summaryrefslogtreecommitdiffstats
path: root/main/linux-scst
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2012-01-26 15:48:06 +0000
committerCarlo Landmeter <clandmeter@gmail.com>2012-01-26 15:48:06 +0000
commit6160b20b4f9a1cb388556228aecb583f0da590b2 (patch)
treed7cb31259015a67805cd01ef64b56c03948e31a3 /main/linux-scst
parent6d05d77a399d7abcbcb308533a5ddc7399a79ead (diff)
downloadaports-6160b20b4f9a1cb388556228aecb583f0da590b2.tar.bz2
aports-6160b20b4f9a1cb388556228aecb583f0da590b2.tar.xz
main/linux-scst: update scst to 2.2.0 and kernel to 3.2.2
Diffstat (limited to 'main/linux-scst')
-rw-r--r--main/linux-scst/APKBUILD26
-rw-r--r--main/linux-scst/kernelconfig.x86_641208
-rw-r--r--main/linux-scst/scst-2.2.0-3.2.2.patch (renamed from main/linux-scst/scst-2.1.0-2.6.39.patch)2447
3 files changed, 1972 insertions, 1709 deletions
diff --git a/main/linux-scst/APKBUILD b/main/linux-scst/APKBUILD
index 8c1f8471c..62da4613b 100644
--- a/main/linux-scst/APKBUILD
+++ b/main/linux-scst/APKBUILD
@@ -2,17 +2,17 @@
_flavor=scst
pkgname=linux-${_flavor}
-pkgver=2.6.39.4
+pkgver=3.2.2
-_scstver=2.1.0
+_scstver=2.2.0
-if [ "${pkgver##*.*.*.*}" = "$pkgver" ]; then
- _kernver=$pkgver
+if [ "${pkgver##*.*.*}" = "$pkgver" ]; then
+ _kernver=$pkgver
else
- _kernver=${pkgver%.*}
+ _kernver=${pkgver%.*}
fi
-pkgrel=1
+pkgrel=0
pkgdesc="Linux kernel with SCST"
url="http://scst.sourceforge.net"
depends="mkinitfs linux-firmware"
@@ -20,10 +20,10 @@ makedepends="perl installkernel"
options="!strip"
_config=${config:-kernelconfig.${CARCH}}
install=
-source="http://mirror.be.gbxs.net/pub/linux/kernel/v2.6/linux-$_kernver.tar.bz2
- http://mirror.be.gbxs.net/pub/linux/kernel/v2.6/patch-$pkgver.bz2
+source="http://www.kernel.org/pub/linux/kernel/v3.0/linux-$_kernver.tar.bz2
+ http://www.kernel.org/pub/linux/kernel/v3.0/patch-$pkgver.bz2
kernelconfig.x86_64
- scst-2.1.0-2.6.39.patch
+ scst-2.2.0-3.2.2.patch
"
subpackages="$pkgname-dev"
arch="x86_64"
@@ -131,7 +131,7 @@ dev() {
"$subpkgdir"/lib/modules/${_abi_release}/build
}
-md5sums="1aab7a741abe08d42e8eccf20de61e05 linux-2.6.39.tar.bz2
-ff5eb7323c054a128d2922bde3297ed5 patch-2.6.39.4.bz2
-82712844db0333b4dccb38638a73f640 kernelconfig.x86_64
-456cd9f0a71d9b2ca15d207f2d2a59a1 scst-2.1.0-2.6.39.patch"
+md5sums="7ceb61f87c097fc17509844b71268935 linux-3.2.tar.bz2
+e9e53fba37c5e2afa4cdecab234120bd patch-3.2.2.bz2
+ef1fc8a0f776a9639a135ac58acd26ce kernelconfig.x86_64
+da058cfd855d01f71443370d846ea541 scst-2.2.0-3.2.2.patch"
diff --git a/main/linux-scst/kernelconfig.x86_64 b/main/linux-scst/kernelconfig.x86_64
index 699eee342..117c48e29 100644
--- a/main/linux-scst/kernelconfig.x86_64
+++ b/main/linux-scst/kernelconfig.x86_64
@@ -1,7 +1,6 @@
#
-# Automatically generated make config: don't edit
-# Linux/x86_64 2.6.39.4 Kernel Configuration
-# Fri Oct 28 15:00:53 2011
+# Automatically generated file; DO NOT EDIT.
+# Linux/x86_64 3.2.2 Kernel Configuration
#
CONFIG_64BIT=y
# CONFIG_X86_32 is not set
@@ -13,6 +12,7 @@ CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_ARCH_CLOCKSOURCE_DATA=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
@@ -39,7 +39,6 @@ CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
-CONFIG_HAVE_CPUMASK_OF_CPU_MAP=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ZONE_DMA32=y
@@ -47,13 +46,13 @@ CONFIG_ARCH_POPULATES_NODE_MAP=y
CONFIG_AUDIT_ARCH=y
CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
+CONFIG_HAVE_INTEL_TXT=y
CONFIG_X86_64_SMP=y
CONFIG_X86_HT=y
CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx -fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 -fcall-saved-r11"
# CONFIG_KTIME_SCALAR is not set
CONFIG_ARCH_CPU_PROBE_RELEASE=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
-CONFIG_CONSTRUCTORS=y
CONFIG_HAVE_IRQ_WORK=y
CONFIG_IRQ_WORK=y
@@ -75,6 +74,7 @@ CONFIG_KERNEL_GZIP=y
# CONFIG_KERNEL_LZMA is not set
# CONFIG_KERNEL_XZ is not set
# CONFIG_KERNEL_LZO is not set
+CONFIG_DEFAULT_HOSTNAME="(none)"
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_SYSVIPC_SYSCTL=y
@@ -82,7 +82,10 @@ CONFIG_SYSVIPC_SYSCTL=y
CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y
# CONFIG_FHANDLE is not set
-# CONFIG_TASKSTATS is not set
+CONFIG_TASKSTATS=y
+CONFIG_TASK_DELAY_ACCT=y
+CONFIG_TASK_XACCT=y
+CONFIG_TASK_IO_ACCOUNTING=y
# CONFIG_AUDIT is not set
CONFIG_HAVE_GENERIC_HARDIRQS=y
@@ -94,8 +97,9 @@ CONFIG_HAVE_SPARSE_IRQ=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_PENDING_IRQ=y
+CONFIG_GENERIC_IRQ_CHIP=y
CONFIG_IRQ_FORCED_THREADING=y
-# CONFIG_SPARSE_IRQ is not set
+CONFIG_SPARSE_IRQ=y
#
# RCU Subsystem
@@ -113,17 +117,18 @@ CONFIG_LOG_BUF_SHIFT=14
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
CONFIG_CGROUPS=y
# CONFIG_CGROUP_DEBUG is not set
-CONFIG_CGROUP_NS=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CPUSETS=y
# CONFIG_PROC_PID_CPUSET is not set
CONFIG_CGROUP_CPUACCT=y
CONFIG_RESOURCE_COUNTERS=y
-# CONFIG_CGROUP_MEM_RES_CTLR is not set
+CONFIG_CGROUP_MEM_RES_CTLR=y
+# CONFIG_CGROUP_MEM_RES_CTLR_SWAP is not set
# CONFIG_CGROUP_PERF is not set
CONFIG_CGROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_CFS_BANDWIDTH=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_BLK_CGROUP=y
# CONFIG_DEBUG_BLK_CGROUP is not set
@@ -134,6 +139,7 @@ CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
CONFIG_SCHED_AUTOGROUP=y
+CONFIG_MM_OWNER=y
# CONFIG_SYSFS_DEPRECATED is not set
# CONFIG_RELAY is not set
CONFIG_BLK_DEV_INITRD=y
@@ -150,12 +156,13 @@ CONFIG_EXPERT=y
CONFIG_UID16=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS=y
-# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_KALLSYMS_ALL=y
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_PCSPKR_PLATFORM=y
+CONFIG_HAVE_PCSPKR_PLATFORM=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
@@ -172,6 +179,7 @@ CONFIG_HAVE_PERF_EVENTS=y
#
CONFIG_PERF_EVENTS=y
CONFIG_PERF_COUNTERS=y
+# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_PCI_QUIRKS=y
# CONFIG_SLUB_DEBUG is not set
@@ -203,6 +211,7 @@ CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
CONFIG_HAVE_USER_RETURN_NOTIFIER=y
CONFIG_HAVE_PERF_EVENTS_NMI=y
CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
#
# GCOV-based kernel profiling
@@ -220,6 +229,7 @@ CONFIG_MODVERSIONS=y
CONFIG_STOP_MACHINE=y
CONFIG_BLOCK=y
CONFIG_BLK_DEV_BSG=y
+CONFIG_BLK_DEV_BSGLIB=y
# CONFIG_BLK_DEV_INTEGRITY is not set
# CONFIG_BLK_DEV_THROTTLING is not set
CONFIG_BLOCK_COMPAT=y
@@ -230,7 +240,7 @@ CONFIG_BLOCK_COMPAT=y
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_DEADLINE=m
CONFIG_IOSCHED_CFQ=y
-# CONFIG_CFQ_GROUP_IOSCHED is not set
+CONFIG_CFQ_GROUP_IOSCHED=y
CONFIG_DEFAULT_CFQ=y
# CONFIG_DEFAULT_NOOP is not set
CONFIG_DEFAULT_IOSCHED="cfq"
@@ -274,12 +284,15 @@ CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
CONFIG_SMP=y
+CONFIG_X86_X2APIC=y
CONFIG_X86_MPPARSE=y
CONFIG_X86_EXTENDED_PLATFORM=y
# CONFIG_X86_VSMP is not set
CONFIG_SCHED_OMIT_FRAME_POINTER=y
CONFIG_PARAVIRT_GUEST=y
+# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
CONFIG_XEN=y
CONFIG_XEN_DOM0=y
CONFIG_XEN_PRIVILEGED_GUEST=y
@@ -287,12 +300,12 @@ CONFIG_XEN_PVHVM=y
CONFIG_XEN_MAX_DOMAIN_MEMORY=128
CONFIG_XEN_SAVE_RESTORE=y
# CONFIG_XEN_DEBUG_FS is not set
-# CONFIG_XEN_DEBUG is not set
CONFIG_KVM_CLOCK=y
CONFIG_KVM_GUEST=y
CONFIG_PARAVIRT=y
# CONFIG_PARAVIRT_SPINLOCKS is not set
CONFIG_PARAVIRT_CLOCK=y
+# CONFIG_PARAVIRT_DEBUG is not set
CONFIG_NO_BOOTMEM=y
# CONFIG_MEMTEST is not set
# CONFIG_MK8 is not set
@@ -303,6 +316,7 @@ CONFIG_GENERIC_CPU=y
CONFIG_X86_INTERNODE_CACHE_SHIFT=6
CONFIG_X86_CMPXCHG=y
CONFIG_CMPXCHG_LOCAL=y
+CONFIG_CMPXCHG_DOUBLE=y
CONFIG_X86_L1_CACHE_SHIFT=6
CONFIG_X86_XADD=y
CONFIG_X86_WP_WORKS_OK=y
@@ -320,11 +334,10 @@ CONFIG_HPET_EMULATE_RTC=y
CONFIG_DMI=y
CONFIG_GART_IOMMU=y
# CONFIG_CALGARY_IOMMU is not set
-# CONFIG_AMD_IOMMU is not set
CONFIG_SWIOTLB=y
CONFIG_IOMMU_HELPER=y
-# CONFIG_IOMMU_API is not set
-CONFIG_NR_CPUS=8
+# CONFIG_MAXSMP is not set
+CONFIG_NR_CPUS=128
CONFIG_SCHED_SMT=y
CONFIG_SCHED_MC=y
CONFIG_IRQ_TIME_ACCOUNTING=y
@@ -346,8 +359,8 @@ CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
CONFIG_DIRECT_GBPAGES=y
# CONFIG_NUMA is not set
-CONFIG_ARCH_SPARSEMEM_DEFAULT=y
CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_DEFAULT=y
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
CONFIG_SELECT_MEMORY_MODEL=y
@@ -374,6 +387,7 @@ CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
CONFIG_TRANSPARENT_HUGEPAGE=y
CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y
# CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is not set
+# CONFIG_CLEANCACHE is not set
# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
CONFIG_X86_RESERVE_LOW=64
CONFIG_MTRR=y
@@ -382,6 +396,7 @@ CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0
CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
CONFIG_X86_PAT=y
CONFIG_ARCH_USES_PG_UNCACHED=y
+CONFIG_ARCH_RANDOM=y
# CONFIG_EFI is not set
# CONFIG_SECCOMP is not set
# CONFIG_CC_STACKPROTECTOR is not set
@@ -417,7 +432,6 @@ CONFIG_ACPI=y
CONFIG_ACPI_SLEEP=y
CONFIG_ACPI_PROCFS=y
CONFIG_ACPI_PROCFS_POWER=y
-# CONFIG_ACPI_POWER_METER is not set
CONFIG_ACPI_EC_DEBUGFS=y
CONFIG_ACPI_PROC_EVENT=y
CONFIG_ACPI_AC=m
@@ -439,8 +453,9 @@ CONFIG_X86_PM_TIMER=y
CONFIG_ACPI_CONTAINER=m
CONFIG_ACPI_SBS=m
CONFIG_ACPI_HED=m
+# CONFIG_ACPI_CUSTOM_METHOD is not set
CONFIG_ACPI_APEI=y
-CONFIG_ACPI_APEI_GHES=m
+# CONFIG_ACPI_APEI_GHES is not set
CONFIG_ACPI_APEI_EINJ=m
CONFIG_ACPI_APEI_ERST_DEBUG=y
# CONFIG_SFI is not set
@@ -450,7 +465,6 @@ CONFIG_ACPI_APEI_ERST_DEBUG=y
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=m
-# CONFIG_CPU_FREQ_DEBUG is not set
CONFIG_CPU_FREQ_STAT=m
# CONFIG_CPU_FREQ_STAT_DETAILS is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
@@ -465,7 +479,7 @@ CONFIG_CPU_FREQ_GOV_ONDEMAND=m
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
#
-# CPUFreq processor drivers
+# x86 CPU frequency scaling drivers
#
CONFIG_X86_PCC_CPUFREQ=m
CONFIG_X86_ACPI_CPUFREQ=m
@@ -485,7 +499,8 @@ CONFIG_INTEL_IDLE=y
#
# Memory power savings
#
-# CONFIG_I7300_IDLE is not set
+CONFIG_I7300_IDLE_IOAT_CHANNEL=y
+CONFIG_I7300_IDLE=m
#
# Bus options (PCI etc.)
@@ -496,8 +511,6 @@ CONFIG_PCI_MMCONFIG=y
CONFIG_PCI_XEN=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCI_CNB20LE_QUIRK=y
-# CONFIG_DMAR is not set
-# CONFIG_INTR_REMAP is not set
CONFIG_PCIEPORTBUS=y
CONFIG_HOTPLUG_PCI_PCIE=m
# CONFIG_PCIEAER is not set
@@ -505,10 +518,14 @@ CONFIG_PCIEASPM=y
# CONFIG_PCIEASPM_DEBUG is not set
CONFIG_ARCH_SUPPORTS_MSI=y
CONFIG_PCI_MSI=y
+# CONFIG_PCI_DEBUG is not set
CONFIG_PCI_STUB=m
-CONFIG_XEN_PCIDEV_FRONTEND=y
+CONFIG_XEN_PCIDEV_FRONTEND=m
CONFIG_HT_IRQ=y
-# CONFIG_PCI_IOV is not set
+CONFIG_PCI_ATS=y
+CONFIG_PCI_IOV=y
+CONFIG_PCI_PRI=y
+CONFIG_PCI_PASID=y
CONFIG_PCI_IOAPIC=y
CONFIG_PCI_LABEL=y
CONFIG_ISA_DMA_API=y
@@ -646,7 +663,7 @@ CONFIG_IPV6_SUBTREES=y
CONFIG_IPV6_MROUTE=y
CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
CONFIG_IPV6_PIMSM_V2=y
-CONFIG_NETLABEL=y
+# CONFIG_NETLABEL is not set
CONFIG_NETWORK_SECMARK=y
CONFIG_NETWORK_PHY_TIMESTAMPING=y
CONFIG_NETFILTER=y
@@ -665,7 +682,7 @@ CONFIG_NF_CONNTRACK_MARK=y
CONFIG_NF_CONNTRACK_SECMARK=y
CONFIG_NF_CONNTRACK_ZONES=y
CONFIG_NF_CONNTRACK_EVENTS=y
-# CONFIG_NF_CONNTRACK_TIMESTAMP is not set
+CONFIG_NF_CONNTRACK_TIMESTAMP=y
CONFIG_NF_CT_PROTO_DCCP=m
CONFIG_NF_CT_PROTO_GRE=m
CONFIG_NF_CT_PROTO_SCTP=m
@@ -769,6 +786,7 @@ CONFIG_IP_SET_HASH_IPPORTIP=m
CONFIG_IP_SET_HASH_IPPORTNET=m
CONFIG_IP_SET_HASH_NET=m
CONFIG_IP_SET_HASH_NETPORT=m
+CONFIG_IP_SET_HASH_NETIFACE=m
CONFIG_IP_SET_LIST_SET=m
CONFIG_IP_VS=m
CONFIG_IP_VS_IPV6=y
@@ -907,6 +925,12 @@ CONFIG_INET_DCCP_DIAG=m
CONFIG_IP_DCCP_CCID3=y
# CONFIG_IP_DCCP_CCID3_DEBUG is not set
CONFIG_IP_DCCP_TFRC_LIB=y
+
+#
+# DCCP Kernel Hacking
+#
+# CONFIG_IP_DCCP_DEBUG is not set
+# CONFIG_NET_DCCPPROBE is not set
CONFIG_IP_SCTP=m
CONFIG_NET_SCTPPROBE=m
# CONFIG_SCTP_DBG_MSG is not set
@@ -956,6 +980,7 @@ CONFIG_LAPB=m
CONFIG_WAN_ROUTER=m
CONFIG_PHONET=m
CONFIG_IEEE802154=m
+CONFIG_IEEE802154_6LOWPAN=m
CONFIG_NET_SCHED=y
#
@@ -978,6 +1003,7 @@ CONFIG_NET_SCH_NETEM=m
CONFIG_NET_SCH_DRR=m
CONFIG_NET_SCH_MQPRIO=m
CONFIG_NET_SCH_CHOKE=m
+CONFIG_NET_SCH_QFQ=m
CONFIG_NET_SCH_INGRESS=m
#
@@ -1021,6 +1047,8 @@ CONFIG_DNS_RESOLVER=y
CONFIG_RPS=y
CONFIG_RFS_ACCEL=y
CONFIG_XPS=y
+CONFIG_HAVE_BPF_JIT=y
+CONFIG_BPF_JIT=y
#
# Network testing
@@ -1028,36 +1056,7 @@ CONFIG_XPS=y
CONFIG_NET_PKTGEN=m
CONFIG_NET_TCPPROBE=m
# CONFIG_HAMRADIO is not set
-CONFIG_CAN=m
-CONFIG_CAN_RAW=m
-CONFIG_CAN_BCM=m
-
-#
-# CAN Device Drivers
-#
-CONFIG_CAN_VCAN=m
-CONFIG_CAN_SLCAN=m
-CONFIG_CAN_DEV=m
-# CONFIG_CAN_CALC_BITTIMING is not set
-CONFIG_CAN_MCP251X=m
-CONFIG_CAN_JANZ_ICAN3=m
-# CONFIG_PCH_CAN is not set
-CONFIG_CAN_SJA1000=m
-CONFIG_CAN_SJA1000_PLATFORM=m
-CONFIG_CAN_EMS_PCI=m
-CONFIG_CAN_KVASER_PCI=m
-CONFIG_CAN_PLX_PCI=m
-CONFIG_CAN_C_CAN=m
-CONFIG_CAN_C_CAN_PLATFORM=m
-
-#
-# CAN USB interfaces
-#
-# CONFIG_CAN_EMS_USB is not set
-# CONFIG_CAN_ESD_USB2 is not set
-CONFIG_CAN_SOFTING=m
-CONFIG_CAN_SOFTING_CS=m
-# CONFIG_CAN_DEBUG_DEVICES is not set
+# CONFIG_CAN is not set
CONFIG_IRDA=m
#
@@ -1115,8 +1114,15 @@ CONFIG_VLSI_FIR=m
CONFIG_VIA_FIR=m
CONFIG_MCS_FIR=m
CONFIG_BT=m
-# CONFIG_BT_L2CAP is not set
-# CONFIG_BT_SCO is not set
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_CMTP=m
+CONFIG_BT_HIDP=m
#
# Bluetooth device drivers
@@ -1136,7 +1142,8 @@ CONFIG_BT_HCIBT3C=m
CONFIG_BT_HCIBLUECARD=m
CONFIG_BT_HCIBTUART=m
CONFIG_BT_HCIVHCI=m
-# CONFIG_BT_MRVL is not set
+CONFIG_BT_MRVL=m
+CONFIG_BT_MRVL_SDIO=m
CONFIG_BT_ATH3K=m
CONFIG_BT_WILINK=m
CONFIG_AF_RXRPC=m
@@ -1184,11 +1191,11 @@ CONFIG_NET_9P=m
CONFIG_NET_9P_VIRTIO=m
CONFIG_NET_9P_RDMA=m
# CONFIG_NET_9P_DEBUG is not set
-CONFIG_CAIF=m
-# CONFIG_CAIF_DEBUG is not set
-CONFIG_CAIF_NETDEV=m
+# CONFIG_CAIF is not set
CONFIG_CEPH_LIB=m
# CONFIG_CEPH_LIB_PRETTYDEBUG is not set
+# CONFIG_CEPH_LIB_USE_DNS_RESOLVER is not set
+# CONFIG_NFC is not set
#
# Device Drivers
@@ -1204,13 +1211,15 @@ CONFIG_STANDALONE=y
CONFIG_FW_LOADER=m
# CONFIG_FIRMWARE_IN_KERNEL is not set
CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_DEBUG_DRIVER is not set
+CONFIG_DEBUG_DEVRES=y
CONFIG_SYS_HYPERVISOR=y
-CONFIG_ARCH_NO_SYSDEV_OPS=y
+CONFIG_REGMAP=y
+CONFIG_REGMAP_I2C=m
+CONFIG_REGMAP_SPI=m
CONFIG_CONNECTOR=m
CONFIG_MTD=m
-# CONFIG_MTD_DEBUG is not set
CONFIG_MTD_TESTS=m
-CONFIG_MTD_PARTITIONS=y
CONFIG_MTD_REDBOOT_PARTS=m
CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1
# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set
@@ -1283,7 +1292,7 @@ CONFIG_MTD_PCMCIA=m
# CONFIG_MTD_GPIO_ADDR is not set
CONFIG_MTD_INTEL_VR_NOR=m
CONFIG_MTD_PLATRAM=m
-CONFIG_MTD_LATCH_ADDR=m
+# CONFIG_MTD_LATCH_ADDR is not set
#
# Self-contained MTD device drivers
@@ -1310,6 +1319,7 @@ CONFIG_MTD_BLOCK2MTD=m
CONFIG_MTD_DOC2000=m
CONFIG_MTD_DOC2001=m
CONFIG_MTD_DOC2001PLUS=m
+# CONFIG_MTD_DOCG3 is not set
CONFIG_MTD_DOCPROBE=m
CONFIG_MTD_DOCECC=m
CONFIG_MTD_DOCPROBE_ADVANCED=y
@@ -1379,9 +1389,9 @@ CONFIG_BLK_DEV_DAC960=m
CONFIG_BLK_DEV_UMEM=m
# CONFIG_BLK_DEV_COW_COMMON is not set
CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_LOOP_MIN_COUNT=8
CONFIG_BLK_DEV_CRYPTOLOOP=m
-CONFIG_BLK_DEV_DRBD=m
-# CONFIG_DRBD_FAULT_INJECTION is not set
+# CONFIG_BLK_DEV_DRBD is not set
CONFIG_BLK_DEV_NBD=m
CONFIG_BLK_DEV_OSD=m
CONFIG_BLK_DEV_SX8=m
@@ -1395,6 +1405,7 @@ CONFIG_CDROM_PKTCDVD_BUFFERS=8
# CONFIG_CDROM_PKTCDVD_WCACHE is not set
CONFIG_ATA_OVER_ETH=m
CONFIG_XEN_BLKDEV_FRONTEND=y
+CONFIG_XEN_BLKDEV_BACKEND=m
CONFIG_VIRTIO_BLK=m
# CONFIG_BLK_DEV_HD is not set
# CONFIG_BLK_DEV_RBD is not set
@@ -1405,6 +1416,7 @@ CONFIG_AD525X_DPOT_I2C=m
CONFIG_AD525X_DPOT_SPI=m
CONFIG_IBM_ASM=m
CONFIG_PHANTOM=m
+# CONFIG_INTEL_MID_PTI is not set
CONFIG_SGI_IOC4=m
CONFIG_TIFM_CORE=m
CONFIG_TIFM_7XX1=m
@@ -1427,6 +1439,7 @@ CONFIG_TI_DAC7512=m
CONFIG_VMWARE_BALLOON=m
CONFIG_BMP085=m
CONFIG_PCH_PHUB=m
+# CONFIG_USB_SWITCH_FSA9480 is not set
CONFIG_C2PORT=m
CONFIG_C2PORT_DURAMAR_2150=m
@@ -1438,6 +1451,7 @@ CONFIG_EEPROM_AT25=m
CONFIG_EEPROM_LEGACY=m
CONFIG_EEPROM_MAX6875=m
CONFIG_EEPROM_93CX6=m
+CONFIG_EEPROM_93XX46=m
CONFIG_CB710_CORE=m
# CONFIG_CB710_DEBUG is not set
CONFIG_CB710_DEBUG_ASSUMPTIONS=y
@@ -1450,6 +1464,11 @@ CONFIG_IWMC3200TOP=m
#
CONFIG_TI_ST=m
CONFIG_SENSORS_LIS3_I2C=m
+
+#
+# Altera FPGA firmware download module
+#
+# CONFIG_ALTERA_STAPL is not set
CONFIG_HAVE_IDE=y
# CONFIG_IDE is not set
@@ -1501,7 +1520,7 @@ CONFIG_SCSI_CXGB3_ISCSI=m
CONFIG_SCSI_CXGB4_ISCSI=m
CONFIG_SCSI_BNX2_ISCSI=m
CONFIG_SCSI_BNX2X_FCOE=m
-# CONFIG_BE2ISCSI is not set
+CONFIG_BE2ISCSI=m
CONFIG_BLK_DEV_3W_XXXX_RAID=m
CONFIG_SCSI_HPSA=m
CONFIG_SCSI_3W_9XXX=m
@@ -1527,6 +1546,8 @@ CONFIG_SCSI_AIC94XX=m
# CONFIG_AIC94XX_DEBUG is not set
CONFIG_SCSI_MVSAS=m
CONFIG_SCSI_MVSAS_DEBUG=y
+CONFIG_SCSI_MVSAS_TASKLET=y
+CONFIG_SCSI_MVUMI=m
CONFIG_SCSI_DPT_I2O=m
CONFIG_SCSI_ADVANSYS=m
CONFIG_SCSI_ARCMSR=m
@@ -1552,13 +1573,12 @@ CONFIG_SCSI_EATA=m
CONFIG_SCSI_EATA_MAX_TAGS=16
CONFIG_SCSI_FUTURE_DOMAIN=m
CONFIG_SCSI_GDTH=m
+CONFIG_SCSI_ISCI=m
CONFIG_SCSI_IPS=m
CONFIG_SCSI_INITIO=m
CONFIG_SCSI_INIA100=m
-CONFIG_SCSI_PPA=m
-CONFIG_SCSI_IMM=m
-# CONFIG_SCSI_IZIP_EPP16 is not set
-# CONFIG_SCSI_IZIP_SLOW_CTR is not set
+# CONFIG_SCSI_PPA is not set
+# CONFIG_SCSI_IMM is not set
CONFIG_SCSI_STEX=m
CONFIG_SCSI_SYM53C8XX_2=m
CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
@@ -1580,11 +1600,7 @@ CONFIG_SCSI_DEBUG=m
CONFIG_SCSI_PM8001=m
CONFIG_SCSI_SRP=m
# CONFIG_SCSI_BFA_FC is not set
-CONFIG_SCSI_LOWLEVEL_PCMCIA=y
-CONFIG_PCMCIA_AHA152X=m
-CONFIG_PCMCIA_FDOMAIN=m
-CONFIG_PCMCIA_QLOGIC=m
-CONFIG_PCMCIA_SYM53C500=m
+# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
CONFIG_SCSI_DH=m
CONFIG_SCSI_DH_RDAC=m
CONFIG_SCSI_DH_HP_SW=m
@@ -1736,8 +1752,13 @@ CONFIG_MD_MULTIPATH=m
CONFIG_MD_FAULTY=m
CONFIG_BLK_DEV_DM=m
# CONFIG_DM_DEBUG is not set
+CONFIG_DM_BUFIO=m
+CONFIG_DM_PERSISTENT_DATA=m
CONFIG_DM_CRYPT=m
CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_THIN_PROVISIONING=m
+# CONFIG_DM_DEBUG_BLOCK_STACK_TRACING is not set
+# CONFIG_DM_DEBUG_SPACE_MAPS is not set
CONFIG_DM_MIRROR=m
CONFIG_DM_RAID=m
CONFIG_DM_LOG_USERSPACE=m
@@ -1753,7 +1774,8 @@ CONFIG_TCM_IBLOCK=m
CONFIG_TCM_FILEIO=m
CONFIG_TCM_PSCSI=m
CONFIG_LOOPBACK_TARGET=m
-# CONFIG_LOOPBACK_TARGET_CDB_DEBUG is not set
+CONFIG_TCM_FC=m
+CONFIG_ISCSI_TARGET=m
CONFIG_FUSION=y
CONFIG_FUSION_SPI=m
CONFIG_FUSION_FC=m
@@ -1783,15 +1805,26 @@ CONFIG_I2O_SCSI=m
CONFIG_I2O_PROC=m
# CONFIG_MACINTOSH_DRIVERS is not set
CONFIG_NETDEVICES=y
-CONFIG_IFB=m
-CONFIG_DUMMY=m
+CONFIG_NET_CORE=y
CONFIG_BONDING=m
+CONFIG_DUMMY=m
+CONFIG_EQUALIZER=m
+# CONFIG_NET_FC is not set
+CONFIG_MII=m
+CONFIG_IEEE802154_DRIVERS=m
+CONFIG_IEEE802154_FAKEHARD=m
+CONFIG_IFB=m
CONFIG_MACVLAN=m
CONFIG_MACVTAP=m
-CONFIG_EQUALIZER=m
+CONFIG_NETCONSOLE=m
+CONFIG_NETCONSOLE_DYNAMIC=y
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
CONFIG_TUN=m
CONFIG_VETH=m
-CONFIG_NET_SB1000=m
+CONFIG_VIRTIO_NET=m
+CONFIG_SUNGEM_PHY=m
CONFIG_ARCNET=m
CONFIG_ARCNET_1201=m
CONFIG_ARCNET_1051=m
@@ -1802,40 +1835,83 @@ CONFIG_ARCNET_COM90xxIO=m
CONFIG_ARCNET_RIM_I=m
CONFIG_ARCNET_COM20020=m
CONFIG_ARCNET_COM20020_PCI=m
-CONFIG_MII=m
-CONFIG_PHYLIB=m
+CONFIG_ARCNET_COM20020_CS=m
+CONFIG_ATM_DRIVERS=y
+CONFIG_ATM_DUMMY=m
+CONFIG_ATM_TCP=m
+CONFIG_ATM_LANAI=m
+CONFIG_ATM_ENI=m
+# CONFIG_ATM_ENI_DEBUG is not set
+# CONFIG_ATM_ENI_TUNE_BURST is not set
+CONFIG_ATM_FIRESTREAM=m
+CONFIG_ATM_ZATM=m
+# CONFIG_ATM_ZATM_DEBUG is not set
+CONFIG_ATM_NICSTAR=m
+# CONFIG_ATM_NICSTAR_USE_SUNI is not set
+# CONFIG_ATM_NICSTAR_USE_IDT77105 is not set
+CONFIG_ATM_IDT77252=m
+# CONFIG_ATM_IDT77252_DEBUG is not set
+# CONFIG_ATM_IDT77252_RCV_ALL is not set
+CONFIG_ATM_IDT77252_USE_SUNI=y
+CONFIG_ATM_AMBASSADOR=m
+# CONFIG_ATM_AMBASSADOR_DEBUG is not set
+CONFIG_ATM_HORIZON=m
+# CONFIG_ATM_HORIZON_DEBUG is not set
+CONFIG_ATM_IA=m
+# CONFIG_ATM_IA_DEBUG is not set
+CONFIG_ATM_FORE200E=m
+CONFIG_ATM_FORE200E_USE_TASKLET=y
+CONFIG_ATM_FORE200E_TX_RETRY=16
+CONFIG_ATM_FORE200E_DEBUG=0
+CONFIG_ATM_HE=m
+CONFIG_ATM_HE_USE_SUNI=y
+CONFIG_ATM_SOLOS=m
#
-# MII PHY device drivers
+# CAIF transport drivers
#
-CONFIG_MARVELL_PHY=m
-CONFIG_DAVICOM_PHY=m
-CONFIG_QSEMI_PHY=m
-CONFIG_LXT_PHY=m
-CONFIG_CICADA_PHY=m
-CONFIG_VITESSE_PHY=m
-CONFIG_SMSC_PHY=m
-CONFIG_BROADCOM_PHY=m
-CONFIG_BCM63XX_PHY=m
-CONFIG_ICPLUS_PHY=m
-CONFIG_REALTEK_PHY=m
-CONFIG_NATIONAL_PHY=m
-CONFIG_STE10XP=m
-CONFIG_LSI_ET1011C_PHY=m
-CONFIG_MICREL_PHY=m
-CONFIG_MDIO_BITBANG=m
-CONFIG_MDIO_GPIO=m
-CONFIG_NET_ETHERNET=y
-CONFIG_HAPPYMEAL=m
-CONFIG_SUNGEM=m
-CONFIG_CASSINI=m
+CONFIG_ETHERNET=y
+CONFIG_MDIO=m
CONFIG_NET_VENDOR_3COM=y
+CONFIG_PCMCIA_3C574=m
+CONFIG_PCMCIA_3C589=m
CONFIG_VORTEX=m
CONFIG_TYPHOON=m
-CONFIG_ENC28J60=m
-# CONFIG_ENC28J60_WRITEVERIFY is not set
-CONFIG_ETHOC=m
+CONFIG_NET_VENDOR_ADAPTEC=y
+CONFIG_ADAPTEC_STARFIRE=m
+CONFIG_NET_VENDOR_ALTEON=y
+CONFIG_ACENIC=m
+# CONFIG_ACENIC_OMIT_TIGON_I is not set
+CONFIG_NET_VENDOR_AMD=y
+CONFIG_AMD8111_ETH=m
+CONFIG_PCNET32=m
+CONFIG_PCMCIA_NMCLAN=m
+CONFIG_NET_VENDOR_ATHEROS=y
+CONFIG_ATL2=m
+CONFIG_ATL1=m
+CONFIG_ATL1E=m
+CONFIG_ATL1C=m
+CONFIG_NET_VENDOR_BROADCOM=y
+CONFIG_B44=m
+CONFIG_B44_PCI_AUTOSELECT=y
+CONFIG_B44_PCICORE_AUTOSELECT=y
+CONFIG_B44_PCI=y
+CONFIG_BNX2=m
+CONFIG_CNIC=m
+CONFIG_TIGON3=m
+CONFIG_BNX2X=m
+CONFIG_NET_VENDOR_BROCADE=y
+CONFIG_BNA=m
+CONFIG_NET_VENDOR_CHELSIO=y
+CONFIG_CHELSIO_T1=m
+CONFIG_CHELSIO_T1_1G=y
+CONFIG_CHELSIO_T3=m
+CONFIG_CHELSIO_T4=m
+CONFIG_CHELSIO_T4VF=m
+CONFIG_NET_VENDOR_CISCO=y
+CONFIG_ENIC=m
CONFIG_DNET=m
+CONFIG_NET_VENDOR_DEC=y
CONFIG_NET_TULIP=y
CONFIG_DE2104X=m
CONFIG_DE2104X_DSL=0
@@ -1848,115 +1924,209 @@ CONFIG_WINBOND_840=m
CONFIG_DM9102=m
CONFIG_ULI526X=m
CONFIG_PCMCIA_XIRCOM=m
-CONFIG_HP100=m
-# CONFIG_IBM_NEW_EMAC_ZMII is not set
-# CONFIG_IBM_NEW_EMAC_RGMII is not set
-# CONFIG_IBM_NEW_EMAC_TAH is not set
-# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
-# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
-# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
-# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
-CONFIG_NET_PCI=y
-CONFIG_PCNET32=m
-CONFIG_AMD8111_ETH=m
-CONFIG_ADAPTEC_STARFIRE=m
-CONFIG_KSZ884X_PCI=m
-CONFIG_B44=m
-CONFIG_B44_PCI_AUTOSELECT=y
-CONFIG_B44_PCICORE_AUTOSELECT=y
-CONFIG_B44_PCI=y
-CONFIG_FORCEDETH=m
-CONFIG_E100=m
-CONFIG_FEALNX=m
-CONFIG_NATSEMI=m
-CONFIG_NE2K_PCI=m
-CONFIG_8139CP=m
-CONFIG_8139TOO=m
-CONFIG_8139TOO_PIO=y
-# CONFIG_8139TOO_TUNE_TWISTER is not set
-# CONFIG_8139TOO_8129 is not set
-# CONFIG_8139_OLD_RX_RESET is not set
-CONFIG_R6040=m
-CONFIG_SIS900=m
-CONFIG_EPIC100=m
-CONFIG_SMSC9420=m
-CONFIG_SUNDANCE=m
-# CONFIG_SUNDANCE_MMIO is not set
-CONFIG_TLAN=m
-CONFIG_KS8842=m
-CONFIG_KS8851=m
-CONFIG_KS8851_MLL=m
-CONFIG_VIA_RHINE=m
-# CONFIG_VIA_RHINE_MMIO is not set
-CONFIG_SC92031=m
-CONFIG_NET_POCKET=y
-CONFIG_ATP=m
+CONFIG_NET_VENDOR_DLINK=y
CONFIG_DE600=m
CONFIG_DE620=m
-CONFIG_ATL2=m
-CONFIG_NETDEV_1000=y
-CONFIG_ACENIC=m
-# CONFIG_ACENIC_OMIT_TIGON_I is not set
CONFIG_DL2K=m
+CONFIG_SUNDANCE=m
+# CONFIG_SUNDANCE_MMIO is not set
+CONFIG_NET_VENDOR_EMULEX=y
+CONFIG_BE2NET=m
+CONFIG_NET_VENDOR_EXAR=y
+CONFIG_S2IO=m
+CONFIG_VXGE=m
+# CONFIG_VXGE_DEBUG_TRACE_ALL is not set
+CONFIG_NET_VENDOR_FUJITSU=y
+CONFIG_PCMCIA_FMVJ18X=m
+CONFIG_NET_VENDOR_HP=y
+CONFIG_HP100=m
+CONFIG_NET_VENDOR_INTEL=y
+CONFIG_E100=m
CONFIG_E1000=m
CONFIG_E1000E=m
-CONFIG_IP1000=m
CONFIG_IGB=m
CONFIG_IGB_DCA=y
CONFIG_IGBVF=m
-CONFIG_NS83820=m
-CONFIG_HAMACHI=m
-CONFIG_YELLOWFIN=m
-CONFIG_R8169=m
-CONFIG_SIS190=m
+CONFIG_IXGB=m
+CONFIG_IXGBE=m
+CONFIG_IXGBE_DCA=y
+# CONFIG_IXGBEVF is not set
+CONFIG_NET_VENDOR_I825XX=y
+# CONFIG_ZNET is not set
+CONFIG_IP1000=m
+CONFIG_JME=m
+CONFIG_NET_VENDOR_MARVELL=y
CONFIG_SKGE=m
# CONFIG_SKGE_DEBUG is not set
+CONFIG_SKGE_GENESIS=y
CONFIG_SKY2=m
# CONFIG_SKY2_DEBUG is not set
-CONFIG_VIA_VELOCITY=m
-CONFIG_TIGON3=m
-CONFIG_BNX2=m
-CONFIG_CNIC=m
-CONFIG_QLA3XXX=m
-CONFIG_ATL1=m
-CONFIG_ATL1E=m
-CONFIG_ATL1C=m
-CONFIG_JME=m
-CONFIG_STMMAC_ETH=m
-# CONFIG_STMMAC_DA is not set
-# CONFIG_STMMAC_DUAL_MAC is not set
-CONFIG_PCH_GBE=m
-CONFIG_NETDEV_10000=y
-CONFIG_MDIO=m
-CONFIG_CHELSIO_T1=m
-CONFIG_CHELSIO_T1_1G=y
-CONFIG_CHELSIO_T3=m
-CONFIG_CHELSIO_T4=m
-CONFIG_CHELSIO_T4VF=m
-CONFIG_ENIC=m
-CONFIG_IXGBE=m
-CONFIG_IXGBE_DCA=y
-# CONFIG_IXGBEVF is not set
-CONFIG_IXGB=m
-CONFIG_S2IO=m
-CONFIG_VXGE=m
-# CONFIG_VXGE_DEBUG_TRACE_ALL is not set
-CONFIG_MYRI10GE=m
-CONFIG_MYRI10GE_DCA=y
-CONFIG_NETXEN_NIC=m
-CONFIG_NIU=m
+CONFIG_NET_VENDOR_MELLANOX=y
CONFIG_MLX4_EN=m
CONFIG_MLX4_CORE=m
CONFIG_MLX4_DEBUG=y
-CONFIG_TEHUTI=m
-CONFIG_BNX2X=m
+CONFIG_NET_VENDOR_MICREL=y
+CONFIG_KS8842=m
+CONFIG_KS8851=m
+CONFIG_KS8851_MLL=m
+CONFIG_KSZ884X_PCI=m
+CONFIG_NET_VENDOR_MICROCHIP=y
+CONFIG_ENC28J60=m
+# CONFIG_ENC28J60_WRITEVERIFY is not set
+CONFIG_NET_VENDOR_MYRI=y
+CONFIG_MYRI10GE=m
+CONFIG_MYRI10GE_DCA=y
+CONFIG_FEALNX=m
+CONFIG_NET_VENDOR_NATSEMI=y
+CONFIG_NATSEMI=m
+CONFIG_NS83820=m
+CONFIG_NET_VENDOR_8390=y
+CONFIG_PCMCIA_AXNET=m
+CONFIG_NE2K_PCI=m
+CONFIG_PCMCIA_PCNET=m
+CONFIG_NET_VENDOR_NVIDIA=y
+CONFIG_FORCEDETH=m
+CONFIG_NET_VENDOR_OKI=y
+CONFIG_PCH_GBE=m
+CONFIG_ETHOC=m
+CONFIG_NET_PACKET_ENGINE=y
+CONFIG_HAMACHI=m
+CONFIG_YELLOWFIN=m
+CONFIG_NET_VENDOR_QLOGIC=y
+CONFIG_QLA3XXX=m
CONFIG_QLCNIC=m
CONFIG_QLGE=m
-CONFIG_BNA=m
+CONFIG_NETXEN_NIC=m
+CONFIG_NET_VENDOR_REALTEK=y
+CONFIG_ATP=m
+CONFIG_8139CP=m
+CONFIG_8139TOO=m
+CONFIG_8139TOO_PIO=y
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+# CONFIG_8139TOO_8129 is not set
+# CONFIG_8139_OLD_RX_RESET is not set
+CONFIG_R8169=m
+CONFIG_NET_VENDOR_RDC=y
+CONFIG_R6040=m
+CONFIG_NET_VENDOR_SEEQ=y
+CONFIG_SEEQ8005=m
+CONFIG_NET_VENDOR_SILAN=y
+CONFIG_SC92031=m
+CONFIG_NET_VENDOR_SIS=y
+CONFIG_SIS900=m
+CONFIG_SIS190=m
CONFIG_SFC=m
CONFIG_SFC_MTD=y
-CONFIG_BE2NET=m
+CONFIG_NET_VENDOR_SMSC=y
+CONFIG_PCMCIA_SMC91C92=m
+CONFIG_EPIC100=m
+CONFIG_SMSC9420=m
+CONFIG_NET_VENDOR_STMICRO=y
+CONFIG_STMMAC_ETH=m
+# CONFIG_STMMAC_DEBUG_FS is not set
+# CONFIG_STMMAC_DA is not set
+CONFIG_STMMAC_RING=y
+# CONFIG_STMMAC_CHAINED is not set
+CONFIG_NET_VENDOR_SUN=y
+CONFIG_HAPPYMEAL=m
+CONFIG_SUNGEM=m
+CONFIG_CASSINI=m
+CONFIG_NIU=m
+CONFIG_NET_VENDOR_TEHUTI=y
+CONFIG_TEHUTI=m
+CONFIG_NET_VENDOR_TI=y
+CONFIG_TLAN=m
+CONFIG_NET_VENDOR_VIA=y
+CONFIG_VIA_RHINE=m
+# CONFIG_VIA_RHINE_MMIO is not set
+CONFIG_VIA_VELOCITY=m
+CONFIG_NET_VENDOR_XIRCOM=y
+CONFIG_PCMCIA_XIRC2PS=m
+CONFIG_FDDI=y
+CONFIG_DEFXX=m
+# CONFIG_DEFXX_MMIO is not set
+CONFIG_SKFP=m
+CONFIG_HIPPI=y
+CONFIG_ROADRUNNER=m
+# CONFIG_ROADRUNNER_LARGE_RINGS is not set
+CONFIG_NET_SB1000=m
+CONFIG_PHYLIB=m
+
+#
+# MII PHY device drivers
+#
+CONFIG_MARVELL_PHY=m
+CONFIG_DAVICOM_PHY=m
+CONFIG_QSEMI_PHY=m
+CONFIG_LXT_PHY=m
+CONFIG_CICADA_PHY=m
+CONFIG_VITESSE_PHY=m
+CONFIG_SMSC_PHY=m
+CONFIG_BROADCOM_PHY=m
+CONFIG_ICPLUS_PHY=m
+CONFIG_REALTEK_PHY=m
+CONFIG_NATIONAL_PHY=m
+CONFIG_STE10XP=m
+CONFIG_LSI_ET1011C_PHY=m
+CONFIG_MICREL_PHY=m
+CONFIG_MDIO_BITBANG=m
+CONFIG_MDIO_GPIO=m
+CONFIG_PLIP=m
+CONFIG_PPP=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_MPPE=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPPOATM=m
+CONFIG_PPPOE=m
+CONFIG_PPTP=m
+CONFIG_PPPOL2TP=m
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_SLIP=m
+CONFIG_SLHC=m
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLIP_SMART=y
+CONFIG_SLIP_MODE_SLIP6=y
# CONFIG_TR is not set
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_NET_AX8817X=m
+CONFIG_USB_NET_CDCETHER=m
+CONFIG_USB_NET_CDC_EEM=m
+CONFIG_USB_NET_CDC_NCM=m
+CONFIG_USB_NET_DM9601=m
+CONFIG_USB_NET_SMSC75XX=m
+CONFIG_USB_NET_SMSC95XX=m
+CONFIG_USB_NET_GL620A=m
+CONFIG_USB_NET_NET1080=m
+CONFIG_USB_NET_PLUSB=m
+CONFIG_USB_NET_MCS7830=m
+CONFIG_USB_NET_RNDIS_HOST=m
+CONFIG_USB_NET_CDC_SUBSET=m
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_KC2190=y
+CONFIG_USB_NET_ZAURUS=m
+CONFIG_USB_NET_CX82310_ETH=m
+CONFIG_USB_NET_KALMIA=m
+CONFIG_USB_HSO=m
+CONFIG_USB_NET_INT51X1=m
+CONFIG_USB_CDC_PHONET=m
+CONFIG_USB_IPHETH=m
+CONFIG_USB_SIERRA_NET=m
+CONFIG_USB_VL600=m
CONFIG_WLAN=y
CONFIG_PCMCIA_RAYCS=m
CONFIG_LIBERTAS_THINFIRM=m
@@ -1986,16 +2156,20 @@ CONFIG_ATH5K_PCI=y
CONFIG_ATH9K_HW=m
CONFIG_ATH9K_COMMON=m
CONFIG_ATH9K=m
+CONFIG_ATH9K_PCI=y
+CONFIG_ATH9K_AHB=y
# CONFIG_ATH9K_DEBUGFS is not set
CONFIG_ATH9K_RATE_CONTROL=y
CONFIG_ATH9K_HTC=m
# CONFIG_ATH9K_HTC_DEBUGFS is not set
-CONFIG_AR9170_USB=m
-CONFIG_AR9170_LEDS=y
CONFIG_CARL9170=m
CONFIG_CARL9170_LEDS=y
CONFIG_CARL9170_WPC=y
+CONFIG_CARL9170_HWRNG=y
+CONFIG_ATH6KL=m
+CONFIG_ATH6KL_DEBUG=y
CONFIG_B43=m
+CONFIG_B43_SSB=y
CONFIG_B43_PCI_AUTOSELECT=y
CONFIG_B43_PCICORE_AUTOSELECT=y
CONFIG_B43_PCMCIA=y
@@ -2003,6 +2177,7 @@ CONFIG_B43_SDIO=y
CONFIG_B43_PIO=y
CONFIG_B43_PHY_N=y
CONFIG_B43_PHY_LP=y
+CONFIG_B43_PHY_HT=y
CONFIG_B43_LEDS=y
CONFIG_B43_HWRNG=y
# CONFIG_B43_DEBUG is not set
@@ -2017,6 +2192,8 @@ CONFIG_B43LEGACY_PIO=y
CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y
# CONFIG_B43LEGACY_DMA_MODE is not set
# CONFIG_B43LEGACY_PIO_MODE is not set
+# CONFIG_BRCMSMAC is not set
+# CONFIG_BRCMFMAC is not set
CONFIG_HOSTAP=m
CONFIG_HOSTAP_FIRMWARE=y
CONFIG_HOSTAP_FIRMWARE_NVRAM=y
@@ -2034,13 +2211,13 @@ CONFIG_IPW2200_QOS=y
# CONFIG_IPW2200_DEBUG is not set
CONFIG_LIBIPW=m
# CONFIG_LIBIPW_DEBUG is not set
-CONFIG_IWLAGN=m
+CONFIG_IWLWIFI=m
#
# Debugging Options
#
# CONFIG_IWLWIFI_DEBUG is not set
-# CONFIG_IWL_P2P is not set
+# CONFIG_IWLWIFI_DEVICE_SVTOOL is not set
CONFIG_IWLWIFI_LEGACY=m
#
@@ -2080,23 +2257,25 @@ CONFIG_RT61PCI=m
CONFIG_RT2800PCI=m
CONFIG_RT2800PCI_RT33XX=y
# CONFIG_RT2800PCI_RT35XX is not set
-# CONFIG_RT2800PCI_RT53XX is not set
+CONFIG_RT2800PCI_RT53XX=y
CONFIG_RT2500USB=m
CONFIG_RT73USB=m
CONFIG_RT2800USB=m
CONFIG_RT2800USB_RT33XX=y
# CONFIG_RT2800USB_RT35XX is not set
+CONFIG_RT2800USB_RT53XX=y
CONFIG_RT2800USB_UNKNOWN=y
CONFIG_RT2800_LIB=m
CONFIG_RT2X00_LIB_PCI=m
CONFIG_RT2X00_LIB_USB=m
CONFIG_RT2X00_LIB=m
-CONFIG_RT2X00_LIB_HT=y
CONFIG_RT2X00_LIB_FIRMWARE=y
CONFIG_RT2X00_LIB_CRYPTO=y
CONFIG_RT2X00_LIB_LEDS=y
# CONFIG_RT2X00_DEBUG is not set
CONFIG_RTL8192CE=m
+CONFIG_RTL8192SE=m
+CONFIG_RTL8192DE=m
CONFIG_RTL8192CU=m
CONFIG_RTLWIFI=m
CONFIG_RTL8192C_COMMON=m
@@ -2105,13 +2284,15 @@ CONFIG_WL1251_SPI=m
CONFIG_WL1251_SDIO=m
CONFIG_WL12XX_MENU=m
CONFIG_WL12XX=m
-CONFIG_WL12XX_HT=y
CONFIG_WL12XX_SPI=m
CONFIG_WL12XX_SDIO=m
CONFIG_WL12XX_SDIO_TEST=m
CONFIG_WL12XX_PLATFORM_DATA=y
CONFIG_ZD1211RW=m
# CONFIG_ZD1211RW_DEBUG is not set
+CONFIG_MWIFIEX=m
+CONFIG_MWIFIEX_SDIO=m
+CONFIG_MWIFIEX_PCIE=m
#
# WiMAX Wireless Broadband devices
@@ -2121,52 +2302,6 @@ CONFIG_WIMAX_I2400M_USB=m
CONFIG_WIMAX_I2400M_SDIO=m
CONFIG_WIMAX_IWMC3200_SDIO=y
CONFIG_WIMAX_I2400M_DEBUG_LEVEL=8
-
-#
-# USB Network Adapters
-#
-CONFIG_USB_CATC=m
-CONFIG_USB_KAWETH=m
-CONFIG_USB_PEGASUS=m
-CONFIG_USB_RTL8150=m
-CONFIG_USB_USBNET=m
-CONFIG_USB_NET_AX8817X=m
-CONFIG_USB_NET_CDCETHER=m
-CONFIG_USB_NET_CDC_EEM=m
-CONFIG_USB_NET_CDC_NCM=m
-CONFIG_USB_NET_DM9601=m
-CONFIG_USB_NET_SMSC75XX=m
-CONFIG_USB_NET_SMSC95XX=m
-CONFIG_USB_NET_GL620A=m
-CONFIG_USB_NET_NET1080=m
-CONFIG_USB_NET_PLUSB=m
-CONFIG_USB_NET_MCS7830=m
-CONFIG_USB_NET_RNDIS_HOST=m
-CONFIG_USB_NET_CDC_SUBSET=m
-CONFIG_USB_ALI_M5632=y
-CONFIG_USB_AN2720=y
-CONFIG_USB_BELKIN=y
-CONFIG_USB_ARMLINUX=y
-CONFIG_USB_EPSON2888=y
-CONFIG_USB_KC2190=y
-CONFIG_USB_NET_ZAURUS=m
-CONFIG_USB_NET_CX82310_ETH=m
-CONFIG_USB_HSO=m
-CONFIG_USB_NET_INT51X1=m
-CONFIG_USB_CDC_PHONET=m
-CONFIG_USB_IPHETH=m
-CONFIG_USB_SIERRA_NET=m
-CONFIG_USB_VL600=m
-CONFIG_NET_PCMCIA=y
-CONFIG_PCMCIA_3C589=m
-CONFIG_PCMCIA_3C574=m
-CONFIG_PCMCIA_FMVJ18X=m
-CONFIG_PCMCIA_PCNET=m
-CONFIG_PCMCIA_NMCLAN=m
-CONFIG_PCMCIA_SMC91C92=m
-CONFIG_PCMCIA_XIRC2PS=m
-CONFIG_PCMCIA_AXNET=m
-CONFIG_ARCNET_COM20020_CS=m
CONFIG_WAN=y
CONFIG_LANMEDIA=m
CONFIG_HDLC=m
@@ -2193,79 +2328,8 @@ CONFIG_LAPBETHER=m
CONFIG_X25_ASY=m
CONFIG_SBNI=m
CONFIG_SBNI_MULTILINE=y
-CONFIG_ATM_DRIVERS=y
-CONFIG_ATM_DUMMY=m
-CONFIG_ATM_TCP=m
-CONFIG_ATM_LANAI=m
-CONFIG_ATM_ENI=m
-# CONFIG_ATM_ENI_DEBUG is not set
-# CONFIG_ATM_ENI_TUNE_BURST is not set
-CONFIG_ATM_FIRESTREAM=m
-CONFIG_ATM_ZATM=m
-# CONFIG_ATM_ZATM_DEBUG is not set
-CONFIG_ATM_NICSTAR=m
-# CONFIG_ATM_NICSTAR_USE_SUNI is not set
-# CONFIG_ATM_NICSTAR_USE_IDT77105 is not set
-CONFIG_ATM_IDT77252=m
-# CONFIG_ATM_IDT77252_DEBUG is not set
-# CONFIG_ATM_IDT77252_RCV_ALL is not set
-CONFIG_ATM_IDT77252_USE_SUNI=y
-CONFIG_ATM_AMBASSADOR=m
-# CONFIG_ATM_AMBASSADOR_DEBUG is not set
-CONFIG_ATM_HORIZON=m
-# CONFIG_ATM_HORIZON_DEBUG is not set
-CONFIG_ATM_IA=m
-# CONFIG_ATM_IA_DEBUG is not set
-CONFIG_ATM_FORE200E=m
-CONFIG_ATM_FORE200E_USE_TASKLET=y
-CONFIG_ATM_FORE200E_TX_RETRY=16
-CONFIG_ATM_FORE200E_DEBUG=0
-CONFIG_ATM_HE=m
-CONFIG_ATM_HE_USE_SUNI=y
-CONFIG_ATM_SOLOS=m
-CONFIG_IEEE802154_DRIVERS=m
-CONFIG_IEEE802154_FAKEHARD=m
-
-#
-# CAIF transport drivers
-#
-CONFIG_CAIF_TTY=m
-CONFIG_CAIF_SPI_SLAVE=m
-# CONFIG_CAIF_SPI_SYNC is not set
CONFIG_XEN_NETDEV_FRONTEND=y
CONFIG_XEN_NETDEV_BACKEND=m
-CONFIG_FDDI=y
-CONFIG_DEFXX=m
-# CONFIG_DEFXX_MMIO is not set
-CONFIG_SKFP=m
-CONFIG_HIPPI=y
-CONFIG_ROADRUNNER=m
-# CONFIG_ROADRUNNER_LARGE_RINGS is not set
-CONFIG_PLIP=m
-CONFIG_PPP=m
-CONFIG_PPP_MULTILINK=y
-CONFIG_PPP_FILTER=y
-CONFIG_PPP_ASYNC=m
-CONFIG_PPP_SYNC_TTY=m
-CONFIG_PPP_DEFLATE=m
-CONFIG_PPP_BSDCOMP=m
-CONFIG_PPP_MPPE=m
-CONFIG_PPPOE=m
-CONFIG_PPTP=m
-CONFIG_PPPOATM=m
-CONFIG_PPPOL2TP=m
-CONFIG_SLIP=m
-CONFIG_SLIP_COMPRESSED=y
-CONFIG_SLHC=m
-CONFIG_SLIP_SMART=y
-CONFIG_SLIP_MODE_SLIP6=y
-# CONFIG_NET_FC is not set
-CONFIG_NETCONSOLE=m
-CONFIG_NETCONSOLE_DYNAMIC=y
-CONFIG_NETPOLL=y
-# CONFIG_NETPOLL_TRAP is not set
-CONFIG_NET_POLL_CONTROLLER=y
-CONFIG_VIRTIO_NET=m
CONFIG_VMXNET3=m
CONFIG_ISDN=y
# CONFIG_ISDN_I4L is not set
@@ -2274,8 +2338,6 @@ CONFIG_ISDN_CAPI=m
# CONFIG_CAPI_TRACE is not set
CONFIG_ISDN_CAPI_MIDDLEWARE=y
CONFIG_ISDN_CAPI_CAPI20=m
-CONFIG_ISDN_CAPI_CAPIFS_BOOL=y
-CONFIG_ISDN_CAPI_CAPIFS=m
#
# CAPI hardware drivers
@@ -2345,8 +2407,9 @@ CONFIG_INPUT_EVBUG=m
#
CONFIG_INPUT_KEYBOARD=y
# CONFIG_KEYBOARD_ADP5588 is not set
+# CONFIG_KEYBOARD_ADP5589 is not set
CONFIG_KEYBOARD_ATKBD=y
-CONFIG_KEYBOARD_QT1070=m
+# CONFIG_KEYBOARD_QT1070 is not set
# CONFIG_KEYBOARD_QT2160 is not set
CONFIG_KEYBOARD_LKKBD=m
CONFIG_KEYBOARD_GPIO=m
@@ -2356,6 +2419,7 @@ CONFIG_KEYBOARD_MATRIX=m
CONFIG_KEYBOARD_LM8323=m
# CONFIG_KEYBOARD_MAX7359 is not set
CONFIG_KEYBOARD_MCS=m
+# CONFIG_KEYBOARD_MPR121 is not set
CONFIG_KEYBOARD_NEWTON=m
# CONFIG_KEYBOARD_OPENCORES is not set
CONFIG_KEYBOARD_STOWAWAY=m
@@ -2395,6 +2459,7 @@ CONFIG_TOUCHSCREEN_FUJITSU=m
CONFIG_TOUCHSCREEN_GUNZE=m
CONFIG_TOUCHSCREEN_ELO=m
CONFIG_TOUCHSCREEN_WACOM_W8001=m
+# CONFIG_TOUCHSCREEN_MAX11801 is not set
# CONFIG_TOUCHSCREEN_MCS5000 is not set
CONFIG_TOUCHSCREEN_MTOUCH=m
CONFIG_TOUCHSCREEN_INEXIO=m
@@ -2426,7 +2491,8 @@ CONFIG_TOUCHSCREEN_USB_ZYTRONIC=y
CONFIG_TOUCHSCREEN_USB_ETT_TC45USB=y
CONFIG_TOUCHSCREEN_USB_NEXIO=y
CONFIG_TOUCHSCREEN_TOUCHIT213=m
-CONFIG_TOUCHSCREEN_TSC2005=m
+CONFIG_TOUCHSCREEN_TSC_SERIO=m
+# CONFIG_TOUCHSCREEN_TSC2005 is not set
CONFIG_TOUCHSCREEN_TSC2007=m
CONFIG_TOUCHSCREEN_ST1232=m
CONFIG_TOUCHSCREEN_TPS6507X=m
@@ -2434,12 +2500,17 @@ CONFIG_INPUT_MISC=y
CONFIG_INPUT_AD714X=m
CONFIG_INPUT_AD714X_I2C=m
CONFIG_INPUT_AD714X_SPI=m
+# CONFIG_INPUT_BMA150 is not set
CONFIG_INPUT_PCSPKR=m
+# CONFIG_INPUT_MC13783_PWRBUTTON is not set
+CONFIG_INPUT_MMA8450=m
+CONFIG_INPUT_MPU3050=m
CONFIG_INPUT_APANEL=m
CONFIG_INPUT_ATLAS_BTNS=m
-CONFIG_INPUT_ATI_REMOTE=m
CONFIG_INPUT_ATI_REMOTE2=m
CONFIG_INPUT_KEYSPAN_REMOTE=m
+CONFIG_INPUT_KXTJ9=m
+# CONFIG_INPUT_KXTJ9_POLLED_MODE is not set
CONFIG_INPUT_POWERMATE=m
CONFIG_INPUT_YEALINK=m
CONFIG_INPUT_CM109=m
@@ -2475,6 +2546,7 @@ CONFIG_SERIO_PS2MULT=m
CONFIG_VT=y
CONFIG_CONSOLE_TRANSLATIONS=y
CONFIG_VT_CONSOLE=y
+CONFIG_VT_CONSOLE_SLEEP=y
CONFIG_HW_CONSOLE=y
# CONFIG_VT_HW_CONSOLE_BINDING is not set
CONFIG_UNIX98_PTYS=y
@@ -2493,6 +2565,7 @@ CONFIG_NOZOMI=m
CONFIG_ISI=m
CONFIG_N_HDLC=m
# CONFIG_N_GSM is not set
+# CONFIG_TRACE_SINK is not set
# CONFIG_DEVKMEM is not set
CONFIG_STALDRV=y
@@ -2531,6 +2604,7 @@ CONFIG_SERIAL_ALTERA_UART_MAXPORTS=4
CONFIG_SERIAL_ALTERA_UART_BAUDRATE=115200
CONFIG_SERIAL_IFX6X60=m
CONFIG_SERIAL_PCH_UART=m
+# CONFIG_SERIAL_XILINX_PS_UART is not set
# CONFIG_TTY_PRINTK is not set
CONFIG_PRINTER=m
# CONFIG_LP_CONSOLE is not set
@@ -2625,6 +2699,7 @@ CONFIG_I2C_SCMI=m
#
# I2C system bus drivers (mostly embedded / system-on-chip)
#
+# CONFIG_I2C_DESIGNWARE_PCI is not set
CONFIG_I2C_GPIO=m
CONFIG_I2C_INTEL_MID=m
CONFIG_I2C_OCORES=m
@@ -2651,17 +2726,18 @@ CONFIG_I2C_STUB=m
# CONFIG_I2C_DEBUG_ALGO is not set
# CONFIG_I2C_DEBUG_BUS is not set
CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
CONFIG_SPI_MASTER=y
#
# SPI Master Controller Drivers
#
-CONFIG_SPI_ALTERA=m
+# CONFIG_SPI_ALTERA is not set
CONFIG_SPI_BITBANG=m
CONFIG_SPI_BUTTERFLY=m
CONFIG_SPI_GPIO=m
CONFIG_SPI_LM70_LLP=m
-CONFIG_SPI_OC_TINY=m
+# CONFIG_SPI_OC_TINY is not set
# CONFIG_SPI_PXA2XX_PCI is not set
CONFIG_SPI_TOPCLIFF_PCH=m
# CONFIG_SPI_XILINX is not set
@@ -2682,15 +2758,24 @@ CONFIG_SPI_TLE62X0=m
#
# PPS generators support
#
+
+#
+# PTP clock support
+#
+
+#
+# Enable Device Drivers -> PPS to see the PTP clock options.
+#
CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
CONFIG_GPIOLIB=y
+# CONFIG_DEBUG_GPIO is not set
# CONFIG_GPIO_SYSFS is not set
CONFIG_GPIO_MAX730X=m
#
-# Memory mapped GPIO expanders:
+# Memory mapped GPIO drivers:
#
-CONFIG_GPIO_BASIC_MMIO=m
+# CONFIG_GPIO_GENERIC_PLATFORM is not set
CONFIG_GPIO_IT8761E=m
CONFIG_GPIO_SCH=m
CONFIG_GPIO_VX855=m
@@ -2731,43 +2816,21 @@ CONFIG_GPIO_74X164=m
# MODULbus GPIO expanders:
#
CONFIG_GPIO_JANZ_TTL=m
-CONFIG_W1=m
-CONFIG_W1_CON=y
-
-#
-# 1-wire Bus Masters
-#
-CONFIG_W1_MASTER_MATROX=m
-CONFIG_W1_MASTER_DS2490=m
-CONFIG_W1_MASTER_DS2482=m
-CONFIG_W1_MASTER_GPIO=m
-
-#
-# 1-wire Slaves
-#
-CONFIG_W1_SLAVE_THERM=m
-CONFIG_W1_SLAVE_SMEM=m
-CONFIG_W1_SLAVE_DS2423=m
-CONFIG_W1_SLAVE_DS2431=m
-CONFIG_W1_SLAVE_DS2433=m
-# CONFIG_W1_SLAVE_DS2433_CRC is not set
-CONFIG_W1_SLAVE_DS2760=m
-CONFIG_W1_SLAVE_BQ27000=m
-CONFIG_POWER_SUPPLY=y
+# CONFIG_W1 is not set
+CONFIG_POWER_SUPPLY=m
# CONFIG_POWER_SUPPLY_DEBUG is not set
-CONFIG_PDA_POWER=m
-CONFIG_TEST_POWER=m
-CONFIG_BATTERY_DS2760=m
-CONFIG_BATTERY_DS2782=m
-CONFIG_BATTERY_BQ20Z75=m
-CONFIG_BATTERY_BQ27x00=m
-CONFIG_BATTERY_BQ27X00_I2C=y
-CONFIG_BATTERY_BQ27X00_PLATFORM=y
-CONFIG_BATTERY_MAX17040=m
-CONFIG_BATTERY_MAX17042=m
-CONFIG_CHARGER_PCF50633=m
-CONFIG_CHARGER_ISP1704=m
-CONFIG_CHARGER_GPIO=m
+# CONFIG_PDA_POWER is not set
+# CONFIG_TEST_POWER is not set
+# CONFIG_BATTERY_DS2780 is not set
+# CONFIG_BATTERY_DS2782 is not set
+# CONFIG_BATTERY_BQ20Z75 is not set
+# CONFIG_BATTERY_BQ27x00 is not set
+# CONFIG_BATTERY_MAX17040 is not set
+# CONFIG_BATTERY_MAX17042 is not set
+# CONFIG_CHARGER_PCF50633 is not set
+# CONFIG_CHARGER_ISP1704 is not set
+# CONFIG_CHARGER_MAX8903 is not set
+# CONFIG_CHARGER_GPIO is not set
CONFIG_HWMON=m
CONFIG_HWMON_VID=m
# CONFIG_HWMON_DEBUG_CHIP is not set
@@ -2777,6 +2840,7 @@ CONFIG_HWMON_VID=m
#
CONFIG_SENSORS_ABITUGURU=m
CONFIG_SENSORS_ABITUGURU3=m
+CONFIG_SENSORS_AD7314=m
CONFIG_SENSORS_AD7414=m
CONFIG_SENSORS_AD7418=m
CONFIG_SENSORS_ADCXX=m
@@ -2793,6 +2857,7 @@ CONFIG_SENSORS_ADT7475=m
CONFIG_SENSORS_ASC7621=m
CONFIG_SENSORS_K8TEMP=m
CONFIG_SENSORS_K10TEMP=m
+CONFIG_SENSORS_FAM15H_POWER=m
CONFIG_SENSORS_ASB100=m
CONFIG_SENSORS_ATXP1=m
CONFIG_SENSORS_DS620=m
@@ -2807,7 +2872,6 @@ CONFIG_SENSORS_GL518SM=m
CONFIG_SENSORS_GL520SM=m
CONFIG_SENSORS_GPIO_FAN=m
CONFIG_SENSORS_CORETEMP=m
-CONFIG_SENSORS_PKGTEMP=m
CONFIG_SENSORS_IBMAEM=m
CONFIG_SENSORS_IBMPEX=m
CONFIG_SENSORS_IT87=m
@@ -2831,18 +2895,29 @@ CONFIG_SENSORS_LTC4215=m
CONFIG_SENSORS_LTC4245=m
CONFIG_SENSORS_LTC4261=m
CONFIG_SENSORS_LM95241=m
+CONFIG_SENSORS_LM95245=m
CONFIG_SENSORS_MAX1111=m
+CONFIG_SENSORS_MAX16065=m
CONFIG_SENSORS_MAX1619=m
+CONFIG_SENSORS_MAX1668=m
CONFIG_SENSORS_MAX6639=m
+CONFIG_SENSORS_MAX6642=m
CONFIG_SENSORS_MAX6650=m
+CONFIG_SENSORS_NTC_THERMISTOR=m
CONFIG_SENSORS_PC87360=m
CONFIG_SENSORS_PC87427=m
CONFIG_SENSORS_PCF8591=m
CONFIG_PMBUS=m
CONFIG_SENSORS_PMBUS=m
+CONFIG_SENSORS_ADM1275=m
+CONFIG_SENSORS_LM25066=m
+CONFIG_SENSORS_LTC2978=m
CONFIG_SENSORS_MAX16064=m
CONFIG_SENSORS_MAX34440=m
CONFIG_SENSORS_MAX8688=m
+CONFIG_SENSORS_UCD9000=m
+CONFIG_SENSORS_UCD9200=m
+CONFIG_SENSORS_ZL6100=m
CONFIG_SENSORS_SHT15=m
CONFIG_SENSORS_SHT21=m
CONFIG_SENSORS_SIS5595=m
@@ -2850,10 +2925,13 @@ CONFIG_SENSORS_SMM665=m
CONFIG_SENSORS_DME1737=m
CONFIG_SENSORS_EMC1403=m
CONFIG_SENSORS_EMC2103=m
+CONFIG_SENSORS_EMC6W201=m
CONFIG_SENSORS_SMSC47M1=m
CONFIG_SENSORS_SMSC47M192=m
CONFIG_SENSORS_SMSC47B397=m
+CONFIG_SENSORS_SCH56XX_COMMON=m
CONFIG_SENSORS_SCH5627=m
+CONFIG_SENSORS_SCH5636=m
CONFIG_SENSORS_ADS1015=m
CONFIG_SENSORS_ADS7828=m
CONFIG_SENSORS_ADS7871=m
@@ -2882,9 +2960,11 @@ CONFIG_SENSORS_APPLESMC=m
#
# ACPI drivers
#
+CONFIG_SENSORS_ACPI_POWER=m
CONFIG_SENSORS_ATK0110=m
CONFIG_THERMAL=y
CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_CORE=y
# CONFIG_WATCHDOG_NOWAYOUT is not set
#
@@ -2956,23 +3036,33 @@ CONFIG_SSB_SDIOHOST=y
# CONFIG_SSB_DEBUG is not set
CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y
CONFIG_SSB_DRIVER_PCICORE=y
-CONFIG_MFD_SUPPORT=y
+CONFIG_BCMA_POSSIBLE=y
+
+#
+# Broadcom specific AMBA
+#
+# CONFIG_BCMA is not set
+
+#
+# Multifunction device drivers
+#
CONFIG_MFD_CORE=m
CONFIG_MFD_SM501=m
# CONFIG_MFD_SM501_GPIO is not set
CONFIG_HTC_PASIC3=m
CONFIG_UCB1400_CORE=m
-CONFIG_TPS6105X=m
+# CONFIG_TPS6105X is not set
CONFIG_TPS65010=m
CONFIG_TPS6507X=m
+# CONFIG_MFD_TPS65912_SPI is not set
# CONFIG_MFD_TMIO is not set
CONFIG_MFD_WM8400=m
# CONFIG_MFD_WM831X_SPI is not set
CONFIG_MFD_PCF50633=m
-CONFIG_MFD_MC13783=m
-CONFIG_MFD_MC13XXX=m
CONFIG_PCF50633_ADC=m
CONFIG_PCF50633_GPIO=m
+CONFIG_MFD_MC13783=m
+CONFIG_MFD_MC13XXX=m
CONFIG_ABX500_CORE=y
# CONFIG_EZX_PCAP is not set
# CONFIG_AB8500_CORE is not set
@@ -2983,39 +3073,18 @@ CONFIG_MFD_RDC321X=m
CONFIG_MFD_JANZ_CMODIO=m
CONFIG_MFD_VX855=m
CONFIG_MFD_WL1273_CORE=m
-CONFIG_REGULATOR=y
-# CONFIG_REGULATOR_DEBUG is not set
-# CONFIG_REGULATOR_DUMMY is not set
-CONFIG_REGULATOR_FIXED_VOLTAGE=m
-CONFIG_REGULATOR_VIRTUAL_CONSUMER=m
-CONFIG_REGULATOR_USERSPACE_CONSUMER=m
-CONFIG_REGULATOR_BQ24022=m
-CONFIG_REGULATOR_MAX1586=m
-CONFIG_REGULATOR_MAX8649=m
-CONFIG_REGULATOR_MAX8660=m
-CONFIG_REGULATOR_MAX8952=m
-CONFIG_REGULATOR_WM8400=m
-CONFIG_REGULATOR_PCF50633=m
-CONFIG_REGULATOR_LP3971=m
-CONFIG_REGULATOR_LP3972=m
-CONFIG_REGULATOR_MC13XXX_CORE=m
-CONFIG_REGULATOR_MC13783=m
-CONFIG_REGULATOR_MC13892=m
-CONFIG_REGULATOR_TPS6105X=m
-# CONFIG_REGULATOR_TPS65023 is not set
-# CONFIG_REGULATOR_TPS6507X is not set
-CONFIG_REGULATOR_ISL6271A=m
-# CONFIG_REGULATOR_AD5398 is not set
-CONFIG_REGULATOR_TPS6524X=m
+# CONFIG_REGULATOR is not set
CONFIG_MEDIA_SUPPORT=m
#
# Multimedia core support
#
-# CONFIG_MEDIA_CONTROLLER is not set
+CONFIG_MEDIA_CONTROLLER=y
CONFIG_VIDEO_DEV=m
CONFIG_VIDEO_V4L2_COMMON=m
+CONFIG_VIDEO_V4L2_SUBDEV_API=y
CONFIG_DVB_CORE=m
+CONFIG_DVB_NET=y
CONFIG_VIDEO_MEDIA=m
#
@@ -3032,12 +3101,16 @@ CONFIG_IR_RC6_DECODER=m
CONFIG_IR_JVC_DECODER=m
CONFIG_IR_SONY_DECODER=m
CONFIG_IR_RC5_SZ_DECODER=m
+CONFIG_IR_MCE_KBD_DECODER=m
CONFIG_IR_LIRC_CODEC=m
+CONFIG_RC_ATI_REMOTE=m
# CONFIG_IR_ENE is not set
CONFIG_IR_IMON=m
# CONFIG_IR_MCEUSB is not set
CONFIG_IR_ITE_CIR=m
+CONFIG_IR_FINTEK=m
# CONFIG_IR_NUVOTON is not set
+CONFIG_IR_REDRAT3=m
# CONFIG_IR_STREAMZAP is not set
CONFIG_IR_WINBOND_CIR=m
CONFIG_RC_LOOPBACK=m
@@ -3058,11 +3131,13 @@ CONFIG_MEDIA_TUNER_MT2131=m
CONFIG_MEDIA_TUNER_QT1010=m
CONFIG_MEDIA_TUNER_XC2028=m
CONFIG_MEDIA_TUNER_XC5000=m
+CONFIG_MEDIA_TUNER_XC4000=m
CONFIG_MEDIA_TUNER_MXL5005S=m
CONFIG_MEDIA_TUNER_MXL5007T=m
CONFIG_MEDIA_TUNER_MC44S803=m
CONFIG_MEDIA_TUNER_MAX2165=m
CONFIG_MEDIA_TUNER_TDA18218=m
+CONFIG_MEDIA_TUNER_TDA18212=m
CONFIG_VIDEO_V4L2=m
CONFIG_VIDEOBUF_GEN=m
CONFIG_VIDEOBUF_DMA_SG=m
@@ -3075,6 +3150,7 @@ CONFIG_VIDEO_TUNER=m
CONFIG_V4L2_MEM2MEM_DEV=m
CONFIG_VIDEOBUF2_CORE=m
CONFIG_VIDEOBUF2_MEMOPS=m
+CONFIG_VIDEOBUF2_DMA_CONTIG=m
CONFIG_VIDEOBUF2_VMALLOC=m
CONFIG_VIDEO_CAPTURE_DRIVERS=y
# CONFIG_VIDEO_ADV_DEBUG is not set
@@ -3083,11 +3159,11 @@ CONFIG_VIDEO_CAPTURE_DRIVERS=y
CONFIG_VIDEO_IR_I2C=m
#
-# Encoders/decoders and other helper chips
+# Encoders, decoders, sensors and other helper chips
#
#
-# Audio decoders
+# Audio decoders, processors and mixers
#
CONFIG_VIDEO_TVAUDIO=m
CONFIG_VIDEO_TDA7432=m
@@ -3097,7 +3173,6 @@ CONFIG_VIDEO_TEA6420=m
CONFIG_VIDEO_MSP3400=m
CONFIG_VIDEO_CS5345=m
CONFIG_VIDEO_CS53L32A=m
-CONFIG_VIDEO_M52790=m
CONFIG_VIDEO_TLV320AIC23B=m
CONFIG_VIDEO_WM8775=m
CONFIG_VIDEO_WM8739=m
@@ -3116,12 +3191,8 @@ CONFIG_VIDEO_BT819=m
CONFIG_VIDEO_BT856=m
CONFIG_VIDEO_BT866=m
CONFIG_VIDEO_KS0127=m
-CONFIG_VIDEO_OV7670=m
-CONFIG_VIDEO_MT9V011=m
-CONFIG_VIDEO_TCM825X=m
CONFIG_VIDEO_SAA7110=m
CONFIG_VIDEO_SAA711X=m
-CONFIG_VIDEO_SAA717X=m
CONFIG_VIDEO_SAA7191=m
CONFIG_VIDEO_TVP514X=m
CONFIG_VIDEO_TVP5150=m
@@ -3131,6 +3202,7 @@ CONFIG_VIDEO_VPX3220=m
#
# Video and audio decoders
#
+CONFIG_VIDEO_SAA717X=m
CONFIG_VIDEO_CX25840=m
#
@@ -3145,15 +3217,39 @@ CONFIG_VIDEO_SAA7127=m
CONFIG_VIDEO_SAA7185=m
CONFIG_VIDEO_ADV7170=m
CONFIG_VIDEO_ADV7175=m
-CONFIG_VIDEO_THS7303=m
CONFIG_VIDEO_ADV7343=m
CONFIG_VIDEO_AK881X=m
#
+# Camera sensor devices
+#
+CONFIG_VIDEO_OV7670=m
+CONFIG_VIDEO_MT9P031=m
+CONFIG_VIDEO_MT9T001=m
+CONFIG_VIDEO_MT9V011=m
+CONFIG_VIDEO_MT9V032=m
+CONFIG_VIDEO_TCM825X=m
+# CONFIG_VIDEO_SR030PC30 is not set
+CONFIG_VIDEO_NOON010PC30=m
+# CONFIG_VIDEO_M5MOLS is not set
+CONFIG_VIDEO_S5K6AA=m
+
+#
+# Flash devices
+#
+# CONFIG_VIDEO_ADP1653 is not set
+
+#
# Video improvement chips
#
CONFIG_VIDEO_UPD64031A=m
CONFIG_VIDEO_UPD64083=m
+
+#
+# Miscelaneous helper chips
+#
+CONFIG_VIDEO_THS7303=m
+CONFIG_VIDEO_M52790=m
# CONFIG_VIDEO_VIVI is not set
CONFIG_VIDEO_BT848=m
CONFIG_VIDEO_BT848_DVB=y
@@ -3184,7 +3280,8 @@ CONFIG_VIDEO_CX88_DVB=m
CONFIG_VIDEO_CX88_MPEG=m
CONFIG_VIDEO_CX88_VP3054=m
CONFIG_VIDEO_CX23885=m
-CONFIG_MEDIA_ALTERA_CI=m
+# CONFIG_MEDIA_ALTERA_CI is not set
+# CONFIG_VIDEO_CX25821 is not set
CONFIG_VIDEO_AU0828=m
CONFIG_VIDEO_IVTV=m
CONFIG_VIDEO_FB_IVTV=m
@@ -3192,9 +3289,7 @@ CONFIG_VIDEO_CX18=m
CONFIG_VIDEO_CX18_ALSA=m
CONFIG_VIDEO_SAA7164=m
CONFIG_VIDEO_CAFE_CCIC=m
-# CONFIG_VIDEO_SR030PC30 is not set
# CONFIG_VIDEO_VIA_CAMERA is not set
-CONFIG_VIDEO_NOON010PC30=m
CONFIG_SOC_CAMERA=m
# CONFIG_SOC_CAMERA_IMX074 is not set
CONFIG_SOC_CAMERA_MT9M001=m
@@ -3206,6 +3301,7 @@ CONFIG_SOC_CAMERA_RJ54N1=m
CONFIG_SOC_CAMERA_TW9910=m
CONFIG_SOC_CAMERA_PLATFORM=m
CONFIG_SOC_CAMERA_OV2640=m
+# CONFIG_SOC_CAMERA_OV5642 is not set
# CONFIG_SOC_CAMERA_OV6650 is not set
CONFIG_SOC_CAMERA_OV772X=m
CONFIG_SOC_CAMERA_OV9640=m
@@ -3223,6 +3319,7 @@ CONFIG_USB_GSPCA_CPIA1=m
CONFIG_USB_GSPCA_ETOMS=m
CONFIG_USB_GSPCA_FINEPIX=m
CONFIG_USB_GSPCA_JEILINJ=m
+CONFIG_USB_GSPCA_KINECT=m
# CONFIG_USB_GSPCA_KONICA is not set
CONFIG_USB_GSPCA_MARS=m
CONFIG_USB_GSPCA_MR97310A=m
@@ -3233,6 +3330,7 @@ CONFIG_USB_GSPCA_OV534_9=m
CONFIG_USB_GSPCA_PAC207=m
CONFIG_USB_GSPCA_PAC7302=m
CONFIG_USB_GSPCA_PAC7311=m
+CONFIG_USB_GSPCA_SE401=m
CONFIG_USB_GSPCA_SN9C2028=m
CONFIG_USB_GSPCA_SN9C20X=m
CONFIG_USB_GSPCA_SONIXB=m
@@ -3251,6 +3349,7 @@ CONFIG_USB_GSPCA_STK014=m
CONFIG_USB_GSPCA_STV0680=m
CONFIG_USB_GSPCA_SUNPLUS=m
CONFIG_USB_GSPCA_T613=m
+CONFIG_USB_GSPCA_TOPRO=m
CONFIG_USB_GSPCA_TV8532=m
CONFIG_USB_GSPCA_VC032X=m
CONFIG_USB_GSPCA_VICAM=m
@@ -3264,11 +3363,13 @@ CONFIG_VIDEO_HDPVR=m
CONFIG_VIDEO_EM28XX=m
CONFIG_VIDEO_EM28XX_ALSA=m
CONFIG_VIDEO_EM28XX_DVB=m
+CONFIG_VIDEO_EM28XX_RC=y
CONFIG_VIDEO_TLG2300=m
CONFIG_VIDEO_CX231XX=m
CONFIG_VIDEO_CX231XX_RC=y
CONFIG_VIDEO_CX231XX_ALSA=m
CONFIG_VIDEO_CX231XX_DVB=m
+# CONFIG_VIDEO_TM6000 is not set
CONFIG_VIDEO_USBVISION=m
CONFIG_USB_ET61X251=m
CONFIG_USB_SN9C102=m
@@ -3280,7 +3381,6 @@ CONFIG_V4L_MEM2MEM_DRIVERS=y
CONFIG_VIDEO_MEM2MEM_TESTDEV=m
CONFIG_RADIO_ADAPTERS=y
CONFIG_RADIO_MAXIRADIO=m
-CONFIG_RADIO_MAESTRO=m
# CONFIG_I2C_SI4713 is not set
# CONFIG_RADIO_SI4713 is not set
CONFIG_USB_DSBR=m
@@ -3337,6 +3437,7 @@ CONFIG_DVB_USB_DTT200U=m
CONFIG_DVB_USB_OPERA1=m
CONFIG_DVB_USB_AF9005=m
CONFIG_DVB_USB_AF9005_REMOTE=m
+CONFIG_DVB_USB_PCTV452E=m
CONFIG_DVB_USB_DW2102=m
CONFIG_DVB_USB_CINERGY_T2=m
CONFIG_DVB_USB_ANYSEE=m
@@ -3348,6 +3449,8 @@ CONFIG_DVB_USB_EC168=m
CONFIG_DVB_USB_AZ6027=m
# CONFIG_DVB_USB_LME2510 is not set
CONFIG_DVB_USB_TECHNISAT_USB2=m
+CONFIG_DVB_USB_IT913X=m
+CONFIG_DVB_USB_MXL111SF=m
CONFIG_DVB_TTUSB_BUDGET=m
CONFIG_DVB_TTUSB_DEC=m
CONFIG_SMS_SIANO_MDTV=m
@@ -3405,6 +3508,11 @@ CONFIG_DVB_HOPPER=m
CONFIG_DVB_NGENE=m
#
+# Supported ddbridge ('Octopus') Adapters
+#
+CONFIG_DVB_DDBRIDGE=m
+
+#
# Supported DVB Frontends
#
# CONFIG_DVB_FE_CUSTOMISE is not set
@@ -3418,6 +3526,12 @@ CONFIG_DVB_STV090x=m
CONFIG_DVB_STV6110x=m
#
+# Multistandard (cable + terrestrial) frontends
+#
+CONFIG_DVB_DRXK=m
+CONFIG_DVB_TDA18271C2DD=m
+
+#
# DVB-S (satellite) frontends
#
CONFIG_DVB_CX24110=m
@@ -3443,6 +3557,7 @@ CONFIG_DVB_CX24116=m
CONFIG_DVB_SI21XX=m
CONFIG_DVB_DS3000=m
CONFIG_DVB_MB86A16=m
+CONFIG_DVB_TDA10071=m
#
# DVB-T (terrestrial) frontends
@@ -3451,6 +3566,7 @@ CONFIG_DVB_SP8870=m
CONFIG_DVB_SP887X=m
CONFIG_DVB_CX22700=m
CONFIG_DVB_CX22702=m
+CONFIG_DVB_DRXD=m
CONFIG_DVB_L64781=m
CONFIG_DVB_TDA1004X=m
CONFIG_DVB_NXT6000=m
@@ -3464,6 +3580,7 @@ CONFIG_DVB_TDA10048=m
CONFIG_DVB_AF9013=m
CONFIG_DVB_EC100=m
CONFIG_DVB_STV0367=m
+CONFIG_DVB_CXD2820R=m
#
# DVB-C (cable) frontends
@@ -3504,12 +3621,15 @@ CONFIG_DVB_TUNER_DIB0090=m
# SEC control devices for DVB-S
#
CONFIG_DVB_LNBP21=m
+CONFIG_DVB_LNBP22=m
CONFIG_DVB_ISL6405=m
CONFIG_DVB_ISL6421=m
CONFIG_DVB_ISL6423=m
+CONFIG_DVB_A8293=m
CONFIG_DVB_LGS8GXX=m
CONFIG_DVB_ATBM8830=m
CONFIG_DVB_TDA665x=m
+CONFIG_DVB_IT913X_FE=m
#
# Tools to develop new frontends
@@ -3540,6 +3660,7 @@ CONFIG_DRM_MGA=m
CONFIG_DRM_SIS=m
CONFIG_DRM_VIA=m
CONFIG_DRM_SAVAGE=m
+CONFIG_DRM_VMWGFX=m
# CONFIG_STUB_POULSBO is not set
CONFIG_VGASTATE=m
CONFIG_VIDEO_OUTPUT_CONTROL=m
@@ -3610,6 +3731,7 @@ CONFIG_FB_ATY_GENERIC_LCD=y
CONFIG_FB_ATY_GX=y
CONFIG_FB_ATY_BACKLIGHT=y
CONFIG_FB_S3=m
+CONFIG_FB_S3_DDC=y
CONFIG_FB_SAVAGE=m
CONFIG_FB_SAVAGE_I2C=y
CONFIG_FB_SAVAGE_ACCEL=y
@@ -3618,6 +3740,7 @@ CONFIG_FB_SIS_300=y
CONFIG_FB_SIS_315=y
CONFIG_FB_VIA=m
# CONFIG_FB_VIA_DIRECT_PROCFS is not set
+CONFIG_FB_VIA_X_COMPATIBILITY=y
CONFIG_FB_NEOMAGIC=m
CONFIG_FB_KYRO=m
CONFIG_FB_3DFX=m
@@ -3638,12 +3761,14 @@ CONFIG_FB_GEODE_GX1=m
CONFIG_FB_TMIO=m
CONFIG_FB_TMIO_ACCELL=y
CONFIG_FB_SM501=m
+# CONFIG_FB_SMSCUFX is not set
# CONFIG_FB_UDL is not set
# CONFIG_FB_VIRTUAL is not set
CONFIG_XEN_FBDEV_FRONTEND=m
CONFIG_FB_METRONOME=m
CONFIG_FB_MB862XX=m
-# CONFIG_FB_MB862XX_PCI_GDC is not set
+CONFIG_FB_MB862XX_PCI_GDC=y
+CONFIG_FB_MB862XX_I2C=y
CONFIG_FB_BROADSHEET=m
CONFIG_BACKLIGHT_LCD_SUPPORT=y
CONFIG_LCD_CLASS_DEVICE=m
@@ -3655,14 +3780,16 @@ CONFIG_LCD_TDO24M=m
CONFIG_LCD_VGG2432A4=m
CONFIG_LCD_PLATFORM=m
CONFIG_LCD_S6E63M0=m
-CONFIG_LCD_LD9040=m
+# CONFIG_LCD_LD9040 is not set
+CONFIG_LCD_AMS369FG06=m
CONFIG_BACKLIGHT_CLASS_DEVICE=m
CONFIG_BACKLIGHT_GENERIC=m
CONFIG_BACKLIGHT_PROGEAR=m
CONFIG_BACKLIGHT_CARILLO_RANCH=m
-CONFIG_BACKLIGHT_APPLE=m
+# CONFIG_BACKLIGHT_APPLE is not set
CONFIG_BACKLIGHT_SAHARA=m
CONFIG_BACKLIGHT_ADP8860=m
+# CONFIG_BACKLIGHT_ADP8870 is not set
CONFIG_BACKLIGHT_PCF50633=m
#
@@ -3735,6 +3862,7 @@ CONFIG_SND_AC97_POWER_SAVE=y
CONFIG_SND_AC97_POWER_SAVE_DEFAULT=0
CONFIG_SND_SB_COMMON=m
CONFIG_SND_SB16_DSP=m
+CONFIG_SND_TEA575X=m
CONFIG_SND_PCI=y
CONFIG_SND_AD1889=m
CONFIG_SND_ALS300=m
@@ -3781,9 +3909,11 @@ CONFIG_SND_ENS1371=m
CONFIG_SND_ES1938=m
CONFIG_SND_ES1968=m
CONFIG_SND_ES1968_INPUT=y
+CONFIG_SND_ES1968_RADIO=y
CONFIG_SND_FM801=m
# CONFIG_SND_FM801_TEA575X_BOOL is not set
CONFIG_SND_HDA_INTEL=m
+CONFIG_SND_HDA_PREALLOC_SIZE=4096
CONFIG_SND_HDA_HWDEP=y
# CONFIG_SND_HDA_RECONFIG is not set
CONFIG_SND_HDA_INPUT_BEEP=y
@@ -3791,6 +3921,7 @@ CONFIG_SND_HDA_INPUT_BEEP_MODE=0
CONFIG_SND_HDA_INPUT_JACK=y
# CONFIG_SND_HDA_PATCH_LOADER is not set
CONFIG_SND_HDA_CODEC_REALTEK=y
+CONFIG_SND_HDA_ENABLE_REALTEK_QUIRKS=y
CONFIG_SND_HDA_CODEC_ANALOG=y
CONFIG_SND_HDA_CODEC_SIGMATEL=y
CONFIG_SND_HDA_CODEC_VIA=y
@@ -3798,6 +3929,7 @@ CONFIG_SND_HDA_CODEC_HDMI=y
CONFIG_SND_HDA_CODEC_CIRRUS=y
CONFIG_SND_HDA_CODEC_CONEXANT=y
CONFIG_SND_HDA_CODEC_CA0110=y
+CONFIG_SND_HDA_CODEC_CA0132=y
CONFIG_SND_HDA_CODEC_CMEDIA=y
CONFIG_SND_HDA_CODEC_SI3054=y
CONFIG_SND_HDA_GENERIC=y
@@ -3809,6 +3941,7 @@ CONFIG_SND_ICE1724=m
CONFIG_SND_INTEL8X0=m
CONFIG_SND_INTEL8X0M=m
CONFIG_SND_KORG1212=m
+CONFIG_SND_LOLA=m
CONFIG_SND_LX6464ES=m
CONFIG_SND_MAESTRO3=m
CONFIG_SND_MAESTRO3_INPUT=y
@@ -3838,6 +3971,7 @@ CONFIG_SND_USB_6FIRE=m
CONFIG_SND_FIREWIRE=y
CONFIG_SND_FIREWIRE_LIB=m
CONFIG_SND_FIREWIRE_SPEAKERS=m
+CONFIG_SND_ISIGHT=m
CONFIG_SND_PCMCIA=y
CONFIG_SND_VXPOCKET=m
CONFIG_SND_PDAUDIOCF=m
@@ -3849,9 +3983,12 @@ CONFIG_SND_SOC_WM_HUBS=m
CONFIG_SND_SOC_AD1836=m
CONFIG_SND_SOC_AD193X=m
CONFIG_SND_SOC_AD73311=m
+CONFIG_SND_SOC_ADAU1373=m
+CONFIG_SND_SOC_ADAV80X=m
CONFIG_SND_SOC_ADS117X=m
CONFIG_SND_SOC_AK4104=m
CONFIG_SND_SOC_AK4535=m
+CONFIG_SND_SOC_AK4641=m
CONFIG_SND_SOC_AK4642=m
CONFIG_SND_SOC_AK4671=m
CONFIG_SND_SOC_ALC5623=m
@@ -3859,23 +3996,29 @@ CONFIG_SND_SOC_CS42L51=m
CONFIG_SND_SOC_CS4270=m
CONFIG_SND_SOC_CS4271=m
CONFIG_SND_SOC_CX20442=m
+CONFIG_SND_SOC_JZ4740_CODEC=m
CONFIG_SND_SOC_L3=m
CONFIG_SND_SOC_DA7210=m
CONFIG_SND_SOC_DFBMCS320=m
CONFIG_SND_SOC_MAX98088=m
+CONFIG_SND_SOC_MAX98095=m
CONFIG_SND_SOC_MAX9850=m
CONFIG_SND_SOC_PCM3008=m
+CONFIG_SND_SOC_RT5631=m
CONFIG_SND_SOC_SGTL5000=m
CONFIG_SND_SOC_SPDIF=m
CONFIG_SND_SOC_SSM2602=m
+CONFIG_SND_SOC_STA32X=m
CONFIG_SND_SOC_TLV320AIC23=m
CONFIG_SND_SOC_TLV320AIC26=m
-CONFIG_SND_SOC_TVL320AIC32X4=m
+CONFIG_SND_SOC_TLV320AIC32X4=m
CONFIG_SND_SOC_TLV320AIC3X=m
CONFIG_SND_SOC_TLV320DAC33=m
CONFIG_SND_SOC_UDA134X=m
CONFIG_SND_SOC_UDA1380=m
CONFIG_SND_SOC_WL1273=m
+CONFIG_SND_SOC_WM1250_EV1=m
+CONFIG_SND_SOC_WM5100=m
CONFIG_SND_SOC_WM8400=m
CONFIG_SND_SOC_WM8510=m
CONFIG_SND_SOC_WM8523=m
@@ -3890,6 +4033,7 @@ CONFIG_SND_SOC_WM8750=m
CONFIG_SND_SOC_WM8753=m
CONFIG_SND_SOC_WM8770=m
CONFIG_SND_SOC_WM8776=m
+CONFIG_SND_SOC_WM8782=m
CONFIG_SND_SOC_WM8804=m
CONFIG_SND_SOC_WM8900=m
CONFIG_SND_SOC_WM8903=m
@@ -3902,12 +4046,14 @@ CONFIG_SND_SOC_WM8962=m
CONFIG_SND_SOC_WM8971=m
CONFIG_SND_SOC_WM8974=m
CONFIG_SND_SOC_WM8978=m
+CONFIG_SND_SOC_WM8983=m
CONFIG_SND_SOC_WM8985=m
CONFIG_SND_SOC_WM8988=m
CONFIG_SND_SOC_WM8990=m
CONFIG_SND_SOC_WM8991=m
CONFIG_SND_SOC_WM8993=m
CONFIG_SND_SOC_WM8995=m
+CONFIG_SND_SOC_WM8996=m
CONFIG_SND_SOC_WM9081=m
CONFIG_SND_SOC_LM4857=m
CONFIG_SND_SOC_MAX9877=m
@@ -3936,19 +4082,19 @@ CONFIG_USB_MOUSE=m
#
# Special HID drivers
#
-CONFIG_HID_3M_PCT=m
# CONFIG_HID_A4TECH is not set
# CONFIG_HID_ACRUX is not set
# CONFIG_HID_APPLE is not set
# CONFIG_HID_BELKIN is not set
-CONFIG_HID_CANDO=m
# CONFIG_HID_CHERRY is not set
# CONFIG_HID_CHICONY is not set
CONFIG_HID_PRODIKEYS=m
# CONFIG_HID_CYPRESS is not set
# CONFIG_HID_DRAGONRISE is not set
# CONFIG_HID_EMS_FF is not set
+# CONFIG_HID_ELECOM is not set
# CONFIG_HID_EZKEY is not set
+# CONFIG_HID_HOLTEK is not set
CONFIG_HID_KEYTOUCH=m
# CONFIG_HID_KYE is not set
# CONFIG_HID_UCLOGIC is not set
@@ -3958,8 +4104,8 @@ CONFIG_HID_KEYTOUCH=m
# CONFIG_HID_KENSINGTON is not set
CONFIG_HID_LCPOWER=m
# CONFIG_HID_LOGITECH is not set
+CONFIG_HID_MAGICMOUSE=m
# CONFIG_HID_MICROSOFT is not set
-CONFIG_HID_MOSART=m
# CONFIG_HID_MONTEREY is not set
CONFIG_HID_MULTITOUCH=m
# CONFIG_HID_NTRIG is not set
@@ -3971,6 +4117,7 @@ CONFIG_HID_PICOLCD_FB=y
CONFIG_HID_PICOLCD_BACKLIGHT=y
CONFIG_HID_PICOLCD_LCD=y
CONFIG_HID_PICOLCD_LEDS=y
+CONFIG_HID_PRIMAX=m
CONFIG_HID_QUANTA=m
CONFIG_HID_ROCCAT=m
CONFIG_HID_ROCCAT_COMMON=m
@@ -3981,18 +4128,22 @@ CONFIG_HID_ROCCAT_KOVAPLUS=m
# CONFIG_HID_ROCCAT_PYRA is not set
# CONFIG_HID_SAMSUNG is not set
CONFIG_HID_SONY=m
-CONFIG_HID_STANTUM=m
+CONFIG_HID_SPEEDLINK=m
# CONFIG_HID_SUNPLUS is not set
# CONFIG_HID_GREENASIA is not set
# CONFIG_HID_SMARTJOYPLUS is not set
# CONFIG_HID_TOPSEED is not set
# CONFIG_HID_THRUSTMASTER is not set
+# CONFIG_HID_WACOM is not set
+# CONFIG_HID_WIIMOTE is not set
# CONFIG_HID_ZEROPLUS is not set
CONFIG_HID_ZYDACRON=m
CONFIG_USB_SUPPORT=y
+CONFIG_USB_COMMON=m
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_ARCH_HAS_OHCI=y
CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_USB_ARCH_HAS_XHCI=y
CONFIG_USB=m
# CONFIG_USB_DEBUG is not set
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
@@ -4005,6 +4156,7 @@ CONFIG_USB_DEVICE_CLASS=y
# CONFIG_USB_DYNAMIC_MINORS is not set
# CONFIG_USB_OTG_WHITELIST is not set
# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+# CONFIG_USB_DWC3 is not set
CONFIG_USB_MON=m
CONFIG_USB_WUSB=m
CONFIG_USB_WUSB_CBAF=m
@@ -4031,16 +4183,13 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
CONFIG_USB_UHCI_HCD=m
CONFIG_USB_U132_HCD=m
CONFIG_USB_SL811_HCD=m
+CONFIG_USB_SL811_HCD_ISO=y
CONFIG_USB_SL811_CS=m
CONFIG_USB_R8A66597_HCD=m
CONFIG_USB_WHCI_HCD=m
CONFIG_USB_HWA_HCD=m
#
-# Enable Host or Gadget support to see Inventra options
-#
-
-#
# USB Device Class drivers
#
CONFIG_USB_ACM=m
@@ -4070,7 +4219,7 @@ CONFIG_USB_STORAGE_ONETOUCH=m
CONFIG_USB_STORAGE_KARMA=m
CONFIG_USB_STORAGE_CYPRESS_ATACB=m
CONFIG_USB_STORAGE_ENE_UB6250=m
-# CONFIG_USB_UAS is not set
+CONFIG_USB_UAS=m
CONFIG_USB_LIBUSUAL=y
#
@@ -4123,7 +4272,6 @@ CONFIG_USB_SERIAL_SPCP8X5=m
CONFIG_USB_SERIAL_HP4X=m
CONFIG_USB_SERIAL_SAFE=m
CONFIG_USB_SERIAL_SAFE_PADDED=y
-# CONFIG_USB_SERIAL_SAMBA is not set
CONFIG_USB_SERIAL_SIEMENS_MPI=m
CONFIG_USB_SERIAL_SIERRAWIRELESS=m
CONFIG_USB_SERIAL_SYMBOL=m
@@ -4207,6 +4355,7 @@ CONFIG_MMC_TIFM_SD=m
CONFIG_MMC_SDRICOH_CS=m
CONFIG_MMC_CB710=m
CONFIG_MMC_VIA_SDMMC=m
+CONFIG_MMC_VUB300=m
# CONFIG_MMC_USHC is not set
CONFIG_MEMSTICK=m
# CONFIG_MEMSTICK_DEBUG is not set
@@ -4231,17 +4380,15 @@ CONFIG_LEDS_CLASS=y
#
CONFIG_LEDS_LM3530=m
CONFIG_LEDS_NET5501=m
-CONFIG_LEDS_ALIX2=m
CONFIG_LEDS_PCA9532=m
+# CONFIG_LEDS_PCA9532_GPIO is not set
CONFIG_LEDS_GPIO=m
-CONFIG_LEDS_GPIO_PLATFORM=y
CONFIG_LEDS_LP3944=m
# CONFIG_LEDS_LP5521 is not set
# CONFIG_LEDS_LP5523 is not set
CONFIG_LEDS_CLEVO_MAIL=m
CONFIG_LEDS_PCA955X=m
CONFIG_LEDS_DAC124S085=m
-CONFIG_LEDS_REGULATOR=m
CONFIG_LEDS_BD2802=m
CONFIG_LEDS_INTEL_SS4200=m
CONFIG_LEDS_LT3593=m
@@ -4261,7 +4408,6 @@ CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
#
# iptables trigger is under Netfilter config (LED target)
#
-# CONFIG_NFC_DEVICES is not set
CONFIG_ACCESSIBILITY=y
# CONFIG_A11Y_BRAILLE_CONSOLE is not set
CONFIG_INFINIBAND=m
@@ -4287,8 +4433,11 @@ CONFIG_INFINIBAND_IPOIB=m
CONFIG_INFINIBAND_SRP=m
CONFIG_INFINIBAND_ISER=m
# CONFIG_EDAC is not set
-CONFIG_RTC_LIB=m
-CONFIG_RTC_CLASS=m
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
#
# RTC interfaces
@@ -4320,10 +4469,13 @@ CONFIG_RTC_DRV_S35390A=m
CONFIG_RTC_DRV_FM3130=m
CONFIG_RTC_DRV_RX8581=m
CONFIG_RTC_DRV_RX8025=m
+CONFIG_RTC_DRV_EM3027=m
+CONFIG_RTC_DRV_RV3029C2=m
#
# SPI RTC drivers
#
+CONFIG_RTC_DRV_M41T93=m
CONFIG_RTC_DRV_M41T94=m
CONFIG_RTC_DRV_DS1305=m
CONFIG_RTC_DRV_DS1390=m
@@ -4336,7 +4488,7 @@ CONFIG_RTC_DRV_PCF2123=m
#
# Platform RTC drivers
#
-CONFIG_RTC_DRV_CMOS=m
+CONFIG_RTC_DRV_CMOS=y
CONFIG_RTC_DRV_DS1286=m
CONFIG_RTC_DRV_DS1511=m
CONFIG_RTC_DRV_DS1553=m
@@ -4386,48 +4538,43 @@ CONFIG_UIO_PDRV=m
CONFIG_UIO_PDRV_GENIRQ=m
CONFIG_UIO_AEC=m
CONFIG_UIO_SERCOS3=m
-# CONFIG_UIO_PCI_GENERIC is not set
+CONFIG_UIO_PCI_GENERIC=m
CONFIG_UIO_NETX=m
+CONFIG_VIRTIO=m
+CONFIG_VIRTIO_RING=m
+
+#
+# Virtio drivers
+#
+CONFIG_VIRTIO_PCI=m
+CONFIG_VIRTIO_BALLOON=m
+CONFIG_VIRTIO_MMIO=m
#
# Xen driver support
#
CONFIG_XEN_BALLOON=y
CONFIG_XEN_SCRUB_PAGES=y
-CONFIG_XEN_DEV_EVTCHN=y
+CONFIG_XEN_DEV_EVTCHN=m
CONFIG_XEN_BACKEND=y
-CONFIG_XENFS=y
+CONFIG_XENFS=m
CONFIG_XEN_COMPAT_XENFS=y
CONFIG_XEN_SYS_HYPERVISOR=y
CONFIG_XEN_XENBUS_FRONTEND=y
CONFIG_XEN_GNTDEV=m
CONFIG_XEN_GRANT_DEV_ALLOC=m
-CONFIG_XEN_PLATFORM_PCI=m
CONFIG_SWIOTLB_XEN=y
+CONFIG_XEN_PCIDEV_BACKEND=m
CONFIG_STAGING=y
-# CONFIG_STAGING_EXCLUDE_BUILD is not set
-CONFIG_STALLION=m
-CONFIG_ISTALLION=m
-CONFIG_DIGIEPCA=m
-CONFIG_RISCOM8=m
-CONFIG_SPECIALIX=m
-CONFIG_COMPUTONE=m
# CONFIG_ET131X is not set
# CONFIG_SLICOSS is not set
-# CONFIG_VIDEO_GO7007 is not set
-# CONFIG_VIDEO_CX25821 is not set
-# CONFIG_VIDEO_TM6000 is not set
-CONFIG_DVB_CXD2099=m
-# CONFIG_USB_IP_COMMON is not set
+CONFIG_USBIP_CORE=m
+CONFIG_USBIP_VHCI_HCD=m
+CONFIG_USBIP_HOST=m
+# CONFIG_USBIP_DEBUG is not set
# CONFIG_W35UND is not set
# CONFIG_PRISM2_USB is not set
# CONFIG_ECHO is not set
-CONFIG_BRCM80211=m
-# CONFIG_BRCMSMAC is not set
-# CONFIG_BRCMFMAC is not set
-# CONFIG_BRCMDBG is not set
-# CONFIG_RT2860 is not set
-# CONFIG_RT2870 is not set
# CONFIG_COMEDI is not set
# CONFIG_ASUS_OLED is not set
# CONFIG_PANEL is not set
@@ -4435,13 +4582,12 @@ CONFIG_BRCM80211=m
# CONFIG_RTL8192U is not set
# CONFIG_RTL8192E is not set
# CONFIG_R8712U is not set
-CONFIG_RTS_PSTOR=m
-# CONFIG_RTS_PSTOR_DEBUG is not set
+# CONFIG_RTS_PSTOR is not set
+# CONFIG_RTS5139 is not set
# CONFIG_TRANZPORT is not set
# CONFIG_POHMELFS is not set
# CONFIG_IDE_PHISON is not set
# CONFIG_LINE6_USB is not set
-CONFIG_DRM_VMWGFX=m
CONFIG_DRM_NOUVEAU=m
CONFIG_DRM_NOUVEAU_BACKLIGHT=y
CONFIG_DRM_NOUVEAU_DEBUG=y
@@ -4455,11 +4601,8 @@ CONFIG_DRM_I2C_SIL164=m
# CONFIG_USB_SERIAL_QUATECH_USB2 is not set
# CONFIG_VT6655 is not set
# CONFIG_VT6656 is not set
-CONFIG_HYPERV=m
CONFIG_HYPERV_STORAGE=m
-CONFIG_HYPERV_BLOCK=m
CONFIG_HYPERV_NET=m
-CONFIG_HYPERV_UTILS=m
CONFIG_HYPERV_MOUSE=m
# CONFIG_VME_BUS is not set
# CONFIG_DX_SEP is not set
@@ -4469,17 +4612,11 @@ CONFIG_HYPERV_MOUSE=m
# CONFIG_WLAGS49_H2 is not set
# CONFIG_WLAGS49_H25 is not set
# CONFIG_FB_SM7XX is not set
-# CONFIG_VIDEO_DT3155 is not set
# CONFIG_CRYSTALHD is not set
# CONFIG_CXT1E1 is not set
# CONFIG_FB_XGI is not set
-# CONFIG_LIRC_STAGING is not set
-# CONFIG_EASYCAP is not set
-# CONFIG_SOLO6X10 is not set
# CONFIG_ACPI_QUICKSTART is not set
-CONFIG_MACH_NO_WESTBRIDGE=y
# CONFIG_SBE_2T3E3 is not set
-# CONFIG_ATH6K_LEGACY is not set
# CONFIG_USB_ENESTORAGE is not set
# CONFIG_BCM_WIMAX is not set
# CONFIG_FT1000 is not set
@@ -4490,14 +4627,12 @@ CONFIG_MACH_NO_WESTBRIDGE=y
# CONFIG_SPEAKUP is not set
# CONFIG_TOUCHSCREEN_CLEARPAD_TM1217 is not set
# CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set
-CONFIG_DRM_PSB=m
-
-#
-# Altera FPGA firmware download module
-#
-CONFIG_ALTERA_STAPL=m
+# CONFIG_DRM_PSB is not set
+# CONFIG_INTEL_MEI is not set
+# CONFIG_STAGING_MEDIA is not set
CONFIG_X86_PLATFORM_DEVICES=y
CONFIG_ACER_WMI=m
+CONFIG_ACERHDF=m
CONFIG_ASUS_LAPTOP=m
CONFIG_DELL_LAPTOP=m
CONFIG_DELL_WMI=m
@@ -4511,7 +4646,7 @@ CONFIG_PANASONIC_LAPTOP=m
CONFIG_COMPAL_LAPTOP=m
CONFIG_SONY_LAPTOP=m
# CONFIG_SONYPI_COMPAT is not set
-# CONFIG_IDEAPAD_LAPTOP is not set
+CONFIG_IDEAPAD_LAPTOP=m
CONFIG_THINKPAD_ACPI=m
CONFIG_THINKPAD_ACPI_ALSA_SUPPORT=y
# CONFIG_THINKPAD_ACPI_DEBUGFACILITIES is not set
@@ -4536,6 +4671,29 @@ CONFIG_ACPI_CMPC=m
# CONFIG_IBM_RTL is not set
CONFIG_XO15_EBOOK=m
# CONFIG_SAMSUNG_LAPTOP is not set
+CONFIG_MXM_WMI=m
+CONFIG_INTEL_OAKTRAIL=m
+# CONFIG_SAMSUNG_Q10 is not set
+
+#
+# Hardware Spinlock drivers
+#
+CONFIG_CLKEVT_I8253=y
+CONFIG_I8253_LOCK=y
+CONFIG_CLKBLD_I8253=y
+CONFIG_IOMMU_API=y
+CONFIG_IOMMU_SUPPORT=y
+CONFIG_AMD_IOMMU=y
+CONFIG_AMD_IOMMU_STATS=y
+CONFIG_DMAR_TABLE=y
+CONFIG_INTEL_IOMMU=y
+# CONFIG_INTEL_IOMMU_DEFAULT_ON is not set
+CONFIG_INTEL_IOMMU_FLOPPY_WA=y
+CONFIG_IRQ_REMAP=y
+CONFIG_VIRT_DRIVERS=y
+CONFIG_HYPERV=m
+CONFIG_HYPERV_UTILS=m
+# CONFIG_PM_DEVFREQ is not set
#
# Firmware Drivers
@@ -4546,9 +4704,10 @@ CONFIG_FIRMWARE_MEMMAP=y
CONFIG_DELL_RBU=m
CONFIG_DCDBAS=m
CONFIG_DMIID=y
-CONFIG_DMI_SYSFS=m
+# CONFIG_DMI_SYSFS is not set
# CONFIG_ISCSI_IBFT_FIND is not set
-CONFIG_SIGMA=m
+# CONFIG_SIGMA is not set
+# CONFIG_GOOGLE_FIRMWARE is not set
#
# File systems
@@ -4602,7 +4761,7 @@ CONFIG_BTRFS_FS=m
CONFIG_BTRFS_FS_POSIX_ACL=y
CONFIG_NILFS2_FS=m
CONFIG_FS_POSIX_ACL=y
-CONFIG_EXPORTFS=y
+CONFIG_EXPORTFS=m
CONFIG_FILE_LOCKING=y
CONFIG_FSNOTIFY=y
# CONFIG_DNOTIFY is not set
@@ -4649,7 +4808,7 @@ CONFIG_FAT_FS=m
CONFIG_MSDOS_FS=m
CONFIG_VFAT_FS=m
CONFIG_FAT_DEFAULT_CODEPAGE=437
-CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_FAT_DEFAULT_IOCHARSET="utf8"
CONFIG_NTFS_FS=m
# CONFIG_NTFS_DEBUG is not set
CONFIG_NTFS_RW=y
@@ -4664,6 +4823,7 @@ CONFIG_PROC_SYSCTL=y
CONFIG_SYSFS=y
CONFIG_TMPFS=y
# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_TMPFS_XATTR is not set
# CONFIG_HUGETLBFS is not set
# CONFIG_HUGETLB_PAGE is not set
CONFIG_CONFIGFS_FS=m
@@ -4702,9 +4862,11 @@ CONFIG_UBIFS_FS_ZLIB=y
CONFIG_LOGFS=m
CONFIG_CRAMFS=m
CONFIG_SQUASHFS=m
-# CONFIG_SQUASHFS_XATTR is not set
+CONFIG_SQUASHFS_XATTR=y
+CONFIG_SQUASHFS_ZLIB=y
# CONFIG_SQUASHFS_LZO is not set
CONFIG_SQUASHFS_XZ=y
+# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set
# CONFIG_SQUASHFS_EMBEDDED is not set
CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
# CONFIG_VXFS_FS is not set
@@ -4724,6 +4886,7 @@ CONFIG_UFS_FS=m
# CONFIG_UFS_DEBUG is not set
CONFIG_EXOFS_FS=m
# CONFIG_EXOFS_DEBUG is not set
+CONFIG_ORE=m
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=m
CONFIG_NFS_V3=y
@@ -4735,7 +4898,6 @@ CONFIG_NFS_V4=y
CONFIG_NFS_USE_KERNEL_DNS=y
# CONFIG_NFS_USE_NEW_IDMAPPER is not set
CONFIG_NFSD=m
-CONFIG_NFSD_DEPRECATED=y
CONFIG_NFSD_V3=y
# CONFIG_NFSD_V3_ACL is not set
CONFIG_NFSD_V4=y
@@ -4756,8 +4918,7 @@ CONFIG_CIFS_POSIX=y
# CONFIG_CIFS_DEBUG2 is not set
CONFIG_CIFS_DFS_UPCALL=y
# CONFIG_CIFS_FSCACHE is not set
-# CONFIG_CIFS_ACL is not set
-CONFIG_CIFS_EXPERIMENTAL=y
+CONFIG_CIFS_ACL=y
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set
@@ -4785,7 +4946,7 @@ CONFIG_MSDOS_PARTITION=y
CONFIG_EFI_PARTITION=y
# CONFIG_SYSV68_PARTITION is not set
CONFIG_NLS=y
-CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_DEFAULT="utf8"
CONFIG_NLS_CODEPAGE_437=m
CONFIG_NLS_CODEPAGE_737=m
CONFIG_NLS_CODEPAGE_775=m
@@ -4836,23 +4997,67 @@ CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
CONFIG_ENABLE_WARN_DEPRECATED=y
# CONFIG_ENABLE_MUST_CHECK is not set
CONFIG_FRAME_WARN=1024
-# CONFIG_MAGIC_SYSRQ is not set
+CONFIG_MAGIC_SYSRQ=y
# CONFIG_STRIP_ASM_SYMS is not set
# CONFIG_UNUSED_SYMBOLS is not set
CONFIG_DEBUG_FS=y
# CONFIG_HEADERS_CHECK is not set
# CONFIG_DEBUG_SECTION_MISMATCH is not set
-# CONFIG_DEBUG_KERNEL is not set
-# CONFIG_HARDLOCKUP_DETECTOR is not set
+CONFIG_DEBUG_KERNEL=y
+CONFIG_DEBUG_SHIRQ=y
+CONFIG_LOCKUP_DETECTOR=y
+CONFIG_HARDLOCKUP_DETECTOR=y
+# CONFIG_BOOTPARAM_HARDLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE=0
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
+# CONFIG_DETECT_HUNG_TASK is not set
+CONFIG_SCHED_DEBUG=y
+CONFIG_SCHEDSTATS=y
+CONFIG_TIMER_STATS=y
+# CONFIG_DEBUG_OBJECTS is not set
# CONFIG_SLUB_STATS is not set
+# CONFIG_DEBUG_KMEMLEAK is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
# CONFIG_SPARSE_RCU_POINTER is not set
+# CONFIG_LOCK_STAT is not set
+# CONFIG_DEBUG_ATOMIC_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+CONFIG_STACKTRACE=y
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_KOBJECT is not set
CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_VIRTUAL is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_TEST_LIST_SORT is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+# CONFIG_DEBUG_CREDENTIALS is not set
CONFIG_ARCH_WANT_FRAME_POINTERS=y
CONFIG_FRAME_POINTER=y
-# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+CONFIG_RCU_CPU_STALL_TIMEOUT=60
+# CONFIG_KPROBES_SANITY_TEST is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
+# CONFIG_DEBUG_PER_CPU_MAPS is not set
# CONFIG_LKDTM is not set
+# CONFIG_CPU_NOTIFIER_ERROR_INJECT is not set
+# CONFIG_FAULT_INJECTION is not set
+CONFIG_LATENCYTOP=y
CONFIG_SYSCTL_SYSCALL_CHECK=y
+# CONFIG_DEBUG_PAGEALLOC is not set
CONFIG_USER_STACKTRACE_SUPPORT=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
@@ -4874,14 +5079,22 @@ CONFIG_TRACING_SUPPORT=y
# CONFIG_ASYNC_RAID6_TEST is not set
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
CONFIG_HAVE_ARCH_KMEMCHECK=y
CONFIG_TEST_KSTRTOX=m
CONFIG_STRICT_DEVMEM=y
# CONFIG_X86_VERBOSE_BOOTUP is not set
# CONFIG_EARLY_PRINTK is not set
+CONFIG_DEBUG_STACKOVERFLOW=y
+# CONFIG_X86_PTDUMP is not set
+CONFIG_DEBUG_RODATA=y
+# CONFIG_DEBUG_RODATA_TEST is not set
CONFIG_DEBUG_SET_MODULE_RONX=y
+CONFIG_DEBUG_NX_TEST=m
+# CONFIG_IOMMU_DEBUG is not set
# CONFIG_IOMMU_STRESS is not set
CONFIG_HAVE_MMIOTRACE_SUPPORT=y
+CONFIG_X86_DECODER_SELFTEST=y
CONFIG_IO_DELAY_TYPE_0X80=0
CONFIG_IO_DELAY_TYPE_0XED=1
CONFIG_IO_DELAY_TYPE_UDELAY=2
@@ -4891,7 +5104,10 @@ CONFIG_IO_DELAY_0X80=y
# CONFIG_IO_DELAY_UDELAY is not set
# CONFIG_IO_DELAY_NONE is not set
CONFIG_DEFAULT_IO_DELAY_TYPE=0
+CONFIG_DEBUG_BOOT_PARAMS=y
+# CONFIG_CPA_DEBUG is not set
# CONFIG_OPTIMIZE_INLINING is not set
+# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set
#
# Security options
@@ -4905,6 +5121,7 @@ CONFIG_SECURITY=y
CONFIG_SECURITYFS=y
# CONFIG_SECURITY_NETWORK is not set
# CONFIG_SECURITY_PATH is not set
+# CONFIG_INTEL_TXT is not set
# CONFIG_SECURITY_TOMOYO is not set
# CONFIG_SECURITY_APPARMOR is not set
# CONFIG_IMA is not set
@@ -4937,6 +5154,7 @@ CONFIG_CRYPTO_PCOMP=m
CONFIG_CRYPTO_PCOMP2=y
CONFIG_CRYPTO_MANAGER=m
CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_USER=m
CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
CONFIG_CRYPTO_GF128MUL=m
CONFIG_CRYPTO_NULL=m
@@ -4963,7 +5181,6 @@ CONFIG_CRYPTO_ECB=m
CONFIG_CRYPTO_LRW=m
CONFIG_CRYPTO_PCBC=m
CONFIG_CRYPTO_XTS=m
-CONFIG_CRYPTO_FPU=m
#
# Hash modes
@@ -4986,6 +5203,7 @@ CONFIG_CRYPTO_RMD160=m
CONFIG_CRYPTO_RMD256=m
CONFIG_CRYPTO_RMD320=m
CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA1_SSSE3=m
CONFIG_CRYPTO_SHA256=y
CONFIG_CRYPTO_SHA512=m
CONFIG_CRYPTO_TGR192=m
@@ -5001,6 +5219,8 @@ CONFIG_CRYPTO_AES_NI_INTEL=m
CONFIG_CRYPTO_ANUBIS=m
CONFIG_CRYPTO_ARC4=m
CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_BLOWFISH_COMMON=m
+CONFIG_CRYPTO_BLOWFISH_X86_64=m
CONFIG_CRYPTO_CAMELLIA=m
CONFIG_CRYPTO_CAST5=m
CONFIG_CRYPTO_CAST6=m
@@ -5015,6 +5235,7 @@ CONFIG_CRYPTO_TEA=m
CONFIG_CRYPTO_TWOFISH=m
CONFIG_CRYPTO_TWOFISH_COMMON=m
CONFIG_CRYPTO_TWOFISH_X86_64=m
+CONFIG_CRYPTO_TWOFISH_X86_64_3WAY=m
#
# Compression
@@ -5034,8 +5255,6 @@ CONFIG_CRYPTO_HW=y
CONFIG_CRYPTO_DEV_PADLOCK=m
CONFIG_CRYPTO_DEV_PADLOCK_AES=m
CONFIG_CRYPTO_DEV_PADLOCK_SHA=m
-CONFIG_CRYPTO_DEV_HIFN_795X=m
-CONFIG_CRYPTO_DEV_HIFN_795X_RNG=y
CONFIG_HAVE_KVM=y
CONFIG_HAVE_KVM_IRQCHIP=y
CONFIG_HAVE_KVM_EVENTFD=y
@@ -5047,10 +5266,6 @@ CONFIG_KVM=m
CONFIG_KVM_INTEL=m
CONFIG_KVM_AMD=m
CONFIG_VHOST_NET=m
-CONFIG_VIRTIO=m
-CONFIG_VIRTIO_RING=m
-CONFIG_VIRTIO_PCI=m
-CONFIG_VIRTIO_BALLOON=m
# CONFIG_BINARY_PRINTF is not set
#
@@ -5059,8 +5274,6 @@ CONFIG_VIRTIO_BALLOON=m
CONFIG_RAID6_PQ=m
CONFIG_BITREVERSE=y
CONFIG_GENERIC_FIND_FIRST_BIT=y
-CONFIG_GENERIC_FIND_NEXT_BIT=y
-CONFIG_GENERIC_FIND_LAST_BIT=y
CONFIG_CRC_CCITT=m
CONFIG_CRC16=m
CONFIG_CRC_T10DIF=m
@@ -5068,9 +5281,10 @@ CONFIG_CRC_ITU_T=m
CONFIG_CRC32=y
CONFIG_CRC7=m
CONFIG_LIBCRC32C=m
+CONFIG_CRC8=m
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=m
-CONFIG_LZO_COMPRESS=m
+CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_XZ_DEC=y
CONFIG_XZ_DEC_X86=y
@@ -5100,5 +5314,5 @@ CONFIG_HAS_DMA=y
CONFIG_CHECK_SIGNATURE=y
CONFIG_CPU_RMAP=y
CONFIG_NLATTR=y
-CONFIG_LRU_CACHE=m
CONFIG_AVERAGE=y
+CONFIG_CORDIC=m
diff --git a/main/linux-scst/scst-2.1.0-2.6.39.patch b/main/linux-scst/scst-2.2.0-3.2.2.patch
index 264fda4b7..a6fef8db2 100644
--- a/main/linux-scst/scst-2.1.0-2.6.39.patch
+++ b/main/linux-scst/scst-2.2.0-3.2.2.patch
@@ -1,6 +1,6 @@
-diff -upkr linux-2.6.39/block/blk-map.c linux-2.6.39/block/blk-map.c
---- linux-2.6.39/block/blk-map.c 2011-05-19 00:06:34.000000000 -0400
-+++ linux-2.6.39/block/blk-map.c 2011-05-19 10:49:02.753812997 -0400
+=== modified file 'block/blk-map.c'
+--- old/block/blk-map.c 2012-01-10 22:58:17 +0000
++++ new/block/blk-map.c 2012-01-10 23:01:21 +0000
@@ -5,6 +5,8 @@
#include <linux/module.h>
#include <linux/bio.h>
@@ -10,7 +10,7 @@ diff -upkr linux-2.6.39/block/blk-map.c linux-2.6.39/block/blk-map.c
#include <scsi/sg.h> /* for struct sg_iovec */
#include "blk.h"
-@@ -274,6 +276,339 @@ int blk_rq_unmap_user(struct bio *bio)
+@@ -275,6 +277,339 @@ int blk_rq_unmap_user(struct bio *bio)
}
EXPORT_SYMBOL(blk_rq_unmap_user);
@@ -350,10 +350,11 @@ diff -upkr linux-2.6.39/block/blk-map.c linux-2.6.39/block/blk-map.c
/**
* blk_rq_map_kern - map kernel data to a request, for REQ_TYPE_BLOCK_PC usage
* @q: request queue where request should be inserted
-diff -upkr linux-2.6.39/include/linux/blkdev.h linux-2.6.39/include/linux/blkdev.h
---- linux-2.6.39/include/linux/blkdev.h 2011-05-19 00:06:34.000000000 -0400
-+++ linux-2.6.39/include/linux/blkdev.h 2011-05-19 10:49:02.753812997 -0400
-@@ -707,6 +709,9 @@ extern int blk_rq_map_kern(struct reques
+
+=== modified file 'include/linux/blkdev.h'
+--- old/include/linux/blkdev.h 2012-01-10 22:58:17 +0000
++++ new/include/linux/blkdev.h 2012-01-10 23:01:21 +0000
+@@ -716,6 +718,9 @@ extern int blk_rq_map_kern(struct reques
extern int blk_rq_map_user_iov(struct request_queue *, struct request *,
struct rq_map_data *, struct sg_iovec *, int,
unsigned int, gfp_t);
@@ -363,9 +364,10 @@ diff -upkr linux-2.6.39/include/linux/blkdev.h linux-2.6.39/include/linux/blkdev
extern int blk_execute_rq(struct request_queue *, struct gendisk *,
struct request *, int);
extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *,
-diff -upkr linux-2.6.39/include/linux/scatterlist.h linux-2.6.39/include/linux/scatterlist.h
---- linux-2.6.39/include/linux/scatterlist.h 2011-05-19 00:06:34.000000000 -0400
-+++ linux-2.6.39/include/linux/scatterlist.h 2011-05-19 10:49:02.753812997 -0400
+
+=== modified file 'include/linux/scatterlist.h'
+--- old/include/linux/scatterlist.h 2012-01-10 22:58:17 +0000
++++ new/include/linux/scatterlist.h 2012-01-10 23:01:21 +0000
@@ -3,6 +3,7 @@
#include <asm/types.h>
@@ -385,9 +387,10 @@ diff -upkr linux-2.6.39/include/linux/scatterlist.h linux-2.6.39/include/linux/s
/*
* Maximum number of entries that will be allocated in one piece, if
* a list larger than this is required then chaining will be utilized.
-diff -upkr linux-2.6.39/lib/scatterlist.c linux-2.6.39/lib/scatterlist.c
---- linux-2.6.39/lib/scatterlist.c 2011-05-19 00:06:34.000000000 -0400
-+++ linux-2.6.39/lib/scatterlist.c 2011-05-19 10:49:02.753812997 -0400
+
+=== modified file 'lib/scatterlist.c'
+--- old/lib/scatterlist.c 2012-01-10 22:58:17 +0000
++++ new/lib/scatterlist.c 2012-01-10 23:01:21 +0000
@@ -517,3 +517,132 @@ size_t sg_copy_to_buffer(struct scatterl
return sg_copy_buffer(sgl, nents, buf, buflen, 1);
}
@@ -521,10 +524,11 @@ diff -upkr linux-2.6.39/lib/scatterlist.c linux-2.6.39/lib/scatterlist.c
+ return res;
+}
+EXPORT_SYMBOL(sg_copy);
-diff -upkr linux-2.6.39/include/linux/mm_types.h linux-2.6.39/include/linux/mm_types.h
---- linux-2.6.39/include/linux/mm_types.h 2011-05-19 00:06:34.000000000 -0400
-+++ linux-2.6.39/include/linux/mm_types.h 2011-05-19 10:46:24.669812999 -0400
-@@ -100,6 +100,18 @@ struct page {
+
+=== modified file 'include/linux/mm_types.h'
+--- old/include/linux/mm_types.h 2012-01-10 22:58:17 +0000
++++ new/include/linux/mm_types.h 2012-01-10 23:02:48 +0000
+@@ -149,6 +149,17 @@ struct page {
*/
void *shadow;
#endif
@@ -539,14 +543,14 @@ diff -upkr linux-2.6.39/include/linux/mm_types.h linux-2.6.39/include/linux/mm_t
+ */
+ void *net_priv;
+#endif
-+
- };
-
+ }
/*
-diff -upkr linux-2.6.39/include/linux/net.h linux-2.6.39/include/linux/net.h
---- linux-2.6.39/include/linux/net.h 2011-05-19 00:06:34.000000000 -0400
-+++ linux-2.6.39/include/linux/net.h 2011-05-19 10:46:24.669812999 -0400
-@@ -60,6 +60,7 @@ typedef enum {
+ * If another subsystem starts using the double word pairing for atomic
+
+=== modified file 'include/linux/net.h'
+--- old/include/linux/net.h 2012-01-10 22:58:17 +0000
++++ new/include/linux/net.h 2012-01-10 23:02:48 +0000
+@@ -61,6 +61,7 @@ typedef enum {
#include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */
#include <linux/kmemcheck.h>
#include <linux/rcupdate.h>
@@ -554,9 +558,9 @@ diff -upkr linux-2.6.39/include/linux/net.h linux-2.6.39/include/linux/net.h
struct poll_table_struct;
struct pipe_inode_info;
-@@ -294,5 +295,44 @@ extern int kernel_sock_shutdown(struct s
- extern struct ratelimit_state net_ratelimit_state;
- #endif
+@@ -289,5 +290,44 @@ extern int kernel_sock_shutdown(struct s
+ MODULE_ALIAS("net-pf-" __stringify(pf) "-proto-" __stringify(proto) \
+ "-type-" __stringify(type))
+#if defined(CONFIG_TCP_ZERO_COPY_TRANSFER_COMPLETION_NOTIFICATION)
+/* Support for notification on zero-copy TCP transfer completion */
@@ -599,22 +603,56 @@ diff -upkr linux-2.6.39/include/linux/net.h linux-2.6.39/include/linux/net.h
+
#endif /* __KERNEL__ */
#endif /* _LINUX_NET_H */
-diff -upkr linux-2.6.39/net/core/dev.c linux-2.6.39/net/core/dev.c
---- linux-2.6.39/net/core/dev.c 2011-05-19 00:06:34.000000000 -0400
-+++ linux-2.6.39/net/core/dev.c 2011-05-19 10:46:24.669812999 -0400
-@@ -3418,7 +3418,7 @@ pull:
- skb_shinfo(skb)->frags[0].size -= grow;
+
+=== modified file 'include/linux/skbuff.h'
+--- old/include/linux/skbuff.h 2012-01-10 22:58:17 +0000
++++ new/include/linux/skbuff.h 2012-01-10 23:15:31 +0000
+@@ -1712,7 +1712,7 @@ static inline struct page *skb_frag_page
+ */
+ static inline void __skb_frag_ref(skb_frag_t *frag)
+ {
+- get_page(skb_frag_page(frag));
++ net_get_page(skb_frag_page(frag));
+ }
+
+ /**
+@@ -1735,7 +1735,7 @@ static inline void skb_frag_ref(struct s
+ */
+ static inline void __skb_frag_unref(skb_frag_t *frag)
+ {
+- put_page(skb_frag_page(frag));
++ net_put_page(skb_frag_page(frag));
+ }
+
+ /**
+
+=== modified file 'net/Kconfig'
+--- old/net/Kconfig 2012-01-10 22:58:17 +0000
++++ new/net/Kconfig 2012-01-10 23:02:48 +0000
+@@ -72,6 +72,18 @@ config INET
+
+ Short answer: say Y.
- if (unlikely(!skb_shinfo(skb)->frags[0].size)) {
-- put_page(skb_shinfo(skb)->frags[0].page);
-+ net_put_page(skb_shinfo(skb)->frags[0].page);
- memmove(skb_shinfo(skb)->frags,
- skb_shinfo(skb)->frags + 1,
- --skb_shinfo(skb)->nr_frags * sizeof(skb_frag_t));
-diff -upkr linux-2.6.39/net/core/skbuff.c linux-2.6.39/net/core/skbuff.c
---- linux-2.6.39/net/core/skbuff.c 2011-05-19 00:06:34.000000000 -0400
-+++ linux-2.6.39/net/core/skbuff.c 2011-05-19 10:46:24.669812999 -0400
-@@ -76,13 +76,13 @@ static struct kmem_cache *skbuff_fclone_
++config TCP_ZERO_COPY_TRANSFER_COMPLETION_NOTIFICATION
++ bool "TCP/IP zero-copy transfer completion notification"
++ depends on INET
++ default SCST_ISCSI
++ ---help---
++ Adds support for sending a notification upon completion of a
++ zero-copy TCP/IP transfer. This can speed up certain TCP/IP
++ software. Currently this is only used by the iSCSI target driver
++ iSCSI-SCST.
++
++ If unsure, say N.
++
+ if INET
+ source "net/ipv4/Kconfig"
+ source "net/ipv6/Kconfig"
+
+=== modified file 'net/core/skbuff.c'
+--- old/net/core/skbuff.c 2012-01-10 22:58:17 +0000
++++ new/net/core/skbuff.c 2012-01-10 23:02:48 +0000
+@@ -77,13 +77,13 @@ static struct kmem_cache *skbuff_fclone_
static void sock_pipe_buf_release(struct pipe_inode_info *pipe,
struct pipe_buffer *buf)
{
@@ -630,52 +668,16 @@ diff -upkr linux-2.6.39/net/core/skbuff.c linux-2.6.39/net/core/skbuff.c
}
static int sock_pipe_buf_steal(struct pipe_inode_info *pipe,
-@@ -325,7 +325,7 @@ static void skb_release_data(struct sk_b
- if (skb_shinfo(skb)->nr_frags) {
- int i;
- for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
-- put_page(skb_shinfo(skb)->frags[i].page);
-+ net_put_page(skb_shinfo(skb)->frags[i].page);
- }
-
- if (skb_has_frag_list(skb))
-@@ -732,7 +732,7 @@ struct sk_buff *pskb_copy(struct sk_buff
-
- for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
- skb_shinfo(n)->frags[i] = skb_shinfo(skb)->frags[i];
-- get_page(skb_shinfo(n)->frags[i].page);
-+ net_get_page(skb_shinfo(n)->frags[i].page);
- }
- skb_shinfo(n)->nr_frags = i;
- }
-@@ -819,7 +819,7 @@ int pskb_expand_head(struct sk_buff *skb
- kfree(skb->head);
- } else {
- for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
-- get_page(skb_shinfo(skb)->frags[i].page);
-+ net_get_page(skb_shinfo(skb)->frags[i].page);
-
- if (skb_has_frag_list(skb))
- skb_clone_fraglist(skb);
-@@ -1097,7 +1097,7 @@ drop_pages:
- skb_shinfo(skb)->nr_frags = i;
-
- for (; i < nfrags; i++)
-- put_page(skb_shinfo(skb)->frags[i].page);
-+ net_put_page(skb_shinfo(skb)->frags[i].page);
-
- if (skb_has_frag_list(skb))
- skb_drop_fraglist(skb);
-@@ -1266,7 +1266,7 @@ pull_pages:
- k = 0;
- for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
- if (skb_shinfo(skb)->frags[i].size <= eat) {
-- put_page(skb_shinfo(skb)->frags[i].page);
-+ net_put_page(skb_shinfo(skb)->frags[i].page);
- eat -= skb_shinfo(skb)->frags[i].size;
- } else {
- skb_shinfo(skb)->frags[k] = skb_shinfo(skb)->frags[i];
-@@ -1367,7 +1367,7 @@ EXPORT_SYMBOL(skb_copy_bits);
+@@ -654,7 +654,7 @@ int skb_copy_ubufs(struct sk_buff *skb,
+ if (!page) {
+ while (head) {
+ struct page *next = (struct page *)head->private;
+- put_page(head);
++ net_put_page(head);
+ head = next;
+ }
+ return -ENOMEM;
+@@ -1493,7 +1493,7 @@ EXPORT_SYMBOL(skb_copy_bits);
*/
static void sock_spd_release(struct splice_pipe_desc *spd, unsigned int i)
{
@@ -684,7 +686,7 @@ diff -upkr linux-2.6.39/net/core/skbuff.c linux-2.6.39/net/core/skbuff.c
}
static inline struct page *linear_to_page(struct page *page, unsigned int *len,
-@@ -1391,7 +1391,7 @@ new_page:
+@@ -1517,7 +1517,7 @@ new_page:
off = sk->sk_sndmsg_off;
mlen = PAGE_SIZE - off;
if (mlen < 64 && mlen < *len) {
@@ -693,7 +695,7 @@ diff -upkr linux-2.6.39/net/core/skbuff.c linux-2.6.39/net/core/skbuff.c
goto new_page;
}
-@@ -1401,7 +1401,7 @@ new_page:
+@@ -1527,7 +1527,7 @@ new_page:
memcpy(page_address(p) + off, page_address(page) + *offset, *len);
sk->sk_sndmsg_off += *len;
*offset = off;
@@ -702,7 +704,7 @@ diff -upkr linux-2.6.39/net/core/skbuff.c linux-2.6.39/net/core/skbuff.c
return p;
}
-@@ -1423,7 +1423,7 @@ static inline int spd_fill_page(struct s
+@@ -1549,7 +1549,7 @@ static inline int spd_fill_page(struct s
if (!page)
return 1;
} else
@@ -711,66 +713,10 @@ diff -upkr linux-2.6.39/net/core/skbuff.c linux-2.6.39/net/core/skbuff.c
spd->pages[spd->nr_pages] = page;
spd->partial[spd->nr_pages].len = *len;
-@@ -2056,7 +2056,7 @@ static inline void skb_split_no_header(s
- * where splitting is expensive.
- * 2. Split is accurately. We make this.
- */
-- get_page(skb_shinfo(skb)->frags[i].page);
-+ net_get_page(skb_shinfo(skb)->frags[i].page);
- skb_shinfo(skb1)->frags[0].page_offset += len - pos;
- skb_shinfo(skb1)->frags[0].size -= len - pos;
- skb_shinfo(skb)->frags[i].size = len - pos;
-@@ -2178,7 +2178,7 @@ int skb_shift(struct sk_buff *tgt, struc
- to++;
-
- } else {
-- get_page(fragfrom->page);
-+ net_get_page(fragfrom->page);
- fragto->page = fragfrom->page;
- fragto->page_offset = fragfrom->page_offset;
- fragto->size = todo;
-@@ -2200,7 +2200,7 @@ int skb_shift(struct sk_buff *tgt, struc
- fragto = &skb_shinfo(tgt)->frags[merge];
-
- fragto->size += fragfrom->size;
-- put_page(fragfrom->page);
-+ net_put_page(fragfrom->page);
- }
-
- /* Reposition in the original skb */
-@@ -2598,7 +2598,7 @@ struct sk_buff *skb_segment(struct sk_bu
-
- while (pos < offset + len && i < nfrags) {
- *frag = skb_shinfo(skb)->frags[i];
-- get_page(frag->page);
-+ net_get_page(frag->page);
- size = frag->size;
-
- if (pos < offset) {
-diff -upkr linux-2.6.39/net/ipv4/ip_output.c linux-2.6.39/net/ipv4/ip_output.c
---- linux-2.6.39/net/ipv4/ip_output.c 2011-05-19 00:06:34.000000000 -0400
-+++ linux-2.6.39/net/ipv4/ip_output.c 2011-05-19 10:47:39.565813000 -0400
-@@ -985,7 +985,7 @@ alloc_new_skb:
- err = -EMSGSIZE;
- goto error;
- }
-- get_page(page);
-+ net_get_page(page);
- skb_fill_page_desc(skb, i, page, off, 0);
- frag = &skb_shinfo(skb)->frags[i];
- }
-@@ -1220,7 +1220,7 @@ ssize_t ip_append_page(struct sock *sk,
- if (skb_can_coalesce(skb, i, page, offset)) {
- skb_shinfo(skb)->frags[i-1].size += len;
- } else if (i < MAX_SKB_FRAGS) {
-- get_page(page);
-+ net_get_page(page);
- skb_fill_page_desc(skb, i, page, offset, len);
- } else {
- err = -EMSGSIZE;
-diff -upkr linux-2.6.39/net/ipv4/Makefile linux-2.6.39/net/ipv4/Makefile
---- linux-2.6.39/net/ipv4/Makefile 2011-05-19 00:06:34.000000000 -0400
-+++ linux-2.6.39/net/ipv4/Makefile 2011-05-19 10:46:24.669812999 -0400
+
+=== modified file 'net/ipv4/Makefile'
+--- old/net/ipv4/Makefile 2012-01-10 22:58:17 +0000
++++ new/net/ipv4/Makefile 2012-01-10 23:02:48 +0000
@@ -48,6 +48,7 @@ obj-$(CONFIG_TCP_CONG_LP) += tcp_lp.o
obj-$(CONFIG_TCP_CONG_YEAH) += tcp_yeah.o
obj-$(CONFIG_TCP_CONG_ILLINOIS) += tcp_illinois.o
@@ -779,19 +725,33 @@ diff -upkr linux-2.6.39/net/ipv4/Makefile linux-2.6.39/net/ipv4/Makefile
obj-$(CONFIG_XFRM) += xfrm4_policy.o xfrm4_state.o xfrm4_input.o \
xfrm4_output.o
-diff -upkr linux-2.6.39/net/ipv4/tcp.c linux-2.6.39/net/ipv4/tcp.c
---- linux-2.6.39/net/ipv4/tcp.c 2011-05-19 00:06:34.000000000 -0400
-+++ linux-2.6.39/net/ipv4/tcp.c 2011-05-19 10:46:24.673813002 -0400
+
+=== modified file 'net/ipv4/ip_output.c'
+--- old/net/ipv4/ip_output.c 2012-01-10 22:58:17 +0000
++++ new/net/ipv4/ip_output.c 2012-01-10 23:02:48 +0000
+@@ -1232,7 +1232,7 @@ ssize_t ip_append_page(struct sock *sk,
+ if (skb_can_coalesce(skb, i, page, offset)) {
+ skb_frag_size_add(&skb_shinfo(skb)->frags[i-1], len);
+ } else if (i < MAX_SKB_FRAGS) {
+- get_page(page);
++ net_get_page(page);
+ skb_fill_page_desc(skb, i, page, offset, len);
+ } else {
+ err = -EMSGSIZE;
+
+=== modified file 'net/ipv4/tcp.c'
+--- old/net/ipv4/tcp.c 2012-01-10 22:58:17 +0000
++++ new/net/ipv4/tcp.c 2012-01-10 23:02:48 +0000
@@ -815,7 +815,7 @@ new_segment:
if (can_coalesce) {
- skb_shinfo(skb)->frags[i - 1].size += copy;
+ skb_frag_size_add(&skb_shinfo(skb)->frags[i - 1], copy);
} else {
- get_page(page);
+ net_get_page(page);
skb_fill_page_desc(skb, i, page, offset, copy);
}
-@@ -1021,7 +1021,7 @@ new_segment:
+@@ -1022,7 +1022,7 @@ new_segment:
goto new_segment;
} else if (page) {
if (off == PAGE_SIZE) {
@@ -812,22 +772,11 @@ diff -upkr linux-2.6.39/net/ipv4/tcp.c linux-2.6.39/net/ipv4/tcp.c
TCP_PAGE(sk) = page;
}
}
-diff -upkr linux-2.6.39/net/ipv4/tcp_output.c linux-2.6.39/net/ipv4/tcp_output.c
---- linux-2.6.39/net/ipv4/tcp_output.c 2011-05-19 00:06:34.000000000 -0400
-+++ linux-2.6.39/net/ipv4/tcp_output.c 2011-05-19 10:46:24.673813002 -0400
-@@ -1095,7 +1095,7 @@ static void __pskb_trim_head(struct sk_b
- k = 0;
- for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
- if (skb_shinfo(skb)->frags[i].size <= eat) {
-- put_page(skb_shinfo(skb)->frags[i].page);
-+ net_put_page(skb_shinfo(skb)->frags[i].page);
- eat -= skb_shinfo(skb)->frags[i].size;
- } else {
- skb_shinfo(skb)->frags[k] = skb_shinfo(skb)->frags[i];
-diff -upkr linux-2.6.39/net/ipv4/tcp_zero_copy.c linux-2.6.39/net/ipv4/tcp_zero_copy.c
---- linux-2.6.39/net/ipv4/tcp_zero_copy.c 2011-05-19 10:44:53.685813002 -0400
-+++ linux-2.6.39/net/ipv4/tcp_zero_copy.c 2011-05-19 10:46:24.673813002 -0400
-@@ -0,0 +1,49 @@
+
+=== added file 'net/ipv4/tcp_zero_copy.c'
+--- old/net/ipv4/tcp_zero_copy.c 1970-01-01 00:00:00 +0000
++++ new/net/ipv4/tcp_zero_copy.c 2012-01-10 23:43:22 +0000
+@@ -0,0 +1,50 @@
+/*
+ * Support routines for TCP zero copy transmit
+ *
@@ -838,13 +787,14 @@ diff -upkr linux-2.6.39/net/ipv4/tcp_zero_copy.c linux-2.6.39/net/ipv4/tcp_zero_
+ * version 2 as published by the Free Software Foundation.
+ */
+
++#include <linux/export.h>
+#include <linux/skbuff.h>
+
+net_get_page_callback_t net_get_page_callback __read_mostly;
-+EXPORT_SYMBOL(net_get_page_callback);
++EXPORT_SYMBOL_GPL(net_get_page_callback);
+
+net_put_page_callback_t net_put_page_callback __read_mostly;
-+EXPORT_SYMBOL(net_put_page_callback);
++EXPORT_SYMBOL_GPL(net_put_page_callback);
+
+/*
+ * Caller of this function must ensure that at the moment when it's called
@@ -876,45 +826,12 @@ diff -upkr linux-2.6.39/net/ipv4/tcp_zero_copy.c linux-2.6.39/net/ipv4/tcp_zero_
+out:
+ return res;
+}
-+EXPORT_SYMBOL(net_set_get_put_page_callbacks);
-diff -upkr linux-2.6.39/net/ipv6/ip6_output.c linux-2.6.39/net/ipv6/ip6_output.c
---- linux-2.6.39/net/ipv6/ip6_output.c 2011-05-19 00:06:34.000000000 -0400
-+++ linux-2.6.39/net/ipv6/ip6_output.c 2011-05-19 10:46:24.673813002 -0400
-@@ -1444,7 +1444,7 @@ alloc_new_skb:
- err = -EMSGSIZE;
- goto error;
- }
-- get_page(page);
-+ net_get_page(page);
- skb_fill_page_desc(skb, i, page, sk->sk_sndmsg_off, 0);
- frag = &skb_shinfo(skb)->frags[i];
- }
-diff -upkr linux-2.6.39/net/Kconfig linux-2.6.39/net/Kconfig
---- linux-2.6.39/net/Kconfig 2011-05-19 00:06:34.000000000 -0400
-+++ linux-2.6.39/net/Kconfig 2011-05-19 10:46:24.673813002 -0400
-@@ -72,6 +72,18 @@ config INET
-
- Short answer: say Y.
-
-+config TCP_ZERO_COPY_TRANSFER_COMPLETION_NOTIFICATION
-+ bool "TCP/IP zero-copy transfer completion notification"
-+ depends on INET
-+ default SCST_ISCSI
-+ ---help---
-+ Adds support for sending a notification upon completion of a
-+ zero-copy TCP/IP transfer. This can speed up certain TCP/IP
-+ software. Currently this is only used by the iSCSI target driver
-+ iSCSI-SCST.
-+
-+ If unsure, say N.
-+
- if INET
- source "net/ipv4/Kconfig"
- source "net/ipv6/Kconfig"
++EXPORT_SYMBOL_GPL(net_set_get_put_page_callbacks);
+
diff --git a/drivers/Kconfig b/drivers/Kconfig
index a2b902f..92e3d67 100644
---- orig/linux-2.6.39/drivers/Kconfig
-+++ linux-2.6.39/drivers/Kconfig
+--- orig/linux-3.2/drivers/Kconfig
++++ linux-3.2/drivers/Kconfig
@@ -22,6 +22,8 @@ source "drivers/ide/Kconfig"
source "drivers/scsi/Kconfig"
@@ -926,8 +843,8 @@ index a2b902f..92e3d67 100644
source "drivers/md/Kconfig"
diff --git a/drivers/Makefile b/drivers/Makefile
index b423bb1..f780114 100644
---- orig/linux-2.6.39/drivers/Makefile
-+++ linux-2.6.39/drivers/Makefile
+--- orig/linux-3.2/drivers/Makefile
++++ linux-3.2/drivers/Makefile
@@ -115,5 +115,6 @@ obj-$(CONFIG_VLYNQ) += vlynq/
obj-$(CONFIG_STAGING) += staging/
obj-y += platform/
@@ -935,9 +852,9 @@ index b423bb1..f780114 100644
+obj-$(CONFIG_SCST) += scst/
#common clk code
obj-y += clk/
-diff -uprN orig/linux-2.6.39/drivers/scst/Kconfig linux-2.6.39/drivers/scst/Kconfig
---- orig/linux-2.6.39/drivers/scst/Kconfig
-+++ linux-2.6.39/drivers/scst/Kconfig
+diff -uprN orig/linux-3.2/drivers/scst/Kconfig linux-3.2/drivers/scst/Kconfig
+--- orig/linux-3.2/drivers/scst/Kconfig
++++ linux-3.2/drivers/scst/Kconfig
@@ -0,0 +1,255 @@
+menu "SCSI target (SCST) support"
+
@@ -1194,9 +1111,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/Kconfig linux-2.6.39/drivers/scst/Kcon
+source "drivers/scst/srpt/Kconfig"
+
+endmenu
-diff -uprN orig/linux-2.6.39/drivers/scst/Makefile linux-2.6.39/drivers/scst/Makefile
---- orig/linux-2.6.39/drivers/scst/Makefile
-+++ linux-2.6.39/drivers/scst/Makefile
+diff -uprN orig/linux-3.2/drivers/scst/Makefile linux-3.2/drivers/scst/Makefile
+--- orig/linux-3.2/drivers/scst/Makefile
++++ linux-3.2/drivers/scst/Makefile
@@ -0,0 +1,13 @@
+ccflags-y += -Wno-unused-parameter
+
@@ -1211,10 +1128,10 @@ diff -uprN orig/linux-2.6.39/drivers/scst/Makefile linux-2.6.39/drivers/scst/Mak
+
+obj-$(CONFIG_SCST) += scst.o dev_handlers/ iscsi-scst/ qla2xxx-target/ \
+ srpt/ scst_local/
-diff -uprN orig/linux-2.6.39/include/scst/scst.h linux-2.6.39/include/scst/scst.h
---- orig/linux-2.6.39/include/scst/scst.h
-+++ linux-2.6.39/include/scst/scst.h
-@@ -0,0 +1,3868 @@
+diff -uprN orig/linux-3.2/include/scst/scst.h linux-3.2/include/scst/scst.h
+--- orig/linux-3.2/include/scst/scst.h
++++ linux-3.2/include/scst/scst.h
+@@ -0,0 +1,3867 @@
+/*
+ * include/scst.h
+ *
@@ -1241,7 +1158,6 @@ diff -uprN orig/linux-2.6.39/include/scst/scst.h linux-2.6.39/include/scst/scst.
+#define __SCST_H
+
+#include <linux/types.h>
-+#include <linux/version.h>
+#include <linux/blkdev.h>
+#include <linux/interrupt.h>
+#include <linux/wait.h>
@@ -1258,7 +1174,7 @@ diff -uprN orig/linux-2.6.39/include/scst/scst.h linux-2.6.39/include/scst/scst.
+#include <scst/scst_sgv.h>
+
+#define SCST_INTERFACE_VERSION \
-+ SCST_VERSION_STRING "$Revision: 3836 $" SCST_CONST_VERSION
++ SCST_VERSION_STRING "$Revision: 3992 $" SCST_CONST_VERSION
+
+#define SCST_LOCAL_NAME "scst_local"
+
@@ -2141,7 +2057,7 @@ diff -uprN orig/linux-2.6.39/include/scst/scst.h linux-2.6.39/include/scst/scst.
+ /*
+ * Optional revision to be reported in the SCSI inquiry response. If
+ * NULL, an SCST device handler specific default value will be used,
-+ * e.g. " 210" for scst_vdisk file I/O.
++ * e.g. " 220" for scst_vdisk file I/O.
+ */
+ const char *revision;
+
@@ -5083,9 +4999,9 @@ diff -uprN orig/linux-2.6.39/include/scst/scst.h linux-2.6.39/include/scst/scst.
+ void (*done)(void *data, char *sense, int result, int resid));
+
+#endif /* __SCST_H */
-diff -uprN orig/linux-2.6.39/include/scst/scst_const.h linux-2.6.39/include/scst/scst_const.h
---- orig/linux-2.6.39/include/scst/scst_const.h
-+++ linux-2.6.39/include/scst/scst_const.h
+diff -uprN orig/linux-3.2/include/scst/scst_const.h linux-3.2/include/scst/scst_const.h
+--- orig/linux-3.2/include/scst/scst_const.h
++++ linux-3.2/include/scst/scst_const.h
@@ -0,0 +1,487 @@
+/*
+ * include/scst_const.h
@@ -5127,12 +5043,12 @@ diff -uprN orig/linux-2.6.39/include/scst/scst_const.h linux-2.6.39/include/scst
+ * and FIO_REV in usr/fileio/common.h as well.
+ */
+#define SCST_VERSION(a, b, c, d) (((a) << 24) + ((b) << 16) + ((c) << 8) + d)
-+#define SCST_VERSION_CODE SCST_VERSION(2, 1, 0, 0)
++#define SCST_VERSION_CODE SCST_VERSION(2, 2, 0, 0)
+#define SCST_VERSION_STRING_SUFFIX
-+#define SCST_VERSION_NAME "2.1.0"
++#define SCST_VERSION_NAME "2.2.0-pre"
+#define SCST_VERSION_STRING SCST_VERSION_NAME SCST_VERSION_STRING_SUFFIX
+
-+#define SCST_CONST_VERSION "$Revision: 3837 $"
++#define SCST_CONST_VERSION "$Revision: 3987 $"
+
+/*** Shared constants between user and kernel spaces ***/
+
@@ -5574,9 +5490,9 @@ diff -uprN orig/linux-2.6.39/include/scst/scst_const.h linux-2.6.39/include/scst
+#define SCST_MAX_REL_TGT_ID 65535
+
+#endif /* __SCST_CONST_H */
-diff -uprN orig/linux-2.6.39/drivers/scst/scst_main.c linux-2.6.39/drivers/scst/scst_main.c
---- orig/linux-2.6.39/drivers/scst/scst_main.c
-+++ linux-2.6.39/drivers/scst/scst_main.c
+diff -uprN orig/linux-3.2/drivers/scst/scst_main.c linux-3.2/drivers/scst/scst_main.c
+--- orig/linux-3.2/drivers/scst/scst_main.c
++++ linux-3.2/drivers/scst/scst_main.c
@@ -0,0 +1,2229 @@
+/*
+ * scst_main.c
@@ -5618,10 +5534,10 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_main.c linux-2.6.39/drivers/scst/
+#include "scst_pres.h"
+
+#if defined(CONFIG_HIGHMEM4G) || defined(CONFIG_HIGHMEM64G)
-+#warning "HIGHMEM kernel configurations are fully supported, but not\
-+ recommended for performance reasons. Consider changing VMSPLIT\
-+ option or use a 64-bit configuration instead. See README file for\
-+ details."
++#warning HIGHMEM kernel configurations are fully supported, but not \
++recommended for performance reasons. Consider changing VMSPLIT \
++option or use a 64-bit configuration instead. See README file for \
++details.
+#endif
+
+/**
@@ -7807,9 +7723,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_main.c linux-2.6.39/drivers/scst/
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("SCSI target core");
+MODULE_VERSION(SCST_VERSION_STRING);
-diff -uprN orig/linux-2.6.39/drivers/scst/scst_module.c linux-2.6.39/drivers/scst/scst_module.c
---- orig/linux-2.6.39/drivers/scst/scst_module.c
-+++ linux-2.6.39/drivers/scst/scst_module.c
+diff -uprN orig/linux-3.2/drivers/scst/scst_module.c linux-3.2/drivers/scst/scst_module.c
+--- orig/linux-3.2/drivers/scst/scst_module.c
++++ linux-3.2/drivers/scst/scst_module.c
@@ -0,0 +1,70 @@
+/*
+ * scst_module.c
@@ -7881,10 +7797,10 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_module.c linux-2.6.39/drivers/scs
+
+module_init(init_this_scst_driver);
+module_exit(exit_this_scst_driver);
-diff -uprN orig/linux-2.6.39/drivers/scst/scst_priv.h linux-2.6.39/drivers/scst/scst_priv.h
---- orig/linux-2.6.39/drivers/scst/scst_priv.h
-+++ linux-2.6.39/drivers/scst/scst_priv.h
-@@ -0,0 +1,645 @@
+diff -uprN orig/linux-3.2/drivers/scst/scst_priv.h linux-3.2/drivers/scst/scst_priv.h
+--- orig/linux-3.2/drivers/scst/scst_priv.h
++++ linux-3.2/drivers/scst/scst_priv.h
+@@ -0,0 +1,646 @@
+/*
+ * scst_priv.h
+ *
@@ -7909,6 +7825,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_priv.h linux-2.6.39/drivers/scst/
+
+#include <linux/types.h>
+#include <linux/slab.h>
++#include <linux/export.h>
+#include <scsi/scsi.h>
+#include <scsi/scsi_cmnd.h>
+#include <scsi/scsi_driver.h>
@@ -8530,10 +8447,10 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_priv.h linux-2.6.39/drivers/scst/
+#endif /* CONFIG_SCST_MEASURE_LATENCY */
+
+#endif /* __SCST_PRIV_H */
-diff -uprN orig/linux-2.6.39/drivers/scst/scst_targ.c linux-2.6.39/drivers/scst/scst_targ.c
---- orig/linux-2.6.39/drivers/scst/scst_targ.c
-+++ linux-2.6.39/drivers/scst/scst_targ.c
-@@ -0,0 +1,6701 @@
+diff -uprN orig/linux-3.2/drivers/scst/scst_targ.c linux-3.2/drivers/scst/scst_targ.c
+--- orig/linux-3.2/drivers/scst/scst_targ.c
++++ linux-3.2/drivers/scst/scst_targ.c
+@@ -0,0 +1,6705 @@
+/*
+ * scst_targ.c
+ *
@@ -13287,11 +13204,12 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_targ.c linux-2.6.39/drivers/scst/
+ }
+
+ if (mstb->done_counted || mstb->finish_counted) {
-+ TRACE_MGMT_DBG("cmd %p (tag %llu, sn %u) being "
-+ "executed/xmitted (state %d, op %x, proc time "
-+ "%ld sec., timeout %d sec.), deferring ABORT "
-+ "(cmd_done_wait_count %d, cmd_finish_wait_count "
-+ "%d)", cmd, (long long unsigned int)cmd->tag,
++ TRACE(TRACE_SCSI|TRACE_MGMT_DEBUG, "cmd %p (tag %llu, "
++ "sn %u) being executed/xmitted (state %d, "
++ "op %x, proc time %ld sec., timeout %d sec.), "
++ "deferring ABORT (cmd_done_wait_count %d, "
++ "cmd_finish_wait_count %d)", cmd,
++ (long long unsigned int)cmd->tag,
+ cmd->sn, cmd->state, cmd->cdb[0],
+ (long)(jiffies - cmd->start_time) / HZ,
+ cmd->timeout / HZ, mcmd->cmd_done_wait_count,
@@ -13334,7 +13252,8 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_targ.c linux-2.6.39/drivers/scst/
+ mcmd->state = SCST_MCMD_STATE_AFFECTED_CMDS_DONE;
+ res = 0;
+ } else {
-+ TRACE_MGMT_DBG("cmd_done_wait_count(%d) not 0, "
++ TRACE(TRACE_SCSI|TRACE_MGMT_DEBUG,
++ "cmd_done_wait_count(%d) not 0, "
+ "preparing to wait", mcmd->cmd_done_wait_count);
+ mcmd->state = SCST_MCMD_STATE_WAITING_AFFECTED_CMDS_DONE;
+ res = -1;
@@ -13346,7 +13265,8 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_targ.c linux-2.6.39/drivers/scst/
+ mcmd->state = SCST_MCMD_STATE_DONE;
+ res = 0;
+ } else {
-+ TRACE_MGMT_DBG("cmd_finish_wait_count(%d) not 0, "
++ TRACE(TRACE_SCSI|TRACE_MGMT_DEBUG,
++ "cmd_finish_wait_count(%d) not 0, "
+ "preparing to wait",
+ mcmd->cmd_finish_wait_count);
+ mcmd->state = SCST_MCMD_STATE_WAITING_AFFECTED_CMDS_FINISHED;
@@ -14183,11 +14103,11 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_targ.c linux-2.6.39/drivers/scst/
+ mcmd->status = SCST_MGMT_STATUS_TASK_NOT_EXIST;
+
+ if (mcmd->fn < SCST_UNREG_SESS_TM)
-+ TRACE(TRACE_MGMT, "TM fn %d finished, "
-+ "status %d", mcmd->fn, mcmd->status);
++ TRACE(TRACE_MGMT, "TM fn %d (%p) finished, "
++ "status %d", mcmd->fn, mcmd, mcmd->status);
+ else
-+ TRACE_MGMT_DBG("TM fn %d finished, "
-+ "status %d", mcmd->fn, mcmd->status);
++ TRACE_MGMT_DBG("TM fn %d (%p) finished, "
++ "status %d", mcmd->fn, mcmd, mcmd->status);
+
+ if (mcmd->fn == SCST_PR_ABORT_ALL) {
+ mcmd->origin_pr_cmd->scst_cmd_done(mcmd->origin_pr_cmd,
@@ -14525,9 +14445,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_targ.c linux-2.6.39/drivers/scst/
+ mcmd->cmd_sn = params->cmd_sn;
+
+ if (params->fn < SCST_UNREG_SESS_TM)
-+ TRACE(TRACE_MGMT, "TM fn %d", params->fn);
++ TRACE(TRACE_MGMT, "TM fn %d (%p)", params->fn, mcmd);
+ else
-+ TRACE_MGMT_DBG("TM fn %d", params->fn);
++ TRACE_MGMT_DBG("TM fn %d (%p)", params->fn, mcmd);
+
+ TRACE_MGMT_DBG("sess=%p, tag_set %d, tag %lld, lun_set %d, "
+ "lun=%lld, cmd_sn_set %d, cmd_sn %d, priv %p", sess,
@@ -14725,8 +14645,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_targ.c linux-2.6.39/drivers/scst/
+
+ sess->acg = scst_find_acg(sess);
+
-+ PRINT_INFO("Using security group \"%s\" for initiator \"%s\"",
-+ sess->acg->acg_name, sess->initiator_name);
++ PRINT_INFO("Using security group \"%s\" for initiator \"%s\" "
++ "(target %s)", sess->acg->acg_name, sess->initiator_name,
++ sess->tgt->tgt_name);
+
+ list_add_tail(&sess->acg_sess_list_entry, &sess->acg->acg_sess_list);
+
@@ -15235,10 +15156,10 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_targ.c linux-2.6.39/drivers/scst/
+ return cmd;
+}
+EXPORT_SYMBOL(scst_find_cmd_by_tag);
-diff -uprN orig/linux-2.6.39/drivers/scst/scst_lib.c linux-2.6.39/drivers/scst/scst_lib.c
---- orig/linux-2.6.39/drivers/scst/scst_lib.c
-+++ linux-2.6.39/drivers/scst/scst_lib.c
-@@ -0,0 +1,7481 @@
+diff -uprN orig/linux-3.2/drivers/scst/scst_lib.c linux-3.2/drivers/scst/scst_lib.c
+--- orig/linux-3.2/drivers/scst/scst_lib.c
++++ linux-3.2/drivers/scst/scst_lib.c
+@@ -0,0 +1,7480 @@
+/*
+ * scst_lib.c
+ *
@@ -17943,7 +17864,6 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_lib.c linux-2.6.39/drivers/scst/s
+ struct scst_tgt_dev *tgt_dev;
+ struct scst_session *sess;
+ LIST_HEAD(tmp_tgt_dev_list);
-+ bool del_sysfs = true;
+
+ TRACE_ENTRY();
+
@@ -17973,10 +17893,8 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_lib.c linux-2.6.39/drivers/scst/s
+ }
+
+ res = scst_acg_dev_sysfs_create(acg_dev, parent);
-+ if (res != 0) {
-+ del_sysfs = false;
++ if (res != 0)
+ goto out_free;
-+ }
+
+ if (gen_scst_report_luns_changed)
+ scst_report_luns_changed(acg);
@@ -17997,7 +17915,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_lib.c linux-2.6.39/drivers/scst/s
+ extra_tgt_dev_list_entry) {
+ scst_free_tgt_dev(tgt_dev);
+ }
-+ scst_del_free_acg_dev(acg_dev, del_sysfs);
++ scst_del_free_acg_dev(acg_dev, false);
+ goto out;
+}
+
@@ -19148,7 +19066,14 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_lib.c linux-2.6.39/drivers/scst/s
+ scst_sess_free_tgt_devs(sess);
+
+ mutex_unlock(&scst_mutex);
++
+ scst_sess_sysfs_del(sess);
++ if (sess->unreg_done_fn) {
++ TRACE_DBG("Calling unreg_done_fn(%p)", sess);
++ sess->unreg_done_fn(sess);
++ TRACE_DBG("%s", "unreg_done_fn() returned");
++ }
++
+ mutex_lock(&scst_mutex);
+
+ /*
@@ -19200,11 +19125,6 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_lib.c linux-2.6.39/drivers/scst/s
+ sess->shut_phase = SCST_SESS_SPH_UNREG_DONE_CALLING;
+ mutex_unlock(&scst_mutex);
+
-+ if (sess->unreg_done_fn) {
-+ TRACE_DBG("Calling unreg_done_fn(%p)", sess);
-+ sess->unreg_done_fn(sess);
-+ TRACE_DBG("%s", "unreg_done_fn() returned");
-+ }
+ scst_free_session(sess);
+
+ if (c)
@@ -21309,7 +21229,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_lib.c linux-2.6.39/drivers/scst/s
+{
+ int skip_UA = 0;
+ struct scst_tgt_dev_UA *UA_entry_tmp;
-+ int len = min((int)sizeof(UA_entry_tmp->UA_sense_buffer), sense_len);
++ int len = min_t(int, sizeof(UA_entry_tmp->UA_sense_buffer), sense_len);
+
+ TRACE_ENTRY();
+
@@ -22720,9 +22640,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_lib.c linux-2.6.39/drivers/scst/s
+}
+
+#endif /* CONFIG_SCST_MEASURE_LATENCY */
-diff -uprN orig/linux-2.6.39/drivers/scst/scst_pres.h linux-2.6.39/drivers/scst/scst_pres.h
---- orig/linux-2.6.39/drivers/scst/scst_pres.h
-+++ linux-2.6.39/drivers/scst/scst_pres.h
+diff -uprN orig/linux-3.2/drivers/scst/scst_pres.h linux-3.2/drivers/scst/scst_pres.h
+--- orig/linux-3.2/drivers/scst/scst_pres.h
++++ linux-3.2/drivers/scst/scst_pres.h
@@ -0,0 +1,234 @@
+/*
+ * scst_pres.c
@@ -22958,10 +22878,10 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_pres.h linux-2.6.39/drivers/scst/
+#endif
+
+#endif /* SCST_PRES_H_ */
-diff -uprN orig/linux-2.6.39/drivers/scst/scst_pres.c linux-2.6.39/drivers/scst/scst_pres.c
---- orig/linux-2.6.39/drivers/scst/scst_pres.c
-+++ linux-2.6.39/drivers/scst/scst_pres.c
-@@ -0,0 +1,2637 @@
+diff -uprN orig/linux-3.2/drivers/scst/scst_pres.c linux-3.2/drivers/scst/scst_pres.c
+--- orig/linux-3.2/drivers/scst/scst_pres.c
++++ linux-3.2/drivers/scst/scst_pres.c
+@@ -0,0 +1,2636 @@
+/*
+ * scst_pres.c
+ *
@@ -23000,7 +22920,6 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_pres.c linux-2.6.39/drivers/scst/
+#include <linux/fcntl.h>
+#include <linux/uaccess.h>
+#include <linux/namei.h>
-+#include <linux/version.h>
+#include <linux/vmalloc.h>
+#include <asm/unaligned.h>
+
@@ -23198,7 +23117,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_pres.c linux-2.6.39/drivers/scst/
+ return;
+}
+
-+#endif /* defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) */
++#endif /* defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) */
+
+/* dev_pr_mutex must be locked */
+static void scst_pr_find_registrants_list_all(struct scst_device *dev,
@@ -25576,7 +25495,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_pres.c linux-2.6.39/drivers/scst/
+
+ if (dev->pr_is_set && scst_pr_is_holder(dev, reg)) {
+ buffer[offset + 12] = 1;
-+ buffer[offset + 13] = (dev->pr_scope << 8) | dev->pr_type;
++ buffer[offset + 13] = (dev->pr_scope << 4) | dev->pr_type;
+ }
+
+ put_unaligned(cpu_to_be16(reg->rel_tgt_id),
@@ -25599,9 +25518,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_pres.c linux-2.6.39/drivers/scst/
+ TRACE_EXIT();
+ return;
+}
-diff -uprN orig/linux-2.6.39/drivers/scst/scst_sysfs.c linux-2.6.39/drivers/scst/scst_sysfs.c
---- orig/linux-2.6.39/drivers/scst/scst_sysfs.c
-+++ linux-2.6.39/drivers/scst/scst_sysfs.c
+diff -uprN orig/linux-3.2/drivers/scst/scst_sysfs.c linux-3.2/drivers/scst/scst_sysfs.c
+--- orig/linux-3.2/drivers/scst/scst_sysfs.c
++++ linux-3.2/drivers/scst/scst_sysfs.c
@@ -0,0 +1,6224 @@
+/*
+ * scst_sysfs.c
@@ -25893,7 +25812,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_sysfs.c linux-2.6.39/drivers/scst
+ return res;
+}
+
-+#endif /* defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) */
++#endif /* defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) */
+
+/**
+ ** Sysfs work
@@ -26414,7 +26333,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_sysfs.c linux-2.6.39/drivers/scst
+ __ATTR(trace_level, S_IRUGO | S_IWUSR,
+ scst_tgtt_trace_level_show, scst_tgtt_trace_level_store);
+
-+#endif /* #if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) */
++#endif /* defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) */
+
+static ssize_t scst_tgtt_mgmt_show(struct kobject *kobj,
+ struct kobj_attribute *attr, char *buf)
@@ -28071,7 +27990,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_sysfs.c linux-2.6.39/drivers/scst
+static struct kobj_attribute dev_dump_prs_attr =
+ __ATTR(dump_prs, S_IWUSR, NULL, scst_dev_sysfs_dump_prs);
+
-+#endif /* defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) */
++#endif /* defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) */
+
+static int scst_process_dev_sysfs_threads_data_store(
+ struct scst_device *dev, int threads_num,
@@ -29082,7 +29001,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_sysfs.c linux-2.6.39/drivers/scst
+
+#define SCST_SESS_SYSFS_STAT_ATTR(name, exported_name, dir, kb) \
+static ssize_t scst_sess_sysfs_##exported_name##_show(struct kobject *kobj, \
-+ struct kobj_attribute *attr, char *buf) \
++ struct kobj_attribute *attr, char *buf) \
+{ \
+ struct scst_session *sess; \
+ int res; \
@@ -30048,7 +29967,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_sysfs.c linux-2.6.39/drivers/scst
+ __ATTR(trace_level, S_IRUGO | S_IWUSR,
+ scst_devt_trace_level_show, scst_devt_trace_level_store);
+
-+#endif /* #if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) */
++#endif /* defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) */
+
+static ssize_t scst_devt_type_show(struct kobject *kobj,
+ struct kobj_attribute *attr, char *buf)
@@ -31377,7 +31296,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_sysfs.c linux-2.6.39/drivers/scst
+ __ATTR(trace_level, S_IRUGO | S_IWUSR, scst_main_trace_level_show,
+ scst_main_trace_level_store);
+
-+#endif /* defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) */
++#endif /* defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) */
+
+static ssize_t scst_version_show(struct kobject *kobj,
+ struct kobj_attribute *attr,
@@ -31827,9 +31746,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_sysfs.c linux-2.6.39/drivers/scst
+ TRACE_EXIT();
+ return;
+}
-diff -uprN orig/linux-2.6.39/include/scst/scst_debug.h linux-2.6.39/include/scst/scst_debug.h
---- orig/linux-2.6.39/include/scst/scst_debug.h
-+++ linux-2.6.39/include/scst/scst_debug.h
+diff -uprN orig/linux-3.2/include/scst/scst_debug.h linux-3.2/include/scst/scst_debug.h
+--- orig/linux-3.2/include/scst/scst_debug.h
++++ linux-3.2/include/scst/scst_debug.h
@@ -0,0 +1,351 @@
+/*
+ * include/scst_debug.h
@@ -31976,7 +31895,7 @@ diff -uprN orig/linux-2.6.39/include/scst/scst_debug.h linux-2.6.39/include/scst
+#define PRINT_BUFFER(message, buff, len) do {} while (0)
+#define PRINT_BUFF_FLAG(flag, message, buff, len) do {} while (0)
+
-+#endif /* CONFIG_SCST_DEBUG || CONFIG_SCST_TRACING */
++#endif /* defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) */
+
+#ifdef CONFIG_SCST_DEBUG
+
@@ -32182,10 +32101,10 @@ diff -uprN orig/linux-2.6.39/include/scst/scst_debug.h linux-2.6.39/include/scst
+#endif
+
+#endif /* __SCST_DEBUG_H */
-diff -uprN orig/linux-2.6.39/drivers/scst/scst_debug.c linux-2.6.39/drivers/scst/scst_debug.c
---- orig/linux-2.6.39/drivers/scst/scst_debug.c
-+++ linux-2.6.39/drivers/scst/scst_debug.c
-@@ -0,0 +1,224 @@
+diff -uprN orig/linux-3.2/drivers/scst/scst_debug.c linux-3.2/drivers/scst/scst_debug.c
+--- orig/linux-3.2/drivers/scst/scst_debug.c
++++ linux-3.2/drivers/scst/scst_debug.c
+@@ -0,0 +1,228 @@
+/*
+ * scst_debug.c
+ *
@@ -32208,6 +32127,10 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_debug.c linux-2.6.39/drivers/scst
+ * GNU General Public License for more details.
+ */
+
++#include <linux/version.h>
++
++#include <linux/export.h>
++
+#include <scst/scst.h>
+#include <scst/scst_debug.h>
+
@@ -32409,10 +32332,10 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_debug.c linux-2.6.39/drivers/scst
+#undef SIZEOF_NAME_BUF
+}
+
-+#endif /* CONFIG_SCST_DEBUG || CONFIG_SCST_TRACING */
-diff -uprN orig/linux-2.6.39/include/scst/scst_sgv.h linux-2.6.39/include/scst/scst_sgv.h
---- orig/linux-2.6.39/include/scst/scst_sgv.h
-+++ linux-2.6.39/include/scst/scst_sgv.h
++#endif /* defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) */
+diff -uprN orig/linux-3.2/include/scst/scst_sgv.h linux-3.2/include/scst/scst_sgv.h
+--- orig/linux-3.2/include/scst/scst_sgv.h
++++ linux-3.2/include/scst/scst_sgv.h
@@ -0,0 +1,98 @@
+/*
+ * include/scst_sgv.h
@@ -32512,9 +32435,9 @@ diff -uprN orig/linux-2.6.39/include/scst/scst_sgv.h linux-2.6.39/include/scst/s
+void scst_init_mem_lim(struct scst_mem_lim *mem_lim);
+
+#endif /* __SCST_SGV_H */
-diff -uprN orig/linux-2.6.39/drivers/scst/scst_mem.h linux-2.6.39/drivers/scst/scst_mem.h
---- orig/linux-2.6.39/drivers/scst/scst_mem.h
-+++ linux-2.6.39/drivers/scst/scst_mem.h
+diff -uprN orig/linux-3.2/drivers/scst/scst_mem.h linux-3.2/drivers/scst/scst_mem.h
+--- orig/linux-3.2/drivers/scst/scst_mem.h
++++ linux-3.2/drivers/scst/scst_mem.h
@@ -0,0 +1,142 @@
+/*
+ * scst_mem.h
@@ -32658,10 +32581,10 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_mem.h linux-2.6.39/drivers/scst/s
+void scst_sgv_pool_use_norm(struct scst_tgt_dev *tgt_dev);
+void scst_sgv_pool_use_norm_clust(struct scst_tgt_dev *tgt_dev);
+void scst_sgv_pool_use_dma(struct scst_tgt_dev *tgt_dev);
-diff -uprN orig/linux-2.6.39/drivers/scst/scst_mem.c linux-2.6.39/drivers/scst/scst_mem.c
---- orig/linux-2.6.39/drivers/scst/scst_mem.c
-+++ linux-2.6.39/drivers/scst/scst_mem.c
-@@ -0,0 +1,2001 @@
+diff -uprN orig/linux-3.2/drivers/scst/scst_mem.c linux-3.2/drivers/scst/scst_mem.c
+--- orig/linux-3.2/drivers/scst/scst_mem.c
++++ linux-3.2/drivers/scst/scst_mem.c
+@@ -0,0 +1,2002 @@
+/*
+ * scst_mem.c
+ *
@@ -32993,8 +32916,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_mem.c linux-2.6.39/drivers/scst/s
+ goto out;
+}
+
-+static int sgv_shrink(struct shrinker *shrinker, int nr, gfp_t gfpm)
++static int sgv_shrink(struct shrinker *shrinker, struct shrink_control *sc)
+{
++ int nr = sc->nr_to_scan;
+
+ TRACE_ENTRY();
+
@@ -34663,9 +34587,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_mem.c linux-2.6.39/drivers/scst/s
+ scst_sgv_kobj = NULL;
+}
+
-diff -uprN orig/linux-2.6.39/Documentation/scst/sgv_cache.sgml linux-2.6.39/Documentation/scst/sgv_cache.sgml
---- orig/linux-2.6.39/Documentation/scst/sgv_cache.sgml
-+++ linux-2.6.39/Documentation/scst/sgv_cache.sgml
+diff -uprN orig/linux-3.2/Documentation/scst/sgv_cache.sgml linux-3.2/Documentation/scst/sgv_cache.sgml
+--- orig/linux-3.2/Documentation/scst/sgv_cache.sgml
++++ linux-3.2/Documentation/scst/sgv_cache.sgml
@@ -0,0 +1,335 @@
+<!doctype linuxdoc system>
+
@@ -35002,9 +34926,9 @@ diff -uprN orig/linux-2.6.39/Documentation/scst/sgv_cache.sgml linux-2.6.39/Docu
+Runtime information and statistics is available in /sys/kernel/scst_tgt/sgv.
+
+</article>
-diff -uprN orig/linux-2.6.39/include/scst/scst_user.h linux-2.6.39/include/scst/scst_user.h
---- orig/linux-2.6.39/include/scst/scst_user.h
-+++ linux-2.6.39/include/scst/scst_user.h
+diff -uprN orig/linux-3.2/include/scst/scst_user.h linux-3.2/include/scst/scst_user.h
+--- orig/linux-3.2/include/scst/scst_user.h
++++ linux-3.2/include/scst/scst_user.h
@@ -0,0 +1,320 @@
+/*
+ * include/scst_user.h
@@ -35326,9 +35250,9 @@ diff -uprN orig/linux-2.6.39/include/scst/scst_user.h linux-2.6.39/include/scst/
+ _IOWR('s', UCMD_STATE_TM_EXECING, struct scst_user_tm)
+
+#endif /* __SCST_USER_H */
-diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_user.c linux-2.6.39/drivers/scst/dev_handlers/scst_user.c
---- orig/linux-2.6.39/drivers/scst/dev_handlers/scst_user.c
-+++ linux-2.6.39/drivers/scst/dev_handlers/scst_user.c
+diff -uprN orig/linux-3.2/drivers/scst/dev_handlers/scst_user.c linux-3.2/drivers/scst/dev_handlers/scst_user.c
+--- orig/linux-3.2/drivers/scst/dev_handlers/scst_user.c
++++ linux-3.2/drivers/scst/dev_handlers/scst_user.c
@@ -0,0 +1,3751 @@
+/*
+ * scst_user.c
@@ -36770,7 +36694,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_user.c linux-2.6.39/
+ if (res != 0)
+ goto out_compl;
+
-+ sense_len = min((int)cmd->sense_buflen, (int)ereply->sense_len);
++ sense_len = min_t(int, cmd->sense_buflen, ereply->sense_len);
+
+ rc = copy_from_user(cmd->sense,
+ (void __user *)(unsigned long)ereply->psense_buffer,
@@ -37545,7 +37469,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_user.c linux-2.6.39/
+ }
+
+ ucmd->cmd->scst_cmd_done(ucmd->cmd, SCST_CMD_STATE_DEFAULT,
-+ SCST_CONTEXT_DIRECT);
++ SCST_CONTEXT_THREAD);
+ /* !! At this point cmd and ucmd can be already freed !! */
+
+ if (flags != NULL)
@@ -39081,10 +39005,10 @@ diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_user.c linux-2.6.39/
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("User space device handler for SCST");
+MODULE_VERSION(SCST_VERSION_STRING);
-diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_vdisk.c linux-2.6.39/drivers/scst/dev_handlers/scst_vdisk.c
---- orig/linux-2.6.39/drivers/scst/dev_handlers/scst_vdisk.c
-+++ linux-2.6.39/drivers/scst/dev_handlers/scst_vdisk.c
-@@ -0,0 +1,4525 @@
+diff -uprN orig/linux-3.2/drivers/scst/dev_handlers/scst_vdisk.c linux-3.2/drivers/scst/dev_handlers/scst_vdisk.c
+--- orig/linux-3.2/drivers/scst/dev_handlers/scst_vdisk.c
++++ linux-3.2/drivers/scst/dev_handlers/scst_vdisk.c
+@@ -0,0 +1,4529 @@
+/*
+ * scst_vdisk.c
+ *
@@ -39155,7 +39079,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_vdisk.c linux-2.6.39
+#define SCST_FIO_VENDOR "SCST_FIO"
+#define SCST_BIO_VENDOR "SCST_BIO"
+/* 4 byte ASCII Product Revision Level - left aligned */
-+#define SCST_FIO_REV " 210"
++#define SCST_FIO_REV " 220"
+
+#define MAX_USN_LEN (20+1) /* For '\0' */
+
@@ -39712,11 +39636,30 @@ diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_vdisk.c linux-2.6.39
+ return res;
+}
+
++/* scst_vdisk_mutex supposed to be held */
++static struct scst_vdisk_dev *vdev_find(const char *name)
++{
++ struct scst_vdisk_dev *res, *vv;
++
++ TRACE_ENTRY();
++
++ res = NULL;
++ list_for_each_entry(vv, &vdev_list, vdev_list_entry) {
++ if (strcmp(vv->name, name) == 0) {
++ res = vv;
++ break;
++ }
++ }
++
++ TRACE_EXIT_HRES((unsigned long)res);
++ return res;
++}
++
+static int vdisk_attach(struct scst_device *dev)
+{
+ int res = 0;
+ loff_t err;
-+ struct scst_vdisk_dev *virt_dev = NULL, *vv;
++ struct scst_vdisk_dev *virt_dev;
+
+ TRACE_ENTRY();
+
@@ -39732,13 +39675,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_vdisk.c linux-2.6.39
+ * scst_vdisk_mutex must be already taken before
+ * scst_register_virtual_device()
+ */
-+ list_for_each_entry(vv, &vdev_list, vdev_list_entry) {
-+ if (strcmp(vv->name, dev->virt_name) == 0) {
-+ virt_dev = vv;
-+ break;
-+ }
-+ }
-+
++ virt_dev = vdev_find(dev->virt_name);
+ if (virt_dev == NULL) {
+ PRINT_ERROR("Device %s not found", dev->virt_name);
+ res = -EINVAL;
@@ -40347,21 +40284,26 @@ diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_vdisk.c linux-2.6.39
+ }
+ } else {
+ const int block_shift = virt_dev->block_shift;
++ const loff_t a0 = start << block_shift;
++ const loff_t a2 = (start + len) << block_shift;
++ const loff_t a1 = max_t(loff_t, a2 & PAGE_CACHE_MASK,
++ a0);
+
+ /*
-+ * We are guaranteed by thin_provisioned flag
-+ * that truncate_range is not NULL.
++ * The SCSI UNMAP command discards a range of blocks
++ * of size (1 << block_shift) while the Linux VFS
++ * truncate_range() function discards a range of blocks
++ * of size PAGE_CACHE_SIZE. Hence pass range [a0, a1)
++ * to truncate_range() instead of range [a0,
++ * a2). Note: since we do not set TPRZ it is not
++ * necessary to overwrite the range [a1, a2) with
++ * zeroes.
+ */
-+ if (((start + len) << block_shift) &
-+ (PAGE_CACHE_SIZE - 1)) {
-+ PRINT_ERROR("Invalid UNMAP range [%llu, %llu); "
-+ "block size = %d", start, start + len,
-+ virt_dev->block_size);
-+ goto out_put;
-+ }
-+ inode->i_op->truncate_range(inode,
-+ start << block_shift,
-+ ((start + len) << block_shift) - 1);
++ WARN_ON(!(a0 <= a1 && a1 <= a2));
++ WARN_ON(!((a1 & (PAGE_CACHE_SIZE - 1)) == 0 ||
++ a0 == a1));
++ if (a0 < a1)
++ inode->i_op->truncate_range(inode, a0, a1 - 1);
+ }
+ }
+
@@ -42290,10 +42232,14 @@ diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_vdisk.c linux-2.6.39
+static int vdev_create(struct scst_dev_type *devt,
+ const char *name, struct scst_vdisk_dev **res_virt_dev)
+{
-+ int res = 0;
++ int res;
+ struct scst_vdisk_dev *virt_dev;
+ uint64_t dev_id_num;
+
++ res = -EEXIST;
++ if (vdev_find(name))
++ goto out;
++
+ virt_dev = kzalloc(sizeof(*virt_dev), GFP_KERNEL);
+ if (virt_dev == NULL) {
+ PRINT_ERROR("Allocation of virtual device %s failed",
@@ -42330,6 +42276,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_vdisk.c linux-2.6.39
+ TRACE_DBG("usn %s", virt_dev->usn);
+
+ *res_virt_dev = virt_dev;
++ res = 0;
+
+out:
+ return res;
@@ -42346,25 +42293,6 @@ diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_vdisk.c linux-2.6.39
+ return;
+}
+
-+/* scst_vdisk_mutex supposed to be held */
-+static struct scst_vdisk_dev *vdev_find(const char *name)
-+{
-+ struct scst_vdisk_dev *res, *vv;
-+
-+ TRACE_ENTRY();
-+
-+ res = NULL;
-+ list_for_each_entry(vv, &vdev_list, vdev_list_entry) {
-+ if (strcmp(vv->name, name) == 0) {
-+ res = vv;
-+ break;
-+ }
-+ }
-+
-+ TRACE_EXIT_HRES((unsigned long)res);
-+ return res;
-+}
-+
+static int vdev_parse_add_dev_params(struct scst_vdisk_dev *virt_dev,
+ char *params, const char *allowed_params[])
+{
@@ -43610,9 +43538,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_vdisk.c linux-2.6.39
+MODULE_DESCRIPTION("SCSI disk (type 0) and CDROM (type 5) dev handler for "
+ "SCST using files on file systems or block devices");
+MODULE_VERSION(SCST_VERSION_STRING);
-diff -uprN orig/linux-2.6.39/drivers/scst/scst_tg.c linux-2.6.39/drivers/scst/scst_tg.c
---- orig/linux-2.6.39/drivers/scst/scst_tg.c
-+++ linux-2.6.39/drivers/scst/scst_tg.c
+diff -uprN orig/linux-3.2/drivers/scst/scst_tg.c linux-3.2/drivers/scst/scst_tg.c
+--- orig/linux-3.2/drivers/scst/scst_tg.c
++++ linux-3.2/drivers/scst/scst_tg.c
@@ -0,0 +1,809 @@
+/*
+ * scst_tg.c
@@ -44423,9 +44351,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_tg.c linux-2.6.39/drivers/scst/sc
+ return res;
+}
+EXPORT_SYMBOL_GPL(scst_tg_get_group_info);
-diff -uprN orig/linux-2.6.39/drivers/scst/scst_proc.c linux-2.6.39/drivers/scst/scst_proc.c
---- orig/linux-2.6.39/drivers/scst/scst_proc.c
-+++ linux-2.6.39/drivers/scst/scst_proc.c
+diff -uprN orig/linux-3.2/drivers/scst/scst_proc.c linux-3.2/drivers/scst/scst_proc.c
+--- orig/linux-3.2/drivers/scst/scst_proc.c
++++ linux-3.2/drivers/scst/scst_proc.c
@@ -0,0 +1,2716 @@
+/*
+ * scst_proc.c
@@ -44825,7 +44753,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_proc.c linux-2.6.39/drivers/scst/
+ return res;
+}
+
-+#endif /* defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) */
++#endif /* defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) */
+
+#ifdef CONFIG_SCST_MEASURE_LATENCY
+
@@ -45163,7 +45091,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_proc.c linux-2.6.39/drivers/scst/
+{
+ int res = 0;
+#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) || \
-+ defined(CONFIG_SCST_MEASURE_LATENCY)
++ defined(CONFIG_SCST_MEASURE_LATENCY)
+ struct proc_dir_entry *generic;
+#endif
+
@@ -47143,9 +47071,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_proc.c linux-2.6.39/drivers/scst/
+ return dtt->proc_dev_type_root;
+}
+EXPORT_SYMBOL_GPL(scst_proc_get_dev_type_root);
-diff -uprN orig/linux-2.6.39/Documentation/scst/README.scst linux-2.6.39/Documentation/scst/README.scst
---- orig/linux-2.6.39/Documentation/scst/README.scst
-+++ linux-2.6.39/Documentation/scst/README.scst
+diff -uprN orig/linux-3.2/Documentation/scst/README.scst linux-3.2/Documentation/scst/README.scst
+--- orig/linux-3.2/Documentation/scst/README.scst
++++ linux-3.2/Documentation/scst/README.scst
@@ -0,0 +1,1535 @@
+Generic SCSI target mid-level for Linux (SCST)
+==============================================
@@ -48682,9 +48610,9 @@ diff -uprN orig/linux-2.6.39/Documentation/scst/README.scst linux-2.6.39/Documen
+
+
+Vladislav Bolkhovitin <vst@vlnb.net>, http://scst.sourceforge.net
-diff -uprN orig/linux-2.6.39/Documentation/scst/SysfsRules linux-2.6.39/Documentation/scst/SysfsRules
---- orig/linux-2.6.39/Documentation/scst/SysfsRules
-+++ linux-2.6.39/Documentation/scst/SysfsRules
+diff -uprN orig/linux-3.2/Documentation/scst/SysfsRules linux-3.2/Documentation/scst/SysfsRules
+--- orig/linux-3.2/Documentation/scst/SysfsRules
++++ linux-3.2/Documentation/scst/SysfsRules
@@ -0,0 +1,942 @@
+ SCST SYSFS interface rules
+ ==========================
@@ -49628,9 +49556,9 @@ diff -uprN orig/linux-2.6.39/Documentation/scst/SysfsRules linux-2.6.39/Document
+
+3.5. If this target driver should be enabled, enable it.
+
-diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/Makefile linux-2.6.39/drivers/scst/dev_handlers/Makefile
---- orig/linux-2.6.39/drivers/scst/dev_handlers/Makefile
-+++ linux-2.6.39/drivers/scst/dev_handlers/Makefile
+diff -uprN orig/linux-3.2/drivers/scst/dev_handlers/Makefile linux-3.2/drivers/scst/dev_handlers/Makefile
+--- orig/linux-3.2/drivers/scst/dev_handlers/Makefile
++++ linux-3.2/drivers/scst/dev_handlers/Makefile
@@ -0,0 +1,14 @@
+ccflags-y += -Wno-unused-parameter
+
@@ -49646,9 +49574,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/Makefile linux-2.6.39/dri
+obj-$(CONFIG_SCST_PROCESSOR) += scst_processor.o
+obj-$(CONFIG_SCST_VDISK) += scst_vdisk.o
+obj-$(CONFIG_SCST_USER) += scst_user.o
-diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_cdrom.c linux-2.6.39/drivers/scst/dev_handlers/scst_cdrom.c
---- orig/linux-2.6.39/drivers/scst/dev_handlers/scst_cdrom.c
-+++ linux-2.6.39/drivers/scst/dev_handlers/scst_cdrom.c
+diff -uprN orig/linux-3.2/drivers/scst/dev_handlers/scst_cdrom.c linux-3.2/drivers/scst/dev_handlers/scst_cdrom.c
+--- orig/linux-3.2/drivers/scst/dev_handlers/scst_cdrom.c
++++ linux-3.2/drivers/scst/dev_handlers/scst_cdrom.c
@@ -0,0 +1,263 @@
+/*
+ * scst_cdrom.c
@@ -49913,9 +49841,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_cdrom.c linux-2.6.39
+MODULE_AUTHOR("Vladislav Bolkhovitin & Leonid Stoljar");
+MODULE_DESCRIPTION("SCSI CDROM (type 5) dev handler for SCST");
+MODULE_VERSION(SCST_VERSION_STRING);
-diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_changer.c linux-2.6.39/drivers/scst/dev_handlers/scst_changer.c
---- orig/linux-2.6.39/drivers/scst/dev_handlers/scst_changer.c
-+++ linux-2.6.39/drivers/scst/dev_handlers/scst_changer.c
+diff -uprN orig/linux-3.2/drivers/scst/dev_handlers/scst_changer.c linux-3.2/drivers/scst/dev_handlers/scst_changer.c
+--- orig/linux-3.2/drivers/scst/dev_handlers/scst_changer.c
++++ linux-3.2/drivers/scst/dev_handlers/scst_changer.c
@@ -0,0 +1,183 @@
+/*
+ * scst_changer.c
@@ -50100,9 +50028,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_changer.c linux-2.6.
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("SCSI medium changer (type 8) dev handler for SCST");
+MODULE_VERSION(SCST_VERSION_STRING);
-diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_dev_handler.h linux-2.6.39/drivers/scst/dev_handlers/scst_dev_handler.h
---- orig/linux-2.6.39/drivers/scst/dev_handlers/scst_dev_handler.h
-+++ linux-2.6.39/drivers/scst/dev_handlers/scst_dev_handler.h
+diff -uprN orig/linux-3.2/drivers/scst/dev_handlers/scst_dev_handler.h linux-3.2/drivers/scst/dev_handlers/scst_dev_handler.h
+--- orig/linux-3.2/drivers/scst/dev_handlers/scst_dev_handler.h
++++ linux-3.2/drivers/scst/dev_handlers/scst_dev_handler.h
@@ -0,0 +1,27 @@
+#ifndef __SCST_DEV_HANDLER_H
+#define __SCST_DEV_HANDLER_H
@@ -50128,12 +50056,12 @@ diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_dev_handler.h linux-
+static unsigned long dh_trace_flag = SCST_DEFAULT_DEV_LOG_FLAGS;
+#define trace_flag dh_trace_flag
+
-+#endif /* defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) */
++#endif /* defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) */
+
+#endif /* __SCST_DEV_HANDLER_H */
-diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_disk.c linux-2.6.39/drivers/scst/dev_handlers/scst_disk.c
---- orig/linux-2.6.39/drivers/scst/dev_handlers/scst_disk.c
-+++ linux-2.6.39/drivers/scst/dev_handlers/scst_disk.c
+diff -uprN orig/linux-3.2/drivers/scst/dev_handlers/scst_disk.c linux-3.2/drivers/scst/dev_handlers/scst_disk.c
+--- orig/linux-3.2/drivers/scst/dev_handlers/scst_disk.c
++++ linux-3.2/drivers/scst/dev_handlers/scst_disk.c
@@ -0,0 +1,692 @@
+/*
+ * scst_disk.c
@@ -50464,7 +50392,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_disk.c linux-2.6.39/
+struct disk_work {
+ struct scst_cmd *cmd;
+ struct completion disk_work_cmpl;
-+ volatile int result;
++ int result;
+ unsigned int left;
+ uint64_t save_lba;
+ unsigned int save_len;
@@ -50827,9 +50755,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_disk.c linux-2.6.39/
+MODULE_DESCRIPTION("SCSI disk (type 0) dev handler for SCST");
+MODULE_VERSION(SCST_VERSION_STRING);
+
-diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_modisk.c linux-2.6.39/drivers/scst/dev_handlers/scst_modisk.c
---- orig/linux-2.6.39/drivers/scst/dev_handlers/scst_modisk.c
-+++ linux-2.6.39/drivers/scst/dev_handlers/scst_modisk.c
+diff -uprN orig/linux-3.2/drivers/scst/dev_handlers/scst_modisk.c linux-3.2/drivers/scst/dev_handlers/scst_modisk.c
+--- orig/linux-3.2/drivers/scst/dev_handlers/scst_modisk.c
++++ linux-3.2/drivers/scst/dev_handlers/scst_modisk.c
@@ -0,0 +1,350 @@
+/*
+ * scst_modisk.c
@@ -51181,9 +51109,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_modisk.c linux-2.6.3
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("SCSI MO disk (type 7) dev handler for SCST");
+MODULE_VERSION(SCST_VERSION_STRING);
-diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_processor.c linux-2.6.39/drivers/scst/dev_handlers/scst_processor.c
---- orig/linux-2.6.39/drivers/scst/dev_handlers/scst_processor.c
-+++ linux-2.6.39/drivers/scst/dev_handlers/scst_processor.c
+diff -uprN orig/linux-3.2/drivers/scst/dev_handlers/scst_processor.c linux-3.2/drivers/scst/dev_handlers/scst_processor.c
+--- orig/linux-3.2/drivers/scst/dev_handlers/scst_processor.c
++++ linux-3.2/drivers/scst/dev_handlers/scst_processor.c
@@ -0,0 +1,183 @@
+/*
+ * scst_processor.c
@@ -51368,9 +51296,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_processor.c linux-2.
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("SCSI medium processor (type 3) dev handler for SCST");
+MODULE_VERSION(SCST_VERSION_STRING);
-diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_raid.c linux-2.6.39/drivers/scst/dev_handlers/scst_raid.c
---- orig/linux-2.6.39/drivers/scst/dev_handlers/scst_raid.c
-+++ linux-2.6.39/drivers/scst/dev_handlers/scst_raid.c
+diff -uprN orig/linux-3.2/drivers/scst/dev_handlers/scst_raid.c linux-3.2/drivers/scst/dev_handlers/scst_raid.c
+--- orig/linux-3.2/drivers/scst/dev_handlers/scst_raid.c
++++ linux-3.2/drivers/scst/dev_handlers/scst_raid.c
@@ -0,0 +1,184 @@
+/*
+ * scst_raid.c
@@ -51556,9 +51484,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_raid.c linux-2.6.39/
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("SCSI raid(controller) (type 0xC) dev handler for SCST");
+MODULE_VERSION(SCST_VERSION_STRING);
-diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_tape.c linux-2.6.39/drivers/scst/dev_handlers/scst_tape.c
---- orig/linux-2.6.39/drivers/scst/dev_handlers/scst_tape.c
-+++ linux-2.6.39/drivers/scst/dev_handlers/scst_tape.c
+diff -uprN orig/linux-3.2/drivers/scst/dev_handlers/scst_tape.c linux-3.2/drivers/scst/dev_handlers/scst_tape.c
+--- orig/linux-3.2/drivers/scst/dev_handlers/scst_tape.c
++++ linux-3.2/drivers/scst/dev_handlers/scst_tape.c
@@ -0,0 +1,383 @@
+/*
+ * scst_tape.c
@@ -51943,9 +51871,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/dev_handlers/scst_tape.c linux-2.6.39/
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("SCSI tape (type 1) dev handler for SCST");
+MODULE_VERSION(SCST_VERSION_STRING);
-diff -uprN orig/linux-2.6.39/drivers/scst/fcst/Makefile linux-2.6.39/drivers/scst/fcst/Makefile
---- orig/linux-2.6.39/drivers/scst/fcst/Makefile
-+++ linux-2.6.39/drivers/scst/fcst/Makefile
+diff -uprN orig/linux-3.2/drivers/scst/fcst/Makefile linux-3.2/drivers/scst/fcst/Makefile
+--- orig/linux-3.2/drivers/scst/fcst/Makefile
++++ linux-3.2/drivers/scst/fcst/Makefile
@@ -0,0 +1,7 @@
+obj-$(CONFIG_FCST) += fcst.o
+
@@ -51954,19 +51882,19 @@ diff -uprN orig/linux-2.6.39/drivers/scst/fcst/Makefile linux-2.6.39/drivers/scs
+ ft_io.o \
+ ft_scst.o \
+ ft_sess.o
-diff -uprN orig/linux-2.6.39/drivers/scst/fcst/Kconfig linux-2.6.39/drivers/scst/fcst/Kconfig
---- orig/linux-2.6.39/drivers/scst/fcst/Kconfig
-+++ linux-2.6.39/drivers/scst/fcst/Kconfig
+diff -uprN orig/linux-3.2/drivers/scst/fcst/Kconfig linux-3.2/drivers/scst/fcst/Kconfig
+--- orig/linux-3.2/drivers/scst/fcst/Kconfig
++++ linux-3.2/drivers/scst/fcst/Kconfig
@@ -0,0 +1,5 @@
+config FCST
+ tristate "SCST target module for Fibre Channel using libfc"
+ depends on LIBFC && SCST
+ ---help---
+ Supports using libfc HBAs as target adapters with SCST
-diff -uprN orig/linux-2.6.39/drivers/scst/fcst/fcst.h linux-2.6.39/drivers/scst/fcst/fcst.h
---- orig/linux-2.6.39/drivers/scst/fcst/fcst.h
-+++ linux-2.6.39/drivers/scst/fcst/fcst.h
-@@ -0,0 +1,152 @@
+diff -uprN orig/linux-3.2/drivers/scst/fcst/fcst.h linux-3.2/drivers/scst/fcst/fcst.h
+--- orig/linux-3.2/drivers/scst/fcst/fcst.h
++++ linux-3.2/drivers/scst/fcst/fcst.h
+@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2010 Cisco Systems, Inc.
+ *
@@ -51988,7 +51916,6 @@ diff -uprN orig/linux-2.6.39/drivers/scst/fcst/fcst.h linux-2.6.39/drivers/scst/
+#ifndef __SCSI_FCST_H__
+#define __SCSI_FCST_H__
+
-+#include <linux/version.h>
+#include <scst/scst.h>
+
+#define FT_VERSION "0.3"
@@ -52119,9 +52046,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/fcst/fcst.h linux-2.6.39/drivers/scst/
+void ft_cmd_dump(struct scst_cmd *, const char *);
+
+#endif /* __SCSI_FCST_H__ */
-diff -uprN orig/linux-2.6.39/drivers/scst/fcst/ft_cmd.c linux-2.6.39/drivers/scst/fcst/ft_cmd.c
---- orig/linux-2.6.39/drivers/scst/fcst/ft_cmd.c
-+++ linux-2.6.39/drivers/scst/fcst/ft_cmd.c
+diff -uprN orig/linux-3.2/drivers/scst/fcst/ft_cmd.c linux-3.2/drivers/scst/fcst/ft_cmd.c
+--- orig/linux-3.2/drivers/scst/fcst/ft_cmd.c
++++ linux-3.2/drivers/scst/fcst/ft_cmd.c
@@ -0,0 +1,685 @@
+/*
+ * Copyright (c) 2010 Cisco Systems, Inc.
@@ -52808,9 +52735,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/fcst/ft_cmd.c linux-2.6.39/drivers/scs
+ break;
+ }
+}
-diff -uprN orig/linux-2.6.39/drivers/scst/fcst/ft_io.c linux-2.6.39/drivers/scst/fcst/ft_io.c
---- orig/linux-2.6.39/drivers/scst/fcst/ft_io.c
-+++ linux-2.6.39/drivers/scst/fcst/ft_io.c
+diff -uprN orig/linux-3.2/drivers/scst/fcst/ft_io.c linux-3.2/drivers/scst/fcst/ft_io.c
+--- orig/linux-3.2/drivers/scst/fcst/ft_io.c
++++ linux-3.2/drivers/scst/fcst/ft_io.c
@@ -0,0 +1,276 @@
+/*
+ * Copyright (c) 2010 Cisco Systems, Inc.
@@ -53088,9 +53015,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/fcst/ft_io.c linux-2.6.39/drivers/scst
+ }
+ return SCST_TGT_RES_SUCCESS;
+}
-diff -uprN orig/linux-2.6.39/drivers/scst/fcst/ft_scst.c linux-2.6.39/drivers/scst/fcst/ft_scst.c
---- orig/linux-2.6.39/drivers/scst/fcst/ft_scst.c
-+++ linux-2.6.39/drivers/scst/fcst/ft_scst.c
+diff -uprN orig/linux-3.2/drivers/scst/fcst/ft_scst.c linux-3.2/drivers/scst/fcst/ft_scst.c
+--- orig/linux-3.2/drivers/scst/fcst/ft_scst.c
++++ linux-3.2/drivers/scst/fcst/ft_scst.c
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2010 Cisco Systems, Inc.
@@ -53188,10 +53115,10 @@ diff -uprN orig/linux-2.6.39/drivers/scst/fcst/ft_scst.c linux-2.6.39/drivers/sc
+ synchronize_rcu();
+}
+module_exit(ft_module_exit);
-diff -uprN orig/linux-2.6.39/drivers/scst/fcst/ft_sess.c linux-2.6.39/drivers/scst/fcst/ft_sess.c
---- orig/linux-2.6.39/drivers/scst/fcst/ft_sess.c
-+++ linux-2.6.39/drivers/scst/fcst/ft_sess.c
-@@ -0,0 +1,576 @@
+diff -uprN orig/linux-3.2/drivers/scst/fcst/ft_sess.c linux-3.2/drivers/scst/fcst/ft_sess.c
+--- orig/linux-3.2/drivers/scst/fcst/ft_sess.c
++++ linux-3.2/drivers/scst/fcst/ft_sess.c
+@@ -0,0 +1,585 @@
+/*
+ * Copyright (c) 2010 Cisco Systems, Inc.
+ *
@@ -53538,6 +53465,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/fcst/ft_sess.c linux-2.6.39/drivers/sc
+ u32 fcp_parm;
+ int ret;
+
++ if (!rspp)
++ goto fill;
++
+ if (rspp->spp_flags & (FC_SPP_OPA_VAL | FC_SPP_RPA_VAL))
+ return FC_SPP_RESP_NO_PA;
+
@@ -53558,9 +53488,16 @@ diff -uprN orig/linux-2.6.39/drivers/scst/fcst/ft_sess.c linux-2.6.39/drivers/sc
+ if (!(fcp_parm & FCP_SPPF_INIT_FCN))
+ return FC_SPP_RESP_CONF;
+ tport = rcu_dereference(rdata->local_port->prov[FC_TYPE_FCP]);
-+ if (!tport || !tport->enabled)
-+ return 0; /* not a target for this local port */
-+
++ if (!tport) {
++ /* not a target for this local port */
++ return FC_SPP_RESP_CONF;
++ }
++ if (!tport->enabled) {
++ pr_err("Refused login from %#x because target port %s"
++ " not yet enabled", rdata->ids.port_id,
++ tport->tgt->tgt_name);
++ return FC_SPP_RESP_CONF;
++ }
+ ret = ft_sess_create(tport, rdata, fcp_parm);
+ if (ret)
+ return ret;
@@ -53571,6 +53508,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/fcst/ft_sess.c linux-2.6.39/drivers/sc
+ * If the initiator indicates RETRY, we must support that, too.
+ * Don't force RETRY on the initiator, though.
+ */
++fill:
+ fcp_parm = ntohl(spp->spp_params); /* response parameters */
+ spp->spp_params = htonl(fcp_parm | FCP_SPPF_TARG_FCN);
+ return FC_SPP_RESP_ACK;
@@ -53594,10 +53532,8 @@ diff -uprN orig/linux-2.6.39/drivers/scst/fcst/ft_sess.c linux-2.6.39/drivers/sc
+ mutex_lock(&ft_lport_lock);
+ ret = ft_prli_locked(rdata, spp_len, rspp, spp);
+ mutex_unlock(&ft_lport_lock);
-+ FT_SESS_DBG("port_id %x flags %x parms %x ret %x\n",
-+ rdata->ids.port_id,
-+ rspp->spp_flags,
-+ ntohl(spp->spp_params), ret);
++ FT_SESS_DBG("port_id %x flags %x parms %x ret %x\n", rdata->ids.port_id,
++ rspp ? rspp->spp_flags : 0, ntohl(spp->spp_params), ret);
+ return ret;
+}
+
@@ -53768,9 +53704,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/fcst/ft_sess.c linux-2.6.39/drivers/sc
+ aen->event_fn, sess->port_id, scst_aen_get_lun(aen));
+ return SCST_AEN_RES_FAILED; /* XXX TBD */
+}
-diff -uprN orig/linux-2.6.39/Documentation/scst/README.fcst linux-2.6.39/Documentation/scst/README.fcst
---- orig/linux-2.6.39/Documentation/scst/README.fcst
-+++ linux-2.6.39/Documentation/scst/README.fcst
+diff -uprN orig/linux-3.2/Documentation/scst/README.fcst linux-3.2/Documentation/scst/README.fcst
+--- orig/linux-3.2/Documentation/scst/README.fcst
++++ linux-3.2/Documentation/scst/README.fcst
@@ -0,0 +1,114 @@
+About fcst
+==========
@@ -53886,9 +53822,9 @@ diff -uprN orig/linux-2.6.39/Documentation/scst/README.fcst linux-2.6.39/Documen
+14. As a temporary workaround, you may need to reset the interface
+ on the initiator side so it sees the SCST device as a target and
+ discovers LUNs. You can avoid this by bringing up the initiator last.
-diff -uprN orig/linux-2.6.39/include/scst/iscsi_scst.h linux-2.6.39/include/scst/iscsi_scst.h
---- orig/linux-2.6.39/include/scst/iscsi_scst.h
-+++ linux-2.6.39/include/scst/iscsi_scst.h
+diff -uprN orig/linux-3.2/include/scst/iscsi_scst.h linux-3.2/include/scst/iscsi_scst.h
+--- orig/linux-3.2/include/scst/iscsi_scst.h
++++ linux-3.2/include/scst/iscsi_scst.h
@@ -0,0 +1,226 @@
+/*
+ * Copyright (C) 2007 - 2011 Vladislav Bolkhovitin
@@ -54116,9 +54052,9 @@ diff -uprN orig/linux-2.6.39/include/scst/iscsi_scst.h linux-2.6.39/include/scst
+}
+
+#endif
-diff -uprN orig/linux-2.6.39/include/scst/iscsi_scst_ver.h linux-2.6.39/include/scst/iscsi_scst_ver.h
---- orig/linux-2.6.39/include/scst/iscsi_scst_ver.h
-+++ linux-2.6.39/include/scst/iscsi_scst_ver.h
+diff -uprN orig/linux-3.2/include/scst/iscsi_scst_ver.h linux-3.2/include/scst/iscsi_scst_ver.h
+--- orig/linux-3.2/include/scst/iscsi_scst_ver.h
++++ linux-3.2/include/scst/iscsi_scst_ver.h
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) 2007 - 2011 Vladislav Bolkhovitin
@@ -54139,25 +54075,25 @@ diff -uprN orig/linux-2.6.39/include/scst/iscsi_scst_ver.h linux-2.6.39/include/
+
+#define ISCSI_VERSION_STRING_SUFFIX
+
-+#define ISCSI_VERSION_STRING "2.1.0" ISCSI_VERSION_STRING_SUFFIX
-diff -uprN orig/linux-2.6.39/include/scst/iscsi_scst_itf_ver.h linux-2.6.39/include/scst/iscsi_scst_itf_ver.h
---- orig/linux-2.6.39/include/scst/iscsi_scst_itf_ver.h
-+++ linux-2.6.39/include/scst/iscsi_scst_itf_ver.h
++#define ISCSI_VERSION_STRING "2.2.0-pre" ISCSI_VERSION_STRING_SUFFIX
+diff -uprN orig/linux-3.2/include/scst/iscsi_scst_itf_ver.h linux-3.2/include/scst/iscsi_scst_itf_ver.h
+--- orig/linux-3.2/include/scst/iscsi_scst_itf_ver.h
++++ linux-3.2/include/scst/iscsi_scst_itf_ver.h
@@ -0,0 +1,3 @@
+/* Autogenerated, don't edit */
+
+#define ISCSI_SCST_INTERFACE_VERSION ISCSI_VERSION_STRING "_" "6e5293bf78ac2fa099a12c932a10afb091dc7731"
-diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/Makefile linux-2.6.39/drivers/scst/iscsi-scst/Makefile
---- orig/linux-2.6.39/drivers/scst/iscsi-scst/Makefile
-+++ linux-2.6.39/drivers/scst/iscsi-scst/Makefile
+diff -uprN orig/linux-3.2/drivers/scst/iscsi-scst/Makefile linux-3.2/drivers/scst/iscsi-scst/Makefile
+--- orig/linux-3.2/drivers/scst/iscsi-scst/Makefile
++++ linux-3.2/drivers/scst/iscsi-scst/Makefile
@@ -0,0 +1,4 @@
+iscsi-scst-y := iscsi.o nthread.o config.o digest.o \
+ conn.o session.o target.o event.o param.o
+
+obj-$(CONFIG_SCST_ISCSI) += iscsi-scst.o
-diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/Kconfig linux-2.6.39/drivers/scst/iscsi-scst/Kconfig
---- orig/linux-2.6.39/drivers/scst/iscsi-scst/Kconfig
-+++ linux-2.6.39/drivers/scst/iscsi-scst/Kconfig
+diff -uprN orig/linux-3.2/drivers/scst/iscsi-scst/Kconfig linux-3.2/drivers/scst/iscsi-scst/Kconfig
+--- orig/linux-3.2/drivers/scst/iscsi-scst/Kconfig
++++ linux-3.2/drivers/scst/iscsi-scst/Kconfig
@@ -0,0 +1,25 @@
+config SCST_ISCSI
+ tristate "ISCSI Target"
@@ -54184,10 +54120,10 @@ diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/Kconfig linux-2.6.39/driver
+ iSCSI initiator that is talking to SCST.
+
+ If unsure, say "N".
-diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/config.c linux-2.6.39/drivers/scst/iscsi-scst/config.c
---- orig/linux-2.6.39/drivers/scst/iscsi-scst/config.c
-+++ linux-2.6.39/drivers/scst/iscsi-scst/config.c
-@@ -0,0 +1,1033 @@
+diff -uprN orig/linux-3.2/drivers/scst/iscsi-scst/config.c linux-3.2/drivers/scst/iscsi-scst/config.c
+--- orig/linux-3.2/drivers/scst/iscsi-scst/config.c
++++ linux-3.2/drivers/scst/iscsi-scst/config.c
+@@ -0,0 +1,1034 @@
+/*
+ * Copyright (C) 2004 - 2005 FUJITA Tomonori <tomof@acm.org>
+ * Copyright (C) 2007 - 2011 Vladislav Bolkhovitin
@@ -54204,6 +54140,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/config.c linux-2.6.39/drive
+ * GNU General Public License for more details.
+ */
+
++#include <linux/module.h>
+#include "iscsi.h"
+
+/* Protected by target_mgmt_mutex */
@@ -55221,9 +55158,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/config.c linux-2.6.39/drive
+}
+
+#endif /* CONFIG_SCST_DEBUG */
-diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/conn.c linux-2.6.39/drivers/scst/iscsi-scst/conn.c
---- orig/linux-2.6.39/drivers/scst/iscsi-scst/conn.c
-+++ linux-2.6.39/drivers/scst/iscsi-scst/conn.c
+diff -uprN orig/linux-3.2/drivers/scst/iscsi-scst/conn.c linux-3.2/drivers/scst/iscsi-scst/conn.c
+--- orig/linux-3.2/drivers/scst/iscsi-scst/conn.c
++++ linux-3.2/drivers/scst/iscsi-scst/conn.c
@@ -0,0 +1,945 @@
+/*
+ * Copyright (C) 2002 - 2003 Ardis Technolgies <roman@ardistech.com>
@@ -56170,9 +56107,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/conn.c linux-2.6.39/drivers
+}
+
+#endif /* CONFIG_SCST_EXTRACHECKS */
-diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/digest.c linux-2.6.39/drivers/scst/iscsi-scst/digest.c
---- orig/linux-2.6.39/drivers/scst/iscsi-scst/digest.c
-+++ linux-2.6.39/drivers/scst/iscsi-scst/digest.c
+diff -uprN orig/linux-3.2/drivers/scst/iscsi-scst/digest.c linux-3.2/drivers/scst/iscsi-scst/digest.c
+--- orig/linux-3.2/drivers/scst/iscsi-scst/digest.c
++++ linux-3.2/drivers/scst/iscsi-scst/digest.c
@@ -0,0 +1,245 @@
+/*
+ * iSCSI digest handling.
@@ -56419,9 +56356,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/digest.c linux-2.6.39/drive
+ TRACE_DBG("TX data digest for cmd %p: %x (offset %d, opcode %x)", cmnd,
+ cmnd->ddigest, offset, cmnd_opcode(cmnd));
+}
-diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/digest.h linux-2.6.39/drivers/scst/iscsi-scst/digest.h
---- orig/linux-2.6.39/drivers/scst/iscsi-scst/digest.h
-+++ linux-2.6.39/drivers/scst/iscsi-scst/digest.h
+diff -uprN orig/linux-3.2/drivers/scst/iscsi-scst/digest.h linux-3.2/drivers/scst/iscsi-scst/digest.h
+--- orig/linux-3.2/drivers/scst/iscsi-scst/digest.h
++++ linux-3.2/drivers/scst/iscsi-scst/digest.h
@@ -0,0 +1,32 @@
+/*
+ * iSCSI digest handling.
@@ -56455,10 +56392,10 @@ diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/digest.h linux-2.6.39/drive
+extern void digest_tx_data(struct iscsi_cmnd *cmnd);
+
+#endif /* __ISCSI_DIGEST_H__ */
-diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/event.c linux-2.6.39/drivers/scst/iscsi-scst/event.c
---- orig/linux-2.6.39/drivers/scst/iscsi-scst/event.c
-+++ linux-2.6.39/drivers/scst/iscsi-scst/event.c
-@@ -0,0 +1,162 @@
+diff -uprN orig/linux-3.2/drivers/scst/iscsi-scst/event.c linux-3.2/drivers/scst/iscsi-scst/event.c
+--- orig/linux-3.2/drivers/scst/iscsi-scst/event.c
++++ linux-3.2/drivers/scst/iscsi-scst/event.c
+@@ -0,0 +1,163 @@
+/*
+ * Event notification code.
+ *
@@ -56478,6 +56415,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/event.c linux-2.6.39/driver
+ *
+ */
+
++#include <linux/module.h>
+#include <net/tcp.h>
+#include <scst/iscsi_scst.h>
+#include "iscsi.h"
@@ -56489,7 +56427,8 @@ diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/event.c linux-2.6.39/driver
+{
+ u32 pid;
+
-+ pid = NETLINK_CREDS(skb)->pid;
++ pid = NETLINK_CB(skb).pid;
++ WARN_ON(pid == 0);
+
+ iscsid_pid = pid;
+
@@ -56536,15 +56475,14 @@ diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/event.c linux-2.6.39/driver
+
+ len = NLMSG_SPACE(buf_len);
+
-+ skb = alloc_skb(NLMSG_SPACE(len), GFP_KERNEL);
++ skb = alloc_skb(len, GFP_KERNEL);
+ if (skb == NULL) {
+ PRINT_ERROR("alloc_skb() failed (len %d)", len);
+ res = -ENOMEM;
+ goto out;
+ }
+
-+ nlh = __nlmsg_put(skb, iscsid_pid, seq++, NLMSG_DONE,
-+ len - sizeof(*nlh), 0);
++ nlh = __nlmsg_put(skb, iscsid_pid, seq++, NLMSG_DONE, buf_len, 0);
+
+ memcpy(NLMSG_DATA(nlh), buf, buf_len);
+ res = netlink_unicast(nl, skb, iscsid_pid, 0);
@@ -56621,9 +56559,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/event.c linux-2.6.39/driver
+{
+ netlink_kernel_release(nl);
+}
-diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/iscsi.c linux-2.6.39/drivers/scst/iscsi-scst/iscsi.c
---- orig/linux-2.6.39/drivers/scst/iscsi-scst/iscsi.c
-+++ linux-2.6.39/drivers/scst/iscsi-scst/iscsi.c
+diff -uprN orig/linux-3.2/drivers/scst/iscsi-scst/iscsi.c linux-3.2/drivers/scst/iscsi-scst/iscsi.c
+--- orig/linux-3.2/drivers/scst/iscsi-scst/iscsi.c
++++ linux-3.2/drivers/scst/iscsi-scst/iscsi.c
@@ -0,0 +1,4137 @@
+/*
+ * Copyright (C) 2002 - 2003 Ardis Technolgies <roman@ardistech.com>
@@ -56657,10 +56595,10 @@ diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/iscsi.c linux-2.6.39/driver
+
+#ifndef GENERATING_UPSTREAM_PATCH
+#if !defined(CONFIG_TCP_ZERO_COPY_TRANSFER_COMPLETION_NOTIFICATION)
-+#warning "Patch put_page_callback-<kernel-version>.patch not applied on your\
-+ kernel or CONFIG_TCP_ZERO_COPY_TRANSFER_COMPLETION_NOTIFICATION\
-+ config option not set. ISCSI-SCST will be working with not the best\
-+ performance. Refer README file for details."
++#warning Patch put_page_callback-<kernel-version>.patch not applied on your \
++kernel or CONFIG_TCP_ZERO_COPY_TRANSFER_COMPLETION_NOTIFICATION \
++config option not set. ISCSI-SCST will be working with not the best \
++performance. Refer README file for details.
+#endif
+#endif
+
@@ -60762,10 +60700,10 @@ diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/iscsi.c linux-2.6.39/driver
+MODULE_VERSION(ISCSI_VERSION_STRING);
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("SCST iSCSI Target");
-diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/iscsi.h linux-2.6.39/drivers/scst/iscsi-scst/iscsi.h
---- orig/linux-2.6.39/drivers/scst/iscsi-scst/iscsi.h
-+++ linux-2.6.39/drivers/scst/iscsi-scst/iscsi.h
-@@ -0,0 +1,788 @@
+diff -uprN orig/linux-3.2/drivers/scst/iscsi-scst/iscsi.h linux-3.2/drivers/scst/iscsi-scst/iscsi.h
+--- orig/linux-3.2/drivers/scst/iscsi-scst/iscsi.h
++++ linux-3.2/drivers/scst/iscsi-scst/iscsi.h
+@@ -0,0 +1,789 @@
+/*
+ * Copyright (C) 2002 - 2003 Ardis Technolgies <roman@ardistech.com>
+ * Copyright (C) 2007 - 2011 Vladislav Bolkhovitin
@@ -60789,6 +60727,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/iscsi.h linux-2.6.39/driver
+#include <linux/pagemap.h>
+#include <linux/mm.h>
+#include <linux/net.h>
++#include <linux/module.h>
+#include <net/sock.h>
+
+#include <scst/scst.h>
@@ -61554,9 +61493,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/iscsi.h linux-2.6.39/driver
+#endif
+
+#endif /* __ISCSI_H__ */
-diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/iscsi_dbg.h linux-2.6.39/drivers/scst/iscsi-scst/iscsi_dbg.h
---- orig/linux-2.6.39/drivers/scst/iscsi-scst/iscsi_dbg.h
-+++ linux-2.6.39/drivers/scst/iscsi-scst/iscsi_dbg.h
+diff -uprN orig/linux-3.2/drivers/scst/iscsi-scst/iscsi_dbg.h linux-3.2/drivers/scst/iscsi-scst/iscsi_dbg.h
+--- orig/linux-3.2/drivers/scst/iscsi-scst/iscsi_dbg.h
++++ linux-3.2/drivers/scst/iscsi-scst/iscsi_dbg.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2007 - 2011 Vladislav Bolkhovitin
@@ -61619,9 +61558,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/iscsi_dbg.h linux-2.6.39/dr
+#define TRACE_WRITE(args...) TRACE_DBG_FLAG(TRACE_DEBUG|TRACE_D_WRITE, args)
+
+#endif
-diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/iscsi_hdr.h linux-2.6.39/drivers/scst/iscsi-scst/iscsi_hdr.h
---- orig/linux-2.6.39/drivers/scst/iscsi-scst/iscsi_hdr.h
-+++ linux-2.6.39/drivers/scst/iscsi-scst/iscsi_hdr.h
+diff -uprN orig/linux-3.2/drivers/scst/iscsi-scst/iscsi_hdr.h linux-3.2/drivers/scst/iscsi-scst/iscsi_hdr.h
+--- orig/linux-3.2/drivers/scst/iscsi-scst/iscsi_hdr.h
++++ linux-3.2/drivers/scst/iscsi-scst/iscsi_hdr.h
@@ -0,0 +1,526 @@
+/*
+ * Copyright (C) 2002 - 2003 Ardis Technolgies <roman@ardistech.com>
@@ -62149,9 +62088,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/iscsi_hdr.h linux-2.6.39/dr
+#define cmnd_scsicode(cmnd) (cmnd_hdr((cmnd))->scb[0])
+
+#endif /* __ISCSI_HDR_H__ */
-diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/nthread.c linux-2.6.39/drivers/scst/iscsi-scst/nthread.c
---- orig/linux-2.6.39/drivers/scst/iscsi-scst/nthread.c
-+++ linux-2.6.39/drivers/scst/iscsi-scst/nthread.c
+diff -uprN orig/linux-3.2/drivers/scst/iscsi-scst/nthread.c linux-3.2/drivers/scst/iscsi-scst/nthread.c
+--- orig/linux-3.2/drivers/scst/iscsi-scst/nthread.c
++++ linux-3.2/drivers/scst/iscsi-scst/nthread.c
@@ -0,0 +1,1891 @@
+/*
+ * Network threads.
@@ -64044,9 +63983,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/nthread.c linux-2.6.39/driv
+ TRACE_EXIT();
+ return 0;
+}
-diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/param.c linux-2.6.39/drivers/scst/iscsi-scst/param.c
---- orig/linux-2.6.39/drivers/scst/iscsi-scst/param.c
-+++ linux-2.6.39/drivers/scst/iscsi-scst/param.c
+diff -uprN orig/linux-3.2/drivers/scst/iscsi-scst/param.c linux-3.2/drivers/scst/iscsi-scst/param.c
+--- orig/linux-3.2/drivers/scst/iscsi-scst/param.c
++++ linux-3.2/drivers/scst/iscsi-scst/param.c
@@ -0,0 +1,342 @@
+/*
+ * Copyright (C) 2005 FUJITA Tomonori <tomof@acm.org>
@@ -64390,10 +64329,10 @@ diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/param.c linux-2.6.39/driver
+out:
+ return err;
+}
-diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/session.c linux-2.6.39/drivers/scst/iscsi-scst/session.c
---- orig/linux-2.6.39/drivers/scst/iscsi-scst/session.c
-+++ linux-2.6.39/drivers/scst/iscsi-scst/session.c
-@@ -0,0 +1,525 @@
+diff -uprN orig/linux-3.2/drivers/scst/iscsi-scst/session.c linux-3.2/drivers/scst/iscsi-scst/session.c
+--- orig/linux-3.2/drivers/scst/iscsi-scst/session.c
++++ linux-3.2/drivers/scst/iscsi-scst/session.c
+@@ -0,0 +1,527 @@
+/*
+ * Copyright (C) 2002 - 2003 Ardis Technolgies <roman@ardistech.com>
+ * Copyright (C) 2007 - 2011 Vladislav Bolkhovitin
@@ -64413,6 +64352,8 @@ diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/session.c linux-2.6.39/driv
+
+#include "iscsi.h"
+
++#include <linux/export.h>
++
+/* target_mutex supposed to be locked */
+struct iscsi_session *session_lookup(struct iscsi_target *target, u64 sid)
+{
@@ -64919,10 +64860,10 @@ diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/session.c linux-2.6.39/driv
+ NULL,
+};
+
-diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/target.c linux-2.6.39/drivers/scst/iscsi-scst/target.c
---- orig/linux-2.6.39/drivers/scst/iscsi-scst/target.c
-+++ linux-2.6.39/drivers/scst/iscsi-scst/target.c
-@@ -0,0 +1,532 @@
+diff -uprN orig/linux-3.2/drivers/scst/iscsi-scst/target.c linux-3.2/drivers/scst/iscsi-scst/target.c
+--- orig/linux-3.2/drivers/scst/iscsi-scst/target.c
++++ linux-3.2/drivers/scst/iscsi-scst/target.c
+@@ -0,0 +1,533 @@
+/*
+ * Copyright (C) 2002 - 2003 Ardis Technolgies <roman@ardistech.com>
+ * Copyright (C) 2007 - 2011 Vladislav Bolkhovitin
@@ -64941,6 +64882,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/target.c linux-2.6.39/drive
+ */
+
+#include <linux/delay.h>
++#include <linux/module.h>
+
+#include "iscsi.h"
+#include "digest.h"
@@ -65455,9 +65397,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/iscsi-scst/target.c linux-2.6.39/drive
+ return res;
+}
+
-diff -uprN orig/linux-2.6.39/Documentation/scst/README.iscsi linux-2.6.39/Documentation/scst/README.iscsi
---- orig/linux-2.6.39/Documentation/scst/README.iscsi
-+++ linux-2.6.39/Documentation/scst/README.iscsi
+diff -uprN orig/linux-3.2/Documentation/scst/README.iscsi linux-3.2/Documentation/scst/README.iscsi
+--- orig/linux-3.2/Documentation/scst/README.iscsi
++++ linux-3.2/Documentation/scst/README.iscsi
@@ -0,0 +1,748 @@
+iSCSI SCST target driver
+========================
@@ -66207,9 +66149,9 @@ diff -uprN orig/linux-2.6.39/Documentation/scst/README.iscsi linux-2.6.39/Docume
+
+Vladislav Bolkhovitin <vst@vlnb.net>, http://scst.sourceforge.net
+
-diff -uprN orig/linux-2.6.39/drivers/scsi/qla2xxx/qla2x_tgt.h linux-2.6.39/drivers/scsi/qla2xxx/qla2x_tgt.h
---- orig/linux-2.6.39/drivers/scsi/qla2xxx/qla2x_tgt.h
-+++ linux-2.6.39/drivers/scsi/qla2xxx/qla2x_tgt.h
+diff -uprN orig/linux-3.2/drivers/scsi/qla2xxx/qla2x_tgt.h linux-3.2/drivers/scsi/qla2xxx/qla2x_tgt.h
+--- orig/linux-3.2/drivers/scsi/qla2xxx/qla2x_tgt.h
++++ linux-3.2/drivers/scsi/qla2xxx/qla2x_tgt.h
@@ -0,0 +1,137 @@
+/*
+ * qla2x_tgt.h
@@ -66348,10 +66290,10 @@ diff -uprN orig/linux-2.6.39/drivers/scsi/qla2xxx/qla2x_tgt.h linux-2.6.39/drive
+#endif /* CONFIG_SCSI_QLA2XXX_TARGET */
+
+#endif /* __QLA2X_TGT_H */
-diff -uprN orig/linux-2.6.39/drivers/scsi/qla2xxx/qla2x_tgt_def.h linux-2.6.39/drivers/scsi/qla2xxx/qla2x_tgt_def.h
---- orig/linux-2.6.39/drivers/scsi/qla2xxx/qla2x_tgt_def.h
-+++ linux-2.6.39/drivers/scsi/qla2xxx/qla2x_tgt_def.h
-@@ -0,0 +1,737 @@
+diff -uprN orig/linux-3.2/drivers/scsi/qla2xxx/qla2x_tgt_def.h linux-3.2/drivers/scsi/qla2xxx/qla2x_tgt_def.h
+--- orig/linux-3.2/drivers/scsi/qla2xxx/qla2x_tgt_def.h
++++ linux-3.2/drivers/scsi/qla2xxx/qla2x_tgt_def.h
+@@ -0,0 +1,771 @@
+/*
+ * qla2x_tgt_def.h
+ *
@@ -66458,20 +66400,23 @@ diff -uprN orig/linux-2.6.39/drivers/scsi/qla2xxx/qla2x_tgt_def.h linux-2.6.39/d
+#ifndef DATASEGS_PER_COMMAND32
+#define DATASEGS_PER_COMMAND32 3
+#define DATASEGS_PER_CONT32 7
-+#define QLA_MAX_SG32(ql) \
-+ (((ql) > 0) ? (DATASEGS_PER_COMMAND32 + DATASEGS_PER_CONT32*((ql) - 1)) : 0)
++#define QLA_MAX_SG32(ql) \
++ (((ql) > 0) ? \
++ (DATASEGS_PER_COMMAND32 + DATASEGS_PER_CONT32 * ((ql) - 1)) : 0)
+
+#define DATASEGS_PER_COMMAND64 2
+#define DATASEGS_PER_CONT64 5
-+#define QLA_MAX_SG64(ql) \
-+ (((ql) > 0) ? (DATASEGS_PER_COMMAND64 + DATASEGS_PER_CONT64*((ql) - 1)) : 0)
++#define QLA_MAX_SG64(ql) \
++ (((ql) > 0) ? \
++ (DATASEGS_PER_COMMAND64 + DATASEGS_PER_CONT64 * ((ql) - 1)) : 0)
+#endif
+
+#ifndef DATASEGS_PER_COMMAND_24XX
+#define DATASEGS_PER_COMMAND_24XX 1
+#define DATASEGS_PER_CONT_24XX 5
-+#define QLA_MAX_SG_24XX(ql) \
-+ (min(1270, ((ql) > 0) ? (DATASEGS_PER_COMMAND_24XX + DATASEGS_PER_CONT_24XX*((ql) - 1)) : 0))
++#define QLA_MAX_SG_24XX(ql) \
++ (min(1270, ((ql) > 0) ? \
++ (DATASEGS_PER_COMMAND_24XX + DATASEGS_PER_CONT_24XX * ((ql) - 1)) : 0))
+#endif
+
+/********************************************************************\
@@ -66771,17 +66716,28 @@ diff -uprN orig/linux-2.6.39/drivers/scsi/qla2xxx/qla2x_tgt_def.h linux-2.6.39/d
+typedef struct {
+ uint64_t lun;
+ uint8_t cmnd_ref;
++#ifdef __LITTLE_ENDIAN
+ uint8_t task_attr:3;
+ uint8_t reserved:5;
++#else
++ uint8_t reserved:5;
++ uint8_t task_attr:3;
++#endif
+ uint8_t task_mgmt_flags;
+#define FCP_CMND_TASK_MGMT_CLEAR_ACA 6
+#define FCP_CMND_TASK_MGMT_TARGET_RESET 5
+#define FCP_CMND_TASK_MGMT_LU_RESET 4
+#define FCP_CMND_TASK_MGMT_CLEAR_TASK_SET 2
+#define FCP_CMND_TASK_MGMT_ABORT_TASK_SET 1
++#ifdef __LITTLE_ENDIAN
+ uint8_t wrdata:1;
+ uint8_t rddata:1;
+ uint8_t add_cdb_len:6;
++#else
++ uint8_t add_cdb_len:6;
++ uint8_t rddata:1;
++ uint8_t wrdata:1;
++#endif
+ uint8_t cdb[16];
+ /*
+ * add_cdb is optional and can absent from fcp_cmnd_t. Size 4 only to
@@ -66800,8 +66756,13 @@ diff -uprN orig/linux-2.6.39/drivers/scsi/qla2xxx/qla2x_tgt_def.h linux-2.6.39/d
+ uint8_t entry_type; /* Entry type. */
+ uint8_t entry_count; /* Entry count. */
+ uint8_t fcp_cmnd_len_low;
++#ifdef __LITTLE_ENDIAN
+ uint8_t fcp_cmnd_len_high:4;
+ uint8_t attr:4;
++#else
++ uint8_t attr:4;
++ uint8_t fcp_cmnd_len_high:4;
++#endif
+ uint32_t exchange_addr;
+#define ATIO_EXCHANGE_ADDRESS_UNKNOWN 0xFFFFFFFF
+ fcp_hdr_t fcp_hdr;
@@ -66977,8 +66938,13 @@ diff -uprN orig/linux-2.6.39/drivers/scsi/qla2xxx/qla2x_tgt_def.h linux-2.6.39/d
+ uint16_t nport_handle;
+ uint8_t reserved_2[2];
+ uint8_t vp_index;
++#ifdef __LITTLE_ENDIAN
+ uint8_t reserved_3:4;
+ uint8_t sof_type:4;
++#else
++ uint8_t sof_type:4;
++ uint8_t reserved_3:4;
++#endif
+ uint32_t exchange_address;
+ fcp_hdr_le_t fcp_hdr_le;
+ uint8_t reserved_4[16];
@@ -67019,8 +66985,13 @@ diff -uprN orig/linux-2.6.39/drivers/scsi/qla2xxx/qla2x_tgt_def.h linux-2.6.39/d
+ uint16_t control_flags;
+#define ABTS_CONTR_FLG_TERM_EXCHG BIT_0
+ uint8_t vp_index;
++#ifdef __LITTLE_ENDIAN
+ uint8_t reserved_3:4;
+ uint8_t sof_type:4;
++#else
++ uint8_t sof_type:4;
++ uint8_t reserved_3:4;
++#endif
+ uint32_t exchange_address;
+ fcp_hdr_le_t fcp_hdr_le;
+ union {
@@ -67043,8 +67014,13 @@ diff -uprN orig/linux-2.6.39/drivers/scsi/qla2xxx/qla2x_tgt_def.h linux-2.6.39/d
+ uint16_t nport_handle;
+ uint16_t reserved_1;
+ uint8_t reserved_2;
++#ifdef __LITTLE_ENDIAN
+ uint8_t reserved_3:4;
+ uint8_t sof_type:4;
++#else
++ uint8_t sof_type:4;
++ uint8_t reserved_3:4;
++#endif
+ uint32_t exchange_address;
+ fcp_hdr_le_t fcp_hdr_le;
+ uint8_t reserved_4[8];
@@ -67089,18 +67065,18 @@ diff -uprN orig/linux-2.6.39/drivers/scsi/qla2xxx/qla2x_tgt_def.h linux-2.6.39/d
+int qla2x00_wait_for_hba_online(scsi_qla_host_t *ha);
+
+#endif /* __QLA2X_TGT_DEF_H */
-diff -uprN orig/linux-2.6.39/drivers/scst/qla2xxx-target/Makefile linux-2.6.39/drivers/scst/qla2xxx-target/Makefile
---- orig/linux-2.6.39/drivers/scst/qla2xxx-target/Makefile
-+++ linux-2.6.39/drivers/scst/qla2xxx-target/Makefile
+diff -uprN orig/linux-3.2/drivers/scst/qla2xxx-target/Makefile linux-3.2/drivers/scst/qla2xxx-target/Makefile
+--- orig/linux-3.2/drivers/scst/qla2xxx-target/Makefile
++++ linux-3.2/drivers/scst/qla2xxx-target/Makefile
@@ -0,0 +1,5 @@
+ccflags-y += -Idrivers/scsi/qla2xxx
+
+qla2x00tgt-y := qla2x00t.o
+
+obj-$(CONFIG_SCST_QLA_TGT_ADDON) += qla2x00tgt.o
-diff -uprN orig/linux-2.6.39/drivers/scst/qla2xxx-target/Kconfig linux-2.6.39/drivers/scst/qla2xxx-target/Kconfig
---- orig/linux-2.6.39/drivers/scst/qla2xxx-target/Kconfig
-+++ linux-2.6.39/drivers/scst/qla2xxx-target/Kconfig
+diff -uprN orig/linux-3.2/drivers/scst/qla2xxx-target/Kconfig linux-3.2/drivers/scst/qla2xxx-target/Kconfig
+--- orig/linux-3.2/drivers/scst/qla2xxx-target/Kconfig
++++ linux-3.2/drivers/scst/qla2xxx-target/Kconfig
@@ -0,0 +1,30 @@
+config SCST_QLA_TGT_ADDON
+ tristate "QLogic 2XXX Target Mode Add-On"
@@ -67132,9 +67108,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/qla2xxx-target/Kconfig linux-2.6.39/dr
+ performance loss.
+
+ If unsure, say "N".
-diff -uprN orig/linux-2.6.39/drivers/scst/qla2xxx-target/qla2x00t.c linux-2.6.39/drivers/scst/qla2xxx-target/qla2x00t.c
---- orig/linux-2.6.39/drivers/scst/qla2xxx-target/qla2x00t.c
-+++ linux-2.6.39/drivers/scst/qla2xxx-target/qla2x00t.c
+diff -uprN orig/linux-3.2/drivers/scst/qla2xxx-target/qla2x00t.c linux-3.2/drivers/scst/qla2xxx-target/qla2x00t.c
+--- orig/linux-3.2/drivers/scst/qla2xxx-target/qla2x00t.c
++++ linux-3.2/drivers/scst/qla2xxx-target/qla2x00t.c
@@ -0,0 +1,6448 @@
+/*
+ * qla2x00t.c
@@ -69329,7 +69305,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/qla2xxx-target/qla2x00t.c linux-2.6.39
+ ha->cmds[h-1] = prm->cmd;
+
+ pkt->common.handle = h | CTIO_COMPLETION_HANDLE_MARK;
-+ pkt->common.nport_handle = prm->cmd->loop_id;
++ pkt->common.nport_handle = cpu_to_le16(prm->cmd->loop_id);
+ pkt->common.timeout = __constant_cpu_to_le16(Q2T_TIMEOUT);
+ pkt->common.initiator_id[0] = atio->fcp_hdr.s_id[2];
+ pkt->common.initiator_id[1] = atio->fcp_hdr.s_id[1];
@@ -73584,9 +73560,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/qla2xxx-target/qla2x00t.c linux-2.6.39
+MODULE_DESCRIPTION("Target mode addon for qla2[2,3,4,5+]xx");
+MODULE_LICENSE("GPL");
+MODULE_VERSION(Q2T_VERSION_STRING);
-diff -uprN orig/linux-2.6.39/drivers/scst/qla2xxx-target/qla2x00t.h linux-2.6.39/drivers/scst/qla2xxx-target/qla2x00t.h
---- orig/linux-2.6.39/drivers/scst/qla2xxx-target/qla2x00t.h
-+++ linux-2.6.39/drivers/scst/qla2xxx-target/qla2x00t.h
+diff -uprN orig/linux-3.2/drivers/scst/qla2xxx-target/qla2x00t.h linux-3.2/drivers/scst/qla2xxx-target/qla2x00t.h
+--- orig/linux-3.2/drivers/scst/qla2xxx-target/qla2x00t.h
++++ linux-3.2/drivers/scst/qla2xxx-target/qla2x00t.h
@@ -0,0 +1,287 @@
+/*
+ * qla2x00t.h
@@ -73621,8 +73597,8 @@ diff -uprN orig/linux-2.6.39/drivers/scst/qla2xxx-target/qla2x00t.h linux-2.6.39
+
+/* Version numbers, the same as for the kernel */
+#define Q2T_VERSION(a, b, c, d) (((a) << 030) + ((b) << 020) + (c) << 010 + (d))
-+#define Q2T_VERSION_CODE Q2T_VERSION(2, 1, 0, 0)
-+#define Q2T_VERSION_STRING "2.1.0"
++#define Q2T_VERSION_CODE Q2T_VERSION(2, 2, 0, 0)
++#define Q2T_VERSION_STRING "2.2.0-pre"
+#define Q2T_PROC_VERSION_NAME "version"
+
+#define Q2T_MAX_CDB_LEN 16
@@ -73875,9 +73851,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/qla2xxx-target/qla2x00t.h linux-2.6.39
+#define Q2T_XMIT_ALL (Q2T_XMIT_STATUS|Q2T_XMIT_DATA)
+
+#endif /* __QLA2X00T_H */
-diff -uprN orig/linux-2.6.39/Documentation/scst/README.qla2x00t linux-2.6.39/Documentation/scst/README.qla2x00t
---- orig/linux-2.6.39/Documentation/scst/README.qla2x00t
-+++ linux-2.6.39/Documentation/scst/README.qla2x00t
+diff -uprN orig/linux-3.2/Documentation/scst/README.qla2x00t linux-3.2/Documentation/scst/README.qla2x00t
+--- orig/linux-3.2/Documentation/scst/README.qla2x00t
++++ linux-3.2/Documentation/scst/README.qla2x00t
@@ -0,0 +1,572 @@
+Target driver for QLogic 22xx/23xx/24xx/25xx Fibre Channel cards
+================================================================
@@ -74465,9 +74441,9 @@ Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Cc: Vu Pham <vu@mellanox.com>
Cc: Roland Dreier <rdreier@cisco.com>
Cc: David Dillow <dillowda@ornl.gov>
-diff -uprN orig/linux-2.6.39/Documentation/scst/README.srpt linux-2.6.39/Documentation/scst/README.srpt
---- orig/linux-2.6.39/Documentation/scst/README.srpt
-+++ linux-2.6.39/Documentation/scst/README.srpt
+diff -uprN orig/linux-3.2/Documentation/scst/README.srpt linux-3.2/Documentation/scst/README.srpt
+--- orig/linux-3.2/Documentation/scst/README.srpt
++++ linux-3.2/Documentation/scst/README.srpt
@@ -0,0 +1,112 @@
+SCSI RDMA Protocol (SRP) Target driver for Linux
+=================================================
@@ -74581,9 +74557,9 @@ diff -uprN orig/linux-2.6.39/Documentation/scst/README.srpt linux-2.6.39/Documen
+
+Send questions about this driver to scst-devel@lists.sourceforge.net, CC:
+Vu Pham <vuhuong@mellanox.com> and Bart Van Assche <bvanassche@acm.org>.
-diff -uprN orig/linux-2.6.39/drivers/scst/srpt/Kconfig linux-2.6.39/drivers/scst/srpt/Kconfig
---- orig/linux-2.6.39/drivers/scst/srpt/Kconfig
-+++ linux-2.6.39/drivers/scst/srpt/Kconfig
+diff -uprN orig/linux-3.2/drivers/scst/srpt/Kconfig linux-3.2/drivers/scst/srpt/Kconfig
+--- orig/linux-3.2/drivers/scst/srpt/Kconfig
++++ linux-3.2/drivers/scst/srpt/Kconfig
@@ -0,0 +1,12 @@
+config SCST_SRPT
+ tristate "InfiniBand SCSI RDMA Protocol target support"
@@ -74597,14 +74573,14 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/Kconfig linux-2.6.39/drivers/scst
+ supported by InfiniBand and by iWarp network hardware. More
+ information about the SRP protocol can be found on the website
+ of the INCITS T10 technical committee (http://www.t10.org/).
-diff -uprN orig/linux-2.6.39/drivers/scst/srpt/Makefile linux-2.6.39/drivers/scst/srpt/Makefile
---- orig/linux-2.6.39/drivers/scst/srpt/Makefile
-+++ linux-2.6.39/drivers/scst/srpt/Makefile
+diff -uprN orig/linux-3.2/drivers/scst/srpt/Makefile linux-3.2/drivers/scst/srpt/Makefile
+--- orig/linux-3.2/drivers/scst/srpt/Makefile
++++ linux-3.2/drivers/scst/srpt/Makefile
@@ -0,0 +1,1 @@
+obj-$(CONFIG_SCST_SRPT) += ib_srpt.o
-diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_dm_mad.h linux-2.6.39/drivers/scst/srpt/ib_dm_mad.h
---- orig/linux-2.6.39/drivers/scst/srpt/ib_dm_mad.h
-+++ linux-2.6.39/drivers/scst/srpt/ib_dm_mad.h
+diff -uprN orig/linux-3.2/drivers/scst/srpt/ib_dm_mad.h linux-3.2/drivers/scst/srpt/ib_dm_mad.h
+--- orig/linux-3.2/drivers/scst/srpt/ib_dm_mad.h
++++ linux-3.2/drivers/scst/srpt/ib_dm_mad.h
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2006 - 2009 Mellanox Technology Inc. All rights reserved.
@@ -74745,13 +74721,13 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_dm_mad.h linux-2.6.39/drivers/
+};
+
+#endif
-diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/scst/srpt/ib_srpt.c
---- orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c
-+++ linux-2.6.39/drivers/scst/srpt/ib_srpt.c
-@@ -0,0 +1,3812 @@
+diff -uprN orig/linux-3.2/drivers/scst/srpt/ib_srpt.c linux-3.2/drivers/scst/srpt/ib_srpt.c
+--- orig/linux-3.2/drivers/scst/srpt/ib_srpt.c
++++ linux-3.2/drivers/scst/srpt/ib_srpt.c
+@@ -0,0 +1,3850 @@
+/*
+ * Copyright (c) 2006 - 2009 Mellanox Technology Inc. All rights reserved.
-+ * Copyright (C) 2008 - 2010 Bart Van Assche <bvanassche@acm.org>.
++ * Copyright (C) 2008 - 2011 Bart Van Assche <bvanassche@acm.org>.
+ * Copyright (C) 2008 Vladislav Bolkhovitin <vst@vlnb.net>
+ *
+ * This software is available to you under a choice of one of two
@@ -74799,7 +74775,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+
+/* Name of this kernel module. */
+#define DRV_NAME "ib_srpt"
-+#define DRV_VERSION "2.1.0-pre"
++#define DRV_VERSION "2.2.1-pre"
+#define DRV_RELDATE "(not yet released)"
+#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
+/* Flags to be used in SCST debug tracing statements. */
@@ -74809,24 +74785,14 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+#define SRPT_PROC_TRACE_LEVEL_NAME "trace_level"
+#endif
+
-+#define MELLANOX_SRPT_ID_STRING "SCST SRP target"
++#define SRPT_ID_STRING "SCST SRP target"
+
-+MODULE_AUTHOR("Vu Pham");
++MODULE_AUTHOR("Vu Pham and Bart Van Assche");
+MODULE_DESCRIPTION("InfiniBand SCSI RDMA Protocol target "
+ "v" DRV_VERSION " (" DRV_RELDATE ")");
+MODULE_LICENSE("Dual BSD/GPL");
+
+/*
-+ * Local data types.
-+ */
-+
-+enum threading_mode {
-+ MODE_ALL_IN_SIRQ = 0,
-+ MODE_IB_COMPLETION_IN_THREAD = 1,
-+ MODE_IB_COMPLETION_IN_SIRQ = 2,
-+};
-+
-+/*
+ * Global Variables
+ */
+
@@ -74839,17 +74805,8 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+MODULE_PARM_DESC(trace_flag, "SCST trace flags.");
+#endif
+
-+static int thread = 1;
-+module_param(thread, int, 0444);
-+MODULE_PARM_DESC(thread,
-+ "IB completion and SCSI command processing context. Defaults"
-+ " to one, i.e. process IB completions and SCSI commands in"
-+ " kernel thread context. 0 means soft IRQ whenever possible"
-+ " and 2 means process IB completions in soft IRQ context and"
-+ " SCSI commands in kernel thread context.");
-+
+static unsigned srp_max_rdma_size = DEFAULT_MAX_RDMA_SIZE;
-+module_param(srp_max_rdma_size, int, 0744);
++module_param(srp_max_rdma_size, int, 0644);
+MODULE_PARM_DESC(srp_max_rdma_size,
+ "Maximum size of SRP RDMA transfers for new connections.");
+
@@ -74859,12 +74816,12 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ "Maximum size of SRP request messages in bytes.");
+
+static unsigned int srp_max_rsp_size = DEFAULT_MAX_RSP_SIZE;
-+module_param(srp_max_rsp_size, int, 0444);
-+MODULE_PARM_DESC(thread,
++module_param(srp_max_rsp_size, int, S_IRUGO | S_IWUSR);
++MODULE_PARM_DESC(srp_max_rsp_size,
+ "Maximum size of SRP response messages in bytes.");
+
+static int srpt_srq_size = DEFAULT_SRPT_SRQ_SIZE;
-+module_param(srpt_srq_size, int, 0444);
++module_param(srpt_srq_size, int, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(srpt_srq_size,
+ "Shared receive queue (SRQ) size.");
+
@@ -74876,7 +74833,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+static bool use_port_guid_in_session_name;
+module_param(use_port_guid_in_session_name, bool, 0444);
+MODULE_PARM_DESC(use_port_guid_in_session_name,
-+ "Use target port ID in the SCST session name such that"
++ "Use target port ID in the session name such that"
+ " redundant paths between multiport systems can be masked.");
+
+static bool use_node_guid_in_target_name;
@@ -74894,30 +74851,27 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ "Using this value for ioc_guid, id_ext, and cm_listen_id"
+ " instead of using the node_guid of the first HCA.");
+
-+static void srpt_add_one(struct ib_device *device);
-+static void srpt_remove_one(struct ib_device *device);
++static struct ib_client srpt_client;
+static void srpt_unregister_mad_agent(struct srpt_device *sdev);
+static void srpt_unmap_sg_to_ib_sge(struct srpt_rdma_ch *ch,
+ struct srpt_send_ioctx *ioctx);
++static void srpt_drain_channel(struct ib_cm_id *cm_id);
+static void srpt_free_ch(struct scst_session *sess);
+
-+static struct ib_client srpt_client = {
-+ .name = DRV_NAME,
-+ .add = srpt_add_one,
-+ .remove = srpt_remove_one
-+};
-+
+static enum rdma_ch_state srpt_set_ch_state_to_disc(struct srpt_rdma_ch *ch)
+{
+ unsigned long flags;
+ enum rdma_ch_state prev;
++ bool changed = false;
+
+ spin_lock_irqsave(&ch->spinlock, flags);
-+ prev = atomic_read(&ch->state);
++ prev = ch->state;
+ switch (prev) {
+ case CH_CONNECTING:
+ case CH_LIVE:
-+ atomic_set(&ch->state, CH_DISCONNECTING);
++ ch->state = CH_DISCONNECTING;
++ wake_up_process(ch->thread);
++ changed = true;
+ break;
+ default:
+ break;
@@ -74930,39 +74884,93 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+static bool srpt_set_ch_state_to_draining(struct srpt_rdma_ch *ch)
+{
+ unsigned long flags;
-+ bool changed_state = false;
++ bool changed = false;
+
+ spin_lock_irqsave(&ch->spinlock, flags);
-+ switch (atomic_read(&ch->state)) {
++ switch (ch->state) {
+ case CH_CONNECTING:
+ case CH_LIVE:
+ case CH_DISCONNECTING:
-+ atomic_set(&ch->state, CH_DRAINING);
-+ changed_state = true;
++ ch->state = CH_DRAINING;
++ wake_up_process(ch->thread);
++ changed = true;
+ break;
+ default:
+ break;
+ }
+ spin_unlock_irqrestore(&ch->spinlock, flags);
+
-+ return changed_state;
++ return changed;
+}
+
+/**
-+ * srpt_test_and_set_channel_state() - Test and set the channel state.
++ * srpt_test_and_set_ch_state() - Test and set the channel state.
+ *
-+ * @ch: RDMA channel.
-+ * @old: channel state to compare with.
-+ * @new: state to change the channel state to if the current state matches @old.
++ * Returns true if and only if the channel state has been set to the new state.
++ */
++static bool srpt_test_and_set_ch_state(struct srpt_rdma_ch *ch,
++ enum rdma_ch_state old,
++ enum rdma_ch_state new)
++{
++ unsigned long flags;
++ bool changed = false;
++
++ spin_lock_irqsave(&ch->spinlock, flags);
++ if (ch->state == old) {
++ ch->state = new;
++ wake_up_process(ch->thread);
++ changed = true;
++ }
++ spin_unlock_irqrestore(&ch->spinlock, flags);
++
++ return changed;
++}
++
++/**
++ * srpt_adjust_req_lim() - Adjust ch->req_lim and ch->req_lim_delta atomically.
++ *
++ * Returns the new value of ch->req_lim.
++ */
++static int srpt_adjust_req_lim(struct srpt_rdma_ch *ch, int req_lim_change,
++ int req_lim_delta_change)
++{
++ int req_lim;
++ unsigned long flags;
++
++ spin_lock_irqsave(&ch->spinlock, flags);
++ ch->req_lim += req_lim_change;
++ req_lim = ch->req_lim;
++ ch->req_lim_delta += req_lim_delta_change;
++ spin_unlock_irqrestore(&ch->spinlock, flags);
++
++ return req_lim;
++}
++
++/**
++ * srpt_inc_req_lim() - Increase ch->req_lim and decrease ch->req_lim_delta.
+ *
-+ * Returns true if and only if the channel state did match @old.
++ * Returns one more than the previous value of ch->req_lim_delta.
+ */
-+static bool
-+srpt_test_and_set_channel_state(struct srpt_rdma_ch *ch,
-+ enum rdma_ch_state old,
-+ enum rdma_ch_state new)
++static int srpt_inc_req_lim(struct srpt_rdma_ch *ch)
+{
-+ return atomic_cmpxchg(&ch->state, old, new) == old;
++ int req_lim_delta;
++ unsigned long flags;
++
++ spin_lock_irqsave(&ch->spinlock, flags);
++ req_lim_delta = ch->req_lim_delta + 1;
++ ch->req_lim += req_lim_delta;
++ ch->req_lim_delta = 0;
++ spin_unlock_irqrestore(&ch->spinlock, flags);
++
++ return req_lim_delta;
++}
++
++/**
++ * srpt_undo_inc_req_lim() - Undo the effect of srpt_inc_req_lim.
++ */
++static int srpt_undo_inc_req_lim(struct srpt_rdma_ch *ch, int req_lim_delta)
++{
++ return srpt_adjust_req_lim(ch, -req_lim_delta, req_lim_delta - 1);
+}
+
+/**
@@ -74978,6 +74986,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+{
+ struct srpt_device *sdev;
+ struct srpt_port *sport;
++ u8 port_num;
+
+ TRACE_ENTRY();
+
@@ -74990,10 +74999,15 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+
+ switch (event->event) {
+ case IB_EVENT_PORT_ERR:
-+ if (event->element.port_num <= sdev->device->phys_port_cnt) {
-+ sport = &sdev->port[event->element.port_num - 1];
++ port_num = event->element.port_num - 1;
++ if (port_num < sdev->device->phys_port_cnt) {
++ sport = &sdev->port[port_num];
+ sport->lid = 0;
+ sport->sm_lid = 0;
++ } else {
++ WARN(true, "event %d: port_num %d out of range 1..%d\n",
++ event->event, port_num + 1,
++ sdev->device->phys_port_cnt);
+ }
+ break;
+ case IB_EVENT_PORT_ACTIVE:
@@ -75001,17 +75015,16 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ case IB_EVENT_PKEY_CHANGE:
+ case IB_EVENT_SM_CHANGE:
+ case IB_EVENT_CLIENT_REREGISTER:
-+ /*
-+ * Refresh port data asynchronously. Note: it is safe to call
-+ * schedule_work() even if &sport->work is already on the
-+ * global workqueue because schedule_work() tests for the
-+ * work_pending() condition before adding &sport->work to the
-+ * global work queue.
-+ */
-+ if (event->element.port_num <= sdev->device->phys_port_cnt) {
-+ sport = &sdev->port[event->element.port_num - 1];
++ /* Refresh port data asynchronously. */
++ port_num = event->element.port_num - 1;
++ if (port_num < sdev->device->phys_port_cnt) {
++ sport = &sdev->port[port_num];
+ if (!sport->lid && !sport->sm_lid)
+ schedule_work(&sport->work);
++ } else {
++ WARN(true, "event %d: port_num %d out of range 1..%d\n",
++ event->event, port_num + 1,
++ sdev->device->phys_port_cnt);
+ }
+ break;
+ default:
@@ -75023,35 +75036,49 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+}
+
+/**
-+ * srpt_srq_event() - SRQ event callback function.
++ * srpt_srq_event() - IB SRQ event callback function.
+ */
+static void srpt_srq_event(struct ib_event *event, void *ctx)
+{
-+ PRINT_INFO("SRQ event %d", event->event);
++ TRACE_DBG("SRQ event %d", event->event);
++}
++
++static const char *get_ch_state_name(enum rdma_ch_state s)
++{
++ switch (s) {
++ case CH_CONNECTING:
++ return "connecting";
++ case CH_LIVE:
++ return "live";
++ case CH_DISCONNECTING:
++ return "disconnecting";
++ case CH_DRAINING:
++ return "draining";
++ case CH_FREEING:
++ return "freeing";
++ }
++ return "???";
+}
+
+/**
-+ * srpt_qp_event() - QP event callback function.
++ * srpt_qp_event() - IB QP event callback function.
+ */
+static void srpt_qp_event(struct ib_event *event, struct srpt_rdma_ch *ch)
+{
-+ TRACE_DBG("QP event %d on cm_id=%p sess_name=%s state=%d",
++ TRACE_DBG("QP event %d on cm_id=%p sess_name=%s state=%s",
+ event->event, ch->cm_id, ch->sess_name,
-+ atomic_read(&ch->state));
++ get_ch_state_name(ch->state));
+
+ switch (event->event) {
+ case IB_EVENT_COMM_EST:
+ ib_cm_notify(ch->cm_id, event->event);
+ break;
+ case IB_EVENT_QP_LAST_WQE_REACHED:
-+ TRACE_DBG("%s: received IB_EVENT_QP_LAST_WQE_REACHED",
-+ ch->sess_name);
-+ if (srpt_test_and_set_channel_state(ch, CH_DRAINING,
-+ CH_RELEASING))
-+ wake_up_process(ch->thread);
-+ else
-+ TRACE_DBG("%s: state %d - ignored LAST_WQE.",
-+ ch->sess_name, atomic_read(&ch->state));
++ TRACE_DBG("%s, state %s: received Last WQE event.",
++ ch->sess_name, get_ch_state_name(ch->state));
++ ch->last_wqe_received = true;
++ BUG_ON(!ch->thread);
++ wake_up_process(ch->thread);
+ break;
+ default:
+ PRINT_ERROR("received unrecognized IB QP event %d",
@@ -75116,7 +75143,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ int i;
+
+ ioui = (struct ib_dm_iou_info *)mad->data;
-+ ioui->change_id = __constant_cpu_to_be16(1);
++ ioui->change_id = cpu_to_be16(1);
+ ioui->max_controllers = 16;
+
+ /* set present for slot 1 and empty for the rest */
@@ -75142,29 +75169,27 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ iocp = (struct ib_dm_ioc_profile *)mad->data;
+
+ if (!slot || slot > 16) {
-+ mad->mad_hdr.status
-+ = __constant_cpu_to_be16(DM_MAD_STATUS_INVALID_FIELD);
++ mad->mad_hdr.status = cpu_to_be16(DM_MAD_STATUS_INVALID_FIELD);
+ return;
+ }
+
+ if (slot > 2) {
-+ mad->mad_hdr.status
-+ = __constant_cpu_to_be16(DM_MAD_STATUS_NO_IOC);
++ mad->mad_hdr.status = cpu_to_be16(DM_MAD_STATUS_NO_IOC);
+ return;
+ }
+
+ memset(iocp, 0, sizeof *iocp);
-+ strcpy(iocp->id_string, MELLANOX_SRPT_ID_STRING);
++ strcpy(iocp->id_string, SRPT_ID_STRING);
+ iocp->guid = cpu_to_be64(srpt_service_guid);
+ iocp->vendor_id = cpu_to_be32(sdev->dev_attr.vendor_id);
+ iocp->device_id = cpu_to_be32(sdev->dev_attr.vendor_part_id);
+ iocp->device_version = cpu_to_be16(sdev->dev_attr.hw_ver);
+ iocp->subsys_vendor_id = cpu_to_be32(sdev->dev_attr.vendor_id);
+ iocp->subsys_device_id = 0x0;
-+ iocp->io_class = __constant_cpu_to_be16(SRP_REV16A_IB_IO_CLASS);
-+ iocp->io_subclass = __constant_cpu_to_be16(SRP_IO_SUBCLASS);
-+ iocp->protocol = __constant_cpu_to_be16(SRP_PROTOCOL);
-+ iocp->protocol_version = __constant_cpu_to_be16(SRP_PROTOCOL_VERSION);
++ iocp->io_class = cpu_to_be16(SRP_REV16A_IB_IO_CLASS);
++ iocp->io_subclass = cpu_to_be16(SRP_IO_SUBCLASS);
++ iocp->protocol = cpu_to_be16(SRP_PROTOCOL);
++ iocp->protocol_version = cpu_to_be16(SRP_PROTOCOL_VERSION);
+ iocp->send_queue_depth = cpu_to_be16(sdev->srq_size);
+ iocp->rdma_read_depth = 4;
+ iocp->send_size = cpu_to_be32(srp_max_req_size);
@@ -75191,14 +75216,12 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ WARN_ON(!ioc_guid);
+
+ if (!slot || slot > 16) {
-+ mad->mad_hdr.status
-+ = __constant_cpu_to_be16(DM_MAD_STATUS_INVALID_FIELD);
++ mad->mad_hdr.status = cpu_to_be16(DM_MAD_STATUS_INVALID_FIELD);
+ return;
+ }
+
+ if (slot > 2 || lo > hi || hi > 1) {
-+ mad->mad_hdr.status
-+ = __constant_cpu_to_be16(DM_MAD_STATUS_NO_IOC);
++ mad->mad_hdr.status = cpu_to_be16(DM_MAD_STATUS_NO_IOC);
+ return;
+ }
+
@@ -75249,7 +75272,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ break;
+ default:
+ rsp_mad->mad_hdr.status =
-+ __constant_cpu_to_be16(DM_MAD_STATUS_UNSUP_METHOD_ATTR);
++ cpu_to_be16(DM_MAD_STATUS_UNSUP_METHOD_ATTR);
+ break;
+ }
+}
@@ -75305,11 +75328,11 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ break;
+ case IB_MGMT_METHOD_SET:
+ dm_mad->mad_hdr.status =
-+ __constant_cpu_to_be16(DM_MAD_STATUS_UNSUP_METHOD_ATTR);
++ cpu_to_be16(DM_MAD_STATUS_UNSUP_METHOD_ATTR);
+ break;
+ default:
+ dm_mad->mad_hdr.status =
-+ __constant_cpu_to_be16(DM_MAD_STATUS_UNSUP_METHOD);
++ cpu_to_be16(DM_MAD_STATUS_UNSUP_METHOD);
+ break;
+ }
+
@@ -75390,13 +75413,11 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ return 0;
+
+err_query_port:
-+
+ port_modify.set_port_cap_mask = 0;
+ port_modify.clr_port_cap_mask = IB_PORT_DEVICE_MGMT_SUP;
+ ib_modify_port(sport->sdev->device, sport->port, 0, &port_modify);
+
+err_mod_port:
-+
+ TRACE_EXIT_RES(ret);
+
+ return ret;
@@ -75491,7 +75512,6 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+
+ WARN_ON(ioctx_size != sizeof(struct srpt_recv_ioctx) &&
+ ioctx_size != sizeof(struct srpt_send_ioctx));
-+ WARN_ON(dma_size != srp_max_req_size && dma_size != srp_max_rsp_size);
+
+ ring = kmalloc(ring_size * sizeof(ring[0]), GFP_KERNEL);
+ if (!ring)
@@ -75508,6 +75528,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ while (--i >= 0)
+ srpt_free_ioctx(sdev, ring[i], dma_size, dir);
+ kfree(ring);
++ ring = NULL;
+out:
+ TRACE_EXIT_HRES(ring);
+ return ring;
@@ -75522,26 +75543,14 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+{
+ int i;
+
-+ WARN_ON(dma_size != srp_max_req_size && dma_size != srp_max_rsp_size);
-+
+ for (i = 0; i < ring_size; ++i)
+ srpt_free_ioctx(sdev, ioctx_ring[i], dma_size, dir);
+ kfree(ioctx_ring);
+}
+
+/**
-+ * srpt_get_cmd_state() - Get the state of a SCSI command.
-+ */
-+static enum srpt_command_state srpt_get_cmd_state(struct srpt_send_ioctx *ioctx)
-+{
-+ BUG_ON(!ioctx);
-+
-+ return atomic_read(&ioctx->state);
-+}
-+
-+/**
+ * srpt_set_cmd_state() - Set the state of a SCSI command.
-+ * @new: New state to be set.
++ * @new: New state.
+ *
+ * Does not modify the state of aborted commands. Returns the previous command
+ * state.
@@ -75553,31 +75562,37 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+
+ BUG_ON(!ioctx);
+
-+ do {
-+ previous = atomic_read(&ioctx->state);
-+ } while (previous != SRPT_STATE_DONE
-+ && atomic_cmpxchg(&ioctx->state, previous, new) != previous);
++ spin_lock(&ioctx->spinlock);
++ previous = ioctx->state;
++ if (previous != SRPT_STATE_DONE)
++ ioctx->state = new;
++ spin_unlock(&ioctx->spinlock);
+
+ return previous;
+}
+
+/**
+ * srpt_test_and_set_cmd_state() - Test and set the state of a command.
-+ * @old: State to compare against.
-+ * @new: New state to be set if the current state matches 'old'.
+ *
-+ * Returns the previous command state.
++ * Returns true if and only if the previous command state was equal to 'old'.
+ */
-+static enum srpt_command_state
-+srpt_test_and_set_cmd_state(struct srpt_send_ioctx *ioctx,
-+ enum srpt_command_state old,
-+ enum srpt_command_state new)
++static bool srpt_test_and_set_cmd_state(struct srpt_send_ioctx *ioctx,
++ enum srpt_command_state old,
++ enum srpt_command_state new)
+{
++ enum srpt_command_state previous;
++
+ WARN_ON(!ioctx);
+ WARN_ON(old == SRPT_STATE_DONE);
+ WARN_ON(new == SRPT_STATE_NEW);
+
-+ return atomic_cmpxchg(&ioctx->state, old, new);
++ spin_lock(&ioctx->spinlock);
++ previous = ioctx->state;
++ if (previous == old)
++ ioctx->state = new;
++ spin_unlock(&ioctx->spinlock);
++
++ return previous == old;
+}
+
+/**
@@ -75603,11 +75618,21 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ return ib_post_srq_recv(sdev->srq, &wr, &bad_wr);
+}
+
++static int srpt_adjust_srq_wr_avail(struct srpt_rdma_ch *ch, int delta)
++{
++ int res;
++ unsigned long flags;
++
++ spin_lock_irqsave(&ch->spinlock, flags);
++ ch->sq_wr_avail += delta;
++ res = ch->sq_wr_avail;
++ spin_unlock_irqrestore(&ch->spinlock, flags);
++
++ return res;
++}
++
+/**
+ * srpt_post_send() - Post an IB send request.
-+ * @ch: RDMA channel to post the send request on.
-+ * @ioctx: I/O context of the send request.
-+ * @len: length of the request to be sent in bytes.
+ *
+ * Returns zero upon success and a non-zero value upon failure.
+ */
@@ -75620,7 +75645,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ int ret;
+
+ ret = -ENOMEM;
-+ if (atomic_dec_return(&ch->sq_wr_avail) < 0) {
++ if (srpt_adjust_srq_wr_avail(ch, -1) < 0) {
+ PRINT_WARNING("%s", "IB send queue full (needed 1)");
+ goto out;
+ }
@@ -75643,7 +75668,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+
+out:
+ if (ret < 0)
-+ atomic_inc(&ch->sq_wr_avail);
++ srpt_adjust_srq_wr_avail(ch, 1);
+ return ret;
+}
+
@@ -75691,10 +75716,10 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ */
+ *dir = SCST_DATA_NONE;
+ if (srp_cmd->buf_fmt & 0xf)
-+ /* DATA-IN: transfer data from target to initiator. */
++ /* DATA-IN: transfer data from target to initiator (read). */
+ *dir = SCST_DATA_READ;
+ else if (srp_cmd->buf_fmt >> 4)
-+ /* DATA-OUT: transfer data from initiator to target. */
++ /* DATA-OUT: transfer data from initiator to target (write). */
+ *dir = SCST_DATA_WRITE;
+
+ /*
@@ -75787,30 +75812,29 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ * @qp: queue pair to change the state of.
+ *
+ * Returns zero upon success and a negative value upon failure.
-+ *
-+ * Note: currently a struct ib_qp_attr takes 136 bytes on a 64-bit system.
-+ * If this structure ever becomes larger, it might be necessary to allocate
-+ * it dynamically instead of on the stack.
+ */
+static int srpt_ch_qp_rtr(struct srpt_rdma_ch *ch, struct ib_qp *qp)
+{
-+ struct ib_qp_attr qp_attr;
++ struct ib_qp_attr *attr;
+ int attr_mask;
+ int ret;
+
-+ TRACE_ENTRY();
++ attr = kzalloc(sizeof *attr, GFP_KERNEL);
++ if (!attr)
++ return -ENOMEM;
+
-+ qp_attr.qp_state = IB_QPS_RTR;
-+ ret = ib_cm_init_qp_attr(ch->cm_id, &qp_attr, &attr_mask);
++ attr->qp_state = IB_QPS_RTR;
++ ret = ib_cm_init_qp_attr(ch->cm_id, attr, &attr_mask);
+ if (ret)
+ goto out;
+
-+ qp_attr.max_dest_rd_atomic = 4;
++ attr->max_dest_rd_atomic = 4;
++ TRACE_DBG("qp timeout = %d", attr->timeout);
+
-+ ret = ib_modify_qp(qp, &qp_attr, attr_mask);
++ ret = ib_modify_qp(qp, attr, attr_mask);
+
+out:
-+ TRACE_EXIT_RES(ret);
++ kfree(attr);
+ return ret;
+}
+
@@ -75827,9 +75851,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ int attr_mask;
+ int ret;
+ uint64_t T_tr_ns;
-+ uint32_t max_compl_time_ms;
-+
-+ TRACE_ENTRY();
++ uint32_t T_tr_ms, max_compl_time_ms;
+
+ attr = kzalloc(sizeof *attr, GFP_KERNEL);
+ if (!attr)
@@ -75850,11 +75872,13 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ WARN_ON(attr->timeout >= (1 << 5));
+ if (attr->timeout) {
+ T_tr_ns = 1ULL << (12 + attr->timeout);
-+ max_compl_time_ms = attr->retry_cnt * 4 * T_tr_ns / 1000000;
++ max_compl_time_ms = attr->retry_cnt * 4 * T_tr_ns;
++ do_div(max_compl_time_ms, 1000000);
++ T_tr_ms = T_tr_ns;
++ do_div(T_tr_ms, 1000000);
+ TRACE_DBG("Session %s: QP local ack timeout = %d or T_tr ="
+ " %u ms; retry_cnt = %d; max compl. time = %d ms",
-+ ch->sess_name,
-+ attr->timeout, (unsigned)(T_tr_ns / (1000 * 1000)),
++ ch->sess_name, attr->timeout, T_tr_ms,
+ attr->retry_cnt, max_compl_time_ms);
+
+ if (max_compl_time_ms >= RDMA_COMPL_TIMEOUT_S * 1000) {
@@ -75869,7 +75893,6 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+
+out:
+ kfree(attr);
-+ TRACE_EXIT_RES(ret);
+ return ret;
+}
+
@@ -75881,8 +75904,6 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ struct ib_qp_attr *attr;
+ int ret;
+
-+ TRACE_ENTRY();
-+
+ attr = kzalloc(sizeof *attr, GFP_KERNEL);
+ if (!attr)
+ return -ENOMEM;
@@ -75890,8 +75911,6 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ attr->qp_state = IB_QPS_ERR;
+ ret = ib_modify_qp(ch->qp, attr, IB_QP_STATE);
+ kfree(attr);
-+
-+ TRACE_EXIT_RES(ret);
+ return ret;
+}
+
@@ -75918,7 +75937,8 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ return ioctx;
+
+ BUG_ON(ioctx->ch != ch);
-+ atomic_set(&ioctx->state, SRPT_STATE_NEW);
++ spin_lock_init(&ioctx->spinlock);
++ ioctx->state = SRPT_STATE_NEW;
+ ioctx->n_rbuf = 0;
+ ioctx->rbufs = NULL;
+ ioctx->n_rdma = 0;
@@ -75942,8 +75962,6 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ ch = ioctx->ch;
+ BUG_ON(!ch);
+
-+ WARN_ON(srpt_get_cmd_state(ioctx) != SRPT_STATE_DONE);
-+
+ ioctx->scmnd = NULL;
+
+ /*
@@ -75965,11 +75983,11 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+}
+
+/**
-+ * srpt_abort_scst_cmd() - Abort a SCSI command.
++ * srpt_abort_cmd() - Abort a SCSI command.
+ * @ioctx: I/O context associated with the SCSI command.
+ * @context: Preferred execution context.
+ */
-+static void srpt_abort_scst_cmd(struct srpt_send_ioctx *ioctx,
++static void srpt_abort_cmd(struct srpt_send_ioctx *ioctx,
+ enum scst_exec_context context)
+{
+ struct scst_cmd *scmnd;
@@ -75980,22 +75998,28 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ BUG_ON(!ioctx);
+
+ /*
-+ * If the command is in a state where the SCST core is waiting for the
-+ * ib_srpt driver, change the state to the next state. Changing the
-+ * state of the command from SRPT_STATE_NEED_DATA to SRPT_STATE_DATA_IN
-+ * ensures that srpt_xmit_response() will call this function a second
-+ * time.
++ * If the command is in a state where the target core is waiting for
++ * the ib_srpt driver, change the state to the next state. Changing
++ * the state of the command from SRPT_STATE_NEED_DATA to
++ * SRPT_STATE_DATA_IN ensures that srpt_xmit_response() will call this
++ * function a second time.
+ */
-+ state = srpt_test_and_set_cmd_state(ioctx, SRPT_STATE_NEED_DATA,
-+ SRPT_STATE_DATA_IN);
-+ if (state != SRPT_STATE_NEED_DATA) {
-+ state = srpt_test_and_set_cmd_state(ioctx, SRPT_STATE_DATA_IN,
-+ SRPT_STATE_DONE);
-+ if (state != SRPT_STATE_DATA_IN) {
-+ state = srpt_test_and_set_cmd_state(ioctx,
-+ SRPT_STATE_CMD_RSP_SENT, SRPT_STATE_DONE);
-+ }
++ spin_lock(&ioctx->spinlock);
++ state = ioctx->state;
++ switch (state) {
++ case SRPT_STATE_NEED_DATA:
++ ioctx->state = SRPT_STATE_DATA_IN;
++ break;
++ case SRPT_STATE_DATA_IN:
++ case SRPT_STATE_CMD_RSP_SENT:
++ case SRPT_STATE_MGMT_RSP_SENT:
++ ioctx->state = SRPT_STATE_DONE;
++ break;
++ default:
++ break;
+ }
++ spin_unlock(&ioctx->spinlock);
++
+ if (state == SRPT_STATE_DONE)
+ goto out;
+
@@ -76012,6 +76036,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ switch (state) {
+ case SRPT_STATE_NEW:
+ case SRPT_STATE_DATA_IN:
++ case SRPT_STATE_MGMT:
+ /*
+ * Do nothing - defer abort processing until
+ * srpt_xmit_response() is invoked.
@@ -76063,11 +76088,11 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ struct scst_cmd *scmnd;
+ u32 index;
+
-+ atomic_inc(&ch->sq_wr_avail);
++ srpt_adjust_srq_wr_avail(ch, 1);
+
+ index = idx_from_wr_id(wr_id);
+ ioctx = ch->ioctx_ring[index];
-+ state = srpt_get_cmd_state(ioctx);
++ state = ioctx->state;
+ scmnd = ioctx->scmnd;
+
+ EXTRACHECKS_WARN_ON(state != SRPT_STATE_CMD_RSP_SENT
@@ -76075,17 +76100,18 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ && state != SRPT_STATE_NEED_DATA
+ && state != SRPT_STATE_DONE);
+
-+ /* If SRP_RSP sending failed, undo the ch->req_lim change. */
++ /*
++ * If SRP_RSP sending failed, undo the ch->req_lim and ch->req_lim_delta
++ * changes.
++ */
+ if (state == SRPT_STATE_CMD_RSP_SENT
+ || state == SRPT_STATE_MGMT_RSP_SENT)
-+ atomic_dec(&ch->req_lim);
++ srpt_undo_inc_req_lim(ch, ioctx->req_lim_delta);
+ if (state != SRPT_STATE_DONE) {
+ if (scmnd)
-+ srpt_abort_scst_cmd(ioctx, context);
-+ else {
-+ srpt_set_cmd_state(ioctx, SRPT_STATE_DONE);
++ srpt_abort_cmd(ioctx, context);
++ else
+ srpt_put_send_ioctx(ioctx);
-+ }
+ } else
+ PRINT_ERROR("Received more than one IB error completion"
+ " for wr_id = %u.", (unsigned)index);
@@ -76100,7 +76126,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+{
+ enum srpt_command_state state;
+
-+ atomic_inc(&ch->sq_wr_avail);
++ srpt_adjust_srq_wr_avail(ch, 1);
+
+ state = srpt_set_cmd_state(ioctx, SRPT_STATE_DONE);
+
@@ -76134,28 +76160,24 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ enum srpt_opcode opcode,
+ enum scst_exec_context context)
+{
-+ enum srpt_command_state state;
+ struct scst_cmd *scmnd;
+
+ EXTRACHECKS_WARN_ON(ioctx->n_rdma <= 0);
-+ atomic_add(ioctx->n_rdma, &ch->sq_wr_avail);
++ srpt_adjust_srq_wr_avail(ch, ioctx->n_rdma);
+
+ scmnd = ioctx->scmnd;
+ if (opcode == SRPT_RDMA_READ_LAST && scmnd) {
-+ state = srpt_test_and_set_cmd_state(ioctx, SRPT_STATE_NEED_DATA,
-+ SRPT_STATE_DATA_IN);
-+ if (state == SRPT_STATE_NEED_DATA)
++ if (srpt_test_and_set_cmd_state(ioctx, SRPT_STATE_NEED_DATA,
++ SRPT_STATE_DATA_IN))
+ scst_rx_data(ioctx->scmnd, SCST_RX_STATUS_SUCCESS,
+ context);
+ else
+ PRINT_ERROR("%s[%d]: wrong state = %d", __func__,
-+ __LINE__, state);
++ __LINE__, ioctx->state);
+ } else if (opcode == SRPT_RDMA_ABORT) {
+ ioctx->rdma_aborted = true;
+ } else {
-+ WARN_ON(opcode != SRPT_RDMA_READ_LAST);
-+ PRINT_ERROR("%s[%d]: scmnd == NULL (opcode %d)", __func__,
-+ __LINE__, opcode);
++ WARN(true, "scmnd == NULL (opcode %d)", opcode);
+ }
+}
+
@@ -76171,7 +76193,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ enum srpt_command_state state;
+
+ scmnd = ioctx->scmnd;
-+ state = srpt_get_cmd_state(ioctx);
++ state = ioctx->state;
+ if (scmnd) {
+ switch (opcode) {
+ case SRPT_RDMA_READ_LAST:
@@ -76181,9 +76203,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ ioctx->ioctx.index);
+ break;
+ }
-+ atomic_add(ioctx->n_rdma, &ch->sq_wr_avail);
++ srpt_adjust_srq_wr_avail(ch, ioctx->n_rdma);
+ if (state == SRPT_STATE_NEED_DATA)
-+ srpt_abort_scst_cmd(ioctx, context);
++ srpt_abort_cmd(ioctx, context);
+ else
+ PRINT_ERROR("%s[%d]: wrong state = %d",
+ __func__, __LINE__, state);
@@ -76237,8 +76259,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ memset(srp_rsp, 0, sizeof *srp_rsp);
+
+ srp_rsp->opcode = SRP_RSP;
-+ srp_rsp->req_lim_delta = __constant_cpu_to_be32(1
-+ + atomic_xchg(&ch->req_lim_delta, 0));
++ srp_rsp->req_lim_delta = cpu_to_be32(ioctx->req_lim_delta);
+ srp_rsp->tag = tag;
+ srp_rsp->status = status;
+
@@ -76290,8 +76311,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ memset(srp_rsp, 0, sizeof *srp_rsp);
+
+ srp_rsp->opcode = SRP_RSP;
-+ srp_rsp->req_lim_delta = __constant_cpu_to_be32(1
-+ + atomic_xchg(&ch->req_lim_delta, 0));
++ srp_rsp->req_lim_delta = cpu_to_be32(ioctx->req_lim_delta);
+ srp_rsp->tag = tag;
+
+ if (rsp_code != SRP_TSK_MGMT_SUCCESS) {
@@ -76394,12 +76414,14 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ struct srpt_send_ioctx *send_ioctx)
+{
+ struct srp_tsk_mgmt *srp_tsk;
-+ struct srpt_mgmt_ioctx *mgmt_ioctx;
+ int ret;
+
+ ret = SCST_MGMT_STATUS_FAILED;
+
+ BUG_ON(!send_ioctx);
++ BUG_ON(send_ioctx->ch != ch);
++
++ srpt_set_cmd_state(send_ioctx, SRPT_STATE_MGMT);
+
+ srp_tsk = recv_ioctx->ioctx.buf;
+
@@ -76408,18 +76430,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ srp_tsk->tsk_mgmt_func, srp_tsk->task_tag, srp_tsk->tag,
+ ch->cm_id, ch->scst_sess);
+
-+ mgmt_ioctx = kmalloc(sizeof *mgmt_ioctx, GFP_ATOMIC);
-+ if (!mgmt_ioctx) {
-+ PRINT_ERROR("tag 0x%llx: memory allocation for task management"
-+ " function failed. Ignoring task management request"
-+ " (func %d).", srp_tsk->task_tag,
-+ srp_tsk->tsk_mgmt_func);
-+ goto err;
-+ }
-+
-+ mgmt_ioctx->ioctx = send_ioctx;
-+ BUG_ON(mgmt_ioctx->ioctx->ch != ch);
-+ mgmt_ioctx->tag = srp_tsk->tag;
++ send_ioctx->tsk_mgmt.tag = srp_tsk->tag;
+
+ switch (srp_tsk->tsk_mgmt_func) {
+ case SRP_TSK_ABORT_TASK:
@@ -76427,7 +76438,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ ret = scst_rx_mgmt_fn_tag(ch->scst_sess,
+ SCST_ABORT_TASK,
+ srp_tsk->task_tag,
-+ SCST_ATOMIC, mgmt_ioctx);
++ SCST_ATOMIC, send_ioctx);
+ break;
+ case SRP_TSK_ABORT_TASK_SET:
+ TRACE_DBG("%s", "Processing SRP_TSK_ABORT_TASK_SET");
@@ -76435,7 +76446,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ SCST_ABORT_TASK_SET,
+ (u8 *) &srp_tsk->lun,
+ sizeof srp_tsk->lun,
-+ SCST_ATOMIC, mgmt_ioctx);
++ SCST_ATOMIC, send_ioctx);
+ break;
+ case SRP_TSK_CLEAR_TASK_SET:
+ TRACE_DBG("%s", "Processing SRP_TSK_CLEAR_TASK_SET");
@@ -76443,7 +76454,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ SCST_CLEAR_TASK_SET,
+ (u8 *) &srp_tsk->lun,
+ sizeof srp_tsk->lun,
-+ SCST_ATOMIC, mgmt_ioctx);
++ SCST_ATOMIC, send_ioctx);
+ break;
+ case SRP_TSK_LUN_RESET:
+ TRACE_DBG("%s", "Processing SRP_TSK_LUN_RESET");
@@ -76451,7 +76462,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ SCST_LUN_RESET,
+ (u8 *) &srp_tsk->lun,
+ sizeof srp_tsk->lun,
-+ SCST_ATOMIC, mgmt_ioctx);
++ SCST_ATOMIC, send_ioctx);
+ break;
+ case SRP_TSK_CLEAR_ACA:
+ TRACE_DBG("%s", "Processing SRP_TSK_CLEAR_ACA");
@@ -76459,7 +76470,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ SCST_CLEAR_ACA,
+ (u8 *) &srp_tsk->lun,
+ sizeof srp_tsk->lun,
-+ SCST_ATOMIC, mgmt_ioctx);
++ SCST_ATOMIC, send_ioctx);
+ break;
+ default:
+ TRACE_DBG("%s", "Unsupported task management function.");
@@ -76467,11 +76478,8 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ }
+
+ if (ret != SCST_MGMT_STATUS_SUCCESS)
-+ goto err;
-+ return ret;
++ srpt_put_send_ioctx(send_ioctx);
+
-+err:
-+ kfree(mgmt_ioctx);
+ return ret;
+}
+
@@ -76512,7 +76520,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ recv_ioctx->ioctx.dma, srp_max_req_size,
+ DMA_FROM_DEVICE);
+
-+ ch_state = atomic_read(&ch->state);
++ ch_state = ch->state;
+ srp_cmd = recv_ioctx->ioctx.buf;
+ if (unlikely(ch_state == CH_CONNECTING)) {
+ list_add_tail(&recv_ioctx->wait_list, &ch->cmd_wait_list);
@@ -76572,7 +76580,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ if (wc->status == IB_WC_SUCCESS) {
+ int req_lim;
+
-+ req_lim = atomic_dec_return(&ch->req_lim);
++ req_lim = srpt_adjust_req_lim(ch, -1, 0);
+ if (unlikely(req_lim < 0))
+ PRINT_ERROR("req_lim = %d < 0", req_lim);
+ ioctx = sdev->ioctx_ring[index];
@@ -76589,9 +76597,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ * Note: Although this has not yet been observed during tests, at least in
+ * theory it is possible that the srpt_get_send_ioctx() call invoked by
+ * srpt_handle_new_iu() fails. This is possible because the req_lim_delta
-+ * value in each response is set to one, and it is possible that this response
-+ * makes the initiator send a new request before the send completion for that
-+ * response has been processed. This could e.g. happen if the call to
++ * value in each response is set to at least one, and it is possible that this
++ * response makes the initiator send a new request before the send completion
++ * for that response has been processed. This could e.g. happen if the call to
+ * srpt_put_send_iotcx() is delayed because of a higher priority interrupt or
+ * if IB retransmission causes generation of the send completion to be
+ * delayed. Incoming information units for which srpt_get_send_ioctx() fails
@@ -76633,7 +76641,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+
+ while (unlikely(opcode == SRPT_SEND
+ && !list_empty(&ch->cmd_wait_list)
-+ && atomic_read(&ch->state) == CH_LIVE
++ && ch->state == CH_LIVE
+ && (send_ioctx = srpt_get_send_ioctx(ch)) != NULL)) {
+ struct srpt_recv_ioctx *recv_ioctx;
+
@@ -76645,62 +76653,39 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ }
+}
+
-+static bool srpt_process_completion(struct ib_cq *cq,
++static void srpt_process_completion(struct ib_cq *cq,
+ struct srpt_rdma_ch *ch,
-+ enum scst_exec_context context)
++ enum scst_exec_context rcv_context,
++ enum scst_exec_context send_context)
+{
+ struct ib_wc *const wc = ch->wc;
+ int i, n;
-+ bool keep_going;
+
+ EXTRACHECKS_WARN_ON(cq != ch->cq);
+
-+ keep_going = atomic_read(&ch->state) <= CH_LIVE;
-+ if (keep_going)
-+ ib_req_notify_cq(cq, IB_CQ_NEXT_COMP);
++ ib_req_notify_cq(cq, IB_CQ_NEXT_COMP);
+ while ((n = ib_poll_cq(cq, ARRAY_SIZE(ch->wc), wc)) > 0) {
+ for (i = 0; i < n; i++) {
+ if (opcode_from_wr_id(wc[i].wr_id) == SRPT_RECV)
-+ srpt_process_rcv_completion(cq, ch, context,
++ srpt_process_rcv_completion(cq, ch, rcv_context,
+ &wc[i]);
+ else
-+ srpt_process_send_completion(cq, ch, context,
++ srpt_process_send_completion(cq, ch,
++ send_context,
+ &wc[i]);
+ }
+ }
-+
-+ return keep_going;
+}
+
+/**
+ * srpt_completion() - IB completion queue callback function.
-+ *
-+ * Notes:
-+ * - It is guaranteed that a completion handler will never be invoked
-+ * concurrently on two different CPUs for the same completion queue. See also
-+ * Documentation/infiniband/core_locking.txt and the implementation of
-+ * handle_edge_irq() in kernel/irq/chip.c.
-+ * - When threaded IRQs are enabled, completion handlers are invoked in thread
-+ * context instead of interrupt context.
+ */
+static void srpt_completion(struct ib_cq *cq, void *ctx)
+{
+ struct srpt_rdma_ch *ch = ctx;
+
-+ BUG_ON(!ch);
-+ atomic_inc(&ch->processing_compl);
-+ switch (thread) {
-+ case MODE_IB_COMPLETION_IN_THREAD:
-+ wake_up_process(ch->thread);
-+ break;
-+ case MODE_IB_COMPLETION_IN_SIRQ:
-+ srpt_process_completion(cq, ch, SCST_CONTEXT_THREAD);
-+ break;
-+ case MODE_ALL_IN_SIRQ:
-+ srpt_process_completion(cq, ch, SCST_CONTEXT_TASKLET);
-+ break;
-+ }
-+ atomic_dec(&ch->processing_compl);
++ BUG_ON(!ch->thread);
++ wake_up_process(ch->thread);
+}
+
+static int srpt_compl_thread(void *arg)
@@ -76712,24 +76697,41 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+
+ ch = arg;
+ BUG_ON(!ch);
-+ while (!kthread_should_stop()) {
++ while (!kthread_should_stop() && !ch->last_wqe_received) {
+ set_current_state(TASK_INTERRUPTIBLE);
-+ if (!srpt_process_completion(ch->cq, ch, SCST_CONTEXT_THREAD))
-+ break;
++ srpt_process_completion(ch->cq, ch, SCST_CONTEXT_THREAD,
++ SCST_CONTEXT_DIRECT);
+ schedule();
+ }
+ set_current_state(TASK_RUNNING);
+
++ srpt_process_completion(ch->cq, ch, SCST_CONTEXT_THREAD,
++ SCST_CONTEXT_DIRECT);
++
++ /*
++ * Note: scst_unregister_session() must only be invoked after the last
++ * WQE event has been received.
++ */
+ TRACE_DBG("ch %s: about to invoke scst_unregister_session()",
+ ch->sess_name);
-+ WARN_ON(atomic_read(&ch->state) != CH_RELEASING);
+ scst_unregister_session(ch->scst_sess, false, srpt_free_ch);
+
-+ while (!kthread_should_stop()) {
++ /*
++ * Some HCAs can queue send completions after the Last WQE
++ * event. Make sure to process these work completions.
++ */
++ while (ch->state < CH_FREEING) {
+ set_current_state(TASK_INTERRUPTIBLE);
++ srpt_process_completion(ch->cq, ch, SCST_CONTEXT_THREAD,
++ SCST_CONTEXT_DIRECT);
+ schedule();
+ }
+
++ complete(&ch->finished_processing_completions);
++
++ while (!kthread_should_stop())
++ schedule();
++
+ return 0;
+}
+
@@ -76767,7 +76769,20 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ qp_init->sq_sig_type = IB_SIGNAL_REQ_WR;
+ qp_init->qp_type = IB_QPT_RC;
+ qp_init->cap.max_send_wr = srpt_sq_size;
-+ qp_init->cap.max_send_sge = SRPT_DEF_SG_PER_WQE;
++ /*
++ * A quote from the OFED 1.5.3.1 release notes
++ * (docs/release_notes/mthca_release_notes.txt), section "Known Issues":
++ * In mem-free devices, RC QPs can be created with a maximum of
++ * (max_sge - 1) entries only; UD QPs can be created with a maximum of
++ * (max_sge - 3) entries.
++ * A quote from the OFED 1.2.5 release notes
++ * (docs/mthca_release_notes.txt), section "Known Issues":
++ * In mem-free devices, RC QPs can be created with a maximum of
++ * (max_sge - 3) entries only.
++ */
++ ch->max_sge = sdev->dev_attr.max_sge - 3;
++ WARN_ON(ch->max_sge < 1);
++ qp_init->cap.max_send_sge = ch->max_sge;
+
+ ch->qp = ib_create_qp(sdev->pd, qp_init);
+ if (IS_ERR(ch->qp)) {
@@ -76776,7 +76791,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ goto err_destroy_cq;
+ }
+
-+ atomic_set(&ch->sq_wr_avail, qp_init->cap.max_send_wr);
++ ch->sq_wr_avail = qp_init->cap.max_send_wr;
+
+ TRACE_DBG("%s: max_cqe= %d max_sge= %d sq_size = %d"
+ " cm_id= %p", __func__, ch->cq->cqe,
@@ -76784,23 +76799,10 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ ch->cm_id);
+
+ ret = srpt_init_ch_qp(ch, ch->qp);
-+ if (ret)
++ if (ret) {
++ PRINT_ERROR("srpt_init_ch_qp() failed (%d)", ret);
+ goto err_destroy_qp;
-+
-+ if (thread == MODE_IB_COMPLETION_IN_THREAD) {
-+ TRACE_DBG("creating IB completion thread for session %s",
-+ ch->sess_name);
-+
-+ ch->thread = kthread_run(srpt_compl_thread, ch,
-+ "ib_srpt_compl");
-+ if (IS_ERR(ch->thread)) {
-+ PRINT_ERROR("failed to create kernel thread %ld",
-+ PTR_ERR(ch->thread));
-+ ch->thread = NULL;
-+ goto err_destroy_qp;
-+ }
-+ } else
-+ ib_req_notify_cq(ch->cq, IB_CQ_NEXT_COMP);
++ }
+
+out:
+ kfree(qp_init);
@@ -76860,7 +76862,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ break;
+ case CH_DISCONNECTING:
+ case CH_DRAINING:
-+ case CH_RELEASING:
++ case CH_FREEING:
+ break;
+ }
+
@@ -76905,14 +76907,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ if (ret < 0)
+ PRINT_ERROR("Setting queue pair in error state"
+ " failed: %d", ret);
-+ } else
-+ TRACE_DBG("Channel already in state %d",
-+ atomic_read(&ch->state));
++ }
+}
+
-+/**
-+ * srpt_free_ch() - Release all resources associated with an RDMA channel.
-+ */
+static void srpt_free_ch(struct scst_session *sess)
+{
+ struct srpt_rdma_ch *ch;
@@ -76921,36 +76918,39 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ TRACE_ENTRY();
+
+ ch = scst_sess_get_tgt_priv(sess);
-+ BUG_ON(!ch);
+ BUG_ON(ch->scst_sess != sess);
+ sdev = ch->sport->sdev;
+ BUG_ON(!sdev);
+
-+ WARN_ON(atomic_read(&ch->state) != CH_RELEASING);
++ WARN_ON(!srpt_test_and_set_ch_state(ch, CH_DRAINING, CH_FREEING));
++ WARN_ON(!ch->last_wqe_received);
+
+ BUG_ON(!ch->thread);
+ BUG_ON(ch->thread == current);
-+ kthread_stop(ch->thread);
-+ ch->thread = NULL;
++
++ while (wait_for_completion_timeout(&ch->finished_processing_completions,
++ 10 * HZ) == 0)
++ PRINT_INFO("%s", "Waiting for completion processing thread ...");
+
+ srpt_destroy_ch_ib(ch);
+
+ srpt_free_ioctx_ring((struct srpt_ioctx **)ch->ioctx_ring,
-+ ch->sport->sdev, ch->rq_size,
-+ srp_max_rsp_size, DMA_TO_DEVICE);
++ sdev, ch->rq_size,
++ ch->max_rsp_size, DMA_TO_DEVICE);
+
+ spin_lock_irq(&sdev->spinlock);
+ list_del(&ch->list);
+ spin_unlock_irq(&sdev->spinlock);
+
-+ TRACE_DBG("destroying cm_id %p", ch->cm_id);
-+ BUG_ON(!ch->cm_id);
+ ib_destroy_cm_id(ch->cm_id);
+
-+ wake_up(&sdev->ch_releaseQ);
++ kthread_stop(ch->thread);
++ ch->thread = NULL;
+
+ kfree(ch);
+
++ wake_up(&sdev->ch_releaseQ);
++
+ TRACE_EXIT();
+}
+
@@ -76998,7 +76998,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+/**
+ * srpt_cm_req_recv() - Process the event IB_CM_REQ_RECEIVED.
+ *
-+ * Ownership of the cm_id is transferred to the SCST session if this functions
++ * Ownership of the cm_id is transferred to the SCST session if this function
+ * returns zero. Otherwise the caller remains the owner of cm_id.
+ */
+static int srpt_cm_req_recv(struct ib_cm_id *cm_id,
@@ -77010,7 +77010,8 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ struct srp_login_rsp *rsp;
+ struct srp_login_rej *rej;
+ struct ib_cm_rep_param *rep_param;
-+ struct srpt_rdma_ch *ch, *tmp_ch;
++ struct srpt_rdma_ch *ch;
++ struct task_struct *thread;
+ u32 it_iu_len;
+ int i;
+ int ret = 0;
@@ -77046,7 +77047,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ }
+
+ if (it_iu_len > srp_max_req_size || it_iu_len < 64) {
-+ rej->reason = __constant_cpu_to_be32(
++ rej->reason = cpu_to_be32(
+ SRP_LOGIN_REJ_REQ_IT_IU_LENGTH_TOO_LARGE);
+ ret = -EINVAL;
+ PRINT_ERROR("rejected SRP_LOGIN_REQ because its"
@@ -77056,48 +77057,19 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ }
+
+ if (!srpt_is_target_enabled(sdev->scst_tgt)) {
-+ rej->reason = __constant_cpu_to_be32(
++ rej->reason = cpu_to_be32(
+ SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
+ ret = -EINVAL;
-+ PRINT_ERROR("rejected SRP_LOGIN_REQ because the target %s"
-+ " has not yet been enabled", sdev->device->name);
++ PRINT_ERROR("rejected SRP_LOGIN_REQ because the target %s (%s)"
++ " has not yet been enabled",
++ sdev->scst_tgt->tgt_name, sdev->device->name);
+ goto reject;
+ }
+
-+ if ((req->req_flags & SRP_MTCH_ACTION) == SRP_MULTICHAN_SINGLE) {
-+ rsp->rsp_flags = SRP_LOGIN_RSP_MULTICHAN_NO_CHAN;
-+
-+ spin_lock_irq(&sdev->spinlock);
-+
-+ list_for_each_entry_safe(ch, tmp_ch, &sdev->rch_list, list) {
-+ if (!memcmp(ch->i_port_id, req->initiator_port_id, 16)
-+ && !memcmp(ch->t_port_id, req->target_port_id, 16)
-+ && param->port == ch->sport->port
-+ && param->listen_id == ch->sport->sdev->cm_id
-+ && ch->cm_id) {
-+ if (!__srpt_close_ch(ch))
-+ continue;
-+
-+ /* found an existing channel */
-+ TRACE_DBG("Found existing channel name= %s"
-+ " cm_id= %p state= %d",
-+ ch->sess_name, ch->cm_id,
-+ atomic_read(&ch->state));
-+
-+ rsp->rsp_flags =
-+ SRP_LOGIN_RSP_MULTICHAN_TERMINATED;
-+ }
-+ }
-+
-+ spin_unlock_irq(&sdev->spinlock);
-+
-+ } else
-+ rsp->rsp_flags = SRP_LOGIN_RSP_MULTICHAN_MAINTAINED;
-+
+ if (*(__be64 *)req->target_port_id != cpu_to_be64(srpt_service_guid)
+ || *(__be64 *)(req->target_port_id + 8) !=
+ cpu_to_be64(srpt_service_guid)) {
-+ rej->reason = __constant_cpu_to_be32(
++ rej->reason = cpu_to_be32(
+ SRP_LOGIN_REJ_UNABLE_ASSOCIATE_CHANNEL);
+ ret = -ENOMEM;
+ PRINT_ERROR("%s", "rejected SRP_LOGIN_REQ because it"
@@ -77107,8 +77079,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+
+ ch = kzalloc(sizeof *ch, GFP_KERNEL);
+ if (!ch) {
-+ rej->reason = __constant_cpu_to_be32(
-+ SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
++ rej->reason = cpu_to_be32(SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
+ PRINT_ERROR("%s",
+ "rejected SRP_LOGIN_REQ because out of memory.");
+ ret = -ENOMEM;
@@ -77125,17 +77096,20 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ * for the SRP protocol to the SCST SCSI command queue size.
+ */
+ ch->rq_size = min(SRPT_RQ_SIZE, scst_get_max_lun_commands(NULL, 0));
-+ atomic_set(&ch->processing_compl, 0);
-+ atomic_set(&ch->state, CH_CONNECTING);
-+ INIT_LIST_HEAD(&ch->cmd_wait_list);
-+
+ spin_lock_init(&ch->spinlock);
++ ch->state = CH_CONNECTING;
++ INIT_LIST_HEAD(&ch->cmd_wait_list);
++ init_waitqueue_head(&ch->state_wq);
++ init_completion(&ch->finished_processing_completions);
++ ch->max_rsp_size = max_t(uint32_t, srp_max_rsp_size, MIN_MAX_RSP_SIZE);
+ ch->ioctx_ring = (struct srpt_send_ioctx **)
+ srpt_alloc_ioctx_ring(ch->sport->sdev, ch->rq_size,
+ sizeof(*ch->ioctx_ring[0]),
-+ srp_max_rsp_size, DMA_TO_DEVICE);
-+ if (!ch->ioctx_ring)
++ ch->max_rsp_size, DMA_TO_DEVICE);
++ if (!ch->ioctx_ring) {
++ rej->reason = cpu_to_be32(SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
+ goto free_ch;
++ }
+
+ INIT_LIST_HEAD(&ch->free_list);
+ for (i = 0; i < ch->rq_size; i++) {
@@ -77145,22 +77119,12 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+
+ ret = srpt_create_ch_ib(ch);
+ if (ret) {
-+ rej->reason = __constant_cpu_to_be32(
-+ SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
++ rej->reason = cpu_to_be32(SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
+ PRINT_ERROR("%s", "rejected SRP_LOGIN_REQ because creating"
+ " a new RDMA channel failed.");
+ goto free_ring;
+ }
+
-+ ret = srpt_ch_qp_rtr(ch, ch->qp);
-+ if (ret) {
-+ rej->reason = __constant_cpu_to_be32(
-+ SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
-+ PRINT_ERROR("rejected SRP_LOGIN_REQ because enabling"
-+ " RTR failed (error code = %d)", ret);
-+ goto destroy_ib;
-+ }
-+
+ if (use_port_guid_in_session_name) {
+ /*
+ * If the kernel module parameter use_port_guid_in_session_name
@@ -77191,10 +77155,54 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ ch->scst_sess = scst_register_session(sdev->scst_tgt, 0, ch->sess_name,
+ ch, NULL, NULL);
+ if (!ch->scst_sess) {
-+ rej->reason = __constant_cpu_to_be32(
-+ SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
++ rej->reason = cpu_to_be32(SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
+ TRACE_DBG("%s", "Failed to create SCST session");
-+ goto release_channel;
++ goto destroy_ib;
++ }
++
++ thread = kthread_run(srpt_compl_thread, ch, "srpt_%s",
++ ch->sport->sdev->device->name);
++ if (IS_ERR(thread)) {
++ rej->reason = cpu_to_be32(SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
++ PRINT_ERROR("failed to create kernel thread %ld", PTR_ERR(ch->thread));
++ goto unreg_ch;
++ }
++
++ spin_lock_irq(&sdev->spinlock);
++ if ((req->req_flags & SRP_MTCH_ACTION) == SRP_MULTICHAN_SINGLE) {
++ struct srpt_rdma_ch *ch2;
++
++ rsp->rsp_flags = SRP_LOGIN_RSP_MULTICHAN_NO_CHAN;
++ list_for_each_entry(ch2, &sdev->rch_list, list) {
++ if (!memcmp(ch2->i_port_id, req->initiator_port_id, 16)
++ && !memcmp(ch2->t_port_id, req->target_port_id, 16)
++ && param->port == ch2->sport->port
++ && param->listen_id == ch2->sport->sdev->cm_id
++ && ch2->cm_id) {
++ if (!__srpt_close_ch(ch2))
++ continue;
++
++ PRINT_INFO("Relogin - closed existing channel"
++ " %s; cm_id = %p", ch2->sess_name,
++ ch2->cm_id);
++
++ rsp->rsp_flags =
++ SRP_LOGIN_RSP_MULTICHAN_TERMINATED;
++ }
++ }
++ } else {
++ rsp->rsp_flags = SRP_LOGIN_RSP_MULTICHAN_MAINTAINED;
++ }
++ list_add_tail(&ch->list, &sdev->rch_list);
++ ch->thread = thread;
++ spin_unlock_irq(&sdev->spinlock);
++
++ ret = srpt_ch_qp_rtr(ch, ch->qp);
++ if (ret) {
++ rej->reason = cpu_to_be32(SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
++ PRINT_ERROR("rejected SRP_LOGIN_REQ because enabling"
++ " RTR failed (error code = %d)", ret);
++ goto reject_and_release;
+ }
+
+ TRACE_DBG("Establish connection sess=%p name=%s cm_id=%p",
@@ -77206,11 +77214,11 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ rsp->max_it_iu_len = req->req_it_iu_len;
+ rsp->max_ti_iu_len = req->req_it_iu_len;
+ ch->max_ti_iu_len = it_iu_len;
-+ rsp->buf_fmt = __constant_cpu_to_be16(SRP_BUF_FORMAT_DIRECT
-+ | SRP_BUF_FORMAT_INDIRECT);
++ rsp->buf_fmt = cpu_to_be16(SRP_BUF_FORMAT_DIRECT |
++ SRP_BUF_FORMAT_INDIRECT);
+ rsp->req_lim_delta = cpu_to_be32(ch->rq_size);
-+ atomic_set(&ch->req_lim, ch->rq_size);
-+ atomic_set(&ch->req_lim_delta, 0);
++ ch->req_lim = ch->rq_size;
++ ch->req_lim_delta = 0;
+
+ /* create cm reply */
+ rep_param->qp_num = ch->qp->qp_num;
@@ -77223,23 +77231,46 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ rep_param->responder_resources = 4;
+ rep_param->initiator_depth = 4;
+
-+ ret = ib_send_cm_rep(cm_id, rep_param);
-+ if (ret) {
++ spin_lock_irq(&sdev->spinlock);
++ if (ch->state == CH_CONNECTING)
++ ret = ib_send_cm_rep(cm_id, rep_param);
++ else
++ ret = -ECONNABORTED;
++ spin_unlock_irq(&sdev->spinlock);
++
++ switch (ret) {
++ case 0:
++ break;
++ case -ECONNABORTED:
++ goto out_keep_cm_id;
++ default:
++ rej->reason = cpu_to_be32(SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
+ PRINT_ERROR("sending SRP_LOGIN_REQ response failed"
+ " (error code = %d)", ret);
-+ goto release_channel;
++ goto reject_and_release;
+ }
+
-+ spin_lock_irq(&sdev->spinlock);
-+ list_add_tail(&ch->list, &sdev->rch_list);
-+ spin_unlock_irq(&sdev->spinlock);
++ goto out;
+
++reject_and_release:
++ PRINT_INFO("Rejecting login with reason %#x", be32_to_cpu(rej->reason));
++ rej->opcode = SRP_LOGIN_REJ;
++ rej->tag = req->tag;
++ rej->buf_fmt = cpu_to_be16(SRP_BUF_FORMAT_DIRECT |
++ SRP_BUF_FORMAT_INDIRECT);
++ ib_send_cm_rej(cm_id, IB_CM_REJ_CONSUMER_DEFINED, NULL, 0,
++ (void *)rej, sizeof *rej);
++
++ srpt_close_ch(ch);
++out_keep_cm_id:
++ /*
++ * Tell the caller not to free cm_id since srpt_free_ch() will do that.
++ */
++ ret = 0;
+ goto out;
+
-+release_channel:
-+ atomic_set(&ch->state, CH_DISCONNECTING);
-+ scst_unregister_session(ch->scst_sess, false, NULL);
-+ ch->scst_sess = NULL;
++unreg_ch:
++ scst_unregister_session(ch->scst_sess, true, NULL);
+
+destroy_ib:
+ srpt_destroy_ch_ib(ch);
@@ -77247,17 +77278,18 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+free_ring:
+ srpt_free_ioctx_ring((struct srpt_ioctx **)ch->ioctx_ring,
+ ch->sport->sdev, ch->rq_size,
-+ srp_max_rsp_size, DMA_TO_DEVICE);
++ ch->max_rsp_size, DMA_TO_DEVICE);
+
+free_ch:
++ cm_id->context = NULL;
+ kfree(ch);
+
+reject:
++ PRINT_INFO("Rejecting login with reason %#x", be32_to_cpu(rej->reason));
+ rej->opcode = SRP_LOGIN_REJ;
+ rej->tag = req->tag;
-+ rej->buf_fmt = __constant_cpu_to_be16(SRP_BUF_FORMAT_DIRECT
-+ | SRP_BUF_FORMAT_INDIRECT);
-+
++ rej->buf_fmt = cpu_to_be16(SRP_BUF_FORMAT_DIRECT |
++ SRP_BUF_FORMAT_INDIRECT);
+ ib_send_cm_rej(cm_id, IB_CM_REJ_CONSUMER_DEFINED, NULL, 0,
+ (void *)rej, sizeof *rej);
+
@@ -77276,7 +77308,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+}
+
+/**
-+ * srpt_cm_rtu_recv() - Process an IB_CM_RTU_RECEIVED or IB_CM_USER_ESTABLISHED event.
++ * srpt_cm_rtu_recv() - Process IB CM RTU_RECEIVED and USER_ESTABLISHED events.
+ *
+ * An IB_CM_RTU_RECEIVED message indicates that the connection is established
+ * and that the recipient may begin transmitting (RTU = ready to use).
@@ -77286,12 +77318,10 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ struct srpt_rdma_ch *ch;
+ int ret;
+
-+ TRACE_ENTRY();
-+
+ ch = cm_id->context;
+ BUG_ON(!ch);
+
-+ if (srpt_test_and_set_channel_state(ch, CH_CONNECTING, CH_LIVE)) {
++ if (srpt_test_and_set_ch_state(ch, CH_CONNECTING, CH_LIVE)) {
+ struct srpt_recv_ioctx *ioctx, *ioctx_tmp;
+
+ ret = srpt_ch_qp_rts(ch, ch->qp);
@@ -77305,8 +77335,6 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ if (ret)
+ srpt_close_ch(ch);
+ }
-+
-+ TRACE_EXIT();
+}
+
+static void srpt_cm_timewait_exit(struct ib_cm_id *cm_id)
@@ -77340,7 +77368,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ PRINT_ERROR("%s", "Sending DREP failed");
+ break;
+ default:
-+ __WARN();
++ WARN_ON(true);
+ break;
+ }
+}
@@ -77360,7 +77388,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ * A non-zero return value will cause the caller destroy the CM ID.
+ *
+ * Note: srpt_cm_handler() must only return a non-zero value when transferring
-+ * ownership of the cm_id to a channel by srpt_cm_req_recv() failed. Returning
++ * ownership of the cm_id to a channel if srpt_cm_req_recv() failed. Returning
+ * a non-zero value in any other case will trigger a race with the
+ * ib_destroy_cm_id() call in srpt_free_ch().
+ */
@@ -77368,6 +77396,8 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+{
+ int ret;
+
++ BUG_ON(!cm_id->context);
++
+ ret = 0;
+ switch (event->event) {
+ case IB_CM_REQ_RECEIVED:
@@ -77421,17 +77451,19 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ struct rdma_iu *riu;
+ struct srp_direct_buf *db;
+ dma_addr_t dma_addr;
-+ struct ib_sge *sge;
++ struct ib_sge *sge_array, *sge;
+ u64 raddr;
+ u32 rsize;
+ u32 tsize;
+ u32 dma_len;
-+ int count, nrdma;
++ int count;
+ int i, j, k;
++ int max_sge, nsge;
+
+ BUG_ON(!ch);
+ BUG_ON(!ioctx);
+ BUG_ON(!scmnd);
++ max_sge = ch->max_sge;
+ dir = scst_cmd_get_data_direction(scmnd);
+ BUG_ON(dir == SCST_DATA_NONE);
+ /*
@@ -77456,19 +77488,20 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+
+ ioctx->mapped_sg_count = count;
+
-+ if (ioctx->rdma_ius && ioctx->n_rdma_ius)
-+ nrdma = ioctx->n_rdma_ius;
-+ else {
-+ nrdma = (count + SRPT_DEF_SG_PER_WQE - 1) / SRPT_DEF_SG_PER_WQE
-+ + ioctx->n_rbuf;
-+
-+ ioctx->rdma_ius = kzalloc(nrdma * sizeof *riu,
-+ scst_cmd_atomic(scmnd)
-+ ? GFP_ATOMIC : GFP_KERNEL);
++ {
++ int size, nrdma;
++
++ nrdma = (count + max_sge - 1) / max_sge + ioctx->n_rbuf;
++ nsge = count + ioctx->n_rbuf;
++ size = nrdma * sizeof(*riu) + nsge * sizeof(*sge);
++ ioctx->rdma_ius = size <= sizeof(ioctx->rdma_ius_buf) ?
++ ioctx->rdma_ius_buf : kmalloc(size,
++ scst_cmd_atomic(scmnd) ? GFP_ATOMIC : GFP_KERNEL);
+ if (!ioctx->rdma_ius)
+ goto free_mem;
+
+ ioctx->n_rdma_ius = nrdma;
++ sge_array = (struct ib_sge *)(ioctx->rdma_ius + nrdma);
+ }
+
+ db = ioctx->rbufs;
@@ -77477,6 +77510,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ : scst_cmd_get_bufflen(scmnd);
+ dma_len = sg_dma_len(&sg[0]);
+ riu = ioctx->rdma_ius;
++ sge = sge_array;
+
+ /*
+ * For each remote desc - calculate the #ib_sge.
@@ -77493,6 +77527,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ riu->raddr = raddr;
+ riu->rkey = be32_to_cpu(db->key);
+ riu->sge_cnt = 0;
++ riu->sge = sge;
+
+ /* calculate how many sge required for this remote_buf */
+ while (rsize > 0 && tsize > 0) {
@@ -77514,33 +77549,21 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ }
+
+ ++riu->sge_cnt;
++ ++sge;
+
-+ if (rsize > 0 && riu->sge_cnt == SRPT_DEF_SG_PER_WQE) {
-+ ++ioctx->n_rdma;
-+ riu->sge =
-+ kmalloc(riu->sge_cnt * sizeof *riu->sge,
-+ scst_cmd_atomic(scmnd)
-+ ? GFP_ATOMIC : GFP_KERNEL);
-+ if (!riu->sge)
-+ goto free_mem;
-+
++ if (rsize > 0 && riu->sge_cnt == max_sge) {
+ ++riu;
-+ riu->sge_cnt = 0;
+ riu->raddr = raddr;
+ riu->rkey = be32_to_cpu(db->key);
++ riu->sge_cnt = 0;
++ riu->sge = sge;
+ }
+ }
-+
-+ ++ioctx->n_rdma;
-+ riu->sge = kmalloc(riu->sge_cnt * sizeof *riu->sge,
-+ scst_cmd_atomic(scmnd)
-+ ? GFP_ATOMIC : GFP_KERNEL);
-+ if (!riu->sge)
-+ goto free_mem;
+ }
+
-+ EXTRACHECKS_WARN_ON(riu - ioctx->rdma_ius != ioctx->n_rdma);
++ ioctx->n_rdma = riu - ioctx->rdma_ius;
+ EXTRACHECKS_WARN_ON(ioctx->n_rdma > ioctx->n_rdma_ius);
++ EXTRACHECKS_WARN_ON(sge - sge_array > nsge);
+
+ db = ioctx->rbufs;
+ tsize = (dir == SCST_DATA_READ)
@@ -77616,11 +77639,10 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ EXTRACHECKS_BUG_ON(!ioctx);
+ EXTRACHECKS_BUG_ON(ioctx->n_rdma && !ioctx->rdma_ius);
+
-+ while (ioctx->n_rdma)
-+ kfree(ioctx->rdma_ius[--ioctx->n_rdma].sge);
-+
-+ kfree(ioctx->rdma_ius);
++ if (ioctx->rdma_ius != (void *)ioctx->rdma_ius_buf)
++ kfree(ioctx->rdma_ius);
+ ioctx->rdma_ius = NULL;
++ ioctx->n_rdma = 0;
+
+ if (ioctx->mapped_sg_count) {
+ EXTRACHECKS_BUG_ON(!ioctx->scmnd);
@@ -77655,8 +77677,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+
+ if (dir == SCST_DATA_WRITE) {
+ ret = -ENOMEM;
-+ sq_wr_avail = atomic_sub_return(ioctx->n_rdma,
-+ &ch->sq_wr_avail);
++ sq_wr_avail = srpt_adjust_srq_wr_avail(ch, -n_rdma);
+ if (sq_wr_avail < 0) {
+ PRINT_WARNING("IB send queue full (needed %d)",
+ n_rdma);
@@ -77705,14 +77726,13 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ wr.num_sge = 0;
+ wr.wr_id = encode_wr_id(SRPT_RDMA_ABORT, ioctx->ioctx.index);
+ wr.send_flags = IB_SEND_SIGNALED;
-+ while (atomic_read(&ch->state) == CH_LIVE &&
++ while (ch->state == CH_LIVE &&
+ ib_post_send(ch->qp, &wr, &bad_wr) != 0) {
+ PRINT_INFO("Trying to abort failed RDMA transfer [%d]",
+ ioctx->ioctx.index);
+ msleep(1000);
+ }
-+ while (atomic_read(&ch->state) != CH_DISCONNECTING &&
-+ !ioctx->rdma_aborted) {
++ while (ch->state != CH_DRAINING && !ioctx->rdma_aborted) {
+ PRINT_INFO("Waiting until RDMA abort finished [%d]",
+ ioctx->ioctx.index);
+ msleep(1000);
@@ -77722,7 +77742,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+
+out:
+ if (unlikely(dir == SCST_DATA_WRITE && ret < 0))
-+ atomic_add(ioctx->n_rdma, &ch->sq_wr_avail);
++ srpt_adjust_srq_wr_avail(ch, n_rdma);
+ return ret;
+}
+
@@ -77783,7 +77803,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ ioctx = scst_cmd_get_tgt_priv(scmnd);
+ BUG_ON(!ioctx);
+
-+ state = srpt_get_cmd_state(ioctx);
++ state = ioctx->state;
+ switch (state) {
+ case SRPT_STATE_NEW:
+ case SRPT_STATE_DATA_IN:
@@ -77805,7 +77825,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ break;
+ }
+
-+ srpt_abort_scst_cmd(ioctx, SCST_CONTEXT_SAME);
++ srpt_abort_cmd(ioctx, SCST_CONTEXT_SAME);
+}
+
+/**
@@ -77816,36 +77836,16 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ */
+static int srpt_rdy_to_xfer(struct scst_cmd *scmnd)
+{
-+ struct srpt_rdma_ch *ch;
+ struct srpt_send_ioctx *ioctx;
-+ enum srpt_command_state new_state;
-+ enum rdma_ch_state ch_state;
++ enum srpt_command_state prev_cmd_state;
+ int ret;
+
+ ioctx = scst_cmd_get_tgt_priv(scmnd);
-+ BUG_ON(!ioctx);
-+
-+ new_state = srpt_set_cmd_state(ioctx, SRPT_STATE_NEED_DATA);
-+ WARN_ON(new_state == SRPT_STATE_DONE);
-+
-+ ch = ioctx->ch;
-+ WARN_ON(ch != scst_sess_get_tgt_priv(scst_cmd_get_session(scmnd)));
-+ BUG_ON(!ch);
++ prev_cmd_state = srpt_set_cmd_state(ioctx, SRPT_STATE_NEED_DATA);
++ ret = srpt_xfer_data(ioctx->ch, ioctx, scmnd);
++ if (unlikely(ret != SCST_TGT_RES_SUCCESS))
++ srpt_set_cmd_state(ioctx, prev_cmd_state);
+
-+ ch_state = atomic_read(&ch->state);
-+ if (ch_state == CH_DISCONNECTING) {
-+ TRACE_DBG("cmd with tag %lld: channel disconnecting",
-+ scst_cmd_get_tag(scmnd));
-+ srpt_set_cmd_state(ioctx, SRPT_STATE_DATA_IN);
-+ ret = SCST_TGT_RES_FATAL_ERROR;
-+ goto out;
-+ } else if (ch_state == CH_CONNECTING) {
-+ ret = SCST_TGT_RES_QUEUE_FULL;
-+ goto out;
-+ }
-+ ret = srpt_xfer_data(ch, ioctx, scmnd);
-+
-+out:
+ return ret;
+}
+
@@ -77872,19 +77872,22 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ ch = scst_sess_get_tgt_priv(scst_cmd_get_session(scmnd));
+ BUG_ON(!ch);
+
-+ state = srpt_test_and_set_cmd_state(ioctx, SRPT_STATE_NEW,
-+ SRPT_STATE_CMD_RSP_SENT);
-+ if (state != SRPT_STATE_NEW) {
-+ state = srpt_test_and_set_cmd_state(ioctx, SRPT_STATE_DATA_IN,
-+ SRPT_STATE_CMD_RSP_SENT);
-+ if (state != SRPT_STATE_DATA_IN)
-+ PRINT_ERROR("Unexpected command state %d",
-+ srpt_get_cmd_state(ioctx));
++ spin_lock(&ioctx->spinlock);
++ state = ioctx->state;
++ switch (state) {
++ case SRPT_STATE_NEW:
++ case SRPT_STATE_DATA_IN:
++ ioctx->state = SRPT_STATE_CMD_RSP_SENT;
++ break;
++ default:
++ WARN(true, "Unexpected command state %d", state);
++ break;
+ }
++ spin_unlock(&ioctx->spinlock);
+
+ if (unlikely(scst_cmd_aborted(scmnd))) {
-+ atomic_inc(&ch->req_lim_delta);
-+ srpt_abort_scst_cmd(ioctx, SCST_CONTEXT_SAME);
++ srpt_adjust_req_lim(ch, 0, 1);
++ srpt_abort_cmd(ioctx, SCST_CONTEXT_SAME);
+ goto out;
+ }
+
@@ -77906,8 +77909,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ }
+ }
+
-+ atomic_inc(&ch->req_lim);
-+
++ ioctx->req_lim_delta = srpt_inc_req_lim(ch);
+ resp_len = srpt_build_cmd_rsp(ch, ioctx,
+ scst_cmd_get_tag(scmnd),
+ scst_cmd_get_status(scmnd),
@@ -77917,7 +77919,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ if (srpt_post_send(ch, ioctx, resp_len)) {
+ srpt_unmap_sg_to_ib_sge(ch, ioctx);
+ srpt_set_cmd_state(ioctx, state);
-+ atomic_dec(&ch->req_lim);
++ srpt_undo_inc_req_lim(ch, ioctx->req_lim_delta);
+ PRINT_WARNING("sending response failed for tag %llu - retrying",
+ scst_cmd_get_tag(scmnd));
+ ret = SCST_TGT_RES_QUEUE_FULL;
@@ -77936,34 +77938,29 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+static void srpt_tsk_mgmt_done(struct scst_mgmt_cmd *mcmnd)
+{
+ struct srpt_rdma_ch *ch;
-+ struct srpt_mgmt_ioctx *mgmt_ioctx;
+ struct srpt_send_ioctx *ioctx;
-+ enum srpt_command_state new_state;
+ int rsp_len;
+
-+ mgmt_ioctx = scst_mgmt_cmd_get_tgt_priv(mcmnd);
-+ BUG_ON(!mgmt_ioctx);
-+
-+ ioctx = mgmt_ioctx->ioctx;
++ ioctx = scst_mgmt_cmd_get_tgt_priv(mcmnd);
+ BUG_ON(!ioctx);
+
+ ch = ioctx->ch;
+ BUG_ON(!ch);
+
+ TRACE_DBG("%s: tsk_mgmt_done for tag= %lld status=%d",
-+ __func__, mgmt_ioctx->tag, scst_mgmt_cmd_get_status(mcmnd));
++ __func__, ioctx->tsk_mgmt.tag,
++ scst_mgmt_cmd_get_status(mcmnd));
+
+ WARN_ON(in_irq());
+
-+ new_state = srpt_set_cmd_state(ioctx, SRPT_STATE_MGMT_RSP_SENT);
-+ WARN_ON(new_state == SRPT_STATE_DONE);
-+
-+ atomic_inc(&ch->req_lim);
++ srpt_set_cmd_state(ioctx, SRPT_STATE_MGMT_RSP_SENT);
++ WARN_ON(ioctx->state == SRPT_STATE_DONE);
+
++ ioctx->req_lim_delta = srpt_inc_req_lim(ch);
+ rsp_len = srpt_build_tskmgmt_rsp(ch, ioctx,
+ scst_to_srp_tsk_mgmt_status(
+ scst_mgmt_cmd_get_status(mcmnd)),
-+ mgmt_ioctx->tag);
++ ioctx->tsk_mgmt.tag);
+ /*
+ * Note: the srpt_post_send() call below sends the task management
+ * response asynchronously. It is possible that the SCST core has
@@ -77972,14 +77969,9 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ */
+ if (srpt_post_send(ch, ioctx, rsp_len)) {
+ PRINT_ERROR("%s", "Sending SRP_RSP response failed.");
-+ srpt_set_cmd_state(ioctx, SRPT_STATE_DONE);
+ srpt_put_send_ioctx(ioctx);
-+ atomic_dec(&ch->req_lim);
++ srpt_undo_inc_req_lim(ch, ioctx->req_lim_delta);
+ }
-+
-+ scst_mgmt_cmd_set_tgt_priv(mcmnd, NULL);
-+
-+ kfree(mgmt_ioctx);
+}
+
+/**
@@ -78096,10 +78088,11 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ PRINT_INFO("%s: waiting for session unregistration ...",
+ sdev->device->name);
+ spin_lock_irq(&sdev->spinlock);
-+ list_for_each_entry_safe(ch, next_ch, &sdev->rch_list, list)
-+ PRINT_INFO("%s: %d commands in progress",
-+ ch->sess_name,
++ list_for_each_entry_safe(ch, next_ch, &sdev->rch_list, list) {
++ PRINT_INFO("%s: state %s; %d commands in progress",
++ ch->sess_name, get_ch_state_name(ch->state),
+ atomic_read(&ch->scst_sess->sess_cmd_count));
++ }
+ spin_unlock_irq(&sdev->spinlock);
+ }
+
@@ -78196,7 +78189,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ ch = scst_sess_get_tgt_priv(scst_sess);
+ if (!ch)
+ return -ENOENT;
-+ return sprintf(buf, "%d\n", atomic_read(&ch->req_lim));
++ return sprintf(buf, "%d\n", ch->req_lim);
+}
+
+static ssize_t show_req_lim_delta(struct kobject *kobj,
@@ -78209,17 +78202,33 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ ch = scst_sess_get_tgt_priv(scst_sess);
+ if (!ch)
+ return -ENOENT;
-+ return sprintf(buf, "%d\n", atomic_read(&ch->req_lim_delta));
++ return sprintf(buf, "%d\n", ch->req_lim_delta);
++}
++
++static ssize_t show_ch_state(struct kobject *kobj, struct kobj_attribute *attr,
++ char *buf)
++{
++ struct scst_session *scst_sess;
++ struct srpt_rdma_ch *ch;
++
++ scst_sess = container_of(kobj, struct scst_session, sess_kobj);
++ ch = scst_sess_get_tgt_priv(scst_sess);
++ if (!ch)
++ return -ENOENT;
++ return sprintf(buf, "%s\n", get_ch_state_name(ch->state));
+}
+
+static const struct kobj_attribute srpt_req_lim_attr =
+ __ATTR(req_lim, S_IRUGO, show_req_lim, NULL);
+static const struct kobj_attribute srpt_req_lim_delta_attr =
+ __ATTR(req_lim_delta, S_IRUGO, show_req_lim_delta, NULL);
++static const struct kobj_attribute srpt_ch_state_attr =
++ __ATTR(ch_state, S_IRUGO, show_ch_state, NULL);
+
+static const struct attribute *srpt_sess_attrs[] = {
+ &srpt_req_lim_attr.attr,
+ &srpt_req_lim_delta_attr.attr,
++ &srpt_ch_state_attr.attr,
+ NULL
+};
+
@@ -78256,7 +78265,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ struct srpt_port *sport;
+ struct ib_srq_init_attr srq_attr;
+ char tgt_name[24];
-+ int i;
++ int i, ret;
+
+ TRACE_ENTRY();
+
@@ -78288,38 +78297,54 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+
+ scst_tgt_set_tgt_priv(sdev->scst_tgt, sdev);
+
-+ if (ib_query_device(device, &sdev->dev_attr))
++ ret = ib_query_device(device, &sdev->dev_attr);
++ if (ret) {
++ PRINT_ERROR("ib_query_device() failed: %d", ret);
+ goto unregister_tgt;
++ }
+
+ sdev->pd = ib_alloc_pd(device);
-+ if (IS_ERR(sdev->pd))
++ if (IS_ERR(sdev->pd)) {
++ PRINT_ERROR("ib_alloc_pd() failed: %ld", PTR_ERR(sdev->pd));
+ goto unregister_tgt;
++ }
+
+ sdev->mr = ib_get_dma_mr(sdev->pd, IB_ACCESS_LOCAL_WRITE);
-+ if (IS_ERR(sdev->mr))
++ if (IS_ERR(sdev->mr)) {
++ PRINT_ERROR("ib_get_dma_mr() failed: %ld", PTR_ERR(sdev->mr));
+ goto err_pd;
++ }
+
-+ sdev->srq_size = min(srpt_srq_size, sdev->dev_attr.max_srq_wr);
++ sdev->srq_size = min(max(srpt_srq_size, MIN_SRPT_SRQ_SIZE),
++ sdev->dev_attr.max_srq_wr);
+
++ memset(&srq_attr, 0, sizeof(srq_attr));
+ srq_attr.event_handler = srpt_srq_event;
+ srq_attr.srq_context = (void *)sdev;
+ srq_attr.attr.max_wr = sdev->srq_size;
+ srq_attr.attr.max_sge = 1;
+ srq_attr.attr.srq_limit = 0;
++ srq_attr.srq_type = IB_SRQT_BASIC;
+
+ sdev->srq = ib_create_srq(sdev->pd, &srq_attr);
-+ if (IS_ERR(sdev->srq))
++ if (IS_ERR(sdev->srq)) {
++ PRINT_ERROR("ib_create_srq() failed: %ld", PTR_ERR(sdev->srq));
+ goto err_mr;
++ }
+
+ TRACE_DBG("%s: create SRQ #wr= %d max_allow=%d dev= %s", __func__,
+ sdev->srq_size, sdev->dev_attr.max_srq_wr, device->name);
+
+ if (!srpt_service_guid)
-+ srpt_service_guid = be64_to_cpu(device->node_guid);
++ srpt_service_guid = be64_to_cpu(device->node_guid) &
++ ~be64_to_cpu(IB_SERVICE_ID_AGN_MASK);
+
+ sdev->cm_id = ib_create_cm_id(device, srpt_cm_handler, sdev);
-+ if (IS_ERR(sdev->cm_id))
++ if (IS_ERR(sdev->cm_id)) {
++ PRINT_ERROR("ib_create_cm_id() failed: %ld",
++ PTR_ERR(sdev->cm_id));
+ goto err_srq;
++ }
+
+ /* print out target login information */
+ TRACE_DBG("Target login info: id_ext=%016llx,"
@@ -78332,26 +78357,35 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ * in the system as service_id; therefore, the target_id will change
+ * if this HCA is gone bad and replaced by different HCA
+ */
-+ if (ib_cm_listen(sdev->cm_id, cpu_to_be64(srpt_service_guid), 0, NULL))
++ ret = ib_cm_listen(sdev->cm_id, cpu_to_be64(srpt_service_guid), 0,
++ NULL);
++ if (ret) {
++ PRINT_ERROR("ib_cm_listen() failed: %d (cm_id state = %d)",
++ ret, sdev->cm_id->state);
+ goto err_cm;
++ }
+
+ INIT_IB_EVENT_HANDLER(&sdev->event_handler, sdev->device,
+ srpt_event_handler);
-+ if (ib_register_event_handler(&sdev->event_handler))
++ ret = ib_register_event_handler(&sdev->event_handler);
++ if (ret) {
++ PRINT_ERROR("ib_register_event_handler() failed: %d", ret);
+ goto err_cm;
++ }
+
+ sdev->ioctx_ring = (struct srpt_recv_ioctx **)
+ srpt_alloc_ioctx_ring(sdev, sdev->srq_size,
+ sizeof(*sdev->ioctx_ring[0]),
+ srp_max_req_size, DMA_FROM_DEVICE);
-+ if (!sdev->ioctx_ring)
++ if (!sdev->ioctx_ring) {
++ PRINT_ERROR("%s", "srpt_alloc_ioctx_ring() failed");
+ goto err_event;
++ }
+
+ for (i = 0; i < sdev->srq_size; ++i)
+ srpt_post_recv(sdev, sdev->ioctx_ring[i]);
+
-+ WARN_ON(sdev->device->phys_port_cnt
-+ > sizeof(sdev->port)/sizeof(sdev->port[0]));
++ WARN_ON(sdev->device->phys_port_cnt > ARRAY_SIZE(sdev->port));
+
+ for (i = 1; i <= sdev->device->phys_port_cnt; i++) {
+ sport = &sdev->port[i - 1];
@@ -78421,9 +78455,6 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ cancel_work_sync(&sdev->port[i].work);
+
+ ib_destroy_cm_id(sdev->cm_id);
-+ ib_destroy_srq(sdev->srq);
-+ ib_dereg_mr(sdev->mr);
-+ ib_dealloc_pd(sdev->pd);
+
+ /*
+ * Unregistering an SCST target must happen after destroying sdev->cm_id
@@ -78433,6 +78464,10 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ scst_unregister_target(sdev->scst_tgt);
+ sdev->scst_tgt = NULL;
+
++ ib_destroy_srq(sdev->srq);
++ ib_dereg_mr(sdev->mr);
++ ib_dealloc_pd(sdev->pd);
++
+ srpt_free_ioctx_ring((struct srpt_ioctx **)sdev->ioctx_ring, sdev,
+ sdev->srq_size, srp_max_req_size, DMA_FROM_DEVICE);
+ sdev->ioctx_ring = NULL;
@@ -78441,6 +78476,12 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ TRACE_EXIT();
+}
+
++static struct ib_client srpt_client = {
++ .name = DRV_NAME,
++ .add = srpt_add_one,
++ .remove = srpt_remove_one
++};
++
+/**
+ * srpt_init_module() - Kernel module initialization.
+ *
@@ -78494,33 +78535,6 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ "update your SCST config file accordingly to use HCAs "
+ "GUIDs.");
+
-+ switch (thread) {
-+ case MODE_ALL_IN_SIRQ:
-+ /*
-+ * Process both IB completions and SCST commands in SIRQ
-+ * context. May lead to soft lockups and other scary behavior
-+ * under sufficient load.
-+ */
-+ srpt_template.rdy_to_xfer_atomic = true;
-+ break;
-+ case MODE_IB_COMPLETION_IN_THREAD:
-+ /*
-+ * Process IB completions in the kernel thread associated with
-+ * the RDMA channel, and process SCST commands in the kernel
-+ * threads created by the SCST core.
-+ */
-+ srpt_template.rdy_to_xfer_atomic = false;
-+ break;
-+ case MODE_IB_COMPLETION_IN_SIRQ:
-+ default:
-+ /*
-+ * Process IB completions in SIRQ context and SCST commands in
-+ * the kernel threads created by the SCST core.
-+ */
-+ srpt_template.rdy_to_xfer_atomic = false;
-+ break;
-+ }
-+
+ ret = scst_register_target_template(&srpt_template);
+ if (ret < 0) {
+ PRINT_ERROR("%s", "couldn't register with scst");
@@ -78561,13 +78575,13 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.c linux-2.6.39/drivers/sc
+ * indent-tabs-mode: t
+ * End:
+ */
-diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.h linux-2.6.39/drivers/scst/srpt/ib_srpt.h
---- orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.h
-+++ linux-2.6.39/drivers/scst/srpt/ib_srpt.h
-@@ -0,0 +1,372 @@
+diff -uprN orig/linux-3.2/drivers/scst/srpt/ib_srpt.h linux-3.2/drivers/scst/srpt/ib_srpt.h
+--- orig/linux-3.2/drivers/scst/srpt/ib_srpt.h
++++ linux-3.2/drivers/scst/srpt/ib_srpt.h
+@@ -0,0 +1,407 @@
+/*
+ * Copyright (c) 2006 - 2009 Mellanox Technology Inc. All rights reserved.
-+ * Copyright (C) 2009 - 2010 Bart Van Assche <bvanassche@acm.org>
++ * Copyright (C) 2009 - 2011 Bart Van Assche <bvanassche@acm.org>.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses. You may choose to be licensed under the terms of the GNU
@@ -78602,23 +78616,19 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.h linux-2.6.39/drivers/sc
+#ifndef IB_SRPT_H
+#define IB_SRPT_H
+
-+#include <linux/version.h>
+#include <linux/types.h>
+#include <linux/list.h>
-+
++#include <linux/wait.h>
+#include <rdma/ib_verbs.h>
+#include <rdma/ib_sa.h>
+#include <rdma/ib_cm.h>
-+
+#include <scsi/srp.h>
-+
+#include <scst/scst.h>
-+
+#include "ib_dm_mad.h"
+
+/*
+ * The prefix the ServiceName field must start with in the device management
-+ * ServiceEntries attribute pair. See also the SRP r16a document.
++ * ServiceEntries attribute pair. See also the SRP specification.
+ */
+#define SRP_SERVICE_NAME_PREFIX "SRP.T10:"
+
@@ -78626,7 +78636,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.h linux-2.6.39/drivers/sc
+ /*
+ * SRP IOControllerProfile attributes for SRP target ports that have
+ * not been defined in <scsi/srp.h>. Source: section B.7, table B.7
-+ * in the SRP r16a document.
++ * in the SRP specification.
+ */
+ SRP_PROTOCOL = 0x0108,
+ SRP_PROTOCOL_VERSION = 0x0001,
@@ -78647,23 +78657,23 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.h linux-2.6.39/drivers/sc
+
+ /*
+ * srp_cmd.sol_nt / srp_tsk_mgmt.sol_not bitmasks. See also tables
-+ * 18 and 20 in the T10 r16a document.
++ * 18 and 20 in the SRP specification.
+ */
+ SRP_SCSOLNT = 0x02, /* SCSOLNT = successful solicited notification */
+ SRP_UCSOLNT = 0x04, /* UCSOLNT = unsuccessful solicited notification */
+
+ /*
+ * srp_rsp.sol_not / srp_t_logout.sol_not bitmasks. See also tables
-+ * 16 and 22 in the T10 r16a document.
++ * 16 and 22 in the SRP specification.
+ */
+ SRP_SOLNT = 0x01, /* SOLNT = solicited notification */
+
-+ /* See also table 24 in the T10 r16a document. */
++ /* See also table 24 in the SRP specification. */
+ SRP_TSK_MGMT_SUCCESS = 0x00,
+ SRP_TSK_MGMT_FUNC_NOT_SUPP = 0x04,
+ SRP_TSK_MGMT_FAILED = 0x05,
+
-+ /* See also table 21 in the T10 r16a document. */
++ /* See also table 21 in the SRP specification. */
+ SRP_CMD_SIMPLE_Q = 0x0,
+ SRP_CMD_HEAD_OF_Q = 0x1,
+ SRP_CMD_ORDERED_Q = 0x2,
@@ -78674,7 +78684,6 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.h linux-2.6.39/drivers/sc
+ SRP_LOGIN_RSP_MULTICHAN_MAINTAINED = 0x2,
+
+ SRPT_DEF_SG_TABLESIZE = 128,
-+ SRPT_DEF_SG_PER_WQE = 16,
+
+ MIN_SRPT_SQ_SIZE = 16,
+ DEF_SRPT_SQ_SIZE = 4096,
@@ -78687,7 +78696,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.h linux-2.6.39/drivers/sc
+ DEFAULT_MAX_REQ_SIZE
+ = sizeof(struct srp_cmd)/*48*/
+ + sizeof(struct srp_indirect_buf)/*20*/
-+ + 128 * sizeof(struct srp_direct_buf)/*16*/,
++ + 255 * sizeof(struct srp_direct_buf)/*16*/,
+
+ MIN_MAX_RSP_SIZE = sizeof(struct srp_rsp)/*36*/ + 4,
+ DEFAULT_MAX_RSP_SIZE = 256, /* leaves 220 bytes for sense data */
@@ -78707,18 +78716,25 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.h linux-2.6.39/drivers/sc
+};
+
+static inline u64 encode_wr_id(enum srpt_opcode opcode, u32 idx)
-+{ return ((u64)opcode << 32) | idx; }
++{
++ return ((u64)opcode << 32) | idx;
++}
++
+static inline enum srpt_opcode opcode_from_wr_id(u64 wr_id)
-+{ return wr_id >> 32; }
++{
++ return wr_id >> 32;
++}
++
+static inline u32 idx_from_wr_id(u64 wr_id)
-+{ return (u32)wr_id; }
++{
++ return (u32)wr_id;
++}
+
+struct rdma_iu {
+ u64 raddr;
+ u32 rkey;
+ struct ib_sge *sge;
+ u32 sge_cnt;
-+ int mem_id;
+};
+
+/**
@@ -78729,18 +78745,20 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.h linux-2.6.39/drivers/sc
+ * @SRPT_STATE_DATA_IN: Data for the write or bidir command arrived and is
+ * being processed.
+ * @SRPT_STATE_CMD_RSP_SENT: SRP_RSP for SRP_CMD has been sent.
++ * @SRPT_STATE_MGMT: Processing a SCSI task management command.
+ * @SRPT_STATE_MGMT_RSP_SENT: SRP_RSP for SRP_TSK_MGMT has been sent.
+ * @SRPT_STATE_DONE: Command processing finished successfully, command
+ * processing has been aborted or command processing
+ * failed.
+ */
+enum srpt_command_state {
-+ SRPT_STATE_NEW = 0,
-+ SRPT_STATE_NEED_DATA = 1,
-+ SRPT_STATE_DATA_IN = 2,
-+ SRPT_STATE_CMD_RSP_SENT = 3,
-+ SRPT_STATE_MGMT_RSP_SENT = 4,
-+ SRPT_STATE_DONE = 5,
++ SRPT_STATE_NEW = 0,
++ SRPT_STATE_NEED_DATA = 1,
++ SRPT_STATE_DATA_IN = 2,
++ SRPT_STATE_CMD_RSP_SENT = 3,
++ SRPT_STATE_MGMT = 4,
++ SRPT_STATE_MGMT_RSP_SENT = 5,
++ SRPT_STATE_DONE = 6,
+};
+
+/**
@@ -78766,10 +78784,36 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.h linux-2.6.39/drivers/sc
+};
+
+/**
++ * struct srpt_tsk_mgmt - SCST management command context information.
++ * @tag: SCSI tag of the management command.
++ */
++struct srpt_tsk_mgmt {
++ u64 tag;
++};
++
++/**
+ * struct srpt_send_ioctx - SRPT send I/O context.
-+ * @ioctx: See above.
-+ * @free_list: Allows to make this struct an entry in srpt_rdma_ch.free_list.
-+ * @state: I/O context state. See also enum srpt_command_state.
++ * @ioctx: See above.
++ * @ch: Channel pointer.
++ * @rdma_ius: Array with information about the RDMA mapping.
++ * @rbufs: Pointer to SRP data buffer array.
++ * @single_rbuf: SRP data buffer if the command has only a single buffer.
++ * @sg: Pointer to sg-list associated with this I/O context.
++ * @spinlock: Protects 'state'.
++ * @state: I/O context state.
++ * @rdma_aborted: If initiating a multipart RDMA transfer failed, whether
++ * the already initiated transfers have finished.
++ * @scmnd: SCST command data structure.
++ * @dir:
++ * @free_list: Node in srpt_rdma_ch.free_list.
++ * @sg_cnt: SG-list size.
++ * @mapped_sg_count: ib_dma_map_sg() return value.
++ * @n_rdma_ius: Size of the rdma_ius array.
++ * @n_rdma: Number of elements used of the rdma_ius array.
++ * @n_rbuf: Number of data buffers in the received SRP command.
++ * @req_lim_delta: Value of the req_lim_delta value field in the latest
++ * SRP response sent.
++ * @tsk_mgmt:
+ */
+struct srpt_send_ioctx {
+ struct srpt_ioctx ioctx;
@@ -78779,26 +78823,21 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.h linux-2.6.39/drivers/sc
+ struct srp_direct_buf single_rbuf;
+ struct scatterlist *sg;
+ struct list_head free_list;
++ spinlock_t spinlock;
++ enum srpt_command_state state;
++ bool rdma_aborted;
++ struct scst_cmd *scmnd;
++ scst_data_direction dir;
+ int sg_cnt;
+ int mapped_sg_count;
+ u16 n_rdma_ius;
+ u8 n_rdma;
+ u8 n_rbuf;
-+
-+ struct scst_cmd *scmnd;
-+ scst_data_direction dir;
-+ atomic_t state;
-+ bool rdma_aborted;
-+};
-+
-+/**
-+ * struct srpt_mgmt_ioctx - SCST management command context information.
-+ * @ioctx: SRPT I/O context associated with the management command.
-+ * @tag: SCSI tag of the management command.
-+ */
-+struct srpt_mgmt_ioctx {
-+ struct srpt_send_ioctx *ioctx;
-+ u64 tag;
++ int req_lim_delta;
++ struct srpt_tsk_mgmt tsk_mgmt;
++ u8 rdma_ius_buf[2 * sizeof(struct rdma_iu)
++ + 2 * sizeof(struct ib_sge)]
++ __aligned(sizeof(uint64_t));
+};
+
+/**
@@ -78808,15 +78847,15 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.h linux-2.6.39/drivers/sc
+ * @CH_DISCONNECTING: DREQ has been received and waiting for DREP or DREQ has
+ * been sent and waiting for DREP or channel is being closed
+ * for another reason.
-+ * @CH_DRAINING: QP is in ERR state; waiting for last WQE event.
-+ * @CH_RELEASING: Last WQE event has been received; releasing resources.
++ * @CH_DRAINING: QP is in ERR state.
++ * @CH_FREEING: QP resources are being freed.
+ */
+enum rdma_ch_state {
+ CH_CONNECTING,
+ CH_LIVE,
+ CH_DISCONNECTING,
+ CH_DRAINING,
-+ CH_RELEASING
++ CH_FREEING,
+};
+
+/**
@@ -78824,26 +78863,30 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.h linux-2.6.39/drivers/sc
+ * @thread: Kernel thread that processes the IB queues associated with
+ * the channel.
+ * @cm_id: IB CM ID associated with the channel.
-+ * @rq_size: IB receive queue size.
-+ * @processing_compl: whether or not an IB completion is being processed.
+ * @qp: IB queue pair used for communicating over this channel.
-+ * @sq_wr_avail: number of work requests available in the send queue.
+ * @cq: IB completion queue for this channel.
++ * @rq_size: IB receive queue size.
++ * @max_sge: Maximum length of RDMA scatter list.
++ * @sq_wr_avail: number of work requests available in the send queue.
+ * @sport: pointer to the information of the HCA port used by this
+ * channel.
+ * @i_port_id: 128-bit initiator port identifier copied from SRP_LOGIN_REQ.
+ * @t_port_id: 128-bit target port identifier copied from SRP_LOGIN_REQ.
+ * @max_ti_iu_len: maximum target-to-initiator information unit length.
-+ * @supports_cred_req: whether or not the initiator supports SRP_CRED_REQ.
+ * @req_lim: request limit: maximum number of requests that may be sent
+ * by the initiator without having received a response.
++ * @req_lim_delta: One less than the req_lim_delta value that will be included
++ * in the next reply sent to the initiator. See also the SRP
++ * credit algorithm in the SRP spec.
++ * @spinlock: Protects free_list.
++ * @free_list: Head of list with free send I/O contexts.
++ * @ioctx_ring:
++ * @wc:
+ * @state: channel state. See also enum rdma_ch_state.
+ * @list: node for insertion in the srpt_device.rch_list list.
+ * @cmd_wait_list: list of SCST commands that arrived before the RTU event. This
+ * list contains struct srpt_ioctx elements and is protected
+ * against concurrent modification by the cm_id spinlock.
-+ * @spinlock: Protects free_list.
-+ * @free_list: Head of list with free send I/O contexts.
+ * @scst_sess: SCST session information associated with this SRP channel.
+ * @sess_name: SCST session name.
+ */
@@ -78851,23 +78894,27 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.h linux-2.6.39/drivers/sc
+ struct task_struct *thread;
+ struct ib_cm_id *cm_id;
+ struct ib_qp *qp;
-+ int rq_size;
-+ atomic_t processing_compl;
+ struct ib_cq *cq;
-+ atomic_t sq_wr_avail;
++ int rq_size;
++ int max_sge;
++ int max_rsp_size;
++ int sq_wr_avail;
+ struct srpt_port *sport;
+ u8 i_port_id[16];
+ u8 t_port_id[16];
+ int max_ti_iu_len;
-+ atomic_t req_lim;
-+ atomic_t req_lim_delta;
++ int req_lim;
++ int req_lim_delta;
+ spinlock_t spinlock;
+ struct list_head free_list;
+ struct srpt_send_ioctx **ioctx_ring;
+ struct ib_wc wc[16];
-+ atomic_t state;
++ enum rdma_ch_state state;
++ wait_queue_head_t state_wq;
+ struct list_head list;
+ struct list_head cmd_wait_list;
++ struct completion finished_processing_completions;
++ bool last_wqe_received;
+
+ struct scst_session *scst_sess;
+ u8 sess_name[36];
@@ -78895,38 +78942,40 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.h linux-2.6.39/drivers/sc
+
+/**
+ * struct srpt_device - Information associated by SRPT with a single HCA.
-+ * @device: backpointer to the struct ib_device managed by the IB core.
++ * @device: Backpointer to the struct ib_device managed by the IB core.
+ * @pd: IB protection domain.
+ * @mr: L_Key (local key) with write access to all local memory.
+ * @srq: Per-HCA SRQ (shared receive queue).
-+ * @cm_id: connection identifier.
-+ * @dev_attr: attributes of the InfiniBand device as obtained during the
++ * @cm_id: Connection identifier.
++ * @dev_attr: Attributes of the InfiniBand device as obtained during the
+ * ib_client.add() callback.
-+ * @ioctx_ring: Per-HCA I/O context ring.
-+ * @rch_list: per-device channel list -- see also srpt_rdma_ch.list.
-+ * @spinlock: protects rch_list.
-+ * @srpt_port: information about the ports owned by this HCA.
-+ * @event_handler: per-HCA asynchronous IB event handler.
-+ * @dev: per-port srpt-<portname> device instance.
++ * @srq_size: SRQ size.
++ * @ioctx_ring: Per-HCA SRQ.
++ * @rch_list: Per-device channel list -- see also srpt_rdma_ch.list.
++ * @ch_releaseQ: Enables waiting for removal from rch_list.
++ * @spinlock: Protects rch_list.
++ * @port: Information about the ports owned by this HCA.
++ * @event_handler: Per-HCA asynchronous IB event handler.
++ * @dev: Per-port srpt-<portname> device instance.
+ * @scst_tgt: SCST target information associated with this HCA.
+ * @enabled: Whether or not this SCST target is enabled.
+ */
+struct srpt_device {
-+ struct ib_device *device;
-+ struct ib_pd *pd;
-+ struct ib_mr *mr;
-+ struct ib_srq *srq;
-+ struct ib_cm_id *cm_id;
-+ struct ib_device_attr dev_attr;
-+ int srq_size;
-+ struct srpt_recv_ioctx **ioctx_ring;
-+ struct list_head rch_list;
-+ wait_queue_head_t ch_releaseQ;
-+ spinlock_t spinlock;
-+ struct srpt_port port[2];
-+ struct ib_event_handler event_handler;
-+ struct scst_tgt *scst_tgt;
-+ bool enabled;
++ struct ib_device *device;
++ struct ib_pd *pd;
++ struct ib_mr *mr;
++ struct ib_srq *srq;
++ struct ib_cm_id *cm_id;
++ struct ib_device_attr dev_attr;
++ int srq_size;
++ struct srpt_recv_ioctx **ioctx_ring;
++ struct list_head rch_list;
++ wait_queue_head_t ch_releaseQ;
++ spinlock_t spinlock;
++ struct srpt_port port[2];
++ struct ib_event_handler event_handler;
++ struct scst_tgt *scst_tgt;
++ bool enabled;
+};
+
+#endif /* IB_SRPT_H */
@@ -78937,10 +78986,10 @@ diff -uprN orig/linux-2.6.39/drivers/scst/srpt/ib_srpt.h linux-2.6.39/drivers/sc
+ * indent-tabs-mode: t
+ * End:
+ */
-diff -uprN orig/linux-2.6.39/Documentation/scst/README.scst_local linux-2.6.39/Documentation/scst/README.scst_local
---- orig/linux-2.6.39/Documentation/scst/README.scst_local
-+++ linux-2.6.39/Documentation/scst/README.scst_local
-@@ -0,0 +1,284 @@
+diff -uprN orig/linux-3.2/Documentation/scst/README.scst_local linux-3.2/Documentation/scst/README.scst_local
+--- orig/linux-3.2/Documentation/scst/README.scst_local
++++ linux-3.2/Documentation/scst/README.scst_local
+@@ -0,0 +1,286 @@
+SCST Local ...
+Richard Sharpe, 30-Nov-2008
+
@@ -79225,9 +79274,11 @@ diff -uprN orig/linux-2.6.39/Documentation/scst/README.scst_local linux-2.6.39/D
+
+V1.0 10-Sep-2010 (Moscow) Sysfs management added. Reviewed and cleaned up.
+
-diff -uprN orig/linux-2.6.39/drivers/scst/scst_local/Kconfig linux-2.6.39/drivers/scst/scst_local/Kconfig
---- orig/linux-2.6.39/drivers/scst/scst_local/Kconfig
-+++ linux-2.6.39/drivers/scst/scst_local/Kconfig
++V2.1 Update for kernels up to 3.0. Cleanups.
++
+diff -uprN orig/linux-3.2/drivers/scst/scst_local/Kconfig linux-3.2/drivers/scst/scst_local/Kconfig
+--- orig/linux-3.2/drivers/scst/scst_local/Kconfig
++++ linux-3.2/drivers/scst/scst_local/Kconfig
@@ -0,0 +1,22 @@
+config SCST_LOCAL
+ tristate "SCST Local driver"
@@ -79251,16 +79302,16 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_local/Kconfig linux-2.6.39/driver
+ unsafe.
+
+ If unsure, say "N".
-diff -uprN orig/linux-2.6.39/drivers/scst/scst_local/Makefile linux-2.6.39/drivers/scst/scst_local/Makefile
---- orig/linux-2.6.39/drivers/scst/scst_local/Makefile
-+++ linux-2.6.39/drivers/scst/scst_local/Makefile
+diff -uprN orig/linux-3.2/drivers/scst/scst_local/Makefile linux-3.2/drivers/scst/scst_local/Makefile
+--- orig/linux-3.2/drivers/scst/scst_local/Makefile
++++ linux-3.2/drivers/scst/scst_local/Makefile
@@ -0,0 +1,2 @@
+obj-$(CONFIG_SCST_LOCAL) += scst_local.o
+
-diff -uprN orig/linux-2.6.39/drivers/scst/scst_local/scst_local.c linux-2.6.39/drivers/scst/scst_local/scst_local.c
---- orig/linux-2.6.39/drivers/scst/scst_local/scst_local.c
-+++ linux-2.6.39/drivers/scst/scst_local/scst_local.c
-@@ -0,0 +1,1589 @@
+diff -uprN orig/linux-3.2/drivers/scst/scst_local/scst_local.c linux-3.2/drivers/scst/scst_local/scst_local.c
+--- orig/linux-3.2/drivers/scst/scst_local/scst_local.c
++++ linux-3.2/drivers/scst/scst_local/scst_local.c
+@@ -0,0 +1,1587 @@
+/*
+ * Copyright (C) 2008 - 2010 Richard Sharpe
+ * Copyright (C) 1992 Eric Youngdale
@@ -79293,7 +79344,6 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_local/scst_local.c linux-2.6.39/d
+#define LOG_PREFIX "scst_local"
+
+/* SCST includes ... */
-+#include <scst/scst_const.h>
+#include <scst/scst.h>
+#include <scst/scst_debug.h>
+
@@ -79313,8 +79363,8 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_local/scst_local.c linux-2.6.39/d
+static unsigned long scst_local_trace_flag = SCST_LOCAL_DEFAULT_LOG_FLAGS;
+#endif
+
-+#define SCST_LOCAL_VERSION "1.0.0"
-+static const char *scst_local_version_date = "20100910";
++#define SCST_LOCAL_VERSION "2.2.0-pre"
++static const char *scst_local_version_date = "20110901";
+
+/* Some statistics */
+static atomic_t num_aborts = ATOMIC_INIT(0);
@@ -80178,8 +80228,7 @@ diff -uprN orig/linux-2.6.39/drivers/scst/scst_local/scst_local.c linux-2.6.39/d
+ return 0;
+}
+
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37) && \
-+ !defined(CONFIG_SCST_LOCAL_FORCE_DIRECT_PROCESSING)
++#if !defined(CONFIG_SCST_LOCAL_FORCE_DIRECT_PROCESSING)
+/*
+ * See comment in scst_local_queuecommand_lck() near
+ * CONFIG_SCST_LOCAL_FORCE_DIRECT_PROCESSING