aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--arch/arm/configs/iop13xx_defconfig306
-rw-r--r--arch/arm/configs/iop32x_defconfig382
-rw-r--r--arch/arm/configs/iop33x_defconfig313
-rw-r--r--arch/arm/configs/rpc_defconfig791
-rw-r--r--arch/arm/mach-at91/at91sam9261_devices.c2
-rw-r--r--arch/arm/mach-at91/at91sam9263_devices.c2
-rw-r--r--arch/powerpc/kernel/entry_64.S3
-rw-r--r--arch/powerpc/kernel/pci_32.c5
-rw-r--r--arch/powerpc/kernel/smp.c9
-rw-r--r--arch/powerpc/mm/hash_low_64.S6
-rw-r--r--arch/powerpc/mm/hash_utils_64.c2
-rw-r--r--arch/powerpc/mm/numa.c4
-rw-r--r--arch/powerpc/mm/slb.c28
-rw-r--r--arch/powerpc/platforms/cell/spufs/sched.c3
-rw-r--r--arch/powerpc/platforms/powermac/feature.c6
-rw-r--r--arch/powerpc/platforms/ps3/setup.c2
-rw-r--r--arch/sh/boards/renesas/rts7751r2d/setup.c9
-rw-r--r--arch/sh/configs/hs7751rvoip_defconfig2
-rw-r--r--arch/sh/configs/landisk_defconfig2
-rw-r--r--arch/sh/configs/lboxre2_defconfig2
-rw-r--r--arch/sh/configs/rts7751r2d_defconfig8
-rw-r--r--arch/sh/configs/snapgear_defconfig587
-rw-r--r--arch/sh/configs/systemh_defconfig2
-rw-r--r--arch/sh/configs/titan_defconfig2
-rw-r--r--arch/sh/kernel/cpu/sh3/entry.S3
-rw-r--r--arch/sh/kernel/traps.c5
-rw-r--r--arch/sh/mm/Makefile4
-rw-r--r--arch/sh/mm/fault-nommu.c47
-rw-r--r--arch/sh/mm/fault.c3
-rw-r--r--arch/sparc/kernel/entry.S7
-rw-r--r--arch/sparc/kernel/irq.c84
-rw-r--r--arch/sparc/kernel/sparc_ksyms.c1
-rw-r--r--block/bsg.c10
-rw-r--r--crypto/ablkcipher.c2
-rw-r--r--crypto/blkcipher.c2
-rw-r--r--crypto/cipher.c2
-rw-r--r--crypto/hash.c2
-rw-r--r--drivers/ata/pata_icside.c28
-rw-r--r--drivers/char/drm/i915_dma.c14
-rw-r--r--drivers/char/drm/i915_drv.h1
-rw-r--r--drivers/firewire/fw-ohci.c20
-rw-r--r--drivers/firewire/fw-sbp2.c5
-rw-r--r--drivers/firewire/fw-transaction.c4
-rw-r--r--drivers/firewire/fw-transaction.h2
-rw-r--r--drivers/ieee1394/Kconfig2
-rw-r--r--drivers/ieee1394/sbp2.c5
-rw-r--r--drivers/kvm/x86_emulate.c2
-rw-r--r--drivers/lguest/Kconfig2
-rw-r--r--drivers/message/fusion/mptbase.c17
-rw-r--r--drivers/message/fusion/mptsas.c126
-rw-r--r--drivers/mtd/Makefile2
-rw-r--r--drivers/mtd/mtdpart.c4
-rw-r--r--drivers/net/atl1/atl1_main.c4
-rw-r--r--drivers/net/bnx2.c12
-rw-r--r--drivers/net/s2io.c9
-rw-r--r--drivers/net/sis190.c3
-rw-r--r--drivers/net/smc91x.h4
-rw-r--r--drivers/net/tg3.c17
-rw-r--r--drivers/power/Kconfig2
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c5
-rw-r--r--drivers/s390/scsi/zfcp_qdio.c41
-rw-r--r--drivers/scsi/aacraid/linit.c4
-rw-r--r--drivers/scsi/aha152x.c169
-rw-r--r--drivers/scsi/aha152x.h2
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_core.c22
-rw-r--r--drivers/scsi/dpt_i2o.c132
-rw-r--r--drivers/scsi/dpti.h9
-rw-r--r--drivers/scsi/esp_scsi.h2
-rw-r--r--drivers/scsi/gdth.c48
-rw-r--r--drivers/scsi/gdth.h6
-rw-r--r--drivers/scsi/hosts.c2
-rw-r--r--drivers/scsi/ibmvscsi/ibmvscsi.c39
-rw-r--r--drivers/scsi/libsas/Kconfig3
-rw-r--r--drivers/scsi/lpfc/lpfc.h72
-rw-r--r--drivers/scsi/lpfc/lpfc_attr.c423
-rw-r--r--drivers/scsi/lpfc/lpfc_crtn.h28
-rw-r--r--drivers/scsi/lpfc/lpfc_ct.c243
-rw-r--r--drivers/scsi/lpfc/lpfc_debugfs.c595
-rw-r--r--drivers/scsi/lpfc/lpfc_debugfs.h2
-rw-r--r--drivers/scsi/lpfc/lpfc_els.c679
-rw-r--r--drivers/scsi/lpfc/lpfc_hbadisc.c539
-rw-r--r--drivers/scsi/lpfc/lpfc_hw.h14
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c284
-rw-r--r--drivers/scsi/lpfc/lpfc_logmsg.h10
-rw-r--r--drivers/scsi/lpfc/lpfc_mbox.c20
-rw-r--r--drivers/scsi/lpfc/lpfc_mem.c32
-rw-r--r--drivers/scsi/lpfc/lpfc_nportdisc.c162
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c413
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c423
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.h10
-rw-r--r--drivers/scsi/lpfc/lpfc_version.h4
-rw-r--r--drivers/scsi/lpfc/lpfc_vport.c164
-rw-r--r--drivers/scsi/lpfc/lpfc_vport.h2
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c14
-rw-r--r--drivers/scsi/qlogicpti.c50
-rw-r--r--drivers/scsi/scsi_lib.c17
-rw-r--r--drivers/scsi/sd.c14
-rw-r--r--drivers/scsi/st.c16
-rw-r--r--drivers/scsi/st.h3
-rw-r--r--drivers/serial/8250.c2
-rw-r--r--drivers/serial/8250_early.c2
-rw-r--r--drivers/video/cg6.c5
-rw-r--r--include/asm-arm/pgtable-nommu.h1
-rw-r--r--include/asm-powerpc/mmu-hash64.h1
-rw-r--r--include/asm-powerpc/pgtable-64k.h8
-rw-r--r--include/asm-sh/rts7751r2d.h2
-rw-r--r--include/asm-sparc/fcntl.h1
-rw-r--r--include/asm-sparc/floppy.h20
-rw-r--r--include/asm-sparc/irq.h7
-rw-r--r--include/asm-sparc64/dma-mapping.h19
-rw-r--r--include/asm-sparc64/fcntl.h2
-rw-r--r--include/linux/bsg.h13
-rw-r--r--include/linux/netfilter/Kbuild1
-rw-r--r--include/net/sctp/sctp.h10
-rw-r--r--include/net/tcp.h2
-rw-r--r--include/scsi/scsi_driver.h2
-rw-r--r--include/scsi/sd.h2
-rw-r--r--kernel/exit.c8
-rw-r--r--kernel/printk.c2
-rw-r--r--kernel/sched_debug.c12
-rw-r--r--kernel/signal.c4
-rw-r--r--net/ipv4/af_inet.c2
-rw-r--r--net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c5
-rw-r--r--net/ipv4/raw.c4
-rw-r--r--net/ipv4/route.c4
-rw-r--r--net/ipv4/tcp.c3
-rw-r--r--net/ipv4/tcp_input.c37
-rw-r--r--net/ipv4/tcp_ipv4.c1
-rw-r--r--net/ipv6/af_inet6.c2
-rw-r--r--net/ipv6/tcp_ipv6.c1
-rw-r--r--net/key/af_key.c3
-rw-r--r--net/netfilter/nf_conntrack_expect.c5
-rw-r--r--net/sctp/input.c2
-rw-r--r--net/sctp/ipv6.c2
-rw-r--r--net/sctp/sm_make_chunk.c6
-rw-r--r--net/sctp/sm_statefuns.c103
-rw-r--r--net/sctp/socket.c45
-rw-r--r--net/sctp/tsnmap.c14
-rw-r--r--net/tipc/link.c2
-rw-r--r--net/tipc/name_table.c2
-rw-r--r--net/tipc/node.c2
-rw-r--r--net/wanrouter/wanmain.c1
-rw-r--r--sound/sparc/cs4231.c42
144 files changed, 4407 insertions, 3661 deletions
diff --git a/Makefile b/Makefile
index dfe3d1610a7b..91759a60d2a3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
1VERSION = 2 1VERSION = 2
2PATCHLEVEL = 6 2PATCHLEVEL = 6
3SUBLEVEL = 23 3SUBLEVEL = 23
4EXTRAVERSION =-rc1 4EXTRAVERSION =-rc2
5NAME = Holy Dancing Manatees, Batman! 5NAME = Holy Dancing Manatees, Batman!
6 6
7# *DOCUMENTATION* 7# *DOCUMENTATION*
diff --git a/arch/arm/configs/iop13xx_defconfig b/arch/arm/configs/iop13xx_defconfig
index 43c4a37e9247..add03c9e5553 100644
--- a/arch/arm/configs/iop13xx_defconfig
+++ b/arch/arm/configs/iop13xx_defconfig
@@ -1,12 +1,18 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.20-rc1-git5 3# Linux kernel version: 2.6.22
4# Tue Dec 19 21:38:01 2006 4# Thu Jul 19 15:57:52 2007
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8# CONFIG_GENERIC_GPIO is not set
7# CONFIG_GENERIC_TIME is not set 9# CONFIG_GENERIC_TIME is not set
10# CONFIG_GENERIC_CLOCKEVENTS is not set
8CONFIG_MMU=y 11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
9CONFIG_GENERIC_HARDIRQS=y 13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_LOCKDEP_SUPPORT=y
10CONFIG_TRACE_IRQFLAGS_SUPPORT=y 16CONFIG_TRACE_IRQFLAGS_SUPPORT=y
11CONFIG_HARDIRQS_SW_RESEND=y 17CONFIG_HARDIRQS_SW_RESEND=y
12CONFIG_GENERIC_IRQ_PROBE=y 18CONFIG_GENERIC_IRQ_PROBE=y
@@ -15,6 +21,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
15# CONFIG_ARCH_HAS_ILOG2_U64 is not set 21# CONFIG_ARCH_HAS_ILOG2_U64 is not set
16CONFIG_GENERIC_HWEIGHT=y 22CONFIG_GENERIC_HWEIGHT=y
17CONFIG_GENERIC_CALIBRATE_DELAY=y 23CONFIG_GENERIC_CALIBRATE_DELAY=y
24CONFIG_ZONE_DMA=y
18CONFIG_VECTORS_BASE=0xffff0000 25CONFIG_VECTORS_BASE=0xffff0000
19CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 26CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
20 27
@@ -32,17 +39,19 @@ CONFIG_LOCALVERSION=""
32# CONFIG_LOCALVERSION_AUTO is not set 39# CONFIG_LOCALVERSION_AUTO is not set
33CONFIG_SWAP=y 40CONFIG_SWAP=y
34CONFIG_SYSVIPC=y 41CONFIG_SYSVIPC=y
35# CONFIG_IPC_NS is not set 42CONFIG_SYSVIPC_SYSCTL=y
36CONFIG_POSIX_MQUEUE=y 43CONFIG_POSIX_MQUEUE=y
37CONFIG_BSD_PROCESS_ACCT=y 44CONFIG_BSD_PROCESS_ACCT=y
38# CONFIG_BSD_PROCESS_ACCT_V3 is not set 45# CONFIG_BSD_PROCESS_ACCT_V3 is not set
39# CONFIG_TASKSTATS is not set 46# CONFIG_TASKSTATS is not set
40# CONFIG_UTS_NS is not set 47# CONFIG_USER_NS is not set
41# CONFIG_AUDIT is not set 48# CONFIG_AUDIT is not set
42CONFIG_IKCONFIG=y 49CONFIG_IKCONFIG=y
43CONFIG_IKCONFIG_PROC=y 50CONFIG_IKCONFIG_PROC=y
51CONFIG_LOG_BUF_SHIFT=14
44CONFIG_SYSFS_DEPRECATED=y 52CONFIG_SYSFS_DEPRECATED=y
45# CONFIG_RELAY is not set 53# CONFIG_RELAY is not set
54CONFIG_BLK_DEV_INITRD=y
46CONFIG_INITRAMFS_SOURCE="" 55CONFIG_INITRAMFS_SOURCE=""
47# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 56# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
48CONFIG_SYSCTL=y 57CONFIG_SYSCTL=y
@@ -57,32 +66,30 @@ CONFIG_BUG=y
57CONFIG_ELF_CORE=y 66CONFIG_ELF_CORE=y
58CONFIG_BASE_FULL=y 67CONFIG_BASE_FULL=y
59CONFIG_FUTEX=y 68CONFIG_FUTEX=y
69CONFIG_ANON_INODES=y
60CONFIG_EPOLL=y 70CONFIG_EPOLL=y
71CONFIG_SIGNALFD=y
72CONFIG_TIMERFD=y
73CONFIG_EVENTFD=y
61CONFIG_SHMEM=y 74CONFIG_SHMEM=y
62CONFIG_SLAB=y
63CONFIG_VM_EVENT_COUNTERS=y 75CONFIG_VM_EVENT_COUNTERS=y
76CONFIG_SLAB=y
77# CONFIG_SLUB is not set
78# CONFIG_SLOB is not set
64CONFIG_RT_MUTEXES=y 79CONFIG_RT_MUTEXES=y
65# CONFIG_TINY_SHMEM is not set 80# CONFIG_TINY_SHMEM is not set
66CONFIG_BASE_SMALL=0 81CONFIG_BASE_SMALL=0
67# CONFIG_SLOB is not set
68
69#
70# Loadable module support
71#
72CONFIG_MODULES=y 82CONFIG_MODULES=y
73CONFIG_MODULE_UNLOAD=y 83CONFIG_MODULE_UNLOAD=y
74# CONFIG_MODULE_FORCE_UNLOAD is not set 84# CONFIG_MODULE_FORCE_UNLOAD is not set
75CONFIG_MODVERSIONS=y 85CONFIG_MODVERSIONS=y
76# CONFIG_MODULE_SRCVERSION_ALL is not set 86# CONFIG_MODULE_SRCVERSION_ALL is not set
77CONFIG_KMOD=y 87CONFIG_KMOD=y
78
79#
80# Block layer
81#
82CONFIG_BLOCK=y 88CONFIG_BLOCK=y
83# CONFIG_LBD is not set 89# CONFIG_LBD is not set
84# CONFIG_BLK_DEV_IO_TRACE is not set 90# CONFIG_BLK_DEV_IO_TRACE is not set
85# CONFIG_LSF is not set 91# CONFIG_LSF is not set
92# CONFIG_BLK_DEV_BSG is not set
86 93
87# 94#
88# IO Schedulers 95# IO Schedulers
@@ -114,13 +121,15 @@ CONFIG_DEFAULT_IOSCHED="deadline"
114# CONFIG_ARCH_NETX is not set 121# CONFIG_ARCH_NETX is not set
115# CONFIG_ARCH_H720X is not set 122# CONFIG_ARCH_H720X is not set
116# CONFIG_ARCH_IMX is not set 123# CONFIG_ARCH_IMX is not set
124CONFIG_ARCH_IOP13XX=y
117# CONFIG_ARCH_IOP32X is not set 125# CONFIG_ARCH_IOP32X is not set
118# CONFIG_ARCH_IOP33X is not set 126# CONFIG_ARCH_IOP33X is not set
119CONFIG_ARCH_IOP13XX=y
120# CONFIG_ARCH_IXP4XX is not set
121# CONFIG_ARCH_IXP2000 is not set
122# CONFIG_ARCH_IXP23XX is not set 127# CONFIG_ARCH_IXP23XX is not set
128# CONFIG_ARCH_IXP2000 is not set
129# CONFIG_ARCH_IXP4XX is not set
123# CONFIG_ARCH_L7200 is not set 130# CONFIG_ARCH_L7200 is not set
131# CONFIG_ARCH_KS8695 is not set
132# CONFIG_ARCH_NS9XXX is not set
124# CONFIG_ARCH_PNX4008 is not set 133# CONFIG_ARCH_PNX4008 is not set
125# CONFIG_ARCH_PXA is not set 134# CONFIG_ARCH_PXA is not set
126# CONFIG_ARCH_RPC is not set 135# CONFIG_ARCH_RPC is not set
@@ -128,6 +137,7 @@ CONFIG_ARCH_IOP13XX=y
128# CONFIG_ARCH_S3C2410 is not set 137# CONFIG_ARCH_S3C2410 is not set
129# CONFIG_ARCH_SHARK is not set 138# CONFIG_ARCH_SHARK is not set
130# CONFIG_ARCH_LH7A40X is not set 139# CONFIG_ARCH_LH7A40X is not set
140# CONFIG_ARCH_DAVINCI is not set
131# CONFIG_ARCH_OMAP is not set 141# CONFIG_ARCH_OMAP is not set
132 142
133# 143#
@@ -141,6 +151,12 @@ CONFIG_MACH_IQ81340SC=y
141CONFIG_MACH_IQ81340MC=y 151CONFIG_MACH_IQ81340MC=y
142 152
143# 153#
154# IOP13XX IMU Support
155#
156# CONFIG_IOP_IMU is not set
157CONFIG_PLAT_IOP=y
158
159#
144# Processor Type 160# Processor Type
145# 161#
146CONFIG_CPU_32=y 162CONFIG_CPU_32=y
@@ -159,13 +175,16 @@ CONFIG_IO_36=y
159CONFIG_ARM_THUMB=y 175CONFIG_ARM_THUMB=y
160# CONFIG_CPU_DCACHE_DISABLE is not set 176# CONFIG_CPU_DCACHE_DISABLE is not set
161# CONFIG_CPU_BPREDICT_DISABLE is not set 177# CONFIG_CPU_BPREDICT_DISABLE is not set
178# CONFIG_OUTER_CACHE is not set
162# CONFIG_IWMMXT is not set 179# CONFIG_IWMMXT is not set
163 180
164# 181#
165# Bus support 182# Bus support
166# 183#
167CONFIG_PCI=y 184CONFIG_PCI=y
168# CONFIG_PCI_MULTITHREAD_PROBE is not set 185CONFIG_PCI_SYSCALL=y
186CONFIG_ARCH_SUPPORTS_MSI=y
187# CONFIG_PCI_MSI is not set
169 188
170# 189#
171# PCCARD (PCMCIA/CardBus) support 190# PCCARD (PCMCIA/CardBus) support
@@ -175,6 +194,7 @@ CONFIG_PCI=y
175# 194#
176# Kernel Features 195# Kernel Features
177# 196#
197# CONFIG_TICK_ONESHOT is not set
178# CONFIG_PREEMPT is not set 198# CONFIG_PREEMPT is not set
179# CONFIG_NO_IDLE_HZ is not set 199# CONFIG_NO_IDLE_HZ is not set
180CONFIG_HZ=100 200CONFIG_HZ=100
@@ -189,6 +209,9 @@ CONFIG_FLAT_NODE_MEM_MAP=y
189# CONFIG_SPARSEMEM_STATIC is not set 209# CONFIG_SPARSEMEM_STATIC is not set
190CONFIG_SPLIT_PTLOCK_CPUS=4096 210CONFIG_SPLIT_PTLOCK_CPUS=4096
191# CONFIG_RESOURCES_64BIT is not set 211# CONFIG_RESOURCES_64BIT is not set
212CONFIG_ZONE_DMA_FLAG=1
213CONFIG_BOUNCE=y
214CONFIG_VIRT_TO_BUS=y
192CONFIG_ALIGNMENT_TRAP=y 215CONFIG_ALIGNMENT_TRAP=y
193 216
194# 217#
@@ -198,6 +221,7 @@ CONFIG_ZBOOT_ROM_TEXT=0x0
198CONFIG_ZBOOT_ROM_BSS=0x0 221CONFIG_ZBOOT_ROM_BSS=0x0
199CONFIG_CMDLINE="ip=bootp root=nfs console=ttyS0,115200 nfsroot=,tcp,v3,wsize=8192,rsize=8192" 222CONFIG_CMDLINE="ip=bootp root=nfs console=ttyS0,115200 nfsroot=,tcp,v3,wsize=8192,rsize=8192"
200# CONFIG_XIP_KERNEL is not set 223# CONFIG_XIP_KERNEL is not set
224# CONFIG_KEXEC is not set
201 225
202# 226#
203# Floating point emulation 227# Floating point emulation
@@ -222,7 +246,6 @@ CONFIG_BINFMT_AOUT=y
222# Power management options 246# Power management options
223# 247#
224# CONFIG_PM is not set 248# CONFIG_PM is not set
225# CONFIG_APM is not set
226 249
227# 250#
228# Networking 251# Networking
@@ -232,14 +255,15 @@ CONFIG_NET=y
232# 255#
233# Networking options 256# Networking options
234# 257#
235# CONFIG_NETDEBUG is not set
236CONFIG_PACKET=y 258CONFIG_PACKET=y
237CONFIG_PACKET_MMAP=y 259CONFIG_PACKET_MMAP=y
238CONFIG_UNIX=y 260CONFIG_UNIX=y
239CONFIG_XFRM=y 261CONFIG_XFRM=y
240# CONFIG_XFRM_USER is not set 262# CONFIG_XFRM_USER is not set
241# CONFIG_XFRM_SUB_POLICY is not set 263# CONFIG_XFRM_SUB_POLICY is not set
264# CONFIG_XFRM_MIGRATE is not set
242CONFIG_NET_KEY=y 265CONFIG_NET_KEY=y
266# CONFIG_NET_KEY_MIGRATE is not set
243CONFIG_INET=y 267CONFIG_INET=y
244CONFIG_IP_MULTICAST=y 268CONFIG_IP_MULTICAST=y
245# CONFIG_IP_ADVANCED_ROUTER is not set 269# CONFIG_IP_ADVANCED_ROUTER is not set
@@ -270,6 +294,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
270CONFIG_IPV6=y 294CONFIG_IPV6=y
271# CONFIG_IPV6_PRIVACY is not set 295# CONFIG_IPV6_PRIVACY is not set
272# CONFIG_IPV6_ROUTER_PREF is not set 296# CONFIG_IPV6_ROUTER_PREF is not set
297# CONFIG_IPV6_OPTIMISTIC_DAD is not set
273# CONFIG_INET6_AH is not set 298# CONFIG_INET6_AH is not set
274# CONFIG_INET6_ESP is not set 299# CONFIG_INET6_ESP is not set
275# CONFIG_INET6_IPCOMP is not set 300# CONFIG_INET6_IPCOMP is not set
@@ -285,20 +310,8 @@ CONFIG_IPV6=y
285# CONFIG_IPV6_MULTIPLE_TABLES is not set 310# CONFIG_IPV6_MULTIPLE_TABLES is not set
286# CONFIG_NETWORK_SECMARK is not set 311# CONFIG_NETWORK_SECMARK is not set
287# CONFIG_NETFILTER is not set 312# CONFIG_NETFILTER is not set
288
289#
290# DCCP Configuration (EXPERIMENTAL)
291#
292# CONFIG_IP_DCCP is not set 313# CONFIG_IP_DCCP is not set
293
294#
295# SCTP Configuration (EXPERIMENTAL)
296#
297# CONFIG_IP_SCTP is not set 314# CONFIG_IP_SCTP is not set
298
299#
300# TIPC Configuration (EXPERIMENTAL)
301#
302# CONFIG_TIPC is not set 315# CONFIG_TIPC is not set
303# CONFIG_ATM is not set 316# CONFIG_ATM is not set
304# CONFIG_BRIDGE is not set 317# CONFIG_BRIDGE is not set
@@ -324,7 +337,17 @@ CONFIG_IPV6=y
324# CONFIG_HAMRADIO is not set 337# CONFIG_HAMRADIO is not set
325# CONFIG_IRDA is not set 338# CONFIG_IRDA is not set
326# CONFIG_BT is not set 339# CONFIG_BT is not set
340# CONFIG_AF_RXRPC is not set
341
342#
343# Wireless
344#
345# CONFIG_CFG80211 is not set
346# CONFIG_WIRELESS_EXT is not set
347# CONFIG_MAC80211 is not set
327# CONFIG_IEEE80211 is not set 348# CONFIG_IEEE80211 is not set
349# CONFIG_RFKILL is not set
350# CONFIG_NET_9P is not set
328 351
329# 352#
330# Device Drivers 353# Device Drivers
@@ -337,15 +360,7 @@ CONFIG_STANDALONE=y
337CONFIG_PREVENT_FIRMWARE_BUILD=y 360CONFIG_PREVENT_FIRMWARE_BUILD=y
338# CONFIG_FW_LOADER is not set 361# CONFIG_FW_LOADER is not set
339# CONFIG_SYS_HYPERVISOR is not set 362# CONFIG_SYS_HYPERVISOR is not set
340
341#
342# Connector - unified userspace <-> kernelspace linker
343#
344# CONFIG_CONNECTOR is not set 363# CONFIG_CONNECTOR is not set
345
346#
347# Memory Technology Devices (MTD)
348#
349CONFIG_MTD=y 364CONFIG_MTD=y
350# CONFIG_MTD_DEBUG is not set 365# CONFIG_MTD_DEBUG is not set
351# CONFIG_MTD_CONCAT is not set 366# CONFIG_MTD_CONCAT is not set
@@ -361,6 +376,7 @@ CONFIG_MTD_REDBOOT_PARTS_READONLY=y
361# User Modules And Translation Layers 376# User Modules And Translation Layers
362# 377#
363# CONFIG_MTD_CHAR is not set 378# CONFIG_MTD_CHAR is not set
379CONFIG_MTD_BLKDEVS=y
364CONFIG_MTD_BLOCK=y 380CONFIG_MTD_BLOCK=y
365# CONFIG_FTL is not set 381# CONFIG_FTL is not set
366# CONFIG_NFTL is not set 382# CONFIG_NFTL is not set
@@ -397,7 +413,6 @@ CONFIG_MTD_CFI_UTIL=y
397# CONFIG_MTD_RAM is not set 413# CONFIG_MTD_RAM is not set
398# CONFIG_MTD_ROM is not set 414# CONFIG_MTD_ROM is not set
399# CONFIG_MTD_ABSENT is not set 415# CONFIG_MTD_ABSENT is not set
400# CONFIG_MTD_OBSOLETE_CHIPS is not set
401 416
402# 417#
403# Mapping drivers for chip access 418# Mapping drivers for chip access
@@ -425,42 +440,27 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=2
425# CONFIG_MTD_DOC2000 is not set 440# CONFIG_MTD_DOC2000 is not set
426# CONFIG_MTD_DOC2001 is not set 441# CONFIG_MTD_DOC2001 is not set
427# CONFIG_MTD_DOC2001PLUS is not set 442# CONFIG_MTD_DOC2001PLUS is not set
428
429#
430# NAND Flash Device Drivers
431#
432# CONFIG_MTD_NAND is not set 443# CONFIG_MTD_NAND is not set
433
434#
435# OneNAND Flash Device Drivers
436#
437# CONFIG_MTD_ONENAND is not set 444# CONFIG_MTD_ONENAND is not set
438 445
439# 446#
440# Parallel port support 447# UBI - Unsorted block images
441# 448#
449# CONFIG_MTD_UBI is not set
442# CONFIG_PARPORT is not set 450# CONFIG_PARPORT is not set
443 451CONFIG_BLK_DEV=y
444#
445# Plug and Play support
446#
447
448#
449# Block devices
450#
451# CONFIG_BLK_CPQ_DA is not set 452# CONFIG_BLK_CPQ_DA is not set
452# CONFIG_BLK_CPQ_CISS_DA is not set 453# CONFIG_BLK_CPQ_CISS_DA is not set
453# CONFIG_BLK_DEV_DAC960 is not set 454# CONFIG_BLK_DEV_DAC960 is not set
454# CONFIG_BLK_DEV_UMEM is not set 455# CONFIG_BLK_DEV_UMEM is not set
455# CONFIG_BLK_DEV_COW_COMMON is not set 456# CONFIG_BLK_DEV_COW_COMMON is not set
456# CONFIG_BLK_DEV_LOOP is not set 457# CONFIG_BLK_DEV_LOOP is not set
457CONFIG_BLK_DEV_NBD=y 458# CONFIG_BLK_DEV_NBD is not set
458# CONFIG_BLK_DEV_SX8 is not set 459# CONFIG_BLK_DEV_SX8 is not set
459CONFIG_BLK_DEV_RAM=y 460CONFIG_BLK_DEV_RAM=y
460CONFIG_BLK_DEV_RAM_COUNT=2 461CONFIG_BLK_DEV_RAM_COUNT=2
461CONFIG_BLK_DEV_RAM_SIZE=8192 462CONFIG_BLK_DEV_RAM_SIZE=8192
462CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 463CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
463CONFIG_BLK_DEV_INITRD=y
464# CONFIG_CDROM_PKTCDVD is not set 464# CONFIG_CDROM_PKTCDVD is not set
465# CONFIG_ATA_OVER_ETH is not set 465# CONFIG_ATA_OVER_ETH is not set
466 466
@@ -469,6 +469,7 @@ CONFIG_BLK_DEV_INITRD=y
469# 469#
470# CONFIG_RAID_ATTRS is not set 470# CONFIG_RAID_ATTRS is not set
471CONFIG_SCSI=y 471CONFIG_SCSI=y
472CONFIG_SCSI_DMA=y
472# CONFIG_SCSI_TGT is not set 473# CONFIG_SCSI_TGT is not set
473# CONFIG_SCSI_NETLINK is not set 474# CONFIG_SCSI_NETLINK is not set
474CONFIG_SCSI_PROC_FS=y 475CONFIG_SCSI_PROC_FS=y
@@ -490,6 +491,7 @@ CONFIG_CHR_DEV_SG=y
490CONFIG_SCSI_CONSTANTS=y 491CONFIG_SCSI_CONSTANTS=y
491# CONFIG_SCSI_LOGGING is not set 492# CONFIG_SCSI_LOGGING is not set
492# CONFIG_SCSI_SCAN_ASYNC is not set 493# CONFIG_SCSI_SCAN_ASYNC is not set
494CONFIG_SCSI_WAIT_SCAN=m
493 495
494# 496#
495# SCSI Transports 497# SCSI Transports
@@ -534,15 +536,7 @@ CONFIG_SCSI_SAS_ATTRS=y
534# CONFIG_SCSI_NSP32 is not set 536# CONFIG_SCSI_NSP32 is not set
535# CONFIG_SCSI_DEBUG is not set 537# CONFIG_SCSI_DEBUG is not set
536# CONFIG_SCSI_SRP is not set 538# CONFIG_SCSI_SRP is not set
537
538#
539# Serial ATA (prod) and Parallel ATA (experimental) drivers
540#
541# CONFIG_ATA is not set 539# CONFIG_ATA is not set
542
543#
544# Multi-device support (RAID and LVM)
545#
546CONFIG_MD=y 540CONFIG_MD=y
547CONFIG_BLK_DEV_MD=y 541CONFIG_BLK_DEV_MD=y
548# CONFIG_MD_LINEAR is not set 542# CONFIG_MD_LINEAR is not set
@@ -560,6 +554,7 @@ CONFIG_BLK_DEV_DM=y
560# CONFIG_DM_MIRROR is not set 554# CONFIG_DM_MIRROR is not set
561# CONFIG_DM_ZERO is not set 555# CONFIG_DM_ZERO is not set
562# CONFIG_DM_MULTIPATH is not set 556# CONFIG_DM_MULTIPATH is not set
557# CONFIG_DM_DELAY is not set
563 558
564# 559#
565# Fusion MPT device support 560# Fusion MPT device support
@@ -572,39 +567,19 @@ CONFIG_BLK_DEV_DM=y
572# 567#
573# IEEE 1394 (FireWire) support 568# IEEE 1394 (FireWire) support
574# 569#
570# CONFIG_FIREWIRE is not set
575# CONFIG_IEEE1394 is not set 571# CONFIG_IEEE1394 is not set
576
577#
578# I2O device support
579#
580# CONFIG_I2O is not set 572# CONFIG_I2O is not set
581
582#
583# Network device support
584#
585CONFIG_NETDEVICES=y 573CONFIG_NETDEVICES=y
574# CONFIG_NETDEVICES_MULTIQUEUE is not set
586# CONFIG_DUMMY is not set 575# CONFIG_DUMMY is not set
587# CONFIG_BONDING is not set 576# CONFIG_BONDING is not set
577# CONFIG_MACVLAN is not set
588# CONFIG_EQUALIZER is not set 578# CONFIG_EQUALIZER is not set
589# CONFIG_TUN is not set 579# CONFIG_TUN is not set
590
591#
592# ARCnet devices
593#
594# CONFIG_ARCNET is not set 580# CONFIG_ARCNET is not set
595
596#
597# PHY device support
598#
599
600#
601# Ethernet (10 or 100Mbit)
602#
603# CONFIG_NET_ETHERNET is not set 581# CONFIG_NET_ETHERNET is not set
604 582CONFIG_NETDEV_1000=y
605#
606# Ethernet (1000 Mbit)
607#
608# CONFIG_ACENIC is not set 583# CONFIG_ACENIC is not set
609# CONFIG_DL2K is not set 584# CONFIG_DL2K is not set
610CONFIG_E1000=y 585CONFIG_E1000=y
@@ -617,33 +592,26 @@ CONFIG_E1000_NAPI=y
617# CONFIG_SIS190 is not set 592# CONFIG_SIS190 is not set
618# CONFIG_SKGE is not set 593# CONFIG_SKGE is not set
619# CONFIG_SKY2 is not set 594# CONFIG_SKY2 is not set
620# CONFIG_SK98LIN is not set 595# CONFIG_VIA_VELOCITY is not set
621# CONFIG_TIGON3 is not set 596# CONFIG_TIGON3 is not set
622# CONFIG_BNX2 is not set 597# CONFIG_BNX2 is not set
623# CONFIG_QLA3XXX is not set 598# CONFIG_QLA3XXX is not set
624 599# CONFIG_ATL1 is not set
625# 600CONFIG_NETDEV_10000=y
626# Ethernet (10000 Mbit)
627#
628# CONFIG_CHELSIO_T1 is not set 601# CONFIG_CHELSIO_T1 is not set
602# CONFIG_CHELSIO_T3 is not set
629# CONFIG_IXGB is not set 603# CONFIG_IXGB is not set
630# CONFIG_S2IO is not set 604# CONFIG_S2IO is not set
631# CONFIG_MYRI10GE is not set 605# CONFIG_MYRI10GE is not set
632# CONFIG_NETXEN_NIC is not set 606# CONFIG_NETXEN_NIC is not set
633 607# CONFIG_MLX4_CORE is not set
634#
635# Token Ring devices
636#
637# CONFIG_TR is not set 608# CONFIG_TR is not set
638 609
639# 610#
640# Wireless LAN (non-hamradio) 611# Wireless LAN
641#
642# CONFIG_NET_RADIO is not set
643
644#
645# Wan interfaces
646# 612#
613# CONFIG_WLAN_PRE80211 is not set
614# CONFIG_WLAN_80211 is not set
647# CONFIG_WAN is not set 615# CONFIG_WAN is not set
648# CONFIG_FDDI is not set 616# CONFIG_FDDI is not set
649# CONFIG_HIPPI is not set 617# CONFIG_HIPPI is not set
@@ -654,10 +622,6 @@ CONFIG_E1000_NAPI=y
654# CONFIG_NETCONSOLE is not set 622# CONFIG_NETCONSOLE is not set
655# CONFIG_NETPOLL is not set 623# CONFIG_NETPOLL is not set
656# CONFIG_NET_POLL_CONTROLLER is not set 624# CONFIG_NET_POLL_CONTROLLER is not set
657
658#
659# ISDN subsystem
660#
661# CONFIG_ISDN is not set 625# CONFIG_ISDN is not set
662 626
663# 627#
@@ -665,6 +629,7 @@ CONFIG_E1000_NAPI=y
665# 629#
666CONFIG_INPUT=y 630CONFIG_INPUT=y
667# CONFIG_INPUT_FF_MEMLESS is not set 631# CONFIG_INPUT_FF_MEMLESS is not set
632# CONFIG_INPUT_POLLDEV is not set
668 633
669# 634#
670# Userland interfaces 635# Userland interfaces
@@ -684,6 +649,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
684# CONFIG_INPUT_KEYBOARD is not set 649# CONFIG_INPUT_KEYBOARD is not set
685# CONFIG_INPUT_MOUSE is not set 650# CONFIG_INPUT_MOUSE is not set
686# CONFIG_INPUT_JOYSTICK is not set 651# CONFIG_INPUT_JOYSTICK is not set
652# CONFIG_INPUT_TABLET is not set
687# CONFIG_INPUT_TOUCHSCREEN is not set 653# CONFIG_INPUT_TOUCHSCREEN is not set
688# CONFIG_INPUT_MISC is not set 654# CONFIG_INPUT_MISC is not set
689 655
@@ -721,33 +687,18 @@ CONFIG_SERIAL_CORE_CONSOLE=y
721CONFIG_UNIX98_PTYS=y 687CONFIG_UNIX98_PTYS=y
722CONFIG_LEGACY_PTYS=y 688CONFIG_LEGACY_PTYS=y
723CONFIG_LEGACY_PTY_COUNT=256 689CONFIG_LEGACY_PTY_COUNT=256
724
725#
726# IPMI
727#
728# CONFIG_IPMI_HANDLER is not set 690# CONFIG_IPMI_HANDLER is not set
729
730#
731# Watchdog Cards
732#
733# CONFIG_WATCHDOG is not set 691# CONFIG_WATCHDOG is not set
734CONFIG_HW_RANDOM=y 692CONFIG_HW_RANDOM=y
735# CONFIG_NVRAM is not set 693# CONFIG_NVRAM is not set
736# CONFIG_DTLK is not set
737# CONFIG_R3964 is not set 694# CONFIG_R3964 is not set
738# CONFIG_APPLICOM is not set 695# CONFIG_APPLICOM is not set
739# CONFIG_DRM is not set 696# CONFIG_DRM is not set
740# CONFIG_RAW_DRIVER is not set 697# CONFIG_RAW_DRIVER is not set
741
742#
743# TPM devices
744#
745# CONFIG_TCG_TPM is not set 698# CONFIG_TCG_TPM is not set
746 699CONFIG_DEVPORT=y
747#
748# I2C support
749#
750CONFIG_I2C=y 700CONFIG_I2C=y
701CONFIG_I2C_BOARDINFO=y
751# CONFIG_I2C_CHARDEV is not set 702# CONFIG_I2C_CHARDEV is not set
752 703
753# 704#
@@ -774,25 +725,28 @@ CONFIG_I2C_IOP3XX=y
774# CONFIG_I2C_PARPORT_LIGHT is not set 725# CONFIG_I2C_PARPORT_LIGHT is not set
775# CONFIG_I2C_PROSAVAGE is not set 726# CONFIG_I2C_PROSAVAGE is not set
776# CONFIG_I2C_SAVAGE4 is not set 727# CONFIG_I2C_SAVAGE4 is not set
728# CONFIG_I2C_SIMTEC is not set
777# CONFIG_I2C_SIS5595 is not set 729# CONFIG_I2C_SIS5595 is not set
778# CONFIG_I2C_SIS630 is not set 730# CONFIG_I2C_SIS630 is not set
779# CONFIG_I2C_SIS96X is not set 731# CONFIG_I2C_SIS96X is not set
732# CONFIG_I2C_TAOS_EVM is not set
780# CONFIG_I2C_STUB is not set 733# CONFIG_I2C_STUB is not set
781# CONFIG_I2C_VIA is not set 734# CONFIG_I2C_VIA is not set
782# CONFIG_I2C_VIAPRO is not set 735# CONFIG_I2C_VIAPRO is not set
783# CONFIG_I2C_VOODOO3 is not set 736# CONFIG_I2C_VOODOO3 is not set
784# CONFIG_I2C_PCA_ISA is not set
785 737
786# 738#
787# Miscellaneous I2C Chip support 739# Miscellaneous I2C Chip support
788# 740#
789# CONFIG_SENSORS_DS1337 is not set 741# CONFIG_SENSORS_DS1337 is not set
790# CONFIG_SENSORS_DS1374 is not set 742# CONFIG_SENSORS_DS1374 is not set
743# CONFIG_DS1682 is not set
791# CONFIG_SENSORS_EEPROM is not set 744# CONFIG_SENSORS_EEPROM is not set
792# CONFIG_SENSORS_PCF8574 is not set 745# CONFIG_SENSORS_PCF8574 is not set
793# CONFIG_SENSORS_PCA9539 is not set 746# CONFIG_SENSORS_PCA9539 is not set
794# CONFIG_SENSORS_PCF8591 is not set 747# CONFIG_SENSORS_PCF8591 is not set
795# CONFIG_SENSORS_MAX6875 is not set 748# CONFIG_SENSORS_MAX6875 is not set
749# CONFIG_SENSORS_TSL2550 is not set
796# CONFIG_I2C_DEBUG_CORE is not set 750# CONFIG_I2C_DEBUG_CORE is not set
797# CONFIG_I2C_DEBUG_ALGO is not set 751# CONFIG_I2C_DEBUG_ALGO is not set
798# CONFIG_I2C_DEBUG_BUS is not set 752# CONFIG_I2C_DEBUG_BUS is not set
@@ -803,21 +757,15 @@ CONFIG_I2C_IOP3XX=y
803# 757#
804# CONFIG_SPI is not set 758# CONFIG_SPI is not set
805# CONFIG_SPI_MASTER is not set 759# CONFIG_SPI_MASTER is not set
806
807#
808# Dallas's 1-wire bus
809#
810# CONFIG_W1 is not set 760# CONFIG_W1 is not set
811
812#
813# Hardware Monitoring support
814#
815CONFIG_HWMON=y 761CONFIG_HWMON=y
816# CONFIG_HWMON_VID is not set 762# CONFIG_HWMON_VID is not set
817# CONFIG_SENSORS_ABITUGURU is not set 763# CONFIG_SENSORS_ABITUGURU is not set
764# CONFIG_SENSORS_AD7418 is not set
818# CONFIG_SENSORS_ADM1021 is not set 765# CONFIG_SENSORS_ADM1021 is not set
819# CONFIG_SENSORS_ADM1025 is not set 766# CONFIG_SENSORS_ADM1025 is not set
820# CONFIG_SENSORS_ADM1026 is not set 767# CONFIG_SENSORS_ADM1026 is not set
768# CONFIG_SENSORS_ADM1029 is not set
821# CONFIG_SENSORS_ADM1031 is not set 769# CONFIG_SENSORS_ADM1031 is not set
822# CONFIG_SENSORS_ADM9240 is not set 770# CONFIG_SENSORS_ADM9240 is not set
823# CONFIG_SENSORS_ASB100 is not set 771# CONFIG_SENSORS_ASB100 is not set
@@ -840,6 +788,7 @@ CONFIG_HWMON=y
840# CONFIG_SENSORS_LM90 is not set 788# CONFIG_SENSORS_LM90 is not set
841# CONFIG_SENSORS_LM92 is not set 789# CONFIG_SENSORS_LM92 is not set
842# CONFIG_SENSORS_MAX1619 is not set 790# CONFIG_SENSORS_MAX1619 is not set
791# CONFIG_SENSORS_MAX6650 is not set
843# CONFIG_SENSORS_PC87360 is not set 792# CONFIG_SENSORS_PC87360 is not set
844# CONFIG_SENSORS_PC87427 is not set 793# CONFIG_SENSORS_PC87427 is not set
845# CONFIG_SENSORS_SIS5595 is not set 794# CONFIG_SENSORS_SIS5595 is not set
@@ -857,12 +806,16 @@ CONFIG_HWMON=y
857# CONFIG_SENSORS_W83627HF is not set 806# CONFIG_SENSORS_W83627HF is not set
858# CONFIG_SENSORS_W83627EHF is not set 807# CONFIG_SENSORS_W83627EHF is not set
859# CONFIG_HWMON_DEBUG_CHIP is not set 808# CONFIG_HWMON_DEBUG_CHIP is not set
809CONFIG_MISC_DEVICES=y
810# CONFIG_PHANTOM is not set
811# CONFIG_EEPROM_93CX6 is not set
812# CONFIG_SGI_IOC4 is not set
813# CONFIG_TIFM_CORE is not set
860 814
861# 815#
862# Misc devices 816# Multifunction device drivers
863# 817#
864# CONFIG_SGI_IOC4 is not set 818# CONFIG_MFD_SM501 is not set
865# CONFIG_TIFM_CORE is not set
866 819
867# 820#
868# LED devices 821# LED devices
@@ -881,16 +834,19 @@ CONFIG_HWMON=y
881# Multimedia devices 834# Multimedia devices
882# 835#
883# CONFIG_VIDEO_DEV is not set 836# CONFIG_VIDEO_DEV is not set
837# CONFIG_DVB_CORE is not set
838CONFIG_DAB=y
884 839
885# 840#
886# Digital Video Broadcasting Devices 841# Graphics support
887# 842#
888# CONFIG_DVB is not set 843# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
889 844
890# 845#
891# Graphics support 846# Display device support
892# 847#
893CONFIG_FIRMWARE_EDID=y 848# CONFIG_DISPLAY_SUPPORT is not set
849# CONFIG_VGASTATE is not set
894# CONFIG_FB is not set 850# CONFIG_FB is not set
895 851
896# 852#
@@ -898,21 +854,15 @@ CONFIG_FIRMWARE_EDID=y
898# 854#
899# CONFIG_VGA_CONSOLE is not set 855# CONFIG_VGA_CONSOLE is not set
900CONFIG_DUMMY_CONSOLE=y 856CONFIG_DUMMY_CONSOLE=y
901# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
902 857
903# 858#
904# Sound 859# Sound
905# 860#
906# CONFIG_SOUND is not set 861# CONFIG_SOUND is not set
907 862CONFIG_HID_SUPPORT=y
908#
909# HID Devices
910#
911CONFIG_HID=y 863CONFIG_HID=y
912 864# CONFIG_HID_DEBUG is not set
913# 865CONFIG_USB_SUPPORT=y
914# USB support
915#
916CONFIG_USB_ARCH_HAS_HCD=y 866CONFIG_USB_ARCH_HAS_HCD=y
917CONFIG_USB_ARCH_HAS_OHCI=y 867CONFIG_USB_ARCH_HAS_OHCI=y
918CONFIG_USB_ARCH_HAS_EHCI=y 868CONFIG_USB_ARCH_HAS_EHCI=y
@@ -926,10 +876,6 @@ CONFIG_USB_ARCH_HAS_EHCI=y
926# USB Gadget Support 876# USB Gadget Support
927# 877#
928# CONFIG_USB_GADGET is not set 878# CONFIG_USB_GADGET is not set
929
930#
931# MMC/SD Card support
932#
933# CONFIG_MMC is not set 879# CONFIG_MMC is not set
934 880
935# 881#
@@ -939,6 +885,22 @@ CONFIG_RTC_LIB=y
939# CONFIG_RTC_CLASS is not set 885# CONFIG_RTC_CLASS is not set
940 886
941# 887#
888# DMA Engine support
889#
890CONFIG_DMA_ENGINE=y
891
892#
893# DMA Clients
894#
895# CONFIG_NET_DMA is not set
896
897#
898# DMA Devices
899#
900# CONFIG_INTEL_IOATDMA is not set
901CONFIG_INTEL_IOP_ADMA=y
902
903#
942# File systems 904# File systems
943# 905#
944CONFIG_EXT2_FS=y 906CONFIG_EXT2_FS=y
@@ -1004,7 +966,6 @@ CONFIG_ECRYPT_FS=y
1004# CONFIG_BEFS_FS is not set 966# CONFIG_BEFS_FS is not set
1005# CONFIG_BFS_FS is not set 967# CONFIG_BFS_FS is not set
1006# CONFIG_EFS_FS is not set 968# CONFIG_EFS_FS is not set
1007# CONFIG_JFFS_FS is not set
1008CONFIG_JFFS2_FS=y 969CONFIG_JFFS2_FS=y
1009CONFIG_JFFS2_FS_DEBUG=0 970CONFIG_JFFS2_FS_DEBUG=0
1010CONFIG_JFFS2_FS_WRITEBUFFER=y 971CONFIG_JFFS2_FS_WRITEBUFFER=y
@@ -1014,7 +975,7 @@ CONFIG_JFFS2_FS_WRITEBUFFER=y
1014CONFIG_JFFS2_ZLIB=y 975CONFIG_JFFS2_ZLIB=y
1015CONFIG_JFFS2_RTIME=y 976CONFIG_JFFS2_RTIME=y
1016# CONFIG_JFFS2_RUBIN is not set 977# CONFIG_JFFS2_RUBIN is not set
1017# CONFIG_CRAMFS is not set 978CONFIG_CRAMFS=y
1018# CONFIG_VXFS_FS is not set 979# CONFIG_VXFS_FS is not set
1019# CONFIG_HPFS_FS is not set 980# CONFIG_HPFS_FS is not set
1020# CONFIG_QNX4FS_FS is not set 981# CONFIG_QNX4FS_FS is not set
@@ -1040,6 +1001,7 @@ CONFIG_LOCKD_V4=y
1040CONFIG_EXPORTFS=y 1001CONFIG_EXPORTFS=y
1041CONFIG_NFS_COMMON=y 1002CONFIG_NFS_COMMON=y
1042CONFIG_SUNRPC=y 1003CONFIG_SUNRPC=y
1004# CONFIG_SUNRPC_BIND34 is not set
1043# CONFIG_RPCSEC_GSS_KRB5 is not set 1005# CONFIG_RPCSEC_GSS_KRB5 is not set
1044# CONFIG_RPCSEC_GSS_SPKM3 is not set 1006# CONFIG_RPCSEC_GSS_SPKM3 is not set
1045CONFIG_SMB_FS=m 1007CONFIG_SMB_FS=m
@@ -1053,7 +1015,6 @@ CONFIG_CIFS=m
1053# CONFIG_NCP_FS is not set 1015# CONFIG_NCP_FS is not set
1054# CONFIG_CODA_FS is not set 1016# CONFIG_CODA_FS is not set
1055# CONFIG_AFS_FS is not set 1017# CONFIG_AFS_FS is not set
1056# CONFIG_9P_FS is not set
1057 1018
1058# 1019#
1059# Partition Types 1020# Partition Types
@@ -1075,6 +1036,7 @@ CONFIG_MSDOS_PARTITION=y
1075# CONFIG_SUN_PARTITION is not set 1036# CONFIG_SUN_PARTITION is not set
1076# CONFIG_KARMA_PARTITION is not set 1037# CONFIG_KARMA_PARTITION is not set
1077# CONFIG_EFI_PARTITION is not set 1038# CONFIG_EFI_PARTITION is not set
1039# CONFIG_SYSV68_PARTITION is not set
1078 1040
1079# 1041#
1080# Native Language Support 1042# Native Language Support
@@ -1140,7 +1102,6 @@ CONFIG_ENABLE_MUST_CHECK=y
1140# CONFIG_DEBUG_FS is not set 1102# CONFIG_DEBUG_FS is not set
1141# CONFIG_HEADERS_CHECK is not set 1103# CONFIG_HEADERS_CHECK is not set
1142# CONFIG_DEBUG_KERNEL is not set 1104# CONFIG_DEBUG_KERNEL is not set
1143CONFIG_LOG_BUF_SHIFT=14
1144CONFIG_DEBUG_BUGVERBOSE=y 1105CONFIG_DEBUG_BUGVERBOSE=y
1145CONFIG_FRAME_POINTER=y 1106CONFIG_FRAME_POINTER=y
1146CONFIG_DEBUG_USER=y 1107CONFIG_DEBUG_USER=y
@@ -1151,10 +1112,10 @@ CONFIG_DEBUG_USER=y
1151CONFIG_KEYS=y 1112CONFIG_KEYS=y
1152CONFIG_KEYS_DEBUG_PROC_KEYS=y 1113CONFIG_KEYS_DEBUG_PROC_KEYS=y
1153# CONFIG_SECURITY is not set 1114# CONFIG_SECURITY is not set
1154 1115CONFIG_XOR_BLOCKS=y
1155# 1116CONFIG_ASYNC_CORE=y
1156# Cryptographic options 1117CONFIG_ASYNC_MEMCPY=y
1157# 1118CONFIG_ASYNC_XOR=y
1158CONFIG_CRYPTO=y 1119CONFIG_CRYPTO=y
1159CONFIG_CRYPTO_ALGAPI=y 1120CONFIG_CRYPTO_ALGAPI=y
1160CONFIG_CRYPTO_BLKCIPHER=y 1121CONFIG_CRYPTO_BLKCIPHER=y
@@ -1173,8 +1134,11 @@ CONFIG_CRYPTO_TGR192=y
1173CONFIG_CRYPTO_GF128MUL=y 1134CONFIG_CRYPTO_GF128MUL=y
1174CONFIG_CRYPTO_ECB=y 1135CONFIG_CRYPTO_ECB=y
1175CONFIG_CRYPTO_CBC=y 1136CONFIG_CRYPTO_CBC=y
1137CONFIG_CRYPTO_PCBC=m
1176CONFIG_CRYPTO_LRW=y 1138CONFIG_CRYPTO_LRW=y
1139# CONFIG_CRYPTO_CRYPTD is not set
1177CONFIG_CRYPTO_DES=y 1140CONFIG_CRYPTO_DES=y
1141# CONFIG_CRYPTO_FCRYPT is not set
1178CONFIG_CRYPTO_BLOWFISH=y 1142CONFIG_CRYPTO_BLOWFISH=y
1179CONFIG_CRYPTO_TWOFISH=y 1143CONFIG_CRYPTO_TWOFISH=y
1180CONFIG_CRYPTO_TWOFISH_COMMON=y 1144CONFIG_CRYPTO_TWOFISH_COMMON=y
@@ -1189,11 +1153,9 @@ CONFIG_CRYPTO_ANUBIS=y
1189CONFIG_CRYPTO_DEFLATE=y 1153CONFIG_CRYPTO_DEFLATE=y
1190CONFIG_CRYPTO_MICHAEL_MIC=y 1154CONFIG_CRYPTO_MICHAEL_MIC=y
1191CONFIG_CRYPTO_CRC32C=y 1155CONFIG_CRYPTO_CRC32C=y
1156# CONFIG_CRYPTO_CAMELLIA is not set
1192# CONFIG_CRYPTO_TEST is not set 1157# CONFIG_CRYPTO_TEST is not set
1193 1158CONFIG_CRYPTO_HW=y
1194#
1195# Hardware crypto devices
1196#
1197 1159
1198# 1160#
1199# Library routines 1161# Library routines
@@ -1201,9 +1163,13 @@ CONFIG_CRYPTO_CRC32C=y
1201CONFIG_BITREVERSE=y 1163CONFIG_BITREVERSE=y
1202CONFIG_CRC_CCITT=y 1164CONFIG_CRC_CCITT=y
1203# CONFIG_CRC16 is not set 1165# CONFIG_CRC16 is not set
1166# CONFIG_CRC_ITU_T is not set
1204CONFIG_CRC32=y 1167CONFIG_CRC32=y
1168# CONFIG_CRC7 is not set
1205CONFIG_LIBCRC32C=y 1169CONFIG_LIBCRC32C=y
1206CONFIG_ZLIB_INFLATE=y 1170CONFIG_ZLIB_INFLATE=y
1207CONFIG_ZLIB_DEFLATE=y 1171CONFIG_ZLIB_DEFLATE=y
1208CONFIG_PLIST=y 1172CONFIG_PLIST=y
1209CONFIG_IOMAP_COPY=y 1173CONFIG_HAS_IOMEM=y
1174CONFIG_HAS_IOPORT=y
1175CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/iop32x_defconfig b/arch/arm/configs/iop32x_defconfig
index 7909a555706d..027aef22b4d1 100644
--- a/arch/arm/configs/iop32x_defconfig
+++ b/arch/arm/configs/iop32x_defconfig
@@ -1,12 +1,18 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.20-rc1-git5 3# Linux kernel version: 2.6.22
4# Tue Dec 19 21:37:52 2006 4# Thu Jul 19 16:00:36 2007
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8# CONFIG_GENERIC_GPIO is not set
7# CONFIG_GENERIC_TIME is not set 9# CONFIG_GENERIC_TIME is not set
10# CONFIG_GENERIC_CLOCKEVENTS is not set
8CONFIG_MMU=y 11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
9CONFIG_GENERIC_HARDIRQS=y 13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_LOCKDEP_SUPPORT=y
10CONFIG_TRACE_IRQFLAGS_SUPPORT=y 16CONFIG_TRACE_IRQFLAGS_SUPPORT=y
11CONFIG_HARDIRQS_SW_RESEND=y 17CONFIG_HARDIRQS_SW_RESEND=y
12CONFIG_GENERIC_IRQ_PROBE=y 18CONFIG_GENERIC_IRQ_PROBE=y
@@ -15,6 +21,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
15# CONFIG_ARCH_HAS_ILOG2_U64 is not set 21# CONFIG_ARCH_HAS_ILOG2_U64 is not set
16CONFIG_GENERIC_HWEIGHT=y 22CONFIG_GENERIC_HWEIGHT=y
17CONFIG_GENERIC_CALIBRATE_DELAY=y 23CONFIG_GENERIC_CALIBRATE_DELAY=y
24CONFIG_ZONE_DMA=y
18CONFIG_VECTORS_BASE=0xffff0000 25CONFIG_VECTORS_BASE=0xffff0000
19CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 26CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
20 27
@@ -32,16 +39,18 @@ CONFIG_LOCALVERSION=""
32CONFIG_LOCALVERSION_AUTO=y 39CONFIG_LOCALVERSION_AUTO=y
33CONFIG_SWAP=y 40CONFIG_SWAP=y
34CONFIG_SYSVIPC=y 41CONFIG_SYSVIPC=y
35# CONFIG_IPC_NS is not set 42CONFIG_SYSVIPC_SYSCTL=y
36# CONFIG_POSIX_MQUEUE is not set 43# CONFIG_POSIX_MQUEUE is not set
37CONFIG_BSD_PROCESS_ACCT=y 44CONFIG_BSD_PROCESS_ACCT=y
38# CONFIG_BSD_PROCESS_ACCT_V3 is not set 45# CONFIG_BSD_PROCESS_ACCT_V3 is not set
39# CONFIG_TASKSTATS is not set 46# CONFIG_TASKSTATS is not set
40# CONFIG_UTS_NS is not set 47# CONFIG_USER_NS is not set
41# CONFIG_AUDIT is not set 48# CONFIG_AUDIT is not set
42# CONFIG_IKCONFIG is not set 49# CONFIG_IKCONFIG is not set
50CONFIG_LOG_BUF_SHIFT=14
43CONFIG_SYSFS_DEPRECATED=y 51CONFIG_SYSFS_DEPRECATED=y
44# CONFIG_RELAY is not set 52# CONFIG_RELAY is not set
53CONFIG_BLK_DEV_INITRD=y
45CONFIG_INITRAMFS_SOURCE="" 54CONFIG_INITRAMFS_SOURCE=""
46CONFIG_CC_OPTIMIZE_FOR_SIZE=y 55CONFIG_CC_OPTIMIZE_FOR_SIZE=y
47CONFIG_SYSCTL=y 56CONFIG_SYSCTL=y
@@ -57,32 +66,30 @@ CONFIG_BUG=y
57CONFIG_ELF_CORE=y 66CONFIG_ELF_CORE=y
58CONFIG_BASE_FULL=y 67CONFIG_BASE_FULL=y
59CONFIG_FUTEX=y 68CONFIG_FUTEX=y
69CONFIG_ANON_INODES=y
60CONFIG_EPOLL=y 70CONFIG_EPOLL=y
71CONFIG_SIGNALFD=y
72CONFIG_TIMERFD=y
73CONFIG_EVENTFD=y
61CONFIG_SHMEM=y 74CONFIG_SHMEM=y
62CONFIG_SLAB=y
63CONFIG_VM_EVENT_COUNTERS=y 75CONFIG_VM_EVENT_COUNTERS=y
76CONFIG_SLAB=y
77# CONFIG_SLUB is not set
78# CONFIG_SLOB is not set
64CONFIG_RT_MUTEXES=y 79CONFIG_RT_MUTEXES=y
65# CONFIG_TINY_SHMEM is not set 80# CONFIG_TINY_SHMEM is not set
66CONFIG_BASE_SMALL=0 81CONFIG_BASE_SMALL=0
67# CONFIG_SLOB is not set
68
69#
70# Loadable module support
71#
72CONFIG_MODULES=y 82CONFIG_MODULES=y
73CONFIG_MODULE_UNLOAD=y 83CONFIG_MODULE_UNLOAD=y
74# CONFIG_MODULE_FORCE_UNLOAD is not set 84# CONFIG_MODULE_FORCE_UNLOAD is not set
75# CONFIG_MODVERSIONS is not set 85# CONFIG_MODVERSIONS is not set
76# CONFIG_MODULE_SRCVERSION_ALL is not set 86# CONFIG_MODULE_SRCVERSION_ALL is not set
77CONFIG_KMOD=y 87CONFIG_KMOD=y
78
79#
80# Block layer
81#
82CONFIG_BLOCK=y 88CONFIG_BLOCK=y
83# CONFIG_LBD is not set 89# CONFIG_LBD is not set
84# CONFIG_BLK_DEV_IO_TRACE is not set 90# CONFIG_BLK_DEV_IO_TRACE is not set
85# CONFIG_LSF is not set 91# CONFIG_LSF is not set
92# CONFIG_BLK_DEV_BSG is not set
86 93
87# 94#
88# IO Schedulers 95# IO Schedulers
@@ -114,13 +121,15 @@ CONFIG_DEFAULT_IOSCHED="cfq"
114# CONFIG_ARCH_NETX is not set 121# CONFIG_ARCH_NETX is not set
115# CONFIG_ARCH_H720X is not set 122# CONFIG_ARCH_H720X is not set
116# CONFIG_ARCH_IMX is not set 123# CONFIG_ARCH_IMX is not set
124# CONFIG_ARCH_IOP13XX is not set
117CONFIG_ARCH_IOP32X=y 125CONFIG_ARCH_IOP32X=y
118# CONFIG_ARCH_IOP33X is not set 126# CONFIG_ARCH_IOP33X is not set
119# CONFIG_ARCH_IOP13XX is not set
120# CONFIG_ARCH_IXP4XX is not set
121# CONFIG_ARCH_IXP2000 is not set
122# CONFIG_ARCH_IXP23XX is not set 127# CONFIG_ARCH_IXP23XX is not set
128# CONFIG_ARCH_IXP2000 is not set
129# CONFIG_ARCH_IXP4XX is not set
123# CONFIG_ARCH_L7200 is not set 130# CONFIG_ARCH_L7200 is not set
131# CONFIG_ARCH_KS8695 is not set
132# CONFIG_ARCH_NS9XXX is not set
124# CONFIG_ARCH_PNX4008 is not set 133# CONFIG_ARCH_PNX4008 is not set
125# CONFIG_ARCH_PXA is not set 134# CONFIG_ARCH_PXA is not set
126# CONFIG_ARCH_RPC is not set 135# CONFIG_ARCH_RPC is not set
@@ -128,6 +137,7 @@ CONFIG_ARCH_IOP32X=y
128# CONFIG_ARCH_S3C2410 is not set 137# CONFIG_ARCH_S3C2410 is not set
129# CONFIG_ARCH_SHARK is not set 138# CONFIG_ARCH_SHARK is not set
130# CONFIG_ARCH_LH7A40X is not set 139# CONFIG_ARCH_LH7A40X is not set
140# CONFIG_ARCH_DAVINCI is not set
131# CONFIG_ARCH_OMAP is not set 141# CONFIG_ARCH_OMAP is not set
132 142
133# 143#
@@ -137,10 +147,12 @@ CONFIG_ARCH_IOP32X=y
137# 147#
138# IOP32x Platform Types 148# IOP32x Platform Types
139# 149#
150CONFIG_MACH_EP80219=y
140CONFIG_MACH_GLANTANK=y 151CONFIG_MACH_GLANTANK=y
141CONFIG_ARCH_IQ80321=y 152CONFIG_ARCH_IQ80321=y
142CONFIG_ARCH_IQ31244=y 153CONFIG_ARCH_IQ31244=y
143CONFIG_MACH_N2100=y 154CONFIG_MACH_N2100=y
155CONFIG_IOP3XX_ATU=y
144CONFIG_PLAT_IOP=y 156CONFIG_PLAT_IOP=y
145 157
146# 158#
@@ -160,6 +172,7 @@ CONFIG_CPU_CP15_MMU=y
160# 172#
161# CONFIG_ARM_THUMB is not set 173# CONFIG_ARM_THUMB is not set
162# CONFIG_CPU_DCACHE_DISABLE is not set 174# CONFIG_CPU_DCACHE_DISABLE is not set
175# CONFIG_OUTER_CACHE is not set
163# CONFIG_IWMMXT is not set 176# CONFIG_IWMMXT is not set
164CONFIG_XSCALE_PMU=y 177CONFIG_XSCALE_PMU=y
165 178
@@ -167,7 +180,8 @@ CONFIG_XSCALE_PMU=y
167# Bus support 180# Bus support
168# 181#
169CONFIG_PCI=y 182CONFIG_PCI=y
170# CONFIG_PCI_MULTITHREAD_PROBE is not set 183CONFIG_PCI_SYSCALL=y
184# CONFIG_ARCH_SUPPORTS_MSI is not set
171# CONFIG_PCI_DEBUG is not set 185# CONFIG_PCI_DEBUG is not set
172 186
173# 187#
@@ -178,6 +192,7 @@ CONFIG_PCI=y
178# 192#
179# Kernel Features 193# Kernel Features
180# 194#
195# CONFIG_TICK_ONESHOT is not set
181# CONFIG_PREEMPT is not set 196# CONFIG_PREEMPT is not set
182# CONFIG_NO_IDLE_HZ is not set 197# CONFIG_NO_IDLE_HZ is not set
183CONFIG_HZ=100 198CONFIG_HZ=100
@@ -192,6 +207,9 @@ CONFIG_FLAT_NODE_MEM_MAP=y
192# CONFIG_SPARSEMEM_STATIC is not set 207# CONFIG_SPARSEMEM_STATIC is not set
193CONFIG_SPLIT_PTLOCK_CPUS=4096 208CONFIG_SPLIT_PTLOCK_CPUS=4096
194# CONFIG_RESOURCES_64BIT is not set 209# CONFIG_RESOURCES_64BIT is not set
210CONFIG_ZONE_DMA_FLAG=1
211CONFIG_BOUNCE=y
212CONFIG_VIRT_TO_BUS=y
195CONFIG_ALIGNMENT_TRAP=y 213CONFIG_ALIGNMENT_TRAP=y
196 214
197# 215#
@@ -199,8 +217,9 @@ CONFIG_ALIGNMENT_TRAP=y
199# 217#
200CONFIG_ZBOOT_ROM_TEXT=0x0 218CONFIG_ZBOOT_ROM_TEXT=0x0
201CONFIG_ZBOOT_ROM_BSS=0x0 219CONFIG_ZBOOT_ROM_BSS=0x0
202CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/nfs ip=bootp" 220CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/nfs ip=bootp cachepolicy=writealloc"
203# CONFIG_XIP_KERNEL is not set 221# CONFIG_XIP_KERNEL is not set
222# CONFIG_KEXEC is not set
204 223
205# 224#
206# Floating point emulation 225# Floating point emulation
@@ -225,7 +244,6 @@ CONFIG_BINFMT_AOUT=y
225# Power management options 244# Power management options
226# 245#
227# CONFIG_PM is not set 246# CONFIG_PM is not set
228# CONFIG_APM is not set
229 247
230# 248#
231# Networking 249# Networking
@@ -235,13 +253,13 @@ CONFIG_NET=y
235# 253#
236# Networking options 254# Networking options
237# 255#
238# CONFIG_NETDEBUG is not set
239CONFIG_PACKET=y 256CONFIG_PACKET=y
240CONFIG_PACKET_MMAP=y 257CONFIG_PACKET_MMAP=y
241CONFIG_UNIX=y 258CONFIG_UNIX=y
242CONFIG_XFRM=y 259CONFIG_XFRM=y
243# CONFIG_XFRM_USER is not set 260# CONFIG_XFRM_USER is not set
244# CONFIG_XFRM_SUB_POLICY is not set 261# CONFIG_XFRM_SUB_POLICY is not set
262# CONFIG_XFRM_MIGRATE is not set
245# CONFIG_NET_KEY is not set 263# CONFIG_NET_KEY is not set
246CONFIG_INET=y 264CONFIG_INET=y
247CONFIG_IP_MULTICAST=y 265CONFIG_IP_MULTICAST=y
@@ -273,6 +291,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
273CONFIG_IPV6=y 291CONFIG_IPV6=y
274# CONFIG_IPV6_PRIVACY is not set 292# CONFIG_IPV6_PRIVACY is not set
275# CONFIG_IPV6_ROUTER_PREF is not set 293# CONFIG_IPV6_ROUTER_PREF is not set
294# CONFIG_IPV6_OPTIMISTIC_DAD is not set
276# CONFIG_INET6_AH is not set 295# CONFIG_INET6_AH is not set
277# CONFIG_INET6_ESP is not set 296# CONFIG_INET6_ESP is not set
278# CONFIG_INET6_IPCOMP is not set 297# CONFIG_INET6_IPCOMP is not set
@@ -288,20 +307,8 @@ CONFIG_IPV6=y
288# CONFIG_IPV6_MULTIPLE_TABLES is not set 307# CONFIG_IPV6_MULTIPLE_TABLES is not set
289# CONFIG_NETWORK_SECMARK is not set 308# CONFIG_NETWORK_SECMARK is not set
290# CONFIG_NETFILTER is not set 309# CONFIG_NETFILTER is not set
291
292#
293# DCCP Configuration (EXPERIMENTAL)
294#
295# CONFIG_IP_DCCP is not set 310# CONFIG_IP_DCCP is not set
296
297#
298# SCTP Configuration (EXPERIMENTAL)
299#
300# CONFIG_IP_SCTP is not set 311# CONFIG_IP_SCTP is not set
301
302#
303# TIPC Configuration (EXPERIMENTAL)
304#
305# CONFIG_TIPC is not set 312# CONFIG_TIPC is not set
306# CONFIG_ATM is not set 313# CONFIG_ATM is not set
307# CONFIG_BRIDGE is not set 314# CONFIG_BRIDGE is not set
@@ -327,7 +334,17 @@ CONFIG_IPV6=y
327# CONFIG_HAMRADIO is not set 334# CONFIG_HAMRADIO is not set
328# CONFIG_IRDA is not set 335# CONFIG_IRDA is not set
329# CONFIG_BT is not set 336# CONFIG_BT is not set
337# CONFIG_AF_RXRPC is not set
338
339#
340# Wireless
341#
342# CONFIG_CFG80211 is not set
343# CONFIG_WIRELESS_EXT is not set
344# CONFIG_MAC80211 is not set
330# CONFIG_IEEE80211 is not set 345# CONFIG_IEEE80211 is not set
346# CONFIG_RFKILL is not set
347# CONFIG_NET_9P is not set
331 348
332# 349#
333# Device Drivers 350# Device Drivers
@@ -340,16 +357,9 @@ CONFIG_STANDALONE=y
340CONFIG_PREVENT_FIRMWARE_BUILD=y 357CONFIG_PREVENT_FIRMWARE_BUILD=y
341# CONFIG_FW_LOADER is not set 358# CONFIG_FW_LOADER is not set
342# CONFIG_DEBUG_DRIVER is not set 359# CONFIG_DEBUG_DRIVER is not set
360# CONFIG_DEBUG_DEVRES is not set
343# CONFIG_SYS_HYPERVISOR is not set 361# CONFIG_SYS_HYPERVISOR is not set
344
345#
346# Connector - unified userspace <-> kernelspace linker
347#
348# CONFIG_CONNECTOR is not set 362# CONFIG_CONNECTOR is not set
349
350#
351# Memory Technology Devices (MTD)
352#
353CONFIG_MTD=y 363CONFIG_MTD=y
354# CONFIG_MTD_DEBUG is not set 364# CONFIG_MTD_DEBUG is not set
355# CONFIG_MTD_CONCAT is not set 365# CONFIG_MTD_CONCAT is not set
@@ -365,6 +375,7 @@ CONFIG_MTD_REDBOOT_PARTS_READONLY=y
365# User Modules And Translation Layers 375# User Modules And Translation Layers
366# 376#
367CONFIG_MTD_CHAR=y 377CONFIG_MTD_CHAR=y
378CONFIG_MTD_BLKDEVS=y
368CONFIG_MTD_BLOCK=y 379CONFIG_MTD_BLOCK=y
369# CONFIG_FTL is not set 380# CONFIG_FTL is not set
370# CONFIG_NFTL is not set 381# CONFIG_NFTL is not set
@@ -396,7 +407,6 @@ CONFIG_MTD_CFI_UTIL=y
396# CONFIG_MTD_RAM is not set 407# CONFIG_MTD_RAM is not set
397# CONFIG_MTD_ROM is not set 408# CONFIG_MTD_ROM is not set
398# CONFIG_MTD_ABSENT is not set 409# CONFIG_MTD_ABSENT is not set
399# CONFIG_MTD_OBSOLETE_CHIPS is not set
400 410
401# 411#
402# Mapping drivers for chip access 412# Mapping drivers for chip access
@@ -424,29 +434,15 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=1
424# CONFIG_MTD_DOC2000 is not set 434# CONFIG_MTD_DOC2000 is not set
425# CONFIG_MTD_DOC2001 is not set 435# CONFIG_MTD_DOC2001 is not set
426# CONFIG_MTD_DOC2001PLUS is not set 436# CONFIG_MTD_DOC2001PLUS is not set
427
428#
429# NAND Flash Device Drivers
430#
431# CONFIG_MTD_NAND is not set 437# CONFIG_MTD_NAND is not set
432
433#
434# OneNAND Flash Device Drivers
435#
436# CONFIG_MTD_ONENAND is not set 438# CONFIG_MTD_ONENAND is not set
437 439
438# 440#
439# Parallel port support 441# UBI - Unsorted block images
440# 442#
443# CONFIG_MTD_UBI is not set
441# CONFIG_PARPORT is not set 444# CONFIG_PARPORT is not set
442 445CONFIG_BLK_DEV=y
443#
444# Plug and Play support
445#
446
447#
448# Block devices
449#
450# CONFIG_BLK_CPQ_DA is not set 446# CONFIG_BLK_CPQ_DA is not set
451# CONFIG_BLK_CPQ_CISS_DA is not set 447# CONFIG_BLK_CPQ_CISS_DA is not set
452# CONFIG_BLK_DEV_DAC960 is not set 448# CONFIG_BLK_DEV_DAC960 is not set
@@ -461,13 +457,8 @@ CONFIG_BLK_DEV_RAM=y
461CONFIG_BLK_DEV_RAM_COUNT=16 457CONFIG_BLK_DEV_RAM_COUNT=16
462CONFIG_BLK_DEV_RAM_SIZE=8192 458CONFIG_BLK_DEV_RAM_SIZE=8192
463CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 459CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
464CONFIG_BLK_DEV_INITRD=y
465# CONFIG_CDROM_PKTCDVD is not set 460# CONFIG_CDROM_PKTCDVD is not set
466# CONFIG_ATA_OVER_ETH is not set 461# CONFIG_ATA_OVER_ETH is not set
467
468#
469# ATA/ATAPI/MFM/RLL support
470#
471# CONFIG_IDE is not set 462# CONFIG_IDE is not set
472 463
473# 464#
@@ -475,6 +466,7 @@ CONFIG_BLK_DEV_INITRD=y
475# 466#
476# CONFIG_RAID_ATTRS is not set 467# CONFIG_RAID_ATTRS is not set
477CONFIG_SCSI=y 468CONFIG_SCSI=y
469CONFIG_SCSI_DMA=y
478# CONFIG_SCSI_TGT is not set 470# CONFIG_SCSI_TGT is not set
479# CONFIG_SCSI_NETLINK is not set 471# CONFIG_SCSI_NETLINK is not set
480CONFIG_SCSI_PROC_FS=y 472CONFIG_SCSI_PROC_FS=y
@@ -496,6 +488,7 @@ CONFIG_CHR_DEV_SG=y
496# CONFIG_SCSI_CONSTANTS is not set 488# CONFIG_SCSI_CONSTANTS is not set
497# CONFIG_SCSI_LOGGING is not set 489# CONFIG_SCSI_LOGGING is not set
498# CONFIG_SCSI_SCAN_ASYNC is not set 490# CONFIG_SCSI_SCAN_ASYNC is not set
491CONFIG_SCSI_WAIT_SCAN=m
499 492
500# 493#
501# SCSI Transports 494# SCSI Transports
@@ -541,11 +534,8 @@ CONFIG_CHR_DEV_SG=y
541# CONFIG_SCSI_NSP32 is not set 534# CONFIG_SCSI_NSP32 is not set
542# CONFIG_SCSI_DEBUG is not set 535# CONFIG_SCSI_DEBUG is not set
543# CONFIG_SCSI_SRP is not set 536# CONFIG_SCSI_SRP is not set
544
545#
546# Serial ATA (prod) and Parallel ATA (experimental) drivers
547#
548CONFIG_ATA=y 537CONFIG_ATA=y
538# CONFIG_ATA_NONSTANDARD is not set
549# CONFIG_SATA_AHCI is not set 539# CONFIG_SATA_AHCI is not set
550# CONFIG_SATA_SVW is not set 540# CONFIG_SATA_SVW is not set
551# CONFIG_ATA_PIIX is not set 541# CONFIG_ATA_PIIX is not set
@@ -560,11 +550,13 @@ CONFIG_SATA_SIL=y
560# CONFIG_SATA_SIS is not set 550# CONFIG_SATA_SIS is not set
561# CONFIG_SATA_ULI is not set 551# CONFIG_SATA_ULI is not set
562# CONFIG_SATA_VIA is not set 552# CONFIG_SATA_VIA is not set
563# CONFIG_SATA_VITESSE is not set 553CONFIG_SATA_VITESSE=y
554# CONFIG_SATA_INIC162X is not set
564# CONFIG_PATA_ALI is not set 555# CONFIG_PATA_ALI is not set
565# CONFIG_PATA_AMD is not set 556# CONFIG_PATA_AMD is not set
566# CONFIG_PATA_ARTOP is not set 557# CONFIG_PATA_ARTOP is not set
567# CONFIG_PATA_ATIIXP is not set 558# CONFIG_PATA_ATIIXP is not set
559# CONFIG_PATA_CMD640_PCI is not set
568# CONFIG_PATA_CMD64X is not set 560# CONFIG_PATA_CMD64X is not set
569# CONFIG_PATA_CS5520 is not set 561# CONFIG_PATA_CS5520 is not set
570# CONFIG_PATA_CS5530 is not set 562# CONFIG_PATA_CS5530 is not set
@@ -576,6 +568,7 @@ CONFIG_SATA_SIL=y
576# CONFIG_PATA_HPT3X2N is not set 568# CONFIG_PATA_HPT3X2N is not set
577# CONFIG_PATA_HPT3X3 is not set 569# CONFIG_PATA_HPT3X3 is not set
578# CONFIG_PATA_IT821X is not set 570# CONFIG_PATA_IT821X is not set
571# CONFIG_PATA_IT8213 is not set
579# CONFIG_PATA_JMICRON is not set 572# CONFIG_PATA_JMICRON is not set
580# CONFIG_PATA_TRIFLEX is not set 573# CONFIG_PATA_TRIFLEX is not set
581# CONFIG_PATA_MARVELL is not set 574# CONFIG_PATA_MARVELL is not set
@@ -595,17 +588,14 @@ CONFIG_SATA_SIL=y
595# CONFIG_PATA_SIS is not set 588# CONFIG_PATA_SIS is not set
596# CONFIG_PATA_VIA is not set 589# CONFIG_PATA_VIA is not set
597# CONFIG_PATA_WINBOND is not set 590# CONFIG_PATA_WINBOND is not set
598
599#
600# Multi-device support (RAID and LVM)
601#
602CONFIG_MD=y 591CONFIG_MD=y
603CONFIG_BLK_DEV_MD=y 592CONFIG_BLK_DEV_MD=y
604# CONFIG_MD_LINEAR is not set 593# CONFIG_MD_LINEAR is not set
605CONFIG_MD_RAID0=y 594CONFIG_MD_RAID0=y
606CONFIG_MD_RAID1=y 595CONFIG_MD_RAID1=y
607# CONFIG_MD_RAID10 is not set 596CONFIG_MD_RAID10=y
608# CONFIG_MD_RAID456 is not set 597CONFIG_MD_RAID456=y
598# CONFIG_MD_RAID5_RESHAPE is not set
609# CONFIG_MD_MULTIPATH is not set 599# CONFIG_MD_MULTIPATH is not set
610# CONFIG_MD_FAULTY is not set 600# CONFIG_MD_FAULTY is not set
611CONFIG_BLK_DEV_DM=y 601CONFIG_BLK_DEV_DM=y
@@ -615,6 +605,7 @@ CONFIG_BLK_DEV_DM=y
615# CONFIG_DM_MIRROR is not set 605# CONFIG_DM_MIRROR is not set
616# CONFIG_DM_ZERO is not set 606# CONFIG_DM_ZERO is not set
617# CONFIG_DM_MULTIPATH is not set 607# CONFIG_DM_MULTIPATH is not set
608# CONFIG_DM_DELAY is not set
618 609
619# 610#
620# Fusion MPT device support 611# Fusion MPT device support
@@ -627,47 +618,27 @@ CONFIG_BLK_DEV_DM=y
627# 618#
628# IEEE 1394 (FireWire) support 619# IEEE 1394 (FireWire) support
629# 620#
621# CONFIG_FIREWIRE is not set
630# CONFIG_IEEE1394 is not set 622# CONFIG_IEEE1394 is not set
631
632#
633# I2O device support
634#
635# CONFIG_I2O is not set 623# CONFIG_I2O is not set
636
637#
638# Network device support
639#
640CONFIG_NETDEVICES=y 624CONFIG_NETDEVICES=y
625# CONFIG_NETDEVICES_MULTIQUEUE is not set
641# CONFIG_DUMMY is not set 626# CONFIG_DUMMY is not set
642# CONFIG_BONDING is not set 627# CONFIG_BONDING is not set
628# CONFIG_MACVLAN is not set
643# CONFIG_EQUALIZER is not set 629# CONFIG_EQUALIZER is not set
644# CONFIG_TUN is not set 630# CONFIG_TUN is not set
645
646#
647# ARCnet devices
648#
649# CONFIG_ARCNET is not set 631# CONFIG_ARCNET is not set
650
651#
652# PHY device support
653#
654# CONFIG_PHYLIB is not set 632# CONFIG_PHYLIB is not set
655
656#
657# Ethernet (10 or 100Mbit)
658#
659CONFIG_NET_ETHERNET=y 633CONFIG_NET_ETHERNET=y
660CONFIG_MII=y 634CONFIG_MII=y
635# CONFIG_AX88796 is not set
661# CONFIG_HAPPYMEAL is not set 636# CONFIG_HAPPYMEAL is not set
662# CONFIG_SUNGEM is not set 637# CONFIG_SUNGEM is not set
663# CONFIG_CASSINI is not set 638# CONFIG_CASSINI is not set
664# CONFIG_NET_VENDOR_3COM is not set 639# CONFIG_NET_VENDOR_3COM is not set
665# CONFIG_SMC91X is not set 640# CONFIG_SMC91X is not set
666# CONFIG_DM9000 is not set 641# CONFIG_DM9000 is not set
667
668#
669# Tulip family network device support
670#
671# CONFIG_NET_TULIP is not set 642# CONFIG_NET_TULIP is not set
672# CONFIG_HP100 is not set 643# CONFIG_HP100 is not set
673CONFIG_NET_PCI=y 644CONFIG_NET_PCI=y
@@ -689,10 +660,8 @@ CONFIG_E100=y
689# CONFIG_SUNDANCE is not set 660# CONFIG_SUNDANCE is not set
690# CONFIG_TLAN is not set 661# CONFIG_TLAN is not set
691# CONFIG_VIA_RHINE is not set 662# CONFIG_VIA_RHINE is not set
692 663# CONFIG_SC92031 is not set
693# 664CONFIG_NETDEV_1000=y
694# Ethernet (1000 Mbit)
695#
696# CONFIG_ACENIC is not set 665# CONFIG_ACENIC is not set
697# CONFIG_DL2K is not set 666# CONFIG_DL2K is not set
698CONFIG_E1000=y 667CONFIG_E1000=y
@@ -706,34 +675,36 @@ CONFIG_R8169=y
706# CONFIG_SIS190 is not set 675# CONFIG_SIS190 is not set
707# CONFIG_SKGE is not set 676# CONFIG_SKGE is not set
708# CONFIG_SKY2 is not set 677# CONFIG_SKY2 is not set
709# CONFIG_SK98LIN is not set
710# CONFIG_VIA_VELOCITY is not set 678# CONFIG_VIA_VELOCITY is not set
711# CONFIG_TIGON3 is not set 679# CONFIG_TIGON3 is not set
712# CONFIG_BNX2 is not set 680# CONFIG_BNX2 is not set
713# CONFIG_QLA3XXX is not set 681# CONFIG_QLA3XXX is not set
714 682# CONFIG_ATL1 is not set
715# 683CONFIG_NETDEV_10000=y
716# Ethernet (10000 Mbit)
717#
718# CONFIG_CHELSIO_T1 is not set 684# CONFIG_CHELSIO_T1 is not set
685# CONFIG_CHELSIO_T3 is not set
719# CONFIG_IXGB is not set 686# CONFIG_IXGB is not set
720# CONFIG_S2IO is not set 687# CONFIG_S2IO is not set
721# CONFIG_MYRI10GE is not set 688# CONFIG_MYRI10GE is not set
722# CONFIG_NETXEN_NIC is not set 689# CONFIG_NETXEN_NIC is not set
723 690# CONFIG_MLX4_CORE is not set
724#
725# Token Ring devices
726#
727# CONFIG_TR is not set 691# CONFIG_TR is not set
728 692
729# 693#
730# Wireless LAN (non-hamradio) 694# Wireless LAN
731# 695#
732# CONFIG_NET_RADIO is not set 696# CONFIG_WLAN_PRE80211 is not set
697# CONFIG_WLAN_80211 is not set
733 698
734# 699#
735# Wan interfaces 700# USB Network Adapters
736# 701#
702# CONFIG_USB_CATC is not set
703# CONFIG_USB_KAWETH is not set
704# CONFIG_USB_PEGASUS is not set
705# CONFIG_USB_RTL8150 is not set
706# CONFIG_USB_USBNET_MII is not set
707# CONFIG_USB_USBNET is not set
737# CONFIG_WAN is not set 708# CONFIG_WAN is not set
738# CONFIG_FDDI is not set 709# CONFIG_FDDI is not set
739# CONFIG_HIPPI is not set 710# CONFIG_HIPPI is not set
@@ -744,10 +715,6 @@ CONFIG_R8169=y
744# CONFIG_NETCONSOLE is not set 715# CONFIG_NETCONSOLE is not set
745# CONFIG_NETPOLL is not set 716# CONFIG_NETPOLL is not set
746# CONFIG_NET_POLL_CONTROLLER is not set 717# CONFIG_NET_POLL_CONTROLLER is not set
747
748#
749# ISDN subsystem
750#
751# CONFIG_ISDN is not set 718# CONFIG_ISDN is not set
752 719
753# 720#
@@ -755,6 +722,7 @@ CONFIG_R8169=y
755# 722#
756CONFIG_INPUT=y 723CONFIG_INPUT=y
757# CONFIG_INPUT_FF_MEMLESS is not set 724# CONFIG_INPUT_FF_MEMLESS is not set
725# CONFIG_INPUT_POLLDEV is not set
758 726
759# 727#
760# Userland interfaces 728# Userland interfaces
@@ -774,6 +742,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
774# CONFIG_INPUT_KEYBOARD is not set 742# CONFIG_INPUT_KEYBOARD is not set
775# CONFIG_INPUT_MOUSE is not set 743# CONFIG_INPUT_MOUSE is not set
776# CONFIG_INPUT_JOYSTICK is not set 744# CONFIG_INPUT_JOYSTICK is not set
745# CONFIG_INPUT_TABLET is not set
777# CONFIG_INPUT_TOUCHSCREEN is not set 746# CONFIG_INPUT_TOUCHSCREEN is not set
778# CONFIG_INPUT_MISC is not set 747# CONFIG_INPUT_MISC is not set
779 748
@@ -811,33 +780,18 @@ CONFIG_SERIAL_CORE_CONSOLE=y
811CONFIG_UNIX98_PTYS=y 780CONFIG_UNIX98_PTYS=y
812CONFIG_LEGACY_PTYS=y 781CONFIG_LEGACY_PTYS=y
813CONFIG_LEGACY_PTY_COUNT=256 782CONFIG_LEGACY_PTY_COUNT=256
814
815#
816# IPMI
817#
818# CONFIG_IPMI_HANDLER is not set 783# CONFIG_IPMI_HANDLER is not set
819
820#
821# Watchdog Cards
822#
823# CONFIG_WATCHDOG is not set 784# CONFIG_WATCHDOG is not set
824CONFIG_HW_RANDOM=y 785CONFIG_HW_RANDOM=y
825# CONFIG_NVRAM is not set 786# CONFIG_NVRAM is not set
826# CONFIG_DTLK is not set
827# CONFIG_R3964 is not set 787# CONFIG_R3964 is not set
828# CONFIG_APPLICOM is not set 788# CONFIG_APPLICOM is not set
829# CONFIG_DRM is not set 789# CONFIG_DRM is not set
830# CONFIG_RAW_DRIVER is not set 790# CONFIG_RAW_DRIVER is not set
831
832#
833# TPM devices
834#
835# CONFIG_TCG_TPM is not set 791# CONFIG_TCG_TPM is not set
836 792CONFIG_DEVPORT=y
837#
838# I2C support
839#
840CONFIG_I2C=y 793CONFIG_I2C=y
794CONFIG_I2C_BOARDINFO=y
841CONFIG_I2C_CHARDEV=y 795CONFIG_I2C_CHARDEV=y
842 796
843# 797#
@@ -864,25 +818,29 @@ CONFIG_I2C_IOP3XX=y
864# CONFIG_I2C_PARPORT_LIGHT is not set 818# CONFIG_I2C_PARPORT_LIGHT is not set
865# CONFIG_I2C_PROSAVAGE is not set 819# CONFIG_I2C_PROSAVAGE is not set
866# CONFIG_I2C_SAVAGE4 is not set 820# CONFIG_I2C_SAVAGE4 is not set
821# CONFIG_I2C_SIMTEC is not set
867# CONFIG_I2C_SIS5595 is not set 822# CONFIG_I2C_SIS5595 is not set
868# CONFIG_I2C_SIS630 is not set 823# CONFIG_I2C_SIS630 is not set
869# CONFIG_I2C_SIS96X is not set 824# CONFIG_I2C_SIS96X is not set
825# CONFIG_I2C_TAOS_EVM is not set
870# CONFIG_I2C_STUB is not set 826# CONFIG_I2C_STUB is not set
827# CONFIG_I2C_TINY_USB is not set
871# CONFIG_I2C_VIA is not set 828# CONFIG_I2C_VIA is not set
872# CONFIG_I2C_VIAPRO is not set 829# CONFIG_I2C_VIAPRO is not set
873# CONFIG_I2C_VOODOO3 is not set 830# CONFIG_I2C_VOODOO3 is not set
874# CONFIG_I2C_PCA_ISA is not set
875 831
876# 832#
877# Miscellaneous I2C Chip support 833# Miscellaneous I2C Chip support
878# 834#
879# CONFIG_SENSORS_DS1337 is not set 835# CONFIG_SENSORS_DS1337 is not set
880# CONFIG_SENSORS_DS1374 is not set 836# CONFIG_SENSORS_DS1374 is not set
837# CONFIG_DS1682 is not set
881# CONFIG_SENSORS_EEPROM is not set 838# CONFIG_SENSORS_EEPROM is not set
882# CONFIG_SENSORS_PCF8574 is not set 839# CONFIG_SENSORS_PCF8574 is not set
883# CONFIG_SENSORS_PCA9539 is not set 840# CONFIG_SENSORS_PCA9539 is not set
884# CONFIG_SENSORS_PCF8591 is not set 841# CONFIG_SENSORS_PCF8591 is not set
885# CONFIG_SENSORS_MAX6875 is not set 842# CONFIG_SENSORS_MAX6875 is not set
843# CONFIG_SENSORS_TSL2550 is not set
886# CONFIG_I2C_DEBUG_CORE is not set 844# CONFIG_I2C_DEBUG_CORE is not set
887# CONFIG_I2C_DEBUG_ALGO is not set 845# CONFIG_I2C_DEBUG_ALGO is not set
888# CONFIG_I2C_DEBUG_BUS is not set 846# CONFIG_I2C_DEBUG_BUS is not set
@@ -893,21 +851,15 @@ CONFIG_I2C_IOP3XX=y
893# 851#
894# CONFIG_SPI is not set 852# CONFIG_SPI is not set
895# CONFIG_SPI_MASTER is not set 853# CONFIG_SPI_MASTER is not set
896
897#
898# Dallas's 1-wire bus
899#
900# CONFIG_W1 is not set 854# CONFIG_W1 is not set
901
902#
903# Hardware Monitoring support
904#
905CONFIG_HWMON=y 855CONFIG_HWMON=y
906# CONFIG_HWMON_VID is not set 856# CONFIG_HWMON_VID is not set
907# CONFIG_SENSORS_ABITUGURU is not set 857# CONFIG_SENSORS_ABITUGURU is not set
858# CONFIG_SENSORS_AD7418 is not set
908# CONFIG_SENSORS_ADM1021 is not set 859# CONFIG_SENSORS_ADM1021 is not set
909# CONFIG_SENSORS_ADM1025 is not set 860# CONFIG_SENSORS_ADM1025 is not set
910# CONFIG_SENSORS_ADM1026 is not set 861# CONFIG_SENSORS_ADM1026 is not set
862# CONFIG_SENSORS_ADM1029 is not set
911# CONFIG_SENSORS_ADM1031 is not set 863# CONFIG_SENSORS_ADM1031 is not set
912# CONFIG_SENSORS_ADM9240 is not set 864# CONFIG_SENSORS_ADM9240 is not set
913# CONFIG_SENSORS_ASB100 is not set 865# CONFIG_SENSORS_ASB100 is not set
@@ -930,6 +882,7 @@ CONFIG_HWMON=y
930# CONFIG_SENSORS_LM90 is not set 882# CONFIG_SENSORS_LM90 is not set
931# CONFIG_SENSORS_LM92 is not set 883# CONFIG_SENSORS_LM92 is not set
932# CONFIG_SENSORS_MAX1619 is not set 884# CONFIG_SENSORS_MAX1619 is not set
885# CONFIG_SENSORS_MAX6650 is not set
933# CONFIG_SENSORS_PC87360 is not set 886# CONFIG_SENSORS_PC87360 is not set
934# CONFIG_SENSORS_PC87427 is not set 887# CONFIG_SENSORS_PC87427 is not set
935# CONFIG_SENSORS_SIS5595 is not set 888# CONFIG_SENSORS_SIS5595 is not set
@@ -947,12 +900,16 @@ CONFIG_HWMON=y
947# CONFIG_SENSORS_W83627HF is not set 900# CONFIG_SENSORS_W83627HF is not set
948# CONFIG_SENSORS_W83627EHF is not set 901# CONFIG_SENSORS_W83627EHF is not set
949# CONFIG_HWMON_DEBUG_CHIP is not set 902# CONFIG_HWMON_DEBUG_CHIP is not set
903CONFIG_MISC_DEVICES=y
904# CONFIG_PHANTOM is not set
905# CONFIG_EEPROM_93CX6 is not set
906# CONFIG_SGI_IOC4 is not set
907# CONFIG_TIFM_CORE is not set
950 908
951# 909#
952# Misc devices 910# Multifunction device drivers
953# 911#
954# CONFIG_SGI_IOC4 is not set 912# CONFIG_MFD_SM501 is not set
955# CONFIG_TIFM_CORE is not set
956 913
957# 914#
958# LED devices 915# LED devices
@@ -971,17 +928,20 @@ CONFIG_HWMON=y
971# Multimedia devices 928# Multimedia devices
972# 929#
973# CONFIG_VIDEO_DEV is not set 930# CONFIG_VIDEO_DEV is not set
931# CONFIG_DVB_CORE is not set
932CONFIG_DAB=y
933# CONFIG_USB_DABUSB is not set
974 934
975# 935#
976# Digital Video Broadcasting Devices 936# Graphics support
977# 937#
978# CONFIG_DVB is not set 938# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
979# CONFIG_USB_DABUSB is not set
980 939
981# 940#
982# Graphics support 941# Display device support
983# 942#
984CONFIG_FIRMWARE_EDID=y 943# CONFIG_DISPLAY_SUPPORT is not set
944# CONFIG_VGASTATE is not set
985# CONFIG_FB is not set 945# CONFIG_FB is not set
986 946
987# 947#
@@ -989,21 +949,26 @@ CONFIG_FIRMWARE_EDID=y
989# 949#
990# CONFIG_VGA_CONSOLE is not set 950# CONFIG_VGA_CONSOLE is not set
991CONFIG_DUMMY_CONSOLE=y 951CONFIG_DUMMY_CONSOLE=y
992# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
993 952
994# 953#
995# Sound 954# Sound
996# 955#
997# CONFIG_SOUND is not set 956# CONFIG_SOUND is not set
957CONFIG_HID_SUPPORT=y
958CONFIG_HID=y
959# CONFIG_HID_DEBUG is not set
998 960
999# 961#
1000# HID Devices 962# USB Input Devices
1001# 963#
1002CONFIG_HID=y 964# CONFIG_USB_HID is not set
1003 965
1004# 966#
1005# USB support 967# USB HID Boot Protocol drivers
1006# 968#
969# CONFIG_USB_KBD is not set
970# CONFIG_USB_MOUSE is not set
971CONFIG_USB_SUPPORT=y
1007CONFIG_USB_ARCH_HAS_HCD=y 972CONFIG_USB_ARCH_HAS_HCD=y
1008CONFIG_USB_ARCH_HAS_OHCI=y 973CONFIG_USB_ARCH_HAS_OHCI=y
1009CONFIG_USB_ARCH_HAS_EHCI=y 974CONFIG_USB_ARCH_HAS_EHCI=y
@@ -1014,9 +979,8 @@ CONFIG_USB=y
1014# Miscellaneous USB options 979# Miscellaneous USB options
1015# 980#
1016# CONFIG_USB_DEVICEFS is not set 981# CONFIG_USB_DEVICEFS is not set
1017# CONFIG_USB_BANDWIDTH is not set 982CONFIG_USB_DEVICE_CLASS=y
1018# CONFIG_USB_DYNAMIC_MINORS is not set 983# CONFIG_USB_DYNAMIC_MINORS is not set
1019# CONFIG_USB_MULTITHREAD_PROBE is not set
1020# CONFIG_USB_OTG is not set 984# CONFIG_USB_OTG is not set
1021 985
1022# 986#
@@ -1030,6 +994,7 @@ CONFIG_USB_EHCI_TT_NEWSCHED=y
1030# CONFIG_USB_OHCI_HCD is not set 994# CONFIG_USB_OHCI_HCD is not set
1031CONFIG_USB_UHCI_HCD=y 995CONFIG_USB_UHCI_HCD=y
1032# CONFIG_USB_SL811_HCD is not set 996# CONFIG_USB_SL811_HCD is not set
997# CONFIG_USB_R8A66597_HCD is not set
1033 998
1034# 999#
1035# USB Device Class drivers 1000# USB Device Class drivers
@@ -1058,43 +1023,10 @@ CONFIG_USB_STORAGE=y
1058# CONFIG_USB_LIBUSUAL is not set 1023# CONFIG_USB_LIBUSUAL is not set
1059 1024
1060# 1025#
1061# USB Input Devices
1062#
1063# CONFIG_USB_HID is not set
1064
1065#
1066# USB HID Boot Protocol drivers
1067#
1068# CONFIG_USB_KBD is not set
1069# CONFIG_USB_MOUSE is not set
1070# CONFIG_USB_AIPTEK is not set
1071# CONFIG_USB_WACOM is not set
1072# CONFIG_USB_ACECAD is not set
1073# CONFIG_USB_KBTAB is not set
1074# CONFIG_USB_POWERMATE is not set
1075# CONFIG_USB_TOUCHSCREEN is not set
1076# CONFIG_USB_YEALINK is not set
1077# CONFIG_USB_XPAD is not set
1078# CONFIG_USB_ATI_REMOTE is not set
1079# CONFIG_USB_ATI_REMOTE2 is not set
1080# CONFIG_USB_KEYSPAN_REMOTE is not set
1081# CONFIG_USB_APPLETOUCH is not set
1082
1083#
1084# USB Imaging devices 1026# USB Imaging devices
1085# 1027#
1086# CONFIG_USB_MDC800 is not set 1028# CONFIG_USB_MDC800 is not set
1087# CONFIG_USB_MICROTEK is not set 1029# CONFIG_USB_MICROTEK is not set
1088
1089#
1090# USB Network Adapters
1091#
1092# CONFIG_USB_CATC is not set
1093# CONFIG_USB_KAWETH is not set
1094# CONFIG_USB_PEGASUS is not set
1095# CONFIG_USB_RTL8150 is not set
1096# CONFIG_USB_USBNET_MII is not set
1097# CONFIG_USB_USBNET is not set
1098CONFIG_USB_MON=y 1030CONFIG_USB_MON=y
1099 1031
1100# 1032#
@@ -1116,6 +1048,7 @@ CONFIG_USB_MON=y
1116# CONFIG_USB_RIO500 is not set 1048# CONFIG_USB_RIO500 is not set
1117# CONFIG_USB_LEGOTOWER is not set 1049# CONFIG_USB_LEGOTOWER is not set
1118# CONFIG_USB_LCD is not set 1050# CONFIG_USB_LCD is not set
1051# CONFIG_USB_BERRY_CHARGE is not set
1119# CONFIG_USB_LED is not set 1052# CONFIG_USB_LED is not set
1120# CONFIG_USB_CYPRESS_CY7C63 is not set 1053# CONFIG_USB_CYPRESS_CY7C63 is not set
1121# CONFIG_USB_CYTHERM is not set 1054# CONFIG_USB_CYTHERM is not set
@@ -1126,6 +1059,7 @@ CONFIG_USB_MON=y
1126# CONFIG_USB_SISUSBVGA is not set 1059# CONFIG_USB_SISUSBVGA is not set
1127# CONFIG_USB_LD is not set 1060# CONFIG_USB_LD is not set
1128# CONFIG_USB_TRANCEVIBRATOR is not set 1061# CONFIG_USB_TRANCEVIBRATOR is not set
1062# CONFIG_USB_IOWARRIOR is not set
1129 1063
1130# 1064#
1131# USB DSL modem support 1065# USB DSL modem support
@@ -1135,10 +1069,6 @@ CONFIG_USB_MON=y
1135# USB Gadget Support 1069# USB Gadget Support
1136# 1070#
1137# CONFIG_USB_GADGET is not set 1071# CONFIG_USB_GADGET is not set
1138
1139#
1140# MMC/SD Card support
1141#
1142# CONFIG_MMC is not set 1072# CONFIG_MMC is not set
1143 1073
1144# 1074#
@@ -1148,6 +1078,22 @@ CONFIG_RTC_LIB=y
1148# CONFIG_RTC_CLASS is not set 1078# CONFIG_RTC_CLASS is not set
1149 1079
1150# 1080#
1081# DMA Engine support
1082#
1083CONFIG_DMA_ENGINE=y
1084
1085#
1086# DMA Clients
1087#
1088CONFIG_NET_DMA=y
1089
1090#
1091# DMA Devices
1092#
1093# CONFIG_INTEL_IOATDMA is not set
1094CONFIG_INTEL_IOP_ADMA=y
1095
1096#
1151# File systems 1097# File systems
1152# 1098#
1153CONFIG_EXT2_FS=y 1099CONFIG_EXT2_FS=y
@@ -1164,11 +1110,7 @@ CONFIG_FS_MBCACHE=y
1164# CONFIG_REISERFS_FS is not set 1110# CONFIG_REISERFS_FS is not set
1165# CONFIG_JFS_FS is not set 1111# CONFIG_JFS_FS is not set
1166# CONFIG_FS_POSIX_ACL is not set 1112# CONFIG_FS_POSIX_ACL is not set
1167CONFIG_XFS_FS=y 1113# CONFIG_XFS_FS is not set
1168# CONFIG_XFS_QUOTA is not set
1169CONFIG_XFS_SECURITY=y
1170CONFIG_XFS_POSIX_ACL=y
1171# CONFIG_XFS_RT is not set
1172# CONFIG_GFS2_FS is not set 1114# CONFIG_GFS2_FS is not set
1173# CONFIG_OCFS2_FS is not set 1115# CONFIG_OCFS2_FS is not set
1174# CONFIG_MINIX_FS is not set 1116# CONFIG_MINIX_FS is not set
@@ -1217,7 +1159,6 @@ CONFIG_ECRYPT_FS=y
1217# CONFIG_BEFS_FS is not set 1159# CONFIG_BEFS_FS is not set
1218# CONFIG_BFS_FS is not set 1160# CONFIG_BFS_FS is not set
1219# CONFIG_EFS_FS is not set 1161# CONFIG_EFS_FS is not set
1220# CONFIG_JFFS_FS is not set
1221CONFIG_JFFS2_FS=y 1162CONFIG_JFFS2_FS=y
1222CONFIG_JFFS2_FS_DEBUG=0 1163CONFIG_JFFS2_FS_DEBUG=0
1223CONFIG_JFFS2_FS_WRITEBUFFER=y 1164CONFIG_JFFS2_FS_WRITEBUFFER=y
@@ -1227,7 +1168,7 @@ CONFIG_JFFS2_FS_WRITEBUFFER=y
1227CONFIG_JFFS2_ZLIB=y 1168CONFIG_JFFS2_ZLIB=y
1228CONFIG_JFFS2_RTIME=y 1169CONFIG_JFFS2_RTIME=y
1229# CONFIG_JFFS2_RUBIN is not set 1170# CONFIG_JFFS2_RUBIN is not set
1230# CONFIG_CRAMFS is not set 1171CONFIG_CRAMFS=y
1231# CONFIG_VXFS_FS is not set 1172# CONFIG_VXFS_FS is not set
1232# CONFIG_HPFS_FS is not set 1173# CONFIG_HPFS_FS is not set
1233# CONFIG_QNX4FS_FS is not set 1174# CONFIG_QNX4FS_FS is not set
@@ -1253,6 +1194,7 @@ CONFIG_LOCKD_V4=y
1253CONFIG_EXPORTFS=y 1194CONFIG_EXPORTFS=y
1254CONFIG_NFS_COMMON=y 1195CONFIG_NFS_COMMON=y
1255CONFIG_SUNRPC=y 1196CONFIG_SUNRPC=y
1197# CONFIG_SUNRPC_BIND34 is not set
1256# CONFIG_RPCSEC_GSS_KRB5 is not set 1198# CONFIG_RPCSEC_GSS_KRB5 is not set
1257# CONFIG_RPCSEC_GSS_SPKM3 is not set 1199# CONFIG_RPCSEC_GSS_SPKM3 is not set
1258# CONFIG_SMB_FS is not set 1200# CONFIG_SMB_FS is not set
@@ -1260,7 +1202,6 @@ CONFIG_SUNRPC=y
1260# CONFIG_NCP_FS is not set 1202# CONFIG_NCP_FS is not set
1261# CONFIG_CODA_FS is not set 1203# CONFIG_CODA_FS is not set
1262# CONFIG_AFS_FS is not set 1204# CONFIG_AFS_FS is not set
1263# CONFIG_9P_FS is not set
1264 1205
1265# 1206#
1266# Partition Types 1207# Partition Types
@@ -1282,6 +1223,7 @@ CONFIG_MSDOS_PARTITION=y
1282# CONFIG_SUN_PARTITION is not set 1223# CONFIG_SUN_PARTITION is not set
1283# CONFIG_KARMA_PARTITION is not set 1224# CONFIG_KARMA_PARTITION is not set
1284# CONFIG_EFI_PARTITION is not set 1225# CONFIG_EFI_PARTITION is not set
1226# CONFIG_SYSV68_PARTITION is not set
1285 1227
1286# 1228#
1287# Native Language Support 1229# Native Language Support
@@ -1308,15 +1250,19 @@ CONFIG_MAGIC_SYSRQ=y
1308# CONFIG_DEBUG_FS is not set 1250# CONFIG_DEBUG_FS is not set
1309# CONFIG_HEADERS_CHECK is not set 1251# CONFIG_HEADERS_CHECK is not set
1310CONFIG_DEBUG_KERNEL=y 1252CONFIG_DEBUG_KERNEL=y
1311CONFIG_LOG_BUF_SHIFT=14 1253# CONFIG_DEBUG_SHIRQ is not set
1312CONFIG_DETECT_SOFTLOCKUP=y 1254CONFIG_DETECT_SOFTLOCKUP=y
1255CONFIG_SCHED_DEBUG=y
1313# CONFIG_SCHEDSTATS is not set 1256# CONFIG_SCHEDSTATS is not set
1257# CONFIG_TIMER_STATS is not set
1314# CONFIG_DEBUG_SLAB is not set 1258# CONFIG_DEBUG_SLAB is not set
1315# CONFIG_DEBUG_RT_MUTEXES is not set 1259# CONFIG_DEBUG_RT_MUTEXES is not set
1316# CONFIG_RT_MUTEX_TESTER is not set 1260# CONFIG_RT_MUTEX_TESTER is not set
1317# CONFIG_DEBUG_SPINLOCK is not set 1261# CONFIG_DEBUG_SPINLOCK is not set
1318# CONFIG_DEBUG_MUTEXES is not set 1262# CONFIG_DEBUG_MUTEXES is not set
1319# CONFIG_DEBUG_RWSEMS is not set 1263# CONFIG_DEBUG_LOCK_ALLOC is not set
1264# CONFIG_PROVE_LOCKING is not set
1265# CONFIG_LOCK_STAT is not set
1320# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1266# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1321# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1267# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1322# CONFIG_DEBUG_KOBJECT is not set 1268# CONFIG_DEBUG_KOBJECT is not set
@@ -1327,6 +1273,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
1327CONFIG_FRAME_POINTER=y 1273CONFIG_FRAME_POINTER=y
1328# CONFIG_FORCED_INLINING is not set 1274# CONFIG_FORCED_INLINING is not set
1329# CONFIG_RCU_TORTURE_TEST is not set 1275# CONFIG_RCU_TORTURE_TEST is not set
1276# CONFIG_FAULT_INJECTION is not set
1330CONFIG_DEBUG_USER=y 1277CONFIG_DEBUG_USER=y
1331# CONFIG_DEBUG_ERRORS is not set 1278# CONFIG_DEBUG_ERRORS is not set
1332CONFIG_DEBUG_LL=y 1279CONFIG_DEBUG_LL=y
@@ -1338,10 +1285,10 @@ CONFIG_DEBUG_LL=y
1338CONFIG_KEYS=y 1285CONFIG_KEYS=y
1339CONFIG_KEYS_DEBUG_PROC_KEYS=y 1286CONFIG_KEYS_DEBUG_PROC_KEYS=y
1340# CONFIG_SECURITY is not set 1287# CONFIG_SECURITY is not set
1341 1288CONFIG_XOR_BLOCKS=y
1342# 1289CONFIG_ASYNC_CORE=y
1343# Cryptographic options 1290CONFIG_ASYNC_MEMCPY=y
1344# 1291CONFIG_ASYNC_XOR=y
1345CONFIG_CRYPTO=y 1292CONFIG_CRYPTO=y
1346CONFIG_CRYPTO_ALGAPI=y 1293CONFIG_CRYPTO_ALGAPI=y
1347CONFIG_CRYPTO_BLKCIPHER=y 1294CONFIG_CRYPTO_BLKCIPHER=y
@@ -1360,8 +1307,11 @@ CONFIG_CRYPTO_TGR192=y
1360CONFIG_CRYPTO_GF128MUL=y 1307CONFIG_CRYPTO_GF128MUL=y
1361CONFIG_CRYPTO_ECB=y 1308CONFIG_CRYPTO_ECB=y
1362CONFIG_CRYPTO_CBC=y 1309CONFIG_CRYPTO_CBC=y
1310CONFIG_CRYPTO_PCBC=m
1363CONFIG_CRYPTO_LRW=y 1311CONFIG_CRYPTO_LRW=y
1312# CONFIG_CRYPTO_CRYPTD is not set
1364CONFIG_CRYPTO_DES=y 1313CONFIG_CRYPTO_DES=y
1314# CONFIG_CRYPTO_FCRYPT is not set
1365CONFIG_CRYPTO_BLOWFISH=y 1315CONFIG_CRYPTO_BLOWFISH=y
1366CONFIG_CRYPTO_TWOFISH=y 1316CONFIG_CRYPTO_TWOFISH=y
1367CONFIG_CRYPTO_TWOFISH_COMMON=y 1317CONFIG_CRYPTO_TWOFISH_COMMON=y
@@ -1376,11 +1326,9 @@ CONFIG_CRYPTO_ANUBIS=y
1376CONFIG_CRYPTO_DEFLATE=y 1326CONFIG_CRYPTO_DEFLATE=y
1377CONFIG_CRYPTO_MICHAEL_MIC=y 1327CONFIG_CRYPTO_MICHAEL_MIC=y
1378CONFIG_CRYPTO_CRC32C=y 1328CONFIG_CRYPTO_CRC32C=y
1329# CONFIG_CRYPTO_CAMELLIA is not set
1379# CONFIG_CRYPTO_TEST is not set 1330# CONFIG_CRYPTO_TEST is not set
1380 1331CONFIG_CRYPTO_HW=y
1381#
1382# Hardware crypto devices
1383#
1384 1332
1385# 1333#
1386# Library routines 1334# Library routines
@@ -1388,9 +1336,13 @@ CONFIG_CRYPTO_CRC32C=y
1388CONFIG_BITREVERSE=y 1336CONFIG_BITREVERSE=y
1389# CONFIG_CRC_CCITT is not set 1337# CONFIG_CRC_CCITT is not set
1390# CONFIG_CRC16 is not set 1338# CONFIG_CRC16 is not set
1339# CONFIG_CRC_ITU_T is not set
1391CONFIG_CRC32=y 1340CONFIG_CRC32=y
1341# CONFIG_CRC7 is not set
1392CONFIG_LIBCRC32C=y 1342CONFIG_LIBCRC32C=y
1393CONFIG_ZLIB_INFLATE=y 1343CONFIG_ZLIB_INFLATE=y
1394CONFIG_ZLIB_DEFLATE=y 1344CONFIG_ZLIB_DEFLATE=y
1395CONFIG_PLIST=y 1345CONFIG_PLIST=y
1396CONFIG_IOMAP_COPY=y 1346CONFIG_HAS_IOMEM=y
1347CONFIG_HAS_IOPORT=y
1348CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/iop33x_defconfig b/arch/arm/configs/iop33x_defconfig
index fa271bce8ff7..721ee64a13f7 100644
--- a/arch/arm/configs/iop33x_defconfig
+++ b/arch/arm/configs/iop33x_defconfig
@@ -1,12 +1,18 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.20-rc1 3# Linux kernel version: 2.6.22
4# Sat Dec 16 06:05:34 2006 4# Thu Jul 19 16:05:59 2007
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8# CONFIG_GENERIC_GPIO is not set
7# CONFIG_GENERIC_TIME is not set 9# CONFIG_GENERIC_TIME is not set
10# CONFIG_GENERIC_CLOCKEVENTS is not set
8CONFIG_MMU=y 11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
9CONFIG_GENERIC_HARDIRQS=y 13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_LOCKDEP_SUPPORT=y
10CONFIG_TRACE_IRQFLAGS_SUPPORT=y 16CONFIG_TRACE_IRQFLAGS_SUPPORT=y
11CONFIG_HARDIRQS_SW_RESEND=y 17CONFIG_HARDIRQS_SW_RESEND=y
12CONFIG_GENERIC_IRQ_PROBE=y 18CONFIG_GENERIC_IRQ_PROBE=y
@@ -15,6 +21,7 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
15# CONFIG_ARCH_HAS_ILOG2_U64 is not set 21# CONFIG_ARCH_HAS_ILOG2_U64 is not set
16CONFIG_GENERIC_HWEIGHT=y 22CONFIG_GENERIC_HWEIGHT=y
17CONFIG_GENERIC_CALIBRATE_DELAY=y 23CONFIG_GENERIC_CALIBRATE_DELAY=y
24CONFIG_ZONE_DMA=y
18CONFIG_VECTORS_BASE=0xffff0000 25CONFIG_VECTORS_BASE=0xffff0000
19CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 26CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
20 27
@@ -32,16 +39,18 @@ CONFIG_LOCALVERSION=""
32CONFIG_LOCALVERSION_AUTO=y 39CONFIG_LOCALVERSION_AUTO=y
33CONFIG_SWAP=y 40CONFIG_SWAP=y
34CONFIG_SYSVIPC=y 41CONFIG_SYSVIPC=y
35# CONFIG_IPC_NS is not set 42CONFIG_SYSVIPC_SYSCTL=y
36# CONFIG_POSIX_MQUEUE is not set 43# CONFIG_POSIX_MQUEUE is not set
37CONFIG_BSD_PROCESS_ACCT=y 44CONFIG_BSD_PROCESS_ACCT=y
38# CONFIG_BSD_PROCESS_ACCT_V3 is not set 45# CONFIG_BSD_PROCESS_ACCT_V3 is not set
39# CONFIG_TASKSTATS is not set 46# CONFIG_TASKSTATS is not set
40# CONFIG_UTS_NS is not set 47# CONFIG_USER_NS is not set
41# CONFIG_AUDIT is not set 48# CONFIG_AUDIT is not set
42# CONFIG_IKCONFIG is not set 49# CONFIG_IKCONFIG is not set
50CONFIG_LOG_BUF_SHIFT=14
43CONFIG_SYSFS_DEPRECATED=y 51CONFIG_SYSFS_DEPRECATED=y
44# CONFIG_RELAY is not set 52# CONFIG_RELAY is not set
53CONFIG_BLK_DEV_INITRD=y
45CONFIG_INITRAMFS_SOURCE="" 54CONFIG_INITRAMFS_SOURCE=""
46CONFIG_CC_OPTIMIZE_FOR_SIZE=y 55CONFIG_CC_OPTIMIZE_FOR_SIZE=y
47CONFIG_SYSCTL=y 56CONFIG_SYSCTL=y
@@ -57,32 +66,30 @@ CONFIG_BUG=y
57CONFIG_ELF_CORE=y 66CONFIG_ELF_CORE=y
58CONFIG_BASE_FULL=y 67CONFIG_BASE_FULL=y
59CONFIG_FUTEX=y 68CONFIG_FUTEX=y
69CONFIG_ANON_INODES=y
60CONFIG_EPOLL=y 70CONFIG_EPOLL=y
71CONFIG_SIGNALFD=y
72CONFIG_TIMERFD=y
73CONFIG_EVENTFD=y
61CONFIG_SHMEM=y 74CONFIG_SHMEM=y
62CONFIG_SLAB=y
63CONFIG_VM_EVENT_COUNTERS=y 75CONFIG_VM_EVENT_COUNTERS=y
76CONFIG_SLAB=y
77# CONFIG_SLUB is not set
78# CONFIG_SLOB is not set
64CONFIG_RT_MUTEXES=y 79CONFIG_RT_MUTEXES=y
65# CONFIG_TINY_SHMEM is not set 80# CONFIG_TINY_SHMEM is not set
66CONFIG_BASE_SMALL=0 81CONFIG_BASE_SMALL=0
67# CONFIG_SLOB is not set
68
69#
70# Loadable module support
71#
72CONFIG_MODULES=y 82CONFIG_MODULES=y
73CONFIG_MODULE_UNLOAD=y 83CONFIG_MODULE_UNLOAD=y
74# CONFIG_MODULE_FORCE_UNLOAD is not set 84# CONFIG_MODULE_FORCE_UNLOAD is not set
75# CONFIG_MODVERSIONS is not set 85# CONFIG_MODVERSIONS is not set
76# CONFIG_MODULE_SRCVERSION_ALL is not set 86# CONFIG_MODULE_SRCVERSION_ALL is not set
77CONFIG_KMOD=y 87CONFIG_KMOD=y
78
79#
80# Block layer
81#
82CONFIG_BLOCK=y 88CONFIG_BLOCK=y
83# CONFIG_LBD is not set 89# CONFIG_LBD is not set
84# CONFIG_BLK_DEV_IO_TRACE is not set 90# CONFIG_BLK_DEV_IO_TRACE is not set
85# CONFIG_LSF is not set 91# CONFIG_LSF is not set
92# CONFIG_BLK_DEV_BSG is not set
86 93
87# 94#
88# IO Schedulers 95# IO Schedulers
@@ -114,13 +121,15 @@ CONFIG_DEFAULT_IOSCHED="cfq"
114# CONFIG_ARCH_NETX is not set 121# CONFIG_ARCH_NETX is not set
115# CONFIG_ARCH_H720X is not set 122# CONFIG_ARCH_H720X is not set
116# CONFIG_ARCH_IMX is not set 123# CONFIG_ARCH_IMX is not set
124# CONFIG_ARCH_IOP13XX is not set
117# CONFIG_ARCH_IOP32X is not set 125# CONFIG_ARCH_IOP32X is not set
118CONFIG_ARCH_IOP33X=y 126CONFIG_ARCH_IOP33X=y
119# CONFIG_ARCH_IOP13XX is not set
120# CONFIG_ARCH_IXP4XX is not set
121# CONFIG_ARCH_IXP2000 is not set
122# CONFIG_ARCH_IXP23XX is not set 127# CONFIG_ARCH_IXP23XX is not set
128# CONFIG_ARCH_IXP2000 is not set
129# CONFIG_ARCH_IXP4XX is not set
123# CONFIG_ARCH_L7200 is not set 130# CONFIG_ARCH_L7200 is not set
131# CONFIG_ARCH_KS8695 is not set
132# CONFIG_ARCH_NS9XXX is not set
124# CONFIG_ARCH_PNX4008 is not set 133# CONFIG_ARCH_PNX4008 is not set
125# CONFIG_ARCH_PXA is not set 134# CONFIG_ARCH_PXA is not set
126# CONFIG_ARCH_RPC is not set 135# CONFIG_ARCH_RPC is not set
@@ -128,7 +137,9 @@ CONFIG_ARCH_IOP33X=y
128# CONFIG_ARCH_S3C2410 is not set 137# CONFIG_ARCH_S3C2410 is not set
129# CONFIG_ARCH_SHARK is not set 138# CONFIG_ARCH_SHARK is not set
130# CONFIG_ARCH_LH7A40X is not set 139# CONFIG_ARCH_LH7A40X is not set
140# CONFIG_ARCH_DAVINCI is not set
131# CONFIG_ARCH_OMAP is not set 141# CONFIG_ARCH_OMAP is not set
142CONFIG_IOP3XX_ATU=y
132 143
133# 144#
134# IOP33x Implementation Options 145# IOP33x Implementation Options
@@ -158,6 +169,7 @@ CONFIG_CPU_CP15_MMU=y
158# 169#
159# CONFIG_ARM_THUMB is not set 170# CONFIG_ARM_THUMB is not set
160# CONFIG_CPU_DCACHE_DISABLE is not set 171# CONFIG_CPU_DCACHE_DISABLE is not set
172# CONFIG_OUTER_CACHE is not set
161# CONFIG_IWMMXT is not set 173# CONFIG_IWMMXT is not set
162CONFIG_XSCALE_PMU=y 174CONFIG_XSCALE_PMU=y
163 175
@@ -165,7 +177,8 @@ CONFIG_XSCALE_PMU=y
165# Bus support 177# Bus support
166# 178#
167CONFIG_PCI=y 179CONFIG_PCI=y
168# CONFIG_PCI_MULTITHREAD_PROBE is not set 180CONFIG_PCI_SYSCALL=y
181# CONFIG_ARCH_SUPPORTS_MSI is not set
169# CONFIG_PCI_DEBUG is not set 182# CONFIG_PCI_DEBUG is not set
170 183
171# 184#
@@ -176,6 +189,7 @@ CONFIG_PCI=y
176# 189#
177# Kernel Features 190# Kernel Features
178# 191#
192# CONFIG_TICK_ONESHOT is not set
179# CONFIG_PREEMPT is not set 193# CONFIG_PREEMPT is not set
180# CONFIG_NO_IDLE_HZ is not set 194# CONFIG_NO_IDLE_HZ is not set
181CONFIG_HZ=100 195CONFIG_HZ=100
@@ -190,6 +204,9 @@ CONFIG_FLAT_NODE_MEM_MAP=y
190# CONFIG_SPARSEMEM_STATIC is not set 204# CONFIG_SPARSEMEM_STATIC is not set
191CONFIG_SPLIT_PTLOCK_CPUS=4096 205CONFIG_SPLIT_PTLOCK_CPUS=4096
192# CONFIG_RESOURCES_64BIT is not set 206# CONFIG_RESOURCES_64BIT is not set
207CONFIG_ZONE_DMA_FLAG=1
208CONFIG_BOUNCE=y
209CONFIG_VIRT_TO_BUS=y
193CONFIG_ALIGNMENT_TRAP=y 210CONFIG_ALIGNMENT_TRAP=y
194 211
195# 212#
@@ -197,8 +214,9 @@ CONFIG_ALIGNMENT_TRAP=y
197# 214#
198CONFIG_ZBOOT_ROM_TEXT=0x0 215CONFIG_ZBOOT_ROM_TEXT=0x0
199CONFIG_ZBOOT_ROM_BSS=0x0 216CONFIG_ZBOOT_ROM_BSS=0x0
200CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/nfs ip=bootp" 217CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/nfs ip=bootp cachepolicy=writealloc"
201# CONFIG_XIP_KERNEL is not set 218# CONFIG_XIP_KERNEL is not set
219# CONFIG_KEXEC is not set
202 220
203# 221#
204# Floating point emulation 222# Floating point emulation
@@ -223,7 +241,6 @@ CONFIG_BINFMT_AOUT=y
223# Power management options 241# Power management options
224# 242#
225# CONFIG_PM is not set 243# CONFIG_PM is not set
226# CONFIG_APM is not set
227 244
228# 245#
229# Networking 246# Networking
@@ -233,13 +250,13 @@ CONFIG_NET=y
233# 250#
234# Networking options 251# Networking options
235# 252#
236# CONFIG_NETDEBUG is not set
237CONFIG_PACKET=y 253CONFIG_PACKET=y
238CONFIG_PACKET_MMAP=y 254CONFIG_PACKET_MMAP=y
239CONFIG_UNIX=y 255CONFIG_UNIX=y
240CONFIG_XFRM=y 256CONFIG_XFRM=y
241# CONFIG_XFRM_USER is not set 257# CONFIG_XFRM_USER is not set
242# CONFIG_XFRM_SUB_POLICY is not set 258# CONFIG_XFRM_SUB_POLICY is not set
259# CONFIG_XFRM_MIGRATE is not set
243# CONFIG_NET_KEY is not set 260# CONFIG_NET_KEY is not set
244CONFIG_INET=y 261CONFIG_INET=y
245CONFIG_IP_MULTICAST=y 262CONFIG_IP_MULTICAST=y
@@ -271,6 +288,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
271CONFIG_IPV6=y 288CONFIG_IPV6=y
272# CONFIG_IPV6_PRIVACY is not set 289# CONFIG_IPV6_PRIVACY is not set
273# CONFIG_IPV6_ROUTER_PREF is not set 290# CONFIG_IPV6_ROUTER_PREF is not set
291# CONFIG_IPV6_OPTIMISTIC_DAD is not set
274# CONFIG_INET6_AH is not set 292# CONFIG_INET6_AH is not set
275# CONFIG_INET6_ESP is not set 293# CONFIG_INET6_ESP is not set
276# CONFIG_INET6_IPCOMP is not set 294# CONFIG_INET6_IPCOMP is not set
@@ -286,20 +304,8 @@ CONFIG_IPV6=y
286# CONFIG_IPV6_MULTIPLE_TABLES is not set 304# CONFIG_IPV6_MULTIPLE_TABLES is not set
287# CONFIG_NETWORK_SECMARK is not set 305# CONFIG_NETWORK_SECMARK is not set
288# CONFIG_NETFILTER is not set 306# CONFIG_NETFILTER is not set
289
290#
291# DCCP Configuration (EXPERIMENTAL)
292#
293# CONFIG_IP_DCCP is not set 307# CONFIG_IP_DCCP is not set
294
295#
296# SCTP Configuration (EXPERIMENTAL)
297#
298# CONFIG_IP_SCTP is not set 308# CONFIG_IP_SCTP is not set
299
300#
301# TIPC Configuration (EXPERIMENTAL)
302#
303# CONFIG_TIPC is not set 309# CONFIG_TIPC is not set
304# CONFIG_ATM is not set 310# CONFIG_ATM is not set
305# CONFIG_BRIDGE is not set 311# CONFIG_BRIDGE is not set
@@ -325,7 +331,17 @@ CONFIG_IPV6=y
325# CONFIG_HAMRADIO is not set 331# CONFIG_HAMRADIO is not set
326# CONFIG_IRDA is not set 332# CONFIG_IRDA is not set
327# CONFIG_BT is not set 333# CONFIG_BT is not set
334# CONFIG_AF_RXRPC is not set
335
336#
337# Wireless
338#
339# CONFIG_CFG80211 is not set
340# CONFIG_WIRELESS_EXT is not set
341# CONFIG_MAC80211 is not set
328# CONFIG_IEEE80211 is not set 342# CONFIG_IEEE80211 is not set
343# CONFIG_RFKILL is not set
344# CONFIG_NET_9P is not set
329 345
330# 346#
331# Device Drivers 347# Device Drivers
@@ -338,16 +354,9 @@ CONFIG_STANDALONE=y
338CONFIG_PREVENT_FIRMWARE_BUILD=y 354CONFIG_PREVENT_FIRMWARE_BUILD=y
339# CONFIG_FW_LOADER is not set 355# CONFIG_FW_LOADER is not set
340# CONFIG_DEBUG_DRIVER is not set 356# CONFIG_DEBUG_DRIVER is not set
357# CONFIG_DEBUG_DEVRES is not set
341# CONFIG_SYS_HYPERVISOR is not set 358# CONFIG_SYS_HYPERVISOR is not set
342
343#
344# Connector - unified userspace <-> kernelspace linker
345#
346# CONFIG_CONNECTOR is not set 359# CONFIG_CONNECTOR is not set
347
348#
349# Memory Technology Devices (MTD)
350#
351CONFIG_MTD=y 360CONFIG_MTD=y
352# CONFIG_MTD_DEBUG is not set 361# CONFIG_MTD_DEBUG is not set
353# CONFIG_MTD_CONCAT is not set 362# CONFIG_MTD_CONCAT is not set
@@ -363,6 +372,7 @@ CONFIG_MTD_REDBOOT_PARTS_READONLY=y
363# User Modules And Translation Layers 372# User Modules And Translation Layers
364# 373#
365CONFIG_MTD_CHAR=y 374CONFIG_MTD_CHAR=y
375CONFIG_MTD_BLKDEVS=y
366CONFIG_MTD_BLOCK=y 376CONFIG_MTD_BLOCK=y
367# CONFIG_FTL is not set 377# CONFIG_FTL is not set
368# CONFIG_NFTL is not set 378# CONFIG_NFTL is not set
@@ -399,7 +409,6 @@ CONFIG_MTD_CFI_UTIL=y
399# CONFIG_MTD_RAM is not set 409# CONFIG_MTD_RAM is not set
400# CONFIG_MTD_ROM is not set 410# CONFIG_MTD_ROM is not set
401# CONFIG_MTD_ABSENT is not set 411# CONFIG_MTD_ABSENT is not set
402# CONFIG_MTD_OBSOLETE_CHIPS is not set
403 412
404# 413#
405# Mapping drivers for chip access 414# Mapping drivers for chip access
@@ -427,29 +436,15 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=1
427# CONFIG_MTD_DOC2000 is not set 436# CONFIG_MTD_DOC2000 is not set
428# CONFIG_MTD_DOC2001 is not set 437# CONFIG_MTD_DOC2001 is not set
429# CONFIG_MTD_DOC2001PLUS is not set 438# CONFIG_MTD_DOC2001PLUS is not set
430
431#
432# NAND Flash Device Drivers
433#
434# CONFIG_MTD_NAND is not set 439# CONFIG_MTD_NAND is not set
435
436#
437# OneNAND Flash Device Drivers
438#
439# CONFIG_MTD_ONENAND is not set 440# CONFIG_MTD_ONENAND is not set
440 441
441# 442#
442# Parallel port support 443# UBI - Unsorted block images
443# 444#
445# CONFIG_MTD_UBI is not set
444# CONFIG_PARPORT is not set 446# CONFIG_PARPORT is not set
445 447CONFIG_BLK_DEV=y
446#
447# Plug and Play support
448#
449
450#
451# Block devices
452#
453# CONFIG_BLK_CPQ_DA is not set 448# CONFIG_BLK_CPQ_DA is not set
454# CONFIG_BLK_CPQ_CISS_DA is not set 449# CONFIG_BLK_CPQ_CISS_DA is not set
455# CONFIG_BLK_DEV_DAC960 is not set 450# CONFIG_BLK_DEV_DAC960 is not set
@@ -462,13 +457,8 @@ CONFIG_BLK_DEV_RAM=y
462CONFIG_BLK_DEV_RAM_COUNT=16 457CONFIG_BLK_DEV_RAM_COUNT=16
463CONFIG_BLK_DEV_RAM_SIZE=8192 458CONFIG_BLK_DEV_RAM_SIZE=8192
464CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 459CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
465CONFIG_BLK_DEV_INITRD=y
466# CONFIG_CDROM_PKTCDVD is not set 460# CONFIG_CDROM_PKTCDVD is not set
467# CONFIG_ATA_OVER_ETH is not set 461# CONFIG_ATA_OVER_ETH is not set
468
469#
470# ATA/ATAPI/MFM/RLL support
471#
472# CONFIG_IDE is not set 462# CONFIG_IDE is not set
473 463
474# 464#
@@ -476,6 +466,7 @@ CONFIG_BLK_DEV_INITRD=y
476# 466#
477# CONFIG_RAID_ATTRS is not set 467# CONFIG_RAID_ATTRS is not set
478CONFIG_SCSI=y 468CONFIG_SCSI=y
469CONFIG_SCSI_DMA=y
479# CONFIG_SCSI_TGT is not set 470# CONFIG_SCSI_TGT is not set
480# CONFIG_SCSI_NETLINK is not set 471# CONFIG_SCSI_NETLINK is not set
481CONFIG_SCSI_PROC_FS=y 472CONFIG_SCSI_PROC_FS=y
@@ -497,6 +488,7 @@ CONFIG_CHR_DEV_SG=y
497# CONFIG_SCSI_CONSTANTS is not set 488# CONFIG_SCSI_CONSTANTS is not set
498# CONFIG_SCSI_LOGGING is not set 489# CONFIG_SCSI_LOGGING is not set
499# CONFIG_SCSI_SCAN_ASYNC is not set 490# CONFIG_SCSI_SCAN_ASYNC is not set
491CONFIG_SCSI_WAIT_SCAN=m
500 492
501# 493#
502# SCSI Transports 494# SCSI Transports
@@ -541,22 +533,15 @@ CONFIG_CHR_DEV_SG=y
541# CONFIG_SCSI_NSP32 is not set 533# CONFIG_SCSI_NSP32 is not set
542# CONFIG_SCSI_DEBUG is not set 534# CONFIG_SCSI_DEBUG is not set
543# CONFIG_SCSI_SRP is not set 535# CONFIG_SCSI_SRP is not set
544
545#
546# Serial ATA (prod) and Parallel ATA (experimental) drivers
547#
548# CONFIG_ATA is not set 536# CONFIG_ATA is not set
549
550#
551# Multi-device support (RAID and LVM)
552#
553CONFIG_MD=y 537CONFIG_MD=y
554CONFIG_BLK_DEV_MD=y 538CONFIG_BLK_DEV_MD=y
555CONFIG_MD_LINEAR=y 539CONFIG_MD_LINEAR=y
556CONFIG_MD_RAID0=y 540CONFIG_MD_RAID0=y
557CONFIG_MD_RAID1=y 541CONFIG_MD_RAID1=y
558# CONFIG_MD_RAID10 is not set 542# CONFIG_MD_RAID10 is not set
559# CONFIG_MD_RAID456 is not set 543CONFIG_MD_RAID456=y
544# CONFIG_MD_RAID5_RESHAPE is not set
560# CONFIG_MD_MULTIPATH is not set 545# CONFIG_MD_MULTIPATH is not set
561# CONFIG_MD_FAULTY is not set 546# CONFIG_MD_FAULTY is not set
562CONFIG_BLK_DEV_DM=y 547CONFIG_BLK_DEV_DM=y
@@ -566,6 +551,7 @@ CONFIG_BLK_DEV_DM=y
566# CONFIG_DM_MIRROR is not set 551# CONFIG_DM_MIRROR is not set
567# CONFIG_DM_ZERO is not set 552# CONFIG_DM_ZERO is not set
568# CONFIG_DM_MULTIPATH is not set 553# CONFIG_DM_MULTIPATH is not set
554# CONFIG_DM_DELAY is not set
569 555
570# 556#
571# Fusion MPT device support 557# Fusion MPT device support
@@ -578,39 +564,19 @@ CONFIG_BLK_DEV_DM=y
578# 564#
579# IEEE 1394 (FireWire) support 565# IEEE 1394 (FireWire) support
580# 566#
567# CONFIG_FIREWIRE is not set
581# CONFIG_IEEE1394 is not set 568# CONFIG_IEEE1394 is not set
582
583#
584# I2O device support
585#
586# CONFIG_I2O is not set 569# CONFIG_I2O is not set
587
588#
589# Network device support
590#
591CONFIG_NETDEVICES=y 570CONFIG_NETDEVICES=y
571# CONFIG_NETDEVICES_MULTIQUEUE is not set
592# CONFIG_DUMMY is not set 572# CONFIG_DUMMY is not set
593# CONFIG_BONDING is not set 573# CONFIG_BONDING is not set
574# CONFIG_MACVLAN is not set
594# CONFIG_EQUALIZER is not set 575# CONFIG_EQUALIZER is not set
595# CONFIG_TUN is not set 576# CONFIG_TUN is not set
596
597#
598# ARCnet devices
599#
600# CONFIG_ARCNET is not set 577# CONFIG_ARCNET is not set
601
602#
603# PHY device support
604#
605
606#
607# Ethernet (10 or 100Mbit)
608#
609# CONFIG_NET_ETHERNET is not set 578# CONFIG_NET_ETHERNET is not set
610 579CONFIG_NETDEV_1000=y
611#
612# Ethernet (1000 Mbit)
613#
614# CONFIG_ACENIC is not set 580# CONFIG_ACENIC is not set
615# CONFIG_DL2K is not set 581# CONFIG_DL2K is not set
616CONFIG_E1000=y 582CONFIG_E1000=y
@@ -623,33 +589,26 @@ CONFIG_E1000_NAPI=y
623# CONFIG_SIS190 is not set 589# CONFIG_SIS190 is not set
624# CONFIG_SKGE is not set 590# CONFIG_SKGE is not set
625# CONFIG_SKY2 is not set 591# CONFIG_SKY2 is not set
626# CONFIG_SK98LIN is not set 592# CONFIG_VIA_VELOCITY is not set
627# CONFIG_TIGON3 is not set 593# CONFIG_TIGON3 is not set
628# CONFIG_BNX2 is not set 594# CONFIG_BNX2 is not set
629# CONFIG_QLA3XXX is not set 595# CONFIG_QLA3XXX is not set
630 596# CONFIG_ATL1 is not set
631# 597CONFIG_NETDEV_10000=y
632# Ethernet (10000 Mbit)
633#
634# CONFIG_CHELSIO_T1 is not set 598# CONFIG_CHELSIO_T1 is not set
599# CONFIG_CHELSIO_T3 is not set
635# CONFIG_IXGB is not set 600# CONFIG_IXGB is not set
636# CONFIG_S2IO is not set 601# CONFIG_S2IO is not set
637# CONFIG_MYRI10GE is not set 602# CONFIG_MYRI10GE is not set
638# CONFIG_NETXEN_NIC is not set 603# CONFIG_NETXEN_NIC is not set
639 604# CONFIG_MLX4_CORE is not set
640#
641# Token Ring devices
642#
643# CONFIG_TR is not set 605# CONFIG_TR is not set
644 606
645# 607#
646# Wireless LAN (non-hamradio) 608# Wireless LAN
647#
648# CONFIG_NET_RADIO is not set
649
650#
651# Wan interfaces
652# 609#
610# CONFIG_WLAN_PRE80211 is not set
611# CONFIG_WLAN_80211 is not set
653# CONFIG_WAN is not set 612# CONFIG_WAN is not set
654# CONFIG_FDDI is not set 613# CONFIG_FDDI is not set
655# CONFIG_HIPPI is not set 614# CONFIG_HIPPI is not set
@@ -660,10 +619,6 @@ CONFIG_E1000_NAPI=y
660# CONFIG_NETCONSOLE is not set 619# CONFIG_NETCONSOLE is not set
661# CONFIG_NETPOLL is not set 620# CONFIG_NETPOLL is not set
662# CONFIG_NET_POLL_CONTROLLER is not set 621# CONFIG_NET_POLL_CONTROLLER is not set
663
664#
665# ISDN subsystem
666#
667# CONFIG_ISDN is not set 622# CONFIG_ISDN is not set
668 623
669# 624#
@@ -671,6 +626,7 @@ CONFIG_E1000_NAPI=y
671# 626#
672CONFIG_INPUT=y 627CONFIG_INPUT=y
673# CONFIG_INPUT_FF_MEMLESS is not set 628# CONFIG_INPUT_FF_MEMLESS is not set
629# CONFIG_INPUT_POLLDEV is not set
674 630
675# 631#
676# Userland interfaces 632# Userland interfaces
@@ -690,6 +646,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
690# CONFIG_INPUT_KEYBOARD is not set 646# CONFIG_INPUT_KEYBOARD is not set
691# CONFIG_INPUT_MOUSE is not set 647# CONFIG_INPUT_MOUSE is not set
692# CONFIG_INPUT_JOYSTICK is not set 648# CONFIG_INPUT_JOYSTICK is not set
649# CONFIG_INPUT_TABLET is not set
693# CONFIG_INPUT_TOUCHSCREEN is not set 650# CONFIG_INPUT_TOUCHSCREEN is not set
694# CONFIG_INPUT_MISC is not set 651# CONFIG_INPUT_MISC is not set
695 652
@@ -727,33 +684,18 @@ CONFIG_SERIAL_CORE_CONSOLE=y
727CONFIG_UNIX98_PTYS=y 684CONFIG_UNIX98_PTYS=y
728CONFIG_LEGACY_PTYS=y 685CONFIG_LEGACY_PTYS=y
729CONFIG_LEGACY_PTY_COUNT=256 686CONFIG_LEGACY_PTY_COUNT=256
730
731#
732# IPMI
733#
734# CONFIG_IPMI_HANDLER is not set 687# CONFIG_IPMI_HANDLER is not set
735
736#
737# Watchdog Cards
738#
739# CONFIG_WATCHDOG is not set 688# CONFIG_WATCHDOG is not set
740CONFIG_HW_RANDOM=y 689CONFIG_HW_RANDOM=y
741# CONFIG_NVRAM is not set 690# CONFIG_NVRAM is not set
742# CONFIG_DTLK is not set
743# CONFIG_R3964 is not set 691# CONFIG_R3964 is not set
744# CONFIG_APPLICOM is not set 692# CONFIG_APPLICOM is not set
745# CONFIG_DRM is not set 693# CONFIG_DRM is not set
746# CONFIG_RAW_DRIVER is not set 694# CONFIG_RAW_DRIVER is not set
747
748#
749# TPM devices
750#
751# CONFIG_TCG_TPM is not set 695# CONFIG_TCG_TPM is not set
752 696CONFIG_DEVPORT=y
753#
754# I2C support
755#
756CONFIG_I2C=y 697CONFIG_I2C=y
698CONFIG_I2C_BOARDINFO=y
757CONFIG_I2C_CHARDEV=y 699CONFIG_I2C_CHARDEV=y
758 700
759# 701#
@@ -780,25 +722,28 @@ CONFIG_I2C_IOP3XX=y
780# CONFIG_I2C_PARPORT_LIGHT is not set 722# CONFIG_I2C_PARPORT_LIGHT is not set
781# CONFIG_I2C_PROSAVAGE is not set 723# CONFIG_I2C_PROSAVAGE is not set
782# CONFIG_I2C_SAVAGE4 is not set 724# CONFIG_I2C_SAVAGE4 is not set
725# CONFIG_I2C_SIMTEC is not set
783# CONFIG_I2C_SIS5595 is not set 726# CONFIG_I2C_SIS5595 is not set
784# CONFIG_I2C_SIS630 is not set 727# CONFIG_I2C_SIS630 is not set
785# CONFIG_I2C_SIS96X is not set 728# CONFIG_I2C_SIS96X is not set
729# CONFIG_I2C_TAOS_EVM is not set
786# CONFIG_I2C_STUB is not set 730# CONFIG_I2C_STUB is not set
787# CONFIG_I2C_VIA is not set 731# CONFIG_I2C_VIA is not set
788# CONFIG_I2C_VIAPRO is not set 732# CONFIG_I2C_VIAPRO is not set
789# CONFIG_I2C_VOODOO3 is not set 733# CONFIG_I2C_VOODOO3 is not set
790# CONFIG_I2C_PCA_ISA is not set
791 734
792# 735#
793# Miscellaneous I2C Chip support 736# Miscellaneous I2C Chip support
794# 737#
795# CONFIG_SENSORS_DS1337 is not set 738# CONFIG_SENSORS_DS1337 is not set
796# CONFIG_SENSORS_DS1374 is not set 739# CONFIG_SENSORS_DS1374 is not set
740# CONFIG_DS1682 is not set
797# CONFIG_SENSORS_EEPROM is not set 741# CONFIG_SENSORS_EEPROM is not set
798# CONFIG_SENSORS_PCF8574 is not set 742# CONFIG_SENSORS_PCF8574 is not set
799# CONFIG_SENSORS_PCA9539 is not set 743# CONFIG_SENSORS_PCA9539 is not set
800# CONFIG_SENSORS_PCF8591 is not set 744# CONFIG_SENSORS_PCF8591 is not set
801# CONFIG_SENSORS_MAX6875 is not set 745# CONFIG_SENSORS_MAX6875 is not set
746# CONFIG_SENSORS_TSL2550 is not set
802# CONFIG_I2C_DEBUG_CORE is not set 747# CONFIG_I2C_DEBUG_CORE is not set
803# CONFIG_I2C_DEBUG_ALGO is not set 748# CONFIG_I2C_DEBUG_ALGO is not set
804# CONFIG_I2C_DEBUG_BUS is not set 749# CONFIG_I2C_DEBUG_BUS is not set
@@ -809,21 +754,15 @@ CONFIG_I2C_IOP3XX=y
809# 754#
810# CONFIG_SPI is not set 755# CONFIG_SPI is not set
811# CONFIG_SPI_MASTER is not set 756# CONFIG_SPI_MASTER is not set
812
813#
814# Dallas's 1-wire bus
815#
816# CONFIG_W1 is not set 757# CONFIG_W1 is not set
817
818#
819# Hardware Monitoring support
820#
821CONFIG_HWMON=y 758CONFIG_HWMON=y
822# CONFIG_HWMON_VID is not set 759# CONFIG_HWMON_VID is not set
823# CONFIG_SENSORS_ABITUGURU is not set 760# CONFIG_SENSORS_ABITUGURU is not set
761# CONFIG_SENSORS_AD7418 is not set
824# CONFIG_SENSORS_ADM1021 is not set 762# CONFIG_SENSORS_ADM1021 is not set
825# CONFIG_SENSORS_ADM1025 is not set 763# CONFIG_SENSORS_ADM1025 is not set
826# CONFIG_SENSORS_ADM1026 is not set 764# CONFIG_SENSORS_ADM1026 is not set
765# CONFIG_SENSORS_ADM1029 is not set
827# CONFIG_SENSORS_ADM1031 is not set 766# CONFIG_SENSORS_ADM1031 is not set
828# CONFIG_SENSORS_ADM9240 is not set 767# CONFIG_SENSORS_ADM9240 is not set
829# CONFIG_SENSORS_ASB100 is not set 768# CONFIG_SENSORS_ASB100 is not set
@@ -846,6 +785,7 @@ CONFIG_HWMON=y
846# CONFIG_SENSORS_LM90 is not set 785# CONFIG_SENSORS_LM90 is not set
847# CONFIG_SENSORS_LM92 is not set 786# CONFIG_SENSORS_LM92 is not set
848# CONFIG_SENSORS_MAX1619 is not set 787# CONFIG_SENSORS_MAX1619 is not set
788# CONFIG_SENSORS_MAX6650 is not set
849# CONFIG_SENSORS_PC87360 is not set 789# CONFIG_SENSORS_PC87360 is not set
850# CONFIG_SENSORS_PC87427 is not set 790# CONFIG_SENSORS_PC87427 is not set
851# CONFIG_SENSORS_SIS5595 is not set 791# CONFIG_SENSORS_SIS5595 is not set
@@ -863,12 +803,16 @@ CONFIG_HWMON=y
863# CONFIG_SENSORS_W83627HF is not set 803# CONFIG_SENSORS_W83627HF is not set
864# CONFIG_SENSORS_W83627EHF is not set 804# CONFIG_SENSORS_W83627EHF is not set
865# CONFIG_HWMON_DEBUG_CHIP is not set 805# CONFIG_HWMON_DEBUG_CHIP is not set
806CONFIG_MISC_DEVICES=y
807# CONFIG_PHANTOM is not set
808# CONFIG_EEPROM_93CX6 is not set
809# CONFIG_SGI_IOC4 is not set
810# CONFIG_TIFM_CORE is not set
866 811
867# 812#
868# Misc devices 813# Multifunction device drivers
869# 814#
870# CONFIG_SGI_IOC4 is not set 815# CONFIG_MFD_SM501 is not set
871# CONFIG_TIFM_CORE is not set
872 816
873# 817#
874# LED devices 818# LED devices
@@ -887,16 +831,19 @@ CONFIG_HWMON=y
887# Multimedia devices 831# Multimedia devices
888# 832#
889# CONFIG_VIDEO_DEV is not set 833# CONFIG_VIDEO_DEV is not set
834# CONFIG_DVB_CORE is not set
835CONFIG_DAB=y
890 836
891# 837#
892# Digital Video Broadcasting Devices 838# Graphics support
893# 839#
894# CONFIG_DVB is not set 840# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
895 841
896# 842#
897# Graphics support 843# Display device support
898# 844#
899CONFIG_FIRMWARE_EDID=y 845# CONFIG_DISPLAY_SUPPORT is not set
846# CONFIG_VGASTATE is not set
900# CONFIG_FB is not set 847# CONFIG_FB is not set
901 848
902# 849#
@@ -904,21 +851,15 @@ CONFIG_FIRMWARE_EDID=y
904# 851#
905# CONFIG_VGA_CONSOLE is not set 852# CONFIG_VGA_CONSOLE is not set
906CONFIG_DUMMY_CONSOLE=y 853CONFIG_DUMMY_CONSOLE=y
907# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
908 854
909# 855#
910# Sound 856# Sound
911# 857#
912# CONFIG_SOUND is not set 858# CONFIG_SOUND is not set
913 859CONFIG_HID_SUPPORT=y
914#
915# HID Devices
916#
917CONFIG_HID=y 860CONFIG_HID=y
918 861# CONFIG_HID_DEBUG is not set
919# 862CONFIG_USB_SUPPORT=y
920# USB support
921#
922CONFIG_USB_ARCH_HAS_HCD=y 863CONFIG_USB_ARCH_HAS_HCD=y
923CONFIG_USB_ARCH_HAS_OHCI=y 864CONFIG_USB_ARCH_HAS_OHCI=y
924CONFIG_USB_ARCH_HAS_EHCI=y 865CONFIG_USB_ARCH_HAS_EHCI=y
@@ -932,10 +873,6 @@ CONFIG_USB_ARCH_HAS_EHCI=y
932# USB Gadget Support 873# USB Gadget Support
933# 874#
934# CONFIG_USB_GADGET is not set 875# CONFIG_USB_GADGET is not set
935
936#
937# MMC/SD Card support
938#
939# CONFIG_MMC is not set 876# CONFIG_MMC is not set
940 877
941# 878#
@@ -945,6 +882,22 @@ CONFIG_RTC_LIB=y
945# CONFIG_RTC_CLASS is not set 882# CONFIG_RTC_CLASS is not set
946 883
947# 884#
885# DMA Engine support
886#
887CONFIG_DMA_ENGINE=y
888
889#
890# DMA Clients
891#
892CONFIG_NET_DMA=y
893
894#
895# DMA Devices
896#
897# CONFIG_INTEL_IOATDMA is not set
898CONFIG_INTEL_IOP_ADMA=y
899
900#
948# File systems 901# File systems
949# 902#
950CONFIG_EXT2_FS=y 903CONFIG_EXT2_FS=y
@@ -961,11 +914,7 @@ CONFIG_FS_MBCACHE=y
961# CONFIG_REISERFS_FS is not set 914# CONFIG_REISERFS_FS is not set
962# CONFIG_JFS_FS is not set 915# CONFIG_JFS_FS is not set
963# CONFIG_FS_POSIX_ACL is not set 916# CONFIG_FS_POSIX_ACL is not set
964CONFIG_XFS_FS=y 917# CONFIG_XFS_FS is not set
965# CONFIG_XFS_QUOTA is not set
966CONFIG_XFS_SECURITY=y
967CONFIG_XFS_POSIX_ACL=y
968# CONFIG_XFS_RT is not set
969# CONFIG_GFS2_FS is not set 918# CONFIG_GFS2_FS is not set
970# CONFIG_OCFS2_FS is not set 919# CONFIG_OCFS2_FS is not set
971# CONFIG_MINIX_FS is not set 920# CONFIG_MINIX_FS is not set
@@ -1013,9 +962,8 @@ CONFIG_RAMFS=y
1013# CONFIG_BEFS_FS is not set 962# CONFIG_BEFS_FS is not set
1014# CONFIG_BFS_FS is not set 963# CONFIG_BFS_FS is not set
1015# CONFIG_EFS_FS is not set 964# CONFIG_EFS_FS is not set
1016# CONFIG_JFFS_FS is not set
1017# CONFIG_JFFS2_FS is not set 965# CONFIG_JFFS2_FS is not set
1018# CONFIG_CRAMFS is not set 966CONFIG_CRAMFS=y
1019# CONFIG_VXFS_FS is not set 967# CONFIG_VXFS_FS is not set
1020# CONFIG_HPFS_FS is not set 968# CONFIG_HPFS_FS is not set
1021# CONFIG_QNX4FS_FS is not set 969# CONFIG_QNX4FS_FS is not set
@@ -1041,6 +989,7 @@ CONFIG_LOCKD_V4=y
1041CONFIG_EXPORTFS=y 989CONFIG_EXPORTFS=y
1042CONFIG_NFS_COMMON=y 990CONFIG_NFS_COMMON=y
1043CONFIG_SUNRPC=y 991CONFIG_SUNRPC=y
992# CONFIG_SUNRPC_BIND34 is not set
1044# CONFIG_RPCSEC_GSS_KRB5 is not set 993# CONFIG_RPCSEC_GSS_KRB5 is not set
1045# CONFIG_RPCSEC_GSS_SPKM3 is not set 994# CONFIG_RPCSEC_GSS_SPKM3 is not set
1046# CONFIG_SMB_FS is not set 995# CONFIG_SMB_FS is not set
@@ -1048,7 +997,6 @@ CONFIG_SUNRPC=y
1048# CONFIG_NCP_FS is not set 997# CONFIG_NCP_FS is not set
1049# CONFIG_CODA_FS is not set 998# CONFIG_CODA_FS is not set
1050# CONFIG_AFS_FS is not set 999# CONFIG_AFS_FS is not set
1051# CONFIG_9P_FS is not set
1052 1000
1053# 1001#
1054# Partition Types 1002# Partition Types
@@ -1070,6 +1018,7 @@ CONFIG_MSDOS_PARTITION=y
1070# CONFIG_SUN_PARTITION is not set 1018# CONFIG_SUN_PARTITION is not set
1071# CONFIG_KARMA_PARTITION is not set 1019# CONFIG_KARMA_PARTITION is not set
1072# CONFIG_EFI_PARTITION is not set 1020# CONFIG_EFI_PARTITION is not set
1021# CONFIG_SYSV68_PARTITION is not set
1073 1022
1074# 1023#
1075# Native Language Support 1024# Native Language Support
@@ -1096,15 +1045,19 @@ CONFIG_MAGIC_SYSRQ=y
1096# CONFIG_DEBUG_FS is not set 1045# CONFIG_DEBUG_FS is not set
1097# CONFIG_HEADERS_CHECK is not set 1046# CONFIG_HEADERS_CHECK is not set
1098CONFIG_DEBUG_KERNEL=y 1047CONFIG_DEBUG_KERNEL=y
1099CONFIG_LOG_BUF_SHIFT=14 1048# CONFIG_DEBUG_SHIRQ is not set
1100CONFIG_DETECT_SOFTLOCKUP=y 1049CONFIG_DETECT_SOFTLOCKUP=y
1050CONFIG_SCHED_DEBUG=y
1101# CONFIG_SCHEDSTATS is not set 1051# CONFIG_SCHEDSTATS is not set
1052# CONFIG_TIMER_STATS is not set
1102# CONFIG_DEBUG_SLAB is not set 1053# CONFIG_DEBUG_SLAB is not set
1103# CONFIG_DEBUG_RT_MUTEXES is not set 1054# CONFIG_DEBUG_RT_MUTEXES is not set
1104# CONFIG_RT_MUTEX_TESTER is not set 1055# CONFIG_RT_MUTEX_TESTER is not set
1105# CONFIG_DEBUG_SPINLOCK is not set 1056# CONFIG_DEBUG_SPINLOCK is not set
1106# CONFIG_DEBUG_MUTEXES is not set 1057# CONFIG_DEBUG_MUTEXES is not set
1107# CONFIG_DEBUG_RWSEMS is not set 1058# CONFIG_DEBUG_LOCK_ALLOC is not set
1059# CONFIG_PROVE_LOCKING is not set
1060# CONFIG_LOCK_STAT is not set
1108# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1061# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1109# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1062# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1110# CONFIG_DEBUG_KOBJECT is not set 1063# CONFIG_DEBUG_KOBJECT is not set
@@ -1115,6 +1068,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
1115CONFIG_FRAME_POINTER=y 1068CONFIG_FRAME_POINTER=y
1116# CONFIG_FORCED_INLINING is not set 1069# CONFIG_FORCED_INLINING is not set
1117# CONFIG_RCU_TORTURE_TEST is not set 1070# CONFIG_RCU_TORTURE_TEST is not set
1071# CONFIG_FAULT_INJECTION is not set
1118CONFIG_DEBUG_USER=y 1072CONFIG_DEBUG_USER=y
1119# CONFIG_DEBUG_ERRORS is not set 1073# CONFIG_DEBUG_ERRORS is not set
1120CONFIG_DEBUG_LL=y 1074CONFIG_DEBUG_LL=y
@@ -1125,10 +1079,10 @@ CONFIG_DEBUG_LL=y
1125# 1079#
1126# CONFIG_KEYS is not set 1080# CONFIG_KEYS is not set
1127# CONFIG_SECURITY is not set 1081# CONFIG_SECURITY is not set
1128 1082CONFIG_XOR_BLOCKS=y
1129# 1083CONFIG_ASYNC_CORE=y
1130# Cryptographic options 1084CONFIG_ASYNC_MEMCPY=y
1131# 1085CONFIG_ASYNC_XOR=y
1132# CONFIG_CRYPTO is not set 1086# CONFIG_CRYPTO is not set
1133 1087
1134# 1088#
@@ -1136,7 +1090,12 @@ CONFIG_DEBUG_LL=y
1136# 1090#
1137# CONFIG_CRC_CCITT is not set 1091# CONFIG_CRC_CCITT is not set
1138# CONFIG_CRC16 is not set 1092# CONFIG_CRC16 is not set
1093# CONFIG_CRC_ITU_T is not set
1139# CONFIG_CRC32 is not set 1094# CONFIG_CRC32 is not set
1095# CONFIG_CRC7 is not set
1140# CONFIG_LIBCRC32C is not set 1096# CONFIG_LIBCRC32C is not set
1097CONFIG_ZLIB_INFLATE=y
1141CONFIG_PLIST=y 1098CONFIG_PLIST=y
1142CONFIG_IOMAP_COPY=y 1099CONFIG_HAS_IOMEM=y
1100CONFIG_HAS_IOPORT=y
1101CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/rpc_defconfig b/arch/arm/configs/rpc_defconfig
index 8452dc8c7cc3..5ddecb9ddf01 100644
--- a/arch/arm/configs/rpc_defconfig
+++ b/arch/arm/configs/rpc_defconfig
@@ -1,87 +1,150 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.11 3# Linux kernel version: 2.6.23-rc2
4# Wed Mar 9 14:41:48 2005 4# Mon Aug 6 16:47:24 2007
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8# CONFIG_GENERIC_GPIO is not set
9# CONFIG_GENERIC_TIME is not set
10# CONFIG_GENERIC_CLOCKEVENTS is not set
7CONFIG_MMU=y 11CONFIG_MMU=y
8CONFIG_UID16=y 12CONFIG_NO_IOPORT=y
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_LOCKDEP_SUPPORT=y
16CONFIG_TRACE_IRQFLAGS_SUPPORT=y
17CONFIG_HARDIRQS_SW_RESEND=y
18CONFIG_GENERIC_IRQ_PROBE=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y 19CONFIG_RWSEM_GENERIC_SPINLOCK=y
20# CONFIG_ARCH_HAS_ILOG2_U32 is not set
21# CONFIG_ARCH_HAS_ILOG2_U64 is not set
22CONFIG_GENERIC_HWEIGHT=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y 23CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y 24CONFIG_ARCH_MAY_HAVE_PC_FDC=y
25CONFIG_ZONE_DMA=y
12CONFIG_FIQ=y 26CONFIG_FIQ=y
27CONFIG_VECTORS_BASE=0xffff0000
28CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
13 29
14# 30#
15# Code maturity level options 31# General setup
16# 32#
17CONFIG_EXPERIMENTAL=y 33CONFIG_EXPERIMENTAL=y
18CONFIG_CLEAN_COMPILE=y
19CONFIG_BROKEN_ON_SMP=y 34CONFIG_BROKEN_ON_SMP=y
20 35CONFIG_INIT_ENV_ARG_LIMIT=32
21#
22# General setup
23#
24CONFIG_LOCALVERSION="" 36CONFIG_LOCALVERSION=""
37# CONFIG_LOCALVERSION_AUTO is not set
25CONFIG_SWAP=y 38CONFIG_SWAP=y
26CONFIG_SYSVIPC=y 39CONFIG_SYSVIPC=y
40CONFIG_SYSVIPC_SYSCTL=y
27# CONFIG_POSIX_MQUEUE is not set 41# CONFIG_POSIX_MQUEUE is not set
28# CONFIG_BSD_PROCESS_ACCT is not set 42# CONFIG_BSD_PROCESS_ACCT is not set
29CONFIG_SYSCTL=y 43# CONFIG_TASKSTATS is not set
44# CONFIG_USER_NS is not set
30# CONFIG_AUDIT is not set 45# CONFIG_AUDIT is not set
31CONFIG_LOG_BUF_SHIFT=14
32# CONFIG_HOTPLUG is not set
33CONFIG_KOBJECT_UEVENT=y
34# CONFIG_IKCONFIG is not set 46# CONFIG_IKCONFIG is not set
47CONFIG_LOG_BUF_SHIFT=14
48CONFIG_SYSFS_DEPRECATED=y
49# CONFIG_RELAY is not set
50CONFIG_BLK_DEV_INITRD=y
51CONFIG_INITRAMFS_SOURCE=""
52CONFIG_CC_OPTIMIZE_FOR_SIZE=y
53CONFIG_SYSCTL=y
35# CONFIG_EMBEDDED is not set 54# CONFIG_EMBEDDED is not set
55CONFIG_UID16=y
56CONFIG_SYSCTL_SYSCALL=y
36CONFIG_KALLSYMS=y 57CONFIG_KALLSYMS=y
37# CONFIG_KALLSYMS_ALL is not set 58# CONFIG_KALLSYMS_ALL is not set
38# CONFIG_KALLSYMS_EXTRA_PASS is not set 59# CONFIG_KALLSYMS_EXTRA_PASS is not set
60CONFIG_HOTPLUG=y
61CONFIG_PRINTK=y
62CONFIG_BUG=y
63CONFIG_ELF_CORE=y
39CONFIG_BASE_FULL=y 64CONFIG_BASE_FULL=y
40CONFIG_FUTEX=y 65CONFIG_FUTEX=y
66CONFIG_ANON_INODES=y
41CONFIG_EPOLL=y 67CONFIG_EPOLL=y
42CONFIG_CC_OPTIMIZE_FOR_SIZE=y 68CONFIG_SIGNALFD=y
69CONFIG_TIMERFD=y
70CONFIG_EVENTFD=y
43CONFIG_SHMEM=y 71CONFIG_SHMEM=y
44CONFIG_CC_ALIGN_FUNCTIONS=0 72CONFIG_VM_EVENT_COUNTERS=y
45CONFIG_CC_ALIGN_LABELS=0 73CONFIG_SLAB=y
46CONFIG_CC_ALIGN_LOOPS=0 74# CONFIG_SLUB is not set
47CONFIG_CC_ALIGN_JUMPS=0 75# CONFIG_SLOB is not set
76CONFIG_RT_MUTEXES=y
48# CONFIG_TINY_SHMEM is not set 77# CONFIG_TINY_SHMEM is not set
49CONFIG_BASE_SMALL=0 78CONFIG_BASE_SMALL=0
50
51#
52# Loadable module support
53#
54CONFIG_MODULES=y 79CONFIG_MODULES=y
55CONFIG_MODULE_UNLOAD=y 80CONFIG_MODULE_UNLOAD=y
56# CONFIG_MODULE_FORCE_UNLOAD is not set 81# CONFIG_MODULE_FORCE_UNLOAD is not set
57CONFIG_OBSOLETE_MODPARM=y
58# CONFIG_MODVERSIONS is not set 82# CONFIG_MODVERSIONS is not set
59# CONFIG_MODULE_SRCVERSION_ALL is not set 83# CONFIG_MODULE_SRCVERSION_ALL is not set
60CONFIG_KMOD=y 84CONFIG_KMOD=y
85CONFIG_BLOCK=y
86# CONFIG_LBD is not set
87# CONFIG_BLK_DEV_IO_TRACE is not set
88# CONFIG_LSF is not set
89# CONFIG_BLK_DEV_BSG is not set
90
91#
92# IO Schedulers
93#
94CONFIG_IOSCHED_NOOP=y
95CONFIG_IOSCHED_AS=y
96CONFIG_IOSCHED_DEADLINE=y
97CONFIG_IOSCHED_CFQ=y
98# CONFIG_DEFAULT_AS is not set
99# CONFIG_DEFAULT_DEADLINE is not set
100CONFIG_DEFAULT_CFQ=y
101# CONFIG_DEFAULT_NOOP is not set
102CONFIG_DEFAULT_IOSCHED="cfq"
61 103
62# 104#
63# System Type 105# System Type
64# 106#
107# CONFIG_ARCH_AAEC2000 is not set
108# CONFIG_ARCH_INTEGRATOR is not set
109# CONFIG_ARCH_REALVIEW is not set
110# CONFIG_ARCH_VERSATILE is not set
111# CONFIG_ARCH_AT91 is not set
65# CONFIG_ARCH_CLPS7500 is not set 112# CONFIG_ARCH_CLPS7500 is not set
66# CONFIG_ARCH_CLPS711X is not set 113# CONFIG_ARCH_CLPS711X is not set
67# CONFIG_ARCH_CO285 is not set 114# CONFIG_ARCH_CO285 is not set
68# CONFIG_ARCH_EBSA110 is not set 115# CONFIG_ARCH_EBSA110 is not set
116# CONFIG_ARCH_EP93XX is not set
69# CONFIG_ARCH_FOOTBRIDGE is not set 117# CONFIG_ARCH_FOOTBRIDGE is not set
70# CONFIG_ARCH_INTEGRATOR is not set 118# CONFIG_ARCH_NETX is not set
71# CONFIG_ARCH_IOP3XX is not set 119# CONFIG_ARCH_H720X is not set
72# CONFIG_ARCH_IXP4XX is not set 120# CONFIG_ARCH_IMX is not set
121# CONFIG_ARCH_IOP13XX is not set
122# CONFIG_ARCH_IOP32X is not set
123# CONFIG_ARCH_IOP33X is not set
124# CONFIG_ARCH_IXP23XX is not set
73# CONFIG_ARCH_IXP2000 is not set 125# CONFIG_ARCH_IXP2000 is not set
126# CONFIG_ARCH_IXP4XX is not set
74# CONFIG_ARCH_L7200 is not set 127# CONFIG_ARCH_L7200 is not set
128# CONFIG_ARCH_KS8695 is not set
129# CONFIG_ARCH_NS9XXX is not set
130# CONFIG_ARCH_MXC is not set
131# CONFIG_ARCH_PNX4008 is not set
75# CONFIG_ARCH_PXA is not set 132# CONFIG_ARCH_PXA is not set
76CONFIG_ARCH_RPC=y 133CONFIG_ARCH_RPC=y
77# CONFIG_ARCH_SA1100 is not set 134# CONFIG_ARCH_SA1100 is not set
78# CONFIG_ARCH_S3C2410 is not set 135# CONFIG_ARCH_S3C2410 is not set
79# CONFIG_ARCH_SHARK is not set 136# CONFIG_ARCH_SHARK is not set
80# CONFIG_ARCH_LH7A40X is not set 137# CONFIG_ARCH_LH7A40X is not set
138# CONFIG_ARCH_DAVINCI is not set
81# CONFIG_ARCH_OMAP is not set 139# CONFIG_ARCH_OMAP is not set
82# CONFIG_ARCH_VERSATILE is not set 140
83# CONFIG_ARCH_IMX is not set 141#
84# CONFIG_ARCH_H720X is not set 142# Boot options
143#
144
145#
146# Power management
147#
85CONFIG_ARCH_ACORN=y 148CONFIG_ARCH_ACORN=y
86 149
87# 150#
@@ -100,15 +163,22 @@ CONFIG_CPU_COPY_V3=y
100CONFIG_CPU_COPY_V4WB=y 163CONFIG_CPU_COPY_V4WB=y
101CONFIG_CPU_TLB_V3=y 164CONFIG_CPU_TLB_V3=y
102CONFIG_CPU_TLB_V4WB=y 165CONFIG_CPU_TLB_V4WB=y
166CONFIG_CPU_CP15=y
167CONFIG_CPU_CP15_MMU=y
103 168
104# 169#
105# Processor Features 170# Processor Features
106# 171#
172# CONFIG_CPU_DCACHE_DISABLE is not set
173# CONFIG_OUTER_CACHE is not set
107CONFIG_TIMER_ACORN=y 174CONFIG_TIMER_ACORN=y
108 175
109# 176#
110# Bus support 177# Bus support
111# 178#
179CONFIG_ISA_DMA_API=y
180# CONFIG_PCI_SYSCALL is not set
181# CONFIG_ARCH_SUPPORTS_MSI is not set
112 182
113# 183#
114# PCCARD (PCMCIA/CardBus) support 184# PCCARD (PCMCIA/CardBus) support
@@ -116,13 +186,26 @@ CONFIG_TIMER_ACORN=y
116# CONFIG_PCCARD is not set 186# CONFIG_PCCARD is not set
117 187
118# 188#
119# PC-card bridges
120#
121
122#
123# Kernel Features 189# Kernel Features
124# 190#
191# CONFIG_TICK_ONESHOT is not set
125# CONFIG_PREEMPT is not set 192# CONFIG_PREEMPT is not set
193# CONFIG_NO_IDLE_HZ is not set
194CONFIG_HZ=100
195# CONFIG_AEABI is not set
196# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
197CONFIG_SELECT_MEMORY_MODEL=y
198CONFIG_FLATMEM_MANUAL=y
199# CONFIG_DISCONTIGMEM_MANUAL is not set
200# CONFIG_SPARSEMEM_MANUAL is not set
201CONFIG_FLATMEM=y
202CONFIG_FLAT_NODE_MEM_MAP=y
203# CONFIG_SPARSEMEM_STATIC is not set
204CONFIG_SPLIT_PTLOCK_CPUS=4096
205# CONFIG_RESOURCES_64BIT is not set
206CONFIG_ZONE_DMA_FLAG=1
207CONFIG_BOUNCE=y
208CONFIG_VIRT_TO_BUS=y
126CONFIG_ALIGNMENT_TRAP=y 209CONFIG_ALIGNMENT_TRAP=y
127 210
128# 211#
@@ -132,6 +215,7 @@ CONFIG_ZBOOT_ROM_TEXT=0x0
132CONFIG_ZBOOT_ROM_BSS=0x0 215CONFIG_ZBOOT_ROM_BSS=0x0
133CONFIG_CMDLINE="" 216CONFIG_CMDLINE=""
134# CONFIG_XIP_KERNEL is not set 217# CONFIG_XIP_KERNEL is not set
218# CONFIG_KEXEC is not set
135 219
136# 220#
137# Floating point emulation 221# Floating point emulation
@@ -157,41 +241,122 @@ CONFIG_BINFMT_AOUT=y
157# CONFIG_PM is not set 241# CONFIG_PM is not set
158 242
159# 243#
160# Device Drivers 244# Networking
161# 245#
246CONFIG_NET=y
162 247
163# 248#
164# Generic Driver Options 249# Networking options
165# 250#
166CONFIG_STANDALONE=y 251CONFIG_PACKET=y
167CONFIG_PREVENT_FIRMWARE_BUILD=y 252CONFIG_PACKET_MMAP=y
168# CONFIG_FW_LOADER is not set 253CONFIG_UNIX=y
169# CONFIG_DEBUG_DRIVER is not set 254# CONFIG_NET_KEY is not set
255CONFIG_INET=y
256CONFIG_IP_MULTICAST=y
257# CONFIG_IP_ADVANCED_ROUTER is not set
258CONFIG_IP_FIB_HASH=y
259# CONFIG_IP_PNP is not set
260# CONFIG_NET_IPIP is not set
261# CONFIG_NET_IPGRE is not set
262# CONFIG_IP_MROUTE is not set
263# CONFIG_ARPD is not set
264# CONFIG_SYN_COOKIES is not set
265# CONFIG_INET_AH is not set
266# CONFIG_INET_ESP is not set
267# CONFIG_INET_IPCOMP is not set
268# CONFIG_INET_XFRM_TUNNEL is not set
269CONFIG_INET_TUNNEL=m
270# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
271# CONFIG_INET_XFRM_MODE_TUNNEL is not set
272# CONFIG_INET_XFRM_MODE_BEET is not set
273CONFIG_INET_DIAG=y
274CONFIG_INET_TCP_DIAG=y
275# CONFIG_TCP_CONG_ADVANCED is not set
276CONFIG_TCP_CONG_CUBIC=y
277CONFIG_DEFAULT_TCP_CONG="cubic"
278# CONFIG_TCP_MD5SIG is not set
279CONFIG_IPV6=m
280# CONFIG_IPV6_PRIVACY is not set
281# CONFIG_IPV6_ROUTER_PREF is not set
282# CONFIG_IPV6_OPTIMISTIC_DAD is not set
283# CONFIG_INET6_AH is not set
284# CONFIG_INET6_ESP is not set
285# CONFIG_INET6_IPCOMP is not set
286# CONFIG_IPV6_MIP6 is not set
287# CONFIG_INET6_XFRM_TUNNEL is not set
288# CONFIG_INET6_TUNNEL is not set
289# CONFIG_INET6_XFRM_MODE_TRANSPORT is not set
290# CONFIG_INET6_XFRM_MODE_TUNNEL is not set
291# CONFIG_INET6_XFRM_MODE_BEET is not set
292# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
293CONFIG_IPV6_SIT=m
294# CONFIG_IPV6_TUNNEL is not set
295# CONFIG_IPV6_MULTIPLE_TABLES is not set
296# CONFIG_NETWORK_SECMARK is not set
297# CONFIG_NETFILTER is not set
298# CONFIG_IP_DCCP is not set
299# CONFIG_IP_SCTP is not set
300# CONFIG_TIPC is not set
301# CONFIG_ATM is not set
302# CONFIG_BRIDGE is not set
303# CONFIG_VLAN_8021Q is not set
304# CONFIG_DECNET is not set
305# CONFIG_LLC2 is not set
306# CONFIG_IPX is not set
307# CONFIG_ATALK is not set
308# CONFIG_X25 is not set
309# CONFIG_LAPB is not set
310# CONFIG_ECONET is not set
311# CONFIG_WAN_ROUTER is not set
170 312
171# 313#
172# Memory Technology Devices (MTD) 314# QoS and/or fair queueing
173# 315#
174# CONFIG_MTD is not set 316# CONFIG_NET_SCHED is not set
175 317
176# 318#
177# Parallel port support 319# Network testing
178# 320#
179CONFIG_PARPORT=y 321# CONFIG_NET_PKTGEN is not set
180CONFIG_PARPORT_PC=y 322# CONFIG_HAMRADIO is not set
181CONFIG_PARPORT_PC_CML1=y 323# CONFIG_IRDA is not set
182CONFIG_PARPORT_PC_FIFO=y 324# CONFIG_BT is not set
183# CONFIG_PARPORT_PC_SUPERIO is not set 325# CONFIG_AF_RXRPC is not set
184# CONFIG_PARPORT_ARC is not set 326
185# CONFIG_PARPORT_OTHER is not set 327#
186# CONFIG_PARPORT_1284 is not set 328# Wireless
329#
330# CONFIG_CFG80211 is not set
331# CONFIG_WIRELESS_EXT is not set
332# CONFIG_MAC80211 is not set
333# CONFIG_IEEE80211 is not set
334# CONFIG_RFKILL is not set
335# CONFIG_NET_9P is not set
187 336
188# 337#
189# Plug and Play support 338# Device Drivers
190# 339#
191 340
192# 341#
193# Block devices 342# Generic Driver Options
194# 343#
344CONFIG_STANDALONE=y
345CONFIG_PREVENT_FIRMWARE_BUILD=y
346# CONFIG_FW_LOADER is not set
347# CONFIG_DEBUG_DRIVER is not set
348# CONFIG_DEBUG_DEVRES is not set
349# CONFIG_SYS_HYPERVISOR is not set
350# CONFIG_CONNECTOR is not set
351# CONFIG_MTD is not set
352CONFIG_PARPORT=y
353CONFIG_PARPORT_PC=y
354CONFIG_PARPORT_PC_FIFO=y
355# CONFIG_PARPORT_PC_SUPERIO is not set
356# CONFIG_PARPORT_GSC is not set
357# CONFIG_PARPORT_AX88796 is not set
358# CONFIG_PARPORT_1284 is not set
359CONFIG_BLK_DEV=y
195CONFIG_BLK_DEV_FD=y 360CONFIG_BLK_DEV_FD=y
196# CONFIG_PARIDE is not set 361# CONFIG_PARIDE is not set
197# CONFIG_BLK_DEV_COW_COMMON is not set 362# CONFIG_BLK_DEV_COW_COMMON is not set
@@ -201,59 +366,19 @@ CONFIG_BLK_DEV_LOOP=m
201CONFIG_BLK_DEV_RAM=y 366CONFIG_BLK_DEV_RAM=y
202CONFIG_BLK_DEV_RAM_COUNT=16 367CONFIG_BLK_DEV_RAM_COUNT=16
203CONFIG_BLK_DEV_RAM_SIZE=4096 368CONFIG_BLK_DEV_RAM_SIZE=4096
204CONFIG_BLK_DEV_INITRD=y 369CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
205CONFIG_INITRAMFS_SOURCE=""
206# CONFIG_CDROM_PKTCDVD is not set 370# CONFIG_CDROM_PKTCDVD is not set
207
208#
209# IO Schedulers
210#
211CONFIG_IOSCHED_NOOP=y
212CONFIG_IOSCHED_AS=y
213CONFIG_IOSCHED_DEADLINE=y
214CONFIG_IOSCHED_CFQ=y
215# CONFIG_ATA_OVER_ETH is not set 371# CONFIG_ATA_OVER_ETH is not set
216 372# CONFIG_IDE is not set
217#
218# Acorn-specific block devices
219#
220
221#
222# ATA/ATAPI/MFM/RLL support
223#
224CONFIG_IDE=y
225CONFIG_BLK_DEV_IDE=y
226
227#
228# Please see Documentation/ide.txt for help/info on IDE drives
229#
230# CONFIG_BLK_DEV_IDE_SATA is not set
231CONFIG_BLK_DEV_IDEDISK=y
232CONFIG_IDEDISK_MULTI_MODE=y
233CONFIG_BLK_DEV_IDECD=y
234# CONFIG_BLK_DEV_IDETAPE is not set
235# CONFIG_BLK_DEV_IDEFLOPPY is not set
236# CONFIG_BLK_DEV_IDESCSI is not set
237# CONFIG_IDE_TASK_IOCTL is not set
238
239#
240# IDE chipset support/bugfixes
241#
242CONFIG_IDE_GENERIC=y
243CONFIG_IDE_ARM=y
244CONFIG_BLK_DEV_IDE_ICSIDE=y
245CONFIG_BLK_DEV_IDEDMA_ICS=y
246CONFIG_IDEDMA_ICS_AUTO=y
247CONFIG_BLK_DEV_IDE_RAPIDE=y
248CONFIG_BLK_DEV_IDEDMA=y
249# CONFIG_IDEDMA_IVB is not set
250CONFIG_IDEDMA_AUTO=y
251# CONFIG_BLK_DEV_HD is not set
252 373
253# 374#
254# SCSI device support 375# SCSI device support
255# 376#
377# CONFIG_RAID_ATTRS is not set
256CONFIG_SCSI=y 378CONFIG_SCSI=y
379CONFIG_SCSI_DMA=y
380# CONFIG_SCSI_TGT is not set
381# CONFIG_SCSI_NETLINK is not set
257CONFIG_SCSI_PROC_FS=y 382CONFIG_SCSI_PROC_FS=y
258 383
259# 384#
@@ -265,6 +390,7 @@ CONFIG_CHR_DEV_ST=m
265CONFIG_BLK_DEV_SR=y 390CONFIG_BLK_DEV_SR=y
266CONFIG_BLK_DEV_SR_VENDOR=y 391CONFIG_BLK_DEV_SR_VENDOR=y
267CONFIG_CHR_DEV_SG=y 392CONFIG_CHR_DEV_SG=y
393# CONFIG_CHR_DEV_SCH is not set
268 394
269# 395#
270# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 396# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
@@ -272,26 +398,23 @@ CONFIG_CHR_DEV_SG=y
272# CONFIG_SCSI_MULTI_LUN is not set 398# CONFIG_SCSI_MULTI_LUN is not set
273CONFIG_SCSI_CONSTANTS=y 399CONFIG_SCSI_CONSTANTS=y
274CONFIG_SCSI_LOGGING=y 400CONFIG_SCSI_LOGGING=y
401# CONFIG_SCSI_SCAN_ASYNC is not set
402CONFIG_SCSI_WAIT_SCAN=m
275 403
276# 404#
277# SCSI Transport Attributes 405# SCSI Transports
278# 406#
279# CONFIG_SCSI_SPI_ATTRS is not set 407CONFIG_SCSI_SPI_ATTRS=m
280# CONFIG_SCSI_FC_ATTRS is not set 408# CONFIG_SCSI_FC_ATTRS is not set
281# CONFIG_SCSI_ISCSI_ATTRS is not set 409# CONFIG_SCSI_ISCSI_ATTRS is not set
282 410# CONFIG_SCSI_SAS_LIBSAS is not set
283# 411CONFIG_SCSI_LOWLEVEL=y
284# SCSI low-level drivers 412# CONFIG_ISCSI_TCP is not set
285# 413# CONFIG_SCSI_PPA is not set
286# CONFIG_SCSI_SATA is not set 414# CONFIG_SCSI_IMM is not set
287CONFIG_SCSI_PPA=m
288CONFIG_SCSI_IMM=m
289# CONFIG_SCSI_IZIP_EPP16 is not set 415# CONFIG_SCSI_IZIP_EPP16 is not set
290# CONFIG_SCSI_IZIP_SLOW_CTR is not set 416# CONFIG_SCSI_IZIP_SLOW_CTR is not set
291# CONFIG_SCSI_DEBUG is not set 417# CONFIG_SCSI_DEBUG is not set
292CONFIG_SCSI_ACORNSCSI_3=m
293CONFIG_SCSI_ACORNSCSI_TAGGED_QUEUE=y
294CONFIG_SCSI_ACORNSCSI_SYNC=y
295CONFIG_SCSI_ARXESCSI=m 418CONFIG_SCSI_ARXESCSI=m
296CONFIG_SCSI_CUMANA_2=m 419CONFIG_SCSI_CUMANA_2=m
297CONFIG_SCSI_EESOXSCSI=m 420CONFIG_SCSI_EESOXSCSI=m
@@ -302,129 +425,36 @@ CONFIG_SCSI_POWERTECSCSI=y
302# 425#
303CONFIG_SCSI_CUMANA_1=m 426CONFIG_SCSI_CUMANA_1=m
304CONFIG_SCSI_OAK1=m 427CONFIG_SCSI_OAK1=m
305 428CONFIG_ATA=y
306# 429# CONFIG_ATA_NONSTANDARD is not set
307# Multi-device support (RAID and LVM) 430CONFIG_PATA_PLATFORM=y
308# 431CONFIG_PATA_ICSIDE=y
309# CONFIG_MD is not set 432# CONFIG_MD is not set
310
311#
312# Fusion MPT device support
313#
314
315#
316# IEEE 1394 (FireWire) support
317#
318
319#
320# I2O device support
321#
322
323#
324# Networking support
325#
326CONFIG_NET=y
327
328#
329# Networking options
330#
331# CONFIG_PACKET is not set
332CONFIG_NETLINK_DEV=y
333CONFIG_UNIX=y
334# CONFIG_NET_KEY is not set
335CONFIG_INET=y
336CONFIG_IP_MULTICAST=y
337# CONFIG_IP_ADVANCED_ROUTER is not set
338# CONFIG_IP_PNP is not set
339# CONFIG_NET_IPIP is not set
340# CONFIG_NET_IPGRE is not set
341# CONFIG_IP_MROUTE is not set
342# CONFIG_ARPD is not set
343# CONFIG_SYN_COOKIES is not set
344# CONFIG_INET_AH is not set
345# CONFIG_INET_ESP is not set
346# CONFIG_INET_IPCOMP is not set
347# CONFIG_INET_TUNNEL is not set
348# CONFIG_IP_TCPDIAG is not set
349# CONFIG_IP_TCPDIAG_IPV6 is not set
350CONFIG_IPV6=m
351# CONFIG_IPV6_PRIVACY is not set
352# CONFIG_INET6_AH is not set
353# CONFIG_INET6_ESP is not set
354# CONFIG_INET6_IPCOMP is not set
355# CONFIG_INET6_TUNNEL is not set
356# CONFIG_IPV6_TUNNEL is not set
357# CONFIG_NETFILTER is not set
358
359#
360# SCTP Configuration (EXPERIMENTAL)
361#
362# CONFIG_IP_SCTP is not set
363# CONFIG_ATM is not set
364# CONFIG_BRIDGE is not set
365# CONFIG_VLAN_8021Q is not set
366# CONFIG_DECNET is not set
367# CONFIG_LLC2 is not set
368# CONFIG_IPX is not set
369# CONFIG_ATALK is not set
370# CONFIG_X25 is not set
371# CONFIG_LAPB is not set
372# CONFIG_NET_DIVERT is not set
373# CONFIG_ECONET is not set
374# CONFIG_WAN_ROUTER is not set
375
376#
377# QoS and/or fair queueing
378#
379# CONFIG_NET_SCHED is not set
380# CONFIG_NET_CLS_ROUTE is not set
381
382#
383# Network testing
384#
385# CONFIG_NET_PKTGEN is not set
386# CONFIG_NETPOLL is not set
387# CONFIG_NET_POLL_CONTROLLER is not set
388# CONFIG_HAMRADIO is not set
389# CONFIG_IRDA is not set
390# CONFIG_BT is not set
391CONFIG_NETDEVICES=y 433CONFIG_NETDEVICES=y
434# CONFIG_NETDEVICES_MULTIQUEUE is not set
392# CONFIG_DUMMY is not set 435# CONFIG_DUMMY is not set
393# CONFIG_BONDING is not set 436# CONFIG_BONDING is not set
437# CONFIG_MACVLAN is not set
394# CONFIG_EQUALIZER is not set 438# CONFIG_EQUALIZER is not set
395# CONFIG_TUN is not set 439# CONFIG_TUN is not set
396# CONFIG_ETHERTAP is not set 440# CONFIG_PHYLIB is not set
397
398#
399# Ethernet (10 or 100Mbit)
400#
401CONFIG_NET_ETHERNET=y 441CONFIG_NET_ETHERNET=y
402# CONFIG_MII is not set 442# CONFIG_MII is not set
403CONFIG_ARM_ETHER1=y 443CONFIG_ARM_ETHER1=y
404CONFIG_ARM_ETHER3=y 444CONFIG_ARM_ETHER3=y
405CONFIG_ARM_ETHERH=y 445CONFIG_ARM_ETHERH=y
446# CONFIG_AX88796 is not set
406# CONFIG_SMC91X is not set 447# CONFIG_SMC91X is not set
448# CONFIG_DM9000 is not set
449# CONFIG_NET_POCKET is not set
450# CONFIG_NETDEV_1000 is not set
451# CONFIG_NETDEV_10000 is not set
407 452
408# 453#
409# Ethernet (1000 Mbit) 454# Wireless LAN
410#
411
412#
413# Ethernet (10000 Mbit)
414#
415
416#
417# Token Ring devices
418#
419
420#
421# Wireless LAN (non-hamradio)
422#
423# CONFIG_NET_RADIO is not set
424
425#
426# Wan interfaces
427# 455#
456# CONFIG_WLAN_PRE80211 is not set
457# CONFIG_WLAN_80211 is not set
428# CONFIG_WAN is not set 458# CONFIG_WAN is not set
429# CONFIG_PLIP is not set 459# CONFIG_PLIP is not set
430CONFIG_PPP=m 460CONFIG_PPP=m
@@ -434,20 +464,23 @@ CONFIG_PPP=m
434# CONFIG_PPP_SYNC_TTY is not set 464# CONFIG_PPP_SYNC_TTY is not set
435# CONFIG_PPP_DEFLATE is not set 465# CONFIG_PPP_DEFLATE is not set
436# CONFIG_PPP_BSDCOMP is not set 466# CONFIG_PPP_BSDCOMP is not set
467# CONFIG_PPP_MPPE is not set
437CONFIG_PPPOE=m 468CONFIG_PPPOE=m
469# CONFIG_PPPOL2TP is not set
438# CONFIG_SLIP is not set 470# CONFIG_SLIP is not set
471CONFIG_SLHC=m
439# CONFIG_SHAPER is not set 472# CONFIG_SHAPER is not set
440# CONFIG_NETCONSOLE is not set 473# CONFIG_NETCONSOLE is not set
441 474# CONFIG_NETPOLL is not set
442# 475# CONFIG_NET_POLL_CONTROLLER is not set
443# ISDN subsystem
444#
445# CONFIG_ISDN is not set 476# CONFIG_ISDN is not set
446 477
447# 478#
448# Input device support 479# Input device support
449# 480#
450CONFIG_INPUT=y 481CONFIG_INPUT=y
482# CONFIG_INPUT_FF_MEMLESS is not set
483# CONFIG_INPUT_POLLDEV is not set
451 484
452# 485#
453# Userland interfaces 486# Userland interfaces
@@ -462,19 +495,6 @@ CONFIG_INPUT_EVDEV=y
462# CONFIG_INPUT_EVBUG is not set 495# CONFIG_INPUT_EVBUG is not set
463 496
464# 497#
465# Input I/O drivers
466#
467# CONFIG_GAMEPORT is not set
468CONFIG_SOUND_GAMEPORT=y
469CONFIG_SERIO=y
470# CONFIG_SERIO_SERPORT is not set
471# CONFIG_SERIO_CT82C710 is not set
472# CONFIG_SERIO_PARKBD is not set
473CONFIG_SERIO_RPCKBD=y
474CONFIG_SERIO_LIBPS2=y
475# CONFIG_SERIO_RAW is not set
476
477#
478# Input Device Drivers 498# Input Device Drivers
479# 499#
480CONFIG_INPUT_KEYBOARD=y 500CONFIG_INPUT_KEYBOARD=y
@@ -483,21 +503,35 @@ CONFIG_KEYBOARD_ATKBD=y
483# CONFIG_KEYBOARD_LKKBD is not set 503# CONFIG_KEYBOARD_LKKBD is not set
484# CONFIG_KEYBOARD_XTKBD is not set 504# CONFIG_KEYBOARD_XTKBD is not set
485# CONFIG_KEYBOARD_NEWTON is not set 505# CONFIG_KEYBOARD_NEWTON is not set
506# CONFIG_KEYBOARD_STOWAWAY is not set
486CONFIG_INPUT_MOUSE=y 507CONFIG_INPUT_MOUSE=y
487# CONFIG_MOUSE_PS2 is not set 508# CONFIG_MOUSE_PS2 is not set
488# CONFIG_MOUSE_SERIAL is not set 509# CONFIG_MOUSE_SERIAL is not set
489CONFIG_MOUSE_RISCPC=y 510CONFIG_MOUSE_RISCPC=y
490# CONFIG_MOUSE_VSXXXAA is not set 511# CONFIG_MOUSE_VSXXXAA is not set
491# CONFIG_INPUT_JOYSTICK is not set 512# CONFIG_INPUT_JOYSTICK is not set
513# CONFIG_INPUT_TABLET is not set
492# CONFIG_INPUT_TOUCHSCREEN is not set 514# CONFIG_INPUT_TOUCHSCREEN is not set
493# CONFIG_INPUT_MISC is not set 515# CONFIG_INPUT_MISC is not set
494 516
495# 517#
518# Hardware I/O ports
519#
520CONFIG_SERIO=y
521# CONFIG_SERIO_SERPORT is not set
522# CONFIG_SERIO_PARKBD is not set
523CONFIG_SERIO_RPCKBD=y
524CONFIG_SERIO_LIBPS2=y
525# CONFIG_SERIO_RAW is not set
526# CONFIG_GAMEPORT is not set
527
528#
496# Character devices 529# Character devices
497# 530#
498CONFIG_VT=y 531CONFIG_VT=y
499CONFIG_VT_CONSOLE=y 532CONFIG_VT_CONSOLE=y
500CONFIG_HW_CONSOLE=y 533CONFIG_HW_CONSOLE=y
534# CONFIG_VT_HW_CONSOLE_BINDING is not set
501# CONFIG_SERIAL_NONSTANDARD is not set 535# CONFIG_SERIAL_NONSTANDARD is not set
502 536
503# 537#
@@ -506,12 +540,13 @@ CONFIG_HW_CONSOLE=y
506CONFIG_SERIAL_8250=y 540CONFIG_SERIAL_8250=y
507CONFIG_SERIAL_8250_CONSOLE=y 541CONFIG_SERIAL_8250_CONSOLE=y
508CONFIG_SERIAL_8250_NR_UARTS=16 542CONFIG_SERIAL_8250_NR_UARTS=16
543CONFIG_SERIAL_8250_RUNTIME_UARTS=8
509# CONFIG_SERIAL_8250_EXTENDED is not set 544# CONFIG_SERIAL_8250_EXTENDED is not set
545CONFIG_SERIAL_8250_ACORN=y
510 546
511# 547#
512# Non-8250 serial port support 548# Non-8250 serial port support
513# 549#
514CONFIG_SERIAL_8250_ACORN=y
515CONFIG_SERIAL_CORE=y 550CONFIG_SERIAL_CORE=y
516CONFIG_SERIAL_CORE_CONSOLE=y 551CONFIG_SERIAL_CORE_CONSOLE=y
517CONFIG_UNIX98_PTYS=y 552CONFIG_UNIX98_PTYS=y
@@ -521,31 +556,15 @@ CONFIG_PRINTER=m
521# CONFIG_LP_CONSOLE is not set 556# CONFIG_LP_CONSOLE is not set
522# CONFIG_PPDEV is not set 557# CONFIG_PPDEV is not set
523# CONFIG_TIPAR is not set 558# CONFIG_TIPAR is not set
524
525#
526# IPMI
527#
528# CONFIG_IPMI_HANDLER is not set 559# CONFIG_IPMI_HANDLER is not set
529
530#
531# Watchdog Cards
532#
533# CONFIG_WATCHDOG is not set 560# CONFIG_WATCHDOG is not set
561# CONFIG_HW_RANDOM is not set
534# CONFIG_NVRAM is not set 562# CONFIG_NVRAM is not set
535# CONFIG_RTC is not set
536# CONFIG_DTLK is not set
537# CONFIG_R3964 is not set 563# CONFIG_R3964 is not set
538
539#
540# Ftape, the floppy tape device driver
541#
542# CONFIG_DRM is not set
543# CONFIG_RAW_DRIVER is not set 564# CONFIG_RAW_DRIVER is not set
544 565# CONFIG_TCG_TPM is not set
545#
546# I2C support
547#
548CONFIG_I2C=y 566CONFIG_I2C=y
567CONFIG_I2C_BOARDINFO=y
549CONFIG_I2C_CHARDEV=y 568CONFIG_I2C_CHARDEV=y
550 569
551# 570#
@@ -558,76 +577,87 @@ CONFIG_I2C_ALGOBIT=y
558# 577#
559# I2C Hardware Bus support 578# I2C Hardware Bus support
560# 579#
580# CONFIG_I2C_OCORES is not set
561# CONFIG_I2C_PARPORT is not set 581# CONFIG_I2C_PARPORT is not set
562# CONFIG_I2C_PARPORT_LIGHT is not set 582# CONFIG_I2C_PARPORT_LIGHT is not set
583# CONFIG_I2C_SIMTEC is not set
584# CONFIG_I2C_TAOS_EVM is not set
563# CONFIG_I2C_STUB is not set 585# CONFIG_I2C_STUB is not set
564# CONFIG_I2C_PCA_ISA is not set 586CONFIG_I2C_ACORN=y
565 587
566# 588#
567# Hardware Sensors Chip support 589# Miscellaneous I2C Chip support
568#
569# CONFIG_I2C_SENSOR is not set
570# CONFIG_SENSORS_ADM1021 is not set
571# CONFIG_SENSORS_ADM1025 is not set
572# CONFIG_SENSORS_ADM1026 is not set
573# CONFIG_SENSORS_ADM1031 is not set
574# CONFIG_SENSORS_ASB100 is not set
575# CONFIG_SENSORS_DS1621 is not set
576# CONFIG_SENSORS_FSCHER is not set
577# CONFIG_SENSORS_FSCPOS is not set
578# CONFIG_SENSORS_GL518SM is not set
579# CONFIG_SENSORS_GL520SM is not set
580# CONFIG_SENSORS_IT87 is not set
581# CONFIG_SENSORS_LM63 is not set
582# CONFIG_SENSORS_LM75 is not set
583# CONFIG_SENSORS_LM77 is not set
584# CONFIG_SENSORS_LM78 is not set
585# CONFIG_SENSORS_LM80 is not set
586# CONFIG_SENSORS_LM83 is not set
587# CONFIG_SENSORS_LM85 is not set
588# CONFIG_SENSORS_LM87 is not set
589# CONFIG_SENSORS_LM90 is not set
590# CONFIG_SENSORS_MAX1619 is not set
591# CONFIG_SENSORS_PC87360 is not set
592# CONFIG_SENSORS_SMSC47B397 is not set
593# CONFIG_SENSORS_SMSC47M1 is not set
594# CONFIG_SENSORS_W83781D is not set
595# CONFIG_SENSORS_W83L785TS is not set
596# CONFIG_SENSORS_W83627HF is not set
597
598#
599# Other I2C Chip support
600# 590#
591# CONFIG_SENSORS_DS1337 is not set
592# CONFIG_SENSORS_DS1374 is not set
593# CONFIG_DS1682 is not set
601# CONFIG_SENSORS_EEPROM is not set 594# CONFIG_SENSORS_EEPROM is not set
602# CONFIG_SENSORS_PCF8574 is not set 595# CONFIG_SENSORS_PCF8574 is not set
596# CONFIG_SENSORS_PCA9539 is not set
603# CONFIG_SENSORS_PCF8591 is not set 597# CONFIG_SENSORS_PCF8591 is not set
604# CONFIG_SENSORS_RTC8564 is not set 598# CONFIG_SENSORS_MAX6875 is not set
599# CONFIG_SENSORS_TSL2550 is not set
605# CONFIG_I2C_DEBUG_CORE is not set 600# CONFIG_I2C_DEBUG_CORE is not set
606# CONFIG_I2C_DEBUG_ALGO is not set 601# CONFIG_I2C_DEBUG_ALGO is not set
607# CONFIG_I2C_DEBUG_BUS is not set 602# CONFIG_I2C_DEBUG_BUS is not set
608# CONFIG_I2C_DEBUG_CHIP is not set 603# CONFIG_I2C_DEBUG_CHIP is not set
609 604
610# 605#
611# Misc devices 606# SPI support
612# 607#
608# CONFIG_SPI is not set
609# CONFIG_SPI_MASTER is not set
610# CONFIG_W1 is not set
611# CONFIG_HWMON is not set
612CONFIG_MISC_DEVICES=y
613# CONFIG_EEPROM_93CX6 is not set
614
615#
616# Multifunction device drivers
617#
618# CONFIG_MFD_SM501 is not set
619# CONFIG_NEW_LEDS is not set
613 620
614# 621#
615# Multimedia devices 622# Multimedia devices
616# 623#
617# CONFIG_VIDEO_DEV is not set 624# CONFIG_VIDEO_DEV is not set
625# CONFIG_DVB_CORE is not set
626# CONFIG_DAB is not set
618 627
619# 628#
620# Digital Video Broadcasting Devices 629# Graphics support
621# 630#
622# CONFIG_DVB is not set 631# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
623 632
624# 633#
625# Graphics support 634# Display device support
626# 635#
636# CONFIG_DISPLAY_SUPPORT is not set
637# CONFIG_VGASTATE is not set
638# CONFIG_VIDEO_OUTPUT_CONTROL is not set
627CONFIG_FB=y 639CONFIG_FB=y
640# CONFIG_FIRMWARE_EDID is not set
641# CONFIG_FB_DDC is not set
642CONFIG_FB_CFB_FILLRECT=y
643CONFIG_FB_CFB_COPYAREA=y
644CONFIG_FB_CFB_IMAGEBLIT=y
645# CONFIG_FB_SYS_FILLRECT is not set
646# CONFIG_FB_SYS_COPYAREA is not set
647# CONFIG_FB_SYS_IMAGEBLIT is not set
648# CONFIG_FB_SYS_FOPS is not set
649CONFIG_FB_DEFERRED_IO=y
650# CONFIG_FB_SVGALIB is not set
651# CONFIG_FB_MACMODES is not set
652# CONFIG_FB_BACKLIGHT is not set
628# CONFIG_FB_MODE_HELPERS is not set 653# CONFIG_FB_MODE_HELPERS is not set
629# CONFIG_FB_TILEBLITTING is not set 654# CONFIG_FB_TILEBLITTING is not set
655
656#
657# Frame buffer hardware drivers
658#
630CONFIG_FB_ACORN=y 659CONFIG_FB_ACORN=y
660# CONFIG_FB_S1D13XXX is not set
631# CONFIG_FB_VIRTUAL is not set 661# CONFIG_FB_VIRTUAL is not set
632 662
633# 663#
@@ -635,24 +665,23 @@ CONFIG_FB_ACORN=y
635# 665#
636CONFIG_DUMMY_CONSOLE=y 666CONFIG_DUMMY_CONSOLE=y
637CONFIG_FRAMEBUFFER_CONSOLE=y 667CONFIG_FRAMEBUFFER_CONSOLE=y
668# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
669# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
638CONFIG_FONTS=y 670CONFIG_FONTS=y
639# CONFIG_FONT_8x8 is not set 671# CONFIG_FONT_8x8 is not set
640CONFIG_FONT_8x16=y 672CONFIG_FONT_8x16=y
641# CONFIG_FONT_6x11 is not set 673# CONFIG_FONT_6x11 is not set
674# CONFIG_FONT_7x14 is not set
642# CONFIG_FONT_PEARL_8x8 is not set 675# CONFIG_FONT_PEARL_8x8 is not set
643CONFIG_FONT_ACORN_8x8=y 676CONFIG_FONT_ACORN_8x8=y
644# CONFIG_FONT_MINI_4x6 is not set 677# CONFIG_FONT_MINI_4x6 is not set
645# CONFIG_FONT_SUN8x16 is not set 678# CONFIG_FONT_SUN8x16 is not set
646# CONFIG_FONT_SUN12x22 is not set 679# CONFIG_FONT_SUN12x22 is not set
647 680# CONFIG_FONT_10x18 is not set
648#
649# Logo configuration
650#
651CONFIG_LOGO=y 681CONFIG_LOGO=y
652CONFIG_LOGO_LINUX_MONO=y 682CONFIG_LOGO_LINUX_MONO=y
653CONFIG_LOGO_LINUX_VGA16=y 683CONFIG_LOGO_LINUX_VGA16=y
654CONFIG_LOGO_LINUX_CLUT224=y 684CONFIG_LOGO_LINUX_CLUT224=y
655# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
656 685
657# 686#
658# Sound 687# Sound
@@ -668,91 +697,115 @@ CONFIG_SOUND=m
668# Open Sound System 697# Open Sound System
669# 698#
670CONFIG_SOUND_PRIME=m 699CONFIG_SOUND_PRIME=m
671# CONFIG_SOUND_BT878 is not set
672# CONFIG_SOUND_FUSION is not set
673# CONFIG_SOUND_CS4281 is not set
674# CONFIG_SOUND_SONICVIBES is not set
675# CONFIG_SOUND_TRIDENT is not set
676# CONFIG_SOUND_MSNDCLAS is not set 700# CONFIG_SOUND_MSNDCLAS is not set
677# CONFIG_SOUND_MSNDPIN is not set 701# CONFIG_SOUND_MSNDPIN is not set
678CONFIG_SOUND_OSS=m 702CONFIG_SOUND_OSS=m
679# CONFIG_SOUND_TRACEINIT is not set 703# CONFIG_SOUND_TRACEINIT is not set
680# CONFIG_SOUND_DMAP is not set 704# CONFIG_SOUND_DMAP is not set
681# CONFIG_SOUND_AD1816 is not set
682# CONFIG_SOUND_AD1889 is not set
683# CONFIG_SOUND_SGALAXY is not set
684# CONFIG_SOUND_ADLIB is not set
685# CONFIG_SOUND_ACI_MIXER is not set
686# CONFIG_SOUND_CS4232 is not set
687# CONFIG_SOUND_SSCAPE is not set 705# CONFIG_SOUND_SSCAPE is not set
688# CONFIG_SOUND_GUS is not set
689# CONFIG_SOUND_VMIDI is not set 706# CONFIG_SOUND_VMIDI is not set
690# CONFIG_SOUND_TRIX is not set 707# CONFIG_SOUND_TRIX is not set
691# CONFIG_SOUND_MSS is not set 708# CONFIG_SOUND_MSS is not set
692# CONFIG_SOUND_MPU401 is not set 709# CONFIG_SOUND_MPU401 is not set
693# CONFIG_SOUND_NM256 is not set
694# CONFIG_SOUND_MAD16 is not set
695# CONFIG_SOUND_PAS is not set 710# CONFIG_SOUND_PAS is not set
696# CONFIG_SOUND_PSS is not set 711# CONFIG_SOUND_PSS is not set
697# CONFIG_SOUND_SB is not set 712# CONFIG_SOUND_SB is not set
698# CONFIG_SOUND_AWE32_SYNTH is not set
699# CONFIG_SOUND_WAVEFRONT is not set
700# CONFIG_SOUND_MAUI is not set
701# CONFIG_SOUND_YM3812 is not set 713# CONFIG_SOUND_YM3812 is not set
702# CONFIG_SOUND_OPL3SA1 is not set
703# CONFIG_SOUND_OPL3SA2 is not set
704# CONFIG_SOUND_UART6850 is not set 714# CONFIG_SOUND_UART6850 is not set
705# CONFIG_SOUND_AEDSP16 is not set 715# CONFIG_SOUND_AEDSP16 is not set
706CONFIG_SOUND_VIDC=m 716CONFIG_SOUND_VIDC=m
707# CONFIG_SOUND_TVMIXER is not set 717# CONFIG_HID_SUPPORT is not set
708# CONFIG_SOUND_AD1980 is not set 718# CONFIG_USB_SUPPORT is not set
719# CONFIG_MMC is not set
720CONFIG_RTC_LIB=y
721CONFIG_RTC_CLASS=y
722CONFIG_RTC_HCTOSYS=y
723CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
724# CONFIG_RTC_DEBUG is not set
709 725
710# 726#
711# USB support 727# RTC interfaces
712# 728#
713# CONFIG_USB is not set 729CONFIG_RTC_INTF_SYSFS=y
714CONFIG_USB_ARCH_HAS_HCD=y 730CONFIG_RTC_INTF_PROC=y
715# CONFIG_USB_ARCH_HAS_OHCI is not set 731CONFIG_RTC_INTF_DEV=y
732# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
733# CONFIG_RTC_DRV_TEST is not set
716 734
717# 735#
718# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information 736# I2C RTC drivers
719# 737#
738# CONFIG_RTC_DRV_DS1307 is not set
739# CONFIG_RTC_DRV_DS1672 is not set
740# CONFIG_RTC_DRV_MAX6900 is not set
741# CONFIG_RTC_DRV_RS5C372 is not set
742# CONFIG_RTC_DRV_ISL1208 is not set
743# CONFIG_RTC_DRV_X1205 is not set
744# CONFIG_RTC_DRV_PCF8563 is not set
745CONFIG_RTC_DRV_PCF8583=y
746# CONFIG_RTC_DRV_M41T80 is not set
720 747
721# 748#
722# USB Gadget Support 749# SPI RTC drivers
723# 750#
724# CONFIG_USB_GADGET is not set
725 751
726# 752#
727# MMC/SD Card support 753# Platform RTC drivers
754#
755# CONFIG_RTC_DRV_CMOS is not set
756# CONFIG_RTC_DRV_DS1553 is not set
757# CONFIG_RTC_DRV_STK17TA8 is not set
758# CONFIG_RTC_DRV_DS1742 is not set
759# CONFIG_RTC_DRV_M48T86 is not set
760# CONFIG_RTC_DRV_M48T59 is not set
761# CONFIG_RTC_DRV_V3020 is not set
762
763#
764# on-CPU RTC drivers
765#
766
767#
768# DMA Engine support
769#
770# CONFIG_DMA_ENGINE is not set
771
772#
773# DMA Clients
774#
775
776#
777# DMA Devices
728# 778#
729# CONFIG_MMC is not set
730 779
731# 780#
732# File systems 781# File systems
733# 782#
734CONFIG_EXT2_FS=y 783CONFIG_EXT2_FS=y
735# CONFIG_EXT2_FS_XATTR is not set 784# CONFIG_EXT2_FS_XATTR is not set
785# CONFIG_EXT2_FS_XIP is not set
736CONFIG_EXT3_FS=y 786CONFIG_EXT3_FS=y
737CONFIG_EXT3_FS_XATTR=y 787CONFIG_EXT3_FS_XATTR=y
738# CONFIG_EXT3_FS_POSIX_ACL is not set 788# CONFIG_EXT3_FS_POSIX_ACL is not set
739# CONFIG_EXT3_FS_SECURITY is not set 789# CONFIG_EXT3_FS_SECURITY is not set
790# CONFIG_EXT4DEV_FS is not set
740CONFIG_JBD=y 791CONFIG_JBD=y
741# CONFIG_JBD_DEBUG is not set 792# CONFIG_JBD_DEBUG is not set
742CONFIG_FS_MBCACHE=y 793CONFIG_FS_MBCACHE=y
743# CONFIG_REISERFS_FS is not set 794# CONFIG_REISERFS_FS is not set
744# CONFIG_JFS_FS is not set 795# CONFIG_JFS_FS is not set
745 796# CONFIG_FS_POSIX_ACL is not set
746#
747# XFS support
748#
749# CONFIG_XFS_FS is not set 797# CONFIG_XFS_FS is not set
798# CONFIG_GFS2_FS is not set
799# CONFIG_OCFS2_FS is not set
750# CONFIG_MINIX_FS is not set 800# CONFIG_MINIX_FS is not set
751# CONFIG_ROMFS_FS is not set 801# CONFIG_ROMFS_FS is not set
802CONFIG_INOTIFY=y
803CONFIG_INOTIFY_USER=y
752# CONFIG_QUOTA is not set 804# CONFIG_QUOTA is not set
753CONFIG_DNOTIFY=y 805CONFIG_DNOTIFY=y
754# CONFIG_AUTOFS_FS is not set 806# CONFIG_AUTOFS_FS is not set
755CONFIG_AUTOFS4_FS=m 807CONFIG_AUTOFS4_FS=m
808# CONFIG_FUSE_FS is not set
756 809
757# 810#
758# CD-ROM/DVD Filesystems 811# CD-ROM/DVD Filesystems
@@ -776,12 +829,12 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
776# Pseudo filesystems 829# Pseudo filesystems
777# 830#
778CONFIG_PROC_FS=y 831CONFIG_PROC_FS=y
832CONFIG_PROC_SYSCTL=y
779CONFIG_SYSFS=y 833CONFIG_SYSFS=y
780# CONFIG_DEVFS_FS is not set
781# CONFIG_DEVPTS_FS_XATTR is not set
782# CONFIG_TMPFS is not set 834# CONFIG_TMPFS is not set
783# CONFIG_HUGETLB_PAGE is not set 835# CONFIG_HUGETLB_PAGE is not set
784CONFIG_RAMFS=y 836CONFIG_RAMFS=y
837# CONFIG_CONFIGFS_FS is not set
785 838
786# 839#
787# Miscellaneous filesystems 840# Miscellaneous filesystems
@@ -810,7 +863,9 @@ CONFIG_NFS_FS=y
810# CONFIG_NFS_DIRECTIO is not set 863# CONFIG_NFS_DIRECTIO is not set
811# CONFIG_NFSD is not set 864# CONFIG_NFSD is not set
812CONFIG_LOCKD=y 865CONFIG_LOCKD=y
866CONFIG_NFS_COMMON=y
813CONFIG_SUNRPC=y 867CONFIG_SUNRPC=y
868# CONFIG_SUNRPC_BIND34 is not set
814# CONFIG_RPCSEC_GSS_KRB5 is not set 869# CONFIG_RPCSEC_GSS_KRB5 is not set
815# CONFIG_RPCSEC_GSS_SPKM3 is not set 870# CONFIG_RPCSEC_GSS_SPKM3 is not set
816# CONFIG_SMB_FS is not set 871# CONFIG_SMB_FS is not set
@@ -830,20 +885,22 @@ CONFIG_ACORN_PARTITION_ICS=y
830CONFIG_ACORN_PARTITION_ADFS=y 885CONFIG_ACORN_PARTITION_ADFS=y
831CONFIG_ACORN_PARTITION_POWERTEC=y 886CONFIG_ACORN_PARTITION_POWERTEC=y
832CONFIG_ACORN_PARTITION_RISCIX=y 887CONFIG_ACORN_PARTITION_RISCIX=y
833CONFIG_OSF_PARTITION=y 888# CONFIG_OSF_PARTITION is not set
834CONFIG_AMIGA_PARTITION=y 889# CONFIG_AMIGA_PARTITION is not set
835# CONFIG_ATARI_PARTITION is not set 890# CONFIG_ATARI_PARTITION is not set
836CONFIG_MAC_PARTITION=y 891# CONFIG_MAC_PARTITION is not set
837CONFIG_MSDOS_PARTITION=y 892CONFIG_MSDOS_PARTITION=y
838CONFIG_BSD_DISKLABEL=y 893CONFIG_BSD_DISKLABEL=y
839# CONFIG_MINIX_SUBPARTITION is not set 894# CONFIG_MINIX_SUBPARTITION is not set
840CONFIG_SOLARIS_X86_PARTITION=y 895# CONFIG_SOLARIS_X86_PARTITION is not set
841# CONFIG_UNIXWARE_DISKLABEL is not set 896# CONFIG_UNIXWARE_DISKLABEL is not set
842# CONFIG_LDM_PARTITION is not set 897# CONFIG_LDM_PARTITION is not set
843CONFIG_SGI_PARTITION=y 898# CONFIG_SGI_PARTITION is not set
844# CONFIG_ULTRIX_PARTITION is not set 899# CONFIG_ULTRIX_PARTITION is not set
845CONFIG_SUN_PARTITION=y 900# CONFIG_SUN_PARTITION is not set
901# CONFIG_KARMA_PARTITION is not set
846# CONFIG_EFI_PARTITION is not set 902# CONFIG_EFI_PARTITION is not set
903# CONFIG_SYSV68_PARTITION is not set
847 904
848# 905#
849# Native Language Support 906# Native Language Support
@@ -890,6 +947,11 @@ CONFIG_NLS_KOI8_R=m
890# CONFIG_NLS_UTF8 is not set 947# CONFIG_NLS_UTF8 is not set
891 948
892# 949#
950# Distributed Lock Manager
951#
952# CONFIG_DLM is not set
953
954#
893# Profiling support 955# Profiling support
894# 956#
895# CONFIG_PROFILING is not set 957# CONFIG_PROFILING is not set
@@ -897,17 +959,37 @@ CONFIG_NLS_KOI8_R=m
897# 959#
898# Kernel hacking 960# Kernel hacking
899# 961#
900CONFIG_DEBUG_KERNEL=y
901CONFIG_MAGIC_SYSRQ=y
902# CONFIG_PRINTK_TIME is not set 962# CONFIG_PRINTK_TIME is not set
963CONFIG_ENABLE_MUST_CHECK=y
964CONFIG_MAGIC_SYSRQ=y
965# CONFIG_UNUSED_SYMBOLS is not set
966# CONFIG_DEBUG_FS is not set
967# CONFIG_HEADERS_CHECK is not set
968CONFIG_DEBUG_KERNEL=y
969# CONFIG_DEBUG_SHIRQ is not set
970CONFIG_DETECT_SOFTLOCKUP=y
971CONFIG_SCHED_DEBUG=y
903# CONFIG_SCHEDSTATS is not set 972# CONFIG_SCHEDSTATS is not set
973# CONFIG_TIMER_STATS is not set
904# CONFIG_DEBUG_SLAB is not set 974# CONFIG_DEBUG_SLAB is not set
975# CONFIG_DEBUG_RT_MUTEXES is not set
976# CONFIG_RT_MUTEX_TESTER is not set
905# CONFIG_DEBUG_SPINLOCK is not set 977# CONFIG_DEBUG_SPINLOCK is not set
978# CONFIG_DEBUG_MUTEXES is not set
979# CONFIG_DEBUG_LOCK_ALLOC is not set
980# CONFIG_PROVE_LOCKING is not set
981# CONFIG_LOCK_STAT is not set
982# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
983# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
906# CONFIG_DEBUG_KOBJECT is not set 984# CONFIG_DEBUG_KOBJECT is not set
907CONFIG_DEBUG_BUGVERBOSE=y 985CONFIG_DEBUG_BUGVERBOSE=y
908# CONFIG_DEBUG_INFO is not set 986# CONFIG_DEBUG_INFO is not set
909# CONFIG_DEBUG_FS is not set 987# CONFIG_DEBUG_VM is not set
988# CONFIG_DEBUG_LIST is not set
910CONFIG_FRAME_POINTER=y 989CONFIG_FRAME_POINTER=y
990CONFIG_FORCED_INLINING=y
991# CONFIG_RCU_TORTURE_TEST is not set
992# CONFIG_FAULT_INJECTION is not set
911CONFIG_DEBUG_USER=y 993CONFIG_DEBUG_USER=y
912CONFIG_DEBUG_ERRORS=y 994CONFIG_DEBUG_ERRORS=y
913CONFIG_DEBUG_LL=y 995CONFIG_DEBUG_LL=y
@@ -918,19 +1000,18 @@ CONFIG_DEBUG_LL=y
918# 1000#
919# CONFIG_KEYS is not set 1001# CONFIG_KEYS is not set
920# CONFIG_SECURITY is not set 1002# CONFIG_SECURITY is not set
921
922#
923# Cryptographic options
924#
925# CONFIG_CRYPTO is not set 1003# CONFIG_CRYPTO is not set
926 1004
927# 1005#
928# Hardware crypto devices
929#
930
931#
932# Library routines 1006# Library routines
933# 1007#
1008CONFIG_BITREVERSE=y
934# CONFIG_CRC_CCITT is not set 1009# CONFIG_CRC_CCITT is not set
1010# CONFIG_CRC16 is not set
1011# CONFIG_CRC_ITU_T is not set
935CONFIG_CRC32=y 1012CONFIG_CRC32=y
1013# CONFIG_CRC7 is not set
936# CONFIG_LIBCRC32C is not set 1014# CONFIG_LIBCRC32C is not set
1015CONFIG_PLIST=y
1016CONFIG_HAS_IOMEM=y
1017CONFIG_HAS_DMA=y
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index 9db58da04754..3576595b4941 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -15,6 +15,8 @@
15 15
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17 17
18#include <video/atmel_lcdc.h>
19
18#include <asm/arch/board.h> 20#include <asm/arch/board.h>
19#include <asm/arch/gpio.h> 21#include <asm/arch/gpio.h>
20#include <asm/arch/at91sam9261.h> 22#include <asm/arch/at91sam9261.h>
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index 635695787f91..f924bd5017de 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -14,6 +14,8 @@
14 14
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16 16
17#include <video/atmel_lcdc.h>
18
17#include <asm/arch/board.h> 19#include <asm/arch/board.h>
18#include <asm/arch/gpio.h> 20#include <asm/arch/gpio.h>
19#include <asm/arch/at91sam9263.h> 21#include <asm/arch/at91sam9263.h>
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 9ef28da2c7fe..952eba6701f4 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -389,8 +389,11 @@ BEGIN_FTR_SECTION
389 ld r9,PACA_SLBSHADOWPTR(r13) 389 ld r9,PACA_SLBSHADOWPTR(r13)
390 li r12,0 390 li r12,0
391 std r12,SLBSHADOW_STACKESID(r9) /* Clear ESID */ 391 std r12,SLBSHADOW_STACKESID(r9) /* Clear ESID */
392 eieio
392 std r7,SLBSHADOW_STACKVSID(r9) /* Save VSID */ 393 std r7,SLBSHADOW_STACKVSID(r9) /* Save VSID */
394 eieio
393 std r0,SLBSHADOW_STACKESID(r9) /* Save ESID */ 395 std r0,SLBSHADOW_STACKESID(r9) /* Save ESID */
396 eieio
394 397
395 slbie r6 398 slbie r6
396 slbie r6 /* Workaround POWER5 < DD2.1 issue */ 399 slbie r6 /* Workaround POWER5 < DD2.1 issue */
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index cd35c969bb28..04a3109ae3c6 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -581,8 +581,11 @@ pcibios_assign_resources(void)
581 if ((r->flags & IORESOURCE_UNSET) && r->end && 581 if ((r->flags & IORESOURCE_UNSET) && r->end &&
582 (!ppc_md.pcibios_enable_device_hook || 582 (!ppc_md.pcibios_enable_device_hook ||
583 !ppc_md.pcibios_enable_device_hook(dev, 1))) { 583 !ppc_md.pcibios_enable_device_hook(dev, 1))) {
584 int rc;
585
584 r->flags &= ~IORESOURCE_UNSET; 586 r->flags &= ~IORESOURCE_UNSET;
585 pci_assign_resource(dev, idx); 587 rc = pci_assign_resource(dev, idx);
588 BUG_ON(rc);
586 } 589 }
587 } 590 }
588 591
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 087c92f2a3eb..1ea43160f543 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -212,11 +212,6 @@ int smp_call_function_map(void (*func) (void *info), void *info, int nonatomic,
212 atomic_set(&data.finished, 0); 212 atomic_set(&data.finished, 0);
213 213
214 spin_lock(&call_lock); 214 spin_lock(&call_lock);
215 /* Must grab online cpu count with preempt disabled, otherwise
216 * it can change. */
217 num_cpus = num_online_cpus() - 1;
218 if (!num_cpus)
219 goto done;
220 215
221 /* remove 'self' from the map */ 216 /* remove 'self' from the map */
222 if (cpu_isset(smp_processor_id(), map)) 217 if (cpu_isset(smp_processor_id(), map))
@@ -224,7 +219,9 @@ int smp_call_function_map(void (*func) (void *info), void *info, int nonatomic,
224 219
225 /* sanity check the map, remove any non-online processors. */ 220 /* sanity check the map, remove any non-online processors. */
226 cpus_and(map, map, cpu_online_map); 221 cpus_and(map, map, cpu_online_map);
227 if (cpus_empty(map)) 222
223 num_cpus = cpus_weight(map);
224 if (!num_cpus)
228 goto done; 225 goto done;
229 226
230 call_data = &data; 227 call_data = &data;
diff --git a/arch/powerpc/mm/hash_low_64.S b/arch/powerpc/mm/hash_low_64.S
index 4762ff7c14df..35eabfb50723 100644
--- a/arch/powerpc/mm/hash_low_64.S
+++ b/arch/powerpc/mm/hash_low_64.S
@@ -472,10 +472,12 @@ _GLOBAL(htab_call_hpte_insert1)
472 /* Now try secondary slot */ 472 /* Now try secondary slot */
473 473
474 /* real page number in r5, PTE RPN value + index */ 474 /* real page number in r5, PTE RPN value + index */
475 rldicl r5,r31,64-PTE_RPN_SHIFT,PTE_RPN_SHIFT 475 andis. r0,r31,_PAGE_4K_PFN@h
476 srdi r5,r31,PTE_RPN_SHIFT
477 bne- 3f
476 sldi r5,r5,PAGE_SHIFT-HW_PAGE_SHIFT 478 sldi r5,r5,PAGE_SHIFT-HW_PAGE_SHIFT
477 add r5,r5,r25 479 add r5,r5,r25
478 sldi r5,r5,HW_PAGE_SHIFT 4803: sldi r5,r5,HW_PAGE_SHIFT
479 481
480 /* Calculate secondary group hash */ 482 /* Calculate secondary group hash */
481 andc r0,r27,r28 483 andc r0,r27,r28
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index bc7b0cedae5e..f1789578747a 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -759,7 +759,7 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
759 mmu_psize_defs[mmu_vmalloc_psize].sllp) { 759 mmu_psize_defs[mmu_vmalloc_psize].sllp) {
760 get_paca()->vmalloc_sllp = 760 get_paca()->vmalloc_sllp =
761 mmu_psize_defs[mmu_vmalloc_psize].sllp; 761 mmu_psize_defs[mmu_vmalloc_psize].sllp;
762 slb_flush_and_rebolt(); 762 slb_vmalloc_update();
763 } 763 }
764#endif /* CONFIG_PPC_64K_PAGES */ 764#endif /* CONFIG_PPC_64K_PAGES */
765 765
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index de45aa82d97b..c12adc3ddffd 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -307,9 +307,9 @@ static void __init parse_drconf_memory(struct device_node *memory)
307 const unsigned int *lm, *dm, *aa; 307 const unsigned int *lm, *dm, *aa;
308 unsigned int ls, ld, la; 308 unsigned int ls, ld, la;
309 unsigned int n, aam, aalen; 309 unsigned int n, aam, aalen;
310 unsigned long lmb_size, size; 310 unsigned long lmb_size, size, start;
311 int nid, default_nid = 0; 311 int nid, default_nid = 0;
312 unsigned int start, ai, flags; 312 unsigned int ai, flags;
313 313
314 lm = of_get_property(memory, "ibm,lmb-size", &ls); 314 lm = of_get_property(memory, "ibm,lmb-size", &ls);
315 dm = of_get_property(memory, "ibm,dynamic-memory", &ld); 315 dm = of_get_property(memory, "ibm,dynamic-memory", &ld);
diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c
index 304375a73574..b0697017d0e8 100644
--- a/arch/powerpc/mm/slb.c
+++ b/arch/powerpc/mm/slb.c
@@ -53,7 +53,8 @@ static inline unsigned long mk_vsid_data(unsigned long ea, unsigned long flags)
53 return (get_kernel_vsid(ea) << SLB_VSID_SHIFT) | flags; 53 return (get_kernel_vsid(ea) << SLB_VSID_SHIFT) | flags;
54} 54}
55 55
56static inline void slb_shadow_update(unsigned long esid, unsigned long vsid, 56static inline void slb_shadow_update(unsigned long ea,
57 unsigned long flags,
57 unsigned long entry) 58 unsigned long entry)
58{ 59{
59 /* 60 /*
@@ -61,11 +62,11 @@ static inline void slb_shadow_update(unsigned long esid, unsigned long vsid,
61 * updating it. 62 * updating it.
62 */ 63 */
63 get_slb_shadow()->save_area[entry].esid = 0; 64 get_slb_shadow()->save_area[entry].esid = 0;
64 barrier(); 65 smp_wmb();
65 get_slb_shadow()->save_area[entry].vsid = vsid; 66 get_slb_shadow()->save_area[entry].vsid = mk_vsid_data(ea, flags);
66 barrier(); 67 smp_wmb();
67 get_slb_shadow()->save_area[entry].esid = esid; 68 get_slb_shadow()->save_area[entry].esid = mk_esid_data(ea, entry);
68 69 smp_wmb();
69} 70}
70 71
71static inline void create_shadowed_slbe(unsigned long ea, unsigned long flags, 72static inline void create_shadowed_slbe(unsigned long ea, unsigned long flags,
@@ -76,8 +77,7 @@ static inline void create_shadowed_slbe(unsigned long ea, unsigned long flags,
76 * we don't get a stale entry here if we get preempted by PHYP 77 * we don't get a stale entry here if we get preempted by PHYP
77 * between these two statements. 78 * between these two statements.
78 */ 79 */
79 slb_shadow_update(mk_esid_data(ea, entry), mk_vsid_data(ea, flags), 80 slb_shadow_update(ea, flags, entry);
80 entry);
81 81
82 asm volatile("slbmte %0,%1" : 82 asm volatile("slbmte %0,%1" :
83 : "r" (mk_vsid_data(ea, flags)), 83 : "r" (mk_vsid_data(ea, flags)),
@@ -104,8 +104,7 @@ void slb_flush_and_rebolt(void)
104 ksp_esid_data &= ~SLB_ESID_V; 104 ksp_esid_data &= ~SLB_ESID_V;
105 105
106 /* Only third entry (stack) may change here so only resave that */ 106 /* Only third entry (stack) may change here so only resave that */
107 slb_shadow_update(ksp_esid_data, 107 slb_shadow_update(get_paca()->kstack, lflags, 2);
108 mk_vsid_data(ksp_esid_data, lflags), 2);
109 108
110 /* We need to do this all in asm, so we're sure we don't touch 109 /* We need to do this all in asm, so we're sure we don't touch
111 * the stack between the slbia and rebolting it. */ 110 * the stack between the slbia and rebolting it. */
@@ -123,6 +122,15 @@ void slb_flush_and_rebolt(void)
123 : "memory"); 122 : "memory");
124} 123}
125 124
125void slb_vmalloc_update(void)
126{
127 unsigned long vflags;
128
129 vflags = SLB_VSID_KERNEL | mmu_psize_defs[mmu_vmalloc_psize].sllp;
130 slb_shadow_update(VMALLOC_START, vflags, 1);
131 slb_flush_and_rebolt();
132}
133
126/* Flush all user entries from the segment table of the current processor. */ 134/* Flush all user entries from the segment table of the current processor. */
127void switch_slb(struct task_struct *tsk, struct mm_struct *mm) 135void switch_slb(struct task_struct *tsk, struct mm_struct *mm)
128{ 136{
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index 758a80ac080a..c784edd40ea7 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -351,7 +351,8 @@ static void aff_set_ref_point_location(struct spu_gang *gang)
351 lowest_offset = ctx->aff_offset; 351 lowest_offset = ctx->aff_offset;
352 } 352 }
353 353
354 gang->aff_ref_spu = aff_ref_location(ctx, mem_aff, gs, lowest_offset); 354 gang->aff_ref_spu = aff_ref_location(gang->aff_ref_ctx, mem_aff, gs,
355 lowest_offset);
355} 356}
356 357
357static struct spu *ctx_location(struct spu *ref, int offset, int node) 358static struct spu *ctx_location(struct spu *ref, int offset, int node)
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c
index f29705f8047d..ba931be2175c 100644
--- a/arch/powerpc/platforms/powermac/feature.c
+++ b/arch/powerpc/platforms/powermac/feature.c
@@ -826,13 +826,15 @@ core99_ata100_enable(struct device_node *node, long value)
826 826
827 if (value) { 827 if (value) {
828 if (pci_device_from_OF_node(node, &pbus, &pid) == 0) 828 if (pci_device_from_OF_node(node, &pbus, &pid) == 0)
829 pdev = pci_find_slot(pbus, pid); 829 pdev = pci_get_bus_and_slot(pbus, pid);
830 if (pdev == NULL) 830 if (pdev == NULL)
831 return 0; 831 return 0;
832 rc = pci_enable_device(pdev); 832 rc = pci_enable_device(pdev);
833 if (rc == 0)
834 pci_set_master(pdev);
835 pci_dev_put(pdev);
833 if (rc) 836 if (rc)
834 return rc; 837 return rc;
835 pci_set_master(pdev);
836 } 838 }
837 return 0; 839 return 0;
838} 840}
diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c
index aa05288de64e..2952b22f1c84 100644
--- a/arch/powerpc/platforms/ps3/setup.c
+++ b/arch/powerpc/platforms/ps3/setup.c
@@ -109,7 +109,7 @@ static void ps3_panic(char *str)
109 109
110#if defined(CONFIG_FB_PS3) || defined(CONFIG_FB_PS3_MODULE) || \ 110#if defined(CONFIG_FB_PS3) || defined(CONFIG_FB_PS3_MODULE) || \
111 defined(CONFIG_PS3_FLASH) || defined(CONFIG_PS3_FLASH_MODULE) 111 defined(CONFIG_PS3_FLASH) || defined(CONFIG_PS3_FLASH_MODULE)
112static void prealloc(struct ps3_prealloc *p) 112static void __init prealloc(struct ps3_prealloc *p)
113{ 113{
114 if (!p->size) 114 if (!p->size)
115 return; 115 return;
diff --git a/arch/sh/boards/renesas/rts7751r2d/setup.c b/arch/sh/boards/renesas/rts7751r2d/setup.c
index e165d85c03b5..6f7029d33241 100644
--- a/arch/sh/boards/renesas/rts7751r2d/setup.c
+++ b/arch/sh/boards/renesas/rts7751r2d/setup.c
@@ -140,12 +140,19 @@ static struct platform_device sm501_device = {
140static struct platform_device *rts7751r2d_devices[] __initdata = { 140static struct platform_device *rts7751r2d_devices[] __initdata = {
141 &uart_device, 141 &uart_device,
142 &heartbeat_device, 142 &heartbeat_device,
143 &cf_ide_device,
144 &sm501_device, 143 &sm501_device,
145}; 144};
146 145
147static int __init rts7751r2d_devices_setup(void) 146static int __init rts7751r2d_devices_setup(void)
148{ 147{
148 int ret;
149
150 if (ctrl_inw(PA_BVERREG) == 0x10) { /* only working on R2D-PLUS */
151 ret = platform_device_register(&cf_ide_device);
152 if (ret)
153 return ret;
154 }
155
149 return platform_add_devices(rts7751r2d_devices, 156 return platform_add_devices(rts7751r2d_devices,
150 ARRAY_SIZE(rts7751r2d_devices)); 157 ARRAY_SIZE(rts7751r2d_devices));
151} 158}
diff --git a/arch/sh/configs/hs7751rvoip_defconfig b/arch/sh/configs/hs7751rvoip_defconfig
index e1a886d621db..5d9da5a02759 100644
--- a/arch/sh/configs/hs7751rvoip_defconfig
+++ b/arch/sh/configs/hs7751rvoip_defconfig
@@ -145,7 +145,7 @@ CONFIG_CPU_SH4=y
145# CONFIG_CPU_SUBTYPE_SH7091 is not set 145# CONFIG_CPU_SUBTYPE_SH7091 is not set
146# CONFIG_CPU_SUBTYPE_SH7750R is not set 146# CONFIG_CPU_SUBTYPE_SH7750R is not set
147# CONFIG_CPU_SUBTYPE_SH7750S is not set 147# CONFIG_CPU_SUBTYPE_SH7750S is not set
148CONFIG_CPU_SUBTYPE_SH7751=y 148# CONFIG_CPU_SUBTYPE_SH7751 is not set
149CONFIG_CPU_SUBTYPE_SH7751R=y 149CONFIG_CPU_SUBTYPE_SH7751R=y
150# CONFIG_CPU_SUBTYPE_SH7760 is not set 150# CONFIG_CPU_SUBTYPE_SH7760 is not set
151# CONFIG_CPU_SUBTYPE_SH4_202 is not set 151# CONFIG_CPU_SUBTYPE_SH4_202 is not set
diff --git a/arch/sh/configs/landisk_defconfig b/arch/sh/configs/landisk_defconfig
index 07310fa03250..f52db125432f 100644
--- a/arch/sh/configs/landisk_defconfig
+++ b/arch/sh/configs/landisk_defconfig
@@ -156,7 +156,7 @@ CONFIG_CPU_SH4=y
156# CONFIG_CPU_SUBTYPE_SH7091 is not set 156# CONFIG_CPU_SUBTYPE_SH7091 is not set
157# CONFIG_CPU_SUBTYPE_SH7750R is not set 157# CONFIG_CPU_SUBTYPE_SH7750R is not set
158# CONFIG_CPU_SUBTYPE_SH7750S is not set 158# CONFIG_CPU_SUBTYPE_SH7750S is not set
159CONFIG_CPU_SUBTYPE_SH7751=y 159# CONFIG_CPU_SUBTYPE_SH7751 is not set
160CONFIG_CPU_SUBTYPE_SH7751R=y 160CONFIG_CPU_SUBTYPE_SH7751R=y
161# CONFIG_CPU_SUBTYPE_SH7760 is not set 161# CONFIG_CPU_SUBTYPE_SH7760 is not set
162# CONFIG_CPU_SUBTYPE_SH4_202 is not set 162# CONFIG_CPU_SUBTYPE_SH4_202 is not set
diff --git a/arch/sh/configs/lboxre2_defconfig b/arch/sh/configs/lboxre2_defconfig
index fa09d68d057a..9fa66d92a4e7 100644
--- a/arch/sh/configs/lboxre2_defconfig
+++ b/arch/sh/configs/lboxre2_defconfig
@@ -159,7 +159,7 @@ CONFIG_CPU_SH4=y
159# CONFIG_CPU_SUBTYPE_SH7091 is not set 159# CONFIG_CPU_SUBTYPE_SH7091 is not set
160# CONFIG_CPU_SUBTYPE_SH7750R is not set 160# CONFIG_CPU_SUBTYPE_SH7750R is not set
161# CONFIG_CPU_SUBTYPE_SH7750S is not set 161# CONFIG_CPU_SUBTYPE_SH7750S is not set
162CONFIG_CPU_SUBTYPE_SH7751=y 162# CONFIG_CPU_SUBTYPE_SH7751 is not set
163CONFIG_CPU_SUBTYPE_SH7751R=y 163CONFIG_CPU_SUBTYPE_SH7751R=y
164# CONFIG_CPU_SUBTYPE_SH7760 is not set 164# CONFIG_CPU_SUBTYPE_SH7760 is not set
165# CONFIG_CPU_SUBTYPE_SH4_202 is not set 165# CONFIG_CPU_SUBTYPE_SH4_202 is not set
diff --git a/arch/sh/configs/rts7751r2d_defconfig b/arch/sh/configs/rts7751r2d_defconfig
index f1e979b1e495..b64f73b704d6 100644
--- a/arch/sh/configs/rts7751r2d_defconfig
+++ b/arch/sh/configs/rts7751r2d_defconfig
@@ -243,8 +243,8 @@ CONFIG_SH_PCLK_FREQ=60000000
243# 243#
244# DMA support 244# DMA support
245# 245#
246CONFIG_SH_DMA=y 246# CONFIG_SH_DMA is not set
247CONFIG_NR_ONCHIP_DMA_CHANNELS=8 247# CONFIG_NR_ONCHIP_DMA_CHANNELS is not set
248# CONFIG_NR_DMA_CHANNELS_BOOL is not set 248# CONFIG_NR_DMA_CHANNELS_BOOL is not set
249 249
250# 250#
@@ -280,7 +280,7 @@ CONFIG_ZERO_PAGE_OFFSET=0x00010000
280CONFIG_BOOT_LINK_OFFSET=0x00800000 280CONFIG_BOOT_LINK_OFFSET=0x00800000
281# CONFIG_UBC_WAKEUP is not set 281# CONFIG_UBC_WAKEUP is not set
282CONFIG_CMDLINE_BOOL=y 282CONFIG_CMDLINE_BOOL=y
283CONFIG_CMDLINE="console=tty0 console=ttySC0,115200 root=/dev/sda1 earlyprintk=bios" 283CONFIG_CMDLINE="console=tty0 console=ttySC0,115200 root=/dev/sda1 earlyprintk=serial"
284 284
285# 285#
286# Bus options 286# Bus options
@@ -1323,7 +1323,7 @@ CONFIG_ENABLE_MUST_CHECK=y
1323# CONFIG_DEBUG_KERNEL is not set 1323# CONFIG_DEBUG_KERNEL is not set
1324CONFIG_LOG_BUF_SHIFT=14 1324CONFIG_LOG_BUF_SHIFT=14
1325# CONFIG_DEBUG_BUGVERBOSE is not set 1325# CONFIG_DEBUG_BUGVERBOSE is not set
1326CONFIG_SH_STANDARD_BIOS=y 1326# CONFIG_SH_STANDARD_BIOS is not set
1327CONFIG_EARLY_SCIF_CONSOLE=y 1327CONFIG_EARLY_SCIF_CONSOLE=y
1328CONFIG_EARLY_SCIF_CONSOLE_PORT=0xffe80000 1328CONFIG_EARLY_SCIF_CONSOLE_PORT=0xffe80000
1329CONFIG_EARLY_PRINTK=y 1329CONFIG_EARLY_PRINTK=y
diff --git a/arch/sh/configs/snapgear_defconfig b/arch/sh/configs/snapgear_defconfig
index 98503f16f3f5..e4e5d2178131 100644
--- a/arch/sh/configs/snapgear_defconfig
+++ b/arch/sh/configs/snapgear_defconfig
@@ -1,15 +1,24 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.18 3# Linux kernel version: 2.6.23-rc1
4# Tue Oct 3 12:55:47 2006 4# Thu Jul 26 11:49:11 2007
5# 5#
6CONFIG_SUPERH=y 6CONFIG_SUPERH=y
7CONFIG_RWSEM_GENERIC_SPINLOCK=y 7CONFIG_RWSEM_GENERIC_SPINLOCK=y
8CONFIG_GENERIC_BUG=y
8CONFIG_GENERIC_FIND_NEXT_BIT=y 9CONFIG_GENERIC_FIND_NEXT_BIT=y
9CONFIG_GENERIC_HWEIGHT=y 10CONFIG_GENERIC_HWEIGHT=y
10CONFIG_GENERIC_HARDIRQS=y 11CONFIG_GENERIC_HARDIRQS=y
11CONFIG_GENERIC_IRQ_PROBE=y 12CONFIG_GENERIC_IRQ_PROBE=y
12CONFIG_GENERIC_CALIBRATE_DELAY=y 13CONFIG_GENERIC_CALIBRATE_DELAY=y
14CONFIG_GENERIC_TIME=y
15CONFIG_GENERIC_CLOCKEVENTS=y
16CONFIG_SYS_SUPPORTS_PCI=y
17CONFIG_STACKTRACE_SUPPORT=y
18CONFIG_LOCKDEP_SUPPORT=y
19# CONFIG_ARCH_HAS_ILOG2_U32 is not set
20# CONFIG_ARCH_HAS_ILOG2_U64 is not set
21CONFIG_ARCH_NO_VIRT_TO_BUS=y
13CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 22CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
14 23
15# 24#
@@ -24,15 +33,18 @@ CONFIG_INIT_ENV_ARG_LIMIT=32
24# 33#
25CONFIG_LOCALVERSION="" 34CONFIG_LOCALVERSION=""
26CONFIG_LOCALVERSION_AUTO=y 35CONFIG_LOCALVERSION_AUTO=y
27CONFIG_SWAP=y 36# CONFIG_SWAP is not set
28# CONFIG_SYSVIPC is not set 37# CONFIG_SYSVIPC is not set
29# CONFIG_POSIX_MQUEUE is not set 38# CONFIG_POSIX_MQUEUE is not set
30# CONFIG_BSD_PROCESS_ACCT is not set 39# CONFIG_BSD_PROCESS_ACCT is not set
31# CONFIG_TASKSTATS is not set 40# CONFIG_TASKSTATS is not set
32# CONFIG_UTS_NS is not set 41# CONFIG_USER_NS is not set
33# CONFIG_AUDIT is not set 42# CONFIG_AUDIT is not set
34# CONFIG_IKCONFIG is not set 43# CONFIG_IKCONFIG is not set
44CONFIG_LOG_BUF_SHIFT=14
45# CONFIG_SYSFS_DEPRECATED is not set
35# CONFIG_RELAY is not set 46# CONFIG_RELAY is not set
47CONFIG_BLK_DEV_INITRD=y
36CONFIG_INITRAMFS_SOURCE="" 48CONFIG_INITRAMFS_SOURCE=""
37CONFIG_CC_OPTIMIZE_FOR_SIZE=y 49CONFIG_CC_OPTIMIZE_FOR_SIZE=y
38CONFIG_SYSCTL=y 50CONFIG_SYSCTL=y
@@ -47,27 +59,25 @@ CONFIG_BUG=y
47CONFIG_ELF_CORE=y 59CONFIG_ELF_CORE=y
48CONFIG_BASE_FULL=y 60CONFIG_BASE_FULL=y
49CONFIG_FUTEX=y 61CONFIG_FUTEX=y
62CONFIG_ANON_INODES=y
50CONFIG_EPOLL=y 63CONFIG_EPOLL=y
64CONFIG_SIGNALFD=y
65CONFIG_TIMERFD=y
66CONFIG_EVENTFD=y
51CONFIG_SHMEM=y 67CONFIG_SHMEM=y
52CONFIG_SLAB=y
53CONFIG_VM_EVENT_COUNTERS=y 68CONFIG_VM_EVENT_COUNTERS=y
69CONFIG_SLAB=y
70# CONFIG_SLUB is not set
71# CONFIG_SLOB is not set
54CONFIG_RT_MUTEXES=y 72CONFIG_RT_MUTEXES=y
55# CONFIG_TINY_SHMEM is not set 73# CONFIG_TINY_SHMEM is not set
56CONFIG_BASE_SMALL=0 74CONFIG_BASE_SMALL=0
57# CONFIG_SLOB is not set
58
59#
60# Loadable module support
61#
62# CONFIG_MODULES is not set 75# CONFIG_MODULES is not set
63
64#
65# Block layer
66#
67CONFIG_BLOCK=y 76CONFIG_BLOCK=y
68# CONFIG_LBD is not set 77# CONFIG_LBD is not set
69# CONFIG_BLK_DEV_IO_TRACE is not set 78# CONFIG_BLK_DEV_IO_TRACE is not set
70# CONFIG_LSF is not set 79# CONFIG_LSF is not set
80# CONFIG_BLK_DEV_BSG is not set
71 81
72# 82#
73# IO Schedulers 83# IO Schedulers
@@ -85,122 +95,103 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
85# 95#
86# System type 96# System type
87# 97#
88# CONFIG_SH_SOLUTION_ENGINE is not set
89# CONFIG_SH_7751_SOLUTION_ENGINE is not set
90# CONFIG_SH_7300_SOLUTION_ENGINE is not set
91# CONFIG_SH_7343_SOLUTION_ENGINE is not set
92# CONFIG_SH_73180_SOLUTION_ENGINE is not set
93# CONFIG_SH_7751_SYSTEMH is not set
94# CONFIG_SH_HP6XX is not set
95# CONFIG_SH_EC3104 is not set
96# CONFIG_SH_SATURN is not set
97# CONFIG_SH_DREAMCAST is not set
98# CONFIG_SH_BIGSUR is not set
99# CONFIG_SH_MPC1211 is not set
100# CONFIG_SH_SH03 is not set
101CONFIG_SH_SECUREEDGE5410=y
102# CONFIG_SH_HS7751RVOIP is not set
103# CONFIG_SH_7710VOIPGW is not set
104# CONFIG_SH_RTS7751R2D is not set
105# CONFIG_SH_R7780RP is not set
106# CONFIG_SH_EDOSK7705 is not set
107# CONFIG_SH_SH4202_MICRODEV is not set
108# CONFIG_SH_LANDISK is not set
109# CONFIG_SH_TITAN is not set
110# CONFIG_SH_SHMIN is not set
111# CONFIG_SH_UNKNOWN is not set
112
113#
114# Processor selection
115#
116CONFIG_CPU_SH4=y 98CONFIG_CPU_SH4=y
117 99# CONFIG_CPU_SUBTYPE_SH7619 is not set
118# 100# CONFIG_CPU_SUBTYPE_SH7206 is not set
119# SH-2 Processor Support
120#
121# CONFIG_CPU_SUBTYPE_SH7604 is not set
122
123#
124# SH-3 Processor Support
125#
126# CONFIG_CPU_SUBTYPE_SH7300 is not set
127# CONFIG_CPU_SUBTYPE_SH7705 is not set 101# CONFIG_CPU_SUBTYPE_SH7705 is not set
128# CONFIG_CPU_SUBTYPE_SH7706 is not set 102# CONFIG_CPU_SUBTYPE_SH7706 is not set
129# CONFIG_CPU_SUBTYPE_SH7707 is not set 103# CONFIG_CPU_SUBTYPE_SH7707 is not set
130# CONFIG_CPU_SUBTYPE_SH7708 is not set 104# CONFIG_CPU_SUBTYPE_SH7708 is not set
131# CONFIG_CPU_SUBTYPE_SH7709 is not set 105# CONFIG_CPU_SUBTYPE_SH7709 is not set
132# CONFIG_CPU_SUBTYPE_SH7710 is not set 106# CONFIG_CPU_SUBTYPE_SH7710 is not set
133 107# CONFIG_CPU_SUBTYPE_SH7712 is not set
134#
135# SH-4 Processor Support
136#
137# CONFIG_CPU_SUBTYPE_SH7750 is not set 108# CONFIG_CPU_SUBTYPE_SH7750 is not set
138# CONFIG_CPU_SUBTYPE_SH7091 is not set 109# CONFIG_CPU_SUBTYPE_SH7091 is not set
139# CONFIG_CPU_SUBTYPE_SH7750R is not set 110# CONFIG_CPU_SUBTYPE_SH7750R is not set
140# CONFIG_CPU_SUBTYPE_SH7750S is not set 111# CONFIG_CPU_SUBTYPE_SH7750S is not set
141CONFIG_CPU_SUBTYPE_SH7751=y 112# CONFIG_CPU_SUBTYPE_SH7751 is not set
142CONFIG_CPU_SUBTYPE_SH7751R=y 113CONFIG_CPU_SUBTYPE_SH7751R=y
143# CONFIG_CPU_SUBTYPE_SH7760 is not set 114# CONFIG_CPU_SUBTYPE_SH7760 is not set
144# CONFIG_CPU_SUBTYPE_SH4_202 is not set 115# CONFIG_CPU_SUBTYPE_SH4_202 is not set
145
146#
147# ST40 Processor Support
148#
149# CONFIG_CPU_SUBTYPE_ST40STB1 is not set 116# CONFIG_CPU_SUBTYPE_ST40STB1 is not set
150# CONFIG_CPU_SUBTYPE_ST40GX1 is not set 117# CONFIG_CPU_SUBTYPE_ST40GX1 is not set
151
152#
153# SH-4A Processor Support
154#
155# CONFIG_CPU_SUBTYPE_SH7770 is not set 118# CONFIG_CPU_SUBTYPE_SH7770 is not set
156# CONFIG_CPU_SUBTYPE_SH7780 is not set 119# CONFIG_CPU_SUBTYPE_SH7780 is not set
157 120# CONFIG_CPU_SUBTYPE_SH7785 is not set
158# 121# CONFIG_CPU_SUBTYPE_SHX3 is not set
159# SH4AL-DSP Processor Support
160#
161# CONFIG_CPU_SUBTYPE_SH73180 is not set
162# CONFIG_CPU_SUBTYPE_SH7343 is not set 122# CONFIG_CPU_SUBTYPE_SH7343 is not set
123# CONFIG_CPU_SUBTYPE_SH7722 is not set
163 124
164# 125#
165# Memory management options 126# Memory management options
166# 127#
128CONFIG_QUICKLIST=y
167CONFIG_MMU=y 129CONFIG_MMU=y
168CONFIG_PAGE_OFFSET=0x80000000 130CONFIG_PAGE_OFFSET=0x80000000
169CONFIG_MEMORY_START=0x08000000 131CONFIG_MEMORY_START=0x08000000
170CONFIG_MEMORY_SIZE=0x01000000 132CONFIG_MEMORY_SIZE=0x01000000
171CONFIG_VSYSCALL=y 133CONFIG_VSYSCALL=y
134CONFIG_ARCH_FLATMEM_ENABLE=y
135CONFIG_ARCH_SPARSEMEM_ENABLE=y
136CONFIG_ARCH_SPARSEMEM_DEFAULT=y
137CONFIG_MAX_ACTIVE_REGIONS=1
138CONFIG_ARCH_POPULATES_NODE_MAP=y
139CONFIG_ARCH_SELECT_MEMORY_MODEL=y
140CONFIG_PAGE_SIZE_4KB=y
141# CONFIG_PAGE_SIZE_8KB is not set
142# CONFIG_PAGE_SIZE_64KB is not set
172CONFIG_SELECT_MEMORY_MODEL=y 143CONFIG_SELECT_MEMORY_MODEL=y
173CONFIG_FLATMEM_MANUAL=y 144CONFIG_FLATMEM_MANUAL=y
174# CONFIG_DISCONTIGMEM_MANUAL is not set 145# CONFIG_DISCONTIGMEM_MANUAL is not set
175# CONFIG_SPARSEMEM_MANUAL is not set 146# CONFIG_SPARSEMEM_MANUAL is not set
176CONFIG_FLATMEM=y 147CONFIG_FLATMEM=y
177CONFIG_FLAT_NODE_MEM_MAP=y 148CONFIG_FLAT_NODE_MEM_MAP=y
178# CONFIG_SPARSEMEM_STATIC is not set 149CONFIG_SPARSEMEM_STATIC=y
179CONFIG_SPLIT_PTLOCK_CPUS=4 150CONFIG_SPLIT_PTLOCK_CPUS=4
180# CONFIG_RESOURCES_64BIT is not set 151# CONFIG_RESOURCES_64BIT is not set
152CONFIG_ZONE_DMA_FLAG=0
153CONFIG_NR_QUICK=2
181 154
182# 155#
183# Cache configuration 156# Cache configuration
184# 157#
185# CONFIG_SH_DIRECT_MAPPED is not set 158# CONFIG_SH_DIRECT_MAPPED is not set
186# CONFIG_SH_WRITETHROUGH is not set 159# CONFIG_SH_WRITETHROUGH is not set
187# CONFIG_SH_OCRAM is not set
188 160
189# 161#
190# Processor features 162# Processor features
191# 163#
192CONFIG_CPU_LITTLE_ENDIAN=y 164CONFIG_CPU_LITTLE_ENDIAN=y
165# CONFIG_CPU_BIG_ENDIAN is not set
193CONFIG_SH_FPU=y 166CONFIG_SH_FPU=y
194# CONFIG_SH_DSP is not set 167# CONFIG_SH_DSP is not set
195# CONFIG_SH_STORE_QUEUES is not set 168# CONFIG_SH_STORE_QUEUES is not set
196CONFIG_CPU_HAS_INTEVT=y 169CONFIG_CPU_HAS_INTEVT=y
170CONFIG_CPU_HAS_INTC_IRQ=y
171CONFIG_CPU_HAS_IPR_IRQ=y
197CONFIG_CPU_HAS_SR_RB=y 172CONFIG_CPU_HAS_SR_RB=y
173CONFIG_CPU_HAS_PTEA=y
174
175#
176# Board support
177#
178# CONFIG_SH_7751_SYSTEMH is not set
179CONFIG_SH_SECUREEDGE5410=y
180# CONFIG_SH_HS7751RVOIP is not set
181# CONFIG_SH_RTS7751R2D is not set
182# CONFIG_SH_LANDISK is not set
183# CONFIG_SH_TITAN is not set
184# CONFIG_SH_LBOX_RE2 is not set
198 185
199# 186#
200# Timer support 187# Timer and clock configuration
201# 188#
202CONFIG_SH_TMU=y 189CONFIG_SH_TMU=y
190CONFIG_SH_TIMER_IRQ=16
203CONFIG_SH_PCLK_FREQ=60000000 191CONFIG_SH_PCLK_FREQ=60000000
192# CONFIG_TICK_ONESHOT is not set
193# CONFIG_NO_HZ is not set
194# CONFIG_HIGH_RES_TIMERS is not set
204 195
205# 196#
206# CPU Frequency scaling 197# CPU Frequency scaling
@@ -210,24 +201,31 @@ CONFIG_SH_PCLK_FREQ=60000000
210# 201#
211# DMA support 202# DMA support
212# 203#
204CONFIG_SH_DMA_API=y
213CONFIG_SH_DMA=y 205CONFIG_SH_DMA=y
214CONFIG_NR_ONCHIP_DMA_CHANNELS=4 206CONFIG_NR_ONCHIP_DMA_CHANNELS=8
215# CONFIG_NR_DMA_CHANNELS_BOOL is not set 207# CONFIG_NR_DMA_CHANNELS_BOOL is not set
216 208
217# 209#
218# Companion Chips 210# Companion Chips
219# 211#
220# CONFIG_HD6446X_SERIES is not set 212
213#
214# Additional SuperH Device Drivers
215#
216# CONFIG_HEARTBEAT is not set
217# CONFIG_PUSH_SWITCH is not set
221 218
222# 219#
223# Kernel features 220# Kernel features
224# 221#
225# CONFIG_HZ_100 is not set 222# CONFIG_HZ_100 is not set
226CONFIG_HZ_250=y 223CONFIG_HZ_250=y
224# CONFIG_HZ_300 is not set
227# CONFIG_HZ_1000 is not set 225# CONFIG_HZ_1000 is not set
228CONFIG_HZ=250 226CONFIG_HZ=250
229# CONFIG_KEXEC is not set 227# CONFIG_KEXEC is not set
230# CONFIG_SMP is not set 228# CONFIG_CRASH_DUMP is not set
231CONFIG_PREEMPT_NONE=y 229CONFIG_PREEMPT_NONE=y
232# CONFIG_PREEMPT_VOLUNTARY is not set 230# CONFIG_PREEMPT_VOLUNTARY is not set
233# CONFIG_PREEMPT is not set 231# CONFIG_PREEMPT is not set
@@ -243,33 +241,24 @@ CONFIG_BOOT_LINK_OFFSET=0x00800000
243# 241#
244# Bus options 242# Bus options
245# 243#
244CONFIG_SH_CONCAT_FS=y
246CONFIG_PCI=y 245CONFIG_PCI=y
247# CONFIG_SH_PCIDMA_NONCOHERENT is not set 246CONFIG_SH_PCIDMA_NONCOHERENT=y
248CONFIG_PCI_AUTO=y 247CONFIG_PCI_AUTO=y
249CONFIG_PCI_AUTO_UPDATE_RESOURCES=y 248CONFIG_PCI_AUTO_UPDATE_RESOURCES=y
250# CONFIG_PCI_MULTITHREAD_PROBE is not set 249# CONFIG_ARCH_SUPPORTS_MSI is not set
251 250
252# 251#
253# PCCARD (PCMCIA/CardBus) support 252# PCCARD (PCMCIA/CardBus) support
254# 253#
255 254
256# 255#
257# PCI Hotplug Support
258#
259
260#
261# Executable file formats 256# Executable file formats
262# 257#
263CONFIG_BINFMT_ELF=y 258CONFIG_BINFMT_ELF=y
264# CONFIG_BINFMT_FLAT is not set
265# CONFIG_BINFMT_MISC is not set 259# CONFIG_BINFMT_MISC is not set
266 260
267# 261#
268# Power management options (EXPERIMENTAL)
269#
270# CONFIG_PM is not set
271
272#
273# Networking 262# Networking
274# 263#
275CONFIG_NET=y 264CONFIG_NET=y
@@ -277,21 +266,14 @@ CONFIG_NET=y
277# 266#
278# Networking options 267# Networking options
279# 268#
280# CONFIG_NETDEBUG is not set
281# CONFIG_PACKET is not set 269# CONFIG_PACKET is not set
282# CONFIG_UNIX is not set 270# CONFIG_UNIX is not set
283CONFIG_XFRM=y
284# CONFIG_XFRM_USER is not set
285# CONFIG_XFRM_SUB_POLICY is not set
286# CONFIG_NET_KEY is not set 271# CONFIG_NET_KEY is not set
287CONFIG_INET=y 272CONFIG_INET=y
288# CONFIG_IP_MULTICAST is not set 273# CONFIG_IP_MULTICAST is not set
289# CONFIG_IP_ADVANCED_ROUTER is not set 274# CONFIG_IP_ADVANCED_ROUTER is not set
290CONFIG_IP_FIB_HASH=y 275CONFIG_IP_FIB_HASH=y
291CONFIG_IP_PNP=y 276# CONFIG_IP_PNP is not set
292CONFIG_IP_PNP_DHCP=y
293# CONFIG_IP_PNP_BOOTP is not set
294# CONFIG_IP_PNP_RARP is not set
295# CONFIG_NET_IPIP is not set 277# CONFIG_NET_IPIP is not set
296# CONFIG_NET_IPGRE is not set 278# CONFIG_NET_IPGRE is not set
297# CONFIG_ARPD is not set 279# CONFIG_ARPD is not set
@@ -301,32 +283,21 @@ CONFIG_IP_PNP_DHCP=y
301# CONFIG_INET_IPCOMP is not set 283# CONFIG_INET_IPCOMP is not set
302# CONFIG_INET_XFRM_TUNNEL is not set 284# CONFIG_INET_XFRM_TUNNEL is not set
303# CONFIG_INET_TUNNEL is not set 285# CONFIG_INET_TUNNEL is not set
304CONFIG_INET_XFRM_MODE_TRANSPORT=y 286# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
305CONFIG_INET_XFRM_MODE_TUNNEL=y 287# CONFIG_INET_XFRM_MODE_TUNNEL is not set
306CONFIG_INET_DIAG=y 288# CONFIG_INET_XFRM_MODE_BEET is not set
307CONFIG_INET_TCP_DIAG=y 289# CONFIG_INET_DIAG is not set
308# CONFIG_TCP_CONG_ADVANCED is not set 290# CONFIG_TCP_CONG_ADVANCED is not set
309CONFIG_TCP_CONG_CUBIC=y 291CONFIG_TCP_CONG_CUBIC=y
310CONFIG_DEFAULT_TCP_CONG="cubic" 292CONFIG_DEFAULT_TCP_CONG="cubic"
293# CONFIG_TCP_MD5SIG is not set
311# CONFIG_IPV6 is not set 294# CONFIG_IPV6 is not set
312# CONFIG_INET6_XFRM_TUNNEL is not set 295# CONFIG_INET6_XFRM_TUNNEL is not set
313# CONFIG_INET6_TUNNEL is not set 296# CONFIG_INET6_TUNNEL is not set
314# CONFIG_NETWORK_SECMARK is not set 297# CONFIG_NETWORK_SECMARK is not set
315# CONFIG_NETFILTER is not set 298# CONFIG_NETFILTER is not set
316
317#
318# DCCP Configuration (EXPERIMENTAL)
319#
320# CONFIG_IP_DCCP is not set 299# CONFIG_IP_DCCP is not set
321
322#
323# SCTP Configuration (EXPERIMENTAL)
324#
325# CONFIG_IP_SCTP is not set 300# CONFIG_IP_SCTP is not set
326
327#
328# TIPC Configuration (EXPERIMENTAL)
329#
330# CONFIG_TIPC is not set 301# CONFIG_TIPC is not set
331# CONFIG_ATM is not set 302# CONFIG_ATM is not set
332# CONFIG_BRIDGE is not set 303# CONFIG_BRIDGE is not set
@@ -352,7 +323,17 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
352# CONFIG_HAMRADIO is not set 323# CONFIG_HAMRADIO is not set
353# CONFIG_IRDA is not set 324# CONFIG_IRDA is not set
354# CONFIG_BT is not set 325# CONFIG_BT is not set
326# CONFIG_AF_RXRPC is not set
327
328#
329# Wireless
330#
331# CONFIG_CFG80211 is not set
332# CONFIG_WIRELESS_EXT is not set
333# CONFIG_MAC80211 is not set
355# CONFIG_IEEE80211 is not set 334# CONFIG_IEEE80211 is not set
335# CONFIG_RFKILL is not set
336# CONFIG_NET_9P is not set
356 337
357# 338#
358# Device Drivers 339# Device Drivers
@@ -364,30 +345,88 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
364CONFIG_STANDALONE=y 345CONFIG_STANDALONE=y
365CONFIG_PREVENT_FIRMWARE_BUILD=y 346CONFIG_PREVENT_FIRMWARE_BUILD=y
366# CONFIG_SYS_HYPERVISOR is not set 347# CONFIG_SYS_HYPERVISOR is not set
367
368#
369# Connector - unified userspace <-> kernelspace linker
370#
371# CONFIG_CONNECTOR is not set 348# CONFIG_CONNECTOR is not set
372 349CONFIG_MTD=y
373# 350# CONFIG_MTD_DEBUG is not set
374# Memory Technology Devices (MTD) 351# CONFIG_MTD_CONCAT is not set
375# 352CONFIG_MTD_PARTITIONS=y
376# CONFIG_MTD is not set 353# CONFIG_MTD_REDBOOT_PARTS is not set
377 354# CONFIG_MTD_CMDLINE_PARTS is not set
378# 355
379# Parallel port support 356#
380# 357# User Modules And Translation Layers
358#
359CONFIG_MTD_CHAR=y
360CONFIG_MTD_BLKDEVS=y
361# CONFIG_MTD_BLOCK is not set
362CONFIG_MTD_BLOCK_RO=y
363# CONFIG_FTL is not set
364# CONFIG_NFTL is not set
365# CONFIG_INFTL is not set
366# CONFIG_RFD_FTL is not set
367# CONFIG_SSFDC is not set
368
369#
370# RAM/ROM/Flash chip drivers
371#
372CONFIG_MTD_CFI=y
373# CONFIG_MTD_JEDECPROBE is not set
374CONFIG_MTD_GEN_PROBE=y
375CONFIG_MTD_CFI_ADV_OPTIONS=y
376CONFIG_MTD_CFI_NOSWAP=y
377# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
378# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
379CONFIG_MTD_CFI_GEOMETRY=y
380CONFIG_MTD_MAP_BANK_WIDTH_1=y
381# CONFIG_MTD_MAP_BANK_WIDTH_2 is not set
382# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set
383# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
384# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
385# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
386CONFIG_MTD_CFI_I1=y
387# CONFIG_MTD_CFI_I2 is not set
388# CONFIG_MTD_CFI_I4 is not set
389# CONFIG_MTD_CFI_I8 is not set
390# CONFIG_MTD_OTP is not set
391CONFIG_MTD_CFI_INTELEXT=y
392# CONFIG_MTD_CFI_AMDSTD is not set
393# CONFIG_MTD_CFI_STAA is not set
394CONFIG_MTD_CFI_UTIL=y
395CONFIG_MTD_RAM=y
396# CONFIG_MTD_ROM is not set
397# CONFIG_MTD_ABSENT is not set
398
399#
400# Mapping drivers for chip access
401#
402# CONFIG_MTD_COMPLEX_MAPPINGS is not set
403# CONFIG_MTD_PHYSMAP is not set
404CONFIG_MTD_PLATRAM=y
405
406#
407# Self-contained MTD device drivers
408#
409# CONFIG_MTD_PMC551 is not set
410# CONFIG_MTD_SLRAM is not set
411# CONFIG_MTD_PHRAM is not set
412# CONFIG_MTD_MTDRAM is not set
413# CONFIG_MTD_BLOCK2MTD is not set
414
415#
416# Disk-On-Chip Device Drivers
417#
418# CONFIG_MTD_DOC2000 is not set
419# CONFIG_MTD_DOC2001 is not set
420# CONFIG_MTD_DOC2001PLUS is not set
421# CONFIG_MTD_NAND is not set
422# CONFIG_MTD_ONENAND is not set
423
424#
425# UBI - Unsorted block images
426#
427# CONFIG_MTD_UBI is not set
381# CONFIG_PARPORT is not set 428# CONFIG_PARPORT is not set
382 429CONFIG_BLK_DEV=y
383#
384# Plug and Play support
385#
386
387#
388# Block devices
389#
390# CONFIG_BLK_CPQ_DA is not set
391# CONFIG_BLK_CPQ_CISS_DA is not set 430# CONFIG_BLK_CPQ_CISS_DA is not set
392# CONFIG_BLK_DEV_DAC960 is not set 431# CONFIG_BLK_DEV_DAC960 is not set
393# CONFIG_BLK_DEV_UMEM is not set 432# CONFIG_BLK_DEV_UMEM is not set
@@ -399,13 +438,9 @@ CONFIG_BLK_DEV_RAM=y
399CONFIG_BLK_DEV_RAM_COUNT=16 438CONFIG_BLK_DEV_RAM_COUNT=16
400CONFIG_BLK_DEV_RAM_SIZE=4096 439CONFIG_BLK_DEV_RAM_SIZE=4096
401CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 440CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
402CONFIG_BLK_DEV_INITRD=y
403# CONFIG_CDROM_PKTCDVD is not set 441# CONFIG_CDROM_PKTCDVD is not set
404# CONFIG_ATA_OVER_ETH is not set 442# CONFIG_ATA_OVER_ETH is not set
405 443# CONFIG_MISC_DEVICES is not set
406#
407# ATA/ATAPI/MFM/RLL support
408#
409# CONFIG_IDE is not set 444# CONFIG_IDE is not set
410 445
411# 446#
@@ -413,16 +448,9 @@ CONFIG_BLK_DEV_INITRD=y
413# 448#
414# CONFIG_RAID_ATTRS is not set 449# CONFIG_RAID_ATTRS is not set
415# CONFIG_SCSI is not set 450# CONFIG_SCSI is not set
451# CONFIG_SCSI_DMA is not set
416# CONFIG_SCSI_NETLINK is not set 452# CONFIG_SCSI_NETLINK is not set
417
418#
419# Serial ATA (prod) and Parallel ATA (experimental) drivers
420#
421# CONFIG_ATA is not set 453# CONFIG_ATA is not set
422
423#
424# Multi-device support (RAID and LVM)
425#
426# CONFIG_MD is not set 454# CONFIG_MD is not set
427 455
428# 456#
@@ -433,35 +461,18 @@ CONFIG_BLK_DEV_INITRD=y
433# 461#
434# IEEE 1394 (FireWire) support 462# IEEE 1394 (FireWire) support
435# 463#
464# CONFIG_FIREWIRE is not set
436# CONFIG_IEEE1394 is not set 465# CONFIG_IEEE1394 is not set
437
438#
439# I2O device support
440#
441# CONFIG_I2O is not set 466# CONFIG_I2O is not set
442
443#
444# Network device support
445#
446CONFIG_NETDEVICES=y 467CONFIG_NETDEVICES=y
468# CONFIG_NETDEVICES_MULTIQUEUE is not set
447# CONFIG_DUMMY is not set 469# CONFIG_DUMMY is not set
448# CONFIG_BONDING is not set 470# CONFIG_BONDING is not set
471# CONFIG_MACVLAN is not set
449# CONFIG_EQUALIZER is not set 472# CONFIG_EQUALIZER is not set
450# CONFIG_TUN is not set 473# CONFIG_TUN is not set
451
452#
453# ARCnet devices
454#
455# CONFIG_ARCNET is not set 474# CONFIG_ARCNET is not set
456
457#
458# PHY device support
459#
460# CONFIG_PHYLIB is not set 475# CONFIG_PHYLIB is not set
461
462#
463# Ethernet (10 or 100Mbit)
464#
465CONFIG_NET_ETHERNET=y 476CONFIG_NET_ETHERNET=y
466CONFIG_MII=y 477CONFIG_MII=y
467# CONFIG_STNIC is not set 478# CONFIG_STNIC is not set
@@ -470,10 +481,6 @@ CONFIG_MII=y
470# CONFIG_CASSINI is not set 481# CONFIG_CASSINI is not set
471# CONFIG_NET_VENDOR_3COM is not set 482# CONFIG_NET_VENDOR_3COM is not set
472# CONFIG_SMC91X is not set 483# CONFIG_SMC91X is not set
473
474#
475# Tulip family network device support
476#
477# CONFIG_NET_TULIP is not set 484# CONFIG_NET_TULIP is not set
478# CONFIG_HP100 is not set 485# CONFIG_HP100 is not set
479CONFIG_NET_PCI=y 486CONFIG_NET_PCI=y
@@ -488,9 +495,9 @@ CONFIG_NET_PCI=y
488# CONFIG_FEALNX is not set 495# CONFIG_FEALNX is not set
489# CONFIG_NATSEMI is not set 496# CONFIG_NATSEMI is not set
490# CONFIG_NE2K_PCI is not set 497# CONFIG_NE2K_PCI is not set
491# CONFIG_8139CP is not set 498CONFIG_8139CP=y
492CONFIG_8139TOO=y 499CONFIG_8139TOO=y
493# CONFIG_8139TOO_PIO is not set 500CONFIG_8139TOO_PIO=y
494# CONFIG_8139TOO_TUNE_TWISTER is not set 501# CONFIG_8139TOO_TUNE_TWISTER is not set
495# CONFIG_8139TOO_8129 is not set 502# CONFIG_8139TOO_8129 is not set
496# CONFIG_8139_OLD_RX_RESET is not set 503# CONFIG_8139_OLD_RX_RESET is not set
@@ -499,47 +506,16 @@ CONFIG_8139TOO=y
499# CONFIG_SUNDANCE is not set 506# CONFIG_SUNDANCE is not set
500# CONFIG_TLAN is not set 507# CONFIG_TLAN is not set
501# CONFIG_VIA_RHINE is not set 508# CONFIG_VIA_RHINE is not set
502 509# CONFIG_SC92031 is not set
503# 510# CONFIG_NETDEV_1000 is not set
504# Ethernet (1000 Mbit) 511# CONFIG_NETDEV_10000 is not set
505#
506# CONFIG_ACENIC is not set
507# CONFIG_DL2K is not set
508# CONFIG_E1000 is not set
509# CONFIG_NS83820 is not set
510# CONFIG_HAMACHI is not set
511# CONFIG_YELLOWFIN is not set
512# CONFIG_R8169 is not set
513# CONFIG_SIS190 is not set
514# CONFIG_SKGE is not set
515# CONFIG_SKY2 is not set
516# CONFIG_SK98LIN is not set
517# CONFIG_VIA_VELOCITY is not set
518# CONFIG_TIGON3 is not set
519# CONFIG_BNX2 is not set
520# CONFIG_QLA3XXX is not set
521
522#
523# Ethernet (10000 Mbit)
524#
525# CONFIG_CHELSIO_T1 is not set
526# CONFIG_IXGB is not set
527# CONFIG_S2IO is not set
528# CONFIG_MYRI10GE is not set
529
530#
531# Token Ring devices
532#
533# CONFIG_TR is not set 512# CONFIG_TR is not set
534 513
535# 514#
536# Wireless LAN (non-hamradio) 515# Wireless LAN
537#
538# CONFIG_NET_RADIO is not set
539
540#
541# Wan interfaces
542# 516#
517# CONFIG_WLAN_PRE80211 is not set
518# CONFIG_WLAN_80211 is not set
543# CONFIG_WAN is not set 519# CONFIG_WAN is not set
544# CONFIG_FDDI is not set 520# CONFIG_FDDI is not set
545# CONFIG_HIPPI is not set 521# CONFIG_HIPPI is not set
@@ -549,15 +525,7 @@ CONFIG_8139TOO=y
549# CONFIG_NETCONSOLE is not set 525# CONFIG_NETCONSOLE is not set
550# CONFIG_NETPOLL is not set 526# CONFIG_NETPOLL is not set
551# CONFIG_NET_POLL_CONTROLLER is not set 527# CONFIG_NET_POLL_CONTROLLER is not set
552
553#
554# ISDN subsystem
555#
556# CONFIG_ISDN is not set 528# CONFIG_ISDN is not set
557
558#
559# Telephony Support
560#
561# CONFIG_PHONE is not set 529# CONFIG_PHONE is not set
562 530
563# 531#
@@ -565,14 +533,12 @@ CONFIG_8139TOO=y
565# 533#
566CONFIG_INPUT=y 534CONFIG_INPUT=y
567# CONFIG_INPUT_FF_MEMLESS is not set 535# CONFIG_INPUT_FF_MEMLESS is not set
536# CONFIG_INPUT_POLLDEV is not set
568 537
569# 538#
570# Userland interfaces 539# Userland interfaces
571# 540#
572CONFIG_INPUT_MOUSEDEV=y 541# CONFIG_INPUT_MOUSEDEV is not set
573CONFIG_INPUT_MOUSEDEV_PSAUX=y
574CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
575CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
576# CONFIG_INPUT_JOYDEV is not set 542# CONFIG_INPUT_JOYDEV is not set
577# CONFIG_INPUT_TSDEV is not set 543# CONFIG_INPUT_TSDEV is not set
578# CONFIG_INPUT_EVDEV is not set 544# CONFIG_INPUT_EVDEV is not set
@@ -584,27 +550,20 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
584# CONFIG_INPUT_KEYBOARD is not set 550# CONFIG_INPUT_KEYBOARD is not set
585# CONFIG_INPUT_MOUSE is not set 551# CONFIG_INPUT_MOUSE is not set
586# CONFIG_INPUT_JOYSTICK is not set 552# CONFIG_INPUT_JOYSTICK is not set
553# CONFIG_INPUT_TABLET is not set
587# CONFIG_INPUT_TOUCHSCREEN is not set 554# CONFIG_INPUT_TOUCHSCREEN is not set
588# CONFIG_INPUT_MISC is not set 555# CONFIG_INPUT_MISC is not set
589 556
590# 557#
591# Hardware I/O ports 558# Hardware I/O ports
592# 559#
593CONFIG_SERIO=y 560# CONFIG_SERIO is not set
594CONFIG_SERIO_I8042=y
595CONFIG_SERIO_SERPORT=y
596# CONFIG_SERIO_PCIPS2 is not set
597# CONFIG_SERIO_LIBPS2 is not set
598# CONFIG_SERIO_RAW is not set
599# CONFIG_GAMEPORT is not set 561# CONFIG_GAMEPORT is not set
600 562
601# 563#
602# Character devices 564# Character devices
603# 565#
604CONFIG_VT=y 566# CONFIG_VT is not set
605CONFIG_VT_CONSOLE=y
606CONFIG_HW_CONSOLE=y
607# CONFIG_VT_HW_CONSOLE_BINDING is not set
608# CONFIG_SERIAL_NONSTANDARD is not set 567# CONFIG_SERIAL_NONSTANDARD is not set
609 568
610# 569#
@@ -615,42 +574,24 @@ CONFIG_HW_CONSOLE=y
615# 574#
616# Non-8250 serial port support 575# Non-8250 serial port support
617# 576#
618# CONFIG_SERIAL_SH_SCI is not set 577CONFIG_SERIAL_SH_SCI=y
578CONFIG_SERIAL_SH_SCI_NR_UARTS=2
579CONFIG_SERIAL_SH_SCI_CONSOLE=y
580CONFIG_SERIAL_CORE=y
581CONFIG_SERIAL_CORE_CONSOLE=y
619# CONFIG_SERIAL_JSM is not set 582# CONFIG_SERIAL_JSM is not set
620CONFIG_UNIX98_PTYS=y 583CONFIG_UNIX98_PTYS=y
621CONFIG_LEGACY_PTYS=y 584CONFIG_LEGACY_PTYS=y
622CONFIG_LEGACY_PTY_COUNT=256 585CONFIG_LEGACY_PTY_COUNT=256
623
624#
625# IPMI
626#
627# CONFIG_IPMI_HANDLER is not set 586# CONFIG_IPMI_HANDLER is not set
628
629#
630# Watchdog Cards
631#
632# CONFIG_WATCHDOG is not set 587# CONFIG_WATCHDOG is not set
633CONFIG_HW_RANDOM=y 588# CONFIG_HW_RANDOM is not set
634# CONFIG_GEN_RTC is not set
635# CONFIG_DTLK is not set
636# CONFIG_R3964 is not set 589# CONFIG_R3964 is not set
637# CONFIG_APPLICOM is not set 590# CONFIG_APPLICOM is not set
638
639#
640# Ftape, the floppy tape device driver
641#
642# CONFIG_DRM is not set 591# CONFIG_DRM is not set
643# CONFIG_RAW_DRIVER is not set 592# CONFIG_RAW_DRIVER is not set
644
645#
646# TPM devices
647#
648# CONFIG_TCG_TPM is not set 593# CONFIG_TCG_TPM is not set
649# CONFIG_TELCLOCK is not set 594CONFIG_DEVPORT=y
650
651#
652# I2C support
653#
654# CONFIG_I2C is not set 595# CONFIG_I2C is not set
655 596
656# 597#
@@ -658,98 +599,46 @@ CONFIG_HW_RANDOM=y
658# 599#
659# CONFIG_SPI is not set 600# CONFIG_SPI is not set
660# CONFIG_SPI_MASTER is not set 601# CONFIG_SPI_MASTER is not set
602# CONFIG_W1 is not set
603# CONFIG_POWER_SUPPLY is not set
604# CONFIG_HWMON is not set
661 605
662# 606#
663# Dallas's 1-wire bus 607# Multifunction device drivers
664#
665
666#
667# Hardware Monitoring support
668#
669CONFIG_HWMON=y
670# CONFIG_HWMON_VID is not set
671# CONFIG_SENSORS_ABITUGURU is not set
672# CONFIG_SENSORS_F71805F is not set
673# CONFIG_SENSORS_VT1211 is not set
674# CONFIG_HWMON_DEBUG_CHIP is not set
675
676#
677# Misc devices
678# 608#
609# CONFIG_MFD_SM501 is not set
679 610
680# 611#
681# Multimedia devices 612# Multimedia devices
682# 613#
683# CONFIG_VIDEO_DEV is not set 614# CONFIG_VIDEO_DEV is not set
684CONFIG_VIDEO_V4L2=y 615# CONFIG_DVB_CORE is not set
685 616# CONFIG_DAB is not set
686#
687# Digital Video Broadcasting Devices
688#
689# CONFIG_DVB is not set
690 617
691# 618#
692# Graphics support 619# Graphics support
693# 620#
694CONFIG_FIRMWARE_EDID=y 621# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
695# CONFIG_FB is not set
696 622
697# 623#
698# Console display driver support 624# Display device support
699# 625#
700CONFIG_DUMMY_CONSOLE=y 626# CONFIG_DISPLAY_SUPPORT is not set
701# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 627# CONFIG_VGASTATE is not set
628# CONFIG_VIDEO_OUTPUT_CONTROL is not set
629# CONFIG_FB is not set
702 630
703# 631#
704# Sound 632# Sound
705# 633#
706# CONFIG_SOUND is not set 634# CONFIG_SOUND is not set
707 635# CONFIG_HID_SUPPORT is not set
708# 636# CONFIG_USB_SUPPORT is not set
709# USB support
710#
711CONFIG_USB_ARCH_HAS_HCD=y
712CONFIG_USB_ARCH_HAS_OHCI=y
713CONFIG_USB_ARCH_HAS_EHCI=y
714# CONFIG_USB is not set
715
716#
717# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
718#
719
720#
721# USB Gadget Support
722#
723# CONFIG_USB_GADGET is not set
724
725#
726# MMC/SD Card support
727#
728# CONFIG_MMC is not set 637# CONFIG_MMC is not set
729
730#
731# LED devices
732#
733# CONFIG_NEW_LEDS is not set 638# CONFIG_NEW_LEDS is not set
734
735#
736# LED drivers
737#
738
739#
740# LED Triggers
741#
742
743#
744# InfiniBand support
745#
746# CONFIG_INFINIBAND is not set 639# CONFIG_INFINIBAND is not set
747 640
748# 641#
749# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
750#
751
752#
753# Real Time Clock 642# Real Time Clock
754# 643#
755# CONFIG_RTC_CLASS is not set 644# CONFIG_RTC_CLASS is not set
@@ -768,23 +657,29 @@ CONFIG_USB_ARCH_HAS_EHCI=y
768# 657#
769 658
770# 659#
660# Userspace I/O
661#
662# CONFIG_UIO is not set
663
664#
771# File systems 665# File systems
772# 666#
773CONFIG_EXT2_FS=y 667CONFIG_EXT2_FS=y
774# CONFIG_EXT2_FS_XATTR is not set 668# CONFIG_EXT2_FS_XATTR is not set
775# CONFIG_EXT2_FS_XIP is not set 669# CONFIG_EXT2_FS_XIP is not set
776# CONFIG_EXT3_FS is not set 670# CONFIG_EXT3_FS is not set
671# CONFIG_EXT4DEV_FS is not set
777# CONFIG_REISERFS_FS is not set 672# CONFIG_REISERFS_FS is not set
778# CONFIG_JFS_FS is not set 673# CONFIG_JFS_FS is not set
779# CONFIG_FS_POSIX_ACL is not set 674# CONFIG_FS_POSIX_ACL is not set
780# CONFIG_XFS_FS is not set 675# CONFIG_XFS_FS is not set
676# CONFIG_GFS2_FS is not set
781# CONFIG_OCFS2_FS is not set 677# CONFIG_OCFS2_FS is not set
782# CONFIG_MINIX_FS is not set 678# CONFIG_MINIX_FS is not set
783CONFIG_ROMFS_FS=y 679CONFIG_ROMFS_FS=y
784CONFIG_INOTIFY=y 680# CONFIG_INOTIFY is not set
785CONFIG_INOTIFY_USER=y
786# CONFIG_QUOTA is not set 681# CONFIG_QUOTA is not set
787CONFIG_DNOTIFY=y 682# CONFIG_DNOTIFY is not set
788# CONFIG_AUTOFS_FS is not set 683# CONFIG_AUTOFS_FS is not set
789# CONFIG_AUTOFS4_FS is not set 684# CONFIG_AUTOFS4_FS is not set
790# CONFIG_FUSE_FS is not set 685# CONFIG_FUSE_FS is not set
@@ -826,6 +721,7 @@ CONFIG_RAMFS=y
826# CONFIG_BEFS_FS is not set 721# CONFIG_BEFS_FS is not set
827# CONFIG_BFS_FS is not set 722# CONFIG_BFS_FS is not set
828# CONFIG_EFS_FS is not set 723# CONFIG_EFS_FS is not set
724# CONFIG_JFFS2_FS is not set
829CONFIG_CRAMFS=y 725CONFIG_CRAMFS=y
830# CONFIG_VXFS_FS is not set 726# CONFIG_VXFS_FS is not set
831# CONFIG_HPFS_FS is not set 727# CONFIG_HPFS_FS is not set
@@ -836,25 +732,13 @@ CONFIG_CRAMFS=y
836# 732#
837# Network File Systems 733# Network File Systems
838# 734#
839CONFIG_NFS_FS=y 735# CONFIG_NFS_FS is not set
840CONFIG_NFS_V3=y
841# CONFIG_NFS_V3_ACL is not set
842# CONFIG_NFS_V4 is not set
843# CONFIG_NFS_DIRECTIO is not set
844# CONFIG_NFSD is not set 736# CONFIG_NFSD is not set
845CONFIG_ROOT_NFS=y
846CONFIG_LOCKD=y
847CONFIG_LOCKD_V4=y
848CONFIG_NFS_COMMON=y
849CONFIG_SUNRPC=y
850# CONFIG_RPCSEC_GSS_KRB5 is not set
851# CONFIG_RPCSEC_GSS_SPKM3 is not set
852# CONFIG_SMB_FS is not set 737# CONFIG_SMB_FS is not set
853# CONFIG_CIFS is not set 738# CONFIG_CIFS is not set
854# CONFIG_NCP_FS is not set 739# CONFIG_NCP_FS is not set
855# CONFIG_CODA_FS is not set 740# CONFIG_CODA_FS is not set
856# CONFIG_AFS_FS is not set 741# CONFIG_AFS_FS is not set
857# CONFIG_9P_FS is not set
858 742
859# 743#
860# Partition Types 744# Partition Types
@@ -868,6 +752,11 @@ CONFIG_MSDOS_PARTITION=y
868# CONFIG_NLS is not set 752# CONFIG_NLS is not set
869 753
870# 754#
755# Distributed Lock Manager
756#
757# CONFIG_DLM is not set
758
759#
871# Profiling support 760# Profiling support
872# 761#
873# CONFIG_PROFILING is not set 762# CONFIG_PROFILING is not set
@@ -875,36 +764,38 @@ CONFIG_MSDOS_PARTITION=y
875# 764#
876# Kernel hacking 765# Kernel hacking
877# 766#
767CONFIG_TRACE_IRQFLAGS_SUPPORT=y
878# CONFIG_PRINTK_TIME is not set 768# CONFIG_PRINTK_TIME is not set
879CONFIG_ENABLE_MUST_CHECK=y 769CONFIG_ENABLE_MUST_CHECK=y
880# CONFIG_MAGIC_SYSRQ is not set 770# CONFIG_MAGIC_SYSRQ is not set
881# CONFIG_UNUSED_SYMBOLS is not set 771# CONFIG_UNUSED_SYMBOLS is not set
772# CONFIG_DEBUG_FS is not set
773# CONFIG_HEADERS_CHECK is not set
882# CONFIG_DEBUG_KERNEL is not set 774# CONFIG_DEBUG_KERNEL is not set
883CONFIG_LOG_BUF_SHIFT=14
884# CONFIG_DEBUG_BUGVERBOSE is not set 775# CONFIG_DEBUG_BUGVERBOSE is not set
885# CONFIG_DEBUG_FS is not set
886# CONFIG_UNWIND_INFO is not set
887# CONFIG_SH_STANDARD_BIOS is not set 776# CONFIG_SH_STANDARD_BIOS is not set
888# CONFIG_EARLY_SCIF_CONSOLE is not set 777# CONFIG_EARLY_SCIF_CONSOLE is not set
889# CONFIG_KGDB is not set 778# CONFIG_SH_KGDB is not set
890 779
891# 780#
892# Security options 781# Security options
893# 782#
894# CONFIG_KEYS is not set 783# CONFIG_KEYS is not set
895# CONFIG_SECURITY is not set 784# CONFIG_SECURITY is not set
896
897#
898# Cryptographic options
899#
900# CONFIG_CRYPTO is not set 785# CONFIG_CRYPTO is not set
901 786
902# 787#
903# Library routines 788# Library routines
904# 789#
790CONFIG_BITREVERSE=y
905# CONFIG_CRC_CCITT is not set 791# CONFIG_CRC_CCITT is not set
906# CONFIG_CRC16 is not set 792# CONFIG_CRC16 is not set
793# CONFIG_CRC_ITU_T is not set
907CONFIG_CRC32=y 794CONFIG_CRC32=y
795# CONFIG_CRC7 is not set
908# CONFIG_LIBCRC32C is not set 796# CONFIG_LIBCRC32C is not set
909CONFIG_ZLIB_INFLATE=y 797CONFIG_ZLIB_INFLATE=y
910CONFIG_PLIST=y 798CONFIG_PLIST=y
799CONFIG_HAS_IOMEM=y
800CONFIG_HAS_IOPORT=y
801CONFIG_HAS_DMA=y
diff --git a/arch/sh/configs/systemh_defconfig b/arch/sh/configs/systemh_defconfig
index c16350dac01b..af921b5a9d46 100644
--- a/arch/sh/configs/systemh_defconfig
+++ b/arch/sh/configs/systemh_defconfig
@@ -141,7 +141,7 @@ CONFIG_CPU_SH4=y
141# CONFIG_CPU_SUBTYPE_SH7091 is not set 141# CONFIG_CPU_SUBTYPE_SH7091 is not set
142# CONFIG_CPU_SUBTYPE_SH7750R is not set 142# CONFIG_CPU_SUBTYPE_SH7750R is not set
143# CONFIG_CPU_SUBTYPE_SH7750S is not set 143# CONFIG_CPU_SUBTYPE_SH7750S is not set
144CONFIG_CPU_SUBTYPE_SH7751=y 144# CONFIG_CPU_SUBTYPE_SH7751 is not set
145CONFIG_CPU_SUBTYPE_SH7751R=y 145CONFIG_CPU_SUBTYPE_SH7751R=y
146# CONFIG_CPU_SUBTYPE_SH7760 is not set 146# CONFIG_CPU_SUBTYPE_SH7760 is not set
147# CONFIG_CPU_SUBTYPE_SH4_202 is not set 147# CONFIG_CPU_SUBTYPE_SH4_202 is not set
diff --git a/arch/sh/configs/titan_defconfig b/arch/sh/configs/titan_defconfig
index 41049cf14b79..0686ed6fe17a 100644
--- a/arch/sh/configs/titan_defconfig
+++ b/arch/sh/configs/titan_defconfig
@@ -147,7 +147,7 @@ CONFIG_CPU_SH4=y
147# CONFIG_CPU_SUBTYPE_SH7091 is not set 147# CONFIG_CPU_SUBTYPE_SH7091 is not set
148# CONFIG_CPU_SUBTYPE_SH7750R is not set 148# CONFIG_CPU_SUBTYPE_SH7750R is not set
149# CONFIG_CPU_SUBTYPE_SH7750S is not set 149# CONFIG_CPU_SUBTYPE_SH7750S is not set
150CONFIG_CPU_SUBTYPE_SH7751=y 150# CONFIG_CPU_SUBTYPE_SH7751 is not set
151CONFIG_CPU_SUBTYPE_SH7751R=y 151CONFIG_CPU_SUBTYPE_SH7751R=y
152# CONFIG_CPU_SUBTYPE_SH7760 is not set 152# CONFIG_CPU_SUBTYPE_SH7760 is not set
153# CONFIG_CPU_SUBTYPE_SH4_202 is not set 153# CONFIG_CPU_SUBTYPE_SH4_202 is not set
diff --git a/arch/sh/kernel/cpu/sh3/entry.S b/arch/sh/kernel/cpu/sh3/entry.S
index d8e122971c3e..0d12a124055c 100644
--- a/arch/sh/kernel/cpu/sh3/entry.S
+++ b/arch/sh/kernel/cpu/sh3/entry.S
@@ -149,8 +149,7 @@ call_dpf:
149 lds r10, pr 149 lds r10, pr
150 rts 150 rts
151 nop 151 nop
1520: sti 1520: mov.l 3f, r0
153 mov.l 3f, r0
154 mov r9, r6 153 mov r9, r6
155 mov r8, r5 154 mov r8, r5
156 jmp @r0 155 jmp @r0
diff --git a/arch/sh/kernel/traps.c b/arch/sh/kernel/traps.c
index 502d43e4785c..67015044d74a 100644
--- a/arch/sh/kernel/traps.c
+++ b/arch/sh/kernel/traps.c
@@ -854,9 +854,14 @@ void __init trap_init(void)
854 set_exception_table_evt(0x800, do_reserved_inst); 854 set_exception_table_evt(0x800, do_reserved_inst);
855 set_exception_table_evt(0x820, do_illegal_slot_inst); 855 set_exception_table_evt(0x820, do_illegal_slot_inst);
856#elif defined(CONFIG_SH_FPU) 856#elif defined(CONFIG_SH_FPU)
857#ifdef CONFIG_CPU_SUBTYPE_SHX3
858 set_exception_table_evt(0xd80, do_fpu_state_restore);
859 set_exception_table_evt(0xda0, do_fpu_state_restore);
860#else
857 set_exception_table_evt(0x800, do_fpu_state_restore); 861 set_exception_table_evt(0x800, do_fpu_state_restore);
858 set_exception_table_evt(0x820, do_fpu_state_restore); 862 set_exception_table_evt(0x820, do_fpu_state_restore);
859#endif 863#endif
864#endif
860 865
861#ifdef CONFIG_CPU_SH2 866#ifdef CONFIG_CPU_SH2
862 set_exception_table_vec(TRAP_ADDRESS_ERROR, address_error_handler); 867 set_exception_table_vec(TRAP_ADDRESS_ERROR, address_error_handler);
diff --git a/arch/sh/mm/Makefile b/arch/sh/mm/Makefile
index d677d7f3afc1..4061e89d84d0 100644
--- a/arch/sh/mm/Makefile
+++ b/arch/sh/mm/Makefile
@@ -8,7 +8,9 @@ obj-$(CONFIG_CPU_SH2) += cache-sh2.o
8obj-$(CONFIG_CPU_SH3) += cache-sh3.o 8obj-$(CONFIG_CPU_SH3) += cache-sh3.o
9obj-$(CONFIG_CPU_SH4) += cache-sh4.o 9obj-$(CONFIG_CPU_SH4) += cache-sh4.o
10 10
11mmu-y := fault-nommu.o tlb-nommu.o pg-nommu.o 11mmu-y := tlb-nommu.o pg-nommu.o
12mmu-$(CONFIG_CPU_SH3) += fault-nommu.o
13mmu-$(CONFIG_CPU_SH4) += fault-nommu.o
12mmu-$(CONFIG_MMU) := fault.o clear_page.o copy_page.o tlb-flush.o \ 14mmu-$(CONFIG_MMU) := fault.o clear_page.o copy_page.o tlb-flush.o \
13 ioremap.o 15 ioremap.o
14 16
diff --git a/arch/sh/mm/fault-nommu.c b/arch/sh/mm/fault-nommu.c
index 923cb456819b..c6f5b51ec2c7 100644
--- a/arch/sh/mm/fault-nommu.c
+++ b/arch/sh/mm/fault-nommu.c
@@ -1,47 +1,33 @@
1/* 1/*
2 * arch/sh/mm/fault-nommu.c 2 * arch/sh/mm/fault-nommu.c
3 * 3 *
4 * Copyright (C) 2002 Paul Mundt 4 * Copyright (C) 2002 - 2007 Paul Mundt
5 * 5 *
6 * Based on linux/arch/sh/mm/fault.c: 6 * Based on linux/arch/sh/mm/fault.c:
7 * Copyright (C) 1999 Niibe Yutaka 7 * Copyright (C) 1999 Niibe Yutaka
8 * 8 *
9 * Released under the terms of the GNU GPL v2.0. 9 * Released under the terms of the GNU GPL v2.0.
10 */ 10 */
11
12#include <linux/signal.h>
13#include <linux/sched.h>
14#include <linux/kernel.h> 11#include <linux/kernel.h>
15#include <linux/errno.h>
16#include <linux/string.h>
17#include <linux/types.h>
18#include <linux/ptrace.h>
19#include <linux/mman.h>
20#include <linux/mm.h> 12#include <linux/mm.h>
21#include <linux/smp.h> 13#include <linux/hardirq.h>
22#include <linux/interrupt.h> 14#include <linux/kprobes.h>
23
24#include <asm/system.h> 15#include <asm/system.h>
25#include <asm/io.h> 16#include <asm/ptrace.h>
26#include <asm/uaccess.h>
27#include <asm/pgalloc.h>
28#include <asm/mmu_context.h>
29#include <asm/cacheflush.h>
30
31#if defined(CONFIG_SH_KGDB)
32#include <asm/kgdb.h> 17#include <asm/kgdb.h>
33#endif
34
35extern void die(const char *,struct pt_regs *,long);
36 18
37/* 19/*
38 * This routine handles page faults. It determines the address, 20 * This routine handles page faults. It determines the address,
39 * and the problem, and then passes it off to one of the appropriate 21 * and the problem, and then passes it off to one of the appropriate
40 * routines. 22 * routines.
41 */ 23 */
42asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long writeaccess, 24asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
43 unsigned long address) 25 unsigned long writeaccess,
26 unsigned long address)
44{ 27{
28 trace_hardirqs_on();
29 local_irq_enable();
30
45#if defined(CONFIG_SH_KGDB) 31#if defined(CONFIG_SH_KGDB)
46 if (kgdb_nofault && kgdb_bus_err_hook) 32 if (kgdb_nofault && kgdb_bus_err_hook)
47 kgdb_bus_err_hook(); 33 kgdb_bus_err_hook();
@@ -65,17 +51,14 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long writeaccess,
65 do_exit(SIGKILL); 51 do_exit(SIGKILL);
66} 52}
67 53
68asmlinkage int __do_page_fault(struct pt_regs *regs, unsigned long writeaccess, 54asmlinkage int __kprobes __do_page_fault(struct pt_regs *regs,
69 unsigned long address) 55 unsigned long writeaccess,
56 unsigned long address)
70{ 57{
71#if defined(CONFIG_SH_KGDB) 58#if defined(CONFIG_SH_KGDB)
72 if (kgdb_nofault && kgdb_bus_err_hook) 59 if (kgdb_nofault && kgdb_bus_err_hook)
73 kgdb_bus_err_hook(); 60 kgdb_bus_err_hook();
74#endif 61#endif
75 62
76 if (address >= TASK_SIZE) 63 return (address >= TASK_SIZE);
77 return 1;
78
79 return 0;
80} 64}
81
diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c
index 964c6767dc73..04a39aa7f1f9 100644
--- a/arch/sh/mm/fault.c
+++ b/arch/sh/mm/fault.c
@@ -184,8 +184,7 @@ no_context:
184 printk(KERN_ALERT "pc = %08lx\n", regs->pc); 184 printk(KERN_ALERT "pc = %08lx\n", regs->pc);
185 page = (unsigned long)get_TTB(); 185 page = (unsigned long)get_TTB();
186 if (page) { 186 if (page) {
187 page = ((__typeof__(page) *) __va(page))[address >> 187 page = ((__typeof__(page) *)page)[address >> PGDIR_SHIFT];
188 PGDIR_SHIFT];
189 printk(KERN_ALERT "*pde = %08lx\n", page); 188 printk(KERN_ALERT "*pde = %08lx\n", page);
190 if (page & _PAGE_PRESENT) { 189 if (page & _PAGE_PRESENT) {
191 page &= PAGE_MASK; 190 page &= PAGE_MASK;
diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S
index eac38388f5fd..88d2cefd01be 100644
--- a/arch/sparc/kernel/entry.S
+++ b/arch/sparc/kernel/entry.S
@@ -1,7 +1,6 @@
1/* $Id: entry.S,v 1.170 2001/11/13 00:57:05 davem Exp $ 1/* arch/sparc/kernel/entry.S: Sparc trap low-level entry points.
2 * arch/sparc/kernel/entry.S: Sparc trap low-level entry points.
3 * 2 *
4 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 3 * Copyright (C) 1995, 2007 David S. Miller (davem@davemloft.net)
5 * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) 4 * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be)
6 * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx) 5 * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx)
7 * Copyright (C) 1996-1999 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 6 * Copyright (C) 1996-1999 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
@@ -129,7 +128,7 @@ trap_low:
129 RESTORE_ALL 128 RESTORE_ALL
130#endif 129#endif
131 130
132#ifdef CONFIG_BLK_DEV_FD 131#if defined(CONFIG_BLK_DEV_FD) || defined(CONFIG_BLK_DEV_FD_MODULE)
133 .text 132 .text
134 .align 4 133 .align 4
135 .globl floppy_hardint 134 .globl floppy_hardint
diff --git a/arch/sparc/kernel/irq.c b/arch/sparc/kernel/irq.c
index 75b2240ad0f9..b76dc03fc318 100644
--- a/arch/sparc/kernel/irq.c
+++ b/arch/sparc/kernel/irq.c
@@ -351,34 +351,14 @@ void handler_irq(int irq, struct pt_regs * regs)
351 set_irq_regs(old_regs); 351 set_irq_regs(old_regs);
352} 352}
353 353
354#ifdef CONFIG_BLK_DEV_FD 354#if defined(CONFIG_BLK_DEV_FD) || defined(CONFIG_BLK_DEV_FD_MODULE)
355extern void floppy_interrupt(int irq, void *dev_id);
356
357void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs)
358{
359 struct pt_regs *old_regs;
360 int cpu = smp_processor_id();
361
362 old_regs = set_irq_regs(regs);
363 disable_pil_irq(irq);
364 irq_enter();
365 kstat_cpu(cpu).irqs[irq]++;
366 floppy_interrupt(irq, dev_id);
367 irq_exit();
368 enable_pil_irq(irq);
369 set_irq_regs(old_regs);
370 // XXX Eek, it's totally changed with preempt_count() and such
371 // if (softirq_pending(cpu))
372 // do_softirq();
373}
374#endif
375 355
376/* Fast IRQs on the Sparc can only have one routine attached to them, 356/* Fast IRQs on the Sparc can only have one routine attached to them,
377 * thus no sharing possible. 357 * thus no sharing possible.
378 */ 358 */
379int request_fast_irq(unsigned int irq, 359static int request_fast_irq(unsigned int irq,
380 irq_handler_t handler, 360 void (*handler)(void),
381 unsigned long irqflags, const char *devname) 361 unsigned long irqflags, const char *devname)
382{ 362{
383 struct irqaction *action; 363 struct irqaction *action;
384 unsigned long flags; 364 unsigned long flags;
@@ -457,7 +437,6 @@ int request_fast_irq(unsigned int irq,
457 */ 437 */
458 flush_cache_all(); 438 flush_cache_all();
459 439
460 action->handler = handler;
461 action->flags = irqflags; 440 action->flags = irqflags;
462 cpus_clear(action->mask); 441 cpus_clear(action->mask);
463 action->name = devname; 442 action->name = devname;
@@ -475,6 +454,61 @@ out:
475 return ret; 454 return ret;
476} 455}
477 456
457/* These variables are used to access state from the assembler
458 * interrupt handler, floppy_hardint, so we cannot put these in
459 * the floppy driver image because that would not work in the
460 * modular case.
461 */
462volatile unsigned char *fdc_status;
463EXPORT_SYMBOL(fdc_status);
464
465char *pdma_vaddr;
466EXPORT_SYMBOL(pdma_vaddr);
467
468unsigned long pdma_size;
469EXPORT_SYMBOL(pdma_size);
470
471volatile int doing_pdma;
472EXPORT_SYMBOL(doing_pdma);
473
474char *pdma_base;
475EXPORT_SYMBOL(pdma_base);
476
477unsigned long pdma_areasize;
478EXPORT_SYMBOL(pdma_areasize);
479
480extern void floppy_hardint(void);
481
482static irqreturn_t (*floppy_irq_handler)(int irq, void *dev_id);
483
484void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs)
485{
486 struct pt_regs *old_regs;
487 int cpu = smp_processor_id();
488
489 old_regs = set_irq_regs(regs);
490 disable_pil_irq(irq);
491 irq_enter();
492 kstat_cpu(cpu).irqs[irq]++;
493 floppy_irq_handler(irq, dev_id);
494 irq_exit();
495 enable_pil_irq(irq);
496 set_irq_regs(old_regs);
497 // XXX Eek, it's totally changed with preempt_count() and such
498 // if (softirq_pending(cpu))
499 // do_softirq();
500}
501
502int sparc_floppy_request_irq(int irq, unsigned long flags,
503 irqreturn_t (*irq_handler)(int irq, void *))
504{
505 floppy_irq_handler = irq_handler;
506 return request_fast_irq(irq, floppy_hardint, flags, "floppy");
507}
508EXPORT_SYMBOL(sparc_floppy_request_irq);
509
510#endif
511
478int request_irq(unsigned int irq, 512int request_irq(unsigned int irq,
479 irq_handler_t handler, 513 irq_handler_t handler,
480 unsigned long irqflags, const char * devname, void *dev_id) 514 unsigned long irqflags, const char * devname, void *dev_id)
diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c
index 7b4abde43028..ef647acc479e 100644
--- a/arch/sparc/kernel/sparc_ksyms.c
+++ b/arch/sparc/kernel/sparc_ksyms.c
@@ -143,7 +143,6 @@ EXPORT_SYMBOL(mstk48t02_regs);
143EXPORT_SYMBOL(set_auxio); 143EXPORT_SYMBOL(set_auxio);
144EXPORT_SYMBOL(get_auxio); 144EXPORT_SYMBOL(get_auxio);
145#endif 145#endif
146EXPORT_SYMBOL(request_fast_irq);
147EXPORT_SYMBOL(io_remap_pfn_range); 146EXPORT_SYMBOL(io_remap_pfn_range);
148 /* P3: iounit_xxx may be needed, sun4d users */ 147 /* P3: iounit_xxx may be needed, sun4d users */
149/* EXPORT_SYMBOL(iounit_map_dma_init); */ 148/* EXPORT_SYMBOL(iounit_map_dma_init); */
diff --git a/block/bsg.c b/block/bsg.c
index d60eee549405..ed2646827234 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * bsg.c - block layer implementation of the sg v3 interface 2 * bsg.c - block layer implementation of the sg v4 interface
3 * 3 *
4 * Copyright (C) 2004 Jens Axboe <axboe@suse.de> SUSE Labs 4 * Copyright (C) 2004 Jens Axboe <axboe@suse.de> SUSE Labs
5 * Copyright (C) 2004 Peter M. Jones <pjones@redhat.com> 5 * Copyright (C) 2004 Peter M. Jones <pjones@redhat.com>
@@ -421,7 +421,6 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr,
421 hdr->info = 0; 421 hdr->info = 0;
422 if (hdr->device_status || hdr->transport_status || hdr->driver_status) 422 if (hdr->device_status || hdr->transport_status || hdr->driver_status)
423 hdr->info |= SG_INFO_CHECK; 423 hdr->info |= SG_INFO_CHECK;
424 hdr->din_resid = rq->data_len;
425 hdr->response_len = 0; 424 hdr->response_len = 0;
426 425
427 if (rq->sense_len && hdr->response) { 426 if (rq->sense_len && hdr->response) {
@@ -437,9 +436,14 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr,
437 } 436 }
438 437
439 if (rq->next_rq) { 438 if (rq->next_rq) {
439 hdr->dout_resid = rq->data_len;
440 hdr->din_resid = rq->next_rq->data_len;
440 blk_rq_unmap_user(bidi_bio); 441 blk_rq_unmap_user(bidi_bio);
441 blk_put_request(rq->next_rq); 442 blk_put_request(rq->next_rq);
442 } 443 } else if (rq_data_dir(rq) == READ)
444 hdr->din_resid = rq->data_len;
445 else
446 hdr->dout_resid = rq->data_len;
443 447
444 blk_rq_unmap_user(bio); 448 blk_rq_unmap_user(bio);
445 blk_put_request(rq); 449 blk_put_request(rq);
diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c
index 1c166b47b4cc..3dbb1cc6eab5 100644
--- a/crypto/ablkcipher.c
+++ b/crypto/ablkcipher.c
@@ -35,7 +35,7 @@ static int setkey_unaligned(struct crypto_ablkcipher *tfm, const u8 *key, unsign
35 alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1); 35 alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1);
36 memcpy(alignbuffer, key, keylen); 36 memcpy(alignbuffer, key, keylen);
37 ret = cipher->setkey(tfm, alignbuffer, keylen); 37 ret = cipher->setkey(tfm, alignbuffer, keylen);
38 memset(alignbuffer, 0, absize); 38 memset(alignbuffer, 0, keylen);
39 kfree(buffer); 39 kfree(buffer);
40 return ret; 40 return ret;
41} 41}
diff --git a/crypto/blkcipher.c b/crypto/blkcipher.c
index 40a3dcff15bb..7755834b8846 100644
--- a/crypto/blkcipher.c
+++ b/crypto/blkcipher.c
@@ -352,7 +352,7 @@ static int setkey_unaligned(struct crypto_tfm *tfm, const u8 *key, unsigned int
352 alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1); 352 alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1);
353 memcpy(alignbuffer, key, keylen); 353 memcpy(alignbuffer, key, keylen);
354 ret = cipher->setkey(tfm, alignbuffer, keylen); 354 ret = cipher->setkey(tfm, alignbuffer, keylen);
355 memset(alignbuffer, 0, absize); 355 memset(alignbuffer, 0, keylen);
356 kfree(buffer); 356 kfree(buffer);
357 return ret; 357 return ret;
358} 358}
diff --git a/crypto/cipher.c b/crypto/cipher.c
index 0b2650c2014b..fc6b46f2a9b0 100644
--- a/crypto/cipher.c
+++ b/crypto/cipher.c
@@ -36,7 +36,7 @@ static int setkey_unaligned(struct crypto_tfm *tfm, const u8 *key, unsigned int
36 alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1); 36 alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1);
37 memcpy(alignbuffer, key, keylen); 37 memcpy(alignbuffer, key, keylen);
38 ret = cia->cia_setkey(tfm, alignbuffer, keylen); 38 ret = cia->cia_setkey(tfm, alignbuffer, keylen);
39 memset(alignbuffer, 0, absize); 39 memset(alignbuffer, 0, keylen);
40 kfree(buffer); 40 kfree(buffer);
41 return ret; 41 return ret;
42 42
diff --git a/crypto/hash.c b/crypto/hash.c
index 4d75ca7b57b2..4fd470bd729b 100644
--- a/crypto/hash.c
+++ b/crypto/hash.c
@@ -40,7 +40,7 @@ static int hash_setkey_unaligned(struct crypto_hash *crt, const u8 *key,
40 alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1); 40 alignbuffer = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1);
41 memcpy(alignbuffer, key, keylen); 41 memcpy(alignbuffer, key, keylen);
42 ret = alg->setkey(crt, alignbuffer, keylen); 42 ret = alg->setkey(crt, alignbuffer, keylen);
43 memset(alignbuffer, 0, absize); 43 memset(alignbuffer, 0, keylen);
44 kfree(buffer); 44 kfree(buffer);
45 return ret; 45 return ret;
46} 46}
diff --git a/drivers/ata/pata_icside.c b/drivers/ata/pata_icside.c
index 321d98b0bed2..64a711776c45 100644
--- a/drivers/ata/pata_icside.c
+++ b/drivers/ata/pata_icside.c
@@ -330,17 +330,12 @@ static void ata_dummy_noret(struct ata_port *port)
330{ 330{
331} 331}
332 332
333/* 333static void pata_icside_postreset(struct ata_port *ap, unsigned int *classes)
334 * We need to shut down unused ports to prevent spurious interrupts.
335 * FIXME: the libata core doesn't call this function for PATA interfaces.
336 */
337static void pata_icside_port_disable(struct ata_port *ap)
338{ 334{
339 struct pata_icside_state *state = ap->host->private_data; 335 struct pata_icside_state *state = ap->host->private_data;
340 336
341 ata_port_printk(ap, KERN_ERR, "disabling icside port\n"); 337 if (classes[0] != ATA_DEV_NONE || classes[1] != ATA_DEV_NONE)
342 338 return ata_std_postreset(ap, classes);
343 ata_port_disable(ap);
344 339
345 state->port[ap->port_no].disabled = 1; 340 state->port[ap->port_no].disabled = 1;
346 341
@@ -356,6 +351,12 @@ static void pata_icside_port_disable(struct ata_port *ap)
356 } 351 }
357} 352}
358 353
354static void pata_icside_error_handler(struct ata_port *ap)
355{
356 ata_bmdma_drive_eh(ap, ata_std_prereset, ata_std_softreset, NULL,
357 pata_icside_postreset);
358}
359
359static u8 pata_icside_irq_ack(struct ata_port *ap, unsigned int chk_drq) 360static u8 pata_icside_irq_ack(struct ata_port *ap, unsigned int chk_drq)
360{ 361{
361 unsigned int bits = chk_drq ? ATA_BUSY | ATA_DRQ : ATA_BUSY; 362 unsigned int bits = chk_drq ? ATA_BUSY | ATA_DRQ : ATA_BUSY;
@@ -374,7 +375,7 @@ static u8 pata_icside_irq_ack(struct ata_port *ap, unsigned int chk_drq)
374} 375}
375 376
376static struct ata_port_operations pata_icside_port_ops = { 377static struct ata_port_operations pata_icside_port_ops = {
377 .port_disable = pata_icside_port_disable, 378 .port_disable = ata_port_disable,
378 379
379 .set_dmamode = pata_icside_set_dmamode, 380 .set_dmamode = pata_icside_set_dmamode,
380 381
@@ -397,7 +398,7 @@ static struct ata_port_operations pata_icside_port_ops = {
397 398
398 .freeze = ata_bmdma_freeze, 399 .freeze = ata_bmdma_freeze,
399 .thaw = ata_bmdma_thaw, 400 .thaw = ata_bmdma_thaw,
400 .error_handler = ata_bmdma_error_handler, 401 .error_handler = pata_icside_error_handler,
401 .post_internal_cmd = pata_icside_bmdma_stop, 402 .post_internal_cmd = pata_icside_bmdma_stop,
402 403
403 .irq_clear = ata_dummy_noret, 404 .irq_clear = ata_dummy_noret,
@@ -484,13 +485,6 @@ static int __devinit pata_icside_register_v6(struct pata_icside_info *info)
484 state->port[0].port_sel = sel; 485 state->port[0].port_sel = sel;
485 state->port[1].port_sel = sel | 1; 486 state->port[1].port_sel = sel | 1;
486 487
487 /*
488 * FIXME: work around libata's aversion to calling port_disable.
489 * This permanently disables interrupts on port 0 - bad luck if
490 * you have a drive on that port.
491 */
492 state->port[0].disabled = 1;
493
494 info->base = easi_base; 488 info->base = easi_base;
495 info->irqops = &pata_icside_ops_arcin_v6; 489 info->irqops = &pata_icside_ops_arcin_v6;
496 info->nr_ports = 2; 490 info->nr_ports = 2;
diff --git a/drivers/char/drm/i915_dma.c b/drivers/char/drm/i915_dma.c
index 3359cc2b9736..8e7d713a5a15 100644
--- a/drivers/char/drm/i915_dma.c
+++ b/drivers/char/drm/i915_dma.c
@@ -184,6 +184,8 @@ static int i915_initialize(struct drm_device * dev,
184 * private backbuffer/depthbuffer usage. 184 * private backbuffer/depthbuffer usage.
185 */ 185 */
186 dev_priv->use_mi_batchbuffer_start = 0; 186 dev_priv->use_mi_batchbuffer_start = 0;
187 if (IS_I965G(dev)) /* 965 doesn't support older method */
188 dev_priv->use_mi_batchbuffer_start = 1;
187 189
188 /* Allow hardware batchbuffers unless told otherwise. 190 /* Allow hardware batchbuffers unless told otherwise.
189 */ 191 */
@@ -517,8 +519,13 @@ static int i915_dispatch_batchbuffer(struct drm_device * dev,
517 519
518 if (dev_priv->use_mi_batchbuffer_start) { 520 if (dev_priv->use_mi_batchbuffer_start) {
519 BEGIN_LP_RING(2); 521 BEGIN_LP_RING(2);
520 OUT_RING(MI_BATCH_BUFFER_START | (2 << 6)); 522 if (IS_I965G(dev)) {
521 OUT_RING(batch->start | MI_BATCH_NON_SECURE); 523 OUT_RING(MI_BATCH_BUFFER_START | (2 << 6) | MI_BATCH_NON_SECURE_I965);
524 OUT_RING(batch->start);
525 } else {
526 OUT_RING(MI_BATCH_BUFFER_START | (2 << 6));
527 OUT_RING(batch->start | MI_BATCH_NON_SECURE);
528 }
522 ADVANCE_LP_RING(); 529 ADVANCE_LP_RING();
523 } else { 530 } else {
524 BEGIN_LP_RING(4); 531 BEGIN_LP_RING(4);
@@ -735,7 +742,8 @@ static int i915_setparam(DRM_IOCTL_ARGS)
735 742
736 switch (param.param) { 743 switch (param.param) {
737 case I915_SETPARAM_USE_MI_BATCHBUFFER_START: 744 case I915_SETPARAM_USE_MI_BATCHBUFFER_START:
738 dev_priv->use_mi_batchbuffer_start = param.value; 745 if (!IS_I965G(dev))
746 dev_priv->use_mi_batchbuffer_start = param.value;
739 break; 747 break;
740 case I915_SETPARAM_TEX_LRU_LOG_GRANULARITY: 748 case I915_SETPARAM_TEX_LRU_LOG_GRANULARITY:
741 dev_priv->tex_lru_log_granularity = param.value; 749 dev_priv->tex_lru_log_granularity = param.value;
diff --git a/drivers/char/drm/i915_drv.h b/drivers/char/drm/i915_drv.h
index fd918565f4e5..737088bd0780 100644
--- a/drivers/char/drm/i915_drv.h
+++ b/drivers/char/drm/i915_drv.h
@@ -282,6 +282,7 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller);
282#define MI_BATCH_BUFFER_START (0x31<<23) 282#define MI_BATCH_BUFFER_START (0x31<<23)
283#define MI_BATCH_BUFFER_END (0xA<<23) 283#define MI_BATCH_BUFFER_END (0xA<<23)
284#define MI_BATCH_NON_SECURE (1) 284#define MI_BATCH_NON_SECURE (1)
285#define MI_BATCH_NON_SECURE_I965 (1<<8)
285 286
286#define MI_WAIT_FOR_EVENT ((0x3<<23)) 287#define MI_WAIT_FOR_EVENT ((0x3<<23))
287#define MI_WAIT_FOR_PLANE_A_FLIP (1<<2) 288#define MI_WAIT_FOR_PLANE_A_FLIP (1<<2)
diff --git a/drivers/firewire/fw-ohci.c b/drivers/firewire/fw-ohci.c
index db703758db98..7e427b4c74b5 100644
--- a/drivers/firewire/fw-ohci.c
+++ b/drivers/firewire/fw-ohci.c
@@ -907,6 +907,8 @@ static void bus_reset_tasklet(unsigned long data)
907 int self_id_count, i, j, reg; 907 int self_id_count, i, j, reg;
908 int generation, new_generation; 908 int generation, new_generation;
909 unsigned long flags; 909 unsigned long flags;
910 void *free_rom = NULL;
911 dma_addr_t free_rom_bus = 0;
910 912
911 reg = reg_read(ohci, OHCI1394_NodeID); 913 reg = reg_read(ohci, OHCI1394_NodeID);
912 if (!(reg & OHCI1394_NodeID_idValid)) { 914 if (!(reg & OHCI1394_NodeID_idValid)) {
@@ -970,8 +972,8 @@ static void bus_reset_tasklet(unsigned long data)
970 */ 972 */
971 973
972 if (ohci->next_config_rom != NULL) { 974 if (ohci->next_config_rom != NULL) {
973 dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE, 975 free_rom = ohci->config_rom;
974 ohci->config_rom, ohci->config_rom_bus); 976 free_rom_bus = ohci->config_rom_bus;
975 ohci->config_rom = ohci->next_config_rom; 977 ohci->config_rom = ohci->next_config_rom;
976 ohci->config_rom_bus = ohci->next_config_rom_bus; 978 ohci->config_rom_bus = ohci->next_config_rom_bus;
977 ohci->next_config_rom = NULL; 979 ohci->next_config_rom = NULL;
@@ -990,6 +992,10 @@ static void bus_reset_tasklet(unsigned long data)
990 992
991 spin_unlock_irqrestore(&ohci->lock, flags); 993 spin_unlock_irqrestore(&ohci->lock, flags);
992 994
995 if (free_rom)
996 dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE,
997 free_rom, free_rom_bus);
998
993 fw_core_handle_bus_reset(&ohci->card, ohci->node_id, generation, 999 fw_core_handle_bus_reset(&ohci->card, ohci->node_id, generation,
994 self_id_count, ohci->self_id_buffer); 1000 self_id_count, ohci->self_id_buffer);
995} 1001}
@@ -1186,7 +1192,7 @@ ohci_set_config_rom(struct fw_card *card, u32 *config_rom, size_t length)
1186{ 1192{
1187 struct fw_ohci *ohci; 1193 struct fw_ohci *ohci;
1188 unsigned long flags; 1194 unsigned long flags;
1189 int retval = 0; 1195 int retval = -EBUSY;
1190 __be32 *next_config_rom; 1196 __be32 *next_config_rom;
1191 dma_addr_t next_config_rom_bus; 1197 dma_addr_t next_config_rom_bus;
1192 1198
@@ -1240,10 +1246,7 @@ ohci_set_config_rom(struct fw_card *card, u32 *config_rom, size_t length)
1240 1246
1241 reg_write(ohci, OHCI1394_ConfigROMmap, 1247 reg_write(ohci, OHCI1394_ConfigROMmap,
1242 ohci->next_config_rom_bus); 1248 ohci->next_config_rom_bus);
1243 } else { 1249 retval = 0;
1244 dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE,
1245 next_config_rom, next_config_rom_bus);
1246 retval = -EBUSY;
1247 } 1250 }
1248 1251
1249 spin_unlock_irqrestore(&ohci->lock, flags); 1252 spin_unlock_irqrestore(&ohci->lock, flags);
@@ -1257,6 +1260,9 @@ ohci_set_config_rom(struct fw_card *card, u32 *config_rom, size_t length)
1257 */ 1260 */
1258 if (retval == 0) 1261 if (retval == 0)
1259 fw_core_initiate_bus_reset(&ohci->card, 1); 1262 fw_core_initiate_bus_reset(&ohci->card, 1);
1263 else
1264 dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE,
1265 next_config_rom, next_config_rom_bus);
1260 1266
1261 return retval; 1267 return retval;
1262} 1268}
diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 3e4a369d0057..ba816ef6def1 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -984,6 +984,7 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
984 struct fw_unit *unit = sd->unit; 984 struct fw_unit *unit = sd->unit;
985 struct fw_device *device = fw_device(unit->device.parent); 985 struct fw_device *device = fw_device(unit->device.parent);
986 struct sbp2_command_orb *orb; 986 struct sbp2_command_orb *orb;
987 unsigned max_payload;
987 988
988 /* 989 /*
989 * Bidirectional commands are not yet implemented, and unknown 990 * Bidirectional commands are not yet implemented, and unknown
@@ -1017,8 +1018,10 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
1017 * specifies the max payload size as 2 ^ (max_payload + 2), so 1018 * specifies the max payload size as 2 ^ (max_payload + 2), so
1018 * if we set this to max_speed + 7, we get the right value. 1019 * if we set this to max_speed + 7, we get the right value.
1019 */ 1020 */
1021 max_payload = min(device->max_speed + 7,
1022 device->card->max_receive - 1);
1020 orb->request.misc = 1023 orb->request.misc =
1021 COMMAND_ORB_MAX_PAYLOAD(device->max_speed + 7) | 1024 COMMAND_ORB_MAX_PAYLOAD(max_payload) |
1022 COMMAND_ORB_SPEED(device->max_speed) | 1025 COMMAND_ORB_SPEED(device->max_speed) |
1023 COMMAND_ORB_NOTIFY; 1026 COMMAND_ORB_NOTIFY;
1024 1027
diff --git a/drivers/firewire/fw-transaction.c b/drivers/firewire/fw-transaction.c
index 3ce8e2fbe15f..3e1cb12e43cd 100644
--- a/drivers/firewire/fw-transaction.c
+++ b/drivers/firewire/fw-transaction.c
@@ -734,7 +734,7 @@ fw_core_handle_response(struct fw_card *card, struct fw_packet *p)
734} 734}
735EXPORT_SYMBOL(fw_core_handle_response); 735EXPORT_SYMBOL(fw_core_handle_response);
736 736
737const struct fw_address_region topology_map_region = 737static const struct fw_address_region topology_map_region =
738 { .start = 0xfffff0001000ull, .end = 0xfffff0001400ull, }; 738 { .start = 0xfffff0001000ull, .end = 0xfffff0001400ull, };
739 739
740static void 740static void
@@ -772,7 +772,7 @@ static struct fw_address_handler topology_map = {
772 .address_callback = handle_topology_map, 772 .address_callback = handle_topology_map,
773}; 773};
774 774
775const struct fw_address_region registers_region = 775static const struct fw_address_region registers_region =
776 { .start = 0xfffff0000000ull, .end = 0xfffff0000400ull, }; 776 { .start = 0xfffff0000000ull, .end = 0xfffff0000400ull, };
777 777
778static void 778static void
diff --git a/drivers/firewire/fw-transaction.h b/drivers/firewire/fw-transaction.h
index 5ceaccd10564..fa7967b57408 100644
--- a/drivers/firewire/fw-transaction.h
+++ b/drivers/firewire/fw-transaction.h
@@ -231,7 +231,7 @@ struct fw_card {
231 unsigned long reset_jiffies; 231 unsigned long reset_jiffies;
232 232
233 unsigned long long guid; 233 unsigned long long guid;
234 int max_receive; 234 unsigned max_receive;
235 int link_speed; 235 int link_speed;
236 int config_rom_generation; 236 int config_rom_generation;
237 237
diff --git a/drivers/ieee1394/Kconfig b/drivers/ieee1394/Kconfig
index 8012b3b0ce75..545663ef820b 100644
--- a/drivers/ieee1394/Kconfig
+++ b/drivers/ieee1394/Kconfig
@@ -97,7 +97,7 @@ config IEEE1394_SBP2
97 97
98config IEEE1394_SBP2_PHYS_DMA 98config IEEE1394_SBP2_PHYS_DMA
99 bool "Enable replacement for physical DMA in SBP2" 99 bool "Enable replacement for physical DMA in SBP2"
100 depends on IEEE1394 && IEEE1394_SBP2 && EXPERIMENTAL && (X86_32 || PPC_32) 100 depends on IEEE1394_SBP2 && VIRT_TO_BUS && EXPERIMENTAL
101 help 101 help
102 This builds sbp2 for use with non-OHCI host adapters which do not 102 This builds sbp2 for use with non-OHCI host adapters which do not
103 support physical DMA or for when ohci1394 is run with phys_dma=0. 103 support physical DMA or for when ohci1394 is run with phys_dma=0.
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index e882cb951b47..47dbe8f17e82 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -773,11 +773,6 @@ static struct sbp2_lu *sbp2_alloc_device(struct unit_directory *ud)
773 SBP2_ERR("failed to register lower 4GB address range"); 773 SBP2_ERR("failed to register lower 4GB address range");
774 goto failed_alloc; 774 goto failed_alloc;
775 } 775 }
776#else
777 if (dma_set_mask(hi->host->device.parent, DMA_32BIT_MASK)) {
778 SBP2_ERR("failed to set 4GB DMA mask");
779 goto failed_alloc;
780 }
781#endif 776#endif
782 } 777 }
783 778
diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index 1f979cb0df31..4b8a0cc9665e 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -1217,11 +1217,13 @@ twobyte_insn:
1217 } 1217 }
1218 break; 1218 break;
1219 case 0x21: /* mov from dr to reg */ 1219 case 0x21: /* mov from dr to reg */
1220 no_wb = 1;
1220 if (modrm_mod != 3) 1221 if (modrm_mod != 3)
1221 goto cannot_emulate; 1222 goto cannot_emulate;
1222 rc = emulator_get_dr(ctxt, modrm_reg, &_regs[modrm_rm]); 1223 rc = emulator_get_dr(ctxt, modrm_reg, &_regs[modrm_rm]);
1223 break; 1224 break;
1224 case 0x23: /* mov from reg to dr */ 1225 case 0x23: /* mov from reg to dr */
1226 no_wb = 1;
1225 if (modrm_mod != 3) 1227 if (modrm_mod != 3)
1226 goto cannot_emulate; 1228 goto cannot_emulate;
1227 rc = emulator_set_dr(ctxt, modrm_reg, _regs[modrm_rm]); 1229 rc = emulator_set_dr(ctxt, modrm_reg, _regs[modrm_rm]);
diff --git a/drivers/lguest/Kconfig b/drivers/lguest/Kconfig
index 888205c3f76b..fd6925f41647 100644
--- a/drivers/lguest/Kconfig
+++ b/drivers/lguest/Kconfig
@@ -21,8 +21,10 @@ config LGUEST_GUEST
21 21
22config LGUEST_NET 22config LGUEST_NET
23 tristate 23 tristate
24 default y
24 depends on LGUEST_GUEST && NET 25 depends on LGUEST_GUEST && NET
25 26
26config LGUEST_BLOCK 27config LGUEST_BLOCK
27 tristate 28 tristate
29 default y
28 depends on LGUEST_GUEST && BLOCK 30 depends on LGUEST_GUEST && BLOCK
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index e866dacde7e5..414c109f4cf5 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -88,7 +88,9 @@ module_param(mpt_channel_mapping, int, 0);
88MODULE_PARM_DESC(mpt_channel_mapping, " Mapping id's to channels (default=0)"); 88MODULE_PARM_DESC(mpt_channel_mapping, " Mapping id's to channels (default=0)");
89 89
90static int mpt_debug_level; 90static int mpt_debug_level;
91module_param(mpt_debug_level, int, 0); 91static int mpt_set_debug_level(const char *val, struct kernel_param *kp);
92module_param_call(mpt_debug_level, mpt_set_debug_level, param_get_int,
93 &mpt_debug_level, 0600);
92MODULE_PARM_DESC(mpt_debug_level, " debug level - refer to mptdebug.h - (default=0)"); 94MODULE_PARM_DESC(mpt_debug_level, " debug level - refer to mptdebug.h - (default=0)");
93 95
94#ifdef MFCNT 96#ifdef MFCNT
@@ -220,6 +222,19 @@ pci_enable_io_access(struct pci_dev *pdev)
220 pci_write_config_word(pdev, PCI_COMMAND, command_reg); 222 pci_write_config_word(pdev, PCI_COMMAND, command_reg);
221} 223}
222 224
225static int mpt_set_debug_level(const char *val, struct kernel_param *kp)
226{
227 int ret = param_set_int(val, kp);
228 MPT_ADAPTER *ioc;
229
230 if (ret)
231 return ret;
232
233 list_for_each_entry(ioc, &ioc_list, list)
234 ioc->debug_level = mpt_debug_level;
235 return 0;
236}
237
223/* 238/*
224 * Process turbo (context) reply... 239 * Process turbo (context) reply...
225 */ 240 */
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index 29add83da588..b9c69bff218c 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -1312,11 +1312,137 @@ mptsas_get_bay_identifier(struct sas_rphy *rphy)
1312 return rc; 1312 return rc;
1313} 1313}
1314 1314
1315static int mptsas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
1316 struct request *req)
1317{
1318 MPT_ADAPTER *ioc = ((MPT_SCSI_HOST *) shost->hostdata)->ioc;
1319 MPT_FRAME_HDR *mf;
1320 SmpPassthroughRequest_t *smpreq;
1321 struct request *rsp = req->next_rq;
1322 int ret;
1323 int flagsLength;
1324 unsigned long timeleft;
1325 char *psge;
1326 dma_addr_t dma_addr_in = 0;
1327 dma_addr_t dma_addr_out = 0;
1328 u64 sas_address = 0;
1329
1330 if (!rsp) {
1331 printk(KERN_ERR "%s: the smp response space is missing\n",
1332 __FUNCTION__);
1333 return -EINVAL;
1334 }
1335
1336 /* do we need to support multiple segments? */
1337 if (req->bio->bi_vcnt > 1 || rsp->bio->bi_vcnt > 1) {
1338 printk(KERN_ERR "%s: multiple segments req %u %u, rsp %u %u\n",
1339 __FUNCTION__, req->bio->bi_vcnt, req->data_len,
1340 rsp->bio->bi_vcnt, rsp->data_len);
1341 return -EINVAL;
1342 }
1343
1344 ret = mutex_lock_interruptible(&ioc->sas_mgmt.mutex);
1345 if (ret)
1346 goto out;
1347
1348 mf = mpt_get_msg_frame(mptsasMgmtCtx, ioc);
1349 if (!mf) {
1350 ret = -ENOMEM;
1351 goto out_unlock;
1352 }
1353
1354 smpreq = (SmpPassthroughRequest_t *)mf;
1355 memset(smpreq, 0, sizeof(*smpreq));
1356
1357 smpreq->RequestDataLength = cpu_to_le16(req->data_len - 4);
1358 smpreq->Function = MPI_FUNCTION_SMP_PASSTHROUGH;
1359
1360 if (rphy)
1361 sas_address = rphy->identify.sas_address;
1362 else {
1363 struct mptsas_portinfo *port_info;
1364
1365 mutex_lock(&ioc->sas_topology_mutex);
1366 port_info = mptsas_find_portinfo_by_handle(ioc, ioc->handle);
1367 if (port_info && port_info->phy_info)
1368 sas_address =
1369 port_info->phy_info[0].phy->identify.sas_address;
1370 mutex_unlock(&ioc->sas_topology_mutex);
1371 }
1372
1373 *((u64 *)&smpreq->SASAddress) = cpu_to_le64(sas_address);
1374
1375 psge = (char *)
1376 (((int *) mf) + (offsetof(SmpPassthroughRequest_t, SGL) / 4));
1377
1378 /* request */
1379 flagsLength = (MPI_SGE_FLAGS_SIMPLE_ELEMENT |
1380 MPI_SGE_FLAGS_END_OF_BUFFER |
1381 MPI_SGE_FLAGS_DIRECTION |
1382 mpt_addr_size()) << MPI_SGE_FLAGS_SHIFT;
1383 flagsLength |= (req->data_len - 4);
1384
1385 dma_addr_out = pci_map_single(ioc->pcidev, bio_data(req->bio),
1386 req->data_len, PCI_DMA_BIDIRECTIONAL);
1387 if (!dma_addr_out)
1388 goto put_mf;
1389 mpt_add_sge(psge, flagsLength, dma_addr_out);
1390 psge += (sizeof(u32) + sizeof(dma_addr_t));
1391
1392 /* response */
1393 flagsLength = MPT_SGE_FLAGS_SSIMPLE_READ;
1394 flagsLength |= rsp->data_len + 4;
1395 dma_addr_in = pci_map_single(ioc->pcidev, bio_data(rsp->bio),
1396 rsp->data_len, PCI_DMA_BIDIRECTIONAL);
1397 if (!dma_addr_in)
1398 goto unmap;
1399 mpt_add_sge(psge, flagsLength, dma_addr_in);
1400
1401 mpt_put_msg_frame(mptsasMgmtCtx, ioc, mf);
1402
1403 timeleft = wait_for_completion_timeout(&ioc->sas_mgmt.done, 10 * HZ);
1404 if (!timeleft) {
1405 printk(KERN_ERR "%s: smp timeout!\n", __FUNCTION__);
1406 /* On timeout reset the board */
1407 mpt_HardResetHandler(ioc, CAN_SLEEP);
1408 ret = -ETIMEDOUT;
1409 goto unmap;
1410 }
1411 mf = NULL;
1412
1413 if (ioc->sas_mgmt.status & MPT_IOCTL_STATUS_RF_VALID) {
1414 SmpPassthroughReply_t *smprep;
1415
1416 smprep = (SmpPassthroughReply_t *)ioc->sas_mgmt.reply;
1417 memcpy(req->sense, smprep, sizeof(*smprep));
1418 req->sense_len = sizeof(*smprep);
1419 } else {
1420 printk(KERN_ERR "%s: smp passthru reply failed to be returned\n",
1421 __FUNCTION__);
1422 ret = -ENXIO;
1423 }
1424unmap:
1425 if (dma_addr_out)
1426 pci_unmap_single(ioc->pcidev, dma_addr_out, req->data_len,
1427 PCI_DMA_BIDIRECTIONAL);
1428 if (dma_addr_in)
1429 pci_unmap_single(ioc->pcidev, dma_addr_in, rsp->data_len,
1430 PCI_DMA_BIDIRECTIONAL);
1431put_mf:
1432 if (mf)
1433 mpt_free_msg_frame(ioc, mf);
1434out_unlock:
1435 mutex_unlock(&ioc->sas_mgmt.mutex);
1436out:
1437 return ret;
1438}
1439
1315static struct sas_function_template mptsas_transport_functions = { 1440static struct sas_function_template mptsas_transport_functions = {
1316 .get_linkerrors = mptsas_get_linkerrors, 1441 .get_linkerrors = mptsas_get_linkerrors,
1317 .get_enclosure_identifier = mptsas_get_enclosure_identifier, 1442 .get_enclosure_identifier = mptsas_get_enclosure_identifier,
1318 .get_bay_identifier = mptsas_get_bay_identifier, 1443 .get_bay_identifier = mptsas_get_bay_identifier,
1319 .phy_reset = mptsas_phy_reset, 1444 .phy_reset = mptsas_phy_reset,
1445 .smp_handler = mptsas_smp_handler,
1320}; 1446};
1321 1447
1322static struct scsi_transport_template *mptsas_transport_template; 1448static struct scsi_transport_template *mptsas_transport_template;
diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile
index 451adcc52b3c..6d958a4566ff 100644
--- a/drivers/mtd/Makefile
+++ b/drivers/mtd/Makefile
@@ -3,9 +3,9 @@
3# 3#
4 4
5# Core functionality. 5# Core functionality.
6obj-$(CONFIG_MTD) += mtd.o
6mtd-y := mtdcore.o mtdsuper.o 7mtd-y := mtdcore.o mtdsuper.o
7mtd-$(CONFIG_MTD_PARTITIONS) += mtdpart.o 8mtd-$(CONFIG_MTD_PARTITIONS) += mtdpart.o
8obj-$(CONFIG_MTD) += $(mtd-y)
9 9
10obj-$(CONFIG_MTD_CONCAT) += mtdconcat.o 10obj-$(CONFIG_MTD_CONCAT) += mtdconcat.o
11obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o 11obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index 9c6236852942..6174a97d7902 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -560,7 +560,3 @@ int parse_mtd_partitions(struct mtd_info *master, const char **types,
560EXPORT_SYMBOL_GPL(parse_mtd_partitions); 560EXPORT_SYMBOL_GPL(parse_mtd_partitions);
561EXPORT_SYMBOL_GPL(register_mtd_parser); 561EXPORT_SYMBOL_GPL(register_mtd_parser);
562EXPORT_SYMBOL_GPL(deregister_mtd_parser); 562EXPORT_SYMBOL_GPL(deregister_mtd_parser);
563
564MODULE_LICENSE("GPL");
565MODULE_AUTHOR("Nicolas Pitre <nico@cam.org>");
566MODULE_DESCRIPTION("Generic support for partitioning of MTD devices");
diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c
index 56f6389a300e..3c1984ecf36c 100644
--- a/drivers/net/atl1/atl1_main.c
+++ b/drivers/net/atl1/atl1_main.c
@@ -1704,10 +1704,8 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
1704 } 1704 }
1705 } 1705 }
1706 1706
1707 local_irq_save(flags); 1707 if (!spin_trylock_irqsave(&adapter->lock, flags)) {
1708 if (!spin_trylock(&adapter->lock)) {
1709 /* Can't get lock - tell upper layer to requeue */ 1708 /* Can't get lock - tell upper layer to requeue */
1710 local_irq_restore(flags);
1711 dev_printk(KERN_DEBUG, &adapter->pdev->dev, "tx locked\n"); 1709 dev_printk(KERN_DEBUG, &adapter->pdev->dev, "tx locked\n");
1712 return NETDEV_TX_LOCKED; 1710 return NETDEV_TX_LOCKED;
1713 } 1711 }
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index d53dfc5bbae0..24e7f9ab3f5a 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -54,8 +54,8 @@
54 54
55#define DRV_MODULE_NAME "bnx2" 55#define DRV_MODULE_NAME "bnx2"
56#define PFX DRV_MODULE_NAME ": " 56#define PFX DRV_MODULE_NAME ": "
57#define DRV_MODULE_VERSION "1.6.3" 57#define DRV_MODULE_VERSION "1.6.4"
58#define DRV_MODULE_RELDATE "July 16, 2007" 58#define DRV_MODULE_RELDATE "August 3, 2007"
59 59
60#define RUN_AT(x) (jiffies + (x)) 60#define RUN_AT(x) (jiffies + (x))
61 61
@@ -6937,6 +6937,11 @@ bnx2_suspend(struct pci_dev *pdev, pm_message_t state)
6937 struct bnx2 *bp = netdev_priv(dev); 6937 struct bnx2 *bp = netdev_priv(dev);
6938 u32 reset_code; 6938 u32 reset_code;
6939 6939
6940 /* PCI register 4 needs to be saved whether netif_running() or not.
6941 * MSI address and data need to be saved if using MSI and
6942 * netif_running().
6943 */
6944 pci_save_state(pdev);
6940 if (!netif_running(dev)) 6945 if (!netif_running(dev))
6941 return 0; 6946 return 0;
6942 6947
@@ -6952,7 +6957,6 @@ bnx2_suspend(struct pci_dev *pdev, pm_message_t state)
6952 reset_code = BNX2_DRV_MSG_CODE_SUSPEND_NO_WOL; 6957 reset_code = BNX2_DRV_MSG_CODE_SUSPEND_NO_WOL;
6953 bnx2_reset_chip(bp, reset_code); 6958 bnx2_reset_chip(bp, reset_code);
6954 bnx2_free_skbs(bp); 6959 bnx2_free_skbs(bp);
6955 pci_save_state(pdev);
6956 bnx2_set_power_state(bp, pci_choose_state(pdev, state)); 6960 bnx2_set_power_state(bp, pci_choose_state(pdev, state));
6957 return 0; 6961 return 0;
6958} 6962}
@@ -6963,10 +6967,10 @@ bnx2_resume(struct pci_dev *pdev)
6963 struct net_device *dev = pci_get_drvdata(pdev); 6967 struct net_device *dev = pci_get_drvdata(pdev);
6964 struct bnx2 *bp = netdev_priv(dev); 6968 struct bnx2 *bp = netdev_priv(dev);
6965 6969
6970 pci_restore_state(pdev);
6966 if (!netif_running(dev)) 6971 if (!netif_running(dev))
6967 return 0; 6972 return 0;
6968 6973
6969 pci_restore_state(pdev);
6970 bnx2_set_power_state(bp, PCI_D0); 6974 bnx2_set_power_state(bp, PCI_D0);
6971 netif_device_attach(dev); 6975 netif_device_attach(dev);
6972 bnx2_init_nic(bp); 6976 bnx2_init_nic(bp);
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 2be0a0f1b48f..24feb00600ee 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -2430,7 +2430,7 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no)
2430 (rxdp3->Buffer1_ptr == DMA_ERROR_CODE)) { 2430 (rxdp3->Buffer1_ptr == DMA_ERROR_CODE)) {
2431 pci_unmap_single 2431 pci_unmap_single
2432 (nic->pdev, 2432 (nic->pdev,
2433 (dma_addr_t)skb->data, 2433 (dma_addr_t)rxdp3->Buffer2_ptr,
2434 dev->mtu + 4, 2434 dev->mtu + 4,
2435 PCI_DMA_FROMDEVICE); 2435 PCI_DMA_FROMDEVICE);
2436 goto pci_map_failed; 2436 goto pci_map_failed;
@@ -6211,7 +6211,7 @@ static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp,
6211 if( (rxdp3->Buffer0_ptr == 0) || 6211 if( (rxdp3->Buffer0_ptr == 0) ||
6212 (rxdp3->Buffer0_ptr == DMA_ERROR_CODE)) { 6212 (rxdp3->Buffer0_ptr == DMA_ERROR_CODE)) {
6213 pci_unmap_single (sp->pdev, 6213 pci_unmap_single (sp->pdev,
6214 (dma_addr_t)(*skb)->data, 6214 (dma_addr_t)rxdp3->Buffer2_ptr,
6215 dev->mtu + 4, PCI_DMA_FROMDEVICE); 6215 dev->mtu + 4, PCI_DMA_FROMDEVICE);
6216 goto memalloc_failed; 6216 goto memalloc_failed;
6217 } 6217 }
@@ -6224,7 +6224,10 @@ static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp,
6224 if( (rxdp3->Buffer1_ptr == 0) || 6224 if( (rxdp3->Buffer1_ptr == 0) ||
6225 (rxdp3->Buffer1_ptr == DMA_ERROR_CODE)) { 6225 (rxdp3->Buffer1_ptr == DMA_ERROR_CODE)) {
6226 pci_unmap_single (sp->pdev, 6226 pci_unmap_single (sp->pdev,
6227 (dma_addr_t)(*skb)->data, 6227 (dma_addr_t)rxdp3->Buffer0_ptr,
6228 BUF0_LEN, PCI_DMA_FROMDEVICE);
6229 pci_unmap_single (sp->pdev,
6230 (dma_addr_t)rxdp3->Buffer2_ptr,
6228 dev->mtu + 4, PCI_DMA_FROMDEVICE); 6231 dev->mtu + 4, PCI_DMA_FROMDEVICE);
6229 goto memalloc_failed; 6232 goto memalloc_failed;
6230 } 6233 }
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index ec2ad9f0efa2..d470b19c0810 100644
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -1593,6 +1593,9 @@ static int __devinit sis190_get_mac_addr_from_apc(struct pci_dev *pdev,
1593 pci_name(pdev)); 1593 pci_name(pdev));
1594 1594
1595 isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0965, NULL); 1595 isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0965, NULL);
1596 if (!isa_bridge)
1597 isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0966, NULL);
1598
1596 if (!isa_bridge) { 1599 if (!isa_bridge) {
1597 net_probe(tp, KERN_INFO "%s: Can not find ISA bridge.\n", 1600 net_probe(tp, KERN_INFO "%s: Can not find ISA bridge.\n",
1598 pci_name(pdev)); 1601 pci_name(pdev));
diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h
index f8429449dc1e..6ff3a1627af8 100644
--- a/drivers/net/smc91x.h
+++ b/drivers/net/smc91x.h
@@ -299,7 +299,7 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg)
299 299
300#define SMC_CAN_USE_8BIT 1 300#define SMC_CAN_USE_8BIT 1
301#define SMC_CAN_USE_16BIT 1 301#define SMC_CAN_USE_16BIT 1
302#define SMC_CAN_USE_32BIT 1 302#define SMC_CAN_USE_32BIT 0
303 303
304#define SMC_inb(a, r) inb((a) + (r)) 304#define SMC_inb(a, r) inb((a) + (r))
305#define SMC_inw(a, r) inw((a) + (r)) 305#define SMC_inw(a, r) inw((a) + (r))
@@ -310,8 +310,6 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg)
310 310
311#endif /* BOARDS */ 311#endif /* BOARDS */
312 312
313#define set_irq_type(irq, type) do {} while (0)
314
315#elif defined(CONFIG_M32R) 313#elif defined(CONFIG_M32R)
316 314
317#define SMC_CAN_USE_8BIT 0 315#define SMC_CAN_USE_8BIT 0
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index dc41c055ebb5..58740428dd07 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.79" 67#define DRV_MODULE_VERSION "3.80"
68#define DRV_MODULE_RELDATE "July 18, 2007" 68#define DRV_MODULE_RELDATE "August 2, 2007"
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
@@ -12111,6 +12111,12 @@ static int tg3_suspend(struct pci_dev *pdev, pm_message_t state)
12111 struct tg3 *tp = netdev_priv(dev); 12111 struct tg3 *tp = netdev_priv(dev);
12112 int err; 12112 int err;
12113 12113
12114 /* PCI register 4 needs to be saved whether netif_running() or not.
12115 * MSI address and data need to be saved if using MSI and
12116 * netif_running().
12117 */
12118 pci_save_state(pdev);
12119
12114 if (!netif_running(dev)) 12120 if (!netif_running(dev))
12115 return 0; 12121 return 0;
12116 12122
@@ -12130,9 +12136,6 @@ static int tg3_suspend(struct pci_dev *pdev, pm_message_t state)
12130 tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE; 12136 tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE;
12131 tg3_full_unlock(tp); 12137 tg3_full_unlock(tp);
12132 12138
12133 /* Save MSI address and data for resume. */
12134 pci_save_state(pdev);
12135
12136 err = tg3_set_power_state(tp, pci_choose_state(pdev, state)); 12139 err = tg3_set_power_state(tp, pci_choose_state(pdev, state));
12137 if (err) { 12140 if (err) {
12138 tg3_full_lock(tp, 0); 12141 tg3_full_lock(tp, 0);
@@ -12160,11 +12163,11 @@ static int tg3_resume(struct pci_dev *pdev)
12160 struct tg3 *tp = netdev_priv(dev); 12163 struct tg3 *tp = netdev_priv(dev);
12161 int err; 12164 int err;
12162 12165
12166 pci_restore_state(tp->pdev);
12167
12163 if (!netif_running(dev)) 12168 if (!netif_running(dev))
12164 return 0; 12169 return 0;
12165 12170
12166 pci_restore_state(tp->pdev);
12167
12168 err = tg3_set_power_state(tp, PCI_D0); 12171 err = tg3_set_power_state(tp, PCI_D0);
12169 if (err) 12172 if (err)
12170 return err; 12173 return err;
diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
index 3f6e176e6ea1..58c806e9c58a 100644
--- a/drivers/power/Kconfig
+++ b/drivers/power/Kconfig
@@ -38,7 +38,7 @@ config BATTERY_DS2760
38 38
39config BATTERY_PMU 39config BATTERY_PMU
40 tristate "Apple PMU battery" 40 tristate "Apple PMU battery"
41 depends on ADB_PMU 41 depends on PPC32 && ADB_PMU
42 help 42 help
43 Say Y here to expose battery information on Apple machines 43 Say Y here to expose battery information on Apple machines
44 through the generic battery class. 44 through the generic battery class.
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index b240800b78d7..99299976e891 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -4154,8 +4154,9 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req)
4154 fcp_rsp_iu->fcp_resid, 4154 fcp_rsp_iu->fcp_resid,
4155 (int) zfcp_get_fcp_dl(fcp_cmnd_iu)); 4155 (int) zfcp_get_fcp_dl(fcp_cmnd_iu));
4156 4156
4157 scpnt->resid = fcp_rsp_iu->fcp_resid; 4157 scsi_set_resid(scpnt, fcp_rsp_iu->fcp_resid);
4158 if (scpnt->request_bufflen - scpnt->resid < scpnt->underflow) 4158 if (scsi_bufflen(scpnt) - scsi_get_resid(scpnt) <
4159 scpnt->underflow)
4159 set_host_byte(&scpnt->result, DID_ERROR); 4160 set_host_byte(&scpnt->result, DID_ERROR);
4160 } 4161 }
4161 4162
diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c
index c408badd2ae9..81daa8204bfe 100644
--- a/drivers/s390/scsi/zfcp_qdio.c
+++ b/drivers/s390/scsi/zfcp_qdio.c
@@ -36,8 +36,6 @@ static void zfcp_qdio_sbale_fill
36 (struct zfcp_fsf_req *, unsigned long, void *, int); 36 (struct zfcp_fsf_req *, unsigned long, void *, int);
37static int zfcp_qdio_sbals_from_segment 37static int zfcp_qdio_sbals_from_segment
38 (struct zfcp_fsf_req *, unsigned long, void *, unsigned long); 38 (struct zfcp_fsf_req *, unsigned long, void *, unsigned long);
39static int zfcp_qdio_sbals_from_buffer
40 (struct zfcp_fsf_req *, unsigned long, void *, unsigned long, int);
41 39
42static qdio_handler_t zfcp_qdio_request_handler; 40static qdio_handler_t zfcp_qdio_request_handler;
43static qdio_handler_t zfcp_qdio_response_handler; 41static qdio_handler_t zfcp_qdio_response_handler;
@@ -632,28 +630,6 @@ out:
632 630
633 631
634/** 632/**
635 * zfcp_qdio_sbals_from_buffer - fill SBALs from buffer
636 * @fsf_req: request to be processed
637 * @sbtype: SBALE flags
638 * @buffer: data buffer
639 * @length: length of buffer
640 * @max_sbals: upper bound for number of SBALs to be used
641 */
642static int
643zfcp_qdio_sbals_from_buffer(struct zfcp_fsf_req *fsf_req, unsigned long sbtype,
644 void *buffer, unsigned long length, int max_sbals)
645{
646 struct scatterlist sg_segment;
647
648 zfcp_address_to_sg(buffer, &sg_segment);
649 sg_segment.length = length;
650
651 return zfcp_qdio_sbals_from_sg(fsf_req, sbtype, &sg_segment, 1,
652 max_sbals);
653}
654
655
656/**
657 * zfcp_qdio_sbals_from_scsicmnd - fill SBALs from scsi command 633 * zfcp_qdio_sbals_from_scsicmnd - fill SBALs from scsi command
658 * @fsf_req: request to be processed 634 * @fsf_req: request to be processed
659 * @sbtype: SBALE flags 635 * @sbtype: SBALE flags
@@ -664,18 +640,13 @@ int
664zfcp_qdio_sbals_from_scsicmnd(struct zfcp_fsf_req *fsf_req, 640zfcp_qdio_sbals_from_scsicmnd(struct zfcp_fsf_req *fsf_req,
665 unsigned long sbtype, struct scsi_cmnd *scsi_cmnd) 641 unsigned long sbtype, struct scsi_cmnd *scsi_cmnd)
666{ 642{
667 if (scsi_cmnd->use_sg) { 643 if (scsi_sg_count(scsi_cmnd))
668 return zfcp_qdio_sbals_from_sg(fsf_req, sbtype, 644 return zfcp_qdio_sbals_from_sg(fsf_req, sbtype,
669 (struct scatterlist *) 645 scsi_sglist(scsi_cmnd),
670 scsi_cmnd->request_buffer, 646 scsi_sg_count(scsi_cmnd),
671 scsi_cmnd->use_sg, 647 ZFCP_MAX_SBALS_PER_REQ);
672 ZFCP_MAX_SBALS_PER_REQ); 648 else
673 } else { 649 return 0;
674 return zfcp_qdio_sbals_from_buffer(fsf_req, sbtype,
675 scsi_cmnd->request_buffer,
676 scsi_cmnd->request_bufflen,
677 ZFCP_MAX_SBALS_PER_REQ);
678 }
679} 650}
680 651
681/** 652/**
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index 813556c60007..a7f42a17b5c7 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -1110,7 +1110,9 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
1110 __aac_shutdown(aac); 1110 __aac_shutdown(aac);
1111 out_unmap: 1111 out_unmap:
1112 aac_fib_map_free(aac); 1112 aac_fib_map_free(aac);
1113 pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr, aac->comm_phys); 1113 if (aac->comm_addr)
1114 pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr,
1115 aac->comm_phys);
1114 kfree(aac->queues); 1116 kfree(aac->queues);
1115 aac_adapter_ioremap(aac, 0); 1117 aac_adapter_ioremap(aac, 0);
1116 kfree(aac->fibs); 1118 kfree(aac->fibs);
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
index 85f2394ffc3e..d30a30786dda 100644
--- a/drivers/scsi/aha152x.c
+++ b/drivers/scsi/aha152x.c
@@ -289,18 +289,18 @@ static LIST_HEAD(aha152x_host_list);
289 if(spin_is_locked(&QLOCK)) { \ 289 if(spin_is_locked(&QLOCK)) { \
290 DPRINTK(debug_intr, DEBUG_LEAD "(%s:%d) already locked at %s:%d\n", CMDINFO(CURRENT_SC), __FUNCTION__, __LINE__, QLOCKER, QLOCKERL); \ 290 DPRINTK(debug_intr, DEBUG_LEAD "(%s:%d) already locked at %s:%d\n", CMDINFO(CURRENT_SC), __FUNCTION__, __LINE__, QLOCKER, QLOCKERL); \
291 } \ 291 } \
292 DPRINTK(debug_locks, DEBUG_LEAD "(%s:%d) locking\n", CMDINFO(CURRENT_SC), __FUNCTION__, __LINE__); \ 292 DPRINTK(debug_locking, DEBUG_LEAD "(%s:%d) locking\n", CMDINFO(CURRENT_SC), __FUNCTION__, __LINE__); \
293 spin_lock_irqsave(&QLOCK,flags); \ 293 spin_lock_irqsave(&QLOCK,flags); \
294 DPRINTK(debug_locks, DEBUG_LEAD "(%s:%d) locked\n", CMDINFO(CURRENT_SC), __FUNCTION__, __LINE__); \ 294 DPRINTK(debug_locking, DEBUG_LEAD "(%s:%d) locked\n", CMDINFO(CURRENT_SC), __FUNCTION__, __LINE__); \
295 QLOCKER=__FUNCTION__; \ 295 QLOCKER=__FUNCTION__; \
296 QLOCKERL=__LINE__; \ 296 QLOCKERL=__LINE__; \
297 } while(0) 297 } while(0)
298 298
299#define DO_UNLOCK(flags) \ 299#define DO_UNLOCK(flags) \
300 do { \ 300 do { \
301 DPRINTK(debug_locks, DEBUG_LEAD "(%s:%d) unlocking (locked at %s:%d)\n", CMDINFO(CURRENT_SC), __FUNCTION__, __LINE__, QLOCKER, QLOCKERL); \ 301 DPRINTK(debug_locking, DEBUG_LEAD "(%s:%d) unlocking (locked at %s:%d)\n", CMDINFO(CURRENT_SC), __FUNCTION__, __LINE__, QLOCKER, QLOCKERL); \
302 spin_unlock_irqrestore(&QLOCK,flags); \ 302 spin_unlock_irqrestore(&QLOCK,flags); \
303 DPRINTK(debug_locks, DEBUG_LEAD "(%s:%d) unlocked\n", CMDINFO(CURRENT_SC), __FUNCTION__, __LINE__); \ 303 DPRINTK(debug_locking, DEBUG_LEAD "(%s:%d) unlocked\n", CMDINFO(CURRENT_SC), __FUNCTION__, __LINE__); \
304 QLOCKER="(not locked)"; \ 304 QLOCKER="(not locked)"; \
305 QLOCKERL=0; \ 305 QLOCKERL=0; \
306 } while(0) 306 } while(0)
@@ -322,6 +322,12 @@ static LIST_HEAD(aha152x_host_list);
322 (cmd) ? ((cmd)->device->id & 0x0f) : -1, \ 322 (cmd) ? ((cmd)->device->id & 0x0f) : -1, \
323 (cmd) ? ((cmd)->device->lun & 0x07) : -1 323 (cmd) ? ((cmd)->device->lun & 0x07) : -1
324 324
325static inline void
326CMD_INC_RESID(struct scsi_cmnd *cmd, int inc)
327{
328 scsi_set_resid(cmd, scsi_get_resid(cmd) + inc);
329}
330
325#define DELAY_DEFAULT 1000 331#define DELAY_DEFAULT 1000
326 332
327#if defined(PCMCIA) 333#if defined(PCMCIA)
@@ -552,14 +558,11 @@ struct aha152x_hostdata {
552struct aha152x_scdata { 558struct aha152x_scdata {
553 Scsi_Cmnd *next; /* next sc in queue */ 559 Scsi_Cmnd *next; /* next sc in queue */
554 struct completion *done;/* semaphore to block on */ 560 struct completion *done;/* semaphore to block on */
555 unsigned char cmd_len; 561 unsigned char aha_orig_cmd_len;
556 unsigned char cmnd[MAX_COMMAND_SIZE]; 562 unsigned char aha_orig_cmnd[MAX_COMMAND_SIZE];
557 unsigned short use_sg; 563 int aha_orig_resid;
558 unsigned request_bufflen;
559 void *request_buffer;
560}; 564};
561 565
562
563/* access macros for hostdata */ 566/* access macros for hostdata */
564 567
565#define HOSTDATA(shpnt) ((struct aha152x_hostdata *) &shpnt->hostdata) 568#define HOSTDATA(shpnt) ((struct aha152x_hostdata *) &shpnt->hostdata)
@@ -978,15 +981,15 @@ static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct completion *complete,
978#if defined(AHA152X_DEBUG) 981#if defined(AHA152X_DEBUG)
979 if (HOSTDATA(shpnt)->debug & debug_queue) { 982 if (HOSTDATA(shpnt)->debug & debug_queue) {
980 printk(INFO_LEAD "queue: %p; cmd_len=%d pieces=%d size=%u cmnd=", 983 printk(INFO_LEAD "queue: %p; cmd_len=%d pieces=%d size=%u cmnd=",
981 CMDINFO(SCpnt), SCpnt, SCpnt->cmd_len, SCpnt->use_sg, SCpnt->request_bufflen); 984 CMDINFO(SCpnt), SCpnt, SCpnt->cmd_len,
985 scsi_sg_count(SCpnt), scsi_bufflen(SCpnt));
982 __scsi_print_command(SCpnt->cmnd); 986 __scsi_print_command(SCpnt->cmnd);
983 } 987 }
984#endif 988#endif
985 989
986 SCpnt->scsi_done = done; 990 SCpnt->scsi_done = done;
987 SCpnt->resid = SCpnt->request_bufflen;
988 SCpnt->SCp.phase = not_issued | phase; 991 SCpnt->SCp.phase = not_issued | phase;
989 SCpnt->SCp.Status = CHECK_CONDITION; 992 SCpnt->SCp.Status = 0x1; /* Ilegal status by SCSI standard */
990 SCpnt->SCp.Message = 0; 993 SCpnt->SCp.Message = 0;
991 SCpnt->SCp.have_data_in = 0; 994 SCpnt->SCp.have_data_in = 0;
992 SCpnt->SCp.sent_command = 0; 995 SCpnt->SCp.sent_command = 0;
@@ -997,20 +1000,11 @@ static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct completion *complete,
997 return FAILED; 1000 return FAILED;
998 } 1001 }
999 } else { 1002 } else {
1000 struct aha152x_scdata *sc;
1001
1002 SCpnt->host_scribble = kmalloc(sizeof(struct aha152x_scdata), GFP_ATOMIC); 1003 SCpnt->host_scribble = kmalloc(sizeof(struct aha152x_scdata), GFP_ATOMIC);
1003 if(SCpnt->host_scribble==0) { 1004 if(SCpnt->host_scribble==0) {
1004 printk(ERR_LEAD "allocation failed\n", CMDINFO(SCpnt)); 1005 printk(ERR_LEAD "allocation failed\n", CMDINFO(SCpnt));
1005 return FAILED; 1006 return FAILED;
1006 } 1007 }
1007
1008 sc = SCDATA(SCpnt);
1009 memcpy(sc->cmnd, SCpnt->cmnd, sizeof(sc->cmnd));
1010 sc->request_buffer = SCpnt->request_buffer;
1011 sc->request_bufflen = SCpnt->request_bufflen;
1012 sc->use_sg = SCpnt->use_sg;
1013 sc->cmd_len = SCpnt->cmd_len;
1014 } 1008 }
1015 1009
1016 SCNEXT(SCpnt) = NULL; 1010 SCNEXT(SCpnt) = NULL;
@@ -1022,16 +1016,25 @@ static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct completion *complete,
1022 SCp.buffer : next buffer 1016 SCp.buffer : next buffer
1023 SCp.buffers_residual : left buffers in list 1017 SCp.buffers_residual : left buffers in list
1024 SCp.phase : current state of the command */ 1018 SCp.phase : current state of the command */
1025 if (SCpnt->use_sg) { 1019
1026 SCpnt->SCp.buffer = (struct scatterlist *) SCpnt->request_buffer; 1020 if ((phase & (check_condition|resetting)) || !scsi_sglist(SCpnt)) {
1027 SCpnt->SCp.ptr = SG_ADDRESS(SCpnt->SCp.buffer); 1021 if (phase & check_condition) {
1028 SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length; 1022 SCpnt->SCp.ptr = SCpnt->sense_buffer;
1029 SCpnt->SCp.buffers_residual = SCpnt->use_sg - 1; 1023 SCpnt->SCp.this_residual = sizeof(SCpnt->sense_buffer);
1030 } else { 1024 scsi_set_resid(SCpnt, sizeof(SCpnt->sense_buffer));
1031 SCpnt->SCp.ptr = (char *) SCpnt->request_buffer; 1025 } else {
1032 SCpnt->SCp.this_residual = SCpnt->request_bufflen; 1026 SCpnt->SCp.ptr = NULL;
1027 SCpnt->SCp.this_residual = 0;
1028 scsi_set_resid(SCpnt, 0);
1029 }
1033 SCpnt->SCp.buffer = NULL; 1030 SCpnt->SCp.buffer = NULL;
1034 SCpnt->SCp.buffers_residual = 0; 1031 SCpnt->SCp.buffers_residual = 0;
1032 } else {
1033 scsi_set_resid(SCpnt, scsi_bufflen(SCpnt));
1034 SCpnt->SCp.buffer = scsi_sglist(SCpnt);
1035 SCpnt->SCp.ptr = SG_ADDRESS(SCpnt->SCp.buffer);
1036 SCpnt->SCp.this_residual = SCpnt->SCp.buffer->length;
1037 SCpnt->SCp.buffers_residual = scsi_sg_count(SCpnt) - 1;
1035 } 1038 }
1036 1039
1037 DO_LOCK(flags); 1040 DO_LOCK(flags);
@@ -1150,9 +1153,6 @@ static int aha152x_device_reset(Scsi_Cmnd * SCpnt)
1150 DECLARE_COMPLETION(done); 1153 DECLARE_COMPLETION(done);
1151 int ret, issued, disconnected; 1154 int ret, issued, disconnected;
1152 unsigned char old_cmd_len = SCpnt->cmd_len; 1155 unsigned char old_cmd_len = SCpnt->cmd_len;
1153 unsigned short old_use_sg = SCpnt->use_sg;
1154 void *old_buffer = SCpnt->request_buffer;
1155 unsigned old_bufflen = SCpnt->request_bufflen;
1156 unsigned long flags; 1156 unsigned long flags;
1157 unsigned long timeleft; 1157 unsigned long timeleft;
1158 1158
@@ -1174,9 +1174,6 @@ static int aha152x_device_reset(Scsi_Cmnd * SCpnt)
1174 DO_UNLOCK(flags); 1174 DO_UNLOCK(flags);
1175 1175
1176 SCpnt->cmd_len = 0; 1176 SCpnt->cmd_len = 0;
1177 SCpnt->use_sg = 0;
1178 SCpnt->request_buffer = NULL;
1179 SCpnt->request_bufflen = 0;
1180 1177
1181 aha152x_internal_queue(SCpnt, &done, resetting, reset_done); 1178 aha152x_internal_queue(SCpnt, &done, resetting, reset_done);
1182 1179
@@ -1189,9 +1186,6 @@ static int aha152x_device_reset(Scsi_Cmnd * SCpnt)
1189 } 1186 }
1190 1187
1191 SCpnt->cmd_len = old_cmd_len; 1188 SCpnt->cmd_len = old_cmd_len;
1192 SCpnt->use_sg = old_use_sg;
1193 SCpnt->request_buffer = old_buffer;
1194 SCpnt->request_bufflen = old_bufflen;
1195 1189
1196 DO_LOCK(flags); 1190 DO_LOCK(flags);
1197 1191
@@ -1531,8 +1525,8 @@ static void busfree_run(struct Scsi_Host *shpnt)
1531 /* target sent DISCONNECT */ 1525 /* target sent DISCONNECT */
1532 DPRINTK(debug_selection, DEBUG_LEAD "target disconnected at %d/%d\n", 1526 DPRINTK(debug_selection, DEBUG_LEAD "target disconnected at %d/%d\n",
1533 CMDINFO(CURRENT_SC), 1527 CMDINFO(CURRENT_SC),
1534 CURRENT_SC->resid, 1528 scsi_get_resid(CURRENT_SC),
1535 CURRENT_SC->request_bufflen); 1529 scsi_bufflen(CURRENT_SC));
1536#if defined(AHA152X_STAT) 1530#if defined(AHA152X_STAT)
1537 HOSTDATA(shpnt)->disconnections++; 1531 HOSTDATA(shpnt)->disconnections++;
1538#endif 1532#endif
@@ -1568,18 +1562,16 @@ static void busfree_run(struct Scsi_Host *shpnt)
1568#endif 1562#endif
1569 1563
1570 /* restore old command */ 1564 /* restore old command */
1571 memcpy(cmd->cmnd, sc->cmnd, sizeof(sc->cmnd)); 1565 memcpy(cmd->cmnd, sc->aha_orig_cmnd, sizeof(cmd->cmnd));
1572 cmd->request_buffer = sc->request_buffer; 1566 cmd->cmd_len = sc->aha_orig_cmd_len;
1573 cmd->request_bufflen = sc->request_bufflen; 1567 scsi_set_resid(cmd, sc->aha_orig_resid);
1574 cmd->use_sg = sc->use_sg;
1575 cmd->cmd_len = sc->cmd_len;
1576 1568
1577 cmd->SCp.Status = 0x02; 1569 cmd->SCp.Status = SAM_STAT_CHECK_CONDITION;
1578 1570
1579 HOSTDATA(shpnt)->commands--; 1571 HOSTDATA(shpnt)->commands--;
1580 if (!HOSTDATA(shpnt)->commands) 1572 if (!HOSTDATA(shpnt)->commands)
1581 SETPORT(PORTA, 0); /* turn led off */ 1573 SETPORT(PORTA, 0); /* turn led off */
1582 } else if(DONE_SC->SCp.Status==0x02) { 1574 } else if(DONE_SC->SCp.Status==SAM_STAT_CHECK_CONDITION) {
1583#if defined(AHA152X_STAT) 1575#if defined(AHA152X_STAT)
1584 HOSTDATA(shpnt)->busfree_with_check_condition++; 1576 HOSTDATA(shpnt)->busfree_with_check_condition++;
1585#endif 1577#endif
@@ -1587,13 +1579,23 @@ static void busfree_run(struct Scsi_Host *shpnt)
1587 DPRINTK(debug_eh, ERR_LEAD "CHECK CONDITION found\n", CMDINFO(DONE_SC)); 1579 DPRINTK(debug_eh, ERR_LEAD "CHECK CONDITION found\n", CMDINFO(DONE_SC));
1588#endif 1580#endif
1589 1581
1590 if(!(DONE_SC->SCp.Status & not_issued)) { 1582 if(!(DONE_SC->SCp.phase & not_issued)) {
1583 struct aha152x_scdata *sc;
1591 Scsi_Cmnd *ptr = DONE_SC; 1584 Scsi_Cmnd *ptr = DONE_SC;
1592 DONE_SC=NULL; 1585 DONE_SC=NULL;
1593#if 0 1586#if 0
1594 DPRINTK(debug_eh, ERR_LEAD "requesting sense\n", CMDINFO(ptr)); 1587 DPRINTK(debug_eh, ERR_LEAD "requesting sense\n", CMDINFO(ptr));
1595#endif 1588#endif
1596 1589
1590 /* save old command */
1591 sc = SCDATA(ptr);
1592 /* It was allocated in aha152x_internal_queue? */
1593 BUG_ON(!sc);
1594 memcpy(sc->aha_orig_cmnd, ptr->cmnd,
1595 sizeof(ptr->cmnd));
1596 sc->aha_orig_cmd_len = ptr->cmd_len;
1597 sc->aha_orig_resid = scsi_get_resid(ptr);
1598
1597 ptr->cmnd[0] = REQUEST_SENSE; 1599 ptr->cmnd[0] = REQUEST_SENSE;
1598 ptr->cmnd[1] = 0; 1600 ptr->cmnd[1] = 0;
1599 ptr->cmnd[2] = 0; 1601 ptr->cmnd[2] = 0;
@@ -1601,10 +1603,7 @@ static void busfree_run(struct Scsi_Host *shpnt)
1601 ptr->cmnd[4] = sizeof(ptr->sense_buffer); 1603 ptr->cmnd[4] = sizeof(ptr->sense_buffer);
1602 ptr->cmnd[5] = 0; 1604 ptr->cmnd[5] = 0;
1603 ptr->cmd_len = 6; 1605 ptr->cmd_len = 6;
1604 ptr->use_sg = 0; 1606
1605 ptr->request_buffer = ptr->sense_buffer;
1606 ptr->request_bufflen = sizeof(ptr->sense_buffer);
1607
1608 DO_UNLOCK(flags); 1607 DO_UNLOCK(flags);
1609 aha152x_internal_queue(ptr, NULL, check_condition, ptr->scsi_done); 1608 aha152x_internal_queue(ptr, NULL, check_condition, ptr->scsi_done);
1610 DO_LOCK(flags); 1609 DO_LOCK(flags);
@@ -2180,7 +2179,8 @@ static void datai_init(struct Scsi_Host *shpnt)
2180 DATA_LEN=0; 2179 DATA_LEN=0;
2181 DPRINTK(debug_datai, 2180 DPRINTK(debug_datai,
2182 DEBUG_LEAD "datai_init: request_bufflen=%d resid=%d\n", 2181 DEBUG_LEAD "datai_init: request_bufflen=%d resid=%d\n",
2183 CMDINFO(CURRENT_SC), CURRENT_SC->request_bufflen, CURRENT_SC->resid); 2182 CMDINFO(CURRENT_SC), scsi_bufflen(CURRENT_SC),
2183 scsi_get_resid(CURRENT_SC));
2184} 2184}
2185 2185
2186static void datai_run(struct Scsi_Host *shpnt) 2186static void datai_run(struct Scsi_Host *shpnt)
@@ -2293,11 +2293,12 @@ static void datai_run(struct Scsi_Host *shpnt)
2293 2293
2294static void datai_end(struct Scsi_Host *shpnt) 2294static void datai_end(struct Scsi_Host *shpnt)
2295{ 2295{
2296 CURRENT_SC->resid -= GETSTCNT(); 2296 CMD_INC_RESID(CURRENT_SC, -GETSTCNT());
2297 2297
2298 DPRINTK(debug_datai, 2298 DPRINTK(debug_datai,
2299 DEBUG_LEAD "datai_end: request_bufflen=%d resid=%d stcnt=%d\n", 2299 DEBUG_LEAD "datai_end: request_bufflen=%d resid=%d stcnt=%d\n",
2300 CMDINFO(CURRENT_SC), CURRENT_SC->request_bufflen, CURRENT_SC->resid, GETSTCNT()); 2300 CMDINFO(CURRENT_SC), scsi_bufflen(CURRENT_SC),
2301 scsi_get_resid(CURRENT_SC), GETSTCNT());
2301 2302
2302 SETPORT(SXFRCTL0, CH1|CLRSTCNT); 2303 SETPORT(SXFRCTL0, CH1|CLRSTCNT);
2303 SETPORT(DMACNTRL0, 0); 2304 SETPORT(DMACNTRL0, 0);
@@ -2318,11 +2319,12 @@ static void datao_init(struct Scsi_Host *shpnt)
2318 SETPORT(SIMODE0, 0); 2319 SETPORT(SIMODE0, 0);
2319 SETPORT(SIMODE1, ENSCSIPERR | ENSCSIRST | ENPHASEMIS | ENBUSFREE ); 2320 SETPORT(SIMODE1, ENSCSIPERR | ENSCSIRST | ENPHASEMIS | ENBUSFREE );
2320 2321
2321 DATA_LEN = CURRENT_SC->resid; 2322 DATA_LEN = scsi_get_resid(CURRENT_SC);
2322 2323
2323 DPRINTK(debug_datao, 2324 DPRINTK(debug_datao,
2324 DEBUG_LEAD "datao_init: request_bufflen=%d; resid=%d\n", 2325 DEBUG_LEAD "datao_init: request_bufflen=%d; resid=%d\n",
2325 CMDINFO(CURRENT_SC), CURRENT_SC->request_bufflen, CURRENT_SC->resid); 2326 CMDINFO(CURRENT_SC), scsi_bufflen(CURRENT_SC),
2327 scsi_get_resid(CURRENT_SC));
2326} 2328}
2327 2329
2328static void datao_run(struct Scsi_Host *shpnt) 2330static void datao_run(struct Scsi_Host *shpnt)
@@ -2346,7 +2348,7 @@ static void datao_run(struct Scsi_Host *shpnt)
2346 SETPORT(DMACNTRL0,WRITE_READ|ENDMA|_8BIT); 2348 SETPORT(DMACNTRL0,WRITE_READ|ENDMA|_8BIT);
2347 SETPORT(DATAPORT, *CURRENT_SC->SCp.ptr++); 2349 SETPORT(DATAPORT, *CURRENT_SC->SCp.ptr++);
2348 CURRENT_SC->SCp.this_residual--; 2350 CURRENT_SC->SCp.this_residual--;
2349 CURRENT_SC->resid--; 2351 CMD_INC_RESID(CURRENT_SC, -1);
2350 SETPORT(DMACNTRL0,WRITE_READ|ENDMA); 2352 SETPORT(DMACNTRL0,WRITE_READ|ENDMA);
2351 } 2353 }
2352 2354
@@ -2355,7 +2357,7 @@ static void datao_run(struct Scsi_Host *shpnt)
2355 outsw(DATAPORT, CURRENT_SC->SCp.ptr, data_count); 2357 outsw(DATAPORT, CURRENT_SC->SCp.ptr, data_count);
2356 CURRENT_SC->SCp.ptr += 2 * data_count; 2358 CURRENT_SC->SCp.ptr += 2 * data_count;
2357 CURRENT_SC->SCp.this_residual -= 2 * data_count; 2359 CURRENT_SC->SCp.this_residual -= 2 * data_count;
2358 CURRENT_SC->resid -= 2 * data_count; 2360 CMD_INC_RESID(CURRENT_SC, -2 * data_count);
2359 } 2361 }
2360 2362
2361 if(CURRENT_SC->SCp.this_residual==0 && CURRENT_SC->SCp.buffers_residual>0) { 2363 if(CURRENT_SC->SCp.this_residual==0 && CURRENT_SC->SCp.buffers_residual>0) {
@@ -2381,35 +2383,34 @@ static void datao_run(struct Scsi_Host *shpnt)
2381static void datao_end(struct Scsi_Host *shpnt) 2383static void datao_end(struct Scsi_Host *shpnt)
2382{ 2384{
2383 if(TESTLO(DMASTAT, DFIFOEMP)) { 2385 if(TESTLO(DMASTAT, DFIFOEMP)) {
2384 int data_count = (DATA_LEN - CURRENT_SC->resid) - GETSTCNT(); 2386 int data_count = (DATA_LEN - scsi_get_resid(CURRENT_SC)) -
2387 GETSTCNT();
2385 2388
2386 DPRINTK(debug_datao, DEBUG_LEAD "datao: %d bytes to resend (%d written, %d transferred)\n", 2389 DPRINTK(debug_datao, DEBUG_LEAD "datao: %d bytes to resend (%d written, %d transferred)\n",
2387 CMDINFO(CURRENT_SC), 2390 CMDINFO(CURRENT_SC),
2388 data_count, 2391 data_count,
2389 DATA_LEN-CURRENT_SC->resid, 2392 DATA_LEN - scsi_get_resid(CURRENT_SC),
2390 GETSTCNT()); 2393 GETSTCNT());
2391 2394
2392 CURRENT_SC->resid += data_count; 2395 CMD_INC_RESID(CURRENT_SC, data_count);
2393 2396
2394 if(CURRENT_SC->use_sg) { 2397 data_count -= CURRENT_SC->SCp.ptr -
2395 data_count -= CURRENT_SC->SCp.ptr - SG_ADDRESS(CURRENT_SC->SCp.buffer); 2398 SG_ADDRESS(CURRENT_SC->SCp.buffer);
2396 while(data_count>0) { 2399 while(data_count>0) {
2397 CURRENT_SC->SCp.buffer--; 2400 CURRENT_SC->SCp.buffer--;
2398 CURRENT_SC->SCp.buffers_residual++; 2401 CURRENT_SC->SCp.buffers_residual++;
2399 data_count -= CURRENT_SC->SCp.buffer->length; 2402 data_count -= CURRENT_SC->SCp.buffer->length;
2400 }
2401 CURRENT_SC->SCp.ptr = SG_ADDRESS(CURRENT_SC->SCp.buffer) - data_count;
2402 CURRENT_SC->SCp.this_residual = CURRENT_SC->SCp.buffer->length + data_count;
2403 } else {
2404 CURRENT_SC->SCp.ptr -= data_count;
2405 CURRENT_SC->SCp.this_residual += data_count;
2406 } 2403 }
2404 CURRENT_SC->SCp.ptr = SG_ADDRESS(CURRENT_SC->SCp.buffer) -
2405 data_count;
2406 CURRENT_SC->SCp.this_residual = CURRENT_SC->SCp.buffer->length +
2407 data_count;
2407 } 2408 }
2408 2409
2409 DPRINTK(debug_datao, DEBUG_LEAD "datao_end: request_bufflen=%d; resid=%d; stcnt=%d\n", 2410 DPRINTK(debug_datao, DEBUG_LEAD "datao_end: request_bufflen=%d; resid=%d; stcnt=%d\n",
2410 CMDINFO(CURRENT_SC), 2411 CMDINFO(CURRENT_SC),
2411 CURRENT_SC->request_bufflen, 2412 scsi_bufflen(CURRENT_SC),
2412 CURRENT_SC->resid, 2413 scsi_get_resid(CURRENT_SC),
2413 GETSTCNT()); 2414 GETSTCNT());
2414 2415
2415 SETPORT(SXFRCTL0, CH1|CLRCH1|CLRSTCNT); 2416 SETPORT(SXFRCTL0, CH1|CLRCH1|CLRSTCNT);
@@ -2936,7 +2937,7 @@ static void show_command(Scsi_Cmnd *ptr)
2936 __scsi_print_command(ptr->cmnd); 2937 __scsi_print_command(ptr->cmnd);
2937 2938
2938 printk(KERN_DEBUG "); request_bufflen=%d; resid=%d; phase |", 2939 printk(KERN_DEBUG "); request_bufflen=%d; resid=%d; phase |",
2939 ptr->request_bufflen, ptr->resid); 2940 scsi_bufflen(ptr), scsi_get_resid(ptr));
2940 2941
2941 if (ptr->SCp.phase & not_issued) 2942 if (ptr->SCp.phase & not_issued)
2942 printk("not issued|"); 2943 printk("not issued|");
@@ -3006,7 +3007,8 @@ static int get_command(char *pos, Scsi_Cmnd * ptr)
3006 SPRINTF("0x%02x ", ptr->cmnd[i]); 3007 SPRINTF("0x%02x ", ptr->cmnd[i]);
3007 3008
3008 SPRINTF("); resid=%d; residual=%d; buffers=%d; phase |", 3009 SPRINTF("); resid=%d; residual=%d; buffers=%d; phase |",
3009 ptr->resid, ptr->SCp.this_residual, ptr->SCp.buffers_residual); 3010 scsi_get_resid(ptr), ptr->SCp.this_residual,
3011 ptr->SCp.buffers_residual);
3010 3012
3011 if (ptr->SCp.phase & not_issued) 3013 if (ptr->SCp.phase & not_issued)
3012 SPRINTF("not issued|"); 3014 SPRINTF("not issued|");
@@ -3395,7 +3397,7 @@ static int aha152x_proc_info(struct Scsi_Host *shpnt, char *buffer, char **start
3395 PDEBUG(debug_datai, "data in"); 3397 PDEBUG(debug_datai, "data in");
3396 PDEBUG(debug_datao, "data out"); 3398 PDEBUG(debug_datao, "data out");
3397 PDEBUG(debug_eh, "eh"); 3399 PDEBUG(debug_eh, "eh");
3398 PDEBUG(debug_locks, "locks"); 3400 PDEBUG(debug_locking, "locks");
3399 PDEBUG(debug_phases, "phases"); 3401 PDEBUG(debug_phases, "phases");
3400 3402
3401 SPRINTF("\n"); 3403 SPRINTF("\n");
@@ -3474,6 +3476,12 @@ static int aha152x_proc_info(struct Scsi_Host *shpnt, char *buffer, char **start
3474 return thislength < length ? thislength : length; 3476 return thislength < length ? thislength : length;
3475} 3477}
3476 3478
3479static int aha152x_adjust_queue(struct scsi_device *device)
3480{
3481 blk_queue_bounce_limit(device->request_queue, BLK_BOUNCE_HIGH);
3482 return 0;
3483}
3484
3477static struct scsi_host_template aha152x_driver_template = { 3485static struct scsi_host_template aha152x_driver_template = {
3478 .module = THIS_MODULE, 3486 .module = THIS_MODULE,
3479 .name = AHA152X_REVID, 3487 .name = AHA152X_REVID,
@@ -3490,6 +3498,7 @@ static struct scsi_host_template aha152x_driver_template = {
3490 .sg_tablesize = SG_ALL, 3498 .sg_tablesize = SG_ALL,
3491 .cmd_per_lun = 1, 3499 .cmd_per_lun = 1,
3492 .use_clustering = DISABLE_CLUSTERING, 3500 .use_clustering = DISABLE_CLUSTERING,
3501 .slave_alloc = aha152x_adjust_queue,
3493}; 3502};
3494 3503
3495#if !defined(PCMCIA) 3504#if !defined(PCMCIA)
diff --git a/drivers/scsi/aha152x.h b/drivers/scsi/aha152x.h
index d2add24d02a3..ac4bfa438bf2 100644
--- a/drivers/scsi/aha152x.h
+++ b/drivers/scsi/aha152x.h
@@ -298,7 +298,7 @@ typedef union {
298enum { 298enum {
299 debug_procinfo = 0x0001, 299 debug_procinfo = 0x0001,
300 debug_queue = 0x0002, 300 debug_queue = 0x0002,
301 debug_locks = 0x0004, 301 debug_locking = 0x0004,
302 debug_intr = 0x0008, 302 debug_intr = 0x0008,
303 debug_selection = 0x0010, 303 debug_selection = 0x0010,
304 debug_msgo = 0x0020, 304 debug_msgo = 0x0020,
diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c
index 75733b09f27a..f350b5e89e76 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_core.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -1701,7 +1701,16 @@ ahc_find_syncrate(struct ahc_softc *ahc, u_int *period,
1701 if ((*ppr_options & MSG_EXT_PPR_DT_REQ) == 0 1701 if ((*ppr_options & MSG_EXT_PPR_DT_REQ) == 0
1702 && maxsync < AHC_SYNCRATE_ULTRA2) 1702 && maxsync < AHC_SYNCRATE_ULTRA2)
1703 maxsync = AHC_SYNCRATE_ULTRA2; 1703 maxsync = AHC_SYNCRATE_ULTRA2;
1704 1704
1705 /* Now set the maxsync based on the card capabilities
1706 * DT is already done above */
1707 if ((ahc->features & (AHC_DT | AHC_ULTRA2)) == 0
1708 && maxsync < AHC_SYNCRATE_ULTRA)
1709 maxsync = AHC_SYNCRATE_ULTRA;
1710 if ((ahc->features & (AHC_DT | AHC_ULTRA2 | AHC_ULTRA)) == 0
1711 && maxsync < AHC_SYNCRATE_FAST)
1712 maxsync = AHC_SYNCRATE_FAST;
1713
1705 for (syncrate = &ahc_syncrates[maxsync]; 1714 for (syncrate = &ahc_syncrates[maxsync];
1706 syncrate->rate != NULL; 1715 syncrate->rate != NULL;
1707 syncrate++) { 1716 syncrate++) {
@@ -1765,6 +1774,17 @@ ahc_find_period(struct ahc_softc *ahc, u_int scsirate, u_int maxsync)
1765 else 1774 else
1766 scsirate &= SXFR; 1775 scsirate &= SXFR;
1767 1776
1777 /* now set maxsync based on card capabilities */
1778 if ((ahc->features & AHC_DT) == 0 && maxsync < AHC_SYNCRATE_ULTRA2)
1779 maxsync = AHC_SYNCRATE_ULTRA2;
1780 if ((ahc->features & (AHC_DT | AHC_ULTRA2)) == 0
1781 && maxsync < AHC_SYNCRATE_ULTRA)
1782 maxsync = AHC_SYNCRATE_ULTRA;
1783 if ((ahc->features & (AHC_DT | AHC_ULTRA2 | AHC_ULTRA)) == 0
1784 && maxsync < AHC_SYNCRATE_FAST)
1785 maxsync = AHC_SYNCRATE_FAST;
1786
1787
1768 syncrate = &ahc_syncrates[maxsync]; 1788 syncrate = &ahc_syncrates[maxsync];
1769 while (syncrate->rate != NULL) { 1789 while (syncrate->rate != NULL) {
1770 1790
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
index 2e2362d787ca..502732ac270d 100644
--- a/drivers/scsi/dpt_i2o.c
+++ b/drivers/scsi/dpt_i2o.c
@@ -173,20 +173,20 @@ static struct pci_device_id dptids[] = {
173}; 173};
174MODULE_DEVICE_TABLE(pci,dptids); 174MODULE_DEVICE_TABLE(pci,dptids);
175 175
176static int adpt_detect(struct scsi_host_template* sht) 176static void adpt_exit(void);
177
178static int adpt_detect(void)
177{ 179{
178 struct pci_dev *pDev = NULL; 180 struct pci_dev *pDev = NULL;
179 adpt_hba* pHba; 181 adpt_hba* pHba;
180 182
181 adpt_init();
182
183 PINFO("Detecting Adaptec I2O RAID controllers...\n"); 183 PINFO("Detecting Adaptec I2O RAID controllers...\n");
184 184
185 /* search for all Adatpec I2O RAID cards */ 185 /* search for all Adatpec I2O RAID cards */
186 while ((pDev = pci_get_device( PCI_DPT_VENDOR_ID, PCI_ANY_ID, pDev))) { 186 while ((pDev = pci_get_device( PCI_DPT_VENDOR_ID, PCI_ANY_ID, pDev))) {
187 if(pDev->device == PCI_DPT_DEVICE_ID || 187 if(pDev->device == PCI_DPT_DEVICE_ID ||
188 pDev->device == PCI_DPT_RAPTOR_DEVICE_ID){ 188 pDev->device == PCI_DPT_RAPTOR_DEVICE_ID){
189 if(adpt_install_hba(sht, pDev) ){ 189 if(adpt_install_hba(pDev) ){
190 PERROR("Could not Init an I2O RAID device\n"); 190 PERROR("Could not Init an I2O RAID device\n");
191 PERROR("Will not try to detect others.\n"); 191 PERROR("Will not try to detect others.\n");
192 return hba_count-1; 192 return hba_count-1;
@@ -248,34 +248,33 @@ rebuild_sys_tab:
248 } 248 }
249 249
250 for (pHba = hba_chain; pHba; pHba = pHba->next) { 250 for (pHba = hba_chain; pHba; pHba = pHba->next) {
251 if( adpt_scsi_register(pHba,sht) < 0){ 251 if (adpt_scsi_register(pHba) < 0) {
252 adpt_i2o_delete_hba(pHba); 252 adpt_i2o_delete_hba(pHba);
253 continue; 253 continue;
254 } 254 }
255 pHba->initialized = TRUE; 255 pHba->initialized = TRUE;
256 pHba->state &= ~DPTI_STATE_RESET; 256 pHba->state &= ~DPTI_STATE_RESET;
257 scsi_scan_host(pHba->host);
257 } 258 }
258 259
259 // Register our control device node 260 // Register our control device node
260 // nodes will need to be created in /dev to access this 261 // nodes will need to be created in /dev to access this
261 // the nodes can not be created from within the driver 262 // the nodes can not be created from within the driver
262 if (hba_count && register_chrdev(DPTI_I2O_MAJOR, DPT_DRIVER, &adpt_fops)) { 263 if (hba_count && register_chrdev(DPTI_I2O_MAJOR, DPT_DRIVER, &adpt_fops)) {
263 adpt_i2o_sys_shutdown(); 264 adpt_exit();
264 return 0; 265 return 0;
265 } 266 }
266 return hba_count; 267 return hba_count;
267} 268}
268 269
269 270
270/* 271static int adpt_release(adpt_hba *pHba)
271 * scsi_unregister will be called AFTER we return.
272 */
273static int adpt_release(struct Scsi_Host *host)
274{ 272{
275 adpt_hba* pHba = (adpt_hba*) host->hostdata[0]; 273 struct Scsi_Host *shost = pHba->host;
274 scsi_remove_host(shost);
276// adpt_i2o_quiesce_hba(pHba); 275// adpt_i2o_quiesce_hba(pHba);
277 adpt_i2o_delete_hba(pHba); 276 adpt_i2o_delete_hba(pHba);
278 scsi_unregister(host); 277 scsi_host_put(shost);
279 return 0; 278 return 0;
280} 279}
281 280
@@ -882,7 +881,7 @@ static int adpt_reboot_event(struct notifier_block *n, ulong code, void *p)
882#endif 881#endif
883 882
884 883
885static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev) 884static int adpt_install_hba(struct pci_dev* pDev)
886{ 885{
887 886
888 adpt_hba* pHba = NULL; 887 adpt_hba* pHba = NULL;
@@ -1031,8 +1030,6 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba)
1031 1030
1032 1031
1033 mutex_lock(&adpt_configuration_lock); 1032 mutex_lock(&adpt_configuration_lock);
1034 // scsi_unregister calls our adpt_release which
1035 // does a quiese
1036 if(pHba->host){ 1033 if(pHba->host){
1037 free_irq(pHba->host->irq, pHba); 1034 free_irq(pHba->host->irq, pHba);
1038 } 1035 }
@@ -1084,17 +1081,6 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba)
1084} 1081}
1085 1082
1086 1083
1087static int adpt_init(void)
1088{
1089 printk("Loading Adaptec I2O RAID: Version " DPT_I2O_VERSION "\n");
1090#ifdef REBOOT_NOTIFIER
1091 register_reboot_notifier(&adpt_reboot_notifier);
1092#endif
1093
1094 return 0;
1095}
1096
1097
1098static struct adpt_device* adpt_find_device(adpt_hba* pHba, u32 chan, u32 id, u32 lun) 1084static struct adpt_device* adpt_find_device(adpt_hba* pHba, u32 chan, u32 id, u32 lun)
1099{ 1085{
1100 struct adpt_device* d; 1086 struct adpt_device* d;
@@ -2180,37 +2166,6 @@ static s32 adpt_scsi_to_i2o(adpt_hba* pHba, struct scsi_cmnd* cmd, struct adpt_d
2180} 2166}
2181 2167
2182 2168
2183static s32 adpt_scsi_register(adpt_hba* pHba,struct scsi_host_template * sht)
2184{
2185 struct Scsi_Host *host = NULL;
2186
2187 host = scsi_register(sht, sizeof(adpt_hba*));
2188 if (host == NULL) {
2189 printk ("%s: scsi_register returned NULL\n",pHba->name);
2190 return -1;
2191 }
2192 host->hostdata[0] = (unsigned long)pHba;
2193 pHba->host = host;
2194
2195 host->irq = pHba->pDev->irq;
2196 /* no IO ports, so don't have to set host->io_port and
2197 * host->n_io_port
2198 */
2199 host->io_port = 0;
2200 host->n_io_port = 0;
2201 /* see comments in scsi_host.h */
2202 host->max_id = 16;
2203 host->max_lun = 256;
2204 host->max_channel = pHba->top_scsi_channel + 1;
2205 host->cmd_per_lun = 1;
2206 host->unique_id = (uint) pHba;
2207 host->sg_tablesize = pHba->sg_tablesize;
2208 host->can_queue = pHba->post_fifo_size;
2209
2210 return 0;
2211}
2212
2213
2214static s32 adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd) 2169static s32 adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd)
2215{ 2170{
2216 adpt_hba* pHba; 2171 adpt_hba* pHba;
@@ -3329,12 +3284,10 @@ static static void adpt_delay(int millisec)
3329 3284
3330#endif 3285#endif
3331 3286
3332static struct scsi_host_template driver_template = { 3287static struct scsi_host_template adpt_template = {
3333 .name = "dpt_i2o", 3288 .name = "dpt_i2o",
3334 .proc_name = "dpt_i2o", 3289 .proc_name = "dpt_i2o",
3335 .proc_info = adpt_proc_info, 3290 .proc_info = adpt_proc_info,
3336 .detect = adpt_detect,
3337 .release = adpt_release,
3338 .info = adpt_info, 3291 .info = adpt_info,
3339 .queuecommand = adpt_queue, 3292 .queuecommand = adpt_queue,
3340 .eh_abort_handler = adpt_abort, 3293 .eh_abort_handler = adpt_abort,
@@ -3348,5 +3301,62 @@ static struct scsi_host_template driver_template = {
3348 .cmd_per_lun = 1, 3301 .cmd_per_lun = 1,
3349 .use_clustering = ENABLE_CLUSTERING, 3302 .use_clustering = ENABLE_CLUSTERING,
3350}; 3303};
3351#include "scsi_module.c" 3304
3305static s32 adpt_scsi_register(adpt_hba* pHba)
3306{
3307 struct Scsi_Host *host;
3308
3309 host = scsi_host_alloc(&adpt_template, sizeof(adpt_hba*));
3310 if (host == NULL) {
3311 printk ("%s: scsi_host_alloc returned NULL\n",pHba->name);
3312 return -1;
3313 }
3314 host->hostdata[0] = (unsigned long)pHba;
3315 pHba->host = host;
3316
3317 host->irq = pHba->pDev->irq;
3318 /* no IO ports, so don't have to set host->io_port and
3319 * host->n_io_port
3320 */
3321 host->io_port = 0;
3322 host->n_io_port = 0;
3323 /* see comments in scsi_host.h */
3324 host->max_id = 16;
3325 host->max_lun = 256;
3326 host->max_channel = pHba->top_scsi_channel + 1;
3327 host->cmd_per_lun = 1;
3328 host->unique_id = (uint) pHba;
3329 host->sg_tablesize = pHba->sg_tablesize;
3330 host->can_queue = pHba->post_fifo_size;
3331
3332 if (scsi_add_host(host, &pHba->pDev->dev)) {
3333 scsi_host_put(host);
3334 return -1;
3335 }
3336
3337 return 0;
3338}
3339
3340static int __init adpt_init(void)
3341{
3342 int count;
3343
3344 printk("Loading Adaptec I2O RAID: Version " DPT_I2O_VERSION "\n");
3345#ifdef REBOOT_NOTIFIER
3346 register_reboot_notifier(&adpt_reboot_notifier);
3347#endif
3348
3349 count = adpt_detect();
3350
3351 return count > 0 ? 0 : -ENODEV;
3352}
3353
3354static void __exit adpt_exit(void)
3355{
3356 while (hba_chain)
3357 adpt_release(hba_chain);
3358}
3359
3360module_init(adpt_init);
3361module_exit(adpt_exit);
3352MODULE_LICENSE("GPL"); 3362MODULE_LICENSE("GPL");
diff --git a/drivers/scsi/dpti.h b/drivers/scsi/dpti.h
index fd79068c5869..0892f6c70319 100644
--- a/drivers/scsi/dpti.h
+++ b/drivers/scsi/dpti.h
@@ -28,11 +28,9 @@
28 * SCSI interface function Prototypes 28 * SCSI interface function Prototypes
29 */ 29 */
30 30
31static int adpt_detect(struct scsi_host_template * sht);
32static int adpt_queue(struct scsi_cmnd * cmd, void (*cmdcomplete) (struct scsi_cmnd *)); 31static int adpt_queue(struct scsi_cmnd * cmd, void (*cmdcomplete) (struct scsi_cmnd *));
33static int adpt_abort(struct scsi_cmnd * cmd); 32static int adpt_abort(struct scsi_cmnd * cmd);
34static int adpt_reset(struct scsi_cmnd* cmd); 33static int adpt_reset(struct scsi_cmnd* cmd);
35static int adpt_release(struct Scsi_Host *host);
36static int adpt_slave_configure(struct scsi_device *); 34static int adpt_slave_configure(struct scsi_device *);
37 35
38static const char *adpt_info(struct Scsi_Host *pSHost); 36static const char *adpt_info(struct Scsi_Host *pSHost);
@@ -49,8 +47,6 @@ static int adpt_device_reset(struct scsi_cmnd* cmd);
49 47
50#define DPT_DRIVER_NAME "Adaptec I2O RAID" 48#define DPT_DRIVER_NAME "Adaptec I2O RAID"
51 49
52#ifndef HOSTS_C
53
54#include "dpt/sys_info.h" 50#include "dpt/sys_info.h"
55#include <linux/wait.h> 51#include <linux/wait.h>
56#include "dpt/dpti_i2o.h" 52#include "dpt/dpti_i2o.h"
@@ -289,7 +285,7 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba);
289static s32 adpt_i2o_hrt_get(adpt_hba* pHba); 285static 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); 286static 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); 287static 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); 288static s32 adpt_scsi_register(adpt_hba* pHba);
293static s32 adpt_hba_reset(adpt_hba* pHba); 289static s32 adpt_hba_reset(adpt_hba* pHba);
294static s32 adpt_i2o_reset_hba(adpt_hba* pHba); 290static s32 adpt_i2o_reset_hba(adpt_hba* pHba);
295static s32 adpt_rescan(adpt_hba* pHba); 291static s32 adpt_rescan(adpt_hba* pHba);
@@ -299,7 +295,7 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba);
299static void adpt_inquiry(adpt_hba* pHba); 295static void adpt_inquiry(adpt_hba* pHba);
300static void adpt_fail_posted_scbs(adpt_hba* pHba); 296static void adpt_fail_posted_scbs(adpt_hba* pHba);
301static struct adpt_device* adpt_find_device(adpt_hba* pHba, u32 chan, u32 id, u32 lun); 297static struct adpt_device* adpt_find_device(adpt_hba* pHba, u32 chan, u32 id, u32 lun);
302static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev) ; 298static int adpt_install_hba(struct pci_dev* pDev) ;
303static int adpt_i2o_online_hba(adpt_hba* pHba); 299static int adpt_i2o_online_hba(adpt_hba* pHba);
304static void adpt_i2o_post_wait_complete(u32, int); 300static void adpt_i2o_post_wait_complete(u32, int);
305static int adpt_i2o_systab_send(adpt_hba* pHba); 301static int adpt_i2o_systab_send(adpt_hba* pHba);
@@ -343,5 +339,4 @@ static void adpt_i386_info(sysInfo_S* si);
343#define FW_DEBUG_BLED_OFFSET 8 339#define FW_DEBUG_BLED_OFFSET 8
344 340
345#define FW_DEBUG_FLAGS_NO_HEADERS_B 0x01 341#define FW_DEBUG_FLAGS_NO_HEADERS_B 0x01
346#endif /* !HOSTS_C */
347#endif /* _DPT_H */ 342#endif /* _DPT_H */
diff --git a/drivers/scsi/esp_scsi.h b/drivers/scsi/esp_scsi.h
index 856e38b14861..d5576d54ce76 100644
--- a/drivers/scsi/esp_scsi.h
+++ b/drivers/scsi/esp_scsi.h
@@ -220,7 +220,7 @@
220#define ESP_BUSID_RESELID 0x10 220#define ESP_BUSID_RESELID 0x10
221#define ESP_BUSID_CTR32BIT 0x40 221#define ESP_BUSID_CTR32BIT 0x40
222 222
223#define ESP_BUS_TIMEOUT 275 /* In milli-seconds */ 223#define ESP_BUS_TIMEOUT 250 /* In milli-seconds */
224#define ESP_TIMEO_CONST 8192 224#define ESP_TIMEO_CONST 8192
225#define ESP_NEG_DEFP(mhz, cfact) \ 225#define ESP_NEG_DEFP(mhz, cfact) \
226 ((ESP_BUS_TIMEOUT * ((mhz) / 1000)) / (8192 * (cfact))) 226 ((ESP_BUS_TIMEOUT * ((mhz) / 1000)) / (8192 * (cfact)))
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
index d0b95ce0ba00..55e4d2dc2bbe 100644
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -902,11 +902,6 @@ static void __init gdth_search_dev(gdth_pci_str *pcistr, ushort *cnt,
902 return; 902 return;
903 /* GDT PCI controller found, resources are already in pdev */ 903 /* GDT PCI controller found, resources are already in pdev */
904 pcistr[*cnt].pdev = pdev; 904 pcistr[*cnt].pdev = pdev;
905 pcistr[*cnt].vendor_id = vendor;
906 pcistr[*cnt].device_id = device;
907 pcistr[*cnt].subdevice_id = pdev->subsystem_device;
908 pcistr[*cnt].bus = pdev->bus->number;
909 pcistr[*cnt].device_fn = pdev->devfn;
910 pcistr[*cnt].irq = pdev->irq; 905 pcistr[*cnt].irq = pdev->irq;
911 base0 = pci_resource_flags(pdev, 0); 906 base0 = pci_resource_flags(pdev, 0);
912 base1 = pci_resource_flags(pdev, 1); 907 base1 = pci_resource_flags(pdev, 1);
@@ -926,7 +921,8 @@ static void __init gdth_search_dev(gdth_pci_str *pcistr, ushort *cnt,
926 pcistr[*cnt].io = pci_resource_start(pdev, 1); 921 pcistr[*cnt].io = pci_resource_start(pdev, 1);
927 } 922 }
928 TRACE2(("Controller found at %d/%d, irq %d, dpmem 0x%lx\n", 923 TRACE2(("Controller found at %d/%d, irq %d, dpmem 0x%lx\n",
929 pcistr[*cnt].bus, PCI_SLOT(pcistr[*cnt].device_fn), 924 pcistr[*cnt].pdev->bus->number,
925 PCI_SLOT(pcistr[*cnt].pdev->devfn),
930 pcistr[*cnt].irq, pcistr[*cnt].dpmem)); 926 pcistr[*cnt].irq, pcistr[*cnt].dpmem));
931 (*cnt)++; 927 (*cnt)++;
932 } 928 }
@@ -946,20 +942,20 @@ static void __init gdth_sort_pci(gdth_pci_str *pcistr, int cnt)
946 changed = FALSE; 942 changed = FALSE;
947 for (i = 0; i < cnt-1; ++i) { 943 for (i = 0; i < cnt-1; ++i) {
948 if (!reverse_scan) { 944 if (!reverse_scan) {
949 if ((pcistr[i].bus > pcistr[i+1].bus) || 945 if ((pcistr[i].pdev->bus->number > pcistr[i+1].pdev->bus->number) ||
950 (pcistr[i].bus == pcistr[i+1].bus && 946 (pcistr[i].pdev->bus->number == pcistr[i+1].pdev->bus->number &&
951 PCI_SLOT(pcistr[i].device_fn) > 947 PCI_SLOT(pcistr[i].pdev->devfn) >
952 PCI_SLOT(pcistr[i+1].device_fn))) { 948 PCI_SLOT(pcistr[i+1].pdev->devfn))) {
953 temp = pcistr[i]; 949 temp = pcistr[i];
954 pcistr[i] = pcistr[i+1]; 950 pcistr[i] = pcistr[i+1];
955 pcistr[i+1] = temp; 951 pcistr[i+1] = temp;
956 changed = TRUE; 952 changed = TRUE;
957 } 953 }
958 } else { 954 } else {
959 if ((pcistr[i].bus < pcistr[i+1].bus) || 955 if ((pcistr[i].pdev->bus->number < pcistr[i+1].pdev->bus->number) ||
960 (pcistr[i].bus == pcistr[i+1].bus && 956 (pcistr[i].pdev->bus->number == pcistr[i+1].pdev->bus->number &&
961 PCI_SLOT(pcistr[i].device_fn) < 957 PCI_SLOT(pcistr[i].pdev->devfn) <
962 PCI_SLOT(pcistr[i+1].device_fn))) { 958 PCI_SLOT(pcistr[i+1].pdev->devfn))) {
963 temp = pcistr[i]; 959 temp = pcistr[i];
964 pcistr[i] = pcistr[i+1]; 960 pcistr[i] = pcistr[i+1];
965 pcistr[i+1] = temp; 961 pcistr[i+1] = temp;
@@ -1176,17 +1172,16 @@ static int __init gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha)
1176 1172
1177 TRACE(("gdth_init_pci()\n")); 1173 TRACE(("gdth_init_pci()\n"));
1178 1174
1179 if (pcistr->vendor_id == PCI_VENDOR_ID_INTEL) 1175 if (pcistr->pdev->vendor == PCI_VENDOR_ID_INTEL)
1180 ha->oem_id = OEM_ID_INTEL; 1176 ha->oem_id = OEM_ID_INTEL;
1181 else 1177 else
1182 ha->oem_id = OEM_ID_ICP; 1178 ha->oem_id = OEM_ID_ICP;
1183 ha->brd_phys = (pcistr->bus << 8) | (pcistr->device_fn & 0xf8); 1179 ha->brd_phys = (pcistr->pdev->bus->number << 8) | (pcistr->pdev->devfn & 0xf8);
1184 ha->stype = (ulong32)pcistr->device_id; 1180 ha->stype = (ulong32)pcistr->pdev->device;
1185 ha->subdevice_id = pcistr->subdevice_id;
1186 ha->irq = pcistr->irq; 1181 ha->irq = pcistr->irq;
1187 ha->pdev = pcistr->pdev; 1182 ha->pdev = pcistr->pdev;
1188 1183
1189 if (ha->stype <= PCI_DEVICE_ID_VORTEX_GDT6000B) { /* GDT6000/B */ 1184 if (ha->pdev->device <= PCI_DEVICE_ID_VORTEX_GDT6000B) { /* GDT6000/B */
1190 TRACE2(("init_pci() dpmem %lx irq %d\n",pcistr->dpmem,ha->irq)); 1185 TRACE2(("init_pci() dpmem %lx irq %d\n",pcistr->dpmem,ha->irq));
1191 ha->brd = ioremap(pcistr->dpmem, sizeof(gdt6_dpram_str)); 1186 ha->brd = ioremap(pcistr->dpmem, sizeof(gdt6_dpram_str));
1192 if (ha->brd == NULL) { 1187 if (ha->brd == NULL) {
@@ -1293,7 +1288,7 @@ static int __init gdth_init_pci(gdth_pci_str *pcistr,gdth_ha_str *ha)
1293 1288
1294 ha->dma64_support = 0; 1289 ha->dma64_support = 0;
1295 1290
1296 } else if (ha->stype <= PCI_DEVICE_ID_VORTEX_GDT6555) { /* GDT6110, ... */ 1291 } else if (ha->pdev->device <= PCI_DEVICE_ID_VORTEX_GDT6555) { /* GDT6110, ... */
1297 ha->plx = (gdt6c_plx_regs *)pcistr->io; 1292 ha->plx = (gdt6c_plx_regs *)pcistr->io;
1298 TRACE2(("init_pci_new() dpmem %lx irq %d\n", 1293 TRACE2(("init_pci_new() dpmem %lx irq %d\n",
1299 pcistr->dpmem,ha->irq)); 1294 pcistr->dpmem,ha->irq));
@@ -4601,7 +4596,8 @@ static int __init gdth_detect(Scsi_Host_Template *shtp)
4601 } 4596 }
4602 /* controller found and initialized */ 4597 /* controller found and initialized */
4603 printk("Configuring GDT-PCI HA at %d/%d IRQ %u\n", 4598 printk("Configuring GDT-PCI HA at %d/%d IRQ %u\n",
4604 pcistr[ctr].bus,PCI_SLOT(pcistr[ctr].device_fn),ha->irq); 4599 pcistr[ctr].pdev->bus->number,
4600 PCI_SLOT(pcistr[ctr].pdev->devfn), ha->irq);
4605 4601
4606 if (request_irq(ha->irq, gdth_interrupt, 4602 if (request_irq(ha->irq, gdth_interrupt,
4607 IRQF_DISABLED|IRQF_SHARED, "gdth", ha)) 4603 IRQF_DISABLED|IRQF_SHARED, "gdth", ha))
@@ -4637,7 +4633,7 @@ static int __init gdth_detect(Scsi_Host_Template *shtp)
4637#endif 4633#endif
4638 ha->scratch_busy = FALSE; 4634 ha->scratch_busy = FALSE;
4639 ha->req_first = NULL; 4635 ha->req_first = NULL;
4640 ha->tid_cnt = pcistr[ctr].device_id >= 0x200 ? MAXID : MAX_HDRIVES; 4636 ha->tid_cnt = pcistr[ctr].pdev->device >= 0x200 ? MAXID : MAX_HDRIVES;
4641 if (max_ids > 0 && max_ids < ha->tid_cnt) 4637 if (max_ids > 0 && max_ids < ha->tid_cnt)
4642 ha->tid_cnt = max_ids; 4638 ha->tid_cnt = max_ids;
4643 for (i=0; i<GDTH_MAXCMDS; ++i) 4639 for (i=0; i<GDTH_MAXCMDS; ++i)
@@ -4810,7 +4806,7 @@ static const char *gdth_ctr_name(int hanum)
4810 } else if (ha->type == GDT_ISA) { 4806 } else if (ha->type == GDT_ISA) {
4811 return("GDT2000/2020"); 4807 return("GDT2000/2020");
4812 } else if (ha->type == GDT_PCI) { 4808 } else if (ha->type == GDT_PCI) {
4813 switch (ha->stype) { 4809 switch (ha->pdev->device) {
4814 case PCI_DEVICE_ID_VORTEX_GDT60x0: 4810 case PCI_DEVICE_ID_VORTEX_GDT60x0:
4815 return("GDT6000/6020/6050"); 4811 return("GDT6000/6020/6050");
4816 case PCI_DEVICE_ID_VORTEX_GDT6000B: 4812 case PCI_DEVICE_ID_VORTEX_GDT6000B:
@@ -5448,12 +5444,12 @@ static int gdth_ioctl(struct inode *inode, struct file *filep,
5448 ctrt.type = 5444 ctrt.type =
5449 (ha->oem_id == OEM_ID_INTEL ? 0xfd : 0xfe); 5445 (ha->oem_id == OEM_ID_INTEL ? 0xfd : 0xfe);
5450 if (ha->stype >= 0x300) 5446 if (ha->stype >= 0x300)
5451 ctrt.ext_type = 0x6000 | ha->subdevice_id; 5447 ctrt.ext_type = 0x6000 | ha->pdev->subsystem_device;
5452 else 5448 else
5453 ctrt.ext_type = 0x6000 | ha->stype; 5449 ctrt.ext_type = 0x6000 | ha->stype;
5454 } 5450 }
5455 ctrt.device_id = ha->stype; 5451 ctrt.device_id = ha->pdev->device;
5456 ctrt.sub_device_id = ha->subdevice_id; 5452 ctrt.sub_device_id = ha->pdev->subsystem_device;
5457 } 5453 }
5458 ctrt.info = ha->brd_phys; 5454 ctrt.info = ha->brd_phys;
5459 ctrt.oem_id = ha->oem_id; 5455 ctrt.oem_id = ha->oem_id;
diff --git a/drivers/scsi/gdth.h b/drivers/scsi/gdth.h
index 8c29eafd51c5..37423300592e 100644
--- a/drivers/scsi/gdth.h
+++ b/drivers/scsi/gdth.h
@@ -845,11 +845,6 @@ typedef struct {
845/* PCI resources */ 845/* PCI resources */
846typedef struct { 846typedef struct {
847 struct pci_dev *pdev; 847 struct pci_dev *pdev;
848 ushort vendor_id; /* vendor (ICP, Intel, ..) */
849 ushort device_id; /* device ID (0,..,9) */
850 ushort subdevice_id; /* sub device ID */
851 unchar bus; /* PCI bus */
852 unchar device_fn; /* PCI device/function no. */
853 ulong dpmem; /* DPRAM address */ 848 ulong dpmem; /* DPRAM address */
854 ulong io; /* IO address */ 849 ulong io; /* IO address */
855 ulong io_mm; /* IO address mem. mapped */ 850 ulong io_mm; /* IO address mem. mapped */
@@ -862,7 +857,6 @@ typedef struct {
862 ushort oem_id; /* OEM */ 857 ushort oem_id; /* OEM */
863 ushort type; /* controller class */ 858 ushort type; /* controller class */
864 ulong32 stype; /* subtype (PCI: device ID) */ 859 ulong32 stype; /* subtype (PCI: device ID) */
865 ushort subdevice_id; /* sub device ID (PCI) */
866 ushort fw_vers; /* firmware version */ 860 ushort fw_vers; /* firmware version */
867 ushort cache_feat; /* feat. cache serv. (s/g,..)*/ 861 ushort cache_feat; /* feat. cache serv. (s/g,..)*/
868 ushort raw_feat; /* feat. raw service (s/g,..)*/ 862 ushort raw_feat; /* feat. raw service (s/g,..)*/
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index bd8e7f323c69..96bc31266c98 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -220,7 +220,7 @@ int scsi_add_host(struct Scsi_Host *shost, struct device *dev)
220 get_device(&shost->shost_gendev); 220 get_device(&shost->shost_gendev);
221 221
222 if (shost->transportt->host_size && 222 if (shost->transportt->host_size &&
223 (shost->shost_data = kmalloc(shost->transportt->host_size, 223 (shost->shost_data = kzalloc(shost->transportt->host_size,
224 GFP_KERNEL)) == NULL) 224 GFP_KERNEL)) == NULL)
225 goto out_del_classdev; 225 goto out_del_classdev;
226 226
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index 5870866abc99..5ecc63d1b436 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -393,12 +393,6 @@ static int map_sg_data(struct scsi_cmnd *cmd,
393 return 1; 393 return 1;
394 else if (sg_mapped < 0) 394 else if (sg_mapped < 0)
395 return 0; 395 return 0;
396 else if (sg_mapped > SG_ALL) {
397 printk(KERN_ERR
398 "ibmvscsi: More than %d mapped sg entries, got %d\n",
399 SG_ALL, sg_mapped);
400 return 0;
401 }
402 396
403 set_srp_direction(cmd, srp_cmd, sg_mapped); 397 set_srp_direction(cmd, srp_cmd, sg_mapped);
404 398
@@ -708,8 +702,7 @@ static int ibmvscsi_queuecommand(struct scsi_cmnd *cmnd,
708 struct srp_cmd *srp_cmd; 702 struct srp_cmd *srp_cmd;
709 struct srp_event_struct *evt_struct; 703 struct srp_event_struct *evt_struct;
710 struct srp_indirect_buf *indirect; 704 struct srp_indirect_buf *indirect;
711 struct ibmvscsi_host_data *hostdata = 705 struct ibmvscsi_host_data *hostdata = shost_priv(cmnd->device->host);
712 (struct ibmvscsi_host_data *)&cmnd->device->host->hostdata;
713 u16 lun = lun_from_dev(cmnd->device); 706 u16 lun = lun_from_dev(cmnd->device);
714 u8 out_fmt, in_fmt; 707 u8 out_fmt, in_fmt;
715 708
@@ -960,8 +953,7 @@ static void sync_completion(struct srp_event_struct *evt_struct)
960 */ 953 */
961static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd) 954static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd)
962{ 955{
963 struct ibmvscsi_host_data *hostdata = 956 struct ibmvscsi_host_data *hostdata = shost_priv(cmd->device->host);
964 (struct ibmvscsi_host_data *)cmd->device->host->hostdata;
965 struct srp_tsk_mgmt *tsk_mgmt; 957 struct srp_tsk_mgmt *tsk_mgmt;
966 struct srp_event_struct *evt; 958 struct srp_event_struct *evt;
967 struct srp_event_struct *tmp_evt, *found_evt; 959 struct srp_event_struct *tmp_evt, *found_evt;
@@ -1084,9 +1076,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd)
1084 */ 1076 */
1085static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd) 1077static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd)
1086{ 1078{
1087 struct ibmvscsi_host_data *hostdata = 1079 struct ibmvscsi_host_data *hostdata = shost_priv(cmd->device->host);
1088 (struct ibmvscsi_host_data *)cmd->device->host->hostdata;
1089
1090 struct srp_tsk_mgmt *tsk_mgmt; 1080 struct srp_tsk_mgmt *tsk_mgmt;
1091 struct srp_event_struct *evt; 1081 struct srp_event_struct *evt;
1092 struct srp_event_struct *tmp_evt, *pos; 1082 struct srp_event_struct *tmp_evt, *pos;
@@ -1183,8 +1173,7 @@ static int ibmvscsi_eh_device_reset_handler(struct scsi_cmnd *cmd)
1183static int ibmvscsi_eh_host_reset_handler(struct scsi_cmnd *cmd) 1173static int ibmvscsi_eh_host_reset_handler(struct scsi_cmnd *cmd)
1184{ 1174{
1185 unsigned long wait_switch = 0; 1175 unsigned long wait_switch = 0;
1186 struct ibmvscsi_host_data *hostdata = 1176 struct ibmvscsi_host_data *hostdata = shost_priv(cmd->device->host);
1187 (struct ibmvscsi_host_data *)cmd->device->host->hostdata;
1188 1177
1189 dev_err(hostdata->dev, "Resetting connection due to error recovery\n"); 1178 dev_err(hostdata->dev, "Resetting connection due to error recovery\n");
1190 1179
@@ -1412,8 +1401,7 @@ static int ibmvscsi_change_queue_depth(struct scsi_device *sdev, int qdepth)
1412static ssize_t show_host_srp_version(struct class_device *class_dev, char *buf) 1401static ssize_t show_host_srp_version(struct class_device *class_dev, char *buf)
1413{ 1402{
1414 struct Scsi_Host *shost = class_to_shost(class_dev); 1403 struct Scsi_Host *shost = class_to_shost(class_dev);
1415 struct ibmvscsi_host_data *hostdata = 1404 struct ibmvscsi_host_data *hostdata = shost_priv(shost);
1416 (struct ibmvscsi_host_data *)shost->hostdata;
1417 int len; 1405 int len;
1418 1406
1419 len = snprintf(buf, PAGE_SIZE, "%s\n", 1407 len = snprintf(buf, PAGE_SIZE, "%s\n",
@@ -1433,8 +1421,7 @@ static ssize_t show_host_partition_name(struct class_device *class_dev,
1433 char *buf) 1421 char *buf)
1434{ 1422{
1435 struct Scsi_Host *shost = class_to_shost(class_dev); 1423 struct Scsi_Host *shost = class_to_shost(class_dev);
1436 struct ibmvscsi_host_data *hostdata = 1424 struct ibmvscsi_host_data *hostdata = shost_priv(shost);
1437 (struct ibmvscsi_host_data *)shost->hostdata;
1438 int len; 1425 int len;
1439 1426
1440 len = snprintf(buf, PAGE_SIZE, "%s\n", 1427 len = snprintf(buf, PAGE_SIZE, "%s\n",
@@ -1454,8 +1441,7 @@ static ssize_t show_host_partition_number(struct class_device *class_dev,
1454 char *buf) 1441 char *buf)
1455{ 1442{
1456 struct Scsi_Host *shost = class_to_shost(class_dev); 1443 struct Scsi_Host *shost = class_to_shost(class_dev);
1457 struct ibmvscsi_host_data *hostdata = 1444 struct ibmvscsi_host_data *hostdata = shost_priv(shost);
1458 (struct ibmvscsi_host_data *)shost->hostdata;
1459 int len; 1445 int len;
1460 1446
1461 len = snprintf(buf, PAGE_SIZE, "%d\n", 1447 len = snprintf(buf, PAGE_SIZE, "%d\n",
@@ -1474,8 +1460,7 @@ static struct class_device_attribute ibmvscsi_host_partition_number = {
1474static ssize_t show_host_mad_version(struct class_device *class_dev, char *buf) 1460static ssize_t show_host_mad_version(struct class_device *class_dev, char *buf)
1475{ 1461{
1476 struct Scsi_Host *shost = class_to_shost(class_dev); 1462 struct Scsi_Host *shost = class_to_shost(class_dev);
1477 struct ibmvscsi_host_data *hostdata = 1463 struct ibmvscsi_host_data *hostdata = shost_priv(shost);
1478 (struct ibmvscsi_host_data *)shost->hostdata;
1479 int len; 1464 int len;
1480 1465
1481 len = snprintf(buf, PAGE_SIZE, "%d\n", 1466 len = snprintf(buf, PAGE_SIZE, "%d\n",
@@ -1494,8 +1479,7 @@ static struct class_device_attribute ibmvscsi_host_mad_version = {
1494static ssize_t show_host_os_type(struct class_device *class_dev, char *buf) 1479static ssize_t show_host_os_type(struct class_device *class_dev, char *buf)
1495{ 1480{
1496 struct Scsi_Host *shost = class_to_shost(class_dev); 1481 struct Scsi_Host *shost = class_to_shost(class_dev);
1497 struct ibmvscsi_host_data *hostdata = 1482 struct ibmvscsi_host_data *hostdata = shost_priv(shost);
1498 (struct ibmvscsi_host_data *)shost->hostdata;
1499 int len; 1483 int len;
1500 1484
1501 len = snprintf(buf, PAGE_SIZE, "%d\n", hostdata->madapter_info.os_type); 1485 len = snprintf(buf, PAGE_SIZE, "%d\n", hostdata->madapter_info.os_type);
@@ -1513,8 +1497,7 @@ static struct class_device_attribute ibmvscsi_host_os_type = {
1513static ssize_t show_host_config(struct class_device *class_dev, char *buf) 1497static ssize_t show_host_config(struct class_device *class_dev, char *buf)
1514{ 1498{
1515 struct Scsi_Host *shost = class_to_shost(class_dev); 1499 struct Scsi_Host *shost = class_to_shost(class_dev);
1516 struct ibmvscsi_host_data *hostdata = 1500 struct ibmvscsi_host_data *hostdata = shost_priv(shost);
1517 (struct ibmvscsi_host_data *)shost->hostdata;
1518 1501
1519 /* returns null-terminated host config data */ 1502 /* returns null-terminated host config data */
1520 if (ibmvscsi_do_host_config(hostdata, buf, PAGE_SIZE) == 0) 1503 if (ibmvscsi_do_host_config(hostdata, buf, PAGE_SIZE) == 0)
@@ -1582,7 +1565,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id)
1582 goto scsi_host_alloc_failed; 1565 goto scsi_host_alloc_failed;
1583 } 1566 }
1584 1567
1585 hostdata = (struct ibmvscsi_host_data *)host->hostdata; 1568 hostdata = shost_priv(host);
1586 memset(hostdata, 0x00, sizeof(*hostdata)); 1569 memset(hostdata, 0x00, sizeof(*hostdata));
1587 INIT_LIST_HEAD(&hostdata->sent); 1570 INIT_LIST_HEAD(&hostdata->sent);
1588 hostdata->host = host; 1571 hostdata->host = host;
diff --git a/drivers/scsi/libsas/Kconfig b/drivers/scsi/libsas/Kconfig
index 3a3c1ac9c6cd..c01a40d321d4 100644
--- a/drivers/scsi/libsas/Kconfig
+++ b/drivers/scsi/libsas/Kconfig
@@ -32,7 +32,8 @@ config SCSI_SAS_LIBSAS
32 32
33config SCSI_SAS_ATA 33config SCSI_SAS_ATA
34 bool "ATA support for libsas (requires libata)" 34 bool "ATA support for libsas (requires libata)"
35 depends on SCSI_SAS_LIBSAS && ATA 35 depends on SCSI_SAS_LIBSAS
36 depends on ATA = y || ATA = SCSI_SAS_LIBSAS
36 help 37 help
37 Builds in ATA support into libsas. Will necessitate 38 Builds in ATA support into libsas. Will necessitate
38 the loading of libata along with libsas. 39 the loading of libata along with libsas.
diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h
index f8f64d6485cd..ba3ecab9baf3 100644
--- a/drivers/scsi/lpfc/lpfc.h
+++ b/drivers/scsi/lpfc/lpfc.h
@@ -45,7 +45,7 @@ struct lpfc_sli2_slim;
45#define LPFC_DISC_IOCB_BUFF_COUNT 20 45#define LPFC_DISC_IOCB_BUFF_COUNT 20
46 46
47#define LPFC_HB_MBOX_INTERVAL 5 /* Heart beat interval in seconds. */ 47#define LPFC_HB_MBOX_INTERVAL 5 /* Heart beat interval in seconds. */
48#define LPFC_HB_MBOX_TIMEOUT 30 /* Heart beat timeout in seconds. */ 48#define LPFC_HB_MBOX_TIMEOUT 30 /* Heart beat timeout in seconds. */
49 49
50/* Define macros for 64 bit support */ 50/* Define macros for 64 bit support */
51#define putPaddrLow(addr) ((uint32_t) (0xffffffff & (u64)(addr))) 51#define putPaddrLow(addr) ((uint32_t) (0xffffffff & (u64)(addr)))
@@ -78,6 +78,7 @@ struct lpfc_dma_pool {
78 78
79struct hbq_dmabuf { 79struct hbq_dmabuf {
80 struct lpfc_dmabuf dbuf; 80 struct lpfc_dmabuf dbuf;
81 uint32_t size;
81 uint32_t tag; 82 uint32_t tag;
82}; 83};
83 84
@@ -329,13 +330,30 @@ struct lpfc_vport {
329#define FC_LOADING 0x1 /* HBA in process of loading drvr */ 330#define FC_LOADING 0x1 /* HBA in process of loading drvr */
330#define FC_UNLOADING 0x2 /* HBA in process of unloading drvr */ 331#define FC_UNLOADING 0x2 /* HBA in process of unloading drvr */
331 char *vname; /* Application assigned name */ 332 char *vname; /* Application assigned name */
333
334 /* Vport Config Parameters */
335 uint32_t cfg_scan_down;
336 uint32_t cfg_lun_queue_depth;
337 uint32_t cfg_nodev_tmo;
338 uint32_t cfg_devloss_tmo;
339 uint32_t cfg_restrict_login;
340 uint32_t cfg_peer_port_login;
341 uint32_t cfg_fcp_class;
342 uint32_t cfg_use_adisc;
343 uint32_t cfg_fdmi_on;
344 uint32_t cfg_discovery_threads;
345 uint32_t cfg_log_verbose;
346 uint32_t cfg_max_luns;
347
348 uint32_t dev_loss_tmo_changed;
349
332 struct fc_vport *fc_vport; 350 struct fc_vport *fc_vport;
333 351
334#ifdef CONFIG_LPFC_DEBUG_FS 352#ifdef CONFIG_LPFC_DEBUG_FS
335 struct dentry *debug_disc_trc; 353 struct dentry *debug_disc_trc;
336 struct dentry *debug_nodelist; 354 struct dentry *debug_nodelist;
337 struct dentry *vport_debugfs_root; 355 struct dentry *vport_debugfs_root;
338 struct lpfc_disc_trc *disc_trc; 356 struct lpfc_debugfs_trc *disc_trc;
339 atomic_t disc_trc_cnt; 357 atomic_t disc_trc_cnt;
340#endif 358#endif
341}; 359};
@@ -345,17 +363,25 @@ struct hbq_s {
345 uint32_t next_hbqPutIdx; /* Index to next HBQ slot to use */ 363 uint32_t next_hbqPutIdx; /* Index to next HBQ slot to use */
346 uint32_t hbqPutIdx; /* HBQ slot to use */ 364 uint32_t hbqPutIdx; /* HBQ slot to use */
347 uint32_t local_hbqGetIdx; /* Local copy of Get index from Port */ 365 uint32_t local_hbqGetIdx; /* Local copy of Get index from Port */
366 void *hbq_virt; /* Virtual ptr to this hbq */
367 struct list_head hbq_buffer_list; /* buffers assigned to this HBQ */
368 /* Callback for HBQ buffer allocation */
369 struct hbq_dmabuf *(*hbq_alloc_buffer) (struct lpfc_hba *);
370 /* Callback for HBQ buffer free */
371 void (*hbq_free_buffer) (struct lpfc_hba *,
372 struct hbq_dmabuf *);
348}; 373};
349 374
350#define LPFC_MAX_HBQS 16 375#define LPFC_MAX_HBQS 4
351/* this matches the possition in the lpfc_hbq_defs array */ 376/* this matches the position in the lpfc_hbq_defs array */
352#define LPFC_ELS_HBQ 0 377#define LPFC_ELS_HBQ 0
378#define LPFC_EXTRA_HBQ 1
353 379
354struct lpfc_hba { 380struct lpfc_hba {
355 struct lpfc_sli sli; 381 struct lpfc_sli sli;
356 uint32_t sli_rev; /* SLI2 or SLI3 */ 382 uint32_t sli_rev; /* SLI2 or SLI3 */
357 uint32_t sli3_options; /* Mask of enabled SLI3 options */ 383 uint32_t sli3_options; /* Mask of enabled SLI3 options */
358#define LPFC_SLI3_ENABLED 0x01 384#define LPFC_SLI3_ENABLED 0x01
359#define LPFC_SLI3_HBQ_ENABLED 0x02 385#define LPFC_SLI3_HBQ_ENABLED 0x02
360#define LPFC_SLI3_NPIV_ENABLED 0x04 386#define LPFC_SLI3_NPIV_ENABLED 0x04
361#define LPFC_SLI3_VPORT_TEARDOWN 0x08 387#define LPFC_SLI3_VPORT_TEARDOWN 0x08
@@ -364,7 +390,7 @@ struct lpfc_hba {
364 390
365 enum hba_state link_state; 391 enum hba_state link_state;
366 uint32_t link_flag; /* link state flags */ 392 uint32_t link_flag; /* link state flags */
367#define LS_LOOPBACK_MODE 0x1 /* NPort is in Loopback mode */ 393#define LS_LOOPBACK_MODE 0x1 /* NPort is in Loopback mode */
368 /* This flag is set while issuing */ 394 /* This flag is set while issuing */
369 /* INIT_LINK mailbox command */ 395 /* INIT_LINK mailbox command */
370#define LS_NPIV_FAB_SUPPORTED 0x2 /* Fabric supports NPIV */ 396#define LS_NPIV_FAB_SUPPORTED 0x2 /* Fabric supports NPIV */
@@ -413,28 +439,16 @@ struct lpfc_hba {
413 uint8_t wwpn[8]; 439 uint8_t wwpn[8];
414 uint32_t RandomData[7]; 440 uint32_t RandomData[7];
415 441
416 uint32_t cfg_log_verbose; 442 /* HBA Config Parameters */
417 uint32_t cfg_lun_queue_depth;
418 uint32_t cfg_nodev_tmo;
419 uint32_t cfg_devloss_tmo;
420 uint32_t cfg_hba_queue_depth;
421 uint32_t cfg_peer_port_login;
422 uint32_t cfg_vport_restrict_login;
423 uint32_t cfg_npiv_enable;
424 uint32_t cfg_fcp_class;
425 uint32_t cfg_use_adisc;
426 uint32_t cfg_ack0; 443 uint32_t cfg_ack0;
444 uint32_t cfg_enable_npiv;
427 uint32_t cfg_topology; 445 uint32_t cfg_topology;
428 uint32_t cfg_scan_down;
429 uint32_t cfg_link_speed; 446 uint32_t cfg_link_speed;
430 uint32_t cfg_cr_delay; 447 uint32_t cfg_cr_delay;
431 uint32_t cfg_cr_count; 448 uint32_t cfg_cr_count;
432 uint32_t cfg_multi_ring_support; 449 uint32_t cfg_multi_ring_support;
433 uint32_t cfg_multi_ring_rctl; 450 uint32_t cfg_multi_ring_rctl;
434 uint32_t cfg_multi_ring_type; 451 uint32_t cfg_multi_ring_type;
435 uint32_t cfg_fdmi_on;
436 uint32_t cfg_discovery_threads;
437 uint32_t cfg_max_luns;
438 uint32_t cfg_poll; 452 uint32_t cfg_poll;
439 uint32_t cfg_poll_tmo; 453 uint32_t cfg_poll_tmo;
440 uint32_t cfg_use_msi; 454 uint32_t cfg_use_msi;
@@ -442,8 +456,8 @@ struct lpfc_hba {
442 uint32_t cfg_sg_dma_buf_size; 456 uint32_t cfg_sg_dma_buf_size;
443 uint64_t cfg_soft_wwnn; 457 uint64_t cfg_soft_wwnn;
444 uint64_t cfg_soft_wwpn; 458 uint64_t cfg_soft_wwpn;
459 uint32_t cfg_hba_queue_depth;
445 460
446 uint32_t dev_loss_tmo_changed;
447 461
448 lpfc_vpd_t vpd; /* vital product data */ 462 lpfc_vpd_t vpd; /* vital product data */
449 463
@@ -457,7 +471,6 @@ struct lpfc_hba {
457 wait_queue_head_t *work_wait; 471 wait_queue_head_t *work_wait;
458 struct task_struct *worker_thread; 472 struct task_struct *worker_thread;
459 473
460 struct list_head hbq_buffer_list;
461 uint32_t hbq_count; /* Count of configured HBQs */ 474 uint32_t hbq_count; /* Count of configured HBQs */
462 struct hbq_s hbqs[LPFC_MAX_HBQS]; /* local copy of hbq indicies */ 475 struct hbq_s hbqs[LPFC_MAX_HBQS]; /* local copy of hbq indicies */
463 476
@@ -526,12 +539,14 @@ struct lpfc_hba {
526 mempool_t *nlp_mem_pool; 539 mempool_t *nlp_mem_pool;
527 540
528 struct fc_host_statistics link_stats; 541 struct fc_host_statistics link_stats;
542 uint8_t using_msi;
529 543
530 struct list_head port_list; 544 struct list_head port_list;
531 struct lpfc_vport *pport; /* physical lpfc_vport pointer */ 545 struct lpfc_vport *pport; /* physical lpfc_vport pointer */
532 uint16_t max_vpi; /* Maximum virtual nports */ 546 uint16_t max_vpi; /* Maximum virtual nports */
533#define LPFC_MAX_VPI 100 /* Max number of VPorts supported */ 547#define LPFC_MAX_VPI 100 /* Max number of VPI supported */
534 unsigned long *vpi_bmask; /* vpi allocation table */ 548#define LPFC_MAX_VPORTS (LPFC_MAX_VPI+1)/* Max number of VPorts supported */
549 unsigned long *vpi_bmask; /* vpi allocation table */
535 550
536 /* Data structure used by fabric iocb scheduler */ 551 /* Data structure used by fabric iocb scheduler */
537 struct list_head fabric_iocb_list; 552 struct list_head fabric_iocb_list;
@@ -547,6 +562,11 @@ struct lpfc_hba {
547#ifdef CONFIG_LPFC_DEBUG_FS 562#ifdef CONFIG_LPFC_DEBUG_FS
548 struct dentry *hba_debugfs_root; 563 struct dentry *hba_debugfs_root;
549 atomic_t debugfs_vport_count; 564 atomic_t debugfs_vport_count;
565 struct dentry *debug_hbqinfo;
566 struct dentry *debug_dumpslim;
567 struct dentry *debug_slow_ring_trc;
568 struct lpfc_debugfs_trc *slow_ring_trc;
569 atomic_t slow_ring_trc_cnt;
550#endif 570#endif
551 571
552 /* Fields used for heart beat. */ 572 /* Fields used for heart beat. */
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index 860a52c090f4..80a11218b9bb 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -68,12 +68,6 @@ lpfc_drvr_version_show(struct class_device *cdev, char *buf)
68} 68}
69 69
70static ssize_t 70static ssize_t
71management_version_show(struct class_device *cdev, char *buf)
72{
73 return snprintf(buf, PAGE_SIZE, DFC_API_VERSION "\n");
74}
75
76static ssize_t
77lpfc_info_show(struct class_device *cdev, char *buf) 71lpfc_info_show(struct class_device *cdev, char *buf)
78{ 72{
79 struct Scsi_Host *host = class_to_shost(cdev); 73 struct Scsi_Host *host = class_to_shost(cdev);
@@ -319,9 +313,8 @@ lpfc_do_offline(struct lpfc_hba *phba, uint32_t type)
319 if (cnt++ > 3000) { 313 if (cnt++ > 3000) {
320 lpfc_printf_log(phba, 314 lpfc_printf_log(phba,
321 KERN_WARNING, LOG_INIT, 315 KERN_WARNING, LOG_INIT,
322 "%d:0466 Outstanding IO when " 316 "0466 Outstanding IO when "
323 "bringing Adapter offline\n", 317 "bringing Adapter offline\n");
324 phba->brd_no);
325 break; 318 break;
326 } 319 }
327 } 320 }
@@ -437,7 +430,7 @@ lpfc_board_mode_store(struct class_device *cdev, const char *buf, size_t count)
437 return -EIO; 430 return -EIO;
438} 431}
439 432
440int 433static int
441lpfc_get_hba_info(struct lpfc_hba *phba, 434lpfc_get_hba_info(struct lpfc_hba *phba,
442 uint32_t *mxri, uint32_t *axri, 435 uint32_t *mxri, uint32_t *axri,
443 uint32_t *mrpi, uint32_t *arpi, 436 uint32_t *mrpi, uint32_t *arpi,
@@ -694,9 +687,8 @@ lpfc_##attr##_init(struct lpfc_hba *phba, int val) \
694 return 0;\ 687 return 0;\
695 }\ 688 }\
696 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, \ 689 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, \
697 "%d:0449 lpfc_"#attr" attribute cannot be set to %d, "\ 690 "0449 lpfc_"#attr" attribute cannot be set to %d, "\
698 "allowed range is ["#minval", "#maxval"]\n", \ 691 "allowed range is ["#minval", "#maxval"]\n", val); \
699 phba->brd_no, val); \
700 phba->cfg_##attr = default;\ 692 phba->cfg_##attr = default;\
701 return -EINVAL;\ 693 return -EINVAL;\
702} 694}
@@ -710,9 +702,8 @@ lpfc_##attr##_set(struct lpfc_hba *phba, int val) \
710 return 0;\ 702 return 0;\
711 }\ 703 }\
712 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, \ 704 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, \
713 "%d:0450 lpfc_"#attr" attribute cannot be set to %d, "\ 705 "0450 lpfc_"#attr" attribute cannot be set to %d, "\
714 "allowed range is ["#minval", "#maxval"]\n", \ 706 "allowed range is ["#minval", "#maxval"]\n", val); \
715 phba->brd_no, val); \
716 return -EINVAL;\ 707 return -EINVAL;\
717} 708}
718 709
@@ -734,6 +725,75 @@ lpfc_##attr##_store(struct class_device *cdev, const char *buf, size_t count) \
734 return -EINVAL;\ 725 return -EINVAL;\
735} 726}
736 727
728#define lpfc_vport_param_show(attr) \
729static ssize_t \
730lpfc_##attr##_show(struct class_device *cdev, char *buf) \
731{ \
732 struct Scsi_Host *shost = class_to_shost(cdev);\
733 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\
734 int val = 0;\
735 val = vport->cfg_##attr;\
736 return snprintf(buf, PAGE_SIZE, "%d\n", vport->cfg_##attr);\
737}
738
739#define lpfc_vport_param_hex_show(attr) \
740static ssize_t \
741lpfc_##attr##_show(struct class_device *cdev, char *buf) \
742{ \
743 struct Scsi_Host *shost = class_to_shost(cdev);\
744 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\
745 int val = 0;\
746 val = vport->cfg_##attr;\
747 return snprintf(buf, PAGE_SIZE, "%#x\n", vport->cfg_##attr);\
748}
749
750#define lpfc_vport_param_init(attr, default, minval, maxval) \
751static int \
752lpfc_##attr##_init(struct lpfc_vport *vport, int val) \
753{ \
754 if (val >= minval && val <= maxval) {\
755 vport->cfg_##attr = val;\
756 return 0;\
757 }\
758 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, \
759 "0449 lpfc_"#attr" attribute cannot be set to %d, "\
760 "allowed range is ["#minval", "#maxval"]\n", val); \
761 vport->cfg_##attr = default;\
762 return -EINVAL;\
763}
764
765#define lpfc_vport_param_set(attr, default, minval, maxval) \
766static int \
767lpfc_##attr##_set(struct lpfc_vport *vport, int val) \
768{ \
769 if (val >= minval && val <= maxval) {\
770 vport->cfg_##attr = val;\
771 return 0;\
772 }\
773 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, \
774 "0450 lpfc_"#attr" attribute cannot be set to %d, "\
775 "allowed range is ["#minval", "#maxval"]\n", val); \
776 return -EINVAL;\
777}
778
779#define lpfc_vport_param_store(attr) \
780static ssize_t \
781lpfc_##attr##_store(struct class_device *cdev, const char *buf, size_t count) \
782{ \
783 struct Scsi_Host *shost = class_to_shost(cdev);\
784 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\
785 int val=0;\
786 if (!isdigit(buf[0]))\
787 return -EINVAL;\
788 if (sscanf(buf, "%i", &val) != 1)\
789 return -EINVAL;\
790 if (lpfc_##attr##_set(vport, val) == 0) \
791 return strlen(buf);\
792 else \
793 return -EINVAL;\
794}
795
796
737#define LPFC_ATTR(name, defval, minval, maxval, desc) \ 797#define LPFC_ATTR(name, defval, minval, maxval, desc) \
738static int lpfc_##name = defval;\ 798static int lpfc_##name = defval;\
739module_param(lpfc_##name, int, 0);\ 799module_param(lpfc_##name, int, 0);\
@@ -778,6 +838,50 @@ lpfc_param_store(name)\
778static CLASS_DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\ 838static CLASS_DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
779 lpfc_##name##_show, lpfc_##name##_store) 839 lpfc_##name##_show, lpfc_##name##_store)
780 840
841#define LPFC_VPORT_ATTR(name, defval, minval, maxval, desc) \
842static int lpfc_##name = defval;\
843module_param(lpfc_##name, int, 0);\
844MODULE_PARM_DESC(lpfc_##name, desc);\
845lpfc_vport_param_init(name, defval, minval, maxval)
846
847#define LPFC_VPORT_ATTR_R(name, defval, minval, maxval, desc) \
848static int lpfc_##name = defval;\
849module_param(lpfc_##name, int, 0);\
850MODULE_PARM_DESC(lpfc_##name, desc);\
851lpfc_vport_param_show(name)\
852lpfc_vport_param_init(name, defval, minval, maxval)\
853static CLASS_DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL)
854
855#define LPFC_VPORT_ATTR_RW(name, defval, minval, maxval, desc) \
856static int lpfc_##name = defval;\
857module_param(lpfc_##name, int, 0);\
858MODULE_PARM_DESC(lpfc_##name, desc);\
859lpfc_vport_param_show(name)\
860lpfc_vport_param_init(name, defval, minval, maxval)\
861lpfc_vport_param_set(name, defval, minval, maxval)\
862lpfc_vport_param_store(name)\
863static CLASS_DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
864 lpfc_##name##_show, lpfc_##name##_store)
865
866#define LPFC_VPORT_ATTR_HEX_R(name, defval, minval, maxval, desc) \
867static int lpfc_##name = defval;\
868module_param(lpfc_##name, int, 0);\
869MODULE_PARM_DESC(lpfc_##name, desc);\
870lpfc_vport_param_hex_show(name)\
871lpfc_vport_param_init(name, defval, minval, maxval)\
872static CLASS_DEVICE_ATTR(lpfc_##name, S_IRUGO , lpfc_##name##_show, NULL)
873
874#define LPFC_VPORT_ATTR_HEX_RW(name, defval, minval, maxval, desc) \
875static int lpfc_##name = defval;\
876module_param(lpfc_##name, int, 0);\
877MODULE_PARM_DESC(lpfc_##name, desc);\
878lpfc_vport_param_hex_show(name)\
879lpfc_vport_param_init(name, defval, minval, maxval)\
880lpfc_vport_param_set(name, defval, minval, maxval)\
881lpfc_vport_param_store(name)\
882static CLASS_DEVICE_ATTR(lpfc_##name, S_IRUGO | S_IWUSR,\
883 lpfc_##name##_show, lpfc_##name##_store)
884
781static CLASS_DEVICE_ATTR(info, S_IRUGO, lpfc_info_show, NULL); 885static CLASS_DEVICE_ATTR(info, S_IRUGO, lpfc_info_show, NULL);
782static CLASS_DEVICE_ATTR(serialnum, S_IRUGO, lpfc_serialnum_show, NULL); 886static CLASS_DEVICE_ATTR(serialnum, S_IRUGO, lpfc_serialnum_show, NULL);
783static CLASS_DEVICE_ATTR(modeldesc, S_IRUGO, lpfc_modeldesc_show, NULL); 887static CLASS_DEVICE_ATTR(modeldesc, S_IRUGO, lpfc_modeldesc_show, NULL);
@@ -794,8 +898,6 @@ static CLASS_DEVICE_ATTR(num_discovered_ports, S_IRUGO,
794static CLASS_DEVICE_ATTR(nport_evt_cnt, S_IRUGO, lpfc_nport_evt_cnt_show, NULL); 898static CLASS_DEVICE_ATTR(nport_evt_cnt, S_IRUGO, lpfc_nport_evt_cnt_show, NULL);
795static CLASS_DEVICE_ATTR(lpfc_drvr_version, S_IRUGO, lpfc_drvr_version_show, 899static CLASS_DEVICE_ATTR(lpfc_drvr_version, S_IRUGO, lpfc_drvr_version_show,
796 NULL); 900 NULL);
797static CLASS_DEVICE_ATTR(management_version, S_IRUGO, management_version_show,
798 NULL);
799static CLASS_DEVICE_ATTR(board_mode, S_IRUGO | S_IWUSR, 901static CLASS_DEVICE_ATTR(board_mode, S_IRUGO | S_IWUSR,
800 lpfc_board_mode_show, lpfc_board_mode_store); 902 lpfc_board_mode_show, lpfc_board_mode_store);
801static CLASS_DEVICE_ATTR(issue_reset, S_IWUSR, NULL, lpfc_issue_reset); 903static CLASS_DEVICE_ATTR(issue_reset, S_IWUSR, NULL, lpfc_issue_reset);
@@ -908,17 +1010,15 @@ lpfc_soft_wwpn_store(struct class_device *cdev, const char *buf, size_t count)
908 stat1 = lpfc_do_offline(phba, LPFC_EVT_OFFLINE); 1010 stat1 = lpfc_do_offline(phba, LPFC_EVT_OFFLINE);
909 if (stat1) 1011 if (stat1)
910 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 1012 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
911 "%d:0463 lpfc_soft_wwpn attribute set failed to reinit " 1013 "0463 lpfc_soft_wwpn attribute set failed to "
912 "adapter - %d\n", phba->brd_no, stat1); 1014 "reinit adapter - %d\n", stat1);
913
914 init_completion(&online_compl); 1015 init_completion(&online_compl);
915 lpfc_workq_post_event(phba, &stat2, &online_compl, LPFC_EVT_ONLINE); 1016 lpfc_workq_post_event(phba, &stat2, &online_compl, LPFC_EVT_ONLINE);
916 wait_for_completion(&online_compl); 1017 wait_for_completion(&online_compl);
917 if (stat2) 1018 if (stat2)
918 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 1019 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
919 "%d:0464 lpfc_soft_wwpn attribute set failed to reinit " 1020 "0464 lpfc_soft_wwpn attribute set failed to "
920 "adapter - %d\n", phba->brd_no, stat2); 1021 "reinit adapter - %d\n", stat2);
921
922 return (stat1 || stat2) ? -EIO : count; 1022 return (stat1 || stat2) ? -EIO : count;
923} 1023}
924static CLASS_DEVICE_ATTR(lpfc_soft_wwpn, S_IRUGO | S_IWUSR,\ 1024static CLASS_DEVICE_ATTR(lpfc_soft_wwpn, S_IRUGO | S_IWUSR,\
@@ -927,8 +1027,8 @@ static CLASS_DEVICE_ATTR(lpfc_soft_wwpn, S_IRUGO | S_IWUSR,\
927static ssize_t 1027static ssize_t
928lpfc_soft_wwnn_show(struct class_device *cdev, char *buf) 1028lpfc_soft_wwnn_show(struct class_device *cdev, char *buf)
929{ 1029{
930 struct Scsi_Host *host = class_to_shost(cdev); 1030 struct Scsi_Host *shost = class_to_shost(cdev);
931 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata; 1031 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba;
932 return snprintf(buf, PAGE_SIZE, "0x%llx\n", 1032 return snprintf(buf, PAGE_SIZE, "0x%llx\n",
933 (unsigned long long)phba->cfg_soft_wwnn); 1033 (unsigned long long)phba->cfg_soft_wwnn);
934} 1034}
@@ -937,8 +1037,8 @@ lpfc_soft_wwnn_show(struct class_device *cdev, char *buf)
937static ssize_t 1037static ssize_t
938lpfc_soft_wwnn_store(struct class_device *cdev, const char *buf, size_t count) 1038lpfc_soft_wwnn_store(struct class_device *cdev, const char *buf, size_t count)
939{ 1039{
940 struct Scsi_Host *host = class_to_shost(cdev); 1040 struct Scsi_Host *shost = class_to_shost(cdev);
941 struct lpfc_hba *phba = (struct lpfc_hba*)host->hostdata; 1041 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba;
942 unsigned int i, j, cnt=count; 1042 unsigned int i, j, cnt=count;
943 u8 wwnn[8]; 1043 u8 wwnn[8];
944 1044
@@ -1002,7 +1102,7 @@ MODULE_PARM_DESC(lpfc_sli_mode, "SLI mode selector:"
1002 " 2 - select SLI-2 even on SLI-3 capable HBAs," 1102 " 2 - select SLI-2 even on SLI-3 capable HBAs,"
1003 " 3 - select SLI-3"); 1103 " 3 - select SLI-3");
1004 1104
1005LPFC_ATTR_R(npiv_enable, 0, 0, 1, "Enable NPIV functionality"); 1105LPFC_ATTR_R(enable_npiv, 0, 0, 1, "Enable NPIV functionality");
1006 1106
1007/* 1107/*
1008# lpfc_nodev_tmo: If set, it will hold all I/O errors on devices that disappear 1108# lpfc_nodev_tmo: If set, it will hold all I/O errors on devices that disappear
@@ -1019,90 +1119,75 @@ lpfc_nodev_tmo_show(struct class_device *cdev, char *buf)
1019{ 1119{
1020 struct Scsi_Host *shost = class_to_shost(cdev); 1120 struct Scsi_Host *shost = class_to_shost(cdev);
1021 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; 1121 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
1022 struct lpfc_hba *phba = vport->phba;
1023 int val = 0; 1122 int val = 0;
1024 val = phba->cfg_devloss_tmo; 1123 val = vport->cfg_devloss_tmo;
1025 return snprintf(buf, PAGE_SIZE, "%d\n", 1124 return snprintf(buf, PAGE_SIZE, "%d\n", vport->cfg_devloss_tmo);
1026 phba->cfg_devloss_tmo);
1027} 1125}
1028 1126
1029static int 1127static int
1030lpfc_nodev_tmo_init(struct lpfc_hba *phba, int val) 1128lpfc_nodev_tmo_init(struct lpfc_vport *vport, int val)
1031{ 1129{
1032 static int warned; 1130 if (vport->cfg_devloss_tmo != LPFC_DEF_DEVLOSS_TMO) {
1033 if (phba->cfg_devloss_tmo != LPFC_DEF_DEVLOSS_TMO) { 1131 vport->cfg_nodev_tmo = vport->cfg_devloss_tmo;
1034 phba->cfg_nodev_tmo = phba->cfg_devloss_tmo; 1132 if (val != LPFC_DEF_DEVLOSS_TMO)
1035 if (!warned && val != LPFC_DEF_DEVLOSS_TMO) { 1133 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
1036 warned = 1; 1134 "0402 Ignoring nodev_tmo module "
1037 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 1135 "parameter because devloss_tmo is "
1038 "%d:0402 Ignoring nodev_tmo module " 1136 "set.\n");
1039 "parameter because devloss_tmo is"
1040 " set.\n",
1041 phba->brd_no);
1042 }
1043 return 0; 1137 return 0;
1044 } 1138 }
1045 1139
1046 if (val >= LPFC_MIN_DEVLOSS_TMO && val <= LPFC_MAX_DEVLOSS_TMO) { 1140 if (val >= LPFC_MIN_DEVLOSS_TMO && val <= LPFC_MAX_DEVLOSS_TMO) {
1047 phba->cfg_nodev_tmo = val; 1141 vport->cfg_nodev_tmo = val;
1048 phba->cfg_devloss_tmo = val; 1142 vport->cfg_devloss_tmo = val;
1049 return 0; 1143 return 0;
1050 } 1144 }
1051 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 1145 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
1052 "%d:0400 lpfc_nodev_tmo attribute cannot be set to %d, " 1146 "0400 lpfc_nodev_tmo attribute cannot be set to"
1053 "allowed range is [%d, %d]\n", 1147 " %d, allowed range is [%d, %d]\n",
1054 phba->brd_no, val, 1148 val, LPFC_MIN_DEVLOSS_TMO, LPFC_MAX_DEVLOSS_TMO);
1055 LPFC_MIN_DEVLOSS_TMO, LPFC_MAX_DEVLOSS_TMO); 1149 vport->cfg_nodev_tmo = LPFC_DEF_DEVLOSS_TMO;
1056 phba->cfg_nodev_tmo = LPFC_DEF_DEVLOSS_TMO;
1057 return -EINVAL; 1150 return -EINVAL;
1058} 1151}
1059 1152
1060static void 1153static void
1061lpfc_update_rport_devloss_tmo(struct lpfc_hba *phba) 1154lpfc_update_rport_devloss_tmo(struct lpfc_vport *vport)
1062{ 1155{
1063 struct lpfc_vport *vport;
1064 struct Scsi_Host *shost; 1156 struct Scsi_Host *shost;
1065 struct lpfc_nodelist *ndlp; 1157 struct lpfc_nodelist *ndlp;
1066 1158
1067 list_for_each_entry(vport, &phba->port_list, listentry) { 1159 shost = lpfc_shost_from_vport(vport);
1068 shost = lpfc_shost_from_vport(vport); 1160 spin_lock_irq(shost->host_lock);
1069 spin_lock_irq(shost->host_lock); 1161 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp)
1070 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) 1162 if (ndlp->rport)
1071 if (ndlp->rport) 1163 ndlp->rport->dev_loss_tmo = vport->cfg_devloss_tmo;
1072 ndlp->rport->dev_loss_tmo = 1164 spin_unlock_irq(shost->host_lock);
1073 phba->cfg_devloss_tmo;
1074 spin_unlock_irq(shost->host_lock);
1075 }
1076} 1165}
1077 1166
1078static int 1167static int
1079lpfc_nodev_tmo_set(struct lpfc_hba *phba, int val) 1168lpfc_nodev_tmo_set(struct lpfc_vport *vport, int val)
1080{ 1169{
1081 if (phba->dev_loss_tmo_changed || 1170 if (vport->dev_loss_tmo_changed ||
1082 (lpfc_devloss_tmo != LPFC_DEF_DEVLOSS_TMO)) { 1171 (lpfc_devloss_tmo != LPFC_DEF_DEVLOSS_TMO)) {
1083 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 1172 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
1084 "%d:0401 Ignoring change to nodev_tmo " 1173 "0401 Ignoring change to nodev_tmo "
1085 "because devloss_tmo is set.\n", 1174 "because devloss_tmo is set.\n");
1086 phba->brd_no);
1087 return 0; 1175 return 0;
1088 } 1176 }
1089
1090 if (val >= LPFC_MIN_DEVLOSS_TMO && val <= LPFC_MAX_DEVLOSS_TMO) { 1177 if (val >= LPFC_MIN_DEVLOSS_TMO && val <= LPFC_MAX_DEVLOSS_TMO) {
1091 phba->cfg_nodev_tmo = val; 1178 vport->cfg_nodev_tmo = val;
1092 phba->cfg_devloss_tmo = val; 1179 vport->cfg_devloss_tmo = val;
1093 lpfc_update_rport_devloss_tmo(phba); 1180 lpfc_update_rport_devloss_tmo(vport);
1094 return 0; 1181 return 0;
1095 } 1182 }
1096 1183 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
1097 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 1184 "0403 lpfc_nodev_tmo attribute cannot be set to"
1098 "%d:0403 lpfc_nodev_tmo attribute cannot be set to %d, " 1185 "%d, allowed range is [%d, %d]\n",
1099 "allowed range is [%d, %d]\n", 1186 val, LPFC_MIN_DEVLOSS_TMO, LPFC_MAX_DEVLOSS_TMO);
1100 phba->brd_no, val, LPFC_MIN_DEVLOSS_TMO,
1101 LPFC_MAX_DEVLOSS_TMO);
1102 return -EINVAL; 1187 return -EINVAL;
1103} 1188}
1104 1189
1105lpfc_param_store(nodev_tmo) 1190lpfc_vport_param_store(nodev_tmo)
1106 1191
1107static CLASS_DEVICE_ATTR(lpfc_nodev_tmo, S_IRUGO | S_IWUSR, 1192static CLASS_DEVICE_ATTR(lpfc_nodev_tmo, S_IRUGO | S_IWUSR,
1108 lpfc_nodev_tmo_show, lpfc_nodev_tmo_store); 1193 lpfc_nodev_tmo_show, lpfc_nodev_tmo_store);
@@ -1116,29 +1201,28 @@ module_param(lpfc_devloss_tmo, int, 0);
1116MODULE_PARM_DESC(lpfc_devloss_tmo, 1201MODULE_PARM_DESC(lpfc_devloss_tmo,
1117 "Seconds driver will hold I/O waiting " 1202 "Seconds driver will hold I/O waiting "
1118 "for a device to come back"); 1203 "for a device to come back");
1119lpfc_param_init(devloss_tmo, LPFC_DEF_DEVLOSS_TMO, 1204lpfc_vport_param_init(devloss_tmo, LPFC_DEF_DEVLOSS_TMO,
1120 LPFC_MIN_DEVLOSS_TMO, LPFC_MAX_DEVLOSS_TMO) 1205 LPFC_MIN_DEVLOSS_TMO, LPFC_MAX_DEVLOSS_TMO)
1121lpfc_param_show(devloss_tmo) 1206lpfc_vport_param_show(devloss_tmo)
1122static int 1207static int
1123lpfc_devloss_tmo_set(struct lpfc_hba *phba, int val) 1208lpfc_devloss_tmo_set(struct lpfc_vport *vport, int val)
1124{ 1209{
1125 if (val >= LPFC_MIN_DEVLOSS_TMO && val <= LPFC_MAX_DEVLOSS_TMO) { 1210 if (val >= LPFC_MIN_DEVLOSS_TMO && val <= LPFC_MAX_DEVLOSS_TMO) {
1126 phba->cfg_nodev_tmo = val; 1211 vport->cfg_nodev_tmo = val;
1127 phba->cfg_devloss_tmo = val; 1212 vport->cfg_devloss_tmo = val;
1128 phba->dev_loss_tmo_changed = 1; 1213 vport->dev_loss_tmo_changed = 1;
1129 lpfc_update_rport_devloss_tmo(phba); 1214 lpfc_update_rport_devloss_tmo(vport);
1130 return 0; 1215 return 0;
1131 } 1216 }
1132 1217
1133 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 1218 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
1134 "%d:0404 lpfc_devloss_tmo attribute cannot be set to" 1219 "0404 lpfc_devloss_tmo attribute cannot be set to"
1135 " %d, allowed range is [%d, %d]\n", 1220 " %d, allowed range is [%d, %d]\n",
1136 phba->brd_no, val, LPFC_MIN_DEVLOSS_TMO, 1221 val, LPFC_MIN_DEVLOSS_TMO, LPFC_MAX_DEVLOSS_TMO);
1137 LPFC_MAX_DEVLOSS_TMO);
1138 return -EINVAL; 1222 return -EINVAL;
1139} 1223}
1140 1224
1141lpfc_param_store(devloss_tmo) 1225lpfc_vport_param_store(devloss_tmo)
1142static CLASS_DEVICE_ATTR(lpfc_devloss_tmo, S_IRUGO | S_IWUSR, 1226static CLASS_DEVICE_ATTR(lpfc_devloss_tmo, S_IRUGO | S_IWUSR,
1143 lpfc_devloss_tmo_show, lpfc_devloss_tmo_store); 1227 lpfc_devloss_tmo_show, lpfc_devloss_tmo_store);
1144 1228
@@ -1160,14 +1244,15 @@ static CLASS_DEVICE_ATTR(lpfc_devloss_tmo, S_IRUGO | S_IWUSR,
1160# LOG_LIBDFC 0x2000 LIBDFC events 1244# LOG_LIBDFC 0x2000 LIBDFC events
1161# LOG_ALL_MSG 0xffff LOG all messages 1245# LOG_ALL_MSG 0xffff LOG all messages
1162*/ 1246*/
1163LPFC_ATTR_HEX_RW(log_verbose, 0x0, 0x0, 0xffff, "Verbose logging bit-mask"); 1247LPFC_VPORT_ATTR_HEX_RW(log_verbose, 0x0, 0x0, 0xffff,
1248 "Verbose logging bit-mask");
1164 1249
1165/* 1250/*
1166# lun_queue_depth: This parameter is used to limit the number of outstanding 1251# lun_queue_depth: This parameter is used to limit the number of outstanding
1167# commands per FCP LUN. Value range is [1,128]. Default value is 30. 1252# commands per FCP LUN. Value range is [1,128]. Default value is 30.
1168*/ 1253*/
1169LPFC_ATTR_R(lun_queue_depth, 30, 1, 128, 1254LPFC_VPORT_ATTR_R(lun_queue_depth, 30, 1, 128,
1170 "Max number of FCP commands we can queue to a specific LUN"); 1255 "Max number of FCP commands we can queue to a specific LUN");
1171 1256
1172/* 1257/*
1173# hba_queue_depth: This parameter is used to limit the number of outstanding 1258# hba_queue_depth: This parameter is used to limit the number of outstanding
@@ -1188,12 +1273,12 @@ LPFC_ATTR_R(hba_queue_depth, 8192, 32, 8192,
1188# are allowed to login to each other. 1273# are allowed to login to each other.
1189# Default value of this parameter is 0. 1274# Default value of this parameter is 0.
1190*/ 1275*/
1191LPFC_ATTR_R(peer_port_login, 0, 0, 1, 1276LPFC_VPORT_ATTR_R(peer_port_login, 0, 0, 1,
1192 "Allow peer ports on the same physical port to login to each " 1277 "Allow peer ports on the same physical port to login to each "
1193 "other."); 1278 "other.");
1194 1279
1195/* 1280/*
1196# vport_restrict_login: This parameter allows/prevents logins 1281# restrict_login: This parameter allows/prevents logins
1197# between Virtual Ports and remote initiators. 1282# between Virtual Ports and remote initiators.
1198# When this parameter is not set (0) Virtual Ports will accept PLOGIs from 1283# When this parameter is not set (0) Virtual Ports will accept PLOGIs from
1199# other initiators and will attempt to PLOGI all remote ports. 1284# other initiators and will attempt to PLOGI all remote ports.
@@ -1203,8 +1288,55 @@ LPFC_ATTR_R(peer_port_login, 0, 0, 1,
1203# This parameter does not restrict logins to Fabric resident remote ports. 1288# This parameter does not restrict logins to Fabric resident remote ports.
1204# Default value of this parameter is 1. 1289# Default value of this parameter is 1.
1205*/ 1290*/
1206LPFC_ATTR_RW(vport_restrict_login, 1, 0, 1, 1291static int lpfc_restrict_login = 1;
1207 "Restrict virtual ports login to remote initiators."); 1292module_param(lpfc_restrict_login, int, 0);
1293MODULE_PARM_DESC(lpfc_restrict_login,
1294 "Restrict virtual ports login to remote initiators.");
1295lpfc_vport_param_show(restrict_login);
1296
1297static int
1298lpfc_restrict_login_init(struct lpfc_vport *vport, int val)
1299{
1300 if (val < 0 || val > 1) {
1301 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
1302 "0449 lpfc_restrict_login attribute cannot "
1303 "be set to %d, allowed range is [0, 1]\n",
1304 val);
1305 vport->cfg_restrict_login = 1;
1306 return -EINVAL;
1307 }
1308 if (vport->port_type == LPFC_PHYSICAL_PORT) {
1309 vport->cfg_restrict_login = 0;
1310 return 0;
1311 }
1312 vport->cfg_restrict_login = val;
1313 return 0;
1314}
1315
1316static int
1317lpfc_restrict_login_set(struct lpfc_vport *vport, int val)
1318{
1319 if (val < 0 || val > 1) {
1320 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
1321 "0450 lpfc_restrict_login attribute cannot "
1322 "be set to %d, allowed range is [0, 1]\n",
1323 val);
1324 vport->cfg_restrict_login = 1;
1325 return -EINVAL;
1326 }
1327 if (vport->port_type == LPFC_PHYSICAL_PORT && val != 0) {
1328 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
1329 "0468 lpfc_restrict_login must be 0 for "
1330 "Physical ports.\n");
1331 vport->cfg_restrict_login = 0;
1332 return 0;
1333 }
1334 vport->cfg_restrict_login = val;
1335 return 0;
1336}
1337lpfc_vport_param_store(restrict_login);
1338static CLASS_DEVICE_ATTR(lpfc_restrict_login, S_IRUGO | S_IWUSR,
1339 lpfc_restrict_login_show, lpfc_restrict_login_store);
1208 1340
1209/* 1341/*
1210# Some disk devices have a "select ID" or "select Target" capability. 1342# Some disk devices have a "select ID" or "select Target" capability.
@@ -1223,8 +1355,8 @@ LPFC_ATTR_RW(vport_restrict_login, 1, 0, 1,
1223# and will not work across a fabric. Also this parameter will take 1355# and will not work across a fabric. Also this parameter will take
1224# effect only in the case when ALPA map is not available.) 1356# effect only in the case when ALPA map is not available.)
1225*/ 1357*/
1226LPFC_ATTR_R(scan_down, 1, 0, 1, 1358LPFC_VPORT_ATTR_R(scan_down, 1, 0, 1,
1227 "Start scanning for devices from highest ALPA to lowest"); 1359 "Start scanning for devices from highest ALPA to lowest");
1228 1360
1229/* 1361/*
1230# lpfc_topology: link topology for init link 1362# lpfc_topology: link topology for init link
@@ -1255,15 +1387,15 @@ LPFC_ATTR_R(link_speed, 0, 0, 8, "Select link speed");
1255# lpfc_fcp_class: Determines FC class to use for the FCP protocol. 1387# lpfc_fcp_class: Determines FC class to use for the FCP protocol.
1256# Value range is [2,3]. Default value is 3. 1388# Value range is [2,3]. Default value is 3.
1257*/ 1389*/
1258LPFC_ATTR_R(fcp_class, 3, 2, 3, 1390LPFC_VPORT_ATTR_R(fcp_class, 3, 2, 3,
1259 "Select Fibre Channel class of service for FCP sequences"); 1391 "Select Fibre Channel class of service for FCP sequences");
1260 1392
1261/* 1393/*
1262# lpfc_use_adisc: Use ADISC for FCP rediscovery instead of PLOGI. Value range 1394# lpfc_use_adisc: Use ADISC for FCP rediscovery instead of PLOGI. Value range
1263# is [0,1]. Default value is 0. 1395# is [0,1]. Default value is 0.
1264*/ 1396*/
1265LPFC_ATTR_RW(use_adisc, 0, 0, 1, 1397LPFC_VPORT_ATTR_RW(use_adisc, 0, 0, 1,
1266 "Use ADISC on rediscovery to authenticate FCP devices"); 1398 "Use ADISC on rediscovery to authenticate FCP devices");
1267 1399
1268/* 1400/*
1269# lpfc_ack0: Use ACK0, instead of ACK1 for class 2 acknowledgement. Value 1401# lpfc_ack0: Use ACK0, instead of ACK1 for class 2 acknowledgement. Value
@@ -1315,13 +1447,13 @@ LPFC_ATTR_R(multi_ring_type, FC_LLC_SNAP, 1,
1315# 2 = support FDMI with attribute of hostname 1447# 2 = support FDMI with attribute of hostname
1316# Value range [0,2]. Default value is 0. 1448# Value range [0,2]. Default value is 0.
1317*/ 1449*/
1318LPFC_ATTR_RW(fdmi_on, 0, 0, 2, "Enable FDMI support"); 1450LPFC_VPORT_ATTR_RW(fdmi_on, 0, 0, 2, "Enable FDMI support");
1319 1451
1320/* 1452/*
1321# Specifies the maximum number of ELS cmds we can have outstanding (for 1453# Specifies the maximum number of ELS cmds we can have outstanding (for
1322# discovery). Value range is [1,64]. Default value = 32. 1454# discovery). Value range is [1,64]. Default value = 32.
1323*/ 1455*/
1324LPFC_ATTR(discovery_threads, 32, 1, 64, "Maximum number of ELS commands " 1456LPFC_VPORT_ATTR(discovery_threads, 32, 1, 64, "Maximum number of ELS commands "
1325 "during discovery"); 1457 "during discovery");
1326 1458
1327/* 1459/*
@@ -1329,8 +1461,7 @@ LPFC_ATTR(discovery_threads, 32, 1, 64, "Maximum number of ELS commands "
1329# Value range is [0,65535]. Default value is 255. 1461# Value range is [0,65535]. Default value is 255.
1330# NOTE: The SCSI layer might probe all allowed LUN on some old targets. 1462# NOTE: The SCSI layer might probe all allowed LUN on some old targets.
1331*/ 1463*/
1332LPFC_ATTR_R(max_luns, 255, 0, 65535, 1464LPFC_VPORT_ATTR_R(max_luns, 255, 0, 65535, "Maximum allowed LUN");
1333 "Maximum allowed LUN");
1334 1465
1335/* 1466/*
1336# lpfc_poll_tmo: .Milliseconds driver will wait between polling FCP ring. 1467# lpfc_poll_tmo: .Milliseconds driver will wait between polling FCP ring.
@@ -1367,7 +1498,6 @@ struct class_device_attribute *lpfc_hba_attrs[] = {
1367 &class_device_attr_lpfc_lun_queue_depth, 1498 &class_device_attr_lpfc_lun_queue_depth,
1368 &class_device_attr_lpfc_hba_queue_depth, 1499 &class_device_attr_lpfc_hba_queue_depth,
1369 &class_device_attr_lpfc_peer_port_login, 1500 &class_device_attr_lpfc_peer_port_login,
1370 &class_device_attr_lpfc_vport_restrict_login,
1371 &class_device_attr_lpfc_nodev_tmo, 1501 &class_device_attr_lpfc_nodev_tmo,
1372 &class_device_attr_lpfc_devloss_tmo, 1502 &class_device_attr_lpfc_devloss_tmo,
1373 &class_device_attr_lpfc_fcp_class, 1503 &class_device_attr_lpfc_fcp_class,
@@ -1383,9 +1513,8 @@ struct class_device_attribute *lpfc_hba_attrs[] = {
1383 &class_device_attr_lpfc_multi_ring_type, 1513 &class_device_attr_lpfc_multi_ring_type,
1384 &class_device_attr_lpfc_fdmi_on, 1514 &class_device_attr_lpfc_fdmi_on,
1385 &class_device_attr_lpfc_max_luns, 1515 &class_device_attr_lpfc_max_luns,
1386 &class_device_attr_lpfc_npiv_enable, 1516 &class_device_attr_lpfc_enable_npiv,
1387 &class_device_attr_nport_evt_cnt, 1517 &class_device_attr_nport_evt_cnt,
1388 &class_device_attr_management_version,
1389 &class_device_attr_board_mode, 1518 &class_device_attr_board_mode,
1390 &class_device_attr_max_vpi, 1519 &class_device_attr_max_vpi,
1391 &class_device_attr_used_vpi, 1520 &class_device_attr_used_vpi,
@@ -1404,6 +1533,28 @@ struct class_device_attribute *lpfc_hba_attrs[] = {
1404 NULL, 1533 NULL,
1405}; 1534};
1406 1535
1536struct class_device_attribute *lpfc_vport_attrs[] = {
1537 &class_device_attr_info,
1538 &class_device_attr_state,
1539 &class_device_attr_num_discovered_ports,
1540 &class_device_attr_lpfc_drvr_version,
1541
1542 &class_device_attr_lpfc_log_verbose,
1543 &class_device_attr_lpfc_lun_queue_depth,
1544 &class_device_attr_lpfc_nodev_tmo,
1545 &class_device_attr_lpfc_devloss_tmo,
1546 &class_device_attr_lpfc_hba_queue_depth,
1547 &class_device_attr_lpfc_peer_port_login,
1548 &class_device_attr_lpfc_restrict_login,
1549 &class_device_attr_lpfc_fcp_class,
1550 &class_device_attr_lpfc_use_adisc,
1551 &class_device_attr_lpfc_fdmi_on,
1552 &class_device_attr_lpfc_max_luns,
1553 &class_device_attr_nport_evt_cnt,
1554 &class_device_attr_npiv_info,
1555 NULL,
1556};
1557
1407static ssize_t 1558static ssize_t
1408sysfs_ctlreg_write(struct kobject *kobj, struct bin_attribute *bin_attr, 1559sysfs_ctlreg_write(struct kobject *kobj, struct bin_attribute *bin_attr,
1409 char *buf, loff_t off, size_t count) 1560 char *buf, loff_t off, size_t count)
@@ -2243,7 +2394,6 @@ struct fc_function_template lpfc_vport_transport_functions = {
2243 .get_starget_port_name = lpfc_get_starget_port_name, 2394 .get_starget_port_name = lpfc_get_starget_port_name,
2244 .show_starget_port_name = 1, 2395 .show_starget_port_name = 1,
2245 2396
2246 .issue_fc_host_lip = lpfc_issue_lip,
2247 .dev_loss_tmo_callbk = lpfc_dev_loss_tmo_callbk, 2397 .dev_loss_tmo_callbk = lpfc_dev_loss_tmo_callbk,
2248 .terminate_rport_io = lpfc_terminate_rport_io, 2398 .terminate_rport_io = lpfc_terminate_rport_io,
2249 2399
@@ -2253,39 +2403,25 @@ struct fc_function_template lpfc_vport_transport_functions = {
2253void 2403void
2254lpfc_get_cfgparam(struct lpfc_hba *phba) 2404lpfc_get_cfgparam(struct lpfc_hba *phba)
2255{ 2405{
2256 lpfc_log_verbose_init(phba, lpfc_log_verbose);
2257 lpfc_cr_delay_init(phba, lpfc_cr_delay); 2406 lpfc_cr_delay_init(phba, lpfc_cr_delay);
2258 lpfc_cr_count_init(phba, lpfc_cr_count); 2407 lpfc_cr_count_init(phba, lpfc_cr_count);
2259 lpfc_multi_ring_support_init(phba, lpfc_multi_ring_support); 2408 lpfc_multi_ring_support_init(phba, lpfc_multi_ring_support);
2260 lpfc_multi_ring_rctl_init(phba, lpfc_multi_ring_rctl); 2409 lpfc_multi_ring_rctl_init(phba, lpfc_multi_ring_rctl);
2261 lpfc_multi_ring_type_init(phba, lpfc_multi_ring_type); 2410 lpfc_multi_ring_type_init(phba, lpfc_multi_ring_type);
2262 lpfc_lun_queue_depth_init(phba, lpfc_lun_queue_depth);
2263 lpfc_fcp_class_init(phba, lpfc_fcp_class);
2264 lpfc_use_adisc_init(phba, lpfc_use_adisc);
2265 lpfc_ack0_init(phba, lpfc_ack0); 2411 lpfc_ack0_init(phba, lpfc_ack0);
2266 lpfc_topology_init(phba, lpfc_topology); 2412 lpfc_topology_init(phba, lpfc_topology);
2267 lpfc_scan_down_init(phba, lpfc_scan_down);
2268 lpfc_link_speed_init(phba, lpfc_link_speed); 2413 lpfc_link_speed_init(phba, lpfc_link_speed);
2269 lpfc_fdmi_on_init(phba, lpfc_fdmi_on);
2270 lpfc_discovery_threads_init(phba, lpfc_discovery_threads);
2271 lpfc_max_luns_init(phba, lpfc_max_luns);
2272 lpfc_poll_tmo_init(phba, lpfc_poll_tmo); 2414 lpfc_poll_tmo_init(phba, lpfc_poll_tmo);
2273 lpfc_peer_port_login_init(phba, lpfc_peer_port_login); 2415 lpfc_enable_npiv_init(phba, lpfc_enable_npiv);
2274 lpfc_npiv_enable_init(phba, lpfc_npiv_enable);
2275 lpfc_vport_restrict_login_init(phba, lpfc_vport_restrict_login);
2276 lpfc_use_msi_init(phba, lpfc_use_msi); 2416 lpfc_use_msi_init(phba, lpfc_use_msi);
2277 lpfc_devloss_tmo_init(phba, lpfc_devloss_tmo);
2278 lpfc_nodev_tmo_init(phba, lpfc_nodev_tmo);
2279 phba->cfg_poll = lpfc_poll; 2417 phba->cfg_poll = lpfc_poll;
2280 phba->cfg_soft_wwnn = 0L; 2418 phba->cfg_soft_wwnn = 0L;
2281 phba->cfg_soft_wwpn = 0L; 2419 phba->cfg_soft_wwpn = 0L;
2282
2283 /* 2420 /*
2284 * The total number of segments is the configuration value plus 2 2421 * The total number of segments is the configuration value plus 2
2285 * since the IOCB need a command and response bde. 2422 * since the IOCB need a command and response bde.
2286 */ 2423 */
2287 phba->cfg_sg_seg_cnt = LPFC_SG_SEG_CNT + 2; 2424 phba->cfg_sg_seg_cnt = LPFC_SG_SEG_CNT + 2;
2288
2289 /* 2425 /*
2290 * Since the sg_tablesize is module parameter, the sg_dma_buf_size 2426 * Since the sg_tablesize is module parameter, the sg_dma_buf_size
2291 * used to create the sg_dma_buf_pool must be dynamically calculated 2427 * used to create the sg_dma_buf_pool must be dynamically calculated
@@ -2293,9 +2429,24 @@ lpfc_get_cfgparam(struct lpfc_hba *phba)
2293 phba->cfg_sg_dma_buf_size = sizeof(struct fcp_cmnd) + 2429 phba->cfg_sg_dma_buf_size = sizeof(struct fcp_cmnd) +
2294 sizeof(struct fcp_rsp) + 2430 sizeof(struct fcp_rsp) +
2295 (phba->cfg_sg_seg_cnt * sizeof(struct ulp_bde64)); 2431 (phba->cfg_sg_seg_cnt * sizeof(struct ulp_bde64));
2296
2297
2298 lpfc_hba_queue_depth_init(phba, lpfc_hba_queue_depth); 2432 lpfc_hba_queue_depth_init(phba, lpfc_hba_queue_depth);
2433 return;
2434}
2299 2435
2436void
2437lpfc_get_vport_cfgparam(struct lpfc_vport *vport)
2438{
2439 lpfc_log_verbose_init(vport, lpfc_log_verbose);
2440 lpfc_lun_queue_depth_init(vport, lpfc_lun_queue_depth);
2441 lpfc_devloss_tmo_init(vport, lpfc_devloss_tmo);
2442 lpfc_nodev_tmo_init(vport, lpfc_nodev_tmo);
2443 lpfc_peer_port_login_init(vport, lpfc_peer_port_login);
2444 lpfc_restrict_login_init(vport, lpfc_restrict_login);
2445 lpfc_fcp_class_init(vport, lpfc_fcp_class);
2446 lpfc_use_adisc_init(vport, lpfc_use_adisc);
2447 lpfc_fdmi_on_init(vport, lpfc_fdmi_on);
2448 lpfc_discovery_threads_init(vport, lpfc_discovery_threads);
2449 lpfc_max_luns_init(vport, lpfc_max_luns);
2450 lpfc_scan_down_init(vport, lpfc_scan_down);
2300 return; 2451 return;
2301} 2452}
diff --git a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h
index e19d1a746586..a599e1510710 100644
--- a/drivers/scsi/lpfc/lpfc_crtn.h
+++ b/drivers/scsi/lpfc/lpfc_crtn.h
@@ -40,6 +40,7 @@ void lpfc_reg_vpi(struct lpfc_hba *, uint16_t, uint32_t, LPFC_MBOXQ_t *);
40void lpfc_unreg_vpi(struct lpfc_hba *, uint16_t, LPFC_MBOXQ_t *); 40void lpfc_unreg_vpi(struct lpfc_hba *, uint16_t, LPFC_MBOXQ_t *);
41void lpfc_init_link(struct lpfc_hba *, LPFC_MBOXQ_t *, uint32_t, uint32_t); 41void lpfc_init_link(struct lpfc_hba *, LPFC_MBOXQ_t *, uint32_t, uint32_t);
42 42
43struct lpfc_vport *lpfc_find_vport_by_did(struct lpfc_hba *, uint32_t);
43void lpfc_cleanup_rpis(struct lpfc_vport *vport, int remove); 44void lpfc_cleanup_rpis(struct lpfc_vport *vport, int remove);
44int lpfc_linkdown(struct lpfc_hba *); 45int lpfc_linkdown(struct lpfc_hba *);
45void lpfc_mbx_cmpl_read_la(struct lpfc_hba *, LPFC_MBOXQ_t *); 46void lpfc_mbx_cmpl_read_la(struct lpfc_hba *, LPFC_MBOXQ_t *);
@@ -101,7 +102,7 @@ int lpfc_issue_els_scr(struct lpfc_vport *, uint32_t, uint8_t);
101int lpfc_els_free_iocb(struct lpfc_hba *, struct lpfc_iocbq *); 102int lpfc_els_free_iocb(struct lpfc_hba *, struct lpfc_iocbq *);
102int lpfc_ct_free_iocb(struct lpfc_hba *, struct lpfc_iocbq *); 103int lpfc_ct_free_iocb(struct lpfc_hba *, struct lpfc_iocbq *);
103int lpfc_els_rsp_acc(struct lpfc_vport *, uint32_t, struct lpfc_iocbq *, 104int lpfc_els_rsp_acc(struct lpfc_vport *, uint32_t, struct lpfc_iocbq *,
104 struct lpfc_nodelist *, LPFC_MBOXQ_t *, uint8_t); 105 struct lpfc_nodelist *, LPFC_MBOXQ_t *);
105int lpfc_els_rsp_reject(struct lpfc_vport *, uint32_t, struct lpfc_iocbq *, 106int lpfc_els_rsp_reject(struct lpfc_vport *, uint32_t, struct lpfc_iocbq *,
106 struct lpfc_nodelist *, LPFC_MBOXQ_t *); 107 struct lpfc_nodelist *, LPFC_MBOXQ_t *);
107int lpfc_els_rsp_adisc_acc(struct lpfc_vport *, struct lpfc_iocbq *, 108int lpfc_els_rsp_adisc_acc(struct lpfc_vport *, struct lpfc_iocbq *,
@@ -117,6 +118,7 @@ void lpfc_els_unsol_event(struct lpfc_hba *, struct lpfc_sli_ring *,
117int lpfc_els_handle_rscn(struct lpfc_vport *); 118int lpfc_els_handle_rscn(struct lpfc_vport *);
118void lpfc_els_flush_rscn(struct lpfc_vport *); 119void lpfc_els_flush_rscn(struct lpfc_vport *);
119int lpfc_rscn_payload_check(struct lpfc_vport *, uint32_t); 120int lpfc_rscn_payload_check(struct lpfc_vport *, uint32_t);
121void lpfc_els_flush_all_cmd(struct lpfc_hba *);
120void lpfc_els_flush_cmd(struct lpfc_vport *); 122void lpfc_els_flush_cmd(struct lpfc_vport *);
121int lpfc_els_disc_adisc(struct lpfc_vport *); 123int lpfc_els_disc_adisc(struct lpfc_vport *);
122int lpfc_els_disc_plogi(struct lpfc_vport *); 124int lpfc_els_disc_plogi(struct lpfc_vport *);
@@ -161,9 +163,11 @@ LPFC_MBOXQ_t *lpfc_mbox_get(struct lpfc_hba *);
161void lpfc_mbox_cmpl_put(struct lpfc_hba *, LPFC_MBOXQ_t *); 163void lpfc_mbox_cmpl_put(struct lpfc_hba *, LPFC_MBOXQ_t *);
162int lpfc_mbox_tmo_val(struct lpfc_hba *, int); 164int lpfc_mbox_tmo_val(struct lpfc_hba *, int);
163 165
164void lpfc_config_hbq(struct lpfc_hba *, struct lpfc_hbq_init *, uint32_t , 166void lpfc_config_hbq(struct lpfc_hba *, uint32_t, struct lpfc_hbq_init *,
165 LPFC_MBOXQ_t *); 167 uint32_t , LPFC_MBOXQ_t *);
166struct lpfc_hbq_entry * lpfc_sli_next_hbq_slot(struct lpfc_hba *, uint32_t); 168struct lpfc_hbq_entry * lpfc_sli_next_hbq_slot(struct lpfc_hba *, uint32_t);
169struct hbq_dmabuf *lpfc_els_hbq_alloc(struct lpfc_hba *);
170void lpfc_els_hbq_free(struct lpfc_hba *, struct hbq_dmabuf *);
167 171
168int lpfc_mem_alloc(struct lpfc_hba *); 172int lpfc_mem_alloc(struct lpfc_hba *);
169void lpfc_mem_free(struct lpfc_hba *); 173void lpfc_mem_free(struct lpfc_hba *);
@@ -200,6 +204,7 @@ int lpfc_sli_ringpostbuf_put(struct lpfc_hba *, struct lpfc_sli_ring *,
200struct lpfc_dmabuf *lpfc_sli_ringpostbuf_get(struct lpfc_hba *, 204struct lpfc_dmabuf *lpfc_sli_ringpostbuf_get(struct lpfc_hba *,
201 struct lpfc_sli_ring *, 205 struct lpfc_sli_ring *,
202 dma_addr_t); 206 dma_addr_t);
207int lpfc_sli_hbq_count(void);
203int lpfc_sli_hbqbuf_init_hbqs(struct lpfc_hba *, uint32_t); 208int lpfc_sli_hbqbuf_init_hbqs(struct lpfc_hba *, uint32_t);
204int lpfc_sli_hbqbuf_add_hbqs(struct lpfc_hba *, uint32_t); 209int lpfc_sli_hbqbuf_add_hbqs(struct lpfc_hba *, uint32_t);
205void lpfc_sli_hbqbuf_free_all(struct lpfc_hba *); 210void lpfc_sli_hbqbuf_free_all(struct lpfc_hba *);
@@ -207,10 +212,9 @@ struct hbq_dmabuf *lpfc_sli_hbqbuf_find(struct lpfc_hba *, uint32_t);
207int lpfc_sli_hbq_size(void); 212int lpfc_sli_hbq_size(void);
208int lpfc_sli_issue_abort_iotag(struct lpfc_hba *, struct lpfc_sli_ring *, 213int lpfc_sli_issue_abort_iotag(struct lpfc_hba *, struct lpfc_sli_ring *,
209 struct lpfc_iocbq *); 214 struct lpfc_iocbq *);
210int lpfc_sli_sum_iocb(struct lpfc_hba *, struct lpfc_sli_ring *, uint16_t, 215int lpfc_sli_sum_iocb(struct lpfc_vport *, uint16_t, uint64_t, lpfc_ctx_cmd);
211 uint64_t, lpfc_ctx_cmd); 216int lpfc_sli_abort_iocb(struct lpfc_vport *, struct lpfc_sli_ring *, uint16_t,
212int lpfc_sli_abort_iocb(struct lpfc_hba *, struct lpfc_sli_ring *, uint16_t, 217 uint64_t, lpfc_ctx_cmd);
213 uint64_t, uint32_t, lpfc_ctx_cmd);
214 218
215void lpfc_mbox_timeout(unsigned long); 219void lpfc_mbox_timeout(unsigned long);
216void lpfc_mbox_timeout_handler(struct lpfc_hba *); 220void lpfc_mbox_timeout_handler(struct lpfc_hba *);
@@ -234,8 +238,6 @@ void lpfc_sli_abort_fcp_cmpl(struct lpfc_hba * phba,
234 struct lpfc_iocbq * cmdiocb, 238 struct lpfc_iocbq * cmdiocb,
235 struct lpfc_iocbq * rspiocb); 239 struct lpfc_iocbq * rspiocb);
236 240
237void *lpfc_hbq_alloc(struct lpfc_hba *, int, dma_addr_t *);
238void lpfc_hbq_free(struct lpfc_hba *, void *, dma_addr_t);
239void lpfc_sli_free_hbq(struct lpfc_hba *, struct hbq_dmabuf *); 241void lpfc_sli_free_hbq(struct lpfc_hba *, struct hbq_dmabuf *);
240 242
241void *lpfc_mbuf_alloc(struct lpfc_hba *, int, dma_addr_t *); 243void *lpfc_mbuf_alloc(struct lpfc_hba *, int, dma_addr_t *);
@@ -248,10 +250,13 @@ const char* lpfc_info(struct Scsi_Host *);
248int lpfc_scan_finished(struct Scsi_Host *, unsigned long); 250int lpfc_scan_finished(struct Scsi_Host *, unsigned long);
249 251
250void lpfc_get_cfgparam(struct lpfc_hba *); 252void lpfc_get_cfgparam(struct lpfc_hba *);
253void lpfc_get_vport_cfgparam(struct lpfc_vport *);
251int lpfc_alloc_sysfs_attr(struct lpfc_vport *); 254int lpfc_alloc_sysfs_attr(struct lpfc_vport *);
252void lpfc_free_sysfs_attr(struct lpfc_vport *); 255void lpfc_free_sysfs_attr(struct lpfc_vport *);
253extern struct class_device_attribute *lpfc_hba_attrs[]; 256extern struct class_device_attribute *lpfc_hba_attrs[];
257extern struct class_device_attribute *lpfc_vport_attrs[];
254extern struct scsi_host_template lpfc_template; 258extern struct scsi_host_template lpfc_template;
259extern struct scsi_host_template lpfc_vport_template;
255extern struct fc_function_template lpfc_transport_functions; 260extern struct fc_function_template lpfc_transport_functions;
256extern struct fc_function_template lpfc_vport_transport_functions; 261extern struct fc_function_template lpfc_vport_transport_functions;
257extern int lpfc_sli_mode; 262extern int lpfc_sli_mode;
@@ -260,7 +265,7 @@ int lpfc_vport_symbolic_node_name(struct lpfc_vport *, char *, size_t);
260void lpfc_terminate_rport_io(struct fc_rport *); 265void lpfc_terminate_rport_io(struct fc_rport *);
261void lpfc_dev_loss_tmo_callbk(struct fc_rport *rport); 266void lpfc_dev_loss_tmo_callbk(struct fc_rport *rport);
262 267
263struct lpfc_vport *lpfc_create_port(struct lpfc_hba *, int, struct fc_vport *); 268struct lpfc_vport *lpfc_create_port(struct lpfc_hba *, int, struct device *);
264int lpfc_vport_disable(struct fc_vport *fc_vport, bool disable); 269int lpfc_vport_disable(struct fc_vport *fc_vport, bool disable);
265void lpfc_mbx_unreg_vpi(struct lpfc_vport *); 270void lpfc_mbx_unreg_vpi(struct lpfc_vport *);
266void destroy_port(struct lpfc_vport *); 271void destroy_port(struct lpfc_vport *);
@@ -271,6 +276,9 @@ extern void lpfc_debugfs_initialize(struct lpfc_vport *);
271extern void lpfc_debugfs_terminate(struct lpfc_vport *); 276extern void lpfc_debugfs_terminate(struct lpfc_vport *);
272extern void lpfc_debugfs_disc_trc(struct lpfc_vport *, int, char *, uint32_t, 277extern void lpfc_debugfs_disc_trc(struct lpfc_vport *, int, char *, uint32_t,
273 uint32_t, uint32_t); 278 uint32_t, uint32_t);
279extern void lpfc_debugfs_slow_ring_trc(struct lpfc_hba *, char *, uint32_t,
280 uint32_t, uint32_t);
281extern struct lpfc_hbq_init *lpfc_hbq_defs[];
274 282
275/* Interface exported by fabric iocb scheduler */ 283/* Interface exported by fabric iocb scheduler */
276int lpfc_issue_fabric_iocb(struct lpfc_hba *, struct lpfc_iocbq *); 284int lpfc_issue_fabric_iocb(struct lpfc_hba *, struct lpfc_iocbq *);
diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
index ae9d6f385a6c..c701e4d611a9 100644
--- a/drivers/scsi/lpfc/lpfc_ct.c
+++ b/drivers/scsi/lpfc/lpfc_ct.c
@@ -257,6 +257,10 @@ lpfc_ct_free_iocb(struct lpfc_hba *phba, struct lpfc_iocbq *ctiocb)
257{ 257{
258 struct lpfc_dmabuf *buf_ptr; 258 struct lpfc_dmabuf *buf_ptr;
259 259
260 if (ctiocb->context_un.ndlp) {
261 lpfc_nlp_put(ctiocb->context_un.ndlp);
262 ctiocb->context_un.ndlp = NULL;
263 }
260 if (ctiocb->context1) { 264 if (ctiocb->context1) {
261 buf_ptr = (struct lpfc_dmabuf *) ctiocb->context1; 265 buf_ptr = (struct lpfc_dmabuf *) ctiocb->context1;
262 lpfc_mbuf_free(phba, buf_ptr->virt, buf_ptr->phys); 266 lpfc_mbuf_free(phba, buf_ptr->virt, buf_ptr->phys);
@@ -314,6 +318,7 @@ lpfc_gen_req(struct lpfc_vport *vport, struct lpfc_dmabuf *bmp,
314 /* Save for completion so we can release these resources */ 318 /* Save for completion so we can release these resources */
315 geniocb->context1 = (uint8_t *) inp; 319 geniocb->context1 = (uint8_t *) inp;
316 geniocb->context2 = (uint8_t *) outp; 320 geniocb->context2 = (uint8_t *) outp;
321 geniocb->context_un.ndlp = ndlp;
317 322
318 /* Fill in payload, bp points to frame payload */ 323 /* Fill in payload, bp points to frame payload */
319 icmd->ulpCommand = CMD_GEN_REQUEST64_CR; 324 icmd->ulpCommand = CMD_GEN_REQUEST64_CR;
@@ -341,11 +346,11 @@ lpfc_gen_req(struct lpfc_vport *vport, struct lpfc_dmabuf *bmp,
341 } 346 }
342 347
343 /* Issue GEN REQ IOCB for NPORT <did> */ 348 /* Issue GEN REQ IOCB for NPORT <did> */
344 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 349 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
345 "%d (%d):0119 Issue GEN REQ IOCB to NPORT x%x " 350 "0119 Issue GEN REQ IOCB to NPORT x%x "
346 "Data: x%x x%x\n", phba->brd_no, vport->vpi, 351 "Data: x%x x%x\n",
347 ndlp->nlp_DID, icmd->ulpIoTag, 352 ndlp->nlp_DID, icmd->ulpIoTag,
348 vport->port_state); 353 vport->port_state);
349 geniocb->iocb_cmpl = cmpl; 354 geniocb->iocb_cmpl = cmpl;
350 geniocb->drvrTimeout = icmd->ulpTimeout + LPFC_DRVR_TIMEOUT; 355 geniocb->drvrTimeout = icmd->ulpTimeout + LPFC_DRVR_TIMEOUT;
351 geniocb->vport = vport; 356 geniocb->vport = vport;
@@ -390,17 +395,19 @@ lpfc_ct_cmd(struct lpfc_vport *vport, struct lpfc_dmabuf *inmp,
390 return 0; 395 return 0;
391} 396}
392 397
393static struct lpfc_vport * 398struct lpfc_vport *
394lpfc_find_vport_by_did(struct lpfc_hba *phba, uint32_t did) { 399lpfc_find_vport_by_did(struct lpfc_hba *phba, uint32_t did) {
395
396 struct lpfc_vport *vport_curr; 400 struct lpfc_vport *vport_curr;
401 unsigned long flags;
397 402
403 spin_lock_irqsave(&phba->hbalock, flags);
398 list_for_each_entry(vport_curr, &phba->port_list, listentry) { 404 list_for_each_entry(vport_curr, &phba->port_list, listentry) {
399 if ((vport_curr->fc_myDID) && 405 if ((vport_curr->fc_myDID) && (vport_curr->fc_myDID == did)) {
400 (vport_curr->fc_myDID == did)) 406 spin_unlock_irqrestore(&phba->hbalock, flags);
401 return vport_curr; 407 return vport_curr;
408 }
402 } 409 }
403 410 spin_unlock_irqrestore(&phba->hbalock, flags);
404 return NULL; 411 return NULL;
405} 412}
406 413
@@ -449,10 +456,10 @@ lpfc_ns_rsp(struct lpfc_vport *vport, struct lpfc_dmabuf *mp, uint32_t Size)
449 */ 456 */
450 if ((Did != vport->fc_myDID) && 457 if ((Did != vport->fc_myDID) &&
451 ((lpfc_find_vport_by_did(phba, Did) == NULL) || 458 ((lpfc_find_vport_by_did(phba, Did) == NULL) ||
452 phba->cfg_peer_port_login)) { 459 vport->cfg_peer_port_login)) {
453 if ((vport->port_type != LPFC_NPIV_PORT) || 460 if ((vport->port_type != LPFC_NPIV_PORT) ||
454 (vport->fc_flag & FC_RFF_NOT_SUPPORTED) || 461 (vport->fc_flag & FC_RFF_NOT_SUPPORTED) ||
455 (!phba->cfg_vport_restrict_login)) { 462 (!vport->cfg_restrict_login)) {
456 ndlp = lpfc_setup_disc_node(vport, Did); 463 ndlp = lpfc_setup_disc_node(vport, Did);
457 if (ndlp) { 464 if (ndlp) {
458 lpfc_debugfs_disc_trc(vport, 465 lpfc_debugfs_disc_trc(vport,
@@ -462,14 +469,13 @@ lpfc_ns_rsp(struct lpfc_vport *vport, struct lpfc_dmabuf *mp, uint32_t Size)
462 Did, ndlp->nlp_flag, 469 Did, ndlp->nlp_flag,
463 vport->fc_flag); 470 vport->fc_flag);
464 471
465 lpfc_printf_log(phba, KERN_INFO, 472 lpfc_printf_vlog(vport,
473 KERN_INFO,
466 LOG_DISCOVERY, 474 LOG_DISCOVERY,
467 "%d (%d):0238 Process " 475 "0238 Process "
468 "x%x NameServer Rsp" 476 "x%x NameServer Rsp"
469 "Data: x%x x%x x%x\n", 477 "Data: x%x x%x x%x\n",
470 phba->brd_no, 478 Did, ndlp->nlp_flag,
471 vport->vpi, Did,
472 ndlp->nlp_flag,
473 vport->fc_flag, 479 vport->fc_flag,
474 vport->fc_rscn_id_cnt); 480 vport->fc_rscn_id_cnt);
475 } else { 481 } else {
@@ -480,14 +486,13 @@ lpfc_ns_rsp(struct lpfc_vport *vport, struct lpfc_dmabuf *mp, uint32_t Size)
480 Did, vport->fc_flag, 486 Did, vport->fc_flag,
481 vport->fc_rscn_id_cnt); 487 vport->fc_rscn_id_cnt);
482 488
483 lpfc_printf_log(phba, KERN_INFO, 489 lpfc_printf_vlog(vport,
490 KERN_INFO,
484 LOG_DISCOVERY, 491 LOG_DISCOVERY,
485 "%d (%d):0239 Skip x%x " 492 "0239 Skip x%x "
486 "NameServer Rsp Data: " 493 "NameServer Rsp Data: "
487 "x%x x%x\n", 494 "x%x x%x\n",
488 phba->brd_no, 495 Did, vport->fc_flag,
489 vport->vpi, Did,
490 vport->fc_flag,
491 vport->fc_rscn_id_cnt); 496 vport->fc_rscn_id_cnt);
492 } 497 }
493 498
@@ -514,14 +519,13 @@ lpfc_ns_rsp(struct lpfc_vport *vport, struct lpfc_dmabuf *mp, uint32_t Size)
514 Did, vport->fc_flag, 519 Did, vport->fc_flag,
515 vport->fc_rscn_id_cnt); 520 vport->fc_rscn_id_cnt);
516 521
517 lpfc_printf_log(phba, KERN_INFO, 522 lpfc_printf_vlog(vport,
523 KERN_INFO,
518 LOG_DISCOVERY, 524 LOG_DISCOVERY,
519 "%d (%d):0245 Skip x%x " 525 "0245 Skip x%x "
520 "NameServer Rsp Data: " 526 "NameServer Rsp Data: "
521 "x%x x%x\n", 527 "x%x x%x\n",
522 phba->brd_no, 528 Did, vport->fc_flag,
523 vport->vpi, Did,
524 vport->fc_flag,
525 vport->fc_rscn_id_cnt); 529 vport->fc_rscn_id_cnt);
526 } 530 }
527 } 531 }
@@ -549,8 +553,12 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
549 struct lpfc_dmabuf *bmp; 553 struct lpfc_dmabuf *bmp;
550 struct lpfc_dmabuf *outp; 554 struct lpfc_dmabuf *outp;
551 struct lpfc_sli_ct_request *CTrsp; 555 struct lpfc_sli_ct_request *CTrsp;
556 struct lpfc_nodelist *ndlp;
552 int rc; 557 int rc;
553 558
559 /* First save ndlp, before we overwrite it */
560 ndlp = cmdiocb->context_un.ndlp;
561
554 /* we pass cmdiocb to state machine which needs rspiocb as well */ 562 /* we pass cmdiocb to state machine which needs rspiocb as well */
555 cmdiocb->context_un.rsp_iocb = rspiocb; 563 cmdiocb->context_un.rsp_iocb = rspiocb;
556 564
@@ -568,9 +576,8 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
568 576
569 577
570 if (lpfc_els_chk_latt(vport) || lpfc_error_lost_link(irsp)) { 578 if (lpfc_els_chk_latt(vport) || lpfc_error_lost_link(irsp)) {
571 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 579 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
572 "%d (%d):0216 Link event during NS query\n", 580 "0216 Link event during NS query\n");
573 phba->brd_no, vport->vpi);
574 lpfc_vport_set_state(vport, FC_VPORT_FAILED); 581 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
575 goto out; 582 goto out;
576 } 583 }
@@ -588,46 +595,61 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
588 goto out; 595 goto out;
589 } 596 }
590 lpfc_vport_set_state(vport, FC_VPORT_FAILED); 597 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
591 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 598 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
592 "%d (%d):0257 GID_FT Query error: 0x%x 0x%x\n", 599 "0257 GID_FT Query error: 0x%x 0x%x\n",
593 phba->brd_no, vport->vpi, irsp->ulpStatus, 600 irsp->ulpStatus, vport->fc_ns_retry);
594 vport->fc_ns_retry);
595 } else { 601 } else {
596 /* Good status, continue checking */ 602 /* Good status, continue checking */
597 CTrsp = (struct lpfc_sli_ct_request *) outp->virt; 603 CTrsp = (struct lpfc_sli_ct_request *) outp->virt;
598 if (CTrsp->CommandResponse.bits.CmdRsp == 604 if (CTrsp->CommandResponse.bits.CmdRsp ==
599 be16_to_cpu(SLI_CT_RESPONSE_FS_ACC)) { 605 be16_to_cpu(SLI_CT_RESPONSE_FS_ACC)) {
600 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 606 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
601 "%d (%d):0208 NameServer Rsp " 607 "0208 NameServer Rsp Data: x%x\n",
602 "Data: x%x\n", 608 vport->fc_flag);
603 phba->brd_no, vport->vpi,
604 vport->fc_flag);
605 lpfc_ns_rsp(vport, outp, 609 lpfc_ns_rsp(vport, outp,
606 (uint32_t) (irsp->un.genreq64.bdl.bdeSize)); 610 (uint32_t) (irsp->un.genreq64.bdl.bdeSize));
607 } else if (CTrsp->CommandResponse.bits.CmdRsp == 611 } else if (CTrsp->CommandResponse.bits.CmdRsp ==
608 be16_to_cpu(SLI_CT_RESPONSE_FS_RJT)) { 612 be16_to_cpu(SLI_CT_RESPONSE_FS_RJT)) {
609 /* NameServer Rsp Error */ 613 /* NameServer Rsp Error */
610 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 614 if ((CTrsp->ReasonCode == SLI_CT_UNABLE_TO_PERFORM_REQ)
611 "%d (%d):0240 NameServer Rsp Error " 615 && (CTrsp->Explanation == SLI_CT_NO_FC4_TYPES)) {
616 lpfc_printf_vlog(vport, KERN_INFO,
617 LOG_DISCOVERY,
618 "0269 No NameServer Entries "
612 "Data: x%x x%x x%x x%x\n", 619 "Data: x%x x%x x%x x%x\n",
613 phba->brd_no, vport->vpi,
614 CTrsp->CommandResponse.bits.CmdRsp, 620 CTrsp->CommandResponse.bits.CmdRsp,
615 (uint32_t) CTrsp->ReasonCode, 621 (uint32_t) CTrsp->ReasonCode,
616 (uint32_t) CTrsp->Explanation, 622 (uint32_t) CTrsp->Explanation,
617 vport->fc_flag); 623 vport->fc_flag);
618 624
619 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_CT, 625 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_CT,
626 "GID_FT no entry cmd:x%x rsn:x%x exp:x%x",
627 (uint32_t)CTrsp->CommandResponse.bits.CmdRsp,
628 (uint32_t) CTrsp->ReasonCode,
629 (uint32_t) CTrsp->Explanation);
630 } else {
631 lpfc_printf_vlog(vport, KERN_INFO,
632 LOG_DISCOVERY,
633 "0240 NameServer Rsp Error "
634 "Data: x%x x%x x%x x%x\n",
635 CTrsp->CommandResponse.bits.CmdRsp,
636 (uint32_t) CTrsp->ReasonCode,
637 (uint32_t) CTrsp->Explanation,
638 vport->fc_flag);
639
640 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_CT,
620 "GID_FT rsp err1 cmd:x%x rsn:x%x exp:x%x", 641 "GID_FT rsp err1 cmd:x%x rsn:x%x exp:x%x",
621 (uint32_t)CTrsp->CommandResponse.bits.CmdRsp, 642 (uint32_t)CTrsp->CommandResponse.bits.CmdRsp,
622 (uint32_t) CTrsp->ReasonCode, 643 (uint32_t) CTrsp->ReasonCode,
623 (uint32_t) CTrsp->Explanation); 644 (uint32_t) CTrsp->Explanation);
645 }
646
624 647
625 } else { 648 } else {
626 /* NameServer Rsp Error */ 649 /* NameServer Rsp Error */
627 lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, 650 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
628 "%d (%d):0241 NameServer Rsp Error " 651 "0241 NameServer Rsp Error "
629 "Data: x%x x%x x%x x%x\n", 652 "Data: x%x x%x x%x x%x\n",
630 phba->brd_no, vport->vpi,
631 CTrsp->CommandResponse.bits.CmdRsp, 653 CTrsp->CommandResponse.bits.CmdRsp,
632 (uint32_t) CTrsp->ReasonCode, 654 (uint32_t) CTrsp->ReasonCode,
633 (uint32_t) CTrsp->Explanation, 655 (uint32_t) CTrsp->Explanation,
@@ -661,11 +683,12 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
661 lpfc_disc_start(vport); 683 lpfc_disc_start(vport);
662 } 684 }
663out: 685out:
686 cmdiocb->context_un.ndlp = ndlp; /* Now restore ndlp for free */
664 lpfc_ct_free_iocb(phba, cmdiocb); 687 lpfc_ct_free_iocb(phba, cmdiocb);
665 return; 688 return;
666} 689}
667 690
668void 691static void
669lpfc_cmpl_ct_cmd_gff_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, 692lpfc_cmpl_ct_cmd_gff_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
670 struct lpfc_iocbq *rspiocb) 693 struct lpfc_iocbq *rspiocb)
671{ 694{
@@ -695,40 +718,37 @@ lpfc_cmpl_ct_cmd_gff_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
695 be16_to_cpu(SLI_CT_RESPONSE_FS_ACC)) { 718 be16_to_cpu(SLI_CT_RESPONSE_FS_ACC)) {
696 if ((fbits & FC4_FEATURE_INIT) && 719 if ((fbits & FC4_FEATURE_INIT) &&
697 !(fbits & FC4_FEATURE_TARGET)) { 720 !(fbits & FC4_FEATURE_TARGET)) {
698 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 721 lpfc_printf_vlog(vport, KERN_INFO,
699 "%d (%d):0245 Skip x%x GFF " 722 LOG_DISCOVERY,
700 "NameServer Rsp Data: (init) " 723 "0270 Skip x%x GFF "
701 "x%x x%x\n", phba->brd_no, 724 "NameServer Rsp Data: (init) "
702 vport->vpi, did, fbits, 725 "x%x x%x\n", did, fbits,
703 vport->fc_rscn_id_cnt); 726 vport->fc_rscn_id_cnt);
704 goto out; 727 goto out;
705 } 728 }
706 } 729 }
707 } 730 }
708 else { 731 else {
709 lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, 732 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
710 "%d (%d):0267 NameServer GFF Rsp" 733 "0267 NameServer GFF Rsp "
711 " x%x Error (%d %d) Data: x%x x%x\n", 734 "x%x Error (%d %d) Data: x%x x%x\n",
712 phba->brd_no, vport->vpi, did, 735 did, irsp->ulpStatus, irsp->un.ulpWord[4],
713 irsp->ulpStatus, irsp->un.ulpWord[4], 736 vport->fc_flag, vport->fc_rscn_id_cnt)
714 vport->fc_flag, vport->fc_rscn_id_cnt)
715 } 737 }
716 738
717 /* This is a target port, unregistered port, or the GFF_ID failed */ 739 /* This is a target port, unregistered port, or the GFF_ID failed */
718 ndlp = lpfc_setup_disc_node(vport, did); 740 ndlp = lpfc_setup_disc_node(vport, did);
719 if (ndlp) { 741 if (ndlp) {
720 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 742 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
721 "%d (%d):0242 Process x%x GFF " 743 "0242 Process x%x GFF "
722 "NameServer Rsp Data: x%x x%x x%x\n", 744 "NameServer Rsp Data: x%x x%x x%x\n",
723 phba->brd_no, vport->vpi, 745 did, ndlp->nlp_flag, vport->fc_flag,
724 did, ndlp->nlp_flag, vport->fc_flag, 746 vport->fc_rscn_id_cnt);
725 vport->fc_rscn_id_cnt);
726 } else { 747 } else {
727 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 748 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
728 "%d (%d):0243 Skip x%x GFF " 749 "0243 Skip x%x GFF "
729 "NameServer Rsp Data: x%x x%x\n", 750 "NameServer Rsp Data: x%x x%x\n", did,
730 phba->brd_no, vport->vpi, did, 751 vport->fc_flag, vport->fc_rscn_id_cnt);
731 vport->fc_flag, vport->fc_rscn_id_cnt);
732 } 752 }
733out: 753out:
734 /* Link up / RSCN discovery */ 754 /* Link up / RSCN discovery */
@@ -766,10 +786,14 @@ lpfc_cmpl_ct_cmd_rft_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
766 struct lpfc_dmabuf *outp; 786 struct lpfc_dmabuf *outp;
767 IOCB_t *irsp; 787 IOCB_t *irsp;
768 struct lpfc_sli_ct_request *CTrsp; 788 struct lpfc_sli_ct_request *CTrsp;
789 struct lpfc_nodelist *ndlp;
769 int cmdcode, rc; 790 int cmdcode, rc;
770 uint8_t retry; 791 uint8_t retry;
771 uint32_t latt; 792 uint32_t latt;
772 793
794 /* First save ndlp, before we overwrite it */
795 ndlp = cmdiocb->context_un.ndlp;
796
773 /* we pass cmdiocb to state machine which needs rspiocb as well */ 797 /* we pass cmdiocb to state machine which needs rspiocb as well */
774 cmdiocb->context_un.rsp_iocb = rspiocb; 798 cmdiocb->context_un.rsp_iocb = rspiocb;
775 799
@@ -784,22 +808,21 @@ lpfc_cmpl_ct_cmd_rft_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
784 latt = lpfc_els_chk_latt(vport); 808 latt = lpfc_els_chk_latt(vport);
785 809
786 /* RFT request completes status <ulpStatus> CmdRsp <CmdRsp> */ 810 /* RFT request completes status <ulpStatus> CmdRsp <CmdRsp> */
787 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 811 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
788 "%d (%d):0209 RFT request completes, latt %d, " 812 "0209 RFT request completes, latt %d, "
789 "ulpStatus x%x CmdRsp x%x, Context x%x, Tag x%x\n", 813 "ulpStatus x%x CmdRsp x%x, Context x%x, Tag x%x\n",
790 phba->brd_no, vport->vpi, latt, irsp->ulpStatus, 814 latt, irsp->ulpStatus,
791 CTrsp->CommandResponse.bits.CmdRsp, 815 CTrsp->CommandResponse.bits.CmdRsp,
792 cmdiocb->iocb.ulpContext, cmdiocb->iocb.ulpIoTag); 816 cmdiocb->iocb.ulpContext, cmdiocb->iocb.ulpIoTag);
793 817
794 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_CT, 818 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_CT,
795 "CT cmd cmpl: status:x%x/x%x cmd:x%x", 819 "CT cmd cmpl: status:x%x/x%x cmd:x%x",
796 irsp->ulpStatus, irsp->un.ulpWord[4], cmdcode); 820 irsp->ulpStatus, irsp->un.ulpWord[4], cmdcode);
797 821
798 if (irsp->ulpStatus) { 822 if (irsp->ulpStatus) {
799 lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, 823 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
800 "%d (%d):0268 NS cmd %x Error (%d %d)\n", 824 "0268 NS cmd %x Error (%d %d)\n",
801 phba->brd_no, vport->vpi, cmdcode, 825 cmdcode, irsp->ulpStatus, irsp->un.ulpWord[4]);
802 irsp->ulpStatus, irsp->un.ulpWord[4]);
803 826
804 if ((irsp->ulpStatus == IOSTAT_LOCAL_REJECT) && 827 if ((irsp->ulpStatus == IOSTAT_LOCAL_REJECT) &&
805 ((irsp->un.ulpWord[4] == IOERR_SLI_DOWN) || 828 ((irsp->un.ulpWord[4] == IOERR_SLI_DOWN) ||
@@ -811,15 +834,15 @@ lpfc_cmpl_ct_cmd_rft_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
811 goto out; 834 goto out;
812 835
813 retry++; 836 retry++;
814 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 837 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
815 "%d (%d):0216 Retrying NS cmd %x\n", 838 "0216 Retrying NS cmd %x\n", cmdcode);
816 phba->brd_no, vport->vpi, cmdcode);
817 rc = lpfc_ns_cmd(vport, cmdcode, retry, 0); 839 rc = lpfc_ns_cmd(vport, cmdcode, retry, 0);
818 if (rc == 0) 840 if (rc == 0)
819 goto out; 841 goto out;
820 } 842 }
821 843
822out: 844out:
845 cmdiocb->context_un.ndlp = ndlp; /* Now restore ndlp for free */
823 lpfc_ct_free_iocb(phba, cmdiocb); 846 lpfc_ct_free_iocb(phba, cmdiocb);
824 return; 847 return;
825} 848}
@@ -862,7 +885,7 @@ lpfc_cmpl_ct_cmd_rff_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
862 return; 885 return;
863} 886}
864 887
865int 888static int
866lpfc_vport_symbolic_port_name(struct lpfc_vport *vport, char *symbol, 889lpfc_vport_symbolic_port_name(struct lpfc_vport *vport, char *symbol,
867 size_t size) 890 size_t size)
868{ 891{
@@ -957,10 +980,9 @@ lpfc_ns_cmd(struct lpfc_vport *vport, int cmdcode,
957 } 980 }
958 981
959 /* NameServer Req */ 982 /* NameServer Req */
960 lpfc_printf_log(phba, KERN_INFO ,LOG_DISCOVERY, 983 lpfc_printf_vlog(vport, KERN_INFO ,LOG_DISCOVERY,
961 "%d (%d):0236 NameServer Req Data: x%x x%x x%x\n", 984 "0236 NameServer Req Data: x%x x%x x%x\n",
962 phba->brd_no, vport->vpi, cmdcode, vport->fc_flag, 985 cmdcode, vport->fc_flag, vport->fc_rscn_id_cnt);
963 vport->fc_rscn_id_cnt);
964 986
965 bpl = (struct ulp_bde64 *) bmp->virt; 987 bpl = (struct ulp_bde64 *) bmp->virt;
966 memset(bpl, 0, sizeof(struct ulp_bde64)); 988 memset(bpl, 0, sizeof(struct ulp_bde64));
@@ -1059,6 +1081,7 @@ lpfc_ns_cmd(struct lpfc_vport *vport, int cmdcode,
1059 cmpl = lpfc_cmpl_ct_cmd_rff_id; 1081 cmpl = lpfc_cmpl_ct_cmd_rff_id;
1060 break; 1082 break;
1061 } 1083 }
1084 lpfc_nlp_get(ndlp);
1062 1085
1063 if (!lpfc_ct_cmd(vport, mp, bmp, ndlp, cmpl, rsp_size, retry)) { 1086 if (!lpfc_ct_cmd(vport, mp, bmp, ndlp, cmpl, rsp_size, retry)) {
1064 /* On success, The cmpl function will free the buffers */ 1087 /* On success, The cmpl function will free the buffers */
@@ -1069,6 +1092,7 @@ lpfc_ns_cmd(struct lpfc_vport *vport, int cmdcode,
1069 } 1092 }
1070 1093
1071 rc=6; 1094 rc=6;
1095 lpfc_nlp_put(ndlp);
1072 lpfc_mbuf_free(phba, bmp->virt, bmp->phys); 1096 lpfc_mbuf_free(phba, bmp->virt, bmp->phys);
1073ns_cmd_free_bmp: 1097ns_cmd_free_bmp:
1074 kfree(bmp); 1098 kfree(bmp);
@@ -1077,10 +1101,9 @@ ns_cmd_free_mpvirt:
1077ns_cmd_free_mp: 1101ns_cmd_free_mp:
1078 kfree(mp); 1102 kfree(mp);
1079ns_cmd_exit: 1103ns_cmd_exit:
1080 lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, 1104 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
1081 "%d (%d):0266 Issue NameServer Req x%x err %d Data: x%x x%x\n", 1105 "0266 Issue NameServer Req x%x err %d Data: x%x x%x\n",
1082 phba->brd_no, vport->vpi, cmdcode, rc, vport->fc_flag, 1106 cmdcode, rc, vport->fc_flag, vport->fc_rscn_id_cnt);
1083 vport->fc_rscn_id_cnt);
1084 return 1; 1107 return 1;
1085} 1108}
1086 1109
@@ -1106,12 +1129,11 @@ lpfc_cmpl_ct_cmd_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
1106 irsp->ulpStatus, irsp->un.ulpWord[4], latt); 1129 irsp->ulpStatus, irsp->un.ulpWord[4], latt);
1107 1130
1108 if (latt || irsp->ulpStatus) { 1131 if (latt || irsp->ulpStatus) {
1109 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 1132 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
1110 "%d (%d):0229 FDMI cmd %04x failed, latt = %d " 1133 "0229 FDMI cmd %04x failed, latt = %d "
1111 "ulpStatus: x%x, rid x%x\n", 1134 "ulpStatus: x%x, rid x%x\n",
1112 phba->brd_no, vport->vpi, 1135 be16_to_cpu(fdmi_cmd), latt, irsp->ulpStatus,
1113 be16_to_cpu(fdmi_cmd), latt, irsp->ulpStatus, 1136 irsp->un.ulpWord[4]);
1114 irsp->un.ulpWord[4]);
1115 lpfc_ct_free_iocb(phba, cmdiocb); 1137 lpfc_ct_free_iocb(phba, cmdiocb);
1116 return; 1138 return;
1117 } 1139 }
@@ -1119,10 +1141,9 @@ lpfc_cmpl_ct_cmd_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
1119 ndlp = lpfc_findnode_did(vport, FDMI_DID); 1141 ndlp = lpfc_findnode_did(vport, FDMI_DID);
1120 if (fdmi_rsp == be16_to_cpu(SLI_CT_RESPONSE_FS_RJT)) { 1142 if (fdmi_rsp == be16_to_cpu(SLI_CT_RESPONSE_FS_RJT)) {
1121 /* FDMI rsp failed */ 1143 /* FDMI rsp failed */
1122 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 1144 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
1123 "%d (%d):0220 FDMI rsp failed Data: x%x\n", 1145 "0220 FDMI rsp failed Data: x%x\n",
1124 phba->brd_no, vport->vpi, 1146 be16_to_cpu(fdmi_cmd));
1125 be16_to_cpu(fdmi_cmd));
1126 } 1147 }
1127 1148
1128 switch (be16_to_cpu(fdmi_cmd)) { 1149 switch (be16_to_cpu(fdmi_cmd)) {
@@ -1185,11 +1206,9 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, int cmdcode)
1185 INIT_LIST_HEAD(&bmp->list); 1206 INIT_LIST_HEAD(&bmp->list);
1186 1207
1187 /* FDMI request */ 1208 /* FDMI request */
1188 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 1209 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
1189 "%d (%d):0218 FDMI Request Data: x%x x%x x%x\n", 1210 "0218 FDMI Request Data: x%x x%x x%x\n",
1190 phba->brd_no, vport->vpi, vport->fc_flag, 1211 vport->fc_flag, vport->port_state, cmdcode);
1191 vport->port_state, cmdcode);
1192
1193 CtReq = (struct lpfc_sli_ct_request *) mp->virt; 1212 CtReq = (struct lpfc_sli_ct_request *) mp->virt;
1194 1213
1195 memset(CtReq, 0, sizeof(struct lpfc_sli_ct_request)); 1214 memset(CtReq, 0, sizeof(struct lpfc_sli_ct_request));
@@ -1449,7 +1468,7 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, int cmdcode)
1449 pab->ab.EntryCnt++; 1468 pab->ab.EntryCnt++;
1450 size += FOURBYTES + len; 1469 size += FOURBYTES + len;
1451 1470
1452 if (phba->cfg_fdmi_on == 2) { 1471 if (vport->cfg_fdmi_on == 2) {
1453 /* #6 Port attribute entry */ 1472 /* #6 Port attribute entry */
1454 ae = (ATTRIBUTE_ENTRY *) ((uint8_t *) pab + 1473 ae = (ATTRIBUTE_ENTRY *) ((uint8_t *) pab +
1455 size); 1474 size);
@@ -1499,10 +1518,12 @@ lpfc_fdmi_cmd(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, int cmdcode)
1499 bpl->tus.w = le32_to_cpu(bpl->tus.w); 1518 bpl->tus.w = le32_to_cpu(bpl->tus.w);
1500 1519
1501 cmpl = lpfc_cmpl_ct_cmd_fdmi; 1520 cmpl = lpfc_cmpl_ct_cmd_fdmi;
1521 lpfc_nlp_get(ndlp);
1502 1522
1503 if (!lpfc_ct_cmd(vport, mp, bmp, ndlp, cmpl, FC_MAX_NS_RSP, 0)) 1523 if (!lpfc_ct_cmd(vport, mp, bmp, ndlp, cmpl, FC_MAX_NS_RSP, 0))
1504 return 0; 1524 return 0;
1505 1525
1526 lpfc_nlp_put(ndlp);
1506 lpfc_mbuf_free(phba, bmp->virt, bmp->phys); 1527 lpfc_mbuf_free(phba, bmp->virt, bmp->phys);
1507fdmi_cmd_free_bmp: 1528fdmi_cmd_free_bmp:
1508 kfree(bmp); 1529 kfree(bmp);
@@ -1512,9 +1533,9 @@ fdmi_cmd_free_mp:
1512 kfree(mp); 1533 kfree(mp);
1513fdmi_cmd_exit: 1534fdmi_cmd_exit:
1514 /* Issue FDMI request failed */ 1535 /* Issue FDMI request failed */
1515 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 1536 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
1516 "%d (%d):0244 Issue FDMI request failed Data: x%x\n", 1537 "0244 Issue FDMI request failed Data: x%x\n",
1517 phba->brd_no, vport->vpi, cmdcode); 1538 cmdcode);
1518 return 1; 1539 return 1;
1519} 1540}
1520 1541
diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c
index 673cfe11cc2b..2e3c01bebed6 100644
--- a/drivers/scsi/lpfc/lpfc_debugfs.c
+++ b/drivers/scsi/lpfc/lpfc_debugfs.c
@@ -71,15 +71,22 @@
71 * lpfc_debugfs_mask_disc_trc=Y Where Y is an event mask as defined in 71 * lpfc_debugfs_mask_disc_trc=Y Where Y is an event mask as defined in
72 * lpfc_debugfs.h . 72 * lpfc_debugfs.h .
73 */ 73 */
74static int lpfc_debugfs_enable = 0; 74static int lpfc_debugfs_enable = 1;
75module_param(lpfc_debugfs_enable, int, 0); 75module_param(lpfc_debugfs_enable, int, 0);
76MODULE_PARM_DESC(lpfc_debugfs_enable, "Enable debugfs services"); 76MODULE_PARM_DESC(lpfc_debugfs_enable, "Enable debugfs services");
77 77
78static int lpfc_debugfs_max_disc_trc = 0; /* This MUST be a power of 2 */ 78/* This MUST be a power of 2 */
79static int lpfc_debugfs_max_disc_trc = 0;
79module_param(lpfc_debugfs_max_disc_trc, int, 0); 80module_param(lpfc_debugfs_max_disc_trc, int, 0);
80MODULE_PARM_DESC(lpfc_debugfs_max_disc_trc, 81MODULE_PARM_DESC(lpfc_debugfs_max_disc_trc,
81 "Set debugfs discovery trace depth"); 82 "Set debugfs discovery trace depth");
82 83
84/* This MUST be a power of 2 */
85static int lpfc_debugfs_max_slow_ring_trc = 0;
86module_param(lpfc_debugfs_max_slow_ring_trc, int, 0);
87MODULE_PARM_DESC(lpfc_debugfs_max_slow_ring_trc,
88 "Set debugfs slow ring trace depth");
89
83static int lpfc_debugfs_mask_disc_trc = 0; 90static int lpfc_debugfs_mask_disc_trc = 0;
84module_param(lpfc_debugfs_mask_disc_trc, int, 0); 91module_param(lpfc_debugfs_mask_disc_trc, int, 0);
85MODULE_PARM_DESC(lpfc_debugfs_mask_disc_trc, 92MODULE_PARM_DESC(lpfc_debugfs_mask_disc_trc,
@@ -87,28 +94,34 @@ MODULE_PARM_DESC(lpfc_debugfs_mask_disc_trc,
87 94
88#include <linux/debugfs.h> 95#include <linux/debugfs.h>
89 96
90/* size of discovery_trace output line */ 97/* size of output line, for discovery_trace and slow_ring_trace */
91#define LPFC_DISC_TRC_ENTRY_SIZE 80 98#define LPFC_DEBUG_TRC_ENTRY_SIZE 100
92 99
93/* nodelist output buffer size */ 100/* nodelist output buffer size */
94#define LPFC_NODELIST_SIZE 8192 101#define LPFC_NODELIST_SIZE 8192
95#define LPFC_NODELIST_ENTRY_SIZE 120 102#define LPFC_NODELIST_ENTRY_SIZE 120
96 103
104/* dumpslim output buffer size */
105#define LPFC_DUMPSLIM_SIZE 4096
106
107/* hbqinfo output buffer size */
108#define LPFC_HBQINFO_SIZE 8192
109
97struct lpfc_debug { 110struct lpfc_debug {
98 char *buffer; 111 char *buffer;
99 int len; 112 int len;
100}; 113};
101 114
102atomic_t lpfc_debugfs_disc_trc_cnt = ATOMIC_INIT(0); 115static atomic_t lpfc_debugfs_seq_trc_cnt = ATOMIC_INIT(0);
103unsigned long lpfc_debugfs_start_time = 0L; 116static unsigned long lpfc_debugfs_start_time = 0L;
104 117
105static int 118static int
106lpfc_debugfs_disc_trc_data(struct lpfc_vport *vport, char *buf, int size) 119lpfc_debugfs_disc_trc_data(struct lpfc_vport *vport, char *buf, int size)
107{ 120{
108 int i, index, len, enable; 121 int i, index, len, enable;
109 uint32_t ms; 122 uint32_t ms;
110 struct lpfc_disc_trc *dtp; 123 struct lpfc_debugfs_trc *dtp;
111 char buffer[80]; 124 char buffer[LPFC_DEBUG_TRC_ENTRY_SIZE];
112 125
113 126
114 enable = lpfc_debugfs_enable; 127 enable = lpfc_debugfs_enable;
@@ -122,7 +135,8 @@ lpfc_debugfs_disc_trc_data(struct lpfc_vport *vport, char *buf, int size)
122 if (!dtp->fmt) 135 if (!dtp->fmt)
123 continue; 136 continue;
124 ms = jiffies_to_msecs(dtp->jif - lpfc_debugfs_start_time); 137 ms = jiffies_to_msecs(dtp->jif - lpfc_debugfs_start_time);
125 snprintf(buffer, 80, "%010d:%010d ms:%s\n", 138 snprintf(buffer,
139 LPFC_DEBUG_TRC_ENTRY_SIZE, "%010d:%010d ms:%s\n",
126 dtp->seq_cnt, ms, dtp->fmt); 140 dtp->seq_cnt, ms, dtp->fmt);
127 len += snprintf(buf+len, size-len, buffer, 141 len += snprintf(buf+len, size-len, buffer,
128 dtp->data1, dtp->data2, dtp->data3); 142 dtp->data1, dtp->data2, dtp->data3);
@@ -132,7 +146,8 @@ lpfc_debugfs_disc_trc_data(struct lpfc_vport *vport, char *buf, int size)
132 if (!dtp->fmt) 146 if (!dtp->fmt)
133 continue; 147 continue;
134 ms = jiffies_to_msecs(dtp->jif - lpfc_debugfs_start_time); 148 ms = jiffies_to_msecs(dtp->jif - lpfc_debugfs_start_time);
135 snprintf(buffer, 80, "%010d:%010d ms:%s\n", 149 snprintf(buffer,
150 LPFC_DEBUG_TRC_ENTRY_SIZE, "%010d:%010d ms:%s\n",
136 dtp->seq_cnt, ms, dtp->fmt); 151 dtp->seq_cnt, ms, dtp->fmt);
137 len += snprintf(buf+len, size-len, buffer, 152 len += snprintf(buf+len, size-len, buffer,
138 dtp->data1, dtp->data2, dtp->data3); 153 dtp->data1, dtp->data2, dtp->data3);
@@ -143,6 +158,236 @@ lpfc_debugfs_disc_trc_data(struct lpfc_vport *vport, char *buf, int size)
143} 158}
144 159
145static int 160static int
161lpfc_debugfs_slow_ring_trc_data(struct lpfc_hba *phba, char *buf, int size)
162{
163 int i, index, len, enable;
164 uint32_t ms;
165 struct lpfc_debugfs_trc *dtp;
166 char buffer[LPFC_DEBUG_TRC_ENTRY_SIZE];
167
168
169 enable = lpfc_debugfs_enable;
170 lpfc_debugfs_enable = 0;
171
172 len = 0;
173 index = (atomic_read(&phba->slow_ring_trc_cnt) + 1) &
174 (lpfc_debugfs_max_slow_ring_trc - 1);
175 for (i = index; i < lpfc_debugfs_max_slow_ring_trc; i++) {
176 dtp = phba->slow_ring_trc + i;
177 if (!dtp->fmt)
178 continue;
179 ms = jiffies_to_msecs(dtp->jif - lpfc_debugfs_start_time);
180 snprintf(buffer,
181 LPFC_DEBUG_TRC_ENTRY_SIZE, "%010d:%010d ms:%s\n",
182 dtp->seq_cnt, ms, dtp->fmt);
183 len += snprintf(buf+len, size-len, buffer,
184 dtp->data1, dtp->data2, dtp->data3);
185 }
186 for (i = 0; i < index; i++) {
187 dtp = phba->slow_ring_trc + i;
188 if (!dtp->fmt)
189 continue;
190 ms = jiffies_to_msecs(dtp->jif - lpfc_debugfs_start_time);
191 snprintf(buffer,
192 LPFC_DEBUG_TRC_ENTRY_SIZE, "%010d:%010d ms:%s\n",
193 dtp->seq_cnt, ms, dtp->fmt);
194 len += snprintf(buf+len, size-len, buffer,
195 dtp->data1, dtp->data2, dtp->data3);
196 }
197
198 lpfc_debugfs_enable = enable;
199 return len;
200}
201
202static int lpfc_debugfs_last_hbq = -1;
203
204static int
205lpfc_debugfs_hbqinfo_data(struct lpfc_hba *phba, char *buf, int size)
206{
207 int len = 0;
208 int cnt, i, j, found, posted, low;
209 uint32_t phys, raw_index, getidx;
210 struct lpfc_hbq_init *hip;
211 struct hbq_s *hbqs;
212 struct lpfc_hbq_entry *hbqe;
213 struct lpfc_dmabuf *d_buf;
214 struct hbq_dmabuf *hbq_buf;
215
216 cnt = LPFC_HBQINFO_SIZE;
217 spin_lock_irq(&phba->hbalock);
218
219 /* toggle between multiple hbqs, if any */
220 i = lpfc_sli_hbq_count();
221 if (i > 1) {
222 lpfc_debugfs_last_hbq++;
223 if (lpfc_debugfs_last_hbq >= i)
224 lpfc_debugfs_last_hbq = 0;
225 }
226 else
227 lpfc_debugfs_last_hbq = 0;
228
229 i = lpfc_debugfs_last_hbq;
230
231 len += snprintf(buf+len, size-len, "HBQ %d Info\n", i);
232
233 hbqs = &phba->hbqs[i];
234 posted = 0;
235 list_for_each_entry(d_buf, &hbqs->hbq_buffer_list, list)
236 posted++;
237
238 hip = lpfc_hbq_defs[i];
239 len += snprintf(buf+len, size-len,
240 "idx:%d prof:%d rn:%d bufcnt:%d icnt:%d acnt:%d posted %d\n",
241 hip->hbq_index, hip->profile, hip->rn,
242 hip->buffer_count, hip->init_count, hip->add_count, posted);
243
244 raw_index = phba->hbq_get[i];
245 getidx = le32_to_cpu(raw_index);
246 len += snprintf(buf+len, size-len,
247 "entrys:%d Put:%d nPut:%d localGet:%d hbaGet:%d\n",
248 hbqs->entry_count, hbqs->hbqPutIdx, hbqs->next_hbqPutIdx,
249 hbqs->local_hbqGetIdx, getidx);
250
251 hbqe = (struct lpfc_hbq_entry *) phba->hbqs[i].hbq_virt;
252 for (j=0; j<hbqs->entry_count; j++) {
253 len += snprintf(buf+len, size-len,
254 "%03d: %08x %04x %05x ", j,
255 hbqe->bde.addrLow, hbqe->bde.tus.w, hbqe->buffer_tag);
256
257 i = 0;
258 found = 0;
259
260 /* First calculate if slot has an associated posted buffer */
261 low = hbqs->hbqPutIdx - posted;
262 if (low >= 0) {
263 if ((j >= hbqs->hbqPutIdx) || (j < low)) {
264 len += snprintf(buf+len, size-len, "Unused\n");
265 goto skipit;
266 }
267 }
268 else {
269 if ((j >= hbqs->hbqPutIdx) &&
270 (j < (hbqs->entry_count+low))) {
271 len += snprintf(buf+len, size-len, "Unused\n");
272 goto skipit;
273 }
274 }
275
276 /* Get the Buffer info for the posted buffer */
277 list_for_each_entry(d_buf, &hbqs->hbq_buffer_list, list) {
278 hbq_buf = container_of(d_buf, struct hbq_dmabuf, dbuf);
279 phys = ((uint64_t)hbq_buf->dbuf.phys & 0xffffffff);
280 if (phys == hbqe->bde.addrLow) {
281 len += snprintf(buf+len, size-len,
282 "Buf%d: %p %06x\n", i,
283 hbq_buf->dbuf.virt, hbq_buf->tag);
284 found = 1;
285 break;
286 }
287 i++;
288 }
289 if (!found) {
290 len += snprintf(buf+len, size-len, "No DMAinfo?\n");
291 }
292skipit:
293 hbqe++;
294 if (len > LPFC_HBQINFO_SIZE - 54)
295 break;
296 }
297 spin_unlock_irq(&phba->hbalock);
298 return len;
299}
300
301static int
302lpfc_debugfs_dumpslim_data(struct lpfc_hba *phba, char *buf, int size)
303{
304 int len = 0;
305 int cnt, i, off;
306 uint32_t word0, word1, word2, word3;
307 uint32_t *ptr;
308 struct lpfc_pgp *pgpp;
309 struct lpfc_sli *psli = &phba->sli;
310 struct lpfc_sli_ring *pring;
311
312 cnt = LPFC_DUMPSLIM_SIZE;
313 off = 0;
314 spin_lock_irq(&phba->hbalock);
315
316 len += snprintf(buf+len, size-len, "SLIM Mailbox\n");
317 ptr = (uint32_t *)phba->slim2p;
318 i = sizeof(MAILBOX_t);
319 while (i > 0) {
320 len += snprintf(buf+len, size-len,
321 "%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
322 off, *ptr, *(ptr+1), *(ptr+2), *(ptr+3), *(ptr+4),
323 *(ptr+5), *(ptr+6), *(ptr+7));
324 ptr += 8;
325 i -= (8 * sizeof(uint32_t));
326 off += (8 * sizeof(uint32_t));
327 }
328
329 len += snprintf(buf+len, size-len, "SLIM PCB\n");
330 ptr = (uint32_t *)&phba->slim2p->pcb;
331 i = sizeof(PCB_t);
332 while (i > 0) {
333 len += snprintf(buf+len, size-len,
334 "%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
335 off, *ptr, *(ptr+1), *(ptr+2), *(ptr+3), *(ptr+4),
336 *(ptr+5), *(ptr+6), *(ptr+7));
337 ptr += 8;
338 i -= (8 * sizeof(uint32_t));
339 off += (8 * sizeof(uint32_t));
340 }
341
342 pgpp = (struct lpfc_pgp *)&phba->slim2p->mbx.us.s3_pgp.port;
343 pring = &psli->ring[0];
344 len += snprintf(buf+len, size-len,
345 "Ring 0: CMD GetInx:%d (Max:%d Next:%d Local:%d flg:x%x) "
346 "RSP PutInx:%d Max:%d\n",
347 pgpp->cmdGetInx, pring->numCiocb,
348 pring->next_cmdidx, pring->local_getidx, pring->flag,
349 pgpp->rspPutInx, pring->numRiocb);
350 pgpp++;
351
352 pring = &psli->ring[1];
353 len += snprintf(buf+len, size-len,
354 "Ring 1: CMD GetInx:%d (Max:%d Next:%d Local:%d flg:x%x) "
355 "RSP PutInx:%d Max:%d\n",
356 pgpp->cmdGetInx, pring->numCiocb,
357 pring->next_cmdidx, pring->local_getidx, pring->flag,
358 pgpp->rspPutInx, pring->numRiocb);
359 pgpp++;
360
361 pring = &psli->ring[2];
362 len += snprintf(buf+len, size-len,
363 "Ring 2: CMD GetInx:%d (Max:%d Next:%d Local:%d flg:x%x) "
364 "RSP PutInx:%d Max:%d\n",
365 pgpp->cmdGetInx, pring->numCiocb,
366 pring->next_cmdidx, pring->local_getidx, pring->flag,
367 pgpp->rspPutInx, pring->numRiocb);
368 pgpp++;
369
370 pring = &psli->ring[3];
371 len += snprintf(buf+len, size-len,
372 "Ring 3: CMD GetInx:%d (Max:%d Next:%d Local:%d flg:x%x) "
373 "RSP PutInx:%d Max:%d\n",
374 pgpp->cmdGetInx, pring->numCiocb,
375 pring->next_cmdidx, pring->local_getidx, pring->flag,
376 pgpp->rspPutInx, pring->numRiocb);
377
378
379 ptr = (uint32_t *)&phba->slim2p->mbx.us.s3_pgp.hbq_get;
380 word0 = readl(phba->HAregaddr);
381 word1 = readl(phba->CAregaddr);
382 word2 = readl(phba->HSregaddr);
383 word3 = readl(phba->HCregaddr);
384 len += snprintf(buf+len, size-len, "HA:%08x CA:%08x HS:%08x HC:%08x\n",
385 word0, word1, word2, word3);
386 spin_unlock_irq(&phba->hbalock);
387 return len;
388}
389
390static int
146lpfc_debugfs_nodelist_data(struct lpfc_vport *vport, char *buf, int size) 391lpfc_debugfs_nodelist_data(struct lpfc_vport *vport, char *buf, int size)
147{ 392{
148 int len = 0; 393 int len = 0;
@@ -204,7 +449,7 @@ lpfc_debugfs_nodelist_data(struct lpfc_vport *vport, char *buf, int size)
204 len += snprintf(buf+len, size-len, "RPI:%03d flag:x%08x ", 449 len += snprintf(buf+len, size-len, "RPI:%03d flag:x%08x ",
205 ndlp->nlp_rpi, ndlp->nlp_flag); 450 ndlp->nlp_rpi, ndlp->nlp_flag);
206 if (!ndlp->nlp_type) 451 if (!ndlp->nlp_type)
207 len += snprintf(buf+len, size-len, "UNKNOWN_TYPE"); 452 len += snprintf(buf+len, size-len, "UNKNOWN_TYPE ");
208 if (ndlp->nlp_type & NLP_FC_NODE) 453 if (ndlp->nlp_type & NLP_FC_NODE)
209 len += snprintf(buf+len, size-len, "FC_NODE "); 454 len += snprintf(buf+len, size-len, "FC_NODE ");
210 if (ndlp->nlp_type & NLP_FABRIC) 455 if (ndlp->nlp_type & NLP_FABRIC)
@@ -213,7 +458,9 @@ lpfc_debugfs_nodelist_data(struct lpfc_vport *vport, char *buf, int size)
213 len += snprintf(buf+len, size-len, "FCP_TGT sid:%d ", 458 len += snprintf(buf+len, size-len, "FCP_TGT sid:%d ",
214 ndlp->nlp_sid); 459 ndlp->nlp_sid);
215 if (ndlp->nlp_type & NLP_FCP_INITIATOR) 460 if (ndlp->nlp_type & NLP_FCP_INITIATOR)
216 len += snprintf(buf+len, size-len, "FCP_INITIATOR"); 461 len += snprintf(buf+len, size-len, "FCP_INITIATOR ");
462 len += snprintf(buf+len, size-len, "refcnt:%x",
463 atomic_read(&ndlp->kref.refcount));
217 len += snprintf(buf+len, size-len, "\n"); 464 len += snprintf(buf+len, size-len, "\n");
218 } 465 }
219 spin_unlock_irq(shost->host_lock); 466 spin_unlock_irq(shost->host_lock);
@@ -227,7 +474,7 @@ lpfc_debugfs_disc_trc(struct lpfc_vport *vport, int mask, char *fmt,
227 uint32_t data1, uint32_t data2, uint32_t data3) 474 uint32_t data1, uint32_t data2, uint32_t data3)
228{ 475{
229#ifdef CONFIG_LPFC_DEBUG_FS 476#ifdef CONFIG_LPFC_DEBUG_FS
230 struct lpfc_disc_trc *dtp; 477 struct lpfc_debugfs_trc *dtp;
231 int index; 478 int index;
232 479
233 if (!(lpfc_debugfs_mask_disc_trc & mask)) 480 if (!(lpfc_debugfs_mask_disc_trc & mask))
@@ -244,7 +491,32 @@ lpfc_debugfs_disc_trc(struct lpfc_vport *vport, int mask, char *fmt,
244 dtp->data1 = data1; 491 dtp->data1 = data1;
245 dtp->data2 = data2; 492 dtp->data2 = data2;
246 dtp->data3 = data3; 493 dtp->data3 = data3;
247 dtp->seq_cnt = atomic_inc_return(&lpfc_debugfs_disc_trc_cnt); 494 dtp->seq_cnt = atomic_inc_return(&lpfc_debugfs_seq_trc_cnt);
495 dtp->jif = jiffies;
496#endif
497 return;
498}
499
500inline void
501lpfc_debugfs_slow_ring_trc(struct lpfc_hba *phba, char *fmt,
502 uint32_t data1, uint32_t data2, uint32_t data3)
503{
504#ifdef CONFIG_LPFC_DEBUG_FS
505 struct lpfc_debugfs_trc *dtp;
506 int index;
507
508 if (!lpfc_debugfs_enable || !lpfc_debugfs_max_slow_ring_trc ||
509 !phba || !phba->slow_ring_trc)
510 return;
511
512 index = atomic_inc_return(&phba->slow_ring_trc_cnt) &
513 (lpfc_debugfs_max_slow_ring_trc - 1);
514 dtp = phba->slow_ring_trc + index;
515 dtp->fmt = fmt;
516 dtp->data1 = data1;
517 dtp->data2 = data2;
518 dtp->data3 = data3;
519 dtp->seq_cnt = atomic_inc_return(&lpfc_debugfs_seq_trc_cnt);
248 dtp->jif = jiffies; 520 dtp->jif = jiffies;
249#endif 521#endif
250 return; 522 return;
@@ -269,7 +541,7 @@ lpfc_debugfs_disc_trc_open(struct inode *inode, struct file *file)
269 goto out; 541 goto out;
270 542
271 /* Round to page boundry */ 543 /* Round to page boundry */
272 size = (lpfc_debugfs_max_disc_trc * LPFC_DISC_TRC_ENTRY_SIZE); 544 size = (lpfc_debugfs_max_disc_trc * LPFC_DEBUG_TRC_ENTRY_SIZE);
273 size = PAGE_ALIGN(size); 545 size = PAGE_ALIGN(size);
274 546
275 debug->buffer = kmalloc(size, GFP_KERNEL); 547 debug->buffer = kmalloc(size, GFP_KERNEL);
@@ -287,6 +559,95 @@ out:
287} 559}
288 560
289static int 561static int
562lpfc_debugfs_slow_ring_trc_open(struct inode *inode, struct file *file)
563{
564 struct lpfc_hba *phba = inode->i_private;
565 struct lpfc_debug *debug;
566 int size;
567 int rc = -ENOMEM;
568
569 if (!lpfc_debugfs_max_slow_ring_trc) {
570 rc = -ENOSPC;
571 goto out;
572 }
573
574 debug = kmalloc(sizeof(*debug), GFP_KERNEL);
575 if (!debug)
576 goto out;
577
578 /* Round to page boundry */
579 size = (lpfc_debugfs_max_slow_ring_trc * LPFC_DEBUG_TRC_ENTRY_SIZE);
580 size = PAGE_ALIGN(size);
581
582 debug->buffer = kmalloc(size, GFP_KERNEL);
583 if (!debug->buffer) {
584 kfree(debug);
585 goto out;
586 }
587
588 debug->len = lpfc_debugfs_slow_ring_trc_data(phba, debug->buffer, size);
589 file->private_data = debug;
590
591 rc = 0;
592out:
593 return rc;
594}
595
596static int
597lpfc_debugfs_hbqinfo_open(struct inode *inode, struct file *file)
598{
599 struct lpfc_hba *phba = inode->i_private;
600 struct lpfc_debug *debug;
601 int rc = -ENOMEM;
602
603 debug = kmalloc(sizeof(*debug), GFP_KERNEL);
604 if (!debug)
605 goto out;
606
607 /* Round to page boundry */
608 debug->buffer = kmalloc(LPFC_HBQINFO_SIZE, GFP_KERNEL);
609 if (!debug->buffer) {
610 kfree(debug);
611 goto out;
612 }
613
614 debug->len = lpfc_debugfs_hbqinfo_data(phba, debug->buffer,
615 LPFC_HBQINFO_SIZE);
616 file->private_data = debug;
617
618 rc = 0;
619out:
620 return rc;
621}
622
623static int
624lpfc_debugfs_dumpslim_open(struct inode *inode, struct file *file)
625{
626 struct lpfc_hba *phba = inode->i_private;
627 struct lpfc_debug *debug;
628 int rc = -ENOMEM;
629
630 debug = kmalloc(sizeof(*debug), GFP_KERNEL);
631 if (!debug)
632 goto out;
633
634 /* Round to page boundry */
635 debug->buffer = kmalloc(LPFC_DUMPSLIM_SIZE, GFP_KERNEL);
636 if (!debug->buffer) {
637 kfree(debug);
638 goto out;
639 }
640
641 debug->len = lpfc_debugfs_dumpslim_data(phba, debug->buffer,
642 LPFC_DUMPSLIM_SIZE);
643 file->private_data = debug;
644
645 rc = 0;
646out:
647 return rc;
648}
649
650static int
290lpfc_debugfs_nodelist_open(struct inode *inode, struct file *file) 651lpfc_debugfs_nodelist_open(struct inode *inode, struct file *file)
291{ 652{
292 struct lpfc_vport *vport = inode->i_private; 653 struct lpfc_vport *vport = inode->i_private;
@@ -372,6 +733,33 @@ static struct file_operations lpfc_debugfs_op_nodelist = {
372 .release = lpfc_debugfs_release, 733 .release = lpfc_debugfs_release,
373}; 734};
374 735
736#undef lpfc_debugfs_op_hbqinfo
737static struct file_operations lpfc_debugfs_op_hbqinfo = {
738 .owner = THIS_MODULE,
739 .open = lpfc_debugfs_hbqinfo_open,
740 .llseek = lpfc_debugfs_lseek,
741 .read = lpfc_debugfs_read,
742 .release = lpfc_debugfs_release,
743};
744
745#undef lpfc_debugfs_op_dumpslim
746static struct file_operations lpfc_debugfs_op_dumpslim = {
747 .owner = THIS_MODULE,
748 .open = lpfc_debugfs_dumpslim_open,
749 .llseek = lpfc_debugfs_lseek,
750 .read = lpfc_debugfs_read,
751 .release = lpfc_debugfs_release,
752};
753
754#undef lpfc_debugfs_op_slow_ring_trc
755static struct file_operations lpfc_debugfs_op_slow_ring_trc = {
756 .owner = THIS_MODULE,
757 .open = lpfc_debugfs_slow_ring_trc_open,
758 .llseek = lpfc_debugfs_lseek,
759 .read = lpfc_debugfs_read,
760 .release = lpfc_debugfs_release,
761};
762
375static struct dentry *lpfc_debugfs_root = NULL; 763static struct dentry *lpfc_debugfs_root = NULL;
376static atomic_t lpfc_debugfs_hba_count; 764static atomic_t lpfc_debugfs_hba_count;
377#endif 765#endif
@@ -387,60 +775,146 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
387 if (!lpfc_debugfs_enable) 775 if (!lpfc_debugfs_enable)
388 return; 776 return;
389 777
390 if (lpfc_debugfs_max_disc_trc) { 778 /* Setup lpfc root directory */
391 num = lpfc_debugfs_max_disc_trc - 1;
392 if (num & lpfc_debugfs_max_disc_trc) {
393 /* Change to be a power of 2 */
394 num = lpfc_debugfs_max_disc_trc;
395 i = 0;
396 while (num > 1) {
397 num = num >> 1;
398 i++;
399 }
400 lpfc_debugfs_max_disc_trc = (1 << i);
401 printk(KERN_ERR
402 "lpfc_debugfs_max_disc_trc changed to %d\n",
403 lpfc_debugfs_max_disc_trc);
404 }
405 }
406
407 if (!lpfc_debugfs_root) { 779 if (!lpfc_debugfs_root) {
408 lpfc_debugfs_root = debugfs_create_dir("lpfc", NULL); 780 lpfc_debugfs_root = debugfs_create_dir("lpfc", NULL);
409 atomic_set(&lpfc_debugfs_hba_count, 0); 781 atomic_set(&lpfc_debugfs_hba_count, 0);
410 if (!lpfc_debugfs_root) 782 if (!lpfc_debugfs_root) {
783 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
784 "0409 Cannot create debugfs root\n");
411 goto debug_failed; 785 goto debug_failed;
786 }
412 } 787 }
788 if (!lpfc_debugfs_start_time)
789 lpfc_debugfs_start_time = jiffies;
413 790
791 /* Setup lpfcX directory for specific HBA */
414 snprintf(name, sizeof(name), "lpfc%d", phba->brd_no); 792 snprintf(name, sizeof(name), "lpfc%d", phba->brd_no);
415 if (!phba->hba_debugfs_root) { 793 if (!phba->hba_debugfs_root) {
416 phba->hba_debugfs_root = 794 phba->hba_debugfs_root =
417 debugfs_create_dir(name, lpfc_debugfs_root); 795 debugfs_create_dir(name, lpfc_debugfs_root);
418 if (!phba->hba_debugfs_root) 796 if (!phba->hba_debugfs_root) {
797 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
798 "0409 Cannot create debugfs hba\n");
419 goto debug_failed; 799 goto debug_failed;
800 }
420 atomic_inc(&lpfc_debugfs_hba_count); 801 atomic_inc(&lpfc_debugfs_hba_count);
421 atomic_set(&phba->debugfs_vport_count, 0); 802 atomic_set(&phba->debugfs_vport_count, 0);
803
804 /* Setup hbqinfo */
805 snprintf(name, sizeof(name), "hbqinfo");
806 phba->debug_hbqinfo =
807 debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR,
808 phba->hba_debugfs_root,
809 phba, &lpfc_debugfs_op_hbqinfo);
810 if (!phba->debug_hbqinfo) {
811 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
812 "0409 Cannot create debugfs hbqinfo\n");
813 goto debug_failed;
814 }
815
816 /* Setup dumpslim */
817 snprintf(name, sizeof(name), "dumpslim");
818 phba->debug_dumpslim =
819 debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR,
820 phba->hba_debugfs_root,
821 phba, &lpfc_debugfs_op_dumpslim);
822 if (!phba->debug_dumpslim) {
823 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
824 "0409 Cannot create debugfs dumpslim\n");
825 goto debug_failed;
826 }
827
828 /* Setup slow ring trace */
829 if (lpfc_debugfs_max_slow_ring_trc) {
830 num = lpfc_debugfs_max_slow_ring_trc - 1;
831 if (num & lpfc_debugfs_max_slow_ring_trc) {
832 /* Change to be a power of 2 */
833 num = lpfc_debugfs_max_slow_ring_trc;
834 i = 0;
835 while (num > 1) {
836 num = num >> 1;
837 i++;
838 }
839 lpfc_debugfs_max_slow_ring_trc = (1 << i);
840 printk(KERN_ERR
841 "lpfc_debugfs_max_disc_trc changed to "
842 "%d\n", lpfc_debugfs_max_disc_trc);
843 }
844 }
845
846
847 snprintf(name, sizeof(name), "slow_ring_trace");
848 phba->debug_slow_ring_trc =
849 debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR,
850 phba->hba_debugfs_root,
851 phba, &lpfc_debugfs_op_slow_ring_trc);
852 if (!phba->debug_slow_ring_trc) {
853 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
854 "0409 Cannot create debugfs "
855 "slow_ring_trace\n");
856 goto debug_failed;
857 }
858 if (!phba->slow_ring_trc) {
859 phba->slow_ring_trc = kmalloc(
860 (sizeof(struct lpfc_debugfs_trc) *
861 lpfc_debugfs_max_slow_ring_trc),
862 GFP_KERNEL);
863 if (!phba->slow_ring_trc) {
864 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
865 "0409 Cannot create debugfs "
866 "slow_ring buffer\n");
867 goto debug_failed;
868 }
869 atomic_set(&phba->slow_ring_trc_cnt, 0);
870 memset(phba->slow_ring_trc, 0,
871 (sizeof(struct lpfc_debugfs_trc) *
872 lpfc_debugfs_max_slow_ring_trc));
873 }
422 } 874 }
423 875
424 snprintf(name, sizeof(name), "vport%d", vport->vpi); 876 snprintf(name, sizeof(name), "vport%d", vport->vpi);
425 if (!vport->vport_debugfs_root) { 877 if (!vport->vport_debugfs_root) {
426 vport->vport_debugfs_root = 878 vport->vport_debugfs_root =
427 debugfs_create_dir(name, phba->hba_debugfs_root); 879 debugfs_create_dir(name, phba->hba_debugfs_root);
428 if (!vport->vport_debugfs_root) 880 if (!vport->vport_debugfs_root) {
881 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
882 "0409 Cant create debugfs");
429 goto debug_failed; 883 goto debug_failed;
884 }
430 atomic_inc(&phba->debugfs_vport_count); 885 atomic_inc(&phba->debugfs_vport_count);
431 } 886 }
432 887
433 if (!lpfc_debugfs_start_time) 888 if (lpfc_debugfs_max_disc_trc) {
434 lpfc_debugfs_start_time = jiffies; 889 num = lpfc_debugfs_max_disc_trc - 1;
890 if (num & lpfc_debugfs_max_disc_trc) {
891 /* Change to be a power of 2 */
892 num = lpfc_debugfs_max_disc_trc;
893 i = 0;
894 while (num > 1) {
895 num = num >> 1;
896 i++;
897 }
898 lpfc_debugfs_max_disc_trc = (1 << i);
899 printk(KERN_ERR
900 "lpfc_debugfs_max_disc_trc changed to %d\n",
901 lpfc_debugfs_max_disc_trc);
902 }
903 }
435 904
436 vport->disc_trc = kmalloc( 905 vport->disc_trc = kmalloc(
437 (sizeof(struct lpfc_disc_trc) * lpfc_debugfs_max_disc_trc), 906 (sizeof(struct lpfc_debugfs_trc) * lpfc_debugfs_max_disc_trc),
438 GFP_KERNEL); 907 GFP_KERNEL);
439 908
440 if (!vport->disc_trc) 909 if (!vport->disc_trc) {
910 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
911 "0409 Cannot create debugfs disc trace "
912 "buffer\n");
441 goto debug_failed; 913 goto debug_failed;
914 }
915 atomic_set(&vport->disc_trc_cnt, 0);
442 memset(vport->disc_trc, 0, 916 memset(vport->disc_trc, 0,
443 (sizeof(struct lpfc_disc_trc) * lpfc_debugfs_max_disc_trc)); 917 (sizeof(struct lpfc_debugfs_trc) * lpfc_debugfs_max_disc_trc));
444 918
445 snprintf(name, sizeof(name), "discovery_trace"); 919 snprintf(name, sizeof(name), "discovery_trace");
446 vport->debug_disc_trc = 920 vport->debug_disc_trc =
@@ -448,9 +922,9 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
448 vport->vport_debugfs_root, 922 vport->vport_debugfs_root,
449 vport, &lpfc_debugfs_op_disc_trc); 923 vport, &lpfc_debugfs_op_disc_trc);
450 if (!vport->debug_disc_trc) { 924 if (!vport->debug_disc_trc) {
451 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 925 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
452 "%d:0409 Cannot create debugfs", 926 "0409 Cannot create debugfs "
453 phba->brd_no); 927 "discovery_trace\n");
454 goto debug_failed; 928 goto debug_failed;
455 } 929 }
456 snprintf(name, sizeof(name), "nodelist"); 930 snprintf(name, sizeof(name), "nodelist");
@@ -459,9 +933,8 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
459 vport->vport_debugfs_root, 933 vport->vport_debugfs_root,
460 vport, &lpfc_debugfs_op_nodelist); 934 vport, &lpfc_debugfs_op_nodelist);
461 if (!vport->debug_nodelist) { 935 if (!vport->debug_nodelist) {
462 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 936 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
463 "%d:0409 Cannot create debugfs", 937 "0409 Cant create debugfs nodelist");
464 phba->brd_no);
465 goto debug_failed; 938 goto debug_failed;
466 } 939 }
467debug_failed: 940debug_failed:
@@ -488,21 +961,45 @@ lpfc_debugfs_terminate(struct lpfc_vport *vport)
488 debugfs_remove(vport->debug_nodelist); /* nodelist */ 961 debugfs_remove(vport->debug_nodelist); /* nodelist */
489 vport->debug_nodelist = NULL; 962 vport->debug_nodelist = NULL;
490 } 963 }
964
491 if (vport->vport_debugfs_root) { 965 if (vport->vport_debugfs_root) {
492 debugfs_remove(vport->vport_debugfs_root); /* vportX */ 966 debugfs_remove(vport->vport_debugfs_root); /* vportX */
493 vport->vport_debugfs_root = NULL; 967 vport->vport_debugfs_root = NULL;
494 atomic_dec(&phba->debugfs_vport_count); 968 atomic_dec(&phba->debugfs_vport_count);
495 } 969 }
496 if (atomic_read(&phba->debugfs_vport_count) == 0) { 970 if (atomic_read(&phba->debugfs_vport_count) == 0) {
497 debugfs_remove(vport->phba->hba_debugfs_root); /* lpfcX */ 971
498 vport->phba->hba_debugfs_root = NULL; 972 if (phba->debug_hbqinfo) {
499 atomic_dec(&lpfc_debugfs_hba_count); 973 debugfs_remove(phba->debug_hbqinfo); /* hbqinfo */
974 phba->debug_hbqinfo = NULL;
975 }
976 if (phba->debug_dumpslim) {
977 debugfs_remove(phba->debug_dumpslim); /* dumpslim */
978 phba->debug_dumpslim = NULL;
979 }
980 if (phba->slow_ring_trc) {
981 kfree(phba->slow_ring_trc);
982 phba->slow_ring_trc = NULL;
983 }
984 if (phba->debug_slow_ring_trc) {
985 /* slow_ring_trace */
986 debugfs_remove(phba->debug_slow_ring_trc);
987 phba->debug_slow_ring_trc = NULL;
988 }
989
990 if (phba->hba_debugfs_root) {
991 debugfs_remove(phba->hba_debugfs_root); /* lpfcX */
992 phba->hba_debugfs_root = NULL;
993 atomic_dec(&lpfc_debugfs_hba_count);
994 }
995
500 if (atomic_read(&lpfc_debugfs_hba_count) == 0) { 996 if (atomic_read(&lpfc_debugfs_hba_count) == 0) {
501 debugfs_remove(lpfc_debugfs_root); /* lpfc */ 997 debugfs_remove(lpfc_debugfs_root); /* lpfc */
502 lpfc_debugfs_root = NULL; 998 lpfc_debugfs_root = NULL;
503 } 999 }
504 } 1000 }
505#endif 1001#endif
1002 return;
506} 1003}
507 1004
508 1005
diff --git a/drivers/scsi/lpfc/lpfc_debugfs.h b/drivers/scsi/lpfc/lpfc_debugfs.h
index fffb678426a4..31e86a55391d 100644
--- a/drivers/scsi/lpfc/lpfc_debugfs.h
+++ b/drivers/scsi/lpfc/lpfc_debugfs.h
@@ -22,7 +22,7 @@
22#define _H_LPFC_DEBUG_FS 22#define _H_LPFC_DEBUG_FS
23 23
24#ifdef CONFIG_LPFC_DEBUG_FS 24#ifdef CONFIG_LPFC_DEBUG_FS
25struct lpfc_disc_trc { 25struct lpfc_debugfs_trc {
26 char *fmt; 26 char *fmt;
27 uint32_t data1; 27 uint32_t data1;
28 uint32_t data2; 28 uint32_t data2;
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index 33fbc1666946..8085900635d4 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -63,10 +63,10 @@ lpfc_els_chk_latt(struct lpfc_vport *vport)
63 return 0; 63 return 0;
64 64
65 /* Pending Link Event during Discovery */ 65 /* Pending Link Event during Discovery */
66 lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, 66 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
67 "%d (%d):0237 Pending Link Event during " 67 "0237 Pending Link Event during "
68 "Discovery: State x%x\n", 68 "Discovery: State x%x\n",
69 phba->brd_no, vport->vpi, phba->pport->port_state); 69 phba->pport->port_state);
70 70
71 /* CLEAR_LA should re-enable link attention events and 71 /* CLEAR_LA should re-enable link attention events and
72 * we should then imediately take a LATT event. The 72 * we should then imediately take a LATT event. The
@@ -196,9 +196,7 @@ lpfc_prep_els_iocb(struct lpfc_vport *vport, uint8_t expectRsp,
196 bpl->tus.w = le32_to_cpu(bpl->tus.w); 196 bpl->tus.w = le32_to_cpu(bpl->tus.w);
197 } 197 }
198 198
199 /* Save for completion so we can release these resources */ 199 elsiocb->context1 = lpfc_nlp_get(ndlp);
200 if (elscmd != ELS_CMD_LS_RJT)
201 elsiocb->context1 = lpfc_nlp_get(ndlp);
202 elsiocb->context2 = pcmd; 200 elsiocb->context2 = pcmd;
203 elsiocb->context3 = pbuflist; 201 elsiocb->context3 = pbuflist;
204 elsiocb->retry = retry; 202 elsiocb->retry = retry;
@@ -208,23 +206,21 @@ lpfc_prep_els_iocb(struct lpfc_vport *vport, uint8_t expectRsp,
208 if (prsp) { 206 if (prsp) {
209 list_add(&prsp->list, &pcmd->list); 207 list_add(&prsp->list, &pcmd->list);
210 } 208 }
211
212 if (expectRsp) { 209 if (expectRsp) {
213 /* Xmit ELS command <elsCmd> to remote NPORT <did> */ 210 /* Xmit ELS command <elsCmd> to remote NPORT <did> */
214 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 211 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
215 "%d (%d):0116 Xmit ELS command x%x to remote " 212 "0116 Xmit ELS command x%x to remote "
216 "NPORT x%x I/O tag: x%x, port state: x%x\n", 213 "NPORT x%x I/O tag: x%x, port state: x%x\n",
217 phba->brd_no, vport->vpi, elscmd, did, 214 elscmd, did, elsiocb->iotag,
218 elsiocb->iotag, vport->port_state); 215 vport->port_state);
219 } else { 216 } else {
220 /* Xmit ELS response <elsCmd> to remote NPORT <did> */ 217 /* Xmit ELS response <elsCmd> to remote NPORT <did> */
221 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 218 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
222 "%d (%d):0117 Xmit ELS response x%x to remote " 219 "0117 Xmit ELS response x%x to remote "
223 "NPORT x%x I/O tag: x%x, size: x%x\n", 220 "NPORT x%x I/O tag: x%x, size: x%x\n",
224 phba->brd_no, vport->vpi, elscmd, 221 elscmd, ndlp->nlp_DID, elsiocb->iotag,
225 ndlp->nlp_DID, elsiocb->iotag, cmdSize); 222 cmdSize);
226 } 223 }
227
228 return elsiocb; 224 return elsiocb;
229} 225}
230 226
@@ -285,9 +281,8 @@ fail_free_mbox:
285 281
286fail: 282fail:
287 lpfc_vport_set_state(vport, FC_VPORT_FAILED); 283 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
288 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 284 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
289 "%d (%d):0249 Cannot issue Register Fabric login\n", 285 "0249 Cannot issue Register Fabric login\n");
290 phba->brd_no, vport->vpi);
291 return -ENXIO; 286 return -ENXIO;
292} 287}
293 288
@@ -340,20 +335,19 @@ lpfc_cmpl_els_flogi_fabric(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
340 335
341 if (phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) { 336 if (phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) {
342 if (sp->cmn.response_multiple_NPort) { 337 if (sp->cmn.response_multiple_NPort) {
343 lpfc_printf_log(phba, KERN_WARNING, LOG_ELS | LOG_VPORT, 338 lpfc_printf_vlog(vport, KERN_WARNING,
344 "%d:1816 FLOGI NPIV supported, " 339 LOG_ELS | LOG_VPORT,
345 "response data 0x%x\n", 340 "1816 FLOGI NPIV supported, "
346 phba->brd_no, 341 "response data 0x%x\n",
347 sp->cmn.response_multiple_NPort); 342 sp->cmn.response_multiple_NPort);
348 phba->link_flag |= LS_NPIV_FAB_SUPPORTED; 343 phba->link_flag |= LS_NPIV_FAB_SUPPORTED;
349
350 } else { 344 } else {
351 /* Because we asked f/w for NPIV it still expects us 345 /* Because we asked f/w for NPIV it still expects us
352 to call reg_vnpid atleast for the physcial host */ 346 to call reg_vnpid atleast for the physcial host */
353 lpfc_printf_log(phba, KERN_WARNING, LOG_ELS | LOG_VPORT, 347 lpfc_printf_vlog(vport, KERN_WARNING,
354 "%d:1817 Fabric does not support NPIV " 348 LOG_ELS | LOG_VPORT,
355 "- configuring single port mode.\n", 349 "1817 Fabric does not support NPIV "
356 phba->brd_no); 350 "- configuring single port mode.\n");
357 phba->link_flag &= ~LS_NPIV_FAB_SUPPORTED; 351 phba->link_flag &= ~LS_NPIV_FAB_SUPPORTED;
358 } 352 }
359 } 353 }
@@ -518,16 +512,15 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
518 * alpa map would take too long otherwise. 512 * alpa map would take too long otherwise.
519 */ 513 */
520 if (phba->alpa_map[0] == 0) { 514 if (phba->alpa_map[0] == 0) {
521 phba->cfg_discovery_threads = LPFC_MAX_DISC_THREADS; 515 vport->cfg_discovery_threads = LPFC_MAX_DISC_THREADS;
522 } 516 }
523 517
524 /* FLOGI failure */ 518 /* FLOGI failure */
525 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 519 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
526 "%d (%d):0100 FLOGI failure Data: x%x x%x " 520 "0100 FLOGI failure Data: x%x x%x "
527 "x%x\n", 521 "x%x\n",
528 phba->brd_no, vport->vpi, 522 irsp->ulpStatus, irsp->un.ulpWord[4],
529 irsp->ulpStatus, irsp->un.ulpWord[4], 523 irsp->ulpTimeout);
530 irsp->ulpTimeout);
531 goto flogifail; 524 goto flogifail;
532 } 525 }
533 526
@@ -540,12 +533,11 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
540 sp = prsp->virt + sizeof(uint32_t); 533 sp = prsp->virt + sizeof(uint32_t);
541 534
542 /* FLOGI completes successfully */ 535 /* FLOGI completes successfully */
543 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 536 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
544 "%d (%d):0101 FLOGI completes sucessfully " 537 "0101 FLOGI completes sucessfully "
545 "Data: x%x x%x x%x x%x\n", 538 "Data: x%x x%x x%x x%x\n",
546 phba->brd_no, vport->vpi, 539 irsp->un.ulpWord[4], sp->cmn.e_d_tov,
547 irsp->un.ulpWord[4], sp->cmn.e_d_tov, 540 sp->cmn.w2.r_a_tov, sp->cmn.edtovResolution);
548 sp->cmn.w2.r_a_tov, sp->cmn.edtovResolution);
549 541
550 if (vport->port_state == LPFC_FLOGI) { 542 if (vport->port_state == LPFC_FLOGI) {
551 /* 543 /*
@@ -662,8 +654,8 @@ lpfc_els_abort_flogi(struct lpfc_hba *phba)
662 654
663 /* Abort outstanding I/O on NPort <nlp_DID> */ 655 /* Abort outstanding I/O on NPort <nlp_DID> */
664 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 656 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY,
665 "%d:0201 Abort outstanding I/O on NPort x%x\n", 657 "0201 Abort outstanding I/O on NPort x%x\n",
666 phba->brd_no, Fabric_DID); 658 Fabric_DID);
667 659
668 pring = &phba->sli.ring[LPFC_ELS_RING]; 660 pring = &phba->sli.ring[LPFC_ELS_RING];
669 661
@@ -736,18 +728,16 @@ static void
736lpfc_more_plogi(struct lpfc_vport *vport) 728lpfc_more_plogi(struct lpfc_vport *vport)
737{ 729{
738 int sentplogi; 730 int sentplogi;
739 struct lpfc_hba *phba = vport->phba;
740 731
741 if (vport->num_disc_nodes) 732 if (vport->num_disc_nodes)
742 vport->num_disc_nodes--; 733 vport->num_disc_nodes--;
743 734
744 /* Continue discovery with <num_disc_nodes> PLOGIs to go */ 735 /* Continue discovery with <num_disc_nodes> PLOGIs to go */
745 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 736 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
746 "%d (%d):0232 Continue discovery with %d PLOGIs to go " 737 "0232 Continue discovery with %d PLOGIs to go "
747 "Data: x%x x%x x%x\n", 738 "Data: x%x x%x x%x\n",
748 phba->brd_no, vport->vpi, vport->num_disc_nodes, 739 vport->num_disc_nodes, vport->fc_plogi_cnt,
749 vport->fc_plogi_cnt, vport->fc_flag, vport->port_state); 740 vport->fc_flag, vport->port_state);
750
751 /* Check to see if there are more PLOGIs to be sent */ 741 /* Check to see if there are more PLOGIs to be sent */
752 if (vport->fc_flag & FC_NLP_MORE) 742 if (vport->fc_flag & FC_NLP_MORE)
753 /* go thru NPR nodes and issue any remaining ELS PLOGIs */ 743 /* go thru NPR nodes and issue any remaining ELS PLOGIs */
@@ -833,11 +823,12 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
833 823
834 ndlp = lpfc_findnode_did(vport, irsp->un.elsreq64.remoteID); 824 ndlp = lpfc_findnode_did(vport, irsp->un.elsreq64.remoteID);
835 if (!ndlp) { 825 if (!ndlp) {
836 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 826 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
837 "%d (%d):0136 PLOGI completes to NPort x%x " 827 "0136 PLOGI completes to NPort x%x "
838 "with no ndlp. Data: x%x x%x x%x\n", 828 "with no ndlp. Data: x%x x%x x%x\n",
839 phba->brd_no, vport->vpi, irsp->un.elsreq64.remoteID, 829 irsp->un.elsreq64.remoteID,
840 irsp->ulpStatus, irsp->un.ulpWord[4], irsp->ulpIoTag); 830 irsp->ulpStatus, irsp->un.ulpWord[4],
831 irsp->ulpIoTag);
841 goto out; 832 goto out;
842 } 833 }
843 834
@@ -851,13 +842,11 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
851 rc = 0; 842 rc = 0;
852 843
853 /* PLOGI completes to NPort <nlp_DID> */ 844 /* PLOGI completes to NPort <nlp_DID> */
854 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 845 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
855 "%d (%d):0102 PLOGI completes to NPort x%x " 846 "0102 PLOGI completes to NPort x%x "
856 "Data: x%x x%x x%x x%x x%x\n", 847 "Data: x%x x%x x%x x%x x%x\n",
857 phba->brd_no, vport->vpi, ndlp->nlp_DID, 848 ndlp->nlp_DID, irsp->ulpStatus, irsp->un.ulpWord[4],
858 irsp->ulpStatus, irsp->un.ulpWord[4], 849 irsp->ulpTimeout, disc, vport->num_disc_nodes);
859 irsp->ulpTimeout, disc, vport->num_disc_nodes);
860
861 /* Check to see if link went down during discovery */ 850 /* Check to see if link went down during discovery */
862 if (lpfc_els_chk_latt(vport)) { 851 if (lpfc_els_chk_latt(vport)) {
863 spin_lock_irq(shost->host_lock); 852 spin_lock_irq(shost->host_lock);
@@ -881,17 +870,14 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
881 } 870 }
882 goto out; 871 goto out;
883 } 872 }
884
885 /* PLOGI failed */ 873 /* PLOGI failed */
886 if (ndlp->nlp_DID == NameServer_DID) { 874 if (ndlp->nlp_DID == NameServer_DID) {
887 lpfc_vport_set_state(vport, FC_VPORT_FAILED); 875 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
888 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 876 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
889 "%d (%d):0250 Nameserver login error: " 877 "0250 Nameserver login error: "
890 "0x%x / 0x%x\n", 878 "0x%x / 0x%x\n",
891 phba->brd_no, vport->vpi, 879 irsp->ulpStatus, irsp->un.ulpWord[4]);
892 irsp->ulpStatus, irsp->un.ulpWord[4]);
893 } 880 }
894
895 /* Do not call DSM for lpfc_els_abort'ed ELS cmds */ 881 /* Do not call DSM for lpfc_els_abort'ed ELS cmds */
896 if (lpfc_error_lost_link(irsp)) { 882 if (lpfc_error_lost_link(irsp)) {
897 rc = NLP_STE_FREED_NODE; 883 rc = NLP_STE_FREED_NODE;
@@ -1017,14 +1003,12 @@ lpfc_cmpl_els_prli(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
1017 "PRLI cmpl: status:x%x/x%x did:x%x", 1003 "PRLI cmpl: status:x%x/x%x did:x%x",
1018 irsp->ulpStatus, irsp->un.ulpWord[4], 1004 irsp->ulpStatus, irsp->un.ulpWord[4],
1019 ndlp->nlp_DID); 1005 ndlp->nlp_DID);
1020
1021 /* PRLI completes to NPort <nlp_DID> */ 1006 /* PRLI completes to NPort <nlp_DID> */
1022 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 1007 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
1023 "%d (%d):0103 PRLI completes to NPort x%x " 1008 "0103 PRLI completes to NPort x%x "
1024 "Data: x%x x%x x%x x%x\n", 1009 "Data: x%x x%x x%x x%x\n",
1025 phba->brd_no, vport->vpi, ndlp->nlp_DID, 1010 ndlp->nlp_DID, irsp->ulpStatus, irsp->un.ulpWord[4],
1026 irsp->ulpStatus, irsp->un.ulpWord[4], irsp->ulpTimeout, 1011 irsp->ulpTimeout, vport->num_disc_nodes);
1027 vport->num_disc_nodes);
1028 1012
1029 vport->fc_prli_sent--; 1013 vport->fc_prli_sent--;
1030 /* Check to see if link went down during discovery */ 1014 /* Check to see if link went down during discovery */
@@ -1129,18 +1113,15 @@ static void
1129lpfc_more_adisc(struct lpfc_vport *vport) 1113lpfc_more_adisc(struct lpfc_vport *vport)
1130{ 1114{
1131 int sentadisc; 1115 int sentadisc;
1132 struct lpfc_hba *phba = vport->phba;
1133 1116
1134 if (vport->num_disc_nodes) 1117 if (vport->num_disc_nodes)
1135 vport->num_disc_nodes--; 1118 vport->num_disc_nodes--;
1136
1137 /* Continue discovery with <num_disc_nodes> ADISCs to go */ 1119 /* Continue discovery with <num_disc_nodes> ADISCs to go */
1138 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 1120 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
1139 "%d (%d):0210 Continue discovery with %d ADISCs to go " 1121 "0210 Continue discovery with %d ADISCs to go "
1140 "Data: x%x x%x x%x\n", 1122 "Data: x%x x%x x%x\n",
1141 phba->brd_no, vport->vpi, vport->num_disc_nodes, 1123 vport->num_disc_nodes, vport->fc_adisc_cnt,
1142 vport->fc_adisc_cnt, vport->fc_flag, vport->port_state); 1124 vport->fc_flag, vport->port_state);
1143
1144 /* Check to see if there are more ADISCs to be sent */ 1125 /* Check to see if there are more ADISCs to be sent */
1145 if (vport->fc_flag & FC_NLP_MORE) { 1126 if (vport->fc_flag & FC_NLP_MORE) {
1146 lpfc_set_disctmo(vport); 1127 lpfc_set_disctmo(vport);
@@ -1206,15 +1187,12 @@ lpfc_cmpl_els_adisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
1206 disc = (ndlp->nlp_flag & NLP_NPR_2B_DISC); 1187 disc = (ndlp->nlp_flag & NLP_NPR_2B_DISC);
1207 ndlp->nlp_flag &= ~(NLP_ADISC_SND | NLP_NPR_2B_DISC); 1188 ndlp->nlp_flag &= ~(NLP_ADISC_SND | NLP_NPR_2B_DISC);
1208 spin_unlock_irq(shost->host_lock); 1189 spin_unlock_irq(shost->host_lock);
1209
1210 /* ADISC completes to NPort <nlp_DID> */ 1190 /* ADISC completes to NPort <nlp_DID> */
1211 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 1191 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
1212 "%d (%d):0104 ADISC completes to NPort x%x " 1192 "0104 ADISC completes to NPort x%x "
1213 "Data: x%x x%x x%x x%x x%x\n", 1193 "Data: x%x x%x x%x x%x x%x\n",
1214 phba->brd_no, vport->vpi, ndlp->nlp_DID, 1194 ndlp->nlp_DID, irsp->ulpStatus, irsp->un.ulpWord[4],
1215 irsp->ulpStatus, irsp->un.ulpWord[4], irsp->ulpTimeout, 1195 irsp->ulpTimeout, disc, vport->num_disc_nodes);
1216 disc, vport->num_disc_nodes);
1217
1218 /* Check to see if link went down during discovery */ 1196 /* Check to see if link went down during discovery */
1219 if (lpfc_els_chk_latt(vport)) { 1197 if (lpfc_els_chk_latt(vport)) {
1220 spin_lock_irq(shost->host_lock); 1198 spin_lock_irq(shost->host_lock);
@@ -1374,15 +1352,12 @@ lpfc_cmpl_els_logo(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
1374 "LOGO cmpl: status:x%x/x%x did:x%x", 1352 "LOGO cmpl: status:x%x/x%x did:x%x",
1375 irsp->ulpStatus, irsp->un.ulpWord[4], 1353 irsp->ulpStatus, irsp->un.ulpWord[4],
1376 ndlp->nlp_DID); 1354 ndlp->nlp_DID);
1377
1378 /* LOGO completes to NPort <nlp_DID> */ 1355 /* LOGO completes to NPort <nlp_DID> */
1379 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 1356 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
1380 "%d (%d):0105 LOGO completes to NPort x%x " 1357 "0105 LOGO completes to NPort x%x "
1381 "Data: x%x x%x x%x x%x\n", 1358 "Data: x%x x%x x%x x%x\n",
1382 phba->brd_no, vport->vpi, ndlp->nlp_DID, 1359 ndlp->nlp_DID, irsp->ulpStatus, irsp->un.ulpWord[4],
1383 irsp->ulpStatus, irsp->un.ulpWord[4], irsp->ulpTimeout, 1360 irsp->ulpTimeout, vport->num_disc_nodes);
1384 vport->num_disc_nodes);
1385
1386 /* Check to see if link went down during discovery */ 1361 /* Check to see if link went down during discovery */
1387 if (lpfc_els_chk_latt(vport)) 1362 if (lpfc_els_chk_latt(vport))
1388 goto out; 1363 goto out;
@@ -1488,15 +1463,11 @@ lpfc_cmpl_els_cmd(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
1488 "ELS cmd cmpl: status:x%x/x%x did:x%x", 1463 "ELS cmd cmpl: status:x%x/x%x did:x%x",
1489 irsp->ulpStatus, irsp->un.ulpWord[4], 1464 irsp->ulpStatus, irsp->un.ulpWord[4],
1490 irsp->un.elsreq64.remoteID); 1465 irsp->un.elsreq64.remoteID);
1491
1492 /* ELS cmd tag <ulpIoTag> completes */ 1466 /* ELS cmd tag <ulpIoTag> completes */
1493 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 1467 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
1494 "%d (%d):0106 ELS cmd tag x%x completes Data: x%x x%x " 1468 "0106 ELS cmd tag x%x completes Data: x%x x%x x%x\n",
1495 "x%x\n", 1469 irsp->ulpIoTag, irsp->ulpStatus,
1496 phba->brd_no, vport->vpi, 1470 irsp->un.ulpWord[4], irsp->ulpTimeout);
1497 irsp->ulpIoTag, irsp->ulpStatus,
1498 irsp->un.ulpWord[4], irsp->ulpTimeout);
1499
1500 /* Check to see if link went down during discovery */ 1471 /* Check to see if link went down during discovery */
1501 lpfc_els_chk_latt(vport); 1472 lpfc_els_chk_latt(vport);
1502 lpfc_els_free_iocb(phba, cmdiocb); 1473 lpfc_els_free_iocb(phba, cmdiocb);
@@ -1831,13 +1802,15 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
1831 case IOERR_ILLEGAL_COMMAND: 1802 case IOERR_ILLEGAL_COMMAND:
1832 if ((phba->sli3_options & LPFC_SLI3_VPORT_TEARDOWN) && 1803 if ((phba->sli3_options & LPFC_SLI3_VPORT_TEARDOWN) &&
1833 (cmd == ELS_CMD_FDISC)) { 1804 (cmd == ELS_CMD_FDISC)) {
1834 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 1805 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
1835 "%d (%d):0124 FDISC failed (3/6) retrying...\n", 1806 "0124 FDISC failed (3/6) "
1836 phba->brd_no, vport->vpi); 1807 "retrying...\n");
1837 lpfc_mbx_unreg_vpi(vport); 1808 lpfc_mbx_unreg_vpi(vport);
1838 retry = 1; 1809 retry = 1;
1839 /* Always retry for this case */ 1810 /* FDISC retry policy */
1840 cmdiocb->retry = 0; 1811 maxretry = 48;
1812 if (cmdiocb->retry >= 32)
1813 delay = 1000;
1841 } 1814 }
1842 break; 1815 break;
1843 1816
@@ -1898,10 +1871,10 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
1898 if ((phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) && 1871 if ((phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) &&
1899 (cmd == ELS_CMD_FDISC) && 1872 (cmd == ELS_CMD_FDISC) &&
1900 (stat.un.b.lsRjtRsnCodeExp == LSEXP_OUT_OF_RESOURCE)){ 1873 (stat.un.b.lsRjtRsnCodeExp == LSEXP_OUT_OF_RESOURCE)){
1901 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 1874 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
1902 "%d (%d):0125 FDISC Failed (x%x)." 1875 "0125 FDISC Failed (x%x). "
1903 " Fabric out of resources\n", 1876 "Fabric out of resources\n",
1904 phba->brd_no, vport->vpi, stat.un.lsRjtError); 1877 stat.un.lsRjtError);
1905 lpfc_vport_set_state(vport, 1878 lpfc_vport_set_state(vport,
1906 FC_VPORT_NO_FABRIC_RSCS); 1879 FC_VPORT_NO_FABRIC_RSCS);
1907 } 1880 }
@@ -1913,8 +1886,10 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
1913 delay = 1000; 1886 delay = 1000;
1914 maxretry = 48; 1887 maxretry = 48;
1915 } else if (cmd == ELS_CMD_FDISC) { 1888 } else if (cmd == ELS_CMD_FDISC) {
1916 /* Always retry for this case */ 1889 /* FDISC retry policy */
1917 cmdiocb->retry = 0; 1890 maxretry = 48;
1891 if (cmdiocb->retry >= 32)
1892 delay = 1000;
1918 } 1893 }
1919 retry = 1; 1894 retry = 1;
1920 break; 1895 break;
@@ -1926,10 +1901,10 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
1926 ((stat.un.b.lsRjtRsnCodeExp == LSEXP_INVALID_PNAME) || 1901 ((stat.un.b.lsRjtRsnCodeExp == LSEXP_INVALID_PNAME) ||
1927 (stat.un.b.lsRjtRsnCodeExp == LSEXP_INVALID_NPORT_ID)) 1902 (stat.un.b.lsRjtRsnCodeExp == LSEXP_INVALID_NPORT_ID))
1928 ) { 1903 ) {
1929 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 1904 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
1930 "%d (%d):0123 FDISC Failed (x%x)." 1905 "0123 FDISC Failed (x%x). "
1931 " Fabric Detected Bad WWN\n", 1906 "Fabric Detected Bad WWN\n",
1932 phba->brd_no, vport->vpi, stat.un.lsRjtError); 1907 stat.un.lsRjtError);
1933 lpfc_vport_set_state(vport, 1908 lpfc_vport_set_state(vport,
1934 FC_VPORT_FABRIC_REJ_WWN); 1909 FC_VPORT_FABRIC_REJ_WWN);
1935 } 1910 }
@@ -1959,11 +1934,10 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
1959 if (retry) { 1934 if (retry) {
1960 1935
1961 /* Retry ELS command <elsCmd> to remote NPORT <did> */ 1936 /* Retry ELS command <elsCmd> to remote NPORT <did> */
1962 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 1937 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
1963 "%d (%d):0107 Retry ELS command x%x to remote " 1938 "0107 Retry ELS command x%x to remote "
1964 "NPORT x%x Data: x%x x%x\n", 1939 "NPORT x%x Data: x%x x%x\n",
1965 phba->brd_no, vport->vpi, 1940 cmd, did, cmdiocb->retry, delay);
1966 cmd, did, cmdiocb->retry, delay);
1967 1941
1968 if (((cmd == ELS_CMD_PLOGI) || (cmd == ELS_CMD_ADISC)) && 1942 if (((cmd == ELS_CMD_PLOGI) || (cmd == ELS_CMD_ADISC)) &&
1969 ((irsp->ulpStatus != IOSTAT_LOCAL_REJECT) || 1943 ((irsp->ulpStatus != IOSTAT_LOCAL_REJECT) ||
@@ -2031,14 +2005,12 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
2031 return 1; 2005 return 1;
2032 } 2006 }
2033 } 2007 }
2034
2035 /* No retry ELS command <elsCmd> to remote NPORT <did> */ 2008 /* No retry ELS command <elsCmd> to remote NPORT <did> */
2036 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 2009 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
2037 "%d (%d):0108 No retry ELS command x%x to remote " 2010 "0108 No retry ELS command x%x to remote "
2038 "NPORT x%x Data: x%x\n", 2011 "NPORT x%x Retried:%d Error:x%x/%x\n",
2039 phba->brd_no, vport->vpi, 2012 cmd, did, cmdiocb->retry, irsp->ulpStatus,
2040 cmd, did, cmdiocb->retry); 2013 irsp->un.ulpWord[4]);
2041
2042 return 0; 2014 return 0;
2043} 2015}
2044 2016
@@ -2087,14 +2059,12 @@ lpfc_cmpl_els_logo_acc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
2087 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, 2059 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP,
2088 "ACC LOGO cmpl: status:x%x/x%x did:x%x", 2060 "ACC LOGO cmpl: status:x%x/x%x did:x%x",
2089 irsp->ulpStatus, irsp->un.ulpWord[4], ndlp->nlp_DID); 2061 irsp->ulpStatus, irsp->un.ulpWord[4], ndlp->nlp_DID);
2090
2091 /* ACC to LOGO completes to NPort <nlp_DID> */ 2062 /* ACC to LOGO completes to NPort <nlp_DID> */
2092 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 2063 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
2093 "%d (%d):0109 ACC to LOGO completes to NPort x%x " 2064 "0109 ACC to LOGO completes to NPort x%x "
2094 "Data: x%x x%x x%x\n", 2065 "Data: x%x x%x x%x\n",
2095 phba->brd_no, vport->vpi, ndlp->nlp_DID, 2066 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
2096 ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi); 2067 ndlp->nlp_rpi);
2097
2098 switch (ndlp->nlp_state) { 2068 switch (ndlp->nlp_state) {
2099 case NLP_STE_UNUSED_NODE: /* node is just allocated */ 2069 case NLP_STE_UNUSED_NODE: /* node is just allocated */
2100 lpfc_drop_node(vport, ndlp); 2070 lpfc_drop_node(vport, ndlp);
@@ -2153,20 +2123,17 @@ lpfc_cmpl_els_rsp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
2153 } 2123 }
2154 2124
2155 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, 2125 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP,
2156 "ACC cmpl: status:x%x/x%x did:x%x", 2126 "ELS rsp cmpl: status:x%x/x%x did:x%x",
2157 irsp->ulpStatus, irsp->un.ulpWord[4], 2127 irsp->ulpStatus, irsp->un.ulpWord[4],
2158 irsp->un.rcvels.remoteID); 2128 cmdiocb->iocb.un.elsreq64.remoteID);
2159
2160 /* ELS response tag <ulpIoTag> completes */ 2129 /* ELS response tag <ulpIoTag> completes */
2161 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 2130 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
2162 "%d (%d):0110 ELS response tag x%x completes " 2131 "0110 ELS response tag x%x completes "
2163 "Data: x%x x%x x%x x%x x%x x%x x%x\n", 2132 "Data: x%x x%x x%x x%x x%x x%x x%x\n",
2164 phba->brd_no, vport->vpi, 2133 cmdiocb->iocb.ulpIoTag, rspiocb->iocb.ulpStatus,
2165 cmdiocb->iocb.ulpIoTag, rspiocb->iocb.ulpStatus, 2134 rspiocb->iocb.un.ulpWord[4], rspiocb->iocb.ulpTimeout,
2166 rspiocb->iocb.un.ulpWord[4], rspiocb->iocb.ulpTimeout, 2135 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
2167 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, 2136 ndlp->nlp_rpi);
2168 ndlp->nlp_rpi);
2169
2170 if (mbox) { 2137 if (mbox) {
2171 if ((rspiocb->iocb.ulpStatus == 0) 2138 if ((rspiocb->iocb.ulpStatus == 0)
2172 && (ndlp->nlp_flag & NLP_ACC_REGLOGIN)) { 2139 && (ndlp->nlp_flag & NLP_ACC_REGLOGIN)) {
@@ -2219,7 +2186,7 @@ out:
2219int 2186int
2220lpfc_els_rsp_acc(struct lpfc_vport *vport, uint32_t flag, 2187lpfc_els_rsp_acc(struct lpfc_vport *vport, uint32_t flag,
2221 struct lpfc_iocbq *oldiocb, struct lpfc_nodelist *ndlp, 2188 struct lpfc_iocbq *oldiocb, struct lpfc_nodelist *ndlp,
2222 LPFC_MBOXQ_t *mbox, uint8_t newnode) 2189 LPFC_MBOXQ_t *mbox)
2223{ 2190{
2224 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 2191 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
2225 struct lpfc_hba *phba = vport->phba; 2192 struct lpfc_hba *phba = vport->phba;
@@ -2305,20 +2272,13 @@ lpfc_els_rsp_acc(struct lpfc_vport *vport, uint32_t flag,
2305 default: 2272 default:
2306 return 1; 2273 return 1;
2307 } 2274 }
2308
2309 if (newnode) {
2310 lpfc_nlp_put(ndlp);
2311 elsiocb->context1 = NULL;
2312 }
2313
2314 /* Xmit ELS ACC response tag <ulpIoTag> */ 2275 /* Xmit ELS ACC response tag <ulpIoTag> */
2315 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 2276 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
2316 "%d (%d):0128 Xmit ELS ACC response tag x%x, XRI: x%x, " 2277 "0128 Xmit ELS ACC response tag x%x, XRI: x%x, "
2317 "DID: x%x, nlp_flag: x%x nlp_state: x%x RPI: x%x\n", 2278 "DID: x%x, nlp_flag: x%x nlp_state: x%x RPI: x%x\n",
2318 phba->brd_no, vport->vpi, elsiocb->iotag, 2279 elsiocb->iotag, elsiocb->iocb.ulpContext,
2319 elsiocb->iocb.ulpContext, ndlp->nlp_DID, 2280 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
2320 ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi); 2281 ndlp->nlp_rpi);
2321
2322 if (ndlp->nlp_flag & NLP_LOGO_ACC) { 2282 if (ndlp->nlp_flag & NLP_LOGO_ACC) {
2323 spin_lock_irq(shost->host_lock); 2283 spin_lock_irq(shost->host_lock);
2324 ndlp->nlp_flag &= ~NLP_LOGO_ACC; 2284 ndlp->nlp_flag &= ~NLP_LOGO_ACC;
@@ -2370,20 +2330,17 @@ lpfc_els_rsp_reject(struct lpfc_vport *vport, uint32_t rejectError,
2370 pcmd += sizeof(uint32_t); 2330 pcmd += sizeof(uint32_t);
2371 *((uint32_t *) (pcmd)) = rejectError; 2331 *((uint32_t *) (pcmd)) = rejectError;
2372 2332
2373 if (mbox) { 2333 if (mbox)
2374 elsiocb->context_un.mbox = mbox; 2334 elsiocb->context_un.mbox = mbox;
2375 elsiocb->context1 = lpfc_nlp_get(ndlp);
2376 }
2377 2335
2378 /* Xmit ELS RJT <err> response tag <ulpIoTag> */ 2336 /* Xmit ELS RJT <err> response tag <ulpIoTag> */
2379 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 2337 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
2380 "%d (%d):0129 Xmit ELS RJT x%x response tag x%x " 2338 "0129 Xmit ELS RJT x%x response tag x%x "
2381 "xri x%x, did x%x, nlp_flag x%x, nlp_state x%x, " 2339 "xri x%x, did x%x, nlp_flag x%x, nlp_state x%x, "
2382 "rpi x%x\n", 2340 "rpi x%x\n",
2383 phba->brd_no, vport->vpi, rejectError, elsiocb->iotag, 2341 rejectError, elsiocb->iotag,
2384 elsiocb->iocb.ulpContext, ndlp->nlp_DID, 2342 elsiocb->iocb.ulpContext, ndlp->nlp_DID,
2385 ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi); 2343 ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi);
2386
2387 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, 2344 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP,
2388 "Issue LS_RJT: did:x%x flg:x%x err:x%x", 2345 "Issue LS_RJT: did:x%x flg:x%x err:x%x",
2389 ndlp->nlp_DID, ndlp->nlp_flag, rejectError); 2346 ndlp->nlp_DID, ndlp->nlp_flag, rejectError);
@@ -2391,6 +2348,15 @@ lpfc_els_rsp_reject(struct lpfc_vport *vport, uint32_t rejectError,
2391 phba->fc_stat.elsXmitLSRJT++; 2348 phba->fc_stat.elsXmitLSRJT++;
2392 elsiocb->iocb_cmpl = lpfc_cmpl_els_rsp; 2349 elsiocb->iocb_cmpl = lpfc_cmpl_els_rsp;
2393 rc = lpfc_sli_issue_iocb(phba, pring, elsiocb, 0); 2350 rc = lpfc_sli_issue_iocb(phba, pring, elsiocb, 0);
2351
2352 /* If the node is in the UNUSED state, and we are sending
2353 * a reject, we are done with it. Release driver reference
2354 * count here. The outstanding els will release its reference on
2355 * completion and the node can be freed then.
2356 */
2357 if (ndlp->nlp_state == NLP_STE_UNUSED_NODE)
2358 lpfc_nlp_put(ndlp);
2359
2394 if (rc == IOCB_ERROR) { 2360 if (rc == IOCB_ERROR) {
2395 lpfc_els_free_iocb(phba, elsiocb); 2361 lpfc_els_free_iocb(phba, elsiocb);
2396 return 1; 2362 return 1;
@@ -2423,13 +2389,12 @@ lpfc_els_rsp_adisc_acc(struct lpfc_vport *vport, struct lpfc_iocbq *oldiocb,
2423 icmd->ulpContext = oldcmd->ulpContext; /* Xri */ 2389 icmd->ulpContext = oldcmd->ulpContext; /* Xri */
2424 2390
2425 /* Xmit ADISC ACC response tag <ulpIoTag> */ 2391 /* Xmit ADISC ACC response tag <ulpIoTag> */
2426 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 2392 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
2427 "%d (%d):0130 Xmit ADISC ACC response iotag x%x xri: " 2393 "0130 Xmit ADISC ACC response iotag x%x xri: "
2428 "x%x, did x%x, nlp_flag x%x, nlp_state x%x rpi x%x\n", 2394 "x%x, did x%x, nlp_flag x%x, nlp_state x%x rpi x%x\n",
2429 phba->brd_no, vport->vpi, elsiocb->iotag, 2395 elsiocb->iotag, elsiocb->iocb.ulpContext,
2430 elsiocb->iocb.ulpContext, ndlp->nlp_DID, 2396 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
2431 ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi); 2397 ndlp->nlp_rpi);
2432
2433 pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt); 2398 pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt);
2434 2399
2435 *((uint32_t *) (pcmd)) = ELS_CMD_ACC; 2400 *((uint32_t *) (pcmd)) = ELS_CMD_ACC;
@@ -2483,15 +2448,13 @@ lpfc_els_rsp_prli_acc(struct lpfc_vport *vport, struct lpfc_iocbq *oldiocb,
2483 icmd = &elsiocb->iocb; 2448 icmd = &elsiocb->iocb;
2484 oldcmd = &oldiocb->iocb; 2449 oldcmd = &oldiocb->iocb;
2485 icmd->ulpContext = oldcmd->ulpContext; /* Xri */ 2450 icmd->ulpContext = oldcmd->ulpContext; /* Xri */
2486
2487 /* Xmit PRLI ACC response tag <ulpIoTag> */ 2451 /* Xmit PRLI ACC response tag <ulpIoTag> */
2488 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 2452 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
2489 "%d (%d):0131 Xmit PRLI ACC response tag x%x xri x%x, " 2453 "0131 Xmit PRLI ACC response tag x%x xri x%x, "
2490 "did x%x, nlp_flag x%x, nlp_state x%x, rpi x%x\n", 2454 "did x%x, nlp_flag x%x, nlp_state x%x, rpi x%x\n",
2491 phba->brd_no, vport->vpi, elsiocb->iotag, 2455 elsiocb->iotag, elsiocb->iocb.ulpContext,
2492 elsiocb->iocb.ulpContext, ndlp->nlp_DID, 2456 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
2493 ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi); 2457 ndlp->nlp_rpi);
2494
2495 pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt); 2458 pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt);
2496 2459
2497 *((uint32_t *) (pcmd)) = (ELS_CMD_ACC | (ELS_CMD_PRLI & ~ELS_RSP_MASK)); 2460 *((uint32_t *) (pcmd)) = (ELS_CMD_ACC | (ELS_CMD_PRLI & ~ELS_RSP_MASK));
@@ -2565,16 +2528,11 @@ lpfc_els_rsp_rnid_acc(struct lpfc_vport *vport, uint8_t format,
2565 icmd = &elsiocb->iocb; 2528 icmd = &elsiocb->iocb;
2566 oldcmd = &oldiocb->iocb; 2529 oldcmd = &oldiocb->iocb;
2567 icmd->ulpContext = oldcmd->ulpContext; /* Xri */ 2530 icmd->ulpContext = oldcmd->ulpContext; /* Xri */
2568
2569 /* Xmit RNID ACC response tag <ulpIoTag> */ 2531 /* Xmit RNID ACC response tag <ulpIoTag> */
2570 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 2532 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
2571 "%d (%d):0132 Xmit RNID ACC response tag x%x " 2533 "0132 Xmit RNID ACC response tag x%x xri x%x\n",
2572 "xri x%x\n", 2534 elsiocb->iotag, elsiocb->iocb.ulpContext);
2573 phba->brd_no, vport->vpi, elsiocb->iotag,
2574 elsiocb->iocb.ulpContext);
2575
2576 pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt); 2535 pcmd = (uint8_t *) (((struct lpfc_dmabuf *) elsiocb->context2)->virt);
2577
2578 *((uint32_t *) (pcmd)) = ELS_CMD_ACC; 2536 *((uint32_t *) (pcmd)) = ELS_CMD_ACC;
2579 pcmd += sizeof(uint32_t); 2537 pcmd += sizeof(uint32_t);
2580 2538
@@ -2641,7 +2599,7 @@ lpfc_els_disc_adisc(struct lpfc_vport *vport)
2641 sentadisc++; 2599 sentadisc++;
2642 vport->num_disc_nodes++; 2600 vport->num_disc_nodes++;
2643 if (vport->num_disc_nodes >= 2601 if (vport->num_disc_nodes >=
2644 vport->phba->cfg_discovery_threads) { 2602 vport->cfg_discovery_threads) {
2645 spin_lock_irq(shost->host_lock); 2603 spin_lock_irq(shost->host_lock);
2646 vport->fc_flag |= FC_NLP_MORE; 2604 vport->fc_flag |= FC_NLP_MORE;
2647 spin_unlock_irq(shost->host_lock); 2605 spin_unlock_irq(shost->host_lock);
@@ -2676,7 +2634,7 @@ lpfc_els_disc_plogi(struct lpfc_vport *vport)
2676 sentplogi++; 2634 sentplogi++;
2677 vport->num_disc_nodes++; 2635 vport->num_disc_nodes++;
2678 if (vport->num_disc_nodes >= 2636 if (vport->num_disc_nodes >=
2679 vport->phba->cfg_discovery_threads) { 2637 vport->cfg_discovery_threads) {
2680 spin_lock_irq(shost->host_lock); 2638 spin_lock_irq(shost->host_lock);
2681 vport->fc_flag |= FC_NLP_MORE; 2639 vport->fc_flag |= FC_NLP_MORE;
2682 spin_unlock_irq(shost->host_lock); 2640 spin_unlock_irq(shost->host_lock);
@@ -2717,7 +2675,6 @@ lpfc_rscn_payload_check(struct lpfc_vport *vport, uint32_t did)
2717 D_ID rscn_did; 2675 D_ID rscn_did;
2718 uint32_t *lp; 2676 uint32_t *lp;
2719 uint32_t payload_len, i; 2677 uint32_t payload_len, i;
2720 struct lpfc_hba *phba = vport->phba;
2721 2678
2722 ns_did.un.word = did; 2679 ns_did.un.word = did;
2723 2680
@@ -2752,12 +2709,10 @@ lpfc_rscn_payload_check(struct lpfc_vport *vport, uint32_t did)
2752 break; 2709 break;
2753 default: 2710 default:
2754 /* Unknown Identifier in RSCN node */ 2711 /* Unknown Identifier in RSCN node */
2755 lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, 2712 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
2756 "%d (%d):0217 Unknown " 2713 "0217 Unknown Identifier in "
2757 "Identifier in RSCN payload " 2714 "RSCN payload Data: x%x\n",
2758 "Data: x%x\n", 2715 rscn_did.un.word);
2759 phba->brd_no, vport->vpi,
2760 rscn_did.un.word);
2761 case 3: /* Whole Fabric effected */ 2716 case 3: /* Whole Fabric effected */
2762 return did; 2717 return did;
2763 } 2718 }
@@ -2796,12 +2751,11 @@ lpfc_rscn_recovery_check(struct lpfc_vport *vport)
2796 2751
2797static int 2752static int
2798lpfc_els_rcv_rscn(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, 2753lpfc_els_rcv_rscn(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
2799 struct lpfc_nodelist *ndlp, uint8_t newnode) 2754 struct lpfc_nodelist *ndlp)
2800{ 2755{
2801 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 2756 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
2802 struct lpfc_hba *phba = vport->phba; 2757 struct lpfc_hba *phba = vport->phba;
2803 struct lpfc_dmabuf *pcmd; 2758 struct lpfc_dmabuf *pcmd;
2804 struct lpfc_vport *next_vport;
2805 uint32_t *lp, *datap; 2759 uint32_t *lp, *datap;
2806 IOCB_t *icmd; 2760 IOCB_t *icmd;
2807 uint32_t payload_len, length, nportid, *cmd; 2761 uint32_t payload_len, length, nportid, *cmd;
@@ -2815,13 +2769,10 @@ lpfc_els_rcv_rscn(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
2815 2769
2816 payload_len = be32_to_cpu(*lp++ & ~ELS_CMD_MASK); 2770 payload_len = be32_to_cpu(*lp++ & ~ELS_CMD_MASK);
2817 payload_len -= sizeof(uint32_t); /* take off word 0 */ 2771 payload_len -= sizeof(uint32_t); /* take off word 0 */
2818
2819 /* RSCN received */ 2772 /* RSCN received */
2820 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 2773 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
2821 "%d (%d):0214 RSCN received Data: x%x x%x x%x x%x\n", 2774 "0214 RSCN received Data: x%x x%x x%x x%x\n",
2822 phba->brd_no, vport->vpi, vport->fc_flag, payload_len, 2775 vport->fc_flag, payload_len, *lp, rscn_cnt);
2823 *lp, rscn_cnt);
2824
2825 for (i = 0; i < payload_len/sizeof(uint32_t); i++) 2776 for (i = 0; i < payload_len/sizeof(uint32_t); i++)
2826 fc_host_post_event(shost, fc_get_event_number(), 2777 fc_host_post_event(shost, fc_get_event_number(),
2827 FCH_EVT_RSCN, lp[i]); 2778 FCH_EVT_RSCN, lp[i]);
@@ -2834,8 +2785,7 @@ lpfc_els_rcv_rscn(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
2834 "RCV RSCN ignore: did:x%x/ste:x%x flg:x%x", 2785 "RCV RSCN ignore: did:x%x/ste:x%x flg:x%x",
2835 ndlp->nlp_DID, vport->port_state, ndlp->nlp_flag); 2786 ndlp->nlp_DID, vport->port_state, ndlp->nlp_flag);
2836 2787
2837 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 2788 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL);
2838 newnode);
2839 return 0; 2789 return 0;
2840 } 2790 }
2841 2791
@@ -2843,7 +2793,7 @@ lpfc_els_rcv_rscn(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
2843 * just ACC and ignore it. 2793 * just ACC and ignore it.
2844 */ 2794 */
2845 if ((phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) && 2795 if ((phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) &&
2846 !(phba->cfg_peer_port_login)) { 2796 !(vport->cfg_peer_port_login)) {
2847 i = payload_len; 2797 i = payload_len;
2848 datap = lp; 2798 datap = lp;
2849 while (i > 0) { 2799 while (i > 0) {
@@ -2851,28 +2801,23 @@ lpfc_els_rcv_rscn(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
2851 nportid = ((be32_to_cpu(nportid)) & Mask_DID); 2801 nportid = ((be32_to_cpu(nportid)) & Mask_DID);
2852 i -= sizeof(uint32_t); 2802 i -= sizeof(uint32_t);
2853 rscn_id++; 2803 rscn_id++;
2854 list_for_each_entry(next_vport, &phba->port_list, 2804 if (lpfc_find_vport_by_did(phba, nportid))
2855 listentry) { 2805 hba_id++;
2856 if (nportid == next_vport->fc_myDID) {
2857 hba_id++;
2858 break;
2859 }
2860 }
2861 } 2806 }
2862 if (rscn_id == hba_id) { 2807 if (rscn_id == hba_id) {
2863 /* ALL NPortIDs in RSCN are on HBA */ 2808 /* ALL NPortIDs in RSCN are on HBA */
2864 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 2809 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
2865 "%d (%d):0214 Ignore RSCN Data: x%x x%x x%x x%x\n", 2810 "0214 Ignore RSCN "
2866 phba->brd_no, vport->vpi, vport->fc_flag, payload_len, 2811 "Data: x%x x%x x%x x%x\n",
2867 *lp, rscn_cnt); 2812 vport->fc_flag, payload_len,
2868 2813 *lp, rscn_cnt);
2869 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, 2814 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL,
2870 "RCV RSCN vport: did:x%x/ste:x%x flg:x%x", 2815 "RCV RSCN vport: did:x%x/ste:x%x flg:x%x",
2871 ndlp->nlp_DID, vport->port_state, 2816 ndlp->nlp_DID, vport->port_state,
2872 ndlp->nlp_flag); 2817 ndlp->nlp_flag);
2873 2818
2874 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, 2819 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb,
2875 ndlp, NULL, newnode); 2820 ndlp, NULL);
2876 return 0; 2821 return 0;
2877 } 2822 }
2878 } 2823 }
@@ -2911,27 +2856,24 @@ lpfc_els_rcv_rscn(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
2911 } 2856 }
2912 2857
2913 /* Deferred RSCN */ 2858 /* Deferred RSCN */
2914 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 2859 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
2915 "%d (%d):0235 Deferred RSCN " 2860 "0235 Deferred RSCN "
2916 "Data: x%x x%x x%x\n", 2861 "Data: x%x x%x x%x\n",
2917 phba->brd_no, vport->vpi, 2862 vport->fc_rscn_id_cnt, vport->fc_flag,
2918 vport->fc_rscn_id_cnt, vport->fc_flag, 2863 vport->port_state);
2919 vport->port_state);
2920 } else { 2864 } else {
2921 spin_lock_irq(shost->host_lock); 2865 spin_lock_irq(shost->host_lock);
2922 vport->fc_flag |= FC_RSCN_DISCOVERY; 2866 vport->fc_flag |= FC_RSCN_DISCOVERY;
2923 spin_unlock_irq(shost->host_lock); 2867 spin_unlock_irq(shost->host_lock);
2924 /* ReDiscovery RSCN */ 2868 /* ReDiscovery RSCN */
2925 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 2869 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
2926 "%d (%d):0234 ReDiscovery RSCN " 2870 "0234 ReDiscovery RSCN "
2927 "Data: x%x x%x x%x\n", 2871 "Data: x%x x%x x%x\n",
2928 phba->brd_no, vport->vpi, 2872 vport->fc_rscn_id_cnt, vport->fc_flag,
2929 vport->fc_rscn_id_cnt, vport->fc_flag, 2873 vport->port_state);
2930 vport->port_state);
2931 } 2874 }
2932 /* Send back ACC */ 2875 /* Send back ACC */
2933 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 2876 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL);
2934 newnode);
2935 2877
2936 /* send RECOVERY event for ALL nodes that match RSCN payload */ 2878 /* send RECOVERY event for ALL nodes that match RSCN payload */
2937 lpfc_rscn_recovery_check(vport); 2879 lpfc_rscn_recovery_check(vport);
@@ -2956,7 +2898,7 @@ lpfc_els_rcv_rscn(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
2956 lpfc_set_disctmo(vport); 2898 lpfc_set_disctmo(vport);
2957 2899
2958 /* Send back ACC */ 2900 /* Send back ACC */
2959 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL, newnode); 2901 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL);
2960 2902
2961 /* send RECOVERY event for ALL nodes that match RSCN payload */ 2903 /* send RECOVERY event for ALL nodes that match RSCN payload */
2962 lpfc_rscn_recovery_check(vport); 2904 lpfc_rscn_recovery_check(vport);
@@ -2980,11 +2922,10 @@ lpfc_els_handle_rscn(struct lpfc_vport *vport)
2980 lpfc_set_disctmo(vport); 2922 lpfc_set_disctmo(vport);
2981 2923
2982 /* RSCN processed */ 2924 /* RSCN processed */
2983 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 2925 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
2984 "%d (%d):0215 RSCN processed Data: x%x x%x x%x x%x\n", 2926 "0215 RSCN processed Data: x%x x%x x%x x%x\n",
2985 phba->brd_no, vport->vpi, 2927 vport->fc_flag, 0, vport->fc_rscn_id_cnt,
2986 vport->fc_flag, 0, vport->fc_rscn_id_cnt, 2928 vport->port_state);
2987 vport->port_state);
2988 2929
2989 /* To process RSCN, first compare RSCN data with NameServer */ 2930 /* To process RSCN, first compare RSCN data with NameServer */
2990 vport->fc_ns_retry = 0; 2931 vport->fc_ns_retry = 0;
@@ -3026,7 +2967,7 @@ lpfc_els_handle_rscn(struct lpfc_vport *vport)
3026 2967
3027static int 2968static int
3028lpfc_els_rcv_flogi(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, 2969lpfc_els_rcv_flogi(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
3029 struct lpfc_nodelist *ndlp, uint8_t newnode) 2970 struct lpfc_nodelist *ndlp)
3030{ 2971{
3031 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 2972 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
3032 struct lpfc_hba *phba = vport->phba; 2973 struct lpfc_hba *phba = vport->phba;
@@ -3052,10 +2993,10 @@ lpfc_els_rcv_flogi(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
3052 2993
3053 /* An FLOGI ELS command <elsCmd> was received from DID <did> in 2994 /* An FLOGI ELS command <elsCmd> was received from DID <did> in
3054 Loop Mode */ 2995 Loop Mode */
3055 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 2996 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
3056 "%d (%d):0113 An FLOGI ELS command x%x was " 2997 "0113 An FLOGI ELS command x%x was "
3057 "received from DID x%x in Loop Mode\n", 2998 "received from DID x%x in Loop Mode\n",
3058 phba->brd_no, vport->vpi, cmd, did); 2999 cmd, did);
3059 return 1; 3000 return 1;
3060 } 3001 }
3061 3002
@@ -3109,7 +3050,7 @@ lpfc_els_rcv_flogi(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
3109 } 3050 }
3110 3051
3111 /* Send back ACC */ 3052 /* Send back ACC */
3112 lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, cmdiocb, ndlp, NULL, newnode); 3053 lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, cmdiocb, ndlp, NULL);
3113 3054
3114 return 0; 3055 return 0;
3115} 3056}
@@ -3226,16 +3167,13 @@ lpfc_els_rsp_rps_acc(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
3226 rps_rsp->primSeqErrCnt = be32_to_cpu(mb->un.varRdLnk.primSeqErrCnt); 3167 rps_rsp->primSeqErrCnt = be32_to_cpu(mb->un.varRdLnk.primSeqErrCnt);
3227 rps_rsp->invalidXmitWord = be32_to_cpu(mb->un.varRdLnk.invalidXmitWord); 3168 rps_rsp->invalidXmitWord = be32_to_cpu(mb->un.varRdLnk.invalidXmitWord);
3228 rps_rsp->crcCnt = be32_to_cpu(mb->un.varRdLnk.crcCnt); 3169 rps_rsp->crcCnt = be32_to_cpu(mb->un.varRdLnk.crcCnt);
3229
3230 /* Xmit ELS RPS ACC response tag <ulpIoTag> */ 3170 /* Xmit ELS RPS ACC response tag <ulpIoTag> */
3231 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 3171 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_ELS,
3232 "%d (%d):0118 Xmit ELS RPS ACC response tag x%x " 3172 "0118 Xmit ELS RPS ACC response tag x%x xri x%x, "
3233 "xri x%x, did x%x, nlp_flag x%x, nlp_state x%x, " 3173 "did x%x, nlp_flag x%x, nlp_state x%x, rpi x%x\n",
3234 "rpi x%x\n", 3174 elsiocb->iotag, elsiocb->iocb.ulpContext,
3235 phba->brd_no, ndlp->vport->vpi, elsiocb->iotag, 3175 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
3236 elsiocb->iocb.ulpContext, ndlp->nlp_DID, 3176 ndlp->nlp_rpi);
3237 ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi);
3238
3239 elsiocb->iocb_cmpl = lpfc_cmpl_els_rsp; 3177 elsiocb->iocb_cmpl = lpfc_cmpl_els_rsp;
3240 phba->fc_stat.elsXmitACC++; 3178 phba->fc_stat.elsXmitACC++;
3241 if (lpfc_sli_issue_iocb(phba, pring, elsiocb, 0) == IOCB_ERROR) 3179 if (lpfc_sli_issue_iocb(phba, pring, elsiocb, 0) == IOCB_ERROR)
@@ -3337,21 +3275,16 @@ lpfc_els_rsp_rpl_acc(struct lpfc_vport *vport, uint16_t cmdsize,
3337 rpl_rsp.port_num_blk.portID = be32_to_cpu(vport->fc_myDID); 3275 rpl_rsp.port_num_blk.portID = be32_to_cpu(vport->fc_myDID);
3338 memcpy(&rpl_rsp.port_num_blk.portName, &vport->fc_portname, 3276 memcpy(&rpl_rsp.port_num_blk.portName, &vport->fc_portname,
3339 sizeof(struct lpfc_name)); 3277 sizeof(struct lpfc_name));
3340
3341 memcpy(pcmd, &rpl_rsp, cmdsize - sizeof(uint32_t)); 3278 memcpy(pcmd, &rpl_rsp, cmdsize - sizeof(uint32_t));
3342
3343
3344 /* Xmit ELS RPL ACC response tag <ulpIoTag> */ 3279 /* Xmit ELS RPL ACC response tag <ulpIoTag> */
3345 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 3280 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
3346 "%d (%d):0120 Xmit ELS RPL ACC response tag x%x " 3281 "0120 Xmit ELS RPL ACC response tag x%x "
3347 "xri x%x, did x%x, nlp_flag x%x, nlp_state x%x, " 3282 "xri x%x, did x%x, nlp_flag x%x, nlp_state x%x, "
3348 "rpi x%x\n", 3283 "rpi x%x\n",
3349 phba->brd_no, vport->vpi, elsiocb->iotag, 3284 elsiocb->iotag, elsiocb->iocb.ulpContext,
3350 elsiocb->iocb.ulpContext, ndlp->nlp_DID, 3285 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
3351 ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi); 3286 ndlp->nlp_rpi);
3352
3353 elsiocb->iocb_cmpl = lpfc_cmpl_els_rsp; 3287 elsiocb->iocb_cmpl = lpfc_cmpl_els_rsp;
3354
3355 phba->fc_stat.elsXmitACC++; 3288 phba->fc_stat.elsXmitACC++;
3356 if (lpfc_sli_issue_iocb(phba, pring, elsiocb, 0) == IOCB_ERROR) { 3289 if (lpfc_sli_issue_iocb(phba, pring, elsiocb, 0) == IOCB_ERROR) {
3357 lpfc_els_free_iocb(phba, elsiocb); 3290 lpfc_els_free_iocb(phba, elsiocb);
@@ -3404,7 +3337,6 @@ static int
3404lpfc_els_rcv_farp(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, 3337lpfc_els_rcv_farp(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
3405 struct lpfc_nodelist *ndlp) 3338 struct lpfc_nodelist *ndlp)
3406{ 3339{
3407 struct lpfc_hba *phba = vport->phba;
3408 struct lpfc_dmabuf *pcmd; 3340 struct lpfc_dmabuf *pcmd;
3409 uint32_t *lp; 3341 uint32_t *lp;
3410 IOCB_t *icmd; 3342 IOCB_t *icmd;
@@ -3418,12 +3350,9 @@ lpfc_els_rcv_farp(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
3418 3350
3419 cmd = *lp++; 3351 cmd = *lp++;
3420 fp = (FARP *) lp; 3352 fp = (FARP *) lp;
3421
3422 /* FARP-REQ received from DID <did> */ 3353 /* FARP-REQ received from DID <did> */
3423 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 3354 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
3424 "%d (%d):0601 FARP-REQ received from DID x%x\n", 3355 "0601 FARP-REQ received from DID x%x\n", did);
3425 phba->brd_no, vport->vpi, did);
3426
3427 /* We will only support match on WWPN or WWNN */ 3356 /* We will only support match on WWPN or WWNN */
3428 if (fp->Mflags & ~(FARP_MATCH_NODE | FARP_MATCH_PORT)) { 3357 if (fp->Mflags & ~(FARP_MATCH_NODE | FARP_MATCH_PORT)) {
3429 return 0; 3358 return 0;
@@ -3471,7 +3400,6 @@ lpfc_els_rcv_farpr(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
3471 uint32_t *lp; 3400 uint32_t *lp;
3472 IOCB_t *icmd; 3401 IOCB_t *icmd;
3473 uint32_t cmd, did; 3402 uint32_t cmd, did;
3474 struct lpfc_hba *phba = vport->phba;
3475 3403
3476 icmd = &cmdiocb->iocb; 3404 icmd = &cmdiocb->iocb;
3477 did = icmd->un.elsreq64.remoteID; 3405 did = icmd->un.elsreq64.remoteID;
@@ -3480,11 +3408,10 @@ lpfc_els_rcv_farpr(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
3480 3408
3481 cmd = *lp++; 3409 cmd = *lp++;
3482 /* FARP-RSP received from DID <did> */ 3410 /* FARP-RSP received from DID <did> */
3483 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 3411 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
3484 "%d (%d):0600 FARP-RSP received from DID x%x\n", 3412 "0600 FARP-RSP received from DID x%x\n", did);
3485 phba->brd_no, vport->vpi, did);
3486 /* ACCEPT the Farp resp request */ 3413 /* ACCEPT the Farp resp request */
3487 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 0); 3414 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL);
3488 3415
3489 return 0; 3416 return 0;
3490} 3417}
@@ -3502,10 +3429,8 @@ lpfc_els_rcv_fan(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
3502 struct lpfc_hba *phba = vport->phba; 3429 struct lpfc_hba *phba = vport->phba;
3503 3430
3504 /* FAN received */ 3431 /* FAN received */
3505 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 3432 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
3506 "%d (%d):0265 FAN received\n", 3433 "0265 FAN received\n");
3507 phba->brd_no, vport->vpi);
3508
3509 icmd = &cmdiocb->iocb; 3434 icmd = &cmdiocb->iocb;
3510 did = icmd->un.elsreq64.remoteID; 3435 did = icmd->un.elsreq64.remoteID;
3511 pcmd = (struct lpfc_dmabuf *)cmdiocb->context2; 3436 pcmd = (struct lpfc_dmabuf *)cmdiocb->context2;
@@ -3664,13 +3589,10 @@ lpfc_els_timeout_handler(struct lpfc_vport *vport)
3664 if (ndlp) 3589 if (ndlp)
3665 remote_ID = ndlp->nlp_DID; 3590 remote_ID = ndlp->nlp_DID;
3666 } 3591 }
3667 3592 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
3668 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 3593 "0127 ELS timeout Data: x%x x%x x%x "
3669 "%d (%d):0127 ELS timeout Data: x%x x%x x%x " 3594 "x%x\n", els_command,
3670 "x%x\n", 3595 remote_ID, cmd->ulpCommand, cmd->ulpIoTag);
3671 phba->brd_no, vport->vpi, els_command,
3672 remote_ID, cmd->ulpCommand, cmd->ulpIoTag);
3673
3674 lpfc_sli_issue_abort_iotag(phba, pring, piocb); 3596 lpfc_sli_issue_abort_iotag(phba, pring, piocb);
3675 } 3597 }
3676 spin_unlock_irq(&phba->hbalock); 3598 spin_unlock_irq(&phba->hbalock);
@@ -3741,6 +3663,50 @@ lpfc_els_flush_cmd(struct lpfc_vport *vport)
3741 return; 3663 return;
3742} 3664}
3743 3665
3666void
3667lpfc_els_flush_all_cmd(struct lpfc_hba *phba)
3668{
3669 LIST_HEAD(completions);
3670 struct lpfc_sli_ring *pring = &phba->sli.ring[LPFC_ELS_RING];
3671 struct lpfc_iocbq *tmp_iocb, *piocb;
3672 IOCB_t *cmd = NULL;
3673
3674 lpfc_fabric_abort_hba(phba);
3675 spin_lock_irq(&phba->hbalock);
3676 list_for_each_entry_safe(piocb, tmp_iocb, &pring->txq, list) {
3677 cmd = &piocb->iocb;
3678 if (piocb->iocb_flag & LPFC_IO_LIBDFC)
3679 continue;
3680 /* Do not flush out the QUE_RING and ABORT/CLOSE iocbs */
3681 if (cmd->ulpCommand == CMD_QUE_RING_BUF_CN ||
3682 cmd->ulpCommand == CMD_QUE_RING_BUF64_CN ||
3683 cmd->ulpCommand == CMD_CLOSE_XRI_CN ||
3684 cmd->ulpCommand == CMD_ABORT_XRI_CN)
3685 continue;
3686 list_move_tail(&piocb->list, &completions);
3687 pring->txq_cnt--;
3688 }
3689 list_for_each_entry_safe(piocb, tmp_iocb, &pring->txcmplq, list) {
3690 if (piocb->iocb_flag & LPFC_IO_LIBDFC)
3691 continue;
3692 lpfc_sli_issue_abort_iotag(phba, pring, piocb);
3693 }
3694 spin_unlock_irq(&phba->hbalock);
3695 while (!list_empty(&completions)) {
3696 piocb = list_get_first(&completions, struct lpfc_iocbq, list);
3697 cmd = &piocb->iocb;
3698 list_del_init(&piocb->list);
3699 if (!piocb->iocb_cmpl)
3700 lpfc_sli_release_iocbq(phba, piocb);
3701 else {
3702 cmd->ulpStatus = IOSTAT_LOCAL_REJECT;
3703 cmd->un.ulpWord[4] = IOERR_SLI_ABORTED;
3704 (piocb->iocb_cmpl) (phba, piocb, piocb);
3705 }
3706 }
3707 return;
3708}
3709
3744static void 3710static void
3745lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, 3711lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
3746 struct lpfc_vport *vport, struct lpfc_iocbq *elsiocb) 3712 struct lpfc_vport *vport, struct lpfc_iocbq *elsiocb)
@@ -3801,11 +3767,9 @@ lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
3801 cmd &= ELS_CMD_MASK; 3767 cmd &= ELS_CMD_MASK;
3802 } 3768 }
3803 /* ELS command <elsCmd> received from NPORT <did> */ 3769 /* ELS command <elsCmd> received from NPORT <did> */
3804 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 3770 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
3805 "%d (%d):0112 ELS command x%x received from NPORT x%x " 3771 "0112 ELS command x%x received from NPORT x%x "
3806 "Data: x%x\n", phba->brd_no, vport->vpi, cmd, did, 3772 "Data: x%x\n", cmd, did, vport->port_state);
3807 vport->port_state);
3808
3809 switch (cmd) { 3773 switch (cmd) {
3810 case ELS_CMD_PLOGI: 3774 case ELS_CMD_PLOGI:
3811 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL, 3775 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_UNSOL,
@@ -3829,7 +3793,7 @@ lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
3829 did, vport->port_state, ndlp->nlp_flag); 3793 did, vport->port_state, ndlp->nlp_flag);
3830 3794
3831 phba->fc_stat.elsRcvFLOGI++; 3795 phba->fc_stat.elsRcvFLOGI++;
3832 lpfc_els_rcv_flogi(vport, elsiocb, ndlp, newnode); 3796 lpfc_els_rcv_flogi(vport, elsiocb, ndlp);
3833 if (newnode) 3797 if (newnode)
3834 lpfc_drop_node(vport, ndlp); 3798 lpfc_drop_node(vport, ndlp);
3835 break; 3799 break;
@@ -3859,7 +3823,7 @@ lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
3859 break; 3823 break;
3860 case ELS_CMD_RSCN: 3824 case ELS_CMD_RSCN:
3861 phba->fc_stat.elsRcvRSCN++; 3825 phba->fc_stat.elsRcvRSCN++;
3862 lpfc_els_rcv_rscn(vport, elsiocb, ndlp, newnode); 3826 lpfc_els_rcv_rscn(vport, elsiocb, ndlp);
3863 if (newnode) 3827 if (newnode)
3864 lpfc_drop_node(vport, ndlp); 3828 lpfc_drop_node(vport, ndlp);
3865 break; 3829 break;
@@ -3974,10 +3938,9 @@ lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
3974 rjt_err = LSRJT_INVALID_CMD; 3938 rjt_err = LSRJT_INVALID_CMD;
3975 3939
3976 /* Unknown ELS command <elsCmd> received from NPORT <did> */ 3940 /* Unknown ELS command <elsCmd> received from NPORT <did> */
3977 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 3941 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
3978 "%d (%d):0115 Unknown ELS command x%x " 3942 "0115 Unknown ELS command x%x "
3979 "received from NPORT x%x\n", 3943 "received from NPORT x%x\n", cmd, did);
3980 phba->brd_no, vport->vpi, cmd, did);
3981 if (newnode) 3944 if (newnode)
3982 lpfc_drop_node(vport, ndlp); 3945 lpfc_drop_node(vport, ndlp);
3983 break; 3946 break;
@@ -3990,19 +3953,16 @@ lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
3990 stat.un.b.lsRjtRsnCodeExp = LSEXP_NOTHING_MORE; 3953 stat.un.b.lsRjtRsnCodeExp = LSEXP_NOTHING_MORE;
3991 lpfc_els_rsp_reject(vport, stat.un.lsRjtError, elsiocb, ndlp, 3954 lpfc_els_rsp_reject(vport, stat.un.lsRjtError, elsiocb, ndlp,
3992 NULL); 3955 NULL);
3993 if (newnode)
3994 lpfc_drop_node(vport, ndlp);
3995 } 3956 }
3996 3957
3997 return; 3958 return;
3998 3959
3999dropit: 3960dropit:
4000 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 3961 lpfc_printf_log(phba, KERN_ERR, LOG_ELS,
4001 "%d (%d):0111 Dropping received ELS cmd " 3962 "(%d):0111 Dropping received ELS cmd "
4002 "Data: x%x x%x x%x\n", 3963 "Data: x%x x%x x%x\n",
4003 phba->brd_no, vport ? vport->vpi : 0xffff, 3964 vport ? vport->vpi : 0xffff, icmd->ulpStatus,
4004 icmd->ulpStatus, icmd->un.ulpWord[4], 3965 icmd->un.ulpWord[4], icmd->ulpTimeout);
4005 icmd->ulpTimeout);
4006 phba->fc_stat.elsRcvDrop++; 3966 phba->fc_stat.elsRcvDrop++;
4007} 3967}
4008 3968
@@ -4010,11 +3970,16 @@ static struct lpfc_vport *
4010lpfc_find_vport_by_vpid(struct lpfc_hba *phba, uint16_t vpi) 3970lpfc_find_vport_by_vpid(struct lpfc_hba *phba, uint16_t vpi)
4011{ 3971{
4012 struct lpfc_vport *vport; 3972 struct lpfc_vport *vport;
3973 unsigned long flags;
4013 3974
3975 spin_lock_irqsave(&phba->hbalock, flags);
4014 list_for_each_entry(vport, &phba->port_list, listentry) { 3976 list_for_each_entry(vport, &phba->port_list, listentry) {
4015 if (vport->vpi == vpi) 3977 if (vport->vpi == vpi) {
3978 spin_unlock_irqrestore(&phba->hbalock, flags);
4016 return vport; 3979 return vport;
3980 }
4017 } 3981 }
3982 spin_unlock_irqrestore(&phba->hbalock, flags);
4018 return NULL; 3983 return NULL;
4019} 3984}
4020 3985
@@ -4109,9 +4074,8 @@ lpfc_do_scr_ns_plogi(struct lpfc_hba *phba, struct lpfc_vport *vport)
4109 return; 4074 return;
4110 } 4075 }
4111 lpfc_vport_set_state(vport, FC_VPORT_FAILED); 4076 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
4112 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 4077 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
4113 "%d (%d):0251 NameServer login: no memory\n", 4078 "0251 NameServer login: no memory\n");
4114 phba->brd_no, vport->vpi);
4115 return; 4079 return;
4116 } 4080 }
4117 lpfc_nlp_init(vport, ndlp, NameServer_DID); 4081 lpfc_nlp_init(vport, ndlp, NameServer_DID);
@@ -4122,13 +4086,12 @@ lpfc_do_scr_ns_plogi(struct lpfc_hba *phba, struct lpfc_vport *vport)
4122 4086
4123 if (lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0)) { 4087 if (lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0)) {
4124 lpfc_vport_set_state(vport, FC_VPORT_FAILED); 4088 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
4125 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 4089 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
4126 "%d (%d):0252 Cannot issue NameServer login\n", 4090 "0252 Cannot issue NameServer login\n");
4127 phba->brd_no, vport->vpi);
4128 return; 4091 return;
4129 } 4092 }
4130 4093
4131 if (phba->cfg_fdmi_on) { 4094 if (vport->cfg_fdmi_on) {
4132 ndlp_fdmi = mempool_alloc(phba->nlp_mem_pool, 4095 ndlp_fdmi = mempool_alloc(phba->nlp_mem_pool,
4133 GFP_KERNEL); 4096 GFP_KERNEL);
4134 if (ndlp_fdmi) { 4097 if (ndlp_fdmi) {
@@ -4155,9 +4118,9 @@ lpfc_cmpl_reg_new_vport(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
4155 lpfc_nlp_put(ndlp); 4118 lpfc_nlp_put(ndlp);
4156 4119
4157 if (mb->mbxStatus) { 4120 if (mb->mbxStatus) {
4158 lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, 4121 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
4159 "%d (%d):0915 Register VPI failed: 0x%x\n", 4122 "0915 Register VPI failed: 0x%x\n",
4160 phba->brd_no, vport->vpi, mb->mbxStatus); 4123 mb->mbxStatus);
4161 4124
4162 switch (mb->mbxStatus) { 4125 switch (mb->mbxStatus) {
4163 case 0x11: /* unsupported feature */ 4126 case 0x11: /* unsupported feature */
@@ -4206,17 +4169,14 @@ lpfc_register_new_vport(struct lpfc_hba *phba, struct lpfc_vport *vport,
4206 vport->fc_flag &= ~FC_VPORT_NEEDS_REG_VPI; 4169 vport->fc_flag &= ~FC_VPORT_NEEDS_REG_VPI;
4207 4170
4208 lpfc_vport_set_state(vport, FC_VPORT_FAILED); 4171 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
4209 4172 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
4210 lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, 4173 "0253 Register VPI: Can't send mbox\n");
4211 "%d (%d):0253 Register VPI: Cannot send mbox\n",
4212 phba->brd_no, vport->vpi);
4213 } 4174 }
4214 } else { 4175 } else {
4215 lpfc_vport_set_state(vport, FC_VPORT_FAILED); 4176 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
4216 4177
4217 lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, 4178 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
4218 "%d (%d):0254 Register VPI: no memory\n", 4179 "0254 Register VPI: no memory\n");
4219 phba->brd_no, vport->vpi);
4220 4180
4221 vport->fc_flag &= ~FC_VPORT_NEEDS_REG_VPI; 4181 vport->fc_flag &= ~FC_VPORT_NEEDS_REG_VPI;
4222 lpfc_nlp_put(ndlp); 4182 lpfc_nlp_put(ndlp);
@@ -4235,11 +4195,10 @@ lpfc_cmpl_els_fdisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
4235 IOCB_t *irsp = &rspiocb->iocb; 4195 IOCB_t *irsp = &rspiocb->iocb;
4236 struct lpfc_iocbq *piocb; 4196 struct lpfc_iocbq *piocb;
4237 4197
4238 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 4198 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
4239 "%d (%d):0123 FDISC completes. x%x/x%x prevDID: x%x\n", 4199 "0123 FDISC completes. x%x/x%x prevDID: x%x\n",
4240 phba->brd_no, vport->vpi, 4200 irsp->ulpStatus, irsp->un.ulpWord[4],
4241 irsp->ulpStatus, irsp->un.ulpWord[4], vport->fc_prevDID); 4201 vport->fc_prevDID);
4242
4243 /* Since all FDISCs are being single threaded, we 4202 /* Since all FDISCs are being single threaded, we
4244 * must reset the discovery timer for ALL vports 4203 * must reset the discovery timer for ALL vports
4245 * waiting to send FDISC when one completes. 4204 * waiting to send FDISC when one completes.
@@ -4256,13 +4215,10 @@ lpfc_cmpl_els_fdisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
4256 /* Check for retry */ 4215 /* Check for retry */
4257 if (lpfc_els_retry(phba, cmdiocb, rspiocb)) 4216 if (lpfc_els_retry(phba, cmdiocb, rspiocb))
4258 goto out; 4217 goto out;
4259
4260 /* FDISC failed */ 4218 /* FDISC failed */
4261 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 4219 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
4262 "%d (%d):0124 FDISC failed. (%d/%d)\n", 4220 "0124 FDISC failed. (%d/%d)\n",
4263 phba->brd_no, vport->vpi, 4221 irsp->ulpStatus, irsp->un.ulpWord[4]);
4264 irsp->ulpStatus, irsp->un.ulpWord[4]);
4265
4266 if (vport->fc_vport->vport_state == FC_VPORT_INITIALIZING) 4222 if (vport->fc_vport->vport_state == FC_VPORT_INITIALIZING)
4267 lpfc_vport_set_state(vport, FC_VPORT_FAILED); 4223 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
4268 4224
@@ -4328,10 +4284,8 @@ lpfc_issue_els_fdisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
4328 ELS_CMD_FDISC); 4284 ELS_CMD_FDISC);
4329 if (!elsiocb) { 4285 if (!elsiocb) {
4330 lpfc_vport_set_state(vport, FC_VPORT_FAILED); 4286 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
4331 4287 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
4332 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 4288 "0255 Issue FDISC: no IOCB\n");
4333 "%d (%d):0255 Issue FDISC: no IOCB\n",
4334 phba->brd_no, vport->vpi);
4335 return 1; 4289 return 1;
4336 } 4290 }
4337 4291
@@ -4377,11 +4331,8 @@ lpfc_issue_els_fdisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
4377 if (rc == IOCB_ERROR) { 4331 if (rc == IOCB_ERROR) {
4378 lpfc_els_free_iocb(phba, elsiocb); 4332 lpfc_els_free_iocb(phba, elsiocb);
4379 lpfc_vport_set_state(vport, FC_VPORT_FAILED); 4333 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
4380 4334 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
4381 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 4335 "0256 Issue FDISC: Cannot send IOCB\n");
4382 "%d (%d):0256 Issue FDISC: Cannot send IOCB\n",
4383 phba->brd_no, vport->vpi);
4384
4385 return 1; 4336 return 1;
4386 } 4337 }
4387 lpfc_vport_set_state(vport, FC_VPORT_INITIALIZING); 4338 lpfc_vport_set_state(vport, FC_VPORT_INITIALIZING);
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index f2f4639eab59..c81c2b3228d6 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -83,10 +83,17 @@ lpfc_terminate_rport_io(struct fc_rport *rport)
83 ndlp->nlp_sid, ndlp->nlp_DID, ndlp->nlp_flag); 83 ndlp->nlp_sid, ndlp->nlp_DID, ndlp->nlp_flag);
84 84
85 if (ndlp->nlp_sid != NLP_NO_SID) { 85 if (ndlp->nlp_sid != NLP_NO_SID) {
86 lpfc_sli_abort_iocb(phba, &phba->sli.ring[phba->sli.fcp_ring], 86 lpfc_sli_abort_iocb(ndlp->vport,
87 ndlp->nlp_sid, 0, 0, LPFC_CTX_TGT); 87 &phba->sli.ring[phba->sli.fcp_ring],
88 ndlp->nlp_sid, 0, LPFC_CTX_TGT);
88 } 89 }
89 90
91 /*
92 * A device is normally blocked for rediscovery and unblocked when
93 * devloss timeout happens. In case a vport is removed or driver
94 * unloaded before devloss timeout happens, we need to unblock here.
95 */
96 scsi_target_unblock(&rport->dev);
90 return; 97 return;
91} 98}
92 99
@@ -194,32 +201,30 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp)
194 if (ndlp->nlp_sid != NLP_NO_SID) { 201 if (ndlp->nlp_sid != NLP_NO_SID) {
195 warn_on = 1; 202 warn_on = 1;
196 /* flush the target */ 203 /* flush the target */
197 lpfc_sli_abort_iocb(phba, &phba->sli.ring[phba->sli.fcp_ring], 204 lpfc_sli_abort_iocb(vport, &phba->sli.ring[phba->sli.fcp_ring],
198 ndlp->nlp_sid, 0, 0, LPFC_CTX_TGT); 205 ndlp->nlp_sid, 0, LPFC_CTX_TGT);
199 } 206 }
200 if (vport->load_flag & FC_UNLOADING) 207 if (vport->load_flag & FC_UNLOADING)
201 warn_on = 0; 208 warn_on = 0;
202 209
203 if (warn_on) { 210 if (warn_on) {
204 lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, 211 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
205 "%d (%d):0203 Devloss timeout on " 212 "0203 Devloss timeout on "
206 "WWPN %x:%x:%x:%x:%x:%x:%x:%x " 213 "WWPN %x:%x:%x:%x:%x:%x:%x:%x "
207 "NPort x%x Data: x%x x%x x%x\n", 214 "NPort x%x Data: x%x x%x x%x\n",
208 phba->brd_no, vport->vpi, 215 *name, *(name+1), *(name+2), *(name+3),
209 *name, *(name+1), *(name+2), *(name+3), 216 *(name+4), *(name+5), *(name+6), *(name+7),
210 *(name+4), *(name+5), *(name+6), *(name+7), 217 ndlp->nlp_DID, ndlp->nlp_flag,
211 ndlp->nlp_DID, ndlp->nlp_flag, 218 ndlp->nlp_state, ndlp->nlp_rpi);
212 ndlp->nlp_state, ndlp->nlp_rpi);
213 } else { 219 } else {
214 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 220 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
215 "%d (%d):0204 Devloss timeout on " 221 "0204 Devloss timeout on "
216 "WWPN %x:%x:%x:%x:%x:%x:%x:%x " 222 "WWPN %x:%x:%x:%x:%x:%x:%x:%x "
217 "NPort x%x Data: x%x x%x x%x\n", 223 "NPort x%x Data: x%x x%x x%x\n",
218 phba->brd_no, vport->vpi, 224 *name, *(name+1), *(name+2), *(name+3),
219 *name, *(name+1), *(name+2), *(name+3), 225 *(name+4), *(name+5), *(name+6), *(name+7),
220 *(name+4), *(name+5), *(name+6), *(name+7), 226 ndlp->nlp_DID, ndlp->nlp_flag,
221 ndlp->nlp_DID, ndlp->nlp_flag, 227 ndlp->nlp_state, ndlp->nlp_rpi);
222 ndlp->nlp_state, ndlp->nlp_rpi);
223 } 228 }
224 229
225 if (!(vport->load_flag & FC_UNLOADING) && 230 if (!(vport->load_flag & FC_UNLOADING) &&
@@ -344,12 +349,14 @@ lpfc_work_list_done(struct lpfc_hba *phba)
344 349
345} 350}
346 351
347void 352static void
348lpfc_work_done(struct lpfc_hba *phba) 353lpfc_work_done(struct lpfc_hba *phba)
349{ 354{
350 struct lpfc_sli_ring *pring; 355 struct lpfc_sli_ring *pring;
351 uint32_t ha_copy, status, control, work_port_events; 356 uint32_t ha_copy, status, control, work_port_events;
357 struct lpfc_vport **vports;
352 struct lpfc_vport *vport; 358 struct lpfc_vport *vport;
359 int i;
353 360
354 spin_lock_irq(&phba->hbalock); 361 spin_lock_irq(&phba->hbalock);
355 ha_copy = phba->work_ha; 362 ha_copy = phba->work_ha;
@@ -364,48 +371,41 @@ lpfc_work_done(struct lpfc_hba *phba)
364 371
365 if (ha_copy & HA_LATT) 372 if (ha_copy & HA_LATT)
366 lpfc_handle_latt(phba); 373 lpfc_handle_latt(phba);
367 374 vports = lpfc_create_vport_work_array(phba);
368 spin_lock_irq(&phba->hbalock); 375 if (vports != NULL)
369 list_for_each_entry(vport, &phba->port_list, listentry) { 376 for(i = 0; i < LPFC_MAX_VPORTS; i++) {
370 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 377 /*
371 378 * We could have no vports in array if unloading, so if
372 if (!scsi_host_get(shost)) { 379 * this happens then just use the pport
373 continue; 380 */
381 if (vports[i] == NULL && i == 0)
382 vport = phba->pport;
383 else
384 vport = vports[i];
385 if (vport == NULL)
386 break;
387 work_port_events = vport->work_port_events;
388 if (work_port_events & WORKER_DISC_TMO)
389 lpfc_disc_timeout_handler(vport);
390 if (work_port_events & WORKER_ELS_TMO)
391 lpfc_els_timeout_handler(vport);
392 if (work_port_events & WORKER_HB_TMO)
393 lpfc_hb_timeout_handler(phba);
394 if (work_port_events & WORKER_MBOX_TMO)
395 lpfc_mbox_timeout_handler(phba);
396 if (work_port_events & WORKER_FABRIC_BLOCK_TMO)
397 lpfc_unblock_fabric_iocbs(phba);
398 if (work_port_events & WORKER_FDMI_TMO)
399 lpfc_fdmi_timeout_handler(vport);
400 if (work_port_events & WORKER_RAMP_DOWN_QUEUE)
401 lpfc_ramp_down_queue_handler(phba);
402 if (work_port_events & WORKER_RAMP_UP_QUEUE)
403 lpfc_ramp_up_queue_handler(phba);
404 spin_lock_irq(&vport->work_port_lock);
405 vport->work_port_events &= ~work_port_events;
406 spin_unlock_irq(&vport->work_port_lock);
374 } 407 }
375 spin_unlock_irq(&phba->hbalock); 408 lpfc_destroy_vport_work_array(vports);
376 work_port_events = vport->work_port_events;
377
378 if (work_port_events & WORKER_DISC_TMO)
379 lpfc_disc_timeout_handler(vport);
380
381 if (work_port_events & WORKER_ELS_TMO)
382 lpfc_els_timeout_handler(vport);
383
384 if (work_port_events & WORKER_HB_TMO)
385 lpfc_hb_timeout_handler(phba);
386
387 if (work_port_events & WORKER_MBOX_TMO)
388 lpfc_mbox_timeout_handler(phba);
389
390 if (work_port_events & WORKER_FABRIC_BLOCK_TMO)
391 lpfc_unblock_fabric_iocbs(phba);
392
393 if (work_port_events & WORKER_FDMI_TMO)
394 lpfc_fdmi_timeout_handler(vport);
395
396 if (work_port_events & WORKER_RAMP_DOWN_QUEUE)
397 lpfc_ramp_down_queue_handler(phba);
398
399 if (work_port_events & WORKER_RAMP_UP_QUEUE)
400 lpfc_ramp_up_queue_handler(phba);
401
402 spin_lock_irq(&vport->work_port_lock);
403 vport->work_port_events &= ~work_port_events;
404 spin_unlock_irq(&vport->work_port_lock);
405 scsi_host_put(shost);
406 spin_lock_irq(&phba->hbalock);
407 }
408 spin_unlock_irq(&phba->hbalock);
409 409
410 pring = &phba->sli.ring[LPFC_ELS_RING]; 410 pring = &phba->sli.ring[LPFC_ELS_RING];
411 status = (ha_copy & (HA_RXMASK << (4*LPFC_ELS_RING))); 411 status = (ha_copy & (HA_RXMASK << (4*LPFC_ELS_RING)));
@@ -426,10 +426,19 @@ lpfc_work_done(struct lpfc_hba *phba)
426 spin_lock_irq(&phba->hbalock); 426 spin_lock_irq(&phba->hbalock);
427 control = readl(phba->HCregaddr); 427 control = readl(phba->HCregaddr);
428 if (!(control & (HC_R0INT_ENA << LPFC_ELS_RING))) { 428 if (!(control & (HC_R0INT_ENA << LPFC_ELS_RING))) {
429 lpfc_debugfs_slow_ring_trc(phba,
430 "WRK Enable ring: cntl:x%x hacopy:x%x",
431 control, ha_copy, 0);
432
429 control |= (HC_R0INT_ENA << LPFC_ELS_RING); 433 control |= (HC_R0INT_ENA << LPFC_ELS_RING);
430 writel(control, phba->HCregaddr); 434 writel(control, phba->HCregaddr);
431 readl(phba->HCregaddr); /* flush */ 435 readl(phba->HCregaddr); /* flush */
432 } 436 }
437 else {
438 lpfc_debugfs_slow_ring_trc(phba,
439 "WRK Ring ok: cntl:x%x hacopy:x%x",
440 control, ha_copy, 0);
441 }
433 spin_unlock_irq(&phba->hbalock); 442 spin_unlock_irq(&phba->hbalock);
434 } 443 }
435 lpfc_work_list_done(phba); 444 lpfc_work_list_done(phba);
@@ -439,32 +448,22 @@ static int
439check_work_wait_done(struct lpfc_hba *phba) 448check_work_wait_done(struct lpfc_hba *phba)
440{ 449{
441 struct lpfc_vport *vport; 450 struct lpfc_vport *vport;
442 struct lpfc_sli_ring *pring; 451 struct lpfc_sli_ring *pring = &phba->sli.ring[LPFC_ELS_RING];
443 int rc = 0; 452 int rc = 0;
444 453
445 spin_lock_irq(&phba->hbalock); 454 spin_lock_irq(&phba->hbalock);
446 list_for_each_entry(vport, &phba->port_list, listentry) { 455 list_for_each_entry(vport, &phba->port_list, listentry) {
447 if (vport->work_port_events) { 456 if (vport->work_port_events) {
448 rc = 1; 457 rc = 1;
449 goto exit; 458 break;
450 } 459 }
451 } 460 }
452 461 if (rc || phba->work_ha || (!list_empty(&phba->work_list)) ||
453 if (phba->work_ha || (!list_empty(&phba->work_list)) || 462 kthread_should_stop() || pring->flag & LPFC_DEFERRED_RING_EVENT) {
454 kthread_should_stop()) {
455 rc = 1;
456 goto exit;
457 }
458
459 pring = &phba->sli.ring[LPFC_ELS_RING];
460 if (pring->flag & LPFC_DEFERRED_RING_EVENT)
461 rc = 1; 463 rc = 1;
462exit:
463 if (rc)
464 phba->work_found++; 464 phba->work_found++;
465 else 465 } else
466 phba->work_found = 0; 466 phba->work_found = 0;
467
468 spin_unlock_irq(&phba->hbalock); 467 spin_unlock_irq(&phba->hbalock);
469 return rc; 468 return rc;
470} 469}
@@ -592,7 +591,6 @@ lpfc_linkdown_port(struct lpfc_vport *vport)
592 591
593 /* free any ndlp's on unused list */ 592 /* free any ndlp's on unused list */
594 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) 593 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp)
595 /* free any ndlp's in unused state */
596 if (ndlp->nlp_state == NLP_STE_UNUSED_NODE) 594 if (ndlp->nlp_state == NLP_STE_UNUSED_NODE)
597 lpfc_drop_node(vport, ndlp); 595 lpfc_drop_node(vport, ndlp);
598 596
@@ -605,8 +603,9 @@ lpfc_linkdown(struct lpfc_hba *phba)
605{ 603{
606 struct lpfc_vport *vport = phba->pport; 604 struct lpfc_vport *vport = phba->pport;
607 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 605 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
608 struct lpfc_vport *port_iterator; 606 struct lpfc_vport **vports;
609 LPFC_MBOXQ_t *mb; 607 LPFC_MBOXQ_t *mb;
608 int i;
610 609
611 if (phba->link_state == LPFC_LINK_DOWN) { 610 if (phba->link_state == LPFC_LINK_DOWN) {
612 return 0; 611 return 0;
@@ -617,13 +616,13 @@ lpfc_linkdown(struct lpfc_hba *phba)
617 phba->pport->fc_flag &= ~FC_LBIT; 616 phba->pport->fc_flag &= ~FC_LBIT;
618 } 617 }
619 spin_unlock_irq(&phba->hbalock); 618 spin_unlock_irq(&phba->hbalock);
620 619 vports = lpfc_create_vport_work_array(phba);
621 list_for_each_entry(port_iterator, &phba->port_list, listentry) { 620 if (vports != NULL)
622 621 for(i = 0; i < LPFC_MAX_VPORTS && vports[i] != NULL; i++) {
623 /* Issue a LINK DOWN event to all nodes */ 622 /* Issue a LINK DOWN event to all nodes */
624 lpfc_linkdown_port(port_iterator); 623 lpfc_linkdown_port(vports[i]);
625 } 624 }
626 625 lpfc_destroy_vport_work_array(vports);
627 /* Clean up any firmware default rpi's */ 626 /* Clean up any firmware default rpi's */
628 mb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); 627 mb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
629 if (mb) { 628 if (mb) {
@@ -724,7 +723,8 @@ lpfc_linkup_port(struct lpfc_vport *vport)
724static int 723static int
725lpfc_linkup(struct lpfc_hba *phba) 724lpfc_linkup(struct lpfc_hba *phba)
726{ 725{
727 struct lpfc_vport *vport; 726 struct lpfc_vport **vports;
727 int i;
728 728
729 phba->link_state = LPFC_LINK_UP; 729 phba->link_state = LPFC_LINK_UP;
730 730
@@ -732,9 +732,11 @@ lpfc_linkup(struct lpfc_hba *phba)
732 clear_bit(FABRIC_COMANDS_BLOCKED, &phba->bit_flags); 732 clear_bit(FABRIC_COMANDS_BLOCKED, &phba->bit_flags);
733 del_timer_sync(&phba->fabric_block_timer); 733 del_timer_sync(&phba->fabric_block_timer);
734 734
735 list_for_each_entry(vport, &phba->port_list, listentry) { 735 vports = lpfc_create_vport_work_array(phba);
736 lpfc_linkup_port(vport); 736 if (vports != NULL)
737 } 737 for(i = 0; i < LPFC_MAX_VPORTS && vports[i] != NULL; i++)
738 lpfc_linkup_port(vports[i]);
739 lpfc_destroy_vport_work_array(vports);
738 if (phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) 740 if (phba->sli3_options & LPFC_SLI3_NPIV_ENABLED)
739 lpfc_issue_clear_la(phba, phba->pport); 741 lpfc_issue_clear_la(phba, phba->pport);
740 742
@@ -764,12 +766,10 @@ lpfc_mbx_cmpl_clear_la(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
764 /* Check for error */ 766 /* Check for error */
765 if ((mb->mbxStatus) && (mb->mbxStatus != 0x1601)) { 767 if ((mb->mbxStatus) && (mb->mbxStatus != 0x1601)) {
766 /* CLEAR_LA mbox error <mbxStatus> state <hba_state> */ 768 /* CLEAR_LA mbox error <mbxStatus> state <hba_state> */
767 lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, 769 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
768 "%d (%d):0320 CLEAR_LA mbxStatus error x%x hba " 770 "0320 CLEAR_LA mbxStatus error x%x hba "
769 "state x%x\n", 771 "state x%x\n",
770 phba->brd_no, vport->vpi, mb->mbxStatus, 772 mb->mbxStatus, vport->port_state);
771 vport->port_state);
772
773 phba->link_state = LPFC_HBA_ERROR; 773 phba->link_state = LPFC_HBA_ERROR;
774 goto out; 774 goto out;
775 } 775 }
@@ -801,10 +801,8 @@ lpfc_mbx_cmpl_clear_la(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
801 801
802out: 802out:
803 /* Device Discovery completes */ 803 /* Device Discovery completes */
804 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 804 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
805 "%d (%d):0225 Device Discovery completes\n", 805 "0225 Device Discovery completes\n");
806 phba->brd_no, vport->vpi);
807
808 mempool_free(pmb, phba->mbox_mem_pool); 806 mempool_free(pmb, phba->mbox_mem_pool);
809 807
810 spin_lock_irq(shost->host_lock); 808 spin_lock_irq(shost->host_lock);
@@ -861,19 +859,17 @@ lpfc_mbx_cmpl_local_config_link(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
861 return; 859 return;
862 860
863out: 861out:
864 lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, 862 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
865 "%d (%d):0306 CONFIG_LINK mbxStatus error x%x " 863 "0306 CONFIG_LINK mbxStatus error x%x "
866 "HBA state x%x\n", 864 "HBA state x%x\n",
867 phba->brd_no, vport->vpi, pmb->mb.mbxStatus, 865 pmb->mb.mbxStatus, vport->port_state);
868 vport->port_state);
869
870 mempool_free(pmb, phba->mbox_mem_pool); 866 mempool_free(pmb, phba->mbox_mem_pool);
871 867
872 lpfc_linkdown(phba); 868 lpfc_linkdown(phba);
873 869
874 lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, 870 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
875 "%d (%d):0200 CONFIG_LINK bad hba state x%x\n", 871 "0200 CONFIG_LINK bad hba state x%x\n",
876 phba->brd_no, vport->vpi, vport->port_state); 872 vport->port_state);
877 873
878 lpfc_issue_clear_la(phba, vport); 874 lpfc_issue_clear_la(phba, vport);
879 return; 875 return;
@@ -890,12 +886,10 @@ lpfc_mbx_cmpl_read_sparam(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
890 /* Check for error */ 886 /* Check for error */
891 if (mb->mbxStatus) { 887 if (mb->mbxStatus) {
892 /* READ_SPARAM mbox error <mbxStatus> state <hba_state> */ 888 /* READ_SPARAM mbox error <mbxStatus> state <hba_state> */
893 lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, 889 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
894 "%d (%d):0319 READ_SPARAM mbxStatus error x%x " 890 "0319 READ_SPARAM mbxStatus error x%x "
895 "hba state x%x>\n", 891 "hba state x%x>\n",
896 phba->brd_no, vport->vpi, mb->mbxStatus, 892 mb->mbxStatus, vport->port_state);
897 vport->port_state);
898
899 lpfc_linkdown(phba); 893 lpfc_linkdown(phba);
900 goto out; 894 goto out;
901 } 895 }
@@ -978,7 +972,7 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la)
978 if (i == 0) { 972 if (i == 0) {
979 phba->alpa_map[0] = 0; 973 phba->alpa_map[0] = 0;
980 } else { 974 } else {
981 if (phba->cfg_log_verbose & LOG_LINK_EVENT) { 975 if (vport->cfg_log_verbose & LOG_LINK_EVENT) {
982 int numalpa, j, k; 976 int numalpa, j, k;
983 union { 977 union {
984 uint8_t pamap[16]; 978 uint8_t pamap[16];
@@ -1004,10 +998,9 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la)
1004 lpfc_printf_log(phba, 998 lpfc_printf_log(phba,
1005 KERN_WARNING, 999 KERN_WARNING,
1006 LOG_LINK_EVENT, 1000 LOG_LINK_EVENT,
1007 "%d:1304 Link Up Event " 1001 "1304 Link Up Event "
1008 "ALPA map Data: x%x " 1002 "ALPA map Data: x%x "
1009 "x%x x%x x%x\n", 1003 "x%x x%x x%x\n",
1010 phba->brd_no,
1011 un.pa.wd1, un.pa.wd2, 1004 un.pa.wd1, un.pa.wd2,
1012 un.pa.wd3, un.pa.wd4); 1005 un.pa.wd3, un.pa.wd4);
1013 } 1006 }
@@ -1015,7 +1008,7 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la)
1015 } 1008 }
1016 } else { 1009 } else {
1017 if (!(phba->sli3_options & LPFC_SLI3_NPIV_ENABLED)) { 1010 if (!(phba->sli3_options & LPFC_SLI3_NPIV_ENABLED)) {
1018 if (phba->max_vpi && phba->cfg_npiv_enable && 1011 if (phba->max_vpi && phba->cfg_enable_npiv &&
1019 (phba->sli_rev == 3)) 1012 (phba->sli_rev == 3))
1020 phba->sli3_options |= LPFC_SLI3_NPIV_ENABLED; 1013 phba->sli3_options |= LPFC_SLI3_NPIV_ENABLED;
1021 } 1014 }
@@ -1055,11 +1048,9 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, READ_LA_VAR *la)
1055 } 1048 }
1056out: 1049out:
1057 lpfc_vport_set_state(vport, FC_VPORT_FAILED); 1050 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
1058 lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, 1051 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
1059 "%d (%d):0263 Discovery Mailbox error: state: 0x%x : %p %p\n", 1052 "0263 Discovery Mailbox error: state: 0x%x : %p %p\n",
1060 phba->brd_no, vport->vpi, 1053 vport->port_state, sparam_mbox, cfglink_mbox);
1061 vport->port_state, sparam_mbox, cfglink_mbox);
1062
1063 lpfc_issue_clear_la(phba, vport); 1054 lpfc_issue_clear_la(phba, vport);
1064 return; 1055 return;
1065} 1056}
@@ -1100,8 +1091,8 @@ lpfc_mbx_cmpl_read_la(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
1100 /* Check for error */ 1091 /* Check for error */
1101 if (mb->mbxStatus) { 1092 if (mb->mbxStatus) {
1102 lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT, 1093 lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT,
1103 "%d:1307 READ_LA mbox error x%x state x%x\n", 1094 "1307 READ_LA mbox error x%x state x%x\n",
1104 phba->brd_no, mb->mbxStatus, vport->port_state); 1095 mb->mbxStatus, vport->port_state);
1105 lpfc_mbx_issue_link_down(phba); 1096 lpfc_mbx_issue_link_down(phba);
1106 phba->link_state = LPFC_HBA_ERROR; 1097 phba->link_state = LPFC_HBA_ERROR;
1107 goto lpfc_mbx_cmpl_read_la_free_mbuf; 1098 goto lpfc_mbx_cmpl_read_la_free_mbuf;
@@ -1132,26 +1123,26 @@ lpfc_mbx_cmpl_read_la(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
1132 phba->fc_stat.LinkUp++; 1123 phba->fc_stat.LinkUp++;
1133 if (phba->link_flag & LS_LOOPBACK_MODE) { 1124 if (phba->link_flag & LS_LOOPBACK_MODE) {
1134 lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT, 1125 lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT,
1135 "%d:1306 Link Up Event in loop back mode " 1126 "1306 Link Up Event in loop back mode "
1136 "x%x received Data: x%x x%x x%x x%x\n", 1127 "x%x received Data: x%x x%x x%x x%x\n",
1137 phba->brd_no, la->eventTag, phba->fc_eventTag, 1128 la->eventTag, phba->fc_eventTag,
1138 la->granted_AL_PA, la->UlnkSpeed, 1129 la->granted_AL_PA, la->UlnkSpeed,
1139 phba->alpa_map[0]); 1130 phba->alpa_map[0]);
1140 } else { 1131 } else {
1141 lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, 1132 lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT,
1142 "%d:1303 Link Up Event x%x received " 1133 "1303 Link Up Event x%x received "
1143 "Data: x%x x%x x%x x%x\n", 1134 "Data: x%x x%x x%x x%x\n",
1144 phba->brd_no, la->eventTag, phba->fc_eventTag, 1135 la->eventTag, phba->fc_eventTag,
1145 la->granted_AL_PA, la->UlnkSpeed, 1136 la->granted_AL_PA, la->UlnkSpeed,
1146 phba->alpa_map[0]); 1137 phba->alpa_map[0]);
1147 } 1138 }
1148 lpfc_mbx_process_link_up(phba, la); 1139 lpfc_mbx_process_link_up(phba, la);
1149 } else { 1140 } else {
1150 phba->fc_stat.LinkDown++; 1141 phba->fc_stat.LinkDown++;
1151 lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, 1142 lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT,
1152 "%d:1305 Link Down Event x%x received " 1143 "1305 Link Down Event x%x received "
1153 "Data: x%x x%x x%x\n", 1144 "Data: x%x x%x x%x\n",
1154 phba->brd_no, la->eventTag, phba->fc_eventTag, 1145 la->eventTag, phba->fc_eventTag,
1155 phba->pport->port_state, vport->fc_flag); 1146 phba->pport->port_state, vport->fc_flag);
1156 lpfc_mbx_issue_link_down(phba); 1147 lpfc_mbx_issue_link_down(phba);
1157 } 1148 }
@@ -1199,10 +1190,9 @@ lpfc_mbx_cmpl_unreg_vpi(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
1199 case 0x0011: 1190 case 0x0011:
1200 case 0x0020: 1191 case 0x0020:
1201 case 0x9700: 1192 case 0x9700:
1202 lpfc_printf_log(phba, KERN_INFO, LOG_NODE, 1193 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE,
1203 "%d (%d):0911 cmpl_unreg_vpi, " 1194 "0911 cmpl_unreg_vpi, mb status = 0x%x\n",
1204 "mb status = 0x%x\n", 1195 mb->mbxStatus);
1205 phba->brd_no, vport->vpi, mb->mbxStatus);
1206 break; 1196 break;
1207 } 1197 }
1208 vport->unreg_vpi_cmpl = VPORT_OK; 1198 vport->unreg_vpi_cmpl = VPORT_OK;
@@ -1231,9 +1221,8 @@ lpfc_mbx_unreg_vpi(struct lpfc_vport *vport)
1231 mbox->mbox_cmpl = lpfc_mbx_cmpl_unreg_vpi; 1221 mbox->mbox_cmpl = lpfc_mbx_cmpl_unreg_vpi;
1232 rc = lpfc_sli_issue_mbox(phba, mbox, (MBX_NOWAIT | MBX_STOP_IOCB)); 1222 rc = lpfc_sli_issue_mbox(phba, mbox, (MBX_NOWAIT | MBX_STOP_IOCB));
1233 if (rc == MBX_NOT_FINISHED) { 1223 if (rc == MBX_NOT_FINISHED) {
1234 lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_VPORT, 1224 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT,
1235 "%d (%d):1800 Could not issue unreg_vpi\n", 1225 "1800 Could not issue unreg_vpi\n");
1236 phba->brd_no, vport->vpi);
1237 mempool_free(mbox, phba->mbox_mem_pool); 1226 mempool_free(mbox, phba->mbox_mem_pool);
1238 vport->unreg_vpi_cmpl = VPORT_ERROR; 1227 vport->unreg_vpi_cmpl = VPORT_ERROR;
1239 } 1228 }
@@ -1250,9 +1239,9 @@ lpfc_mbx_cmpl_reg_vpi(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
1250 case 0x0011: 1239 case 0x0011:
1251 case 0x9601: 1240 case 0x9601:
1252 case 0x9602: 1241 case 0x9602:
1253 lpfc_printf_log(phba, KERN_INFO, LOG_NODE, 1242 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE,
1254 "%d (%d):0912 cmpl_reg_vpi, mb status = 0x%x\n", 1243 "0912 cmpl_reg_vpi, mb status = 0x%x\n",
1255 phba->brd_no, vport->vpi, mb->mbxStatus); 1244 mb->mbxStatus);
1256 lpfc_vport_set_state(vport, FC_VPORT_FAILED); 1245 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
1257 spin_lock_irq(shost->host_lock); 1246 spin_lock_irq(shost->host_lock);
1258 vport->fc_flag &= ~(FC_FABRIC | FC_PUBLIC_LOOP); 1247 vport->fc_flag &= ~(FC_FABRIC | FC_PUBLIC_LOOP);
@@ -1289,15 +1278,15 @@ void
1289lpfc_mbx_cmpl_fabric_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) 1278lpfc_mbx_cmpl_fabric_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
1290{ 1279{
1291 struct lpfc_vport *vport = pmb->vport; 1280 struct lpfc_vport *vport = pmb->vport;
1292 struct lpfc_vport *next_vport;
1293 MAILBOX_t *mb = &pmb->mb; 1281 MAILBOX_t *mb = &pmb->mb;
1294 struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *) (pmb->context1); 1282 struct lpfc_dmabuf *mp = (struct lpfc_dmabuf *) (pmb->context1);
1295 struct lpfc_nodelist *ndlp; 1283 struct lpfc_nodelist *ndlp;
1296 ndlp = (struct lpfc_nodelist *) pmb->context2; 1284 struct lpfc_vport **vports;
1285 int i;
1297 1286
1287 ndlp = (struct lpfc_nodelist *) pmb->context2;
1298 pmb->context1 = NULL; 1288 pmb->context1 = NULL;
1299 pmb->context2 = NULL; 1289 pmb->context2 = NULL;
1300
1301 if (mb->mbxStatus) { 1290 if (mb->mbxStatus) {
1302 lpfc_mbuf_free(phba, mp->virt, mp->phys); 1291 lpfc_mbuf_free(phba, mp->virt, mp->phys);
1303 kfree(mp); 1292 kfree(mp);
@@ -1314,10 +1303,9 @@ lpfc_mbx_cmpl_fabric_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
1314 } 1303 }
1315 1304
1316 lpfc_vport_set_state(vport, FC_VPORT_FAILED); 1305 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
1317 lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, 1306 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
1318 "%d (%d):0258 Register Fabric login error: 0x%x\n", 1307 "0258 Register Fabric login error: 0x%x\n",
1319 phba->brd_no, vport->vpi, mb->mbxStatus); 1308 mb->mbxStatus);
1320
1321 return; 1309 return;
1322 } 1310 }
1323 1311
@@ -1328,21 +1316,26 @@ lpfc_mbx_cmpl_fabric_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
1328 lpfc_nlp_put(ndlp); /* Drop the reference from the mbox */ 1316 lpfc_nlp_put(ndlp); /* Drop the reference from the mbox */
1329 1317
1330 if (vport->port_state == LPFC_FABRIC_CFG_LINK) { 1318 if (vport->port_state == LPFC_FABRIC_CFG_LINK) {
1331 list_for_each_entry(next_vport, &phba->port_list, listentry) { 1319 vports = lpfc_create_vport_work_array(phba);
1332 if (next_vport->port_type == LPFC_PHYSICAL_PORT) 1320 if (vports != NULL)
1333 continue; 1321 for(i = 0;
1334 1322 i < LPFC_MAX_VPORTS && vports[i] != NULL;
1335 if (phba->link_flag & LS_NPIV_FAB_SUPPORTED) 1323 i++) {
1336 lpfc_initial_fdisc(next_vport); 1324 if (vports[i]->port_type == LPFC_PHYSICAL_PORT)
1337 else if (phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) { 1325 continue;
1338 lpfc_vport_set_state(vport, 1326 if (phba->link_flag & LS_NPIV_FAB_SUPPORTED)
1339 FC_VPORT_NO_FABRIC_SUPP); 1327 lpfc_initial_fdisc(vports[i]);
1340 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 1328 else if (phba->sli3_options &
1341 "%d (%d):0259 No NPIV Fabric " 1329 LPFC_SLI3_NPIV_ENABLED) {
1342 "support\n", 1330 lpfc_vport_set_state(vports[i],
1343 phba->brd_no, vport->vpi); 1331 FC_VPORT_NO_FABRIC_SUPP);
1332 lpfc_printf_vlog(vport, KERN_ERR,
1333 LOG_ELS,
1334 "0259 No NPIV "
1335 "Fabric support\n");
1336 }
1344 } 1337 }
1345 } 1338 lpfc_destroy_vport_work_array(vports);
1346 lpfc_do_scr_ns_plogi(phba, vport); 1339 lpfc_do_scr_ns_plogi(phba, vport);
1347 } 1340 }
1348 1341
@@ -1386,9 +1379,9 @@ out:
1386 return; 1379 return;
1387 } 1380 }
1388 lpfc_vport_set_state(vport, FC_VPORT_FAILED); 1381 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
1389 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 1382 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
1390 "%d (%d):0260 Register NameServer error: 0x%x\n", 1383 "0260 Register NameServer error: 0x%x\n",
1391 phba->brd_no, vport->vpi, mb->mbxStatus); 1384 mb->mbxStatus);
1392 return; 1385 return;
1393 } 1386 }
1394 1387
@@ -1598,7 +1591,7 @@ lpfc_nlp_state_name(char *buffer, size_t size, int state)
1598 [NLP_STE_NPR_NODE] = "NPR", 1591 [NLP_STE_NPR_NODE] = "NPR",
1599 }; 1592 };
1600 1593
1601 if (state < ARRAY_SIZE(states) && states[state]) 1594 if (state < NLP_STE_MAX_STATE && states[state])
1602 strlcpy(buffer, states[state], size); 1595 strlcpy(buffer, states[state], size);
1603 else 1596 else
1604 snprintf(buffer, size, "unknown (%d)", state); 1597 snprintf(buffer, size, "unknown (%d)", state);
@@ -1613,12 +1606,11 @@ lpfc_nlp_set_state(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
1613 int old_state = ndlp->nlp_state; 1606 int old_state = ndlp->nlp_state;
1614 char name1[16], name2[16]; 1607 char name1[16], name2[16];
1615 1608
1616 lpfc_printf_log(vport->phba, KERN_INFO, LOG_NODE, 1609 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE,
1617 "%d (%d):0904 NPort state transition x%06x, %s -> %s\n", 1610 "0904 NPort state transition x%06x, %s -> %s\n",
1618 vport->phba->brd_no, vport->vpi, 1611 ndlp->nlp_DID,
1619 ndlp->nlp_DID, 1612 lpfc_nlp_state_name(name1, sizeof(name1), old_state),
1620 lpfc_nlp_state_name(name1, sizeof(name1), old_state), 1613 lpfc_nlp_state_name(name2, sizeof(name2), state));
1621 lpfc_nlp_state_name(name2, sizeof(name2), state));
1622 1614
1623 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_NODE, 1615 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_NODE,
1624 "node statechg did:x%x old:%d ste:%d", 1616 "node statechg did:x%x old:%d ste:%d",
@@ -1664,16 +1656,7 @@ lpfc_dequeue_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
1664void 1656void
1665lpfc_drop_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) 1657lpfc_drop_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
1666{ 1658{
1667 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 1659 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNUSED_NODE);
1668
1669 if ((ndlp->nlp_flag & NLP_DELAY_TMO) != 0)
1670 lpfc_cancel_retry_delay_tmo(vport, ndlp);
1671 if (ndlp->nlp_state && !list_empty(&ndlp->nlp_listp))
1672 lpfc_nlp_counters(vport, ndlp->nlp_state, -1);
1673 spin_lock_irq(shost->host_lock);
1674 list_del_init(&ndlp->nlp_listp);
1675 ndlp->nlp_flag &= ~NLP_TARGET_REMOVE;
1676 spin_unlock_irq(shost->host_lock);
1677 lpfc_nlp_put(ndlp); 1660 lpfc_nlp_put(ndlp);
1678} 1661}
1679 1662
@@ -1710,12 +1693,12 @@ lpfc_set_disctmo(struct lpfc_vport *vport)
1710 spin_unlock_irq(shost->host_lock); 1693 spin_unlock_irq(shost->host_lock);
1711 1694
1712 /* Start Discovery Timer state <hba_state> */ 1695 /* Start Discovery Timer state <hba_state> */
1713 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 1696 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
1714 "%d (%d):0247 Start Discovery Timer state x%x " 1697 "0247 Start Discovery Timer state x%x "
1715 "Data: x%x x%lx x%x x%x\n", 1698 "Data: x%x x%lx x%x x%x\n",
1716 phba->brd_no, vport->vpi, vport->port_state, tmo, 1699 vport->port_state, tmo,
1717 (unsigned long)&vport->fc_disctmo, vport->fc_plogi_cnt, 1700 (unsigned long)&vport->fc_disctmo, vport->fc_plogi_cnt,
1718 vport->fc_adisc_cnt); 1701 vport->fc_adisc_cnt);
1719 1702
1720 return; 1703 return;
1721} 1704}
@@ -1727,7 +1710,6 @@ int
1727lpfc_can_disctmo(struct lpfc_vport *vport) 1710lpfc_can_disctmo(struct lpfc_vport *vport)
1728{ 1711{
1729 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 1712 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
1730 struct lpfc_hba *phba = vport->phba;
1731 unsigned long iflags; 1713 unsigned long iflags;
1732 1714
1733 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, 1715 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD,
@@ -1746,13 +1728,11 @@ lpfc_can_disctmo(struct lpfc_vport *vport)
1746 } 1728 }
1747 1729
1748 /* Cancel Discovery Timer state <hba_state> */ 1730 /* Cancel Discovery Timer state <hba_state> */
1749 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 1731 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
1750 "%d (%d):0248 Cancel Discovery Timer state x%x " 1732 "0248 Cancel Discovery Timer state x%x "
1751 "Data: x%x x%x x%x\n", 1733 "Data: x%x x%x x%x\n",
1752 phba->brd_no, vport->vpi, vport->port_state, 1734 vport->port_state, vport->fc_flag,
1753 vport->fc_flag, vport->fc_plogi_cnt, 1735 vport->fc_plogi_cnt, vport->fc_adisc_cnt);
1754 vport->fc_adisc_cnt);
1755
1756 return 0; 1736 return 0;
1757} 1737}
1758 1738
@@ -1935,10 +1915,9 @@ lpfc_unreg_default_rpis(struct lpfc_vport *vport)
1935 rc = lpfc_sli_issue_mbox(phba, mbox, 1915 rc = lpfc_sli_issue_mbox(phba, mbox,
1936 (MBX_NOWAIT | MBX_STOP_IOCB)); 1916 (MBX_NOWAIT | MBX_STOP_IOCB));
1937 if (rc == MBX_NOT_FINISHED) { 1917 if (rc == MBX_NOT_FINISHED) {
1938 lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_VPORT, 1918 lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT,
1939 "%d (%d):1815 Could not issue " 1919 "1815 Could not issue "
1940 "unreg_did (default rpis)\n", 1920 "unreg_did (default rpis)\n");
1941 phba->brd_no, vport->vpi);
1942 mempool_free(mbox, phba->mbox_mem_pool); 1921 mempool_free(mbox, phba->mbox_mem_pool);
1943 } 1922 }
1944 } 1923 }
@@ -1957,12 +1936,11 @@ lpfc_cleanup_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
1957 struct lpfc_dmabuf *mp; 1936 struct lpfc_dmabuf *mp;
1958 1937
1959 /* Cleanup node for NPort <nlp_DID> */ 1938 /* Cleanup node for NPort <nlp_DID> */
1960 lpfc_printf_log(phba, KERN_INFO, LOG_NODE, 1939 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE,
1961 "%d (%d):0900 Cleanup node for NPort x%x " 1940 "0900 Cleanup node for NPort x%x "
1962 "Data: x%x x%x x%x\n", 1941 "Data: x%x x%x x%x\n",
1963 phba->brd_no, vport->vpi, ndlp->nlp_DID, ndlp->nlp_flag, 1942 ndlp->nlp_DID, ndlp->nlp_flag,
1964 ndlp->nlp_state, ndlp->nlp_rpi); 1943 ndlp->nlp_state, ndlp->nlp_rpi);
1965
1966 lpfc_dequeue_node(vport, ndlp); 1944 lpfc_dequeue_node(vport, ndlp);
1967 1945
1968 /* cleanup any ndlp on mbox q waiting for reglogin cmpl */ 1946 /* cleanup any ndlp on mbox q waiting for reglogin cmpl */
@@ -2094,7 +2072,6 @@ lpfc_matchdid(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
2094static struct lpfc_nodelist * 2072static struct lpfc_nodelist *
2095__lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did) 2073__lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did)
2096{ 2074{
2097 struct lpfc_hba *phba = vport->phba;
2098 struct lpfc_nodelist *ndlp; 2075 struct lpfc_nodelist *ndlp;
2099 uint32_t data1; 2076 uint32_t data1;
2100 2077
@@ -2104,20 +2081,18 @@ __lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did)
2104 ((uint32_t) ndlp->nlp_xri << 16) | 2081 ((uint32_t) ndlp->nlp_xri << 16) |
2105 ((uint32_t) ndlp->nlp_type << 8) | 2082 ((uint32_t) ndlp->nlp_type << 8) |
2106 ((uint32_t) ndlp->nlp_rpi & 0xff)); 2083 ((uint32_t) ndlp->nlp_rpi & 0xff));
2107 lpfc_printf_log(phba, KERN_INFO, LOG_NODE, 2084 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE,
2108 "%d (%d):0929 FIND node DID " 2085 "0929 FIND node DID "
2109 " Data: x%p x%x x%x x%x\n", 2086 "Data: x%p x%x x%x x%x\n",
2110 phba->brd_no, vport->vpi, 2087 ndlp, ndlp->nlp_DID,
2111 ndlp, ndlp->nlp_DID, 2088 ndlp->nlp_flag, data1);
2112 ndlp->nlp_flag, data1);
2113 return ndlp; 2089 return ndlp;
2114 } 2090 }
2115 } 2091 }
2116 2092
2117 /* FIND node did <did> NOT FOUND */ 2093 /* FIND node did <did> NOT FOUND */
2118 lpfc_printf_log(phba, KERN_INFO, LOG_NODE, 2094 lpfc_printf_vlog(vport, KERN_INFO, LOG_NODE,
2119 "%d (%d):0932 FIND node did x%x NOT FOUND.\n", 2095 "0932 FIND node did x%x NOT FOUND.\n", did);
2120 phba->brd_no, vport->vpi, did);
2121 return NULL; 2096 return NULL;
2122} 2097}
2123 2098
@@ -2208,7 +2183,7 @@ lpfc_disc_list_loopmap(struct lpfc_vport *vport)
2208 /* If cfg_scan_down is set, start from highest 2183 /* If cfg_scan_down is set, start from highest
2209 * ALPA (0xef) to lowest (0x1). 2184 * ALPA (0xef) to lowest (0x1).
2210 */ 2185 */
2211 if (phba->cfg_scan_down) 2186 if (vport->cfg_scan_down)
2212 index = j; 2187 index = j;
2213 else 2188 else
2214 index = FC_MAXLOOP - j - 1; 2189 index = FC_MAXLOOP - j - 1;
@@ -2309,12 +2284,11 @@ lpfc_disc_start(struct lpfc_vport *vport)
2309 vport->num_disc_nodes = 0; 2284 vport->num_disc_nodes = 0;
2310 2285
2311 /* Start Discovery state <hba_state> */ 2286 /* Start Discovery state <hba_state> */
2312 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 2287 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
2313 "%d (%d):0202 Start Discovery hba state x%x " 2288 "0202 Start Discovery hba state x%x "
2314 "Data: x%x x%x x%x\n", 2289 "Data: x%x x%x x%x\n",
2315 phba->brd_no, vport->vpi, vport->port_state, 2290 vport->port_state, vport->fc_flag, vport->fc_plogi_cnt,
2316 vport->fc_flag, vport->fc_plogi_cnt, 2291 vport->fc_adisc_cnt);
2317 vport->fc_adisc_cnt);
2318 2292
2319 /* First do ADISCs - if any */ 2293 /* First do ADISCs - if any */
2320 num_sent = lpfc_els_disc_adisc(vport); 2294 num_sent = lpfc_els_disc_adisc(vport);
@@ -2532,10 +2506,8 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport)
2532 * FAN 2506 * FAN
2533 */ 2507 */
2534 /* FAN timeout */ 2508 /* FAN timeout */
2535 lpfc_printf_log(phba, KERN_WARNING, LOG_DISCOVERY, 2509 lpfc_printf_vlog(vport, KERN_WARNING, LOG_DISCOVERY,
2536 "%d (%d):0221 FAN timeout\n", 2510 "0221 FAN timeout\n");
2537 phba->brd_no, vport->vpi);
2538
2539 /* Start discovery by sending FLOGI, clean up old rpis */ 2511 /* Start discovery by sending FLOGI, clean up old rpis */
2540 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, 2512 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes,
2541 nlp_listp) { 2513 nlp_listp) {
@@ -2562,10 +2534,9 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport)
2562 case LPFC_FLOGI: 2534 case LPFC_FLOGI:
2563 /* port_state is identically LPFC_FLOGI while waiting for FLOGI cmpl */ 2535 /* port_state is identically LPFC_FLOGI while waiting for FLOGI cmpl */
2564 /* Initial FLOGI timeout */ 2536 /* Initial FLOGI timeout */
2565 lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, 2537 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
2566 "%d (%d):0222 Initial %s timeout\n", 2538 "0222 Initial %s timeout\n",
2567 phba->brd_no, vport->vpi, 2539 vport->vpi ? "FLOGI" : "FDISC");
2568 vport->vpi ? "FLOGI" : "FDISC");
2569 2540
2570 /* Assume no Fabric and go on with discovery. 2541 /* Assume no Fabric and go on with discovery.
2571 * Check for outstanding ELS FLOGI to abort. 2542 * Check for outstanding ELS FLOGI to abort.
@@ -2581,11 +2552,9 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport)
2581 case LPFC_FABRIC_CFG_LINK: 2552 case LPFC_FABRIC_CFG_LINK:
2582 /* hba_state is identically LPFC_FABRIC_CFG_LINK while waiting for 2553 /* hba_state is identically LPFC_FABRIC_CFG_LINK while waiting for
2583 NameServer login */ 2554 NameServer login */
2584 lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, 2555 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
2585 "%d (%d):0223 Timeout while waiting for " 2556 "0223 Timeout while waiting for "
2586 "NameServer login\n", 2557 "NameServer login\n");
2587 phba->brd_no, vport->vpi);
2588
2589 /* Next look for NameServer ndlp */ 2558 /* Next look for NameServer ndlp */
2590 ndlp = lpfc_findnode_did(vport, NameServer_DID); 2559 ndlp = lpfc_findnode_did(vport, NameServer_DID);
2591 if (ndlp) 2560 if (ndlp)
@@ -2596,11 +2565,10 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport)
2596 2565
2597 case LPFC_NS_QRY: 2566 case LPFC_NS_QRY:
2598 /* Check for wait for NameServer Rsp timeout */ 2567 /* Check for wait for NameServer Rsp timeout */
2599 lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, 2568 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
2600 "%d (%d):0224 NameServer Query timeout " 2569 "0224 NameServer Query timeout "
2601 "Data: x%x x%x\n", 2570 "Data: x%x x%x\n",
2602 phba->brd_no, vport->vpi, 2571 vport->fc_ns_retry, LPFC_MAX_NS_RETRY);
2603 vport->fc_ns_retry, LPFC_MAX_NS_RETRY);
2604 2572
2605 if (vport->fc_ns_retry < LPFC_MAX_NS_RETRY) { 2573 if (vport->fc_ns_retry < LPFC_MAX_NS_RETRY) {
2606 /* Try it one more time */ 2574 /* Try it one more time */
@@ -2627,10 +2595,9 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport)
2627 /* Setup and issue mailbox INITIALIZE LINK command */ 2595 /* Setup and issue mailbox INITIALIZE LINK command */
2628 initlinkmbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); 2596 initlinkmbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
2629 if (!initlinkmbox) { 2597 if (!initlinkmbox) {
2630 lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, 2598 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
2631 "%d (%d):0206 Device Discovery " 2599 "0206 Device Discovery "
2632 "completion error\n", 2600 "completion error\n");
2633 phba->brd_no, vport->vpi);
2634 phba->link_state = LPFC_HBA_ERROR; 2601 phba->link_state = LPFC_HBA_ERROR;
2635 break; 2602 break;
2636 } 2603 }
@@ -2651,9 +2618,8 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport)
2651 2618
2652 case LPFC_DISC_AUTH: 2619 case LPFC_DISC_AUTH:
2653 /* Node Authentication timeout */ 2620 /* Node Authentication timeout */
2654 lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, 2621 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
2655 "%d (%d):0227 Node Authentication timeout\n", 2622 "0227 Node Authentication timeout\n");
2656 phba->brd_no, vport->vpi);
2657 lpfc_disc_flush_list(vport); 2623 lpfc_disc_flush_list(vport);
2658 2624
2659 /* 2625 /*
@@ -2670,11 +2636,10 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport)
2670 2636
2671 case LPFC_VPORT_READY: 2637 case LPFC_VPORT_READY:
2672 if (vport->fc_flag & FC_RSCN_MODE) { 2638 if (vport->fc_flag & FC_RSCN_MODE) {
2673 lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, 2639 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
2674 "%d (%d):0231 RSCN timeout Data: x%x " 2640 "0231 RSCN timeout Data: x%x "
2675 "x%x\n", 2641 "x%x\n",
2676 phba->brd_no, vport->vpi, 2642 vport->fc_ns_retry, LPFC_MAX_NS_RETRY);
2677 vport->fc_ns_retry, LPFC_MAX_NS_RETRY);
2678 2643
2679 /* Cleanup any outstanding ELS commands */ 2644 /* Cleanup any outstanding ELS commands */
2680 lpfc_els_flush_cmd(vport); 2645 lpfc_els_flush_cmd(vport);
@@ -2685,20 +2650,17 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport)
2685 break; 2650 break;
2686 2651
2687 default: 2652 default:
2688 lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, 2653 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
2689 "%d (%d):0229 Unexpected discovery timeout, " 2654 "0229 Unexpected discovery timeout, "
2690 "vport State x%x\n", 2655 "vport State x%x\n", vport->port_state);
2691 phba->brd_no, vport->vpi, vport->port_state);
2692
2693 break; 2656 break;
2694 } 2657 }
2695 2658
2696 switch (phba->link_state) { 2659 switch (phba->link_state) {
2697 case LPFC_CLEAR_LA: 2660 case LPFC_CLEAR_LA:
2698 /* CLEAR LA timeout */ 2661 /* CLEAR LA timeout */
2699 lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, 2662 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
2700 "%d (%d):0228 CLEAR LA timeout\n", 2663 "0228 CLEAR LA timeout\n");
2701 phba->brd_no, vport->vpi);
2702 clrlaerr = 1; 2664 clrlaerr = 1;
2703 break; 2665 break;
2704 2666
@@ -2709,10 +2671,9 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport)
2709 case LPFC_LINK_DOWN: 2671 case LPFC_LINK_DOWN:
2710 case LPFC_LINK_UP: 2672 case LPFC_LINK_UP:
2711 case LPFC_HBA_ERROR: 2673 case LPFC_HBA_ERROR:
2712 lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, 2674 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
2713 "%d (%d):0230 Unexpected timeout, hba link " 2675 "0230 Unexpected timeout, hba link "
2714 "state x%x\n", 2676 "state x%x\n", phba->link_state);
2715 phba->brd_no, vport->vpi, phba->link_state);
2716 clrlaerr = 1; 2677 clrlaerr = 1;
2717 break; 2678 break;
2718 2679
@@ -2757,7 +2718,7 @@ lpfc_mbx_cmpl_fdmi_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
2757 * fdmi-on=2 (supporting RPA/hostnmae) 2718 * fdmi-on=2 (supporting RPA/hostnmae)
2758 */ 2719 */
2759 2720
2760 if (phba->cfg_fdmi_on == 1) 2721 if (vport->cfg_fdmi_on == 1)
2761 lpfc_fdmi_cmd(vport, ndlp, SLI_MGMT_DHBA); 2722 lpfc_fdmi_cmd(vport, ndlp, SLI_MGMT_DHBA);
2762 else 2723 else
2763 mod_timer(&vport->fc_fdmitmo, jiffies + HZ * 60); 2724 mod_timer(&vport->fc_fdmitmo, jiffies + HZ * 60);
@@ -2854,32 +2815,6 @@ lpfc_findnode_wwpn(struct lpfc_vport *vport, struct lpfc_name *wwpn)
2854} 2815}
2855 2816
2856void 2817void
2857lpfc_dev_loss_delay(unsigned long ptr)
2858{
2859 struct lpfc_nodelist *ndlp = (struct lpfc_nodelist *) ptr;
2860 struct lpfc_vport *vport = ndlp->vport;
2861 struct lpfc_hba *phba = vport->phba;
2862 struct lpfc_work_evt *evtp = &ndlp->dev_loss_evt;
2863 unsigned long flags;
2864
2865 evtp = &ndlp->dev_loss_evt;
2866
2867 spin_lock_irqsave(&phba->hbalock, flags);
2868 if (!list_empty(&evtp->evt_listp)) {
2869 spin_unlock_irqrestore(&phba->hbalock, flags);
2870 return;
2871 }
2872
2873 evtp->evt_arg1 = ndlp;
2874 evtp->evt = LPFC_EVT_DEV_LOSS_DELAY;
2875 list_add_tail(&evtp->evt_listp, &phba->work_list);
2876 if (phba->work_wait)
2877 lpfc_worker_wake_up(phba);
2878 spin_unlock_irqrestore(&phba->hbalock, flags);
2879 return;
2880}
2881
2882void
2883lpfc_nlp_init(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, 2818lpfc_nlp_init(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
2884 uint32_t did) 2819 uint32_t did)
2885{ 2820{
@@ -2902,7 +2837,7 @@ lpfc_nlp_init(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
2902 return; 2837 return;
2903} 2838}
2904 2839
2905void 2840static void
2906lpfc_nlp_release(struct kref *kref) 2841lpfc_nlp_release(struct kref *kref)
2907{ 2842{
2908 struct lpfc_nodelist *ndlp = container_of(kref, struct lpfc_nodelist, 2843 struct lpfc_nodelist *ndlp = container_of(kref, struct lpfc_nodelist,
diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h
index c2fb59f595f3..451accd5564b 100644
--- a/drivers/scsi/lpfc/lpfc_hw.h
+++ b/drivers/scsi/lpfc/lpfc_hw.h
@@ -150,7 +150,11 @@ struct lpfc_sli_ct_request {
150 struct gff_acc { 150 struct gff_acc {
151 uint8_t fbits[128]; 151 uint8_t fbits[128];
152 } gff_acc; 152 } gff_acc;
153#ifdef __BIG_ENDIAN_BITFIELD
154#define FCP_TYPE_FEATURE_OFFSET 7
155#else /* __LITTLE_ENDIAN_BITFIELD */
153#define FCP_TYPE_FEATURE_OFFSET 4 156#define FCP_TYPE_FEATURE_OFFSET 4
157#endif
154 struct rff { 158 struct rff {
155 uint32_t PortId; 159 uint32_t PortId;
156 uint8_t reserved[2]; 160 uint8_t reserved[2];
@@ -805,7 +809,7 @@ typedef struct _RNID { /* Structure is in Big Endian format */
805 } un; 809 } un;
806} RNID; 810} RNID;
807 811
808typedef struct _RPS { /* Structure is in Big Endian format */ 812typedef struct _RPS { /* Structure is in Big Endian format */
809 union { 813 union {
810 uint32_t portNum; 814 uint32_t portNum;
811 struct lpfc_name portName; 815 struct lpfc_name portName;
@@ -823,7 +827,7 @@ typedef struct _RPS_RSP { /* Structure is in Big Endian format */
823 uint32_t crcCnt; 827 uint32_t crcCnt;
824} RPS_RSP; 828} RPS_RSP;
825 829
826typedef struct _RPL { /* Structure is in Big Endian format */ 830typedef struct _RPL { /* Structure is in Big Endian format */
827 uint32_t maxsize; 831 uint32_t maxsize;
828 uint32_t index; 832 uint32_t index;
829} RPL; 833} RPL;
@@ -834,7 +838,7 @@ typedef struct _PORT_NUM_BLK {
834 struct lpfc_name portName; 838 struct lpfc_name portName;
835} PORT_NUM_BLK; 839} PORT_NUM_BLK;
836 840
837typedef struct _RPL_RSP { /* Structure is in Big Endian format */ 841typedef struct _RPL_RSP { /* Structure is in Big Endian format */
838 uint32_t listLen; 842 uint32_t listLen;
839 uint32_t index; 843 uint32_t index;
840 PORT_NUM_BLK port_num_blk; 844 PORT_NUM_BLK port_num_blk;
@@ -2613,8 +2617,8 @@ typedef union {
2613 LOAD_SM_VAR varLdSM; /* cmd = 1 (LOAD_SM) */ 2617 LOAD_SM_VAR varLdSM; /* cmd = 1 (LOAD_SM) */
2614 READ_NV_VAR varRDnvp; /* cmd = 2 (READ_NVPARMS) */ 2618 READ_NV_VAR varRDnvp; /* cmd = 2 (READ_NVPARMS) */
2615 WRITE_NV_VAR varWTnvp; /* cmd = 3 (WRITE_NVPARMS) */ 2619 WRITE_NV_VAR varWTnvp; /* cmd = 3 (WRITE_NVPARMS) */
2616 BIU_DIAG_VAR varBIUdiag; /* cmd = 4 (RUN_BIU_DIAG) */ 2620 BIU_DIAG_VAR varBIUdiag; /* cmd = 4 (RUN_BIU_DIAG) */
2617 INIT_LINK_VAR varInitLnk; /* cmd = 5 (INIT_LINK) */ 2621 INIT_LINK_VAR varInitLnk; /* cmd = 5 (INIT_LINK) */
2618 DOWN_LINK_VAR varDwnLnk; /* cmd = 6 (DOWN_LINK) */ 2622 DOWN_LINK_VAR varDwnLnk; /* cmd = 6 (DOWN_LINK) */
2619 CONFIG_LINK varCfgLnk; /* cmd = 7 (CONFIG_LINK) */ 2623 CONFIG_LINK varCfgLnk; /* cmd = 7 (CONFIG_LINK) */
2620 PART_SLIM_VAR varSlim; /* cmd = 8 (PART_SLIM) */ 2624 PART_SLIM_VAR varSlim; /* cmd = 8 (PART_SLIM) */
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 07bd0dcdf0d6..414350ab584e 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -53,8 +53,6 @@ static struct scsi_transport_template *lpfc_transport_template = NULL;
53static struct scsi_transport_template *lpfc_vport_transport_template = NULL; 53static struct scsi_transport_template *lpfc_vport_transport_template = NULL;
54static DEFINE_IDR(lpfc_hba_index); 54static DEFINE_IDR(lpfc_hba_index);
55 55
56
57
58/************************************************************************/ 56/************************************************************************/
59/* */ 57/* */
60/* lpfc_config_port_prep */ 58/* lpfc_config_port_prep */
@@ -107,10 +105,9 @@ lpfc_config_port_prep(struct lpfc_hba *phba)
107 105
108 if (rc != MBX_SUCCESS) { 106 if (rc != MBX_SUCCESS) {
109 lpfc_printf_log(phba, KERN_ERR, LOG_MBOX, 107 lpfc_printf_log(phba, KERN_ERR, LOG_MBOX,
110 "%d:0324 Config Port initialization " 108 "0324 Config Port initialization "
111 "error, mbxCmd x%x READ_NVPARM, " 109 "error, mbxCmd x%x READ_NVPARM, "
112 "mbxStatus x%x\n", 110 "mbxStatus x%x\n",
113 phba->brd_no,
114 mb->mbxCommand, mb->mbxStatus); 111 mb->mbxCommand, mb->mbxStatus);
115 mempool_free(pmb, phba->mbox_mem_pool); 112 mempool_free(pmb, phba->mbox_mem_pool);
116 return -ERESTART; 113 return -ERESTART;
@@ -128,9 +125,8 @@ lpfc_config_port_prep(struct lpfc_hba *phba)
128 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL); 125 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL);
129 if (rc != MBX_SUCCESS) { 126 if (rc != MBX_SUCCESS) {
130 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 127 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
131 "%d:0439 Adapter failed to init, mbxCmd x%x " 128 "0439 Adapter failed to init, mbxCmd x%x "
132 "READ_REV, mbxStatus x%x\n", 129 "READ_REV, mbxStatus x%x\n",
133 phba->brd_no,
134 mb->mbxCommand, mb->mbxStatus); 130 mb->mbxCommand, mb->mbxStatus);
135 mempool_free( pmb, phba->mbox_mem_pool); 131 mempool_free( pmb, phba->mbox_mem_pool);
136 return -ERESTART; 132 return -ERESTART;
@@ -144,9 +140,8 @@ lpfc_config_port_prep(struct lpfc_hba *phba)
144 if (mb->un.varRdRev.rr == 0) { 140 if (mb->un.varRdRev.rr == 0) {
145 vp->rev.rBit = 0; 141 vp->rev.rBit = 0;
146 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 142 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
147 "%d:0440 Adapter failed to init, READ_REV has " 143 "0440 Adapter failed to init, READ_REV has "
148 "missing revision information.\n", 144 "missing revision information.\n");
149 phba->brd_no);
150 mempool_free(pmb, phba->mbox_mem_pool); 145 mempool_free(pmb, phba->mbox_mem_pool);
151 return -ERESTART; 146 return -ERESTART;
152 } 147 }
@@ -197,9 +192,8 @@ lpfc_config_port_prep(struct lpfc_hba *phba)
197 192
198 if (rc != MBX_SUCCESS) { 193 if (rc != MBX_SUCCESS) {
199 lpfc_printf_log(phba, KERN_INFO, LOG_INIT, 194 lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
200 "%d:0441 VPD not present on adapter, " 195 "0441 VPD not present on adapter, "
201 "mbxCmd x%x DUMP VPD, mbxStatus x%x\n", 196 "mbxCmd x%x DUMP VPD, mbxStatus x%x\n",
202 phba->brd_no,
203 mb->mbxCommand, mb->mbxStatus); 197 mb->mbxCommand, mb->mbxStatus);
204 mb->un.varDmp.word_cnt = 0; 198 mb->un.varDmp.word_cnt = 0;
205 } 199 }
@@ -253,9 +247,8 @@ lpfc_config_port_post(struct lpfc_hba *phba)
253 pmb->vport = vport; 247 pmb->vport = vport;
254 if (lpfc_sli_issue_mbox(phba, pmb, MBX_POLL) != MBX_SUCCESS) { 248 if (lpfc_sli_issue_mbox(phba, pmb, MBX_POLL) != MBX_SUCCESS) {
255 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 249 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
256 "%d:0448 Adapter failed init, mbxCmd x%x " 250 "0448 Adapter failed init, mbxCmd x%x "
257 "READ_SPARM mbxStatus x%x\n", 251 "READ_SPARM mbxStatus x%x\n",
258 phba->brd_no,
259 mb->mbxCommand, mb->mbxStatus); 252 mb->mbxCommand, mb->mbxStatus);
260 phba->link_state = LPFC_HBA_ERROR; 253 phba->link_state = LPFC_HBA_ERROR;
261 mp = (struct lpfc_dmabuf *) pmb->context1; 254 mp = (struct lpfc_dmabuf *) pmb->context1;
@@ -312,9 +305,8 @@ lpfc_config_port_post(struct lpfc_hba *phba)
312 pmb->vport = vport; 305 pmb->vport = vport;
313 if (lpfc_sli_issue_mbox(phba, pmb, MBX_POLL) != MBX_SUCCESS) { 306 if (lpfc_sli_issue_mbox(phba, pmb, MBX_POLL) != MBX_SUCCESS) {
314 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 307 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
315 "%d:0453 Adapter failed to init, mbxCmd x%x " 308 "0453 Adapter failed to init, mbxCmd x%x "
316 "READ_CONFIG, mbxStatus x%x\n", 309 "READ_CONFIG, mbxStatus x%x\n",
317 phba->brd_no,
318 mb->mbxCommand, mb->mbxStatus); 310 mb->mbxCommand, mb->mbxStatus);
319 phba->link_state = LPFC_HBA_ERROR; 311 phba->link_state = LPFC_HBA_ERROR;
320 mempool_free( pmb, phba->mbox_mem_pool); 312 mempool_free( pmb, phba->mbox_mem_pool);
@@ -344,9 +336,8 @@ lpfc_config_port_post(struct lpfc_hba *phba)
344 && !(phba->lmt & LMT_10Gb))) { 336 && !(phba->lmt & LMT_10Gb))) {
345 /* Reset link speed to auto */ 337 /* Reset link speed to auto */
346 lpfc_printf_log(phba, KERN_WARNING, LOG_LINK_EVENT, 338 lpfc_printf_log(phba, KERN_WARNING, LOG_LINK_EVENT,
347 "%d:1302 Invalid speed for this board: " 339 "1302 Invalid speed for this board: "
348 "Reset link speed to auto: x%x\n", 340 "Reset link speed to auto: x%x\n",
349 phba->brd_no,
350 phba->cfg_link_speed); 341 phba->cfg_link_speed);
351 phba->cfg_link_speed = LINK_SPEED_AUTO; 342 phba->cfg_link_speed = LINK_SPEED_AUTO;
352 } 343 }
@@ -402,9 +393,8 @@ lpfc_config_port_post(struct lpfc_hba *phba)
402 lpfc_set_loopback_flag(phba); 393 lpfc_set_loopback_flag(phba);
403 if (rc != MBX_SUCCESS) { 394 if (rc != MBX_SUCCESS) {
404 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 395 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
405 "%d:0454 Adapter failed to init, mbxCmd x%x " 396 "0454 Adapter failed to init, mbxCmd x%x "
406 "INIT_LINK, mbxStatus x%x\n", 397 "INIT_LINK, mbxStatus x%x\n",
407 phba->brd_no,
408 mb->mbxCommand, mb->mbxStatus); 398 mb->mbxCommand, mb->mbxStatus);
409 399
410 /* Clear all interrupt enable conditions */ 400 /* Clear all interrupt enable conditions */
@@ -437,16 +427,11 @@ lpfc_config_port_post(struct lpfc_hba *phba)
437int 427int
438lpfc_hba_down_prep(struct lpfc_hba *phba) 428lpfc_hba_down_prep(struct lpfc_hba *phba)
439{ 429{
440 struct lpfc_vport *vport = phba->pport;
441
442 /* Disable interrupts */ 430 /* Disable interrupts */
443 writel(0, phba->HCregaddr); 431 writel(0, phba->HCregaddr);
444 readl(phba->HCregaddr); /* flush */ 432 readl(phba->HCregaddr); /* flush */
445 433
446 list_for_each_entry(vport, &phba->port_list, listentry) { 434 lpfc_cleanup_discovery_resources(phba->pport);
447 lpfc_cleanup_discovery_resources(vport);
448 }
449
450 return 0; 435 return 0;
451} 436}
452 437
@@ -518,7 +503,7 @@ lpfc_hb_mbox_cmpl(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmboxq)
518 mempool_free(pmboxq, phba->mbox_mem_pool); 503 mempool_free(pmboxq, phba->mbox_mem_pool);
519 if (!(phba->pport->fc_flag & FC_OFFLINE_MODE) && 504 if (!(phba->pport->fc_flag & FC_OFFLINE_MODE) &&
520 !(phba->link_state == LPFC_HBA_ERROR) && 505 !(phba->link_state == LPFC_HBA_ERROR) &&
521 !(phba->pport->fc_flag & FC_UNLOADING)) 506 !(phba->pport->load_flag & FC_UNLOADING))
522 mod_timer(&phba->hb_tmofunc, 507 mod_timer(&phba->hb_tmofunc,
523 jiffies + HZ * LPFC_HB_MBOX_INTERVAL); 508 jiffies + HZ * LPFC_HB_MBOX_INTERVAL);
524 return; 509 return;
@@ -532,7 +517,7 @@ lpfc_hb_timeout_handler(struct lpfc_hba *phba)
532 struct lpfc_sli *psli = &phba->sli; 517 struct lpfc_sli *psli = &phba->sli;
533 518
534 if ((phba->link_state == LPFC_HBA_ERROR) || 519 if ((phba->link_state == LPFC_HBA_ERROR) ||
535 (phba->pport->fc_flag & FC_UNLOADING) || 520 (phba->pport->load_flag & FC_UNLOADING) ||
536 (phba->pport->fc_flag & FC_OFFLINE_MODE)) 521 (phba->pport->fc_flag & FC_OFFLINE_MODE))
537 return; 522 return;
538 523
@@ -586,8 +571,8 @@ lpfc_hb_timeout_handler(struct lpfc_hba *phba)
586 * need to take the HBA offline. 571 * need to take the HBA offline.
587 */ 572 */
588 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 573 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
589 "%d:0459 Adapter heartbeat failure, taking " 574 "0459 Adapter heartbeat failure, taking "
590 "this port offline.\n", phba->brd_no); 575 "this port offline.\n");
591 576
592 spin_lock_irq(&phba->hbalock); 577 spin_lock_irq(&phba->hbalock);
593 psli->sli_flag &= ~LPFC_SLI2_ACTIVE; 578 psli->sli_flag &= ~LPFC_SLI2_ACTIVE;
@@ -615,9 +600,10 @@ lpfc_handle_eratt(struct lpfc_hba *phba)
615 struct lpfc_vport *vport = phba->pport; 600 struct lpfc_vport *vport = phba->pport;
616 struct lpfc_sli *psli = &phba->sli; 601 struct lpfc_sli *psli = &phba->sli;
617 struct lpfc_sli_ring *pring; 602 struct lpfc_sli_ring *pring;
618 struct lpfc_vport *port_iterator; 603 struct lpfc_vport **vports;
619 uint32_t event_data; 604 uint32_t event_data;
620 struct Scsi_Host *shost; 605 struct Scsi_Host *shost;
606 int i;
621 607
622 /* If the pci channel is offline, ignore possible errors, 608 /* If the pci channel is offline, ignore possible errors,
623 * since we cannot communicate with the pci card anyway. */ 609 * since we cannot communicate with the pci card anyway. */
@@ -628,18 +614,21 @@ lpfc_handle_eratt(struct lpfc_hba *phba)
628 phba->work_hs & HS_FFER5) { 614 phba->work_hs & HS_FFER5) {
629 /* Re-establishing Link */ 615 /* Re-establishing Link */
630 lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT, 616 lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT,
631 "%d:1301 Re-establishing Link " 617 "1301 Re-establishing Link "
632 "Data: x%x x%x x%x\n", 618 "Data: x%x x%x x%x\n",
633 phba->brd_no, phba->work_hs, 619 phba->work_hs,
634 phba->work_status[0], phba->work_status[1]); 620 phba->work_status[0], phba->work_status[1]);
635 list_for_each_entry(port_iterator, &phba->port_list, 621 vports = lpfc_create_vport_work_array(phba);
636 listentry) { 622 if (vports != NULL)
637 shost = lpfc_shost_from_vport(port_iterator); 623 for(i = 0;
638 624 i < LPFC_MAX_VPORTS && vports[i] != NULL;
639 spin_lock_irq(shost->host_lock); 625 i++){
640 port_iterator->fc_flag |= FC_ESTABLISH_LINK; 626 shost = lpfc_shost_from_vport(vports[i]);
641 spin_unlock_irq(shost->host_lock); 627 spin_lock_irq(shost->host_lock);
642 } 628 vports[i]->fc_flag |= FC_ESTABLISH_LINK;
629 spin_unlock_irq(shost->host_lock);
630 }
631 lpfc_destroy_vport_work_array(vports);
643 spin_lock_irq(&phba->hbalock); 632 spin_lock_irq(&phba->hbalock);
644 psli->sli_flag &= ~LPFC_SLI2_ACTIVE; 633 psli->sli_flag &= ~LPFC_SLI2_ACTIVE;
645 spin_unlock_irq(&phba->hbalock); 634 spin_unlock_irq(&phba->hbalock);
@@ -673,9 +662,9 @@ lpfc_handle_eratt(struct lpfc_hba *phba)
673 * twice. This is the adapter hardware error path. 662 * twice. This is the adapter hardware error path.
674 */ 663 */
675 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 664 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
676 "%d:0457 Adapter Hardware Error " 665 "0457 Adapter Hardware Error "
677 "Data: x%x x%x x%x\n", 666 "Data: x%x x%x x%x\n",
678 phba->brd_no, phba->work_hs, 667 phba->work_hs,
679 phba->work_status[0], phba->work_status[1]); 668 phba->work_status[0], phba->work_status[1]);
680 669
681 event_data = FC_REG_DUMP_EVENT; 670 event_data = FC_REG_DUMP_EVENT;
@@ -708,7 +697,6 @@ lpfc_handle_latt(struct lpfc_hba *phba)
708{ 697{
709 struct lpfc_vport *vport = phba->pport; 698 struct lpfc_vport *vport = phba->pport;
710 struct lpfc_sli *psli = &phba->sli; 699 struct lpfc_sli *psli = &phba->sli;
711 struct lpfc_vport *port_iterator;
712 LPFC_MBOXQ_t *pmb; 700 LPFC_MBOXQ_t *pmb;
713 volatile uint32_t control; 701 volatile uint32_t control;
714 struct lpfc_dmabuf *mp; 702 struct lpfc_dmabuf *mp;
@@ -729,8 +717,7 @@ lpfc_handle_latt(struct lpfc_hba *phba)
729 rc = -EIO; 717 rc = -EIO;
730 718
731 /* Cleanup any outstanding ELS commands */ 719 /* Cleanup any outstanding ELS commands */
732 list_for_each_entry(port_iterator, &phba->port_list, listentry) 720 lpfc_els_flush_all_cmd(phba);
733 lpfc_els_flush_cmd(port_iterator);
734 721
735 psli->slistat.link_event++; 722 psli->slistat.link_event++;
736 lpfc_read_la(phba, pmb, mp); 723 lpfc_read_la(phba, pmb, mp);
@@ -773,8 +760,7 @@ lpfc_handle_latt_err_exit:
773 /* The other case is an error from issue_mbox */ 760 /* The other case is an error from issue_mbox */
774 if (rc == -ENOMEM) 761 if (rc == -ENOMEM)
775 lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX, 762 lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX,
776 "%d:0300 READ_LA: no buffers\n", 763 "0300 READ_LA: no buffers\n");
777 phba->brd_no);
778 764
779 return; 765 return;
780} 766}
@@ -799,8 +785,7 @@ lpfc_parse_vpd(struct lpfc_hba *phba, uint8_t *vpd, int len)
799 785
800 /* Vital Product */ 786 /* Vital Product */
801 lpfc_printf_log(phba, KERN_INFO, LOG_INIT, 787 lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
802 "%d:0455 Vital Product Data: x%x x%x x%x x%x\n", 788 "0455 Vital Product Data: x%x x%x x%x x%x\n",
803 phba->brd_no,
804 (uint32_t) vpd[0], (uint32_t) vpd[1], (uint32_t) vpd[2], 789 (uint32_t) vpd[0], (uint32_t) vpd[1], (uint32_t) vpd[2],
805 (uint32_t) vpd[3]); 790 (uint32_t) vpd[3]);
806 while (!finished && (index < (len - 4))) { 791 while (!finished && (index < (len - 4))) {
@@ -1313,22 +1298,25 @@ static void
1313lpfc_establish_link_tmo(unsigned long ptr) 1298lpfc_establish_link_tmo(unsigned long ptr)
1314{ 1299{
1315 struct lpfc_hba *phba = (struct lpfc_hba *) ptr; 1300 struct lpfc_hba *phba = (struct lpfc_hba *) ptr;
1316 struct lpfc_vport *vport = phba->pport; 1301 struct lpfc_vport **vports;
1317 unsigned long iflag; 1302 unsigned long iflag;
1303 int i;
1318 1304
1319 /* Re-establishing Link, timer expired */ 1305 /* Re-establishing Link, timer expired */
1320 lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, 1306 lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT,
1321 "%d:1300 Re-establishing Link, timer expired " 1307 "1300 Re-establishing Link, timer expired "
1322 "Data: x%x x%x\n", 1308 "Data: x%x x%x\n",
1323 phba->brd_no, vport->fc_flag, 1309 phba->pport->fc_flag, phba->pport->port_state);
1324 vport->port_state); 1310 vports = lpfc_create_vport_work_array(phba);
1325 list_for_each_entry(vport, &phba->port_list, listentry) { 1311 if (vports != NULL)
1326 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 1312 for(i = 0; i < LPFC_MAX_VPORTS && vports[i] != NULL; i++) {
1327 1313 struct Scsi_Host *shost;
1328 spin_lock_irqsave(shost->host_lock, iflag); 1314 shost = lpfc_shost_from_vport(vports[i]);
1329 vport->fc_flag &= ~FC_ESTABLISH_LINK; 1315 spin_lock_irqsave(shost->host_lock, iflag);
1330 spin_unlock_irqrestore(shost->host_lock, iflag); 1316 vports[i]->fc_flag &= ~FC_ESTABLISH_LINK;
1331 } 1317 spin_unlock_irqrestore(shost->host_lock, iflag);
1318 }
1319 lpfc_destroy_vport_work_array(vports);
1332} 1320}
1333 1321
1334void 1322void
@@ -1343,12 +1331,9 @@ lpfc_stop_vport_timers(struct lpfc_vport *vport)
1343static void 1331static void
1344lpfc_stop_phba_timers(struct lpfc_hba *phba) 1332lpfc_stop_phba_timers(struct lpfc_hba *phba)
1345{ 1333{
1346 struct lpfc_vport *vport;
1347
1348 del_timer_sync(&phba->fcp_poll_timer); 1334 del_timer_sync(&phba->fcp_poll_timer);
1349 del_timer_sync(&phba->fc_estabtmo); 1335 del_timer_sync(&phba->fc_estabtmo);
1350 list_for_each_entry(vport, &phba->port_list, listentry) 1336 lpfc_stop_vport_timers(phba->pport);
1351 lpfc_stop_vport_timers(vport);
1352 del_timer_sync(&phba->sli.mbox_tmo); 1337 del_timer_sync(&phba->sli.mbox_tmo);
1353 del_timer_sync(&phba->fabric_block_timer); 1338 del_timer_sync(&phba->fabric_block_timer);
1354 phba->hb_outstanding = 0; 1339 phba->hb_outstanding = 0;
@@ -1360,6 +1345,8 @@ int
1360lpfc_online(struct lpfc_hba *phba) 1345lpfc_online(struct lpfc_hba *phba)
1361{ 1346{
1362 struct lpfc_vport *vport = phba->pport; 1347 struct lpfc_vport *vport = phba->pport;
1348 struct lpfc_vport **vports;
1349 int i;
1363 1350
1364 if (!phba) 1351 if (!phba)
1365 return 0; 1352 return 0;
@@ -1368,8 +1355,7 @@ lpfc_online(struct lpfc_hba *phba)
1368 return 0; 1355 return 0;
1369 1356
1370 lpfc_printf_log(phba, KERN_WARNING, LOG_INIT, 1357 lpfc_printf_log(phba, KERN_WARNING, LOG_INIT,
1371 "%d:0458 Bring Adapter online\n", 1358 "0458 Bring Adapter online\n");
1372 phba->brd_no);
1373 1359
1374 lpfc_block_mgmt_io(phba); 1360 lpfc_block_mgmt_io(phba);
1375 1361
@@ -1383,14 +1369,18 @@ lpfc_online(struct lpfc_hba *phba)
1383 return 1; 1369 return 1;
1384 } 1370 }
1385 1371
1386 list_for_each_entry(vport, &phba->port_list, listentry) { 1372 vports = lpfc_create_vport_work_array(phba);
1387 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 1373 if (vports != NULL)
1388 spin_lock_irq(shost->host_lock); 1374 for(i = 0; i < LPFC_MAX_VPORTS && vports[i] != NULL; i++) {
1389 vport->fc_flag &= ~FC_OFFLINE_MODE; 1375 struct Scsi_Host *shost;
1390 if (phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) 1376 shost = lpfc_shost_from_vport(vports[i]);
1391 vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI; 1377 spin_lock_irq(shost->host_lock);
1392 spin_unlock_irq(shost->host_lock); 1378 vports[i]->fc_flag &= ~FC_OFFLINE_MODE;
1393 } 1379 if (phba->sli3_options & LPFC_SLI3_NPIV_ENABLED)
1380 vports[i]->fc_flag |= FC_VPORT_NEEDS_REG_VPI;
1381 spin_unlock_irq(shost->host_lock);
1382 }
1383 lpfc_destroy_vport_work_array(vports);
1394 1384
1395 lpfc_unblock_mgmt_io(phba); 1385 lpfc_unblock_mgmt_io(phba);
1396 return 0; 1386 return 0;
@@ -1440,39 +1430,39 @@ lpfc_offline_prep(struct lpfc_hba * phba)
1440void 1430void
1441lpfc_offline(struct lpfc_hba *phba) 1431lpfc_offline(struct lpfc_hba *phba)
1442{ 1432{
1443 struct lpfc_vport *vport = phba->pport; 1433 struct Scsi_Host *shost;
1444 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 1434 struct lpfc_vport **vports;
1445 struct lpfc_vport *port_iterator; 1435 int i;
1446 1436
1447 if (vport->fc_flag & FC_OFFLINE_MODE) 1437 if (phba->pport->fc_flag & FC_OFFLINE_MODE)
1448 return; 1438 return;
1449 1439
1450 /* stop all timers associated with this hba */ 1440 /* stop all timers associated with this hba */
1451 lpfc_stop_phba_timers(phba); 1441 lpfc_stop_phba_timers(phba);
1452 list_for_each_entry(port_iterator, &phba->port_list, listentry) { 1442 vports = lpfc_create_vport_work_array(phba);
1453 port_iterator->work_port_events = 0; 1443 if (vports != NULL)
1454 } 1444 for(i = 0; i < LPFC_MAX_VPORTS && vports[i] != NULL; i++)
1455 1445 lpfc_stop_vport_timers(vports[i]);
1446 lpfc_destroy_vport_work_array(vports);
1456 lpfc_printf_log(phba, KERN_WARNING, LOG_INIT, 1447 lpfc_printf_log(phba, KERN_WARNING, LOG_INIT,
1457 "%d:0460 Bring Adapter offline\n", 1448 "0460 Bring Adapter offline\n");
1458 phba->brd_no);
1459
1460 /* Bring down the SLI Layer and cleanup. The HBA is offline 1449 /* Bring down the SLI Layer and cleanup. The HBA is offline
1461 now. */ 1450 now. */
1462 lpfc_sli_hba_down(phba); 1451 lpfc_sli_hba_down(phba);
1463 spin_lock_irq(&phba->hbalock); 1452 spin_lock_irq(&phba->hbalock);
1464 phba->work_ha = 0; 1453 phba->work_ha = 0;
1465 vport->fc_flag |= FC_OFFLINE_MODE;
1466 spin_unlock_irq(&phba->hbalock); 1454 spin_unlock_irq(&phba->hbalock);
1467 list_for_each_entry(port_iterator, &phba->port_list, listentry) { 1455 vports = lpfc_create_vport_work_array(phba);
1468 shost = lpfc_shost_from_vport(port_iterator); 1456 if (vports != NULL)
1469 1457 for(i = 0; i < LPFC_MAX_VPORTS && vports[i] != NULL; i++) {
1470 lpfc_cleanup(port_iterator); 1458 shost = lpfc_shost_from_vport(vports[i]);
1471 spin_lock_irq(shost->host_lock); 1459 lpfc_cleanup(vports[i]);
1472 vport->work_port_events = 0; 1460 spin_lock_irq(shost->host_lock);
1473 vport->fc_flag |= FC_OFFLINE_MODE; 1461 vports[i]->work_port_events = 0;
1474 spin_unlock_irq(shost->host_lock); 1462 vports[i]->fc_flag |= FC_OFFLINE_MODE;
1475 } 1463 spin_unlock_irq(shost->host_lock);
1464 }
1465 lpfc_destroy_vport_work_array(vports);
1476} 1466}
1477 1467
1478/****************************************************************************** 1468/******************************************************************************
@@ -1509,15 +1499,19 @@ lpfc_scsi_free(struct lpfc_hba *phba)
1509 return 0; 1499 return 0;
1510} 1500}
1511 1501
1512
1513struct lpfc_vport * 1502struct lpfc_vport *
1514lpfc_create_port(struct lpfc_hba *phba, int instance, struct fc_vport *fc_vport) 1503lpfc_create_port(struct lpfc_hba *phba, int instance, struct device *dev)
1515{ 1504{
1516 struct lpfc_vport *vport; 1505 struct lpfc_vport *vport;
1517 struct Scsi_Host *shost; 1506 struct Scsi_Host *shost;
1518 int error = 0; 1507 int error = 0;
1519 1508
1520 shost = scsi_host_alloc(&lpfc_template, sizeof(struct lpfc_vport)); 1509 if (dev != &phba->pcidev->dev)
1510 shost = scsi_host_alloc(&lpfc_vport_template,
1511 sizeof(struct lpfc_vport));
1512 else
1513 shost = scsi_host_alloc(&lpfc_template,
1514 sizeof(struct lpfc_vport));
1521 if (!shost) 1515 if (!shost)
1522 goto out; 1516 goto out;
1523 1517
@@ -1527,9 +1521,10 @@ lpfc_create_port(struct lpfc_hba *phba, int instance, struct fc_vport *fc_vport)
1527 vport->load_flag |= FC_LOADING; 1521 vport->load_flag |= FC_LOADING;
1528 vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI; 1522 vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI;
1529 1523
1524 lpfc_get_vport_cfgparam(vport);
1530 shost->unique_id = instance; 1525 shost->unique_id = instance;
1531 shost->max_id = LPFC_MAX_TARGET; 1526 shost->max_id = LPFC_MAX_TARGET;
1532 shost->max_lun = phba->cfg_max_luns; 1527 shost->max_lun = vport->cfg_max_luns;
1533 shost->this_id = -1; 1528 shost->this_id = -1;
1534 shost->max_cmd_len = 16; 1529 shost->max_cmd_len = 16;
1535 /* 1530 /*
@@ -1538,7 +1533,7 @@ lpfc_create_port(struct lpfc_hba *phba, int instance, struct fc_vport *fc_vport)
1538 * max xri value determined in hba setup. 1533 * max xri value determined in hba setup.
1539 */ 1534 */
1540 shost->can_queue = phba->cfg_hba_queue_depth - 10; 1535 shost->can_queue = phba->cfg_hba_queue_depth - 10;
1541 if (fc_vport != NULL) { 1536 if (dev != &phba->pcidev->dev) {
1542 shost->transportt = lpfc_vport_transport_template; 1537 shost->transportt = lpfc_vport_transport_template;
1543 vport->port_type = LPFC_NPIV_PORT; 1538 vport->port_type = LPFC_NPIV_PORT;
1544 } else { 1539 } else {
@@ -1562,15 +1557,13 @@ lpfc_create_port(struct lpfc_hba *phba, int instance, struct fc_vport *fc_vport)
1562 vport->els_tmofunc.function = lpfc_els_timeout; 1557 vport->els_tmofunc.function = lpfc_els_timeout;
1563 vport->els_tmofunc.data = (unsigned long)vport; 1558 vport->els_tmofunc.data = (unsigned long)vport;
1564 1559
1565 if (fc_vport != NULL) { 1560 error = scsi_add_host(shost, dev);
1566 error = scsi_add_host(shost, &fc_vport->dev);
1567 } else {
1568 error = scsi_add_host(shost, &phba->pcidev->dev);
1569 }
1570 if (error) 1561 if (error)
1571 goto out_put_shost; 1562 goto out_put_shost;
1572 1563
1564 spin_lock_irq(&phba->hbalock);
1573 list_add_tail(&vport->listentry, &phba->port_list); 1565 list_add_tail(&vport->listentry, &phba->port_list);
1566 spin_unlock_irq(&phba->hbalock);
1574 return vport; 1567 return vport;
1575 1568
1576out_put_shost: 1569out_put_shost:
@@ -1625,23 +1618,21 @@ int lpfc_scan_finished(struct Scsi_Host *shost, unsigned long time)
1625 1618
1626 spin_lock_irq(shost->host_lock); 1619 spin_lock_irq(shost->host_lock);
1627 1620
1628 if (vport->fc_flag & FC_UNLOADING) { 1621 if (vport->load_flag & FC_UNLOADING) {
1629 stat = 1; 1622 stat = 1;
1630 goto finished; 1623 goto finished;
1631 } 1624 }
1632 if (time >= 30 * HZ) { 1625 if (time >= 30 * HZ) {
1633 lpfc_printf_log(phba, KERN_INFO, LOG_INIT, 1626 lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
1634 "%d:0461 Scanning longer than 30 " 1627 "0461 Scanning longer than 30 "
1635 "seconds. Continuing initialization\n", 1628 "seconds. Continuing initialization\n");
1636 phba->brd_no);
1637 stat = 1; 1629 stat = 1;
1638 goto finished; 1630 goto finished;
1639 } 1631 }
1640 if (time >= 15 * HZ && phba->link_state <= LPFC_LINK_DOWN) { 1632 if (time >= 15 * HZ && phba->link_state <= LPFC_LINK_DOWN) {
1641 lpfc_printf_log(phba, KERN_INFO, LOG_INIT, 1633 lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
1642 "%d:0465 Link down longer than 15 " 1634 "0465 Link down longer than 15 "
1643 "seconds. Continuing initialization\n", 1635 "seconds. Continuing initialization\n");
1644 phba->brd_no);
1645 stat = 1; 1636 stat = 1;
1646 goto finished; 1637 goto finished;
1647 } 1638 }
@@ -1704,7 +1695,7 @@ void lpfc_host_attrib_init(struct Scsi_Host *shost)
1704 1695
1705 fc_host_max_npiv_vports(shost) = phba->max_vpi; 1696 fc_host_max_npiv_vports(shost) = phba->max_vpi;
1706 spin_lock_irq(shost->host_lock); 1697 spin_lock_irq(shost->host_lock);
1707 vport->fc_flag &= ~FC_LOADING; 1698 vport->load_flag &= ~FC_LOADING;
1708 spin_unlock_irq(shost->host_lock); 1699 spin_unlock_irq(shost->host_lock);
1709} 1700}
1710 1701
@@ -1716,9 +1707,10 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
1716 struct lpfc_sli *psli; 1707 struct lpfc_sli *psli;
1717 struct lpfc_iocbq *iocbq_entry = NULL, *iocbq_next = NULL; 1708 struct lpfc_iocbq *iocbq_entry = NULL, *iocbq_next = NULL;
1718 struct Scsi_Host *shost = NULL; 1709 struct Scsi_Host *shost = NULL;
1710 void *ptr;
1719 unsigned long bar0map_len, bar2map_len; 1711 unsigned long bar0map_len, bar2map_len;
1720 int error = -ENODEV; 1712 int error = -ENODEV;
1721 int i; 1713 int i, hbq_count;
1722 uint16_t iotag; 1714 uint16_t iotag;
1723 1715
1724 if (pci_enable_device(pdev)) 1716 if (pci_enable_device(pdev))
@@ -1739,7 +1731,6 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
1739 goto out_free_phba; 1731 goto out_free_phba;
1740 1732
1741 INIT_LIST_HEAD(&phba->port_list); 1733 INIT_LIST_HEAD(&phba->port_list);
1742 INIT_LIST_HEAD(&phba->hbq_buffer_list);
1743 /* 1734 /*
1744 * Get all the module params for configuring this host and then 1735 * Get all the module params for configuring this host and then
1745 * establish the host. 1736 * establish the host.
@@ -1817,6 +1808,17 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
1817 if (!phba->hbqslimp.virt) 1808 if (!phba->hbqslimp.virt)
1818 goto out_free_slim; 1809 goto out_free_slim;
1819 1810
1811 hbq_count = lpfc_sli_hbq_count();
1812 ptr = phba->hbqslimp.virt;
1813 for (i = 0; i < hbq_count; ++i) {
1814 phba->hbqs[i].hbq_virt = ptr;
1815 INIT_LIST_HEAD(&phba->hbqs[i].hbq_buffer_list);
1816 ptr += (lpfc_hbq_defs[i]->entry_count *
1817 sizeof(struct lpfc_hbq_entry));
1818 }
1819 phba->hbqs[LPFC_ELS_HBQ].hbq_alloc_buffer = lpfc_els_hbq_alloc;
1820 phba->hbqs[LPFC_ELS_HBQ].hbq_free_buffer = lpfc_els_hbq_free;
1821
1820 memset(phba->hbqslimp.virt, 0, lpfc_sli_hbq_size()); 1822 memset(phba->hbqslimp.virt, 0, lpfc_sli_hbq_size());
1821 1823
1822 /* Initialize the SLI Layer to run with lpfc HBAs. */ 1824 /* Initialize the SLI Layer to run with lpfc HBAs. */
@@ -1880,7 +1882,7 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
1880 /* Initialize list of fabric iocbs */ 1882 /* Initialize list of fabric iocbs */
1881 INIT_LIST_HEAD(&phba->fabric_iocb_list); 1883 INIT_LIST_HEAD(&phba->fabric_iocb_list);
1882 1884
1883 vport = lpfc_create_port(phba, phba->brd_no, NULL); 1885 vport = lpfc_create_port(phba, phba->brd_no, &phba->pcidev->dev);
1884 if (!vport) 1886 if (!vport)
1885 goto out_kthread_stop; 1887 goto out_kthread_stop;
1886 1888
@@ -1892,18 +1894,19 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
1892 1894
1893 if (phba->cfg_use_msi) { 1895 if (phba->cfg_use_msi) {
1894 error = pci_enable_msi(phba->pcidev); 1896 error = pci_enable_msi(phba->pcidev);
1895 if (error) 1897 if (!error)
1896 lpfc_printf_log(phba, KERN_INFO, LOG_INIT, "%d:0452 " 1898 phba->using_msi = 1;
1897 "Enable MSI failed, continuing with " 1899 else
1898 "IRQ\n", phba->brd_no); 1900 lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
1901 "0452 Enable MSI failed, continuing "
1902 "with IRQ\n");
1899 } 1903 }
1900 1904
1901 error = request_irq(phba->pcidev->irq, lpfc_intr_handler, IRQF_SHARED, 1905 error = request_irq(phba->pcidev->irq, lpfc_intr_handler, IRQF_SHARED,
1902 LPFC_DRIVER_NAME, phba); 1906 LPFC_DRIVER_NAME, phba);
1903 if (error) { 1907 if (error) {
1904 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 1908 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
1905 "%d:0451 Enable interrupt handler failed\n", 1909 "0451 Enable interrupt handler failed\n");
1906 phba->brd_no);
1907 goto out_disable_msi; 1910 goto out_disable_msi;
1908 } 1911 }
1909 1912
@@ -1940,14 +1943,15 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
1940out_remove_device: 1943out_remove_device:
1941 lpfc_free_sysfs_attr(vport); 1944 lpfc_free_sysfs_attr(vport);
1942 spin_lock_irq(shost->host_lock); 1945 spin_lock_irq(shost->host_lock);
1943 vport->fc_flag |= FC_UNLOADING; 1946 vport->load_flag |= FC_UNLOADING;
1944 spin_unlock_irq(shost->host_lock); 1947 spin_unlock_irq(shost->host_lock);
1945out_free_irq: 1948out_free_irq:
1946 lpfc_stop_phba_timers(phba); 1949 lpfc_stop_phba_timers(phba);
1947 phba->pport->work_port_events = 0; 1950 phba->pport->work_port_events = 0;
1948 free_irq(phba->pcidev->irq, phba); 1951 free_irq(phba->pcidev->irq, phba);
1949out_disable_msi: 1952out_disable_msi:
1950 pci_disable_msi(phba->pcidev); 1953 if (phba->using_msi)
1954 pci_disable_msi(phba->pcidev);
1951 destroy_port(vport); 1955 destroy_port(vport);
1952out_kthread_stop: 1956out_kthread_stop:
1953 kthread_stop(phba->worker_thread); 1957 kthread_stop(phba->worker_thread);
@@ -1989,16 +1993,15 @@ lpfc_pci_remove_one(struct pci_dev *pdev)
1989 struct Scsi_Host *shost = pci_get_drvdata(pdev); 1993 struct Scsi_Host *shost = pci_get_drvdata(pdev);
1990 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; 1994 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
1991 struct lpfc_hba *phba = vport->phba; 1995 struct lpfc_hba *phba = vport->phba;
1992 struct lpfc_vport *port_iterator; 1996 spin_lock_irq(&phba->hbalock);
1993 list_for_each_entry(port_iterator, &phba->port_list, listentry) 1997 vport->load_flag |= FC_UNLOADING;
1994 port_iterator->load_flag |= FC_UNLOADING; 1998 spin_unlock_irq(&phba->hbalock);
1995 1999
1996 kfree(vport->vname); 2000 kfree(vport->vname);
1997 lpfc_free_sysfs_attr(vport); 2001 lpfc_free_sysfs_attr(vport);
1998 2002
1999 fc_remove_host(shost); 2003 fc_remove_host(shost);
2000 scsi_remove_host(shost); 2004 scsi_remove_host(shost);
2001
2002 /* 2005 /*
2003 * Bring down the SLI Layer. This step disable all interrupts, 2006 * Bring down the SLI Layer. This step disable all interrupts,
2004 * clears the rings, discards all mailbox commands, and resets 2007 * clears the rings, discards all mailbox commands, and resets
@@ -2012,7 +2015,6 @@ lpfc_pci_remove_one(struct pci_dev *pdev)
2012 list_del_init(&vport->listentry); 2015 list_del_init(&vport->listentry);
2013 spin_unlock_irq(&phba->hbalock); 2016 spin_unlock_irq(&phba->hbalock);
2014 2017
2015
2016 lpfc_debugfs_terminate(vport); 2018 lpfc_debugfs_terminate(vport);
2017 lpfc_cleanup(vport); 2019 lpfc_cleanup(vport);
2018 2020
@@ -2020,7 +2022,8 @@ lpfc_pci_remove_one(struct pci_dev *pdev)
2020 2022
2021 /* Release the irq reservation */ 2023 /* Release the irq reservation */
2022 free_irq(phba->pcidev->irq, phba); 2024 free_irq(phba->pcidev->irq, phba);
2023 pci_disable_msi(phba->pcidev); 2025 if (phba->using_msi)
2026 pci_disable_msi(phba->pcidev);
2024 2027
2025 pci_set_drvdata(pdev, NULL); 2028 pci_set_drvdata(pdev, NULL);
2026 scsi_host_put(shost); 2029 scsi_host_put(shost);
@@ -2062,8 +2065,8 @@ lpfc_pci_remove_one(struct pci_dev *pdev)
2062static pci_ers_result_t lpfc_io_error_detected(struct pci_dev *pdev, 2065static pci_ers_result_t lpfc_io_error_detected(struct pci_dev *pdev,
2063 pci_channel_state_t state) 2066 pci_channel_state_t state)
2064{ 2067{
2065 struct Scsi_Host *host = pci_get_drvdata(pdev); 2068 struct Scsi_Host *shost = pci_get_drvdata(pdev);
2066 struct lpfc_hba *phba = (struct lpfc_hba *)host->hostdata; 2069 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba;
2067 struct lpfc_sli *psli = &phba->sli; 2070 struct lpfc_sli *psli = &phba->sli;
2068 struct lpfc_sli_ring *pring; 2071 struct lpfc_sli_ring *pring;
2069 2072
@@ -2079,6 +2082,11 @@ static pci_ers_result_t lpfc_io_error_detected(struct pci_dev *pdev,
2079 pring = &psli->ring[psli->fcp_ring]; 2082 pring = &psli->ring[psli->fcp_ring];
2080 lpfc_sli_abort_iocb_ring(phba, pring); 2083 lpfc_sli_abort_iocb_ring(phba, pring);
2081 2084
2085 /* Release the irq reservation */
2086 free_irq(phba->pcidev->irq, phba);
2087 if (phba->using_msi)
2088 pci_disable_msi(phba->pcidev);
2089
2082 /* Request a slot reset. */ 2090 /* Request a slot reset. */
2083 return PCI_ERS_RESULT_NEED_RESET; 2091 return PCI_ERS_RESULT_NEED_RESET;
2084} 2092}
@@ -2091,8 +2099,8 @@ static pci_ers_result_t lpfc_io_error_detected(struct pci_dev *pdev,
2091 */ 2099 */
2092static pci_ers_result_t lpfc_io_slot_reset(struct pci_dev *pdev) 2100static pci_ers_result_t lpfc_io_slot_reset(struct pci_dev *pdev)
2093{ 2101{
2094 struct Scsi_Host *host = pci_get_drvdata(pdev); 2102 struct Scsi_Host *shost = pci_get_drvdata(pdev);
2095 struct lpfc_hba *phba = (struct lpfc_hba *)host->hostdata; 2103 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba;
2096 struct lpfc_sli *psli = &phba->sli; 2104 struct lpfc_sli *psli = &phba->sli;
2097 int bars = pci_select_bars(pdev, IORESOURCE_MEM); 2105 int bars = pci_select_bars(pdev, IORESOURCE_MEM);
2098 2106
@@ -2106,9 +2114,9 @@ static pci_ers_result_t lpfc_io_slot_reset(struct pci_dev *pdev)
2106 pci_set_master(pdev); 2114 pci_set_master(pdev);
2107 2115
2108 /* Re-establishing Link */ 2116 /* Re-establishing Link */
2109 spin_lock_irq(host->host_lock); 2117 spin_lock_irq(shost->host_lock);
2110 phba->pport->fc_flag |= FC_ESTABLISH_LINK; 2118 phba->pport->fc_flag |= FC_ESTABLISH_LINK;
2111 spin_unlock_irq(host->host_lock); 2119 spin_unlock_irq(shost->host_lock);
2112 2120
2113 spin_lock_irq(&phba->hbalock); 2121 spin_lock_irq(&phba->hbalock);
2114 psli->sli_flag &= ~LPFC_SLI2_ACTIVE; 2122 psli->sli_flag &= ~LPFC_SLI2_ACTIVE;
@@ -2131,8 +2139,8 @@ static pci_ers_result_t lpfc_io_slot_reset(struct pci_dev *pdev)
2131 */ 2139 */
2132static void lpfc_io_resume(struct pci_dev *pdev) 2140static void lpfc_io_resume(struct pci_dev *pdev)
2133{ 2141{
2134 struct Scsi_Host *host = pci_get_drvdata(pdev); 2142 struct Scsi_Host *shost = pci_get_drvdata(pdev);
2135 struct lpfc_hba *phba = (struct lpfc_hba *)host->hostdata; 2143 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba;
2136 2144
2137 if (lpfc_online(phba) == 0) { 2145 if (lpfc_online(phba) == 0) {
2138 mod_timer(&phba->fc_estabtmo, jiffies + HZ * 60); 2146 mod_timer(&phba->fc_estabtmo, jiffies + HZ * 60);
diff --git a/drivers/scsi/lpfc/lpfc_logmsg.h b/drivers/scsi/lpfc/lpfc_logmsg.h
index 8a6ceffeabcf..626e4d878725 100644
--- a/drivers/scsi/lpfc/lpfc_logmsg.h
+++ b/drivers/scsi/lpfc/lpfc_logmsg.h
@@ -33,6 +33,12 @@
33#define LOG_VPORT 0x4000 /* NPIV events */ 33#define LOG_VPORT 0x4000 /* NPIV events */
34#define LOG_ALL_MSG 0xffff /* LOG all messages */ 34#define LOG_ALL_MSG 0xffff /* LOG all messages */
35 35
36#define lpfc_printf_vlog(vport, level, mask, fmt, arg...) \
37 { if (((mask) &(vport)->cfg_log_verbose) || (level[1] <= '3')) \
38 dev_printk(level, &((vport)->phba->pcidev)->dev, "%d:(%d):" \
39 fmt, (vport)->phba->brd_no, vport->vpi, ##arg); }
40
36#define lpfc_printf_log(phba, level, mask, fmt, arg...) \ 41#define lpfc_printf_log(phba, level, mask, fmt, arg...) \
37 { if (((mask) &(phba)->cfg_log_verbose) || (level[1] <= '3')) \ 42 { if (((mask) &(phba)->pport->cfg_log_verbose) || (level[1] <= '3')) \
38 dev_printk(level, &((phba)->pcidev)->dev, fmt, ##arg); } 43 dev_printk(level, &((phba)->pcidev)->dev, "%d:" \
44 fmt, phba->brd_no, ##arg); }
diff --git a/drivers/scsi/lpfc/lpfc_mbox.c b/drivers/scsi/lpfc/lpfc_mbox.c
index 8f42fbfdd29e..a592733664e9 100644
--- a/drivers/scsi/lpfc/lpfc_mbox.c
+++ b/drivers/scsi/lpfc/lpfc_mbox.c
@@ -275,11 +275,8 @@ lpfc_read_sparam(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb, int vpi)
275 kfree(mp); 275 kfree(mp);
276 mb->mbxCommand = MBX_READ_SPARM64; 276 mb->mbxCommand = MBX_READ_SPARM64;
277 /* READ_SPARAM: no buffers */ 277 /* READ_SPARAM: no buffers */
278 lpfc_printf_log(phba, 278 lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX,
279 KERN_WARNING, 279 "0301 READ_SPARAM: no buffers\n");
280 LOG_MBOX,
281 "%d:0301 READ_SPARAM: no buffers\n",
282 phba->brd_no);
283 return (1); 280 return (1);
284 } 281 }
285 INIT_LIST_HEAD(&mp->list); 282 INIT_LIST_HEAD(&mp->list);
@@ -378,9 +375,8 @@ lpfc_reg_login(struct lpfc_hba *phba, uint16_t vpi, uint32_t did,
378 mb->mbxCommand = MBX_REG_LOGIN64; 375 mb->mbxCommand = MBX_REG_LOGIN64;
379 /* REG_LOGIN: no buffers */ 376 /* REG_LOGIN: no buffers */
380 lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX, 377 lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX,
381 "%d (%d):0302 REG_LOGIN: no buffers, DID x%x, " 378 "0302 REG_LOGIN: no buffers, VPI:%d DID:x%x, "
382 "flag x%x\n", 379 "flag x%x\n", vpi, did, flag);
383 phba->brd_no, vpi, did, flag);
384 return (1); 380 return (1);
385 } 381 }
386 INIT_LIST_HEAD(&mp->list); 382 INIT_LIST_HEAD(&mp->list);
@@ -564,7 +560,8 @@ lpfc_build_hbq_profile5(struct config_hbq_var *hbqmb,
564} 560}
565 561
566void 562void
567lpfc_config_hbq(struct lpfc_hba *phba, struct lpfc_hbq_init *hbq_desc, 563lpfc_config_hbq(struct lpfc_hba *phba, uint32_t id,
564 struct lpfc_hbq_init *hbq_desc,
568 uint32_t hbq_entry_index, LPFC_MBOXQ_t *pmb) 565 uint32_t hbq_entry_index, LPFC_MBOXQ_t *pmb)
569{ 566{
570 int i; 567 int i;
@@ -572,6 +569,7 @@ lpfc_config_hbq(struct lpfc_hba *phba, struct lpfc_hbq_init *hbq_desc,
572 struct config_hbq_var *hbqmb = &mb->un.varCfgHbq; 569 struct config_hbq_var *hbqmb = &mb->un.varCfgHbq;
573 570
574 memset(pmb, 0, sizeof (LPFC_MBOXQ_t)); 571 memset(pmb, 0, sizeof (LPFC_MBOXQ_t));
572 hbqmb->hbqId = id;
575 hbqmb->entry_count = hbq_desc->entry_count; /* # entries in HBQ */ 573 hbqmb->entry_count = hbq_desc->entry_count; /* # entries in HBQ */
576 hbqmb->recvNotify = hbq_desc->rn; /* Receive 574 hbqmb->recvNotify = hbq_desc->rn; /* Receive
577 * Notification */ 575 * Notification */
@@ -691,8 +689,8 @@ lpfc_config_port(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb)
691 689
692 if (phba->sli_rev == 3 && phba->vpd.sli3Feat.cerbm) { 690 if (phba->sli_rev == 3 && phba->vpd.sli3Feat.cerbm) {
693 mb->un.varCfgPort.cerbm = 1; /* Request HBQs */ 691 mb->un.varCfgPort.cerbm = 1; /* Request HBQs */
694 mb->un.varCfgPort.max_hbq = 1; /* Requesting 2 HBQs */ 692 mb->un.varCfgPort.max_hbq = lpfc_sli_hbq_count();
695 if (phba->max_vpi && phba->cfg_npiv_enable && 693 if (phba->max_vpi && phba->cfg_enable_npiv &&
696 phba->vpd.sli3Feat.cmv) { 694 phba->vpd.sli3Feat.cmv) {
697 mb->un.varCfgPort.max_vpi = phba->max_vpi; 695 mb->un.varCfgPort.max_vpi = phba->max_vpi;
698 mb->un.varCfgPort.cmv = 1; 696 mb->un.varCfgPort.cmv = 1;
diff --git a/drivers/scsi/lpfc/lpfc_mem.c b/drivers/scsi/lpfc/lpfc_mem.c
index 3594c469494f..43c3b8a0d76a 100644
--- a/drivers/scsi/lpfc/lpfc_mem.c
+++ b/drivers/scsi/lpfc/lpfc_mem.c
@@ -231,21 +231,34 @@ lpfc_mbuf_free(struct lpfc_hba * phba, void *virt, dma_addr_t dma)
231 return; 231 return;
232} 232}
233 233
234void * 234struct hbq_dmabuf *
235lpfc_hbq_alloc(struct lpfc_hba *phba, int mem_flags, dma_addr_t *handle) 235lpfc_els_hbq_alloc(struct lpfc_hba *phba)
236{ 236{
237 void *ret; 237 struct hbq_dmabuf *hbqbp;
238 ret = pci_pool_alloc(phba->lpfc_hbq_pool, GFP_ATOMIC, handle); 238
239 return ret; 239 hbqbp = kmalloc(sizeof(struct hbq_dmabuf), GFP_KERNEL);
240 if (!hbqbp)
241 return NULL;
242
243 hbqbp->dbuf.virt = pci_pool_alloc(phba->lpfc_hbq_pool, GFP_KERNEL,
244 &hbqbp->dbuf.phys);
245 if (!hbqbp->dbuf.virt) {
246 kfree(hbqbp);
247 return NULL;
248 }
249 hbqbp->size = LPFC_BPL_SIZE;
250 return hbqbp;
240} 251}
241 252
242void 253void
243lpfc_hbq_free(struct lpfc_hba *phba, void *virt, dma_addr_t dma) 254lpfc_els_hbq_free(struct lpfc_hba *phba, struct hbq_dmabuf *hbqbp)
244{ 255{
245 pci_pool_free(phba->lpfc_hbq_pool, virt, dma); 256 pci_pool_free(phba->lpfc_hbq_pool, hbqbp->dbuf.virt, hbqbp->dbuf.phys);
257 kfree(hbqbp);
246 return; 258 return;
247} 259}
248 260
261/* This is ONLY called for the LPFC_ELS_HBQ */
249void 262void
250lpfc_in_buf_free(struct lpfc_hba *phba, struct lpfc_dmabuf *mp) 263lpfc_in_buf_free(struct lpfc_hba *phba, struct lpfc_dmabuf *mp)
251{ 264{
@@ -254,9 +267,8 @@ lpfc_in_buf_free(struct lpfc_hba *phba, struct lpfc_dmabuf *mp)
254 if (phba->sli3_options & LPFC_SLI3_HBQ_ENABLED) { 267 if (phba->sli3_options & LPFC_SLI3_HBQ_ENABLED) {
255 hbq_entry = container_of(mp, struct hbq_dmabuf, dbuf); 268 hbq_entry = container_of(mp, struct hbq_dmabuf, dbuf);
256 if (hbq_entry->tag == -1) { 269 if (hbq_entry->tag == -1) {
257 lpfc_hbq_free(phba, hbq_entry->dbuf.virt, 270 (phba->hbqs[LPFC_ELS_HBQ].hbq_free_buffer)
258 hbq_entry->dbuf.phys); 271 (phba, hbq_entry);
259 kfree(hbq_entry);
260 } else { 272 } else {
261 lpfc_sli_free_hbq(phba, hbq_entry); 273 lpfc_sli_free_hbq(phba, hbq_entry);
262 } 274 }
diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c
index bca2f5c9b4ba..880af0cd463d 100644
--- a/drivers/scsi/lpfc/lpfc_nportdisc.c
+++ b/drivers/scsi/lpfc/lpfc_nportdisc.c
@@ -133,15 +133,15 @@ lpfc_check_sparm(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
133 memcpy(&ndlp->nlp_portname, &sp->portName, sizeof (struct lpfc_name)); 133 memcpy(&ndlp->nlp_portname, &sp->portName, sizeof (struct lpfc_name));
134 return 1; 134 return 1;
135bad_service_param: 135bad_service_param:
136 lpfc_printf_log(vport->phba, KERN_ERR, LOG_DISCOVERY, 136 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
137 "%d (%d):0207 Device %x " 137 "0207 Device %x "
138 "(%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x) sent " 138 "(%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x) sent "
139 "invalid service parameters. Ignoring device.\n", 139 "invalid service parameters. Ignoring device.\n",
140 vport->phba->brd_no, ndlp->vport->vpi, ndlp->nlp_DID, 140 ndlp->nlp_DID,
141 sp->nodeName.u.wwn[0], sp->nodeName.u.wwn[1], 141 sp->nodeName.u.wwn[0], sp->nodeName.u.wwn[1],
142 sp->nodeName.u.wwn[2], sp->nodeName.u.wwn[3], 142 sp->nodeName.u.wwn[2], sp->nodeName.u.wwn[3],
143 sp->nodeName.u.wwn[4], sp->nodeName.u.wwn[5], 143 sp->nodeName.u.wwn[4], sp->nodeName.u.wwn[5],
144 sp->nodeName.u.wwn[6], sp->nodeName.u.wwn[7]); 144 sp->nodeName.u.wwn[6], sp->nodeName.u.wwn[7]);
145 return 0; 145 return 0;
146} 146}
147 147
@@ -194,11 +194,11 @@ lpfc_els_abort(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp)
194 IOCB_t *cmd; 194 IOCB_t *cmd;
195 195
196 /* Abort outstanding I/O on NPort <nlp_DID> */ 196 /* Abort outstanding I/O on NPort <nlp_DID> */
197 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 197 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_DISCOVERY,
198 "%d (%d):0205 Abort outstanding I/O on NPort x%x " 198 "0205 Abort outstanding I/O on NPort x%x "
199 "Data: x%x x%x x%x\n", 199 "Data: x%x x%x x%x\n",
200 phba->brd_no, ndlp->vport->vpi, ndlp->nlp_DID, 200 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
201 ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi); 201 ndlp->nlp_rpi);
202 202
203 lpfc_fabric_abort_nport(ndlp); 203 lpfc_fabric_abort_nport(ndlp);
204 204
@@ -298,13 +298,12 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
298 icmd = &cmdiocb->iocb; 298 icmd = &cmdiocb->iocb;
299 299
300 /* PLOGI chkparm OK */ 300 /* PLOGI chkparm OK */
301 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 301 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
302 "%d (%d):0114 PLOGI chkparm OK Data: x%x x%x x%x x%x\n", 302 "0114 PLOGI chkparm OK Data: x%x x%x x%x x%x\n",
303 phba->brd_no, vport->vpi, 303 ndlp->nlp_DID, ndlp->nlp_state, ndlp->nlp_flag,
304 ndlp->nlp_DID, ndlp->nlp_state, ndlp->nlp_flag, 304 ndlp->nlp_rpi);
305 ndlp->nlp_rpi);
306 305
307 if (phba->cfg_fcp_class == 2 && sp->cls2.classValid) 306 if (vport->cfg_fcp_class == 2 && sp->cls2.classValid)
308 ndlp->nlp_fcp_info |= CLASS2; 307 ndlp->nlp_fcp_info |= CLASS2;
309 else 308 else
310 ndlp->nlp_fcp_info |= CLASS3; 309 ndlp->nlp_fcp_info |= CLASS3;
@@ -330,7 +329,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
330 case NLP_STE_PRLI_ISSUE: 329 case NLP_STE_PRLI_ISSUE:
331 case NLP_STE_UNMAPPED_NODE: 330 case NLP_STE_UNMAPPED_NODE:
332 case NLP_STE_MAPPED_NODE: 331 case NLP_STE_MAPPED_NODE:
333 lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, cmdiocb, ndlp, NULL, 0); 332 lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, cmdiocb, ndlp, NULL);
334 return 1; 333 return 1;
335 } 334 }
336 335
@@ -392,7 +391,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
392 } 391 }
393 392
394 if ((vport->port_type == LPFC_NPIV_PORT && 393 if ((vport->port_type == LPFC_NPIV_PORT &&
395 phba->cfg_vport_restrict_login)) { 394 vport->cfg_restrict_login)) {
396 395
397 /* In order to preserve RPIs, we want to cleanup 396 /* In order to preserve RPIs, we want to cleanup
398 * the default RPI the firmware created to rcv 397 * the default RPI the firmware created to rcv
@@ -408,7 +407,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
408 ndlp, mbox); 407 ndlp, mbox);
409 return 1; 408 return 1;
410 } 409 }
411 lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, cmdiocb, ndlp, mbox, 0); 410 lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, cmdiocb, ndlp, mbox);
412 return 1; 411 return 1;
413 412
414out: 413out:
@@ -452,7 +451,7 @@ lpfc_rcv_padisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
452 lpfc_els_rsp_adisc_acc(vport, cmdiocb, ndlp); 451 lpfc_els_rsp_adisc_acc(vport, cmdiocb, ndlp);
453 } else { 452 } else {
454 lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, cmdiocb, ndlp, 453 lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, cmdiocb, ndlp,
455 NULL, 0); 454 NULL);
456 } 455 }
457 return 1; 456 return 1;
458 } 457 }
@@ -489,9 +488,9 @@ lpfc_rcv_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
489 ndlp->nlp_flag |= NLP_LOGO_ACC; 488 ndlp->nlp_flag |= NLP_LOGO_ACC;
490 spin_unlock_irq(shost->host_lock); 489 spin_unlock_irq(shost->host_lock);
491 if (els_cmd == ELS_CMD_PRLO) 490 if (els_cmd == ELS_CMD_PRLO)
492 lpfc_els_rsp_acc(vport, ELS_CMD_PRLO, cmdiocb, ndlp, NULL, 0); 491 lpfc_els_rsp_acc(vport, ELS_CMD_PRLO, cmdiocb, ndlp, NULL);
493 else 492 else
494 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 0); 493 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL);
495 494
496 if (!(ndlp->nlp_type & NLP_FABRIC) || 495 if (!(ndlp->nlp_type & NLP_FABRIC) ||
497 (ndlp->nlp_state == NLP_STE_ADISC_ISSUE)) { 496 (ndlp->nlp_state == NLP_STE_ADISC_ISSUE)) {
@@ -564,10 +563,14 @@ static uint32_t
564lpfc_disc_set_adisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) 563lpfc_disc_set_adisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
565{ 564{
566 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 565 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
567 struct lpfc_hba *phba = vport->phba; 566
567 if (!ndlp->nlp_rpi) {
568 ndlp->nlp_flag &= ~NLP_NPR_ADISC;
569 return 0;
570 }
568 571
569 /* Check config parameter use-adisc or FCP-2 */ 572 /* Check config parameter use-adisc or FCP-2 */
570 if ((phba->cfg_use_adisc && (vport->fc_flag & FC_RSCN_MODE)) || 573 if ((vport->cfg_use_adisc && (vport->fc_flag & FC_RSCN_MODE)) ||
571 ndlp->nlp_fcp_info & NLP_FCP_2_DEVICE) { 574 ndlp->nlp_fcp_info & NLP_FCP_2_DEVICE) {
572 spin_lock_irq(shost->host_lock); 575 spin_lock_irq(shost->host_lock);
573 ndlp->nlp_flag |= NLP_NPR_ADISC; 576 ndlp->nlp_flag |= NLP_NPR_ADISC;
@@ -583,12 +586,11 @@ static uint32_t
583lpfc_disc_illegal(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, 586lpfc_disc_illegal(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
584 void *arg, uint32_t evt) 587 void *arg, uint32_t evt)
585{ 588{
586 lpfc_printf_log(vport->phba, KERN_ERR, LOG_DISCOVERY, 589 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
587 "%d (%d):0253 Illegal State Transition: node x%x " 590 "0253 Illegal State Transition: node x%x "
588 "event x%x, state x%x Data: x%x x%x\n", 591 "event x%x, state x%x Data: x%x x%x\n",
589 vport->phba->brd_no, vport->vpi, 592 ndlp->nlp_DID, evt, ndlp->nlp_state, ndlp->nlp_rpi,
590 ndlp->nlp_DID, evt, ndlp->nlp_state, ndlp->nlp_rpi, 593 ndlp->nlp_flag);
591 ndlp->nlp_flag);
592 return ndlp->nlp_state; 594 return ndlp->nlp_state;
593} 595}
594 596
@@ -630,7 +632,7 @@ lpfc_rcv_logo_unused_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
630 spin_lock_irq(shost->host_lock); 632 spin_lock_irq(shost->host_lock);
631 ndlp->nlp_flag |= NLP_LOGO_ACC; 633 ndlp->nlp_flag |= NLP_LOGO_ACC;
632 spin_unlock_irq(shost->host_lock); 634 spin_unlock_irq(shost->host_lock);
633 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 0); 635 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL);
634 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNUSED_NODE); 636 lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNUSED_NODE);
635 637
636 return ndlp->nlp_state; 638 return ndlp->nlp_state;
@@ -726,7 +728,7 @@ lpfc_rcv_els_plogi_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
726 lpfc_els_abort(phba, ndlp); 728 lpfc_els_abort(phba, ndlp);
727 729
728 if (evt == NLP_EVT_RCV_LOGO) { 730 if (evt == NLP_EVT_RCV_LOGO) {
729 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 0); 731 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL);
730 } else { 732 } else {
731 lpfc_issue_els_logo(vport, ndlp, 0); 733 lpfc_issue_els_logo(vport, ndlp, 0);
732 } 734 }
@@ -778,16 +780,12 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport,
778 sp = (struct serv_parm *) ((uint8_t *) lp + sizeof (uint32_t)); 780 sp = (struct serv_parm *) ((uint8_t *) lp + sizeof (uint32_t));
779 if (!lpfc_check_sparm(vport, ndlp, sp, CLASS3)) 781 if (!lpfc_check_sparm(vport, ndlp, sp, CLASS3))
780 goto out; 782 goto out;
781
782 /* PLOGI chkparm OK */ 783 /* PLOGI chkparm OK */
783 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 784 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
784 "%d (%d):0121 PLOGI chkparm OK " 785 "0121 PLOGI chkparm OK Data: x%x x%x x%x x%x\n",
785 "Data: x%x x%x x%x x%x\n", 786 ndlp->nlp_DID, ndlp->nlp_state,
786 phba->brd_no, vport->vpi, 787 ndlp->nlp_flag, ndlp->nlp_rpi);
787 ndlp->nlp_DID, ndlp->nlp_state, 788 if (vport->cfg_fcp_class == 2 && (sp->cls2.classValid))
788 ndlp->nlp_flag, ndlp->nlp_rpi);
789
790 if (phba->cfg_fcp_class == 2 && (sp->cls2.classValid))
791 ndlp->nlp_fcp_info |= CLASS2; 789 ndlp->nlp_fcp_info |= CLASS2;
792 else 790 else
793 ndlp->nlp_fcp_info |= CLASS3; 791 ndlp->nlp_fcp_info |= CLASS3;
@@ -806,10 +804,9 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport,
806 804
807 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); 805 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
808 if (!mbox) { 806 if (!mbox) {
809 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 807 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
810 "%d (%d):0133 PLOGI: no memory for reg_login " 808 "0133 PLOGI: no memory for reg_login "
811 "Data: x%x x%x x%x x%x\n", 809 "Data: x%x x%x x%x x%x\n",
812 phba->brd_no, vport->vpi,
813 ndlp->nlp_DID, ndlp->nlp_state, 810 ndlp->nlp_DID, ndlp->nlp_state,
814 ndlp->nlp_flag, ndlp->nlp_rpi); 811 ndlp->nlp_flag, ndlp->nlp_rpi);
815 goto out; 812 goto out;
@@ -844,30 +841,27 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport,
844 kfree(mp); 841 kfree(mp);
845 mempool_free(mbox, phba->mbox_mem_pool); 842 mempool_free(mbox, phba->mbox_mem_pool);
846 843
847 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 844 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
848 "%d (%d):0134 PLOGI: cannot issue reg_login " 845 "0134 PLOGI: cannot issue reg_login "
849 "Data: x%x x%x x%x x%x\n", 846 "Data: x%x x%x x%x x%x\n",
850 phba->brd_no, vport->vpi, 847 ndlp->nlp_DID, ndlp->nlp_state,
851 ndlp->nlp_DID, ndlp->nlp_state, 848 ndlp->nlp_flag, ndlp->nlp_rpi);
852 ndlp->nlp_flag, ndlp->nlp_rpi);
853 } else { 849 } else {
854 mempool_free(mbox, phba->mbox_mem_pool); 850 mempool_free(mbox, phba->mbox_mem_pool);
855 851
856 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 852 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
857 "%d (%d):0135 PLOGI: cannot format reg_login " 853 "0135 PLOGI: cannot format reg_login "
858 "Data: x%x x%x x%x x%x\n", 854 "Data: x%x x%x x%x x%x\n",
859 phba->brd_no, vport->vpi, 855 ndlp->nlp_DID, ndlp->nlp_state,
860 ndlp->nlp_DID, ndlp->nlp_state, 856 ndlp->nlp_flag, ndlp->nlp_rpi);
861 ndlp->nlp_flag, ndlp->nlp_rpi);
862 } 857 }
863 858
864 859
865out: 860out:
866 if (ndlp->nlp_DID == NameServer_DID) { 861 if (ndlp->nlp_DID == NameServer_DID) {
867 lpfc_vport_set_state(vport, FC_VPORT_FAILED); 862 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
868 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 863 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
869 "%d (%d):0261 Cannot Register NameServer login\n", 864 "0261 Cannot Register NameServer login\n");
870 phba->brd_no, vport->vpi);
871 } 865 }
872 866
873 /* Free this node since the driver cannot login or has the wrong 867 /* Free this node since the driver cannot login or has the wrong
@@ -1178,7 +1172,7 @@ lpfc_rcv_prlo_reglogin_issue(struct lpfc_vport *vport,
1178 struct lpfc_iocbq *cmdiocb; 1172 struct lpfc_iocbq *cmdiocb;
1179 1173
1180 cmdiocb = (struct lpfc_iocbq *) arg; 1174 cmdiocb = (struct lpfc_iocbq *) arg;
1181 lpfc_els_rsp_acc(vport, ELS_CMD_PRLO, cmdiocb, ndlp, NULL, 0); 1175 lpfc_els_rsp_acc(vport, ELS_CMD_PRLO, cmdiocb, ndlp, NULL);
1182 return ndlp->nlp_state; 1176 return ndlp->nlp_state;
1183} 1177}
1184 1178
@@ -1189,19 +1183,15 @@ lpfc_cmpl_reglogin_reglogin_issue(struct lpfc_vport *vport,
1189 uint32_t evt) 1183 uint32_t evt)
1190{ 1184{
1191 struct Scsi_Host *shost = lpfc_shost_from_vport(vport); 1185 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
1192 struct lpfc_hba *phba = vport->phba;
1193 LPFC_MBOXQ_t *pmb = (LPFC_MBOXQ_t *) arg; 1186 LPFC_MBOXQ_t *pmb = (LPFC_MBOXQ_t *) arg;
1194 MAILBOX_t *mb = &pmb->mb; 1187 MAILBOX_t *mb = &pmb->mb;
1195 uint32_t did = mb->un.varWords[1]; 1188 uint32_t did = mb->un.varWords[1];
1196 1189
1197 if (mb->mbxStatus) { 1190 if (mb->mbxStatus) {
1198 /* RegLogin failed */ 1191 /* RegLogin failed */
1199 lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, 1192 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
1200 "%d (%d):0246 RegLogin failed Data: x%x x%x " 1193 "0246 RegLogin failed Data: x%x x%x x%x\n",
1201 "x%x\n",
1202 phba->brd_no, vport->vpi,
1203 did, mb->mbxStatus, vport->port_state); 1194 did, mb->mbxStatus, vport->port_state);
1204
1205 /* 1195 /*
1206 * If RegLogin failed due to lack of HBA resources do not 1196 * If RegLogin failed due to lack of HBA resources do not
1207 * retry discovery. 1197 * retry discovery.
@@ -1337,7 +1327,7 @@ lpfc_rcv_prlo_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
1337{ 1327{
1338 struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; 1328 struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg;
1339 1329
1340 lpfc_els_rsp_acc(vport, ELS_CMD_PRLO, cmdiocb, ndlp, NULL, 0); 1330 lpfc_els_rsp_acc(vport, ELS_CMD_PRLO, cmdiocb, ndlp, NULL);
1341 return ndlp->nlp_state; 1331 return ndlp->nlp_state;
1342} 1332}
1343 1333
@@ -1358,7 +1348,7 @@ lpfc_cmpl_prli_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
1358 irsp = &rspiocb->iocb; 1348 irsp = &rspiocb->iocb;
1359 if (irsp->ulpStatus) { 1349 if (irsp->ulpStatus) {
1360 if ((vport->port_type == LPFC_NPIV_PORT) && 1350 if ((vport->port_type == LPFC_NPIV_PORT) &&
1361 phba->cfg_vport_restrict_login) { 1351 vport->cfg_restrict_login) {
1362 goto out; 1352 goto out;
1363 } 1353 }
1364 ndlp->nlp_prev_state = NLP_STE_PRLI_ISSUE; 1354 ndlp->nlp_prev_state = NLP_STE_PRLI_ISSUE;
@@ -1380,7 +1370,7 @@ lpfc_cmpl_prli_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
1380 } 1370 }
1381 if (!(ndlp->nlp_type & NLP_FCP_TARGET) && 1371 if (!(ndlp->nlp_type & NLP_FCP_TARGET) &&
1382 (vport->port_type == LPFC_NPIV_PORT) && 1372 (vport->port_type == LPFC_NPIV_PORT) &&
1383 phba->cfg_vport_restrict_login) { 1373 vport->cfg_restrict_login) {
1384out: 1374out:
1385 spin_lock_irq(shost->host_lock); 1375 spin_lock_irq(shost->host_lock);
1386 ndlp->nlp_flag |= NLP_TARGET_REMOVE; 1376 ndlp->nlp_flag |= NLP_TARGET_REMOVE;
@@ -1529,7 +1519,7 @@ lpfc_rcv_prlo_unmap_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
1529{ 1519{
1530 struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; 1520 struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg;
1531 1521
1532 lpfc_els_rsp_acc(vport, ELS_CMD_PRLO, cmdiocb, ndlp, NULL, 0); 1522 lpfc_els_rsp_acc(vport, ELS_CMD_PRLO, cmdiocb, ndlp, NULL);
1533 return ndlp->nlp_state; 1523 return ndlp->nlp_state;
1534} 1524}
1535 1525
@@ -1600,8 +1590,8 @@ lpfc_rcv_prlo_mapped_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
1600 struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; 1590 struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg;
1601 1591
1602 /* flush the target */ 1592 /* flush the target */
1603 lpfc_sli_abort_iocb(phba, &phba->sli.ring[phba->sli.fcp_ring], 1593 lpfc_sli_abort_iocb(vport, &phba->sli.ring[phba->sli.fcp_ring],
1604 ndlp->nlp_sid, 0, 0, LPFC_CTX_TGT); 1594 ndlp->nlp_sid, 0, LPFC_CTX_TGT);
1605 1595
1606 /* Treat like rcv logo */ 1596 /* Treat like rcv logo */
1607 lpfc_rcv_logo(vport, ndlp, cmdiocb, ELS_CMD_PRLO); 1597 lpfc_rcv_logo(vport, ndlp, cmdiocb, ELS_CMD_PRLO);
@@ -1734,7 +1724,7 @@ lpfc_rcv_prlo_npr_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
1734 ndlp->nlp_flag |= NLP_LOGO_ACC; 1724 ndlp->nlp_flag |= NLP_LOGO_ACC;
1735 spin_unlock_irq(shost->host_lock); 1725 spin_unlock_irq(shost->host_lock);
1736 1726
1737 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 0); 1727 lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL);
1738 1728
1739 if ((ndlp->nlp_flag & NLP_DELAY_TMO) == 0) { 1729 if ((ndlp->nlp_flag & NLP_DELAY_TMO) == 0) {
1740 mod_timer(&ndlp->nlp_delayfunc, jiffies + HZ * 1); 1730 mod_timer(&ndlp->nlp_delayfunc, jiffies + HZ * 1);
@@ -2047,7 +2037,6 @@ int
2047lpfc_disc_state_machine(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, 2037lpfc_disc_state_machine(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
2048 void *arg, uint32_t evt) 2038 void *arg, uint32_t evt)
2049{ 2039{
2050 struct lpfc_hba *phba = vport->phba;
2051 uint32_t cur_state, rc; 2040 uint32_t cur_state, rc;
2052 uint32_t(*func) (struct lpfc_vport *, struct lpfc_nodelist *, void *, 2041 uint32_t(*func) (struct lpfc_vport *, struct lpfc_nodelist *, void *,
2053 uint32_t); 2042 uint32_t);
@@ -2056,11 +2045,10 @@ lpfc_disc_state_machine(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
2056 cur_state = ndlp->nlp_state; 2045 cur_state = ndlp->nlp_state;
2057 2046
2058 /* DSM in event <evt> on NPort <nlp_DID> in state <cur_state> */ 2047 /* DSM in event <evt> on NPort <nlp_DID> in state <cur_state> */
2059 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 2048 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
2060 "%d (%d):0211 DSM in event x%x on NPort x%x in " 2049 "0211 DSM in event x%x on NPort x%x in "
2061 "state %d Data: x%x\n", 2050 "state %d Data: x%x\n",
2062 phba->brd_no, vport->vpi, 2051 evt, ndlp->nlp_DID, cur_state, ndlp->nlp_flag);
2063 evt, ndlp->nlp_DID, cur_state, ndlp->nlp_flag);
2064 2052
2065 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_DSM, 2053 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_DSM,
2066 "DSM in: evt:%d ste:%d did:x%x", 2054 "DSM in: evt:%d ste:%d did:x%x",
@@ -2070,11 +2058,9 @@ lpfc_disc_state_machine(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
2070 rc = (func) (vport, ndlp, arg, evt); 2058 rc = (func) (vport, ndlp, arg, evt);
2071 2059
2072 /* DSM out state <rc> on NPort <nlp_DID> */ 2060 /* DSM out state <rc> on NPort <nlp_DID> */
2073 lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, 2061 lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
2074 "%d (%d):0212 DSM out state %d on NPort x%x " 2062 "0212 DSM out state %d on NPort x%x Data: x%x\n",
2075 "Data: x%x\n", 2063 rc, ndlp->nlp_DID, ndlp->nlp_flag);
2076 phba->brd_no, vport->vpi,
2077 rc, ndlp->nlp_DID, ndlp->nlp_flag);
2078 2064
2079 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_DSM, 2065 lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_DSM,
2080 "DSM out: ste:%d did:x%x flg:x%x", 2066 "DSM out: ste:%d did:x%x flg:x%x",
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index 8f45bbc42126..17d7dc05149b 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -84,22 +84,21 @@ lpfc_adjust_queue_depth(struct lpfc_hba *phba)
84 * SCSI command completion. 84 * SCSI command completion.
85 */ 85 */
86static inline void 86static inline void
87lpfc_rampup_queue_depth(struct lpfc_hba *phba, 87lpfc_rampup_queue_depth(struct lpfc_vport *vport,
88 struct scsi_device *sdev) 88 struct scsi_device *sdev)
89{ 89{
90 unsigned long flags; 90 unsigned long flags;
91 struct lpfc_hba *phba = vport->phba;
91 atomic_inc(&phba->num_cmd_success); 92 atomic_inc(&phba->num_cmd_success);
92 93
93 if (phba->cfg_lun_queue_depth <= sdev->queue_depth) 94 if (vport->cfg_lun_queue_depth <= sdev->queue_depth)
94 return; 95 return;
95
96 spin_lock_irqsave(&phba->hbalock, flags); 96 spin_lock_irqsave(&phba->hbalock, flags);
97 if (((phba->last_ramp_up_time + QUEUE_RAMP_UP_INTERVAL) > jiffies) || 97 if (((phba->last_ramp_up_time + QUEUE_RAMP_UP_INTERVAL) > jiffies) ||
98 ((phba->last_rsrc_error_time + QUEUE_RAMP_UP_INTERVAL ) > jiffies)) { 98 ((phba->last_rsrc_error_time + QUEUE_RAMP_UP_INTERVAL ) > jiffies)) {
99 spin_unlock_irqrestore(&phba->hbalock, flags); 99 spin_unlock_irqrestore(&phba->hbalock, flags);
100 return; 100 return;
101 } 101 }
102
103 phba->last_ramp_up_time = jiffies; 102 phba->last_ramp_up_time = jiffies;
104 spin_unlock_irqrestore(&phba->hbalock, flags); 103 spin_unlock_irqrestore(&phba->hbalock, flags);
105 104
@@ -119,43 +118,40 @@ lpfc_rampup_queue_depth(struct lpfc_hba *phba,
119void 118void
120lpfc_ramp_down_queue_handler(struct lpfc_hba *phba) 119lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
121{ 120{
122 struct lpfc_vport *vport; 121 struct lpfc_vport **vports;
123 struct Scsi_Host *host; 122 struct Scsi_Host *shost;
124 struct scsi_device *sdev; 123 struct scsi_device *sdev;
125 unsigned long new_queue_depth; 124 unsigned long new_queue_depth;
126 unsigned long num_rsrc_err, num_cmd_success; 125 unsigned long num_rsrc_err, num_cmd_success;
126 int i;
127 127
128 num_rsrc_err = atomic_read(&phba->num_rsrc_err); 128 num_rsrc_err = atomic_read(&phba->num_rsrc_err);
129 num_cmd_success = atomic_read(&phba->num_cmd_success); 129 num_cmd_success = atomic_read(&phba->num_cmd_success);
130 130
131 spin_lock_irq(&phba->hbalock); 131 vports = lpfc_create_vport_work_array(phba);
132 list_for_each_entry(vport, &phba->port_list, listentry) { 132 if (vports != NULL)
133 host = lpfc_shost_from_vport(vport); 133 for(i = 0; i < LPFC_MAX_VPORTS && vports[i] != NULL; i++) {
134 if (!scsi_host_get(host)) 134 shost = lpfc_shost_from_vport(vports[i]);
135 continue; 135 shost_for_each_device(sdev, shost) {
136
137 spin_unlock_irq(&phba->hbalock);
138
139 shost_for_each_device(sdev, host) {
140 new_queue_depth = sdev->queue_depth * num_rsrc_err /
141 (num_rsrc_err + num_cmd_success);
142 if (!new_queue_depth)
143 new_queue_depth = sdev->queue_depth - 1;
144 else
145 new_queue_depth = 136 new_queue_depth =
146 sdev->queue_depth - new_queue_depth; 137 sdev->queue_depth * num_rsrc_err /
147 138 (num_rsrc_err + num_cmd_success);
148 if (sdev->ordered_tags) 139 if (!new_queue_depth)
149 scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, 140 new_queue_depth = sdev->queue_depth - 1;
150 new_queue_depth); 141 else
151 else 142 new_queue_depth = sdev->queue_depth -
152 scsi_adjust_queue_depth(sdev, MSG_SIMPLE_TAG, 143 new_queue_depth;
153 new_queue_depth); 144 if (sdev->ordered_tags)
145 scsi_adjust_queue_depth(sdev,
146 MSG_ORDERED_TAG,
147 new_queue_depth);
148 else
149 scsi_adjust_queue_depth(sdev,
150 MSG_SIMPLE_TAG,
151 new_queue_depth);
152 }
154 } 153 }
155 spin_lock_irq(&phba->hbalock); 154 lpfc_destroy_vport_work_array(vports);
156 scsi_host_put(host);
157 }
158 spin_unlock_irq(&phba->hbalock);
159 atomic_set(&phba->num_rsrc_err, 0); 155 atomic_set(&phba->num_rsrc_err, 0);
160 atomic_set(&phba->num_cmd_success, 0); 156 atomic_set(&phba->num_cmd_success, 0);
161} 157}
@@ -163,29 +159,27 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
163void 159void
164lpfc_ramp_up_queue_handler(struct lpfc_hba *phba) 160lpfc_ramp_up_queue_handler(struct lpfc_hba *phba)
165{ 161{
166 struct lpfc_vport *vport; 162 struct lpfc_vport **vports;
167 struct Scsi_Host *host; 163 struct Scsi_Host *shost;
168 struct scsi_device *sdev; 164 struct scsi_device *sdev;
169 165 int i;
170 spin_lock_irq(&phba->hbalock); 166
171 list_for_each_entry(vport, &phba->port_list, listentry) { 167 vports = lpfc_create_vport_work_array(phba);
172 host = lpfc_shost_from_vport(vport); 168 if (vports != NULL)
173 if (!scsi_host_get(host)) 169 for(i = 0; i < LPFC_MAX_VPORTS && vports[i] != NULL; i++) {
174 continue; 170 shost = lpfc_shost_from_vport(vports[i]);
175 171 shost_for_each_device(sdev, shost) {
176 spin_unlock_irq(&phba->hbalock); 172 if (sdev->ordered_tags)
177 shost_for_each_device(sdev, host) { 173 scsi_adjust_queue_depth(sdev,
178 if (sdev->ordered_tags) 174 MSG_ORDERED_TAG,
179 scsi_adjust_queue_depth(sdev, MSG_ORDERED_TAG, 175 sdev->queue_depth+1);
180 sdev->queue_depth+1); 176 else
181 else 177 scsi_adjust_queue_depth(sdev,
182 scsi_adjust_queue_depth(sdev, MSG_SIMPLE_TAG, 178 MSG_SIMPLE_TAG,
183 sdev->queue_depth+1); 179 sdev->queue_depth+1);
180 }
184 } 181 }
185 spin_lock_irq(&phba->hbalock); 182 lpfc_destroy_vport_work_array(vports);
186 scsi_host_put(host);
187 }
188 spin_unlock_irq(&phba->hbalock);
189 atomic_set(&phba->num_rsrc_err, 0); 183 atomic_set(&phba->num_rsrc_err, 0);
190 atomic_set(&phba->num_cmd_success, 0); 184 atomic_set(&phba->num_cmd_success, 0);
191} 185}
@@ -411,9 +405,7 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
411 struct scsi_cmnd *cmnd = lpfc_cmd->pCmd; 405 struct scsi_cmnd *cmnd = lpfc_cmd->pCmd;
412 struct fcp_cmnd *fcpcmd = lpfc_cmd->fcp_cmnd; 406 struct fcp_cmnd *fcpcmd = lpfc_cmd->fcp_cmnd;
413 struct fcp_rsp *fcprsp = lpfc_cmd->fcp_rsp; 407 struct fcp_rsp *fcprsp = lpfc_cmd->fcp_rsp;
414 struct lpfc_hba *phba = vport->phba;
415 uint32_t fcpi_parm = rsp_iocb->iocb.un.fcpi.fcpi_parm; 408 uint32_t fcpi_parm = rsp_iocb->iocb.un.fcpi.fcpi_parm;
416 uint32_t vpi = vport->vpi;
417 uint32_t resp_info = fcprsp->rspStatus2; 409 uint32_t resp_info = fcprsp->rspStatus2;
418 uint32_t scsi_status = fcprsp->rspStatus3; 410 uint32_t scsi_status = fcprsp->rspStatus3;
419 uint32_t *lp; 411 uint32_t *lp;
@@ -445,15 +437,15 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
445 if (!scsi_status && (resp_info & RESID_UNDER)) 437 if (!scsi_status && (resp_info & RESID_UNDER))
446 logit = LOG_FCP; 438 logit = LOG_FCP;
447 439
448 lpfc_printf_log(phba, KERN_WARNING, logit, 440 lpfc_printf_vlog(vport, KERN_WARNING, logit,
449 "%d (%d):0730 FCP command x%x failed: x%x SNS x%x x%x " 441 "0730 FCP command x%x failed: x%x SNS x%x x%x "
450 "Data: x%x x%x x%x x%x x%x\n", 442 "Data: x%x x%x x%x x%x x%x\n",
451 phba->brd_no, vpi, cmnd->cmnd[0], scsi_status, 443 cmnd->cmnd[0], scsi_status,
452 be32_to_cpu(*lp), be32_to_cpu(*(lp + 3)), resp_info, 444 be32_to_cpu(*lp), be32_to_cpu(*(lp + 3)), resp_info,
453 be32_to_cpu(fcprsp->rspResId), 445 be32_to_cpu(fcprsp->rspResId),
454 be32_to_cpu(fcprsp->rspSnsLen), 446 be32_to_cpu(fcprsp->rspSnsLen),
455 be32_to_cpu(fcprsp->rspRspLen), 447 be32_to_cpu(fcprsp->rspRspLen),
456 fcprsp->rspInfo3); 448 fcprsp->rspInfo3);
457 449
458 if (resp_info & RSP_LEN_VALID) { 450 if (resp_info & RSP_LEN_VALID) {
459 rsplen = be32_to_cpu(fcprsp->rspRspLen); 451 rsplen = be32_to_cpu(fcprsp->rspRspLen);
@@ -468,12 +460,12 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
468 if (resp_info & RESID_UNDER) { 460 if (resp_info & RESID_UNDER) {
469 scsi_set_resid(cmnd, be32_to_cpu(fcprsp->rspResId)); 461 scsi_set_resid(cmnd, be32_to_cpu(fcprsp->rspResId));
470 462
471 lpfc_printf_log(phba, KERN_INFO, LOG_FCP, 463 lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
472 "%d (%d):0716 FCP Read Underrun, expected %d, " 464 "0716 FCP Read Underrun, expected %d, "
473 "residual %d Data: x%x x%x x%x\n", 465 "residual %d Data: x%x x%x x%x\n",
474 phba->brd_no, vpi, be32_to_cpu(fcpcmd->fcpDl), 466 be32_to_cpu(fcpcmd->fcpDl),
475 scsi_get_resid(cmnd), fcpi_parm, cmnd->cmnd[0], 467 scsi_get_resid(cmnd), fcpi_parm, cmnd->cmnd[0],
476 cmnd->underflow); 468 cmnd->underflow);
477 469
478 /* 470 /*
479 * If there is an under run check if under run reported by 471 * If there is an under run check if under run reported by
@@ -483,14 +475,13 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
483 if ((cmnd->sc_data_direction == DMA_FROM_DEVICE) && 475 if ((cmnd->sc_data_direction == DMA_FROM_DEVICE) &&
484 fcpi_parm && 476 fcpi_parm &&
485 (scsi_get_resid(cmnd) != fcpi_parm)) { 477 (scsi_get_resid(cmnd) != fcpi_parm)) {
486 lpfc_printf_log(phba, KERN_WARNING, 478 lpfc_printf_vlog(vport, KERN_WARNING,
487 LOG_FCP | LOG_FCP_ERROR, 479 LOG_FCP | LOG_FCP_ERROR,
488 "%d (%d):0735 FCP Read Check Error " 480 "0735 FCP Read Check Error "
489 "and Underrun Data: x%x x%x x%x x%x\n", 481 "and Underrun Data: x%x x%x x%x x%x\n",
490 phba->brd_no, vpi, 482 be32_to_cpu(fcpcmd->fcpDl),
491 be32_to_cpu(fcpcmd->fcpDl), 483 scsi_get_resid(cmnd), fcpi_parm,
492 scsi_get_resid(cmnd), fcpi_parm, 484 cmnd->cmnd[0]);
493 cmnd->cmnd[0]);
494 scsi_set_resid(cmnd, scsi_bufflen(cmnd)); 485 scsi_set_resid(cmnd, scsi_bufflen(cmnd));
495 host_status = DID_ERROR; 486 host_status = DID_ERROR;
496 } 487 }
@@ -504,21 +495,19 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
504 (scsi_status == SAM_STAT_GOOD) && 495 (scsi_status == SAM_STAT_GOOD) &&
505 (scsi_bufflen(cmnd) - scsi_get_resid(cmnd) 496 (scsi_bufflen(cmnd) - scsi_get_resid(cmnd)
506 < cmnd->underflow)) { 497 < cmnd->underflow)) {
507 lpfc_printf_log(phba, KERN_INFO, LOG_FCP, 498 lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
508 "%d (%d):0717 FCP command x%x residual " 499 "0717 FCP command x%x residual "
509 "underrun converted to error " 500 "underrun converted to error "
510 "Data: x%x x%x x%x\n", 501 "Data: x%x x%x x%x\n",
511 phba->brd_no, vpi, cmnd->cmnd[0], 502 cmnd->cmnd[0], scsi_bufflen(cmnd),
512 scsi_bufflen(cmnd), 503 scsi_get_resid(cmnd), cmnd->underflow);
513 scsi_get_resid(cmnd), cmnd->underflow);
514 host_status = DID_ERROR; 504 host_status = DID_ERROR;
515 } 505 }
516 } else if (resp_info & RESID_OVER) { 506 } else if (resp_info & RESID_OVER) {
517 lpfc_printf_log(phba, KERN_WARNING, LOG_FCP, 507 lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
518 "%d (%d):0720 FCP command x%x residual " 508 "0720 FCP command x%x residual overrun error. "
519 "overrun error. Data: x%x x%x \n", 509 "Data: x%x x%x \n", cmnd->cmnd[0],
520 phba->brd_no, vpi, cmnd->cmnd[0], 510 scsi_bufflen(cmnd), scsi_get_resid(cmnd));
521 scsi_bufflen(cmnd), scsi_get_resid(cmnd));
522 host_status = DID_ERROR; 511 host_status = DID_ERROR;
523 512
524 /* 513 /*
@@ -527,13 +516,12 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_scsi_buf *lpfc_cmd,
527 */ 516 */
528 } else if ((scsi_status == SAM_STAT_GOOD) && fcpi_parm && 517 } else if ((scsi_status == SAM_STAT_GOOD) && fcpi_parm &&
529 (cmnd->sc_data_direction == DMA_FROM_DEVICE)) { 518 (cmnd->sc_data_direction == DMA_FROM_DEVICE)) {
530 lpfc_printf_log(phba, KERN_WARNING, LOG_FCP | LOG_FCP_ERROR, 519 lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP | LOG_FCP_ERROR,
531 "%d (%d):0734 FCP Read Check Error Data: " 520 "0734 FCP Read Check Error Data: "
532 "x%x x%x x%x x%x\n", 521 "x%x x%x x%x x%x\n",
533 phba->brd_no, vpi, 522 be32_to_cpu(fcpcmd->fcpDl),
534 be32_to_cpu(fcpcmd->fcpDl), 523 be32_to_cpu(fcprsp->rspResId),
535 be32_to_cpu(fcprsp->rspResId), 524 fcpi_parm, cmnd->cmnd[0]);
536 fcpi_parm, cmnd->cmnd[0]);
537 host_status = DID_ERROR; 525 host_status = DID_ERROR;
538 scsi_set_resid(cmnd, scsi_bufflen(cmnd)); 526 scsi_set_resid(cmnd, scsi_bufflen(cmnd));
539 } 527 }
@@ -552,9 +540,6 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
552 struct lpfc_rport_data *rdata = lpfc_cmd->rdata; 540 struct lpfc_rport_data *rdata = lpfc_cmd->rdata;
553 struct lpfc_nodelist *pnode = rdata->pnode; 541 struct lpfc_nodelist *pnode = rdata->pnode;
554 struct scsi_cmnd *cmd = lpfc_cmd->pCmd; 542 struct scsi_cmnd *cmd = lpfc_cmd->pCmd;
555 uint32_t vpi = (lpfc_cmd->cur_iocbq.vport
556 ? lpfc_cmd->cur_iocbq.vport->vpi
557 : 0);
558 int result; 543 int result;
559 struct scsi_device *sdev, *tmp_sdev; 544 struct scsi_device *sdev, *tmp_sdev;
560 int depth = 0; 545 int depth = 0;
@@ -569,15 +554,15 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
569 else if (lpfc_cmd->status >= IOSTAT_CNT) 554 else if (lpfc_cmd->status >= IOSTAT_CNT)
570 lpfc_cmd->status = IOSTAT_DEFAULT; 555 lpfc_cmd->status = IOSTAT_DEFAULT;
571 556
572 lpfc_printf_log(phba, KERN_WARNING, LOG_FCP, 557 lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
573 "%d (%d):0729 FCP cmd x%x failed <%d/%d> " 558 "0729 FCP cmd x%x failed <%d/%d> "
574 "status: x%x result: x%x Data: x%x x%x\n", 559 "status: x%x result: x%x Data: x%x x%x\n",
575 phba->brd_no, vpi, cmd->cmnd[0], 560 cmd->cmnd[0],
576 cmd->device ? cmd->device->id : 0xffff, 561 cmd->device ? cmd->device->id : 0xffff,
577 cmd->device ? cmd->device->lun : 0xffff, 562 cmd->device ? cmd->device->lun : 0xffff,
578 lpfc_cmd->status, lpfc_cmd->result, 563 lpfc_cmd->status, lpfc_cmd->result,
579 pIocbOut->iocb.ulpContext, 564 pIocbOut->iocb.ulpContext,
580 lpfc_cmd->cur_iocbq.iocb.ulpIoTag); 565 lpfc_cmd->cur_iocbq.iocb.ulpIoTag);
581 566
582 switch (lpfc_cmd->status) { 567 switch (lpfc_cmd->status) {
583 case IOSTAT_FCP_RSP_ERROR: 568 case IOSTAT_FCP_RSP_ERROR:
@@ -610,13 +595,12 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
610 if (cmd->result || lpfc_cmd->fcp_rsp->rspSnsLen) { 595 if (cmd->result || lpfc_cmd->fcp_rsp->rspSnsLen) {
611 uint32_t *lp = (uint32_t *)cmd->sense_buffer; 596 uint32_t *lp = (uint32_t *)cmd->sense_buffer;
612 597
613 lpfc_printf_log(phba, KERN_INFO, LOG_FCP, 598 lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
614 "%d (%d):0710 Iodone <%d/%d> cmd %p, error " 599 "0710 Iodone <%d/%d> cmd %p, error "
615 "x%x SNS x%x x%x Data: x%x x%x\n", 600 "x%x SNS x%x x%x Data: x%x x%x\n",
616 phba->brd_no, vpi, cmd->device->id, 601 cmd->device->id, cmd->device->lun, cmd,
617 cmd->device->lun, cmd, cmd->result, 602 cmd->result, *lp, *(lp + 3), cmd->retries,
618 *lp, *(lp + 3), cmd->retries, 603 scsi_get_resid(cmd));
619 scsi_get_resid(cmd));
620 } 604 }
621 605
622 result = cmd->result; 606 result = cmd->result;
@@ -631,16 +615,16 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
631 615
632 616
633 if (!result) 617 if (!result)
634 lpfc_rampup_queue_depth(phba, sdev); 618 lpfc_rampup_queue_depth(vport, sdev);
635 619
636 if (!result && pnode != NULL && 620 if (!result && pnode != NULL &&
637 ((jiffies - pnode->last_ramp_up_time) > 621 ((jiffies - pnode->last_ramp_up_time) >
638 LPFC_Q_RAMP_UP_INTERVAL * HZ) && 622 LPFC_Q_RAMP_UP_INTERVAL * HZ) &&
639 ((jiffies - pnode->last_q_full_time) > 623 ((jiffies - pnode->last_q_full_time) >
640 LPFC_Q_RAMP_UP_INTERVAL * HZ) && 624 LPFC_Q_RAMP_UP_INTERVAL * HZ) &&
641 (phba->cfg_lun_queue_depth > sdev->queue_depth)) { 625 (vport->cfg_lun_queue_depth > sdev->queue_depth)) {
642 shost_for_each_device(tmp_sdev, sdev->host) { 626 shost_for_each_device(tmp_sdev, sdev->host) {
643 if (phba->cfg_lun_queue_depth > tmp_sdev->queue_depth) { 627 if (vport->cfg_lun_queue_depth > tmp_sdev->queue_depth){
644 if (tmp_sdev->id != sdev->id) 628 if (tmp_sdev->id != sdev->id)
645 continue; 629 continue;
646 if (tmp_sdev->ordered_tags) 630 if (tmp_sdev->ordered_tags)
@@ -680,10 +664,9 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn,
680 depth = sdev->host->cmd_per_lun; 664 depth = sdev->host->cmd_per_lun;
681 665
682 if (depth) { 666 if (depth) {
683 lpfc_printf_log(phba, KERN_WARNING, LOG_FCP, 667 lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
684 "%d (%d):0711 detected queue full - " 668 "0711 detected queue full - lun queue "
685 "lun queue depth adjusted to %d.\n", 669 "depth adjusted to %d.\n", depth);
686 phba->brd_no, vpi, depth);
687 } 670 }
688 } 671 }
689 672
@@ -853,12 +836,9 @@ lpfc_scsi_tgt_reset(struct lpfc_scsi_buf *lpfc_cmd, struct lpfc_vport *vport,
853 return FAILED; 836 return FAILED;
854 837
855 /* Issue Target Reset to TGT <num> */ 838 /* Issue Target Reset to TGT <num> */
856 lpfc_printf_log(phba, KERN_INFO, LOG_FCP, 839 lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
857 "%d (%d):0702 Issue Target Reset to TGT %d " 840 "0702 Issue Target Reset to TGT %d Data: x%x x%x\n",
858 "Data: x%x x%x\n", 841 tgt_id, rdata->pnode->nlp_rpi, rdata->pnode->nlp_flag);
859 phba->brd_no, vport->vpi, tgt_id,
860 rdata->pnode->nlp_rpi, rdata->pnode->nlp_flag);
861
862 ret = lpfc_sli_issue_iocb_wait(phba, 842 ret = lpfc_sli_issue_iocb_wait(phba,
863 &phba->sli.ring[phba->sli.fcp_ring], 843 &phba->sli.ring[phba->sli.fcp_ring],
864 iocbq, iocbqrsp, lpfc_cmd->timeout); 844 iocbq, iocbqrsp, lpfc_cmd->timeout);
@@ -965,10 +945,9 @@ lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *))
965 if (lpfc_cmd == NULL) { 945 if (lpfc_cmd == NULL) {
966 lpfc_adjust_queue_depth(phba); 946 lpfc_adjust_queue_depth(phba);
967 947
968 lpfc_printf_log(phba, KERN_INFO, LOG_FCP, 948 lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
969 "%d (%d):0707 driver's buffer pool is empty, " 949 "0707 driver's buffer pool is empty, "
970 "IO busied\n", 950 "IO busied\n");
971 phba->brd_no, vport->vpi);
972 goto out_host_busy; 951 goto out_host_busy;
973 } 952 }
974 953
@@ -1103,28 +1082,25 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd)
1103 1082
1104 schedule_timeout_uninterruptible(LPFC_ABORT_WAIT * HZ); 1083 schedule_timeout_uninterruptible(LPFC_ABORT_WAIT * HZ);
1105 if (++loop_count 1084 if (++loop_count
1106 > (2 * phba->cfg_devloss_tmo)/LPFC_ABORT_WAIT) 1085 > (2 * vport->cfg_devloss_tmo)/LPFC_ABORT_WAIT)
1107 break; 1086 break;
1108 } 1087 }
1109 1088
1110 if (lpfc_cmd->pCmd == cmnd) { 1089 if (lpfc_cmd->pCmd == cmnd) {
1111 ret = FAILED; 1090 ret = FAILED;
1112 lpfc_printf_log(phba, KERN_ERR, LOG_FCP, 1091 lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
1113 "%d (%d):0748 abort handler timed out waiting " 1092 "0748 abort handler timed out waiting "
1114 "for abort to complete: ret %#x, ID %d, " 1093 "for abort to complete: ret %#x, ID %d, "
1115 "LUN %d, snum %#lx\n", 1094 "LUN %d, snum %#lx\n",
1116 phba->brd_no, vport->vpi, ret, 1095 ret, cmnd->device->id, cmnd->device->lun,
1117 cmnd->device->id, cmnd->device->lun, 1096 cmnd->serial_number);
1118 cmnd->serial_number);
1119 } 1097 }
1120 1098
1121 out: 1099 out:
1122 lpfc_printf_log(phba, KERN_WARNING, LOG_FCP, 1100 lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
1123 "%d (%d):0749 SCSI Layer I/O Abort Request " 1101 "0749 SCSI Layer I/O Abort Request Status x%x ID %d "
1124 "Status x%x ID %d LUN %d snum %#lx\n", 1102 "LUN %d snum %#lx\n", ret, cmnd->device->id,
1125 phba->brd_no, vport->vpi, ret, cmnd->device->id, 1103 cmnd->device->lun, cmnd->serial_number);
1126 cmnd->device->lun, cmnd->serial_number);
1127
1128 return ret; 1104 return ret;
1129} 1105}
1130 1106
@@ -1158,12 +1134,11 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd)
1158 loopcnt++; 1134 loopcnt++;
1159 rdata = cmnd->device->hostdata; 1135 rdata = cmnd->device->hostdata;
1160 if (!rdata || 1136 if (!rdata ||
1161 (loopcnt > ((phba->cfg_devloss_tmo * 2) + 1))) { 1137 (loopcnt > ((vport->cfg_devloss_tmo * 2) + 1))){
1162 lpfc_printf_log(phba, KERN_ERR, LOG_FCP, 1138 lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
1163 "%d (%d):0721 LUN Reset rport " 1139 "0721 LUN Reset rport "
1164 "failure: cnt x%x rdata x%p\n", 1140 "failure: cnt x%x rdata x%p\n",
1165 phba->brd_no, vport->vpi, 1141 loopcnt, rdata);
1166 loopcnt, rdata);
1167 goto out; 1142 goto out;
1168 } 1143 }
1169 pnode = rdata->pnode; 1144 pnode = rdata->pnode;
@@ -1193,12 +1168,10 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd)
1193 if (iocbqrsp == NULL) 1168 if (iocbqrsp == NULL)
1194 goto out_free_scsi_buf; 1169 goto out_free_scsi_buf;
1195 1170
1196 lpfc_printf_log(phba, KERN_INFO, LOG_FCP, 1171 lpfc_printf_vlog(vport, KERN_INFO, LOG_FCP,
1197 "%d (%d):0703 Issue target reset to TGT %d LUN %d " 1172 "0703 Issue target reset to TGT %d LUN %d "
1198 "rpi x%x nlp_flag x%x\n", 1173 "rpi x%x nlp_flag x%x\n", cmnd->device->id,
1199 phba->brd_no, vport->vpi, cmnd->device->id, 1174 cmnd->device->lun, pnode->nlp_rpi, pnode->nlp_flag);
1200 cmnd->device->lun, pnode->nlp_rpi, pnode->nlp_flag);
1201
1202 iocb_status = lpfc_sli_issue_iocb_wait(phba, 1175 iocb_status = lpfc_sli_issue_iocb_wait(phba,
1203 &phba->sli.ring[phba->sli.fcp_ring], 1176 &phba->sli.ring[phba->sli.fcp_ring],
1204 iocbq, iocbqrsp, lpfc_cmd->timeout); 1177 iocbq, iocbqrsp, lpfc_cmd->timeout);
@@ -1221,33 +1194,28 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd)
1221 * Unfortunately, some targets do not abide by this forcing the driver 1194 * Unfortunately, some targets do not abide by this forcing the driver
1222 * to double check. 1195 * to double check.
1223 */ 1196 */
1224 cnt = lpfc_sli_sum_iocb(phba, &phba->sli.ring[phba->sli.fcp_ring], 1197 cnt = lpfc_sli_sum_iocb(vport, cmnd->device->id, cmnd->device->lun,
1225 cmnd->device->id, cmnd->device->lun,
1226 LPFC_CTX_LUN); 1198 LPFC_CTX_LUN);
1227 if (cnt) 1199 if (cnt)
1228 lpfc_sli_abort_iocb(phba, 1200 lpfc_sli_abort_iocb(vport, &phba->sli.ring[phba->sli.fcp_ring],
1229 &phba->sli.ring[phba->sli.fcp_ring],
1230 cmnd->device->id, cmnd->device->lun, 1201 cmnd->device->id, cmnd->device->lun,
1231 0, LPFC_CTX_LUN); 1202 LPFC_CTX_LUN);
1232 loopcnt = 0; 1203 loopcnt = 0;
1233 while(cnt) { 1204 while(cnt) {
1234 schedule_timeout_uninterruptible(LPFC_RESET_WAIT*HZ); 1205 schedule_timeout_uninterruptible(LPFC_RESET_WAIT*HZ);
1235 1206
1236 if (++loopcnt 1207 if (++loopcnt
1237 > (2 * phba->cfg_devloss_tmo)/LPFC_RESET_WAIT) 1208 > (2 * vport->cfg_devloss_tmo)/LPFC_RESET_WAIT)
1238 break; 1209 break;
1239 1210
1240 cnt = lpfc_sli_sum_iocb(phba, 1211 cnt = lpfc_sli_sum_iocb(vport, cmnd->device->id,
1241 &phba->sli.ring[phba->sli.fcp_ring], 1212 cmnd->device->lun, LPFC_CTX_LUN);
1242 cmnd->device->id, cmnd->device->lun,
1243 LPFC_CTX_LUN);
1244 } 1213 }
1245 1214
1246 if (cnt) { 1215 if (cnt) {
1247 lpfc_printf_log(phba, KERN_ERR, LOG_FCP, 1216 lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
1248 "%d (%d):0719 device reset I/O flush failure: " 1217 "0719 device reset I/O flush failure: "
1249 "cnt x%x\n", 1218 "cnt x%x\n", cnt);
1250 phba->brd_no, vport->vpi, cnt);
1251 ret = FAILED; 1219 ret = FAILED;
1252 } 1220 }
1253 1221
@@ -1255,12 +1223,11 @@ out_free_scsi_buf:
1255 if (iocb_status != IOCB_TIMEDOUT) { 1223 if (iocb_status != IOCB_TIMEDOUT) {
1256 lpfc_release_scsi_buf(phba, lpfc_cmd); 1224 lpfc_release_scsi_buf(phba, lpfc_cmd);
1257 } 1225 }
1258 lpfc_printf_log(phba, KERN_ERR, LOG_FCP, 1226 lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
1259 "%d (%d):0713 SCSI layer issued device reset (%d, %d) " 1227 "0713 SCSI layer issued device reset (%d, %d) "
1260 "return x%x status x%x result x%x\n", 1228 "return x%x status x%x result x%x\n",
1261 phba->brd_no, vport->vpi, cmnd->device->id, 1229 cmnd->device->id, cmnd->device->lun, ret,
1262 cmnd->device->lun, ret, cmd_status, cmd_result); 1230 cmd_status, cmd_result);
1263
1264out: 1231out:
1265 return ret; 1232 return ret;
1266} 1233}
@@ -1311,10 +1278,9 @@ lpfc_bus_reset_handler(struct scsi_cmnd *cmnd)
1311 cmnd->device->lun, 1278 cmnd->device->lun,
1312 ndlp->rport->dd_data); 1279 ndlp->rport->dd_data);
1313 if (ret != SUCCESS) { 1280 if (ret != SUCCESS) {
1314 lpfc_printf_log(phba, KERN_ERR, LOG_FCP, 1281 lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
1315 "%d (%d):0700 Bus Reset on target %d " 1282 "0700 Bus Reset on target %d failed\n",
1316 "failed\n", 1283 i);
1317 phba->brd_no, vport->vpi, i);
1318 err_count++; 1284 err_count++;
1319 break; 1285 break;
1320 } 1286 }
@@ -1333,35 +1299,30 @@ lpfc_bus_reset_handler(struct scsi_cmnd *cmnd)
1333 * the targets. Unfortunately, some targets do not abide by 1299 * the targets. Unfortunately, some targets do not abide by
1334 * this forcing the driver to double check. 1300 * this forcing the driver to double check.
1335 */ 1301 */
1336 cnt = lpfc_sli_sum_iocb(phba, &phba->sli.ring[phba->sli.fcp_ring], 1302 cnt = lpfc_sli_sum_iocb(vport, 0, 0, LPFC_CTX_HOST);
1337 0, 0, LPFC_CTX_HOST);
1338 if (cnt) 1303 if (cnt)
1339 lpfc_sli_abort_iocb(phba, &phba->sli.ring[phba->sli.fcp_ring], 1304 lpfc_sli_abort_iocb(vport, &phba->sli.ring[phba->sli.fcp_ring],
1340 0, 0, 0, LPFC_CTX_HOST); 1305 0, 0, LPFC_CTX_HOST);
1341 loopcnt = 0; 1306 loopcnt = 0;
1342 while(cnt) { 1307 while(cnt) {
1343 schedule_timeout_uninterruptible(LPFC_RESET_WAIT*HZ); 1308 schedule_timeout_uninterruptible(LPFC_RESET_WAIT*HZ);
1344 1309
1345 if (++loopcnt 1310 if (++loopcnt
1346 > (2 * phba->cfg_devloss_tmo)/LPFC_RESET_WAIT) 1311 > (2 * vport->cfg_devloss_tmo)/LPFC_RESET_WAIT)
1347 break; 1312 break;
1348 1313
1349 cnt = lpfc_sli_sum_iocb(phba, 1314 cnt = lpfc_sli_sum_iocb(vport, 0, 0, LPFC_CTX_HOST);
1350 &phba->sli.ring[phba->sli.fcp_ring],
1351 0, 0, LPFC_CTX_HOST);
1352 } 1315 }
1353 1316
1354 if (cnt) { 1317 if (cnt) {
1355 lpfc_printf_log(phba, KERN_ERR, LOG_FCP, 1318 lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
1356 "%d (%d):0715 Bus Reset I/O flush failure: " 1319 "0715 Bus Reset I/O flush failure: "
1357 "cnt x%x left x%x\n", 1320 "cnt x%x left x%x\n", cnt, i);
1358 phba->brd_no, vport->vpi, cnt, i);
1359 ret = FAILED; 1321 ret = FAILED;
1360 } 1322 }
1361 1323
1362 lpfc_printf_log(phba, KERN_ERR, LOG_FCP, 1324 lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
1363 "%d (%d):0714 SCSI layer issued Bus Reset Data: x%x\n", 1325 "0714 SCSI layer issued Bus Reset Data: x%x\n", ret);
1364 phba->brd_no, vport->vpi, ret);
1365out: 1326out:
1366 return ret; 1327 return ret;
1367} 1328}
@@ -1390,36 +1351,32 @@ lpfc_slave_alloc(struct scsi_device *sdev)
1390 * extra. This list of scsi bufs exists for the lifetime of the driver. 1351 * extra. This list of scsi bufs exists for the lifetime of the driver.
1391 */ 1352 */
1392 total = phba->total_scsi_bufs; 1353 total = phba->total_scsi_bufs;
1393 num_to_alloc = phba->cfg_lun_queue_depth + 2; 1354 num_to_alloc = vport->cfg_lun_queue_depth + 2;
1394 1355
1395 /* Allow some exchanges to be available always to complete discovery */ 1356 /* Allow some exchanges to be available always to complete discovery */
1396 if (total >= phba->cfg_hba_queue_depth - LPFC_DISC_IOCB_BUFF_COUNT ) { 1357 if (total >= phba->cfg_hba_queue_depth - LPFC_DISC_IOCB_BUFF_COUNT ) {
1397 lpfc_printf_log(phba, KERN_WARNING, LOG_FCP, 1358 lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
1398 "%d (%d):0704 At limitation of %d " 1359 "0704 At limitation of %d preallocated "
1399 "preallocated command buffers\n", 1360 "command buffers\n", total);
1400 phba->brd_no, vport->vpi, total);
1401 return 0; 1361 return 0;
1402
1403 /* Allow some exchanges to be available always to complete discovery */ 1362 /* Allow some exchanges to be available always to complete discovery */
1404 } else if (total + num_to_alloc > 1363 } else if (total + num_to_alloc >
1405 phba->cfg_hba_queue_depth - LPFC_DISC_IOCB_BUFF_COUNT ) { 1364 phba->cfg_hba_queue_depth - LPFC_DISC_IOCB_BUFF_COUNT ) {
1406 lpfc_printf_log(phba, KERN_WARNING, LOG_FCP, 1365 lpfc_printf_vlog(vport, KERN_WARNING, LOG_FCP,
1407 "%d (%d):0705 Allocation request of %d " 1366 "0705 Allocation request of %d "
1408 "command buffers will exceed max of %d. " 1367 "command buffers will exceed max of %d. "
1409 "Reducing allocation request to %d.\n", 1368 "Reducing allocation request to %d.\n",
1410 phba->brd_no, vport->vpi, num_to_alloc, 1369 num_to_alloc, phba->cfg_hba_queue_depth,
1411 phba->cfg_hba_queue_depth, 1370 (phba->cfg_hba_queue_depth - total));
1412 (phba->cfg_hba_queue_depth - total));
1413 num_to_alloc = phba->cfg_hba_queue_depth - total; 1371 num_to_alloc = phba->cfg_hba_queue_depth - total;
1414 } 1372 }
1415 1373
1416 for (i = 0; i < num_to_alloc; i++) { 1374 for (i = 0; i < num_to_alloc; i++) {
1417 scsi_buf = lpfc_new_scsi_buf(vport); 1375 scsi_buf = lpfc_new_scsi_buf(vport);
1418 if (!scsi_buf) { 1376 if (!scsi_buf) {
1419 lpfc_printf_log(phba, KERN_ERR, LOG_FCP, 1377 lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
1420 "%d (%d):0706 Failed to allocate " 1378 "0706 Failed to allocate "
1421 "command buffer\n", 1379 "command buffer\n");
1422 phba->brd_no, vport->vpi);
1423 break; 1380 break;
1424 } 1381 }
1425 1382
@@ -1439,9 +1396,9 @@ lpfc_slave_configure(struct scsi_device *sdev)
1439 struct fc_rport *rport = starget_to_rport(sdev->sdev_target); 1396 struct fc_rport *rport = starget_to_rport(sdev->sdev_target);
1440 1397
1441 if (sdev->tagged_supported) 1398 if (sdev->tagged_supported)
1442 scsi_activate_tcq(sdev, phba->cfg_lun_queue_depth); 1399 scsi_activate_tcq(sdev, vport->cfg_lun_queue_depth);
1443 else 1400 else
1444 scsi_deactivate_tcq(sdev, phba->cfg_lun_queue_depth); 1401 scsi_deactivate_tcq(sdev, vport->cfg_lun_queue_depth);
1445 1402
1446 /* 1403 /*
1447 * Initialize the fc transport attributes for the target 1404 * Initialize the fc transport attributes for the target
@@ -1449,7 +1406,7 @@ lpfc_slave_configure(struct scsi_device *sdev)
1449 * target pointer is stored in the starget_data for the 1406 * target pointer is stored in the starget_data for the
1450 * driver's sysfs entry point functions. 1407 * driver's sysfs entry point functions.
1451 */ 1408 */
1452 rport->dev_loss_tmo = phba->cfg_devloss_tmo; 1409 rport->dev_loss_tmo = vport->cfg_devloss_tmo;
1453 1410
1454 if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) { 1411 if (phba->cfg_poll & ENABLE_FCP_RING_POLLING) {
1455 lpfc_sli_poll_fcp_ring(phba); 1412 lpfc_sli_poll_fcp_ring(phba);
@@ -1487,3 +1444,23 @@ struct scsi_host_template lpfc_template = {
1487 .shost_attrs = lpfc_hba_attrs, 1444 .shost_attrs = lpfc_hba_attrs,
1488 .max_sectors = 0xFFFF, 1445 .max_sectors = 0xFFFF,
1489}; 1446};
1447
1448struct scsi_host_template lpfc_vport_template = {
1449 .module = THIS_MODULE,
1450 .name = LPFC_DRIVER_NAME,
1451 .info = lpfc_info,
1452 .queuecommand = lpfc_queuecommand,
1453 .eh_abort_handler = lpfc_abort_handler,
1454 .eh_device_reset_handler= lpfc_device_reset_handler,
1455 .eh_bus_reset_handler = lpfc_bus_reset_handler,
1456 .slave_alloc = lpfc_slave_alloc,
1457 .slave_configure = lpfc_slave_configure,
1458 .slave_destroy = lpfc_slave_destroy,
1459 .scan_finished = lpfc_scan_finished,
1460 .this_id = -1,
1461 .sg_tablesize = LPFC_SG_SEG_CNT,
1462 .cmd_per_lun = LPFC_CMD_PER_LUN,
1463 .use_clustering = ENABLE_CLUSTERING,
1464 .shost_attrs = lpfc_vport_attrs,
1465 .max_sectors = 0xFFFF,
1466};
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index f4d5a6b00fde..ce5ff2bccba6 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -49,9 +49,8 @@
49 lpfc_printf_log(phba, \ 49 lpfc_printf_log(phba, \
50 KERN_INFO, \ 50 KERN_INFO, \
51 LOG_MBOX | LOG_SLI, \ 51 LOG_MBOX | LOG_SLI, \
52 "%d (%d):0311 Mailbox command x%x cannot " \ 52 "(%d):0311 Mailbox command x%x cannot " \
53 "issue Data: x%x x%x x%x\n", \ 53 "issue Data: x%x x%x x%x\n", \
54 phba->brd_no, \
55 pmbox->vport ? pmbox->vport->vpi : 0, \ 54 pmbox->vport ? pmbox->vport->vpi : 0, \
56 pmbox->mb.mbxCommand, \ 55 pmbox->mb.mbxCommand, \
57 phba->pport->port_state, \ 56 phba->pport->port_state, \
@@ -231,13 +230,11 @@ lpfc_sli_ring_map(struct lpfc_hba *phba)
231 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL); 230 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL);
232 if (rc != MBX_SUCCESS) { 231 if (rc != MBX_SUCCESS) {
233 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 232 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
234 "%d:0446 Adapter failed to init (%d), " 233 "0446 Adapter failed to init (%d), "
235 "mbxCmd x%x CFG_RING, mbxStatus x%x, " 234 "mbxCmd x%x CFG_RING, mbxStatus x%x, "
236 "ring %d\n", 235 "ring %d\n",
237 phba->brd_no, rc, 236 rc, pmbox->mbxCommand,
238 pmbox->mbxCommand, 237 pmbox->mbxStatus, i);
239 pmbox->mbxStatus,
240 i);
241 phba->link_state = LPFC_HBA_ERROR; 238 phba->link_state = LPFC_HBA_ERROR;
242 ret = -ENXIO; 239 ret = -ENXIO;
243 break; 240 break;
@@ -296,9 +293,9 @@ lpfc_sli_next_iocb_slot (struct lpfc_hba *phba, struct lpfc_sli_ring *pring)
296 293
297 if (unlikely(pring->local_getidx >= max_cmd_idx)) { 294 if (unlikely(pring->local_getidx >= max_cmd_idx)) {
298 lpfc_printf_log(phba, KERN_ERR, LOG_SLI, 295 lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
299 "%d:0315 Ring %d issue: portCmdGet %d " 296 "0315 Ring %d issue: portCmdGet %d "
300 "is bigger then cmd ring %d\n", 297 "is bigger then cmd ring %d\n",
301 phba->brd_no, pring->ringno, 298 pring->ringno,
302 pring->local_getidx, max_cmd_idx); 299 pring->local_getidx, max_cmd_idx);
303 300
304 phba->link_state = LPFC_HBA_ERROR; 301 phba->link_state = LPFC_HBA_ERROR;
@@ -366,7 +363,7 @@ lpfc_sli_next_iotag(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq)
366 if (psli->iocbq_lookup) 363 if (psli->iocbq_lookup)
367 memcpy(new_arr, old_arr, 364 memcpy(new_arr, old_arr,
368 ((psli->last_iotag + 1) * 365 ((psli->last_iotag + 1) *
369 sizeof (struct lpfc_iocbq *))); 366 sizeof (struct lpfc_iocbq *)));
370 psli->iocbq_lookup = new_arr; 367 psli->iocbq_lookup = new_arr;
371 psli->iocbq_lookup_len = new_len; 368 psli->iocbq_lookup_len = new_len;
372 psli->last_iotag = iotag; 369 psli->last_iotag = iotag;
@@ -380,8 +377,8 @@ lpfc_sli_next_iotag(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq)
380 spin_unlock_irq(&phba->hbalock); 377 spin_unlock_irq(&phba->hbalock);
381 378
382 lpfc_printf_log(phba, KERN_ERR,LOG_SLI, 379 lpfc_printf_log(phba, KERN_ERR,LOG_SLI,
383 "%d:0318 Failed to allocate IOTAG.last IOTAG is %d\n", 380 "0318 Failed to allocate IOTAG.last IOTAG is %d\n",
384 phba->brd_no, psli->last_iotag); 381 psli->last_iotag);
385 382
386 return 0; 383 return 0;
387} 384}
@@ -395,6 +392,14 @@ lpfc_sli_submit_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
395 */ 392 */
396 nextiocb->iocb.ulpIoTag = (nextiocb->iocb_cmpl) ? nextiocb->iotag : 0; 393 nextiocb->iocb.ulpIoTag = (nextiocb->iocb_cmpl) ? nextiocb->iotag : 0;
397 394
395 if (pring->ringno == LPFC_ELS_RING) {
396 lpfc_debugfs_slow_ring_trc(phba,
397 "IOCB cmd ring: wd4:x%08x wd6:x%08x wd7:x%08x",
398 *(((uint32_t *) &nextiocb->iocb) + 4),
399 *(((uint32_t *) &nextiocb->iocb) + 6),
400 *(((uint32_t *) &nextiocb->iocb) + 7));
401 }
402
398 /* 403 /*
399 * Issue iocb command to adapter 404 * Issue iocb command to adapter
400 */ 405 */
@@ -527,10 +532,9 @@ lpfc_sli_next_hbq_slot(struct lpfc_hba *phba, uint32_t hbqno)
527 if (unlikely(hbqp->local_hbqGetIdx >= hbqp->entry_count)) { 532 if (unlikely(hbqp->local_hbqGetIdx >= hbqp->entry_count)) {
528 lpfc_printf_log(phba, KERN_ERR, 533 lpfc_printf_log(phba, KERN_ERR,
529 LOG_SLI | LOG_VPORT, 534 LOG_SLI | LOG_VPORT,
530 "%d:1802 HBQ %d: local_hbqGetIdx " 535 "1802 HBQ %d: local_hbqGetIdx "
531 "%u is > than hbqp->entry_count %u\n", 536 "%u is > than hbqp->entry_count %u\n",
532 phba->brd_no, hbqno, 537 hbqno, hbqp->local_hbqGetIdx,
533 hbqp->local_hbqGetIdx,
534 hbqp->entry_count); 538 hbqp->entry_count);
535 539
536 phba->link_state = LPFC_HBA_ERROR; 540 phba->link_state = LPFC_HBA_ERROR;
@@ -541,7 +545,8 @@ lpfc_sli_next_hbq_slot(struct lpfc_hba *phba, uint32_t hbqno)
541 return NULL; 545 return NULL;
542 } 546 }
543 547
544 return (struct lpfc_hbq_entry *) phba->hbqslimp.virt + hbqp->hbqPutIdx; 548 return (struct lpfc_hbq_entry *) phba->hbqs[hbqno].hbq_virt +
549 hbqp->hbqPutIdx;
545} 550}
546 551
547void 552void
@@ -549,18 +554,21 @@ lpfc_sli_hbqbuf_free_all(struct lpfc_hba *phba)
549{ 554{
550 struct lpfc_dmabuf *dmabuf, *next_dmabuf; 555 struct lpfc_dmabuf *dmabuf, *next_dmabuf;
551 struct hbq_dmabuf *hbq_buf; 556 struct hbq_dmabuf *hbq_buf;
557 int i, hbq_count;
552 558
559 hbq_count = lpfc_sli_hbq_count();
553 /* Return all memory used by all HBQs */ 560 /* Return all memory used by all HBQs */
554 list_for_each_entry_safe(dmabuf, next_dmabuf, 561 for (i = 0; i < hbq_count; ++i) {
555 &phba->hbq_buffer_list, list) { 562 list_for_each_entry_safe(dmabuf, next_dmabuf,
556 hbq_buf = container_of(dmabuf, struct hbq_dmabuf, dbuf); 563 &phba->hbqs[i].hbq_buffer_list, list) {
557 list_del(&hbq_buf->dbuf.list); 564 hbq_buf = container_of(dmabuf, struct hbq_dmabuf, dbuf);
558 lpfc_hbq_free(phba, hbq_buf->dbuf.virt, hbq_buf->dbuf.phys); 565 list_del(&hbq_buf->dbuf.list);
559 kfree(hbq_buf); 566 (phba->hbqs[i].hbq_free_buffer)(phba, hbq_buf);
567 }
560 } 568 }
561} 569}
562 570
563static void 571static struct lpfc_hbq_entry *
564lpfc_sli_hbq_to_firmware(struct lpfc_hba *phba, uint32_t hbqno, 572lpfc_sli_hbq_to_firmware(struct lpfc_hba *phba, uint32_t hbqno,
565 struct hbq_dmabuf *hbq_buf) 573 struct hbq_dmabuf *hbq_buf)
566{ 574{
@@ -574,7 +582,7 @@ lpfc_sli_hbq_to_firmware(struct lpfc_hba *phba, uint32_t hbqno,
574 582
575 hbqe->bde.addrHigh = le32_to_cpu(putPaddrHigh(physaddr)); 583 hbqe->bde.addrHigh = le32_to_cpu(putPaddrHigh(physaddr));
576 hbqe->bde.addrLow = le32_to_cpu(putPaddrLow(physaddr)); 584 hbqe->bde.addrLow = le32_to_cpu(putPaddrLow(physaddr));
577 hbqe->bde.tus.f.bdeSize = FCELSSIZE; 585 hbqe->bde.tus.f.bdeSize = hbq_buf->size;
578 hbqe->bde.tus.f.bdeFlags = 0; 586 hbqe->bde.tus.f.bdeFlags = 0;
579 hbqe->bde.tus.w = le32_to_cpu(hbqe->bde.tus.w); 587 hbqe->bde.tus.w = le32_to_cpu(hbqe->bde.tus.w);
580 hbqe->buffer_tag = le32_to_cpu(hbq_buf->tag); 588 hbqe->buffer_tag = le32_to_cpu(hbq_buf->tag);
@@ -583,8 +591,9 @@ lpfc_sli_hbq_to_firmware(struct lpfc_hba *phba, uint32_t hbqno,
583 writel(hbqp->hbqPutIdx, phba->hbq_put + hbqno); 591 writel(hbqp->hbqPutIdx, phba->hbq_put + hbqno);
584 /* flush */ 592 /* flush */
585 readl(phba->hbq_put + hbqno); 593 readl(phba->hbq_put + hbqno);
586 list_add_tail(&hbq_buf->dbuf.list, &phba->hbq_buffer_list); 594 list_add_tail(&hbq_buf->dbuf.list, &hbqp->hbq_buffer_list);
587 } 595 }
596 return hbqe;
588} 597}
589 598
590static struct lpfc_hbq_init lpfc_els_hbq = { 599static struct lpfc_hbq_init lpfc_els_hbq = {
@@ -592,22 +601,38 @@ static struct lpfc_hbq_init lpfc_els_hbq = {
592 .entry_count = 200, 601 .entry_count = 200,
593 .mask_count = 0, 602 .mask_count = 0,
594 .profile = 0, 603 .profile = 0,
595 .ring_mask = 1 << LPFC_ELS_RING, 604 .ring_mask = (1 << LPFC_ELS_RING),
596 .buffer_count = 0, 605 .buffer_count = 0,
597 .init_count = 20, 606 .init_count = 20,
598 .add_count = 5, 607 .add_count = 5,
599}; 608};
600 609
601static struct lpfc_hbq_init *lpfc_hbq_defs[] = { 610static struct lpfc_hbq_init lpfc_extra_hbq = {
611 .rn = 1,
612 .entry_count = 200,
613 .mask_count = 0,
614 .profile = 0,
615 .ring_mask = (1 << LPFC_EXTRA_RING),
616 .buffer_count = 0,
617 .init_count = 0,
618 .add_count = 5,
619};
620
621struct lpfc_hbq_init *lpfc_hbq_defs[] = {
602 &lpfc_els_hbq, 622 &lpfc_els_hbq,
623 &lpfc_extra_hbq,
603}; 624};
604 625
605int 626static int
606lpfc_sli_hbqbuf_fill_hbqs(struct lpfc_hba *phba, uint32_t hbqno, uint32_t count) 627lpfc_sli_hbqbuf_fill_hbqs(struct lpfc_hba *phba, uint32_t hbqno, uint32_t count)
607{ 628{
608 uint32_t i, start, end; 629 uint32_t i, start, end;
609 struct hbq_dmabuf *hbq_buffer; 630 struct hbq_dmabuf *hbq_buffer;
610 631
632 if (!phba->hbqs[hbqno].hbq_alloc_buffer) {
633 return 0;
634 }
635
611 start = lpfc_hbq_defs[hbqno]->buffer_count; 636 start = lpfc_hbq_defs[hbqno]->buffer_count;
612 end = count + lpfc_hbq_defs[hbqno]->buffer_count; 637 end = count + lpfc_hbq_defs[hbqno]->buffer_count;
613 if (end > lpfc_hbq_defs[hbqno]->entry_count) { 638 if (end > lpfc_hbq_defs[hbqno]->entry_count) {
@@ -616,17 +641,14 @@ lpfc_sli_hbqbuf_fill_hbqs(struct lpfc_hba *phba, uint32_t hbqno, uint32_t count)
616 641
617 /* Populate HBQ entries */ 642 /* Populate HBQ entries */
618 for (i = start; i < end; i++) { 643 for (i = start; i < end; i++) {
619 hbq_buffer = kmalloc(sizeof(struct hbq_dmabuf), 644 hbq_buffer = (phba->hbqs[hbqno].hbq_alloc_buffer)(phba);
620 GFP_KERNEL);
621 if (!hbq_buffer) 645 if (!hbq_buffer)
622 return 1; 646 return 1;
623 hbq_buffer->dbuf.virt = lpfc_hbq_alloc(phba, MEM_PRI,
624 &hbq_buffer->dbuf.phys);
625 if (hbq_buffer->dbuf.virt == NULL)
626 return 1;
627 hbq_buffer->tag = (i | (hbqno << 16)); 647 hbq_buffer->tag = (i | (hbqno << 16));
628 lpfc_sli_hbq_to_firmware(phba, hbqno, hbq_buffer); 648 if (lpfc_sli_hbq_to_firmware(phba, hbqno, hbq_buffer))
629 lpfc_hbq_defs[hbqno]->buffer_count++; 649 lpfc_hbq_defs[hbqno]->buffer_count++;
650 else
651 (phba->hbqs[hbqno].hbq_free_buffer)(phba, hbq_buffer);
630 } 652 }
631 return 0; 653 return 0;
632} 654}
@@ -650,28 +672,34 @@ lpfc_sli_hbqbuf_find(struct lpfc_hba *phba, uint32_t tag)
650{ 672{
651 struct lpfc_dmabuf *d_buf; 673 struct lpfc_dmabuf *d_buf;
652 struct hbq_dmabuf *hbq_buf; 674 struct hbq_dmabuf *hbq_buf;
675 uint32_t hbqno;
676
677 hbqno = tag >> 16;
678 if (hbqno > LPFC_MAX_HBQS)
679 return NULL;
653 680
654 list_for_each_entry(d_buf, &phba->hbq_buffer_list, list) { 681 list_for_each_entry(d_buf, &phba->hbqs[hbqno].hbq_buffer_list, list) {
655 hbq_buf = container_of(d_buf, struct hbq_dmabuf, dbuf); 682 hbq_buf = container_of(d_buf, struct hbq_dmabuf, dbuf);
656 if ((hbq_buf->tag & 0xffff) == tag) { 683 if (hbq_buf->tag == tag) {
657 return hbq_buf; 684 return hbq_buf;
658 } 685 }
659 } 686 }
660 lpfc_printf_log(phba, KERN_ERR, LOG_SLI | LOG_VPORT, 687 lpfc_printf_log(phba, KERN_ERR, LOG_SLI | LOG_VPORT,
661 "%d:1803 Bad hbq tag. Data: x%x x%x\n", 688 "1803 Bad hbq tag. Data: x%x x%x\n",
662 phba->brd_no, tag, 689 tag, lpfc_hbq_defs[tag >> 16]->buffer_count);
663 lpfc_hbq_defs[tag >> 16]->buffer_count);
664 return NULL; 690 return NULL;
665} 691}
666 692
667void 693void
668lpfc_sli_free_hbq(struct lpfc_hba *phba, struct hbq_dmabuf *sp) 694lpfc_sli_free_hbq(struct lpfc_hba *phba, struct hbq_dmabuf *hbq_buffer)
669{ 695{
670 uint32_t hbqno; 696 uint32_t hbqno;
671 697
672 if (sp) { 698 if (hbq_buffer) {
673 hbqno = sp->tag >> 16; 699 hbqno = hbq_buffer->tag >> 16;
674 lpfc_sli_hbq_to_firmware(phba, hbqno, sp); 700 if (!lpfc_sli_hbq_to_firmware(phba, hbqno, hbq_buffer)) {
701 (phba->hbqs[hbqno].hbq_free_buffer)(phba, hbq_buffer);
702 }
675 } 703 }
676} 704}
677 705
@@ -837,12 +865,10 @@ lpfc_sli_handle_mb_event(struct lpfc_hba *phba)
837 */ 865 */
838 if (lpfc_sli_chk_mbx_command(pmbox->mbxCommand) == 866 if (lpfc_sli_chk_mbx_command(pmbox->mbxCommand) ==
839 MBX_SHUTDOWN) { 867 MBX_SHUTDOWN) {
840
841 /* Unknow mailbox command compl */ 868 /* Unknow mailbox command compl */
842 lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, 869 lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
843 "%d (%d):0323 Unknown Mailbox command " 870 "(%d):0323 Unknown Mailbox command "
844 "%x Cmpl\n", 871 "%x Cmpl\n",
845 phba->brd_no,
846 pmb->vport ? pmb->vport->vpi : 0, 872 pmb->vport ? pmb->vport->vpi : 0,
847 pmbox->mbxCommand); 873 pmbox->mbxCommand);
848 phba->link_state = LPFC_HBA_ERROR; 874 phba->link_state = LPFC_HBA_ERROR;
@@ -857,10 +883,9 @@ lpfc_sli_handle_mb_event(struct lpfc_hba *phba)
857 /* Mbox cmd cmpl error - RETRYing */ 883 /* Mbox cmd cmpl error - RETRYing */
858 lpfc_printf_log(phba, KERN_INFO, 884 lpfc_printf_log(phba, KERN_INFO,
859 LOG_MBOX | LOG_SLI, 885 LOG_MBOX | LOG_SLI,
860 "%d (%d):0305 Mbox cmd cmpl " 886 "(%d):0305 Mbox cmd cmpl "
861 "error - RETRYing Data: x%x " 887 "error - RETRYing Data: x%x "
862 "x%x x%x x%x\n", 888 "x%x x%x x%x\n",
863 phba->brd_no,
864 pmb->vport ? pmb->vport->vpi :0, 889 pmb->vport ? pmb->vport->vpi :0,
865 pmbox->mbxCommand, 890 pmbox->mbxCommand,
866 pmbox->mbxStatus, 891 pmbox->mbxStatus,
@@ -879,9 +904,8 @@ lpfc_sli_handle_mb_event(struct lpfc_hba *phba)
879 904
880 /* Mailbox cmd <cmd> Cmpl <cmpl> */ 905 /* Mailbox cmd <cmd> Cmpl <cmpl> */
881 lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, 906 lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI,
882 "%d (%d):0307 Mailbox cmd x%x Cmpl x%p " 907 "(%d):0307 Mailbox cmd x%x Cmpl x%p "
883 "Data: x%x x%x x%x x%x x%x x%x x%x x%x x%x\n", 908 "Data: x%x x%x x%x x%x x%x x%x x%x x%x x%x\n",
884 phba->brd_no,
885 pmb->vport ? pmb->vport->vpi : 0, 909 pmb->vport ? pmb->vport->vpi : 0,
886 pmbox->mbxCommand, 910 pmbox->mbxCommand,
887 pmb->mbox_cmpl, 911 pmb->mbox_cmpl,
@@ -905,21 +929,26 @@ static struct lpfc_dmabuf *
905lpfc_sli_replace_hbqbuff(struct lpfc_hba *phba, uint32_t tag) 929lpfc_sli_replace_hbqbuff(struct lpfc_hba *phba, uint32_t tag)
906{ 930{
907 struct hbq_dmabuf *hbq_entry, *new_hbq_entry; 931 struct hbq_dmabuf *hbq_entry, *new_hbq_entry;
932 uint32_t hbqno;
933 void *virt; /* virtual address ptr */
934 dma_addr_t phys; /* mapped address */
908 935
909 hbq_entry = lpfc_sli_hbqbuf_find(phba, tag); 936 hbq_entry = lpfc_sli_hbqbuf_find(phba, tag);
910 if (hbq_entry == NULL) 937 if (hbq_entry == NULL)
911 return NULL; 938 return NULL;
912 list_del(&hbq_entry->dbuf.list); 939 list_del(&hbq_entry->dbuf.list);
913 new_hbq_entry = kmalloc(sizeof(struct hbq_dmabuf), GFP_ATOMIC); 940
941 hbqno = tag >> 16;
942 new_hbq_entry = (phba->hbqs[hbqno].hbq_alloc_buffer)(phba);
914 if (new_hbq_entry == NULL) 943 if (new_hbq_entry == NULL)
915 return &hbq_entry->dbuf; 944 return &hbq_entry->dbuf;
916 new_hbq_entry->dbuf = hbq_entry->dbuf;
917 new_hbq_entry->tag = -1; 945 new_hbq_entry->tag = -1;
918 hbq_entry->dbuf.virt = lpfc_hbq_alloc(phba, 0, &hbq_entry->dbuf.phys); 946 phys = new_hbq_entry->dbuf.phys;
919 if (hbq_entry->dbuf.virt == NULL) { 947 virt = new_hbq_entry->dbuf.virt;
920 kfree(new_hbq_entry); 948 new_hbq_entry->dbuf.phys = hbq_entry->dbuf.phys;
921 return &hbq_entry->dbuf; 949 new_hbq_entry->dbuf.virt = hbq_entry->dbuf.virt;
922 } 950 hbq_entry->dbuf.phys = phys;
951 hbq_entry->dbuf.virt = virt;
923 lpfc_sli_free_hbq(phba, hbq_entry); 952 lpfc_sli_free_hbq(phba, hbq_entry);
924 return &new_hbq_entry->dbuf; 953 return &new_hbq_entry->dbuf;
925} 954}
@@ -965,7 +994,7 @@ lpfc_sli_process_unsol_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
965 irsp->un.ulpWord[3]); 994 irsp->un.ulpWord[3]);
966 if (irsp->ulpBdeCount == 2) 995 if (irsp->ulpBdeCount == 2)
967 saveq->context3 = lpfc_sli_replace_hbqbuff(phba, 996 saveq->context3 = lpfc_sli_replace_hbqbuff(phba,
968 irsp->un.ulpWord[15]); 997 irsp->unsli3.sli3Words[7]);
969 } 998 }
970 999
971 /* unSolicited Responses */ 1000 /* unSolicited Responses */
@@ -996,12 +1025,9 @@ lpfc_sli_process_unsol_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
996 /* Ring <ringno> handler: unexpected 1025 /* Ring <ringno> handler: unexpected
997 Rctl <Rctl> Type <Type> received */ 1026 Rctl <Rctl> Type <Type> received */
998 lpfc_printf_log(phba, KERN_WARNING, LOG_SLI, 1027 lpfc_printf_log(phba, KERN_WARNING, LOG_SLI,
999 "%d:0313 Ring %d handler: unexpected Rctl x%x " 1028 "0313 Ring %d handler: unexpected Rctl x%x "
1000 "Type x%x received\n", 1029 "Type x%x received\n",
1001 phba->brd_no, 1030 pring->ringno, Rctl, Type);
1002 pring->ringno,
1003 Rctl,
1004 Type);
1005 } 1031 }
1006 return 1; 1032 return 1;
1007} 1033}
@@ -1024,10 +1050,9 @@ lpfc_sli_iocbq_lookup(struct lpfc_hba *phba,
1024 } 1050 }
1025 1051
1026 lpfc_printf_log(phba, KERN_ERR, LOG_SLI, 1052 lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
1027 "%d:0317 iotag x%x is out off " 1053 "0317 iotag x%x is out off "
1028 "range: max iotag x%x wd0 x%x\n", 1054 "range: max iotag x%x wd0 x%x\n",
1029 phba->brd_no, iotag, 1055 iotag, phba->sli.last_iotag,
1030 phba->sli.last_iotag,
1031 *(((uint32_t *) &prspiocb->iocb) + 7)); 1056 *(((uint32_t *) &prspiocb->iocb) + 7));
1032 return NULL; 1057 return NULL;
1033} 1058}
@@ -1075,18 +1100,16 @@ lpfc_sli_process_sol_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
1075 * Ring <ringno> handler: unexpected completion IoTag 1100 * Ring <ringno> handler: unexpected completion IoTag
1076 * <IoTag> 1101 * <IoTag>
1077 */ 1102 */
1078 lpfc_printf_log(phba, KERN_WARNING, LOG_SLI, 1103 lpfc_printf_vlog(cmdiocbp->vport, KERN_WARNING, LOG_SLI,
1079 "%d (%d):0322 Ring %d handler: " 1104 "0322 Ring %d handler: "
1080 "unexpected completion IoTag x%x " 1105 "unexpected completion IoTag x%x "
1081 "Data: x%x x%x x%x x%x\n", 1106 "Data: x%x x%x x%x x%x\n",
1082 phba->brd_no, 1107 pring->ringno,
1083 cmdiocbp->vport->vpi, 1108 saveq->iocb.ulpIoTag,
1084 pring->ringno, 1109 saveq->iocb.ulpStatus,
1085 saveq->iocb.ulpIoTag, 1110 saveq->iocb.un.ulpWord[4],
1086 saveq->iocb.ulpStatus, 1111 saveq->iocb.ulpCommand,
1087 saveq->iocb.un.ulpWord[4], 1112 saveq->iocb.ulpContext);
1088 saveq->iocb.ulpCommand,
1089 saveq->iocb.ulpContext);
1090 } 1113 }
1091 } 1114 }
1092 1115
@@ -1104,10 +1127,9 @@ lpfc_sli_rsp_pointers_error(struct lpfc_hba *phba, struct lpfc_sli_ring *pring)
1104 * rsp ring <portRspMax> 1127 * rsp ring <portRspMax>
1105 */ 1128 */
1106 lpfc_printf_log(phba, KERN_ERR, LOG_SLI, 1129 lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
1107 "%d:0312 Ring %d handler: portRspPut %d " 1130 "0312 Ring %d handler: portRspPut %d "
1108 "is bigger then rsp ring %d\n", 1131 "is bigger then rsp ring %d\n",
1109 phba->brd_no, pring->ringno, 1132 pring->ringno, le32_to_cpu(pgp->rspPutInx),
1110 le32_to_cpu(pgp->rspPutInx),
1111 pring->numRiocb); 1133 pring->numRiocb);
1112 1134
1113 phba->link_state = LPFC_HBA_ERROR; 1135 phba->link_state = LPFC_HBA_ERROR;
@@ -1177,9 +1199,9 @@ void lpfc_sli_poll_fcp_ring(struct lpfc_hba *phba)
1177 if (unlikely(irsp->ulpStatus)) { 1199 if (unlikely(irsp->ulpStatus)) {
1178 /* Rsp ring <ringno> error: IOCB */ 1200 /* Rsp ring <ringno> error: IOCB */
1179 lpfc_printf_log(phba, KERN_WARNING, LOG_SLI, 1201 lpfc_printf_log(phba, KERN_WARNING, LOG_SLI,
1180 "%d:0326 Rsp Ring %d error: IOCB Data: " 1202 "0326 Rsp Ring %d error: IOCB Data: "
1181 "x%x x%x x%x x%x x%x x%x x%x x%x\n", 1203 "x%x x%x x%x x%x x%x x%x x%x x%x\n",
1182 phba->brd_no, pring->ringno, 1204 pring->ringno,
1183 irsp->un.ulpWord[0], 1205 irsp->un.ulpWord[0],
1184 irsp->un.ulpWord[1], 1206 irsp->un.ulpWord[1],
1185 irsp->un.ulpWord[2], 1207 irsp->un.ulpWord[2],
@@ -1199,9 +1221,9 @@ void lpfc_sli_poll_fcp_ring(struct lpfc_hba *phba)
1199 */ 1221 */
1200 if (unlikely(irsp->ulpCommand == CMD_XRI_ABORTED_CX)) { 1222 if (unlikely(irsp->ulpCommand == CMD_XRI_ABORTED_CX)) {
1201 lpfc_printf_log(phba, KERN_INFO, LOG_SLI, 1223 lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
1202 "%d:0314 IOCB cmd 0x%x" 1224 "0314 IOCB cmd 0x%x "
1203 " processed. Skipping" 1225 "processed. Skipping "
1204 " completion", phba->brd_no, 1226 "completion",
1205 irsp->ulpCommand); 1227 irsp->ulpCommand);
1206 break; 1228 break;
1207 } 1229 }
@@ -1226,10 +1248,9 @@ void lpfc_sli_poll_fcp_ring(struct lpfc_hba *phba)
1226 } else { 1248 } else {
1227 /* Unknown IOCB command */ 1249 /* Unknown IOCB command */
1228 lpfc_printf_log(phba, KERN_ERR, LOG_SLI, 1250 lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
1229 "%d:0321 Unknown IOCB command " 1251 "0321 Unknown IOCB command "
1230 "Data: x%x, x%x x%x x%x x%x\n", 1252 "Data: x%x, x%x x%x x%x x%x\n",
1231 phba->brd_no, type, 1253 type, irsp->ulpCommand,
1232 irsp->ulpCommand,
1233 irsp->ulpStatus, 1254 irsp->ulpStatus,
1234 irsp->ulpIoTag, 1255 irsp->ulpIoTag,
1235 irsp->ulpContext); 1256 irsp->ulpContext);
@@ -1353,9 +1374,9 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba *phba,
1353 1374
1354 /* Rsp ring <ringno> error: IOCB */ 1375 /* Rsp ring <ringno> error: IOCB */
1355 lpfc_printf_log(phba, KERN_WARNING, LOG_SLI, 1376 lpfc_printf_log(phba, KERN_WARNING, LOG_SLI,
1356 "%d:0336 Rsp Ring %d error: IOCB Data: " 1377 "0336 Rsp Ring %d error: IOCB Data: "
1357 "x%x x%x x%x x%x x%x x%x x%x x%x\n", 1378 "x%x x%x x%x x%x x%x x%x x%x x%x\n",
1358 phba->brd_no, pring->ringno, 1379 pring->ringno,
1359 irsp->un.ulpWord[0], 1380 irsp->un.ulpWord[0],
1360 irsp->un.ulpWord[1], 1381 irsp->un.ulpWord[1],
1361 irsp->un.ulpWord[2], 1382 irsp->un.ulpWord[2],
@@ -1375,10 +1396,9 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba *phba,
1375 */ 1396 */
1376 if (unlikely(irsp->ulpCommand == CMD_XRI_ABORTED_CX)) { 1397 if (unlikely(irsp->ulpCommand == CMD_XRI_ABORTED_CX)) {
1377 lpfc_printf_log(phba, KERN_INFO, LOG_SLI, 1398 lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
1378 "%d:0333 IOCB cmd 0x%x" 1399 "0333 IOCB cmd 0x%x"
1379 " processed. Skipping" 1400 " processed. Skipping"
1380 " completion\n", 1401 " completion\n",
1381 phba->brd_no,
1382 irsp->ulpCommand); 1402 irsp->ulpCommand);
1383 break; 1403 break;
1384 } 1404 }
@@ -1415,10 +1435,9 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba *phba,
1415 } else { 1435 } else {
1416 /* Unknown IOCB command */ 1436 /* Unknown IOCB command */
1417 lpfc_printf_log(phba, KERN_ERR, LOG_SLI, 1437 lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
1418 "%d:0334 Unknown IOCB command " 1438 "0334 Unknown IOCB command "
1419 "Data: x%x, x%x x%x x%x x%x\n", 1439 "Data: x%x, x%x x%x x%x x%x\n",
1420 phba->brd_no, type, 1440 type, irsp->ulpCommand,
1421 irsp->ulpCommand,
1422 irsp->ulpStatus, 1441 irsp->ulpStatus,
1423 irsp->ulpIoTag, 1442 irsp->ulpIoTag,
1424 irsp->ulpContext); 1443 irsp->ulpContext);
@@ -1496,10 +1515,9 @@ lpfc_sli_handle_slow_ring_event(struct lpfc_hba *phba,
1496 * rsp ring <portRspMax> 1515 * rsp ring <portRspMax>
1497 */ 1516 */
1498 lpfc_printf_log(phba, KERN_ERR, LOG_SLI, 1517 lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
1499 "%d:0303 Ring %d handler: portRspPut %d " 1518 "0303 Ring %d handler: portRspPut %d "
1500 "is bigger then rsp ring %d\n", 1519 "is bigger then rsp ring %d\n",
1501 phba->brd_no, pring->ringno, portRspPut, 1520 pring->ringno, portRspPut, portRspMax);
1502 portRspMax);
1503 1521
1504 phba->link_state = LPFC_HBA_ERROR; 1522 phba->link_state = LPFC_HBA_ERROR;
1505 spin_unlock_irqrestore(&phba->hbalock, iflag); 1523 spin_unlock_irqrestore(&phba->hbalock, iflag);
@@ -1542,6 +1560,14 @@ lpfc_sli_handle_slow_ring_event(struct lpfc_hba *phba,
1542 if (++pring->rspidx >= portRspMax) 1560 if (++pring->rspidx >= portRspMax)
1543 pring->rspidx = 0; 1561 pring->rspidx = 0;
1544 1562
1563 if (pring->ringno == LPFC_ELS_RING) {
1564 lpfc_debugfs_slow_ring_trc(phba,
1565 "IOCB rsp ring: wd4:x%08x wd6:x%08x wd7:x%08x",
1566 *(((uint32_t *) irsp) + 4),
1567 *(((uint32_t *) irsp) + 6),
1568 *(((uint32_t *) irsp) + 7));
1569 }
1570
1545 writel(pring->rspidx, &phba->host_gp[pring->ringno].rspGetInx); 1571 writel(pring->rspidx, &phba->host_gp[pring->ringno].rspGetInx);
1546 1572
1547 if (list_empty(&(pring->iocb_continueq))) { 1573 if (list_empty(&(pring->iocb_continueq))) {
@@ -1580,13 +1606,12 @@ lpfc_sli_handle_slow_ring_event(struct lpfc_hba *phba,
1580 if (irsp->ulpStatus) { 1606 if (irsp->ulpStatus) {
1581 /* Rsp ring <ringno> error: IOCB */ 1607 /* Rsp ring <ringno> error: IOCB */
1582 lpfc_printf_log(phba, KERN_WARNING, LOG_SLI, 1608 lpfc_printf_log(phba, KERN_WARNING, LOG_SLI,
1583 "%d:0328 Rsp Ring %d error: " 1609 "0328 Rsp Ring %d error: "
1584 "IOCB Data: " 1610 "IOCB Data: "
1585 "x%x x%x x%x x%x " 1611 "x%x x%x x%x x%x "
1586 "x%x x%x x%x x%x " 1612 "x%x x%x x%x x%x "
1587 "x%x x%x x%x x%x " 1613 "x%x x%x x%x x%x "
1588 "x%x x%x x%x x%x\n", 1614 "x%x x%x x%x x%x\n",
1589 phba->brd_no,
1590 pring->ringno, 1615 pring->ringno,
1591 irsp->un.ulpWord[0], 1616 irsp->un.ulpWord[0],
1592 irsp->un.ulpWord[1], 1617 irsp->un.ulpWord[1],
@@ -1661,10 +1686,9 @@ lpfc_sli_handle_slow_ring_event(struct lpfc_hba *phba,
1661 } else { 1686 } else {
1662 /* Unknown IOCB command */ 1687 /* Unknown IOCB command */
1663 lpfc_printf_log(phba, KERN_ERR, LOG_SLI, 1688 lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
1664 "%d:0335 Unknown IOCB " 1689 "0335 Unknown IOCB "
1665 "command Data: x%x " 1690 "command Data: x%x "
1666 "x%x x%x x%x\n", 1691 "x%x x%x x%x\n",
1667 phba->brd_no,
1668 irsp->ulpCommand, 1692 irsp->ulpCommand,
1669 irsp->ulpStatus, 1693 irsp->ulpStatus,
1670 irsp->ulpIoTag, 1694 irsp->ulpIoTag,
@@ -1892,8 +1916,8 @@ lpfc_sli_brdkill(struct lpfc_hba *phba)
1892 1916
1893 /* Kill HBA */ 1917 /* Kill HBA */
1894 lpfc_printf_log(phba, KERN_INFO, LOG_SLI, 1918 lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
1895 "%d:0329 Kill HBA Data: x%x x%x\n", 1919 "0329 Kill HBA Data: x%x x%x\n",
1896 phba->brd_no, phba->pport->port_state, psli->sli_flag); 1920 phba->pport->port_state, psli->sli_flag);
1897 1921
1898 if ((pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, 1922 if ((pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool,
1899 GFP_KERNEL)) == 0) 1923 GFP_KERNEL)) == 0)
@@ -1966,7 +1990,7 @@ lpfc_sli_brdreset(struct lpfc_hba *phba)
1966 1990
1967 /* Reset HBA */ 1991 /* Reset HBA */
1968 lpfc_printf_log(phba, KERN_INFO, LOG_SLI, 1992 lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
1969 "%d:0325 Reset HBA Data: x%x x%x\n", phba->brd_no, 1993 "0325 Reset HBA Data: x%x x%x\n",
1970 phba->pport->port_state, psli->sli_flag); 1994 phba->pport->port_state, psli->sli_flag);
1971 1995
1972 /* perform board reset */ 1996 /* perform board reset */
@@ -2021,7 +2045,7 @@ lpfc_sli_brdrestart(struct lpfc_hba *phba)
2021 2045
2022 /* Restart HBA */ 2046 /* Restart HBA */
2023 lpfc_printf_log(phba, KERN_INFO, LOG_SLI, 2047 lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
2024 "%d:0337 Restart HBA Data: x%x x%x\n", phba->brd_no, 2048 "0337 Restart HBA Data: x%x x%x\n",
2025 phba->pport->port_state, psli->sli_flag); 2049 phba->pport->port_state, psli->sli_flag);
2026 2050
2027 word0 = 0; 2051 word0 = 0;
@@ -2086,9 +2110,8 @@ lpfc_sli_chipset_init(struct lpfc_hba *phba)
2086 /* Adapter failed to init, timeout, status reg 2110 /* Adapter failed to init, timeout, status reg
2087 <status> */ 2111 <status> */
2088 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 2112 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
2089 "%d:0436 Adapter failed to init, " 2113 "0436 Adapter failed to init, "
2090 "timeout, status reg x%x\n", 2114 "timeout, status reg x%x\n", status);
2091 phba->brd_no, status);
2092 phba->link_state = LPFC_HBA_ERROR; 2115 phba->link_state = LPFC_HBA_ERROR;
2093 return -ETIMEDOUT; 2116 return -ETIMEDOUT;
2094 } 2117 }
@@ -2099,10 +2122,8 @@ lpfc_sli_chipset_init(struct lpfc_hba *phba)
2099 /* Adapter failed to init, chipset, status reg 2122 /* Adapter failed to init, chipset, status reg
2100 <status> */ 2123 <status> */
2101 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 2124 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
2102 "%d:0437 Adapter failed to init, " 2125 "0437 Adapter failed to init, "
2103 "chipset, status reg x%x\n", 2126 "chipset, status reg x%x\n", status);
2104 phba->brd_no,
2105 status);
2106 phba->link_state = LPFC_HBA_ERROR; 2127 phba->link_state = LPFC_HBA_ERROR;
2107 return -EIO; 2128 return -EIO;
2108 } 2129 }
@@ -2129,10 +2150,8 @@ lpfc_sli_chipset_init(struct lpfc_hba *phba)
2129 /* ERROR: During chipset initialization */ 2150 /* ERROR: During chipset initialization */
2130 /* Adapter failed to init, chipset, status reg <status> */ 2151 /* Adapter failed to init, chipset, status reg <status> */
2131 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 2152 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
2132 "%d:0438 Adapter failed to init, chipset, " 2153 "0438 Adapter failed to init, chipset, "
2133 "status reg x%x\n", 2154 "status reg x%x\n", status);
2134 phba->brd_no,
2135 status);
2136 phba->link_state = LPFC_HBA_ERROR; 2155 phba->link_state = LPFC_HBA_ERROR;
2137 return -EIO; 2156 return -EIO;
2138 } 2157 }
@@ -2147,7 +2166,7 @@ lpfc_sli_chipset_init(struct lpfc_hba *phba)
2147 return 0; 2166 return 0;
2148} 2167}
2149 2168
2150static int 2169int
2151lpfc_sli_hbq_count(void) 2170lpfc_sli_hbq_count(void)
2152{ 2171{
2153 return ARRAY_SIZE(lpfc_hbq_defs); 2172 return ARRAY_SIZE(lpfc_hbq_defs);
@@ -2200,8 +2219,8 @@ lpfc_sli_hbq_setup(struct lpfc_hba *phba)
2200 phba->hbqs[hbqno].local_hbqGetIdx = 0; 2219 phba->hbqs[hbqno].local_hbqGetIdx = 0;
2201 phba->hbqs[hbqno].entry_count = 2220 phba->hbqs[hbqno].entry_count =
2202 lpfc_hbq_defs[hbqno]->entry_count; 2221 lpfc_hbq_defs[hbqno]->entry_count;
2203 lpfc_config_hbq(phba, lpfc_hbq_defs[hbqno], hbq_entry_index, 2222 lpfc_config_hbq(phba, hbqno, lpfc_hbq_defs[hbqno],
2204 pmb); 2223 hbq_entry_index, pmb);
2205 hbq_entry_index += phba->hbqs[hbqno].entry_count; 2224 hbq_entry_index += phba->hbqs[hbqno].entry_count;
2206 2225
2207 if (lpfc_sli_issue_mbox(phba, pmb, MBX_POLL) != MBX_SUCCESS) { 2226 if (lpfc_sli_issue_mbox(phba, pmb, MBX_POLL) != MBX_SUCCESS) {
@@ -2210,9 +2229,9 @@ lpfc_sli_hbq_setup(struct lpfc_hba *phba)
2210 2229
2211 lpfc_printf_log(phba, KERN_ERR, 2230 lpfc_printf_log(phba, KERN_ERR,
2212 LOG_SLI | LOG_VPORT, 2231 LOG_SLI | LOG_VPORT,
2213 "%d:1805 Adapter failed to init. " 2232 "1805 Adapter failed to init. "
2214 "Data: x%x x%x x%x\n", 2233 "Data: x%x x%x x%x\n",
2215 phba->brd_no, pmbox->mbxCommand, 2234 pmbox->mbxCommand,
2216 pmbox->mbxStatus, hbqno); 2235 pmbox->mbxStatus, hbqno);
2217 2236
2218 phba->link_state = LPFC_HBA_ERROR; 2237 phba->link_state = LPFC_HBA_ERROR;
@@ -2279,10 +2298,9 @@ lpfc_do_config_port(struct lpfc_hba *phba, int sli_mode)
2279 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL); 2298 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL);
2280 if (rc != MBX_SUCCESS) { 2299 if (rc != MBX_SUCCESS) {
2281 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 2300 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
2282 "%d:0442 Adapter failed to init, mbxCmd x%x " 2301 "0442 Adapter failed to init, mbxCmd x%x "
2283 "CONFIG_PORT, mbxStatus x%x Data: x%x\n", 2302 "CONFIG_PORT, mbxStatus x%x Data: x%x\n",
2284 phba->brd_no, pmb->mb.mbxCommand, 2303 pmb->mb.mbxCommand, pmb->mb.mbxStatus, 0);
2285 pmb->mb.mbxStatus, 0);
2286 spin_lock_irq(&phba->hbalock); 2304 spin_lock_irq(&phba->hbalock);
2287 phba->sli.sli_flag &= ~LPFC_SLI2_ACTIVE; 2305 phba->sli.sli_flag &= ~LPFC_SLI2_ACTIVE;
2288 spin_unlock_irq(&phba->hbalock); 2306 spin_unlock_irq(&phba->hbalock);
@@ -2321,11 +2339,11 @@ lpfc_sli_hba_setup(struct lpfc_hba *phba)
2321 2339
2322 switch (lpfc_sli_mode) { 2340 switch (lpfc_sli_mode) {
2323 case 2: 2341 case 2:
2324 if (phba->cfg_npiv_enable) { 2342 if (phba->cfg_enable_npiv) {
2325 lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_VPORT, 2343 lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_VPORT,
2326 "%d:1824 NPIV enabled: Override lpfc_sli_mode " 2344 "1824 NPIV enabled: Override lpfc_sli_mode "
2327 "parameter (%d) to auto (0).\n", 2345 "parameter (%d) to auto (0).\n",
2328 phba->brd_no, lpfc_sli_mode); 2346 lpfc_sli_mode);
2329 break; 2347 break;
2330 } 2348 }
2331 mode = 2; 2349 mode = 2;
@@ -2335,9 +2353,8 @@ lpfc_sli_hba_setup(struct lpfc_hba *phba)
2335 break; 2353 break;
2336 default: 2354 default:
2337 lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_VPORT, 2355 lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_VPORT,
2338 "%d:1819 Unrecognized lpfc_sli_mode " 2356 "1819 Unrecognized lpfc_sli_mode "
2339 "parameter: %d.\n", 2357 "parameter: %d.\n", lpfc_sli_mode);
2340 phba->brd_no, lpfc_sli_mode);
2341 2358
2342 break; 2359 break;
2343 } 2360 }
@@ -2345,9 +2362,8 @@ lpfc_sli_hba_setup(struct lpfc_hba *phba)
2345 rc = lpfc_do_config_port(phba, mode); 2362 rc = lpfc_do_config_port(phba, mode);
2346 if (rc && lpfc_sli_mode == 3) 2363 if (rc && lpfc_sli_mode == 3)
2347 lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_VPORT, 2364 lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_VPORT,
2348 "%d:1820 Unable to select SLI-3. " 2365 "1820 Unable to select SLI-3. "
2349 "Not supported by adapter.\n", 2366 "Not supported by adapter.\n");
2350 phba->brd_no);
2351 if (rc && mode != 2) 2367 if (rc && mode != 2)
2352 rc = lpfc_do_config_port(phba, 2); 2368 rc = lpfc_do_config_port(phba, 2);
2353 if (rc) 2369 if (rc)
@@ -2366,8 +2382,8 @@ lpfc_sli_hba_setup(struct lpfc_hba *phba)
2366 } 2382 }
2367 2383
2368 lpfc_printf_log(phba, KERN_INFO, LOG_INIT, 2384 lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
2369 "%d:0444 Firmware in SLI %x mode. Max_vpi %d\n", 2385 "0444 Firmware in SLI %x mode. Max_vpi %d\n",
2370 phba->brd_no, phba->sli_rev, phba->max_vpi); 2386 phba->sli_rev, phba->max_vpi);
2371 rc = lpfc_sli_ring_map(phba); 2387 rc = lpfc_sli_ring_map(phba);
2372 2388
2373 if (rc) 2389 if (rc)
@@ -2392,8 +2408,7 @@ lpfc_sli_hba_setup(struct lpfc_hba *phba)
2392lpfc_sli_hba_setup_error: 2408lpfc_sli_hba_setup_error:
2393 phba->link_state = LPFC_HBA_ERROR; 2409 phba->link_state = LPFC_HBA_ERROR;
2394 lpfc_printf_log(phba, KERN_INFO, LOG_INIT, 2410 lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
2395 "%d:0445 Firmware initialization failed\n", 2411 "0445 Firmware initialization failed\n");
2396 phba->brd_no);
2397 return rc; 2412 return rc;
2398} 2413}
2399 2414
@@ -2445,9 +2460,7 @@ lpfc_mbox_timeout_handler(struct lpfc_hba *phba)
2445 2460
2446 /* Mbox cmd <mbxCommand> timeout */ 2461 /* Mbox cmd <mbxCommand> timeout */
2447 lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, 2462 lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
2448 "%d:0310 Mailbox command x%x timeout Data: x%x x%x " 2463 "0310 Mailbox command x%x timeout Data: x%x x%x x%p\n",
2449 "x%p\n",
2450 phba->brd_no,
2451 mb->mbxCommand, 2464 mb->mbxCommand,
2452 phba->pport->port_state, 2465 phba->pport->port_state,
2453 phba->sli.sli_flag, 2466 phba->sli.sli_flag,
@@ -2470,8 +2483,7 @@ lpfc_mbox_timeout_handler(struct lpfc_hba *phba)
2470 lpfc_sli_abort_iocb_ring(phba, pring); 2483 lpfc_sli_abort_iocb_ring(phba, pring);
2471 2484
2472 lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, 2485 lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
2473 "%d:0316 Resetting board due to mailbox timeout\n", 2486 "0316 Resetting board due to mailbox timeout\n");
2474 phba->brd_no);
2475 /* 2487 /*
2476 * lpfc_offline calls lpfc_sli_hba_down which will clean up 2488 * lpfc_offline calls lpfc_sli_hba_down which will clean up
2477 * on oustanding mailbox commands. 2489 * on oustanding mailbox commands.
@@ -2502,8 +2514,7 @@ lpfc_sli_issue_mbox(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, uint32_t flag)
2502 if(!pmbox->vport) { 2514 if(!pmbox->vport) {
2503 lpfc_printf_log(phba, KERN_ERR, 2515 lpfc_printf_log(phba, KERN_ERR,
2504 LOG_MBOX | LOG_VPORT, 2516 LOG_MBOX | LOG_VPORT,
2505 "%d:1806 Mbox x%x failed. No vport\n", 2517 "1806 Mbox x%x failed. No vport\n",
2506 phba->brd_no,
2507 pmbox->mb.mbxCommand); 2518 pmbox->mb.mbxCommand);
2508 dump_stack(); 2519 dump_stack();
2509 return MBXERR_ERROR; 2520 return MBXERR_ERROR;
@@ -2580,9 +2591,8 @@ lpfc_sli_issue_mbox(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, uint32_t flag)
2580 2591
2581 /* Mbox cmd issue - BUSY */ 2592 /* Mbox cmd issue - BUSY */
2582 lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, 2593 lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI,
2583 "%d (%d):0308 Mbox cmd issue - BUSY Data: " 2594 "(%d):0308 Mbox cmd issue - BUSY Data: "
2584 "x%x x%x x%x x%x\n", 2595 "x%x x%x x%x x%x\n",
2585 phba->brd_no,
2586 pmbox->vport ? pmbox->vport->vpi : 0xffffff, 2596 pmbox->vport ? pmbox->vport->vpi : 0xffffff,
2587 mb->mbxCommand, phba->pport->port_state, 2597 mb->mbxCommand, phba->pport->port_state,
2588 psli->sli_flag, flag); 2598 psli->sli_flag, flag);
@@ -2644,9 +2654,9 @@ lpfc_sli_issue_mbox(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, uint32_t flag)
2644 2654
2645 /* Mailbox cmd <cmd> issue */ 2655 /* Mailbox cmd <cmd> issue */
2646 lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI, 2656 lpfc_printf_log(phba, KERN_INFO, LOG_MBOX | LOG_SLI,
2647 "%d (%d):0309 Mailbox cmd x%x issue Data: x%x x%x " 2657 "(%d):0309 Mailbox cmd x%x issue Data: x%x x%x "
2648 "x%x\n", 2658 "x%x\n",
2649 phba->brd_no, pmbox->vport ? pmbox->vport->vpi : 0, 2659 pmbox->vport ? pmbox->vport->vpi : 0,
2650 mb->mbxCommand, phba->pport->port_state, 2660 mb->mbxCommand, phba->pport->port_state,
2651 psli->sli_flag, flag); 2661 psli->sli_flag, flag);
2652 2662
@@ -2848,8 +2858,7 @@ __lpfc_sli_issue_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
2848 (piocb->iocb.ulpCommand != CMD_CLOSE_XRI_CN)) { 2858 (piocb->iocb.ulpCommand != CMD_CLOSE_XRI_CN)) {
2849 lpfc_printf_log(phba, KERN_ERR, 2859 lpfc_printf_log(phba, KERN_ERR,
2850 LOG_SLI | LOG_VPORT, 2860 LOG_SLI | LOG_VPORT,
2851 "%d:1807 IOCB x%x failed. No vport\n", 2861 "1807 IOCB x%x failed. No vport\n",
2852 phba->brd_no,
2853 piocb->iocb.ulpCommand); 2862 piocb->iocb.ulpCommand);
2854 dump_stack(); 2863 dump_stack();
2855 return IOCB_ERROR; 2864 return IOCB_ERROR;
@@ -3080,11 +3089,10 @@ lpfc_sli_setup(struct lpfc_hba *phba)
3080 } 3089 }
3081 if (totiocbsize > MAX_SLIM_IOCB_SIZE) { 3090 if (totiocbsize > MAX_SLIM_IOCB_SIZE) {
3082 /* Too many cmd / rsp ring entries in SLI2 SLIM */ 3091 /* Too many cmd / rsp ring entries in SLI2 SLIM */
3083 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 3092 printk(KERN_ERR "%d:0462 Too many cmd / rsp ring entries in "
3084 "%d:0462 Too many cmd / rsp ring entries in " 3093 "SLI2 SLIM Data: x%x x%lx\n",
3085 "SLI2 SLIM Data: x%x x%lx\n", 3094 phba->brd_no, totiocbsize,
3086 phba->brd_no, totiocbsize, 3095 (unsigned long) MAX_SLIM_IOCB_SIZE);
3087 (unsigned long) MAX_SLIM_IOCB_SIZE);
3088 } 3096 }
3089 if (phba->cfg_multi_ring_support == 2) 3097 if (phba->cfg_multi_ring_support == 2)
3090 lpfc_extra_ring_setup(phba); 3098 lpfc_extra_ring_setup(phba);
@@ -3305,9 +3313,9 @@ lpfc_sli_ringpostbuf_get(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
3305 3313
3306 spin_unlock_irq(&phba->hbalock); 3314 spin_unlock_irq(&phba->hbalock);
3307 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 3315 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
3308 "%d:0410 Cannot find virtual addr for mapped buf on " 3316 "0410 Cannot find virtual addr for mapped buf on "
3309 "ring %d Data x%llx x%p x%p x%x\n", 3317 "ring %d Data x%llx x%p x%p x%x\n",
3310 phba->brd_no, pring->ringno, (unsigned long long)phys, 3318 pring->ringno, (unsigned long long)phys,
3311 slp->next, slp->prev, pring->postbufq_cnt); 3319 slp->next, slp->prev, pring->postbufq_cnt);
3312 return NULL; 3320 return NULL;
3313} 3321}
@@ -3332,12 +3340,11 @@ lpfc_sli_abort_els_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
3332 abort_iocb = phba->sli.iocbq_lookup[abort_iotag]; 3340 abort_iocb = phba->sli.iocbq_lookup[abort_iotag];
3333 3341
3334 lpfc_printf_log(phba, KERN_INFO, LOG_ELS | LOG_SLI, 3342 lpfc_printf_log(phba, KERN_INFO, LOG_ELS | LOG_SLI,
3335 "%d:0327 Cannot abort els iocb %p " 3343 "0327 Cannot abort els iocb %p "
3336 "with tag %x context %x, abort status %x, " 3344 "with tag %x context %x, abort status %x, "
3337 "abort code %x\n", 3345 "abort code %x\n",
3338 phba->brd_no, abort_iocb, abort_iotag, 3346 abort_iocb, abort_iotag, abort_context,
3339 abort_context, irsp->ulpStatus, 3347 irsp->ulpStatus, irsp->un.ulpWord[4]);
3340 irsp->un.ulpWord[4]);
3341 3348
3342 /* 3349 /*
3343 * make sure we have the right iocbq before taking it 3350 * make sure we have the right iocbq before taking it
@@ -3371,9 +3378,9 @@ lpfc_ignore_els_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
3371 3378
3372 /* ELS cmd tag <ulpIoTag> completes */ 3379 /* ELS cmd tag <ulpIoTag> completes */
3373 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 3380 lpfc_printf_log(phba, KERN_INFO, LOG_ELS,
3374 "%d (X):0133 Ignoring ELS cmd tag x%x completion Data: " 3381 "0133 Ignoring ELS cmd tag x%x completion Data: "
3375 "x%x x%x x%x\n", 3382 "x%x x%x x%x\n",
3376 phba->brd_no, irsp->ulpIoTag, irsp->ulpStatus, 3383 irsp->ulpIoTag, irsp->ulpStatus,
3377 irsp->un.ulpWord[4], irsp->ulpTimeout); 3384 irsp->un.ulpWord[4], irsp->ulpTimeout);
3378 if (cmdiocb->iocb.ulpCommand == CMD_GEN_REQUEST64_CR) 3385 if (cmdiocb->iocb.ulpCommand == CMD_GEN_REQUEST64_CR)
3379 lpfc_ct_free_iocb(phba, cmdiocb); 3386 lpfc_ct_free_iocb(phba, cmdiocb);
@@ -3439,12 +3446,11 @@ lpfc_sli_issue_abort_iotag(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
3439 3446
3440 abtsiocbp->iocb_cmpl = lpfc_sli_abort_els_cmpl; 3447 abtsiocbp->iocb_cmpl = lpfc_sli_abort_els_cmpl;
3441 3448
3442 lpfc_printf_log(phba, KERN_INFO, LOG_SLI, 3449 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI,
3443 "%d (%d):0339 Abort xri x%x, original iotag x%x, " 3450 "0339 Abort xri x%x, original iotag x%x, "
3444 "abort cmd iotag x%x\n", 3451 "abort cmd iotag x%x\n",
3445 phba->brd_no, vport->vpi, 3452 iabt->un.acxri.abortContextTag,
3446 iabt->un.acxri.abortContextTag, 3453 iabt->un.acxri.abortIoTag, abtsiocbp->iotag);
3447 iabt->un.acxri.abortIoTag, abtsiocbp->iotag);
3448 retval = __lpfc_sli_issue_iocb(phba, pring, abtsiocbp, 0); 3454 retval = __lpfc_sli_issue_iocb(phba, pring, abtsiocbp, 0);
3449 3455
3450abort_iotag_exit: 3456abort_iotag_exit:
@@ -3457,8 +3463,8 @@ abort_iotag_exit:
3457} 3463}
3458 3464
3459static int 3465static int
3460lpfc_sli_validate_fcp_iocb(struct lpfc_iocbq *iocbq, uint16_t tgt_id, 3466lpfc_sli_validate_fcp_iocb(struct lpfc_iocbq *iocbq, struct lpfc_vport *vport,
3461 uint64_t lun_id, uint32_t ctx, 3467 uint16_t tgt_id, uint64_t lun_id,
3462 lpfc_ctx_cmd ctx_cmd) 3468 lpfc_ctx_cmd ctx_cmd)
3463{ 3469{
3464 struct lpfc_scsi_buf *lpfc_cmd; 3470 struct lpfc_scsi_buf *lpfc_cmd;
@@ -3468,6 +3474,9 @@ lpfc_sli_validate_fcp_iocb(struct lpfc_iocbq *iocbq, uint16_t tgt_id,
3468 if (!(iocbq->iocb_flag & LPFC_IO_FCP)) 3474 if (!(iocbq->iocb_flag & LPFC_IO_FCP))
3469 return rc; 3475 return rc;
3470 3476
3477 if (iocbq->vport != vport)
3478 return rc;
3479
3471 lpfc_cmd = container_of(iocbq, struct lpfc_scsi_buf, cur_iocbq); 3480 lpfc_cmd = container_of(iocbq, struct lpfc_scsi_buf, cur_iocbq);
3472 cmnd = lpfc_cmd->pCmd; 3481 cmnd = lpfc_cmd->pCmd;
3473 3482
@@ -3484,10 +3493,6 @@ lpfc_sli_validate_fcp_iocb(struct lpfc_iocbq *iocbq, uint16_t tgt_id,
3484 if (cmnd->device->id == tgt_id) 3493 if (cmnd->device->id == tgt_id)
3485 rc = 0; 3494 rc = 0;
3486 break; 3495 break;
3487 case LPFC_CTX_CTX:
3488 if (iocbq->iocb.ulpContext == ctx)
3489 rc = 0;
3490 break;
3491 case LPFC_CTX_HOST: 3496 case LPFC_CTX_HOST:
3492 rc = 0; 3497 rc = 0;
3493 break; 3498 break;
@@ -3501,17 +3506,18 @@ lpfc_sli_validate_fcp_iocb(struct lpfc_iocbq *iocbq, uint16_t tgt_id,
3501} 3506}
3502 3507
3503int 3508int
3504lpfc_sli_sum_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, 3509lpfc_sli_sum_iocb(struct lpfc_vport *vport, uint16_t tgt_id, uint64_t lun_id,
3505 uint16_t tgt_id, uint64_t lun_id, lpfc_ctx_cmd ctx_cmd) 3510 lpfc_ctx_cmd ctx_cmd)
3506{ 3511{
3512 struct lpfc_hba *phba = vport->phba;
3507 struct lpfc_iocbq *iocbq; 3513 struct lpfc_iocbq *iocbq;
3508 int sum, i; 3514 int sum, i;
3509 3515
3510 for (i = 1, sum = 0; i <= phba->sli.last_iotag; i++) { 3516 for (i = 1, sum = 0; i <= phba->sli.last_iotag; i++) {
3511 iocbq = phba->sli.iocbq_lookup[i]; 3517 iocbq = phba->sli.iocbq_lookup[i];
3512 3518
3513 if (lpfc_sli_validate_fcp_iocb (iocbq, tgt_id, lun_id, 3519 if (lpfc_sli_validate_fcp_iocb (iocbq, vport, tgt_id, lun_id,
3514 0, ctx_cmd) == 0) 3520 ctx_cmd) == 0)
3515 sum++; 3521 sum++;
3516 } 3522 }
3517 3523
@@ -3527,10 +3533,10 @@ lpfc_sli_abort_fcp_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb,
3527} 3533}
3528 3534
3529int 3535int
3530lpfc_sli_abort_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, 3536lpfc_sli_abort_iocb(struct lpfc_vport *vport, struct lpfc_sli_ring *pring,
3531 uint16_t tgt_id, uint64_t lun_id, uint32_t ctx, 3537 uint16_t tgt_id, uint64_t lun_id, lpfc_ctx_cmd abort_cmd)
3532 lpfc_ctx_cmd abort_cmd)
3533{ 3538{
3539 struct lpfc_hba *phba = vport->phba;
3534 struct lpfc_iocbq *iocbq; 3540 struct lpfc_iocbq *iocbq;
3535 struct lpfc_iocbq *abtsiocb; 3541 struct lpfc_iocbq *abtsiocb;
3536 IOCB_t *cmd = NULL; 3542 IOCB_t *cmd = NULL;
@@ -3540,7 +3546,7 @@ lpfc_sli_abort_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
3540 for (i = 1; i <= phba->sli.last_iotag; i++) { 3546 for (i = 1; i <= phba->sli.last_iotag; i++) {
3541 iocbq = phba->sli.iocbq_lookup[i]; 3547 iocbq = phba->sli.iocbq_lookup[i];
3542 3548
3543 if (lpfc_sli_validate_fcp_iocb(iocbq, tgt_id, lun_id, 0, 3549 if (lpfc_sli_validate_fcp_iocb(iocbq, vport, tgt_id, lun_id,
3544 abort_cmd) != 0) 3550 abort_cmd) != 0)
3545 continue; 3551 continue;
3546 3552
@@ -3647,25 +3653,23 @@ lpfc_sli_issue_iocb_wait(struct lpfc_hba *phba,
3647 3653
3648 if (piocb->iocb_flag & LPFC_IO_WAKE) { 3654 if (piocb->iocb_flag & LPFC_IO_WAKE) {
3649 lpfc_printf_log(phba, KERN_INFO, LOG_SLI, 3655 lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
3650 "%d:0331 IOCB wake signaled\n", 3656 "0331 IOCB wake signaled\n");
3651 phba->brd_no);
3652 } else if (timeleft == 0) { 3657 } else if (timeleft == 0) {
3653 lpfc_printf_log(phba, KERN_ERR, LOG_SLI, 3658 lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
3654 "%d:0338 IOCB wait timeout error - no " 3659 "0338 IOCB wait timeout error - no "
3655 "wake response Data x%x\n", 3660 "wake response Data x%x\n", timeout);
3656 phba->brd_no, timeout);
3657 retval = IOCB_TIMEDOUT; 3661 retval = IOCB_TIMEDOUT;
3658 } else { 3662 } else {
3659 lpfc_printf_log(phba, KERN_ERR, LOG_SLI, 3663 lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
3660 "%d:0330 IOCB wake NOT set, " 3664 "0330 IOCB wake NOT set, "
3661 "Data x%x x%lx\n", phba->brd_no, 3665 "Data x%x x%lx\n",
3662 timeout, (timeleft / jiffies)); 3666 timeout, (timeleft / jiffies));
3663 retval = IOCB_TIMEDOUT; 3667 retval = IOCB_TIMEDOUT;
3664 } 3668 }
3665 } else { 3669 } else {
3666 lpfc_printf_log(phba, KERN_INFO, LOG_SLI, 3670 lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
3667 "%d:0332 IOCB wait issue failed, Data x%x\n", 3671 ":0332 IOCB wait issue failed, Data x%x\n",
3668 phba->brd_no, retval); 3672 retval);
3669 retval = IOCB_ERROR; 3673 retval = IOCB_ERROR;
3670 } 3674 }
3671 3675
@@ -3850,12 +3854,33 @@ lpfc_intr_handler(int irq, void *dev_id)
3850 if (status & HA_RXMASK) { 3854 if (status & HA_RXMASK) {
3851 spin_lock(&phba->hbalock); 3855 spin_lock(&phba->hbalock);
3852 control = readl(phba->HCregaddr); 3856 control = readl(phba->HCregaddr);
3857
3858 lpfc_debugfs_slow_ring_trc(phba,
3859 "ISR slow ring: ctl:x%x stat:x%x isrcnt:x%x",
3860 control, status,
3861 (uint32_t)phba->sli.slistat.sli_intr);
3862
3853 if (control & (HC_R0INT_ENA << LPFC_ELS_RING)) { 3863 if (control & (HC_R0INT_ENA << LPFC_ELS_RING)) {
3864 lpfc_debugfs_slow_ring_trc(phba,
3865 "ISR Disable ring:"
3866 "pwork:x%x hawork:x%x wait:x%x",
3867 phba->work_ha, work_ha_copy,
3868 (uint32_t)((unsigned long)
3869 phba->work_wait));
3870
3854 control &= 3871 control &=
3855 ~(HC_R0INT_ENA << LPFC_ELS_RING); 3872 ~(HC_R0INT_ENA << LPFC_ELS_RING);
3856 writel(control, phba->HCregaddr); 3873 writel(control, phba->HCregaddr);
3857 readl(phba->HCregaddr); /* flush */ 3874 readl(phba->HCregaddr); /* flush */
3858 } 3875 }
3876 else {
3877 lpfc_debugfs_slow_ring_trc(phba,
3878 "ISR slow ring: pwork:"
3879 "x%x hawork:x%x wait:x%x",
3880 phba->work_ha, work_ha_copy,
3881 (uint32_t)((unsigned long)
3882 phba->work_wait));
3883 }
3859 spin_unlock(&phba->hbalock); 3884 spin_unlock(&phba->hbalock);
3860 } 3885 }
3861 } 3886 }
@@ -3895,12 +3920,10 @@ lpfc_intr_handler(int irq, void *dev_id)
3895 */ 3920 */
3896 lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX | 3921 lpfc_printf_log(phba, KERN_WARNING, LOG_MBOX |
3897 LOG_SLI, 3922 LOG_SLI,
3898 "%d (%d):0304 Stray Mailbox " 3923 "(%d):0304 Stray Mailbox "
3899 "Interrupt mbxCommand x%x " 3924 "Interrupt mbxCommand x%x "
3900 "mbxStatus x%x\n", 3925 "mbxStatus x%x\n",
3901 phba->brd_no, 3926 (vport ? vport->vpi : 0),
3902 (vport
3903 ? vport->vpi : 0),
3904 pmbox->mbxCommand, 3927 pmbox->mbxCommand,
3905 pmbox->mbxStatus); 3928 pmbox->mbxStatus);
3906 } 3929 }
diff --git a/drivers/scsi/lpfc/lpfc_sli.h b/drivers/scsi/lpfc/lpfc_sli.h
index 76058505795e..51b2b6b949be 100644
--- a/drivers/scsi/lpfc/lpfc_sli.h
+++ b/drivers/scsi/lpfc/lpfc_sli.h
@@ -26,7 +26,6 @@ struct lpfc_vport;
26typedef enum _lpfc_ctx_cmd { 26typedef enum _lpfc_ctx_cmd {
27 LPFC_CTX_LUN, 27 LPFC_CTX_LUN,
28 LPFC_CTX_TGT, 28 LPFC_CTX_TGT,
29 LPFC_CTX_CTX,
30 LPFC_CTX_HOST 29 LPFC_CTX_HOST
31} lpfc_ctx_cmd; 30} lpfc_ctx_cmd;
32 31
@@ -54,9 +53,10 @@ struct lpfc_iocbq {
54 void *context2; /* caller context information */ 53 void *context2; /* caller context information */
55 void *context3; /* caller context information */ 54 void *context3; /* caller context information */
56 union { 55 union {
57 wait_queue_head_t *wait_queue; 56 wait_queue_head_t *wait_queue;
58 struct lpfc_iocbq *rsp_iocb; 57 struct lpfc_iocbq *rsp_iocb;
59 struct lpfcMboxq *mbox; 58 struct lpfcMboxq *mbox;
59 struct lpfc_nodelist *ndlp;
60 } context_un; 60 } context_un;
61 61
62 void (*fabric_iocb_cmpl) (struct lpfc_hba *, struct lpfc_iocbq *, 62 void (*fabric_iocb_cmpl) (struct lpfc_hba *, struct lpfc_iocbq *,
@@ -143,7 +143,7 @@ struct lpfc_sli_ring {
143 uint16_t numCiocb; /* number of command iocb's per ring */ 143 uint16_t numCiocb; /* number of command iocb's per ring */
144 uint16_t numRiocb; /* number of rsp iocb's per ring */ 144 uint16_t numRiocb; /* number of rsp iocb's per ring */
145 uint16_t sizeCiocb; /* Size of command iocb's in this ring */ 145 uint16_t sizeCiocb; /* Size of command iocb's in this ring */
146 uint16_t sizeRiocb; /* Size of response iocb's in this ring */ 146 uint16_t sizeRiocb; /* Size of response iocb's in this ring */
147 147
148 uint32_t fast_iotag; /* max fastlookup based iotag */ 148 uint32_t fast_iotag; /* max fastlookup based iotag */
149 uint32_t iotag_ctr; /* keeps track of the next iotag to use */ 149 uint32_t iotag_ctr; /* keeps track of the next iotag to use */
diff --git a/drivers/scsi/lpfc/lpfc_version.h b/drivers/scsi/lpfc/lpfc_version.h
index a5bc79eef052..0081f49286bc 100644
--- a/drivers/scsi/lpfc/lpfc_version.h
+++ b/drivers/scsi/lpfc/lpfc_version.h
@@ -18,12 +18,10 @@
18 * included with this package. * 18 * included with this package. *
19 *******************************************************************/ 19 *******************************************************************/
20 20
21#define LPFC_DRIVER_VERSION "8.2.1" 21#define LPFC_DRIVER_VERSION "8.2.2"
22 22
23#define LPFC_DRIVER_NAME "lpfc" 23#define LPFC_DRIVER_NAME "lpfc"
24 24
25#define LPFC_MODULE_DESC "Emulex LightPulse Fibre Channel SCSI driver " \ 25#define LPFC_MODULE_DESC "Emulex LightPulse Fibre Channel SCSI driver " \
26 LPFC_DRIVER_VERSION 26 LPFC_DRIVER_VERSION
27#define LPFC_COPYRIGHT "Copyright(c) 2004-2007 Emulex. All rights reserved." 27#define LPFC_COPYRIGHT "Copyright(c) 2004-2007 Emulex. All rights reserved."
28
29#define DFC_API_VERSION "0.0.0"
diff --git a/drivers/scsi/lpfc/lpfc_vport.c b/drivers/scsi/lpfc/lpfc_vport.c
index 85797dbf5478..dcb415e717c3 100644
--- a/drivers/scsi/lpfc/lpfc_vport.c
+++ b/drivers/scsi/lpfc/lpfc_vport.c
@@ -125,11 +125,10 @@ lpfc_vport_sparm(struct lpfc_hba *phba, struct lpfc_vport *vport)
125 pmb->vport = vport; 125 pmb->vport = vport;
126 rc = lpfc_sli_issue_mbox_wait(phba, pmb, phba->fc_ratov * 2); 126 rc = lpfc_sli_issue_mbox_wait(phba, pmb, phba->fc_ratov * 2);
127 if (rc != MBX_SUCCESS) { 127 if (rc != MBX_SUCCESS) {
128 lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_VPORT, 128 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT | LOG_VPORT,
129 "%d (%d):1818 VPort failed init, mbxCmd x%x " 129 "1818 VPort failed init, mbxCmd x%x "
130 "READ_SPARM mbxStatus x%x, rc = x%x\n", 130 "READ_SPARM mbxStatus x%x, rc = x%x\n",
131 phba->brd_no, vport->vpi, 131 mb->mbxCommand, mb->mbxStatus, rc);
132 mb->mbxCommand, mb->mbxStatus, rc);
133 lpfc_mbuf_free(phba, mp->virt, mp->phys); 132 lpfc_mbuf_free(phba, mp->virt, mp->phys);
134 kfree(mp); 133 kfree(mp);
135 if (rc != MBX_TIMEOUT) 134 if (rc != MBX_TIMEOUT)
@@ -162,9 +161,9 @@ lpfc_valid_wwn_format(struct lpfc_hba *phba, struct lpfc_name *wwn,
162 return 1; 161 return 1;
163 162
164 lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, 163 lpfc_printf_log(phba, KERN_ERR, LOG_VPORT,
165 "%d:1822 Invalid %s: %02x:%02x:%02x:%02x:" 164 "1822 Invalid %s: %02x:%02x:%02x:%02x:"
166 "%02x:%02x:%02x:%02x\n", 165 "%02x:%02x:%02x:%02x\n",
167 phba->brd_no, name_type, 166 name_type,
168 wwn->u.wwn[0], wwn->u.wwn[1], 167 wwn->u.wwn[0], wwn->u.wwn[1],
169 wwn->u.wwn[2], wwn->u.wwn[3], 168 wwn->u.wwn[2], wwn->u.wwn[3],
170 wwn->u.wwn[4], wwn->u.wwn[5], 169 wwn->u.wwn[4], wwn->u.wwn[5],
@@ -176,16 +175,21 @@ static int
176lpfc_unique_wwpn(struct lpfc_hba *phba, struct lpfc_vport *new_vport) 175lpfc_unique_wwpn(struct lpfc_hba *phba, struct lpfc_vport *new_vport)
177{ 176{
178 struct lpfc_vport *vport; 177 struct lpfc_vport *vport;
178 unsigned long flags;
179 179
180 spin_lock_irqsave(&phba->hbalock, flags);
180 list_for_each_entry(vport, &phba->port_list, listentry) { 181 list_for_each_entry(vport, &phba->port_list, listentry) {
181 if (vport == new_vport) 182 if (vport == new_vport)
182 continue; 183 continue;
183 /* If they match, return not unique */ 184 /* If they match, return not unique */
184 if (memcmp(&vport->fc_sparam.portName, 185 if (memcmp(&vport->fc_sparam.portName,
185 &new_vport->fc_sparam.portName, 186 &new_vport->fc_sparam.portName,
186 sizeof(struct lpfc_name)) == 0) 187 sizeof(struct lpfc_name)) == 0) {
188 spin_unlock_irqrestore(&phba->hbalock, flags);
187 return 0; 189 return 0;
190 }
188 } 191 }
192 spin_unlock_irqrestore(&phba->hbalock, flags);
189 return 1; 193 return 1;
190} 194}
191 195
@@ -193,8 +197,8 @@ int
193lpfc_vport_create(struct fc_vport *fc_vport, bool disable) 197lpfc_vport_create(struct fc_vport *fc_vport, bool disable)
194{ 198{
195 struct lpfc_nodelist *ndlp; 199 struct lpfc_nodelist *ndlp;
196 struct lpfc_vport *pport = 200 struct Scsi_Host *shost = fc_vport->shost;
197 (struct lpfc_vport *) fc_vport->shost->hostdata; 201 struct lpfc_vport *pport = (struct lpfc_vport *) shost->hostdata;
198 struct lpfc_hba *phba = pport->phba; 202 struct lpfc_hba *phba = pport->phba;
199 struct lpfc_vport *vport = NULL; 203 struct lpfc_vport *vport = NULL;
200 int instance; 204 int instance;
@@ -204,9 +208,9 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable)
204 if ((phba->sli_rev < 3) || 208 if ((phba->sli_rev < 3) ||
205 !(phba->sli3_options & LPFC_SLI3_NPIV_ENABLED)) { 209 !(phba->sli3_options & LPFC_SLI3_NPIV_ENABLED)) {
206 lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, 210 lpfc_printf_log(phba, KERN_ERR, LOG_VPORT,
207 "%d:1808 Create VPORT failed: " 211 "1808 Create VPORT failed: "
208 "NPIV is not enabled: SLImode:%d\n", 212 "NPIV is not enabled: SLImode:%d\n",
209 phba->brd_no, phba->sli_rev); 213 phba->sli_rev);
210 rc = VPORT_INVAL; 214 rc = VPORT_INVAL;
211 goto error_out; 215 goto error_out;
212 } 216 }
@@ -214,9 +218,9 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable)
214 vpi = lpfc_alloc_vpi(phba); 218 vpi = lpfc_alloc_vpi(phba);
215 if (vpi == 0) { 219 if (vpi == 0) {
216 lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, 220 lpfc_printf_log(phba, KERN_ERR, LOG_VPORT,
217 "%d:1809 Create VPORT failed: " 221 "1809 Create VPORT failed: "
218 "Max VPORTs (%d) exceeded\n", 222 "Max VPORTs (%d) exceeded\n",
219 phba->brd_no, phba->max_vpi); 223 phba->max_vpi);
220 rc = VPORT_NORESOURCES; 224 rc = VPORT_NORESOURCES;
221 goto error_out; 225 goto error_out;
222 } 226 }
@@ -225,18 +229,17 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable)
225 /* Assign an unused board number */ 229 /* Assign an unused board number */
226 if ((instance = lpfc_get_instance()) < 0) { 230 if ((instance = lpfc_get_instance()) < 0) {
227 lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, 231 lpfc_printf_log(phba, KERN_ERR, LOG_VPORT,
228 "%d:1810 Create VPORT failed: Cannot get " 232 "1810 Create VPORT failed: Cannot get "
229 "instance number\n", phba->brd_no); 233 "instance number\n");
230 lpfc_free_vpi(phba, vpi); 234 lpfc_free_vpi(phba, vpi);
231 rc = VPORT_NORESOURCES; 235 rc = VPORT_NORESOURCES;
232 goto error_out; 236 goto error_out;
233 } 237 }
234 238
235 vport = lpfc_create_port(phba, instance, fc_vport); 239 vport = lpfc_create_port(phba, instance, &fc_vport->dev);
236 if (!vport) { 240 if (!vport) {
237 lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, 241 lpfc_printf_log(phba, KERN_ERR, LOG_VPORT,
238 "%d:1811 Create VPORT failed: vpi x%x\n", 242 "1811 Create VPORT failed: vpi x%x\n", vpi);
239 phba->brd_no, vpi);
240 lpfc_free_vpi(phba, vpi); 243 lpfc_free_vpi(phba, vpi);
241 rc = VPORT_NORESOURCES; 244 rc = VPORT_NORESOURCES;
242 goto error_out; 245 goto error_out;
@@ -246,10 +249,9 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable)
246 lpfc_debugfs_initialize(vport); 249 lpfc_debugfs_initialize(vport);
247 250
248 if (lpfc_vport_sparm(phba, vport)) { 251 if (lpfc_vport_sparm(phba, vport)) {
249 lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, 252 lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
250 "%d:1813 Create VPORT failed: vpi:%d " 253 "1813 Create VPORT failed. "
251 "Cannot get sparam\n", 254 "Cannot get sparam\n");
252 phba->brd_no, vpi);
253 lpfc_free_vpi(phba, vpi); 255 lpfc_free_vpi(phba, vpi);
254 destroy_port(vport); 256 destroy_port(vport);
255 rc = VPORT_NORESOURCES; 257 rc = VPORT_NORESOURCES;
@@ -269,10 +271,9 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable)
269 271
270 if (!lpfc_valid_wwn_format(phba, &vport->fc_sparam.nodeName, "WWNN") || 272 if (!lpfc_valid_wwn_format(phba, &vport->fc_sparam.nodeName, "WWNN") ||
271 !lpfc_valid_wwn_format(phba, &vport->fc_sparam.portName, "WWPN")) { 273 !lpfc_valid_wwn_format(phba, &vport->fc_sparam.portName, "WWPN")) {
272 lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, 274 lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
273 "%d:1821 Create VPORT failed: vpi:%d " 275 "1821 Create VPORT failed. "
274 "Invalid WWN format\n", 276 "Invalid WWN format\n");
275 phba->brd_no, vpi);
276 lpfc_free_vpi(phba, vpi); 277 lpfc_free_vpi(phba, vpi);
277 destroy_port(vport); 278 destroy_port(vport);
278 rc = VPORT_INVAL; 279 rc = VPORT_INVAL;
@@ -280,10 +281,9 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable)
280 } 281 }
281 282
282 if (!lpfc_unique_wwpn(phba, vport)) { 283 if (!lpfc_unique_wwpn(phba, vport)) {
283 lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, 284 lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
284 "%d:1823 Create VPORT failed: vpi:%d " 285 "1823 Create VPORT failed. "
285 "Duplicate WWN on HBA\n", 286 "Duplicate WWN on HBA\n");
286 phba->brd_no, vpi);
287 lpfc_free_vpi(phba, vpi); 287 lpfc_free_vpi(phba, vpi);
288 destroy_port(vport); 288 destroy_port(vport);
289 rc = VPORT_INVAL; 289 rc = VPORT_INVAL;
@@ -315,10 +315,8 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable)
315 lpfc_initial_fdisc(vport); 315 lpfc_initial_fdisc(vport);
316 } else { 316 } else {
317 lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP); 317 lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP);
318 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 318 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
319 "%d (%d):0262 No NPIV Fabric " 319 "0262 No NPIV Fabric support\n");
320 "support\n",
321 phba->brd_no, vport->vpi);
322 } 320 }
323 } else { 321 } else {
324 lpfc_vport_set_state(vport, FC_VPORT_FAILED); 322 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
@@ -326,12 +324,14 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable)
326 rc = VPORT_OK; 324 rc = VPORT_OK;
327 325
328out: 326out:
327 lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
328 "1825 Vport Created.\n");
329 lpfc_host_attrib_init(lpfc_shost_from_vport(vport)); 329 lpfc_host_attrib_init(lpfc_shost_from_vport(vport));
330error_out: 330error_out:
331 return rc; 331 return rc;
332} 332}
333 333
334int 334static int
335disable_vport(struct fc_vport *fc_vport) 335disable_vport(struct fc_vport *fc_vport)
336{ 336{
337 struct lpfc_vport *vport = *(struct lpfc_vport **)fc_vport->dd_data; 337 struct lpfc_vport *vport = *(struct lpfc_vport **)fc_vport->dd_data;
@@ -371,10 +371,12 @@ disable_vport(struct fc_vport *fc_vport)
371 lpfc_mbx_unreg_vpi(vport); 371 lpfc_mbx_unreg_vpi(vport);
372 372
373 lpfc_vport_set_state(vport, FC_VPORT_DISABLED); 373 lpfc_vport_set_state(vport, FC_VPORT_DISABLED);
374 lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
375 "1826 Vport Disabled.\n");
374 return VPORT_OK; 376 return VPORT_OK;
375} 377}
376 378
377int 379static int
378enable_vport(struct fc_vport *fc_vport) 380enable_vport(struct fc_vport *fc_vport)
379{ 381{
380 struct lpfc_vport *vport = *(struct lpfc_vport **)fc_vport->dd_data; 382 struct lpfc_vport *vport = *(struct lpfc_vport **)fc_vport->dd_data;
@@ -400,15 +402,14 @@ enable_vport(struct fc_vport *fc_vport)
400 lpfc_initial_fdisc(vport); 402 lpfc_initial_fdisc(vport);
401 } else { 403 } else {
402 lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP); 404 lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP);
403 lpfc_printf_log(phba, KERN_ERR, LOG_ELS, 405 lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
404 "%d (%d):0264 No NPIV Fabric " 406 "0264 No NPIV Fabric support\n");
405 "support\n",
406 phba->brd_no, vport->vpi);
407 } 407 }
408 } else { 408 } else {
409 lpfc_vport_set_state(vport, FC_VPORT_FAILED); 409 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
410 } 410 }
411 411 lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
412 "1827 Vport Enabled.\n");
412 return VPORT_OK; 413 return VPORT_OK;
413} 414}
414 415
@@ -431,8 +432,29 @@ lpfc_vport_delete(struct fc_vport *fc_vport)
431 struct lpfc_vport *vport = *(struct lpfc_vport **)fc_vport->dd_data; 432 struct lpfc_vport *vport = *(struct lpfc_vport **)fc_vport->dd_data;
432 struct lpfc_hba *phba = vport->phba; 433 struct lpfc_hba *phba = vport->phba;
433 long timeout; 434 long timeout;
434 int rc = VPORT_ERROR;
435 435
436 if (vport->port_type == LPFC_PHYSICAL_PORT) {
437 lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
438 "1812 vport_delete failed: Cannot delete "
439 "physical host\n");
440 return VPORT_ERROR;
441 }
442 /*
443 * If we are not unloading the driver then prevent the vport_delete
444 * from happening until after this vport's discovery is finished.
445 */
446 if (!(phba->pport->load_flag & FC_UNLOADING)) {
447 int check_count = 0;
448 while (check_count < ((phba->fc_ratov * 3) + 3) &&
449 vport->port_state > LPFC_VPORT_FAILED &&
450 vport->port_state < LPFC_VPORT_READY) {
451 check_count++;
452 msleep(1000);
453 }
454 if (vport->port_state > LPFC_VPORT_FAILED &&
455 vport->port_state < LPFC_VPORT_READY)
456 return -EAGAIN;
457 }
436 /* 458 /*
437 * This is a bit of a mess. We want to ensure the shost doesn't get 459 * This is a bit of a mess. We want to ensure the shost doesn't get
438 * torn down until we're done with the embedded lpfc_vport structure. 460 * torn down until we're done with the embedded lpfc_vport structure.
@@ -450,16 +472,9 @@ lpfc_vport_delete(struct fc_vport *fc_vport)
450 */ 472 */
451 if (!scsi_host_get(shost) || !scsi_host_get(shost)) 473 if (!scsi_host_get(shost) || !scsi_host_get(shost))
452 return VPORT_INVAL; 474 return VPORT_INVAL;
453 475 spin_lock_irq(&phba->hbalock);
454 if (vport->port_type == LPFC_PHYSICAL_PORT) {
455 lpfc_printf_log(phba, KERN_ERR, LOG_VPORT,
456 "%d:1812 vport_delete failed: Cannot delete "
457 "physical host\n", phba->brd_no);
458 goto out;
459 }
460
461 vport->load_flag |= FC_UNLOADING; 476 vport->load_flag |= FC_UNLOADING;
462 477 spin_unlock_irq(&phba->hbalock);
463 kfree(vport->vname); 478 kfree(vport->vname);
464 lpfc_debugfs_terminate(vport); 479 lpfc_debugfs_terminate(vport);
465 fc_remove_host(lpfc_shost_from_vport(vport)); 480 fc_remove_host(lpfc_shost_from_vport(vport));
@@ -511,13 +526,46 @@ skip_logo:
511 spin_lock_irq(&phba->hbalock); 526 spin_lock_irq(&phba->hbalock);
512 list_del_init(&vport->listentry); 527 list_del_init(&vport->listentry);
513 spin_unlock_irq(&phba->hbalock); 528 spin_unlock_irq(&phba->hbalock);
514 529 lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
515 rc = VPORT_OK; 530 "1828 Vport Deleted.\n");
516out:
517 scsi_host_put(shost); 531 scsi_host_put(shost);
518 return rc; 532 return VPORT_OK;
519} 533}
520 534
521
522EXPORT_SYMBOL(lpfc_vport_create); 535EXPORT_SYMBOL(lpfc_vport_create);
523EXPORT_SYMBOL(lpfc_vport_delete); 536EXPORT_SYMBOL(lpfc_vport_delete);
537
538struct lpfc_vport **
539lpfc_create_vport_work_array(struct lpfc_hba *phba)
540{
541 struct lpfc_vport *port_iterator;
542 struct lpfc_vport **vports;
543 int index = 0;
544 vports = kzalloc(LPFC_MAX_VPORTS * sizeof(struct lpfc_vport *),
545 GFP_KERNEL);
546 if (vports == NULL)
547 return NULL;
548 spin_lock_irq(&phba->hbalock);
549 list_for_each_entry(port_iterator, &phba->port_list, listentry) {
550 if (!scsi_host_get(lpfc_shost_from_vport(port_iterator))) {
551 lpfc_printf_vlog(port_iterator, KERN_WARNING, LOG_VPORT,
552 "1801 Create vport work array FAILED: "
553 "cannot do scsi_host_get\n");
554 continue;
555 }
556 vports[index++] = port_iterator;
557 }
558 spin_unlock_irq(&phba->hbalock);
559 return vports;
560}
561
562void
563lpfc_destroy_vport_work_array(struct lpfc_vport **vports)
564{
565 int i;
566 if (vports == NULL)
567 return;
568 for (i=0; vports[i] != NULL && i < LPFC_MAX_VPORTS; i++)
569 scsi_host_put(lpfc_shost_from_vport(vports[i]));
570 kfree(vports);
571}
diff --git a/drivers/scsi/lpfc/lpfc_vport.h b/drivers/scsi/lpfc/lpfc_vport.h
index f223550f8cba..91da17751a37 100644
--- a/drivers/scsi/lpfc/lpfc_vport.h
+++ b/drivers/scsi/lpfc/lpfc_vport.h
@@ -88,6 +88,8 @@ int lpfc_vport_create(struct fc_vport *, bool);
88int lpfc_vport_delete(struct fc_vport *); 88int lpfc_vport_delete(struct fc_vport *);
89int lpfc_vport_getinfo(struct Scsi_Host *, struct vport_info *); 89int lpfc_vport_getinfo(struct Scsi_Host *, struct vport_info *);
90int lpfc_vport_tgt_remove(struct Scsi_Host *, uint, uint); 90int lpfc_vport_tgt_remove(struct Scsi_Host *, uint, uint);
91struct lpfc_vport **lpfc_create_vport_work_array(struct lpfc_hba *);
92void lpfc_destroy_vport_work_array(struct lpfc_vport **);
91 93
92/* 94/*
93 * queuecommand VPORT-specific return codes. Specified in the host byte code. 95 * queuecommand VPORT-specific return codes. Specified in the host byte code.
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index c488996cb958..93c0c7e4f08f 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -2154,6 +2154,19 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha)
2154 } 2154 }
2155 } 2155 }
2156 2156
2157 /* Get memory for cached NVRAM */
2158 ha->nvram = kzalloc(MAX_NVRAM_SIZE, GFP_KERNEL);
2159 if (ha->nvram == NULL) {
2160 /* error */
2161 qla_printk(KERN_WARNING, ha,
2162 "Memory Allocation failed - nvram cache\n");
2163
2164 qla2x00_mem_free(ha);
2165 msleep(100);
2166
2167 continue;
2168 }
2169
2157 /* Done all allocations without any error. */ 2170 /* Done all allocations without any error. */
2158 status = 0; 2171 status = 0;
2159 2172
@@ -2266,6 +2279,7 @@ qla2x00_mem_free(scsi_qla_host_t *ha)
2266 ha->fw_dump_reading = 0; 2279 ha->fw_dump_reading = 0;
2267 2280
2268 vfree(ha->optrom_buffer); 2281 vfree(ha->optrom_buffer);
2282 kfree(ha->nvram);
2269} 2283}
2270 2284
2271/* 2285/*
diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c
index c4195ea869e9..594887205b0f 100644
--- a/drivers/scsi/qlogicpti.c
+++ b/drivers/scsi/qlogicpti.c
@@ -193,7 +193,8 @@ static int qlogicpti_mbox_command(struct qlogicpti *qpti, u_short param[], int f
193 cpu_relax(); 193 cpu_relax();
194 } 194 }
195 if (!loop_count) 195 if (!loop_count)
196 printk(KERN_EMERG "qlogicpti: mbox_command loop timeout #1\n"); 196 printk(KERN_EMERG "qlogicpti%d: mbox_command loop timeout #1\n",
197 qpti->qpti_id);
197 198
198 /* Write mailbox command registers. */ 199 /* Write mailbox command registers. */
199 switch (mbox_param[param[0]] >> 4) { 200 switch (mbox_param[param[0]] >> 4) {
@@ -224,8 +225,8 @@ static int qlogicpti_mbox_command(struct qlogicpti *qpti, u_short param[], int f
224 (sbus_readw(qpti->qregs + HCCTRL) & HCCTRL_CRIRQ)) 225 (sbus_readw(qpti->qregs + HCCTRL) & HCCTRL_CRIRQ))
225 udelay(20); 226 udelay(20);
226 if (!loop_count) 227 if (!loop_count)
227 printk(KERN_EMERG "qlogicpti: mbox_command[%04x] loop timeout #2\n", 228 printk(KERN_EMERG "qlogicpti%d: mbox_command[%04x] loop timeout #2\n",
228 param[0]); 229 qpti->qpti_id, param[0]);
229 230
230 /* Wait for SBUS semaphore to get set. */ 231 /* Wait for SBUS semaphore to get set. */
231 loop_count = DEFAULT_LOOP_COUNT; 232 loop_count = DEFAULT_LOOP_COUNT;
@@ -238,16 +239,16 @@ static int qlogicpti_mbox_command(struct qlogicpti *qpti, u_short param[], int f
238 break; 239 break;
239 } 240 }
240 if (!loop_count) 241 if (!loop_count)
241 printk(KERN_EMERG "qlogicpti: mbox_command[%04x] loop timeout #3\n", 242 printk(KERN_EMERG "qlogicpti%d: mbox_command[%04x] loop timeout #3\n",
242 param[0]); 243 qpti->qpti_id, param[0]);
243 244
244 /* Wait for MBOX busy condition to go away. */ 245 /* Wait for MBOX busy condition to go away. */
245 loop_count = DEFAULT_LOOP_COUNT; 246 loop_count = DEFAULT_LOOP_COUNT;
246 while (--loop_count && (sbus_readw(qpti->qregs + MBOX0) == 0x04)) 247 while (--loop_count && (sbus_readw(qpti->qregs + MBOX0) == 0x04))
247 udelay(20); 248 udelay(20);
248 if (!loop_count) 249 if (!loop_count)
249 printk(KERN_EMERG "qlogicpti: mbox_command[%04x] loop timeout #4\n", 250 printk(KERN_EMERG "qlogicpti%d: mbox_command[%04x] loop timeout #4\n",
250 param[0]); 251 qpti->qpti_id, param[0]);
251 252
252 /* Read back output parameters. */ 253 /* Read back output parameters. */
253 switch (mbox_param[param[0]] & 0xf) { 254 switch (mbox_param[param[0]] & 0xf) {
@@ -342,7 +343,8 @@ static int qlogicpti_reset_hardware(struct Scsi_Host *host)
342 while (--loop_count && ((sbus_readw(qpti->qregs + MBOX0) & 0xff) == 0x04)) 343 while (--loop_count && ((sbus_readw(qpti->qregs + MBOX0) & 0xff) == 0x04))
343 udelay(20); 344 udelay(20);
344 if (!loop_count) 345 if (!loop_count)
345 printk(KERN_EMERG "qlogicpti: reset_hardware loop timeout\n"); 346 printk(KERN_EMERG "qlogicpti%d: reset_hardware loop timeout\n",
347 qpti->qpti_id);
346 348
347 sbus_writew(HCCTRL_PAUSE, qpti->qregs + HCCTRL); 349 sbus_writew(HCCTRL_PAUSE, qpti->qregs + HCCTRL);
348 set_sbus_cfg1(qpti); 350 set_sbus_cfg1(qpti);
@@ -721,12 +723,12 @@ static int __init qpti_register_irq(struct qlogicpti *qpti)
721 IRQF_SHARED, "Qlogic/PTI", qpti)) 723 IRQF_SHARED, "Qlogic/PTI", qpti))
722 goto fail; 724 goto fail;
723 725
724 printk("qpti%d: IRQ %d ", qpti->qpti_id, qpti->irq); 726 printk("qlogicpti%d: IRQ %d ", qpti->qpti_id, qpti->irq);
725 727
726 return 0; 728 return 0;
727 729
728fail: 730fail:
729 printk("qpti%d: Cannot acquire irq line\n", qpti->qpti_id); 731 printk("qlogicpti%d: Cannot acquire irq line\n", qpti->qpti_id);
730 return -1; 732 return -1;
731} 733}
732 734
@@ -1210,7 +1212,7 @@ static int qlogicpti_return_status(struct Status_Entry *sts, int id)
1210 host_status = DID_OK; 1212 host_status = DID_OK;
1211 break; 1213 break;
1212 default: 1214 default:
1213 printk(KERN_EMERG "qpti%d: unknown completion status 0x%04x\n", 1215 printk(KERN_EMERG "qlogicpti%d: unknown completion status 0x%04x\n",
1214 id, sts->completion_status); 1216 id, sts->completion_status);
1215 host_status = DID_ERROR; 1217 host_status = DID_ERROR;
1216 break; 1218 break;
@@ -1329,8 +1331,8 @@ static int qlogicpti_abort(struct scsi_cmnd *Cmnd)
1329 u32 cmd_cookie; 1331 u32 cmd_cookie;
1330 int i; 1332 int i;
1331 1333
1332 printk(KERN_WARNING "qlogicpti : Aborting cmd for tgt[%d] lun[%d]\n", 1334 printk(KERN_WARNING "qlogicpti%d: Aborting cmd for tgt[%d] lun[%d]\n",
1333 (int)Cmnd->device->id, (int)Cmnd->device->lun); 1335 qpti->qpti_id, (int)Cmnd->device->id, (int)Cmnd->device->lun);
1334 1336
1335 qlogicpti_disable_irqs(qpti); 1337 qlogicpti_disable_irqs(qpti);
1336 1338
@@ -1348,7 +1350,8 @@ static int qlogicpti_abort(struct scsi_cmnd *Cmnd)
1348 param[3] = cmd_cookie & 0xffff; 1350 param[3] = cmd_cookie & 0xffff;
1349 if (qlogicpti_mbox_command(qpti, param, 0) || 1351 if (qlogicpti_mbox_command(qpti, param, 0) ||
1350 (param[0] != MBOX_COMMAND_COMPLETE)) { 1352 (param[0] != MBOX_COMMAND_COMPLETE)) {
1351 printk(KERN_EMERG "qlogicpti : scsi abort failure: %x\n", param[0]); 1353 printk(KERN_EMERG "qlogicpti%d: scsi abort failure: %x\n",
1354 qpti->qpti_id, param[0]);
1352 return_status = FAILED; 1355 return_status = FAILED;
1353 } 1356 }
1354 1357
@@ -1364,7 +1367,8 @@ static int qlogicpti_reset(struct scsi_cmnd *Cmnd)
1364 struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata; 1367 struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata;
1365 int return_status = SUCCESS; 1368 int return_status = SUCCESS;
1366 1369
1367 printk(KERN_WARNING "qlogicpti : Resetting SCSI bus!\n"); 1370 printk(KERN_WARNING "qlogicpti%d: Resetting SCSI bus!\n",
1371 qpti->qpti_id);
1368 1372
1369 qlogicpti_disable_irqs(qpti); 1373 qlogicpti_disable_irqs(qpti);
1370 1374
@@ -1372,7 +1376,8 @@ static int qlogicpti_reset(struct scsi_cmnd *Cmnd)
1372 param[1] = qpti->host_param.bus_reset_delay; 1376 param[1] = qpti->host_param.bus_reset_delay;
1373 if (qlogicpti_mbox_command(qpti, param, 0) || 1377 if (qlogicpti_mbox_command(qpti, param, 0) ||
1374 (param[0] != MBOX_COMMAND_COMPLETE)) { 1378 (param[0] != MBOX_COMMAND_COMPLETE)) {
1375 printk(KERN_EMERG "qlogicisp : scsi bus reset failure: %x\n", param[0]); 1379 printk(KERN_EMERG "qlogicisp%d: scsi bus reset failure: %x\n",
1380 qpti->qpti_id, param[0]);
1376 return_status = FAILED; 1381 return_status = FAILED;
1377 } 1382 }
1378 1383
@@ -1454,22 +1459,25 @@ static int __devinit qpti_sbus_probe(struct of_device *dev, const struct of_devi
1454 if (qlogicpti_reset_hardware(host)) 1459 if (qlogicpti_reset_hardware(host))
1455 goto fail_unmap_queues; 1460 goto fail_unmap_queues;
1456 1461
1457 if (scsi_add_host(host, &dev->dev))
1458 goto fail_unmap_queues;
1459
1460 printk("(Firmware v%d.%d.%d)", qpti->fware_majrev, 1462 printk("(Firmware v%d.%d.%d)", qpti->fware_majrev,
1461 qpti->fware_minrev, qpti->fware_micrev); 1463 qpti->fware_minrev, qpti->fware_micrev);
1462 1464
1463 fcode = of_get_property(dp, "isp-fcode", NULL); 1465 fcode = of_get_property(dp, "isp-fcode", NULL);
1464 if (fcode && fcode[0]) 1466 if (fcode && fcode[0])
1465 printk("(Firmware %s)", fcode); 1467 printk("(FCode %s)", fcode);
1466 if (of_find_property(dp, "differential", NULL) != NULL) 1468 if (of_find_property(dp, "differential", NULL) != NULL)
1467 qpti->differential = 1; 1469 qpti->differential = 1;
1468 1470
1469 printk (" [%s Wide, using %s interface]\n", 1471 printk("\nqlogicpti%d: [%s Wide, using %s interface]\n",
1472 qpti->qpti_id,
1470 (qpti->ultra ? "Ultra" : "Fast"), 1473 (qpti->ultra ? "Ultra" : "Fast"),
1471 (qpti->differential ? "differential" : "single ended")); 1474 (qpti->differential ? "differential" : "single ended"));
1472 1475
1476 if (scsi_add_host(host, &dev->dev)) {
1477 printk("qlogicpti%d: Failed scsi_add_host\n", qpti->qpti_id);
1478 goto fail_unmap_queues;
1479 }
1480
1473 dev_set_drvdata(&sdev->ofdev.dev, qpti); 1481 dev_set_drvdata(&sdev->ofdev.dev, qpti);
1474 1482
1475 qpti_chain_add(qpti); 1483 qpti_chain_add(qpti);
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 21c075d44db1..a417a6ff9f97 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1038,22 +1038,6 @@ static int scsi_init_io(struct scsi_cmnd *cmd)
1038 return BLKPREP_KILL; 1038 return BLKPREP_KILL;
1039} 1039}
1040 1040
1041static int scsi_issue_flush_fn(struct request_queue *q, struct gendisk *disk,
1042 sector_t *error_sector)
1043{
1044 struct scsi_device *sdev = q->queuedata;
1045 struct scsi_driver *drv;
1046
1047 if (sdev->sdev_state != SDEV_RUNNING)
1048 return -ENXIO;
1049
1050 drv = *(struct scsi_driver **) disk->private_data;
1051 if (drv->issue_flush)
1052 return drv->issue_flush(&sdev->sdev_gendev, error_sector);
1053
1054 return -EOPNOTSUPP;
1055}
1056
1057static struct scsi_cmnd *scsi_get_cmd_from_req(struct scsi_device *sdev, 1041static struct scsi_cmnd *scsi_get_cmd_from_req(struct scsi_device *sdev,
1058 struct request *req) 1042 struct request *req)
1059{ 1043{
@@ -1596,7 +1580,6 @@ struct request_queue *scsi_alloc_queue(struct scsi_device *sdev)
1596 return NULL; 1580 return NULL;
1597 1581
1598 blk_queue_prep_rq(q, scsi_prep_fn); 1582 blk_queue_prep_rq(q, scsi_prep_fn);
1599 blk_queue_issue_flush_fn(q, scsi_issue_flush_fn);
1600 blk_queue_softirq_done(q, scsi_softirq_done); 1583 blk_queue_softirq_done(q, scsi_softirq_done);
1601 return q; 1584 return q;
1602} 1585}
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index e21c7142a3ea..2c6116fd4578 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -241,7 +241,6 @@ static struct scsi_driver sd_template = {
241 }, 241 },
242 .rescan = sd_rescan, 242 .rescan = sd_rescan,
243 .init_command = sd_init_command, 243 .init_command = sd_init_command,
244 .issue_flush = sd_issue_flush,
245}; 244};
246 245
247/* 246/*
@@ -800,10 +799,17 @@ static int sd_sync_cache(struct scsi_disk *sdkp)
800 return 0; 799 return 0;
801} 800}
802 801
803static int sd_issue_flush(struct device *dev, sector_t *error_sector) 802static int sd_issue_flush(struct request_queue *q, struct gendisk *disk,
803 sector_t *error_sector)
804{ 804{
805 int ret = 0; 805 int ret = 0;
806 struct scsi_disk *sdkp = scsi_disk_get_from_dev(dev); 806 struct scsi_device *sdp = q->queuedata;
807 struct scsi_disk *sdkp;
808
809 if (sdp->sdev_state != SDEV_RUNNING)
810 return -ENXIO;
811
812 sdkp = scsi_disk_get_from_dev(&sdp->sdev_gendev);
807 813
808 if (!sdkp) 814 if (!sdkp)
809 return -ENODEV; 815 return -ENODEV;
@@ -1663,6 +1669,8 @@ static int sd_probe(struct device *dev)
1663 1669
1664 sd_revalidate_disk(gd); 1670 sd_revalidate_disk(gd);
1665 1671
1672 blk_queue_issue_flush_fn(sdp->request_queue, sd_issue_flush);
1673
1666 gd->driverfs_dev = &sdp->sdev_gendev; 1674 gd->driverfs_dev = &sdp->sdev_gendev;
1667 gd->flags = GENHD_FL_DRIVERFS; 1675 gd->flags = GENHD_FL_DRIVERFS;
1668 if (sdp->removable) 1676 if (sdp->removable)
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index a4f7b8465773..73c44cbdea47 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -1485,7 +1485,7 @@ st_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
1485 struct st_buffer *STbp; 1485 struct st_buffer *STbp;
1486 char *name = tape_name(STp); 1486 char *name = tape_name(STp);
1487 1487
1488 if (down_interruptible(&STp->lock)) 1488 if (mutex_lock_interruptible(&STp->lock))
1489 return -ERESTARTSYS; 1489 return -ERESTARTSYS;
1490 1490
1491 retval = rw_checks(STp, filp, count); 1491 retval = rw_checks(STp, filp, count);
@@ -1736,7 +1736,7 @@ st_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
1736 if (SRpnt != NULL) 1736 if (SRpnt != NULL)
1737 st_release_request(SRpnt); 1737 st_release_request(SRpnt);
1738 release_buffering(STp, 0); 1738 release_buffering(STp, 0);
1739 up(&STp->lock); 1739 mutex_unlock(&STp->lock);
1740 1740
1741 return retval; 1741 return retval;
1742} 1742}
@@ -1942,7 +1942,7 @@ st_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos)
1942 struct st_buffer *STbp = STp->buffer; 1942 struct st_buffer *STbp = STp->buffer;
1943 DEB( char *name = tape_name(STp); ) 1943 DEB( char *name = tape_name(STp); )
1944 1944
1945 if (down_interruptible(&STp->lock)) 1945 if (mutex_lock_interruptible(&STp->lock))
1946 return -ERESTARTSYS; 1946 return -ERESTARTSYS;
1947 1947
1948 retval = rw_checks(STp, filp, count); 1948 retval = rw_checks(STp, filp, count);
@@ -2069,7 +2069,7 @@ st_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos)
2069 release_buffering(STp, 1); 2069 release_buffering(STp, 1);
2070 STbp->buffer_bytes = 0; 2070 STbp->buffer_bytes = 0;
2071 } 2071 }
2072 up(&STp->lock); 2072 mutex_unlock(&STp->lock);
2073 2073
2074 return retval; 2074 return retval;
2075} 2075}
@@ -3226,7 +3226,7 @@ static int st_ioctl(struct inode *inode, struct file *file,
3226 char *name = tape_name(STp); 3226 char *name = tape_name(STp);
3227 void __user *p = (void __user *)arg; 3227 void __user *p = (void __user *)arg;
3228 3228
3229 if (down_interruptible(&STp->lock)) 3229 if (mutex_lock_interruptible(&STp->lock))
3230 return -ERESTARTSYS; 3230 return -ERESTARTSYS;
3231 3231
3232 DEB( 3232 DEB(
@@ -3537,7 +3537,7 @@ static int st_ioctl(struct inode *inode, struct file *file,
3537 retval = (-EFAULT); 3537 retval = (-EFAULT);
3538 goto out; 3538 goto out;
3539 } 3539 }
3540 up(&STp->lock); 3540 mutex_unlock(&STp->lock);
3541 switch (cmd_in) { 3541 switch (cmd_in) {
3542 case SCSI_IOCTL_GET_IDLUN: 3542 case SCSI_IOCTL_GET_IDLUN:
3543 case SCSI_IOCTL_GET_BUS_NUMBER: 3543 case SCSI_IOCTL_GET_BUS_NUMBER:
@@ -3563,7 +3563,7 @@ static int st_ioctl(struct inode *inode, struct file *file,
3563 return retval; 3563 return retval;
3564 3564
3565 out: 3565 out:
3566 up(&STp->lock); 3566 mutex_unlock(&STp->lock);
3567 return retval; 3567 return retval;
3568} 3568}
3569 3569
@@ -4029,7 +4029,7 @@ static int st_probe(struct device *dev)
4029 4029
4030 tpnt->density_changed = tpnt->compression_changed = 4030 tpnt->density_changed = tpnt->compression_changed =
4031 tpnt->blksize_changed = 0; 4031 tpnt->blksize_changed = 0;
4032 init_MUTEX(&tpnt->lock); 4032 mutex_init(&tpnt->lock);
4033 4033
4034 st_nr_dev++; 4034 st_nr_dev++;
4035 write_unlock(&st_dev_arr_lock); 4035 write_unlock(&st_dev_arr_lock);
diff --git a/drivers/scsi/st.h b/drivers/scsi/st.h
index 50f3deb1f9ed..6c8075712974 100644
--- a/drivers/scsi/st.h
+++ b/drivers/scsi/st.h
@@ -3,6 +3,7 @@
3#define _ST_H 3#define _ST_H
4 4
5#include <linux/completion.h> 5#include <linux/completion.h>
6#include <linux/mutex.h>
6#include <linux/kref.h> 7#include <linux/kref.h>
7#include <scsi/scsi_cmnd.h> 8#include <scsi/scsi_cmnd.h>
8 9
@@ -98,7 +99,7 @@ struct st_partstat {
98struct scsi_tape { 99struct scsi_tape {
99 struct scsi_driver *driver; 100 struct scsi_driver *driver;
100 struct scsi_device *device; 101 struct scsi_device *device;
101 struct semaphore lock; /* For serialization */ 102 struct mutex lock; /* For serialization */
102 struct completion wait; /* For SCSI commands */ 103 struct completion wait; /* For SCSI commands */
103 struct st_buffer *buffer; 104 struct st_buffer *buffer;
104 105
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 2f5a5ac1b271..301313002f6b 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2514,7 +2514,7 @@ static int __init serial8250_console_setup(struct console *co, char *options)
2514 return uart_set_options(port, co, baud, parity, bits, flow); 2514 return uart_set_options(port, co, baud, parity, bits, flow);
2515} 2515}
2516 2516
2517static int __init serial8250_console_early_setup(void) 2517static int serial8250_console_early_setup(void)
2518{ 2518{
2519 return serial8250_find_port_for_earlycon(); 2519 return serial8250_find_port_for_earlycon();
2520} 2520}
diff --git a/drivers/serial/8250_early.c b/drivers/serial/8250_early.c
index 150cad5c2eba..4d4c9f01be8d 100644
--- a/drivers/serial/8250_early.c
+++ b/drivers/serial/8250_early.c
@@ -227,7 +227,7 @@ int __init setup_early_serial8250_console(char *cmdline)
227 return 0; 227 return 0;
228} 228}
229 229
230int __init serial8250_find_port_for_earlycon(void) 230int serial8250_find_port_for_earlycon(void)
231{ 231{
232 struct early_serial8250_device *device = &early_device; 232 struct early_serial8250_device *device = &early_device;
233 struct uart_port *port = &device->port; 233 struct uart_port *port = &device->port;
diff --git a/drivers/video/cg6.c b/drivers/video/cg6.c
index 87c747123538..ee9046db9c7d 100644
--- a/drivers/video/cg6.c
+++ b/drivers/video/cg6.c
@@ -677,6 +677,7 @@ static int __devinit cg6_probe(struct of_device *op, const struct of_device_id *
677 struct fb_info *info; 677 struct fb_info *info;
678 struct cg6_par *par; 678 struct cg6_par *par;
679 int linebytes, err; 679 int linebytes, err;
680 int dblbuf;
680 681
681 info = framebuffer_alloc(sizeof(struct cg6_par), &op->dev); 682 info = framebuffer_alloc(sizeof(struct cg6_par), &op->dev);
682 683
@@ -698,7 +699,9 @@ static int __devinit cg6_probe(struct of_device *op, const struct of_device_id *
698 linebytes = of_getintprop_default(dp, "linebytes", 699 linebytes = of_getintprop_default(dp, "linebytes",
699 info->var.xres); 700 info->var.xres);
700 par->fbsize = PAGE_ALIGN(linebytes * info->var.yres); 701 par->fbsize = PAGE_ALIGN(linebytes * info->var.yres);
701 if (of_find_property(dp, "dblbuf", NULL)) 702
703 dblbuf = of_getintprop_default(dp, "dblbuf", 0);
704 if (dblbuf)
702 par->fbsize *= 4; 705 par->fbsize *= 4;
703 706
704 par->fbc = of_ioremap(&op->resource[0], CG6_FBC_OFFSET, 707 par->fbc = of_ioremap(&op->resource[0], CG6_FBC_OFFSET,
diff --git a/include/asm-arm/pgtable-nommu.h b/include/asm-arm/pgtable-nommu.h
index b186bc820e30..33c83dd87965 100644
--- a/include/asm-arm/pgtable-nommu.h
+++ b/include/asm-arm/pgtable-nommu.h
@@ -74,7 +74,6 @@ static inline int pte_file(pte_t pte) { return 0; }
74 * These would be in other places but having them here reduces the diffs. 74 * These would be in other places but having them here reduces the diffs.
75 */ 75 */
76extern unsigned int kobjsize(const void *objp); 76extern unsigned int kobjsize(const void *objp);
77extern int is_in_rom(unsigned long);
78 77
79/* 78/*
80 * No page table caches to initialise. 79 * No page table caches to initialise.
diff --git a/include/asm-powerpc/mmu-hash64.h b/include/asm-powerpc/mmu-hash64.h
index 695962f02059..3112ad14ad95 100644
--- a/include/asm-powerpc/mmu-hash64.h
+++ b/include/asm-powerpc/mmu-hash64.h
@@ -262,6 +262,7 @@ extern void slb_initialize(void);
262extern void slb_flush_and_rebolt(void); 262extern void slb_flush_and_rebolt(void);
263extern void stab_initialize(unsigned long stab); 263extern void stab_initialize(unsigned long stab);
264 264
265extern void slb_vmalloc_update(void);
265#endif /* __ASSEMBLY__ */ 266#endif /* __ASSEMBLY__ */
266 267
267/* 268/*
diff --git a/include/asm-powerpc/pgtable-64k.h b/include/asm-powerpc/pgtable-64k.h
index 31cbd3d7fce8..33ae9018fe72 100644
--- a/include/asm-powerpc/pgtable-64k.h
+++ b/include/asm-powerpc/pgtable-64k.h
@@ -49,12 +49,10 @@
49 49
50/* Shift to put page number into pte. 50/* Shift to put page number into pte.
51 * 51 *
52 * That gives us a max RPN of 32 bits, which means a max of 48 bits 52 * That gives us a max RPN of 34 bits, which means a max of 50 bits
53 * of addressable physical space. 53 * of addressable physical space, or 46 bits for the special 4k PFNs.
54 * We could get 3 more bits here by setting PTE_RPN_SHIFT to 29 but
55 * 32 makes PTEs more readable for debugging for now :)
56 */ 54 */
57#define PTE_RPN_SHIFT (32) 55#define PTE_RPN_SHIFT (30)
58#define PTE_RPN_MAX (1UL << (64 - PTE_RPN_SHIFT)) 56#define PTE_RPN_MAX (1UL << (64 - PTE_RPN_SHIFT))
59#define PTE_RPN_MASK (~((1UL<<PTE_RPN_SHIFT)-1)) 57#define PTE_RPN_MASK (~((1UL<<PTE_RPN_SHIFT)-1))
60 58
diff --git a/include/asm-sh/rts7751r2d.h b/include/asm-sh/rts7751r2d.h
index 10565ac7966a..5d7800aa31b5 100644
--- a/include/asm-sh/rts7751r2d.h
+++ b/include/asm-sh/rts7751r2d.h
@@ -37,7 +37,7 @@
37#define PA_VERREG 0xa4000032 /* FPGA Version Register */ 37#define PA_VERREG 0xa4000032 /* FPGA Version Register */
38#define PA_INPORT 0xa4000034 /* KEY Input Port control */ 38#define PA_INPORT 0xa4000034 /* KEY Input Port control */
39#define PA_OUTPORT 0xa4000036 /* LED control */ 39#define PA_OUTPORT 0xa4000036 /* LED control */
40#define PA_DMPORT 0xa4000038 /* DM270 Output Port control */ 40#define PA_BVERREG 0xa4000038 /* Board Revision Register */
41 41
42#define PA_AX88796L 0xaa000400 /* AX88796L Area */ 42#define PA_AX88796L 0xaa000400 /* AX88796L Area */
43#define PA_VOYAGER 0xab000000 /* VOYAGER GX Area */ 43#define PA_VOYAGER 0xab000000 /* VOYAGER GX Area */
diff --git a/include/asm-sparc/fcntl.h b/include/asm-sparc/fcntl.h
index 5db60b5ae7b0..5ec546349fc8 100644
--- a/include/asm-sparc/fcntl.h
+++ b/include/asm-sparc/fcntl.h
@@ -16,6 +16,7 @@
16#define O_LARGEFILE 0x40000 16#define O_LARGEFILE 0x40000
17#define O_DIRECT 0x100000 /* direct disk access hint */ 17#define O_DIRECT 0x100000 /* direct disk access hint */
18#define O_NOATIME 0x200000 18#define O_NOATIME 0x200000
19#define O_CLOEXEC 0x400000
19 20
20#define F_GETOWN 5 /* for sockets. */ 21#define F_GETOWN 5 /* for sockets. */
21#define F_SETOWN 6 /* for sockets. */ 22#define F_SETOWN 6 /* for sockets. */
diff --git a/include/asm-sparc/floppy.h b/include/asm-sparc/floppy.h
index 28ce2b9c3da8..acd06d8ff70a 100644
--- a/include/asm-sparc/floppy.h
+++ b/include/asm-sparc/floppy.h
@@ -48,7 +48,7 @@ struct sun_flpy_controller {
48 48
49/* You'll only ever find one controller on a SparcStation anyways. */ 49/* You'll only ever find one controller on a SparcStation anyways. */
50static struct sun_flpy_controller *sun_fdc = NULL; 50static struct sun_flpy_controller *sun_fdc = NULL;
51volatile unsigned char *fdc_status; 51extern volatile unsigned char *fdc_status;
52 52
53struct sun_floppy_ops { 53struct sun_floppy_ops {
54 unsigned char (*fd_inb)(int port); 54 unsigned char (*fd_inb)(int port);
@@ -225,13 +225,13 @@ static void sun_82077_fd_outb(unsigned char value, int port)
225 * underruns. If non-zero, doing_pdma encodes the direction of 225 * underruns. If non-zero, doing_pdma encodes the direction of
226 * the transfer for debugging. 1=read 2=write 226 * the transfer for debugging. 1=read 2=write
227 */ 227 */
228char *pdma_vaddr; 228extern char *pdma_vaddr;
229unsigned long pdma_size; 229extern unsigned long pdma_size;
230volatile int doing_pdma = 0; 230extern volatile int doing_pdma;
231 231
232/* This is software state */ 232/* This is software state */
233char *pdma_base = NULL; 233extern char *pdma_base;
234unsigned long pdma_areasize; 234extern unsigned long pdma_areasize;
235 235
236/* Common routines to all controller types on the Sparc. */ 236/* Common routines to all controller types on the Sparc. */
237static __inline__ void virtual_dma_init(void) 237static __inline__ void virtual_dma_init(void)
@@ -281,7 +281,8 @@ static __inline__ void sun_fd_enable_dma(void)
281} 281}
282 282
283/* Our low-level entry point in arch/sparc/kernel/entry.S */ 283/* Our low-level entry point in arch/sparc/kernel/entry.S */
284irqreturn_t floppy_hardint(int irq, void *unused); 284extern int sparc_floppy_request_irq(int irq, unsigned long flags,
285 irqreturn_t (*irq_handler)(int irq, void *));
285 286
286static int sun_fd_request_irq(void) 287static int sun_fd_request_irq(void)
287{ 288{
@@ -290,8 +291,9 @@ static int sun_fd_request_irq(void)
290 291
291 if(!once) { 292 if(!once) {
292 once = 1; 293 once = 1;
293 error = request_fast_irq(FLOPPY_IRQ, floppy_hardint, 294 error = sparc_floppy_request_irq(FLOPPY_IRQ,
294 IRQF_DISABLED, "floppy"); 295 IRQF_DISABLED,
296 floppy_interrupt);
295 return ((error == 0) ? 0 : -1); 297 return ((error == 0) ? 0 : -1);
296 } else return 0; 298 } else return 0;
297} 299}
diff --git a/include/asm-sparc/irq.h b/include/asm-sparc/irq.h
index 61fb99643afd..fe205cc444b8 100644
--- a/include/asm-sparc/irq.h
+++ b/include/asm-sparc/irq.h
@@ -1,7 +1,6 @@
1/* $Id: irq.h,v 1.32 2000/08/26 02:42:28 anton Exp $ 1/* irq.h: IRQ registers on the Sparc.
2 * irq.h: IRQ registers on the Sparc.
3 * 2 *
4 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 3 * Copyright (C) 1995, 2007 David S. Miller (davem@davemloft.net)
5 */ 4 */
6 5
7#ifndef _SPARC_IRQ_H 6#ifndef _SPARC_IRQ_H
@@ -13,6 +12,4 @@
13 12
14#define irq_canonicalize(irq) (irq) 13#define irq_canonicalize(irq) (irq)
15 14
16extern int request_fast_irq(unsigned int irq, irq_handler_t handler, unsigned long flags, __const__ char *devname);
17
18#endif 15#endif
diff --git a/include/asm-sparc64/dma-mapping.h b/include/asm-sparc64/dma-mapping.h
index a72a5f271f31..1fc655452b81 100644
--- a/include/asm-sparc64/dma-mapping.h
+++ b/include/asm-sparc64/dma-mapping.h
@@ -108,6 +108,25 @@ static inline void dma_sync_single_for_device(struct device *dev,
108 dma_ops->sync_single_for_device(dev, dma_handle, size, direction); 108 dma_ops->sync_single_for_device(dev, dma_handle, size, direction);
109} 109}
110 110
111static inline void dma_sync_single_range_for_cpu(struct device *dev,
112 dma_addr_t dma_handle,
113 unsigned long offset,
114 size_t size,
115 enum dma_data_direction direction)
116{
117 dma_sync_single_for_cpu(dev, dma_handle+offset, size, direction);
118}
119
120static inline void dma_sync_single_range_for_device(struct device *dev,
121 dma_addr_t dma_handle,
122 unsigned long offset,
123 size_t size,
124 enum dma_data_direction direction)
125{
126 dma_sync_single_for_device(dev, dma_handle+offset, size, direction);
127}
128
129
111static inline void dma_sync_sg_for_cpu(struct device *dev, 130static inline void dma_sync_sg_for_cpu(struct device *dev,
112 struct scatterlist *sg, int nelems, 131 struct scatterlist *sg, int nelems,
113 enum dma_data_direction direction) 132 enum dma_data_direction direction)
diff --git a/include/asm-sparc64/fcntl.h b/include/asm-sparc64/fcntl.h
index b2aecf0054bd..111f6b3b8925 100644
--- a/include/asm-sparc64/fcntl.h
+++ b/include/asm-sparc64/fcntl.h
@@ -16,7 +16,7 @@
16#define O_LARGEFILE 0x40000 16#define O_LARGEFILE 0x40000
17#define O_DIRECT 0x100000 /* direct disk access hint */ 17#define O_DIRECT 0x100000 /* direct disk access hint */
18#define O_NOATIME 0x200000 18#define O_NOATIME 0x200000
19 19#define O_CLOEXEC 0x400000
20 20
21#define F_GETOWN 5 /* for sockets. */ 21#define F_GETOWN 5 /* for sockets. */
22#define F_SETOWN 6 /* for sockets. */ 22#define F_SETOWN 6 /* for sockets. */
diff --git a/include/linux/bsg.h b/include/linux/bsg.h
index 102dc096e1cb..60e377b520f8 100644
--- a/include/linux/bsg.h
+++ b/include/linux/bsg.h
@@ -15,14 +15,18 @@ struct sg_io_v4 {
15 15
16 __u32 request_len; /* [i] in bytes */ 16 __u32 request_len; /* [i] in bytes */
17 __u64 request; /* [i], [*i] {SCSI: cdb} */ 17 __u64 request; /* [i], [*i] {SCSI: cdb} */
18 __u64 request_tag; /* [i] {SCSI: task tag (only if flagged)} */
18 __u32 request_attr; /* [i] {SCSI: task attribute} */ 19 __u32 request_attr; /* [i] {SCSI: task attribute} */
19 __u32 request_tag; /* [i] {SCSI: task tag (only if flagged)} */
20 __u32 request_priority; /* [i] {SCSI: task priority} */ 20 __u32 request_priority; /* [i] {SCSI: task priority} */
21 __u32 request_extra; /* [i] {spare, for padding} */
21 __u32 max_response_len; /* [i] in bytes */ 22 __u32 max_response_len; /* [i] in bytes */
22 __u64 response; /* [i], [*o] {SCSI: (auto)sense data} */ 23 __u64 response; /* [i], [*o] {SCSI: (auto)sense data} */
23 24
24 /* "din_" for data in (from device); "dout_" for data out (to device) */ 25 /* "dout_": data out (to device); "din_": data in (from device) */
26 __u32 dout_iovec_count; /* [i] 0 -> "flat" dout transfer else
27 dout_xfer points to array of iovec */
25 __u32 dout_xfer_len; /* [i] bytes to be transferred to device */ 28 __u32 dout_xfer_len; /* [i] bytes to be transferred to device */
29 __u32 din_iovec_count; /* [i] 0 -> "flat" din transfer */
26 __u32 din_xfer_len; /* [i] bytes to be transferred from device */ 30 __u32 din_xfer_len; /* [i] bytes to be transferred from device */
27 __u64 dout_xferp; /* [i], [*i] */ 31 __u64 dout_xferp; /* [i], [*i] */
28 __u64 din_xferp; /* [i], [*o] */ 32 __u64 din_xferp; /* [i], [*o] */
@@ -39,8 +43,9 @@ struct sg_io_v4 {
39 __u32 info; /* [o] additional information */ 43 __u32 info; /* [o] additional information */
40 __u32 duration; /* [o] time to complete, in milliseconds */ 44 __u32 duration; /* [o] time to complete, in milliseconds */
41 __u32 response_len; /* [o] bytes of response actually written */ 45 __u32 response_len; /* [o] bytes of response actually written */
42 __s32 din_resid; /* [o] actual_din_xfer_len - din_xfer_len */ 46 __s32 din_resid; /* [o] din_xfer_len - actual_din_xfer_len */
43 __u32 generated_tag; /* [o] {SCSI: task tag that transport chose} */ 47 __s32 dout_resid; /* [o] dout_xfer_len - actual_dout_xfer_len */
48 __u64 generated_tag; /* [o] {SCSI: transport generated task tag} */
44 __u32 spare_out; /* [o] */ 49 __u32 spare_out; /* [o] */
45 50
46 __u32 padding; 51 __u32 padding;
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild
index 43397a414cd6..ab57cb7d7c61 100644
--- a/include/linux/netfilter/Kbuild
+++ b/include/linux/netfilter/Kbuild
@@ -28,6 +28,7 @@ header-y += xt_policy.h
28header-y += xt_realm.h 28header-y += xt_realm.h
29header-y += xt_sctp.h 29header-y += xt_sctp.h
30header-y += xt_state.h 30header-y += xt_state.h
31header-y += xt_statistic.h
31header-y += xt_string.h 32header-y += xt_string.h
32header-y += xt_tcpmss.h 33header-y += xt_tcpmss.h
33header-y += xt_tcpudp.h 34header-y += xt_tcpudp.h
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 16baef4dab7e..d529045c1679 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -190,6 +190,16 @@ void sctp_assocs_proc_exit(void);
190 190
191 191
192/* 192/*
193 * Module global variables
194 */
195
196 /*
197 * sctp/protocol.c
198 */
199extern struct kmem_cache *sctp_chunk_cachep __read_mostly;
200extern struct kmem_cache *sctp_bucket_cachep __read_mostly;
201
202/*
193 * Section: Macros, externs, and inlines 203 * Section: Macros, externs, and inlines
194 */ 204 */
195 205
diff --git a/include/net/tcp.h b/include/net/tcp.h
index c209361ab74a..185c7ecce4cc 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -281,7 +281,7 @@ extern int tcp_v4_remember_stamp(struct sock *sk);
281 281
282extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); 282extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw);
283 283
284extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, 284extern int tcp_sendmsg(struct kiocb *iocb, struct socket *sock,
285 struct msghdr *msg, size_t size); 285 struct msghdr *msg, size_t size);
286extern ssize_t tcp_sendpage(struct socket *sock, struct page *page, int offset, size_t size, int flags); 286extern ssize_t tcp_sendpage(struct socket *sock, struct page *page, int offset, size_t size, int flags);
287 287
diff --git a/include/scsi/scsi_driver.h b/include/scsi/scsi_driver.h
index 02e26c1672bf..3465f31a21c4 100644
--- a/include/scsi/scsi_driver.h
+++ b/include/scsi/scsi_driver.h
@@ -13,8 +13,6 @@ struct scsi_driver {
13 13
14 int (*init_command)(struct scsi_cmnd *); 14 int (*init_command)(struct scsi_cmnd *);
15 void (*rescan)(struct device *); 15 void (*rescan)(struct device *);
16 int (*issue_flush)(struct device *, sector_t *);
17 int (*prepare_flush)(struct request_queue *, struct request *);
18}; 16};
19#define to_scsi_driver(drv) \ 17#define to_scsi_driver(drv) \
20 container_of((drv), struct scsi_driver, gendrv) 18 container_of((drv), struct scsi_driver, gendrv)
diff --git a/include/scsi/sd.h b/include/scsi/sd.h
index 78583fee0ab2..ce02ad1f5185 100644
--- a/include/scsi/sd.h
+++ b/include/scsi/sd.h
@@ -56,8 +56,6 @@ static int sd_suspend(struct device *dev, pm_message_t state);
56static int sd_resume(struct device *dev); 56static int sd_resume(struct device *dev);
57static void sd_rescan(struct device *); 57static void sd_rescan(struct device *);
58static int sd_init_command(struct scsi_cmnd *); 58static int sd_init_command(struct scsi_cmnd *);
59static int sd_issue_flush(struct device *, sector_t *);
60static void sd_prepare_flush(struct request_queue *, struct request *);
61static void sd_read_capacity(struct scsi_disk *sdkp, unsigned char *buffer); 59static void sd_read_capacity(struct scsi_disk *sdkp, unsigned char *buffer);
62static void scsi_disk_release(struct class_device *cdev); 60static void scsi_disk_release(struct class_device *cdev);
63static void sd_print_sense_hdr(struct scsi_disk *, struct scsi_sense_hdr *); 61static void sd_print_sense_hdr(struct scsi_disk *, struct scsi_sense_hdr *);
diff --git a/kernel/exit.c b/kernel/exit.c
index 464c2b172f07..9578c1ae19ca 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -813,7 +813,7 @@ static void exit_notify(struct task_struct *tsk)
813 __kill_pgrp_info(SIGCONT, SEND_SIG_PRIV, pgrp); 813 __kill_pgrp_info(SIGCONT, SEND_SIG_PRIV, pgrp);
814 } 814 }
815 815
816 /* Let father know we died 816 /* Let father know we died
817 * 817 *
818 * Thread signals are configurable, but you aren't going to use 818 * Thread signals are configurable, but you aren't going to use
819 * that to send signals to arbitary processes. 819 * that to send signals to arbitary processes.
@@ -826,9 +826,7 @@ static void exit_notify(struct task_struct *tsk)
826 * If our self_exec id doesn't match our parent_exec_id then 826 * If our self_exec id doesn't match our parent_exec_id then
827 * we have changed execution domain as these two values started 827 * we have changed execution domain as these two values started
828 * the same after a fork. 828 * the same after a fork.
829 *
830 */ 829 */
831
832 if (tsk->exit_signal != SIGCHLD && tsk->exit_signal != -1 && 830 if (tsk->exit_signal != SIGCHLD && tsk->exit_signal != -1 &&
833 ( tsk->parent_exec_id != t->self_exec_id || 831 ( tsk->parent_exec_id != t->self_exec_id ||
834 tsk->self_exec_id != tsk->parent_exec_id) 832 tsk->self_exec_id != tsk->parent_exec_id)
@@ -848,9 +846,7 @@ static void exit_notify(struct task_struct *tsk)
848 } 846 }
849 847
850 state = EXIT_ZOMBIE; 848 state = EXIT_ZOMBIE;
851 if (tsk->exit_signal == -1 && 849 if (tsk->exit_signal == -1 && likely(!tsk->ptrace))
852 (likely(tsk->ptrace == 0) ||
853 unlikely(tsk->parent->signal->flags & SIGNAL_GROUP_EXIT)))
854 state = EXIT_DEAD; 850 state = EXIT_DEAD;
855 tsk->exit_state = state; 851 tsk->exit_state = state;
856 852
diff --git a/kernel/printk.c b/kernel/printk.c
index 051d27e36a6c..bd2cd062878d 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -732,7 +732,7 @@ int __init add_preferred_console(char *name, int idx, char *options)
732 return 0; 732 return 0;
733} 733}
734 734
735int __init update_console_cmdline(char *name, int idx, char *name_new, int idx_new, char *options) 735int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, char *options)
736{ 736{
737 struct console_cmdline *c; 737 struct console_cmdline *c;
738 int i; 738 int i;
diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c
index 1c61e5315ad2..8421b9399e10 100644
--- a/kernel/sched_debug.c
+++ b/kernel/sched_debug.c
@@ -36,24 +36,24 @@ print_task(struct seq_file *m, struct rq *rq, struct task_struct *p, u64 now)
36 else 36 else
37 SEQ_printf(m, " "); 37 SEQ_printf(m, " ");
38 38
39 SEQ_printf(m, "%15s %5d %15Ld %13Ld %13Ld %9Ld %5d " 39 SEQ_printf(m, "%15s %5d %15Ld %13Ld %13Ld %9Ld %5d ",
40 "%15Ld %15Ld %15Ld %15Ld %15Ld\n",
41 p->comm, p->pid, 40 p->comm, p->pid,
42 (long long)p->se.fair_key, 41 (long long)p->se.fair_key,
43 (long long)(p->se.fair_key - rq->cfs.fair_clock), 42 (long long)(p->se.fair_key - rq->cfs.fair_clock),
44 (long long)p->se.wait_runtime, 43 (long long)p->se.wait_runtime,
45 (long long)(p->nvcsw + p->nivcsw), 44 (long long)(p->nvcsw + p->nivcsw),
46 p->prio, 45 p->prio);
47#ifdef CONFIG_SCHEDSTATS 46#ifdef CONFIG_SCHEDSTATS
47 SEQ_printf(m, "%15Ld %15Ld %15Ld %15Ld %15Ld\n",
48 (long long)p->se.sum_exec_runtime, 48 (long long)p->se.sum_exec_runtime,
49 (long long)p->se.sum_wait_runtime, 49 (long long)p->se.sum_wait_runtime,
50 (long long)p->se.sum_sleep_runtime, 50 (long long)p->se.sum_sleep_runtime,
51 (long long)p->se.wait_runtime_overruns, 51 (long long)p->se.wait_runtime_overruns,
52 (long long)p->se.wait_runtime_underruns 52 (long long)p->se.wait_runtime_underruns);
53#else 53#else
54 0LL, 0LL, 0LL, 0LL, 0LL 54 SEQ_printf(m, "%15Ld %15Ld %15Ld %15Ld %15Ld\n",
55 0LL, 0LL, 0LL, 0LL, 0LL);
55#endif 56#endif
56 );
57} 57}
58 58
59static void print_rq(struct seq_file *m, struct rq *rq, int rq_cpu, u64 now) 59static void print_rq(struct seq_file *m, struct rq *rq, int rq_cpu, u64 now)
diff --git a/kernel/signal.c b/kernel/signal.c
index ef8156a6aad5..b27c01a66448 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1561,10 +1561,6 @@ static inline int may_ptrace_stop(void)
1561 (current->ptrace & PT_ATTACHED))) 1561 (current->ptrace & PT_ATTACHED)))
1562 return 0; 1562 return 0;
1563 1563
1564 if (unlikely(current->signal == current->parent->signal) &&
1565 unlikely(current->signal->flags & SIGNAL_GROUP_EXIT))
1566 return 0;
1567
1568 /* 1564 /*
1569 * Are we in the middle of do_coredump? 1565 * Are we in the middle of do_coredump?
1570 * If so and our tracer is also part of the coredump stopping 1566 * If so and our tracer is also part of the coredump stopping
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 06c08e5740fb..e68103475cca 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -831,7 +831,7 @@ const struct proto_ops inet_stream_ops = {
831 .shutdown = inet_shutdown, 831 .shutdown = inet_shutdown,
832 .setsockopt = sock_common_setsockopt, 832 .setsockopt = sock_common_setsockopt,
833 .getsockopt = sock_common_getsockopt, 833 .getsockopt = sock_common_getsockopt,
834 .sendmsg = inet_sendmsg, 834 .sendmsg = tcp_sendmsg,
835 .recvmsg = sock_common_recvmsg, 835 .recvmsg = sock_common_recvmsg,
836 .mmap = sock_no_mmap, 836 .mmap = sock_no_mmap,
837 .sendpage = tcp_sendpage, 837 .sendpage = tcp_sendpage,
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
index 27c7918e442a..b3dd5de9a258 100644
--- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
+++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
@@ -294,15 +294,14 @@ static int exp_open(struct inode *inode, struct file *file)
294 struct ct_expect_iter_state *st; 294 struct ct_expect_iter_state *st;
295 int ret; 295 int ret;
296 296
297 st = kmalloc(sizeof(struct ct_expect_iter_state), GFP_KERNEL); 297 st = kzalloc(sizeof(struct ct_expect_iter_state), GFP_KERNEL);
298 if (st == NULL) 298 if (!st)
299 return -ENOMEM; 299 return -ENOMEM;
300 ret = seq_open(file, &exp_seq_ops); 300 ret = seq_open(file, &exp_seq_ops);
301 if (ret) 301 if (ret)
302 goto out_free; 302 goto out_free;
303 seq = file->private_data; 303 seq = file->private_data;
304 seq->private = st; 304 seq->private = st;
305 memset(st, 0, sizeof(struct ct_expect_iter_state));
306 return ret; 305 return ret;
307out_free: 306out_free:
308 kfree(st); 307 kfree(st);
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 24d7c9f31918..c6d71526f625 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -900,8 +900,9 @@ static int raw_seq_open(struct inode *inode, struct file *file)
900{ 900{
901 struct seq_file *seq; 901 struct seq_file *seq;
902 int rc = -ENOMEM; 902 int rc = -ENOMEM;
903 struct raw_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL); 903 struct raw_iter_state *s;
904 904
905 s = kzalloc(sizeof(*s), GFP_KERNEL);
905 if (!s) 906 if (!s)
906 goto out; 907 goto out;
907 rc = seq_open(file, &raw_seq_ops); 908 rc = seq_open(file, &raw_seq_ops);
@@ -910,7 +911,6 @@ static int raw_seq_open(struct inode *inode, struct file *file)
910 911
911 seq = file->private_data; 912 seq = file->private_data;
912 seq->private = s; 913 seq->private = s;
913 memset(s, 0, sizeof(*s));
914out: 914out:
915 return rc; 915 return rc;
916out_kfree: 916out_kfree:
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index df42b7fb3268..c7ca94bd152c 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -374,8 +374,9 @@ static int rt_cache_seq_open(struct inode *inode, struct file *file)
374{ 374{
375 struct seq_file *seq; 375 struct seq_file *seq;
376 int rc = -ENOMEM; 376 int rc = -ENOMEM;
377 struct rt_cache_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL); 377 struct rt_cache_iter_state *s;
378 378
379 s = kzalloc(sizeof(*s), GFP_KERNEL);
379 if (!s) 380 if (!s)
380 goto out; 381 goto out;
381 rc = seq_open(file, &rt_cache_seq_ops); 382 rc = seq_open(file, &rt_cache_seq_ops);
@@ -383,7 +384,6 @@ static int rt_cache_seq_open(struct inode *inode, struct file *file)
383 goto out_kfree; 384 goto out_kfree;
384 seq = file->private_data; 385 seq = file->private_data;
385 seq->private = s; 386 seq->private = s;
386 memset(s, 0, sizeof(*s));
387out: 387out:
388 return rc; 388 return rc;
389out_kfree: 389out_kfree:
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index da4c0b6ab79a..7e740112b238 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -658,9 +658,10 @@ static inline int select_size(struct sock *sk)
658 return tmp; 658 return tmp;
659} 659}
660 660
661int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, 661int tcp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
662 size_t size) 662 size_t size)
663{ 663{
664 struct sock *sk = sock->sk;
664 struct iovec *iov; 665 struct iovec *iov;
665 struct tcp_sock *tp = tcp_sk(sk); 666 struct tcp_sock *tp = tcp_sk(sk);
666 struct sk_buff *skb; 667 struct sk_buff *skb;
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 378ca8a086a3..f030435e0eb4 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -102,11 +102,14 @@ int sysctl_tcp_abc __read_mostly;
102#define FLAG_DATA_LOST 0x80 /* SACK detected data lossage. */ 102#define FLAG_DATA_LOST 0x80 /* SACK detected data lossage. */
103#define FLAG_SLOWPATH 0x100 /* Do not skip RFC checks for window update.*/ 103#define FLAG_SLOWPATH 0x100 /* Do not skip RFC checks for window update.*/
104#define FLAG_ONLY_ORIG_SACKED 0x200 /* SACKs only non-rexmit sent before RTO */ 104#define FLAG_ONLY_ORIG_SACKED 0x200 /* SACKs only non-rexmit sent before RTO */
105#define FLAG_SND_UNA_ADVANCED 0x400 /* Snd_una was changed (!= FLAG_DATA_ACKED) */
106#define FLAG_DSACKING_ACK 0x800 /* SACK blocks contained DSACK info */
105 107
106#define FLAG_ACKED (FLAG_DATA_ACKED|FLAG_SYN_ACKED) 108#define FLAG_ACKED (FLAG_DATA_ACKED|FLAG_SYN_ACKED)
107#define FLAG_NOT_DUP (FLAG_DATA|FLAG_WIN_UPDATE|FLAG_ACKED) 109#define FLAG_NOT_DUP (FLAG_DATA|FLAG_WIN_UPDATE|FLAG_ACKED)
108#define FLAG_CA_ALERT (FLAG_DATA_SACKED|FLAG_ECE) 110#define FLAG_CA_ALERT (FLAG_DATA_SACKED|FLAG_ECE)
109#define FLAG_FORWARD_PROGRESS (FLAG_ACKED|FLAG_DATA_SACKED) 111#define FLAG_FORWARD_PROGRESS (FLAG_ACKED|FLAG_DATA_SACKED)
112#define FLAG_ANY_PROGRESS (FLAG_FORWARD_PROGRESS|FLAG_SND_UNA_ADVANCED)
110 113
111#define IsReno(tp) ((tp)->rx_opt.sack_ok == 0) 114#define IsReno(tp) ((tp)->rx_opt.sack_ok == 0)
112#define IsFack(tp) ((tp)->rx_opt.sack_ok & 2) 115#define IsFack(tp) ((tp)->rx_opt.sack_ok & 2)
@@ -964,12 +967,14 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
964 967
965 /* Check for D-SACK. */ 968 /* Check for D-SACK. */
966 if (before(ntohl(sp[0].start_seq), TCP_SKB_CB(ack_skb)->ack_seq)) { 969 if (before(ntohl(sp[0].start_seq), TCP_SKB_CB(ack_skb)->ack_seq)) {
970 flag |= FLAG_DSACKING_ACK;
967 found_dup_sack = 1; 971 found_dup_sack = 1;
968 tp->rx_opt.sack_ok |= 4; 972 tp->rx_opt.sack_ok |= 4;
969 NET_INC_STATS_BH(LINUX_MIB_TCPDSACKRECV); 973 NET_INC_STATS_BH(LINUX_MIB_TCPDSACKRECV);
970 } else if (num_sacks > 1 && 974 } else if (num_sacks > 1 &&
971 !after(ntohl(sp[0].end_seq), ntohl(sp[1].end_seq)) && 975 !after(ntohl(sp[0].end_seq), ntohl(sp[1].end_seq)) &&
972 !before(ntohl(sp[0].start_seq), ntohl(sp[1].start_seq))) { 976 !before(ntohl(sp[0].start_seq), ntohl(sp[1].start_seq))) {
977 flag |= FLAG_DSACKING_ACK;
973 found_dup_sack = 1; 978 found_dup_sack = 1;
974 tp->rx_opt.sack_ok |= 4; 979 tp->rx_opt.sack_ok |= 4;
975 NET_INC_STATS_BH(LINUX_MIB_TCPDSACKOFORECV); 980 NET_INC_STATS_BH(LINUX_MIB_TCPDSACKOFORECV);
@@ -1856,7 +1861,7 @@ static void tcp_cwnd_down(struct sock *sk, int flag)
1856 struct tcp_sock *tp = tcp_sk(sk); 1861 struct tcp_sock *tp = tcp_sk(sk);
1857 int decr = tp->snd_cwnd_cnt + 1; 1862 int decr = tp->snd_cwnd_cnt + 1;
1858 1863
1859 if ((flag&FLAG_FORWARD_PROGRESS) || 1864 if ((flag&(FLAG_ANY_PROGRESS|FLAG_DSACKING_ACK)) ||
1860 (IsReno(tp) && !(flag&FLAG_NOT_DUP))) { 1865 (IsReno(tp) && !(flag&FLAG_NOT_DUP))) {
1861 tp->snd_cwnd_cnt = decr&1; 1866 tp->snd_cwnd_cnt = decr&1;
1862 decr >>= 1; 1867 decr >>= 1;
@@ -2107,15 +2112,13 @@ static void tcp_mtup_probe_success(struct sock *sk, struct sk_buff *skb)
2107 * tcp_xmit_retransmit_queue(). 2112 * tcp_xmit_retransmit_queue().
2108 */ 2113 */
2109static void 2114static void
2110tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una, 2115tcp_fastretrans_alert(struct sock *sk, int prior_packets, int flag)
2111 int prior_packets, int flag)
2112{ 2116{
2113 struct inet_connection_sock *icsk = inet_csk(sk); 2117 struct inet_connection_sock *icsk = inet_csk(sk);
2114 struct tcp_sock *tp = tcp_sk(sk); 2118 struct tcp_sock *tp = tcp_sk(sk);
2115 int is_dupack = (tp->snd_una == prior_snd_una && 2119 int is_dupack = !(flag&(FLAG_SND_UNA_ADVANCED|FLAG_NOT_DUP));
2116 (!(flag&FLAG_NOT_DUP) || 2120 int do_lost = is_dupack || ((flag&FLAG_DATA_SACKED) &&
2117 ((flag&FLAG_DATA_SACKED) && 2121 (tp->fackets_out > tp->reordering));
2118 (tp->fackets_out > tp->reordering))));
2119 2122
2120 /* Some technical things: 2123 /* Some technical things:
2121 * 1. Reno does not count dupacks (sacked_out) automatically. */ 2124 * 1. Reno does not count dupacks (sacked_out) automatically. */
@@ -2192,14 +2195,14 @@ tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una,
2192 /* F. Process state. */ 2195 /* F. Process state. */
2193 switch (icsk->icsk_ca_state) { 2196 switch (icsk->icsk_ca_state) {
2194 case TCP_CA_Recovery: 2197 case TCP_CA_Recovery:
2195 if (prior_snd_una == tp->snd_una) { 2198 if (!(flag & FLAG_SND_UNA_ADVANCED)) {
2196 if (IsReno(tp) && is_dupack) 2199 if (IsReno(tp) && is_dupack)
2197 tcp_add_reno_sack(sk); 2200 tcp_add_reno_sack(sk);
2198 } else { 2201 } else {
2199 int acked = prior_packets - tp->packets_out; 2202 int acked = prior_packets - tp->packets_out;
2200 if (IsReno(tp)) 2203 if (IsReno(tp))
2201 tcp_remove_reno_sacks(sk, acked); 2204 tcp_remove_reno_sacks(sk, acked);
2202 is_dupack = tcp_try_undo_partial(sk, acked); 2205 do_lost = tcp_try_undo_partial(sk, acked);
2203 } 2206 }
2204 break; 2207 break;
2205 case TCP_CA_Loss: 2208 case TCP_CA_Loss:
@@ -2215,7 +2218,7 @@ tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una,
2215 /* Loss is undone; fall through to processing in Open state. */ 2218 /* Loss is undone; fall through to processing in Open state. */
2216 default: 2219 default:
2217 if (IsReno(tp)) { 2220 if (IsReno(tp)) {
2218 if (tp->snd_una != prior_snd_una) 2221 if (flag & FLAG_SND_UNA_ADVANCED)
2219 tcp_reset_reno_sack(tp); 2222 tcp_reset_reno_sack(tp);
2220 if (is_dupack) 2223 if (is_dupack)
2221 tcp_add_reno_sack(sk); 2224 tcp_add_reno_sack(sk);
@@ -2264,7 +2267,7 @@ tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una,
2264 tcp_set_ca_state(sk, TCP_CA_Recovery); 2267 tcp_set_ca_state(sk, TCP_CA_Recovery);
2265 } 2268 }
2266 2269
2267 if (is_dupack || tcp_head_timedout(sk)) 2270 if (do_lost || tcp_head_timedout(sk))
2268 tcp_update_scoreboard(sk); 2271 tcp_update_scoreboard(sk);
2269 tcp_cwnd_down(sk, flag); 2272 tcp_cwnd_down(sk, flag);
2270 tcp_xmit_retransmit_queue(sk); 2273 tcp_xmit_retransmit_queue(sk);
@@ -2684,7 +2687,7 @@ static void tcp_undo_spur_to_response(struct sock *sk, int flag)
2684 * to prove that the RTO is indeed spurious. It transfers the control 2687 * to prove that the RTO is indeed spurious. It transfers the control
2685 * from F-RTO to the conventional RTO recovery 2688 * from F-RTO to the conventional RTO recovery
2686 */ 2689 */
2687static int tcp_process_frto(struct sock *sk, u32 prior_snd_una, int flag) 2690static int tcp_process_frto(struct sock *sk, int flag)
2688{ 2691{
2689 struct tcp_sock *tp = tcp_sk(sk); 2692 struct tcp_sock *tp = tcp_sk(sk);
2690 2693
@@ -2704,8 +2707,7 @@ static int tcp_process_frto(struct sock *sk, u32 prior_snd_una, int flag)
2704 * ACK isn't duplicate nor advances window, e.g., opposite dir 2707 * ACK isn't duplicate nor advances window, e.g., opposite dir
2705 * data, winupdate 2708 * data, winupdate
2706 */ 2709 */
2707 if ((tp->snd_una == prior_snd_una) && (flag&FLAG_NOT_DUP) && 2710 if (!(flag&FLAG_ANY_PROGRESS) && (flag&FLAG_NOT_DUP))
2708 !(flag&FLAG_FORWARD_PROGRESS))
2709 return 1; 2711 return 1;
2710 2712
2711 if (!(flag&FLAG_DATA_ACKED)) { 2713 if (!(flag&FLAG_DATA_ACKED)) {
@@ -2785,6 +2787,9 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag)
2785 if (before(ack, prior_snd_una)) 2787 if (before(ack, prior_snd_una))
2786 goto old_ack; 2788 goto old_ack;
2787 2789
2790 if (after(ack, prior_snd_una))
2791 flag |= FLAG_SND_UNA_ADVANCED;
2792
2788 if (sysctl_tcp_abc) { 2793 if (sysctl_tcp_abc) {
2789 if (icsk->icsk_ca_state < TCP_CA_CWR) 2794 if (icsk->icsk_ca_state < TCP_CA_CWR)
2790 tp->bytes_acked += ack - prior_snd_una; 2795 tp->bytes_acked += ack - prior_snd_una;
@@ -2837,14 +2842,14 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag)
2837 flag |= tcp_clean_rtx_queue(sk, &seq_rtt); 2842 flag |= tcp_clean_rtx_queue(sk, &seq_rtt);
2838 2843
2839 if (tp->frto_counter) 2844 if (tp->frto_counter)
2840 frto_cwnd = tcp_process_frto(sk, prior_snd_una, flag); 2845 frto_cwnd = tcp_process_frto(sk, flag);
2841 2846
2842 if (tcp_ack_is_dubious(sk, flag)) { 2847 if (tcp_ack_is_dubious(sk, flag)) {
2843 /* Advance CWND, if state allows this. */ 2848 /* Advance CWND, if state allows this. */
2844 if ((flag & FLAG_DATA_ACKED) && !frto_cwnd && 2849 if ((flag & FLAG_DATA_ACKED) && !frto_cwnd &&
2845 tcp_may_raise_cwnd(sk, flag)) 2850 tcp_may_raise_cwnd(sk, flag))
2846 tcp_cong_avoid(sk, ack, prior_in_flight, 0); 2851 tcp_cong_avoid(sk, ack, prior_in_flight, 0);
2847 tcp_fastretrans_alert(sk, prior_snd_una, prior_packets, flag); 2852 tcp_fastretrans_alert(sk, prior_packets, flag);
2848 } else { 2853 } else {
2849 if ((flag & FLAG_DATA_ACKED) && !frto_cwnd) 2854 if ((flag & FLAG_DATA_ACKED) && !frto_cwnd)
2850 tcp_cong_avoid(sk, ack, prior_in_flight, 1); 2855 tcp_cong_avoid(sk, ack, prior_in_flight, 1);
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 3f5f7423b95c..9c94627c8c7e 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -2425,7 +2425,6 @@ struct proto tcp_prot = {
2425 .shutdown = tcp_shutdown, 2425 .shutdown = tcp_shutdown,
2426 .setsockopt = tcp_setsockopt, 2426 .setsockopt = tcp_setsockopt,
2427 .getsockopt = tcp_getsockopt, 2427 .getsockopt = tcp_getsockopt,
2428 .sendmsg = tcp_sendmsg,
2429 .recvmsg = tcp_recvmsg, 2428 .recvmsg = tcp_recvmsg,
2430 .backlog_rcv = tcp_v4_do_rcv, 2429 .backlog_rcv = tcp_v4_do_rcv,
2431 .hash = tcp_v4_hash, 2430 .hash = tcp_v4_hash,
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index eed09373a45d..b5f96372ad73 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -484,7 +484,7 @@ const struct proto_ops inet6_stream_ops = {
484 .shutdown = inet_shutdown, /* ok */ 484 .shutdown = inet_shutdown, /* ok */
485 .setsockopt = sock_common_setsockopt, /* ok */ 485 .setsockopt = sock_common_setsockopt, /* ok */
486 .getsockopt = sock_common_getsockopt, /* ok */ 486 .getsockopt = sock_common_getsockopt, /* ok */
487 .sendmsg = inet_sendmsg, /* ok */ 487 .sendmsg = tcp_sendmsg, /* ok */
488 .recvmsg = sock_common_recvmsg, /* ok */ 488 .recvmsg = sock_common_recvmsg, /* ok */
489 .mmap = sock_no_mmap, 489 .mmap = sock_no_mmap,
490 .sendpage = tcp_sendpage, 490 .sendpage = tcp_sendpage,
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index f10f3689d671..cbdb78487915 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -2115,7 +2115,6 @@ struct proto tcpv6_prot = {
2115 .shutdown = tcp_shutdown, 2115 .shutdown = tcp_shutdown,
2116 .setsockopt = tcp_setsockopt, 2116 .setsockopt = tcp_setsockopt,
2117 .getsockopt = tcp_getsockopt, 2117 .getsockopt = tcp_getsockopt,
2118 .sendmsg = tcp_sendmsg,
2119 .recvmsg = tcp_recvmsg, 2118 .recvmsg = tcp_recvmsg,
2120 .backlog_rcv = tcp_v6_do_rcv, 2119 .backlog_rcv = tcp_v6_do_rcv,
2121 .hash = tcp_v6_hash, 2120 .hash = tcp_v6_hash,
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 7b0a95abe934..5502df115a63 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -1206,6 +1206,9 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct sadb_msg *hdr,
1206 x->sel.prefixlen_s = addr->sadb_address_prefixlen; 1206 x->sel.prefixlen_s = addr->sadb_address_prefixlen;
1207 } 1207 }
1208 1208
1209 if (!x->sel.family)
1210 x->sel.family = x->props.family;
1211
1209 if (ext_hdrs[SADB_X_EXT_NAT_T_TYPE-1]) { 1212 if (ext_hdrs[SADB_X_EXT_NAT_T_TYPE-1]) {
1210 struct sadb_x_nat_t_type* n_type; 1213 struct sadb_x_nat_t_type* n_type;
1211 struct xfrm_encap_tmpl *natt; 1214 struct xfrm_encap_tmpl *natt;
diff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c
index eb6695dcd73b..3ac64e25f10c 100644
--- a/net/netfilter/nf_conntrack_expect.c
+++ b/net/netfilter/nf_conntrack_expect.c
@@ -477,15 +477,14 @@ static int exp_open(struct inode *inode, struct file *file)
477 struct ct_expect_iter_state *st; 477 struct ct_expect_iter_state *st;
478 int ret; 478 int ret;
479 479
480 st = kmalloc(sizeof(struct ct_expect_iter_state), GFP_KERNEL); 480 st = kzalloc(sizeof(struct ct_expect_iter_state), GFP_KERNEL);
481 if (st == NULL) 481 if (!st)
482 return -ENOMEM; 482 return -ENOMEM;
483 ret = seq_open(file, &exp_seq_ops); 483 ret = seq_open(file, &exp_seq_ops);
484 if (ret) 484 if (ret)
485 goto out_free; 485 goto out_free;
486 seq = file->private_data; 486 seq = file->private_data;
487 seq->private = st; 487 seq->private = st;
488 memset(st, 0, sizeof(struct ct_expect_iter_state));
489 return ret; 488 return ret;
490out_free: 489out_free:
491 kfree(st); 490 kfree(st);
diff --git a/net/sctp/input.c b/net/sctp/input.c
index d57ff7f3c576..47e56017f4ce 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -590,7 +590,7 @@ out_unlock:
590 * Return 0 - If further processing is needed. 590 * Return 0 - If further processing is needed.
591 * Return 1 - If the packet can be discarded right away. 591 * Return 1 - If the packet can be discarded right away.
592 */ 592 */
593int sctp_rcv_ootb(struct sk_buff *skb) 593static int sctp_rcv_ootb(struct sk_buff *skb)
594{ 594{
595 sctp_chunkhdr_t *ch; 595 sctp_chunkhdr_t *ch;
596 __u8 *ch_end; 596 __u8 *ch_end;
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 2c29394fd92e..f8aa23dda1c1 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -641,6 +641,8 @@ static struct sock *sctp_v6_create_accept_sk(struct sock *sk,
641 newsctp6sk = (struct sctp6_sock *)newsk; 641 newsctp6sk = (struct sctp6_sock *)newsk;
642 inet_sk(newsk)->pinet6 = &newsctp6sk->inet6; 642 inet_sk(newsk)->pinet6 = &newsctp6sk->inet6;
643 643
644 sctp_sk(newsk)->v4mapped = sctp_sk(sk)->v4mapped;
645
644 newinet = inet_sk(newsk); 646 newinet = inet_sk(newsk);
645 newnp = inet6_sk(newsk); 647 newnp = inet6_sk(newsk);
646 648
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 8d18f570c2e6..51c4d7fef1d2 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -65,8 +65,6 @@
65#include <net/sctp/sctp.h> 65#include <net/sctp/sctp.h>
66#include <net/sctp/sm.h> 66#include <net/sctp/sm.h>
67 67
68extern struct kmem_cache *sctp_chunk_cachep;
69
70SCTP_STATIC 68SCTP_STATIC
71struct sctp_chunk *sctp_make_chunk(const struct sctp_association *asoc, 69struct sctp_chunk *sctp_make_chunk(const struct sctp_association *asoc,
72 __u8 type, __u8 flags, int paylen); 70 __u8 type, __u8 flags, int paylen);
@@ -115,15 +113,12 @@ void sctp_init_cause(struct sctp_chunk *chunk, __be16 cause_code,
115 const void *payload, size_t paylen) 113 const void *payload, size_t paylen)
116{ 114{
117 sctp_errhdr_t err; 115 sctp_errhdr_t err;
118 int padlen;
119 __u16 len; 116 __u16 len;
120 117
121 /* Cause code constants are now defined in network order. */ 118 /* Cause code constants are now defined in network order. */
122 err.cause = cause_code; 119 err.cause = cause_code;
123 len = sizeof(sctp_errhdr_t) + paylen; 120 len = sizeof(sctp_errhdr_t) + paylen;
124 padlen = len % 4;
125 err.length = htons(len); 121 err.length = htons(len);
126 len += padlen;
127 chunk->subh.err_hdr = sctp_addto_chunk(chunk, sizeof(sctp_errhdr_t), &err); 122 chunk->subh.err_hdr = sctp_addto_chunk(chunk, sizeof(sctp_errhdr_t), &err);
128 sctp_addto_chunk(chunk, paylen, payload); 123 sctp_addto_chunk(chunk, paylen, payload);
129} 124}
@@ -1454,7 +1449,6 @@ no_hmac:
1454 do_gettimeofday(&tv); 1449 do_gettimeofday(&tv);
1455 1450
1456 if (!asoc && tv_lt(bear_cookie->expiration, tv)) { 1451 if (!asoc && tv_lt(bear_cookie->expiration, tv)) {
1457 __u16 len;
1458 /* 1452 /*
1459 * Section 3.3.10.3 Stale Cookie Error (3) 1453 * Section 3.3.10.3 Stale Cookie Error (3)
1460 * 1454 *
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index fd2dfdd7d7fd..71cad56dd73f 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -97,6 +97,13 @@ static sctp_disposition_t sctp_stop_t1_and_abort(sctp_cmd_seq_t *commands,
97 const struct sctp_association *asoc, 97 const struct sctp_association *asoc,
98 struct sctp_transport *transport); 98 struct sctp_transport *transport);
99 99
100static sctp_disposition_t sctp_sf_abort_violation(
101 const struct sctp_association *asoc,
102 void *arg,
103 sctp_cmd_seq_t *commands,
104 const __u8 *payload,
105 const size_t paylen);
106
100static sctp_disposition_t sctp_sf_violation_chunklen( 107static sctp_disposition_t sctp_sf_violation_chunklen(
101 const struct sctp_endpoint *ep, 108 const struct sctp_endpoint *ep,
102 const struct sctp_association *asoc, 109 const struct sctp_association *asoc,
@@ -104,6 +111,13 @@ static sctp_disposition_t sctp_sf_violation_chunklen(
104 void *arg, 111 void *arg,
105 sctp_cmd_seq_t *commands); 112 sctp_cmd_seq_t *commands);
106 113
114static sctp_disposition_t sctp_sf_violation_ctsn(
115 const struct sctp_endpoint *ep,
116 const struct sctp_association *asoc,
117 const sctp_subtype_t type,
118 void *arg,
119 sctp_cmd_seq_t *commands);
120
107/* Small helper function that checks if the chunk length 121/* Small helper function that checks if the chunk length
108 * is of the appropriate length. The 'required_length' argument 122 * is of the appropriate length. The 'required_length' argument
109 * is set to be the size of a specific chunk we are testing. 123 * is set to be the size of a specific chunk we are testing.
@@ -2880,6 +2894,13 @@ sctp_disposition_t sctp_sf_eat_sack_6_2(const struct sctp_endpoint *ep,
2880 return SCTP_DISPOSITION_DISCARD; 2894 return SCTP_DISPOSITION_DISCARD;
2881 } 2895 }
2882 2896
2897 /* If Cumulative TSN Ack beyond the max tsn currently
2898 * send, terminating the association and respond to the
2899 * sender with an ABORT.
2900 */
2901 if (!TSN_lt(ctsn, asoc->next_tsn))
2902 return sctp_sf_violation_ctsn(ep, asoc, type, arg, commands);
2903
2883 /* Return this SACK for further processing. */ 2904 /* Return this SACK for further processing. */
2884 sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_SACK, SCTP_SACKH(sackh)); 2905 sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_SACK, SCTP_SACKH(sackh));
2885 2906
@@ -3691,40 +3712,21 @@ sctp_disposition_t sctp_sf_violation(const struct sctp_endpoint *ep,
3691 return SCTP_DISPOSITION_VIOLATION; 3712 return SCTP_DISPOSITION_VIOLATION;
3692} 3713}
3693 3714
3694
3695/* 3715/*
3696 * Handle a protocol violation when the chunk length is invalid. 3716 * Common function to handle a protocol violation.
3697 * "Invalid" length is identified as smaller then the minimal length a
3698 * given chunk can be. For example, a SACK chunk has invalid length
3699 * if it's length is set to be smaller then the size of sctp_sack_chunk_t.
3700 *
3701 * We inform the other end by sending an ABORT with a Protocol Violation
3702 * error code.
3703 *
3704 * Section: Not specified
3705 * Verification Tag: Nothing to do
3706 * Inputs
3707 * (endpoint, asoc, chunk)
3708 *
3709 * Outputs
3710 * (reply_msg, msg_up, counters)
3711 *
3712 * Generate an ABORT chunk and terminate the association.
3713 */ 3717 */
3714static sctp_disposition_t sctp_sf_violation_chunklen( 3718static sctp_disposition_t sctp_sf_abort_violation(
3715 const struct sctp_endpoint *ep,
3716 const struct sctp_association *asoc, 3719 const struct sctp_association *asoc,
3717 const sctp_subtype_t type,
3718 void *arg, 3720 void *arg,
3719 sctp_cmd_seq_t *commands) 3721 sctp_cmd_seq_t *commands,
3722 const __u8 *payload,
3723 const size_t paylen)
3720{ 3724{
3721 struct sctp_chunk *chunk = arg; 3725 struct sctp_chunk *chunk = arg;
3722 struct sctp_chunk *abort = NULL; 3726 struct sctp_chunk *abort = NULL;
3723 char err_str[]="The following chunk had invalid length:";
3724 3727
3725 /* Make the abort chunk. */ 3728 /* Make the abort chunk. */
3726 abort = sctp_make_abort_violation(asoc, chunk, err_str, 3729 abort = sctp_make_abort_violation(asoc, chunk, payload, paylen);
3727 sizeof(err_str));
3728 if (!abort) 3730 if (!abort)
3729 goto nomem; 3731 goto nomem;
3730 3732
@@ -3756,6 +3758,57 @@ nomem:
3756 return SCTP_DISPOSITION_NOMEM; 3758 return SCTP_DISPOSITION_NOMEM;
3757} 3759}
3758 3760
3761/*
3762 * Handle a protocol violation when the chunk length is invalid.
3763 * "Invalid" length is identified as smaller then the minimal length a
3764 * given chunk can be. For example, a SACK chunk has invalid length
3765 * if it's length is set to be smaller then the size of sctp_sack_chunk_t.
3766 *
3767 * We inform the other end by sending an ABORT with a Protocol Violation
3768 * error code.
3769 *
3770 * Section: Not specified
3771 * Verification Tag: Nothing to do
3772 * Inputs
3773 * (endpoint, asoc, chunk)
3774 *
3775 * Outputs
3776 * (reply_msg, msg_up, counters)
3777 *
3778 * Generate an ABORT chunk and terminate the association.
3779 */
3780static sctp_disposition_t sctp_sf_violation_chunklen(
3781 const struct sctp_endpoint *ep,
3782 const struct sctp_association *asoc,
3783 const sctp_subtype_t type,
3784 void *arg,
3785 sctp_cmd_seq_t *commands)
3786{
3787 char err_str[]="The following chunk had invalid length:";
3788
3789 return sctp_sf_abort_violation(asoc, arg, commands, err_str,
3790 sizeof(err_str));
3791}
3792
3793/* Handle a protocol violation when the peer trying to advance the
3794 * cumulative tsn ack to a point beyond the max tsn currently sent.
3795 *
3796 * We inform the other end by sending an ABORT with a Protocol Violation
3797 * error code.
3798 */
3799static sctp_disposition_t sctp_sf_violation_ctsn(
3800 const struct sctp_endpoint *ep,
3801 const struct sctp_association *asoc,
3802 const sctp_subtype_t type,
3803 void *arg,
3804 sctp_cmd_seq_t *commands)
3805{
3806 char err_str[]="The cumulative tsn ack beyond the max tsn currently sent:";
3807
3808 return sctp_sf_abort_violation(asoc, arg, commands, err_str,
3809 sizeof(err_str));
3810}
3811
3759/*************************************************************************** 3812/***************************************************************************
3760 * These are the state functions for handling primitive (Section 10) events. 3813 * These are the state functions for handling primitive (Section 10) events.
3761 ***************************************************************************/ 3814 ***************************************************************************/
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index ee88f2ea5101..01c6364245b7 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -107,8 +107,6 @@ static void sctp_sock_migrate(struct sock *, struct sock *,
107 struct sctp_association *, sctp_socket_type_t); 107 struct sctp_association *, sctp_socket_type_t);
108static char *sctp_hmac_alg = SCTP_COOKIE_HMAC_ALG; 108static char *sctp_hmac_alg = SCTP_COOKIE_HMAC_ALG;
109 109
110extern struct kmem_cache *sctp_bucket_cachep;
111
112/* Get the sndbuf space available at the time on the association. */ 110/* Get the sndbuf space available at the time on the association. */
113static inline int sctp_wspace(struct sctp_association *asoc) 111static inline int sctp_wspace(struct sctp_association *asoc)
114{ 112{
@@ -433,7 +431,7 @@ out:
433 * 431 *
434 * Only sctp_setsockopt_bindx() is supposed to call this function. 432 * Only sctp_setsockopt_bindx() is supposed to call this function.
435 */ 433 */
436int sctp_bindx_add(struct sock *sk, struct sockaddr *addrs, int addrcnt) 434static int sctp_bindx_add(struct sock *sk, struct sockaddr *addrs, int addrcnt)
437{ 435{
438 int cnt; 436 int cnt;
439 int retval = 0; 437 int retval = 0;
@@ -602,7 +600,7 @@ out:
602 * 600 *
603 * Only sctp_setsockopt_bindx() is supposed to call this function. 601 * Only sctp_setsockopt_bindx() is supposed to call this function.
604 */ 602 */
605int sctp_bindx_rem(struct sock *sk, struct sockaddr *addrs, int addrcnt) 603static int sctp_bindx_rem(struct sock *sk, struct sockaddr *addrs, int addrcnt)
606{ 604{
607 struct sctp_sock *sp = sctp_sk(sk); 605 struct sctp_sock *sp = sctp_sk(sk);
608 struct sctp_endpoint *ep = sp->ep; 606 struct sctp_endpoint *ep = sp->ep;
@@ -977,7 +975,7 @@ static int __sctp_connect(struct sock* sk,
977 int err = 0; 975 int err = 0;
978 int addrcnt = 0; 976 int addrcnt = 0;
979 int walk_size = 0; 977 int walk_size = 0;
980 union sctp_addr *sa_addr; 978 union sctp_addr *sa_addr = NULL;
981 void *addr_buf; 979 void *addr_buf;
982 unsigned short port; 980 unsigned short port;
983 unsigned int f_flags = 0; 981 unsigned int f_flags = 0;
@@ -1011,7 +1009,10 @@ static int __sctp_connect(struct sock* sk,
1011 goto out_free; 1009 goto out_free;
1012 } 1010 }
1013 1011
1014 err = sctp_verify_addr(sk, sa_addr, af->sockaddr_len); 1012 /* Save current address so we can work with it */
1013 memcpy(&to, sa_addr, af->sockaddr_len);
1014
1015 err = sctp_verify_addr(sk, &to, af->sockaddr_len);
1015 if (err) 1016 if (err)
1016 goto out_free; 1017 goto out_free;
1017 1018
@@ -1021,12 +1022,11 @@ static int __sctp_connect(struct sock* sk,
1021 if (asoc && asoc->peer.port && asoc->peer.port != port) 1022 if (asoc && asoc->peer.port && asoc->peer.port != port)
1022 goto out_free; 1023 goto out_free;
1023 1024
1024 memcpy(&to, sa_addr, af->sockaddr_len);
1025 1025
1026 /* Check if there already is a matching association on the 1026 /* Check if there already is a matching association on the
1027 * endpoint (other than the one created here). 1027 * endpoint (other than the one created here).
1028 */ 1028 */
1029 asoc2 = sctp_endpoint_lookup_assoc(ep, sa_addr, &transport); 1029 asoc2 = sctp_endpoint_lookup_assoc(ep, &to, &transport);
1030 if (asoc2 && asoc2 != asoc) { 1030 if (asoc2 && asoc2 != asoc) {
1031 if (asoc2->state >= SCTP_STATE_ESTABLISHED) 1031 if (asoc2->state >= SCTP_STATE_ESTABLISHED)
1032 err = -EISCONN; 1032 err = -EISCONN;
@@ -1039,7 +1039,7 @@ static int __sctp_connect(struct sock* sk,
1039 * make sure that there is no peeled-off association matching 1039 * make sure that there is no peeled-off association matching
1040 * the peer address even on another socket. 1040 * the peer address even on another socket.
1041 */ 1041 */
1042 if (sctp_endpoint_is_peeled_off(ep, sa_addr)) { 1042 if (sctp_endpoint_is_peeled_off(ep, &to)) {
1043 err = -EADDRNOTAVAIL; 1043 err = -EADDRNOTAVAIL;
1044 goto out_free; 1044 goto out_free;
1045 } 1045 }
@@ -1070,7 +1070,7 @@ static int __sctp_connect(struct sock* sk,
1070 } 1070 }
1071 } 1071 }
1072 1072
1073 scope = sctp_scope(sa_addr); 1073 scope = sctp_scope(&to);
1074 asoc = sctp_association_new(ep, sk, scope, GFP_KERNEL); 1074 asoc = sctp_association_new(ep, sk, scope, GFP_KERNEL);
1075 if (!asoc) { 1075 if (!asoc) {
1076 err = -ENOMEM; 1076 err = -ENOMEM;
@@ -1079,7 +1079,7 @@ static int __sctp_connect(struct sock* sk,
1079 } 1079 }
1080 1080
1081 /* Prime the peer's transport structures. */ 1081 /* Prime the peer's transport structures. */
1082 transport = sctp_assoc_add_peer(asoc, sa_addr, GFP_KERNEL, 1082 transport = sctp_assoc_add_peer(asoc, &to, GFP_KERNEL,
1083 SCTP_UNKNOWN); 1083 SCTP_UNKNOWN);
1084 if (!transport) { 1084 if (!transport) {
1085 err = -ENOMEM; 1085 err = -ENOMEM;
@@ -1103,8 +1103,8 @@ static int __sctp_connect(struct sock* sk,
1103 1103
1104 /* Initialize sk's dport and daddr for getpeername() */ 1104 /* Initialize sk's dport and daddr for getpeername() */
1105 inet_sk(sk)->dport = htons(asoc->peer.port); 1105 inet_sk(sk)->dport = htons(asoc->peer.port);
1106 af = sctp_get_af_specific(to.sa.sa_family); 1106 af = sctp_get_af_specific(sa_addr->sa.sa_family);
1107 af->to_sk_daddr(&to, sk); 1107 af->to_sk_daddr(sa_addr, sk);
1108 sk->sk_err = 0; 1108 sk->sk_err = 0;
1109 1109
1110 /* in-kernel sockets don't generally have a file allocated to them 1110 /* in-kernel sockets don't generally have a file allocated to them
@@ -1531,7 +1531,6 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
1531 goto out_unlock; 1531 goto out_unlock;
1532 } 1532 }
1533 if (sinfo_flags & SCTP_ABORT) { 1533 if (sinfo_flags & SCTP_ABORT) {
1534 struct sctp_chunk *chunk;
1535 1534
1536 chunk = sctp_make_abort_user(asoc, msg, msg_len); 1535 chunk = sctp_make_abort_user(asoc, msg, msg_len);
1537 if (!chunk) { 1536 if (!chunk) {
@@ -4353,7 +4352,7 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len,
4353 space_left, &bytes_copied); 4352 space_left, &bytes_copied);
4354 if (cnt < 0) { 4353 if (cnt < 0) {
4355 err = cnt; 4354 err = cnt;
4356 goto error; 4355 goto error_lock;
4357 } 4356 }
4358 goto copy_getaddrs; 4357 goto copy_getaddrs;
4359 } 4358 }
@@ -4367,7 +4366,7 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len,
4367 addrlen = sctp_get_af_specific(temp.sa.sa_family)->sockaddr_len; 4366 addrlen = sctp_get_af_specific(temp.sa.sa_family)->sockaddr_len;
4368 if (space_left < addrlen) { 4367 if (space_left < addrlen) {
4369 err = -ENOMEM; /*fixme: right error?*/ 4368 err = -ENOMEM; /*fixme: right error?*/
4370 goto error; 4369 goto error_lock;
4371 } 4370 }
4372 memcpy(buf, &temp, addrlen); 4371 memcpy(buf, &temp, addrlen);
4373 buf += addrlen; 4372 buf += addrlen;
@@ -4381,15 +4380,21 @@ copy_getaddrs:
4381 4380
4382 if (copy_to_user(to, addrs, bytes_copied)) { 4381 if (copy_to_user(to, addrs, bytes_copied)) {
4383 err = -EFAULT; 4382 err = -EFAULT;
4384 goto error; 4383 goto out;
4385 } 4384 }
4386 if (put_user(cnt, &((struct sctp_getaddrs __user *)optval)->addr_num)) { 4385 if (put_user(cnt, &((struct sctp_getaddrs __user *)optval)->addr_num)) {
4387 err = -EFAULT; 4386 err = -EFAULT;
4388 goto error; 4387 goto out;
4389 } 4388 }
4390 if (put_user(bytes_copied, optlen)) 4389 if (put_user(bytes_copied, optlen))
4391 err = -EFAULT; 4390 err = -EFAULT;
4392error: 4391
4392 goto out;
4393
4394error_lock:
4395 sctp_read_unlock(addr_lock);
4396
4397out:
4393 kfree(addrs); 4398 kfree(addrs);
4394 return err; 4399 return err;
4395} 4400}
@@ -5964,7 +5969,7 @@ static int sctp_wait_for_accept(struct sock *sk, long timeo)
5964 return err; 5969 return err;
5965} 5970}
5966 5971
5967void sctp_wait_for_close(struct sock *sk, long timeout) 5972static void sctp_wait_for_close(struct sock *sk, long timeout)
5968{ 5973{
5969 DEFINE_WAIT(wait); 5974 DEFINE_WAIT(wait);
5970 5975
diff --git a/net/sctp/tsnmap.c b/net/sctp/tsnmap.c
index d3192a1babcc..1ff0daade304 100644
--- a/net/sctp/tsnmap.c
+++ b/net/sctp/tsnmap.c
@@ -161,7 +161,7 @@ SCTP_STATIC int sctp_tsnmap_next_gap_ack(const struct sctp_tsnmap *map,
161 __u16 *start, __u16 *end) 161 __u16 *start, __u16 *end)
162{ 162{
163 int started, ended; 163 int started, ended;
164 __u16 _start, _end, offset; 164 __u16 start_, end_, offset;
165 165
166 /* We haven't found a gap yet. */ 166 /* We haven't found a gap yet. */
167 started = ended = 0; 167 started = ended = 0;
@@ -175,7 +175,7 @@ SCTP_STATIC int sctp_tsnmap_next_gap_ack(const struct sctp_tsnmap *map,
175 175
176 offset = iter->start - map->base_tsn; 176 offset = iter->start - map->base_tsn;
177 sctp_tsnmap_find_gap_ack(map->tsn_map, offset, map->len, 0, 177 sctp_tsnmap_find_gap_ack(map->tsn_map, offset, map->len, 0,
178 &started, &_start, &ended, &_end); 178 &started, &start_, &ended, &end_);
179 } 179 }
180 180
181 /* Do we need to check the overflow map? */ 181 /* Do we need to check the overflow map? */
@@ -193,8 +193,8 @@ SCTP_STATIC int sctp_tsnmap_next_gap_ack(const struct sctp_tsnmap *map,
193 offset, 193 offset,
194 map->len, 194 map->len,
195 map->len, 195 map->len,
196 &started, &_start, 196 &started, &start_,
197 &ended, &_end); 197 &ended, &end_);
198 } 198 }
199 199
200 /* The Gap Ack Block happens to end at the end of the 200 /* The Gap Ack Block happens to end at the end of the
@@ -202,7 +202,7 @@ SCTP_STATIC int sctp_tsnmap_next_gap_ack(const struct sctp_tsnmap *map,
202 */ 202 */
203 if (started && !ended) { 203 if (started && !ended) {
204 ended++; 204 ended++;
205 _end = map->len + map->len - 1; 205 end_ = map->len + map->len - 1;
206 } 206 }
207 207
208 /* If we found a Gap Ack Block, return the start and end and 208 /* If we found a Gap Ack Block, return the start and end and
@@ -215,8 +215,8 @@ SCTP_STATIC int sctp_tsnmap_next_gap_ack(const struct sctp_tsnmap *map,
215 int gap = map->cumulative_tsn_ack_point - 215 int gap = map->cumulative_tsn_ack_point -
216 map->base_tsn; 216 map->base_tsn;
217 217
218 *start = _start - gap; 218 *start = start_ - gap;
219 *end = _end - gap; 219 *end = end_ - gap;
220 220
221 /* Move the iterator forward. */ 221 /* Move the iterator forward. */
222 iter->start = map->cumulative_tsn_ack_point + *end + 1; 222 iter->start = map->cumulative_tsn_ack_point + *end + 1;
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 1d674e0848fa..1b17fecee747 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -2383,10 +2383,10 @@ void tipc_link_changeover(struct link *l_ptr)
2383 struct tipc_msg *msg = buf_msg(crs); 2383 struct tipc_msg *msg = buf_msg(crs);
2384 2384
2385 if ((msg_user(msg) == MSG_BUNDLER) && split_bundles) { 2385 if ((msg_user(msg) == MSG_BUNDLER) && split_bundles) {
2386 u32 msgcount = msg_msgcnt(msg);
2387 struct tipc_msg *m = msg_get_wrapped(msg); 2386 struct tipc_msg *m = msg_get_wrapped(msg);
2388 unchar* pos = (unchar*)m; 2387 unchar* pos = (unchar*)m;
2389 2388
2389 msgcount = msg_msgcnt(msg);
2390 while (msgcount--) { 2390 while (msgcount--) {
2391 msg_set_seqno(m,msg_seqno(msg)); 2391 msg_set_seqno(m,msg_seqno(msg));
2392 tipc_link_tunnel(l_ptr, &tunnel_hdr, m, 2392 tipc_link_tunnel(l_ptr, &tunnel_hdr, m,
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c
index d8473eefcd23..ac7dfdda7973 100644
--- a/net/tipc/name_table.c
+++ b/net/tipc/name_table.c
@@ -501,7 +501,7 @@ end_node:
501 * sequence overlapping with the requested sequence 501 * sequence overlapping with the requested sequence
502 */ 502 */
503 503
504void tipc_nameseq_subscribe(struct name_seq *nseq, struct subscription *s) 504static void tipc_nameseq_subscribe(struct name_seq *nseq, struct subscription *s)
505{ 505{
506 struct sub_seq *sseq = nseq->sseqs; 506 struct sub_seq *sseq = nseq->sseqs;
507 507
diff --git a/net/tipc/node.c b/net/tipc/node.c
index e2e452a62ba1..598f4d3a0098 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -241,8 +241,6 @@ struct node *tipc_node_attach_link(struct link *l_ptr)
241 char addr_string[16]; 241 char addr_string[16];
242 242
243 if (n_ptr->link_cnt >= 2) { 243 if (n_ptr->link_cnt >= 2) {
244 char addr_string[16];
245
246 err("Attempt to create third link to %s\n", 244 err("Attempt to create third link to %s\n",
247 addr_string_fill(addr_string, n_ptr->addr)); 245 addr_string_fill(addr_string, n_ptr->addr));
248 return NULL; 246 return NULL;
diff --git a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c
index 849cc06bd914..9ab31a3ce3ad 100644
--- a/net/wanrouter/wanmain.c
+++ b/net/wanrouter/wanmain.c
@@ -46,7 +46,6 @@
46#include <linux/capability.h> 46#include <linux/capability.h>
47#include <linux/errno.h> /* return codes */ 47#include <linux/errno.h> /* return codes */
48#include <linux/kernel.h> 48#include <linux/kernel.h>
49#include <linux/init.h>
50#include <linux/module.h> /* support for loadable modules */ 49#include <linux/module.h> /* support for loadable modules */
51#include <linux/slab.h> /* kmalloc(), kfree() */ 50#include <linux/slab.h> /* kmalloc(), kfree() */
52#include <linux/mm.h> 51#include <linux/mm.h>
diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c
index dca0344cc1bc..f2950cab74a6 100644
--- a/sound/sparc/cs4231.c
+++ b/sound/sparc/cs4231.c
@@ -74,7 +74,6 @@ struct cs4231_dma_control {
74 void (*enable)(struct cs4231_dma_control *dma_cont, int on); 74 void (*enable)(struct cs4231_dma_control *dma_cont, int on);
75 int (*request)(struct cs4231_dma_control *dma_cont, dma_addr_t bus_addr, size_t len); 75 int (*request)(struct cs4231_dma_control *dma_cont, dma_addr_t bus_addr, size_t len);
76 unsigned int (*address)(struct cs4231_dma_control *dma_cont); 76 unsigned int (*address)(struct cs4231_dma_control *dma_cont);
77 void (*reset)(struct snd_cs4231 *chip);
78 void (*preallocate)(struct snd_cs4231 *chip, struct snd_pcm *pcm); 77 void (*preallocate)(struct snd_cs4231 *chip, struct snd_pcm *pcm);
79#ifdef EBUS_SUPPORT 78#ifdef EBUS_SUPPORT
80 struct ebus_dma_info ebus_info; 79 struct ebus_dma_info ebus_info;
@@ -1214,10 +1213,6 @@ static int __init snd_cs4231_probe(struct snd_cs4231 *chip)
1214 1213
1215 spin_lock_irqsave(&chip->lock, flags); 1214 spin_lock_irqsave(&chip->lock, flags);
1216 1215
1217
1218 /* Reset DMA engine (sbus only). */
1219 chip->p_dma.reset(chip);
1220
1221 __cs4231_readb(chip, CS4231P(chip, STATUS)); /* clear any pendings IRQ */ 1216 __cs4231_readb(chip, CS4231P(chip, STATUS)); /* clear any pendings IRQ */
1222 __cs4231_writeb(chip, 0, CS4231P(chip, STATUS)); 1217 __cs4231_writeb(chip, 0, CS4231P(chip, STATUS));
1223 mb(); 1218 mb();
@@ -1861,14 +1856,13 @@ static void sbus_dma_enable(struct cs4231_dma_control *dma_cont, int on)
1861 if (!on) { 1856 if (!on) {
1862 sbus_writel(0, base->regs + base->dir + APCNC); 1857 sbus_writel(0, base->regs + base->dir + APCNC);
1863 sbus_writel(0, base->regs + base->dir + APCNVA); 1858 sbus_writel(0, base->regs + base->dir + APCNVA);
1864 sbus_writel(0, base->regs + base->dir + APCC); 1859 if ( base->dir == APC_PLAY ) {
1865 sbus_writel(0, base->regs + base->dir + APCVA); 1860 sbus_writel(0, base->regs + base->dir + APCC);
1861 sbus_writel(0, base->regs + base->dir + APCVA);
1862 }
1866 1863
1867 /* ACK any APC interrupts. */ 1864 udelay(1200);
1868 csr = sbus_readl(base->regs + APCCSR);
1869 sbus_writel(csr, base->regs + APCCSR);
1870 } 1865 }
1871 udelay(1000);
1872 csr = sbus_readl(base->regs + APCCSR); 1866 csr = sbus_readl(base->regs + APCCSR);
1873 shift = 0; 1867 shift = 0;
1874 if ( base->dir == APC_PLAY ) 1868 if ( base->dir == APC_PLAY )
@@ -1894,23 +1888,6 @@ static unsigned int sbus_dma_addr(struct cs4231_dma_control *dma_cont)
1894 return sbus_readl(base->regs + base->dir + APCVA); 1888 return sbus_readl(base->regs + base->dir + APCVA);
1895} 1889}
1896 1890
1897static void sbus_dma_reset(struct snd_cs4231 *chip)
1898{
1899 sbus_writel(APC_CHIP_RESET, chip->port + APCCSR);
1900 sbus_writel(0x00, chip->port + APCCSR);
1901 sbus_writel(sbus_readl(chip->port + APCCSR) | APC_CDC_RESET,
1902 chip->port + APCCSR);
1903
1904 udelay(20);
1905
1906 sbus_writel(sbus_readl(chip->port + APCCSR) & ~APC_CDC_RESET,
1907 chip->port + APCCSR);
1908 sbus_writel(sbus_readl(chip->port + APCCSR) | (APC_XINT_ENA |
1909 APC_XINT_PENA |
1910 APC_XINT_CENA),
1911 chip->port + APCCSR);
1912}
1913
1914static void sbus_dma_preallocate(struct snd_cs4231 *chip, struct snd_pcm *pcm) 1891static void sbus_dma_preallocate(struct snd_cs4231 *chip, struct snd_pcm *pcm)
1915{ 1892{
1916 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_SBUS, 1893 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_SBUS,
@@ -1986,14 +1963,12 @@ static int __init snd_cs4231_sbus_create(struct snd_card *card,
1986 chip->p_dma.enable = sbus_dma_enable; 1963 chip->p_dma.enable = sbus_dma_enable;
1987 chip->p_dma.request = sbus_dma_request; 1964 chip->p_dma.request = sbus_dma_request;
1988 chip->p_dma.address = sbus_dma_addr; 1965 chip->p_dma.address = sbus_dma_addr;
1989 chip->p_dma.reset = sbus_dma_reset;
1990 chip->p_dma.preallocate = sbus_dma_preallocate; 1966 chip->p_dma.preallocate = sbus_dma_preallocate;
1991 1967
1992 chip->c_dma.prepare = sbus_dma_prepare; 1968 chip->c_dma.prepare = sbus_dma_prepare;
1993 chip->c_dma.enable = sbus_dma_enable; 1969 chip->c_dma.enable = sbus_dma_enable;
1994 chip->c_dma.request = sbus_dma_request; 1970 chip->c_dma.request = sbus_dma_request;
1995 chip->c_dma.address = sbus_dma_addr; 1971 chip->c_dma.address = sbus_dma_addr;
1996 chip->c_dma.reset = sbus_dma_reset;
1997 chip->c_dma.preallocate = sbus_dma_preallocate; 1972 chip->c_dma.preallocate = sbus_dma_preallocate;
1998 1973
1999 if (request_irq(sdev->irqs[0], snd_cs4231_sbus_interrupt, 1974 if (request_irq(sdev->irqs[0], snd_cs4231_sbus_interrupt,
@@ -2087,11 +2062,6 @@ static unsigned int _ebus_dma_addr(struct cs4231_dma_control *dma_cont)
2087 return ebus_dma_addr(&dma_cont->ebus_info); 2062 return ebus_dma_addr(&dma_cont->ebus_info);
2088} 2063}
2089 2064
2090static void _ebus_dma_reset(struct snd_cs4231 *chip)
2091{
2092 return;
2093}
2094
2095static void _ebus_dma_preallocate(struct snd_cs4231 *chip, struct snd_pcm *pcm) 2065static void _ebus_dma_preallocate(struct snd_cs4231 *chip, struct snd_pcm *pcm)
2096{ 2066{
2097 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 2067 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
@@ -2171,14 +2141,12 @@ static int __init snd_cs4231_ebus_create(struct snd_card *card,
2171 chip->p_dma.enable = _ebus_dma_enable; 2141 chip->p_dma.enable = _ebus_dma_enable;
2172 chip->p_dma.request = _ebus_dma_request; 2142 chip->p_dma.request = _ebus_dma_request;
2173 chip->p_dma.address = _ebus_dma_addr; 2143 chip->p_dma.address = _ebus_dma_addr;
2174 chip->p_dma.reset = _ebus_dma_reset;
2175 chip->p_dma.preallocate = _ebus_dma_preallocate; 2144 chip->p_dma.preallocate = _ebus_dma_preallocate;
2176 2145
2177 chip->c_dma.prepare = _ebus_dma_prepare; 2146 chip->c_dma.prepare = _ebus_dma_prepare;
2178 chip->c_dma.enable = _ebus_dma_enable; 2147 chip->c_dma.enable = _ebus_dma_enable;
2179 chip->c_dma.request = _ebus_dma_request; 2148 chip->c_dma.request = _ebus_dma_request;
2180 chip->c_dma.address = _ebus_dma_addr; 2149 chip->c_dma.address = _ebus_dma_addr;
2181 chip->c_dma.reset = _ebus_dma_reset;
2182 chip->c_dma.preallocate = _ebus_dma_preallocate; 2150 chip->c_dma.preallocate = _ebus_dma_preallocate;
2183 2151
2184 chip->port = ioremap(edev->resource[0].start, 0x10); 2152 chip->port = ioremap(edev->resource[0].start, 0x10);