aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2011-01-06 09:49:04 +0100
committerMartin Jansa <Martin.Jansa@gmail.com>2011-01-10 09:15:38 +0100
commit16a1f2e538452cfff7ab7e518ab21feabaf0ddd2 (patch)
treeb740e9c86177eec36ae6e8038f65902b3b12c821
parent9ef31e4aa678966165af743ebae8ba2bbf5d32ac (diff)
downloadopenembedded-16a1f2e538452cfff7ab7e518ab21feabaf0ddd2.zip
openembedded-16a1f2e538452cfff7ab7e518ab21feabaf0ddd2.tar.gz
openembedded-16a1f2e538452cfff7ab7e518ab21feabaf0ddd2.tar.bz2
linux-2.6.37: add om-gta02 support
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r--recipes/linux/linux-2.6.37/om-gta02/defconfig2361
-rw-r--r--recipes/linux/linux-2.6.37/openmoko.patch51829
-rw-r--r--recipes/linux/linux-2.6.37/shr.patch28
-rw-r--r--recipes/linux/linux-openmoko_2.6.37.bb2
-rw-r--r--recipes/linux/linux_2.6.37.bb9
5 files changed, 54228 insertions, 1 deletions
diff --git a/recipes/linux/linux-2.6.37/om-gta02/defconfig b/recipes/linux/linux-2.6.37/om-gta02/defconfig
new file mode 100644
index 0000000..4575664
--- /dev/null
+++ b/recipes/linux/linux-2.6.37/om-gta02/defconfig
@@ -0,0 +1,2361 @@
+#
+# Automatically generated make config: don't edit
+# Linux/arm 2.6.37 Kernel Configuration
+# Thu Jan 6 10:03:07 2011
+#
+CONFIG_ARM=y
+CONFIG_HAVE_PWM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_GENERIC_GPIO=y
+CONFIG_ARCH_USES_GETTIMEOFFSET=y
+CONFIG_HAVE_PROC_CPU=y
+CONFIG_NO_IOPORT=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_LATENCYTOP_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_ARCH_HAS_CPUFREQ=y
+CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_FIQ=y
+CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_CONSTRUCTORS=y
+CONFIG_HAVE_IRQ_WORK=y
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_CROSS_COMPILE=""
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_HAVE_KERNEL_GZIP=y
+CONFIG_HAVE_KERNEL_LZMA=y
+CONFIG_HAVE_KERNEL_LZO=y
+CONFIG_KERNEL_GZIP=y
+# CONFIG_KERNEL_LZMA is not set
+# CONFIG_KERNEL_LZO is not set
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_HAVE_GENERIC_HARDIRQS is not set
+# CONFIG_SPARSE_IRQ is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_TINY_RCU=y
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_TREE_RCU_TRACE is not set
+CONFIG_IKCONFIG=m
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=18
+# CONFIG_CGROUPS is not set
+CONFIG_NAMESPACES=y
+# CONFIG_UTS_NS is not set
+# CONFIG_IPC_NS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
+# CONFIG_NET_NS is not set
+# CONFIG_SYSFS_DEPRECATED is not set
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_RD_GZIP=y
+CONFIG_RD_BZIP2=y
+CONFIG_RD_LZMA=y
+CONFIG_RD_LZO=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_PERF_USE_VMALLOC=y
+
+#
+# Kernel Performance Events And Counters
+#
+# CONFIG_PERF_EVENTS is not set
+# CONFIG_PERF_COUNTERS is not set
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_COMPAT_BRK=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
+CONFIG_HAVE_CLK=y
+
+#
+# GCOV-based kernel profiling
+#
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_BLOCK=y
+# CONFIG_LBDAF is not set
+CONFIG_BLK_DEV_BSG=y
+# CONFIG_BLK_DEV_INTEGRITY is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=m
+CONFIG_DEFAULT_DEADLINE=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="deadline"
+# CONFIG_INLINE_SPIN_TRYLOCK is not set
+# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK is not set
+# CONFIG_INLINE_SPIN_LOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
+CONFIG_INLINE_SPIN_UNLOCK=y
+# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
+CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
+# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
+# CONFIG_INLINE_READ_TRYLOCK is not set
+# CONFIG_INLINE_READ_LOCK is not set
+# CONFIG_INLINE_READ_LOCK_BH is not set
+# CONFIG_INLINE_READ_LOCK_IRQ is not set
+# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
+CONFIG_INLINE_READ_UNLOCK=y
+# CONFIG_INLINE_READ_UNLOCK_BH is not set
+CONFIG_INLINE_READ_UNLOCK_IRQ=y
+# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
+# CONFIG_INLINE_WRITE_TRYLOCK is not set
+# CONFIG_INLINE_WRITE_LOCK is not set
+# CONFIG_INLINE_WRITE_LOCK_BH is not set
+# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
+# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
+CONFIG_INLINE_WRITE_UNLOCK=y
+# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
+CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
+# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
+# CONFIG_MUTEX_SPIN_ON_OWNER is not set
+CONFIG_FREEZER=y
+
+#
+# System Type
+#
+CONFIG_MMU=y
+# CONFIG_ARCH_AAEC2000 is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_VERSATILE is not set
+# CONFIG_ARCH_VEXPRESS is not set
+# CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_BCMRING is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CNS3XXX is not set
+# CONFIG_ARCH_GEMINI is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_STMP3XXX is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_DOVE is not set
+# CONFIG_ARCH_KIRKWOOD is not set
+# CONFIG_ARCH_LOKI is not set
+# CONFIG_ARCH_LPC32XX is not set
+# CONFIG_ARCH_MV78XX0 is not set
+# CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_NS9XXX is not set
+# CONFIG_ARCH_W90X900 is not set
+# CONFIG_ARCH_NUC93X is not set
+# CONFIG_ARCH_TEGRA is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_MSM is not set
+# CONFIG_ARCH_SHMOBILE is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+CONFIG_ARCH_S3C2410=y
+# CONFIG_ARCH_S3C64XX is not set
+# CONFIG_ARCH_S5P64X0 is not set
+# CONFIG_ARCH_S5P6442 is not set
+# CONFIG_ARCH_S5PC100 is not set
+# CONFIG_ARCH_S5PV210 is not set
+# CONFIG_ARCH_S5PV310 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_TCC_926 is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_U300 is not set
+# CONFIG_ARCH_U8500 is not set
+# CONFIG_ARCH_NOMADIK is not set
+# CONFIG_ARCH_DAVINCI is not set
+# CONFIG_ARCH_OMAP is not set
+# CONFIG_PLAT_SPEAR is not set
+CONFIG_PLAT_SAMSUNG=y
+
+#
+# Boot options
+#
+CONFIG_S3C_BOOT_WATCHDOG=y
+CONFIG_S3C_BOOT_ERROR_RESET=y
+CONFIG_S3C_BOOT_UART_FORCE_FIFO=y
+CONFIG_S3C_LOWLEVEL_UART_PORT=2
+CONFIG_S3C_GPIO_CFG_S3C24XX=y
+CONFIG_S3C_GPIO_PULL_DOWN=y
+CONFIG_SAMSUNG_GPIO_EXTRA=64
+CONFIG_S3C_GPIO_SPACE=0
+CONFIG_S3C_ADC=y
+CONFIG_S3C_DEV_USB_HOST=y
+CONFIG_S3C_DEV_WDT=y
+CONFIG_S3C_DEV_NAND=y
+CONFIG_S3C_DMA=y
+
+#
+# Power management
+#
+# CONFIG_SAMSUNG_PM_DEBUG is not set
+# CONFIG_SAMSUNG_PM_CHECK is not set
+CONFIG_PLAT_S3C24XX=y
+CONFIG_CPU_LLSERIAL_S3C2440_ONLY=y
+CONFIG_CPU_LLSERIAL_S3C2440=y
+CONFIG_S3C2410_CLOCK=y
+CONFIG_S3C24XX_PWM=y
+CONFIG_S3C24XX_GPIO_EXTRA=64
+CONFIG_S3C24XX_GPIO_EXTRA64=y
+CONFIG_S3C2410_DMA=y
+# CONFIG_S3C2410_DMA_DEBUG is not set
+
+#
+# S3C2400 Machines
+#
+CONFIG_CPU_S3C2410_DMA=y
+CONFIG_S3C2410_PM=y
+CONFIG_S3C2410_GPIO=y
+
+#
+# S3C2410 Machines
+#
+# CONFIG_ARCH_SMDK2410 is not set
+# CONFIG_ARCH_H1940 is not set
+# CONFIG_MACH_N30 is not set
+# CONFIG_ARCH_BAST is not set
+# CONFIG_MACH_OTOM is not set
+# CONFIG_MACH_AML_M5900 is not set
+# CONFIG_MACH_TCT_HAMMER is not set
+# CONFIG_MACH_VR1000 is not set
+# CONFIG_MACH_QT2410 is not set
+
+#
+# S3C2412 Machines
+#
+# CONFIG_MACH_JIVE is not set
+# CONFIG_MACH_SMDK2413 is not set
+# CONFIG_MACH_SMDK2412 is not set
+# CONFIG_MACH_VSTMS is not set
+
+#
+# S3C2416 Machines
+#
+# CONFIG_MACH_SMDK2416 is not set
+CONFIG_CPU_S3C2442=y
+CONFIG_CPU_S3C244X=y
+
+#
+# S3C2440 and S3C2442 Machines
+#
+# CONFIG_MACH_ANUBIS is not set
+CONFIG_MACH_NEO1973_GTA02=y
+# CONFIG_MACH_OSIRIS is not set
+# CONFIG_MACH_RX3715 is not set
+# CONFIG_ARCH_S3C2440 is not set
+# CONFIG_MACH_NEXCODER_2440 is not set
+# CONFIG_SMDK2440_CPU2440 is not set
+# CONFIG_SMDK2440_CPU2442 is not set
+# CONFIG_MACH_AT2440EVB is not set
+# CONFIG_MACH_MINI2440 is not set
+# CONFIG_MACH_RX1950 is not set
+
+#
+# S3C2443 Machines
+#
+# CONFIG_MACH_SMDK2443 is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_ARM920T=y
+CONFIG_CPU_32v4T=y
+CONFIG_CPU_ABRT_EV4T=y
+CONFIG_CPU_PABRT_LEGACY=y
+CONFIG_CPU_CACHE_V4WT=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_COPY_V4WB=y
+CONFIG_CPU_TLB_V4WBI=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
+CONFIG_ARM_L1_CACHE_SHIFT=5
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_HZ=200
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
+# CONFIG_HIGHMEM is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=999999
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=0
+CONFIG_VIRT_TO_BUS=y
+# CONFIG_KSM is not set
+CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
+CONFIG_NEED_PER_CPU_KM=y
+CONFIG_FORCE_MAX_ZONEORDER=11
+CONFIG_ALIGNMENT_TRAP=y
+# CONFIG_UACCESS_WITH_MEMCPY is not set
+# CONFIG_SECCOMP is not set
+# CONFIG_CC_STACKPROTECTOR is not set
+# CONFIG_DEPRECATED_PARAM_STRUCT is not set
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="unused -- bootloader passes ATAG list debug "
+# CONFIG_CMDLINE_FORCE is not set
+# CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
+# CONFIG_AUTO_ZRELADDR is not set
+
+#
+# CPU Power Management
+#
+# CONFIG_CPU_FREQ is not set
+CONFIG_CPU_IDLE=y
+CONFIG_CPU_IDLE_GOV_LADDER=y
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
+# CONFIG_BINFMT_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+
+#
+# Power management options
+#
+CONFIG_PM=y
+# CONFIG_PM_DEBUG is not set
+CONFIG_PM_SLEEP=y
+CONFIG_SUSPEND_NVS=y
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+# CONFIG_APM_EMULATION is not set
+# CONFIG_PM_RUNTIME is not set
+CONFIG_PM_OPS=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=m
+# CONFIG_XFRM_SUB_POLICY is not set
+CONFIG_XFRM_MIGRATE=y
+# CONFIG_XFRM_STATISTICS is not set
+CONFIG_XFRM_IPCOMP=m
+CONFIG_NET_KEY=m
+CONFIG_NET_KEY_MIGRATE=y
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_ASK_IP_FIB_HASH=y
+# CONFIG_IP_FIB_TRIE is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_MULTIPLE_TABLES=y
+# CONFIG_IP_ROUTE_MULTIPATH is not set
+# CONFIG_IP_ROUTE_VERBOSE is not set
+CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
+# CONFIG_IP_PNP_BOOTP is not set
+# CONFIG_IP_PNP_RARP is not set
+CONFIG_NET_IPIP=m
+# CONFIG_NET_IPGRE_DEMUX is not set
+CONFIG_IP_MROUTE=y
+# CONFIG_IP_MROUTE_MULTIPLE_TABLES is not set
+# CONFIG_IP_PIMSM_V1 is not set
+# CONFIG_IP_PIMSM_V2 is not set
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+CONFIG_INET_AH=m
+CONFIG_INET_ESP=m
+CONFIG_INET_IPCOMP=m
+CONFIG_INET_XFRM_TUNNEL=m
+CONFIG_INET_TUNNEL=m
+CONFIG_INET_XFRM_MODE_TRANSPORT=m
+CONFIG_INET_XFRM_MODE_TUNNEL=m
+CONFIG_INET_XFRM_MODE_BEET=m
+# CONFIG_INET_LRO is not set
+CONFIG_INET_DIAG=m
+CONFIG_INET_TCP_DIAG=m
+CONFIG_TCP_CONG_ADVANCED=y
+# CONFIG_TCP_CONG_BIC is not set
+# CONFIG_TCP_CONG_CUBIC is not set
+CONFIG_TCP_CONG_WESTWOOD=y
+# CONFIG_TCP_CONG_HTCP is not set
+# CONFIG_TCP_CONG_HSTCP is not set
+# CONFIG_TCP_CONG_HYBLA is not set
+# CONFIG_TCP_CONG_VEGAS is not set
+# CONFIG_TCP_CONG_SCALABLE is not set
+# CONFIG_TCP_CONG_LP is not set
+# CONFIG_TCP_CONG_VENO is not set
+# CONFIG_TCP_CONG_YEAH is not set
+# CONFIG_TCP_CONG_ILLINOIS is not set
+CONFIG_DEFAULT_WESTWOOD=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="westwood"
+CONFIG_TCP_MD5SIG=y
+CONFIG_IPV6=m
+# CONFIG_IPV6_PRIVACY is not set
+# CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
+CONFIG_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+# CONFIG_IPV6_MIP6 is not set
+CONFIG_INET6_XFRM_TUNNEL=m
+CONFIG_INET6_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_BEET=m
+# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=m
+# CONFIG_IPV6_SIT_6RD is not set
+CONFIG_IPV6_NDISC_NODETYPE=y
+CONFIG_IPV6_TUNNEL=m
+# CONFIG_IPV6_MULTIPLE_TABLES is not set
+# CONFIG_IPV6_MROUTE is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+CONFIG_NETFILTER_ADVANCED=y
+CONFIG_BRIDGE_NETFILTER=y
+
+#
+# Core Netfilter Configuration
+#
+CONFIG_NETFILTER_NETLINK=m
+CONFIG_NETFILTER_NETLINK_QUEUE=m
+CONFIG_NETFILTER_NETLINK_LOG=m
+CONFIG_NF_CONNTRACK=m
+CONFIG_NF_CONNTRACK_MARK=y
+# CONFIG_NF_CONNTRACK_EVENTS is not set
+# CONFIG_NF_CT_PROTO_DCCP is not set
+CONFIG_NF_CT_PROTO_GRE=m
+CONFIG_NF_CT_PROTO_SCTP=m
+# CONFIG_NF_CT_PROTO_UDPLITE is not set
+# CONFIG_NF_CONNTRACK_AMANDA is not set
+CONFIG_NF_CONNTRACK_FTP=m
+CONFIG_NF_CONNTRACK_H323=m
+CONFIG_NF_CONNTRACK_IRC=m
+CONFIG_NF_CONNTRACK_NETBIOS_NS=m
+CONFIG_NF_CONNTRACK_PPTP=m
+CONFIG_NF_CONNTRACK_SANE=m
+CONFIG_NF_CONNTRACK_SIP=m
+CONFIG_NF_CONNTRACK_TFTP=m
+CONFIG_NF_CT_NETLINK=m
+# CONFIG_NETFILTER_TPROXY is not set
+CONFIG_NETFILTER_XTABLES=m
+
+#
+# Xtables combined modules
+#
+CONFIG_NETFILTER_XT_MARK=m
+CONFIG_NETFILTER_XT_CONNMARK=m
+
+#
+# Xtables targets
+#
+# CONFIG_NETFILTER_XT_TARGET_CHECKSUM is not set
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
+# CONFIG_NETFILTER_XT_TARGET_CT is not set
+CONFIG_NETFILTER_XT_TARGET_DSCP=m
+CONFIG_NETFILTER_XT_TARGET_HL=m
+# CONFIG_NETFILTER_XT_TARGET_IDLETIMER is not set
+# CONFIG_NETFILTER_XT_TARGET_LED is not set
+CONFIG_NETFILTER_XT_TARGET_MARK=m
+CONFIG_NETFILTER_XT_TARGET_NFLOG=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
+CONFIG_NETFILTER_XT_TARGET_NOTRACK=m
+# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set
+# CONFIG_NETFILTER_XT_TARGET_TEE is not set
+# CONFIG_NETFILTER_XT_TARGET_TRACE is not set
+CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
+# CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set
+
+#
+# Xtables matches
+#
+# CONFIG_NETFILTER_XT_MATCH_CLUSTER is not set
+# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set
+CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
+# CONFIG_NETFILTER_XT_MATCH_CONNLIMIT is not set
+CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
+# CONFIG_NETFILTER_XT_MATCH_CPU is not set
+CONFIG_NETFILTER_XT_MATCH_DCCP=m
+CONFIG_NETFILTER_XT_MATCH_DSCP=m
+CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
+CONFIG_NETFILTER_XT_MATCH_HELPER=m
+CONFIG_NETFILTER_XT_MATCH_HL=m
+CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
+CONFIG_NETFILTER_XT_MATCH_LENGTH=m
+CONFIG_NETFILTER_XT_MATCH_LIMIT=m
+CONFIG_NETFILTER_XT_MATCH_MAC=m
+CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
+# CONFIG_NETFILTER_XT_MATCH_OSF is not set
+# CONFIG_NETFILTER_XT_MATCH_OWNER is not set
+CONFIG_NETFILTER_XT_MATCH_POLICY=m
+CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+CONFIG_NETFILTER_XT_MATCH_QUOTA=m
+# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set
+CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_RECENT=m
+CONFIG_NETFILTER_XT_MATCH_SCTP=m
+CONFIG_NETFILTER_XT_MATCH_STATE=m
+CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
+CONFIG_NETFILTER_XT_MATCH_STRING=m
+CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
+CONFIG_NETFILTER_XT_MATCH_TIME=m
+# CONFIG_NETFILTER_XT_MATCH_U32 is not set
+# CONFIG_IP_VS is not set
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_NF_DEFRAG_IPV4=m
+CONFIG_NF_CONNTRACK_IPV4=m
+CONFIG_NF_CONNTRACK_PROC_COMPAT=y
+# CONFIG_IP_NF_QUEUE is not set
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
+CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_NF_NAT=m
+CONFIG_NF_NAT_NEEDED=y
+CONFIG_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_NF_NAT_SNMP_BASIC=m
+CONFIG_NF_NAT_PROTO_GRE=m
+CONFIG_NF_NAT_PROTO_SCTP=m
+CONFIG_NF_NAT_FTP=m
+CONFIG_NF_NAT_IRC=m
+CONFIG_NF_NAT_TFTP=m
+# CONFIG_NF_NAT_AMANDA is not set
+CONFIG_NF_NAT_PPTP=m
+CONFIG_NF_NAT_H323=m
+CONFIG_NF_NAT_SIP=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_RAW=m
+# CONFIG_IP_NF_ARPTABLES is not set
+
+#
+# IPv6: Netfilter Configuration
+#
+CONFIG_NF_DEFRAG_IPV6=m
+CONFIG_NF_CONNTRACK_IPV6=m
+# CONFIG_IP6_NF_QUEUE is not set
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_HL=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+CONFIG_IP6_NF_MATCH_MH=m
+CONFIG_IP6_NF_MATCH_RT=m
+CONFIG_IP6_NF_TARGET_HL=m
+CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_REJECT=m
+CONFIG_IP6_NF_MANGLE=m
+# CONFIG_IP6_NF_RAW is not set
+CONFIG_BRIDGE_NF_EBTABLES=m
+CONFIG_BRIDGE_EBT_BROUTE=m
+CONFIG_BRIDGE_EBT_T_FILTER=m
+CONFIG_BRIDGE_EBT_T_NAT=m
+CONFIG_BRIDGE_EBT_802_3=m
+CONFIG_BRIDGE_EBT_AMONG=m
+CONFIG_BRIDGE_EBT_ARP=m
+CONFIG_BRIDGE_EBT_IP=m
+# CONFIG_BRIDGE_EBT_IP6 is not set
+CONFIG_BRIDGE_EBT_LIMIT=m
+CONFIG_BRIDGE_EBT_MARK=m
+CONFIG_BRIDGE_EBT_PKTTYPE=m
+CONFIG_BRIDGE_EBT_STP=m
+CONFIG_BRIDGE_EBT_VLAN=m
+CONFIG_BRIDGE_EBT_ARPREPLY=m
+CONFIG_BRIDGE_EBT_DNAT=m
+CONFIG_BRIDGE_EBT_MARK_T=m
+CONFIG_BRIDGE_EBT_REDIRECT=m
+CONFIG_BRIDGE_EBT_SNAT=m
+CONFIG_BRIDGE_EBT_LOG=m
+CONFIG_BRIDGE_EBT_ULOG=m
+# CONFIG_BRIDGE_EBT_NFLOG is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_RDS is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_L2TP is not set
+CONFIG_STP=m
+CONFIG_BRIDGE=m
+CONFIG_BRIDGE_IGMP_SNOOPING=y
+# CONFIG_NET_DSA is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+CONFIG_LLC=m
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_PHONET is not set
+# CONFIG_IEEE802154 is not set
+CONFIG_NET_SCHED=y
+
+#
+# Queueing/Scheduling
+#
+CONFIG_NET_SCH_CBQ=m
+CONFIG_NET_SCH_HTB=m
+CONFIG_NET_SCH_HFSC=m
+CONFIG_NET_SCH_PRIO=m
+# CONFIG_NET_SCH_MULTIQ is not set
+CONFIG_NET_SCH_RED=m
+CONFIG_NET_SCH_SFQ=m
+CONFIG_NET_SCH_TEQL=m
+CONFIG_NET_SCH_TBF=m
+CONFIG_NET_SCH_GRED=m
+CONFIG_NET_SCH_DSMARK=m
+CONFIG_NET_SCH_NETEM=m
+# CONFIG_NET_SCH_DRR is not set
+
+#
+# Classification
+#
+CONFIG_NET_CLS=y
+CONFIG_NET_CLS_BASIC=m
+CONFIG_NET_CLS_TCINDEX=m
+CONFIG_NET_CLS_ROUTE4=m
+CONFIG_NET_CLS_ROUTE=y
+CONFIG_NET_CLS_FW=m
+CONFIG_NET_CLS_U32=m
+CONFIG_CLS_U32_PERF=y
+CONFIG_CLS_U32_MARK=y
+CONFIG_NET_CLS_RSVP=m
+CONFIG_NET_CLS_RSVP6=m
+# CONFIG_NET_CLS_FLOW is not set
+# CONFIG_NET_EMATCH is not set
+# CONFIG_NET_CLS_ACT is not set
+# CONFIG_NET_CLS_IND is not set
+CONFIG_NET_SCH_FIFO=y
+# CONFIG_DCB is not set
+CONFIG_DNS_RESOLVER=y
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+CONFIG_BT=m
+CONFIG_BT_L2CAP=m
+CONFIG_BT_SCO=m
+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_HIDP=m
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIBTUSB=m
+# CONFIG_BT_HCIBTSDIO is not set
+# CONFIG_BT_HCIUART is not set
+# CONFIG_BT_HCIBCM203X is not set
+# CONFIG_BT_HCIBPA10X is not set
+# CONFIG_BT_HCIBFUSB is not set
+# CONFIG_BT_HCIVHCI is not set
+# CONFIG_BT_MRVL is not set
+# CONFIG_BT_ATH3K is not set
+# CONFIG_AF_RXRPC is not set
+CONFIG_FIB_RULES=y
+CONFIG_WIRELESS=y
+CONFIG_WIRELESS_EXT=y
+CONFIG_WEXT_CORE=y
+CONFIG_WEXT_PROC=y
+CONFIG_WEXT_PRIV=y
+# CONFIG_CFG80211 is not set
+CONFIG_WIRELESS_EXT_SYSFS=y
+# CONFIG_LIB80211 is not set
+
+#
+# CFG80211 needs to be enabled for MAC80211
+#
+
+#
+# Some wireless drivers require a rate control algorithm
+#
+# CONFIG_WIMAX is not set
+CONFIG_RFKILL=y
+CONFIG_RFKILL_LEDS=y
+CONFIG_RFKILL_INPUT=y
+# CONFIG_NET_9P is not set
+# CONFIG_CAIF is not set
+# CONFIG_CEPH_LIB is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH=""
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+# CONFIG_FIRMWARE_IN_KERNEL is not set
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_SYS_HYPERVISOR is not set
+CONFIG_CONNECTOR=m
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_TESTS is not set
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set
+# CONFIG_MTD_AR7_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_SM_FTL is not set
+# CONFIG_MTD_OOPS is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_GEN_PROBE=y
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+CONFIG_MTD_CFI_INTELEXT=y
+# CONFIG_MTD_CFI_AMDSTD is not set
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_CFI_UTIL=y
+# CONFIG_MTD_RAM is not set
+CONFIG_MTD_ROM=y
+CONFIG_MTD_ABSENT=y
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+CONFIG_MTD_PHYSMAP=y
+# CONFIG_MTD_PHYSMAP_COMPAT is not set
+# CONFIG_MTD_ARM_INTEGRATOR is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_DATAFLASH is not set
+# CONFIG_MTD_M25P80 is not set
+# CONFIG_MTD_SST25L is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+CONFIG_MTD_NAND_ECC=y
+# CONFIG_MTD_NAND_ECC_SMC is not set
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_VERIFY_WRITE=y
+# CONFIG_MTD_SM_COMMON is not set
+# CONFIG_MTD_NAND_MUSEUM_IDS is not set
+# CONFIG_MTD_NAND_GPIO is not set
+CONFIG_MTD_NAND_IDS=y
+CONFIG_MTD_NAND_S3C2410=y
+# CONFIG_MTD_NAND_S3C2410_DEBUG is not set
+CONFIG_MTD_NAND_S3C2410_HWECC=y
+# CONFIG_MTD_NAND_S3C2410_CLKSTOP is not set
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
+# CONFIG_MTD_ALAUDA is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# LPDDR flash memory drivers
+#
+# CONFIG_MTD_LPDDR is not set
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
+CONFIG_MTD_UBI_BEB_RESERVE=1
+CONFIG_MTD_UBI_GLUEBI=y
+
+#
+# UBI debugging options
+#
+# CONFIG_MTD_UBI_DEBUG is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=m
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_DRBD is not set
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_UB=m
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=4096
+# CONFIG_BLK_DEV_XIP is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_MG_DISK is not set
+# CONFIG_BLK_DEV_RBD is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_AD525X_DPOT is not set
+# CONFIG_ICS932S401 is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_APDS9802ALS is not set
+# CONFIG_ISL29003 is not set
+# CONFIG_ISL29020 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_SENSORS_BH1780 is not set
+# CONFIG_SENSORS_BH1770 is not set
+# CONFIG_SENSORS_APDS990X is not set
+# CONFIG_HMC6352 is not set
+# CONFIG_DS1682 is not set
+# CONFIG_TI_DAC7512 is not set
+# CONFIG_BMP085 is not set
+# CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+# CONFIG_EEPROM_AT24 is not set
+# CONFIG_EEPROM_AT25 is not set
+# CONFIG_EEPROM_LEGACY is not set
+# CONFIG_EEPROM_MAX6875 is not set
+# CONFIG_EEPROM_93CX6 is not set
+# CONFIG_IWMC3200TOP is not set
+
+#
+# Texas Instruments shared transport line discipline
+#
+# CONFIG_TI_ST is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+CONFIG_SCSI_MOD=m
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=m
+CONFIG_SCSI_DMA=y
+# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=m
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+CONFIG_BLK_DEV_SR=m
+# CONFIG_BLK_DEV_SR_VENDOR is not set
+CONFIG_CHR_DEV_SG=m
+# CONFIG_CHR_DEV_SCH is not set
+CONFIG_SCSI_MULTI_LUN=y
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+CONFIG_SCSI_SCAN_ASYNC=y
+CONFIG_SCSI_WAIT_SCAN=m
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_ISCSI_BOOT_SYSFS is not set
+# CONFIG_LIBFC is not set
+# CONFIG_LIBFCOE is not set
+# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_DH is not set
+# CONFIG_SCSI_OSD_INITIATOR is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+CONFIG_TUN=m
+# CONFIG_VETH is not set
+CONFIG_MII=m
+# CONFIG_PHYLIB is not set
+# CONFIG_NET_ETHERNET is not set
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+CONFIG_WLAN=y
+# CONFIG_USB_ZD1201 is not set
+# CONFIG_HOSTAP is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+
+#
+# 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 is not set
+CONFIG_USB_NET_CDCETHER=m
+# CONFIG_USB_NET_CDC_EEM is not set
+# CONFIG_USB_NET_DM9601 is not set
+# CONFIG_USB_NET_SMSC75XX is not set
+# CONFIG_USB_NET_SMSC95XX is not set
+# CONFIG_USB_NET_GL620A is not set
+CONFIG_USB_NET_NET1080=m
+# CONFIG_USB_NET_PLUSB is not set
+# CONFIG_USB_NET_MCS7830 is not set
+# CONFIG_USB_NET_RNDIS_HOST is not set
+CONFIG_USB_NET_CDC_SUBSET=m
+# CONFIG_USB_ALI_M5632 is not set
+# CONFIG_USB_AN2720 is not set
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+# CONFIG_USB_EPSON2888 is not set
+# CONFIG_USB_KC2190 is not set
+CONFIG_USB_NET_ZAURUS=m
+# CONFIG_USB_NET_CX82310_ETH is not set
+# CONFIG_USB_HSO is not set
+# CONFIG_USB_NET_INT51X1 is not set
+# CONFIG_USB_IPHETH is not set
+# CONFIG_USB_SIERRA_NET is not set
+# CONFIG_WAN is not set
+
+#
+# CAIF transport drivers
+#
+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 is not set
+# CONFIG_SLIP is not set
+CONFIG_SLHC=m
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+# CONFIG_INPUT_SPARSEKMAP is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=480
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=640
+CONFIG_INPUT_JOYDEV=m
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ADP5588 is not set
+# CONFIG_KEYBOARD_ATKBD is not set
+# CONFIG_KEYBOARD_QT2160 is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+CONFIG_KEYBOARD_GPIO=y
+# CONFIG_KEYBOARD_GPIO_POLLED is not set
+# CONFIG_KEYBOARD_TCA6416 is not set
+# CONFIG_KEYBOARD_MATRIX is not set
+# CONFIG_KEYBOARD_LM8323 is not set
+# CONFIG_KEYBOARD_MAX7359 is not set
+# CONFIG_KEYBOARD_MCS is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_OPENCORES is not set
+CONFIG_KEYBOARD_STOWAWAY=m
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+# CONFIG_TOUCHSCREEN_ADS7846 is not set
+# CONFIG_TOUCHSCREEN_AD7877 is not set
+# CONFIG_TOUCHSCREEN_AD7879 is not set
+# CONFIG_TOUCHSCREEN_BU21013 is not set
+# CONFIG_TOUCHSCREEN_CY8CTMG110 is not set
+# CONFIG_TOUCHSCREEN_DYNAPRO is not set
+# CONFIG_TOUCHSCREEN_HAMPSHIRE is not set
+# CONFIG_TOUCHSCREEN_EETI is not set
+# CONFIG_TOUCHSCREEN_FUJITSU is not set
+CONFIG_TOUCHSCREEN_S3C2410=y
+# CONFIG_TOUCHSCREEN_GUNZE is not set
+# CONFIG_TOUCHSCREEN_ELO is not set
+# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
+# CONFIG_TOUCHSCREEN_MCS5000 is not set
+# CONFIG_TOUCHSCREEN_MTOUCH is not set
+# CONFIG_TOUCHSCREEN_INEXIO is not set
+# CONFIG_TOUCHSCREEN_MK712 is not set
+# CONFIG_TOUCHSCREEN_PENMOUNT is not set
+# CONFIG_TOUCHSCREEN_QT602240 is not set
+# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
+# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
+# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
+# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
+# CONFIG_TOUCHSCREEN_TSC2007 is not set
+# CONFIG_TOUCHSCREEN_W90X900 is not set
+# CONFIG_TOUCHSCREEN_TPS6507X is not set
+CONFIG_INPUT_MISC=y
+# CONFIG_INPUT_AD714X is not set
+# CONFIG_INPUT_ATI_REMOTE is not set
+# CONFIG_INPUT_ATI_REMOTE2 is not set
+# CONFIG_INPUT_KEYSPAN_REMOTE is not set
+# CONFIG_INPUT_POWERMATE is not set
+# CONFIG_INPUT_YEALINK is not set
+# CONFIG_INPUT_CM109 is not set
+CONFIG_INPUT_UINPUT=m
+CONFIG_INPUT_PCF50633_PMU=y
+# CONFIG_INPUT_PCF8574 is not set
+# CONFIG_INPUT_PWM_BEEPER is not set
+# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
+# CONFIG_INPUT_ADXL34X is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+# CONFIG_SERIO_SERPORT is not set
+# CONFIG_SERIO_LIBPS2 is not set
+# CONFIG_SERIO_RAW is not set
+# CONFIG_SERIO_ALTERA_PS2 is not set
+# CONFIG_SERIO_PS2MULT is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+CONFIG_VT_HW_CONSOLE_BINDING=y
+# CONFIG_DEVKMEM is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_N_GSM is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_SAMSUNG=y
+CONFIG_SERIAL_SAMSUNG_UARTS=3
+CONFIG_SERIAL_SAMSUNG_CONSOLE=y
+CONFIG_SERIAL_S3C2440=y
+# CONFIG_SERIAL_MAX3100 is not set
+# CONFIG_SERIAL_MAX3107 is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_TIMBERDALE is not set
+# CONFIG_SERIAL_ALTERA_JTAGUART is not set
+# CONFIG_SERIAL_ALTERA_UART is not set
+CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_TTY_PRINTK is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_RAMOOPS is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_COMPAT=y
+CONFIG_I2C_CHARDEV=y
+# CONFIG_I2C_MUX is not set
+# CONFIG_I2C_HELPER_AUTO is not set
+# CONFIG_I2C_SMBUS is not set
+
+#
+# I2C Algorithms
+#
+CONFIG_I2C_ALGOBIT=y
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_DESIGNWARE is not set
+# CONFIG_I2C_GPIO is not set
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_PCA_PLATFORM is not set
+CONFIG_HAVE_S3C2410_I2C=y
+CONFIG_I2C_S3C2410=y
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_XILINX is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_TINY_USB is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_BITBANG=y
+CONFIG_SPI_GPIO=y
+CONFIG_SPI_S3C24XX=y
+# CONFIG_SPI_S3C24XX_FIQ is not set
+CONFIG_SPI_S3C24XX_GPIO=y
+# CONFIG_SPI_XILINX is not set
+# CONFIG_SPI_DESIGNWARE is not set
+
+#
+# SPI Protocol Masters
+#
+# CONFIG_SPI_SPIDEV is not set
+# CONFIG_SPI_TLE62X0 is not set
+
+#
+# PPS support
+#
+# CONFIG_PPS is not set
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_GPIOLIB=y
+CONFIG_GPIO_SYSFS=y
+
+#
+# Memory mapped GPIO expanders:
+#
+# CONFIG_GPIO_BASIC_MMIO is not set
+CONFIG_GPIO_GLAMO=y
+# CONFIG_GPIO_IT8761E is not set
+# CONFIG_GPIO_VX855 is not set
+
+#
+# I2C GPIO expanders:
+#
+# CONFIG_GPIO_MAX7300 is not set
+# CONFIG_GPIO_MAX732X is not set
+# CONFIG_GPIO_PCA953X is not set
+# CONFIG_GPIO_PCF857X is not set
+# CONFIG_GPIO_SX150X is not set
+# CONFIG_GPIO_ADP5588 is not set
+CONFIG_GPIO_PCF50633=y
+
+#
+# PCI GPIO expanders:
+#
+
+#
+# SPI GPIO expanders:
+#
+# CONFIG_GPIO_MAX7301 is not set
+# CONFIG_GPIO_MCP23S08 is not set
+# CONFIG_GPIO_MC33880 is not set
+# CONFIG_GPIO_74X164 is not set
+
+#
+# AC97 GPIO expanders:
+#
+
+#
+# MODULbus GPIO expanders:
+#
+# CONFIG_W1 is not set
+CONFIG_POWER_SUPPLY=y
+# CONFIG_POWER_SUPPLY_DEBUG is not set
+# CONFIG_PDA_POWER is not set
+# CONFIG_TEST_POWER is not set
+# CONFIG_BATTERY_DS2782 is not set
+# CONFIG_BATTERY_BQ20Z75 is not set
+CONFIG_BATTERY_BQ27x00=y
+CONFIG_BATTERY_BQ27X00_I2C=y
+CONFIG_BATTERY_BQ27X00_PLATFORM=y
+# CONFIG_BATTERY_MAX17040 is not set
+# CONFIG_BATTERY_S3C_ADC is not set
+CONFIG_CHARGER_PCF50633=y
+CONFIG_BATTERY_PLATFORM=m
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+
+#
+# Watchdog Device Drivers
+#
+CONFIG_SOFT_WATCHDOG=y
+CONFIG_S3C2410_WATCHDOG=y
+# CONFIG_MAX63XX_WATCHDOG is not set
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+CONFIG_MFD_SUPPORT=y
+CONFIG_MFD_CORE=y
+# CONFIG_MFD_88PM860X is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_MFD_ASIC3 is not set
+# CONFIG_HTC_EGPIO is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_HTC_I2CPLD is not set
+# CONFIG_TPS65010 is not set
+# CONFIG_TPS6507X is not set
+# CONFIG_TWL4030_CORE is not set
+# CONFIG_MFD_STMPE is not set
+# CONFIG_MFD_TC35892 is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_T7L66XB is not set
+# CONFIG_MFD_TC6387XB is not set
+# CONFIG_MFD_TC6393XB is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_PMIC_ADP5520 is not set
+# CONFIG_MFD_MAX8925 is not set
+# CONFIG_MFD_MAX8998 is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM831X_I2C is not set
+# CONFIG_MFD_WM831X_SPI is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_WM8994 is not set
+CONFIG_MFD_PCF50633=y
+# CONFIG_MFD_MC13XXX is not set
+CONFIG_PCF50633_ADC=y
+# CONFIG_ABX500_CORE is not set
+# CONFIG_EZX_PCAP is not set
+CONFIG_MFD_GLAMO=y
+# CONFIG_MFD_TPS6586X is not set
+CONFIG_REGULATOR=y
+# CONFIG_REGULATOR_DEBUG is not set
+# CONFIG_REGULATOR_DUMMY is not set
+CONFIG_REGULATOR_FIXED_VOLTAGE=y
+# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
+# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
+# CONFIG_REGULATOR_BQ24022 is not set
+# CONFIG_REGULATOR_MAX1586 is not set
+# CONFIG_REGULATOR_MAX8649 is not set
+# CONFIG_REGULATOR_MAX8660 is not set
+# CONFIG_REGULATOR_MAX8952 is not set
+CONFIG_REGULATOR_PCF50633=y
+# CONFIG_REGULATOR_LP3971 is not set
+# CONFIG_REGULATOR_LP3972 is not set
+# CONFIG_REGULATOR_TPS65023 is not set
+# CONFIG_REGULATOR_TPS6507X is not set
+# CONFIG_REGULATOR_ISL6271A is not set
+# CONFIG_REGULATOR_AD5398 is not set
+# CONFIG_MEDIA_SUPPORT is not set
+
+#
+# Graphics support
+#
+CONFIG_DRM=y
+# CONFIG_VGASTATE is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=y
+CONFIG_FB=y
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_UVESA is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_TMIO is not set
+# CONFIG_FB_S3C2410 is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
+# CONFIG_FB_BROADSHEET is not set
+CONFIG_FB_GLAMO=y
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=y
+# CONFIG_LCD_L4F00242T03 is not set
+# CONFIG_LCD_LMS283GF05 is not set
+# CONFIG_LCD_LTV350QV is not set
+# CONFIG_LCD_TDO24M is not set
+# CONFIG_LCD_VGG2432A4 is not set
+# CONFIG_LCD_PLATFORM is not set
+# CONFIG_LCD_S6E63M0 is not set
+CONFIG_LCD_JBT6K74=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+# CONFIG_BACKLIGHT_GENERIC is not set
+CONFIG_BACKLIGHT_PWM=y
+# CONFIG_BACKLIGHT_ADP8860 is not set
+CONFIG_BACKLIGHT_PCF50633=y
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Console display driver support
+#
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
+# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+# CONFIG_LOGO is not set
+CONFIG_SOUND=m
+CONFIG_SOUND_OSS_CORE=y
+CONFIG_SOUND_OSS_CORE_PRECLAIM=y
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_JACK=y
+CONFIG_SND_SEQUENCER=m
+CONFIG_SND_SEQ_DUMMY=m
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_PCM_OSS_PLUGINS=y
+CONFIG_SND_SEQUENCER_OSS=y
+# CONFIG_SND_DYNAMIC_MINORS is not set
+# CONFIG_SND_SUPPORT_OLD_API is not set
+# CONFIG_SND_VERBOSE_PROCFS is not set
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+# CONFIG_SND_RAWMIDI_SEQ is not set
+# CONFIG_SND_OPL3_LIB_SEQ is not set
+# CONFIG_SND_OPL4_LIB_SEQ is not set
+# CONFIG_SND_SBAWE_SEQ is not set
+# CONFIG_SND_EMU10K1_SEQ is not set
+# CONFIG_SND_DRIVERS is not set
+# CONFIG_SND_ARM is not set
+# CONFIG_SND_SPI is not set
+# CONFIG_SND_USB is not set
+CONFIG_SND_SOC=m
+CONFIG_SND_S3C24XX_SOC=m
+CONFIG_SND_S3C24XX_SOC_I2S=m
+CONFIG_SND_S3C24XX_SOC_NEO1973_WM8753=m
+# CONFIG_SND_S3C24XX_SOC_LN2440SBC_ALC650 is not set
+# CONFIG_SND_S3C24XX_SOC_S3C24XX_UDA134X is not set
+# CONFIG_SND_S3C24XX_SOC_SIMTEC_TLV320AIC23 is not set
+# CONFIG_SND_S3C24XX_SOC_SIMTEC_HERMES is not set
+CONFIG_SND_SOC_I2C_AND_SPI=m
+# CONFIG_SND_SOC_ALL_CODECS is not set
+CONFIG_SND_SOC_WM8753=m
+CONFIG_SND_SOC_LM4857=m
+# CONFIG_SOUND_PRIME is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HIDRAW is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=m
+# CONFIG_HID_PID is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# USB HID Boot Protocol drivers
+#
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+
+#
+# Special HID drivers
+#
+# CONFIG_HID_3M_PCT is not set
+CONFIG_HID_A4TECH=m
+# CONFIG_HID_ACRUX_FF is not set
+CONFIG_HID_APPLE=m
+CONFIG_HID_BELKIN=m
+# CONFIG_HID_CANDO is not set
+CONFIG_HID_CHERRY=m
+CONFIG_HID_CHICONY=m
+# CONFIG_HID_PRODIKEYS is not set
+CONFIG_HID_CYPRESS=m
+CONFIG_HID_DRAGONRISE=m
+# CONFIG_DRAGONRISE_FF is not set
+# CONFIG_HID_EGALAX is not set
+# CONFIG_HID_ELECOM is not set
+CONFIG_HID_EZKEY=m
+CONFIG_HID_KYE=m
+# CONFIG_HID_UCLOGIC is not set
+# CONFIG_HID_WALTOP is not set
+CONFIG_HID_GYRATION=m
+CONFIG_HID_TWINHAN=m
+CONFIG_HID_KENSINGTON=m
+CONFIG_HID_LOGITECH=m
+# CONFIG_LOGITECH_FF is not set
+# CONFIG_LOGIRUMBLEPAD2_FF is not set
+# CONFIG_LOGIG940_FF is not set
+# CONFIG_LOGIWII_FF is not set
+# CONFIG_HID_MAGICMOUSE is not set
+CONFIG_HID_MICROSOFT=m
+# CONFIG_HID_MOSART is not set
+CONFIG_HID_MONTEREY=m
+CONFIG_HID_NTRIG=m
+CONFIG_HID_ORTEK=m
+CONFIG_HID_PANTHERLORD=m
+# CONFIG_PANTHERLORD_FF is not set
+CONFIG_HID_PETALYNX=m
+# CONFIG_HID_PICOLCD is not set
+# CONFIG_HID_QUANTA is not set
+# CONFIG_HID_ROCCAT is not set
+# CONFIG_HID_ROCCAT_KONE is not set
+# CONFIG_HID_ROCCAT_PYRA is not set
+CONFIG_HID_SAMSUNG=m
+CONFIG_HID_SONY=m
+# CONFIG_HID_STANTUM is not set
+CONFIG_HID_SUNPLUS=m
+CONFIG_HID_GREENASIA=m
+# CONFIG_GREENASIA_FF is not set
+CONFIG_HID_SMARTJOYPLUS=m
+# CONFIG_SMARTJOYPLUS_FF is not set
+CONFIG_HID_TOPSEED=m
+CONFIG_HID_THRUSTMASTER=m
+# CONFIG_THRUSTMASTER_FF is not set
+CONFIG_HID_WACOM=m
+# CONFIG_HID_WACOM_POWER_SUPPLY is not set
+CONFIG_HID_ZEROPLUS=m
+# CONFIG_ZEROPLUS_FF is not set
+# CONFIG_HID_ZYDACRON is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+# CONFIG_USB_ARCH_HAS_EHCI is not set
+CONFIG_USB=m
+# CONFIG_USB_DEBUG is not set
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+
+#
+# Miscellaneous USB options
+#
+# CONFIG_USB_DEVICEFS is not set
+# CONFIG_USB_DEVICE_CLASS is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+# CONFIG_USB_MON is not set
+# CONFIG_USB_WUSB is not set
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+# CONFIG_USB_OXU210HP_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1760_HCD is not set
+# CONFIG_USB_ISP1362_HCD is not set
+CONFIG_USB_OHCI_HCD=m
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_HWA_HCD is not set
+# CONFIG_USB_MUSB_HDRC is not set
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+# CONFIG_USB_WDM is not set
+CONFIG_USB_TMC=m
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
+#
+
+#
+# also be needed; see USB_STORAGE Help for more info
+#
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+CONFIG_USB_STORAGE_DATAFAB=m
+CONFIG_USB_STORAGE_FREECOM=m
+# CONFIG_USB_STORAGE_ISD200 is not set
+CONFIG_USB_STORAGE_USBAT=m
+CONFIG_USB_STORAGE_SDDR09=m
+CONFIG_USB_STORAGE_SDDR55=m
+CONFIG_USB_STORAGE_JUMPSHOT=m
+CONFIG_USB_STORAGE_ALAUDA=m
+# CONFIG_USB_STORAGE_ONETOUCH is not set
+CONFIG_USB_STORAGE_KARMA=m
+# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
+# CONFIG_USB_UAS is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB port drivers
+#
+CONFIG_USB_SERIAL=m
+CONFIG_USB_EZUSB=y
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_AIRCABLE=m
+CONFIG_USB_SERIAL_ARK3116=m
+CONFIG_USB_SERIAL_BELKIN=m
+# CONFIG_USB_SERIAL_CH341 is not set
+CONFIG_USB_SERIAL_WHITEHEAT=m
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+# CONFIG_USB_SERIAL_CP210X is not set
+CONFIG_USB_SERIAL_CYPRESS_M8=m
+CONFIG_USB_SERIAL_EMPEG=m
+CONFIG_USB_SERIAL_FTDI_SIO=m
+CONFIG_USB_SERIAL_FUNSOFT=m
+CONFIG_USB_SERIAL_VISOR=m
+CONFIG_USB_SERIAL_IPAQ=m
+CONFIG_USB_SERIAL_IR=m
+CONFIG_USB_SERIAL_EDGEPORT=m
+CONFIG_USB_SERIAL_EDGEPORT_TI=m
+CONFIG_USB_SERIAL_GARMIN=m
+CONFIG_USB_SERIAL_IPW=m
+# CONFIG_USB_SERIAL_IUU is not set
+CONFIG_USB_SERIAL_KEYSPAN_PDA=m
+CONFIG_USB_SERIAL_KEYSPAN=m
+CONFIG_USB_SERIAL_KLSI=m
+CONFIG_USB_SERIAL_KOBIL_SCT=m
+CONFIG_USB_SERIAL_MCT_U232=m
+CONFIG_USB_SERIAL_MOS7720=m
+CONFIG_USB_SERIAL_MOS7840=m
+# CONFIG_USB_SERIAL_MOTOROLA is not set
+CONFIG_USB_SERIAL_NAVMAN=m
+CONFIG_USB_SERIAL_PL2303=m
+# CONFIG_USB_SERIAL_OTI6858 is not set
+# CONFIG_USB_SERIAL_QCAUX is not set
+# CONFIG_USB_SERIAL_QUALCOMM is not set
+# CONFIG_USB_SERIAL_SPCP8X5 is not set
+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 is not set
+CONFIG_USB_SERIAL_SIERRAWIRELESS=m
+# CONFIG_USB_SERIAL_SYMBOL is not set
+CONFIG_USB_SERIAL_TI=m
+CONFIG_USB_SERIAL_CYBERJACK=m
+CONFIG_USB_SERIAL_XIRCOM=m
+CONFIG_USB_SERIAL_WWAN=m
+CONFIG_USB_SERIAL_OPTION=m
+CONFIG_USB_SERIAL_OMNINET=m
+# CONFIG_USB_SERIAL_OPTICON is not set
+# CONFIG_USB_SERIAL_VIVOPAY_SERIAL is not set
+# CONFIG_USB_SERIAL_ZIO is not set
+# CONFIG_USB_SERIAL_SSU100 is not set
+# CONFIG_USB_SERIAL_DEBUG is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_SEVSEG is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_LD is not set
+CONFIG_USB_TRANCEVIBRATOR=m
+CONFIG_USB_IOWARRIOR=m
+# CONFIG_USB_TEST is not set
+# CONFIG_USB_ISIGHTFW is not set
+# CONFIG_USB_YUREX is not set
+CONFIG_USB_GADGET=m
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_VBUS_DRAW=500
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_R8A66597 is not set
+CONFIG_USB_GADGET_S3C2410=y
+CONFIG_USB_S3C2410=m
+# CONFIG_USB_S3C2410_DEBUG is not set
+# CONFIG_USB_GADGET_M66592 is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+# CONFIG_USB_GADGET_DUALSPEED is not set
+# CONFIG_USB_ZERO is not set
+# CONFIG_USB_AUDIO is not set
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+# CONFIG_USB_ETH_EEM is not set
+CONFIG_USB_GADGETFS=m
+# CONFIG_USB_FUNCTIONFS is not set
+CONFIG_USB_FILE_STORAGE=m
+# CONFIG_USB_FILE_STORAGE_TEST is not set
+CONFIG_USB_MASS_STORAGE=m
+CONFIG_USB_G_SERIAL=m
+# CONFIG_USB_MIDI_GADGET is not set
+# CONFIG_USB_G_PRINTER is not set
+CONFIG_USB_CDC_COMPOSITE=m
+# CONFIG_USB_G_MULTI is not set
+# CONFIG_USB_G_HID is not set
+# CONFIG_USB_G_DBGP is not set
+
+#
+# OTG and related infrastructure
+#
+# CONFIG_USB_GPIO_VBUS is not set
+# CONFIG_USB_ULPI is not set
+# CONFIG_NOP_USB_XCEIV is not set
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+CONFIG_MMC_UNSAFE_RESUME=y
+
+#
+# MMC/SD/SDIO Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_MINORS=8
+CONFIG_MMC_BLOCK_BOUNCE=y
+# CONFIG_SDIO_UART is not set
+# CONFIG_MMC_TEST is not set
+
+#
+# MMC/SD/SDIO Host Controller Drivers
+#
+# CONFIG_MMC_SDHCI is not set
+# CONFIG_MMC_SPI is not set
+CONFIG_MMC_S3C=y
+# CONFIG_MMC_S3C_HW_SDIO_IRQ is not set
+CONFIG_MMC_S3C_PIO=y
+# CONFIG_MMC_S3C_DMA is not set
+# CONFIG_MMC_S3C_PIODMA is not set
+CONFIG_MMC_GLAMO=y
+# CONFIG_MMC_USHC is not set
+# CONFIG_MEMSTICK is not set
+CONFIG_NEW_LEDS=y
+# CONFIG_LEDS_CLASS is not set
+
+#
+# LED drivers
+#
+CONFIG_LEDS_S3C24XX=m
+# CONFIG_LEDS_PCA9532 is not set
+CONFIG_LEDS_GPIO=m
+CONFIG_LEDS_GPIO_PLATFORM=y
+# CONFIG_LEDS_LP3944 is not set
+# CONFIG_LEDS_LP5521 is not set
+# CONFIG_LEDS_LP5523 is not set
+# CONFIG_LEDS_PCA955X is not set
+# CONFIG_LEDS_DAC124S085 is not set
+CONFIG_LEDS_PWM=m
+CONFIG_LEDS_REGULATOR=m
+# CONFIG_LEDS_BD2802 is not set
+# CONFIG_LEDS_LT3593 is not set
+CONFIG_LEDS_TRIGGERS=y
+
+#
+# LED Triggers
+#
+CONFIG_LEDS_TRIGGER_TIMER=m
+CONFIG_LEDS_TRIGGER_HEARTBEAT=m
+CONFIG_LEDS_TRIGGER_BACKLIGHT=m
+CONFIG_LEDS_TRIGGER_GPIO=m
+CONFIG_LEDS_TRIGGER_DEFAULT_ON=m
+
+#
+# iptables trigger is under Netfilter config (LED target)
+#
+# CONFIG_ACCESSIBILITY is not set
+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
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_DS3232 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_ISL12022 is not set
+# CONFIG_RTC_DRV_X1205 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_PCF8583 is not set
+# CONFIG_RTC_DRV_M41T80 is not set
+# CONFIG_RTC_DRV_BQ32K is not set
+# CONFIG_RTC_DRV_S35390A is not set
+# CONFIG_RTC_DRV_FM3130 is not set
+# CONFIG_RTC_DRV_RX8581 is not set
+# CONFIG_RTC_DRV_RX8025 is not set
+
+#
+# SPI RTC drivers
+#
+# CONFIG_RTC_DRV_M41T94 is not set
+# CONFIG_RTC_DRV_DS1305 is not set
+# CONFIG_RTC_DRV_DS1390 is not set
+# CONFIG_RTC_DRV_MAX6902 is not set
+# CONFIG_RTC_DRV_R9701 is not set
+# CONFIG_RTC_DRV_RS5C348 is not set
+# CONFIG_RTC_DRV_DS3234 is not set
+# CONFIG_RTC_DRV_PCF2123 is not set
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_MSM6242 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_RP5C01 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+CONFIG_RTC_DRV_PCF50633=y
+
+#
+# on-CPU RTC drivers
+#
+CONFIG_RTC_DRV_S3C=y
+# CONFIG_DMADEVICES is not set
+# CONFIG_AUXDISPLAY is not set
+# CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+CONFIG_AR6000_WLAN=m
+# CONFIG_AR6000_WLAN_DEBUG is not set
+# CONFIG_AR6000_WLAN_RESET is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+# CONFIG_EXT3_FS_XATTR is not set
+# CONFIG_EXT4_FS is not set
+CONFIG_JBD=y
+CONFIG_REISERFS_FS=y
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+# CONFIG_REISERFS_FS_XATTR is not set
+# CONFIG_JFS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_XFS_FS=m
+# CONFIG_XFS_QUOTA is not set
+# CONFIG_XFS_POSIX_ACL is not set
+# CONFIG_XFS_RT is not set
+# CONFIG_XFS_DEBUG is not set
+# CONFIG_OCFS2_FS is not set
+CONFIG_BTRFS_FS=m
+# CONFIG_BTRFS_FS_POSIX_ACL is not set
+# CONFIG_NILFS2_FS is not set
+CONFIG_EXPORTFS=m
+CONFIG_FILE_LOCKING=y
+CONFIG_FSNOTIFY=y
+# CONFIG_DNOTIFY is not set
+CONFIG_INOTIFY_USER=y
+# CONFIG_FANOTIFY is not set
+# CONFIG_QUOTA is not set
+# CONFIG_QUOTACTL is not set
+CONFIG_AUTOFS4_FS=m
+CONFIG_FUSE_FS=m
+CONFIG_CUSE=m
+CONFIG_GENERIC_ACL=y
+
+#
+# Caches
+#
+# CONFIG_FSCACHE is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+# CONFIG_ZISOFS is not set
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+# CONFIG_MSDOS_FS is not set
+CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_CONFIGFS_FS=m
+CONFIG_MISC_FILESYSTEMS=y
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_ECRYPT_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
+CONFIG_JFFS2_SUMMARY=y
+# CONFIG_JFFS2_FS_XATTR is not set
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_ZLIB=y
+# CONFIG_JFFS2_LZO is not set
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+# CONFIG_JFFS2_CMODE_NONE is not set
+CONFIG_JFFS2_CMODE_PRIORITY=y
+# CONFIG_JFFS2_CMODE_SIZE is not set
+# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
+CONFIG_UBIFS_FS=y
+CONFIG_UBIFS_FS_XATTR=y
+CONFIG_UBIFS_FS_ADVANCED_COMPR=y
+CONFIG_UBIFS_FS_LZO=y
+CONFIG_UBIFS_FS_ZLIB=y
+# CONFIG_UBIFS_FS_DEBUG is not set
+# CONFIG_LOGFS is not set
+# CONFIG_CRAMFS is not set
+CONFIG_SQUASHFS=m
+# CONFIG_SQUASHFS_XATTR is not set
+# CONFIG_SQUASHFS_LZO is not set
+# CONFIG_SQUASHFS_EMBEDDED is not set
+CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+# CONFIG_NFS_V4_1 is not set
+# CONFIG_NFS_USE_LEGACY_DNS is not set
+CONFIG_NFS_USE_KERNEL_DNS=y
+# CONFIG_NFS_USE_NEW_IDMAPPER is not set
+CONFIG_NFSD=m
+CONFIG_NFSD_DEPRECATED=y
+CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V3=y
+CONFIG_NFSD_V3_ACL=y
+CONFIG_NFSD_V4=y
+CONFIG_LOCKD=m
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_ACL_SUPPORT=m
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=m
+CONFIG_SUNRPC_GSS=m
+CONFIG_RPCSEC_GSS_KRB5=m
+# CONFIG_CEPH_FS is not set
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_WEAK_PW_HASH is not set
+# CONFIG_CIFS_UPCALL is not set
+# CONFIG_CIFS_XATTR is not set
+# CONFIG_CIFS_DEBUG2 is not set
+# CONFIG_CIFS_DFS_UPCALL is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+CONFIG_EFI_PARTITION=y
+# CONFIG_SYSV68_PARTITION is not set
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+CONFIG_NLS_CODEPAGE_850=m
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+CONFIG_NLS_CODEPAGE_866=m
+# CONFIG_NLS_CODEPAGE_869 is not set
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+CONFIG_NLS_UTF8=m
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+CONFIG_PRINTK_TIME=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=1024
+# CONFIG_MAGIC_SYSRQ is not set
+CONFIG_STRIP_ASM_SYMS=y
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_HARDLOCKUP_DETECTOR is not set
+CONFIG_BKL=y
+# CONFIG_SPARSE_RCU_POINTER is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_MEMORY_INIT is not set
+CONFIG_FRAME_POINTER=y
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_TRACING_SUPPORT=y
+# CONFIG_FTRACE is not set
+# CONFIG_ATOMIC64_SELFTEST is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_STRICT_DEVMEM is not set
+# CONFIG_ARM_UNWIND is not set
+# CONFIG_DEBUG_USER is not set
+# CONFIG_OC_ETM is not set
+CONFIG_DEBUG_S3C_UART=2
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
+# CONFIG_SECURITY_DMESG_RESTRICT is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+CONFIG_DEFAULT_SECURITY_DAC=y
+CONFIG_DEFAULT_SECURITY=""
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD=m
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER=m
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_PCOMP=y
+CONFIG_CRYPTO_PCOMP2=y
+CONFIG_CRYPTO_MANAGER=m
+CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
+CONFIG_CRYPTO_GF128MUL=m
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_WORKQUEUE=y
+# CONFIG_CRYPTO_CRYPTD is not set
+CONFIG_CRYPTO_AUTHENC=m
+CONFIG_CRYPTO_TEST=m
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=m
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+CONFIG_CRYPTO_ECB=m
+CONFIG_CRYPTO_LRW=m
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+CONFIG_CRYPTO_HMAC=m
+CONFIG_CRYPTO_XCBC=m
+# CONFIG_CRYPTO_VMAC is not set
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=y
+# CONFIG_CRYPTO_GHASH is not set
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_MICHAEL_MIC=m
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_WP512=m
+
+#
+# Ciphers
+#
+# CONFIG_CRYPTO_AES is not set
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_ARC4=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_DES=m
+CONFIG_CRYPTO_FCRYPT=m
+CONFIG_CRYPTO_KHAZAD=m
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_TWOFISH_COMMON=m
+
+#
+# Compression
+#
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_ZLIB=y
+CONFIG_CRYPTO_LZO=y
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_HW is not set
+# CONFIG_BINARY_PRINTF is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
+CONFIG_CRC_CCITT=y
+CONFIG_CRC16=y
+CONFIG_CRC_T10DIF=y
+CONFIG_CRC_ITU_T=y
+CONFIG_CRC32=y
+CONFIG_CRC7=y
+CONFIG_LIBCRC32C=y
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_DECOMPRESS_GZIP=y
+CONFIG_DECOMPRESS_BZIP2=y
+CONFIG_DECOMPRESS_LZMA=y
+CONFIG_DECOMPRESS_LZO=y
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_TEXTSEARCH_BM=m
+CONFIG_TEXTSEARCH_FSM=m
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_DMA=y
+CONFIG_NLATTR=y
+CONFIG_GENERIC_ATOMIC64=y
diff --git a/recipes/linux/linux-2.6.37/openmoko.patch b/recipes/linux/linux-2.6.37/openmoko.patch
new file mode 100644
index 0000000..7635f68
--- /dev/null
+++ b/recipes/linux/linux-2.6.37/openmoko.patch
@@ -0,0 +1,51829 @@
+diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
+index 7193884..6534c00 100644
+--- a/arch/arm/boot/compressed/head.S
++++ b/arch/arm/boot/compressed/head.S
+@@ -66,7 +66,7 @@ wait: mrc p14, 0, pc, c0, c1, 0
+ add \rb, \rb, #0x00010000 @ Ser1
+ #endif
+ .endm
+-#elif defined(CONFIG_ARCH_S3C2410)
++#elif defined(CONFIG_ARCH_S3C2410) && CONFIG_S3C_LOWLEVEL_UART_PORT >= 0
+ .macro loadsp, rb, tmp
+ mov \rb, #0x50000000
+ add \rb, \rb, #0x4000 * CONFIG_S3C_LOWLEVEL_UART_PORT
+diff --git a/arch/arm/configs/gta02_defconfig b/arch/arm/configs/gta02_defconfig
+new file mode 100644
+index 0000000..0e4864d
+--- /dev/null
++++ b/arch/arm/configs/gta02_defconfig
+@@ -0,0 +1,1938 @@
++#
++# Automatically generated make config: don't edit
++# Linux/arm 2.6.37 Kernel Configuration
++# Wed Jan 5 19:56:16 2011
++#
++CONFIG_ARM=y
++CONFIG_HAVE_PWM=y
++CONFIG_SYS_SUPPORTS_APM_EMULATION=y
++CONFIG_GENERIC_GPIO=y
++CONFIG_ARCH_USES_GETTIMEOFFSET=y
++CONFIG_HAVE_PROC_CPU=y
++CONFIG_NO_IOPORT=y
++CONFIG_GENERIC_HARDIRQS=y
++CONFIG_STACKTRACE_SUPPORT=y
++CONFIG_HAVE_LATENCYTOP_SUPPORT=y
++CONFIG_LOCKDEP_SUPPORT=y
++CONFIG_TRACE_IRQFLAGS_SUPPORT=y
++CONFIG_HARDIRQS_SW_RESEND=y
++CONFIG_GENERIC_IRQ_PROBE=y
++CONFIG_RWSEM_GENERIC_SPINLOCK=y
++CONFIG_ARCH_HAS_CPUFREQ=y
++CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
++CONFIG_GENERIC_HWEIGHT=y
++CONFIG_GENERIC_CALIBRATE_DELAY=y
++CONFIG_NEED_DMA_MAP_STATE=y
++CONFIG_FIQ=y
++CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
++CONFIG_VECTORS_BASE=0xffff0000
++CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
++CONFIG_CONSTRUCTORS=y
++CONFIG_HAVE_IRQ_WORK=y
++
++#
++# General setup
++#
++CONFIG_EXPERIMENTAL=y
++CONFIG_BROKEN_ON_SMP=y
++CONFIG_INIT_ENV_ARG_LIMIT=32
++CONFIG_CROSS_COMPILE=""
++CONFIG_LOCALVERSION=""
++# CONFIG_LOCALVERSION_AUTO is not set
++CONFIG_HAVE_KERNEL_GZIP=y
++CONFIG_HAVE_KERNEL_LZMA=y
++CONFIG_HAVE_KERNEL_LZO=y
++CONFIG_KERNEL_GZIP=y
++# CONFIG_KERNEL_LZMA is not set
++# CONFIG_KERNEL_LZO is not set
++CONFIG_SWAP=y
++CONFIG_SYSVIPC=y
++CONFIG_SYSVIPC_SYSCTL=y
++# CONFIG_POSIX_MQUEUE is not set
++# CONFIG_BSD_PROCESS_ACCT is not set
++# CONFIG_TASKSTATS is not set
++# CONFIG_AUDIT is not set
++# CONFIG_HAVE_GENERIC_HARDIRQS is not set
++# CONFIG_SPARSE_IRQ is not set
++
++#
++# RCU Subsystem
++#
++CONFIG_TINY_RCU=y
++# CONFIG_PREEMPT_RCU is not set
++# CONFIG_TREE_RCU_TRACE is not set
++# CONFIG_IKCONFIG is not set
++CONFIG_LOG_BUF_SHIFT=18
++# CONFIG_CGROUPS is not set
++CONFIG_NAMESPACES=y
++# CONFIG_UTS_NS is not set
++# CONFIG_IPC_NS is not set
++# CONFIG_USER_NS is not set
++# CONFIG_PID_NS is not set
++# CONFIG_NET_NS is not set
++CONFIG_SYSFS_DEPRECATED=y
++CONFIG_SYSFS_DEPRECATED_V2=y
++# CONFIG_RELAY is not set
++CONFIG_BLK_DEV_INITRD=y
++CONFIG_INITRAMFS_SOURCE=""
++CONFIG_RD_GZIP=y
++CONFIG_RD_BZIP2=y
++CONFIG_RD_LZMA=y
++CONFIG_RD_LZO=y
++# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
++CONFIG_SYSCTL=y
++CONFIG_ANON_INODES=y
++# CONFIG_EMBEDDED is not set
++CONFIG_UID16=y
++CONFIG_SYSCTL_SYSCALL=y
++CONFIG_KALLSYMS=y
++# CONFIG_KALLSYMS_EXTRA_PASS is not set
++CONFIG_HOTPLUG=y
++CONFIG_PRINTK=y
++CONFIG_BUG=y
++CONFIG_ELF_CORE=y
++CONFIG_BASE_FULL=y
++CONFIG_FUTEX=y
++CONFIG_EPOLL=y
++CONFIG_SIGNALFD=y
++CONFIG_TIMERFD=y
++CONFIG_EVENTFD=y
++CONFIG_SHMEM=y
++CONFIG_AIO=y
++CONFIG_HAVE_PERF_EVENTS=y
++CONFIG_PERF_USE_VMALLOC=y
++
++#
++# Kernel Performance Events And Counters
++#
++# CONFIG_PERF_EVENTS is not set
++# CONFIG_PERF_COUNTERS is not set
++CONFIG_VM_EVENT_COUNTERS=y
++CONFIG_COMPAT_BRK=y
++CONFIG_SLAB=y
++# CONFIG_SLUB is not set
++# CONFIG_PROFILING is not set
++CONFIG_HAVE_OPROFILE=y
++# CONFIG_KPROBES is not set
++CONFIG_HAVE_KPROBES=y
++CONFIG_HAVE_KRETPROBES=y
++CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
++CONFIG_HAVE_CLK=y
++
++#
++# GCOV-based kernel profiling
++#
++# CONFIG_GCOV_KERNEL is not set
++CONFIG_HAVE_GENERIC_DMA_COHERENT=y
++CONFIG_SLABINFO=y
++CONFIG_RT_MUTEXES=y
++CONFIG_BASE_SMALL=0
++CONFIG_MODULES=y
++# CONFIG_MODULE_FORCE_LOAD is not set
++CONFIG_MODULE_UNLOAD=y
++CONFIG_MODULE_FORCE_UNLOAD=y
++# CONFIG_MODVERSIONS is not set
++# CONFIG_MODULE_SRCVERSION_ALL is not set
++CONFIG_BLOCK=y
++CONFIG_LBDAF=y
++# CONFIG_BLK_DEV_BSG is not set
++# CONFIG_BLK_DEV_INTEGRITY is not set
++
++#
++# IO Schedulers
++#
++CONFIG_IOSCHED_NOOP=y
++CONFIG_IOSCHED_DEADLINE=y
++# CONFIG_IOSCHED_CFQ is not set
++CONFIG_DEFAULT_DEADLINE=y
++# CONFIG_DEFAULT_NOOP is not set
++CONFIG_DEFAULT_IOSCHED="deadline"
++# CONFIG_INLINE_SPIN_TRYLOCK is not set
++# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
++# CONFIG_INLINE_SPIN_LOCK is not set
++# CONFIG_INLINE_SPIN_LOCK_BH is not set
++# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
++# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
++CONFIG_INLINE_SPIN_UNLOCK=y
++# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
++CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
++# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
++# CONFIG_INLINE_READ_TRYLOCK is not set
++# CONFIG_INLINE_READ_LOCK is not set
++# CONFIG_INLINE_READ_LOCK_BH is not set
++# CONFIG_INLINE_READ_LOCK_IRQ is not set
++# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
++CONFIG_INLINE_READ_UNLOCK=y
++# CONFIG_INLINE_READ_UNLOCK_BH is not set
++CONFIG_INLINE_READ_UNLOCK_IRQ=y
++# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
++# CONFIG_INLINE_WRITE_TRYLOCK is not set
++# CONFIG_INLINE_WRITE_LOCK is not set
++# CONFIG_INLINE_WRITE_LOCK_BH is not set
++# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
++# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
++CONFIG_INLINE_WRITE_UNLOCK=y
++# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
++CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
++# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
++# CONFIG_MUTEX_SPIN_ON_OWNER is not set
++CONFIG_FREEZER=y
++
++#
++# System Type
++#
++CONFIG_MMU=y
++# CONFIG_ARCH_AAEC2000 is not set
++# CONFIG_ARCH_INTEGRATOR is not set
++# CONFIG_ARCH_REALVIEW is not set
++# CONFIG_ARCH_VERSATILE is not set
++# CONFIG_ARCH_VEXPRESS is not set
++# CONFIG_ARCH_AT91 is not set
++# CONFIG_ARCH_BCMRING is not set
++# CONFIG_ARCH_CLPS711X is not set
++# CONFIG_ARCH_CNS3XXX is not set
++# CONFIG_ARCH_GEMINI is not set
++# CONFIG_ARCH_EBSA110 is not set
++# CONFIG_ARCH_EP93XX is not set
++# CONFIG_ARCH_FOOTBRIDGE is not set
++# CONFIG_ARCH_MXC is not set
++# CONFIG_ARCH_STMP3XXX is not set
++# CONFIG_ARCH_NETX is not set
++# CONFIG_ARCH_H720X is not set
++# CONFIG_ARCH_IOP13XX is not set
++# CONFIG_ARCH_IOP32X is not set
++# CONFIG_ARCH_IOP33X is not set
++# CONFIG_ARCH_IXP23XX is not set
++# CONFIG_ARCH_IXP2000 is not set
++# CONFIG_ARCH_IXP4XX is not set
++# CONFIG_ARCH_DOVE is not set
++# CONFIG_ARCH_KIRKWOOD is not set
++# CONFIG_ARCH_LOKI is not set
++# CONFIG_ARCH_LPC32XX is not set
++# CONFIG_ARCH_MV78XX0 is not set
++# CONFIG_ARCH_ORION5X is not set
++# CONFIG_ARCH_MMP is not set
++# CONFIG_ARCH_KS8695 is not set
++# CONFIG_ARCH_NS9XXX is not set
++# CONFIG_ARCH_W90X900 is not set
++# CONFIG_ARCH_NUC93X is not set
++# CONFIG_ARCH_TEGRA is not set
++# CONFIG_ARCH_PNX4008 is not set
++# CONFIG_ARCH_PXA is not set
++# CONFIG_ARCH_MSM is not set
++# CONFIG_ARCH_SHMOBILE is not set
++# CONFIG_ARCH_RPC is not set
++# CONFIG_ARCH_SA1100 is not set
++CONFIG_ARCH_S3C2410=y
++# CONFIG_ARCH_S3C64XX is not set
++# CONFIG_ARCH_S5P64X0 is not set
++# CONFIG_ARCH_S5P6442 is not set
++# CONFIG_ARCH_S5PC100 is not set
++# CONFIG_ARCH_S5PV210 is not set
++# CONFIG_ARCH_S5PV310 is not set
++# CONFIG_ARCH_SHARK is not set
++# CONFIG_ARCH_TCC_926 is not set
++# CONFIG_ARCH_LH7A40X is not set
++# CONFIG_ARCH_U300 is not set
++# CONFIG_ARCH_U8500 is not set
++# CONFIG_ARCH_NOMADIK is not set
++# CONFIG_ARCH_DAVINCI is not set
++# CONFIG_ARCH_OMAP is not set
++# CONFIG_PLAT_SPEAR is not set
++CONFIG_PLAT_SAMSUNG=y
++
++#
++# Boot options
++#
++# CONFIG_S3C_BOOT_WATCHDOG is not set
++# CONFIG_S3C_BOOT_ERROR_RESET is not set
++CONFIG_S3C_BOOT_UART_FORCE_FIFO=y
++CONFIG_S3C_LOWLEVEL_UART_PORT=-1
++CONFIG_S3C_GPIO_CFG_S3C24XX=y
++CONFIG_S3C_GPIO_PULL_DOWN=y
++CONFIG_SAMSUNG_GPIO_EXTRA=64
++CONFIG_S3C_GPIO_SPACE=0
++CONFIG_S3C_ADC=y
++CONFIG_S3C_DEV_USB_HOST=y
++CONFIG_S3C_DEV_WDT=y
++CONFIG_S3C_DEV_NAND=y
++CONFIG_S3C_DMA=y
++
++#
++# Power management
++#
++# CONFIG_SAMSUNG_PM_DEBUG is not set
++# CONFIG_SAMSUNG_PM_CHECK is not set
++CONFIG_PLAT_S3C24XX=y
++CONFIG_CPU_LLSERIAL_S3C2440_ONLY=y
++CONFIG_CPU_LLSERIAL_S3C2440=y
++CONFIG_S3C2410_CLOCK=y
++CONFIG_S3C24XX_PWM=y
++CONFIG_S3C24XX_GPIO_EXTRA=64
++CONFIG_S3C24XX_GPIO_EXTRA64=y
++CONFIG_S3C2410_DMA=y
++# CONFIG_S3C2410_DMA_DEBUG is not set
++
++#
++# S3C2400 Machines
++#
++CONFIG_CPU_S3C2410_DMA=y
++CONFIG_S3C2410_PM=y
++CONFIG_S3C2410_GPIO=y
++
++#
++# S3C2410 Machines
++#
++# CONFIG_ARCH_SMDK2410 is not set
++# CONFIG_ARCH_H1940 is not set
++# CONFIG_MACH_N30 is not set
++# CONFIG_ARCH_BAST is not set
++# CONFIG_MACH_OTOM is not set
++# CONFIG_MACH_AML_M5900 is not set
++# CONFIG_MACH_TCT_HAMMER is not set
++# CONFIG_MACH_VR1000 is not set
++# CONFIG_MACH_QT2410 is not set
++
++#
++# S3C2412 Machines
++#
++# CONFIG_MACH_JIVE is not set
++# CONFIG_MACH_SMDK2413 is not set
++# CONFIG_MACH_SMDK2412 is not set
++# CONFIG_MACH_VSTMS is not set
++
++#
++# S3C2416 Machines
++#
++# CONFIG_MACH_SMDK2416 is not set
++CONFIG_CPU_S3C2442=y
++CONFIG_CPU_S3C244X=y
++
++#
++# S3C2440 and S3C2442 Machines
++#
++# CONFIG_MACH_ANUBIS is not set
++CONFIG_MACH_NEO1973_GTA02=y
++# CONFIG_MACH_OSIRIS is not set
++# CONFIG_MACH_RX3715 is not set
++# CONFIG_ARCH_S3C2440 is not set
++# CONFIG_MACH_NEXCODER_2440 is not set
++# CONFIG_SMDK2440_CPU2440 is not set
++# CONFIG_SMDK2440_CPU2442 is not set
++# CONFIG_MACH_AT2440EVB is not set
++# CONFIG_MACH_MINI2440 is not set
++# CONFIG_MACH_RX1950 is not set
++
++#
++# S3C2443 Machines
++#
++# CONFIG_MACH_SMDK2443 is not set
++
++#
++# Processor Type
++#
++CONFIG_CPU_ARM920T=y
++CONFIG_CPU_32v4T=y
++CONFIG_CPU_ABRT_EV4T=y
++CONFIG_CPU_PABRT_LEGACY=y
++CONFIG_CPU_CACHE_V4WT=y
++CONFIG_CPU_CACHE_VIVT=y
++CONFIG_CPU_COPY_V4WB=y
++CONFIG_CPU_TLB_V4WBI=y
++CONFIG_CPU_CP15=y
++CONFIG_CPU_CP15_MMU=y
++
++#
++# Processor Features
++#
++CONFIG_ARM_THUMB=y
++# CONFIG_CPU_ICACHE_DISABLE is not set
++# CONFIG_CPU_DCACHE_DISABLE is not set
++# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
++CONFIG_ARM_L1_CACHE_SHIFT=5
++
++#
++# Bus support
++#
++# CONFIG_PCI_SYSCALL is not set
++# CONFIG_ARCH_SUPPORTS_MSI is not set
++# CONFIG_PCCARD is not set
++
++#
++# Kernel Features
++#
++CONFIG_VMSPLIT_3G=y
++# CONFIG_VMSPLIT_2G is not set
++# CONFIG_VMSPLIT_1G is not set
++CONFIG_PAGE_OFFSET=0xC0000000
++CONFIG_PREEMPT_NONE=y
++# CONFIG_PREEMPT_VOLUNTARY is not set
++# CONFIG_PREEMPT is not set
++CONFIG_HZ=200
++CONFIG_AEABI=y
++# CONFIG_OABI_COMPAT is not set
++# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
++# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
++# CONFIG_HIGHMEM is not set
++CONFIG_SELECT_MEMORY_MODEL=y
++CONFIG_FLATMEM_MANUAL=y
++CONFIG_FLATMEM=y
++CONFIG_FLAT_NODE_MEM_MAP=y
++CONFIG_HAVE_MEMBLOCK=y
++CONFIG_PAGEFLAGS_EXTENDED=y
++CONFIG_SPLIT_PTLOCK_CPUS=999999
++# CONFIG_PHYS_ADDR_T_64BIT is not set
++CONFIG_ZONE_DMA_FLAG=0
++CONFIG_VIRT_TO_BUS=y
++# CONFIG_KSM is not set
++CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
++CONFIG_NEED_PER_CPU_KM=y
++CONFIG_FORCE_MAX_ZONEORDER=11
++CONFIG_ALIGNMENT_TRAP=y
++# CONFIG_UACCESS_WITH_MEMCPY is not set
++# CONFIG_SECCOMP is not set
++# CONFIG_CC_STACKPROTECTOR is not set
++# CONFIG_DEPRECATED_PARAM_STRUCT is not set
++
++#
++# Boot options
++#
++CONFIG_ZBOOT_ROM_TEXT=0x0
++CONFIG_ZBOOT_ROM_BSS=0x0
++CONFIG_CMDLINE="unused -- bootloader passes ATAG list"
++# CONFIG_CMDLINE_FORCE is not set
++# CONFIG_XIP_KERNEL is not set
++# CONFIG_KEXEC is not set
++# CONFIG_AUTO_ZRELADDR is not set
++
++#
++# CPU Power Management
++#
++# CONFIG_CPU_FREQ is not set
++CONFIG_CPU_IDLE=y
++CONFIG_CPU_IDLE_GOV_LADDER=y
++
++#
++# Floating point emulation
++#
++
++#
++# At least one emulation must be selected
++#
++
++#
++# Userspace binary formats
++#
++CONFIG_BINFMT_ELF=y
++# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
++CONFIG_HAVE_AOUT=y
++# CONFIG_BINFMT_AOUT is not set
++# CONFIG_BINFMT_MISC is not set
++
++#
++# Power management options
++#
++CONFIG_PM=y
++# CONFIG_PM_DEBUG is not set
++CONFIG_PM_SLEEP=y
++CONFIG_SUSPEND_NVS=y
++CONFIG_SUSPEND=y
++CONFIG_SUSPEND_FREEZER=y
++# CONFIG_APM_EMULATION is not set
++# CONFIG_PM_RUNTIME is not set
++CONFIG_PM_OPS=y
++CONFIG_ARCH_SUSPEND_POSSIBLE=y
++CONFIG_NET=y
++
++#
++# Networking options
++#
++CONFIG_PACKET=y
++CONFIG_UNIX=y
++# CONFIG_NET_KEY is not set
++CONFIG_INET=y
++CONFIG_IP_MULTICAST=y
++CONFIG_IP_ADVANCED_ROUTER=y
++CONFIG_ASK_IP_FIB_HASH=y
++# CONFIG_IP_FIB_TRIE is not set
++CONFIG_IP_FIB_HASH=y
++CONFIG_IP_MULTIPLE_TABLES=y
++# CONFIG_IP_ROUTE_MULTIPATH is not set
++# CONFIG_IP_ROUTE_VERBOSE is not set
++CONFIG_IP_PNP=y
++# CONFIG_IP_PNP_DHCP is not set
++# CONFIG_IP_PNP_BOOTP is not set
++# CONFIG_IP_PNP_RARP is not set
++# CONFIG_NET_IPIP is not set
++# CONFIG_NET_IPGRE_DEMUX is not set
++CONFIG_IP_MROUTE=y
++CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
++# CONFIG_IP_PIMSM_V1 is not set
++# CONFIG_IP_PIMSM_V2 is not set
++# CONFIG_ARPD is not set
++CONFIG_SYN_COOKIES=y
++# CONFIG_INET_AH is not set
++# CONFIG_INET_ESP is not set
++# CONFIG_INET_IPCOMP is not set
++# CONFIG_INET_XFRM_TUNNEL is not set
++# CONFIG_INET_TUNNEL is not set
++# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
++# CONFIG_INET_XFRM_MODE_TUNNEL is not set
++# CONFIG_INET_XFRM_MODE_BEET is not set
++# CONFIG_INET_LRO is not set
++CONFIG_INET_DIAG=y
++CONFIG_INET_TCP_DIAG=y
++CONFIG_TCP_CONG_ADVANCED=y
++# CONFIG_TCP_CONG_BIC is not set
++# CONFIG_TCP_CONG_CUBIC is not set
++CONFIG_TCP_CONG_WESTWOOD=y
++# CONFIG_TCP_CONG_HTCP is not set
++# CONFIG_TCP_CONG_HSTCP is not set
++# CONFIG_TCP_CONG_HYBLA is not set
++# CONFIG_TCP_CONG_VEGAS is not set
++# CONFIG_TCP_CONG_SCALABLE is not set
++# CONFIG_TCP_CONG_LP is not set
++# CONFIG_TCP_CONG_VENO is not set
++# CONFIG_TCP_CONG_YEAH is not set
++# CONFIG_TCP_CONG_ILLINOIS is not set
++CONFIG_DEFAULT_WESTWOOD=y
++# CONFIG_DEFAULT_RENO is not set
++CONFIG_DEFAULT_TCP_CONG="westwood"
++CONFIG_TCP_MD5SIG=y
++# CONFIG_IPV6 is not set
++# CONFIG_NETWORK_SECMARK is not set
++# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
++# CONFIG_NETFILTER is not set
++# CONFIG_IP_DCCP is not set
++# CONFIG_IP_SCTP is not set
++# CONFIG_RDS is not set
++# CONFIG_TIPC is not set
++# CONFIG_ATM is not set
++# CONFIG_L2TP is not set
++CONFIG_STP=y
++CONFIG_BRIDGE=y
++# CONFIG_BRIDGE_IGMP_SNOOPING is not set
++# CONFIG_NET_DSA is not set
++# CONFIG_VLAN_8021Q is not set
++# CONFIG_DECNET is not set
++CONFIG_LLC=y
++# CONFIG_LLC2 is not set
++# CONFIG_IPX is not set
++# CONFIG_ATALK is not set
++# CONFIG_X25 is not set
++# CONFIG_LAPB is not set
++# CONFIG_ECONET is not set
++# CONFIG_WAN_ROUTER is not set
++# CONFIG_PHONET is not set
++# CONFIG_IEEE802154 is not set
++CONFIG_NET_SCHED=y
++
++#
++# Queueing/Scheduling
++#
++# CONFIG_NET_SCH_CBQ is not set
++# CONFIG_NET_SCH_HTB is not set
++# CONFIG_NET_SCH_HFSC is not set
++# CONFIG_NET_SCH_PRIO is not set
++# CONFIG_NET_SCH_MULTIQ is not set
++# CONFIG_NET_SCH_RED is not set
++# CONFIG_NET_SCH_SFQ is not set
++# CONFIG_NET_SCH_TEQL is not set
++# CONFIG_NET_SCH_TBF is not set
++# CONFIG_NET_SCH_GRED is not set
++# CONFIG_NET_SCH_DSMARK is not set
++# CONFIG_NET_SCH_NETEM is not set
++# CONFIG_NET_SCH_DRR is not set
++
++#
++# Classification
++#
++CONFIG_NET_CLS=y
++CONFIG_NET_CLS_BASIC=y
++# CONFIG_NET_CLS_TCINDEX is not set
++# CONFIG_NET_CLS_ROUTE4 is not set
++# CONFIG_NET_CLS_FW is not set
++# CONFIG_NET_CLS_U32 is not set
++# CONFIG_NET_CLS_RSVP is not set
++# CONFIG_NET_CLS_RSVP6 is not set
++# CONFIG_NET_CLS_FLOW is not set
++# CONFIG_NET_EMATCH is not set
++# CONFIG_NET_CLS_ACT is not set
++CONFIG_NET_SCH_FIFO=y
++# CONFIG_DCB is not set
++
++#
++# Network testing
++#
++# CONFIG_NET_PKTGEN is not set
++# CONFIG_HAMRADIO is not set
++# CONFIG_CAN is not set
++# CONFIG_IRDA is not set
++CONFIG_BT=y
++CONFIG_BT_L2CAP=y
++CONFIG_BT_SCO=y
++CONFIG_BT_RFCOMM=y
++CONFIG_BT_RFCOMM_TTY=y
++CONFIG_BT_BNEP=y
++CONFIG_BT_BNEP_MC_FILTER=y
++CONFIG_BT_BNEP_PROTO_FILTER=y
++CONFIG_BT_HIDP=y
++
++#
++# Bluetooth device drivers
++#
++CONFIG_BT_HCIBTUSB=y
++# CONFIG_BT_HCIBTSDIO is not set
++# CONFIG_BT_HCIUART is not set
++# CONFIG_BT_HCIBCM203X is not set
++# CONFIG_BT_HCIBPA10X is not set
++# CONFIG_BT_HCIBFUSB is not set
++# CONFIG_BT_HCIVHCI is not set
++# CONFIG_BT_MRVL is not set
++# CONFIG_BT_ATH3K is not set
++# CONFIG_AF_RXRPC is not set
++CONFIG_FIB_RULES=y
++CONFIG_WIRELESS=y
++CONFIG_WIRELESS_EXT=y
++CONFIG_WEXT_CORE=y
++CONFIG_WEXT_PROC=y
++CONFIG_WEXT_PRIV=y
++# CONFIG_CFG80211 is not set
++CONFIG_WIRELESS_EXT_SYSFS=y
++# CONFIG_LIB80211 is not set
++
++#
++# CFG80211 needs to be enabled for MAC80211
++#
++
++#
++# Some wireless drivers require a rate control algorithm
++#
++# CONFIG_WIMAX is not set
++# CONFIG_RFKILL is not set
++# CONFIG_NET_9P is not set
++# CONFIG_CAIF is not set
++# CONFIG_CEPH_LIB is not set
++
++#
++# Device Drivers
++#
++
++#
++# Generic Driver Options
++#
++CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
++# CONFIG_DEVTMPFS is not set
++CONFIG_STANDALONE=y
++CONFIG_PREVENT_FIRMWARE_BUILD=y
++CONFIG_FW_LOADER=y
++# CONFIG_FIRMWARE_IN_KERNEL is not set
++CONFIG_EXTRA_FIRMWARE=""
++# CONFIG_SYS_HYPERVISOR is not set
++# CONFIG_CONNECTOR is not set
++CONFIG_MTD=y
++# CONFIG_MTD_DEBUG is not set
++# CONFIG_MTD_TESTS is not set
++CONFIG_MTD_CONCAT=y
++CONFIG_MTD_PARTITIONS=y
++# CONFIG_MTD_REDBOOT_PARTS is not set
++CONFIG_MTD_CMDLINE_PARTS=y
++# CONFIG_MTD_AFS_PARTS is not set
++# CONFIG_MTD_AR7_PARTS is not set
++
++#
++# User Modules And Translation Layers
++#
++CONFIG_MTD_CHAR=y
++CONFIG_MTD_BLKDEVS=y
++CONFIG_MTD_BLOCK=y
++# CONFIG_FTL is not set
++# CONFIG_NFTL is not set
++# CONFIG_INFTL is not set
++# CONFIG_RFD_FTL is not set
++# CONFIG_SSFDC is not set
++# CONFIG_SM_FTL is not set
++# CONFIG_MTD_OOPS is not set
++
++#
++# RAM/ROM/Flash chip drivers
++#
++CONFIG_MTD_CFI=y
++# CONFIG_MTD_JEDECPROBE is not set
++CONFIG_MTD_GEN_PROBE=y
++# CONFIG_MTD_CFI_ADV_OPTIONS is not set
++CONFIG_MTD_MAP_BANK_WIDTH_1=y
++CONFIG_MTD_MAP_BANK_WIDTH_2=y
++CONFIG_MTD_MAP_BANK_WIDTH_4=y
++# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
++# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
++# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
++CONFIG_MTD_CFI_I1=y
++CONFIG_MTD_CFI_I2=y
++# CONFIG_MTD_CFI_I4 is not set
++# CONFIG_MTD_CFI_I8 is not set
++CONFIG_MTD_CFI_INTELEXT=y
++# CONFIG_MTD_CFI_AMDSTD is not set
++# CONFIG_MTD_CFI_STAA is not set
++CONFIG_MTD_CFI_UTIL=y
++# CONFIG_MTD_RAM is not set
++CONFIG_MTD_ROM=y
++CONFIG_MTD_ABSENT=y
++
++#
++# Mapping drivers for chip access
++#
++# CONFIG_MTD_COMPLEX_MAPPINGS is not set
++CONFIG_MTD_PHYSMAP=y
++# CONFIG_MTD_PHYSMAP_COMPAT is not set
++# CONFIG_MTD_ARM_INTEGRATOR is not set
++# CONFIG_MTD_PLATRAM is not set
++
++#
++# Self-contained MTD device drivers
++#
++# CONFIG_MTD_DATAFLASH is not set
++# CONFIG_MTD_M25P80 is not set
++# CONFIG_MTD_SST25L is not set
++# CONFIG_MTD_SLRAM is not set
++# CONFIG_MTD_PHRAM is not set
++# CONFIG_MTD_MTDRAM is not set
++# CONFIG_MTD_BLOCK2MTD is not set
++
++#
++# Disk-On-Chip Device Drivers
++#
++# CONFIG_MTD_DOC2000 is not set
++# CONFIG_MTD_DOC2001 is not set
++# CONFIG_MTD_DOC2001PLUS is not set
++CONFIG_MTD_NAND_ECC=y
++# CONFIG_MTD_NAND_ECC_SMC is not set
++CONFIG_MTD_NAND=y
++CONFIG_MTD_NAND_VERIFY_WRITE=y
++# CONFIG_MTD_SM_COMMON is not set
++# CONFIG_MTD_NAND_MUSEUM_IDS is not set
++# CONFIG_MTD_NAND_GPIO is not set
++CONFIG_MTD_NAND_IDS=y
++CONFIG_MTD_NAND_S3C2410=y
++# CONFIG_MTD_NAND_S3C2410_DEBUG is not set
++CONFIG_MTD_NAND_S3C2410_HWECC=y
++# CONFIG_MTD_NAND_S3C2410_CLKSTOP is not set
++# CONFIG_MTD_NAND_DISKONCHIP is not set
++# CONFIG_MTD_NAND_NANDSIM is not set
++# CONFIG_MTD_NAND_PLATFORM is not set
++# CONFIG_MTD_ALAUDA is not set
++# CONFIG_MTD_ONENAND is not set
++
++#
++# LPDDR flash memory drivers
++#
++# CONFIG_MTD_LPDDR is not set
++# CONFIG_MTD_UBI is not set
++# CONFIG_PARPORT is not set
++CONFIG_BLK_DEV=y
++# CONFIG_BLK_DEV_COW_COMMON is not set
++# CONFIG_BLK_DEV_LOOP is not set
++
++#
++# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
++#
++# CONFIG_BLK_DEV_NBD is not set
++# CONFIG_BLK_DEV_UB is not set
++CONFIG_BLK_DEV_RAM=y
++CONFIG_BLK_DEV_RAM_COUNT=16
++CONFIG_BLK_DEV_RAM_SIZE=4096
++# CONFIG_BLK_DEV_XIP is not set
++# CONFIG_CDROM_PKTCDVD is not set
++# CONFIG_ATA_OVER_ETH is not set
++# CONFIG_MG_DISK is not set
++# CONFIG_BLK_DEV_RBD is not set
++# CONFIG_MISC_DEVICES is not set
++CONFIG_HAVE_IDE=y
++# CONFIG_IDE is not set
++
++#
++# SCSI device support
++#
++CONFIG_SCSI_MOD=y
++# CONFIG_RAID_ATTRS is not set
++# CONFIG_SCSI is not set
++# CONFIG_SCSI_DMA is not set
++# CONFIG_SCSI_NETLINK is not set
++# CONFIG_ATA is not set
++# CONFIG_MD is not set
++CONFIG_NETDEVICES=y
++# CONFIG_DUMMY is not set
++# CONFIG_BONDING is not set
++# CONFIG_MACVLAN is not set
++# CONFIG_EQUALIZER is not set
++CONFIG_TUN=m
++# CONFIG_VETH is not set
++CONFIG_MII=y
++# CONFIG_PHYLIB is not set
++# CONFIG_NET_ETHERNET is not set
++# CONFIG_NETDEV_1000 is not set
++# CONFIG_NETDEV_10000 is not set
++CONFIG_WLAN=y
++# CONFIG_USB_ZD1201 is not set
++# CONFIG_HOSTAP is not set
++
++#
++# Enable WiMAX (Networking options) to see the WiMAX drivers
++#
++
++#
++# USB Network Adapters
++#
++# CONFIG_USB_CATC is not set
++# CONFIG_USB_KAWETH is not set
++# CONFIG_USB_PEGASUS is not set
++# CONFIG_USB_RTL8150 is not set
++# CONFIG_USB_USBNET is not set
++# CONFIG_USB_IPHETH is not set
++# CONFIG_WAN is not set
++
++#
++# CAIF transport drivers
++#
++# CONFIG_PPP is not set
++# CONFIG_SLIP is not set
++# CONFIG_NETCONSOLE is not set
++# CONFIG_NETPOLL is not set
++# CONFIG_NET_POLL_CONTROLLER is not set
++# CONFIG_ISDN is not set
++# CONFIG_PHONE is not set
++
++#
++# Input device support
++#
++CONFIG_INPUT=y
++# CONFIG_INPUT_FF_MEMLESS is not set
++# CONFIG_INPUT_POLLDEV is not set
++# CONFIG_INPUT_SPARSEKMAP is not set
++
++#
++# Userland interfaces
++#
++CONFIG_INPUT_MOUSEDEV=y
++CONFIG_INPUT_MOUSEDEV_PSAUX=y
++CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
++CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
++# CONFIG_INPUT_JOYDEV is not set
++CONFIG_INPUT_EVDEV=y
++# CONFIG_INPUT_EVBUG is not set
++
++#
++# Input Device Drivers
++#
++CONFIG_INPUT_KEYBOARD=y
++# CONFIG_KEYBOARD_ADP5588 is not set
++# CONFIG_KEYBOARD_ATKBD is not set
++# CONFIG_KEYBOARD_QT2160 is not set
++# CONFIG_KEYBOARD_LKKBD is not set
++CONFIG_KEYBOARD_GPIO=y
++# CONFIG_KEYBOARD_GPIO_POLLED is not set
++# CONFIG_KEYBOARD_TCA6416 is not set
++# CONFIG_KEYBOARD_MATRIX is not set
++# CONFIG_KEYBOARD_LM8323 is not set
++# CONFIG_KEYBOARD_MAX7359 is not set
++# CONFIG_KEYBOARD_MCS is not set
++# CONFIG_KEYBOARD_NEWTON is not set
++# CONFIG_KEYBOARD_OPENCORES is not set
++# CONFIG_KEYBOARD_STOWAWAY is not set
++# CONFIG_KEYBOARD_SUNKBD is not set
++# CONFIG_KEYBOARD_XTKBD is not set
++# CONFIG_INPUT_MOUSE is not set
++# CONFIG_INPUT_JOYSTICK is not set
++# CONFIG_INPUT_TABLET is not set
++CONFIG_INPUT_TOUCHSCREEN=y
++# CONFIG_TOUCHSCREEN_ADS7846 is not set
++# CONFIG_TOUCHSCREEN_AD7877 is not set
++# CONFIG_TOUCHSCREEN_AD7879 is not set
++# CONFIG_TOUCHSCREEN_BU21013 is not set
++# CONFIG_TOUCHSCREEN_CY8CTMG110 is not set
++# CONFIG_TOUCHSCREEN_DYNAPRO is not set
++# CONFIG_TOUCHSCREEN_HAMPSHIRE is not set
++# CONFIG_TOUCHSCREEN_EETI is not set
++# CONFIG_TOUCHSCREEN_FUJITSU is not set
++CONFIG_TOUCHSCREEN_S3C2410=y
++# CONFIG_TOUCHSCREEN_GUNZE is not set
++# CONFIG_TOUCHSCREEN_ELO is not set
++# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
++# CONFIG_TOUCHSCREEN_MCS5000 is not set
++# CONFIG_TOUCHSCREEN_MTOUCH is not set
++# CONFIG_TOUCHSCREEN_INEXIO is not set
++# CONFIG_TOUCHSCREEN_MK712 is not set
++# CONFIG_TOUCHSCREEN_PENMOUNT is not set
++# CONFIG_TOUCHSCREEN_QT602240 is not set
++# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
++# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
++# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
++# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
++# CONFIG_TOUCHSCREEN_TSC2007 is not set
++# CONFIG_TOUCHSCREEN_W90X900 is not set
++# CONFIG_TOUCHSCREEN_TPS6507X is not set
++CONFIG_INPUT_MISC=y
++# CONFIG_INPUT_AD714X is not set
++# CONFIG_INPUT_ATI_REMOTE is not set
++# CONFIG_INPUT_ATI_REMOTE2 is not set
++# CONFIG_INPUT_KEYSPAN_REMOTE is not set
++# CONFIG_INPUT_POWERMATE is not set
++# CONFIG_INPUT_YEALINK is not set
++# CONFIG_INPUT_CM109 is not set
++# CONFIG_INPUT_UINPUT is not set
++CONFIG_INPUT_PCF50633_PMU=y
++# CONFIG_INPUT_PCF8574 is not set
++# CONFIG_INPUT_PWM_BEEPER is not set
++# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
++# CONFIG_INPUT_ADXL34X is not set
++
++#
++# Hardware I/O ports
++#
++CONFIG_SERIO=y
++# CONFIG_SERIO_SERPORT is not set
++# CONFIG_SERIO_RAW is not set
++# CONFIG_SERIO_ALTERA_PS2 is not set
++# CONFIG_SERIO_PS2MULT is not set
++# CONFIG_GAMEPORT is not set
++
++#
++# Character devices
++#
++CONFIG_VT=y
++CONFIG_CONSOLE_TRANSLATIONS=y
++CONFIG_VT_CONSOLE=y
++CONFIG_HW_CONSOLE=y
++CONFIG_VT_HW_CONSOLE_BINDING=y
++# CONFIG_DEVKMEM is not set
++# CONFIG_SERIAL_NONSTANDARD is not set
++# CONFIG_N_GSM is not set
++
++#
++# Serial drivers
++#
++# CONFIG_SERIAL_8250 is not set
++
++#
++# Non-8250 serial port support
++#
++CONFIG_SERIAL_SAMSUNG=y
++CONFIG_SERIAL_SAMSUNG_UARTS=3
++CONFIG_SERIAL_SAMSUNG_CONSOLE=y
++CONFIG_SERIAL_S3C2440=y
++# CONFIG_SERIAL_MAX3100 is not set
++# CONFIG_SERIAL_MAX3107 is not set
++CONFIG_SERIAL_CORE=y
++CONFIG_SERIAL_CORE_CONSOLE=y
++# CONFIG_SERIAL_TIMBERDALE is not set
++# CONFIG_SERIAL_ALTERA_JTAGUART is not set
++# CONFIG_SERIAL_ALTERA_UART is not set
++CONFIG_UNIX98_PTYS=y
++# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
++# CONFIG_LEGACY_PTYS is not set
++# CONFIG_IPMI_HANDLER is not set
++# CONFIG_HW_RANDOM is not set
++# CONFIG_R3964 is not set
++# CONFIG_RAW_DRIVER is not set
++# CONFIG_TCG_TPM is not set
++# CONFIG_RAMOOPS is not set
++CONFIG_I2C=y
++CONFIG_I2C_BOARDINFO=y
++# CONFIG_I2C_COMPAT is not set
++CONFIG_I2C_CHARDEV=y
++# CONFIG_I2C_MUX is not set
++# CONFIG_I2C_HELPER_AUTO is not set
++# CONFIG_I2C_SMBUS is not set
++
++#
++# I2C Algorithms
++#
++# CONFIG_I2C_ALGOBIT is not set
++# CONFIG_I2C_ALGOPCF is not set
++# CONFIG_I2C_ALGOPCA is not set
++
++#
++# I2C Hardware Bus support
++#
++
++#
++# I2C system bus drivers (mostly embedded / system-on-chip)
++#
++# CONFIG_I2C_DESIGNWARE is not set
++# CONFIG_I2C_GPIO is not set
++# CONFIG_I2C_OCORES is not set
++# CONFIG_I2C_PCA_PLATFORM is not set
++CONFIG_HAVE_S3C2410_I2C=y
++CONFIG_I2C_S3C2410=y
++# CONFIG_I2C_SIMTEC is not set
++# CONFIG_I2C_XILINX is not set
++
++#
++# External I2C/SMBus adapter drivers
++#
++# CONFIG_I2C_PARPORT_LIGHT is not set
++# CONFIG_I2C_TAOS_EVM is not set
++# CONFIG_I2C_TINY_USB is not set
++
++#
++# Other I2C/SMBus bus drivers
++#
++# CONFIG_I2C_STUB is not set
++# CONFIG_I2C_DEBUG_CORE is not set
++# CONFIG_I2C_DEBUG_ALGO is not set
++# CONFIG_I2C_DEBUG_BUS is not set
++CONFIG_SPI=y
++CONFIG_SPI_MASTER=y
++
++#
++# SPI Master Controller Drivers
++#
++CONFIG_SPI_BITBANG=y
++CONFIG_SPI_GPIO=y
++CONFIG_SPI_S3C24XX=y
++# CONFIG_SPI_S3C24XX_FIQ is not set
++CONFIG_SPI_S3C24XX_GPIO=y
++# CONFIG_SPI_XILINX is not set
++# CONFIG_SPI_DESIGNWARE is not set
++
++#
++# SPI Protocol Masters
++#
++# CONFIG_SPI_SPIDEV is not set
++# CONFIG_SPI_TLE62X0 is not set
++
++#
++# PPS support
++#
++# CONFIG_PPS is not set
++CONFIG_ARCH_REQUIRE_GPIOLIB=y
++CONFIG_GPIOLIB=y
++CONFIG_GPIO_SYSFS=y
++
++#
++# Memory mapped GPIO expanders:
++#
++# CONFIG_GPIO_BASIC_MMIO is not set
++CONFIG_GPIO_GLAMO=y
++# CONFIG_GPIO_IT8761E is not set
++# CONFIG_GPIO_VX855 is not set
++
++#
++# I2C GPIO expanders:
++#
++# CONFIG_GPIO_MAX7300 is not set
++# CONFIG_GPIO_MAX732X is not set
++# CONFIG_GPIO_PCA953X is not set
++# CONFIG_GPIO_PCF857X is not set
++# CONFIG_GPIO_SX150X is not set
++# CONFIG_GPIO_ADP5588 is not set
++CONFIG_GPIO_PCF50633=y
++
++#
++# PCI GPIO expanders:
++#
++
++#
++# SPI GPIO expanders:
++#
++# CONFIG_GPIO_MAX7301 is not set
++# CONFIG_GPIO_MCP23S08 is not set
++# CONFIG_GPIO_MC33880 is not set
++# CONFIG_GPIO_74X164 is not set
++
++#
++# AC97 GPIO expanders:
++#
++
++#
++# MODULbus GPIO expanders:
++#
++# CONFIG_W1 is not set
++CONFIG_POWER_SUPPLY=y
++# CONFIG_POWER_SUPPLY_DEBUG is not set
++# CONFIG_PDA_POWER is not set
++# CONFIG_TEST_POWER is not set
++# CONFIG_BATTERY_DS2782 is not set
++# CONFIG_BATTERY_BQ20Z75 is not set
++CONFIG_BATTERY_BQ27x00=y
++CONFIG_BATTERY_BQ27X00_I2C=y
++CONFIG_BATTERY_BQ27X00_PLATFORM=y
++# CONFIG_BATTERY_MAX17040 is not set
++# CONFIG_BATTERY_S3C_ADC is not set
++CONFIG_CHARGER_PCF50633=y
++# CONFIG_BATTERY_PLATFORM is not set
++# CONFIG_HWMON is not set
++# CONFIG_THERMAL is not set
++CONFIG_WATCHDOG=y
++# CONFIG_WATCHDOG_NOWAYOUT is not set
++
++#
++# Watchdog Device Drivers
++#
++# CONFIG_SOFT_WATCHDOG is not set
++CONFIG_S3C2410_WATCHDOG=y
++# CONFIG_MAX63XX_WATCHDOG is not set
++
++#
++# USB-based Watchdog Cards
++#
++# CONFIG_USBPCWATCHDOG is not set
++CONFIG_SSB_POSSIBLE=y
++
++#
++# Sonics Silicon Backplane
++#
++# CONFIG_SSB is not set
++CONFIG_MFD_SUPPORT=y
++CONFIG_MFD_CORE=y
++# CONFIG_MFD_88PM860X is not set
++# CONFIG_MFD_SM501 is not set
++# CONFIG_MFD_ASIC3 is not set
++# CONFIG_HTC_EGPIO is not set
++# CONFIG_HTC_PASIC3 is not set
++# CONFIG_HTC_I2CPLD is not set
++# CONFIG_TPS65010 is not set
++# CONFIG_TPS6507X is not set
++# CONFIG_TWL4030_CORE is not set
++# CONFIG_MFD_STMPE is not set
++# CONFIG_MFD_TC35892 is not set
++# CONFIG_MFD_TMIO is not set
++# CONFIG_MFD_T7L66XB is not set
++# CONFIG_MFD_TC6387XB is not set
++# CONFIG_MFD_TC6393XB is not set
++# CONFIG_PMIC_DA903X is not set
++# CONFIG_PMIC_ADP5520 is not set
++# CONFIG_MFD_MAX8925 is not set
++# CONFIG_MFD_MAX8998 is not set
++# CONFIG_MFD_WM8400 is not set
++# CONFIG_MFD_WM831X_I2C is not set
++# CONFIG_MFD_WM831X_SPI is not set
++# CONFIG_MFD_WM8350_I2C is not set
++# CONFIG_MFD_WM8994 is not set
++CONFIG_MFD_PCF50633=y
++# CONFIG_MFD_MC13XXX is not set
++CONFIG_PCF50633_ADC=y
++# CONFIG_ABX500_CORE is not set
++# CONFIG_EZX_PCAP is not set
++CONFIG_MFD_GLAMO=y
++# CONFIG_MFD_TPS6586X is not set
++CONFIG_REGULATOR=y
++# CONFIG_REGULATOR_DEBUG is not set
++# CONFIG_REGULATOR_DUMMY is not set
++CONFIG_REGULATOR_FIXED_VOLTAGE=y
++# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
++CONFIG_REGULATOR_USERSPACE_CONSUMER=y
++# CONFIG_REGULATOR_BQ24022 is not set
++# CONFIG_REGULATOR_MAX1586 is not set
++# CONFIG_REGULATOR_MAX8649 is not set
++# CONFIG_REGULATOR_MAX8660 is not set
++# CONFIG_REGULATOR_MAX8952 is not set
++CONFIG_REGULATOR_PCF50633=y
++# CONFIG_REGULATOR_LP3971 is not set
++# CONFIG_REGULATOR_LP3972 is not set
++# CONFIG_REGULATOR_TPS65023 is not set
++# CONFIG_REGULATOR_TPS6507X is not set
++# CONFIG_REGULATOR_ISL6271A is not set
++# CONFIG_REGULATOR_AD5398 is not set
++# CONFIG_MEDIA_SUPPORT is not set
++
++#
++# Graphics support
++#
++# CONFIG_DRM is not set
++# CONFIG_VGASTATE is not set
++# CONFIG_VIDEO_OUTPUT_CONTROL is not set
++CONFIG_FB=y
++# CONFIG_FIRMWARE_EDID is not set
++# CONFIG_FB_DDC is not set
++# CONFIG_FB_BOOT_VESA_SUPPORT is not set
++CONFIG_FB_CFB_FILLRECT=y
++CONFIG_FB_CFB_COPYAREA=y
++CONFIG_FB_CFB_IMAGEBLIT=y
++# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
++# CONFIG_FB_SYS_FILLRECT is not set
++# CONFIG_FB_SYS_COPYAREA is not set
++# CONFIG_FB_SYS_IMAGEBLIT is not set
++# CONFIG_FB_FOREIGN_ENDIAN is not set
++# CONFIG_FB_SYS_FOPS is not set
++# CONFIG_FB_SVGALIB is not set
++# CONFIG_FB_MACMODES is not set
++# CONFIG_FB_BACKLIGHT is not set
++# CONFIG_FB_MODE_HELPERS is not set
++# CONFIG_FB_TILEBLITTING is not set
++
++#
++# Frame buffer hardware drivers
++#
++# CONFIG_FB_S1D13XXX is not set
++# CONFIG_FB_TMIO is not set
++# CONFIG_FB_S3C2410 is not set
++# CONFIG_FB_VIRTUAL is not set
++# CONFIG_FB_METRONOME is not set
++# CONFIG_FB_MB862XX is not set
++# CONFIG_FB_BROADSHEET is not set
++CONFIG_FB_GLAMO=y
++CONFIG_BACKLIGHT_LCD_SUPPORT=y
++CONFIG_LCD_CLASS_DEVICE=y
++# CONFIG_LCD_L4F00242T03 is not set
++# CONFIG_LCD_LMS283GF05 is not set
++# CONFIG_LCD_LTV350QV is not set
++# CONFIG_LCD_TDO24M is not set
++# CONFIG_LCD_VGG2432A4 is not set
++# CONFIG_LCD_PLATFORM is not set
++# CONFIG_LCD_S6E63M0 is not set
++CONFIG_LCD_JBT6K74=y
++CONFIG_BACKLIGHT_CLASS_DEVICE=y
++# CONFIG_BACKLIGHT_GENERIC is not set
++# CONFIG_BACKLIGHT_PWM is not set
++# CONFIG_BACKLIGHT_ADP8860 is not set
++CONFIG_BACKLIGHT_PCF50633=y
++
++#
++# Display device support
++#
++# CONFIG_DISPLAY_SUPPORT is not set
++
++#
++# Console display driver support
++#
++CONFIG_DUMMY_CONSOLE=y
++CONFIG_FRAMEBUFFER_CONSOLE=y
++# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
++# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
++CONFIG_FONTS=y
++# CONFIG_FONT_8x8 is not set
++# CONFIG_FONT_8x16 is not set
++CONFIG_FONT_6x11=y
++# CONFIG_FONT_7x14 is not set
++# CONFIG_FONT_PEARL_8x8 is not set
++# CONFIG_FONT_ACORN_8x8 is not set
++# CONFIG_FONT_MINI_4x6 is not set
++# CONFIG_FONT_SUN8x16 is not set
++# CONFIG_FONT_SUN12x22 is not set
++# CONFIG_FONT_10x18 is not set
++CONFIG_LOGO=y
++# CONFIG_LOGO_LINUX_MONO is not set
++# CONFIG_LOGO_LINUX_VGA16 is not set
++# CONFIG_LOGO_LINUX_CLUT224 is not set
++CONFIG_SOUND=y
++CONFIG_SOUND_OSS_CORE=y
++CONFIG_SOUND_OSS_CORE_PRECLAIM=y
++CONFIG_SND=y
++CONFIG_SND_TIMER=y
++CONFIG_SND_PCM=y
++CONFIG_SND_JACK=y
++CONFIG_SND_SEQUENCER=m
++CONFIG_SND_SEQ_DUMMY=m
++CONFIG_SND_OSSEMUL=y
++CONFIG_SND_MIXER_OSS=m
++CONFIG_SND_PCM_OSS=m
++CONFIG_SND_PCM_OSS_PLUGINS=y
++CONFIG_SND_SEQUENCER_OSS=y
++# CONFIG_SND_DYNAMIC_MINORS is not set
++# CONFIG_SND_SUPPORT_OLD_API is not set
++# CONFIG_SND_VERBOSE_PROCFS is not set
++# CONFIG_SND_VERBOSE_PRINTK is not set
++# CONFIG_SND_DEBUG is not set
++# CONFIG_SND_RAWMIDI_SEQ is not set
++# CONFIG_SND_OPL3_LIB_SEQ is not set
++# CONFIG_SND_OPL4_LIB_SEQ is not set
++# CONFIG_SND_SBAWE_SEQ is not set
++# CONFIG_SND_EMU10K1_SEQ is not set
++# CONFIG_SND_DRIVERS is not set
++# CONFIG_SND_ARM is not set
++# CONFIG_SND_SPI is not set
++# CONFIG_SND_USB is not set
++CONFIG_SND_SOC=y
++CONFIG_SND_S3C24XX_SOC=y
++CONFIG_SND_S3C24XX_SOC_I2S=y
++CONFIG_SND_S3C24XX_SOC_NEO1973_WM8753=y
++# CONFIG_SND_S3C24XX_SOC_LN2440SBC_ALC650 is not set
++# CONFIG_SND_S3C24XX_SOC_S3C24XX_UDA134X is not set
++# CONFIG_SND_S3C24XX_SOC_SIMTEC_TLV320AIC23 is not set
++# CONFIG_SND_S3C24XX_SOC_SIMTEC_HERMES is not set
++CONFIG_SND_SOC_I2C_AND_SPI=y
++# CONFIG_SND_SOC_ALL_CODECS is not set
++CONFIG_SND_SOC_WM8753=y
++CONFIG_SND_SOC_LM4857=y
++# CONFIG_SOUND_PRIME is not set
++CONFIG_HID_SUPPORT=y
++CONFIG_HID=y
++# CONFIG_HIDRAW is not set
++
++#
++# USB Input Devices
++#
++CONFIG_USB_HID=y
++# CONFIG_HID_PID is not set
++# CONFIG_USB_HIDDEV is not set
++
++#
++# Special HID drivers
++#
++# CONFIG_HID_3M_PCT is not set
++CONFIG_HID_A4TECH=y
++# CONFIG_HID_ACRUX_FF is not set
++CONFIG_HID_APPLE=y
++CONFIG_HID_BELKIN=y
++# CONFIG_HID_CANDO is not set
++CONFIG_HID_CHERRY=y
++CONFIG_HID_CHICONY=y
++# CONFIG_HID_PRODIKEYS is not set
++CONFIG_HID_CYPRESS=y
++CONFIG_HID_DRAGONRISE=y
++# CONFIG_DRAGONRISE_FF is not set
++# CONFIG_HID_EGALAX is not set
++# CONFIG_HID_ELECOM is not set
++CONFIG_HID_EZKEY=y
++CONFIG_HID_KYE=y
++# CONFIG_HID_UCLOGIC is not set
++# CONFIG_HID_WALTOP is not set
++CONFIG_HID_GYRATION=y
++CONFIG_HID_TWINHAN=y
++CONFIG_HID_KENSINGTON=y
++CONFIG_HID_LOGITECH=y
++# CONFIG_LOGITECH_FF is not set
++# CONFIG_LOGIRUMBLEPAD2_FF is not set
++# CONFIG_LOGIG940_FF is not set
++# CONFIG_LOGIWII_FF is not set
++# CONFIG_HID_MAGICMOUSE is not set
++CONFIG_HID_MICROSOFT=y
++# CONFIG_HID_MOSART is not set
++CONFIG_HID_MONTEREY=y
++CONFIG_HID_NTRIG=y
++CONFIG_HID_ORTEK=y
++CONFIG_HID_PANTHERLORD=y
++# CONFIG_PANTHERLORD_FF is not set
++CONFIG_HID_PETALYNX=y
++# CONFIG_HID_PICOLCD is not set
++# CONFIG_HID_QUANTA is not set
++# CONFIG_HID_ROCCAT is not set
++# CONFIG_HID_ROCCAT_KONE is not set
++# CONFIG_HID_ROCCAT_PYRA is not set
++CONFIG_HID_SAMSUNG=y
++CONFIG_HID_SONY=y
++# CONFIG_HID_STANTUM is not set
++CONFIG_HID_SUNPLUS=y
++CONFIG_HID_GREENASIA=y
++# CONFIG_GREENASIA_FF is not set
++CONFIG_HID_SMARTJOYPLUS=y
++# CONFIG_SMARTJOYPLUS_FF is not set
++CONFIG_HID_TOPSEED=y
++CONFIG_HID_THRUSTMASTER=y
++# CONFIG_THRUSTMASTER_FF is not set
++# CONFIG_HID_WACOM is not set
++CONFIG_HID_ZEROPLUS=y
++# CONFIG_ZEROPLUS_FF is not set
++# CONFIG_HID_ZYDACRON is not set
++CONFIG_USB_SUPPORT=y
++CONFIG_USB_ARCH_HAS_HCD=y
++CONFIG_USB_ARCH_HAS_OHCI=y
++# CONFIG_USB_ARCH_HAS_EHCI is not set
++CONFIG_USB=y
++# CONFIG_USB_DEBUG is not set
++CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
++
++#
++# Miscellaneous USB options
++#
++# CONFIG_USB_DEVICEFS is not set
++# CONFIG_USB_DEVICE_CLASS is not set
++# CONFIG_USB_DYNAMIC_MINORS is not set
++# CONFIG_USB_MON is not set
++# CONFIG_USB_WUSB is not set
++# CONFIG_USB_WUSB_CBAF is not set
++
++#
++# USB Host Controller Drivers
++#
++# CONFIG_USB_C67X00_HCD is not set
++# CONFIG_USB_OXU210HP_HCD is not set
++# CONFIG_USB_ISP116X_HCD is not set
++# CONFIG_USB_ISP1760_HCD is not set
++# CONFIG_USB_ISP1362_HCD is not set
++CONFIG_USB_OHCI_HCD=y
++# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
++# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
++CONFIG_USB_OHCI_LITTLE_ENDIAN=y
++# CONFIG_USB_SL811_HCD is not set
++# CONFIG_USB_R8A66597_HCD is not set
++# CONFIG_USB_HWA_HCD is not set
++# CONFIG_USB_MUSB_HDRC is not set
++
++#
++# USB Device Class drivers
++#
++# CONFIG_USB_ACM is not set
++# CONFIG_USB_PRINTER is not set
++# CONFIG_USB_WDM is not set
++# CONFIG_USB_TMC is not set
++
++#
++# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
++#
++
++#
++# also be needed; see USB_STORAGE Help for more info
++#
++# CONFIG_USB_LIBUSUAL is not set
++
++#
++# USB Imaging devices
++#
++# CONFIG_USB_MDC800 is not set
++
++#
++# USB port drivers
++#
++# CONFIG_USB_SERIAL is not set
++
++#
++# USB Miscellaneous drivers
++#
++# CONFIG_USB_EMI62 is not set
++# CONFIG_USB_EMI26 is not set
++# CONFIG_USB_ADUTUX is not set
++# CONFIG_USB_SEVSEG is not set
++# CONFIG_USB_RIO500 is not set
++# CONFIG_USB_LEGOTOWER is not set
++# CONFIG_USB_LCD is not set
++# CONFIG_USB_LED is not set
++# CONFIG_USB_CYPRESS_CY7C63 is not set
++# CONFIG_USB_CYTHERM is not set
++# CONFIG_USB_IDMOUSE is not set
++# CONFIG_USB_FTDI_ELAN is not set
++# CONFIG_USB_APPLEDISPLAY is not set
++# CONFIG_USB_LD is not set
++# CONFIG_USB_TRANCEVIBRATOR is not set
++# CONFIG_USB_IOWARRIOR is not set
++# CONFIG_USB_TEST is not set
++# CONFIG_USB_ISIGHTFW is not set
++# CONFIG_USB_YUREX is not set
++CONFIG_USB_GADGET=y
++# CONFIG_USB_GADGET_DEBUG_FILES is not set
++# CONFIG_USB_GADGET_DEBUG_FS is not set
++CONFIG_USB_GADGET_VBUS_DRAW=500
++CONFIG_USB_GADGET_SELECTED=y
++# CONFIG_USB_GADGET_R8A66597 is not set
++CONFIG_USB_GADGET_S3C2410=y
++CONFIG_USB_S3C2410=y
++# CONFIG_USB_S3C2410_DEBUG is not set
++# CONFIG_USB_GADGET_M66592 is not set
++# CONFIG_USB_GADGET_DUMMY_HCD is not set
++# CONFIG_USB_GADGET_DUALSPEED is not set
++# CONFIG_USB_ZERO is not set
++# CONFIG_USB_AUDIO is not set
++CONFIG_USB_ETH=y
++CONFIG_USB_ETH_RNDIS=y
++# CONFIG_USB_ETH_EEM is not set
++# CONFIG_USB_GADGETFS is not set
++# CONFIG_USB_FUNCTIONFS is not set
++# CONFIG_USB_FILE_STORAGE is not set
++# CONFIG_USB_MASS_STORAGE is not set
++# CONFIG_USB_G_SERIAL is not set
++# CONFIG_USB_MIDI_GADGET is not set
++# CONFIG_USB_G_PRINTER is not set
++# CONFIG_USB_CDC_COMPOSITE is not set
++# CONFIG_USB_G_MULTI is not set
++# CONFIG_USB_G_HID is not set
++# CONFIG_USB_G_DBGP is not set
++
++#
++# OTG and related infrastructure
++#
++# CONFIG_USB_GPIO_VBUS is not set
++# CONFIG_USB_ULPI is not set
++# CONFIG_NOP_USB_XCEIV is not set
++CONFIG_MMC=y
++# CONFIG_MMC_DEBUG is not set
++CONFIG_MMC_UNSAFE_RESUME=y
++
++#
++# MMC/SD/SDIO Card Drivers
++#
++CONFIG_MMC_BLOCK=y
++CONFIG_MMC_BLOCK_MINORS=8
++# CONFIG_MMC_BLOCK_BOUNCE is not set
++# CONFIG_SDIO_UART is not set
++# CONFIG_MMC_TEST is not set
++
++#
++# MMC/SD/SDIO Host Controller Drivers
++#
++# CONFIG_MMC_SDHCI is not set
++# CONFIG_MMC_SPI is not set
++CONFIG_MMC_S3C=y
++# CONFIG_MMC_S3C_HW_SDIO_IRQ is not set
++CONFIG_MMC_S3C_PIO=y
++# CONFIG_MMC_S3C_DMA is not set
++# CONFIG_MMC_S3C_PIODMA is not set
++CONFIG_MMC_GLAMO=y
++# CONFIG_MMC_USHC is not set
++# CONFIG_MEMSTICK is not set
++CONFIG_NEW_LEDS=y
++CONFIG_LEDS_CLASS=y
++
++#
++# LED drivers
++#
++# CONFIG_LEDS_S3C24XX is not set
++# CONFIG_LEDS_PCA9532 is not set
++CONFIG_LEDS_GPIO=y
++CONFIG_LEDS_GPIO_PLATFORM=y
++# CONFIG_LEDS_LP3944 is not set
++# CONFIG_LEDS_LP5521 is not set
++# CONFIG_LEDS_LP5523 is not set
++# CONFIG_LEDS_PCA955X is not set
++# CONFIG_LEDS_DAC124S085 is not set
++CONFIG_LEDS_PWM=y
++# CONFIG_LEDS_REGULATOR is not set
++# CONFIG_LEDS_BD2802 is not set
++# CONFIG_LEDS_LT3593 is not set
++CONFIG_LEDS_TRIGGERS=y
++
++#
++# LED Triggers
++#
++CONFIG_LEDS_TRIGGER_TIMER=y
++CONFIG_LEDS_TRIGGER_HEARTBEAT=y
++# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
++# CONFIG_LEDS_TRIGGER_GPIO is not set
++# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
++
++#
++# iptables trigger is under Netfilter config (LED target)
++#
++# CONFIG_ACCESSIBILITY is not set
++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
++#
++CONFIG_RTC_INTF_SYSFS=y
++CONFIG_RTC_INTF_PROC=y
++CONFIG_RTC_INTF_DEV=y
++# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
++# CONFIG_RTC_DRV_TEST is not set
++
++#
++# I2C RTC drivers
++#
++# CONFIG_RTC_DRV_DS1307 is not set
++# CONFIG_RTC_DRV_DS1374 is not set
++# CONFIG_RTC_DRV_DS1672 is not set
++# CONFIG_RTC_DRV_DS3232 is not set
++# CONFIG_RTC_DRV_MAX6900 is not set
++# CONFIG_RTC_DRV_RS5C372 is not set
++# CONFIG_RTC_DRV_ISL1208 is not set
++# CONFIG_RTC_DRV_ISL12022 is not set
++# CONFIG_RTC_DRV_X1205 is not set
++# CONFIG_RTC_DRV_PCF8563 is not set
++# CONFIG_RTC_DRV_PCF8583 is not set
++# CONFIG_RTC_DRV_M41T80 is not set
++# CONFIG_RTC_DRV_BQ32K is not set
++# CONFIG_RTC_DRV_S35390A is not set
++# CONFIG_RTC_DRV_FM3130 is not set
++# CONFIG_RTC_DRV_RX8581 is not set
++# CONFIG_RTC_DRV_RX8025 is not set
++
++#
++# SPI RTC drivers
++#
++# CONFIG_RTC_DRV_M41T94 is not set
++# CONFIG_RTC_DRV_DS1305 is not set
++# CONFIG_RTC_DRV_DS1390 is not set
++# CONFIG_RTC_DRV_MAX6902 is not set
++# CONFIG_RTC_DRV_R9701 is not set
++# CONFIG_RTC_DRV_RS5C348 is not set
++# CONFIG_RTC_DRV_DS3234 is not set
++# CONFIG_RTC_DRV_PCF2123 is not set
++
++#
++# Platform RTC drivers
++#
++# CONFIG_RTC_DRV_CMOS is not set
++# CONFIG_RTC_DRV_DS1286 is not set
++# CONFIG_RTC_DRV_DS1511 is not set
++# CONFIG_RTC_DRV_DS1553 is not set
++# CONFIG_RTC_DRV_DS1742 is not set
++# CONFIG_RTC_DRV_STK17TA8 is not set
++# CONFIG_RTC_DRV_M48T86 is not set
++# CONFIG_RTC_DRV_M48T35 is not set
++# CONFIG_RTC_DRV_M48T59 is not set
++# CONFIG_RTC_DRV_MSM6242 is not set
++# CONFIG_RTC_DRV_BQ4802 is not set
++# CONFIG_RTC_DRV_RP5C01 is not set
++# CONFIG_RTC_DRV_V3020 is not set
++CONFIG_RTC_DRV_PCF50633=y
++
++#
++# on-CPU RTC drivers
++#
++# CONFIG_RTC_DRV_S3C is not set
++# CONFIG_DMADEVICES is not set
++# CONFIG_AUXDISPLAY is not set
++# CONFIG_UIO is not set
++CONFIG_STAGING=y
++# CONFIG_STAGING_EXCLUDE_BUILD is not set
++# CONFIG_USB_IP_COMMON is not set
++# CONFIG_ECHO is not set
++# CONFIG_BRCM80211 is not set
++# CONFIG_RT2870 is not set
++# CONFIG_COMEDI is not set
++# CONFIG_ASUS_OLED is not set
++# CONFIG_R8712U is not set
++# CONFIG_TRANZPORT is not set
++# CONFIG_POHMELFS is not set
++# CONFIG_AUTOFS_FS is not set
++# CONFIG_LINE6_USB is not set
++# CONFIG_VT6656 is not set
++# CONFIG_FB_UDL is not set
++# CONFIG_IIO is not set
++# CONFIG_ZRAM is not set
++# CONFIG_BATMAN_ADV is not set
++# CONFIG_FB_SM7XX is not set
++
++#
++# Texas Instruments shared transport line discipline
++#
++# CONFIG_ADIS16255 is not set
++# CONFIG_SMB_FS is not set
++CONFIG_MACH_NO_WESTBRIDGE=y
++# CONFIG_ATH6K_LEGACY is not set
++# CONFIG_BCM_WIMAX is not set
++# CONFIG_FT1000 is not set
++
++#
++# Speakup console speech
++#
++# CONFIG_SPEAKUP is not set
++CONFIG_AR6000_WLAN=y
++# CONFIG_AR6000_WLAN_DEBUG is not set
++# CONFIG_AR6000_WLAN_RESET is not set
++
++#
++# File systems
++#
++CONFIG_EXT2_FS=y
++# CONFIG_EXT2_FS_XATTR is not set
++# CONFIG_EXT2_FS_XIP is not set
++CONFIG_EXT3_FS=y
++# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
++# CONFIG_EXT3_FS_XATTR is not set
++# CONFIG_EXT4_FS is not set
++CONFIG_JBD=y
++# CONFIG_JBD_DEBUG is not set
++# CONFIG_REISERFS_FS is not set
++# CONFIG_JFS_FS is not set
++# CONFIG_FS_POSIX_ACL is not set
++# CONFIG_XFS_FS is not set
++# CONFIG_GFS2_FS is not set
++# CONFIG_OCFS2_FS is not set
++# CONFIG_BTRFS_FS is not set
++# CONFIG_NILFS2_FS is not set
++CONFIG_FILE_LOCKING=y
++CONFIG_FSNOTIFY=y
++# CONFIG_DNOTIFY is not set
++CONFIG_INOTIFY_USER=y
++# CONFIG_FANOTIFY is not set
++# CONFIG_QUOTA is not set
++# CONFIG_QUOTACTL is not set
++# CONFIG_AUTOFS4_FS is not set
++# CONFIG_FUSE_FS is not set
++
++#
++# Caches
++#
++# CONFIG_FSCACHE is not set
++
++#
++# CD-ROM/DVD Filesystems
++#
++# CONFIG_ISO9660_FS is not set
++# CONFIG_UDF_FS is not set
++
++#
++# DOS/FAT/NT Filesystems
++#
++CONFIG_FAT_FS=y
++# CONFIG_MSDOS_FS is not set
++CONFIG_VFAT_FS=y
++CONFIG_FAT_DEFAULT_CODEPAGE=437
++CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
++# CONFIG_NTFS_FS is not set
++
++#
++# Pseudo filesystems
++#
++CONFIG_PROC_FS=y
++CONFIG_PROC_SYSCTL=y
++CONFIG_PROC_PAGE_MONITOR=y
++CONFIG_SYSFS=y
++CONFIG_TMPFS=y
++# CONFIG_TMPFS_POSIX_ACL is not set
++# CONFIG_HUGETLB_PAGE is not set
++# CONFIG_CONFIGFS_FS is not set
++CONFIG_MISC_FILESYSTEMS=y
++# CONFIG_ADFS_FS is not set
++# CONFIG_AFFS_FS is not set
++# CONFIG_HFS_FS is not set
++# CONFIG_HFSPLUS_FS is not set
++# CONFIG_BEFS_FS is not set
++# CONFIG_BFS_FS is not set
++# CONFIG_EFS_FS is not set
++CONFIG_JFFS2_FS=y
++CONFIG_JFFS2_FS_DEBUG=0
++CONFIG_JFFS2_FS_WRITEBUFFER=y
++# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
++CONFIG_JFFS2_SUMMARY=y
++# CONFIG_JFFS2_FS_XATTR is not set
++# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
++CONFIG_JFFS2_ZLIB=y
++# CONFIG_JFFS2_LZO is not set
++CONFIG_JFFS2_RTIME=y
++# CONFIG_JFFS2_RUBIN is not set
++# CONFIG_LOGFS is not set
++# CONFIG_CRAMFS is not set
++# CONFIG_SQUASHFS is not set
++# CONFIG_VXFS_FS is not set
++# CONFIG_MINIX_FS is not set
++# CONFIG_OMFS_FS is not set
++# CONFIG_HPFS_FS is not set
++# CONFIG_QNX4FS_FS is not set
++# CONFIG_ROMFS_FS is not set
++# CONFIG_SYSV_FS is not set
++# CONFIG_UFS_FS is not set
++# CONFIG_NETWORK_FILESYSTEMS is not set
++
++#
++# Partition Types
++#
++CONFIG_PARTITION_ADVANCED=y
++# CONFIG_ACORN_PARTITION is not set
++CONFIG_OSF_PARTITION=y
++CONFIG_AMIGA_PARTITION=y
++CONFIG_ATARI_PARTITION=y
++CONFIG_MAC_PARTITION=y
++CONFIG_MSDOS_PARTITION=y
++CONFIG_BSD_DISKLABEL=y
++CONFIG_MINIX_SUBPARTITION=y
++CONFIG_SOLARIS_X86_PARTITION=y
++CONFIG_UNIXWARE_DISKLABEL=y
++CONFIG_LDM_PARTITION=y
++CONFIG_LDM_DEBUG=y
++CONFIG_SGI_PARTITION=y
++CONFIG_ULTRIX_PARTITION=y
++CONFIG_SUN_PARTITION=y
++CONFIG_KARMA_PARTITION=y
++CONFIG_EFI_PARTITION=y
++CONFIG_SYSV68_PARTITION=y
++CONFIG_NLS=y
++CONFIG_NLS_DEFAULT="iso8859-1"
++# CONFIG_NLS_CODEPAGE_437 is not set
++# CONFIG_NLS_CODEPAGE_737 is not set
++# CONFIG_NLS_CODEPAGE_775 is not set
++# CONFIG_NLS_CODEPAGE_850 is not set
++# CONFIG_NLS_CODEPAGE_852 is not set
++# CONFIG_NLS_CODEPAGE_855 is not set
++# CONFIG_NLS_CODEPAGE_857 is not set
++# CONFIG_NLS_CODEPAGE_860 is not set
++# CONFIG_NLS_CODEPAGE_861 is not set
++# CONFIG_NLS_CODEPAGE_862 is not set
++# CONFIG_NLS_CODEPAGE_863 is not set
++# CONFIG_NLS_CODEPAGE_864 is not set
++# CONFIG_NLS_CODEPAGE_865 is not set
++# CONFIG_NLS_CODEPAGE_866 is not set
++# CONFIG_NLS_CODEPAGE_869 is not set
++# CONFIG_NLS_CODEPAGE_936 is not set
++# CONFIG_NLS_CODEPAGE_950 is not set
++# CONFIG_NLS_CODEPAGE_932 is not set
++# CONFIG_NLS_CODEPAGE_949 is not set
++# CONFIG_NLS_CODEPAGE_874 is not set
++# CONFIG_NLS_ISO8859_8 is not set
++# CONFIG_NLS_CODEPAGE_1250 is not set
++# CONFIG_NLS_CODEPAGE_1251 is not set
++# CONFIG_NLS_ASCII is not set
++# CONFIG_NLS_ISO8859_1 is not set
++# CONFIG_NLS_ISO8859_2 is not set
++# CONFIG_NLS_ISO8859_3 is not set
++# CONFIG_NLS_ISO8859_4 is not set
++# CONFIG_NLS_ISO8859_5 is not set
++# CONFIG_NLS_ISO8859_6 is not set
++# CONFIG_NLS_ISO8859_7 is not set
++# CONFIG_NLS_ISO8859_9 is not set
++# CONFIG_NLS_ISO8859_13 is not set
++# CONFIG_NLS_ISO8859_14 is not set
++# CONFIG_NLS_ISO8859_15 is not set
++# CONFIG_NLS_KOI8_R is not set
++# CONFIG_NLS_KOI8_U is not set
++# CONFIG_NLS_UTF8 is not set
++# CONFIG_DLM is not set
++
++#
++# Kernel hacking
++#
++CONFIG_PRINTK_TIME=y
++# CONFIG_ENABLE_WARN_DEPRECATED is not set
++# CONFIG_ENABLE_MUST_CHECK is not set
++CONFIG_FRAME_WARN=1024
++# CONFIG_MAGIC_SYSRQ is not set
++CONFIG_STRIP_ASM_SYMS=y
++# CONFIG_UNUSED_SYMBOLS is not set
++CONFIG_DEBUG_FS=y
++# CONFIG_HEADERS_CHECK is not set
++# CONFIG_DEBUG_KERNEL is not set
++# CONFIG_HARDLOCKUP_DETECTOR is not set
++CONFIG_BKL=y
++# CONFIG_SPARSE_RCU_POINTER is not set
++CONFIG_DEBUG_BUGVERBOSE=y
++CONFIG_DEBUG_MEMORY_INIT=y
++CONFIG_FRAME_POINTER=y
++# CONFIG_LKDTM is not set
++# CONFIG_SYSCTL_SYSCALL_CHECK is not set
++CONFIG_HAVE_FUNCTION_TRACER=y
++CONFIG_HAVE_DYNAMIC_FTRACE=y
++CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
++CONFIG_TRACING_SUPPORT=y
++# CONFIG_FTRACE is not set
++# CONFIG_DYNAMIC_DEBUG is not set
++# CONFIG_ATOMIC64_SELFTEST is not set
++# CONFIG_SAMPLES is not set
++CONFIG_HAVE_ARCH_KGDB=y
++# CONFIG_STRICT_DEVMEM is not set
++# CONFIG_ARM_UNWIND is not set
++# CONFIG_DEBUG_USER is not set
++# CONFIG_OC_ETM is not set
++CONFIG_DEBUG_S3C_UART=2
++
++#
++# Security options
++#
++# CONFIG_KEYS is not set
++# CONFIG_SECURITY_DMESG_RESTRICT is not set
++# CONFIG_SECURITY is not set
++# CONFIG_SECURITYFS is not set
++CONFIG_DEFAULT_SECURITY_DAC=y
++CONFIG_DEFAULT_SECURITY=""
++CONFIG_CRYPTO=y
++
++#
++# Crypto core or helper
++#
++CONFIG_CRYPTO_ALGAPI=y
++CONFIG_CRYPTO_ALGAPI2=y
++CONFIG_CRYPTO_HASH=y
++CONFIG_CRYPTO_HASH2=y
++CONFIG_CRYPTO_PCOMP=y
++CONFIG_CRYPTO_PCOMP2=y
++# CONFIG_CRYPTO_MANAGER is not set
++# CONFIG_CRYPTO_MANAGER2 is not set
++# CONFIG_CRYPTO_GF128MUL is not set
++# CONFIG_CRYPTO_NULL is not set
++# CONFIG_CRYPTO_CRYPTD is not set
++# CONFIG_CRYPTO_AUTHENC is not set
++# CONFIG_CRYPTO_TEST is not set
++
++#
++# Authenticated Encryption with Associated Data
++#
++# CONFIG_CRYPTO_CCM is not set
++# CONFIG_CRYPTO_GCM is not set
++# CONFIG_CRYPTO_SEQIV is not set
++
++#
++# Block modes
++#
++# CONFIG_CRYPTO_CBC is not set
++# CONFIG_CRYPTO_CTR is not set
++# CONFIG_CRYPTO_CTS is not set
++# CONFIG_CRYPTO_ECB is not set
++# CONFIG_CRYPTO_LRW is not set
++# CONFIG_CRYPTO_PCBC is not set
++# CONFIG_CRYPTO_XTS is not set
++
++#
++# Hash modes
++#
++# CONFIG_CRYPTO_HMAC is not set
++# CONFIG_CRYPTO_XCBC is not set
++# CONFIG_CRYPTO_VMAC is not set
++
++#
++# Digest
++#
++# CONFIG_CRYPTO_CRC32C is not set
++# CONFIG_CRYPTO_GHASH is not set
++# CONFIG_CRYPTO_MD4 is not set
++CONFIG_CRYPTO_MD5=y
++# CONFIG_CRYPTO_MICHAEL_MIC is not set
++# CONFIG_CRYPTO_RMD128 is not set
++# CONFIG_CRYPTO_RMD160 is not set
++# CONFIG_CRYPTO_RMD256 is not set
++# CONFIG_CRYPTO_RMD320 is not set
++# CONFIG_CRYPTO_SHA1 is not set
++# CONFIG_CRYPTO_SHA256 is not set
++# CONFIG_CRYPTO_SHA512 is not set
++# CONFIG_CRYPTO_TGR192 is not set
++# CONFIG_CRYPTO_WP512 is not set
++
++#
++# Ciphers
++#
++# CONFIG_CRYPTO_AES is not set
++# CONFIG_CRYPTO_ANUBIS is not set
++# CONFIG_CRYPTO_ARC4 is not set
++# CONFIG_CRYPTO_BLOWFISH is not set
++# CONFIG_CRYPTO_CAMELLIA is not set
++# CONFIG_CRYPTO_CAST5 is not set
++# CONFIG_CRYPTO_CAST6 is not set
++# CONFIG_CRYPTO_DES is not set
++# CONFIG_CRYPTO_FCRYPT is not set
++# CONFIG_CRYPTO_KHAZAD is not set
++# CONFIG_CRYPTO_SALSA20 is not set
++# CONFIG_CRYPTO_SEED is not set
++# CONFIG_CRYPTO_SERPENT is not set
++# CONFIG_CRYPTO_TEA is not set
++# CONFIG_CRYPTO_TWOFISH is not set
++
++#
++# Compression
++#
++# CONFIG_CRYPTO_DEFLATE is not set
++CONFIG_CRYPTO_ZLIB=y
++# CONFIG_CRYPTO_LZO is not set
++
++#
++# Random Number Generation
++#
++# CONFIG_CRYPTO_ANSI_CPRNG is not set
++# CONFIG_CRYPTO_HW is not set
++# CONFIG_BINARY_PRINTF is not set
++
++#
++# Library routines
++#
++CONFIG_BITREVERSE=y
++CONFIG_GENERIC_FIND_LAST_BIT=y
++CONFIG_CRC_CCITT=y
++CONFIG_CRC16=y
++CONFIG_CRC_T10DIF=y
++CONFIG_CRC_ITU_T=y
++CONFIG_CRC32=y
++CONFIG_CRC7=y
++# CONFIG_LIBCRC32C is not set
++CONFIG_ZLIB_INFLATE=y
++CONFIG_ZLIB_DEFLATE=y
++CONFIG_LZO_DECOMPRESS=y
++CONFIG_DECOMPRESS_GZIP=y
++CONFIG_DECOMPRESS_BZIP2=y
++CONFIG_DECOMPRESS_LZMA=y
++CONFIG_DECOMPRESS_LZO=y
++CONFIG_HAS_IOMEM=y
++CONFIG_HAS_DMA=y
++CONFIG_NLATTR=y
++CONFIG_GENERIC_ATOMIC64=y
+diff --git a/arch/arm/configs/gta02_drm_defconfig b/arch/arm/configs/gta02_drm_defconfig
+new file mode 100644
+index 0000000..d771962
+--- /dev/null
++++ b/arch/arm/configs/gta02_drm_defconfig
+@@ -0,0 +1,1943 @@
++#
++# Automatically generated make config: don't edit
++# Linux/arm 2.6.37 Kernel Configuration
++# Wed Jan 5 19:56:16 2011
++#
++CONFIG_ARM=y
++CONFIG_HAVE_PWM=y
++CONFIG_SYS_SUPPORTS_APM_EMULATION=y
++CONFIG_GENERIC_GPIO=y
++CONFIG_ARCH_USES_GETTIMEOFFSET=y
++CONFIG_HAVE_PROC_CPU=y
++CONFIG_NO_IOPORT=y
++CONFIG_GENERIC_HARDIRQS=y
++CONFIG_STACKTRACE_SUPPORT=y
++CONFIG_HAVE_LATENCYTOP_SUPPORT=y
++CONFIG_LOCKDEP_SUPPORT=y
++CONFIG_TRACE_IRQFLAGS_SUPPORT=y
++CONFIG_HARDIRQS_SW_RESEND=y
++CONFIG_GENERIC_IRQ_PROBE=y
++CONFIG_RWSEM_GENERIC_SPINLOCK=y
++CONFIG_ARCH_HAS_CPUFREQ=y
++CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
++CONFIG_GENERIC_HWEIGHT=y
++CONFIG_GENERIC_CALIBRATE_DELAY=y
++CONFIG_NEED_DMA_MAP_STATE=y
++CONFIG_FIQ=y
++CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
++CONFIG_VECTORS_BASE=0xffff0000
++CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
++CONFIG_CONSTRUCTORS=y
++CONFIG_HAVE_IRQ_WORK=y
++
++#
++# General setup
++#
++CONFIG_EXPERIMENTAL=y
++CONFIG_BROKEN_ON_SMP=y
++CONFIG_INIT_ENV_ARG_LIMIT=32
++CONFIG_CROSS_COMPILE=""
++CONFIG_LOCALVERSION=""
++# CONFIG_LOCALVERSION_AUTO is not set
++CONFIG_HAVE_KERNEL_GZIP=y
++CONFIG_HAVE_KERNEL_LZMA=y
++CONFIG_HAVE_KERNEL_LZO=y
++CONFIG_KERNEL_GZIP=y
++# CONFIG_KERNEL_LZMA is not set
++# CONFIG_KERNEL_LZO is not set
++CONFIG_SWAP=y
++CONFIG_SYSVIPC=y
++CONFIG_SYSVIPC_SYSCTL=y
++# CONFIG_POSIX_MQUEUE is not set
++# CONFIG_BSD_PROCESS_ACCT is not set
++# CONFIG_TASKSTATS is not set
++# CONFIG_AUDIT is not set
++# CONFIG_HAVE_GENERIC_HARDIRQS is not set
++# CONFIG_SPARSE_IRQ is not set
++
++#
++# RCU Subsystem
++#
++CONFIG_TINY_RCU=y
++# CONFIG_PREEMPT_RCU is not set
++# CONFIG_TREE_RCU_TRACE is not set
++# CONFIG_IKCONFIG is not set
++CONFIG_LOG_BUF_SHIFT=18
++# CONFIG_CGROUPS is not set
++CONFIG_NAMESPACES=y
++# CONFIG_UTS_NS is not set
++# CONFIG_IPC_NS is not set
++# CONFIG_USER_NS is not set
++# CONFIG_PID_NS is not set
++# CONFIG_NET_NS is not set
++CONFIG_SYSFS_DEPRECATED=y
++CONFIG_SYSFS_DEPRECATED_V2=y
++# CONFIG_RELAY is not set
++CONFIG_BLK_DEV_INITRD=y
++CONFIG_INITRAMFS_SOURCE=""
++CONFIG_RD_GZIP=y
++CONFIG_RD_BZIP2=y
++CONFIG_RD_LZMA=y
++CONFIG_RD_LZO=y
++# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
++CONFIG_SYSCTL=y
++CONFIG_ANON_INODES=y
++# CONFIG_EMBEDDED is not set
++CONFIG_UID16=y
++CONFIG_SYSCTL_SYSCALL=y
++CONFIG_KALLSYMS=y
++# CONFIG_KALLSYMS_EXTRA_PASS is not set
++CONFIG_HOTPLUG=y
++CONFIG_PRINTK=y
++CONFIG_BUG=y
++CONFIG_ELF_CORE=y
++CONFIG_BASE_FULL=y
++CONFIG_FUTEX=y
++CONFIG_EPOLL=y
++CONFIG_SIGNALFD=y
++CONFIG_TIMERFD=y
++CONFIG_EVENTFD=y
++CONFIG_SHMEM=y
++CONFIG_AIO=y
++CONFIG_HAVE_PERF_EVENTS=y
++CONFIG_PERF_USE_VMALLOC=y
++
++#
++# Kernel Performance Events And Counters
++#
++# CONFIG_PERF_EVENTS is not set
++# CONFIG_PERF_COUNTERS is not set
++CONFIG_VM_EVENT_COUNTERS=y
++CONFIG_COMPAT_BRK=y
++CONFIG_SLAB=y
++# CONFIG_SLUB is not set
++# CONFIG_PROFILING is not set
++CONFIG_HAVE_OPROFILE=y
++# CONFIG_KPROBES is not set
++CONFIG_HAVE_KPROBES=y
++CONFIG_HAVE_KRETPROBES=y
++CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
++CONFIG_HAVE_CLK=y
++
++#
++# GCOV-based kernel profiling
++#
++# CONFIG_GCOV_KERNEL is not set
++CONFIG_HAVE_GENERIC_DMA_COHERENT=y
++CONFIG_SLABINFO=y
++CONFIG_RT_MUTEXES=y
++CONFIG_BASE_SMALL=0
++CONFIG_MODULES=y
++# CONFIG_MODULE_FORCE_LOAD is not set
++CONFIG_MODULE_UNLOAD=y
++CONFIG_MODULE_FORCE_UNLOAD=y
++# CONFIG_MODVERSIONS is not set
++# CONFIG_MODULE_SRCVERSION_ALL is not set
++CONFIG_BLOCK=y
++CONFIG_LBDAF=y
++# CONFIG_BLK_DEV_BSG is not set
++# CONFIG_BLK_DEV_INTEGRITY is not set
++
++#
++# IO Schedulers
++#
++CONFIG_IOSCHED_NOOP=y
++CONFIG_IOSCHED_DEADLINE=y
++# CONFIG_IOSCHED_CFQ is not set
++CONFIG_DEFAULT_DEADLINE=y
++# CONFIG_DEFAULT_NOOP is not set
++CONFIG_DEFAULT_IOSCHED="deadline"
++# CONFIG_INLINE_SPIN_TRYLOCK is not set
++# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
++# CONFIG_INLINE_SPIN_LOCK is not set
++# CONFIG_INLINE_SPIN_LOCK_BH is not set
++# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
++# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
++CONFIG_INLINE_SPIN_UNLOCK=y
++# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
++CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
++# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
++# CONFIG_INLINE_READ_TRYLOCK is not set
++# CONFIG_INLINE_READ_LOCK is not set
++# CONFIG_INLINE_READ_LOCK_BH is not set
++# CONFIG_INLINE_READ_LOCK_IRQ is not set
++# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
++CONFIG_INLINE_READ_UNLOCK=y
++# CONFIG_INLINE_READ_UNLOCK_BH is not set
++CONFIG_INLINE_READ_UNLOCK_IRQ=y
++# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
++# CONFIG_INLINE_WRITE_TRYLOCK is not set
++# CONFIG_INLINE_WRITE_LOCK is not set
++# CONFIG_INLINE_WRITE_LOCK_BH is not set
++# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
++# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
++CONFIG_INLINE_WRITE_UNLOCK=y
++# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
++CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
++# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
++# CONFIG_MUTEX_SPIN_ON_OWNER is not set
++CONFIG_FREEZER=y
++
++#
++# System Type
++#
++CONFIG_MMU=y
++# CONFIG_ARCH_AAEC2000 is not set
++# CONFIG_ARCH_INTEGRATOR is not set
++# CONFIG_ARCH_REALVIEW is not set
++# CONFIG_ARCH_VERSATILE is not set
++# CONFIG_ARCH_VEXPRESS is not set
++# CONFIG_ARCH_AT91 is not set
++# CONFIG_ARCH_BCMRING is not set
++# CONFIG_ARCH_CLPS711X is not set
++# CONFIG_ARCH_CNS3XXX is not set
++# CONFIG_ARCH_GEMINI is not set
++# CONFIG_ARCH_EBSA110 is not set
++# CONFIG_ARCH_EP93XX is not set
++# CONFIG_ARCH_FOOTBRIDGE is not set
++# CONFIG_ARCH_MXC is not set
++# CONFIG_ARCH_STMP3XXX is not set
++# CONFIG_ARCH_NETX is not set
++# CONFIG_ARCH_H720X is not set
++# CONFIG_ARCH_IOP13XX is not set
++# CONFIG_ARCH_IOP32X is not set
++# CONFIG_ARCH_IOP33X is not set
++# CONFIG_ARCH_IXP23XX is not set
++# CONFIG_ARCH_IXP2000 is not set
++# CONFIG_ARCH_IXP4XX is not set
++# CONFIG_ARCH_DOVE is not set
++# CONFIG_ARCH_KIRKWOOD is not set
++# CONFIG_ARCH_LOKI is not set
++# CONFIG_ARCH_LPC32XX is not set
++# CONFIG_ARCH_MV78XX0 is not set
++# CONFIG_ARCH_ORION5X is not set
++# CONFIG_ARCH_MMP is not set
++# CONFIG_ARCH_KS8695 is not set
++# CONFIG_ARCH_NS9XXX is not set
++# CONFIG_ARCH_W90X900 is not set
++# CONFIG_ARCH_NUC93X is not set
++# CONFIG_ARCH_TEGRA is not set
++# CONFIG_ARCH_PNX4008 is not set
++# CONFIG_ARCH_PXA is not set
++# CONFIG_ARCH_MSM is not set
++# CONFIG_ARCH_SHMOBILE is not set
++# CONFIG_ARCH_RPC is not set
++# CONFIG_ARCH_SA1100 is not set
++CONFIG_ARCH_S3C2410=y
++# CONFIG_ARCH_S3C64XX is not set
++# CONFIG_ARCH_S5P64X0 is not set
++# CONFIG_ARCH_S5P6442 is not set
++# CONFIG_ARCH_S5PC100 is not set
++# CONFIG_ARCH_S5PV210 is not set
++# CONFIG_ARCH_S5PV310 is not set
++# CONFIG_ARCH_SHARK is not set
++# CONFIG_ARCH_TCC_926 is not set
++# CONFIG_ARCH_LH7A40X is not set
++# CONFIG_ARCH_U300 is not set
++# CONFIG_ARCH_U8500 is not set
++# CONFIG_ARCH_NOMADIK is not set
++# CONFIG_ARCH_DAVINCI is not set
++# CONFIG_ARCH_OMAP is not set
++# CONFIG_PLAT_SPEAR is not set
++CONFIG_PLAT_SAMSUNG=y
++
++#
++# Boot options
++#
++# CONFIG_S3C_BOOT_WATCHDOG is not set
++# CONFIG_S3C_BOOT_ERROR_RESET is not set
++CONFIG_S3C_BOOT_UART_FORCE_FIFO=y
++CONFIG_S3C_LOWLEVEL_UART_PORT=-1
++CONFIG_S3C_GPIO_CFG_S3C24XX=y
++CONFIG_S3C_GPIO_PULL_DOWN=y
++CONFIG_SAMSUNG_GPIO_EXTRA=64
++CONFIG_S3C_GPIO_SPACE=0
++CONFIG_S3C_ADC=y
++CONFIG_S3C_DEV_USB_HOST=y
++CONFIG_S3C_DEV_WDT=y
++CONFIG_S3C_DEV_NAND=y
++CONFIG_S3C_DMA=y
++
++#
++# Power management
++#
++# CONFIG_SAMSUNG_PM_DEBUG is not set
++# CONFIG_SAMSUNG_PM_CHECK is not set
++CONFIG_PLAT_S3C24XX=y
++CONFIG_CPU_LLSERIAL_S3C2440_ONLY=y
++CONFIG_CPU_LLSERIAL_S3C2440=y
++CONFIG_S3C2410_CLOCK=y
++CONFIG_S3C24XX_PWM=y
++CONFIG_S3C24XX_GPIO_EXTRA=64
++CONFIG_S3C24XX_GPIO_EXTRA64=y
++CONFIG_S3C2410_DMA=y
++# CONFIG_S3C2410_DMA_DEBUG is not set
++
++#
++# S3C2400 Machines
++#
++CONFIG_CPU_S3C2410_DMA=y
++CONFIG_S3C2410_PM=y
++CONFIG_S3C2410_GPIO=y
++
++#
++# S3C2410 Machines
++#
++# CONFIG_ARCH_SMDK2410 is not set
++# CONFIG_ARCH_H1940 is not set
++# CONFIG_MACH_N30 is not set
++# CONFIG_ARCH_BAST is not set
++# CONFIG_MACH_OTOM is not set
++# CONFIG_MACH_AML_M5900 is not set
++# CONFIG_MACH_TCT_HAMMER is not set
++# CONFIG_MACH_VR1000 is not set
++# CONFIG_MACH_QT2410 is not set
++
++#
++# S3C2412 Machines
++#
++# CONFIG_MACH_JIVE is not set
++# CONFIG_MACH_SMDK2413 is not set
++# CONFIG_MACH_SMDK2412 is not set
++# CONFIG_MACH_VSTMS is not set
++
++#
++# S3C2416 Machines
++#
++# CONFIG_MACH_SMDK2416 is not set
++CONFIG_CPU_S3C2442=y
++CONFIG_CPU_S3C244X=y
++
++#
++# S3C2440 and S3C2442 Machines
++#
++# CONFIG_MACH_ANUBIS is not set
++CONFIG_MACH_NEO1973_GTA02=y
++# CONFIG_MACH_OSIRIS is not set
++# CONFIG_MACH_RX3715 is not set
++# CONFIG_ARCH_S3C2440 is not set
++# CONFIG_MACH_NEXCODER_2440 is not set
++# CONFIG_SMDK2440_CPU2440 is not set
++# CONFIG_SMDK2440_CPU2442 is not set
++# CONFIG_MACH_AT2440EVB is not set
++# CONFIG_MACH_MINI2440 is not set
++# CONFIG_MACH_RX1950 is not set
++
++#
++# S3C2443 Machines
++#
++# CONFIG_MACH_SMDK2443 is not set
++
++#
++# Processor Type
++#
++CONFIG_CPU_ARM920T=y
++CONFIG_CPU_32v4T=y
++CONFIG_CPU_ABRT_EV4T=y
++CONFIG_CPU_PABRT_LEGACY=y
++CONFIG_CPU_CACHE_V4WT=y
++CONFIG_CPU_CACHE_VIVT=y
++CONFIG_CPU_COPY_V4WB=y
++CONFIG_CPU_TLB_V4WBI=y
++CONFIG_CPU_CP15=y
++CONFIG_CPU_CP15_MMU=y
++
++#
++# Processor Features
++#
++CONFIG_ARM_THUMB=y
++# CONFIG_CPU_ICACHE_DISABLE is not set
++# CONFIG_CPU_DCACHE_DISABLE is not set
++# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
++CONFIG_ARM_L1_CACHE_SHIFT=5
++
++#
++# Bus support
++#
++# CONFIG_PCI_SYSCALL is not set
++# CONFIG_ARCH_SUPPORTS_MSI is not set
++# CONFIG_PCCARD is not set
++
++#
++# Kernel Features
++#
++CONFIG_VMSPLIT_3G=y
++# CONFIG_VMSPLIT_2G is not set
++# CONFIG_VMSPLIT_1G is not set
++CONFIG_PAGE_OFFSET=0xC0000000
++CONFIG_PREEMPT_NONE=y
++# CONFIG_PREEMPT_VOLUNTARY is not set
++# CONFIG_PREEMPT is not set
++CONFIG_HZ=200
++CONFIG_AEABI=y
++# CONFIG_OABI_COMPAT is not set
++# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
++# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
++# CONFIG_HIGHMEM is not set
++CONFIG_SELECT_MEMORY_MODEL=y
++CONFIG_FLATMEM_MANUAL=y
++CONFIG_FLATMEM=y
++CONFIG_FLAT_NODE_MEM_MAP=y
++CONFIG_HAVE_MEMBLOCK=y
++CONFIG_PAGEFLAGS_EXTENDED=y
++CONFIG_SPLIT_PTLOCK_CPUS=999999
++# CONFIG_PHYS_ADDR_T_64BIT is not set
++CONFIG_ZONE_DMA_FLAG=0
++CONFIG_VIRT_TO_BUS=y
++# CONFIG_KSM is not set
++CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
++CONFIG_NEED_PER_CPU_KM=y
++CONFIG_FORCE_MAX_ZONEORDER=11
++CONFIG_ALIGNMENT_TRAP=y
++# CONFIG_UACCESS_WITH_MEMCPY is not set
++# CONFIG_SECCOMP is not set
++# CONFIG_CC_STACKPROTECTOR is not set
++# CONFIG_DEPRECATED_PARAM_STRUCT is not set
++
++#
++# Boot options
++#
++CONFIG_ZBOOT_ROM_TEXT=0x0
++CONFIG_ZBOOT_ROM_BSS=0x0
++CONFIG_CMDLINE="unused -- bootloader passes ATAG list"
++# CONFIG_CMDLINE_FORCE is not set
++# CONFIG_XIP_KERNEL is not set
++# CONFIG_KEXEC is not set
++# CONFIG_AUTO_ZRELADDR is not set
++
++#
++# CPU Power Management
++#
++# CONFIG_CPU_FREQ is not set
++CONFIG_CPU_IDLE=y
++CONFIG_CPU_IDLE_GOV_LADDER=y
++
++#
++# Floating point emulation
++#
++
++#
++# At least one emulation must be selected
++#
++
++#
++# Userspace binary formats
++#
++CONFIG_BINFMT_ELF=y
++# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
++CONFIG_HAVE_AOUT=y
++# CONFIG_BINFMT_AOUT is not set
++# CONFIG_BINFMT_MISC is not set
++
++#
++# Power management options
++#
++CONFIG_PM=y
++# CONFIG_PM_DEBUG is not set
++CONFIG_PM_SLEEP=y
++CONFIG_SUSPEND_NVS=y
++CONFIG_SUSPEND=y
++CONFIG_SUSPEND_FREEZER=y
++# CONFIG_APM_EMULATION is not set
++# CONFIG_PM_RUNTIME is not set
++CONFIG_PM_OPS=y
++CONFIG_ARCH_SUSPEND_POSSIBLE=y
++CONFIG_NET=y
++
++#
++# Networking options
++#
++CONFIG_PACKET=y
++CONFIG_UNIX=y
++# CONFIG_NET_KEY is not set
++CONFIG_INET=y
++CONFIG_IP_MULTICAST=y
++CONFIG_IP_ADVANCED_ROUTER=y
++CONFIG_ASK_IP_FIB_HASH=y
++# CONFIG_IP_FIB_TRIE is not set
++CONFIG_IP_FIB_HASH=y
++CONFIG_IP_MULTIPLE_TABLES=y
++# CONFIG_IP_ROUTE_MULTIPATH is not set
++# CONFIG_IP_ROUTE_VERBOSE is not set
++CONFIG_IP_PNP=y
++# CONFIG_IP_PNP_DHCP is not set
++# CONFIG_IP_PNP_BOOTP is not set
++# CONFIG_IP_PNP_RARP is not set
++# CONFIG_NET_IPIP is not set
++# CONFIG_NET_IPGRE_DEMUX is not set
++CONFIG_IP_MROUTE=y
++CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
++# CONFIG_IP_PIMSM_V1 is not set
++# CONFIG_IP_PIMSM_V2 is not set
++# CONFIG_ARPD is not set
++CONFIG_SYN_COOKIES=y
++# CONFIG_INET_AH is not set
++# CONFIG_INET_ESP is not set
++# CONFIG_INET_IPCOMP is not set
++# CONFIG_INET_XFRM_TUNNEL is not set
++# CONFIG_INET_TUNNEL is not set
++# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
++# CONFIG_INET_XFRM_MODE_TUNNEL is not set
++# CONFIG_INET_XFRM_MODE_BEET is not set
++# CONFIG_INET_LRO is not set
++CONFIG_INET_DIAG=y
++CONFIG_INET_TCP_DIAG=y
++CONFIG_TCP_CONG_ADVANCED=y
++# CONFIG_TCP_CONG_BIC is not set
++# CONFIG_TCP_CONG_CUBIC is not set
++CONFIG_TCP_CONG_WESTWOOD=y
++# CONFIG_TCP_CONG_HTCP is not set
++# CONFIG_TCP_CONG_HSTCP is not set
++# CONFIG_TCP_CONG_HYBLA is not set
++# CONFIG_TCP_CONG_VEGAS is not set
++# CONFIG_TCP_CONG_SCALABLE is not set
++# CONFIG_TCP_CONG_LP is not set
++# CONFIG_TCP_CONG_VENO is not set
++# CONFIG_TCP_CONG_YEAH is not set
++# CONFIG_TCP_CONG_ILLINOIS is not set
++CONFIG_DEFAULT_WESTWOOD=y
++# CONFIG_DEFAULT_RENO is not set
++CONFIG_DEFAULT_TCP_CONG="westwood"
++CONFIG_TCP_MD5SIG=y
++# CONFIG_IPV6 is not set
++# CONFIG_NETWORK_SECMARK is not set
++# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
++# CONFIG_NETFILTER is not set
++# CONFIG_IP_DCCP is not set
++# CONFIG_IP_SCTP is not set
++# CONFIG_RDS is not set
++# CONFIG_TIPC is not set
++# CONFIG_ATM is not set
++# CONFIG_L2TP is not set
++CONFIG_STP=y
++CONFIG_BRIDGE=y
++# CONFIG_BRIDGE_IGMP_SNOOPING is not set
++# CONFIG_NET_DSA is not set
++# CONFIG_VLAN_8021Q is not set
++# CONFIG_DECNET is not set
++CONFIG_LLC=y
++# CONFIG_LLC2 is not set
++# CONFIG_IPX is not set
++# CONFIG_ATALK is not set
++# CONFIG_X25 is not set
++# CONFIG_LAPB is not set
++# CONFIG_ECONET is not set
++# CONFIG_WAN_ROUTER is not set
++# CONFIG_PHONET is not set
++# CONFIG_IEEE802154 is not set
++CONFIG_NET_SCHED=y
++
++#
++# Queueing/Scheduling
++#
++# CONFIG_NET_SCH_CBQ is not set
++# CONFIG_NET_SCH_HTB is not set
++# CONFIG_NET_SCH_HFSC is not set
++# CONFIG_NET_SCH_PRIO is not set
++# CONFIG_NET_SCH_MULTIQ is not set
++# CONFIG_NET_SCH_RED is not set
++# CONFIG_NET_SCH_SFQ is not set
++# CONFIG_NET_SCH_TEQL is not set
++# CONFIG_NET_SCH_TBF is not set
++# CONFIG_NET_SCH_GRED is not set
++# CONFIG_NET_SCH_DSMARK is not set
++# CONFIG_NET_SCH_NETEM is not set
++# CONFIG_NET_SCH_DRR is not set
++
++#
++# Classification
++#
++CONFIG_NET_CLS=y
++CONFIG_NET_CLS_BASIC=y
++# CONFIG_NET_CLS_TCINDEX is not set
++# CONFIG_NET_CLS_ROUTE4 is not set
++# CONFIG_NET_CLS_FW is not set
++# CONFIG_NET_CLS_U32 is not set
++# CONFIG_NET_CLS_RSVP is not set
++# CONFIG_NET_CLS_RSVP6 is not set
++# CONFIG_NET_CLS_FLOW is not set
++# CONFIG_NET_EMATCH is not set
++# CONFIG_NET_CLS_ACT is not set
++CONFIG_NET_SCH_FIFO=y
++# CONFIG_DCB is not set
++
++#
++# Network testing
++#
++# CONFIG_NET_PKTGEN is not set
++# CONFIG_HAMRADIO is not set
++# CONFIG_CAN is not set
++# CONFIG_IRDA is not set
++CONFIG_BT=y
++CONFIG_BT_L2CAP=y
++CONFIG_BT_SCO=y
++CONFIG_BT_RFCOMM=y
++CONFIG_BT_RFCOMM_TTY=y
++CONFIG_BT_BNEP=y
++CONFIG_BT_BNEP_MC_FILTER=y
++CONFIG_BT_BNEP_PROTO_FILTER=y
++CONFIG_BT_HIDP=y
++
++#
++# Bluetooth device drivers
++#
++CONFIG_BT_HCIBTUSB=y
++# CONFIG_BT_HCIBTSDIO is not set
++# CONFIG_BT_HCIUART is not set
++# CONFIG_BT_HCIBCM203X is not set
++# CONFIG_BT_HCIBPA10X is not set
++# CONFIG_BT_HCIBFUSB is not set
++# CONFIG_BT_HCIVHCI is not set
++# CONFIG_BT_MRVL is not set
++# CONFIG_BT_ATH3K is not set
++# CONFIG_AF_RXRPC is not set
++CONFIG_FIB_RULES=y
++CONFIG_WIRELESS=y
++CONFIG_WIRELESS_EXT=y
++CONFIG_WEXT_CORE=y
++CONFIG_WEXT_PROC=y
++CONFIG_WEXT_PRIV=y
++# CONFIG_CFG80211 is not set
++CONFIG_WIRELESS_EXT_SYSFS=y
++# CONFIG_LIB80211 is not set
++
++#
++# CFG80211 needs to be enabled for MAC80211
++#
++
++#
++# Some wireless drivers require a rate control algorithm
++#
++# CONFIG_WIMAX is not set
++# CONFIG_RFKILL is not set
++# CONFIG_NET_9P is not set
++# CONFIG_CAIF is not set
++# CONFIG_CEPH_LIB is not set
++
++#
++# Device Drivers
++#
++
++#
++# Generic Driver Options
++#
++CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
++# CONFIG_DEVTMPFS is not set
++CONFIG_STANDALONE=y
++CONFIG_PREVENT_FIRMWARE_BUILD=y
++CONFIG_FW_LOADER=y
++# CONFIG_FIRMWARE_IN_KERNEL is not set
++CONFIG_EXTRA_FIRMWARE=""
++# CONFIG_SYS_HYPERVISOR is not set
++# CONFIG_CONNECTOR is not set
++CONFIG_MTD=y
++# CONFIG_MTD_DEBUG is not set
++# CONFIG_MTD_TESTS is not set
++CONFIG_MTD_CONCAT=y
++CONFIG_MTD_PARTITIONS=y
++# CONFIG_MTD_REDBOOT_PARTS is not set
++CONFIG_MTD_CMDLINE_PARTS=y
++# CONFIG_MTD_AFS_PARTS is not set
++# CONFIG_MTD_AR7_PARTS is not set
++
++#
++# User Modules And Translation Layers
++#
++CONFIG_MTD_CHAR=y
++CONFIG_MTD_BLKDEVS=y
++CONFIG_MTD_BLOCK=y
++# CONFIG_FTL is not set
++# CONFIG_NFTL is not set
++# CONFIG_INFTL is not set
++# CONFIG_RFD_FTL is not set
++# CONFIG_SSFDC is not set
++# CONFIG_SM_FTL is not set
++# CONFIG_MTD_OOPS is not set
++
++#
++# RAM/ROM/Flash chip drivers
++#
++CONFIG_MTD_CFI=y
++# CONFIG_MTD_JEDECPROBE is not set
++CONFIG_MTD_GEN_PROBE=y
++# CONFIG_MTD_CFI_ADV_OPTIONS is not set
++CONFIG_MTD_MAP_BANK_WIDTH_1=y
++CONFIG_MTD_MAP_BANK_WIDTH_2=y
++CONFIG_MTD_MAP_BANK_WIDTH_4=y
++# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
++# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
++# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
++CONFIG_MTD_CFI_I1=y
++CONFIG_MTD_CFI_I2=y
++# CONFIG_MTD_CFI_I4 is not set
++# CONFIG_MTD_CFI_I8 is not set
++CONFIG_MTD_CFI_INTELEXT=y
++# CONFIG_MTD_CFI_AMDSTD is not set
++# CONFIG_MTD_CFI_STAA is not set
++CONFIG_MTD_CFI_UTIL=y
++# CONFIG_MTD_RAM is not set
++CONFIG_MTD_ROM=y
++CONFIG_MTD_ABSENT=y
++
++#
++# Mapping drivers for chip access
++#
++# CONFIG_MTD_COMPLEX_MAPPINGS is not set
++CONFIG_MTD_PHYSMAP=y
++# CONFIG_MTD_PHYSMAP_COMPAT is not set
++# CONFIG_MTD_ARM_INTEGRATOR is not set
++# CONFIG_MTD_PLATRAM is not set
++
++#
++# Self-contained MTD device drivers
++#
++# CONFIG_MTD_DATAFLASH is not set
++# CONFIG_MTD_M25P80 is not set
++# CONFIG_MTD_SST25L is not set
++# CONFIG_MTD_SLRAM is not set
++# CONFIG_MTD_PHRAM is not set
++# CONFIG_MTD_MTDRAM is not set
++# CONFIG_MTD_BLOCK2MTD is not set
++
++#
++# Disk-On-Chip Device Drivers
++#
++# CONFIG_MTD_DOC2000 is not set
++# CONFIG_MTD_DOC2001 is not set
++# CONFIG_MTD_DOC2001PLUS is not set
++CONFIG_MTD_NAND_ECC=y
++# CONFIG_MTD_NAND_ECC_SMC is not set
++CONFIG_MTD_NAND=y
++CONFIG_MTD_NAND_VERIFY_WRITE=y
++# CONFIG_MTD_SM_COMMON is not set
++# CONFIG_MTD_NAND_MUSEUM_IDS is not set
++# CONFIG_MTD_NAND_GPIO is not set
++CONFIG_MTD_NAND_IDS=y
++CONFIG_MTD_NAND_S3C2410=y
++# CONFIG_MTD_NAND_S3C2410_DEBUG is not set
++CONFIG_MTD_NAND_S3C2410_HWECC=y
++# CONFIG_MTD_NAND_S3C2410_CLKSTOP is not set
++# CONFIG_MTD_NAND_DISKONCHIP is not set
++# CONFIG_MTD_NAND_NANDSIM is not set
++# CONFIG_MTD_NAND_PLATFORM is not set
++# CONFIG_MTD_ALAUDA is not set
++# CONFIG_MTD_ONENAND is not set
++
++#
++# LPDDR flash memory drivers
++#
++# CONFIG_MTD_LPDDR is not set
++# CONFIG_MTD_UBI is not set
++# CONFIG_PARPORT is not set
++CONFIG_BLK_DEV=y
++# CONFIG_BLK_DEV_COW_COMMON is not set
++# CONFIG_BLK_DEV_LOOP is not set
++
++#
++# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
++#
++# CONFIG_BLK_DEV_NBD is not set
++# CONFIG_BLK_DEV_UB is not set
++CONFIG_BLK_DEV_RAM=y
++CONFIG_BLK_DEV_RAM_COUNT=16
++CONFIG_BLK_DEV_RAM_SIZE=4096
++# CONFIG_BLK_DEV_XIP is not set
++# CONFIG_CDROM_PKTCDVD is not set
++# CONFIG_ATA_OVER_ETH is not set
++# CONFIG_MG_DISK is not set
++# CONFIG_BLK_DEV_RBD is not set
++# CONFIG_MISC_DEVICES is not set
++CONFIG_HAVE_IDE=y
++# CONFIG_IDE is not set
++
++#
++# SCSI device support
++#
++CONFIG_SCSI_MOD=y
++# CONFIG_RAID_ATTRS is not set
++# CONFIG_SCSI is not set
++# CONFIG_SCSI_DMA is not set
++# CONFIG_SCSI_NETLINK is not set
++# CONFIG_ATA is not set
++# CONFIG_MD is not set
++CONFIG_NETDEVICES=y
++# CONFIG_DUMMY is not set
++# CONFIG_BONDING is not set
++# CONFIG_MACVLAN is not set
++# CONFIG_EQUALIZER is not set
++CONFIG_TUN=m
++# CONFIG_VETH is not set
++CONFIG_MII=y
++# CONFIG_PHYLIB is not set
++# CONFIG_NET_ETHERNET is not set
++# CONFIG_NETDEV_1000 is not set
++# CONFIG_NETDEV_10000 is not set
++CONFIG_WLAN=y
++# CONFIG_USB_ZD1201 is not set
++# CONFIG_HOSTAP is not set
++
++#
++# Enable WiMAX (Networking options) to see the WiMAX drivers
++#
++
++#
++# USB Network Adapters
++#
++# CONFIG_USB_CATC is not set
++# CONFIG_USB_KAWETH is not set
++# CONFIG_USB_PEGASUS is not set
++# CONFIG_USB_RTL8150 is not set
++# CONFIG_USB_USBNET is not set
++# CONFIG_USB_IPHETH is not set
++# CONFIG_WAN is not set
++
++#
++# CAIF transport drivers
++#
++# CONFIG_PPP is not set
++# CONFIG_SLIP is not set
++# CONFIG_NETCONSOLE is not set
++# CONFIG_NETPOLL is not set
++# CONFIG_NET_POLL_CONTROLLER is not set
++# CONFIG_ISDN is not set
++# CONFIG_PHONE is not set
++
++#
++# Input device support
++#
++CONFIG_INPUT=y
++# CONFIG_INPUT_FF_MEMLESS is not set
++# CONFIG_INPUT_POLLDEV is not set
++# CONFIG_INPUT_SPARSEKMAP is not set
++
++#
++# Userland interfaces
++#
++CONFIG_INPUT_MOUSEDEV=y
++CONFIG_INPUT_MOUSEDEV_PSAUX=y
++CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
++CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
++# CONFIG_INPUT_JOYDEV is not set
++CONFIG_INPUT_EVDEV=y
++# CONFIG_INPUT_EVBUG is not set
++
++#
++# Input Device Drivers
++#
++CONFIG_INPUT_KEYBOARD=y
++# CONFIG_KEYBOARD_ADP5588 is not set
++# CONFIG_KEYBOARD_ATKBD is not set
++# CONFIG_KEYBOARD_QT2160 is not set
++# CONFIG_KEYBOARD_LKKBD is not set
++CONFIG_KEYBOARD_GPIO=y
++# CONFIG_KEYBOARD_GPIO_POLLED is not set
++# CONFIG_KEYBOARD_TCA6416 is not set
++# CONFIG_KEYBOARD_MATRIX is not set
++# CONFIG_KEYBOARD_LM8323 is not set
++# CONFIG_KEYBOARD_MAX7359 is not set
++# CONFIG_KEYBOARD_MCS is not set
++# CONFIG_KEYBOARD_NEWTON is not set
++# CONFIG_KEYBOARD_OPENCORES is not set
++# CONFIG_KEYBOARD_STOWAWAY is not set
++# CONFIG_KEYBOARD_SUNKBD is not set
++# CONFIG_KEYBOARD_XTKBD is not set
++# CONFIG_INPUT_MOUSE is not set
++# CONFIG_INPUT_JOYSTICK is not set
++# CONFIG_INPUT_TABLET is not set
++CONFIG_INPUT_TOUCHSCREEN=y
++# CONFIG_TOUCHSCREEN_ADS7846 is not set
++# CONFIG_TOUCHSCREEN_AD7877 is not set
++# CONFIG_TOUCHSCREEN_AD7879 is not set
++# CONFIG_TOUCHSCREEN_BU21013 is not set
++# CONFIG_TOUCHSCREEN_CY8CTMG110 is not set
++# CONFIG_TOUCHSCREEN_DYNAPRO is not set
++# CONFIG_TOUCHSCREEN_HAMPSHIRE is not set
++# CONFIG_TOUCHSCREEN_EETI is not set
++# CONFIG_TOUCHSCREEN_FUJITSU is not set
++CONFIG_TOUCHSCREEN_S3C2410=y
++# CONFIG_TOUCHSCREEN_GUNZE is not set
++# CONFIG_TOUCHSCREEN_ELO is not set
++# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
++# CONFIG_TOUCHSCREEN_MCS5000 is not set
++# CONFIG_TOUCHSCREEN_MTOUCH is not set
++# CONFIG_TOUCHSCREEN_INEXIO is not set
++# CONFIG_TOUCHSCREEN_MK712 is not set
++# CONFIG_TOUCHSCREEN_PENMOUNT is not set
++# CONFIG_TOUCHSCREEN_QT602240 is not set
++# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
++# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
++# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
++# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
++# CONFIG_TOUCHSCREEN_TSC2007 is not set
++# CONFIG_TOUCHSCREEN_W90X900 is not set
++# CONFIG_TOUCHSCREEN_TPS6507X is not set
++CONFIG_INPUT_MISC=y
++# CONFIG_INPUT_AD714X is not set
++# CONFIG_INPUT_ATI_REMOTE is not set
++# CONFIG_INPUT_ATI_REMOTE2 is not set
++# CONFIG_INPUT_KEYSPAN_REMOTE is not set
++# CONFIG_INPUT_POWERMATE is not set
++# CONFIG_INPUT_YEALINK is not set
++# CONFIG_INPUT_CM109 is not set
++# CONFIG_INPUT_UINPUT is not set
++CONFIG_INPUT_PCF50633_PMU=y
++# CONFIG_INPUT_PCF8574 is not set
++# CONFIG_INPUT_PWM_BEEPER is not set
++# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
++# CONFIG_INPUT_ADXL34X is not set
++
++#
++# Hardware I/O ports
++#
++CONFIG_SERIO=y
++# CONFIG_SERIO_SERPORT is not set
++# CONFIG_SERIO_RAW is not set
++# CONFIG_SERIO_ALTERA_PS2 is not set
++# CONFIG_SERIO_PS2MULT is not set
++# CONFIG_GAMEPORT is not set
++
++#
++# Character devices
++#
++CONFIG_VT=y
++CONFIG_CONSOLE_TRANSLATIONS=y
++CONFIG_VT_CONSOLE=y
++CONFIG_HW_CONSOLE=y
++CONFIG_VT_HW_CONSOLE_BINDING=y
++# CONFIG_DEVKMEM is not set
++# CONFIG_SERIAL_NONSTANDARD is not set
++# CONFIG_N_GSM is not set
++
++#
++# Serial drivers
++#
++# CONFIG_SERIAL_8250 is not set
++
++#
++# Non-8250 serial port support
++#
++CONFIG_SERIAL_SAMSUNG=y
++CONFIG_SERIAL_SAMSUNG_UARTS=3
++CONFIG_SERIAL_SAMSUNG_CONSOLE=y
++CONFIG_SERIAL_S3C2440=y
++# CONFIG_SERIAL_MAX3100 is not set
++# CONFIG_SERIAL_MAX3107 is not set
++CONFIG_SERIAL_CORE=y
++CONFIG_SERIAL_CORE_CONSOLE=y
++# CONFIG_SERIAL_TIMBERDALE is not set
++# CONFIG_SERIAL_ALTERA_JTAGUART is not set
++# CONFIG_SERIAL_ALTERA_UART is not set
++CONFIG_UNIX98_PTYS=y
++# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
++# CONFIG_LEGACY_PTYS is not set
++# CONFIG_IPMI_HANDLER is not set
++# CONFIG_HW_RANDOM is not set
++# CONFIG_R3964 is not set
++# CONFIG_RAW_DRIVER is not set
++# CONFIG_TCG_TPM is not set
++# CONFIG_RAMOOPS is not set
++CONFIG_I2C=y
++CONFIG_I2C_BOARDINFO=y
++# CONFIG_I2C_COMPAT is not set
++CONFIG_I2C_CHARDEV=y
++# CONFIG_I2C_MUX is not set
++# CONFIG_I2C_HELPER_AUTO is not set
++# CONFIG_I2C_SMBUS is not set
++
++#
++# I2C Algorithms
++#
++# CONFIG_I2C_ALGOBIT is not set
++# CONFIG_I2C_ALGOPCF is not set
++# CONFIG_I2C_ALGOPCA is not set
++
++#
++# I2C Hardware Bus support
++#
++
++#
++# I2C system bus drivers (mostly embedded / system-on-chip)
++#
++# CONFIG_I2C_DESIGNWARE is not set
++# CONFIG_I2C_GPIO is not set
++# CONFIG_I2C_OCORES is not set
++# CONFIG_I2C_PCA_PLATFORM is not set
++CONFIG_HAVE_S3C2410_I2C=y
++CONFIG_I2C_S3C2410=y
++# CONFIG_I2C_SIMTEC is not set
++# CONFIG_I2C_XILINX is not set
++
++#
++# External I2C/SMBus adapter drivers
++#
++# CONFIG_I2C_PARPORT_LIGHT is not set
++# CONFIG_I2C_TAOS_EVM is not set
++# CONFIG_I2C_TINY_USB is not set
++
++#
++# Other I2C/SMBus bus drivers
++#
++# CONFIG_I2C_STUB is not set
++# CONFIG_I2C_DEBUG_CORE is not set
++# CONFIG_I2C_DEBUG_ALGO is not set
++# CONFIG_I2C_DEBUG_BUS is not set
++CONFIG_SPI=y
++CONFIG_SPI_MASTER=y
++
++#
++# SPI Master Controller Drivers
++#
++CONFIG_SPI_BITBANG=y
++CONFIG_SPI_GPIO=y
++CONFIG_SPI_S3C24XX=y
++# CONFIG_SPI_S3C24XX_FIQ is not set
++CONFIG_SPI_S3C24XX_GPIO=y
++# CONFIG_SPI_XILINX is not set
++# CONFIG_SPI_DESIGNWARE is not set
++
++#
++# SPI Protocol Masters
++#
++# CONFIG_SPI_SPIDEV is not set
++# CONFIG_SPI_TLE62X0 is not set
++
++#
++# PPS support
++#
++# CONFIG_PPS is not set
++CONFIG_ARCH_REQUIRE_GPIOLIB=y
++CONFIG_GPIOLIB=y
++CONFIG_GPIO_SYSFS=y
++
++#
++# Memory mapped GPIO expanders:
++#
++# CONFIG_GPIO_BASIC_MMIO is not set
++CONFIG_GPIO_GLAMO=y
++# CONFIG_GPIO_IT8761E is not set
++# CONFIG_GPIO_VX855 is not set
++
++#
++# I2C GPIO expanders:
++#
++# CONFIG_GPIO_MAX7300 is not set
++# CONFIG_GPIO_MAX732X is not set
++# CONFIG_GPIO_PCA953X is not set
++# CONFIG_GPIO_PCF857X is not set
++# CONFIG_GPIO_SX150X is not set
++# CONFIG_GPIO_ADP5588 is not set
++CONFIG_GPIO_PCF50633=y
++
++#
++# PCI GPIO expanders:
++#
++
++#
++# SPI GPIO expanders:
++#
++# CONFIG_GPIO_MAX7301 is not set
++# CONFIG_GPIO_MCP23S08 is not set
++# CONFIG_GPIO_MC33880 is not set
++# CONFIG_GPIO_74X164 is not set
++
++#
++# AC97 GPIO expanders:
++#
++
++#
++# MODULbus GPIO expanders:
++#
++# CONFIG_W1 is not set
++CONFIG_POWER_SUPPLY=y
++# CONFIG_POWER_SUPPLY_DEBUG is not set
++# CONFIG_PDA_POWER is not set
++# CONFIG_TEST_POWER is not set
++# CONFIG_BATTERY_DS2782 is not set
++# CONFIG_BATTERY_BQ20Z75 is not set
++CONFIG_BATTERY_BQ27x00=y
++CONFIG_BATTERY_BQ27X00_I2C=y
++CONFIG_BATTERY_BQ27X00_PLATFORM=y
++# CONFIG_BATTERY_MAX17040 is not set
++# CONFIG_BATTERY_S3C_ADC is not set
++CONFIG_CHARGER_PCF50633=y
++# CONFIG_BATTERY_PLATFORM is not set
++# CONFIG_HWMON is not set
++# CONFIG_THERMAL is not set
++CONFIG_WATCHDOG=y
++# CONFIG_WATCHDOG_NOWAYOUT is not set
++
++#
++# Watchdog Device Drivers
++#
++# CONFIG_SOFT_WATCHDOG is not set
++CONFIG_S3C2410_WATCHDOG=y
++# CONFIG_MAX63XX_WATCHDOG is not set
++
++#
++# USB-based Watchdog Cards
++#
++# CONFIG_USBPCWATCHDOG is not set
++CONFIG_SSB_POSSIBLE=y
++
++#
++# Sonics Silicon Backplane
++#
++# CONFIG_SSB is not set
++CONFIG_MFD_SUPPORT=y
++CONFIG_MFD_CORE=y
++# CONFIG_MFD_88PM860X is not set
++# CONFIG_MFD_SM501 is not set
++# CONFIG_MFD_ASIC3 is not set
++# CONFIG_HTC_EGPIO is not set
++# CONFIG_HTC_PASIC3 is not set
++# CONFIG_HTC_I2CPLD is not set
++# CONFIG_TPS65010 is not set
++# CONFIG_TPS6507X is not set
++# CONFIG_TWL4030_CORE is not set
++# CONFIG_MFD_STMPE is not set
++# CONFIG_MFD_TC35892 is not set
++# CONFIG_MFD_TMIO is not set
++# CONFIG_MFD_T7L66XB is not set
++# CONFIG_MFD_TC6387XB is not set
++# CONFIG_MFD_TC6393XB is not set
++# CONFIG_PMIC_DA903X is not set
++# CONFIG_PMIC_ADP5520 is not set
++# CONFIG_MFD_MAX8925 is not set
++# CONFIG_MFD_MAX8998 is not set
++# CONFIG_MFD_WM8400 is not set
++# CONFIG_MFD_WM831X_I2C is not set
++# CONFIG_MFD_WM831X_SPI is not set
++# CONFIG_MFD_WM8350_I2C is not set
++# CONFIG_MFD_WM8994 is not set
++CONFIG_MFD_PCF50633=y
++# CONFIG_MFD_MC13XXX is not set
++CONFIG_PCF50633_ADC=y
++# CONFIG_ABX500_CORE is not set
++# CONFIG_EZX_PCAP is not set
++CONFIG_MFD_GLAMO=y
++CONFIG_MFD_GLAMO_DRM=y
++# CONFIG_MFD_TPS6586X is not set
++CONFIG_REGULATOR=y
++# CONFIG_REGULATOR_DEBUG is not set
++# CONFIG_REGULATOR_DUMMY is not set
++CONFIG_REGULATOR_FIXED_VOLTAGE=y
++# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
++CONFIG_REGULATOR_USERSPACE_CONSUMER=y
++# CONFIG_REGULATOR_BQ24022 is not set
++# CONFIG_REGULATOR_MAX1586 is not set
++# CONFIG_REGULATOR_MAX8649 is not set
++# CONFIG_REGULATOR_MAX8660 is not set
++# CONFIG_REGULATOR_MAX8952 is not set
++CONFIG_REGULATOR_PCF50633=y
++# CONFIG_REGULATOR_LP3971 is not set
++# CONFIG_REGULATOR_LP3972 is not set
++# CONFIG_REGULATOR_TPS65023 is not set
++# CONFIG_REGULATOR_TPS6507X is not set
++# CONFIG_REGULATOR_ISL6271A is not set
++# CONFIG_REGULATOR_AD5398 is not set
++# CONFIG_MEDIA_SUPPORT is not set
++
++#
++# Graphics support
++#
++CONFIG_DRM=y
++CONFIG_DRM_KMS_HELPER=y
+++# CONFIG_DRM_MGA is not set
+++# CONFIG_DRM_VIA is not set
+++# CONFIG_DRM_SAVAGE is not set
++# CONFIG_VGASTATE is not set
++# CONFIG_VIDEO_OUTPUT_CONTROL is not set
++CONFIG_FB=y
++# CONFIG_FIRMWARE_EDID is not set
++# CONFIG_FB_DDC is not set
++# CONFIG_FB_BOOT_VESA_SUPPORT is not set
++CONFIG_FB_CFB_FILLRECT=y
++CONFIG_FB_CFB_COPYAREA=y
++CONFIG_FB_CFB_IMAGEBLIT=y
++# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
++# CONFIG_FB_SYS_FILLRECT is not set
++# CONFIG_FB_SYS_COPYAREA is not set
++# CONFIG_FB_SYS_IMAGEBLIT is not set
++# CONFIG_FB_FOREIGN_ENDIAN is not set
++# CONFIG_FB_SYS_FOPS is not set
++# CONFIG_FB_SVGALIB is not set
++# CONFIG_FB_MACMODES is not set
++# CONFIG_FB_BACKLIGHT is not set
++# CONFIG_FB_MODE_HELPERS is not set
++# CONFIG_FB_TILEBLITTING is not set
++
++#
++# Frame buffer hardware drivers
++#
++# CONFIG_FB_S1D13XXX is not set
++# CONFIG_FB_TMIO is not set
++# CONFIG_FB_S3C2410 is not set
++# CONFIG_FB_VIRTUAL is not set
++# CONFIG_FB_METRONOME is not set
++# CONFIG_FB_MB862XX is not set
++# CONFIG_FB_BROADSHEET is not set
++# CONFIG_FB_GLAMO is not set
++CONFIG_BACKLIGHT_LCD_SUPPORT=y
++CONFIG_LCD_CLASS_DEVICE=y
++# CONFIG_LCD_L4F00242T03 is not set
++# CONFIG_LCD_LMS283GF05 is not set
++# CONFIG_LCD_LTV350QV is not set
++# CONFIG_LCD_TDO24M is not set
++# CONFIG_LCD_VGG2432A4 is not set
++# CONFIG_LCD_PLATFORM is not set
++# CONFIG_LCD_S6E63M0 is not set
++CONFIG_LCD_JBT6K74=y
++CONFIG_BACKLIGHT_CLASS_DEVICE=y
++# CONFIG_BACKLIGHT_GENERIC is not set
++# CONFIG_BACKLIGHT_PWM is not set
++# CONFIG_BACKLIGHT_ADP8860 is not set
++CONFIG_BACKLIGHT_PCF50633=y
++
++#
++# Display device support
++#
++# CONFIG_DISPLAY_SUPPORT is not set
++
++#
++# Console display driver support
++#
++CONFIG_DUMMY_CONSOLE=y
++CONFIG_FRAMEBUFFER_CONSOLE=y
++# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
++# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
++CONFIG_FONTS=y
++# CONFIG_FONT_8x8 is not set
++# CONFIG_FONT_8x16 is not set
++CONFIG_FONT_6x11=y
++# CONFIG_FONT_7x14 is not set
++# CONFIG_FONT_PEARL_8x8 is not set
++# CONFIG_FONT_ACORN_8x8 is not set
++# CONFIG_FONT_MINI_4x6 is not set
++# CONFIG_FONT_SUN8x16 is not set
++# CONFIG_FONT_SUN12x22 is not set
++# CONFIG_FONT_10x18 is not set
++CONFIG_LOGO=y
++# CONFIG_LOGO_LINUX_MONO is not set
++# CONFIG_LOGO_LINUX_VGA16 is not set
++# CONFIG_LOGO_LINUX_CLUT224 is not set
++CONFIG_SOUND=y
++CONFIG_SOUND_OSS_CORE=y
++CONFIG_SOUND_OSS_CORE_PRECLAIM=y
++CONFIG_SND=y
++CONFIG_SND_TIMER=y
++CONFIG_SND_PCM=y
++CONFIG_SND_JACK=y
++CONFIG_SND_SEQUENCER=m
++CONFIG_SND_SEQ_DUMMY=m
++CONFIG_SND_OSSEMUL=y
++CONFIG_SND_MIXER_OSS=m
++CONFIG_SND_PCM_OSS=m
++CONFIG_SND_PCM_OSS_PLUGINS=y
++CONFIG_SND_SEQUENCER_OSS=y
++# CONFIG_SND_DYNAMIC_MINORS is not set
++# CONFIG_SND_SUPPORT_OLD_API is not set
++# CONFIG_SND_VERBOSE_PROCFS is not set
++# CONFIG_SND_VERBOSE_PRINTK is not set
++# CONFIG_SND_DEBUG is not set
++# CONFIG_SND_RAWMIDI_SEQ is not set
++# CONFIG_SND_OPL3_LIB_SEQ is not set
++# CONFIG_SND_OPL4_LIB_SEQ is not set
++# CONFIG_SND_SBAWE_SEQ is not set
++# CONFIG_SND_EMU10K1_SEQ is not set
++# CONFIG_SND_DRIVERS is not set
++# CONFIG_SND_ARM is not set
++# CONFIG_SND_SPI is not set
++# CONFIG_SND_USB is not set
++CONFIG_SND_SOC=y
++CONFIG_SND_S3C24XX_SOC=y
++CONFIG_SND_S3C24XX_SOC_I2S=y
++CONFIG_SND_S3C24XX_SOC_NEO1973_WM8753=y
++# CONFIG_SND_S3C24XX_SOC_LN2440SBC_ALC650 is not set
++# CONFIG_SND_S3C24XX_SOC_S3C24XX_UDA134X is not set
++# CONFIG_SND_S3C24XX_SOC_SIMTEC_TLV320AIC23 is not set
++# CONFIG_SND_S3C24XX_SOC_SIMTEC_HERMES is not set
++CONFIG_SND_SOC_I2C_AND_SPI=y
++# CONFIG_SND_SOC_ALL_CODECS is not set
++CONFIG_SND_SOC_WM8753=y
++CONFIG_SND_SOC_LM4857=y
++# CONFIG_SOUND_PRIME is not set
++CONFIG_HID_SUPPORT=y
++CONFIG_HID=y
++# CONFIG_HIDRAW is not set
++
++#
++# USB Input Devices
++#
++CONFIG_USB_HID=y
++# CONFIG_HID_PID is not set
++# CONFIG_USB_HIDDEV is not set
++
++#
++# Special HID drivers
++#
++# CONFIG_HID_3M_PCT is not set
++CONFIG_HID_A4TECH=y
++# CONFIG_HID_ACRUX_FF is not set
++CONFIG_HID_APPLE=y
++CONFIG_HID_BELKIN=y
++# CONFIG_HID_CANDO is not set
++CONFIG_HID_CHERRY=y
++CONFIG_HID_CHICONY=y
++# CONFIG_HID_PRODIKEYS is not set
++CONFIG_HID_CYPRESS=y
++CONFIG_HID_DRAGONRISE=y
++# CONFIG_DRAGONRISE_FF is not set
++# CONFIG_HID_EGALAX is not set
++# CONFIG_HID_ELECOM is not set
++CONFIG_HID_EZKEY=y
++CONFIG_HID_KYE=y
++# CONFIG_HID_UCLOGIC is not set
++# CONFIG_HID_WALTOP is not set
++CONFIG_HID_GYRATION=y
++CONFIG_HID_TWINHAN=y
++CONFIG_HID_KENSINGTON=y
++CONFIG_HID_LOGITECH=y
++# CONFIG_LOGITECH_FF is not set
++# CONFIG_LOGIRUMBLEPAD2_FF is not set
++# CONFIG_LOGIG940_FF is not set
++# CONFIG_LOGIWII_FF is not set
++# CONFIG_HID_MAGICMOUSE is not set
++CONFIG_HID_MICROSOFT=y
++# CONFIG_HID_MOSART is not set
++CONFIG_HID_MONTEREY=y
++CONFIG_HID_NTRIG=y
++CONFIG_HID_ORTEK=y
++CONFIG_HID_PANTHERLORD=y
++# CONFIG_PANTHERLORD_FF is not set
++CONFIG_HID_PETALYNX=y
++# CONFIG_HID_PICOLCD is not set
++# CONFIG_HID_QUANTA is not set
++# CONFIG_HID_ROCCAT is not set
++# CONFIG_HID_ROCCAT_KONE is not set
++# CONFIG_HID_ROCCAT_PYRA is not set
++CONFIG_HID_SAMSUNG=y
++CONFIG_HID_SONY=y
++# CONFIG_HID_STANTUM is not set
++CONFIG_HID_SUNPLUS=y
++CONFIG_HID_GREENASIA=y
++# CONFIG_GREENASIA_FF is not set
++CONFIG_HID_SMARTJOYPLUS=y
++# CONFIG_SMARTJOYPLUS_FF is not set
++CONFIG_HID_TOPSEED=y
++CONFIG_HID_THRUSTMASTER=y
++# CONFIG_THRUSTMASTER_FF is not set
++# CONFIG_HID_WACOM is not set
++CONFIG_HID_ZEROPLUS=y
++# CONFIG_ZEROPLUS_FF is not set
++# CONFIG_HID_ZYDACRON is not set
++CONFIG_USB_SUPPORT=y
++CONFIG_USB_ARCH_HAS_HCD=y
++CONFIG_USB_ARCH_HAS_OHCI=y
++# CONFIG_USB_ARCH_HAS_EHCI is not set
++CONFIG_USB=y
++# CONFIG_USB_DEBUG is not set
++CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
++
++#
++# Miscellaneous USB options
++#
++# CONFIG_USB_DEVICEFS is not set
++# CONFIG_USB_DEVICE_CLASS is not set
++# CONFIG_USB_DYNAMIC_MINORS is not set
++# CONFIG_USB_MON is not set
++# CONFIG_USB_WUSB is not set
++# CONFIG_USB_WUSB_CBAF is not set
++
++#
++# USB Host Controller Drivers
++#
++# CONFIG_USB_C67X00_HCD is not set
++# CONFIG_USB_OXU210HP_HCD is not set
++# CONFIG_USB_ISP116X_HCD is not set
++# CONFIG_USB_ISP1760_HCD is not set
++# CONFIG_USB_ISP1362_HCD is not set
++CONFIG_USB_OHCI_HCD=y
++# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
++# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
++CONFIG_USB_OHCI_LITTLE_ENDIAN=y
++# CONFIG_USB_SL811_HCD is not set
++# CONFIG_USB_R8A66597_HCD is not set
++# CONFIG_USB_HWA_HCD is not set
++# CONFIG_USB_MUSB_HDRC is not set
++
++#
++# USB Device Class drivers
++#
++# CONFIG_USB_ACM is not set
++# CONFIG_USB_PRINTER is not set
++# CONFIG_USB_WDM is not set
++# CONFIG_USB_TMC is not set
++
++#
++# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
++#
++
++#
++# also be needed; see USB_STORAGE Help for more info
++#
++# CONFIG_USB_LIBUSUAL is not set
++
++#
++# USB Imaging devices
++#
++# CONFIG_USB_MDC800 is not set
++
++#
++# USB port drivers
++#
++# CONFIG_USB_SERIAL is not set
++
++#
++# USB Miscellaneous drivers
++#
++# CONFIG_USB_EMI62 is not set
++# CONFIG_USB_EMI26 is not set
++# CONFIG_USB_ADUTUX is not set
++# CONFIG_USB_SEVSEG is not set
++# CONFIG_USB_RIO500 is not set
++# CONFIG_USB_LEGOTOWER is not set
++# CONFIG_USB_LCD is not set
++# CONFIG_USB_LED is not set
++# CONFIG_USB_CYPRESS_CY7C63 is not set
++# CONFIG_USB_CYTHERM is not set
++# CONFIG_USB_IDMOUSE is not set
++# CONFIG_USB_FTDI_ELAN is not set
++# CONFIG_USB_APPLEDISPLAY is not set
++# CONFIG_USB_LD is not set
++# CONFIG_USB_TRANCEVIBRATOR is not set
++# CONFIG_USB_IOWARRIOR is not set
++# CONFIG_USB_TEST is not set
++# CONFIG_USB_ISIGHTFW is not set
++# CONFIG_USB_YUREX is not set
++CONFIG_USB_GADGET=y
++# CONFIG_USB_GADGET_DEBUG_FILES is not set
++# CONFIG_USB_GADGET_DEBUG_FS is not set
++CONFIG_USB_GADGET_VBUS_DRAW=500
++CONFIG_USB_GADGET_SELECTED=y
++# CONFIG_USB_GADGET_R8A66597 is not set
++CONFIG_USB_GADGET_S3C2410=y
++CONFIG_USB_S3C2410=y
++# CONFIG_USB_S3C2410_DEBUG is not set
++# CONFIG_USB_GADGET_M66592 is not set
++# CONFIG_USB_GADGET_DUMMY_HCD is not set
++# CONFIG_USB_GADGET_DUALSPEED is not set
++# CONFIG_USB_ZERO is not set
++# CONFIG_USB_AUDIO is not set
++CONFIG_USB_ETH=y
++CONFIG_USB_ETH_RNDIS=y
++# CONFIG_USB_ETH_EEM is not set
++# CONFIG_USB_GADGETFS is not set
++# CONFIG_USB_FUNCTIONFS is not set
++# CONFIG_USB_FILE_STORAGE is not set
++# CONFIG_USB_MASS_STORAGE is not set
++# CONFIG_USB_G_SERIAL is not set
++# CONFIG_USB_MIDI_GADGET is not set
++# CONFIG_USB_G_PRINTER is not set
++# CONFIG_USB_CDC_COMPOSITE is not set
++# CONFIG_USB_G_MULTI is not set
++# CONFIG_USB_G_HID is not set
++# CONFIG_USB_G_DBGP is not set
++
++#
++# OTG and related infrastructure
++#
++# CONFIG_USB_GPIO_VBUS is not set
++# CONFIG_USB_ULPI is not set
++# CONFIG_NOP_USB_XCEIV is not set
++CONFIG_MMC=y
++# CONFIG_MMC_DEBUG is not set
++CONFIG_MMC_UNSAFE_RESUME=y
++
++#
++# MMC/SD/SDIO Card Drivers
++#
++CONFIG_MMC_BLOCK=y
++CONFIG_MMC_BLOCK_MINORS=8
++# CONFIG_MMC_BLOCK_BOUNCE is not set
++# CONFIG_SDIO_UART is not set
++# CONFIG_MMC_TEST is not set
++
++#
++# MMC/SD/SDIO Host Controller Drivers
++#
++# CONFIG_MMC_SDHCI is not set
++# CONFIG_MMC_SPI is not set
++CONFIG_MMC_S3C=y
++# CONFIG_MMC_S3C_HW_SDIO_IRQ is not set
++CONFIG_MMC_S3C_PIO=y
++# CONFIG_MMC_S3C_DMA is not set
++# CONFIG_MMC_S3C_PIODMA is not set
++CONFIG_MMC_GLAMO=y
++# CONFIG_MMC_USHC is not set
++# CONFIG_MEMSTICK is not set
++CONFIG_NEW_LEDS=y
++CONFIG_LEDS_CLASS=y
++
++#
++# LED drivers
++#
++# CONFIG_LEDS_S3C24XX is not set
++# CONFIG_LEDS_PCA9532 is not set
++CONFIG_LEDS_GPIO=y
++CONFIG_LEDS_GPIO_PLATFORM=y
++# CONFIG_LEDS_LP3944 is not set
++# CONFIG_LEDS_LP5521 is not set
++# CONFIG_LEDS_LP5523 is not set
++# CONFIG_LEDS_PCA955X is not set
++# CONFIG_LEDS_DAC124S085 is not set
++CONFIG_LEDS_PWM=y
++# CONFIG_LEDS_REGULATOR is not set
++# CONFIG_LEDS_BD2802 is not set
++# CONFIG_LEDS_LT3593 is not set
++CONFIG_LEDS_TRIGGERS=y
++
++#
++# LED Triggers
++#
++CONFIG_LEDS_TRIGGER_TIMER=y
++CONFIG_LEDS_TRIGGER_HEARTBEAT=y
++# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
++# CONFIG_LEDS_TRIGGER_GPIO is not set
++# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
++
++#
++# iptables trigger is under Netfilter config (LED target)
++#
++# CONFIG_ACCESSIBILITY is not set
++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
++#
++CONFIG_RTC_INTF_SYSFS=y
++CONFIG_RTC_INTF_PROC=y
++CONFIG_RTC_INTF_DEV=y
++# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
++# CONFIG_RTC_DRV_TEST is not set
++
++#
++# I2C RTC drivers
++#
++# CONFIG_RTC_DRV_DS1307 is not set
++# CONFIG_RTC_DRV_DS1374 is not set
++# CONFIG_RTC_DRV_DS1672 is not set
++# CONFIG_RTC_DRV_DS3232 is not set
++# CONFIG_RTC_DRV_MAX6900 is not set
++# CONFIG_RTC_DRV_RS5C372 is not set
++# CONFIG_RTC_DRV_ISL1208 is not set
++# CONFIG_RTC_DRV_ISL12022 is not set
++# CONFIG_RTC_DRV_X1205 is not set
++# CONFIG_RTC_DRV_PCF8563 is not set
++# CONFIG_RTC_DRV_PCF8583 is not set
++# CONFIG_RTC_DRV_M41T80 is not set
++# CONFIG_RTC_DRV_BQ32K is not set
++# CONFIG_RTC_DRV_S35390A is not set
++# CONFIG_RTC_DRV_FM3130 is not set
++# CONFIG_RTC_DRV_RX8581 is not set
++# CONFIG_RTC_DRV_RX8025 is not set
++
++#
++# SPI RTC drivers
++#
++# CONFIG_RTC_DRV_M41T94 is not set
++# CONFIG_RTC_DRV_DS1305 is not set
++# CONFIG_RTC_DRV_DS1390 is not set
++# CONFIG_RTC_DRV_MAX6902 is not set
++# CONFIG_RTC_DRV_R9701 is not set
++# CONFIG_RTC_DRV_RS5C348 is not set
++# CONFIG_RTC_DRV_DS3234 is not set
++# CONFIG_RTC_DRV_PCF2123 is not set
++
++#
++# Platform RTC drivers
++#
++# CONFIG_RTC_DRV_CMOS is not set
++# CONFIG_RTC_DRV_DS1286 is not set
++# CONFIG_RTC_DRV_DS1511 is not set
++# CONFIG_RTC_DRV_DS1553 is not set
++# CONFIG_RTC_DRV_DS1742 is not set
++# CONFIG_RTC_DRV_STK17TA8 is not set
++# CONFIG_RTC_DRV_M48T86 is not set
++# CONFIG_RTC_DRV_M48T35 is not set
++# CONFIG_RTC_DRV_M48T59 is not set
++# CONFIG_RTC_DRV_MSM6242 is not set
++# CONFIG_RTC_DRV_BQ4802 is not set
++# CONFIG_RTC_DRV_RP5C01 is not set
++# CONFIG_RTC_DRV_V3020 is not set
++CONFIG_RTC_DRV_PCF50633=y
++
++#
++# on-CPU RTC drivers
++#
++# CONFIG_RTC_DRV_S3C is not set
++# CONFIG_DMADEVICES is not set
++# CONFIG_AUXDISPLAY is not set
++# CONFIG_UIO is not set
++CONFIG_STAGING=y
++# CONFIG_STAGING_EXCLUDE_BUILD is not set
++# CONFIG_USB_IP_COMMON is not set
++# CONFIG_ECHO is not set
++# CONFIG_BRCM80211 is not set
++# CONFIG_RT2870 is not set
++# CONFIG_COMEDI is not set
++# CONFIG_ASUS_OLED is not set
++# CONFIG_R8712U is not set
++# CONFIG_TRANZPORT is not set
++# CONFIG_POHMELFS is not set
++# CONFIG_AUTOFS_FS is not set
++# CONFIG_LINE6_USB is not set
++# CONFIG_VT6656 is not set
++# CONFIG_FB_UDL is not set
++# CONFIG_IIO is not set
++# CONFIG_ZRAM is not set
++# CONFIG_BATMAN_ADV is not set
++# CONFIG_FB_SM7XX is not set
++
++#
++# Texas Instruments shared transport line discipline
++#
++# CONFIG_ADIS16255 is not set
++# CONFIG_SMB_FS is not set
++CONFIG_MACH_NO_WESTBRIDGE=y
++# CONFIG_ATH6K_LEGACY is not set
++# CONFIG_BCM_WIMAX is not set
++# CONFIG_FT1000 is not set
++
++#
++# Speakup console speech
++#
++# CONFIG_SPEAKUP is not set
++CONFIG_AR6000_WLAN=y
++# CONFIG_AR6000_WLAN_DEBUG is not set
++# CONFIG_AR6000_WLAN_RESET is not set
++
++#
++# File systems
++#
++CONFIG_EXT2_FS=y
++# CONFIG_EXT2_FS_XATTR is not set
++# CONFIG_EXT2_FS_XIP is not set
++CONFIG_EXT3_FS=y
++# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
++# CONFIG_EXT3_FS_XATTR is not set
++# CONFIG_EXT4_FS is not set
++CONFIG_JBD=y
++# CONFIG_JBD_DEBUG is not set
++# CONFIG_REISERFS_FS is not set
++# CONFIG_JFS_FS is not set
++# CONFIG_FS_POSIX_ACL is not set
++# CONFIG_XFS_FS is not set
++# CONFIG_GFS2_FS is not set
++# CONFIG_OCFS2_FS is not set
++# CONFIG_BTRFS_FS is not set
++# CONFIG_NILFS2_FS is not set
++CONFIG_FILE_LOCKING=y
++CONFIG_FSNOTIFY=y
++# CONFIG_DNOTIFY is not set
++CONFIG_INOTIFY_USER=y
++# CONFIG_FANOTIFY is not set
++# CONFIG_QUOTA is not set
++# CONFIG_QUOTACTL is not set
++# CONFIG_AUTOFS4_FS is not set
++# CONFIG_FUSE_FS is not set
++
++#
++# Caches
++#
++# CONFIG_FSCACHE is not set
++
++#
++# CD-ROM/DVD Filesystems
++#
++# CONFIG_ISO9660_FS is not set
++# CONFIG_UDF_FS is not set
++
++#
++# DOS/FAT/NT Filesystems
++#
++CONFIG_FAT_FS=y
++# CONFIG_MSDOS_FS is not set
++CONFIG_VFAT_FS=y
++CONFIG_FAT_DEFAULT_CODEPAGE=437
++CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
++# CONFIG_NTFS_FS is not set
++
++#
++# Pseudo filesystems
++#
++CONFIG_PROC_FS=y
++CONFIG_PROC_SYSCTL=y
++CONFIG_PROC_PAGE_MONITOR=y
++CONFIG_SYSFS=y
++CONFIG_TMPFS=y
++# CONFIG_TMPFS_POSIX_ACL is not set
++# CONFIG_HUGETLB_PAGE is not set
++# CONFIG_CONFIGFS_FS is not set
++CONFIG_MISC_FILESYSTEMS=y
++# CONFIG_ADFS_FS is not set
++# CONFIG_AFFS_FS is not set
++# CONFIG_HFS_FS is not set
++# CONFIG_HFSPLUS_FS is not set
++# CONFIG_BEFS_FS is not set
++# CONFIG_BFS_FS is not set
++# CONFIG_EFS_FS is not set
++CONFIG_JFFS2_FS=y
++CONFIG_JFFS2_FS_DEBUG=0
++CONFIG_JFFS2_FS_WRITEBUFFER=y
++# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
++CONFIG_JFFS2_SUMMARY=y
++# CONFIG_JFFS2_FS_XATTR is not set
++# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
++CONFIG_JFFS2_ZLIB=y
++# CONFIG_JFFS2_LZO is not set
++CONFIG_JFFS2_RTIME=y
++# CONFIG_JFFS2_RUBIN is not set
++# CONFIG_LOGFS is not set
++# CONFIG_CRAMFS is not set
++# CONFIG_SQUASHFS is not set
++# CONFIG_VXFS_FS is not set
++# CONFIG_MINIX_FS is not set
++# CONFIG_OMFS_FS is not set
++# CONFIG_HPFS_FS is not set
++# CONFIG_QNX4FS_FS is not set
++# CONFIG_ROMFS_FS is not set
++# CONFIG_SYSV_FS is not set
++# CONFIG_UFS_FS is not set
++# CONFIG_NETWORK_FILESYSTEMS is not set
++
++#
++# Partition Types
++#
++CONFIG_PARTITION_ADVANCED=y
++# CONFIG_ACORN_PARTITION is not set
++CONFIG_OSF_PARTITION=y
++CONFIG_AMIGA_PARTITION=y
++CONFIG_ATARI_PARTITION=y
++CONFIG_MAC_PARTITION=y
++CONFIG_MSDOS_PARTITION=y
++CONFIG_BSD_DISKLABEL=y
++CONFIG_MINIX_SUBPARTITION=y
++CONFIG_SOLARIS_X86_PARTITION=y
++CONFIG_UNIXWARE_DISKLABEL=y
++CONFIG_LDM_PARTITION=y
++CONFIG_LDM_DEBUG=y
++CONFIG_SGI_PARTITION=y
++CONFIG_ULTRIX_PARTITION=y
++CONFIG_SUN_PARTITION=y
++CONFIG_KARMA_PARTITION=y
++CONFIG_EFI_PARTITION=y
++CONFIG_SYSV68_PARTITION=y
++CONFIG_NLS=y
++CONFIG_NLS_DEFAULT="iso8859-1"
++# CONFIG_NLS_CODEPAGE_437 is not set
++# CONFIG_NLS_CODEPAGE_737 is not set
++# CONFIG_NLS_CODEPAGE_775 is not set
++# CONFIG_NLS_CODEPAGE_850 is not set
++# CONFIG_NLS_CODEPAGE_852 is not set
++# CONFIG_NLS_CODEPAGE_855 is not set
++# CONFIG_NLS_CODEPAGE_857 is not set
++# CONFIG_NLS_CODEPAGE_860 is not set
++# CONFIG_NLS_CODEPAGE_861 is not set
++# CONFIG_NLS_CODEPAGE_862 is not set
++# CONFIG_NLS_CODEPAGE_863 is not set
++# CONFIG_NLS_CODEPAGE_864 is not set
++# CONFIG_NLS_CODEPAGE_865 is not set
++# CONFIG_NLS_CODEPAGE_866 is not set
++# CONFIG_NLS_CODEPAGE_869 is not set
++# CONFIG_NLS_CODEPAGE_936 is not set
++# CONFIG_NLS_CODEPAGE_950 is not set
++# CONFIG_NLS_CODEPAGE_932 is not set
++# CONFIG_NLS_CODEPAGE_949 is not set
++# CONFIG_NLS_CODEPAGE_874 is not set
++# CONFIG_NLS_ISO8859_8 is not set
++# CONFIG_NLS_CODEPAGE_1250 is not set
++# CONFIG_NLS_CODEPAGE_1251 is not set
++# CONFIG_NLS_ASCII is not set
++# CONFIG_NLS_ISO8859_1 is not set
++# CONFIG_NLS_ISO8859_2 is not set
++# CONFIG_NLS_ISO8859_3 is not set
++# CONFIG_NLS_ISO8859_4 is not set
++# CONFIG_NLS_ISO8859_5 is not set
++# CONFIG_NLS_ISO8859_6 is not set
++# CONFIG_NLS_ISO8859_7 is not set
++# CONFIG_NLS_ISO8859_9 is not set
++# CONFIG_NLS_ISO8859_13 is not set
++# CONFIG_NLS_ISO8859_14 is not set
++# CONFIG_NLS_ISO8859_15 is not set
++# CONFIG_NLS_KOI8_R is not set
++# CONFIG_NLS_KOI8_U is not set
++# CONFIG_NLS_UTF8 is not set
++# CONFIG_DLM is not set
++
++#
++# Kernel hacking
++#
++CONFIG_PRINTK_TIME=y
++# CONFIG_ENABLE_WARN_DEPRECATED is not set
++# CONFIG_ENABLE_MUST_CHECK is not set
++CONFIG_FRAME_WARN=1024
++# CONFIG_MAGIC_SYSRQ is not set
++CONFIG_STRIP_ASM_SYMS=y
++# CONFIG_UNUSED_SYMBOLS is not set
++CONFIG_DEBUG_FS=y
++# CONFIG_HEADERS_CHECK is not set
++# CONFIG_DEBUG_KERNEL is not set
++# CONFIG_HARDLOCKUP_DETECTOR is not set
++CONFIG_BKL=y
++# CONFIG_SPARSE_RCU_POINTER is not set
++CONFIG_DEBUG_BUGVERBOSE=y
++CONFIG_DEBUG_MEMORY_INIT=y
++CONFIG_FRAME_POINTER=y
++# CONFIG_LKDTM is not set
++# CONFIG_SYSCTL_SYSCALL_CHECK is not set
++CONFIG_HAVE_FUNCTION_TRACER=y
++CONFIG_HAVE_DYNAMIC_FTRACE=y
++CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
++CONFIG_TRACING_SUPPORT=y
++# CONFIG_FTRACE is not set
++# CONFIG_DYNAMIC_DEBUG is not set
++# CONFIG_ATOMIC64_SELFTEST is not set
++# CONFIG_SAMPLES is not set
++CONFIG_HAVE_ARCH_KGDB=y
++# CONFIG_STRICT_DEVMEM is not set
++# CONFIG_ARM_UNWIND is not set
++# CONFIG_DEBUG_USER is not set
++# CONFIG_OC_ETM is not set
++CONFIG_DEBUG_S3C_UART=2
++
++#
++# Security options
++#
++# CONFIG_KEYS is not set
++# CONFIG_SECURITY_DMESG_RESTRICT is not set
++# CONFIG_SECURITY is not set
++# CONFIG_SECURITYFS is not set
++CONFIG_DEFAULT_SECURITY_DAC=y
++CONFIG_DEFAULT_SECURITY=""
++CONFIG_CRYPTO=y
++
++#
++# Crypto core or helper
++#
++CONFIG_CRYPTO_ALGAPI=y
++CONFIG_CRYPTO_ALGAPI2=y
++CONFIG_CRYPTO_HASH=y
++CONFIG_CRYPTO_HASH2=y
++CONFIG_CRYPTO_PCOMP=y
++CONFIG_CRYPTO_PCOMP2=y
++# CONFIG_CRYPTO_MANAGER is not set
++# CONFIG_CRYPTO_MANAGER2 is not set
++# CONFIG_CRYPTO_GF128MUL is not set
++# CONFIG_CRYPTO_NULL is not set
++# CONFIG_CRYPTO_CRYPTD is not set
++# CONFIG_CRYPTO_AUTHENC is not set
++# CONFIG_CRYPTO_TEST is not set
++
++#
++# Authenticated Encryption with Associated Data
++#
++# CONFIG_CRYPTO_CCM is not set
++# CONFIG_CRYPTO_GCM is not set
++# CONFIG_CRYPTO_SEQIV is not set
++
++#
++# Block modes
++#
++# CONFIG_CRYPTO_CBC is not set
++# CONFIG_CRYPTO_CTR is not set
++# CONFIG_CRYPTO_CTS is not set
++# CONFIG_CRYPTO_ECB is not set
++# CONFIG_CRYPTO_LRW is not set
++# CONFIG_CRYPTO_PCBC is not set
++# CONFIG_CRYPTO_XTS is not set
++
++#
++# Hash modes
++#
++# CONFIG_CRYPTO_HMAC is not set
++# CONFIG_CRYPTO_XCBC is not set
++# CONFIG_CRYPTO_VMAC is not set
++
++#
++# Digest
++#
++# CONFIG_CRYPTO_CRC32C is not set
++# CONFIG_CRYPTO_GHASH is not set
++# CONFIG_CRYPTO_MD4 is not set
++CONFIG_CRYPTO_MD5=y
++# CONFIG_CRYPTO_MICHAEL_MIC is not set
++# CONFIG_CRYPTO_RMD128 is not set
++# CONFIG_CRYPTO_RMD160 is not set
++# CONFIG_CRYPTO_RMD256 is not set
++# CONFIG_CRYPTO_RMD320 is not set
++# CONFIG_CRYPTO_SHA1 is not set
++# CONFIG_CRYPTO_SHA256 is not set
++# CONFIG_CRYPTO_SHA512 is not set
++# CONFIG_CRYPTO_TGR192 is not set
++# CONFIG_CRYPTO_WP512 is not set
++
++#
++# Ciphers
++#
++# CONFIG_CRYPTO_AES is not set
++# CONFIG_CRYPTO_ANUBIS is not set
++# CONFIG_CRYPTO_ARC4 is not set
++# CONFIG_CRYPTO_BLOWFISH is not set
++# CONFIG_CRYPTO_CAMELLIA is not set
++# CONFIG_CRYPTO_CAST5 is not set
++# CONFIG_CRYPTO_CAST6 is not set
++# CONFIG_CRYPTO_DES is not set
++# CONFIG_CRYPTO_FCRYPT is not set
++# CONFIG_CRYPTO_KHAZAD is not set
++# CONFIG_CRYPTO_SALSA20 is not set
++# CONFIG_CRYPTO_SEED is not set
++# CONFIG_CRYPTO_SERPENT is not set
++# CONFIG_CRYPTO_TEA is not set
++# CONFIG_CRYPTO_TWOFISH is not set
++
++#
++# Compression
++#
++# CONFIG_CRYPTO_DEFLATE is not set
++CONFIG_CRYPTO_ZLIB=y
++# CONFIG_CRYPTO_LZO is not set
++
++#
++# Random Number Generation
++#
++# CONFIG_CRYPTO_ANSI_CPRNG is not set
++# CONFIG_CRYPTO_HW is not set
++# CONFIG_BINARY_PRINTF is not set
++
++#
++# Library routines
++#
++CONFIG_BITREVERSE=y
++CONFIG_GENERIC_FIND_LAST_BIT=y
++CONFIG_CRC_CCITT=y
++CONFIG_CRC16=y
++CONFIG_CRC_T10DIF=y
++CONFIG_CRC_ITU_T=y
++CONFIG_CRC32=y
++CONFIG_CRC7=y
++# CONFIG_LIBCRC32C is not set
++CONFIG_ZLIB_INFLATE=y
++CONFIG_ZLIB_DEFLATE=y
++CONFIG_LZO_DECOMPRESS=y
++CONFIG_DECOMPRESS_GZIP=y
++CONFIG_DECOMPRESS_BZIP2=y
++CONFIG_DECOMPRESS_LZMA=y
++CONFIG_DECOMPRESS_LZO=y
++CONFIG_HAS_IOMEM=y
++CONFIG_HAS_DMA=y
++CONFIG_NLATTR=y
++CONFIG_GENERIC_ATOMIC64=y
+diff --git a/arch/arm/include/asm/fiq.h b/arch/arm/include/asm/fiq.h
+index 2242ce2..7ade2b8 100644
+--- a/arch/arm/include/asm/fiq.h
++++ b/arch/arm/include/asm/fiq.h
+@@ -29,8 +29,9 @@ struct fiq_handler {
+ extern int claim_fiq(struct fiq_handler *f);
+ extern void release_fiq(struct fiq_handler *f);
+ extern void set_fiq_handler(void *start, unsigned int length);
+-extern void set_fiq_regs(struct pt_regs *regs);
+-extern void get_fiq_regs(struct pt_regs *regs);
++extern void set_fiq_c_handler(void (*handler)(void));
++extern void __attribute__((naked)) set_fiq_regs(struct pt_regs *regs);
++extern void __attribute__((naked)) get_fiq_regs(struct pt_regs *regs);
+ extern void enable_fiq(int fiq);
+ extern void disable_fiq(int fiq);
+
+diff --git a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c
+index 6ff7919..c07691e 100644
+--- a/arch/arm/kernel/fiq.c
++++ b/arch/arm/kernel/fiq.c
+@@ -8,6 +8,8 @@
+ *
+ * FIQ support re-written by Russell King to be more generic
+ *
++ * FIQ handler in C supoprt written by Andy Green <andy@openmoko.com>
++ *
+ * We now properly support a method by which the FIQ handlers can
+ * be stacked onto the vector. We still do not support sharing
+ * the FIQ vector itself.
+@@ -124,6 +126,83 @@ void __naked get_fiq_regs(struct pt_regs *regs)
+ : "r" (&regs->ARM_r8), "I" (PSR_I_BIT | PSR_F_BIT | FIQ_MODE));
+ }
+
++/* -------- FIQ handler in C ---------
++ *
++ * Major Caveats for using this
++ * ---------------------------
++ * *
++ * * 1) it CANNOT touch any vmalloc()'d memory, only memory
++ * that was kmalloc()'d. Static allocations in the monolithic kernel
++ * are kmalloc()'d so they are okay. You can touch memory-mapped IO, but
++ * the pointer for it has to have been stored in kmalloc'd memory. The
++ * reason for this is simple: every now and then Linux turns off interrupts
++ * and reorders the paging tables. If a FIQ happens during this time, the
++ * virtual memory space can be partly or entirely disordered or missing.
++ *
++ * 2) Because vmalloc() is used when a module is inserted, THIS FIQ
++ * ISR HAS TO BE IN THE MONOLITHIC KERNEL, not a module. But the way
++ * it is set up, you can all to enable and disable it from your module
++ * and intercommunicate with it through struct fiq_ipc
++ * fiq_ipc which you can define in
++ * asm/archfiq_ipc_type.h. The reason is the same as above, a
++ * FIQ could happen while even the ISR is not present in virtual memory
++ * space due to pagetables being changed at the time.
++ *
++ * 3) You can't call any Linux API code except simple macros
++ * - understand that FIQ can come in at any time, no matter what
++ * state of undress the kernel may privately be in, thinking it
++ * locked the door by turning off interrupts... FIQ is an
++ * unstoppable monster force (which is its value)
++ * - they are not vmalloc()'d memory safe
++ * - they might do crazy stuff like sleep: FIQ pisses fire and
++ * is not interested in 'sleep' that the weak seem to need
++ * - calling APIs from FIQ can re-enter un-renterable things
++ * - summary: you cannot interoperate with linux APIs directly in the FIQ ISR
++ *
++ * If you follow these rules, it is fantastic, an extremely powerful, solid,
++ * genuine hard realtime feature.
++ */
++
++static void (*current_fiq_c_isr)(void);
++#define FIQ_C_ISR_STACK_SIZE 256
++
++static void __attribute__((naked)) __jump_to_isr(void)
++{
++ asm __volatile__ ("mov pc, r8");
++}
++
++
++static void __attribute__((naked)) __actual_isr(void)
++{
++ asm __volatile__ (
++ "stmdb sp!, {r0-r12, lr};"
++ "mov fp, sp;"
++ );
++
++ current_fiq_c_isr();
++
++ asm __volatile__ (
++ "ldmia sp!, {r0-r12, lr};"
++ "subs pc, lr, #4;"
++ );
++}
++
++void set_fiq_c_handler(void (*isr)(void))
++{
++ struct pt_regs regs;
++
++ memset(&regs, 0, sizeof(regs));
++ regs.ARM_r8 = (unsigned long) __actual_isr;
++ regs.ARM_sp = 0xffff001c + FIQ_C_ISR_STACK_SIZE;
++
++ set_fiq_handler(__jump_to_isr, 4);
++
++ current_fiq_c_isr = isr;
++
++ set_fiq_regs(&regs);
++}
++/* -------- FIQ handler in C ---------*/
++
+ int claim_fiq(struct fiq_handler *f)
+ {
+ int ret = 0;
+diff --git a/arch/arm/mach-s3c2410/include/mach/gpio.h b/arch/arm/mach-s3c2410/include/mach/gpio.h
+index f7f6b07..f9ddfa9 100644
+--- a/arch/arm/mach-s3c2410/include/mach/gpio.h
++++ b/arch/arm/mach-s3c2410/include/mach/gpio.h
+@@ -16,26 +16,20 @@
+ #define gpio_cansleep __gpio_cansleep
+ #define gpio_to_irq __gpio_to_irq
+
+-/* some boards require extra gpio capacity to support external
+- * devices that need GPIO.
+- */
++#include <mach/gpio-fns.h>
++#include <mach/gpio-nrs.h>
+
+-#ifdef CONFIG_CPU_S3C244X
+-#define ARCH_NR_GPIOS (32 * 9 + CONFIG_S3C24XX_GPIO_EXTRA)
+-#elif defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2416)
+-#define ARCH_NR_GPIOS (32 * 12 + CONFIG_S3C24XX_GPIO_EXTRA)
++#if defined(CPU_S3C2416) || defined(CPU_S3C2443)
++#define S3C_GPIO_END S3C2410_GPM(S3C2410_GPIO_M_NR)
++#elif defined(CONFIG_CPU_S3C244X)
++#define S3C_GPIO_END S3C2410_GPJ(S3C2410_GPIO_J_NR)
+ #else
+-#define ARCH_NR_GPIOS (256 + CONFIG_S3C24XX_GPIO_EXTRA)
++#define S3C_GPIO_END S3C2410_GPH(S3C2410_GPIO_H_NR)
+ #endif
+
+-#include <asm-generic/gpio.h>
+-#include <mach/gpio-nrs.h>
+-#include <mach/gpio-fns.h>
++/* some boards require extra gpio capacity to support external
++ * devices that need GPIO.
++ */
++#define ARCH_NR_GPIOS (S3C_GPIO_END + CONFIG_S3C24XX_GPIO_EXTRA)
+
+-#ifdef CONFIG_CPU_S3C244X
+-#define S3C_GPIO_END (S3C2410_GPJ(0) + 32)
+-#elif defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2416)
+-#define S3C_GPIO_END (S3C2410_GPM(0) + 32)
+-#else
+-#define S3C_GPIO_END (S3C2410_GPH(0) + 32)
+-#endif
++#include <asm-generic/gpio.h>
+diff --git a/arch/arm/mach-s3c2410/include/mach/irqs.h b/arch/arm/mach-s3c2410/include/mach/irqs.h
+index 11bb0f0..d22ffca 100644
+--- a/arch/arm/mach-s3c2410/include/mach/irqs.h
++++ b/arch/arm/mach-s3c2410/include/mach/irqs.h
+@@ -176,9 +176,9 @@
+ #define IRQ_S3C2443_AC97 S3C2410_IRQSUB(28)
+
+ #if defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2416)
+-#define NR_IRQS (IRQ_S3C2443_AC97+1)
++#define S3C2410_NR_INTERNAL_IRQS (IRQ_S3C2443_AC97+1)
+ #else
+-#define NR_IRQS (IRQ_S3C2440_AC97+1)
++#define S3C2410_NR_INTERNAL_IRQS (IRQ_S3C2440_AC97+1)
+ #endif
+
+ /* compatibility define. */
+@@ -199,4 +199,22 @@
+ /* Our FIQs are routable from IRQ_EINT0 to IRQ_ADCPARENT */
+ #define FIQ_START IRQ_EINT0
+
++/* Board specific IRQs
++ * If your board needs a extra set of IRQ numbers add it to the list here.
++ * Make sure that the numbers are kept in descending order, so if support for
++ * multiple boards is compiled in the maximum will be used and there are enough
++ * IRQ numbers available for each board.
++ */
++
++#if defined(CONFIG_MACH_NEO1973_GTA02)
++#define IRQ_BOARD_NR (9 + 40)
++#else
++#define IRQ_BOARD_NR 0
++#endif
++
++#define IRQ_BOARD_START S3C2410_NR_INTERNAL_IRQS
++#define IRQ_BOARD_END (IRQ_BOARD_START + IRQ_BOARD_NR)
++
++#define NR_IRQS IRQ_BOARD_END
++
+ #endif /* __ASM_ARCH_IRQ_H */
+diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig
+index a0cb258..17459cb 100644
+--- a/arch/arm/mach-s3c2440/Kconfig
++++ b/arch/arm/mach-s3c2440/Kconfig
+@@ -94,11 +94,15 @@ config MACH_NEO1973_GTA02
+ bool "Openmoko GTA02 / Freerunner phone"
+ select CPU_S3C2442
+ select MFD_PCF50633
+- select PCF50633_GPIO
++ select GPIO_PCF50633
+ select I2C
+ select POWER_SUPPLY
+ select MACH_NEO1973
+ select S3C2410_PWM
++ select S3C_DEV_USB_HOST
++ select S3C_DEV_NAND
++ select FIQ
++ select S3C24XX_GPIO_EXTRA64
+ help
+ Say Y here if you are using the Openmoko GTA02 / Freerunner GSM Phone
+
+diff --git a/arch/arm/mach-s3c2440/Makefile b/arch/arm/mach-s3c2440/Makefile
+index d5440fa..035d116 100644
+--- a/arch/arm/mach-s3c2440/Makefile
++++ b/arch/arm/mach-s3c2440/Makefile
+@@ -33,8 +33,14 @@ obj-$(CONFIG_ARCH_S3C2440) += mach-smdk2440.o
+ obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o
+ obj-$(CONFIG_MACH_AT2440EVB) += mach-at2440evb.o
+ obj-$(CONFIG_MACH_MINI2440) += mach-mini2440.o
+-obj-$(CONFIG_MACH_NEO1973_GTA02) += mach-gta02.o
+ obj-$(CONFIG_MACH_RX1950) += mach-rx1950.o
++obj-$(CONFIG_MACH_NEO1973_GTA02) += mach-gta02.o \
++ gta02-pm-bt.o \
++ gta02-pm-gps.o \
++ gta02-pm-gsm.o \
++ gta02-pm-wlan.o \
++ gta02-fiq.o \
++ gta02-hdq.o \
+
+ # extra machine support
+
+diff --git a/arch/arm/mach-s3c2440/gta02-fiq.c b/arch/arm/mach-s3c2440/gta02-fiq.c
+new file mode 100644
+index 0000000..2356868
+--- /dev/null
++++ b/arch/arm/mach-s3c2440/gta02-fiq.c
+@@ -0,0 +1,131 @@
++#include <linux/kernel.h>
++
++#include <asm/fiq.h>
++#include <mach/regs-irq.h>
++#include <plat/regs-timer.h>
++#include <mach/irqs.h>
++#include <linux/io.h>
++#include <linux/pwm.h>
++#include <linux/err.h>
++#include <mach/gta02-hdq.h>
++
++/* -------------------------------------------------------------------------------
++ * GTA02 FIQ related
++ *
++ * Calls into vibrator and hdq and based on the return values
++ * determines if we the FIQ source be kept alive
++ */
++
++#define DIVISOR_FROM_US(x) ((x) << 3)
++
++#define FIQ_DIVISOR_HDQ DIVISOR_FROM_US(HDQ_SAMPLE_PERIOD_US)
++extern int hdq_fiq_handler(void);
++
++/* Global data related to our fiq source */
++static uint32_t gta02_fiq_ack_mask;
++static const int gta02_gta02_fiq_timer_id = 2;
++
++struct pwm_device* gta02_fiq_timer;
++
++void gta02_fiq_handler(void)
++{
++ unsigned long intmask;
++ int keep_running = 0;
++ /* disable further timer interrupts if nobody has any work
++ * or adjust rate according to who still has work
++ *
++ * CAUTION: it means forground code must disable FIQ around
++ * its own non-atomic S3C2410_INTMSK changes... not common
++ * thankfully and taken care of by the fiq-basis patch
++ */
++
++ keep_running = hdq_fiq_handler();
++ if (!keep_running) {
++ /* Disable irq */
++ intmask = __raw_readl(S3C2410_INTMSK);
++ intmask |= (gta02_fiq_ack_mask);
++ __raw_writel(intmask, S3C2410_INTMSK);
++ }
++
++ __raw_writel(gta02_fiq_ack_mask, S3C2410_SRCPND);
++}
++
++void gta02_fiq_kick(void)
++{
++ unsigned long flags;
++ unsigned long intmask;
++ /* we have to take care about FIQ because this modification is
++ * non-atomic, FIQ could come in after the read and before the
++ * writeback and its changes to the register would be lost
++ * (platform INTMSK mod code is taken care of already)
++ */
++ local_save_flags(flags);
++ local_fiq_disable();
++
++ /* allow FIQs to resume */
++ intmask = __raw_readl(S3C2410_INTMSK);
++ intmask &= ~(gta02_fiq_ack_mask);
++ __raw_writel(intmask, S3C2410_INTMSK);
++
++ local_irq_restore(flags);
++
++}
++
++int gta02_fiq_enable(void)
++{
++ int ret = 0;
++
++ local_fiq_disable();
++
++ gta02_fiq_timer = pwm_request(gta02_gta02_fiq_timer_id, "fiq timer");
++
++ if (IS_ERR(gta02_fiq_timer)) {
++ ret = PTR_ERR(gta02_fiq_timer);
++ printk("GTA02 FIQ: Could not request fiq timer: %d\n", ret);
++ return ret;
++ }
++
++ gta02_fiq_ack_mask = 1 << (IRQ_TIMER0 + gta02_gta02_fiq_timer_id
++ - S3C2410_CPUIRQ_OFFSET);
++
++
++ ret = pwm_config(gta02_fiq_timer, HDQ_SAMPLE_PERIOD_US * 1000,
++ HDQ_SAMPLE_PERIOD_US * 1000);
++ if (ret) {
++ printk("GTA02 FIQ: Could not configure fiq timer: %d\n", ret);
++ goto err;
++ }
++
++ set_fiq_c_handler(gta02_fiq_handler);
++
++ __raw_writel(gta02_fiq_ack_mask, S3C2410_INTMOD);
++
++ pwm_enable(gta02_fiq_timer);
++
++ local_fiq_enable();
++
++ return 0;
++
++err:
++ pwm_free(gta02_fiq_timer);
++
++ return ret;
++}
++
++void gta02_fiq_disable(void)
++{
++ local_fiq_disable();
++
++ if (!gta02_fiq_timer)
++ return;
++
++ __raw_writel(0, S3C2410_INTMOD);
++ set_fiq_c_handler(NULL);
++
++ pwm_disable(gta02_fiq_timer);
++
++ pwm_free(gta02_fiq_timer);
++
++ gta02_fiq_timer = NULL;
++}
++/* -------------------- /GTA02 FIQ Handler ------------------------------------- */
+diff --git a/arch/arm/mach-s3c2440/gta02-hdq.c b/arch/arm/mach-s3c2440/gta02-hdq.c
+new file mode 100644
+index 0000000..d40f9b8
+--- /dev/null
++++ b/arch/arm/mach-s3c2440/gta02-hdq.c
+@@ -0,0 +1,412 @@
++/*
++ * HDQ generic GPIO bitbang driver using FIQ
++ *
++ * (C) 2006-2007 by Openmoko, Inc.
++ * Author: Andy Green <andy@openmoko.com>
++ * All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ */
++
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/delay.h>
++#include <linux/platform_device.h>
++#include <mach/gta02-hdq.h>
++
++#define HDQ_READ 0
++
++enum hdq_bitbang_states {
++ HDQB_IDLE = 0,
++ HDQB_TX_BREAK,
++ HDQB_TX_BREAK_RECOVERY,
++ HDQB_ADS_CALC,
++ HDQB_ADS_LOW,
++ HDQB_ADS_HIGH,
++ HDQB_WAIT_RX,
++ HDQB_DATA_RX_LOW,
++ HDQB_DATA_RX_HIGH,
++ HDQB_WAIT_TX,
++};
++
++static struct hdq_priv {
++ u8 hdq_probed; /* nonzero after HDQ driver probed */
++ struct mutex hdq_lock; /* if you want to use hdq, you have to take lock */
++ u8 hdq_ads; /* b7..b6 = register address, b0 = r/w */
++ u8 hdq_tx_data; /* data to tx for write action */
++ u8 hdq_rx_data; /* data received in read action */
++ u8 hdq_request_ctr; /* incremented by "user" to request a transfer */
++ u8 hdq_transaction_ctr; /* incremented after each transfer */
++ u8 hdq_error; /* 0 = no error */
++ u8 hdq_ctr;
++ u8 hdq_ctr2;
++ u8 hdq_bit;
++ u8 hdq_shifter;
++ u8 hdq_tx_data_done;
++ enum hdq_bitbang_states hdq_state;
++ int reported_error;
++
++ struct hdq_platform_data *pdata;
++} hdq_priv;
++
++
++static void hdq_bad(void)
++{
++ if (!hdq_priv.reported_error)
++ printk(KERN_ERR "HDQ error: %d\n", hdq_priv.hdq_error);
++ hdq_priv.reported_error = 1;
++}
++
++static void hdq_good(void)
++{
++ if (hdq_priv.reported_error)
++ printk(KERN_INFO "HDQ responds again\n");
++ hdq_priv.reported_error = 0;
++}
++
++int hdq_fiq_handler(void)
++{
++ if (!hdq_priv.hdq_probed)
++ return 0;
++
++ switch (hdq_priv.hdq_state) {
++ case HDQB_IDLE:
++ if (hdq_priv.hdq_request_ctr == hdq_priv.hdq_transaction_ctr)
++ break;
++ hdq_priv.hdq_ctr = 250 / HDQ_SAMPLE_PERIOD_US;
++ hdq_priv.pdata->gpio_set(0);
++ hdq_priv.pdata->gpio_dir_out();
++ hdq_priv.hdq_tx_data_done = 0;
++ hdq_priv.hdq_state = HDQB_TX_BREAK;
++ break;
++
++ case HDQB_TX_BREAK: /* issue low for > 190us */
++ if (--hdq_priv.hdq_ctr == 0) {
++ hdq_priv.hdq_ctr = 60 / HDQ_SAMPLE_PERIOD_US;
++ hdq_priv.hdq_state = HDQB_TX_BREAK_RECOVERY;
++ hdq_priv.pdata->gpio_set(1);
++ }
++ break;
++
++ case HDQB_TX_BREAK_RECOVERY: /* issue low for > 40us */
++ if (--hdq_priv.hdq_ctr)
++ break;
++ hdq_priv.hdq_shifter = hdq_priv.hdq_ads;
++ hdq_priv.hdq_bit = 8; /* 8 bits of ads / rw */
++ hdq_priv.hdq_tx_data_done = 0; /* doing ads */
++ /* fallthru on last one */
++ case HDQB_ADS_CALC:
++ if (hdq_priv.hdq_shifter & 1)
++ hdq_priv.hdq_ctr = 50 / HDQ_SAMPLE_PERIOD_US;
++ else
++ hdq_priv.hdq_ctr = 120 / HDQ_SAMPLE_PERIOD_US;
++ /* carefully precompute the other phase length */
++ hdq_priv.hdq_ctr2 = (210 - (hdq_priv.hdq_ctr * HDQ_SAMPLE_PERIOD_US)) /
++ HDQ_SAMPLE_PERIOD_US;
++ hdq_priv.hdq_state = HDQB_ADS_LOW;
++ hdq_priv.hdq_shifter >>= 1;
++ hdq_priv.hdq_bit--;
++ hdq_priv.pdata->gpio_set(0);
++ break;
++
++ case HDQB_ADS_LOW:
++ if (--hdq_priv.hdq_ctr)
++ break;
++ hdq_priv.pdata->gpio_set(1);
++ hdq_priv.hdq_state = HDQB_ADS_HIGH;
++ break;
++
++ case HDQB_ADS_HIGH:
++ if (--hdq_priv.hdq_ctr2 > 1) /* account for HDQB_ADS_CALC */
++ break;
++ if (hdq_priv.hdq_bit) { /* more bits to do */
++ hdq_priv.hdq_state = HDQB_ADS_CALC;
++ break;
++ }
++ /* no more bits, wait it out until hdq_priv.hdq_ctr2 exhausted */
++ if (hdq_priv.hdq_ctr2)
++ break;
++ /* ok no more bits and very last state */
++ hdq_priv.hdq_ctr = 60 / HDQ_SAMPLE_PERIOD_US;
++ /* FIXME 0 = read */
++ if (hdq_priv.hdq_ads & 0x80) { /* write the byte out */
++ /* set delay before payload */
++ hdq_priv.hdq_ctr = 300 / HDQ_SAMPLE_PERIOD_US;
++ /* already high, no need to write */
++ hdq_priv.hdq_state = HDQB_WAIT_TX;
++ break;
++ }
++ /* read the next byte */
++ hdq_priv.hdq_bit = 8; /* 8 bits of data */
++ hdq_priv.hdq_ctr = 2500 / HDQ_SAMPLE_PERIOD_US;
++ hdq_priv.hdq_state = HDQB_WAIT_RX;
++ hdq_priv.pdata->gpio_dir_in();
++ break;
++
++ case HDQB_WAIT_TX: /* issue low for > 40us */
++ if (--hdq_priv.hdq_ctr)
++ break;
++ if (!hdq_priv.hdq_tx_data_done) { /* was that the data sent? */
++ hdq_priv.hdq_tx_data_done++;
++ hdq_priv.hdq_shifter = hdq_priv.hdq_tx_data;
++ hdq_priv.hdq_bit = 8; /* 8 bits of data */
++ hdq_priv.hdq_state = HDQB_ADS_CALC; /* start sending */
++ break;
++ }
++ hdq_priv.hdq_error = 0;
++ hdq_priv.hdq_transaction_ctr = hdq_priv.hdq_request_ctr;
++ hdq_priv.hdq_state = HDQB_IDLE; /* all tx is done */
++ /* idle in input mode, it's pulled up by 10K */
++ hdq_priv.pdata->gpio_dir_in();
++ break;
++
++ case HDQB_WAIT_RX: /* wait for battery to talk to us */
++ if (hdq_priv.pdata->gpio_get() == 0) {
++ /* it talks to us! */
++ hdq_priv.hdq_ctr2 = 1;
++ hdq_priv.hdq_bit = 8; /* 8 bits of data */
++ /* timeout */
++ hdq_priv.hdq_ctr = 500 / HDQ_SAMPLE_PERIOD_US;
++ hdq_priv.hdq_state = HDQB_DATA_RX_LOW;
++ break;
++ }
++ if (--hdq_priv.hdq_ctr == 0) { /* timed out, error */
++ hdq_priv.hdq_error = 1;
++ hdq_priv.hdq_transaction_ctr = hdq_priv.hdq_request_ctr;
++ hdq_priv.hdq_state = HDQB_IDLE; /* abort */
++ }
++ break;
++
++ /*
++ * HDQ basically works by measuring the low time of the bit cell
++ * 32-50us --> '1', 80 - 145us --> '0'
++ */
++
++ case HDQB_DATA_RX_LOW:
++ if (hdq_priv.pdata->gpio_get()) {
++ hdq_priv.hdq_rx_data >>= 1;
++ if (hdq_priv.hdq_ctr2 <= (65 / HDQ_SAMPLE_PERIOD_US))
++ hdq_priv.hdq_rx_data |= 0x80;
++
++ if (--hdq_priv.hdq_bit == 0) {
++ hdq_priv.hdq_error = 0;
++ hdq_priv.hdq_transaction_ctr =
++ hdq_priv.hdq_request_ctr;
++
++ hdq_priv.hdq_state = HDQB_IDLE;
++ } else
++ hdq_priv.hdq_state = HDQB_DATA_RX_HIGH;
++ /* timeout */
++ hdq_priv.hdq_ctr = 1000 / HDQ_SAMPLE_PERIOD_US;
++ hdq_priv.hdq_ctr2 = 1;
++ break;
++ }
++ hdq_priv.hdq_ctr2++;
++ if (--hdq_priv.hdq_ctr)
++ break;
++ /* timed out, error */
++ hdq_priv.hdq_error = 2;
++ hdq_priv.hdq_transaction_ctr = hdq_priv.hdq_request_ctr;
++ hdq_priv.hdq_state = HDQB_IDLE; /* abort */
++ break;
++
++ case HDQB_DATA_RX_HIGH:
++ if (!hdq_priv.pdata->gpio_get()) {
++ /* it talks to us! */
++ hdq_priv.hdq_ctr2 = 1;
++ /* timeout */
++ hdq_priv.hdq_ctr = 400 / HDQ_SAMPLE_PERIOD_US;
++ hdq_priv.hdq_state = HDQB_DATA_RX_LOW;
++ break;
++ }
++ if (--hdq_priv.hdq_ctr)
++ break;
++ /* timed out, error */
++ hdq_priv.hdq_error = 3;
++ hdq_priv.hdq_transaction_ctr = hdq_priv.hdq_request_ctr;
++
++ /* we're in input mode already */
++ hdq_priv.hdq_state = HDQB_IDLE; /* abort */
++ break;
++ }
++
++ /* Are we interested in keeping the FIQ source alive ? */
++ if (hdq_priv.hdq_state != HDQB_IDLE)
++ return 1;
++ else
++ return 0;
++}
++
++static int fiq_busy(void)
++{
++ int request = (volatile u8)hdq_priv.hdq_request_ctr;
++ int transact = (volatile u8)hdq_priv.hdq_transaction_ctr;
++
++ return (request != transact);
++}
++
++int hdq_read(struct device *dev, unsigned int address)
++{
++ int count_sleeps = 5;
++ int ret = -ETIME;
++
++ if (!hdq_priv.hdq_probed)
++ return -EINVAL;
++
++ mutex_lock(&hdq_priv.hdq_lock);
++
++ hdq_priv.hdq_error = 0;
++ hdq_priv.hdq_ads = address | HDQ_READ;
++ hdq_priv.hdq_request_ctr++;
++ hdq_priv.pdata->kick_fiq();
++ /*
++ * FIQ takes care of it while we block our calling process
++ * But we're not spinning -- other processes run normally while
++ * we wait for the result
++ */
++ while (count_sleeps--) {
++ msleep(10); /* valid transaction always completes in < 10ms */
++
++ if (fiq_busy())
++ continue;
++
++ if (hdq_priv.hdq_error) {
++ hdq_bad();
++ goto done; /* didn't see a response in good time */
++ }
++ hdq_good();
++
++ ret = hdq_priv.hdq_rx_data;
++ goto done;
++ }
++
++done:
++ mutex_unlock(&hdq_priv.hdq_lock);
++ return ret;
++}
++EXPORT_SYMBOL_GPL(hdq_read);
++
++/* sysfs */
++
++static ssize_t hdq_sysfs_dump(struct device *dev, struct device_attribute *attr,
++ char *buf)
++{
++ int n;
++ int v;
++ u8 u8a[128]; /* whole address space for HDQ */
++ char *end = buf;
++
++ if (!hdq_priv.hdq_probed)
++ return -EINVAL;
++
++ /* the dump does not take care about 16 bit regs, because at this
++ * bus level we don't know about the chip details
++ */
++ for (n = 0; n < sizeof(u8a); n++) {
++ v = hdq_read(NULL, n);
++ if (v < 0)
++ goto bail;
++ u8a[n] = v;
++ }
++
++ for (n = 0; n < sizeof(u8a); n += 16) {
++ hex_dump_to_buffer(u8a + n, sizeof(u8a), 16, 1, end, 4096, 0);
++ end += strlen(end);
++ *end++ = '\n';
++ *end = '\0';
++ }
++ return (end - buf);
++
++bail:
++ return sprintf(buf, "ERROR %d\n", v);
++}
++
++
++static DEVICE_ATTR(dump, 0400, hdq_sysfs_dump, NULL);
++
++#ifdef CONFIG_PM
++static int hdq_suspend(struct platform_device *pdev, pm_message_t state)
++{
++ /* after 18s of this, the battery monitor will also go to sleep */
++ hdq_priv.pdata->gpio_dir_in();
++ hdq_priv.pdata->disable_fiq();
++ return 0;
++}
++
++static int hdq_resume(struct platform_device *pdev)
++{
++ hdq_priv.pdata->gpio_set(1);
++ hdq_priv.pdata->gpio_dir_out();
++ hdq_priv.pdata->enable_fiq();
++ return 0;
++}
++#endif
++
++static int __devinit hdq_probe(struct platform_device *pdev)
++{
++ struct hdq_platform_data *pdata = pdev->dev.platform_data;
++ int ret;
++
++ if (!pdata)
++ return -ENXIO;
++
++ mutex_init(&hdq_priv.hdq_lock);
++
++ /* set our HDQ comms pin from the platform data */
++ hdq_priv.pdata = pdata;
++
++ hdq_priv.pdata->gpio_set(1);
++ hdq_priv.pdata->gpio_dir_out();
++
++ /* Initialize FIQ */
++ if (hdq_priv.pdata->enable_fiq() < 0) {
++ dev_err(&pdev->dev, "Could not enable FIQ source\n");
++ return -EINVAL;
++ }
++
++ ret = device_create_file(&pdev->dev, &dev_attr_dump);
++ if (ret)
++ return ret;
++
++ hdq_priv.hdq_probed = 1; /* we are ready to do stuff now */
++
++ hdq_priv.pdata = pdata;
++
++ return 0;
++}
++
++static int __devexit hdq_remove(struct platform_device *pdev)
++{
++ device_remove_file(&pdev->dev, &dev_attr_dump);
++ return 0;
++}
++
++static struct platform_driver hdq_driver = {
++ .probe = hdq_probe,
++ .remove = hdq_remove,
++#ifdef CONFIG_PM
++ .suspend = hdq_suspend,
++ .resume = hdq_resume,
++#endif
++ .driver = {
++ .name = "hdq",
++ },
++};
++
++static int __init hdq_init(void)
++{
++ return platform_driver_register(&hdq_driver);
++}
++module_init(hdq_init);
++
++static void __exit hdq_exit(void)
++{
++ platform_driver_unregister(&hdq_driver);
++}
++module_exit(hdq_exit);
++
++MODULE_AUTHOR("Andy Green <andy@openmoko.com>");
++MODULE_DESCRIPTION("HDQ driver");
+diff --git a/arch/arm/mach-s3c2440/gta02-pm-bt.c b/arch/arm/mach-s3c2440/gta02-pm-bt.c
+new file mode 100644
+index 0000000..d2de59d
+--- /dev/null
++++ b/arch/arm/mach-s3c2440/gta02-pm-bt.c
+@@ -0,0 +1,261 @@
++/*
++ * Bluetooth PM code for the Openmoko Freerunner GSM Phone
++ *
++ * (C) 2007 by Openmoko Inc.
++ * Author: Harald Welte <laforge@openmoko.org>
++ * All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation
++ *
++ */
++
++#include <linux/init.h>
++#include <linux/module.h>
++#include <linux/kernel.h>
++#include <linux/platform_device.h>
++#include <linux/rfkill.h>
++#include <linux/slab.h>
++#include <linux/gpio.h>
++
++#include <linux/err.h>
++
++#include <mach/gpio-fns.h>
++
++#include <mach/hardware.h>
++#include <asm/mach-types.h>
++
++#include <mach/gta02.h>
++
++#include <linux/regulator/consumer.h>
++
++#define DRVMSG "Openmoko Freerunner Bluetooth Power Management"
++
++struct gta02_pm_bt_data {
++ struct regulator *regulator;
++ struct rfkill *rfkill;
++ int pre_resume_state;
++};
++
++static ssize_t bt_read(struct device *dev, struct device_attribute *attr,
++ char *buf)
++{
++ int ret = 0;
++ if (!strcmp(attr->attr.name, "power_on")) {
++ if (gpio_get_value(GTA02_GPIO_BT_EN))
++ ret = 1;
++ } else if (!strcmp(attr->attr.name, "reset")) {
++ if (gpio_get_value(GTA02_GPIO_BT_EN) == 0)
++ ret = 1;
++ }
++
++ if (!ret) {
++ return strlcpy(buf, "0\n", 3);
++ } else {
++ return strlcpy(buf, "1\n", 3);
++ }
++}
++
++static void __gta02_pm_bt_toggle_radio(struct device *dev, unsigned int on)
++{
++ struct gta02_pm_bt_data *bt_data = dev_get_drvdata(dev);
++
++ dev_info(dev, "__gta02_pm_bt_toggle_radio %d\n", on);
++
++ bt_data = dev_get_drvdata(dev);
++
++ gpio_set_value(GTA02_GPIO_BT_EN, !on);
++
++ if (on) {
++ if (!regulator_is_enabled(bt_data->regulator))
++ regulator_enable(bt_data->regulator);
++ } else {
++ if (regulator_is_enabled(bt_data->regulator))
++ regulator_disable(bt_data->regulator);
++ }
++
++ gpio_set_value(GTA02_GPIO_BT_EN, on);
++}
++
++
++static int bt_rfkill_set_block(void *data, bool blocked)
++{
++ struct device *dev = data;
++
++ __gta02_pm_bt_toggle_radio(dev, !blocked);
++
++ return 0;
++}
++
++static const struct rfkill_ops gta02_bt_rfkill_ops = {
++ .set_block = bt_rfkill_set_block,
++};
++
++
++static ssize_t bt_write(struct device *dev, struct device_attribute *attr,
++ const char *buf, size_t count)
++{
++ unsigned long on = simple_strtoul(buf, NULL, 10);
++ struct gta02_pm_bt_data *bt_data = dev_get_drvdata(dev);
++
++ if (!strcmp(attr->attr.name, "power_on")) {
++ rfkill_set_sw_state(bt_data->rfkill, on ? 1 : 0);
++
++ __gta02_pm_bt_toggle_radio(dev, on);
++ } else if (!strcmp(attr->attr.name, "reset")) {
++ /* reset is low-active, so we need to invert */
++ gpio_set_value(GTA02_GPIO_BT_EN, on ? 0 : 1);
++ }
++
++ return count;
++}
++
++static DEVICE_ATTR(power_on, 0644, bt_read, bt_write);
++static DEVICE_ATTR(reset, 0644, bt_read, bt_write);
++
++#ifdef CONFIG_PM
++static int gta02_bt_suspend(struct platform_device *pdev, pm_message_t state)
++{
++ struct gta02_pm_bt_data *bt_data = dev_get_drvdata(&pdev->dev);
++
++ dev_dbg(&pdev->dev, DRVMSG ": suspending\n");
++
++ bt_data->pre_resume_state = gpio_get_value(GTA02_GPIO_BT_EN);
++ __gta02_pm_bt_toggle_radio(&pdev->dev, 0);
++
++ return 0;
++}
++
++static int gta02_bt_resume(struct platform_device *pdev)
++{
++ struct gta02_pm_bt_data *bt_data = dev_get_drvdata(&pdev->dev);
++ dev_dbg(&pdev->dev, DRVMSG ": resuming\n");
++
++ __gta02_pm_bt_toggle_radio(&pdev->dev, bt_data->pre_resume_state);
++ return 0;
++}
++#else
++#define gta02_bt_suspend NULL
++#define gta02_bt_resume NULL
++#endif
++
++static struct attribute *gta02_bt_sysfs_entries[] = {
++ &dev_attr_power_on.attr,
++ &dev_attr_reset.attr,
++ NULL
++};
++
++static struct attribute_group gta02_bt_attr_group = {
++ .name = NULL,
++ .attrs = gta02_bt_sysfs_entries,
++};
++
++static int __init gta02_bt_probe(struct platform_device *pdev)
++{
++ struct rfkill *rfkill;
++ struct regulator *regulator;
++ struct gta02_pm_bt_data *bt_data;
++ int ret;
++
++ dev_info(&pdev->dev, DRVMSG ": starting\n");
++
++ bt_data = kzalloc(sizeof(*bt_data), GFP_KERNEL);
++ dev_set_drvdata(&pdev->dev, bt_data);
++
++ regulator = regulator_get(&pdev->dev, "BT_3V2");
++ if (IS_ERR(regulator))
++ return -ENODEV;
++
++ bt_data->regulator = regulator;
++
++ /* this tests the true physical state of the regulator... */
++ if (regulator_is_enabled(regulator)) {
++ /*
++ * but these only operate on the logical state of the
++ * regulator... so we need to logicaly "adopt" it on
++ * to turn it off
++ */
++ regulator_enable(regulator);
++ regulator_disable(regulator);
++ }
++
++ /* we pull reset to low to make sure that the chip doesn't
++ * drain power through the reset line */
++ gpio_request(GTA02_GPIO_BT_EN, "Bluetooth enable");
++ gpio_direction_output(GTA02_GPIO_BT_EN, 0);
++
++ rfkill = rfkill_alloc(pdev->name, &pdev->dev, RFKILL_TYPE_BLUETOOTH,
++ &gta02_bt_rfkill_ops, &pdev->dev);
++
++ if (!rfkill) {
++ dev_err(&pdev->dev, "Failed to allocate rfkill\n");
++ return -ENOMEM;
++ }
++
++ rfkill_init_sw_state(rfkill, 0);
++
++ ret = rfkill_register(rfkill);
++ if (ret) {
++ rfkill_destroy(rfkill);
++ dev_err(&pdev->dev, "Failed to register rfkill\n");
++ return ret;
++ }
++
++ bt_data->rfkill = rfkill;
++
++ return sysfs_create_group(&pdev->dev.kobj, &gta02_bt_attr_group);
++}
++
++static int gta02_bt_remove(struct platform_device *pdev)
++{
++ struct gta02_pm_bt_data *bt_data = dev_get_drvdata(&pdev->dev);
++ struct regulator *regulator;
++
++ sysfs_remove_group(&pdev->dev.kobj, &gta02_bt_attr_group);
++
++ if (bt_data->rfkill) {
++ rfkill_destroy(bt_data->rfkill);
++ }
++
++ if (!bt_data || !bt_data->regulator)
++ return 0;
++
++ regulator = bt_data->regulator;
++
++ /* Make sure regulator is disabled before calling regulator_put */
++ if (regulator_is_enabled(regulator))
++ regulator_disable(regulator);
++
++ regulator_put(regulator);
++
++ kfree(bt_data);
++
++ return 0;
++}
++
++static struct platform_driver gta02_bt_driver = {
++ .probe = gta02_bt_probe,
++ .remove = gta02_bt_remove,
++ .suspend = gta02_bt_suspend,
++ .resume = gta02_bt_resume,
++ .driver = {
++ .name = "gta02-pm-bt",
++ },
++};
++
++static int __devinit gta02_bt_init(void)
++{
++ return platform_driver_register(&gta02_bt_driver);
++}
++module_init(gta02_bt_init);
++
++static void gta02_bt_exit(void)
++{
++ platform_driver_unregister(&gta02_bt_driver);
++}
++module_exit(gta02_bt_exit);
++
++MODULE_LICENSE("GPL");
++MODULE_AUTHOR("Harald Welte <laforge@openmoko.org>");
++MODULE_DESCRIPTION(DRVMSG);
+diff --git a/arch/arm/mach-s3c2440/gta02-pm-gps.c b/arch/arm/mach-s3c2440/gta02-pm-gps.c
+new file mode 100644
+index 0000000..5f57eb4
+--- /dev/null
++++ b/arch/arm/mach-s3c2440/gta02-pm-gps.c
+@@ -0,0 +1,224 @@
++/*
++ * GPS Power Management code for the Openmoko Freerunner GSM Phone
++ *
++ * (C) 2007-2009 by Openmoko Inc.
++ * Author: Harald Welte <laforge@openmoko.org>
++ * All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation
++ *
++ */
++
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/kernel.h>
++#include <linux/platform_device.h>
++
++#include <mach/hardware.h>
++#include <mach/gpio-fns.h>
++#include <linux/gpio.h>
++
++#include <mach/gta02.h>
++
++#include <linux/regulator/consumer.h>
++#include <linux/err.h>
++
++struct gta02_pm_gps_data {
++#ifdef CONFIG_PM
++ int keep_on_in_suspend;
++#endif
++ int power_was_on;
++ struct regulator *regulator;
++};
++
++static struct gta02_pm_gps_data gta02_gps;
++
++int gta02_pm_gps_is_on(void)
++{
++ return gta02_gps.power_was_on;
++}
++EXPORT_SYMBOL_GPL(gta02_pm_gps_is_on);
++
++/* This is the POWERON pin */
++static void gps_pwron_set(int on)
++{
++ if (on) {
++ /* return UART pins to being UART pins */
++ s3c_gpio_cfgpin(S3C2410_GPH(4), S3C2410_GPH4_TXD1);
++ /* remove pulldown now it won't be floating any more */
++ s3c_gpio_setpull(S3C2410_GPH(5), S3C_GPIO_PULL_NONE);
++
++ if (!gta02_gps.power_was_on)
++ regulator_enable(gta02_gps.regulator);
++ } else {
++ /*
++ * take care not to power unpowered GPS from UART TX
++ * return them to GPIO and force low
++ */
++ s3c_gpio_cfgpin(S3C2410_GPH(4), S3C2410_GPIO_OUTPUT);
++ gpio_set_value(S3C2410_GPH(4), 0);
++ /* don't let RX from unpowered GPS float */
++ s3c_gpio_setpull(S3C2410_GPH(5), S3C_GPIO_PULL_DOWN);
++ if (gta02_gps.power_was_on)
++ regulator_disable(gta02_gps.regulator);
++ }
++}
++
++static int gps_pwron_get(void)
++{
++ return regulator_is_enabled(gta02_gps.regulator);
++}
++
++#ifdef CONFIG_PM
++/* This is the flag for keeping gps ON during suspend */
++static void gps_keep_on_in_suspend_set(int on)
++{
++ gta02_gps.keep_on_in_suspend = on;
++}
++
++static int gps_keep_on_in_suspend_get(void)
++{
++ return gta02_gps.keep_on_in_suspend;
++}
++#endif
++
++static ssize_t power_gps_read(struct device *dev,
++ struct device_attribute *attr, char *buf)
++{
++ int ret = 0;
++
++ if (!strcmp(attr->attr.name, "power_on"))
++ ret = gps_pwron_get();
++#ifdef CONFIG_PM
++ else if (!strcmp(attr->attr.name, "keep_on_in_suspend"))
++ ret = gps_keep_on_in_suspend_get();
++#endif
++ if (ret)
++ return strlcpy(buf, "1\n", 3);
++ else
++ return strlcpy(buf, "0\n", 3);
++}
++
++static ssize_t power_gps_write(struct device *dev,
++ struct device_attribute *attr, const char *buf,
++ size_t count)
++{
++ unsigned long on = simple_strtoul(buf, NULL, 10);
++
++ if (!strcmp(attr->attr.name, "power_on")) {
++ gps_pwron_set(on);
++ gta02_gps.power_was_on = !!on;
++#ifdef CONFIG_PM
++ } else if (!strcmp(attr->attr.name, "keep_on_in_suspend")) {
++ gps_keep_on_in_suspend_set(on);
++#endif
++ }
++ return count;
++}
++
++#ifdef CONFIG_PM
++static int gta02_pm_gps_suspend(struct device *dev)
++{
++ if (!gta02_gps.keep_on_in_suspend ||
++ !gta02_gps.power_was_on)
++ gps_pwron_set(0);
++ else
++ dev_warn(dev, "GTA02: keeping gps ON "
++ "during suspend\n");
++ return 0;
++}
++
++static int gta02_pm_gps_resume(struct device *dev)
++{
++ if (!gta02_gps.keep_on_in_suspend && gta02_gps.power_was_on)
++ gps_pwron_set(1);
++
++ return 0;
++}
++
++static DEVICE_ATTR(keep_on_in_suspend, 0644, power_gps_read, power_gps_write);
++
++static struct dev_pm_ops gta02_gps_pm_ops = {
++ .suspend = gta02_pm_gps_suspend,
++ .resume = gta02_pm_gps_resume,
++};
++
++#define GTA02_GPS_PM_OPS (&gta02_gps_pm_ops)
++
++#else
++#define GTA02_GPS_PM_OPS NULL
++#endif
++
++static DEVICE_ATTR(power_on, 0644, power_gps_read, power_gps_write);
++
++static struct attribute *gta02_gps_sysfs_entries[] = {
++ &dev_attr_power_on.attr,
++#ifdef CONFIG_PM
++ &dev_attr_keep_on_in_suspend.attr,
++#endif
++ NULL
++};
++
++static struct attribute_group gta02_gps_attr_group = {
++ .name = NULL,
++ .attrs = gta02_gps_sysfs_entries,
++};
++
++static int __init gta02_pm_gps_probe(struct platform_device *pdev)
++{
++ gta02_gps.regulator = regulator_get(&pdev->dev, "RF_3V");
++ if (IS_ERR(gta02_gps.regulator)) {
++ dev_err(&pdev->dev, "probe failed %ld\n",
++ PTR_ERR(gta02_gps.regulator));
++
++ return PTR_ERR(gta02_gps.regulator);
++ }
++
++ dev_info(&pdev->dev, "starting\n");
++
++
++ /*
++ * take care not to power unpowered GPS from UART TX
++ * return them to GPIO and force low
++ */
++ gpio_request(S3C2410_GPH(4), "gps tx");
++ gpio_direction_output(S3C2410_GPH(4), 0);
++ /* don't let RX from unpowered GPS float */
++ s3c_gpio_setpull(S3C2410_GPH(5), S3C_GPIO_PULL_UP);
++
++ return sysfs_create_group(&pdev->dev.kobj,
++ &gta02_gps_attr_group);
++}
++
++static int gta02_pm_gps_remove(struct platform_device *pdev)
++{
++ regulator_put(gta02_gps.regulator);
++ sysfs_remove_group(&pdev->dev.kobj, &gta02_gps_attr_group);
++ return 0;
++}
++
++static struct platform_driver gta02_pm_gps_driver = {
++ .probe = gta02_pm_gps_probe,
++ .remove = gta02_pm_gps_remove,
++ .driver = {
++ .name = "gta02-pm-gps",
++ .pm = GTA02_GPS_PM_OPS,
++ },
++};
++
++static int __devinit gta02_pm_gps_init(void)
++{
++ return platform_driver_register(&gta02_pm_gps_driver);
++}
++module_init(gta02_pm_gps_init);
++
++static void gta02_pm_gps_exit(void)
++{
++ platform_driver_unregister(&gta02_pm_gps_driver);
++}
++module_exit(gta02_pm_gps_exit);
++
++MODULE_LICENSE("GPL");
++MODULE_AUTHOR("Harald Welte <laforge@openmoko.org>");
+diff --git a/arch/arm/mach-s3c2440/gta02-pm-gsm.c b/arch/arm/mach-s3c2440/gta02-pm-gsm.c
+new file mode 100644
+index 0000000..08fcb27
+--- /dev/null
++++ b/arch/arm/mach-s3c2440/gta02-pm-gsm.c
+@@ -0,0 +1,362 @@
++/*
++ * GSM Management code for the Openmoko Freerunner GSM Phone
++ *
++ * (C) 2007 by Openmoko Inc.
++ * Author: Harald Welte <laforge@openmoko.org>
++ * All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation
++ *
++ */
++
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/kernel.h>
++#include <linux/platform_device.h>
++#include <linux/console.h>
++#include <linux/errno.h>
++#include <linux/interrupt.h>
++#include <linux/delay.h>
++#include <linux/err.h>
++#include <linux/regulator/consumer.h>
++
++#include <linux/gpio.h>
++#include <mach/gpio.h>
++#include <asm/mach-types.h>
++
++#include <mach/hardware.h>
++
++#include <mach/gta02.h>
++#include <mach/regs-gpio.h>
++#include <mach/regs-gpioj.h>
++
++static int gta02_gsm_interrupts;
++
++extern void s3c24xx_serial_console_set_silence(int);
++
++struct gta02pm_priv {
++ int gpio_ndl_gsm;
++ struct console *con;
++ struct regulator *regulator;
++};
++
++static struct gta02pm_priv gta02_gsm;
++
++static struct console *find_s3c24xx_console(void)
++{
++ struct console *con;
++
++ acquire_console_sem();
++
++ for (con = console_drivers; con; con = con->next) {
++ if (!strcmp(con->name, "ttySAC"))
++ break;
++ }
++
++ release_console_sem();
++
++ return con;
++}
++
++static ssize_t gsm_read(struct device *dev, struct device_attribute *attr,
++ char *buf)
++{
++ if (!strcmp(attr->attr.name, "power_on")) {
++ if (regulator_is_enabled(gta02_gsm.regulator))
++ goto out_1;
++ } else if (!strcmp(attr->attr.name, "download")) {
++ if (!gpio_get_value(GTA02_GPIO_nDL_GSM))
++ goto out_1;
++ } else if (!strcmp(attr->attr.name, "flowcontrolled")) {
++ if (s3c_gpio_getcfg(S3C2410_GPH(1)) == S3C2410_GPIO_OUTPUT)
++ goto out_1;
++ }
++
++ return strlcpy(buf, "0\n", 3);
++out_1:
++ return strlcpy(buf, "1\n", 3);
++}
++
++static void gsm_on_off(struct device *dev, bool on)
++{
++ if (on == regulator_is_enabled(gta02_gsm.regulator))
++ return;
++
++ if (!on) {
++ s3c_gpio_cfgpin(S3C2410_GPH(1), S3C2410_GPIO_INPUT);
++ s3c_gpio_cfgpin(S3C2410_GPH(2), S3C2410_GPIO_INPUT);
++
++ regulator_disable(gta02_gsm.regulator);
++
++ if (gta02_gsm.con) {
++ s3c24xx_serial_console_set_silence(0);
++ console_start(gta02_gsm.con);
++
++ dev_dbg(dev, "powered down gta02 GSM, enabling "
++ "serial console\n");
++ }
++
++ return;
++ }
++
++ if (gta02_gsm.con) {
++ dev_dbg(dev, "powering up GSM, thus "
++ "disconnecting serial console\n");
++
++ console_stop(gta02_gsm.con);
++ s3c24xx_serial_console_set_silence(1);
++ }
++
++ /* allow UART to talk to GSM side now we will power it */
++ s3c_gpio_cfgpin(S3C2410_GPH(1), S3C2410_GPH1_nRTS0);
++ s3c_gpio_cfgpin(S3C2410_GPH(2), S3C2410_GPH2_TXD0);
++
++ regulator_enable(gta02_gsm.regulator);
++
++ msleep(100);
++
++ gpio_set_value(GTA02_GPIO_MODEM_ON, 1);
++ msleep(500);
++ gpio_set_value(GTA02_GPIO_MODEM_ON, 0);
++
++ /*
++ * workaround for calypso firmware moko10 and earlier,
++ * without this it will leave IRQ line high after
++ * booting
++ */
++ s3c2410_gpio_setpin(S3C2410_GPH(1), 1);
++ s3c_gpio_cfgpin(S3C2410_GPH(1), S3C2410_GPIO_OUTPUT);
++ msleep(1000);
++ s3c_gpio_cfgpin(S3C2410_GPH(1), S3C2410_GPH1_nRTS0);
++
++}
++
++static ssize_t gsm_write(struct device *dev, struct device_attribute *attr,
++ const char *buf, size_t count)
++{
++ unsigned long on = simple_strtoul(buf, NULL, 10);
++
++ if (!strcmp(attr->attr.name, "power_on")) {
++ gsm_on_off(dev, on);
++
++ return count;
++ }
++
++ if (!strcmp(attr->attr.name, "download")) {
++ /*
++ * the keyboard / buttons driver requests and enables
++ * the JACK_INSERT IRQ. We have to take care about
++ * not enabling and disabling the IRQ when it was
++ * already in that state or we get "unblanaced IRQ"
++ * kernel warnings and stack dumps. So we use the
++ * copy of the ndl_gsm state to figure out if we should
++ * enable or disable the jack interrupt
++ */
++ if (on) {
++ if (gta02_gsm.gpio_ndl_gsm)
++ disable_irq(gpio_to_irq(
++ GTA02_GPIO_JACK_INSERT));
++ } else {
++ if (!gta02_gsm.gpio_ndl_gsm)
++ enable_irq(gpio_to_irq(
++ GTA02_GPIO_JACK_INSERT));
++ }
++
++ gta02_gsm.gpio_ndl_gsm = !on;
++ gpio_set_value(GTA02_GPIO_nDL_GSM, !on);
++
++ return count;
++ }
++
++ if (!strcmp(attr->attr.name, "flowcontrolled")) {
++ if (on) {
++ gta02_gsm_interrupts = 0;
++ gpio_set_value(S3C2410_GPH(1), 1);
++ s3c_gpio_cfgpin(S3C2410_GPH(1), S3C2410_GPIO_OUTPUT);
++ } else
++ s3c_gpio_cfgpin(S3C2410_GPH(1), S3C2410_GPH1_nRTS0);
++ }
++
++ return count;
++}
++
++static DEVICE_ATTR(power_on, 0644, gsm_read, gsm_write);
++static DEVICE_ATTR(reset, 0644, gsm_read, gsm_write);
++static DEVICE_ATTR(download, 0644, gsm_read, gsm_write);
++static DEVICE_ATTR(flowcontrolled, 0644, gsm_read, gsm_write);
++
++#ifdef CONFIG_PM
++
++static int gta02_gsm_suspend(struct device *dev)
++{
++ /* GPIO state is saved/restored by S3C2410 core GPIO driver, so we
++ * don't need to do much here. */
++
++
++ /* If flowcontrol asserted, abort if GSM already interrupted */
++ if (s3c_gpio_getcfg(S3C2410_GPH(1)) == S3C2410_GPIO_OUTPUT) {
++ if (gta02_gsm_interrupts)
++ goto busy;
++ }
++
++ /* disable DL GSM to prevent jack_insert becoming 'floating' */
++ gpio_set_value(GTA02_GPIO_nDL_GSM, 1);
++
++ if (device_may_wakeup(dev))
++ enable_irq_wake(GTA02_IRQ_MODEM);
++
++ return 0;
++
++busy:
++ return -EBUSY;
++}
++
++static int gta02_gsm_suspend_late(struct device *dev)
++{
++ /* Last chance: abort if GSM already interrupted */
++ if (s3c_gpio_getcfg(S3C2410_GPH(1)) == S3C2410_GPIO_OUTPUT) {
++ if (gta02_gsm_interrupts)
++ return -EBUSY;
++ }
++ return 0;
++}
++
++static int gta02_gsm_resume(struct device *dev)
++{
++ if (device_may_wakeup(dev))
++ disable_irq_wake(GTA02_IRQ_MODEM);
++
++ /* GPIO state is saved/restored by S3C2410 core GPIO driver, so we
++ * don't need to do much here. */
++
++ /* Make sure that the kernel console on the serial port is still
++ * disabled. FIXME: resume ordering race with serial driver! */
++ if (gta02_gsm.con && gpio_get_value(GTA02_GPIO_MODEM_ON))
++ console_stop(gta02_gsm.con);
++
++ gpio_set_value(GTA02_GPIO_nDL_GSM, gta02_gsm.gpio_ndl_gsm);
++
++ return 0;
++}
++
++static struct dev_pm_ops gta02_gsm_pm_ops = {
++ .suspend = gta02_gsm_suspend,
++ .suspend_noirq = gta02_gsm_suspend_late,
++ .resume = gta02_gsm_resume,
++};
++
++#define GTA02_GSM_PM_OPS (&gta02_gsm_pm_ops)
++
++#else
++#define GTA02_GSM_PM_OPS NULL
++#endif /* CONFIG_PM */
++
++static struct attribute *gta02_gsm_sysfs_entries[] = {
++ &dev_attr_power_on.attr,
++ &dev_attr_reset.attr,
++ &dev_attr_download.attr,
++ &dev_attr_flowcontrolled.attr,
++ NULL
++};
++
++static struct attribute_group gta02_gsm_attr_group = {
++ .name = NULL,
++ .attrs = gta02_gsm_sysfs_entries,
++};
++
++static irqreturn_t gta02_gsm_irq(int irq, void *devid)
++{
++ gta02_gsm_interrupts++;
++ return IRQ_HANDLED;
++}
++
++static int __init gta02_gsm_probe(struct platform_device *pdev)
++{
++ int ret;
++
++ gta02_gsm.con = find_s3c24xx_console();
++ if (!gta02_gsm.con)
++ dev_warn(&pdev->dev,
++ "cannot find S3C24xx console driver\n");
++
++ gta02_gsm.regulator = regulator_get_exclusive(&pdev->dev, "GSM");
++
++ if (IS_ERR(gta02_gsm.regulator)) {
++ ret = PTR_ERR(gta02_gsm.regulator);
++ dev_err(&pdev->dev, "Failed to get regulator: %d\n", ret);
++ return ret;
++ }
++
++ ret = request_irq(GTA02_IRQ_MODEM, gta02_gsm_irq,
++ IRQF_DISABLED | IRQF_TRIGGER_RISING, "modem", NULL);
++
++ if (ret) {
++ regulator_put(gta02_gsm.regulator);
++ dev_err(&pdev->dev, "Failed to get modem irq: %d\n", ret);
++ goto err_regulator_put;
++ }
++
++ ret = sysfs_create_group(&pdev->dev.kobj, &gta02_gsm_attr_group);
++ if (ret) {
++ dev_err(&pdev->dev, "Failed to create sysfs entries: %d\n", ret);
++ goto err_free_irq;
++ }
++
++ device_init_wakeup(&pdev->dev, 1);
++
++ /* note that download initially disabled, and enforce that */
++ gta02_gsm.gpio_ndl_gsm = 1;
++ gpio_request(GTA02_GPIO_nDL_GSM, "GSM nDL");
++ gpio_direction_output(GTA02_GPIO_nDL_GSM, 1);
++ gpio_request(GTA02_GPIO_MODEM_ON, "GSM modem enable");
++ gpio_direction_output(GTA02_GPIO_MODEM_ON, 0);
++
++ /* GSM is to be initially off (at boot, or if this module inserted) */
++ gsm_on_off(&pdev->dev, 0);
++
++ return 0;
++err_free_irq:
++ free_irq(GTA02_IRQ_MODEM, NULL);
++err_regulator_put:
++ regulator_put(gta02_gsm.regulator);
++
++ return ret;
++}
++
++static int gta02_gsm_remove(struct platform_device *pdev)
++{
++ gsm_on_off(&pdev->dev, 0);
++
++ sysfs_remove_group(&pdev->dev.kobj, &gta02_gsm_attr_group);
++ free_irq(GTA02_IRQ_MODEM, NULL);
++ regulator_put(gta02_gsm.regulator);
++
++ return 0;
++}
++
++static struct platform_driver gta02_gsm_driver = {
++ .probe = gta02_gsm_probe,
++ .remove = gta02_gsm_remove,
++ .driver = {
++ .name = "gta02-pm-gsm",
++ .pm = GTA02_GSM_PM_OPS,
++ },
++};
++
++static int __devinit gta02_gsm_init(void)
++{
++ return platform_driver_register(&gta02_gsm_driver);
++}
++module_init(gta02_gsm_init);
++
++static void gta02_gsm_exit(void)
++{
++ platform_driver_unregister(&gta02_gsm_driver);
++}
++module_exit(gta02_gsm_exit);
++
++MODULE_LICENSE("GPL");
++MODULE_AUTHOR("Harald Welte <laforge@openmoko.org>");
++MODULE_DESCRIPTION("Openmoko Freerunner GSM Power Management");
+diff --git a/arch/arm/mach-s3c2440/gta02-pm-wlan.c b/arch/arm/mach-s3c2440/gta02-pm-wlan.c
+new file mode 100644
+index 0000000..183b317
+--- /dev/null
++++ b/arch/arm/mach-s3c2440/gta02-pm-wlan.c
+@@ -0,0 +1,198 @@
++/*
++ * GTA02 WLAN power management
++ *
++ * (C) 2008, 2009 by Openmoko Inc.
++ * Author: Andy Green <andy@openmoko.com>
++ * All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation
++ *
++ */
++
++#include <linux/module.h>
++#include <linux/init.h>
++#include <linux/kernel.h>
++#include <linux/mutex.h>
++#include <linux/platform_device.h>
++
++#include <mach/hardware.h>
++#include <asm/mach-types.h>
++
++#include <mach/gta02.h>
++#include <mach/gta02-pm-wlan.h>
++#include <mach/regs-gpio.h>
++#include <mach/gpio-fns.h>
++#include <linux/gpio.h>
++
++#include <linux/delay.h>
++#include <linux/rfkill.h>
++
++
++/* ----- Module hardware reset ("power") ----------------------------------- */
++
++
++void gta02_wlan_reset()
++{
++ gpio_set_value(GTA02_GPIO_nWLAN_RESET, 0);
++ msleep(200); /* probably excessive but we don't have specs */
++ gpio_set_value(GTA02_GPIO_nWLAN_RESET, 1);
++}
++
++/* ----- rfkill ------------------------------------------------------------ */
++
++/*
++ * S3C MCI handles suspend/resume through device removal/insertion. In order to
++ * preserve rfkill state, as required in clause 7 of section 3.1 in rfkill.txt,
++ * we therefore need to maintain rfkill state outside the driver.
++ *
++ * This platform driver is as good a place as any other.
++ */
++
++static int (*gta02_wlan_rfkill_cb)(void *user, int on);
++static void *gta02_wlan_rfkill_user;
++static DEFINE_MUTEX(gta02_wlan_rfkill_lock);
++static int gta02_wlan_rfkill_on;
++
++/*
++ * gta02_wlan_query_rfkill_lock is used to obtain the rfkill state before the
++ * driver is ready to process rfkill callbacks. To prevent the state from
++ * changing until the driver has completed its initialization, we grab and hold
++ * the rfkill lock.
++ *
++ * A call to gta02_wlan_query_rfkill_lock must be followed by either
++ * - a call to gta02_wlan_set_rfkill_cb, to complete the setup, or
++ * - a call to gta02_wlan_query_rfkill_unlock to abort the setup process.
++ */
++
++int gta02_wlan_query_rfkill_lock(void)
++{
++ mutex_lock(&gta02_wlan_rfkill_lock);
++ return gta02_wlan_rfkill_on;
++}
++EXPORT_SYMBOL_GPL(gta02_wlan_query_rfkill_lock);
++
++void gta02_wlan_query_rfkill_unlock(void)
++{
++ mutex_unlock(&gta02_wlan_rfkill_lock);
++}
++EXPORT_SYMBOL_GPL(gta02_wlan_query_rfkill_unlock);
++
++void gta02_wlan_set_rfkill_cb(int (*cb)(void *user, int on), void *user)
++{
++ BUG_ON(!mutex_is_locked(&gta02_wlan_rfkill_lock));
++ BUG_ON(gta02_wlan_rfkill_cb);
++ gta02_wlan_rfkill_cb = cb;
++ gta02_wlan_rfkill_user = user;
++ mutex_unlock(&gta02_wlan_rfkill_lock);
++}
++EXPORT_SYMBOL_GPL(gta02_wlan_set_rfkill_cb);
++
++void gta02_wlan_clear_rfkill_cb(void)
++{
++ mutex_lock(&gta02_wlan_rfkill_lock);
++ BUG_ON(!gta02_wlan_rfkill_cb);
++ gta02_wlan_rfkill_cb = NULL;
++ mutex_unlock(&gta02_wlan_rfkill_lock);
++}
++EXPORT_SYMBOL_GPL(gta02_wlan_clear_rfkill_cb);
++
++static int gta02_wlan_set_radio_block(void *data, bool blocked)
++{
++ struct device *dev = data;
++ int res = 0;
++
++ dev_dbg(dev, "gta02_wlan_toggle_radio: blocked %d (%p)\n",
++ blocked, gta02_wlan_rfkill_cb);
++ mutex_lock(&gta02_wlan_rfkill_lock);
++ if (gta02_wlan_rfkill_cb)
++ res = gta02_wlan_rfkill_cb(gta02_wlan_rfkill_user, !blocked);
++ if (!res)
++ gta02_wlan_rfkill_on = !blocked;
++ mutex_unlock(&gta02_wlan_rfkill_lock);
++ return res;
++}
++
++static const struct rfkill_ops gta02_wlan_rfkill_ops = {
++ .set_block = gta02_wlan_set_radio_block,
++};
++
++/* ----- Initialization/removal -------------------------------------------- */
++
++
++static int __init gta02_wlan_probe(struct platform_device *pdev)
++{
++ /* default-on for now */
++ const int default_state = 1;
++ struct rfkill *rfkill;
++ int ret;
++
++ dev_info(&pdev->dev, "starting\n");
++
++ gpio_request(GTA02_GPIO_nWLAN_RESET, "wlan reset");
++ gpio_direction_output(GTA02_GPIO_nWLAN_RESET, 0);
++ gta02_wlan_reset();
++
++ rfkill = rfkill_alloc("ar6000", &pdev->dev, RFKILL_TYPE_WLAN,
++ &gta02_wlan_rfkill_ops, &pdev->dev);
++
++
++ if (!rfkill) {
++ dev_err(&pdev->dev, "Failed to allocate rfkill\n");
++ return -ENOMEM;
++ }
++
++ rfkill_init_sw_state(rfkill, default_state);
++ /*
++ * If the WLAN driver somehow managed to get activated before we're
++ * ready, the driver is now in an unknown state, which isn't something
++ * we're prepared to handle. This can't happen, so just fail hard.
++ */
++ BUG_ON(gta02_wlan_rfkill_cb);
++ gta02_wlan_rfkill_on = default_state;
++
++ ret = rfkill_register(rfkill);
++ if (ret) {
++ rfkill_destroy(rfkill);
++ dev_err(&pdev->dev, "Failed to register rfkill\n");
++ return ret;
++ }
++
++ dev_set_drvdata(&pdev->dev, rfkill);
++
++ return 0;
++}
++
++static int gta02_wlan_remove(struct platform_device *pdev)
++{
++ struct rfkill *rfkill = dev_get_drvdata(&pdev->dev);
++
++ rfkill_destroy(rfkill);
++
++ return 0;
++}
++
++static struct platform_driver gta02_wlan_driver = {
++ .probe = gta02_wlan_probe,
++ .remove = gta02_wlan_remove,
++ .driver = {
++ .name = "gta02-pm-wlan",
++ },
++};
++
++static int __devinit gta02_wlan_init(void)
++{
++ return platform_driver_register(&gta02_wlan_driver);
++}
++module_init(gta02_wlan_init);
++
++static void gta02_wlan_exit(void)
++{
++ platform_driver_unregister(&gta02_wlan_driver);
++}
++module_exit(gta02_wlan_exit);
++
++MODULE_LICENSE("GPL");
++MODULE_AUTHOR("Andy Green <andy@openmoko.com>");
++MODULE_DESCRIPTION("Openmoko GTA02 WLAN power management");
+diff --git a/arch/arm/mach-s3c2440/include/mach/gta02-fiq.h b/arch/arm/mach-s3c2440/include/mach/gta02-fiq.h
+new file mode 100644
+index 0000000..90de353
+--- /dev/null
++++ b/arch/arm/mach-s3c2440/include/mach/gta02-fiq.h
+@@ -0,0 +1,9 @@
++#ifndef __GTA02_FIQ_H
++#define __GTA02_FIQ_H
++
++extern void gta02_fiq_handler(void);
++extern void gta02_fiq_kick(void);
++extern int gta02_fiq_enable(void);
++extern void gta02_fiq_disable(void);
++
++#endif
+diff --git a/arch/arm/mach-s3c2440/include/mach/gta02-hdq.h b/arch/arm/mach-s3c2440/include/mach/gta02-hdq.h
+new file mode 100644
+index 0000000..ba98f8f
+--- /dev/null
++++ b/arch/arm/mach-s3c2440/include/mach/gta02-hdq.h
+@@ -0,0 +1,23 @@
++#ifndef __LINUX_HDQ_H__
++#define __LINUX_HDQ_H__
++
++#include <linux/device.h>
++
++#define HDQ_SAMPLE_PERIOD_US 10
++
++/* platform data */
++
++struct hdq_platform_data {
++ void (*gpio_dir_out)(void);
++ void (*gpio_dir_in)(void);
++ void (*gpio_set)(int);
++ int (*gpio_get)(void);
++
++ int (*enable_fiq)(void);
++ void (*disable_fiq)(void);
++ void (*kick_fiq)(void);
++};
++
++int hdq_read(struct device *dev, unsigned int address);
++
++#endif
+diff --git a/arch/arm/mach-s3c2440/include/mach/gta02-pm-gps.h b/arch/arm/mach-s3c2440/include/mach/gta02-pm-gps.h
+new file mode 100644
+index 0000000..f15180a
+--- /dev/null
++++ b/arch/arm/mach-s3c2440/include/mach/gta02-pm-gps.h
+@@ -0,0 +1 @@
++extern int gta02_pm_gps_is_on(void);
+diff --git a/arch/arm/mach-s3c2440/include/mach/gta02-pm-wlan.h b/arch/arm/mach-s3c2440/include/mach/gta02-pm-wlan.h
+new file mode 100644
+index 0000000..0c96db4
+--- /dev/null
++++ b/arch/arm/mach-s3c2440/include/mach/gta02-pm-wlan.h
+@@ -0,0 +1,10 @@
++#ifndef __MACH_GTA02_PM_WLAN_H
++#define __MACH_GTA02_PM_WLAN_H
++
++void gta02_wlan_reset(void);
++int gta02_wlan_query_rfkill_lock(void);
++void gta02_wlan_query_rfkill_unlock(void);
++void gta02_wlan_set_rfkill_cb(int (*cb)(void *user, int on), void *user);
++void gta02_wlan_clear_rfkill_cb(void);
++
++#endif /* __MACH_GTA02_PM_WLAN_H */
+diff --git a/arch/arm/mach-s3c2440/include/mach/gta02.h b/arch/arm/mach-s3c2440/include/mach/gta02.h
+index 953331d..d838408 100644
+--- a/arch/arm/mach-s3c2440/include/mach/gta02.h
++++ b/arch/arm/mach-s3c2440/include/mach/gta02.h
+@@ -44,19 +44,19 @@
+ #define GTA02v3_GPIO_nUSB_FLT S3C2410_GPG(10) /* v3 + v4 only */
+ #define GTA02v3_GPIO_nGSM_OC S3C2410_GPG(11) /* v3 + v4 only */
+
+-#define GTA02_GPIO_AMP_SHUT S3C2440_GPJ1 /* v2 + v3 + v4 only */
+-#define GTA02v1_GPIO_WLAN_GPIO10 S3C2440_GPJ2
+-#define GTA02_GPIO_HP_IN S3C2440_GPJ2 /* v2 + v3 + v4 only */
+-#define GTA02_GPIO_INT0 S3C2440_GPJ3 /* v2 + v3 + v4 only */
+-#define GTA02_GPIO_nGSM_EN S3C2440_GPJ4
+-#define GTA02_GPIO_3D_RESET S3C2440_GPJ5
+-#define GTA02_GPIO_nDL_GSM S3C2440_GPJ6 /* v4 + v5 only */
+-#define GTA02_GPIO_WLAN_GPIO0 S3C2440_GPJ7
+-#define GTA02v1_GPIO_BAT_ID S3C2440_GPJ8
+-#define GTA02_GPIO_KEEPACT S3C2440_GPJ8
+-#define GTA02v1_GPIO_HP_IN S3C2440_GPJ10
+-#define GTA02_CHIP_PWD S3C2440_GPJ11 /* v2 + v3 + v4 only */
+-#define GTA02_GPIO_nWLAN_RESET S3C2440_GPJ12 /* v2 + v3 + v4 only */
++#define GTA02_GPIO_AMP_SHUT S3C2410_GPJ(1) /* v2 + v3 + v4 only */
++#define GTA02v1_GPIO_WLAN_GPIO10 S3C2410_GPJ(2)
++#define GTA02_GPIO_HP_IN S3C2410_GPJ(2) /* v2 + v3 + v4 only */
++#define GTA02_GPIO_INT0 S3C2410_GPJ(3) /* v2 + v3 + v4 only */
++#define GTA02_GPIO_nGSM_EN S3C2410_GPJ(4)
++#define GTA02_GPIO_3D_RESET S3C2410_GPJ(5)
++#define GTA02_GPIO_nDL_GSM S3C2410_GPJ(6) /* v4 + v5 only */
++#define GTA02_GPIO_WLAN_GPIO0 S3C2410_GPJ(7)
++#define GTA02v1_GPIO_BAT_ID S3C2410_GPJ(8)
++#define GTA02_GPIO_KEEPACT S3C2410_GPJ(8)
++#define GTA02v1_GPIO_HP_IN S3C2410_GPJ(10)
++#define GTA02_CHIP_PWD S3C2410_GPJ(11) /* v2 + v3 + v4 only */
++#define GTA02_GPIO_nWLAN_RESET S3C2410_GPJ(12) /* v2 + v3 + v4 only */
+
+ #define GTA02_IRQ_GSENSOR_1 IRQ_EINT0
+ #define GTA02_IRQ_MODEM IRQ_EINT1
+@@ -79,6 +79,14 @@
+ #define GTA02_PCB_ID2_0 S3C2410_GPD(3)
+ #define GTA02_PCB_ID2_1 S3C2410_GPD(4)
+
++#define GTA02_GPIO_GLAMO_BASE S3C_GPIO_END
++#define GTA02_GPIO_GLAMO(x) (GTA02_GPIO_GLAMO_BASE + (x))
++#define GTA02_GPIO_PCF_BASE (GTA02_GPIO_GLAMO_BASE + 32)
++#define GTA02_GPIO_PCF(x) (GTA02_GPIO_PCF_BASE + (x))
++
++#define GTA02_GLAMO_IRQ_BASE IRQ_BOARD_START
++#define GTA02_PCF50633_IRQ_BASE (GTA02_GLAMO_IRQ_BASE + 9)
++
+ int gta02_get_pcb_revision(void);
+
+ #endif /* _GTA02_H */
+diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
+index 9f2c14e..450f1f2 100644
+--- a/arch/arm/mach-s3c2440/mach-gta02.c
++++ b/arch/arm/mach-s3c2440/mach-gta02.c
+@@ -38,6 +38,7 @@
+ #include <linux/platform_device.h>
+ #include <linux/serial_core.h>
+ #include <linux/spi/spi.h>
++#include <linux/spi/spi_gpio.h>
+
+ #include <linux/mmc/host.h>
+
+@@ -50,6 +51,7 @@
+
+ #include <linux/i2c.h>
+ #include <linux/regulator/machine.h>
++#include <linux/regulator/fixed.h>
+
+ #include <linux/mfd/pcf50633/core.h>
+ #include <linux/mfd/pcf50633/mbc.h>
+@@ -58,6 +60,12 @@
+ #include <linux/mfd/pcf50633/pmic.h>
+ #include <linux/mfd/pcf50633/backlight.h>
+
++#include <linux/input.h>
++#include <linux/gpio_keys.h>
++
++#include <linux/leds.h>
++#include <linux/leds_pwm.h>
++
+ #include <asm/mach/arch.h>
+ #include <asm/mach/map.h>
+ #include <asm/mach/irq.h>
+@@ -76,6 +84,8 @@
+ #include <mach/regs-mem.h>
+ #include <mach/hardware.h>
+
++#include <plat/ts.h>
++
+ #include <mach/gta02.h>
+
+ #include <plat/regs-serial.h>
+@@ -87,6 +97,19 @@
+ #include <plat/gpio-cfg.h>
+ #include <plat/iic.h>
+
++#include <mach/gta02-pm-gps.h>
++#include <mach/gta02-pm-wlan.h>
++
++#include <mach/gta02-fiq.h>
++
++#include <mach/gta02-hdq.h>
++#include <linux/power/bq27x00_battery.h>
++#include <linux/platform_battery.h>
++
++#include <linux/jbt6k74.h>
++#include <linux/glamofb.h>
++#include <linux/mfd/glamo.h>
++
+ static struct pcf50633 *gta02_pcf;
+
+ /*
+@@ -142,6 +165,194 @@ static struct s3c2410_uartcfg gta02_uartcfgs[] = {
+ },
+ };
+
++static struct platform_device gta02_pm_bt_dev = {
++ .name = "gta02-pm-bt",
++};
++
++static struct platform_device gta02_pm_gps_dev = {
++ .name = "gta02-pm-gps",
++};
++
++static struct platform_device gta02_pm_gsm_dev = {
++ .name = "gta02-pm-gsm",
++};
++
++static struct platform_device gta02_pm_wlan_dev = {
++ .name = "gta02-pm-wlan",
++};
++
++static struct regulator_consumer_supply gsm_supply_consumer = {
++ .dev = &gta02_pm_gsm_dev.dev,
++ .supply = "GSM",
++};
++
++static struct regulator_init_data gsm_supply_init_data = {
++ .constraints = {
++ .min_uV = 3700000,
++ .max_uV = 3700000,
++ .valid_modes_mask = REGULATOR_MODE_NORMAL,
++ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
++ },
++ .num_consumer_supplies = 1,
++ .consumer_supplies = &gsm_supply_consumer,
++};
++
++static struct fixed_voltage_config gsm_supply_config = {
++ .supply_name = "GSM",
++ .microvolts = 3700000,
++ .gpio = GTA02_GPIO_PCF(PCF50633_GPIO2),
++ .enable_high = 1,
++ .init_data = &gsm_supply_init_data,
++};
++
++static struct platform_device gta02_gsm_supply_device = {
++ .name = "reg-fixed-voltage",
++ .id = 1,
++ .dev = {
++ .platform_data = &gsm_supply_config,
++ },
++};
++
++/*
++ * we crank down SD Card clock dynamically when GPS is powered
++ */
++
++static int gta02_glamo_mci_use_slow(void)
++{
++ return gta02_pm_gps_is_on();
++}
++
++static void gta02_glamo_external_reset(int level)
++{
++ s3c2410_gpio_setpin(GTA02_GPIO_3D_RESET, level);
++ s3c2410_gpio_cfgpin(GTA02_GPIO_3D_RESET, S3C2410_GPIO_OUTPUT);
++}
++
++struct spi_gpio_platform_data spigpio_platform_data = {
++ .sck = GTA02_GPIO_GLAMO(10),
++ .mosi = GTA02_GPIO_GLAMO(11),
++ .miso = GTA02_GPIO_GLAMO(5),
++ .num_chipselect = 1,
++};
++
++static struct platform_device spigpio_device = {
++ .name = "spi_gpio",
++ .id = 2,
++ .dev = {
++ .platform_data = &spigpio_platform_data,
++ },
++};
++
++static void gta02_glamo_registered(struct device *dev)
++{
++ spigpio_device.dev.parent = dev;
++ platform_device_register(&spigpio_device);
++}
++
++static struct fb_videomode gta02_glamo_modes[] = {
++ {
++ .name = "480x640",
++ .xres = 480,
++ .yres = 640,
++ .pixclock = 40816,
++ .left_margin = 8,
++ .right_margin = 16,
++ .upper_margin = 2,
++ .lower_margin = 16,
++ .hsync_len = 8,
++ .vsync_len = 2,
++ .vmode = FB_VMODE_NONINTERLACED,
++ }, {
++ .name = "240x320",
++ .xres = 240,
++ .yres = 320,
++ .pixclock = 40816,
++ .left_margin = 8,
++ .right_margin = 16,
++ .upper_margin = 2,
++ .lower_margin = 16,
++ .hsync_len = 8,
++ .vsync_len = 2,
++ .vmode = FB_VMODE_NONINTERLACED,
++ }
++};
++
++static struct glamo_fb_platform_data gta02_glamo_fb_pdata = {
++ .width = 43,
++ .height = 58,
++
++ .num_modes = ARRAY_SIZE(gta02_glamo_modes),
++ .modes = gta02_glamo_modes,
++};
++
++static struct glamo_mmc_platform_data gta02_glamo_mmc_pdata = {
++ .glamo_mmc_use_slow = gta02_glamo_mci_use_slow,
++};
++
++static struct glamo_gpio_platform_data gta02_glamo_gpio_pdata = {
++ .base = GTA02_GPIO_GLAMO_BASE,
++ .registered = gta02_glamo_registered,
++};
++
++static struct glamo_platform_data gta02_glamo_pdata = {
++ .fb_data = &gta02_glamo_fb_pdata,
++ .mmc_data = &gta02_glamo_mmc_pdata,
++ .gpio_data = &gta02_glamo_gpio_pdata,
++
++ .osci_clock_rate = 32768,
++
++ .glamo_external_reset = gta02_glamo_external_reset,
++};
++
++/* JBT6k74 display controller */
++static void gta02_jbt6k74_probe_completed(struct device *dev)
++ {
++ pcf50633_bl_set_brightness_limit(gta02_pcf, 0x3f);
++}
++
++const static struct jbt6k74_platform_data jbt6k74_pdata = {
++ .gpio_reset = GTA02_GPIO_GLAMO(4),
++};
++
++static struct spi_board_info gta02_spi_board_info[] = {
++ {
++ .modalias = "jbt6k74",
++ .platform_data = &jbt6k74_pdata,
++ .controller_data = (void*)GTA02_GPIO_GLAMO(12),
++ /* irq */
++ .max_speed_hz = 100 * 1000,
++ .bus_num = 2,
++ .chip_select = 0
++ },
++};
++
++static struct resource gta02_glamo_resources[] = {
++ [0] = {
++ .start = S3C2410_CS1,
++ .end = S3C2410_CS1 + 0x1000000 - 1,
++ .flags = IORESOURCE_MEM,
++ },
++ [1] = {
++ .start = GTA02_IRQ_3D,
++ .end = GTA02_IRQ_3D,
++ .flags = IORESOURCE_IRQ,
++ },
++ [2] = {
++ .start = GTA02_GLAMO_IRQ_BASE,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++static struct platform_device gta02_glamo_dev = {
++ .name = "glamo3362",
++ .num_resources = ARRAY_SIZE(gta02_glamo_resources),
++ .resource = gta02_glamo_resources,
++ .dev = {
++ .platform_data = &gta02_glamo_pdata,
++ },
++};
++
++
+ #ifdef CONFIG_CHARGER_PCF50633
+ /*
+ * On GTA02 the 1A charger features a 48K resistor to 0V on the ID pin.
+@@ -154,22 +365,28 @@ static struct s3c2410_uartcfg gta02_uartcfgs[] = {
+ #define ADC_NOM_CHG_DETECT_1A 6
+ #define ADC_NOM_CHG_DETECT_USB 43
+
+-static void
+-gta02_configure_pmu_for_charger(struct pcf50633 *pcf, void *unused, int res)
++static int gta02_get_charger_online_status(void)
+ {
+- int ma;
++ struct pcf50633 *pcf = gta02_pcf;
+
+- /* Interpret charger type */
+- if (res < ((ADC_NOM_CHG_DETECT_USB + ADC_NOM_CHG_DETECT_1A) / 2)) {
++ return pcf50633_mbc_get_status(pcf) & PCF50633_MBC_USB_ONLINE;
++}
+
+- /*
+- * Sanity - stop GPO driving out now that we have a 1A charger
+- * GPO controls USB Host power generation on GTA02
+- */
+- pcf50633_gpio_set(pcf, PCF50633_GPO, 0);
++static int gta02_get_charger_active_status(void)
++{
++ struct pcf50633 *pcf = gta02_pcf;
++
++ return pcf50633_mbc_get_status(pcf) & PCF50633_MBC_USB_ACTIVE;
++}
+
++static void
++gta02_configure_pmu_for_charger(struct pcf50633 *pcf, void *unused, int res)
++{
++ int ma;
++
++ if (res < ((ADC_NOM_CHG_DETECT_USB + ADC_NOM_CHG_DETECT_1A) / 2))
+ ma = 1000;
+- } else
++ else
+ ma = 100;
+
+ pcf50633_mbc_usb_curlim_set(pcf, ma);
+@@ -230,6 +447,8 @@ static void gta02_udc_vbus_draw(unsigned int ma)
+ #else /* !CONFIG_CHARGER_PCF50633 */
+ #define gta02_pmu_event_callback NULL
+ #define gta02_udc_vbus_draw NULL
++#define gta02_get_charger_online_status NULL
++#define gta02_get_charger_active_status NULL
+ #endif
+
+ /*
+@@ -253,6 +472,32 @@ static struct pcf50633_bl_platform_data gta02_backlight_data = {
+ .ramp_time = 5,
+ };
+
++static struct regulator_consumer_supply ldo4_consumers[] = {
++ {
++ .dev = &gta02_pm_bt_dev.dev,
++ .supply = "BT_3V2",
++ },
++};
++
++static struct regulator_consumer_supply ldo5_consumers[] = {
++ {
++ .dev = &gta02_pm_gps_dev.dev,
++ .supply = "RF_3V",
++ },
++};
++
++static struct regulator_consumer_supply ldo6_consumers[] = {
++ REGULATOR_SUPPLY("VDC", "spi2.0"),
++ REGULATOR_SUPPLY("VDDIO", "spi2.0"),
++};
++
++static struct regulator_consumer_supply hcldo_consumers[] = {
++ {
++ .dev = &gta02_glamo_dev.dev,
++ .supply = "SD_3V3",
++ },
++};
++
+ struct pcf50633_platform_data gta02_pcf_pdata = {
+ .resumers = {
+ [0] = PCF50633_INT1_USBINS |
+@@ -271,6 +516,8 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
+ .charger_reference_current_ma = 1000,
+
+ .backlight_data = &gta02_backlight_data,
++ .gpio_base = GTA02_GPIO_PCF_BASE,
++ .irq_base = GTA02_PCF50633_IRQ_BASE,
+
+ .reg_init_data = {
+ [PCF50633_REGULATOR_AUTO] = {
+@@ -280,9 +527,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
+ .valid_modes_mask = REGULATOR_MODE_NORMAL,
+ .always_on = 1,
+ .apply_uV = 1,
+- .state_mem = {
+- .enabled = 1,
+- },
+ },
+ },
+ [PCF50633_REGULATOR_DOWN1] = {
+@@ -301,9 +545,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
+ .valid_modes_mask = REGULATOR_MODE_NORMAL,
+ .apply_uV = 1,
+ .always_on = 1,
+- .state_mem = {
+- .enabled = 1,
+- },
+ },
+ },
+ [PCF50633_REGULATOR_HCLDO] = {
+@@ -311,19 +552,19 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
+ .min_uV = 2000000,
+ .max_uV = 3300000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL,
+- .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
+- .always_on = 1,
++ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
++ REGULATOR_CHANGE_STATUS,
+ },
++ .num_consumer_supplies = ARRAY_SIZE(hcldo_consumers),
++ .consumer_supplies = hcldo_consumers,
+ },
+ [PCF50633_REGULATOR_LDO1] = {
+ .constraints = {
+ .min_uV = 3300000,
+ .max_uV = 3300000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL,
++ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ .apply_uV = 1,
+- .state_mem = {
+- .enabled = 0,
+- },
+ },
+ },
+ [PCF50633_REGULATOR_LDO2] = {
+@@ -347,35 +588,38 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
+ .min_uV = 3200000,
+ .max_uV = 3200000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL,
++ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ .apply_uV = 1,
+ },
++ .num_consumer_supplies = ARRAY_SIZE(ldo4_consumers),
++ .consumer_supplies = ldo4_consumers,
+ },
+ [PCF50633_REGULATOR_LDO5] = {
+ .constraints = {
+ .min_uV = 3000000,
+ .max_uV = 3000000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL,
++ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ .apply_uV = 1,
+- .state_mem = {
+- .enabled = 1,
+- },
+ },
++ .num_consumer_supplies = ARRAY_SIZE(ldo5_consumers),
++ .consumer_supplies = ldo5_consumers,
+ },
+ [PCF50633_REGULATOR_LDO6] = {
+ .constraints = {
+ .min_uV = 3000000,
+ .max_uV = 3000000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL,
++ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ },
++ .num_consumer_supplies = ARRAY_SIZE(ldo6_consumers),
++ .consumer_supplies = ldo6_consumers,
+ },
+ [PCF50633_REGULATOR_MEMLDO] = {
+ .constraints = {
+ .min_uV = 1800000,
+ .max_uV = 1800000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL,
+- .state_mem = {
+- .enabled = 1,
+- },
+ },
+ },
+
+@@ -410,12 +654,6 @@ static struct platform_device gta02_nor_flash = {
+ .num_resources = 1,
+ };
+
+-
+-struct platform_device s3c24xx_pwm_device = {
+- .name = "s3c24xx_pwm",
+- .num_resources = 0,
+-};
+-
+ static struct i2c_board_info gta02_i2c_devs[] __initdata = {
+ {
+ I2C_BOARD_INFO("pcf50633", 0x73),
+@@ -452,6 +690,7 @@ static struct s3c2410_platform_nand __initdata gta02_nand_info = {
+ .twrph1 = 15,
+ .nr_sets = ARRAY_SIZE(gta02_nand_sets),
+ .sets = gta02_nand_sets,
++ .software_ecc = 1,
+ };
+
+
+@@ -460,11 +699,11 @@ static void gta02_udc_command(enum s3c2410_udc_cmd_e cmd)
+ switch (cmd) {
+ case S3C2410_UDC_P_ENABLE:
+ pr_debug("%s S3C2410_UDC_P_ENABLE\n", __func__);
+- gpio_direction_output(GTA02_GPIO_USB_PULLUP, 1);
++ gpio_set_value(GTA02_GPIO_USB_PULLUP, 1);
+ break;
+ case S3C2410_UDC_P_DISABLE:
+ pr_debug("%s S3C2410_UDC_P_DISABLE\n", __func__);
+- gpio_direction_output(GTA02_GPIO_USB_PULLUP, 0);
++ gpio_set_value(GTA02_GPIO_USB_PULLUP, 0);
+ break;
+ case S3C2410_UDC_P_RESET:
+ pr_debug("%s S3C2410_UDC_P_RESET\n", __func__);
+@@ -489,6 +728,310 @@ static struct s3c2410_hcd_info gta02_usb_info __initdata = {
+ },
+ };
+
++/* Touchscreen */
++static struct s3c2410_ts_mach_info gta02_ts_info = {
++ .delay = 10000,
++ .presc = 0xff, /* slow as we can go */
++ .oversampling_shift = 2,
++};
++
++/* Buttons */
++static struct gpio_keys_button gta02_buttons[] = {
++ {
++ .gpio = GTA02_GPIO_AUX_KEY,
++ .code = KEY_PHONE,
++ .desc = "Aux",
++ .type = EV_KEY,
++ .debounce_interval = 100,
++ },
++ {
++ .gpio = GTA02_GPIO_HOLD_KEY,
++ .code = KEY_PAUSE,
++ .desc = "Hold",
++ .type = EV_KEY,
++ .debounce_interval = 100,
++ },
++};
++
++static struct gpio_keys_platform_data gta02_buttons_pdata = {
++ .buttons = gta02_buttons,
++ .nbuttons = ARRAY_SIZE(gta02_buttons),
++};
++
++static struct platform_device gta02_buttons_device = {
++ .name = "gpio-keys",
++ .id = -1,
++ .dev = {
++ .platform_data = &gta02_buttons_pdata,
++ },
++};
++
++/* LEDs */
++static struct gpio_led gta02_gpio_leds[] = {
++ {
++ .name = "gta02:red:aux",
++ .gpio = GTA02_GPIO_AUX_LED,
++ },
++};
++
++static struct gpio_led_platform_data gta02_gpio_leds_pdata = {
++ .leds = gta02_gpio_leds,
++ .num_leds = ARRAY_SIZE(gta02_gpio_leds),
++};
++
++static struct platform_device gta02_leds_device = {
++ .name = "leds-gpio",
++ .id = -1,
++ .dev = {
++ .platform_data = &gta02_gpio_leds_pdata,
++ },
++};
++
++static inline int gta02_pwm_to_gpio(int pwm_id)
++{
++ return S3C2410_GPB(pwm_id);
++}
++
++static int gta02_pwm_led_init(struct device *dev, struct led_pwm *led)
++{
++ int ret;
++ int gpio = gta02_pwm_to_gpio(led->pwm_id);
++
++ ret = gpio_request(gpio, dev_name(dev));
++ if (ret)
++ return ret;
++
++ gpio_direction_output(gpio, 0);
++
++ return 0;
++}
++
++static enum led_brightness gta02_pwm_led_notify(struct device *dev,
++ struct led_pwm *led, enum led_brightness brightness)
++{
++ int gpio = gta02_pwm_to_gpio(led->pwm_id);
++
++ if (brightness == led->max_brightness || brightness == 0) {
++ s3c2410_gpio_cfgpin(gpio, S3C2410_GPIO_OUTPUT);
++ gpio_set_value(gpio, brightness ? 1 : 0);
++
++ brightness = 0;
++ } else {
++ s3c2410_gpio_cfgpin(gpio, S3C2410_GPIO_SFN2);
++ }
++
++ return brightness;
++}
++
++static void gta02_pwm_led_exit(struct device *dev, struct led_pwm *led)
++{
++ gpio_free(gta02_pwm_to_gpio(led->pwm_id));
++}
++
++static struct led_pwm gta02_pwm_leds[] = {
++ {
++ .name = "gta02:orange:power",
++ .max_brightness = 0xff,
++ .pwm_period_ns = 1000000,
++ .pwm_id = 0,
++ },
++ {
++ .name = "gta02:blue:power",
++ .max_brightness = 0xff,
++ .pwm_period_ns = 1000000,
++ .pwm_id = 1,
++ },
++ {
++ .name = "gta02::vibrator",
++ .max_brightness = 0x3f,
++ .pwm_period_ns = 60000000,
++ .pwm_id = 3,
++ }
++};
++
++static struct led_pwm_platform_data gta02_pwm_leds_pdata = {
++ .num_leds = ARRAY_SIZE(gta02_pwm_leds),
++ .leds = gta02_pwm_leds,
++
++ .init = gta02_pwm_led_init,
++ .notify = gta02_pwm_led_notify,
++ .exit = gta02_pwm_led_exit,
++};
++
++static struct platform_device gta02_pwm_leds_device = {
++ .name = "leds_pwm",
++ .id = -1,
++ .dev = {
++ .platform_data = &gta02_pwm_leds_pdata,
++ }
++};
++
++/* BQ27000 Battery */
++
++static struct bq27000_platform_data bq27000_pdata = {
++ .read = hdq_read,
++ .name = "battery",
++};
++
++static struct platform_device bq27000_battery_device = {
++ .name = "bq27000-battery",
++ .dev = {
++ .platform_data = &bq27000_pdata,
++ },
++};
++
++/* Platform battery */
++
++/* Capacity of a typical BL-5C dumb battery */
++#define GTA02_BAT_CHARGE_FULL 850000
++
++static int gta02_bat_voltscale(int volt)
++{
++ /* This table is suggested by SpeedEvil based on analysis of
++ * experimental data */
++ static const int lut[][2] = {
++ { 4120, 100 },
++ { 3900, 60 },
++ { 3740, 25 },
++ { 3600, 5 },
++ { 3000, 0 } };
++ int i, res = 0;
++
++ if (volt > lut[0][0])
++ res = lut[0][1];
++ else
++ for (i = 0; lut[i][1]; i++) {
++ if (volt <= lut[i][0] && volt >= lut[i+1][0]) {
++ res = lut[i][1] - (lut[i][0]-volt)*
++ (lut[i][1]-lut[i+1][1])/
++ (lut[i][0]-lut[i+1][0]);
++ break;
++ }
++ }
++ return res;
++}
++
++static int gta02_bat_get_voltage(void)
++{
++ struct pcf50633 *pcf = gta02_pcf;
++ u16 adc, mv = 0;
++ adc = pcf50633_adc_sync_read(pcf,
++ PCF50633_ADCC1_MUX_BATSNS_RES,
++ PCF50633_ADCC1_AVERAGE_16);
++ /* The formula from DS is for divide-by-two mode, current driver uses
++ divide-by-three */
++ mv = (adc * 6000) / 1023;
++ return mv * 1000;
++}
++
++static int gta02_bat_get_present(void)
++{
++ /* There is no reliable way to tell if it is present or not */
++ return 1;
++}
++
++static int gta02_bat_get_status(void)
++{
++#ifdef CONFIG_CHARGER_PCF50633
++ if (gta02_get_charger_active_status())
++ return POWER_SUPPLY_STATUS_CHARGING;
++ else
++ return POWER_SUPPLY_STATUS_DISCHARGING;
++#else
++ return POWER_SUPPLY_STATUS_UNKNOWN;
++#endif
++}
++
++static int gta02_bat_get_capacity(void)
++{
++ return gta02_bat_voltscale(gta02_bat_get_voltage()/1000);
++}
++
++static int gta02_bat_get_charge_full(void)
++{
++ return GTA02_BAT_CHARGE_FULL;
++}
++
++static int gta02_bat_get_charge_now(void)
++{
++ return gta02_bat_get_capacity() * gta02_bat_get_charge_full() / 100;
++}
++
++static enum power_supply_property gta02_platform_bat_properties[] = {
++ POWER_SUPPLY_PROP_PRESENT,
++ POWER_SUPPLY_PROP_STATUS,
++ POWER_SUPPLY_PROP_VOLTAGE_NOW,
++ POWER_SUPPLY_PROP_CAPACITY,
++ POWER_SUPPLY_PROP_CHARGE_FULL,
++ POWER_SUPPLY_PROP_CHARGE_NOW,
++};
++
++int (*gta02_platform_bat_get_property[])(void) = {
++ gta02_bat_get_present,
++ gta02_bat_get_status,
++ gta02_bat_get_voltage,
++ gta02_bat_get_capacity,
++ gta02_bat_get_charge_full,
++ gta02_bat_get_charge_now,
++};
++
++static struct platform_bat_platform_data gta02_platform_bat_pdata = {
++ .name = "battery",
++ .properties = gta02_platform_bat_properties,
++ .num_properties = ARRAY_SIZE(gta02_platform_bat_properties),
++ .get_property = gta02_platform_bat_get_property,
++ .is_present = gta02_bat_get_present,
++};
++
++struct platform_device gta02_platform_bat = {
++ .name = "platform_battery",
++ .id = -1,
++ .dev = {
++ .platform_data = &gta02_platform_bat_pdata,
++ }
++};
++
++/* HDQ */
++
++static void gta02_hdq_gpio_direction_out(void)
++{
++ s3c2410_gpio_cfgpin(GTA02v5_GPIO_HDQ, S3C2410_GPIO_OUTPUT);
++}
++
++static void gta02_hdq_gpio_direction_in(void)
++{
++ s3c2410_gpio_cfgpin(GTA02v5_GPIO_HDQ, S3C2410_GPIO_INPUT);
++}
++
++static void gta02_hdq_gpio_set_value(int val)
++{
++ s3c2410_gpio_setpin(GTA02v5_GPIO_HDQ, val);
++}
++
++static int gta02_hdq_gpio_get_value(void)
++{
++ return s3c2410_gpio_getpin(GTA02v5_GPIO_HDQ);
++}
++
++struct hdq_platform_data gta02_hdq_platform_data = {
++ .gpio_dir_out = gta02_hdq_gpio_direction_out,
++ .gpio_dir_in = gta02_hdq_gpio_direction_in,
++ .gpio_set = gta02_hdq_gpio_set_value,
++ .gpio_get = gta02_hdq_gpio_get_value,
++
++ .enable_fiq = gta02_fiq_enable,
++ .disable_fiq = gta02_fiq_disable,
++ .kick_fiq = gta02_fiq_kick,
++};
++
++struct platform_device gta02_hdq_device = {
++ .name = "hdq",
++ .id = -1,
++ .dev = {
++ .platform_data = &gta02_hdq_platform_data,
++ .parent = &s3c_device_timer[2].dev,
++ },
++};
+
+ static void __init gta02_map_io(void)
+ {
+@@ -507,14 +1050,29 @@ static struct platform_device *gta02_devices[] __initdata = {
+ &s3c_device_usbgadget,
+ &s3c_device_nand,
+ &gta02_nor_flash,
+- &s3c24xx_pwm_device,
++ &s3c_device_timer[0],
++ &s3c_device_timer[1],
++ &s3c_device_timer[2],
++ &s3c_device_timer[3],
+ &s3c_device_iis,
++ &s3c_device_pcm,
+ &s3c_device_i2c0,
++ &gta02_buttons_device,
++ &gta02_leds_device,
++ &gta02_pwm_leds_device,
++ &gta02_pm_gps_dev,
++ &gta02_pm_bt_dev,
++ &gta02_pm_wlan_dev,
++ &gta02_glamo_dev,
++ &s3c_device_adc,
++ &s3c_device_ts,
+ };
+
+ /* These guys DO need to be children of PMU. */
+
+ static struct platform_device *gta02_devices_pmu_children[] = {
++ &gta02_hdq_device,
++ &gta02_platform_bat,
+ };
+
+
+@@ -540,6 +1098,8 @@ static void gta02_pmu_attach_child_devices(struct pcf50633 *pcf)
+
+ platform_add_devices(gta02_devices_pmu_children,
+ ARRAY_SIZE(gta02_devices_pmu_children));
++
++ regulator_has_full_constraints();
+ }
+
+ static void gta02_poweroff(void)
+@@ -547,11 +1107,125 @@ static void gta02_poweroff(void)
+ pcf50633_reg_set_bit_mask(gta02_pcf, PCF50633_REG_OOCSHDWN, 1, 1);
+ }
+
++struct gta02_device_children {
++ const char *dev_name;
++ size_t num_children;
++ struct platform_device **children;
++ void (*probed_callback)(struct device *dev);
++};
++
++static struct platform_device* gta02_pcf50633_gpio_children[] = {
++ &gta02_gsm_supply_device,
++};
++
++static struct platform_device* gta02_gsm_supply_children[] = {
++ &gta02_pm_gsm_dev,
++};
++
++static struct platform_device* gta02_hdq_children[] = {
++ &bq27000_battery_device,
++};
++
++
++static struct gta02_device_children gta02_device_children[] = {
++ {
++ .dev_name = "pcf50633-gpio.0",
++ .num_children = 1,
++ .children = gta02_pcf50633_gpio_children,
++ },
++ {
++ .dev_name = "reg-fixed-voltage.1",
++ .num_children = 1,
++ .children = gta02_gsm_supply_children,
++ },
++ {
++ .dev_name = "spi2.0",
++ .probed_callback = gta02_jbt6k74_probe_completed,
++ },
++ {
++ .dev_name = "hdq",
++ .num_children = 1,
++ .children = gta02_hdq_children,
++ },
++};
++
++static int gta02_add_child_devices(struct device *parent,
++ struct platform_device **children,
++ size_t num_children)
++{
++ size_t i;
++
++ for (i = 0; i < num_children; ++i)
++ children[i]->dev.parent = parent;
++
++ return platform_add_devices(children, num_children);
++}
++
++static int gta02_device_registered(struct notifier_block *block,
++ unsigned long action, void *data)
++{
++ struct device *dev = data;
++ const char *devname = dev_name(dev);
++ size_t i;
++
++ if (action != BUS_NOTIFY_BOUND_DRIVER)
++ return 0;
++
++ for (i = 0; i < ARRAY_SIZE(gta02_device_children); ++i) {
++ if (strcmp(devname, gta02_device_children[i].dev_name) == 0) {
++ gta02_add_child_devices(dev, gta02_device_children[i].children,
++ gta02_device_children[i].num_children);
++
++ if (gta02_device_children[i].probed_callback)
++ gta02_device_children[i].probed_callback(dev);
++ break;
++ }
++ }
++
++ return 0;
++}
++
++static struct notifier_block gta02_device_register_notifier = {
++ .notifier_call = gta02_device_registered,
++ .priority = INT_MAX,
++};
++
++
++/*
++ * Allow the bootloader to enable hw ecc
++ * hardware_ecc=1|0
++ */
++static int __init hardware_ecc_setup(char *str)
++{
++ if (str && str[0] == '1')
++ gta02_nand_info.software_ecc = 0;
++ return 1;
++}
++__setup("hardware_ecc=", hardware_ecc_setup);
++
++static void gta02_request_gpios(void)
++{
++ int ret;
++ ret = gpio_request(GTA02_GPIO_USB_PULLUP, "USB pullup");
++ if (ret) {
++ printk(KERN_ERR "Failed to request USB pullup gpio pin: %d\n", ret);
++ } else {
++ ret = gpio_direction_output(GTA02_GPIO_USB_PULLUP, 0);
++ if (ret)
++ printk(KERN_ERR "Failed to set USB pullup gpio direction: %d\n", ret);
++ }
++}
++
+ static void __init gta02_machine_init(void)
+ {
+ /* Set the panic callback to turn AUX LED on or off. */
+ panic_blink = gta02_panic_blink;
+
++ bus_register_notifier(&platform_bus_type, &gta02_device_register_notifier);
++ bus_register_notifier(&spi_bus_type, &gta02_device_register_notifier);
++
++ gta02_request_gpios();
++
+ s3c_pm_init();
+
+ #ifdef CONFIG_CHARGER_PCF50633
+@@ -559,13 +1233,17 @@ static void __init gta02_machine_init(void)
+ #endif
+
+ s3c24xx_udc_set_platdata(&gta02_udc_cfg);
++ s3c24xx_ts_set_platdata(&gta02_ts_info);
+ s3c_ohci_set_platdata(&gta02_usb_info);
+ s3c_nand_set_platdata(&gta02_nand_info);
+ s3c_i2c0_set_platdata(NULL);
++ spi_register_board_info(gta02_spi_board_info,
++ ARRAY_SIZE(gta02_spi_board_info));
+
+ i2c_register_board_info(0, gta02_i2c_devs, ARRAY_SIZE(gta02_i2c_devs));
+
+ platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices));
++
+ pm_power_off = gta02_poweroff;
+ }
+
+diff --git a/arch/arm/plat-s3c24xx/gpiolib.c b/arch/arm/plat-s3c24xx/gpiolib.c
+index 243b641..72fa584 100644
+--- a/arch/arm/plat-s3c24xx/gpiolib.c
++++ b/arch/arm/plat-s3c24xx/gpiolib.c
+@@ -217,6 +217,8 @@ static __init int s3c24xx_gpiolib_init(void)
+ int gpn;
+
+ for (gpn = 0; gpn < ARRAY_SIZE(s3c24xx_gpios); gpn++, chip++) {
++ if (chip->chip.base >= S3C_GPIO_END)
++ break;
+ if (!chip->config)
+ chip->config = &s3c24xx_gpiocfg_default;
+
+diff --git a/arch/arm/plat-s3c24xx/include/plat/irq.h b/arch/arm/plat-s3c24xx/include/plat/irq.h
+index 69e1be8..11a8664 100644
+--- a/arch/arm/plat-s3c24xx/include/plat/irq.h
++++ b/arch/arm/plat-s3c24xx/include/plat/irq.h
+@@ -12,6 +12,7 @@
+
+ #include <linux/io.h>
+
++#include <mach/irqs.h>
+ #include <mach/hardware.h>
+ #include <mach/regs-irq.h>
+ #include <mach/regs-gpio.h>
+@@ -31,8 +32,15 @@ s3c_irqsub_mask(unsigned int irqno, unsigned int parentbit,
+ {
+ unsigned long mask;
+ unsigned long submask;
++#ifdef CONFIG_S3C2440_C_FIQ
++ unsigned long flags;
++#endif
+
+ submask = __raw_readl(S3C2410_INTSUBMSK);
++#ifdef CONFIG_S3C2440_C_FIQ
++ local_save_flags(flags);
++ local_fiq_disable();
++#endif
+ mask = __raw_readl(S3C2410_INTMSK);
+
+ submask |= (1UL << (irqno - IRQ_S3CUART_RX0));
+@@ -45,6 +53,9 @@ s3c_irqsub_mask(unsigned int irqno, unsigned int parentbit,
+
+ /* write back masks */
+ __raw_writel(submask, S3C2410_INTSUBMSK);
++#ifdef CONFIG_S3C2440_C_FIQ
++ local_irq_restore(flags);
++#endif
+
+ }
+
+@@ -53,8 +64,15 @@ s3c_irqsub_unmask(unsigned int irqno, unsigned int parentbit)
+ {
+ unsigned long mask;
+ unsigned long submask;
++#ifdef CONFIG_S3C2440_C_FIQ
++ unsigned long flags;
++#endif
+
+ submask = __raw_readl(S3C2410_INTSUBMSK);
++#ifdef CONFIG_S3C2440_C_FIQ
++ local_save_flags(flags);
++ local_fiq_disable();
++#endif
+ mask = __raw_readl(S3C2410_INTMSK);
+
+ submask &= ~(1UL << (irqno - IRQ_S3CUART_RX0));
+@@ -63,6 +81,9 @@ s3c_irqsub_unmask(unsigned int irqno, unsigned int parentbit)
+ /* write back masks */
+ __raw_writel(submask, S3C2410_INTSUBMSK);
+ __raw_writel(mask, S3C2410_INTMSK);
++#ifdef CONFIG_S3C2440_C_FIQ
++ local_irq_restore(flags);
++#endif
+ }
+
+
+diff --git a/arch/arm/plat-s3c24xx/irq.c b/arch/arm/plat-s3c24xx/irq.c
+index ad0d44e..0a8553b 100644
+--- a/arch/arm/plat-s3c24xx/irq.c
++++ b/arch/arm/plat-s3c24xx/irq.c
+@@ -28,6 +28,8 @@
+ #include <asm/mach/irq.h>
+
+ #include <plat/regs-irqtype.h>
++#include <mach/regs-irq.h>
++#include <mach/regs-gpio.h>
+
+ #include <plat/cpu.h>
+ #include <plat/pm.h>
+@@ -37,12 +39,20 @@ static void
+ s3c_irq_mask(unsigned int irqno)
+ {
+ unsigned long mask;
+-
++#ifdef CONFIG_S3C2440_C_FIQ
++ unsigned long flags;
++#endif
+ irqno -= IRQ_EINT0;
+-
++#ifdef CONFIG_S3C2440_C_FIQ
++ local_save_flags(flags);
++ local_fiq_disable();
++#endif
+ mask = __raw_readl(S3C2410_INTMSK);
+ mask |= 1UL << irqno;
+ __raw_writel(mask, S3C2410_INTMSK);
++#ifdef CONFIG_S3C2440_C_FIQ
++ local_irq_restore(flags);
++#endif
+ }
+
+ static inline void
+@@ -59,9 +69,19 @@ s3c_irq_maskack(unsigned int irqno)
+ {
+ unsigned long bitval = 1UL << (irqno - IRQ_EINT0);
+ unsigned long mask;
++#ifdef CONFIG_S3C2440_C_FIQ
++ unsigned long flags;
++#endif
+
++#ifdef CONFIG_S3C2440_C_FIQ
++ local_save_flags(flags);
++ local_fiq_disable();
++#endif
+ mask = __raw_readl(S3C2410_INTMSK);
+ __raw_writel(mask|bitval, S3C2410_INTMSK);
++#ifdef CONFIG_S3C2440_C_FIQ
++ local_irq_restore(flags);
++#endif
+
+ __raw_writel(bitval, S3C2410_SRCPND);
+ __raw_writel(bitval, S3C2410_INTPND);
+@@ -72,15 +92,25 @@ static void
+ s3c_irq_unmask(unsigned int irqno)
+ {
+ unsigned long mask;
++#ifdef CONFIG_S3C2440_C_FIQ
++ unsigned long flags;
++#endif
+
+ if (irqno != IRQ_TIMER4 && irqno != IRQ_EINT8t23)
+ irqdbf2("s3c_irq_unmask %d\n", irqno);
+
+ irqno -= IRQ_EINT0;
+
++#ifdef CONFIG_S3C2440_C_FIQ
++ local_save_flags(flags);
++ local_fiq_disable();
++#endif
+ mask = __raw_readl(S3C2410_INTMSK);
+ mask &= ~(1UL << irqno);
+ __raw_writel(mask, S3C2410_INTMSK);
++#ifdef CONFIG_S3C2440_C_FIQ
++ local_irq_restore(flags);
++#endif
+ }
+
+ struct irq_chip s3c_irq_level_chip = {
+@@ -561,26 +591,26 @@ void __init s3c24xx_init_irq(void)
+
+ last = 0;
+ for (i = 0; i < 4; i++) {
+- pend = __raw_readl(S3C2410_INTPND);
++ pend = __raw_readl(S3C2410_SUBSRCPND);
+
+ if (pend == 0 || pend == last)
+ break;
+
+- __raw_writel(pend, S3C2410_SRCPND);
+- __raw_writel(pend, S3C2410_INTPND);
+- printk("irq: clearing pending status %08x\n", (int)pend);
++ printk("irq: clearing subpending status %08x\n", (int)pend);
++ __raw_writel(pend, S3C2410_SUBSRCPND);
+ last = pend;
+ }
+
+ last = 0;
+ for (i = 0; i < 4; i++) {
+- pend = __raw_readl(S3C2410_SUBSRCPND);
++ pend = __raw_readl(S3C2410_INTPND);
+
+ if (pend == 0 || pend == last)
+ break;
+
+- printk("irq: clearing subpending status %08x\n", (int)pend);
+- __raw_writel(pend, S3C2410_SUBSRCPND);
++ __raw_writel(pend, S3C2410_SRCPND);
++ __raw_writel(pend, S3C2410_INTPND);
++ printk("irq: clearing pending status %08x\n", (int)pend);
+ last = pend;
+ }
+
+@@ -631,15 +661,13 @@ void __init s3c24xx_init_irq(void)
+
+ for (irqno = IRQ_EINT0; irqno <= IRQ_EINT3; irqno++) {
+ irqdbf("registering irq %d (ext int)\n", irqno);
+- set_irq_chip(irqno, &s3c_irq_eint0t4);
+- set_irq_handler(irqno, handle_edge_irq);
++ set_irq_chip_and_handler(irqno, &s3c_irq_eint0t4, handle_level_irq);
+ set_irq_flags(irqno, IRQF_VALID);
+ }
+
+ for (irqno = IRQ_EINT4; irqno <= IRQ_EINT23; irqno++) {
+ irqdbf("registering irq %d (extended s3c irq)\n", irqno);
+- set_irq_chip(irqno, &s3c_irqext_chip);
+- set_irq_handler(irqno, handle_edge_irq);
++ set_irq_chip_and_handler(irqno, &s3c_irqext_chip, handle_level_irq);
+ set_irq_flags(irqno, IRQF_VALID);
+ }
+
+diff --git a/arch/arm/plat-samsung/include/plat/nand.h b/arch/arm/plat-samsung/include/plat/nand.h
+index b64115f..cbdc8f0 100644
+--- a/arch/arm/plat-samsung/include/plat/nand.h
++++ b/arch/arm/plat-samsung/include/plat/nand.h
+@@ -49,6 +49,7 @@ struct s3c2410_platform_nand {
+ int twrph1; /* time for release CLE/ALE from nWE/nOE inactive */
+
+ unsigned int ignore_unset_ecc:1;
++ unsigned int software_ecc:1; /* force software ecc at runtime */
+
+ int nr_sets;
+ struct s3c2410_nand_set *sets;
+diff --git a/arch/arm/plat-samsung/include/plat/uncompress.h b/arch/arm/plat-samsung/include/plat/uncompress.h
+index 7d6ed72..152c496 100644
+--- a/arch/arm/plat-samsung/include/plat/uncompress.h
++++ b/arch/arm/plat-samsung/include/plat/uncompress.h
+@@ -37,6 +37,8 @@ static void arch_detect_cpu(void);
+ /* how many bytes we allow into the FIFO at a time in FIFO mode */
+ #define FIFO_MAX (14)
+
++#if CONFIG_S3C_LOWLEVEL_UART_PORT >= 0
++
+ #define uart_base S3C_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT)
+
+ static __inline__ void
+@@ -86,10 +88,6 @@ static void putc(int ch)
+ uart_wr(S3C2410_UTXH, ch);
+ }
+
+-static inline void flush(void)
+-{
+-}
+-
+ #define __raw_writel(d, ad) \
+ do { \
+ *((volatile unsigned int __force *)(ad)) = (d); \
+@@ -161,6 +159,19 @@ static inline void arch_enable_uart_fifo(void)
+ #define arch_enable_uart_fifo() do { } while(0)
+ #endif
+
++#else
++static inline void putc(int ch)
++{
++}
++
++#define arch_enable_uart_fifo() do { } while(0)
++#define arch_decomp_wdog_start()
++#define arch_decomp_wdog()
++#endif
++
++static inline void flush(void)
++{
++}
+
+ static void
+ arch_decomp_setup(void)
+diff --git a/drivers/Kconfig b/drivers/Kconfig
+index a2b902f..a211562 100644
+--- a/drivers/Kconfig
++++ b/drivers/Kconfig
+@@ -111,4 +111,6 @@ source "drivers/xen/Kconfig"
+ source "drivers/staging/Kconfig"
+
+ source "drivers/platform/Kconfig"
++
++source "drivers/ar6000/Kconfig"
+ endmenu
+diff --git a/drivers/Makefile b/drivers/Makefile
+index f3ebb30..fdfe5bd 100644
+--- a/drivers/Makefile
++++ b/drivers/Makefile
+@@ -95,6 +95,7 @@ obj-$(CONFIG_CPU_IDLE) += cpuidle/
+ obj-$(CONFIG_DMA_ENGINE) += dma/
+ obj-$(CONFIG_MMC) += mmc/
+ obj-$(CONFIG_MEMSTICK) += memstick/
++obj-$(CONFIG_AR6000_WLAN) += ar6000/
+ obj-$(CONFIG_NEW_LEDS) += leds/
+ obj-$(CONFIG_INFINIBAND) += infiniband/
+ obj-$(CONFIG_SGI_SN) += sn/
+diff --git a/drivers/ar6000/Kconfig b/drivers/ar6000/Kconfig
+new file mode 100644
+index 0000000..29b28b8
+--- /dev/null
++++ b/drivers/ar6000/Kconfig
+@@ -0,0 +1,32 @@
++config AR6000_WLAN
++ tristate "AR6000 wireless networking over SDIO"
++ depends on MMC
++ select WIRELESS_EXT
++ select WEXT_PRIV
++ default m
++ help
++ good luck.
++
++config AR6000_WLAN_DEBUG
++ bool "Enable retrieval of firmware debugging information"
++ depends on AR6000_WLAN
++ default n
++ help
++ The AR6k firmware maintains a log of debugging events that
++ gets flushed to the host on various occasions. Retrieval of
++ this data is very slow, taking several seconds.
++
++ If in doubt, say N.
++
++config AR6000_WLAN_RESET
++ bool "Soft-reset when shutting down"
++ depends on AR6000_WLAN
++ default n
++ help
++ The AR6k module can be explicitly reset when shutting down
++ the device. This adds a delay of about two seconds to suspend,
++ module removal, and so on. Since the WLAN SDIO function is
++ generally disabled soon thereafter anyway, this reset seems
++ superfluous.
++
++ If in doubt, say N.
+diff --git a/drivers/ar6000/Makefile b/drivers/ar6000/Makefile
+new file mode 100644
+index 0000000..f8f4431
+--- /dev/null
++++ b/drivers/ar6000/Makefile
+@@ -0,0 +1,38 @@
++REV ?= 2
++
++PWD := $(shell pwd)
++
++EXTRA_CFLAGS += -I$(src)/include
++
++EXTRA_CFLAGS += -DLINUX -D__KERNEL__ -DHTC_RAW_INTERFACE\
++ -DTCMD -DUSER_KEYS \
++ -DNO_SYNC_FLUSH #\
++ -DMULTIPLE_FRAMES_PER_INTERRUPT -DAR6000REV$(REV) \
++ -DBLOCK_TX_PATH_FLAG \
++ -DSDIO \
++
++EXTRA_CFLAGS += -DKERNEL_2_6
++
++obj-$(CONFIG_AR6000_WLAN) += ar6000.o
++
++ar6000-objs += htc/ar6k.o \
++ htc/ar6k_events.o \
++ htc/htc_send.o \
++ htc/htc_recv.o \
++ htc/htc_services.o \
++ htc/htc.o \
++ hif/hif2.o \
++ bmi/bmi.o \
++ ar6000/ar6000_drv.o \
++ ar6000/ar6000_raw_if.o \
++ ar6000/netbuf.o \
++ ar6000/wireless_ext.o \
++ ar6000/ioctl.o \
++ miscdrv/common_drv.o \
++ miscdrv/credit_dist.o \
++ wmi/wmi.o \
++ wlan/wlan_node.o \
++ wlan/wlan_recv_beacon.o \
++ wlan/wlan_utils.o
++
++
+diff --git a/drivers/ar6000/ar6000/ar6000_drv.c b/drivers/ar6000/ar6000/ar6000_drv.c
+new file mode 100644
+index 0000000..90533ab
+--- /dev/null
++++ b/drivers/ar6000/ar6000/ar6000_drv.c
+@@ -0,0 +1,3129 @@
++/*
++ *
++ * Copyright (c) 2004-2007 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation;
++ *
++ * Software distributed under the License is distributed on an "AS
++ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
++ * implied. See the License for the specific language governing
++ * rights and limitations under the License.
++ *
++ *
++ *
++ */
++
++/*
++ * This driver is a pseudo ethernet driver to access the Atheros AR6000
++ * WLAN Device
++ */
++static const char athId[] __attribute__ ((unused)) = "$Id: //depot/sw/releases/olca2.0-GPL/host/os/linux/ar6000_drv.c#2 $";
++
++#include "ar6000_drv.h"
++#include "htc.h"
++
++MODULE_LICENSE("GPL and additional rights");
++
++#ifndef REORG_APTC_HEURISTICS
++#undef ADAPTIVE_POWER_THROUGHPUT_CONTROL
++#endif /* REORG_APTC_HEURISTICS */
++
++#ifdef ADAPTIVE_POWER_THROUGHPUT_CONTROL
++#define APTC_TRAFFIC_SAMPLING_INTERVAL 100 /* msec */
++#define APTC_UPPER_THROUGHPUT_THRESHOLD 3000 /* Kbps */
++#define APTC_LOWER_THROUGHPUT_THRESHOLD 2000 /* Kbps */
++
++typedef struct aptc_traffic_record {
++ A_BOOL timerScheduled;
++ struct timeval samplingTS;
++ unsigned long bytesReceived;
++ unsigned long bytesTransmitted;
++} APTC_TRAFFIC_RECORD;
++
++A_TIMER aptcTimer;
++APTC_TRAFFIC_RECORD aptcTR;
++#endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */
++
++unsigned int bypasswmi = 0;
++unsigned int debuglevel = 0;
++int tspecCompliance = 1;
++unsigned int busspeedlow = 0;
++unsigned int onebitmode = 0;
++unsigned int skipflash = 0;
++unsigned int wmitimeout = 2;
++unsigned int wlanNodeCaching = 1;
++unsigned int enableuartprint = 0;
++unsigned int logWmiRawMsgs = 0;
++unsigned int enabletimerwar = 0;
++unsigned int mbox_yield_limit = 99;
++int reduce_credit_dribble = 1 + HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_ONE_HALF;
++int allow_trace_signal = 0;
++#ifdef CONFIG_HOST_TCMD_SUPPORT
++unsigned int testmode =0;
++#endif
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
++module_param(bypasswmi, int, 0644);
++module_param(debuglevel, int, 0644);
++module_param(tspecCompliance, int, 0644);
++module_param(onebitmode, int, 0644);
++module_param(busspeedlow, int, 0644);
++module_param(skipflash, int, 0644);
++module_param(wmitimeout, int, 0644);
++module_param(wlanNodeCaching, int, 0644);
++module_param(logWmiRawMsgs, int, 0644);
++module_param(enableuartprint, int, 0644);
++module_param(enabletimerwar, int, 0644);
++module_param(mbox_yield_limit, int, 0644);
++module_param(reduce_credit_dribble, int, 0644);
++module_param(allow_trace_signal, int, 0644);
++#ifdef CONFIG_HOST_TCMD_SUPPORT
++module_param(testmode, int, 0644);
++#endif
++#else
++
++#define __user
++/* for linux 2.4 and lower */
++MODULE_PARM(bypasswmi,"i");
++MODULE_PARM(debuglevel, "i");
++MODULE_PARM(onebitmode,"i");
++MODULE_PARM(busspeedlow, "i");
++MODULE_PARM(skipflash, "i");
++MODULE_PARM(wmitimeout, "i");
++MODULE_PARM(wlanNodeCaching, "i");
++MODULE_PARM(enableuartprint,"i");
++MODULE_PARM(logWmiRawMsgs, "i");
++MODULE_PARM(enabletimerwar,"i");
++MODULE_PARM(mbox_yield_limit,"i");
++MODULE_PARM(reduce_credit_dribble,"i");
++MODULE_PARM(allow_trace_signal,"i");
++#ifdef CONFIG_HOST_TCMD_SUPPORT
++MODULE_PARM(testmode, "i");
++#endif
++#endif
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
++/* in 2.6.10 and later this is now a pointer to a uint */
++unsigned int _mboxnum = HTC_MAILBOX_NUM_MAX;
++#define mboxnum &_mboxnum
++#else
++unsigned int mboxnum = HTC_MAILBOX_NUM_MAX;
++#endif
++
++#ifdef CONFIG_AR6000_WLAN_RESET
++unsigned int resetok = 1;
++#else
++unsigned int resetok = 0;
++#endif
++
++#ifdef DEBUG
++A_UINT32 g_dbg_flags = DBG_DEFAULTS;
++unsigned int debugflags = 0;
++int debugdriver = 1;
++unsigned int debughtc = 128;
++unsigned int debugbmi = 1;
++unsigned int debughif = 2;
++unsigned int txcreditsavailable[HTC_MAILBOX_NUM_MAX] = {0};
++unsigned int txcreditsconsumed[HTC_MAILBOX_NUM_MAX] = {0};
++unsigned int txcreditintrenable[HTC_MAILBOX_NUM_MAX] = {0};
++unsigned int txcreditintrenableaggregate[HTC_MAILBOX_NUM_MAX] = {0};
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
++module_param(debugflags, int, 0644);
++module_param(debugdriver, int, 0644);
++module_param(debughtc, int, 0644);
++module_param(debugbmi, int, 0644);
++module_param(debughif, int, 0644);
++module_param(resetok, int, 0644);
++module_param_array(txcreditsavailable, int, mboxnum, 0644);
++module_param_array(txcreditsconsumed, int, mboxnum, 0644);
++module_param_array(txcreditintrenable, int, mboxnum, 0644);
++module_param_array(txcreditintrenableaggregate, int, mboxnum, 0644);
++#else
++/* linux 2.4 and lower */
++MODULE_PARM(debugflags,"i");
++MODULE_PARM(debugdriver, "i");
++MODULE_PARM(debughtc, "i");
++MODULE_PARM(debugbmi, "i");
++MODULE_PARM(debughif, "i");
++MODULE_PARM(resetok, "i");
++MODULE_PARM(txcreditsavailable, "0-3i");
++MODULE_PARM(txcreditsconsumed, "0-3i");
++MODULE_PARM(txcreditintrenable, "0-3i");
++MODULE_PARM(txcreditintrenableaggregate, "0-3i");
++#endif
++
++#endif /* DEBUG */
++
++unsigned int tx_attempt[HTC_MAILBOX_NUM_MAX] = {0};
++unsigned int tx_post[HTC_MAILBOX_NUM_MAX] = {0};
++unsigned int tx_complete[HTC_MAILBOX_NUM_MAX] = {0};
++unsigned int hifBusRequestNumMax = 40;
++unsigned int war23838_disabled = 0;
++#ifdef ADAPTIVE_POWER_THROUGHPUT_CONTROL
++unsigned int enableAPTCHeuristics = 1;
++#endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
++module_param_array(tx_attempt, int, mboxnum, 0644);
++module_param_array(tx_post, int, mboxnum, 0644);
++module_param_array(tx_complete, int, mboxnum, 0644);
++module_param(hifBusRequestNumMax, int, 0644);
++module_param(war23838_disabled, int, 0644);
++#ifdef ADAPTIVE_POWER_THROUGHPUT_CONTROL
++module_param(enableAPTCHeuristics, int, 0644);
++#endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */
++#else
++MODULE_PARM(tx_attempt, "0-3i");
++MODULE_PARM(tx_post, "0-3i");
++MODULE_PARM(tx_complete, "0-3i");
++MODULE_PARM(hifBusRequestNumMax, "i");
++MODULE_PARM(war23838_disabled, "i");
++#ifdef ADAPTIVE_POWER_THROUGHPUT_CONTROL
++MODULE_PARM(enableAPTCHeuristics, "i");
++#endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */
++#endif
++
++#ifdef BLOCK_TX_PATH_FLAG
++int blocktx = 0;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
++module_param(blocktx, int, 0644);
++#else
++MODULE_PARM(blocktx, "i");
++#endif
++#endif /* BLOCK_TX_PATH_FLAG */
++
++// TODO move to arsoft_c
++USER_RSSI_THOLD rssi_map[12];
++
++int reconnect_flag = 0;
++
++DECLARE_WAIT_QUEUE_HEAD(ar6000_scan_queue);
++
++/* Function declarations */
++static int ar6000_init_module(void);
++static void ar6000_cleanup_module(void);
++
++int ar6000_init(struct net_device *dev);
++static int ar6000_open(struct net_device *dev);
++static int ar6000_close(struct net_device *dev);
++static int ar6000_cleanup(struct net_device *dev);
++static void ar6000_init_control_info(AR_SOFTC_T *ar);
++static int ar6000_data_tx(struct sk_buff *skb, struct net_device *dev);
++
++static void ar6000_destroy(struct net_device *dev, unsigned int unregister);
++static void ar6000_detect_error(unsigned long ptr);
++static struct net_device_stats *ar6000_get_stats(struct net_device *dev);
++static struct iw_statistics *ar6000_get_iwstats(struct net_device * dev);
++
++/*
++ * HTC service connection handlers
++ */
++static void ar6000_avail_ev(HTC_HANDLE HTCHandle);
++
++static void ar6000_unavail_ev(void *Instance);
++
++static void ar6000_target_failure(void *Instance, A_STATUS Status);
++
++static void ar6000_rx(void *Context, HTC_PACKET *pPacket);
++
++static void ar6000_rx_refill(void *Context,HTC_ENDPOINT_ID Endpoint);
++
++static void ar6000_tx_complete(void *Context, HTC_PACKET *pPacket);
++
++static void ar6000_tx_queue_full(void *Context, HTC_ENDPOINT_ID Endpoint);
++
++static void ar6000_tx_queue_avail(void *Context, HTC_ENDPOINT_ID Endpoint);
++
++/*
++ * Static variables
++ */
++
++static struct net_device *ar6000_devices[MAX_AR6000];
++extern struct iw_handler_def ath_iw_handler_def;
++DECLARE_WAIT_QUEUE_HEAD(arEvent);
++static void ar6000_cookie_init(AR_SOFTC_T *ar);
++static void ar6000_cookie_cleanup(AR_SOFTC_T *ar);
++static void ar6000_free_cookie(AR_SOFTC_T *ar, struct ar_cookie * cookie);
++static struct ar_cookie *ar6000_alloc_cookie(AR_SOFTC_T *ar);
++static void ar6000_TxDataCleanup(AR_SOFTC_T *ar);
++
++#ifdef USER_KEYS
++static A_STATUS ar6000_reinstall_keys(AR_SOFTC_T *ar,A_UINT8 key_op_ctrl);
++#endif
++
++
++static struct ar_cookie s_ar_cookie_mem[MAX_COOKIE_NUM];
++
++#define HOST_INTEREST_ITEM_ADDRESS(ar, item) \
++((ar->arTargetType == TARGET_TYPE_AR6001) ? \
++ AR6001_HOST_INTEREST_ITEM_ADDRESS(item) : \
++ AR6002_HOST_INTEREST_ITEM_ADDRESS(item))
++
++
++/* Debug log support */
++
++/*
++ * Flag to govern whether the debug logs should be parsed in the kernel
++ * or reported to the application.
++ */
++#ifdef DEBUG
++#define REPORT_DEBUG_LOGS_TO_APP
++#endif
++
++A_STATUS
++ar6000_set_host_app_area(AR_SOFTC_T *ar)
++{
++ A_UINT32 address, data;
++ struct host_app_area_s host_app_area;
++
++ /* Fetch the address of the host_app_area_s instance in the host interest area */
++ address = HOST_INTEREST_ITEM_ADDRESS(ar, hi_app_host_interest);
++ if (ar6000_ReadRegDiag(ar->arHifDevice, &address, &data) != A_OK) {
++ return A_ERROR;
++ }
++ address = data;
++ host_app_area.wmi_protocol_ver = WMI_PROTOCOL_VERSION;
++ if (ar6000_WriteDataDiag(ar->arHifDevice, address,
++ (A_UCHAR *)&host_app_area,
++ sizeof(struct host_app_area_s)) != A_OK)
++ {
++ return A_ERROR;
++ }
++
++ return A_OK;
++}
++
++A_UINT32
++dbglog_get_debug_hdr_ptr(AR_SOFTC_T *ar)
++{
++ A_UINT32 param;
++ A_UINT32 address;
++ A_STATUS status;
++
++ address = HOST_INTEREST_ITEM_ADDRESS(ar, hi_dbglog_hdr);
++ if ((status = ar6000_ReadDataDiag(ar->arHifDevice, address,
++ (A_UCHAR *)&param, 4)) != A_OK)
++ {
++ param = 0;
++ }
++
++ return param;
++}
++
++/*
++ * The dbglog module has been initialized. Its ok to access the relevant
++ * data stuctures over the diagnostic window.
++ */
++void
++ar6000_dbglog_init_done(AR_SOFTC_T *ar)
++{
++ ar->dbglog_init_done = TRUE;
++}
++
++A_UINT32
++dbglog_get_debug_fragment(A_INT8 *datap, A_UINT32 len, A_UINT32 limit)
++{
++ A_INT32 *buffer;
++ A_UINT32 count;
++ A_UINT32 numargs;
++ A_UINT32 length;
++ A_UINT32 fraglen;
++
++ count = fraglen = 0;
++ buffer = (A_INT32 *)datap;
++ length = (limit >> 2);
++
++ if (len <= limit) {
++ fraglen = len;
++ } else {
++ while (count < length) {
++ numargs = DBGLOG_GET_NUMARGS(buffer[count]);
++ fraglen = (count << 2);
++ count += numargs + 1;
++ }
++ }
++
++ return fraglen;
++}
++
++void
++dbglog_parse_debug_logs(A_INT8 *datap, A_UINT32 len)
++{
++ A_INT32 *buffer;
++ A_UINT32 count;
++ A_UINT32 timestamp;
++ A_UINT32 debugid;
++ A_UINT32 moduleid;
++ A_UINT32 numargs;
++ A_UINT32 length;
++
++ count = 0;
++ buffer = (A_INT32 *)datap;
++ length = (len >> 2);
++ while (count < length) {
++ debugid = DBGLOG_GET_DBGID(buffer[count]);
++ moduleid = DBGLOG_GET_MODULEID(buffer[count]);
++ numargs = DBGLOG_GET_NUMARGS(buffer[count]);
++ timestamp = DBGLOG_GET_TIMESTAMP(buffer[count]);
++ switch (numargs) {
++ case 0:
++ AR_DEBUG_PRINTF("%d %d (%d)\n", moduleid, debugid, timestamp);
++ break;
++
++ case 1:
++ AR_DEBUG_PRINTF("%d %d (%d): 0x%x\n", moduleid, debugid,
++ timestamp, buffer[count+1]);
++ break;
++
++ case 2:
++ AR_DEBUG_PRINTF("%d %d (%d): 0x%x, 0x%x\n", moduleid, debugid,
++ timestamp, buffer[count+1], buffer[count+2]);
++ break;
++
++ default:
++ AR_DEBUG_PRINTF("Invalid args: %d\n", numargs);
++ }
++ count += numargs + 1;
++ }
++}
++
++int
++ar6000_dbglog_get_debug_logs(AR_SOFTC_T *ar)
++{
++ struct dbglog_hdr_s debug_hdr;
++ struct dbglog_buf_s debug_buf;
++ A_UINT32 address;
++ A_UINT32 length;
++ A_UINT32 dropped;
++ A_UINT32 firstbuf;
++ A_UINT32 debug_hdr_ptr;
++
++ if (!ar->dbglog_init_done) return A_ERROR;
++
++#ifndef CONFIG_AR6000_WLAN_DEBUG
++ return 0;
++#endif
++
++ AR6000_SPIN_LOCK(&ar->arLock, 0);
++
++ if (ar->dbgLogFetchInProgress) {
++ AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++ return A_EBUSY;
++ }
++
++ /* block out others */
++ ar->dbgLogFetchInProgress = TRUE;
++
++ AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++
++ debug_hdr_ptr = dbglog_get_debug_hdr_ptr(ar);
++ printk("debug_hdr_ptr: 0x%x\n", debug_hdr_ptr);
++
++ /* Get the contents of the ring buffer */
++ if (debug_hdr_ptr) {
++ address = debug_hdr_ptr;
++ length = sizeof(struct dbglog_hdr_s);
++ ar6000_ReadDataDiag(ar->arHifDevice, address,
++ (A_UCHAR *)&debug_hdr, length);
++ address = (A_UINT32)debug_hdr.dbuf;
++ firstbuf = address;
++ dropped = debug_hdr.dropped;
++ length = sizeof(struct dbglog_buf_s);
++ ar6000_ReadDataDiag(ar->arHifDevice, address,
++ (A_UCHAR *)&debug_buf, length);
++
++ do {
++ address = (A_UINT32)debug_buf.buffer;
++ length = debug_buf.length;
++ if ((length) && (debug_buf.length <= debug_buf.bufsize)) {
++ /* Rewind the index if it is about to overrun the buffer */
++ if (ar->log_cnt > (DBGLOG_HOST_LOG_BUFFER_SIZE - length)) {
++ ar->log_cnt = 0;
++ }
++ if(A_OK != ar6000_ReadDataDiag(ar->arHifDevice, address,
++ (A_UCHAR *)&ar->log_buffer[ar->log_cnt], length))
++ {
++ break;
++ }
++ ar6000_dbglog_event(ar, dropped, &ar->log_buffer[ar->log_cnt], length);
++ ar->log_cnt += length;
++ } else {
++ AR_DEBUG_PRINTF("Length: %d (Total size: %d)\n",
++ debug_buf.length, debug_buf.bufsize);
++ }
++
++ address = (A_UINT32)debug_buf.next;
++ length = sizeof(struct dbglog_buf_s);
++ if(A_OK != ar6000_ReadDataDiag(ar->arHifDevice, address,
++ (A_UCHAR *)&debug_buf, length))
++ {
++ break;
++ }
++
++ } while (address != firstbuf);
++ }
++
++ ar->dbgLogFetchInProgress = FALSE;
++
++ return A_OK;
++}
++
++void
++ar6000_dbglog_event(AR_SOFTC_T *ar, A_UINT32 dropped,
++ A_INT8 *buffer, A_UINT32 length)
++{
++#ifdef REPORT_DEBUG_LOGS_TO_APP
++ #define MAX_WIRELESS_EVENT_SIZE 252
++ /*
++ * Break it up into chunks of MAX_WIRELESS_EVENT_SIZE bytes of messages.
++ * There seems to be a limitation on the length of message that could be
++ * transmitted to the user app via this mechanism.
++ */
++ A_UINT32 send, sent;
++
++ sent = 0;
++ send = dbglog_get_debug_fragment(&buffer[sent], length - sent,
++ MAX_WIRELESS_EVENT_SIZE);
++ while (send) {
++ ar6000_send_event_to_app(ar, WMIX_DBGLOG_EVENTID, &buffer[sent], send);
++ sent += send;
++ send = dbglog_get_debug_fragment(&buffer[sent], length - sent,
++ MAX_WIRELESS_EVENT_SIZE);
++ }
++#else
++ AR_DEBUG_PRINTF("Dropped logs: 0x%x\nDebug info length: %d\n",
++ dropped, length);
++
++ /* Interpret the debug logs */
++ dbglog_parse_debug_logs(buffer, length);
++#endif /* REPORT_DEBUG_LOGS_TO_APP */
++}
++
++
++
++static int __init
++ar6000_init_module(void)
++{
++ static int probed = 0;
++ A_STATUS status;
++ HTC_INIT_INFO initInfo;
++
++ A_MEMZERO(&initInfo,sizeof(initInfo));
++ initInfo.AddInstance = ar6000_avail_ev;
++ initInfo.DeleteInstance = ar6000_unavail_ev;
++ initInfo.TargetFailure = ar6000_target_failure;
++
++
++#ifdef DEBUG
++ /* Set the debug flags if specified at load time */
++ if(debugflags != 0)
++ {
++ g_dbg_flags = debugflags;
++ }
++#endif
++
++ if (probed) {
++ return -ENODEV;
++ }
++ probed++;
++
++#ifdef ADAPTIVE_POWER_THROUGHPUT_CONTROL
++ memset(&aptcTR, 0, sizeof(APTC_TRAFFIC_RECORD));
++#endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */
++
++#ifdef CONFIG_HOST_GPIO_SUPPORT
++ ar6000_gpio_init();
++#endif /* CONFIG_HOST_GPIO_SUPPORT */
++
++ status = HTCInit(&initInfo);
++ if(status != A_OK)
++ return -ENODEV;
++
++ return 0;
++}
++
++static void __exit
++ar6000_cleanup_module(void)
++{
++ int i = 0;
++ struct net_device *ar6000_netdev;
++
++#ifdef ADAPTIVE_POWER_THROUGHPUT_CONTROL
++ /* Delete the Adaptive Power Control timer */
++ if (timer_pending(&aptcTimer)) {
++ del_timer_sync(&aptcTimer);
++ }
++#endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */
++
++ for (i=0; i < MAX_AR6000; i++) {
++ if (ar6000_devices[i] != NULL) {
++ ar6000_netdev = ar6000_devices[i];
++ ar6000_devices[i] = NULL;
++ ar6000_destroy(ar6000_netdev, 1);
++ }
++ }
++
++ /* shutting down HTC will cause the HIF layer to detach from the
++ * underlying bus driver which will cause the subsequent deletion of
++ * all HIF and HTC instances */
++ HTCShutDown();
++
++ AR_DEBUG_PRINTF("ar6000_cleanup: success\n");
++}
++
++#ifdef ADAPTIVE_POWER_THROUGHPUT_CONTROL
++void
++aptcTimerHandler(unsigned long arg)
++{
++ A_UINT32 numbytes;
++ A_UINT32 throughput;
++ AR_SOFTC_T *ar;
++ A_STATUS status;
++
++ ar = (AR_SOFTC_T *)arg;
++ A_ASSERT(ar != NULL);
++ A_ASSERT(!timer_pending(&aptcTimer));
++
++ AR6000_SPIN_LOCK(&ar->arLock, 0);
++
++ /* Get the number of bytes transferred */
++ numbytes = aptcTR.bytesTransmitted + aptcTR.bytesReceived;
++ aptcTR.bytesTransmitted = aptcTR.bytesReceived = 0;
++
++ /* Calculate and decide based on throughput thresholds */
++ throughput = ((numbytes * 8)/APTC_TRAFFIC_SAMPLING_INTERVAL); /* Kbps */
++ if (throughput < APTC_LOWER_THROUGHPUT_THRESHOLD) {
++ /* Enable Sleep and delete the timer */
++ A_ASSERT(ar->arWmiReady == TRUE);
++ AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++ status = wmi_powermode_cmd(ar->arWmi, REC_POWER);
++ AR6000_SPIN_LOCK(&ar->arLock, 0);
++ A_ASSERT(status == A_OK);
++ aptcTR.timerScheduled = FALSE;
++ } else {
++ A_TIMEOUT_MS(&aptcTimer, APTC_TRAFFIC_SAMPLING_INTERVAL, 0);
++ }
++
++ AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++}
++#endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */
++
++
++
++/* set HTC block size, assume BMI is already initialized */
++A_STATUS ar6000_SetHTCBlockSize(AR_SOFTC_T *ar)
++{
++ A_STATUS status;
++ A_UINT32 blocksizes[HTC_MAILBOX_NUM_MAX];
++
++ do {
++ /* get the block sizes */
++ status = HIFConfigureDevice(ar->arHifDevice, HIF_DEVICE_GET_MBOX_BLOCK_SIZE,
++ blocksizes, sizeof(blocksizes));
++
++ if (A_FAILED(status)) {
++ AR_DEBUG_PRINTF("Failed to get block size info from HIF layer...\n");
++ break;
++ }
++ /* note: we actually get the block size for mailbox 1, for SDIO the block
++ * size on mailbox 0 is artificially set to 1 */
++ /* must be a power of 2 */
++ A_ASSERT((blocksizes[1] & (blocksizes[1] - 1)) == 0);
++
++ /* set the host interest area for the block size */
++ status = BMIWriteMemory(ar->arHifDevice,
++ HOST_INTEREST_ITEM_ADDRESS(ar, hi_mbox_io_block_sz),
++ (A_UCHAR *)&blocksizes[1],
++ 4);
++
++ if (A_FAILED(status)) {
++ AR_DEBUG_PRINTF("BMIWriteMemory for IO block size failed \n");
++ break;
++ }
++
++ AR_DEBUG_PRINTF("Block Size Set: %d (target address:0x%X)\n",
++ blocksizes[1], HOST_INTEREST_ITEM_ADDRESS(ar, hi_mbox_io_block_sz));
++
++ /* set the host interest area for the mbox ISR yield limit */
++ status = BMIWriteMemory(ar->arHifDevice,
++ HOST_INTEREST_ITEM_ADDRESS(ar, hi_mbox_isr_yield_limit),
++ (A_UCHAR *)&mbox_yield_limit,
++ 4);
++
++ if (A_FAILED(status)) {
++ AR_DEBUG_PRINTF("BMIWriteMemory for yield limit failed \n");
++ break;
++ }
++
++ } while (FALSE);
++
++ return status;
++}
++
++static void free_raw_buffers(AR_SOFTC_T *ar)
++{
++ int i, j;
++
++ for (i = 0; i != HTC_RAW_STREAM_NUM_MAX; i++) {
++ for (j = 0; j != RAW_HTC_READ_BUFFERS_NUM; j++)
++ kfree(ar->raw_htc_read_buffer[i][j]);
++ for (j = 0; j != RAW_HTC_WRITE_BUFFERS_NUM; j++)
++ kfree(ar->raw_htc_write_buffer[i][j]);
++ }
++}
++
++static int alloc_raw_buffers(AR_SOFTC_T *ar)
++{
++ int i, j;
++ raw_htc_buffer *b;
++
++ for (i = 0; i != HTC_RAW_STREAM_NUM_MAX; i++) {
++ for (j = 0; j != RAW_HTC_READ_BUFFERS_NUM; j++) {
++ b = kzalloc(sizeof(*b), GFP_KERNEL);
++ if (!b)
++ return -ENOMEM;
++ ar->raw_htc_read_buffer[i][j] = b;
++ }
++ for (j = 0; j != RAW_HTC_WRITE_BUFFERS_NUM; j++) {
++ b = kzalloc(sizeof(*b), GFP_KERNEL);
++ if (!b)
++ return -ENOMEM;
++ ar->raw_htc_write_buffer[i][j] = b;
++ }
++ }
++ return 0;
++}
++
++static const struct net_device_ops ar6000_netdev_ops = {
++ .ndo_init = &ar6000_init,
++ .ndo_open = &ar6000_open,
++ .ndo_stop = &ar6000_close,
++ .ndo_start_xmit = &ar6000_data_tx,
++ .ndo_get_stats = &ar6000_get_stats,
++ .ndo_do_ioctl = &ar6000_ioctl,
++};
++/*
++ * HTC Event handlers
++ */
++static void
++ar6000_avail_ev(HTC_HANDLE HTCHandle)
++{
++ int i;
++ struct net_device *dev;
++ AR_SOFTC_T *ar;
++ int device_index = 0;
++
++ AR_DEBUG_PRINTF("ar6000_available\n");
++
++ for (i=0; i < MAX_AR6000; i++) {
++ if (ar6000_devices[i] == NULL) {
++ break;
++ }
++ }
++
++ if (i == MAX_AR6000) {
++ AR_DEBUG_PRINTF("ar6000_available: max devices reached\n");
++ return;
++ }
++
++ /* Save this. It gives a bit better readability especially since */
++ /* we use another local "i" variable below. */
++ device_index = i;
++
++ A_ASSERT(HTCHandle != NULL);
++
++ dev = alloc_etherdev(sizeof(AR_SOFTC_T));
++ if (dev == NULL) {
++ AR_DEBUG_PRINTF("ar6000_available: can't alloc etherdev\n");
++ return;
++ }
++
++ ether_setup(dev);
++
++ if (netdev_priv(dev) == NULL) {
++ printk(KERN_CRIT "ar6000_available: Could not allocate memory\n");
++ return;
++ }
++
++ A_MEMZERO(netdev_priv(dev), sizeof(AR_SOFTC_T));
++
++ ar = (AR_SOFTC_T *)netdev_priv(dev);
++ ar->arNetDev = dev;
++ ar->arHtcTarget = HTCHandle;
++ ar->arHifDevice = HTCGetHifDevice(HTCHandle);
++ ar->arWlanState = WLAN_ENABLED;
++ ar->arRadioSwitch = WLAN_ENABLED;
++ ar->arDeviceIndex = device_index;
++
++ A_INIT_TIMER(&ar->arHBChallengeResp.timer, ar6000_detect_error, dev);
++ ar->arHBChallengeResp.seqNum = 0;
++ ar->arHBChallengeResp.outstanding = FALSE;
++ ar->arHBChallengeResp.missCnt = 0;
++ ar->arHBChallengeResp.frequency = AR6000_HB_CHALLENGE_RESP_FREQ_DEFAULT;
++ ar->arHBChallengeResp.missThres = AR6000_HB_CHALLENGE_RESP_MISS_THRES_DEFAULT;
++
++ ar6000_init_control_info(ar);
++ init_waitqueue_head(&arEvent);
++ sema_init(&ar->arSem, 1);
++
++ if (alloc_raw_buffers(ar)) {
++ free_raw_buffers(ar);
++ /*
++ * @@@ Clean up our own mess, but for anything else, cheerfully mimick
++ * the beautiful error non-handling of the rest of this function.
++ */
++ return;
++ }
++
++#ifdef ADAPTIVE_POWER_THROUGHPUT_CONTROL
++ A_INIT_TIMER(&aptcTimer, aptcTimerHandler, ar);
++#endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */
++
++ /*
++ * If requested, perform some magic which requires no cooperation from
++ * the Target. It causes the Target to ignore flash and execute to the
++ * OS from ROM.
++ *
++ * This is intended to support recovery from a corrupted flash on Targets
++ * that support flash.
++ */
++ if (skipflash)
++ {
++ ar6000_reset_device_skipflash(ar->arHifDevice);
++ }
++
++ BMIInit();
++ {
++ struct bmi_target_info targ_info;
++
++ if (BMIGetTargetInfo(ar->arHifDevice, &targ_info) != A_OK) {
++ return;
++ }
++
++ ar->arVersion.target_ver = targ_info.target_ver;
++ ar->arTargetType = targ_info.target_type;
++ }
++
++ if (enableuartprint) {
++ A_UINT32 param;
++ param = 1;
++ if (BMIWriteMemory(ar->arHifDevice,
++ HOST_INTEREST_ITEM_ADDRESS(ar, hi_serial_enable),
++ (A_UCHAR *)&param,
++ 4)!= A_OK)
++ {
++ AR_DEBUG_PRINTF("BMIWriteMemory for enableuartprint failed \n");
++ return ;
++ }
++ AR_DEBUG_PRINTF("Serial console prints enabled\n");
++ }
++#ifdef CONFIG_HOST_TCMD_SUPPORT
++ if(testmode) {
++ ar->arTargetMode = AR6000_TCMD_MODE;
++ }else {
++ ar->arTargetMode = AR6000_WLAN_MODE;
++ }
++#endif
++ if (enabletimerwar) {
++ A_UINT32 param;
++
++ if (BMIReadMemory(ar->arHifDevice,
++ HOST_INTEREST_ITEM_ADDRESS(ar, hi_option_flag),
++ (A_UCHAR *)&param,
++ 4)!= A_OK)
++ {
++ AR_DEBUG_PRINTF("BMIReadMemory for enabletimerwar failed \n");
++ return;
++ }
++
++ param |= HI_OPTION_TIMER_WAR;
++
++ if (BMIWriteMemory(ar->arHifDevice,
++ HOST_INTEREST_ITEM_ADDRESS(ar, hi_option_flag),
++ (A_UCHAR *)&param,
++ 4) != A_OK)
++ {
++ AR_DEBUG_PRINTF("BMIWriteMemory for enabletimerwar failed \n");
++ return;
++ }
++ AR_DEBUG_PRINTF("Timer WAR enabled\n");
++ }
++
++
++ /* since BMIInit is called in the driver layer, we have to set the block
++ * size here for the target */
++
++ if (A_FAILED(ar6000_SetHTCBlockSize(ar))) {
++ return;
++ }
++
++ spin_lock_init(&ar->arLock);
++
++ dev->netdev_ops = &ar6000_netdev_ops;
++ dev->watchdog_timeo = AR6000_TX_TIMEOUT;
++ ar6000_ioctl_iwsetup(&ath_iw_handler_def);
++ dev->wireless_handlers = &ath_iw_handler_def;
++ ath_iw_handler_def.get_wireless_stats = ar6000_get_iwstats; /*Displayed via proc fs */
++
++ /*
++ * We need the OS to provide us with more headroom in order to
++ * perform dix to 802.3, WMI header encap, and the HTC header
++ */
++ dev->hard_header_len = ETH_HLEN + sizeof(ATH_LLC_SNAP_HDR) +
++ sizeof(WMI_DATA_HDR) + HTC_HEADER_LEN;
++
++ /* This runs the init function */
++ SET_NETDEV_DEV(dev, HIFGetOSDevice(ar->arHifDevice));
++ if (register_netdev(dev)) {
++ AR_DEBUG_PRINTF("ar6000_avail: register_netdev failed\n");
++ ar6000_destroy(dev, 0);
++ return;
++ }
++
++ HTCSetInstance(ar->arHtcTarget, ar);
++
++ /* We only register the device in the global list if we succeed. */
++ /* If the device is in the global list, it will be destroyed */
++ /* when the module is unloaded. */
++ ar6000_devices[device_index] = dev;
++
++ AR_DEBUG_PRINTF("ar6000_avail: name=%s htcTarget=0x%x, dev=0x%x (%d), ar=0x%x\n",
++ dev->name, (A_UINT32)HTCHandle, (A_UINT32)dev, device_index,
++ (A_UINT32)ar);
++}
++
++static void ar6000_target_failure(void *Instance, A_STATUS Status)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)Instance;
++ WMI_TARGET_ERROR_REPORT_EVENT errEvent;
++ static A_BOOL sip = FALSE;
++
++ if (Status != A_OK) {
++ if (timer_pending(&ar->arHBChallengeResp.timer)) {
++ A_UNTIMEOUT(&ar->arHBChallengeResp.timer);
++ }
++
++ /* try dumping target assertion information (if any) */
++ ar6000_dump_target_assert_info(ar->arHifDevice,ar->arTargetType);
++
++ /*
++ * Fetch the logs from the target via the diagnostic
++ * window.
++ */
++ ar6000_dbglog_get_debug_logs(ar);
++
++ /* Report the error only once */
++ if (!sip) {
++ sip = TRUE;
++ errEvent.errorVal = WMI_TARGET_COM_ERR |
++ WMI_TARGET_FATAL_ERR;
++#ifdef SEND_EVENT_TO_APP
++ ar6000_send_event_to_app(ar, WMI_ERROR_REPORT_EVENTID,
++ (A_UINT8 *)&errEvent,
++ sizeof(WMI_TARGET_ERROR_REPORT_EVENT));
++#endif
++ }
++ }
++}
++
++static void
++ar6000_unavail_ev(void *Instance)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)Instance;
++ /* NULL out it's entry in the global list */
++ ar6000_devices[ar->arDeviceIndex] = NULL;
++ ar6000_destroy(ar->arNetDev, 1);
++}
++
++/*
++ * We need to differentiate between the surprise and planned removal of the
++ * device because of the following consideration:
++ * - In case of surprise removal, the hcd already frees up the pending
++ * for the device and hence there is no need to unregister the function
++ * driver inorder to get these requests. For planned removal, the function
++ * driver has to explictly unregister itself to have the hcd return all the
++ * pending requests before the data structures for the devices are freed up.
++ * Note that as per the current implementation, the function driver will
++ * end up releasing all the devices since there is no API to selectively
++ * release a particular device.
++ * - Certain commands issued to the target can be skipped for surprise
++ * removal since they will anyway not go through.
++ */
++static void
++ar6000_destroy(struct net_device *dev, unsigned int unregister)
++{
++ AR_SOFTC_T *ar;
++
++ AR_DEBUG_PRINTF("+ar6000_destroy \n");
++
++ if((dev == NULL) || ((ar = netdev_priv(dev)) == NULL))
++ {
++ AR_DEBUG_PRINTF("%s(): Failed to get device structure.\n", __func__);
++ return;
++ }
++
++ /* Clear the tx counters */
++ memset(tx_attempt, 0, sizeof(tx_attempt));
++ memset(tx_post, 0, sizeof(tx_post));
++ memset(tx_complete, 0, sizeof(tx_complete));
++
++ /* Free up the device data structure */
++ if (unregister) {
++ unregister_netdev(dev);
++ } else {
++ ar6000_close(dev);
++ ar6000_cleanup(dev);
++ }
++
++ free_raw_buffers(ar);
++
++#ifndef free_netdev
++ kfree(dev);
++#else
++ free_netdev(dev);
++#endif
++
++ AR_DEBUG_PRINTF("-ar6000_destroy \n");
++}
++
++static void ar6000_detect_error(unsigned long ptr)
++{
++ struct net_device *dev = (struct net_device *)ptr;
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ WMI_TARGET_ERROR_REPORT_EVENT errEvent;
++
++ AR6000_SPIN_LOCK(&ar->arLock, 0);
++
++ if (ar->arHBChallengeResp.outstanding) {
++ ar->arHBChallengeResp.missCnt++;
++ } else {
++ ar->arHBChallengeResp.missCnt = 0;
++ }
++
++ if (ar->arHBChallengeResp.missCnt > ar->arHBChallengeResp.missThres) {
++ /* Send Error Detect event to the application layer and do not reschedule the error detection module timer */
++ ar->arHBChallengeResp.missCnt = 0;
++ ar->arHBChallengeResp.seqNum = 0;
++ errEvent.errorVal = WMI_TARGET_COM_ERR | WMI_TARGET_FATAL_ERR;
++ AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++#ifdef SEND_EVENT_TO_APP
++ ar6000_send_event_to_app(ar, WMI_ERROR_REPORT_EVENTID,
++ (A_UINT8 *)&errEvent,
++ sizeof(WMI_TARGET_ERROR_REPORT_EVENT));
++#endif
++ return;
++ }
++
++ /* Generate the sequence number for the next challenge */
++ ar->arHBChallengeResp.seqNum++;
++ ar->arHBChallengeResp.outstanding = TRUE;
++
++ AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++
++ /* Send the challenge on the control channel */
++ if (wmi_get_challenge_resp_cmd(ar->arWmi, ar->arHBChallengeResp.seqNum, DRV_HB_CHALLENGE) != A_OK) {
++ AR_DEBUG_PRINTF("Unable to send heart beat challenge\n");
++ }
++
++
++ /* Reschedule the timer for the next challenge */
++ A_TIMEOUT_MS(&ar->arHBChallengeResp.timer, ar->arHBChallengeResp.frequency * 1000, 0);
++}
++
++void ar6000_init_profile_info(AR_SOFTC_T *ar)
++{
++ ar->arSsidLen = 0;
++ A_MEMZERO(ar->arSsid, sizeof(ar->arSsid));
++ ar->arNetworkType = INFRA_NETWORK;
++ ar->arDot11AuthMode = OPEN_AUTH;
++ ar->arAuthMode = NONE_AUTH;
++ ar->arPairwiseCrypto = NONE_CRYPT;
++ ar->arPairwiseCryptoLen = 0;
++ ar->arGroupCrypto = NONE_CRYPT;
++ ar->arGroupCryptoLen = 0;
++ A_MEMZERO(ar->arWepKeyList, sizeof(ar->arWepKeyList));
++ A_MEMZERO(ar->arReqBssid, sizeof(ar->arReqBssid));
++ A_MEMZERO(ar->arBssid, sizeof(ar->arBssid));
++ ar->arBssChannel = 0;
++}
++
++static void
++ar6000_init_control_info(AR_SOFTC_T *ar)
++{
++ ar->arWmiEnabled = FALSE;
++ ar6000_init_profile_info(ar);
++ ar->arDefTxKeyIndex = 0;
++ A_MEMZERO(ar->arWepKeyList, sizeof(ar->arWepKeyList));
++ ar->arChannelHint = 0;
++ ar->arListenInterval = MAX_LISTEN_INTERVAL;
++ ar->arVersion.host_ver = AR6K_SW_VERSION;
++ ar->arRssi = 0;
++ ar->arTxPwr = 0;
++ ar->arTxPwrSet = FALSE;
++ ar->arSkipScan = 0;
++ ar->arBeaconInterval = 0;
++ ar->arBitRate = 0;
++ ar->arMaxRetries = 0;
++ ar->arWmmEnabled = TRUE;
++}
++
++static int
++ar6000_open(struct net_device *dev)
++{
++ /* Wake up the queues */
++ netif_start_queue(dev);
++
++ return 0;
++}
++
++static int
++ar6000_close(struct net_device *dev)
++{
++ /* Stop the transmit queues */
++ netif_stop_queue(dev);
++ return 0;
++}
++
++static int
++ar6000_cleanup(struct net_device *dev)
++{
++ AR_SOFTC_T *ar = netdev_priv(dev);
++
++ /* Stop the transmit queues */
++ netif_stop_queue(dev);
++
++ /* Disable the target and the interrupts associated with it */
++ if (ar->arWmiReady == TRUE)
++ {
++ if (!bypasswmi)
++ {
++ if (ar->arConnected == TRUE || ar->arConnectPending == TRUE)
++ {
++ AR_DEBUG_PRINTF("%s(): Disconnect\n", __func__);
++ AR6000_SPIN_LOCK(&ar->arLock, 0);
++ ar6000_init_profile_info(ar);
++ AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++ wmi_disconnect_cmd(ar->arWmi);
++ }
++
++ ar6000_dbglog_get_debug_logs(ar);
++ ar->arWmiReady = FALSE;
++ ar->arConnected = FALSE;
++ ar->arConnectPending = FALSE;
++ wmi_shutdown(ar->arWmi);
++ ar->arWmiEnabled = FALSE;
++ ar->arWmi = NULL;
++ ar->arWlanState = WLAN_ENABLED;
++#ifdef USER_KEYS
++ ar->user_savedkeys_stat = USER_SAVEDKEYS_STAT_INIT;
++ ar->user_key_ctrl = 0;
++#endif
++ }
++
++ AR_DEBUG_PRINTF("%s(): WMI stopped\n", __func__);
++ }
++ else
++ {
++ AR_DEBUG_PRINTF("%s(): WMI not ready 0x%08x 0x%08x\n",
++ __func__, (unsigned int) ar, (unsigned int) ar->arWmi);
++
++ /* Shut down WMI if we have started it */
++ if(ar->arWmiEnabled == TRUE)
++ {
++ AR_DEBUG_PRINTF("%s(): Shut down WMI\n", __func__);
++ wmi_shutdown(ar->arWmi);
++ ar->arWmiEnabled = FALSE;
++ ar->arWmi = NULL;
++ }
++ }
++
++ /* stop HTC */
++ HTCStop(ar->arHtcTarget);
++
++ /* set the instance to NULL so we do not get called back on remove incase we
++ * we're explicity destroyed by module unload */
++ HTCSetInstance(ar->arHtcTarget, NULL);
++
++ if (resetok) {
++ /* try to reset the device if we can
++ * The driver may have been configure NOT to reset the target during
++ * a debug session */
++ AR_DEBUG_PRINTF(" Attempting to reset target on instance destroy.... \n");
++ ar6000_reset_device(ar->arHifDevice, ar->arTargetType);
++ } else {
++ AR_DEBUG_PRINTF(" Host does not want target reset. \n");
++ }
++
++ /* Done with cookies */
++ ar6000_cookie_cleanup(ar);
++
++ /* Cleanup BMI */
++ BMIInit();
++
++ return 0;
++}
++
++/* connect to a service */
++static A_STATUS ar6000_connectservice(AR_SOFTC_T *ar,
++ HTC_SERVICE_CONNECT_REQ *pConnect,
++ WMI_PRI_STREAM_ID WmiStreamID,
++ char *pDesc)
++{
++ A_STATUS status;
++ HTC_SERVICE_CONNECT_RESP response;
++
++ do {
++
++ A_MEMZERO(&response,sizeof(response));
++
++ status = HTCConnectService(ar->arHtcTarget,
++ pConnect,
++ &response);
++
++ if (A_FAILED(status)) {
++ AR_DEBUG_PRINTF(" Failed to connect to %s service status:%d \n", pDesc, status);
++ break;
++ }
++
++ if (WmiStreamID == WMI_NOT_MAPPED) {
++ /* done */
++ break;
++ }
++
++ /* set endpoint mapping for the WMI stream in the driver layer */
++ arSetWMIStream2EndpointIDMap(ar,WmiStreamID,response.Endpoint);
++
++ } while (FALSE);
++
++ return status;
++}
++
++static void ar6000_TxDataCleanup(AR_SOFTC_T *ar)
++{
++ /* flush all the data (non-control) streams
++ * we only flush packets that are tagged as data, we leave any control packets that
++ * were in the TX queues alone */
++ HTCFlushEndpoint(ar->arHtcTarget,
++ arWMIStream2EndpointID(ar,WMI_BEST_EFFORT_PRI),
++ AR6K_DATA_PKT_TAG);
++ HTCFlushEndpoint(ar->arHtcTarget,
++ arWMIStream2EndpointID(ar,WMI_LOW_PRI),
++ AR6K_DATA_PKT_TAG);
++ HTCFlushEndpoint(ar->arHtcTarget,
++ arWMIStream2EndpointID(ar,WMI_HIGH_PRI),
++ AR6K_DATA_PKT_TAG);
++ HTCFlushEndpoint(ar->arHtcTarget,
++ arWMIStream2EndpointID(ar,WMI_HIGHEST_PRI),
++ AR6K_DATA_PKT_TAG);
++}
++
++/* This function does one time initialization for the lifetime of the device */
++int ar6000_init(struct net_device *dev)
++{
++ AR_SOFTC_T *ar;
++ A_STATUS status;
++ A_INT32 timeleft;
++
++ if((ar = netdev_priv(dev)) == NULL)
++ {
++ return(-EIO);
++ }
++
++ /* Do we need to finish the BMI phase */
++ if(BMIDone(ar->arHifDevice) != A_OK)
++ {
++ return -EIO;
++ }
++
++ if (!bypasswmi)
++ {
++#if 0 /* TBDXXX */
++ if (ar->arVersion.host_ver != ar->arVersion.target_ver) {
++ A_PRINTF("WARNING: Host version 0x%x does not match Target "
++ " version 0x%x!\n",
++ ar->arVersion.host_ver, ar->arVersion.target_ver);
++ }
++#endif
++
++ /* Indicate that WMI is enabled (although not ready yet) */
++ ar->arWmiEnabled = TRUE;
++ if ((ar->arWmi = wmi_init((void *) ar)) == NULL)
++ {
++ AR_DEBUG_PRINTF("%s() Failed to initialize WMI.\n", __func__);
++ return(-EIO);
++ }
++
++ AR_DEBUG_PRINTF("%s() Got WMI @ 0x%08x.\n", __func__,
++ (unsigned int) ar->arWmi);
++ }
++
++ do {
++ HTC_SERVICE_CONNECT_REQ connect;
++
++ /* the reason we have to wait for the target here is that the driver layer
++ * has to init BMI in order to set the host block size,
++ */
++ status = HTCWaitTarget(ar->arHtcTarget);
++
++ if (A_FAILED(status)) {
++ break;
++ }
++
++ A_MEMZERO(&connect,sizeof(connect));
++ /* meta data is unused for now */
++ connect.pMetaData = NULL;
++ connect.MetaDataLength = 0;
++ /* these fields are the same for all service endpoints */
++ connect.EpCallbacks.pContext = ar;
++ connect.EpCallbacks.EpTxComplete = ar6000_tx_complete;
++ connect.EpCallbacks.EpRecv = ar6000_rx;
++ connect.EpCallbacks.EpRecvRefill = ar6000_rx_refill;
++ connect.EpCallbacks.EpSendFull = ar6000_tx_queue_full;
++ connect.EpCallbacks.EpSendAvail = ar6000_tx_queue_avail;
++ /* set the max queue depth so that our ar6000_tx_queue_full handler gets called.
++ * Linux has the peculiarity of not providing flow control between the
++ * NIC and the network stack. There is no API to indicate that a TX packet
++ * was sent which could provide some back pressure to the network stack.
++ * Under linux you would have to wait till the network stack consumed all sk_buffs
++ * before any back-flow kicked in. Which isn't very friendly.
++ * So we have to manage this ourselves */
++ connect.MaxSendQueueDepth = 32;
++
++ /* connect to control service */
++ connect.ServiceID = WMI_CONTROL_SVC;
++ status = ar6000_connectservice(ar,
++ &connect,
++ WMI_CONTROL_PRI,
++ "WMI CONTROL");
++ if (A_FAILED(status)) {
++ break;
++ }
++
++ /* for the remaining data services set the connection flag to reduce dribbling,
++ * if configured to do so */
++ if (reduce_credit_dribble) {
++ connect.ConnectionFlags |= HTC_CONNECT_FLAGS_REDUCE_CREDIT_DRIBBLE;
++ /* the credit dribble trigger threshold is (reduce_credit_dribble - 1) for a value
++ * of 0-3 */
++ connect.ConnectionFlags &= ~HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_MASK;
++ connect.ConnectionFlags |=
++ ((A_UINT16)reduce_credit_dribble - 1) & HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_MASK;
++ }
++ /* connect to best-effort service */
++ connect.ServiceID = WMI_DATA_BE_SVC;
++
++ status = ar6000_connectservice(ar,
++ &connect,
++ WMI_BEST_EFFORT_PRI,
++ "WMI DATA BE");
++ if (A_FAILED(status)) {
++ break;
++ }
++
++ /* connect to back-ground
++ * map this to WMI LOW_PRI */
++ connect.ServiceID = WMI_DATA_BK_SVC;
++ status = ar6000_connectservice(ar,
++ &connect,
++ WMI_LOW_PRI,
++ "WMI DATA BK");
++ if (A_FAILED(status)) {
++ break;
++ }
++
++ /* connect to Video service, map this to
++ * to HI PRI */
++ connect.ServiceID = WMI_DATA_VI_SVC;
++ status = ar6000_connectservice(ar,
++ &connect,
++ WMI_HIGH_PRI,
++ "WMI DATA VI");
++ if (A_FAILED(status)) {
++ break;
++ }
++
++ /* connect to VO service, this is currently not
++ * mapped to a WMI priority stream due to historical reasons.
++ * WMI originally defined 3 priorities over 3 mailboxes
++ * We can change this when WMI is reworked so that priorities are not
++ * dependent on mailboxes */
++ connect.ServiceID = WMI_DATA_VO_SVC;
++ status = ar6000_connectservice(ar,
++ &connect,
++ WMI_HIGHEST_PRI,
++ "WMI DATA VO");
++ if (A_FAILED(status)) {
++ break;
++ }
++
++ A_ASSERT(arWMIStream2EndpointID(ar,WMI_CONTROL_PRI) != 0);
++ A_ASSERT(arWMIStream2EndpointID(ar,WMI_BEST_EFFORT_PRI) != 0);
++ A_ASSERT(arWMIStream2EndpointID(ar,WMI_LOW_PRI) != 0);
++ A_ASSERT(arWMIStream2EndpointID(ar,WMI_HIGH_PRI) != 0);
++ A_ASSERT(arWMIStream2EndpointID(ar,WMI_HIGHEST_PRI) != 0);
++ } while (FALSE);
++
++ if (A_FAILED(status)) {
++ return (-EIO);
++ }
++
++ /*
++ * give our connected endpoints some buffers
++ */
++ ar6000_rx_refill(ar, arWMIStream2EndpointID(ar,WMI_CONTROL_PRI));
++
++ ar6000_rx_refill(ar, arWMIStream2EndpointID(ar,WMI_BEST_EFFORT_PRI));
++
++ /*
++ * We will post the receive buffers only for SPE testing and so we are
++ * making it conditional on the 'bypasswmi' flag.
++ */
++ if (bypasswmi) {
++ ar6000_rx_refill(ar,arWMIStream2EndpointID(ar,WMI_LOW_PRI));
++ ar6000_rx_refill(ar,arWMIStream2EndpointID(ar,WMI_HIGH_PRI));
++ }
++
++ /* setup credit distribution */
++ ar6000_setup_credit_dist(ar->arHtcTarget, &ar->arCreditStateInfo);
++
++ /* Since cookies are used for HTC transports, they should be */
++ /* initialized prior to enabling HTC. */
++ ar6000_cookie_init(ar);
++
++ /* start HTC */
++ status = HTCStart(ar->arHtcTarget);
++
++ if (status != A_OK) {
++ if (ar->arWmiEnabled == TRUE) {
++ wmi_shutdown(ar->arWmi);
++ ar->arWmiEnabled = FALSE;
++ ar->arWmi = NULL;
++ }
++ ar6000_cookie_cleanup(ar);
++ return -EIO;
++ }
++
++ if (!bypasswmi) {
++ /* Wait for Wmi event to be ready */
++ timeleft = wait_event_interruptible_timeout(arEvent,
++ (ar->arWmiReady == TRUE), wmitimeout * HZ);
++
++ if(!timeleft || signal_pending(current))
++ {
++ AR_DEBUG_PRINTF("WMI is not ready or wait was interrupted\n");
++#if defined(DWSIM) /* TBDXXX */
++ AR_DEBUG_PRINTF(".....but proceed anyway.\n");
++#else
++ return -EIO;
++#endif
++ }
++
++ AR_DEBUG_PRINTF("%s() WMI is ready\n", __func__);
++
++ /* Communicate the wmi protocol verision to the target */
++ if ((ar6000_set_host_app_area(ar)) != A_OK) {
++ AR_DEBUG_PRINTF("Unable to set the host app area\n");
++ }
++ }
++
++ ar->arNumDataEndPts = 1;
++
++ return(0);
++}
++
++
++void
++ar6000_bitrate_rx(void *devt, A_INT32 rateKbps)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)devt;
++
++ ar->arBitRate = rateKbps;
++ wake_up(&arEvent);
++}
++
++void
++ar6000_ratemask_rx(void *devt, A_UINT16 ratemask)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)devt;
++
++ ar->arRateMask = ratemask;
++ wake_up(&arEvent);
++}
++
++void
++ar6000_txPwr_rx(void *devt, A_UINT8 txPwr)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)devt;
++
++ ar->arTxPwr = txPwr;
++ wake_up(&arEvent);
++}
++
++
++void
++ar6000_channelList_rx(void *devt, A_INT8 numChan, A_UINT16 *chanList)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)devt;
++
++ A_MEMCPY(ar->arChannelList, chanList, numChan * sizeof (A_UINT16));
++ ar->arNumChannels = numChan;
++
++ wake_up(&arEvent);
++}
++
++A_UINT8
++ar6000_ibss_map_epid(struct sk_buff *skb, struct net_device *dev, A_UINT32 * mapNo)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ A_UINT8 *datap;
++ ATH_MAC_HDR *macHdr;
++ A_UINT32 i, eptMap;
++
++ (*mapNo) = 0;
++ datap = A_NETBUF_DATA(skb);
++ macHdr = (ATH_MAC_HDR *)(datap + sizeof(WMI_DATA_HDR));
++ if (IEEE80211_IS_MULTICAST(macHdr->dstMac)) {
++ return ENDPOINT_2;
++ }
++
++ eptMap = -1;
++ for (i = 0; i < ar->arNodeNum; i ++) {
++ if (IEEE80211_ADDR_EQ(macHdr->dstMac, ar->arNodeMap[i].macAddress)) {
++ (*mapNo) = i + 1;
++ ar->arNodeMap[i].txPending ++;
++ return ar->arNodeMap[i].epId;
++ }
++
++ if ((eptMap == -1) && !ar->arNodeMap[i].txPending) {
++ eptMap = i;
++ }
++ }
++
++ if (eptMap == -1) {
++ eptMap = ar->arNodeNum;
++ ar->arNodeNum ++;
++ A_ASSERT(ar->arNodeNum <= MAX_NODE_NUM);
++ }
++
++ A_MEMCPY(ar->arNodeMap[eptMap].macAddress, macHdr->dstMac, IEEE80211_ADDR_LEN);
++
++ for (i = ENDPOINT_2; i <= ENDPOINT_5; i ++) {
++ if (!ar->arTxPending[i]) {
++ ar->arNodeMap[eptMap].epId = i;
++ break;
++ }
++ // No free endpoint is available, start redistribution on the inuse endpoints.
++ if (i == ENDPOINT_5) {
++ ar->arNodeMap[eptMap].epId = ar->arNexEpId;
++ ar->arNexEpId ++;
++ if (ar->arNexEpId > ENDPOINT_5) {
++ ar->arNexEpId = ENDPOINT_2;
++ }
++ }
++ }
++
++ (*mapNo) = eptMap + 1;
++ ar->arNodeMap[eptMap].txPending ++;
++
++ return ar->arNodeMap[eptMap].epId;
++}
++
++#ifdef DEBUG
++static void ar6000_dump_skb(struct sk_buff *skb)
++{
++ u_char *ch;
++ for (ch = A_NETBUF_DATA(skb);
++ (A_UINT32)ch < ((A_UINT32)A_NETBUF_DATA(skb) +
++ A_NETBUF_LEN(skb)); ch++)
++ {
++ AR_DEBUG_PRINTF("%2.2x ", *ch);
++ }
++ AR_DEBUG_PRINTF("\n");
++}
++#endif
++
++static int
++ar6000_data_tx(struct sk_buff *skb, struct net_device *dev)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ WMI_PRI_STREAM_ID streamID = WMI_NOT_MAPPED;
++ A_UINT32 mapNo = 0;
++ int len;
++ struct ar_cookie *cookie;
++ A_BOOL checkAdHocPsMapping = FALSE;
++
++#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,13)
++ skb->list = NULL;
++#endif
++
++ AR_DEBUG2_PRINTF("ar6000_data_tx start - skb=0x%x, data=0x%x, len=0x%x\n",
++ (A_UINT32)skb, (A_UINT32)A_NETBUF_DATA(skb),
++ A_NETBUF_LEN(skb));
++#ifdef CONFIG_HOST_TCMD_SUPPORT
++ /* TCMD doesnt support any data, free the buf and return */
++ if(ar->arTargetMode == AR6000_TCMD_MODE) {
++ A_NETBUF_FREE(skb);
++ return 0;
++ }
++#endif
++ do {
++
++ if (ar->arWmiReady == FALSE && bypasswmi == 0) {
++ break;
++ }
++
++#ifdef BLOCK_TX_PATH_FLAG
++ if (blocktx) {
++ break;
++ }
++#endif /* BLOCK_TX_PATH_FLAG */
++
++ if (ar->arWmiEnabled) {
++ if (A_NETBUF_HEADROOM(skb) < dev->hard_header_len) {
++ struct sk_buff *newbuf;
++ /*
++ * We really should have gotten enough headroom but sometimes
++ * we still get packets with not enough headroom. Copy the packet.
++ */
++ len = A_NETBUF_LEN(skb);
++ newbuf = A_NETBUF_ALLOC(len);
++ if (newbuf == NULL) {
++ break;
++ }
++ A_NETBUF_PUT(newbuf, len);
++ A_MEMCPY(A_NETBUF_DATA(newbuf), A_NETBUF_DATA(skb), len);
++ A_NETBUF_FREE(skb);
++ skb = newbuf;
++ /* fall through and assemble header */
++ }
++
++ if (wmi_dix_2_dot3(ar->arWmi, skb) != A_OK) {
++ AR_DEBUG_PRINTF("ar6000_data_tx - wmi_dix_2_dot3 failed\n");
++ break;
++ }
++
++ if (wmi_data_hdr_add(ar->arWmi, skb, DATA_MSGTYPE) != A_OK) {
++ AR_DEBUG_PRINTF("ar6000_data_tx - wmi_data_hdr_add failed\n");
++ break;
++ }
++
++ if ((ar->arNetworkType == ADHOC_NETWORK) &&
++ ar->arIbssPsEnable && ar->arConnected) {
++ /* flag to check adhoc mapping once we take the lock below: */
++ checkAdHocPsMapping = TRUE;
++
++ } else {
++ /* get the stream mapping */
++ if (ar->arWmmEnabled) {
++ streamID = wmi_get_stream_id(ar->arWmi,
++ wmi_implicit_create_pstream(ar->arWmi, skb, UPLINK_TRAFFIC, UNDEFINED_PRI));
++ } else {
++ streamID = WMI_BEST_EFFORT_PRI;
++ }
++ }
++
++ } else {
++ struct iphdr *ipHdr;
++ /*
++ * the endpoint is directly based on the TOS field in the IP
++ * header **** only for testing ******
++ */
++ ipHdr = A_NETBUF_DATA(skb) + sizeof(ATH_MAC_HDR);
++ /* here we map the TOS field to an endpoint number, this is for
++ * the endpointping test application */
++ streamID = IP_TOS_TO_WMI_PRI(ipHdr->tos);
++ }
++
++ } while (FALSE);
++
++ /* did we succeed ? */
++ if ((streamID == WMI_NOT_MAPPED) && !checkAdHocPsMapping) {
++ /* cleanup and exit */
++ A_NETBUF_FREE(skb);
++ AR6000_STAT_INC(ar, tx_dropped);
++ AR6000_STAT_INC(ar, tx_aborted_errors);
++ return 0;
++ }
++
++ cookie = NULL;
++
++ /* take the lock to protect driver data */
++ AR6000_SPIN_LOCK(&ar->arLock, 0);
++
++ do {
++
++ if (checkAdHocPsMapping) {
++ streamID = ar6000_ibss_map_epid(skb, dev, &mapNo);
++ }
++
++ A_ASSERT(streamID != WMI_NOT_MAPPED);
++
++ /* validate that the endpoint is connected */
++ if (arWMIStream2EndpointID(ar,streamID) == 0) {
++ AR_DEBUG_PRINTF("Stream %d is NOT mapped!\n",streamID);
++ break;
++ }
++ /* allocate resource for this packet */
++ cookie = ar6000_alloc_cookie(ar);
++
++ if (cookie != NULL) {
++ /* update counts while the lock is held */
++ ar->arTxPending[streamID]++;
++ ar->arTotalTxDataPending++;
++ }
++
++ } while (FALSE);
++
++ AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++
++ if (cookie != NULL) {
++ cookie->arc_bp[0] = (A_UINT32)skb;
++ cookie->arc_bp[1] = mapNo;
++ SET_HTC_PACKET_INFO_TX(&cookie->HtcPkt,
++ cookie,
++ A_NETBUF_DATA(skb),
++ A_NETBUF_LEN(skb),
++ arWMIStream2EndpointID(ar,streamID),
++ AR6K_DATA_PKT_TAG);
++
++#ifdef DEBUG
++ if (debugdriver >= 3) {
++ ar6000_dump_skb(skb);
++ }
++#endif
++ /* HTC interface is asynchronous, if this fails, cleanup will happen in
++ * the ar6000_tx_complete callback */
++ HTCSendPkt(ar->arHtcTarget, &cookie->HtcPkt);
++ } else {
++ /* no packet to send, cleanup */
++ A_NETBUF_FREE(skb);
++ AR6000_STAT_INC(ar, tx_dropped);
++ AR6000_STAT_INC(ar, tx_aborted_errors);
++ }
++
++ return 0;
++}
++
++#ifdef ADAPTIVE_POWER_THROUGHPUT_CONTROL
++static void
++tvsub(register struct timeval *out, register struct timeval *in)
++{
++ if((out->tv_usec -= in->tv_usec) < 0) {
++ out->tv_sec--;
++ out->tv_usec += 1000000;
++ }
++ out->tv_sec -= in->tv_sec;
++}
++
++void
++applyAPTCHeuristics(AR_SOFTC_T *ar)
++{
++ A_UINT32 duration;
++ A_UINT32 numbytes;
++ A_UINT32 throughput;
++ struct timeval ts;
++ A_STATUS status;
++
++ AR6000_SPIN_LOCK(&ar->arLock, 0);
++
++ if ((enableAPTCHeuristics) && (!aptcTR.timerScheduled)) {
++ do_gettimeofday(&ts);
++ tvsub(&ts, &aptcTR.samplingTS);
++ duration = ts.tv_sec * 1000 + ts.tv_usec / 1000; /* ms */
++ numbytes = aptcTR.bytesTransmitted + aptcTR.bytesReceived;
++
++ if (duration > APTC_TRAFFIC_SAMPLING_INTERVAL) {
++ /* Initialize the time stamp and byte count */
++ aptcTR.bytesTransmitted = aptcTR.bytesReceived = 0;
++ do_gettimeofday(&aptcTR.samplingTS);
++
++ /* Calculate and decide based on throughput thresholds */
++ throughput = ((numbytes * 8) / duration);
++ if (throughput > APTC_UPPER_THROUGHPUT_THRESHOLD) {
++ /* Disable Sleep and schedule a timer */
++ A_ASSERT(ar->arWmiReady == TRUE);
++ AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++ status = wmi_powermode_cmd(ar->arWmi, MAX_PERF_POWER);
++ AR6000_SPIN_LOCK(&ar->arLock, 0);
++ A_TIMEOUT_MS(&aptcTimer, APTC_TRAFFIC_SAMPLING_INTERVAL, 0);
++ aptcTR.timerScheduled = TRUE;
++ }
++ }
++ }
++
++ AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++}
++#endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */
++
++static void
++ar6000_tx_queue_full(void *Context, HTC_ENDPOINT_ID Endpoint)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *) Context;
++
++ if (Endpoint == arWMIStream2EndpointID(ar,WMI_CONTROL_PRI)) {
++ if (!bypasswmi) {
++ /* under normal WMI if this is getting full, then something is running rampant
++ * the host should not be exhausting the WMI queue with too many commands
++ * the only exception to this is during testing using endpointping */
++
++ AR6000_SPIN_LOCK(&ar->arLock, 0);
++ /* set flag to handle subsequent messages */
++ ar->arWMIControlEpFull = TRUE;
++ AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++ AR_DEBUG_PRINTF("WMI Control Endpoint is FULL!!! \n");
++ }
++ } else {
++ /* one of the data endpoints queues is getting full..need to stop network stack
++ * the queue will resume after credits received */
++ netif_stop_queue(ar->arNetDev);
++ }
++}
++
++static void
++ar6000_tx_queue_avail(void *Context, HTC_ENDPOINT_ID Endpoint)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)Context;
++
++ if (Endpoint == arWMIStream2EndpointID(ar,WMI_CONTROL_PRI)) {
++ /* FIXME: what do for it? */
++ } else {
++ /* Wake up interface, rescheduling prevented. */
++ if (ar->arConnected == TRUE || bypasswmi)
++ netif_wake_queue(ar->arNetDev);
++ }
++}
++
++static void
++ar6000_tx_complete(void *Context, HTC_PACKET *pPacket)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)Context;
++ void *cookie = (void *)pPacket->pPktContext;
++ struct sk_buff *skb = NULL;
++ A_UINT32 mapNo = 0;
++ A_STATUS status;
++ struct ar_cookie * ar_cookie;
++ WMI_PRI_STREAM_ID streamID;
++ A_BOOL wakeEvent = FALSE;
++
++ status = pPacket->Status;
++ ar_cookie = (struct ar_cookie *)cookie;
++ skb = (struct sk_buff *)ar_cookie->arc_bp[0];
++ streamID = arEndpoint2WMIStreamID(ar,pPacket->Endpoint);
++ mapNo = ar_cookie->arc_bp[1];
++
++ A_ASSERT(skb);
++ A_ASSERT(pPacket->pBuffer == A_NETBUF_DATA(skb));
++
++ if (A_SUCCESS(status)) {
++ A_ASSERT(pPacket->ActualLength == A_NETBUF_LEN(skb));
++ }
++
++ AR_DEBUG2_PRINTF("ar6000_tx_complete skb=0x%x data=0x%x len=0x%x sid=%d ",
++ (A_UINT32)skb, (A_UINT32)pPacket->pBuffer,
++ pPacket->ActualLength,
++ streamID);
++
++ /* lock the driver as we update internal state */
++ AR6000_SPIN_LOCK(&ar->arLock, 0);
++
++ ar->arTxPending[streamID]--;
++
++ if ((streamID != WMI_CONTROL_PRI) || bypasswmi) {
++ ar->arTotalTxDataPending--;
++ }
++
++ if (streamID == WMI_CONTROL_PRI)
++ {
++ if (ar->arWMIControlEpFull) {
++ /* since this packet completed, the WMI EP is no longer full */
++ ar->arWMIControlEpFull = FALSE;
++ }
++
++ if (ar->arTxPending[streamID] == 0) {
++ wakeEvent = TRUE;
++ }
++ }
++
++ if (A_FAILED(status)) {
++ AR_DEBUG_PRINTF("%s() -TX ERROR, status: 0x%x\n", __func__,
++ status);
++ AR6000_STAT_INC(ar, tx_errors);
++ } else {
++ AR_DEBUG2_PRINTF("OK\n");
++ AR6000_STAT_INC(ar, tx_packets);
++ ar->arNetStats.tx_bytes += A_NETBUF_LEN(skb);
++#ifdef ADAPTIVE_POWER_THROUGHPUT_CONTROL
++ aptcTR.bytesTransmitted += a_netbuf_to_len(skb);
++ applyAPTCHeuristics(ar);
++#endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */
++ }
++
++ // TODO this needs to be looked at
++ if ((ar->arNetworkType == ADHOC_NETWORK) && ar->arIbssPsEnable
++ && (streamID != WMI_CONTROL_PRI) && mapNo)
++ {
++ mapNo --;
++ ar->arNodeMap[mapNo].txPending --;
++
++ if (!ar->arNodeMap[mapNo].txPending && (mapNo == (ar->arNodeNum - 1))) {
++ A_UINT32 i;
++ for (i = ar->arNodeNum; i > 0; i --) {
++ if (!ar->arNodeMap[i - 1].txPending) {
++ A_MEMZERO(&ar->arNodeMap[i - 1], sizeof(struct ar_node_mapping));
++ ar->arNodeNum --;
++ } else {
++ break;
++ }
++ }
++ }
++ }
++
++ /* Freeing a cookie should not be contingent on either of */
++ /* these flags, just if we have a cookie or not. */
++ /* Can we even get here without a cookie? Fix later. */
++ if (ar->arWmiReady == TRUE || (bypasswmi))
++ {
++ ar6000_free_cookie(ar, cookie);
++ }
++
++ AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++
++ /* lock is released, we can freely call other kernel APIs */
++
++ /* this indirectly frees the HTC_PACKET */
++ A_NETBUF_FREE(skb);
++
++ if (wakeEvent) {
++ wake_up(&arEvent);
++ }
++}
++
++/*
++ * Receive event handler. This is called by HTC when a packet is received
++ */
++int pktcount;
++static void
++ar6000_rx(void *Context, HTC_PACKET *pPacket)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)Context;
++ struct sk_buff *skb = (struct sk_buff *)pPacket->pPktContext;
++ int minHdrLen;
++ A_STATUS status = pPacket->Status;
++ WMI_PRI_STREAM_ID streamID = arEndpoint2WMIStreamID(ar,pPacket->Endpoint);
++ HTC_ENDPOINT_ID ept = pPacket->Endpoint;
++
++ A_ASSERT((status != A_OK) || (pPacket->pBuffer == (A_NETBUF_DATA(skb) + HTC_HEADER_LEN)));
++
++ AR_DEBUG2_PRINTF("ar6000_rx ar=0x%x sid=%d, skb=0x%x, data=0x%x, len=0x%x ",
++ (A_UINT32)ar, streamID, (A_UINT32)skb, (A_UINT32)pPacket->pBuffer,
++ pPacket->ActualLength);
++ if (status != A_OK) {
++ AR_DEBUG2_PRINTF("ERR\n");
++ } else {
++ AR_DEBUG2_PRINTF("OK\n");
++ }
++
++ /* take lock to protect buffer counts
++ * and adaptive power throughput state */
++ AR6000_SPIN_LOCK(&ar->arLock, 0);
++
++ ar->arRxBuffers[streamID]--;
++
++ if (A_SUCCESS(status)) {
++ AR6000_STAT_INC(ar, rx_packets);
++ ar->arNetStats.rx_bytes += pPacket->ActualLength;
++#ifdef ADAPTIVE_POWER_THROUGHPUT_CONTROL
++ aptcTR.bytesReceived += a_netbuf_to_len(skb);
++ applyAPTCHeuristics(ar);
++#endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */
++
++ A_NETBUF_PUT(skb, pPacket->ActualLength + HTC_HEADER_LEN);
++ A_NETBUF_PULL(skb, HTC_HEADER_LEN);
++
++#ifdef DEBUG
++ if (debugdriver >= 2) {
++ ar6000_dump_skb(skb);
++ }
++#endif /* DEBUG */
++ }
++
++ AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++
++ if (status != A_OK) {
++ AR6000_STAT_INC(ar, rx_errors);
++ A_NETBUF_FREE(skb);
++ } else if (ar->arWmiEnabled == TRUE) {
++ if (streamID == WMI_CONTROL_PRI) {
++ /*
++ * this is a wmi control msg
++ */
++ wmi_control_rx(ar->arWmi, skb);
++ } else {
++ WMI_DATA_HDR *dhdr = (WMI_DATA_HDR *)A_NETBUF_DATA(skb);
++ if (WMI_DATA_HDR_IS_MSG_TYPE(dhdr, CNTL_MSGTYPE)) {
++ /*
++ * this is a wmi control msg
++ */
++ /* strip off WMI hdr */
++ wmi_data_hdr_remove(ar->arWmi, skb);
++ wmi_control_rx(ar->arWmi, skb);
++ } else {
++ /*
++ * this is a wmi data packet
++ */
++ minHdrLen = sizeof (WMI_DATA_HDR) + sizeof(ATH_MAC_HDR) +
++ sizeof(ATH_LLC_SNAP_HDR);
++
++ if ((pPacket->ActualLength < minHdrLen) ||
++ (pPacket->ActualLength > AR6000_BUFFER_SIZE))
++ {
++ /*
++ * packet is too short or too long
++ */
++ AR_DEBUG_PRINTF("TOO SHORT or TOO LONG\n");
++ AR6000_STAT_INC(ar, rx_errors);
++ AR6000_STAT_INC(ar, rx_length_errors);
++ A_NETBUF_FREE(skb);
++ } else {
++ if (ar->arWmmEnabled) {
++ wmi_implicit_create_pstream(ar->arWmi, skb,
++ DNLINK_TRAFFIC, UNDEFINED_PRI);
++ }
++#if 0
++ /* Access RSSI values here */
++ AR_DEBUG_PRINTF("RSSI %d\n",
++ ((WMI_DATA_HDR *) A_NETBUF_DATA(skb))->rssi);
++#endif
++ wmi_data_hdr_remove(ar->arWmi, skb);
++ wmi_dot3_2_dix(ar->arWmi, skb);
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
++ /*
++ * extra push and memcpy, for eth_type_trans() of 2.4 kernel
++ * will pull out hard_header_len bytes of the skb.
++ */
++ A_NETBUF_PUSH(skb, sizeof(WMI_DATA_HDR) + sizeof(ATH_LLC_SNAP_HDR) + HTC_HEADER_LEN);
++ A_MEMCPY(A_NETBUF_DATA(skb), A_NETBUF_DATA(skb) + sizeof(WMI_DATA_HDR) +
++ sizeof(ATH_LLC_SNAP_HDR) + HTC_HEADER_LEN, sizeof(ATH_MAC_HDR));
++#endif
++ if ((ar->arNetDev->flags & IFF_UP) == IFF_UP)
++ {
++ skb->dev = ar->arNetDev;
++ skb->protocol = eth_type_trans(skb, ar->arNetDev);
++ netif_rx(skb);
++ }
++ else
++ {
++ A_NETBUF_FREE(skb);
++ }
++ }
++ }
++ }
++ } else {
++ if ((ar->arNetDev->flags & IFF_UP) == IFF_UP)
++ {
++ skb->dev = ar->arNetDev;
++ skb->protocol = eth_type_trans(skb, ar->arNetDev);
++ netif_rx(skb);
++ }
++ else
++ {
++ A_NETBUF_FREE(skb);
++ }
++ }
++
++ if (status != A_ECANCELED) {
++ /*
++ * HTC provides A_ECANCELED status when it doesn't want to be refilled
++ * (probably due to a shutdown)
++ */
++ ar6000_rx_refill(Context, ept);
++ }
++
++
++}
++
++static void
++ar6000_rx_refill(void *Context, HTC_ENDPOINT_ID Endpoint)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)Context;
++ void *osBuf;
++ int RxBuffers;
++ int buffersToRefill;
++ HTC_PACKET *pPacket;
++ WMI_PRI_STREAM_ID streamId = arEndpoint2WMIStreamID(ar,Endpoint);
++
++ buffersToRefill = (int)AR6000_MAX_RX_BUFFERS -
++ (int)ar->arRxBuffers[streamId];
++
++ if (buffersToRefill <= 0) {
++ /* fast return, nothing to fill */
++ return;
++ }
++
++ AR_DEBUG2_PRINTF("ar6000_rx_refill: providing htc with %d buffers at eid=%d\n",
++ buffersToRefill, Endpoint);
++
++ for (RxBuffers = 0; RxBuffers < buffersToRefill; RxBuffers++) {
++ osBuf = A_NETBUF_ALLOC(AR6000_BUFFER_SIZE);
++ if (NULL == osBuf) {
++ break;
++ }
++ /* the HTC packet wrapper is at the head of the reserved area
++ * in the skb */
++ pPacket = (HTC_PACKET *)(A_NETBUF_HEAD(osBuf));
++ /* set re-fill info */
++ SET_HTC_PACKET_INFO_RX_REFILL(pPacket,osBuf,A_NETBUF_DATA(osBuf),AR6000_BUFFER_SIZE,Endpoint);
++ /* add this packet */
++ HTCAddReceivePkt(ar->arHtcTarget, pPacket);
++ }
++
++ /* update count */
++ AR6000_SPIN_LOCK(&ar->arLock, 0);
++ ar->arRxBuffers[streamId] += RxBuffers;
++ AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++}
++
++static struct net_device_stats *
++ar6000_get_stats(struct net_device *dev)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ return &ar->arNetStats;
++}
++
++static struct iw_statistics *
++ar6000_get_iwstats(struct net_device * dev)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ TARGET_STATS *pStats = &ar->arTargetStats;
++ struct iw_statistics * pIwStats = &ar->arIwStats;
++
++ if ((ar->arWmiReady == FALSE)
++ /*
++ * The in_atomic function is used to determine if the scheduling is
++ * allowed in the current context or not. This was introduced in 2.6
++ * From what I have read on the differences between 2.4 and 2.6, the
++ * 2.4 kernel did not support preemption and so this check might not
++ * be required for 2.4 kernels.
++ */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
++ || (in_atomic())
++#endif
++ )
++ {
++ pIwStats->status = 0;
++ pIwStats->qual.qual = 0;
++ pIwStats->qual.level =0;
++ pIwStats->qual.noise = 0;
++ pIwStats->discard.code =0;
++ pIwStats->discard.retries=0;
++ pIwStats->miss.beacon =0;
++ return pIwStats;
++ }
++ if (down_interruptible(&ar->arSem)) {
++ pIwStats->status = 0;
++ return pIwStats;
++ }
++
++
++ ar->statsUpdatePending = TRUE;
++
++ if(wmi_get_stats_cmd(ar->arWmi) != A_OK) {
++ up(&ar->arSem);
++ pIwStats->status = 0;
++ return pIwStats;
++ }
++
++ wait_event_interruptible_timeout(arEvent, ar->statsUpdatePending == FALSE, wmitimeout * HZ);
++
++ if (signal_pending(current)) {
++ AR_DEBUG_PRINTF("ar6000 : WMI get stats timeout \n");
++ up(&ar->arSem);
++ pIwStats->status = 0;
++ return pIwStats;
++ }
++ pIwStats->status = 1 ;
++ pIwStats->qual.qual = pStats->cs_aveBeacon_rssi;
++ pIwStats->qual.level =pStats->cs_aveBeacon_rssi + 161; /* noise is -95 dBm */
++ pIwStats->qual.noise = pStats->noise_floor_calibation;
++ pIwStats->discard.code = pStats->rx_decrypt_err;
++ pIwStats->discard.retries = pStats->tx_retry_cnt;
++ pIwStats->miss.beacon = pStats->cs_bmiss_cnt;
++ up(&ar->arSem);
++ return pIwStats;
++}
++
++void
++ar6000_ready_event(void *devt, A_UINT8 *datap, A_UINT8 phyCap)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)devt;
++ struct net_device *dev = ar->arNetDev;
++
++ ar->arWmiReady = TRUE;
++ wake_up(&arEvent);
++ A_MEMCPY(dev->dev_addr, datap, AR6000_ETH_ADDR_LEN);
++ AR_DEBUG_PRINTF("mac address = %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n",
++ dev->dev_addr[0], dev->dev_addr[1],
++ dev->dev_addr[2], dev->dev_addr[3],
++ dev->dev_addr[4], dev->dev_addr[5]);
++
++ ar->arPhyCapability = phyCap;
++}
++
++A_UINT8
++ar6000_iptos_to_userPriority(A_UINT8 *pkt)
++{
++ struct iphdr *ipHdr = (struct iphdr *)pkt;
++ A_UINT8 userPriority;
++
++ /*
++ * IP Tos format :
++ * (Refer Pg 57 WMM-test-plan-v1.2)
++ * IP-TOS - 8bits
++ * : DSCP(6-bits) ECN(2-bits)
++ * : DSCP - P2 P1 P0 X X X
++ * where (P2 P1 P0) form 802.1D
++ */
++ userPriority = ipHdr->tos >> 5;
++ return (userPriority & 0x7);
++}
++
++void
++ar6000_connect_event(AR_SOFTC_T *ar, A_UINT16 channel, A_UINT8 *bssid,
++ A_UINT16 listenInterval, A_UINT16 beaconInterval,
++ NETWORK_TYPE networkType, A_UINT8 beaconIeLen,
++ A_UINT8 assocReqLen, A_UINT8 assocRespLen,
++ A_UINT8 *assocInfo)
++{
++ union iwreq_data wrqu;
++ int i, beacon_ie_pos, assoc_resp_ie_pos, assoc_req_ie_pos;
++ static const char *tag1 = "ASSOCINFO(ReqIEs=";
++ static const char *tag2 = "ASSOCRESPIE=";
++ static const char *beaconIetag = "BEACONIE=";
++ char buf[WMI_CONTROL_MSG_MAX_LEN * 2 + sizeof(tag1)];
++ char *pos;
++ A_UINT8 key_op_ctrl;
++
++ A_MEMCPY(ar->arBssid, bssid, sizeof(ar->arBssid));
++ ar->arBssChannel = channel;
++
++ A_PRINTF("AR6000 connected event on freq %d ", channel);
++ A_PRINTF("with bssid %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x "
++ " listenInterval=%d, beaconInterval = %d, beaconIeLen = %d assocReqLen=%d"
++ " assocRespLen =%d\n",
++ bssid[0], bssid[1], bssid[2],
++ bssid[3], bssid[4], bssid[5],
++ listenInterval, beaconInterval,
++ beaconIeLen, assocReqLen, assocRespLen);
++ if (networkType & ADHOC_NETWORK) {
++ if (networkType & ADHOC_CREATOR) {
++ A_PRINTF("Network: Adhoc (Creator)\n");
++ } else {
++ A_PRINTF("Network: Adhoc (Joiner)\n");
++ }
++ } else {
++ A_PRINTF("Network: Infrastructure\n");
++ }
++
++ if (beaconIeLen && (sizeof(buf) > (9 + beaconIeLen * 2))) {
++ AR_DEBUG_PRINTF("\nBeaconIEs= ");
++
++ beacon_ie_pos = 0;
++ A_MEMZERO(buf, sizeof(buf));
++ sprintf(buf, "%s", beaconIetag);
++ pos = buf + 9;
++ for (i = beacon_ie_pos; i < beacon_ie_pos + beaconIeLen; i++) {
++ AR_DEBUG_PRINTF("%2.2x ", assocInfo[i]);
++ sprintf(pos, "%2.2x", assocInfo[i]);
++ pos += 2;
++ }
++ AR_DEBUG_PRINTF("\n");
++
++ A_MEMZERO(&wrqu, sizeof(wrqu));
++ wrqu.data.length = strlen(buf);
++ wireless_send_event(ar->arNetDev, IWEVCUSTOM, &wrqu, buf);
++ }
++
++ if (assocRespLen && (sizeof(buf) > (12 + (assocRespLen * 2))))
++ {
++ assoc_resp_ie_pos = beaconIeLen + assocReqLen +
++ sizeof(A_UINT16) + /* capinfo*/
++ sizeof(A_UINT16) + /* status Code */
++ sizeof(A_UINT16) ; /* associd */
++ A_MEMZERO(buf, sizeof(buf));
++ sprintf(buf, "%s", tag2);
++ pos = buf + 12;
++ AR_DEBUG_PRINTF("\nAssocRespIEs= ");
++ /*
++ * The Association Response Frame w.o. the WLAN header is delivered to
++ * the host, so skip over to the IEs
++ */
++ for (i = assoc_resp_ie_pos; i < assoc_resp_ie_pos + assocRespLen - 6; i++)
++ {
++ AR_DEBUG_PRINTF("%2.2x ", assocInfo[i]);
++ sprintf(pos, "%2.2x", assocInfo[i]);
++ pos += 2;
++ }
++ AR_DEBUG_PRINTF("\n");
++
++ A_MEMZERO(&wrqu, sizeof(wrqu));
++ wrqu.data.length = strlen(buf);
++ wireless_send_event(ar->arNetDev, IWEVCUSTOM, &wrqu, buf);
++ }
++
++ if (assocReqLen && (sizeof(buf) > (17 + (assocReqLen * 2)))) {
++ /*
++ * assoc Request includes capability and listen interval. Skip these.
++ */
++ assoc_req_ie_pos = beaconIeLen +
++ sizeof(A_UINT16) + /* capinfo*/
++ sizeof(A_UINT16); /* listen interval */
++
++ A_MEMZERO(buf, sizeof(buf));
++ sprintf(buf, "%s", tag1);
++ pos = buf + 17;
++ AR_DEBUG_PRINTF("AssocReqIEs= ");
++ for (i = assoc_req_ie_pos; i < assoc_req_ie_pos + assocReqLen - 4; i++) {
++ AR_DEBUG_PRINTF("%2.2x ", assocInfo[i]);
++ sprintf(pos, "%2.2x", assocInfo[i]);
++ pos += 2;;
++ }
++ AR_DEBUG_PRINTF("\n");
++
++ A_MEMZERO(&wrqu, sizeof(wrqu));
++ wrqu.data.length = strlen(buf);
++ wireless_send_event(ar->arNetDev, IWEVCUSTOM, &wrqu, buf);
++ }
++
++#ifdef USER_KEYS
++ if (ar->user_savedkeys_stat == USER_SAVEDKEYS_STAT_RUN &&
++ ar->user_saved_keys.keyOk == TRUE)
++ {
++
++ key_op_ctrl = KEY_OP_VALID_MASK & ~KEY_OP_INIT_TSC;
++ if (ar->user_key_ctrl & AR6000_USER_SETKEYS_RSC_UNCHANGED) {
++ key_op_ctrl &= ~KEY_OP_INIT_RSC;
++ } else {
++ key_op_ctrl |= KEY_OP_INIT_RSC;
++ }
++ ar6000_reinstall_keys(ar, key_op_ctrl);
++ }
++#endif /* USER_KEYS */
++
++ /* flush data queues */
++ ar6000_TxDataCleanup(ar);
++
++ netif_start_queue(ar->arNetDev);
++
++ if ((OPEN_AUTH == ar->arDot11AuthMode) &&
++ (NONE_AUTH == ar->arAuthMode) &&
++ (WEP_CRYPT == ar->arPairwiseCrypto))
++ {
++ if (!ar->arConnected) {
++ ar6000_install_static_wep_keys(ar);
++ }
++ }
++
++ ar->arConnected = TRUE;
++ ar->arConnectPending = FALSE;
++
++ reconnect_flag = 0;
++
++ A_MEMZERO(&wrqu, sizeof(wrqu));
++ A_MEMCPY(wrqu.addr.sa_data, bssid, IEEE80211_ADDR_LEN);
++ wrqu.addr.sa_family = ARPHRD_ETHER;
++ wireless_send_event(ar->arNetDev, SIOCGIWAP, &wrqu, NULL);
++ if ((ar->arNetworkType == ADHOC_NETWORK) && ar->arIbssPsEnable) {
++ A_MEMZERO(ar->arNodeMap, sizeof(ar->arNodeMap));
++ ar->arNodeNum = 0;
++ ar->arNexEpId = ENDPOINT_2;
++ }
++
++}
++
++void ar6000_set_numdataendpts(AR_SOFTC_T *ar, A_UINT32 num)
++{
++ A_ASSERT(num <= (HTC_MAILBOX_NUM_MAX - 1));
++ ar->arNumDataEndPts = num;
++}
++
++void
++ar6000_disconnect_event(AR_SOFTC_T *ar, A_UINT8 reason, A_UINT8 *bssid,
++ A_UINT8 assocRespLen, A_UINT8 *assocInfo, A_UINT16 protocolReasonStatus)
++{
++ A_UINT8 i;
++
++ A_PRINTF("AR6000 disconnected");
++ if (bssid[0] || bssid[1] || bssid[2] || bssid[3] || bssid[4] || bssid[5]) {
++ A_PRINTF(" from %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x ",
++ bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], bssid[5]);
++ }
++ A_PRINTF("\n");
++
++ AR_DEBUG_PRINTF("\nDisconnect Reason is %d", reason);
++ AR_DEBUG_PRINTF("\nProtocol Reason/Status Code is %d", protocolReasonStatus);
++ AR_DEBUG_PRINTF("\nAssocResp Frame = %s",
++ assocRespLen ? " " : "NULL");
++ for (i = 0; i < assocRespLen; i++) {
++ if (!(i % 0x10)) {
++ AR_DEBUG_PRINTF("\n");
++ }
++ AR_DEBUG_PRINTF("%2.2x ", assocInfo[i]);
++ }
++ AR_DEBUG_PRINTF("\n");
++ /*
++ * If the event is due to disconnect cmd from the host, only they the target
++ * would stop trying to connect. Under any other condition, target would
++ * keep trying to connect.
++ *
++ */
++ if( reason == DISCONNECT_CMD)
++ {
++ ar->arConnectPending = FALSE;
++ } else {
++ ar->arConnectPending = TRUE;
++ if (((reason == ASSOC_FAILED) && (protocolReasonStatus == 0x11)) ||
++ ((reason == ASSOC_FAILED) && (protocolReasonStatus == 0x0) && (reconnect_flag == 1))) {
++ ar->arConnected = TRUE;
++ return;
++ }
++ }
++ ar->arConnected = FALSE;
++
++ if( (reason != CSERV_DISCONNECT) || (reconnect_flag != 1) ) {
++ reconnect_flag = 0;
++ }
++
++#ifdef USER_KEYS
++ if (reason != CSERV_DISCONNECT)
++ {
++ ar->user_savedkeys_stat = USER_SAVEDKEYS_STAT_INIT;
++ ar->user_key_ctrl = 0;
++ }
++#endif /* USER_KEYS */
++
++ netif_stop_queue(ar->arNetDev);
++ A_MEMZERO(ar->arBssid, sizeof(ar->arBssid));
++ ar->arBssChannel = 0;
++ ar->arBeaconInterval = 0;
++
++ ar6000_TxDataCleanup(ar);
++}
++
++void
++ar6000_regDomain_event(AR_SOFTC_T *ar, A_UINT32 regCode)
++{
++ A_PRINTF("AR6000 Reg Code = 0x%x\n", regCode);
++ ar->arRegCode = regCode;
++}
++
++void
++ar6000_neighborReport_event(AR_SOFTC_T *ar, int numAps, WMI_NEIGHBOR_INFO *info)
++{
++ static const char *tag = "PRE-AUTH";
++ char buf[128];
++ union iwreq_data wrqu;
++ int i;
++
++ AR_DEBUG_PRINTF("AR6000 Neighbor Report Event\n");
++ for (i=0; i < numAps; info++, i++) {
++ AR_DEBUG_PRINTF("bssid %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x ",
++ info->bssid[0], info->bssid[1], info->bssid[2],
++ info->bssid[3], info->bssid[4], info->bssid[5]);
++ if (info->bssFlags & WMI_PREAUTH_CAPABLE_BSS) {
++ AR_DEBUG_PRINTF("preauth-cap");
++ }
++ if (info->bssFlags & WMI_PMKID_VALID_BSS) {
++ AR_DEBUG_PRINTF(" pmkid-valid\n");
++ continue; /* we skip bss if the pmkid is already valid */
++ }
++ AR_DEBUG_PRINTF("\n");
++ snprintf(buf, sizeof(buf), "%s%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x",
++ tag,
++ info->bssid[0], info->bssid[1], info->bssid[2],
++ info->bssid[3], info->bssid[4], info->bssid[5],
++ i, info->bssFlags);
++ A_MEMZERO(&wrqu, sizeof(wrqu));
++ wrqu.data.length = strlen(buf);
++ wireless_send_event(ar->arNetDev, IWEVCUSTOM, &wrqu, buf);
++ }
++}
++
++void
++ar6000_tkip_micerr_event(AR_SOFTC_T *ar, A_UINT8 keyid, A_BOOL ismcast)
++{
++ static const char *tag = "MLME-MICHAELMICFAILURE.indication";
++ char buf[128];
++ union iwreq_data wrqu;
++
++ A_PRINTF("AR6000 TKIP MIC error received for keyid %d %scast\n",
++ keyid, ismcast ? "multi": "uni");
++ snprintf(buf, sizeof(buf), "%s(keyid=%d %scat)", tag, keyid,
++ ismcast ? "multi" : "uni");
++ memset(&wrqu, 0, sizeof(wrqu));
++ wrqu.data.length = strlen(buf);
++ wireless_send_event(ar->arNetDev, IWEVCUSTOM, &wrqu, buf);
++}
++
++void
++ar6000_scanComplete_event(AR_SOFTC_T *ar, A_STATUS status)
++{
++ AR_DEBUG_PRINTF("AR6000 scan complete: %d\n", status);
++
++ ar->scan_complete = 1;
++ wake_up_interruptible(&ar6000_scan_queue);
++}
++
++void
++ar6000_targetStats_event(AR_SOFTC_T *ar, WMI_TARGET_STATS *pTarget)
++{
++ TARGET_STATS *pStats = &ar->arTargetStats;
++ A_UINT8 ac;
++
++ /*A_PRINTF("AR6000 updating target stats\n");*/
++ pStats->tx_packets += pTarget->txrxStats.tx_stats.tx_packets;
++ pStats->tx_bytes += pTarget->txrxStats.tx_stats.tx_bytes;
++ pStats->tx_unicast_pkts += pTarget->txrxStats.tx_stats.tx_unicast_pkts;
++ pStats->tx_unicast_bytes += pTarget->txrxStats.tx_stats.tx_unicast_bytes;
++ pStats->tx_multicast_pkts += pTarget->txrxStats.tx_stats.tx_multicast_pkts;
++ pStats->tx_multicast_bytes += pTarget->txrxStats.tx_stats.tx_multicast_bytes;
++ pStats->tx_broadcast_pkts += pTarget->txrxStats.tx_stats.tx_broadcast_pkts;
++ pStats->tx_broadcast_bytes += pTarget->txrxStats.tx_stats.tx_broadcast_bytes;
++ pStats->tx_rts_success_cnt += pTarget->txrxStats.tx_stats.tx_rts_success_cnt;
++ for(ac = 0; ac < WMM_NUM_AC; ac++)
++ pStats->tx_packet_per_ac[ac] += pTarget->txrxStats.tx_stats.tx_packet_per_ac[ac];
++ pStats->tx_errors += pTarget->txrxStats.tx_stats.tx_errors;
++ pStats->tx_failed_cnt += pTarget->txrxStats.tx_stats.tx_failed_cnt;
++ pStats->tx_retry_cnt += pTarget->txrxStats.tx_stats.tx_retry_cnt;
++ pStats->tx_rts_fail_cnt += pTarget->txrxStats.tx_stats.tx_rts_fail_cnt;
++ pStats->tx_unicast_rate = wmi_get_rate(pTarget->txrxStats.tx_stats.tx_unicast_rate);
++
++ pStats->rx_packets += pTarget->txrxStats.rx_stats.rx_packets;
++ pStats->rx_bytes += pTarget->txrxStats.rx_stats.rx_bytes;
++ pStats->rx_unicast_pkts += pTarget->txrxStats.rx_stats.rx_unicast_pkts;
++ pStats->rx_unicast_bytes += pTarget->txrxStats.rx_stats.rx_unicast_bytes;
++ pStats->rx_multicast_pkts += pTarget->txrxStats.rx_stats.rx_multicast_pkts;
++ pStats->rx_multicast_bytes += pTarget->txrxStats.rx_stats.rx_multicast_bytes;
++ pStats->rx_broadcast_pkts += pTarget->txrxStats.rx_stats.rx_broadcast_pkts;
++ pStats->rx_broadcast_bytes += pTarget->txrxStats.rx_stats.rx_broadcast_bytes;
++ pStats->rx_fragment_pkt += pTarget->txrxStats.rx_stats.rx_fragment_pkt;
++ pStats->rx_errors += pTarget->txrxStats.rx_stats.rx_errors;
++ pStats->rx_crcerr += pTarget->txrxStats.rx_stats.rx_crcerr;
++ pStats->rx_key_cache_miss += pTarget->txrxStats.rx_stats.rx_key_cache_miss;
++ pStats->rx_decrypt_err += pTarget->txrxStats.rx_stats.rx_decrypt_err;
++ pStats->rx_duplicate_frames += pTarget->txrxStats.rx_stats.rx_duplicate_frames;
++ pStats->rx_unicast_rate = wmi_get_rate(pTarget->txrxStats.rx_stats.rx_unicast_rate);
++
++
++ pStats->tkip_local_mic_failure
++ += pTarget->txrxStats.tkipCcmpStats.tkip_local_mic_failure;
++ pStats->tkip_counter_measures_invoked
++ += pTarget->txrxStats.tkipCcmpStats.tkip_counter_measures_invoked;
++ pStats->tkip_replays += pTarget->txrxStats.tkipCcmpStats.tkip_replays;
++ pStats->tkip_format_errors += pTarget->txrxStats.tkipCcmpStats.tkip_format_errors;
++ pStats->ccmp_format_errors += pTarget->txrxStats.tkipCcmpStats.ccmp_format_errors;
++ pStats->ccmp_replays += pTarget->txrxStats.tkipCcmpStats.ccmp_replays;
++
++
++ pStats->power_save_failure_cnt += pTarget->pmStats.power_save_failure_cnt;
++ pStats->noise_floor_calibation = pTarget->noise_floor_calibation;
++
++ pStats->cs_bmiss_cnt += pTarget->cservStats.cs_bmiss_cnt;
++ pStats->cs_lowRssi_cnt += pTarget->cservStats.cs_lowRssi_cnt;
++ pStats->cs_connect_cnt += pTarget->cservStats.cs_connect_cnt;
++ pStats->cs_disconnect_cnt += pTarget->cservStats.cs_disconnect_cnt;
++ pStats->cs_aveBeacon_snr = pTarget->cservStats.cs_aveBeacon_snr;
++ pStats->cs_aveBeacon_rssi = pTarget->cservStats.cs_aveBeacon_rssi;
++ pStats->cs_lastRoam_msec = pTarget->cservStats.cs_lastRoam_msec;
++ pStats->cs_snr = pTarget->cservStats.cs_snr;
++ pStats->cs_rssi = pTarget->cservStats.cs_rssi;
++
++ pStats->lq_val = pTarget->lqVal;
++
++ pStats->wow_num_pkts_dropped += pTarget->wowStats.wow_num_pkts_dropped;
++ pStats->wow_num_host_pkt_wakeups += pTarget->wowStats.wow_num_host_pkt_wakeups;
++ pStats->wow_num_host_event_wakeups += pTarget->wowStats.wow_num_host_event_wakeups;
++ pStats->wow_num_events_discarded += pTarget->wowStats.wow_num_events_discarded;
++
++ ar->statsUpdatePending = FALSE;
++ wake_up(&arEvent);
++}
++
++void
++ar6000_rssiThreshold_event(AR_SOFTC_T *ar, WMI_RSSI_THRESHOLD_VAL newThreshold, A_INT16 rssi)
++{
++ USER_RSSI_THOLD userRssiThold;
++
++ userRssiThold.tag = rssi_map[newThreshold].tag;
++ userRssiThold.rssi = rssi;
++ AR_DEBUG2_PRINTF("rssi Threshold range = %d tag = %d rssi = %d\n", newThreshold, userRssiThold.tag, rssi);
++#ifdef SEND_EVENT_TO_APP
++ ar6000_send_event_to_app(ar, WMI_RSSI_THRESHOLD_EVENTID,(A_UINT8 *)&userRssiThold, sizeof(USER_RSSI_THOLD));
++#endif
++}
++
++
++void
++ar6000_hbChallengeResp_event(AR_SOFTC_T *ar, A_UINT32 cookie, A_UINT32 source)
++{
++ if (source == APP_HB_CHALLENGE) {
++ /* Report it to the app in case it wants a positive acknowledgement */
++#ifdef SEND_EVENT_TO_APP
++ ar6000_send_event_to_app(ar, WMIX_HB_CHALLENGE_RESP_EVENTID,
++ (A_UINT8 *)&cookie, sizeof(cookie));
++#endif
++ } else {
++ /* This would ignore the replys that come in after their due time */
++ if (cookie == ar->arHBChallengeResp.seqNum) {
++ ar->arHBChallengeResp.outstanding = FALSE;
++ }
++ }
++}
++
++
++void
++ar6000_reportError_event(AR_SOFTC_T *ar, WMI_TARGET_ERROR_VAL errorVal)
++{
++ char *errString[] = {
++ [WMI_TARGET_PM_ERR_FAIL] "WMI_TARGET_PM_ERR_FAIL",
++ [WMI_TARGET_KEY_NOT_FOUND] "WMI_TARGET_KEY_NOT_FOUND",
++ [WMI_TARGET_DECRYPTION_ERR] "WMI_TARGET_DECRYPTION_ERR",
++ [WMI_TARGET_BMISS] "WMI_TARGET_BMISS",
++ [WMI_PSDISABLE_NODE_JOIN] "WMI_PSDISABLE_NODE_JOIN"
++ };
++
++ A_PRINTF("AR6000 Error on Target. Error = 0x%x\n", errorVal);
++
++ /* One error is reported at a time, and errorval is a bitmask */
++ if(errorVal & (errorVal - 1))
++ return;
++
++ A_PRINTF("AR6000 Error type = ");
++ switch(errorVal)
++ {
++ case WMI_TARGET_PM_ERR_FAIL:
++ case WMI_TARGET_KEY_NOT_FOUND:
++ case WMI_TARGET_DECRYPTION_ERR:
++ case WMI_TARGET_BMISS:
++ case WMI_PSDISABLE_NODE_JOIN:
++ A_PRINTF("%s\n", errString[errorVal]);
++ break;
++ default:
++ A_PRINTF("INVALID\n");
++ break;
++ }
++
++}
++
++
++void
++ar6000_cac_event(AR_SOFTC_T *ar, A_UINT8 ac, A_UINT8 cacIndication,
++ A_UINT8 statusCode, A_UINT8 *tspecSuggestion)
++{
++ WMM_TSPEC_IE *tspecIe;
++
++ /*
++ * This is the TSPEC IE suggestion from AP.
++ * Suggestion provided by AP under some error
++ * cases, could be helpful for the host app.
++ * Check documentation.
++ */
++ tspecIe = (WMM_TSPEC_IE *)tspecSuggestion;
++
++ /*
++ * What do we do, if we get TSPEC rejection? One thought
++ * that comes to mind is implictly delete the pstream...
++ */
++ A_PRINTF("AR6000 CAC notification. "
++ "AC = %d, cacIndication = 0x%x, statusCode = 0x%x\n",
++ ac, cacIndication, statusCode);
++}
++
++#define AR6000_PRINT_BSSID(_pBss) do { \
++ A_PRINTF("%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x ",\
++ (_pBss)[0],(_pBss)[1],(_pBss)[2],(_pBss)[3],\
++ (_pBss)[4],(_pBss)[5]); \
++} while(0)
++
++void
++ar6000_roam_tbl_event(AR_SOFTC_T *ar, WMI_TARGET_ROAM_TBL *pTbl)
++{
++ A_UINT8 i;
++
++ A_PRINTF("ROAM TABLE NO OF ENTRIES is %d ROAM MODE is %d\n",
++ pTbl->numEntries, pTbl->roamMode);
++ for (i= 0; i < pTbl->numEntries; i++) {
++ A_PRINTF("[%d]bssid %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x ", i,
++ pTbl->bssRoamInfo[i].bssid[0], pTbl->bssRoamInfo[i].bssid[1],
++ pTbl->bssRoamInfo[i].bssid[2],
++ pTbl->bssRoamInfo[i].bssid[3],
++ pTbl->bssRoamInfo[i].bssid[4],
++ pTbl->bssRoamInfo[i].bssid[5]);
++ A_PRINTF("RSSI %d RSSIDT %d LAST RSSI %d UTIL %d ROAM_UTIL %d"
++ " BIAS %d\n",
++ pTbl->bssRoamInfo[i].rssi,
++ pTbl->bssRoamInfo[i].rssidt,
++ pTbl->bssRoamInfo[i].last_rssi,
++ pTbl->bssRoamInfo[i].util,
++ pTbl->bssRoamInfo[i].roam_util,
++ pTbl->bssRoamInfo[i].bias);
++ }
++}
++
++void
++ar6000_wow_list_event(struct ar6_softc *ar, A_UINT8 num_filters, WMI_GET_WOW_LIST_REPLY *wow_reply)
++{
++ A_UINT8 i,j;
++
++ /*Each event now contains exactly one filter, see bug 26613*/
++ A_PRINTF("WOW pattern %d of %d patterns\n", wow_reply->this_filter_num, wow_reply->num_filters);
++ A_PRINTF("wow mode = %s host mode = %s\n",
++ (wow_reply->wow_mode == 0? "disabled":"enabled"),
++ (wow_reply->host_mode == 1 ? "awake":"asleep"));
++
++
++ /*If there are no patterns, the reply will only contain generic
++ WoW information. Pattern information will exist only if there are
++ patterns present. Bug 26716*/
++
++ /* If this event contains pattern information, display it*/
++ if (wow_reply->this_filter_num) {
++ i=0;
++ A_PRINTF("id=%d size=%d offset=%d\n",
++ wow_reply->wow_filters[i].wow_filter_id,
++ wow_reply->wow_filters[i].wow_filter_size,
++ wow_reply->wow_filters[i].wow_filter_offset);
++ A_PRINTF("wow pattern = ");
++ for (j=0; j< wow_reply->wow_filters[i].wow_filter_size; j++) {
++ A_PRINTF("%2.2x",wow_reply->wow_filters[i].wow_filter_pattern[j]);
++ }
++
++ A_PRINTF("\nwow mask = ");
++ for (j=0; j< wow_reply->wow_filters[i].wow_filter_size; j++) {
++ A_PRINTF("%2.2x",wow_reply->wow_filters[i].wow_filter_mask[j]);
++ }
++ A_PRINTF("\n");
++ }
++}
++
++/*
++ * Report the Roaming related data collected on the target
++ */
++void
++ar6000_display_roam_time(WMI_TARGET_ROAM_TIME *p)
++{
++ A_PRINTF("Disconnect Data : BSSID: ");
++ AR6000_PRINT_BSSID(p->disassoc_bssid);
++ A_PRINTF(" RSSI %d DISASSOC Time %d NO_TXRX_TIME %d\n",
++ p->disassoc_bss_rssi,p->disassoc_time,
++ p->no_txrx_time);
++ A_PRINTF("Connect Data: BSSID: ");
++ AR6000_PRINT_BSSID(p->assoc_bssid);
++ A_PRINTF(" RSSI %d ASSOC Time %d TXRX_TIME %d\n",
++ p->assoc_bss_rssi,p->assoc_time,
++ p->allow_txrx_time);
++ A_PRINTF("Last Data Tx Time (b4 Disassoc) %d "\
++ "First Data Tx Time (after Assoc) %d\n",
++ p->last_data_txrx_time, p->first_data_txrx_time);
++}
++
++void
++ar6000_roam_data_event(AR_SOFTC_T *ar, WMI_TARGET_ROAM_DATA *p)
++{
++ switch (p->roamDataType) {
++ case ROAM_DATA_TIME:
++ ar6000_display_roam_time(&p->u.roamTime);
++ break;
++ default:
++ break;
++ }
++}
++
++void
++ar6000_bssInfo_event_rx(AR_SOFTC_T *ar, A_UINT8 *datap, int len)
++{
++ struct sk_buff *skb;
++ WMI_BSS_INFO_HDR *bih = (WMI_BSS_INFO_HDR *)datap;
++
++
++ if (!ar->arMgmtFilter) {
++ return;
++ }
++ if (((ar->arMgmtFilter & IEEE80211_FILTER_TYPE_BEACON) &&
++ (bih->frameType != BEACON_FTYPE)) ||
++ ((ar->arMgmtFilter & IEEE80211_FILTER_TYPE_PROBE_RESP) &&
++ (bih->frameType != PROBERESP_FTYPE)))
++ {
++ return;
++ }
++
++ if ((skb = A_NETBUF_ALLOC_RAW(len)) != NULL) {
++
++ A_NETBUF_PUT(skb, len);
++ A_MEMCPY(A_NETBUF_DATA(skb), datap, len);
++ skb->dev = ar->arNetDev;
++ printk("MAC RAW...\n");
++// skb->mac.raw = A_NETBUF_DATA(skb);
++ skb->ip_summed = CHECKSUM_NONE;
++ skb->pkt_type = PACKET_OTHERHOST;
++ skb->protocol = __constant_htons(0x0019);
++ netif_rx(skb);
++ }
++}
++
++A_UINT32 wmiSendCmdNum;
++
++A_STATUS
++ar6000_control_tx(void *devt, void *osbuf, WMI_PRI_STREAM_ID streamID)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)devt;
++ A_STATUS status = A_OK;
++ struct ar_cookie *cookie = NULL;
++ int i;
++
++ /* take lock to protect ar6000_alloc_cookie() */
++ AR6000_SPIN_LOCK(&ar->arLock, 0);
++
++ do {
++
++ AR_DEBUG2_PRINTF("ar_contrstatus = ol_tx: skb=0x%x, len=0x%x, sid=%d\n",
++ (A_UINT32)osbuf, A_NETBUF_LEN(osbuf), streamID);
++
++ if ((streamID == WMI_CONTROL_PRI) && (ar->arWMIControlEpFull)) {
++ /* control endpoint is full, don't allocate resources, we
++ * are just going to drop this packet */
++ cookie = NULL;
++ AR_DEBUG_PRINTF(" WMI Control EP full, dropping packet : 0x%X, len:%d \n",
++ (A_UINT32)osbuf, A_NETBUF_LEN(osbuf));
++ } else {
++ cookie = ar6000_alloc_cookie(ar);
++ }
++
++ if (cookie == NULL) {
++ status = A_NO_MEMORY;
++ break;
++ }
++
++ if(logWmiRawMsgs) {
++ A_PRINTF("WMI cmd send, msgNo %d :", wmiSendCmdNum);
++ for(i = 0; i < a_netbuf_to_len(osbuf); i++)
++ A_PRINTF("%x ", ((A_UINT8 *)a_netbuf_to_data(osbuf))[i]);
++ A_PRINTF("\n");
++ }
++
++ wmiSendCmdNum++;
++
++ } while (FALSE);
++
++ if (cookie != NULL) {
++ /* got a structure to send it out on */
++ ar->arTxPending[streamID]++;
++
++ if (streamID != WMI_CONTROL_PRI) {
++ ar->arTotalTxDataPending++;
++ }
++ }
++
++ AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++
++ if (cookie != NULL) {
++ cookie->arc_bp[0] = (A_UINT32)osbuf;
++ cookie->arc_bp[1] = 0;
++ SET_HTC_PACKET_INFO_TX(&cookie->HtcPkt,
++ cookie,
++ A_NETBUF_DATA(osbuf),
++ A_NETBUF_LEN(osbuf),
++ arWMIStream2EndpointID(ar,streamID),
++ AR6K_CONTROL_PKT_TAG);
++ /* this interface is asynchronous, if there is an error, cleanup will happen in the
++ * TX completion callback */
++ HTCSendPkt(ar->arHtcTarget, &cookie->HtcPkt);
++ status = A_OK;
++ }
++
++ return status;
++}
++
++/* indicate tx activity or inactivity on a WMI stream */
++void ar6000_indicate_tx_activity(void *devt, A_UINT8 TrafficClass, A_BOOL Active)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)devt;
++ WMI_PRI_STREAM_ID streamid;
++
++ if (ar->arWmiEnabled) {
++ streamid = wmi_get_stream_id(ar->arWmi, TrafficClass);
++ } else {
++ /* for mbox ping testing, the traffic class is mapped directly as a stream ID,
++ * see handling of AR6000_XIOCTL_TRAFFIC_ACTIVITY_CHANGE in ioctl.c */
++ streamid = (WMI_PRI_STREAM_ID)TrafficClass;
++ }
++
++ /* notify HTC, this may cause credit distribution changes */
++
++ HTCIndicateActivityChange(ar->arHtcTarget,
++ arWMIStream2EndpointID(ar,streamid),
++ Active);
++
++}
++
++module_init(ar6000_init_module);
++module_exit(ar6000_cleanup_module);
++
++/* Init cookie queue */
++static void
++ar6000_cookie_init(AR_SOFTC_T *ar)
++{
++ A_UINT32 i;
++
++ ar->arCookieList = NULL;
++ A_MEMZERO(s_ar_cookie_mem, sizeof(s_ar_cookie_mem));
++
++ for (i = 0; i < MAX_COOKIE_NUM; i++) {
++ ar6000_free_cookie(ar, &s_ar_cookie_mem[i]);
++ }
++}
++
++/* cleanup cookie queue */
++static void
++ar6000_cookie_cleanup(AR_SOFTC_T *ar)
++{
++ /* It is gone .... */
++ ar->arCookieList = NULL;
++}
++
++/* Init cookie queue */
++static void
++ar6000_free_cookie(AR_SOFTC_T *ar, struct ar_cookie * cookie)
++{
++ /* Insert first */
++ A_ASSERT(ar != NULL);
++ A_ASSERT(cookie != NULL);
++ cookie->arc_list_next = ar->arCookieList;
++ ar->arCookieList = cookie;
++}
++
++/* cleanup cookie queue */
++static struct ar_cookie *
++ar6000_alloc_cookie(AR_SOFTC_T *ar)
++{
++ struct ar_cookie *cookie;
++
++ cookie = ar->arCookieList;
++ if(cookie != NULL)
++ {
++ ar->arCookieList = cookie->arc_list_next;
++ }
++
++ return cookie;
++}
++
++#ifdef SEND_EVENT_TO_APP
++/*
++ * This function is used to send event which come from taget to
++ * the application. The buf which send to application is include
++ * the event ID and event content.
++ */
++#define EVENT_ID_LEN 2
++void ar6000_send_event_to_app(AR_SOFTC_T *ar, A_UINT16 eventId,
++ A_UINT8 *datap, int len)
++{
++
++#if (WIRELESS_EXT >= 15)
++
++/* note: IWEVCUSTOM only exists in wireless extensions after version 15 */
++
++ char *buf;
++ A_UINT16 size;
++ union iwreq_data wrqu;
++
++ size = len + EVENT_ID_LEN;
++
++ if (size > IW_CUSTOM_MAX) {
++ AR_DEBUG_PRINTF("WMI event ID : 0x%4.4X, len = %d too big for IWEVCUSTOM (max=%d) \n",
++ eventId, size, IW_CUSTOM_MAX);
++ return;
++ }
++
++ buf = A_MALLOC_NOWAIT(size);
++ A_MEMZERO(buf, size);
++ A_MEMCPY(buf, &eventId, EVENT_ID_LEN);
++ A_MEMCPY(buf+EVENT_ID_LEN, datap, len);
++
++ //AR_DEBUG_PRINTF("event ID = %d,len = %d\n",*(A_UINT16*)buf, size);
++ A_MEMZERO(&wrqu, sizeof(wrqu));
++ wrqu.data.length = size;
++ wireless_send_event(ar->arNetDev, IWEVCUSTOM, &wrqu, buf);
++
++ A_FREE(buf);
++#endif
++
++
++}
++#endif
++
++
++void
++ar6000_tx_retry_err_event(void *devt)
++{
++ AR_DEBUG2_PRINTF("Tx retries reach maximum!\n");
++}
++
++void
++ar6000_snrThresholdEvent_rx(void *devt, WMI_SNR_THRESHOLD_VAL newThreshold, A_UINT8 snr)
++{
++ AR_DEBUG2_PRINTF("snr threshold range %d, snr %d\n", newThreshold, snr);
++}
++
++void
++ar6000_lqThresholdEvent_rx(void *devt, WMI_LQ_THRESHOLD_VAL newThreshold, A_UINT8 lq)
++{
++ AR_DEBUG2_PRINTF("lq threshold range %d, lq %d\n", newThreshold, lq);
++}
++
++
++
++A_UINT32
++a_copy_to_user(void *to, const void *from, A_UINT32 n)
++{
++ return(copy_to_user(to, from, n));
++}
++
++A_UINT32
++a_copy_from_user(void *to, const void *from, A_UINT32 n)
++{
++ return(copy_from_user(to, from, n));
++}
++
++
++A_STATUS
++ar6000_get_driver_cfg(struct net_device *dev,
++ A_UINT16 cfgParam,
++ void *result)
++{
++
++ A_STATUS ret = 0;
++
++ switch(cfgParam)
++ {
++ case AR6000_DRIVER_CFG_GET_WLANNODECACHING:
++ *((A_UINT32 *)result) = wlanNodeCaching;
++ break;
++ case AR6000_DRIVER_CFG_LOG_RAW_WMI_MSGS:
++ *((A_UINT32 *)result) = logWmiRawMsgs;
++ break;
++ default:
++ ret = EINVAL;
++ break;
++ }
++
++ return ret;
++}
++
++void
++ar6000_keepalive_rx(void *devt, A_UINT8 configured)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)devt;
++
++ ar->arKeepaliveConfigured = configured;
++ wake_up(&arEvent);
++}
++
++void
++ar6000_pmkid_list_event(void *devt, A_UINT8 numPMKID, WMI_PMKID *pmkidList)
++{
++ A_UINT8 i, j;
++
++ A_PRINTF("Number of Cached PMKIDs is %d\n", numPMKID);
++
++ for (i = 0; i < numPMKID; i++) {
++ A_PRINTF("\nPMKID %d ", i);
++ for (j = 0; j < WMI_PMKID_LEN; j++) {
++ A_PRINTF("%2.2x", pmkidList->pmkid[j]);
++ }
++ pmkidList++;
++ }
++}
++
++#ifdef USER_KEYS
++static A_STATUS
++
++ar6000_reinstall_keys(AR_SOFTC_T *ar, A_UINT8 key_op_ctrl)
++{
++ A_STATUS status = A_OK;
++ struct ieee80211req_key *uik = &ar->user_saved_keys.ucast_ik;
++ struct ieee80211req_key *bik = &ar->user_saved_keys.bcast_ik;
++ CRYPTO_TYPE keyType = ar->user_saved_keys.keyType;
++
++ if (IEEE80211_CIPHER_CCKM_KRK != uik->ik_type) {
++ if (NONE_CRYPT == keyType) {
++ goto _reinstall_keys_out;
++ }
++
++ if (uik->ik_keylen) {
++ status = wmi_addKey_cmd(ar->arWmi, uik->ik_keyix,
++ ar->user_saved_keys.keyType, PAIRWISE_USAGE,
++ uik->ik_keylen, (A_UINT8 *)&uik->ik_keyrsc,
++ uik->ik_keydata, key_op_ctrl, SYNC_BEFORE_WMIFLAG);
++ }
++
++ } else {
++ status = wmi_add_krk_cmd(ar->arWmi, uik->ik_keydata);
++ }
++
++ if (IEEE80211_CIPHER_CCKM_KRK != bik->ik_type) {
++ if (NONE_CRYPT == keyType) {
++ goto _reinstall_keys_out;
++ }
++
++ if (bik->ik_keylen) {
++ status = wmi_addKey_cmd(ar->arWmi, bik->ik_keyix,
++ ar->user_saved_keys.keyType, GROUP_USAGE,
++ bik->ik_keylen, (A_UINT8 *)&bik->ik_keyrsc,
++ bik->ik_keydata, key_op_ctrl, NO_SYNC_WMIFLAG);
++ }
++ } else {
++ status = wmi_add_krk_cmd(ar->arWmi, bik->ik_keydata);
++ }
++
++_reinstall_keys_out:
++ ar->user_savedkeys_stat = USER_SAVEDKEYS_STAT_INIT;
++ ar->user_key_ctrl = 0;
++
++ return status;
++}
++#endif /* USER_KEYS */
++
++
++void
++ar6000_dset_open_req(
++ void *context,
++ A_UINT32 id,
++ A_UINT32 targHandle,
++ A_UINT32 targReplyFn,
++ A_UINT32 targReplyArg)
++{
++}
++
++void
++ar6000_dset_close(
++ void *context,
++ A_UINT32 access_cookie)
++{
++ return;
++}
++
++void
++ar6000_dset_data_req(
++ void *context,
++ A_UINT32 accessCookie,
++ A_UINT32 offset,
++ A_UINT32 length,
++ A_UINT32 targBuf,
++ A_UINT32 targReplyFn,
++ A_UINT32 targReplyArg)
++{
++}
+diff --git a/drivers/ar6000/ar6000/ar6000_drv.h b/drivers/ar6000/ar6000/ar6000_drv.h
+new file mode 100644
+index 0000000..3230d32
+--- /dev/null
++++ b/drivers/ar6000/ar6000/ar6000_drv.h
+@@ -0,0 +1,361 @@
++/*
++ *
++ * Copyright (c) 2004-2007 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation;
++ *
++ * Software distributed under the License is distributed on an "AS
++ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
++ * implied. See the License for the specific language governing
++ * rights and limitations under the License.
++ *
++ *
++ *
++ */
++
++#ifndef _AR6000_H_
++#define _AR6000_H_
++
++#include <linux/version.h>
++
++
++#include <generated/autoconf.h>
++#include <linux/init.h>
++#include <linux/kernel.h>
++#include <linux/spinlock.h>
++#include <linux/skbuff.h>
++#include <linux/if_ether.h>
++#include <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <net/iw_handler.h>
++#include <linux/if_arp.h>
++#include <linux/ip.h>
++#include <linux/semaphore.h>
++#include <linux/wireless.h>
++#include <linux/module.h>
++#include <linux/sched.h>
++#include <asm/io.h>
++
++#include <a_config.h>
++#include <athdefs.h>
++#include "a_types.h"
++#include "a_osapi.h"
++#include "htc_api.h"
++#include "wmi.h"
++#include "a_drv.h"
++#include "bmi.h"
++#include <ieee80211.h>
++#include <ieee80211_ioctl.h>
++#include <wlan_api.h>
++#include <wmi_api.h>
++#include "gpio_api.h"
++#include "gpio.h"
++#include <host_version.h>
++#include <linux/rtnetlink.h>
++#include <linux/init.h>
++#include <linux/moduleparam.h>
++#include "AR6Khwreg.h"
++#include "ar6000_api.h"
++#ifdef CONFIG_HOST_TCMD_SUPPORT
++#include <testcmd.h>
++#endif
++
++#include "targaddrs.h"
++#include "dbglog_api.h"
++#include "ar6000_diag.h"
++#include "common_drv.h"
++
++#ifndef __dev_put
++#define __dev_put(dev) dev_put(dev)
++#endif
++
++#ifdef USER_KEYS
++
++#define USER_SAVEDKEYS_STAT_INIT 0
++#define USER_SAVEDKEYS_STAT_RUN 1
++
++// TODO this needs to move into the AR_SOFTC struct
++struct USER_SAVEDKEYS {
++ struct ieee80211req_key ucast_ik;
++ struct ieee80211req_key bcast_ik;
++ CRYPTO_TYPE keyType;
++ A_BOOL keyOk;
++};
++#endif
++
++#define DBG_INFO 0x00000001
++#define DBG_ERROR 0x00000002
++#define DBG_WARNING 0x00000004
++#define DBG_SDIO 0x00000008
++#define DBG_HIF 0x00000010
++#define DBG_HTC 0x00000020
++#define DBG_WMI 0x00000040
++#define DBG_WMI2 0x00000080
++#define DBG_DRIVER 0x00000100
++
++#define DBG_DEFAULTS (DBG_ERROR|DBG_WARNING)
++
++
++#ifdef DEBUG
++#define AR_DEBUG_PRINTF(args...) if (debugdriver) A_PRINTF(args);
++#define AR_DEBUG2_PRINTF(args...) if (debugdriver >= 2) A_PRINTF(args);
++extern int debugdriver;
++#else
++#define AR_DEBUG_PRINTF(args...)
++#define AR_DEBUG2_PRINTF(args...)
++#endif
++
++A_STATUS ar6000_ReadRegDiag(HIF_DEVICE *hifDevice, A_UINT32 *address, A_UINT32 *data);
++A_STATUS ar6000_WriteRegDiag(HIF_DEVICE *hifDevice, A_UINT32 *address, A_UINT32 *data);
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#define MAX_AR6000 1
++#define AR6000_MAX_RX_BUFFERS 16
++#define AR6000_BUFFER_SIZE 1664
++#define AR6000_TX_TIMEOUT 10
++#define AR6000_ETH_ADDR_LEN 6
++#define AR6000_MAX_ENDPOINTS 4
++#define MAX_NODE_NUM 15
++#define MAX_COOKIE_NUM 150
++#define AR6000_HB_CHALLENGE_RESP_FREQ_DEFAULT 1
++#define AR6000_HB_CHALLENGE_RESP_MISS_THRES_DEFAULT 1
++
++enum {
++ DRV_HB_CHALLENGE = 0,
++ APP_HB_CHALLENGE
++};
++
++/* HTC RAW streams */
++typedef enum _HTC_RAW_STREAM_ID {
++ HTC_RAW_STREAM_NOT_MAPPED = -1,
++ HTC_RAW_STREAM_0 = 0,
++ HTC_RAW_STREAM_1 = 1,
++ HTC_RAW_STREAM_2 = 2,
++ HTC_RAW_STREAM_3 = 3,
++ HTC_RAW_STREAM_NUM_MAX
++} HTC_RAW_STREAM_ID;
++
++#define RAW_HTC_READ_BUFFERS_NUM 4
++#define RAW_HTC_WRITE_BUFFERS_NUM 4
++
++typedef struct {
++ int currPtr;
++ int length;
++ unsigned char data[AR6000_BUFFER_SIZE];
++ HTC_PACKET HTCPacket;
++} raw_htc_buffer;
++
++#ifdef CONFIG_HOST_TCMD_SUPPORT
++/*
++ * add TCMD_MODE besides wmi and bypasswmi
++ * in TCMD_MODE, only few TCMD releated wmi commands
++ * counld be hanlder
++ */
++enum {
++ AR6000_WMI_MODE = 0,
++ AR6000_BYPASS_MODE,
++ AR6000_TCMD_MODE,
++ AR6000_WLAN_MODE
++};
++#endif /* CONFIG_HOST_TCMD_SUPPORT */
++
++struct ar_wep_key {
++ A_UINT8 arKeyIndex;
++ A_UINT8 arKeyLen;
++ A_UINT8 arKey[64];
++} ;
++
++struct ar_node_mapping {
++ A_UINT8 macAddress[6];
++ A_UINT8 epId;
++ A_UINT8 txPending;
++};
++
++struct ar_cookie {
++ A_UINT32 arc_bp[2]; /* Must be first field */
++ HTC_PACKET HtcPkt; /* HTC packet wrapper */
++ struct ar_cookie *arc_list_next;
++};
++
++struct ar_hb_chlng_resp {
++ A_TIMER timer;
++ A_UINT32 frequency;
++ A_UINT32 seqNum;
++ A_BOOL outstanding;
++ A_UINT8 missCnt;
++ A_UINT8 missThres;
++};
++
++typedef struct ar6_softc {
++ struct net_device *arNetDev; /* net_device pointer */
++ void *arWmi;
++ int arTxPending[WMI_PRI_MAX_COUNT];
++ int arTotalTxDataPending;
++ A_UINT8 arNumDataEndPts;
++ A_BOOL arWmiEnabled;
++ A_BOOL arWmiReady;
++ A_BOOL arConnected;
++ A_BOOL arRadioSwitch;
++ HTC_HANDLE arHtcTarget;
++ void *arHifDevice;
++ spinlock_t arLock;
++ struct semaphore arSem;
++ int arRxBuffers[WMI_PRI_MAX_COUNT];
++ int arSsidLen;
++ u_char arSsid[32];
++ A_UINT8 arNetworkType;
++ A_UINT8 arDot11AuthMode;
++ A_UINT8 arAuthMode;
++ A_UINT8 arPairwiseCrypto;
++ A_UINT8 arPairwiseCryptoLen;
++ A_UINT8 arGroupCrypto;
++ A_UINT8 arGroupCryptoLen;
++ A_UINT8 arDefTxKeyIndex;
++ struct ar_wep_key arWepKeyList[WMI_MAX_KEY_INDEX + 1];
++ A_UINT8 arBssid[6];
++ A_UINT8 arReqBssid[6];
++ A_UINT16 arChannelHint;
++ A_UINT16 arBssChannel;
++ A_UINT16 arListenInterval;
++ struct ar6000_version arVersion;
++ A_UINT32 arTargetType;
++ A_INT8 arRssi;
++ A_UINT8 arTxPwr;
++ A_BOOL arTxPwrSet;
++ A_INT32 arBitRate;
++ struct net_device_stats arNetStats;
++ struct iw_statistics arIwStats;
++ A_INT8 arNumChannels;
++ A_UINT16 arChannelList[32];
++ A_UINT32 arRegCode;
++ A_BOOL statsUpdatePending;
++ TARGET_STATS arTargetStats;
++ A_INT8 arMaxRetries;
++ A_UINT8 arPhyCapability;
++#ifdef CONFIG_HOST_TCMD_SUPPORT
++ A_UINT8 tcmdRxReport;
++ A_UINT32 tcmdRxTotalPkt;
++ A_INT32 tcmdRxRssi;
++ A_UINT32 tcmdPm;
++ A_UINT32 arTargetMode;
++#endif
++ AR6000_WLAN_STATE arWlanState;
++ struct ar_node_mapping arNodeMap[MAX_NODE_NUM];
++ A_UINT8 arIbssPsEnable;
++ A_UINT8 arNodeNum;
++ A_UINT8 arNexEpId;
++ struct ar_cookie *arCookieList;
++ A_UINT16 arRateMask;
++ A_UINT8 arSkipScan;
++ A_UINT16 arBeaconInterval;
++ A_BOOL arConnectPending;
++ A_BOOL arWmmEnabled;
++ struct ar_hb_chlng_resp arHBChallengeResp;
++ A_UINT8 arKeepaliveConfigured;
++ A_UINT32 arMgmtFilter;
++ HTC_ENDPOINT_ID arWmi2EpMapping[WMI_PRI_MAX_COUNT];
++ WMI_PRI_STREAM_ID arEp2WmiMapping[ENDPOINT_MAX];
++#ifdef HTC_RAW_INTERFACE
++ HTC_ENDPOINT_ID arRaw2EpMapping[HTC_RAW_STREAM_NUM_MAX];
++ HTC_RAW_STREAM_ID arEp2RawMapping[ENDPOINT_MAX];
++ struct semaphore raw_htc_read_sem[HTC_RAW_STREAM_NUM_MAX];
++ struct semaphore raw_htc_write_sem[HTC_RAW_STREAM_NUM_MAX];
++ wait_queue_head_t raw_htc_read_queue[HTC_RAW_STREAM_NUM_MAX];
++ wait_queue_head_t raw_htc_write_queue[HTC_RAW_STREAM_NUM_MAX];
++ raw_htc_buffer *raw_htc_read_buffer[HTC_RAW_STREAM_NUM_MAX][RAW_HTC_READ_BUFFERS_NUM];
++ raw_htc_buffer *raw_htc_write_buffer[HTC_RAW_STREAM_NUM_MAX][RAW_HTC_WRITE_BUFFERS_NUM];
++ A_BOOL write_buffer_available[HTC_RAW_STREAM_NUM_MAX];
++ A_BOOL read_buffer_available[HTC_RAW_STREAM_NUM_MAX];
++#endif
++ A_BOOL arRawIfInit;
++ int arDeviceIndex;
++ COMMON_CREDIT_STATE_INFO arCreditStateInfo;
++ A_BOOL arWMIControlEpFull;
++ A_BOOL dbgLogFetchInProgress;
++ A_UCHAR log_buffer[DBGLOG_HOST_LOG_BUFFER_SIZE];
++ A_UINT32 log_cnt;
++ A_UINT32 dbglog_init_done;
++ A_UINT32 arConnectCtrlFlags;
++ A_UINT32 scan_complete;
++#ifdef USER_KEYS
++ A_INT32 user_savedkeys_stat;
++ A_UINT32 user_key_ctrl;
++ struct USER_SAVEDKEYS user_saved_keys;
++#endif
++} AR_SOFTC_T;
++
++
++#define arWMIStream2EndpointID(ar,wmi) (ar)->arWmi2EpMapping[(wmi)]
++#define arSetWMIStream2EndpointIDMap(ar,wmi,ep) \
++{ (ar)->arWmi2EpMapping[(wmi)] = (ep); \
++ (ar)->arEp2WmiMapping[(ep)] = (wmi); }
++#define arEndpoint2WMIStreamID(ar,ep) (ar)->arEp2WmiMapping[(ep)]
++
++#define arRawIfEnabled(ar) (ar)->arRawIfInit
++#define arRawStream2EndpointID(ar,raw) (ar)->arRaw2EpMapping[(raw)]
++#define arSetRawStream2EndpointIDMap(ar,raw,ep) \
++{ (ar)->arRaw2EpMapping[(raw)] = (ep); \
++ (ar)->arEp2RawMapping[(ep)] = (raw); }
++#define arEndpoint2RawStreamID(ar,ep) (ar)->arEp2RawMapping[(ep)]
++
++struct ar_giwscan_param {
++ char *current_ev;
++ char *end_buf;
++ A_BOOL firstPass;
++};
++
++#define AR6000_STAT_INC(ar, stat) (ar->arNetStats.stat++)
++
++#define AR6000_SPIN_LOCK(lock, param) do { \
++ if (irqs_disabled()) { \
++ AR_DEBUG_PRINTF("IRQs disabled:AR6000_LOCK\n"); \
++ } \
++ spin_lock_bh(lock); \
++} while (0)
++
++#define AR6000_SPIN_UNLOCK(lock, param) do { \
++ if (irqs_disabled()) { \
++ AR_DEBUG_PRINTF("IRQs disabled: AR6000_UNLOCK\n"); \
++ } \
++ spin_unlock_bh(lock); \
++} while (0)
++
++int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
++int ar6000_ioctl_dispatcher(struct net_device *dev, struct ifreq *rq, int cmd);
++void ar6000_ioctl_iwsetup(struct iw_handler_def *def);
++void ar6000_gpio_init(void);
++void ar6000_init_profile_info(AR_SOFTC_T *ar);
++void ar6000_install_static_wep_keys(AR_SOFTC_T *ar);
++int ar6000_init(struct net_device *dev);
++int ar6000_dbglog_get_debug_logs(AR_SOFTC_T *ar);
++A_STATUS ar6000_SetHTCBlockSize(AR_SOFTC_T *ar);
++
++#ifdef HTC_RAW_INTERFACE
++
++#ifndef __user
++#define __user
++#endif
++
++int ar6000_htc_raw_open(AR_SOFTC_T *ar);
++int ar6000_htc_raw_close(AR_SOFTC_T *ar);
++ssize_t ar6000_htc_raw_read(AR_SOFTC_T *ar,
++ HTC_RAW_STREAM_ID StreamID,
++ char __user *buffer, size_t count);
++ssize_t ar6000_htc_raw_write(AR_SOFTC_T *ar,
++ HTC_RAW_STREAM_ID StreamID,
++ char __user *buffer, size_t count);
++
++#endif /* HTC_RAW_INTERFACE */
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* _AR6000_H_ */
+diff --git a/drivers/ar6000/ar6000/ar6000_raw_if.c b/drivers/ar6000/ar6000/ar6000_raw_if.c
+new file mode 100644
+index 0000000..c0d9f8e
+--- /dev/null
++++ b/drivers/ar6000/ar6000/ar6000_raw_if.c
+@@ -0,0 +1,440 @@
++/*
++ *
++ * Copyright (c) 2004-2007 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation;
++ *
++ * Software distributed under the License is distributed on an "AS
++ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
++ * implied. See the License for the specific language governing
++ * rights and limitations under the License.
++ *
++ *
++ *
++ */
++
++#include "ar6000_drv.h"
++
++#ifdef HTC_RAW_INTERFACE
++
++static void
++ar6000_htc_raw_read_cb(void *Context, HTC_PACKET *pPacket)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)Context;
++ raw_htc_buffer *busy;
++ HTC_RAW_STREAM_ID streamID;
++
++ busy = (raw_htc_buffer *)pPacket->pPktContext;
++ A_ASSERT(busy != NULL);
++
++ if (pPacket->Status == A_ECANCELED) {
++ /*
++ * HTC provides A_ECANCELED status when it doesn't want to be refilled
++ * (probably due to a shutdown)
++ */
++ return;
++ }
++
++ streamID = arEndpoint2RawStreamID(ar,pPacket->Endpoint);
++ A_ASSERT(streamID != HTC_RAW_STREAM_NOT_MAPPED);
++
++#ifdef CF
++ if (down_trylock(&ar->raw_htc_read_sem[streamID])) {
++#else
++ if (down_interruptible(&ar->raw_htc_read_sem[streamID])) {
++#endif /* CF */
++ AR_DEBUG2_PRINTF("Unable to down the semaphore\n");
++ }
++
++ A_ASSERT((pPacket->Status != A_OK) ||
++ (pPacket->pBuffer == (busy->data + HTC_HEADER_LEN)));
++
++ busy->length = pPacket->ActualLength + HTC_HEADER_LEN;
++ busy->currPtr = HTC_HEADER_LEN;
++ ar->read_buffer_available[streamID] = TRUE;
++ //AR_DEBUG_PRINTF("raw read cb: 0x%X 0x%X \n", busy->currPtr,busy->length);
++ up(&ar->raw_htc_read_sem[streamID]);
++
++ /* Signal the waiting process */
++ AR_DEBUG2_PRINTF("Waking up the StreamID(%d) read process\n", streamID);
++ wake_up_interruptible(&ar->raw_htc_read_queue[streamID]);
++}
++
++static void
++ar6000_htc_raw_write_cb(void *Context, HTC_PACKET *pPacket)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)Context;
++ raw_htc_buffer *free;
++ HTC_RAW_STREAM_ID streamID;
++
++ free = (raw_htc_buffer *)pPacket->pPktContext;
++ A_ASSERT(free != NULL);
++
++ if (pPacket->Status == A_ECANCELED) {
++ /*
++ * HTC provides A_ECANCELED status when it doesn't want to be refilled
++ * (probably due to a shutdown)
++ */
++ return;
++ }
++
++ streamID = arEndpoint2RawStreamID(ar,pPacket->Endpoint);
++ A_ASSERT(streamID != HTC_RAW_STREAM_NOT_MAPPED);
++
++#ifdef CF
++ if (down_trylock(&ar->raw_htc_write_sem[streamID])) {
++#else
++ if (down_interruptible(&ar->raw_htc_write_sem[streamID])) {
++#endif
++ AR_DEBUG2_PRINTF("Unable to down the semaphore\n");
++ }
++
++ A_ASSERT(pPacket->pBuffer == (free->data + HTC_HEADER_LEN));
++
++ free->length = 0;
++ ar->write_buffer_available[streamID] = TRUE;
++ up(&ar->raw_htc_write_sem[streamID]);
++
++ /* Signal the waiting process */
++ AR_DEBUG2_PRINTF("Waking up the StreamID(%d) write process\n", streamID);
++ wake_up_interruptible(&ar->raw_htc_write_queue[streamID]);
++}
++
++/* connect to a service */
++static A_STATUS ar6000_connect_raw_service(AR_SOFTC_T *ar,
++ HTC_RAW_STREAM_ID StreamID)
++{
++ A_STATUS status;
++ HTC_SERVICE_CONNECT_RESP response;
++ A_UINT8 streamNo;
++ HTC_SERVICE_CONNECT_REQ connect;
++
++ do {
++
++ A_MEMZERO(&connect,sizeof(connect));
++ /* pass the stream ID as meta data to the RAW streams service */
++ streamNo = (A_UINT8)StreamID;
++ connect.pMetaData = &streamNo;
++ connect.MetaDataLength = sizeof(A_UINT8);
++ /* these fields are the same for all endpoints */
++ connect.EpCallbacks.pContext = ar;
++ connect.EpCallbacks.EpTxComplete = ar6000_htc_raw_write_cb;
++ connect.EpCallbacks.EpRecv = ar6000_htc_raw_read_cb;
++ /* simple interface, we don't need these optional callbacks */
++ connect.EpCallbacks.EpRecvRefill = NULL;
++ connect.EpCallbacks.EpSendFull = NULL;
++ connect.EpCallbacks.EpSendAvail = NULL;
++ connect.MaxSendQueueDepth = RAW_HTC_WRITE_BUFFERS_NUM;
++
++ /* connect to the raw streams service, we may be able to get 1 or more
++ * connections, depending on WHAT is running on the target */
++ connect.ServiceID = HTC_RAW_STREAMS_SVC;
++
++ A_MEMZERO(&response,sizeof(response));
++
++ /* try to connect to the raw stream, it is okay if this fails with
++ * status HTC_SERVICE_NO_MORE_EP */
++ status = HTCConnectService(ar->arHtcTarget,
++ &connect,
++ &response);
++
++ if (A_FAILED(status)) {
++ if (response.ConnectRespCode == HTC_SERVICE_NO_MORE_EP) {
++ AR_DEBUG_PRINTF("HTC RAW , No more streams allowed \n");
++ status = A_OK;
++ }
++ break;
++ }
++
++ /* set endpoint mapping for the RAW HTC streams */
++ arSetRawStream2EndpointIDMap(ar,StreamID,response.Endpoint);
++
++ AR_DEBUG_PRINTF("HTC RAW : stream ID: %d, endpoint: %d\n",
++ StreamID, arRawStream2EndpointID(ar,StreamID));
++
++ } while (FALSE);
++
++ return status;
++}
++
++int ar6000_htc_raw_open(AR_SOFTC_T *ar)
++{
++ A_STATUS status;
++ int streamID, endPt, count2;
++ raw_htc_buffer *buffer;
++ HTC_SERVICE_ID servicepriority;
++
++ A_ASSERT(ar->arHtcTarget != NULL);
++
++ /* wait for target */
++ status = HTCWaitTarget(ar->arHtcTarget);
++
++ if (A_FAILED(status)) {
++ AR_DEBUG_PRINTF("HTCWaitTarget failed (%d)\n", status);
++ return -ENODEV;
++ }
++
++ for (endPt = 0; endPt < ENDPOINT_MAX; endPt++) {
++ ar->arEp2RawMapping[endPt] = HTC_RAW_STREAM_NOT_MAPPED;
++ }
++
++ for (streamID = HTC_RAW_STREAM_0; streamID < HTC_RAW_STREAM_NUM_MAX; streamID++) {
++ /* Initialize the data structures */
++ sema_init(&ar->raw_htc_read_sem[streamID], 1);
++ sema_init(&ar->raw_htc_write_sem[streamID], 1);
++ init_waitqueue_head(&ar->raw_htc_read_queue[streamID]);
++ init_waitqueue_head(&ar->raw_htc_write_queue[streamID]);
++
++ /* try to connect to the raw service */
++ status = ar6000_connect_raw_service(ar,streamID);
++
++ if (A_FAILED(status)) {
++ break;
++ }
++
++ if (arRawStream2EndpointID(ar,streamID) == 0) {
++ break;
++ }
++
++ for (count2 = 0; count2 < RAW_HTC_READ_BUFFERS_NUM; count2 ++) {
++ /* Initialize the receive buffers */
++ buffer = ar->raw_htc_write_buffer[streamID][count2];
++ memset(buffer, 0, sizeof(raw_htc_buffer));
++ buffer = ar->raw_htc_read_buffer[streamID][count2];
++ memset(buffer, 0, sizeof(raw_htc_buffer));
++
++ SET_HTC_PACKET_INFO_RX_REFILL(&buffer->HTCPacket,
++ buffer,
++ buffer->data,
++ AR6000_BUFFER_SIZE,
++ arRawStream2EndpointID(ar,streamID));
++
++ /* Queue buffers to HTC for receive */
++ if ((status = HTCAddReceivePkt(ar->arHtcTarget, &buffer->HTCPacket)) != A_OK)
++ {
++ BMIInit();
++ return -EIO;
++ }
++ }
++
++ for (count2 = 0; count2 < RAW_HTC_WRITE_BUFFERS_NUM; count2 ++) {
++ /* Initialize the receive buffers */
++ buffer = ar->raw_htc_write_buffer[streamID][count2];
++ memset(buffer, 0, sizeof(raw_htc_buffer));
++ }
++
++ ar->read_buffer_available[streamID] = FALSE;
++ ar->write_buffer_available[streamID] = TRUE;
++ }
++
++ if (A_FAILED(status)) {
++ return -EIO;
++ }
++
++ AR_DEBUG_PRINTF("HTC RAW, number of streams the target supports: %d \n", streamID);
++
++ servicepriority = HTC_RAW_STREAMS_SVC; /* only 1 */
++
++ /* set callbacks and priority list */
++ HTCSetCreditDistribution(ar->arHtcTarget,
++ ar,
++ NULL, /* use default */
++ NULL, /* use default */
++ &servicepriority,
++ 1);
++
++ /* Start the HTC component */
++ if ((status = HTCStart(ar->arHtcTarget)) != A_OK) {
++ BMIInit();
++ return -EIO;
++ }
++
++ (ar)->arRawIfInit = TRUE;
++
++ return 0;
++}
++
++int ar6000_htc_raw_close(AR_SOFTC_T *ar)
++{
++ A_PRINTF("ar6000_htc_raw_close called \n");
++ HTCStop(ar->arHtcTarget);
++
++ /* reset the device */
++ ar6000_reset_device(ar->arHifDevice, ar->arTargetType);
++ /* Initialize the BMI component */
++ BMIInit();
++
++ return 0;
++}
++
++raw_htc_buffer *
++get_filled_buffer(AR_SOFTC_T *ar, HTC_RAW_STREAM_ID StreamID)
++{
++ int count;
++ raw_htc_buffer *busy;
++
++ /* Check for data */
++ for (count = 0; count < RAW_HTC_READ_BUFFERS_NUM; count ++) {
++ busy = ar->raw_htc_read_buffer[StreamID][count];
++ if (busy->length) {
++ break;
++ }
++ }
++ if (busy->length) {
++ ar->read_buffer_available[StreamID] = TRUE;
++ } else {
++ ar->read_buffer_available[StreamID] = FALSE;
++ }
++
++ return busy;
++}
++
++ssize_t ar6000_htc_raw_read(AR_SOFTC_T *ar, HTC_RAW_STREAM_ID StreamID,
++ char __user *buffer, size_t length)
++{
++ int readPtr;
++ raw_htc_buffer *busy;
++
++ if (arRawStream2EndpointID(ar,StreamID) == 0) {
++ AR_DEBUG_PRINTF("StreamID(%d) not connected! \n", StreamID);
++ return -EFAULT;
++ }
++
++ if (down_interruptible(&ar->raw_htc_read_sem[StreamID])) {
++ return -ERESTARTSYS;
++ }
++
++ busy = get_filled_buffer(ar,StreamID);
++ while (!ar->read_buffer_available[StreamID]) {
++ up(&ar->raw_htc_read_sem[StreamID]);
++
++ /* Wait for the data */
++ AR_DEBUG2_PRINTF("Sleeping StreamID(%d) read process\n", StreamID);
++ if (wait_event_interruptible(ar->raw_htc_read_queue[StreamID],
++ ar->read_buffer_available[StreamID]))
++ {
++ return -EINTR;
++ }
++ if (down_interruptible(&ar->raw_htc_read_sem[StreamID])) {
++ return -ERESTARTSYS;
++ }
++ busy = get_filled_buffer(ar,StreamID);
++ }
++
++ /* Read the data */
++ readPtr = busy->currPtr;
++ if (length > busy->length - HTC_HEADER_LEN) {
++ length = busy->length - HTC_HEADER_LEN;
++ }
++ if (copy_to_user(buffer, &busy->data[readPtr], length)) {
++ up(&ar->raw_htc_read_sem[StreamID]);
++ return -EFAULT;
++ }
++
++ busy->currPtr += length;
++
++ //AR_DEBUG_PRINTF("raw read ioctl: currPTR : 0x%X 0x%X \n", busy->currPtr,busy->length);
++
++ if (busy->currPtr == busy->length)
++ {
++ busy->currPtr = 0;
++ busy->length = 0;
++ HTC_PACKET_RESET_RX(&busy->HTCPacket);
++ //AR_DEBUG_PRINTF("raw read ioctl: ep for packet:%d \n", busy->HTCPacket.Endpoint);
++ HTCAddReceivePkt(ar->arHtcTarget, &busy->HTCPacket);
++ }
++ ar->read_buffer_available[StreamID] = FALSE;
++ up(&ar->raw_htc_read_sem[StreamID]);
++
++ return length;
++}
++
++static raw_htc_buffer *
++get_free_buffer(AR_SOFTC_T *ar, HTC_ENDPOINT_ID StreamID)
++{
++ int count;
++ raw_htc_buffer *free;
++
++ free = NULL;
++ for (count = 0; count < RAW_HTC_WRITE_BUFFERS_NUM; count ++) {
++ free = ar->raw_htc_write_buffer[StreamID][count];
++ if (free->length == 0) {
++ break;
++ }
++ }
++ if (!free->length) {
++ ar->write_buffer_available[StreamID] = TRUE;
++ } else {
++ ar->write_buffer_available[StreamID] = FALSE;
++ }
++
++ return free;
++}
++
++ssize_t ar6000_htc_raw_write(AR_SOFTC_T *ar, HTC_RAW_STREAM_ID StreamID,
++ char __user *buffer, size_t length)
++{
++ int writePtr;
++ raw_htc_buffer *free;
++
++ if (arRawStream2EndpointID(ar,StreamID) == 0) {
++ AR_DEBUG_PRINTF("StreamID(%d) not connected! \n", StreamID);
++ return -EFAULT;
++ }
++
++ if (down_interruptible(&ar->raw_htc_write_sem[StreamID])) {
++ return -ERESTARTSYS;
++ }
++
++ /* Search for a free buffer */
++ free = get_free_buffer(ar,StreamID);
++
++ /* Check if there is space to write else wait */
++ while (!ar->write_buffer_available[StreamID]) {
++ up(&ar->raw_htc_write_sem[StreamID]);
++
++ /* Wait for buffer to become free */
++ AR_DEBUG2_PRINTF("Sleeping StreamID(%d) write process\n", StreamID);
++ if (wait_event_interruptible(ar->raw_htc_write_queue[StreamID],
++ ar->write_buffer_available[StreamID]))
++ {
++ return -EINTR;
++ }
++ if (down_interruptible(&ar->raw_htc_write_sem[StreamID])) {
++ return -ERESTARTSYS;
++ }
++ free = get_free_buffer(ar,StreamID);
++ }
++
++ /* Send the data */
++ writePtr = HTC_HEADER_LEN;
++ if (length > (AR6000_BUFFER_SIZE - HTC_HEADER_LEN)) {
++ length = AR6000_BUFFER_SIZE - HTC_HEADER_LEN;
++ }
++
++ if (copy_from_user(&free->data[writePtr], buffer, length)) {
++ up(&ar->raw_htc_read_sem[StreamID]);
++ return -EFAULT;
++ }
++
++ free->length = length;
++
++ SET_HTC_PACKET_INFO_TX(&free->HTCPacket,
++ free,
++ &free->data[writePtr],
++ length,
++ arRawStream2EndpointID(ar,StreamID),
++ AR6K_DATA_PKT_TAG);
++
++ HTCSendPkt(ar->arHtcTarget,&free->HTCPacket);
++
++ ar->write_buffer_available[StreamID] = FALSE;
++ up(&ar->raw_htc_write_sem[StreamID]);
++
++ return length;
++}
++#endif /* HTC_RAW_INTERFACE */
+diff --git a/drivers/ar6000/ar6000/ar6xapi_linux.h b/drivers/ar6000/ar6000/ar6xapi_linux.h
+new file mode 100644
+index 0000000..b8e6e09
+--- /dev/null
++++ b/drivers/ar6000/ar6000/ar6xapi_linux.h
+@@ -0,0 +1,128 @@
++#ifndef _AR6XAPI_LINUX_H
++#define _AR6XAPI_LINUX_H
++/*
++ *
++ * Copyright (c) 2004-2007 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation;
++ *
++ * Software distributed under the License is distributed on an "AS
++ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
++ * implied. See the License for the specific language governing
++ * rights and limitations under the License.
++ *
++ *
++ *
++ */
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++struct ar6_softc;
++
++void ar6000_ready_event(void *devt, A_UINT8 *datap, A_UINT8 phyCap);
++A_UINT8 ar6000_iptos_to_userPriority(A_UINT8 *pkt);
++A_STATUS ar6000_control_tx(void *devt, void *osbuf, WMI_PRI_STREAM_ID streamID);
++void ar6000_connect_event(struct ar6_softc *ar, A_UINT16 channel,
++ A_UINT8 *bssid, A_UINT16 listenInterval,
++ A_UINT16 beaconInterval, NETWORK_TYPE networkType,
++ A_UINT8 beaconIeLen, A_UINT8 assocReqLen,
++ A_UINT8 assocRespLen,A_UINT8 *assocInfo);
++void ar6000_disconnect_event(struct ar6_softc *ar, A_UINT8 reason,
++ A_UINT8 *bssid, A_UINT8 assocRespLen,
++ A_UINT8 *assocInfo, A_UINT16 protocolReasonStatus);
++void ar6000_tkip_micerr_event(struct ar6_softc *ar, A_UINT8 keyid,
++ A_BOOL ismcast);
++void ar6000_bitrate_rx(void *devt, A_INT32 rateKbps);
++void ar6000_channelList_rx(void *devt, A_INT8 numChan, A_UINT16 *chanList);
++void ar6000_regDomain_event(struct ar6_softc *ar, A_UINT32 regCode);
++void ar6000_txPwr_rx(void *devt, A_UINT8 txPwr);
++void ar6000_keepalive_rx(void *devt, A_UINT8 configured);
++void ar6000_neighborReport_event(struct ar6_softc *ar, int numAps,
++ WMI_NEIGHBOR_INFO *info);
++void ar6000_set_numdataendpts(struct ar6_softc *ar, A_UINT32 num);
++void ar6000_scanComplete_event(struct ar6_softc *ar, A_STATUS status);
++void ar6000_targetStats_event(struct ar6_softc *ar, WMI_TARGET_STATS *pStats);
++void ar6000_rssiThreshold_event(struct ar6_softc *ar,
++ WMI_RSSI_THRESHOLD_VAL newThreshold,
++ A_INT16 rssi);
++void ar6000_reportError_event(struct ar6_softc *, WMI_TARGET_ERROR_VAL errorVal);
++void ar6000_cac_event(struct ar6_softc *ar, A_UINT8 ac, A_UINT8 cac_indication,
++ A_UINT8 statusCode, A_UINT8 *tspecSuggestion);
++void ar6000_hbChallengeResp_event(struct ar6_softc *, A_UINT32 cookie, A_UINT32 source);
++void
++ar6000_roam_tbl_event(struct ar6_softc *ar, WMI_TARGET_ROAM_TBL *pTbl);
++
++void
++ar6000_roam_data_event(struct ar6_softc *ar, WMI_TARGET_ROAM_DATA *p);
++
++void
++ar6000_wow_list_event(struct ar6_softc *ar, A_UINT8 num_filters,
++ WMI_GET_WOW_LIST_REPLY *wow_reply);
++
++void ar6000_pmkid_list_event(void *devt, A_UINT8 numPMKID,
++ WMI_PMKID *pmkidList);
++
++void ar6000_gpio_intr_rx(A_UINT32 intr_mask, A_UINT32 input_values);
++void ar6000_gpio_data_rx(A_UINT32 reg_id, A_UINT32 value);
++void ar6000_gpio_ack_rx(void);
++
++void ar6000_dbglog_init_done(struct ar6_softc *ar);
++
++#ifdef SEND_EVENT_TO_APP
++void ar6000_send_event_to_app(struct ar6_softc *ar, A_UINT16 eventId, A_UINT8 *datap, int len);
++#endif
++
++#ifdef CONFIG_HOST_TCMD_SUPPORT
++void ar6000_tcmd_rx_report_event(void *devt, A_UINT8 * results, int len);
++#endif
++
++void ar6000_tx_retry_err_event(void *devt);
++
++void ar6000_snrThresholdEvent_rx(void *devt,
++ WMI_SNR_THRESHOLD_VAL newThreshold,
++ A_UINT8 snr);
++
++void ar6000_lqThresholdEvent_rx(void *devt, WMI_LQ_THRESHOLD_VAL range, A_UINT8 lqVal);
++
++
++void ar6000_ratemask_rx(void *devt, A_UINT16 ratemask);
++
++A_STATUS ar6000_get_driver_cfg(struct net_device *dev,
++ A_UINT16 cfgParam,
++ void *result);
++void ar6000_bssInfo_event_rx(struct ar6_softc *ar, A_UINT8 *data, int len);
++
++void ar6000_dbglog_event(struct ar6_softc *ar, A_UINT32 dropped,
++ A_INT8 *buffer, A_UINT32 length);
++
++int ar6000_dbglog_get_debug_logs(struct ar6_softc *ar);
++
++void ar6000_indicate_tx_activity(void *devt, A_UINT8 trafficClass, A_BOOL Active);
++
++void ar6000_dset_open_req(void *devt,
++ A_UINT32 id,
++ A_UINT32 targ_handle,
++ A_UINT32 targ_reply_fn,
++ A_UINT32 targ_reply_arg);
++void ar6000_dset_close(void *devt, A_UINT32 access_cookie);
++void ar6000_dset_data_req(void *devt,
++ A_UINT32 access_cookie,
++ A_UINT32 offset,
++ A_UINT32 length,
++ A_UINT32 targ_buf,
++ A_UINT32 targ_reply_fn,
++ A_UINT32 targ_reply_arg);
++
++
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif
+diff --git a/drivers/ar6000/ar6000/athdrv_linux.h b/drivers/ar6000/ar6000/athdrv_linux.h
+new file mode 100644
+index 0000000..9c3e449
+--- /dev/null
++++ b/drivers/ar6000/ar6000/athdrv_linux.h
+@@ -0,0 +1,993 @@
++/*
++ * Copyright (c) 2004-2006 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ *
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation;
++ *
++ * Software distributed under the License is distributed on an "AS
++ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
++ * implied. See the License for the specific language governing
++ * rights and limitations under the License.
++ *
++ *
++ *
++ */
++
++#ifndef _ATHDRV_LINUX_H
++#define _ATHDRV_LINUX_H
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++
++/*
++ * There are two types of ioctl's here: Standard ioctls and
++ * eXtended ioctls. All extended ioctls (XIOCTL) are multiplexed
++ * off of the single ioctl command, AR6000_IOCTL_EXTENDED. The
++ * arguments for every XIOCTL starts with a 32-bit command word
++ * that is used to select which extended ioctl is in use. After
++ * the command word are command-specific arguments.
++ */
++
++/* Linux standard Wireless Extensions, private ioctl interfaces */
++#define IEEE80211_IOCTL_SETPARAM (SIOCIWFIRSTPRIV+0)
++#define IEEE80211_IOCTL_GETPARAM (SIOCIWFIRSTPRIV+1)
++#define IEEE80211_IOCTL_SETKEY (SIOCIWFIRSTPRIV+2)
++#define IEEE80211_IOCTL_SETWMMPARAMS (SIOCIWFIRSTPRIV+3)
++#define IEEE80211_IOCTL_DELKEY (SIOCIWFIRSTPRIV+4)
++#define IEEE80211_IOCTL_GETWMMPARAMS (SIOCIWFIRSTPRIV+5)
++#define IEEE80211_IOCTL_SETOPTIE (SIOCIWFIRSTPRIV+6)
++#define IEEE80211_IOCTL_SETMLME (SIOCIWFIRSTPRIV+7)
++//#define IEEE80211_IOCTL_GETOPTIE (SIOCIWFIRSTPRIV+7)
++#define IEEE80211_IOCTL_ADDPMKID (SIOCIWFIRSTPRIV+8)
++//#define IEEE80211_IOCTL_SETAUTHALG (SIOCIWFIRSTPRIV+10)
++#define IEEE80211_IOCTL_LASTONE (SIOCIWFIRSTPRIV+9)
++
++
++
++/* ====WMI Ioctls==== */
++/*
++ *
++ * Many ioctls simply provide WMI services to application code:
++ * an application makes such an ioctl call with a set of arguments
++ * that are packaged into the corresponding WMI message, and sent
++ * to the Target.
++ */
++
++#define AR6000_IOCTL_WMI_GETREV (SIOCIWFIRSTPRIV+10)
++/*
++ * arguments:
++ * ar6000_version *revision
++ */
++
++#define AR6000_IOCTL_WMI_SETPWR (SIOCIWFIRSTPRIV+11)
++/*
++ * arguments:
++ * WMI_POWER_MODE_CMD pwrModeCmd (see include/wmi.h)
++ * uses: WMI_SET_POWER_MODE_CMDID
++ */
++
++#define AR6000_IOCTL_WMI_SETSCAN (SIOCIWFIRSTPRIV+12)
++/*
++ * arguments:
++ * WMI_SCAN_PARAMS_CMD scanParams (see include/wmi.h)
++ * uses: WMI_SET_SCAN_PARAMS_CMDID
++ */
++
++#define AR6000_IOCTL_WMI_SETLISTENINT (SIOCIWFIRSTPRIV+13)
++/*
++ * arguments:
++ * UINT32 listenInterval
++ * uses: WMI_SET_LISTEN_INT_CMDID
++ */
++
++#define AR6000_IOCTL_WMI_SETBSSFILTER (SIOCIWFIRSTPRIV+14)
++/*
++ * arguments:
++ * WMI_BSS_FILTER filter (see include/wmi.h)
++ * uses: WMI_SET_BSS_FILTER_CMDID
++ */
++
++#define AR6000_IOCTL_WMI_SET_CHANNELPARAMS (SIOCIWFIRSTPRIV+16)
++/*
++ * arguments:
++ * WMI_CHANNEL_PARAMS_CMD chParams
++ * uses: WMI_SET_CHANNEL_PARAMS_CMDID
++ */
++
++#define AR6000_IOCTL_WMI_SET_PROBEDSSID (SIOCIWFIRSTPRIV+17)
++/*
++ * arguments:
++ * WMI_PROBED_SSID_CMD probedSsids (see include/wmi.h)
++ * uses: WMI_SETPROBED_SSID_CMDID
++ */
++
++#define AR6000_IOCTL_WMI_SET_PMPARAMS (SIOCIWFIRSTPRIV+18)
++/*
++ * arguments:
++ * WMI_POWER_PARAMS_CMD powerParams (see include/wmi.h)
++ * uses: WMI_SET_POWER_PARAMS_CMDID
++ */
++
++#define AR6000_IOCTL_WMI_SET_BADAP (SIOCIWFIRSTPRIV+19)
++/*
++ * arguments:
++ * WMI_ADD_BAD_AP_CMD badAPs (see include/wmi.h)
++ * uses: WMI_ADD_BAD_AP_CMDID
++ */
++
++#define AR6000_IOCTL_WMI_GET_QOS_QUEUE (SIOCIWFIRSTPRIV+20)
++/*
++ * arguments:
++ * ar6000_queuereq queueRequest (see below)
++ */
++
++#define AR6000_IOCTL_WMI_CREATE_QOS (SIOCIWFIRSTPRIV+21)
++/*
++ * arguments:
++ * WMI_CREATE_PSTREAM createPstreamCmd (see include/wmi.h)
++ * uses: WMI_CREATE_PSTREAM_CMDID
++ */
++
++#define AR6000_IOCTL_WMI_DELETE_QOS (SIOCIWFIRSTPRIV+22)
++/*
++ * arguments:
++ * WMI_DELETE_PSTREAM_CMD deletePstreamCmd (see include/wmi.h)
++ * uses: WMI_DELETE_PSTREAM_CMDID
++ */
++
++#define AR6000_IOCTL_WMI_SET_SNRTHRESHOLD (SIOCIWFIRSTPRIV+23)
++/*
++ * arguments:
++ * WMI_SNR_THRESHOLD_PARAMS_CMD thresholdParams (see include/wmi.h)
++ * uses: WMI_SNR_THRESHOLD_PARAMS_CMDID
++ */
++
++#define AR6000_IOCTL_WMI_SET_ERROR_REPORT_BITMASK (SIOCIWFIRSTPRIV+24)
++/*
++ * arguments:
++ * WMI_TARGET_ERROR_REPORT_BITMASK errorReportBitMask (see include/wmi.h)
++ * uses: WMI_TARGET_ERROR_REPORT_BITMASK_CMDID
++ */
++
++#define AR6000_IOCTL_WMI_GET_TARGET_STATS (SIOCIWFIRSTPRIV+25)
++/*
++ * arguments:
++ * TARGET_STATS *targetStats (see below)
++ * uses: WMI_GET_STATISTICS_CMDID
++ */
++
++#define AR6000_IOCTL_WMI_SET_ASSOC_INFO (SIOCIWFIRSTPRIV+26)
++/*
++ * arguments:
++ * WMI_SET_ASSOC_INFO_CMD setAssocInfoCmd
++ * uses: WMI_SET_ASSOC_INFO_CMDID
++ */
++
++#define AR6000_IOCTL_WMI_SET_ACCESS_PARAMS (SIOCIWFIRSTPRIV+27)
++/*
++ * arguments:
++ * WMI_SET_ACCESS_PARAMS_CMD setAccessParams (see include/wmi.h)
++ * uses: WMI_SET_ACCESS_PARAMS_CMDID
++ */
++
++#define AR6000_IOCTL_WMI_SET_BMISS_TIME (SIOCIWFIRSTPRIV+28)
++/*
++ * arguments:
++ * UINT32 beaconMissTime
++ * uses: WMI_SET_BMISS_TIME_CMDID
++ */
++
++#define AR6000_IOCTL_WMI_SET_DISC_TIMEOUT (SIOCIWFIRSTPRIV+29)
++/*
++ * arguments:
++ * WMI_DISC_TIMEOUT_CMD disconnectTimeoutCmd (see include/wmi.h)
++ * uses: WMI_SET_DISC_TIMEOUT_CMDID
++ */
++
++#define AR6000_IOCTL_WMI_SET_IBSS_PM_CAPS (SIOCIWFIRSTPRIV+30)
++/*
++ * arguments:
++ * WMI_IBSS_PM_CAPS_CMD ibssPowerMgmtCapsCmd
++ * uses: WMI_SET_IBSS_PM_CAPS_CMDID
++ */
++
++/*
++ * There is a very small space available for driver-private
++ * wireless ioctls. In order to circumvent this limitation,
++ * we multiplex a bunch of ioctls (XIOCTLs) on top of a
++ * single AR6000_IOCTL_EXTENDED ioctl.
++ */
++#define AR6000_IOCTL_EXTENDED (SIOCIWFIRSTPRIV+31)
++
++
++/* ====BMI Extended Ioctls==== */
++
++#define AR6000_XIOCTL_BMI_DONE 1
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_BMI_DONE)
++ * uses: BMI_DONE
++ */
++
++#define AR6000_XIOCTL_BMI_READ_MEMORY 2
++/*
++ * arguments:
++ * union {
++ * struct {
++ * UINT32 cmd (AR6000_XIOCTL_BMI_READ_MEMORY)
++ * UINT32 address
++ * UINT32 length
++ * }
++ * char results[length]
++ * }
++ * uses: BMI_READ_MEMORY
++ */
++
++#define AR6000_XIOCTL_BMI_WRITE_MEMORY 3
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_BMI_WRITE_MEMORY)
++ * UINT32 address
++ * UINT32 length
++ * char data[length]
++ * uses: BMI_WRITE_MEMORY
++ */
++
++#define AR6000_XIOCTL_BMI_EXECUTE 4
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_BMI_EXECUTE)
++ * UINT32 TargetAddress
++ * UINT32 parameter
++ * uses: BMI_EXECUTE
++ */
++
++#define AR6000_XIOCTL_BMI_SET_APP_START 5
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_BMI_SET_APP_START)
++ * UINT32 TargetAddress
++ * uses: BMI_SET_APP_START
++ */
++
++#define AR6000_XIOCTL_BMI_READ_SOC_REGISTER 6
++/*
++ * arguments:
++ * union {
++ * struct {
++ * UINT32 cmd (AR6000_XIOCTL_BMI_READ_SOC_REGISTER)
++ * UINT32 TargetAddress, 32-bit aligned
++ * }
++ * UINT32 result
++ * }
++ * uses: BMI_READ_SOC_REGISTER
++ */
++
++#define AR6000_XIOCTL_BMI_WRITE_SOC_REGISTER 7
++/*
++ * arguments:
++ * struct {
++ * UINT32 cmd (AR6000_XIOCTL_BMI_WRITE_SOC_REGISTER)
++ * UINT32 TargetAddress, 32-bit aligned
++ * UINT32 newValue
++ * }
++ * uses: BMI_WRITE_SOC_REGISTER
++ */
++
++#define AR6000_XIOCTL_BMI_TEST 8
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_BMI_TEST)
++ * UINT32 address
++ * UINT32 length
++ * UINT32 count
++ */
++
++
++
++/* Historical Host-side DataSet support */
++#define AR6000_XIOCTL_UNUSED9 9
++#define AR6000_XIOCTL_UNUSED10 10
++#define AR6000_XIOCTL_UNUSED11 11
++
++/* ====Misc Extended Ioctls==== */
++
++#define AR6000_XIOCTL_FORCE_TARGET_RESET 12
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_FORCE_TARGET_RESET)
++ */
++
++
++#ifdef HTC_RAW_INTERFACE
++/* HTC Raw Interface Ioctls */
++#define AR6000_XIOCTL_HTC_RAW_OPEN 13
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_HTC_RAW_OPEN)
++ */
++
++#define AR6000_XIOCTL_HTC_RAW_CLOSE 14
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_HTC_RAW_CLOSE)
++ */
++
++#define AR6000_XIOCTL_HTC_RAW_READ 15
++/*
++ * arguments:
++ * union {
++ * struct {
++ * UINT32 cmd (AR6000_XIOCTL_HTC_RAW_READ)
++ * UINT32 mailboxID
++ * UINT32 length
++ * }
++ * results[length]
++ * }
++ */
++
++#define AR6000_XIOCTL_HTC_RAW_WRITE 16
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_HTC_RAW_WRITE)
++ * UINT32 mailboxID
++ * UINT32 length
++ * char buffer[length]
++ */
++#endif /* HTC_RAW_INTERFACE */
++
++#define AR6000_XIOCTL_CHECK_TARGET_READY 17
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_CHECK_TARGET_READY)
++ */
++
++
++
++/* ====GPIO (General Purpose I/O) Extended Ioctls==== */
++
++#define AR6000_XIOCTL_GPIO_OUTPUT_SET 18
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_GPIO_OUTPUT_SET)
++ * ar6000_gpio_output_set_cmd_s (see below)
++ * uses: WMIX_GPIO_OUTPUT_SET_CMDID
++ */
++
++#define AR6000_XIOCTL_GPIO_INPUT_GET 19
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_GPIO_INPUT_GET)
++ * uses: WMIX_GPIO_INPUT_GET_CMDID
++ */
++
++#define AR6000_XIOCTL_GPIO_REGISTER_SET 20
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_GPIO_REGISTER_SET)
++ * ar6000_gpio_register_cmd_s (see below)
++ * uses: WMIX_GPIO_REGISTER_SET_CMDID
++ */
++
++#define AR6000_XIOCTL_GPIO_REGISTER_GET 21
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_GPIO_REGISTER_GET)
++ * ar6000_gpio_register_cmd_s (see below)
++ * uses: WMIX_GPIO_REGISTER_GET_CMDID
++ */
++
++#define AR6000_XIOCTL_GPIO_INTR_ACK 22
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_GPIO_INTR_ACK)
++ * ar6000_cpio_intr_ack_cmd_s (see below)
++ * uses: WMIX_GPIO_INTR_ACK_CMDID
++ */
++
++#define AR6000_XIOCTL_GPIO_INTR_WAIT 23
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_GPIO_INTR_WAIT)
++ */
++
++
++
++/* ====more wireless commands==== */
++
++#define AR6000_XIOCTL_SET_ADHOC_BSSID 24
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_SET_ADHOC_BSSID)
++ * WMI_SET_ADHOC_BSSID_CMD setAdHocBssidCmd (see include/wmi.h)
++ */
++
++#define AR6000_XIOCTL_SET_OPT_MODE 25
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_SET_OPT_MODE)
++ * WMI_SET_OPT_MODE_CMD setOptModeCmd (see include/wmi.h)
++ * uses: WMI_SET_OPT_MODE_CMDID
++ */
++
++#define AR6000_XIOCTL_OPT_SEND_FRAME 26
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_OPT_SEND_FRAME)
++ * WMI_OPT_TX_FRAME_CMD optTxFrameCmd (see include/wmi.h)
++ * uses: WMI_OPT_TX_FRAME_CMDID
++ */
++
++#define AR6000_XIOCTL_SET_ADHOC_BEACON_INTVAL 27
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_SET_ADHOC_BEACON_INTVAL)
++ * WMI_BEACON_INT_CMD beaconIntCmd (see include/wmi.h)
++ * uses: WMI_SET_BEACON_INT_CMDID
++ */
++
++
++#define IEEE80211_IOCTL_SETAUTHALG 28
++
++
++#define AR6000_XIOCTL_SET_VOICE_PKT_SIZE 29
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_SET_VOICE_PKT_SIZE)
++ * WMI_SET_VOICE_PKT_SIZE_CMD setVoicePktSizeCmd (see include/wmi.h)
++ * uses: WMI_SET_VOICE_PKT_SIZE_CMDID
++ */
++
++
++#define AR6000_XIOCTL_SET_MAX_SP 30
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_SET_MAX_SP)
++ * WMI_SET_MAX_SP_LEN_CMD maxSPLen(see include/wmi.h)
++ * uses: WMI_SET_MAX_SP_LEN_CMDID
++ */
++
++#define AR6000_XIOCTL_WMI_GET_ROAM_TBL 31
++
++#define AR6000_XIOCTL_WMI_SET_ROAM_CTRL 32
++
++#define AR6000_XIOCTRL_WMI_SET_POWERSAVE_TIMERS 33
++
++
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTRL_WMI_SET_POWERSAVE_TIMERS)
++ * WMI_SET_POWERSAVE_TIMERS_CMD powerSaveTimers(see include/wmi.h)
++ * WMI_SET_POWERSAVE_TIMERS_CMDID
++ */
++
++#define AR6000_XIOCTRL_WMI_GET_POWER_MODE 34
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTRL_WMI_GET_POWER_MODE)
++ */
++
++#define AR6000_XIOCTRL_WMI_SET_WLAN_STATE 35
++typedef enum {
++ WLAN_DISABLED,
++ WLAN_ENABLED
++} AR6000_WLAN_STATE;
++/*
++ * arguments:
++ * enable/disable
++ */
++
++#define AR6000_XIOCTL_WMI_GET_ROAM_DATA 36
++
++#define AR6000_XIOCTL_WMI_SETRETRYLIMITS 37
++/*
++ * arguments:
++ * WMI_SET_RETRY_LIMITS_CMD ibssSetRetryLimitsCmd
++ * uses: WMI_SET_RETRY_LIMITS_CMDID
++ */
++
++#ifdef CONFIG_HOST_TCMD_SUPPORT
++/* ====extended commands for radio test ==== */
++
++#define AR6000_XIOCTL_TCMD_CONT_TX 38
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_TCMD_CONT_TX)
++ * WMI_TCMD_CONT_TX_CMD contTxCmd (see include/wmi.h)
++ * uses: WMI_TCMD_CONT_TX_CMDID
++ */
++
++#define AR6000_XIOCTL_TCMD_CONT_RX 39
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_TCMD_CONT_RX)
++ * WMI_TCMD_CONT_RX_CMD rxCmd (see include/wmi.h)
++ * uses: WMI_TCMD_CONT_RX_CMDID
++ */
++
++#define AR6000_XIOCTL_TCMD_PM 40
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_TCMD_PM)
++ * WMI_TCMD_PM_CMD pmCmd (see include/wmi.h)
++ * uses: WMI_TCMD_PM_CMDID
++ */
++
++#endif /* CONFIG_HOST_TCMD_SUPPORT */
++
++#define AR6000_XIOCTL_WMI_STARTSCAN 41
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_WMI_STARTSCAN)
++ * UINT8 scanType
++ * UINT8 scanConnected
++ * A_BOOL forceFgScan
++ * uses: WMI_START_SCAN_CMDID
++ */
++
++#define AR6000_XIOCTL_WMI_SETFIXRATES 42
++
++#define AR6000_XIOCTL_WMI_GETFIXRATES 43
++
++
++#define AR6000_XIOCTL_WMI_SET_RSSITHRESHOLD 44
++/*
++ * arguments:
++ * WMI_RSSI_THRESHOLD_PARAMS_CMD thresholdParams (see include/wmi.h)
++ * uses: WMI_RSSI_THRESHOLD_PARAMS_CMDID
++ */
++
++#define AR6000_XIOCTL_WMI_CLR_RSSISNR 45
++/*
++ * arguments:
++ * WMI_CLR_RSSISNR_CMD thresholdParams (see include/wmi.h)
++ * uses: WMI_CLR_RSSISNR_CMDID
++ */
++
++#define AR6000_XIOCTL_WMI_SET_LQTHRESHOLD 46
++/*
++ * arguments:
++ * WMI_LQ_THRESHOLD_PARAMS_CMD thresholdParams (see include/wmi.h)
++ * uses: WMI_LQ_THRESHOLD_PARAMS_CMDID
++ */
++
++#define AR6000_XIOCTL_WMI_SET_RTS 47
++/*
++ * arguments:
++ * WMI_SET_RTS_MODE_CMD (see include/wmi.h)
++ * uses: WMI_SET_RTS_MODE_CMDID
++ */
++
++#define AR6000_XIOCTL_WMI_SET_LPREAMBLE 48
++
++#define AR6000_XIOCTL_WMI_SET_AUTHMODE 49
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_WMI_SET_AUTHMODE)
++ * UINT8 mode
++ * uses: WMI_SET_RECONNECT_AUTH_MODE_CMDID
++ */
++
++#define AR6000_XIOCTL_WMI_SET_REASSOCMODE 50
++
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_WMI_SET_WMM)
++ * UINT8 mode
++ * uses: WMI_SET_WMM_CMDID
++ */
++#define AR6000_XIOCTL_WMI_SET_WMM 51
++
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_WMI_SET_HB_CHALLENGE_RESP_PARAMS)
++ * UINT32 frequency
++ * UINT8 threshold
++ */
++#define AR6000_XIOCTL_WMI_SET_HB_CHALLENGE_RESP_PARAMS 52
++
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_WMI_GET_HB_CHALLENGE_RESP)
++ * UINT32 cookie
++ */
++#define AR6000_XIOCTL_WMI_GET_HB_CHALLENGE_RESP 53
++
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_WMI_GET_RD)
++ * UINT32 regDomain
++ */
++#define AR6000_XIOCTL_WMI_GET_RD 54
++
++#define AR6000_XIOCTL_DIAG_READ 55
++
++#define AR6000_XIOCTL_DIAG_WRITE 56
++
++/*
++ * arguments cmd (AR6000_XIOCTL_SET_TXOP)
++ * WMI_TXOP_CFG txopEnable
++ */
++#define AR6000_XIOCTL_WMI_SET_TXOP 57
++
++#ifdef USER_KEYS
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_USER_SETKEYS)
++ * UINT32 keyOpCtrl
++ * uses AR6000_USER_SETKEYS_INFO
++ */
++#define AR6000_XIOCTL_USER_SETKEYS 58
++#endif /* USER_KEYS */
++
++#define AR6000_XIOCTL_WMI_SET_KEEPALIVE 59
++/*
++ * arguments:
++ * UINT8 cmd (AR6000_XIOCTL_WMI_SET_KEEPALIVE)
++ * UINT8 keepaliveInterval
++ * uses: WMI_SET_KEEPALIVE_CMDID
++ */
++
++#define AR6000_XIOCTL_WMI_GET_KEEPALIVE 60
++/*
++ * arguments:
++ * UINT8 cmd (AR6000_XIOCTL_WMI_GET_KEEPALIVE)
++ * UINT8 keepaliveInterval
++ * A_BOOL configured
++ * uses: WMI_GET_KEEPALIVE_CMDID
++ */
++
++/* ====ROM Patching Extended Ioctls==== */
++
++#define AR6000_XIOCTL_BMI_ROMPATCH_INSTALL 61
++/*
++ * arguments:
++ * union {
++ * struct {
++ * UINT32 cmd (AR6000_XIOCTL_BMI_ROMPATCH_INSTALL)
++ * UINT32 ROM Address
++ * UINT32 RAM Address
++ * UINT32 number of bytes
++ * UINT32 activate? (0 or 1)
++ * }
++ * A_UINT32 resulting rompatch ID
++ * }
++ * uses: BMI_ROMPATCH_INSTALL
++ */
++
++#define AR6000_XIOCTL_BMI_ROMPATCH_UNINSTALL 62
++/*
++ * arguments:
++ * struct {
++ * UINT32 cmd (AR6000_XIOCTL_BMI_ROMPATCH_UNINSTALL)
++ * UINT32 rompatch ID
++ * }
++ * uses: BMI_ROMPATCH_UNINSTALL
++ */
++
++#define AR6000_XIOCTL_BMI_ROMPATCH_ACTIVATE 63
++/*
++ * arguments:
++ * struct {
++ * UINT32 cmd (AR6000_XIOCTL_BMI_ROMPATCH_ACTIVATE)
++ * UINT32 rompatch count
++ * UINT32 rompatch IDs[rompatch count]
++ * }
++ * uses: BMI_ROMPATCH_ACTIVATE
++ */
++
++#define AR6000_XIOCTL_BMI_ROMPATCH_DEACTIVATE 64
++/*
++ * arguments:
++ * struct {
++ * UINT32 cmd (AR6000_XIOCTL_BMI_ROMPATCH_DEACTIVATE)
++ * UINT32 rompatch count
++ * UINT32 rompatch IDs[rompatch count]
++ * }
++ * uses: BMI_ROMPATCH_DEACTIVATE
++ */
++
++#define AR6000_XIOCTL_WMI_SET_APPIE 65
++/*
++ * arguments:
++ * struct {
++ * UINT32 cmd (AR6000_XIOCTL_WMI_SET_APPIE)
++ * UINT32 app_frmtype;
++ * UINT32 app_buflen;
++ * UINT8 app_buf[];
++ * }
++ */
++#define AR6000_XIOCTL_WMI_SET_MGMT_FRM_RX_FILTER 66
++/*
++ * arguments:
++ * A_UINT32 filter_type;
++ */
++
++#define AR6000_XIOCTL_DBGLOG_CFG_MODULE 67
++
++#define AR6000_XIOCTL_DBGLOG_GET_DEBUG_LOGS 68
++
++#define AR6000_XIOCTL_WMI_SET_WSC_STATUS 70
++/*
++ * arguments:
++ * A_UINT32 wsc_status;
++ * (WSC_REG_INACTIVE or WSC_REG_ACTIVE)
++ */
++
++/*
++ * arguments:
++ * struct {
++ * A_UINT8 streamType;
++ * A_UINT8 status;
++ * }
++ * uses: WMI_SET_BT_STATUS_CMDID
++ */
++#define AR6000_XIOCTL_WMI_SET_BT_STATUS 71
++
++/*
++ * arguments:
++ * struct {
++ * A_UINT8 paramType;
++ * union {
++ * A_UINT8 noSCOPkts;
++ * BT_PARAMS_A2DP a2dpParams;
++ * BT_COEX_REGS regs;
++ * };
++ * }
++ * uses: WMI_SET_BT_PARAM_CMDID
++ */
++#define AR6000_XIOCTL_WMI_SET_BT_PARAMS 72
++
++#define AR6000_XIOCTL_WMI_SET_HOST_SLEEP_MODE 73
++#define AR6000_XIOCTL_WMI_SET_WOW_MODE 74
++#define AR6000_XIOCTL_WMI_GET_WOW_LIST 75
++#define AR6000_XIOCTL_WMI_ADD_WOW_PATTERN 76
++#define AR6000_XIOCTL_WMI_DEL_WOW_PATTERN 77
++
++
++
++#define AR6000_XIOCTL_TARGET_INFO 78
++/*
++ * arguments:
++ * UINT32 cmd (AR6000_XIOCTL_TARGET_INFO)
++ * A_UINT32 TargetVersion (returned)
++ * A_UINT32 TargetType (returned)
++ * (See also bmi_msg.h target_ver and target_type)
++ */
++
++#define AR6000_XIOCTL_DUMP_HTC_CREDIT_STATE 79
++/*
++ * arguments:
++ * none
++ */
++
++#define AR6000_XIOCTL_TRAFFIC_ACTIVITY_CHANGE 80
++/*
++ * This ioctl is used to emulate traffic activity
++ * timeouts. Activity/inactivity will trigger the driver
++ * to re-balance credits.
++ *
++ * arguments:
++ * ar6000_traffic_activity_change
++ */
++
++#define AR6000_XIOCTL_WMI_SET_CONNECT_CTRL_FLAGS 81
++/*
++ * This ioctl is used to set the connect control flags
++ *
++ * arguments:
++ * A_UINT32 connectCtrlFlags
++ */
++
++#define AR6000_XIOCTL_WMI_SET_AKMP_PARAMS 82
++/*
++ * This IOCTL sets any Authentication,Key Management and Protection
++ * related parameters. This is used along with the information set in
++ * Connect Command.
++ * Currently this enables Multiple PMKIDs to an AP.
++ *
++ * arguments:
++ * struct {
++ * A_UINT32 akmpInfo;
++ * }
++ * uses: WMI_SET_AKMP_PARAMS_CMD
++ */
++
++#define AR6000_XIOCTL_WMI_GET_PMKID_LIST 83
++
++#define AR6000_XIOCTL_WMI_SET_PMKID_LIST 84
++/*
++ * This IOCTL is used to set a list of PMKIDs. This list of
++ * PMKIDs is used in the [Re]AssocReq Frame. This list is used
++ * only if the MultiPMKID option is enabled via the
++ * AR6000_XIOCTL_WMI_SET_AKMP_PARAMS IOCTL.
++ *
++ * arguments:
++ * struct {
++ * A_UINT32 numPMKID;
++ * WMI_PMKID pmkidList[WMI_MAX_PMKID_CACHE];
++ * }
++ * uses: WMI_SET_PMKIDLIST_CMD
++ */
++
++/* Historical DSETPATCH support for INI patches */
++#define AR6000_XIOCTL_UNUSED90 90
++
++
++
++/* used by AR6000_IOCTL_WMI_GETREV */
++struct ar6000_version {
++ A_UINT32 host_ver;
++ A_UINT32 target_ver;
++};
++
++/* used by AR6000_IOCTL_WMI_GET_QOS_QUEUE */
++struct ar6000_queuereq {
++ A_UINT8 trafficClass;
++ A_UINT16 activeTsids;
++};
++
++/* used by AR6000_IOCTL_WMI_GET_TARGET_STATS */
++typedef struct targetStats_t {
++ A_UINT64 tx_packets;
++ A_UINT64 tx_bytes;
++ A_UINT64 tx_unicast_pkts;
++ A_UINT64 tx_unicast_bytes;
++ A_UINT64 tx_multicast_pkts;
++ A_UINT64 tx_multicast_bytes;
++ A_UINT64 tx_broadcast_pkts;
++ A_UINT64 tx_broadcast_bytes;
++ A_UINT64 tx_rts_success_cnt;
++ A_UINT64 tx_packet_per_ac[4];
++
++ A_UINT64 tx_errors;
++ A_UINT64 tx_failed_cnt;
++ A_UINT64 tx_retry_cnt;
++ A_UINT64 tx_rts_fail_cnt;
++ A_INT32 tx_unicast_rate;
++ A_UINT64 rx_packets;
++ A_UINT64 rx_bytes;
++ A_UINT64 rx_unicast_pkts;
++ A_UINT64 rx_unicast_bytes;
++ A_UINT64 rx_multicast_pkts;
++ A_UINT64 rx_multicast_bytes;
++ A_UINT64 rx_broadcast_pkts;
++ A_UINT64 rx_broadcast_bytes;
++ A_UINT64 rx_fragment_pkt;
++
++ A_UINT64 rx_errors;
++ A_UINT64 rx_crcerr;
++ A_UINT64 rx_key_cache_miss;
++ A_UINT64 rx_decrypt_err;
++ A_UINT64 rx_duplicate_frames;
++ A_INT32 rx_unicast_rate;
++
++ A_UINT64 tkip_local_mic_failure;
++ A_UINT64 tkip_counter_measures_invoked;
++ A_UINT64 tkip_replays;
++ A_UINT64 tkip_format_errors;
++ A_UINT64 ccmp_format_errors;
++ A_UINT64 ccmp_replays;
++
++ A_UINT64 power_save_failure_cnt;
++ A_INT16 noise_floor_calibation;
++
++ A_UINT64 cs_bmiss_cnt;
++ A_UINT64 cs_lowRssi_cnt;
++ A_UINT64 cs_connect_cnt;
++ A_UINT64 cs_disconnect_cnt;
++ A_UINT8 cs_aveBeacon_snr;
++ A_INT16 cs_aveBeacon_rssi;
++ A_UINT8 cs_lastRoam_msec;
++ A_UINT8 cs_snr;
++ A_INT16 cs_rssi;
++
++ A_UINT32 lq_val;
++
++ A_UINT32 wow_num_pkts_dropped;
++ A_UINT8 wow_num_host_pkt_wakeups;
++ A_UINT8 wow_num_host_event_wakeups;
++ A_UINT16 wow_num_events_discarded;
++
++}TARGET_STATS;
++
++typedef struct targetStats_cmd_t {
++ TARGET_STATS targetStats;
++ int clearStats;
++} TARGET_STATS_CMD;
++
++/* used by AR6000_XIOCTL_USER_SETKEYS */
++
++/*
++ * Setting this bit to 1 doesnot initialize the RSC on the firmware
++ */
++#define AR6000_XIOCTL_USER_SETKEYS_RSC_CTRL 1
++#define AR6000_USER_SETKEYS_RSC_UNCHANGED 0x00000002
++
++typedef struct {
++ A_UINT32 keyOpCtrl; /* Bit Map of Key Mgmt Ctrl Flags */
++} AR6000_USER_SETKEYS_INFO;
++
++
++/* used by AR6000_XIOCTL_GPIO_OUTPUT_SET */
++struct ar6000_gpio_output_set_cmd_s {
++ A_UINT32 set_mask;
++ A_UINT32 clear_mask;
++ A_UINT32 enable_mask;
++ A_UINT32 disable_mask;
++};
++
++/*
++ * used by AR6000_XIOCTL_GPIO_REGISTER_GET and AR6000_XIOCTL_GPIO_REGISTER_SET
++ */
++struct ar6000_gpio_register_cmd_s {
++ A_UINT32 gpioreg_id;
++ A_UINT32 value;
++};
++
++/* used by AR6000_XIOCTL_GPIO_INTR_ACK */
++struct ar6000_gpio_intr_ack_cmd_s {
++ A_UINT32 ack_mask;
++};
++
++/* used by AR6000_XIOCTL_GPIO_INTR_WAIT */
++struct ar6000_gpio_intr_wait_cmd_s {
++ A_UINT32 intr_mask;
++ A_UINT32 input_values;
++};
++
++/* used by the AR6000_XIOCTL_DBGLOG_CFG_MODULE */
++typedef struct ar6000_dbglog_module_config_s {
++ A_UINT32 valid;
++ A_UINT16 mmask;
++ A_UINT16 tsr;
++ A_BOOL rep;
++ A_UINT16 size;
++} DBGLOG_MODULE_CONFIG;
++
++typedef struct user_rssi_thold_t {
++ A_INT16 tag;
++ A_INT16 rssi;
++} USER_RSSI_THOLD;
++
++typedef struct user_rssi_params_t {
++ A_UINT8 weight;
++ A_UINT32 pollTime;
++ USER_RSSI_THOLD tholds[12];
++} USER_RSSI_PARAMS;
++
++/*
++ * Host driver may have some config parameters. Typically, these
++ * config params are one time config parameters. These could
++ * correspond to any of the underlying modules. Host driver exposes
++ * an api for the underlying modules to get this config.
++ */
++#define AR6000_DRIVER_CFG_BASE 0x8000
++
++/* Should driver perform wlan node caching? */
++#define AR6000_DRIVER_CFG_GET_WLANNODECACHING 0x8001
++/*Should we log raw WMI msgs */
++#define AR6000_DRIVER_CFG_LOG_RAW_WMI_MSGS 0x8002
++
++/* used by AR6000_XIOCTL_DIAG_READ & AR6000_XIOCTL_DIAG_WRITE */
++struct ar6000_diag_window_cmd_s {
++ unsigned int addr;
++ unsigned int value;
++};
++
++
++struct ar6000_traffic_activity_change {
++ A_UINT32 StreamID; /* stream ID to indicate activity change */
++ A_UINT32 Active; /* active (1) or inactive (0) */
++};
++
++#ifdef __cplusplus
++}
++#endif
++#endif
+diff --git a/drivers/ar6000/ar6000/athtypes_linux.h b/drivers/ar6000/ar6000/athtypes_linux.h
+new file mode 100644
+index 0000000..3e91de3
+--- /dev/null
++++ b/drivers/ar6000/ar6000/athtypes_linux.h
+@@ -0,0 +1,47 @@
++/*
++ * $Id: //depot/sw/releases/olca2.0-GPL/host/os/linux/include/athtypes_linux.h#1 $
++ *
++ * This file contains the definitions of the basic atheros data types.
++ * It is used to map the data types in atheros files to a platform specific
++ * type.
++ *
++ * Copyright 2003-2005 Atheros Communications, Inc., All Rights Reserved.
++ *
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation;
++ *
++ * Software distributed under the License is distributed on an "AS
++ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
++ * implied. See the License for the specific language governing
++ * rights and limitations under the License.
++ *
++ *
++ *
++ */
++
++#ifndef _ATHTYPES_LINUX_H_
++#define _ATHTYPES_LINUX_H_
++
++#ifdef __KERNEL__
++#include <linux/types.h>
++#endif
++
++typedef int8_t A_INT8;
++typedef int16_t A_INT16;
++typedef int32_t A_INT32;
++typedef int64_t A_INT64;
++
++typedef u_int8_t A_UINT8;
++typedef u_int16_t A_UINT16;
++typedef u_int32_t A_UINT32;
++typedef u_int64_t A_UINT64;
++
++typedef int A_BOOL;
++typedef char A_CHAR;
++typedef unsigned char A_UCHAR;
++typedef unsigned long A_ATH_TIMER;
++
++
++#endif /* _ATHTYPES_LINUX_H_ */
+diff --git a/drivers/ar6000/ar6000/config_linux.h b/drivers/ar6000/ar6000/config_linux.h
+new file mode 100644
+index 0000000..11a691d
+--- /dev/null
++++ b/drivers/ar6000/ar6000/config_linux.h
+@@ -0,0 +1,44 @@
++/*
++ * Copyright (c) 2004-2007 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation;
++ *
++ * Software distributed under the License is distributed on an "AS
++ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
++ * implied. See the License for the specific language governing
++ * rights and limitations under the License.
++ *
++ *
++ *
++ */
++
++#ifndef _CONFIG_LINUX_H_
++#define _CONFIG_LINUX_H_
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++/*
++ * Host-side GPIO support is optional.
++ * If run-time access to GPIO pins is not required, then
++ * this should be changed to #undef.
++ */
++#define CONFIG_HOST_GPIO_SUPPORT
++
++/*
++ * Host side Test Command support
++ */
++#define CONFIG_HOST_TCMD_SUPPORT
++
++#define USE_4BYTE_REGISTER_ACCESS
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif
+diff --git a/drivers/ar6000/ar6000/debug_linux.h b/drivers/ar6000/ar6000/debug_linux.h
+new file mode 100644
+index 0000000..c74e1df
+--- /dev/null
++++ b/drivers/ar6000/ar6000/debug_linux.h
+@@ -0,0 +1,86 @@
++/*
++ * Copyright (c) 2004-2006 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation;
++ *
++ * Software distributed under the License is distributed on an "AS
++ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
++ * implied. See the License for the specific language governing
++ * rights and limitations under the License.
++ *
++ *
++ *
++ */
++
++#ifndef _DEBUG_LINUX_H_
++#define _DEBUG_LINUX_H_
++
++#define DBG_DEFAULTS (DBG_ERROR|DBG_WARNING)
++
++extern A_UINT32 g_dbg_flags;
++
++#define DBGFMT "%s() : "
++#define DBGARG __func__
++#define DBGFN A_PRINTF
++
++/* ------- Debug related stuff ------- */
++enum {
++ ATH_DEBUG_SEND = 0x0001,
++ ATH_DEBUG_RECV = 0x0002,
++ ATH_DEBUG_SYNC = 0x0004,
++ ATH_DEBUG_DUMP = 0x0008,
++ ATH_DEBUG_IRQ = 0x0010,
++ ATH_DEBUG_TRC = 0x0020,
++ ATH_DEBUG_WARN = 0x0040,
++ ATH_DEBUG_ERR = 0x0080,
++ ATH_LOG_INF = 0x0100,
++ ATH_DEBUG_BMI = 0x0110,
++ ATH_DEBUG_WMI = 0x0120,
++ ATH_DEBUG_HIF = 0x0140,
++ ATH_DEBUG_HTC = 0x0180,
++ ATH_DEBUG_WLAN = 0x1000,
++ ATH_LOG_ERR = 0x1010,
++ ATH_DEBUG_ANY = 0xFFFF,
++};
++
++#ifdef DEBUG
++
++#define A_DPRINTF(f, a) \
++ if(g_dbg_flags & (f)) \
++ { \
++ DBGFN a ; \
++ }
++
++
++// TODO FIX usage of A_PRINTF!
++#define AR_DEBUG_LVL_CHECK(lvl) (debughtc & (lvl))
++#define AR_DEBUG_PRINTBUF(buffer, length, desc) do { \
++ if (debughtc & ATH_DEBUG_DUMP) { \
++ DebugDumpBytes(buffer, length,desc); \
++ } \
++} while(0)
++#define PRINTX_ARG(arg...) arg
++#define AR_DEBUG_PRINTF(flags, args) do { \
++ if (debughtc & (flags)) { \
++ A_PRINTF(KERN_ALERT PRINTX_ARG args); \
++ } \
++} while (0)
++#define AR_DEBUG_ASSERT(test) do { \
++ if (!(test)) { \
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Debug Assert Caught, File %s, Line: %d, Test:%s \n",__FILE__, __LINE__,#test)); \
++ } \
++} while(0)
++extern int debughtc;
++#else
++#define AR_DEBUG_PRINTF(flags, args)
++#define AR_DEBUG_PRINTBUF(buffer, length, desc)
++#define AR_DEBUG_ASSERT(test)
++#define AR_DEBUG_LVL_CHECK(lvl) 0
++#define A_DPRINTF(f, a)
++#endif
++
++#endif /* _DEBUG_LINUX_H_ */
+diff --git a/drivers/ar6000/ar6000/ioctl.c b/drivers/ar6000/ar6000/ioctl.c
+new file mode 100644
+index 0000000..04aa911
+--- /dev/null
++++ b/drivers/ar6000/ar6000/ioctl.c
+@@ -0,0 +1,2532 @@
++/*
++ *
++ * Copyright (c) 2004-2007 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation;
++ *
++ * Software distributed under the License is distributed on an "AS
++ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
++ * implied. See the License for the specific language governing
++ * rights and limitations under the License.
++ *
++ *
++ *
++ */
++
++#include "ar6000_drv.h"
++
++static A_UINT8 bcast_mac[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
++static A_UINT8 null_mac[] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
++extern USER_RSSI_THOLD rssi_map[12];
++extern unsigned int wmitimeout;
++extern A_WAITQUEUE_HEAD arEvent;
++extern int tspecCompliance;
++extern int bypasswmi;
++
++static int
++ar6000_ioctl_get_roam_tbl(struct net_device *dev, struct ifreq *rq)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++ if(wmi_get_roam_tbl_cmd(ar->arWmi) != A_OK) {
++ return -EIO;
++ }
++
++ return 0;
++}
++
++static int
++ar6000_ioctl_get_roam_data(struct net_device *dev, struct ifreq *rq)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++
++ /* currently assume only roam times are required */
++ if(wmi_get_roam_data_cmd(ar->arWmi, ROAM_DATA_TIME) != A_OK) {
++ return -EIO;
++ }
++
++
++ return 0;
++}
++
++static int
++ar6000_ioctl_set_roam_ctrl(struct net_device *dev, char *userdata)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ WMI_SET_ROAM_CTRL_CMD cmd;
++ A_UINT8 size = sizeof(cmd);
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++
++ if (copy_from_user(&cmd, userdata, size)) {
++ return -EFAULT;
++ }
++
++ if (cmd.roamCtrlType == WMI_SET_HOST_BIAS) {
++ if (cmd.info.bssBiasInfo.numBss > 1) {
++ size += (cmd.info.bssBiasInfo.numBss - 1) * sizeof(WMI_BSS_BIAS);
++ }
++ }
++
++ if (copy_from_user(&cmd, userdata, size)) {
++ return -EFAULT;
++ }
++
++ if(wmi_set_roam_ctrl_cmd(ar->arWmi, &cmd, size) != A_OK) {
++ return -EIO;
++ }
++
++ return 0;
++}
++
++static int
++ar6000_ioctl_set_powersave_timers(struct net_device *dev, char *userdata)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ WMI_POWERSAVE_TIMERS_POLICY_CMD cmd;
++ A_UINT8 size = sizeof(cmd);
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++ if (copy_from_user(&cmd, userdata, size)) {
++ return -EFAULT;
++ }
++
++ if (copy_from_user(&cmd, userdata, size)) {
++ return -EFAULT;
++ }
++
++ if(wmi_set_powersave_timers_cmd(ar->arWmi, &cmd, size) != A_OK) {
++ return -EIO;
++ }
++
++ return 0;
++}
++
++static int
++ar6000_ioctl_set_wmm(struct net_device *dev, struct ifreq *rq)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ WMI_SET_WMM_CMD cmd;
++ A_STATUS ret;
++
++ if ((dev->flags & IFF_UP) != IFF_UP) {
++ return -EIO;
++ }
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++ if (copy_from_user(&cmd, (char *)((unsigned int*)rq->ifr_data + 1),
++ sizeof(cmd)))
++ {
++ return -EFAULT;
++ }
++
++ if (cmd.status == WMI_WMM_ENABLED) {
++ ar->arWmmEnabled = TRUE;
++ } else {
++ ar->arWmmEnabled = FALSE;
++ }
++
++ ret = wmi_set_wmm_cmd(ar->arWmi, cmd.status);
++
++ switch (ret) {
++ case A_OK:
++ return 0;
++ case A_EBUSY :
++ return -EBUSY;
++ case A_NO_MEMORY:
++ return -ENOMEM;
++ case A_EINVAL:
++ default:
++ return -EFAULT;
++ }
++}
++
++static int
++ar6000_ioctl_set_txop(struct net_device *dev, struct ifreq *rq)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ WMI_SET_WMM_TXOP_CMD cmd;
++ A_STATUS ret;
++
++ if ((dev->flags & IFF_UP) != IFF_UP) {
++ return -EIO;
++ }
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++ if (copy_from_user(&cmd, (char *)((unsigned int*)rq->ifr_data + 1),
++ sizeof(cmd)))
++ {
++ return -EFAULT;
++ }
++
++ ret = wmi_set_wmm_txop(ar->arWmi, cmd.txopEnable);
++
++ switch (ret) {
++ case A_OK:
++ return 0;
++ case A_EBUSY :
++ return -EBUSY;
++ case A_NO_MEMORY:
++ return -ENOMEM;
++ case A_EINVAL:
++ default:
++ return -EFAULT;
++ }
++}
++
++static int
++ar6000_ioctl_get_rd(struct net_device *dev, struct ifreq *rq)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ A_STATUS ret = 0;
++
++ if ((dev->flags & IFF_UP) != IFF_UP || ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++ if(copy_to_user((char *)((unsigned int*)rq->ifr_data + 1),
++ &ar->arRegCode, sizeof(ar->arRegCode)))
++ ret = -EFAULT;
++
++ return ret;
++}
++
++
++/* Get power mode command */
++static int
++ar6000_ioctl_get_power_mode(struct net_device *dev, struct ifreq *rq)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ WMI_POWER_MODE_CMD power_mode;
++ int ret = 0;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++ power_mode.powerMode = wmi_get_power_mode_cmd(ar->arWmi);
++ if (copy_to_user(rq->ifr_data, &power_mode, sizeof(WMI_POWER_MODE_CMD))) {
++ ret = -EFAULT;
++ }
++
++ return ret;
++}
++
++
++static int
++ar6000_ioctl_set_channelParams(struct net_device *dev, struct ifreq *rq)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ WMI_CHANNEL_PARAMS_CMD cmd, *cmdp;
++ int ret = 0;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++
++ if (copy_from_user(&cmd, rq->ifr_data, sizeof(cmd))) {
++ return -EFAULT;
++ }
++
++ if (cmd.numChannels > 1) {
++ cmdp = A_MALLOC(130);
++ if (copy_from_user(cmdp, rq->ifr_data,
++ sizeof (*cmdp) +
++ ((cmd.numChannels - 1) * sizeof(A_UINT16))))
++ {
++ kfree(cmdp);
++ return -EFAULT;
++ }
++ } else {
++ cmdp = &cmd;
++ }
++
++ if ((ar->arPhyCapability == WMI_11G_CAPABILITY) &&
++ ((cmdp->phyMode == WMI_11A_MODE) || (cmdp->phyMode == WMI_11AG_MODE)))
++ {
++ ret = -EINVAL;
++ }
++
++ if (!ret &&
++ (wmi_set_channelParams_cmd(ar->arWmi, cmdp->scanParam, cmdp->phyMode,
++ cmdp->numChannels, cmdp->channelList)
++ != A_OK))
++ {
++ ret = -EIO;
++ }
++
++ if (cmd.numChannels > 1) {
++ kfree(cmdp);
++ }
++
++ return ret;
++}
++
++static int
++ar6000_ioctl_set_snr_threshold(struct net_device *dev, struct ifreq *rq)
++{
++
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ WMI_SNR_THRESHOLD_PARAMS_CMD cmd;
++ int ret = 0;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++ if (copy_from_user(&cmd, rq->ifr_data, sizeof(cmd))) {
++ return -EFAULT;
++ }
++
++ if( wmi_set_snr_threshold_params(ar->arWmi, &cmd) != A_OK ) {
++ ret = -EIO;
++ }
++
++ return ret;
++}
++
++static int
++ar6000_ioctl_set_rssi_threshold(struct net_device *dev, struct ifreq *rq)
++{
++#define SWAP_THOLD(thold1, thold2) do { \
++ USER_RSSI_THOLD tmpThold; \
++ tmpThold.tag = thold1.tag; \
++ tmpThold.rssi = thold1.rssi; \
++ thold1.tag = thold2.tag; \
++ thold1.rssi = thold2.rssi; \
++ thold2.tag = tmpThold.tag; \
++ thold2.rssi = tmpThold.rssi; \
++} while (0)
++
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ WMI_RSSI_THRESHOLD_PARAMS_CMD cmd;
++ USER_RSSI_PARAMS rssiParams;
++ A_INT32 i, j;
++
++ int ret = 0;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++ if (copy_from_user((char *)&rssiParams, (char *)((unsigned int *)rq->ifr_data + 1), sizeof(USER_RSSI_PARAMS))) {
++ return -EFAULT;
++ }
++ cmd.weight = rssiParams.weight;
++ cmd.pollTime = rssiParams.pollTime;
++
++ A_MEMCPY(rssi_map, &rssiParams.tholds, sizeof(rssi_map));
++ /*
++ * only 6 elements, so use bubble sorting, in ascending order
++ */
++ for (i = 5; i > 0; i--) {
++ for (j = 0; j < i; j++) { /* above tholds */
++ if (rssi_map[j+1].rssi < rssi_map[j].rssi) {
++ SWAP_THOLD(rssi_map[j+1], rssi_map[j]);
++ } else if (rssi_map[j+1].rssi == rssi_map[j].rssi) {
++ return EFAULT;
++ }
++ }
++ }
++ for (i = 11; i > 6; i--) {
++ for (j = 6; j < i; j++) { /* below tholds */
++ if (rssi_map[j+1].rssi < rssi_map[j].rssi) {
++ SWAP_THOLD(rssi_map[j+1], rssi_map[j]);
++ } else if (rssi_map[j+1].rssi == rssi_map[j].rssi) {
++ return EFAULT;
++ }
++ }
++ }
++
++#ifdef DEBUG
++ for (i = 0; i < 12; i++) {
++ AR_DEBUG2_PRINTF("thold[%d].tag: %d, thold[%d].rssi: %d \n",
++ i, rssi_map[i].tag, i, rssi_map[i].rssi);
++ }
++#endif
++ cmd.thresholdAbove1_Val = rssi_map[0].rssi;
++ cmd.thresholdAbove2_Val = rssi_map[1].rssi;
++ cmd.thresholdAbove3_Val = rssi_map[2].rssi;
++ cmd.thresholdAbove4_Val = rssi_map[3].rssi;
++ cmd.thresholdAbove5_Val = rssi_map[4].rssi;
++ cmd.thresholdAbove6_Val = rssi_map[5].rssi;
++ cmd.thresholdBelow1_Val = rssi_map[6].rssi;
++ cmd.thresholdBelow2_Val = rssi_map[7].rssi;
++ cmd.thresholdBelow3_Val = rssi_map[8].rssi;
++ cmd.thresholdBelow4_Val = rssi_map[9].rssi;
++ cmd.thresholdBelow5_Val = rssi_map[10].rssi;
++ cmd.thresholdBelow6_Val = rssi_map[11].rssi;
++
++ if( wmi_set_rssi_threshold_params(ar->arWmi, &cmd) != A_OK ) {
++ ret = -EIO;
++ }
++
++ return ret;
++}
++
++static int
++ar6000_ioctl_set_lq_threshold(struct net_device *dev, struct ifreq *rq)
++{
++
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ WMI_LQ_THRESHOLD_PARAMS_CMD cmd;
++ int ret = 0;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++ if (copy_from_user(&cmd, (char *)((unsigned int *)rq->ifr_data + 1), sizeof(cmd))) {
++ return -EFAULT;
++ }
++
++ if( wmi_set_lq_threshold_params(ar->arWmi, &cmd) != A_OK ) {
++ ret = -EIO;
++ }
++
++ return ret;
++}
++
++
++static int
++ar6000_ioctl_set_probedSsid(struct net_device *dev, struct ifreq *rq)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ WMI_PROBED_SSID_CMD cmd;
++ int ret = 0;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++ if (copy_from_user(&cmd, rq->ifr_data, sizeof(cmd))) {
++ return -EFAULT;
++ }
++
++ if (wmi_probedSsid_cmd(ar->arWmi, cmd.entryIndex, cmd.flag, cmd.ssidLength,
++ cmd.ssid) != A_OK)
++ {
++ ret = -EIO;
++ }
++
++ return ret;
++}
++
++static int
++ar6000_ioctl_set_badAp(struct net_device *dev, struct ifreq *rq)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ WMI_ADD_BAD_AP_CMD cmd;
++ int ret = 0;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++
++ if (copy_from_user(&cmd, rq->ifr_data, sizeof(cmd))) {
++ return -EFAULT;
++ }
++
++ if (cmd.badApIndex > WMI_MAX_BAD_AP_INDEX) {
++ return -EIO;
++ }
++
++ if (A_MEMCMP(cmd.bssid, null_mac, AR6000_ETH_ADDR_LEN) == 0) {
++ /*
++ * This is a delete badAP.
++ */
++ if (wmi_deleteBadAp_cmd(ar->arWmi, cmd.badApIndex) != A_OK) {
++ ret = -EIO;
++ }
++ } else {
++ if (wmi_addBadAp_cmd(ar->arWmi, cmd.badApIndex, cmd.bssid) != A_OK) {
++ ret = -EIO;
++ }
++ }
++
++ return ret;
++}
++
++static int
++ar6000_ioctl_create_qos(struct net_device *dev, struct ifreq *rq)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ WMI_CREATE_PSTREAM_CMD cmd;
++ A_STATUS ret;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++
++ if (copy_from_user(&cmd, rq->ifr_data, sizeof(cmd))) {
++ return -EFAULT;
++ }
++
++ ret = wmi_verify_tspec_params(&cmd, tspecCompliance);
++ if (ret == A_OK)
++ ret = wmi_create_pstream_cmd(ar->arWmi, &cmd);
++
++ switch (ret) {
++ case A_OK:
++ return 0;
++ case A_EBUSY :
++ return -EBUSY;
++ case A_NO_MEMORY:
++ return -ENOMEM;
++ case A_EINVAL:
++ default:
++ return -EFAULT;
++ }
++}
++
++static int
++ar6000_ioctl_delete_qos(struct net_device *dev, struct ifreq *rq)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ WMI_DELETE_PSTREAM_CMD cmd;
++ int ret = 0;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++ if (copy_from_user(&cmd, rq->ifr_data, sizeof(cmd))) {
++ return -EFAULT;
++ }
++
++ ret = wmi_delete_pstream_cmd(ar->arWmi, cmd.trafficClass, cmd.tsid);
++
++ switch (ret) {
++ case A_OK:
++ return 0;
++ case A_EBUSY :
++ return -EBUSY;
++ case A_NO_MEMORY:
++ return -ENOMEM;
++ case A_EINVAL:
++ default:
++ return -EFAULT;
++ }
++}
++
++static int
++ar6000_ioctl_get_qos_queue(struct net_device *dev, struct ifreq *rq)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ struct ar6000_queuereq qreq;
++ int ret = 0;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++ if( copy_from_user(&qreq, rq->ifr_data,
++ sizeof(struct ar6000_queuereq)))
++ return -EFAULT;
++
++ qreq.activeTsids = wmi_get_mapped_qos_queue(ar->arWmi, qreq.trafficClass);
++
++ if (copy_to_user(rq->ifr_data, &qreq,
++ sizeof(struct ar6000_queuereq)))
++ {
++ ret = -EFAULT;
++ }
++
++ return ret;
++}
++
++#ifdef CONFIG_HOST_TCMD_SUPPORT
++static A_STATUS
++ar6000_ioctl_tcmd_get_rx_report(struct net_device *dev,
++ struct ifreq *rq, A_UINT8 *data, A_UINT32 len)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ A_UINT32 buf[2];
++ int ret = 0;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++ if (down_interruptible(&ar->arSem)) {
++ return -ERESTARTSYS;
++ }
++ ar->tcmdRxReport = 0;
++ if (wmi_test_cmd(ar->arWmi, data, len) != A_OK) {
++ up(&ar->arSem);
++ return -EIO;
++ }
++
++ wait_event_interruptible_timeout(arEvent, ar->tcmdRxReport != 0, wmitimeout * HZ);
++
++ if (signal_pending(current)) {
++ ret = -EINTR;
++ }
++
++ buf[0] = ar->tcmdRxTotalPkt;
++ buf[1] = ar->tcmdRxRssi;
++ if (!ret && copy_to_user(rq->ifr_data, buf, sizeof(buf))) {
++ ret = -EFAULT;
++ }
++
++ up(&ar->arSem);
++
++ return ret;
++}
++
++void
++ar6000_tcmd_rx_report_event(void *devt, A_UINT8 * results, int len)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)devt;
++ TCMD_CONT_RX * rx_rep = (TCMD_CONT_RX *)results;
++
++ ar->tcmdRxTotalPkt = rx_rep->u.report.totalPkt;
++ ar->tcmdRxRssi = rx_rep->u.report.rssiInDBm;
++ ar->tcmdRxReport = 1;
++
++ wake_up(&arEvent);
++}
++#endif /* CONFIG_HOST_TCMD_SUPPORT*/
++
++static int
++ar6000_ioctl_set_error_report_bitmask(struct net_device *dev, struct ifreq *rq)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ WMI_TARGET_ERROR_REPORT_BITMASK cmd;
++ int ret = 0;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++ if (copy_from_user(&cmd, rq->ifr_data, sizeof(cmd))) {
++ return -EFAULT;
++ }
++
++ ret = wmi_set_error_report_bitmask(ar->arWmi, cmd.bitmask);
++
++ return (ret==0 ? ret : -EINVAL);
++}
++
++static int
++ar6000_clear_target_stats(struct net_device *dev)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ TARGET_STATS *pStats = &ar->arTargetStats;
++ int ret = 0;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++ AR6000_SPIN_LOCK(&ar->arLock, 0);
++ A_MEMZERO(pStats, sizeof(TARGET_STATS));
++ AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++ return ret;
++}
++
++static int
++ar6000_ioctl_get_target_stats(struct net_device *dev, struct ifreq *rq)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ TARGET_STATS_CMD cmd;
++ TARGET_STATS *pStats = &ar->arTargetStats;
++ int ret = 0;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++ if (copy_from_user(&cmd, rq->ifr_data, sizeof(cmd))) {
++ return -EFAULT;
++ }
++ if (down_interruptible(&ar->arSem)) {
++ return -ERESTARTSYS;
++ }
++
++ ar->statsUpdatePending = TRUE;
++
++ if(wmi_get_stats_cmd(ar->arWmi) != A_OK) {
++ up(&ar->arSem);
++ return -EIO;
++ }
++
++ wait_event_interruptible_timeout(arEvent, ar->statsUpdatePending == FALSE, wmitimeout * HZ);
++
++ if (signal_pending(current)) {
++ ret = -EINTR;
++ }
++
++ if (!ret && copy_to_user(rq->ifr_data, pStats, sizeof(*pStats))) {
++ ret = -EFAULT;
++ }
++
++ if (cmd.clearStats == 1) {
++ ret = ar6000_clear_target_stats(dev);
++ }
++
++ up(&ar->arSem);
++
++ return ret;
++}
++
++static int
++ar6000_ioctl_set_access_params(struct net_device *dev, struct ifreq *rq)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ WMI_SET_ACCESS_PARAMS_CMD cmd;
++ int ret = 0;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++ if (copy_from_user(&cmd, rq->ifr_data, sizeof(cmd))) {
++ return -EFAULT;
++ }
++
++ if (wmi_set_access_params_cmd(ar->arWmi, cmd.txop, cmd.eCWmin, cmd.eCWmax,
++ cmd.aifsn) == A_OK)
++ {
++ ret = 0;
++ } else {
++ ret = -EINVAL;
++ }
++
++ return (ret);
++}
++
++static int
++ar6000_ioctl_set_disconnect_timeout(struct net_device *dev, struct ifreq *rq)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ WMI_DISC_TIMEOUT_CMD cmd;
++ int ret = 0;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++ if (copy_from_user(&cmd, rq->ifr_data, sizeof(cmd))) {
++ return -EFAULT;
++ }
++
++ if (wmi_disctimeout_cmd(ar->arWmi, cmd.disconnectTimeout) == A_OK)
++ {
++ ret = 0;
++ } else {
++ ret = -EINVAL;
++ }
++
++ return (ret);
++}
++
++static int
++ar6000_xioctl_set_voice_pkt_size(struct net_device *dev, char * userdata)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ WMI_SET_VOICE_PKT_SIZE_CMD cmd;
++ int ret = 0;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++ if (copy_from_user(&cmd, userdata, sizeof(cmd))) {
++ return -EFAULT;
++ }
++
++ if (wmi_set_voice_pkt_size_cmd(ar->arWmi, cmd.voicePktSize) == A_OK)
++ {
++ ret = 0;
++ } else {
++ ret = -EINVAL;
++ }
++
++
++ return (ret);
++}
++
++static int
++ar6000_xioctl_set_max_sp_len(struct net_device *dev, char * userdata)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ WMI_SET_MAX_SP_LEN_CMD cmd;
++ int ret = 0;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++ if (copy_from_user(&cmd, userdata, sizeof(cmd))) {
++ return -EFAULT;
++ }
++
++ if (wmi_set_max_sp_len_cmd(ar->arWmi, cmd.maxSPLen) == A_OK)
++ {
++ ret = 0;
++ } else {
++ ret = -EINVAL;
++ }
++
++ return (ret);
++}
++
++
++static int
++ar6000_xioctl_set_bt_status_cmd(struct net_device *dev, char * userdata)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ WMI_SET_BT_STATUS_CMD cmd;
++ int ret = 0;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++ if (copy_from_user(&cmd, userdata, sizeof(cmd))) {
++ return -EFAULT;
++ }
++
++ if (wmi_set_bt_status_cmd(ar->arWmi, cmd.streamType, cmd.status) == A_OK)
++ {
++ ret = 0;
++ } else {
++ ret = -EINVAL;
++ }
++
++ return (ret);
++}
++
++static int
++ar6000_xioctl_set_bt_params_cmd(struct net_device *dev, char * userdata)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ WMI_SET_BT_PARAMS_CMD cmd;
++ int ret = 0;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++ if (copy_from_user(&cmd, userdata, sizeof(cmd))) {
++ return -EFAULT;
++ }
++
++ if (wmi_set_bt_params_cmd(ar->arWmi, &cmd) == A_OK)
++ {
++ ret = 0;
++ } else {
++ ret = -EINVAL;
++ }
++
++ return (ret);
++}
++
++#ifdef CONFIG_HOST_GPIO_SUPPORT
++struct ar6000_gpio_intr_wait_cmd_s gpio_intr_results;
++/* gpio_reg_results and gpio_data_available are protected by arSem */
++static struct ar6000_gpio_register_cmd_s gpio_reg_results;
++static A_BOOL gpio_data_available; /* Requested GPIO data available */
++static A_BOOL gpio_intr_available; /* GPIO interrupt info available */
++static A_BOOL gpio_ack_received; /* GPIO ack was received */
++
++/* Host-side initialization for General Purpose I/O support */
++void ar6000_gpio_init(void)
++{
++ gpio_intr_available = FALSE;
++ gpio_data_available = FALSE;
++ gpio_ack_received = FALSE;
++}
++
++/*
++ * Called when a GPIO interrupt is received from the Target.
++ * intr_values shows which GPIO pins have interrupted.
++ * input_values shows a recent value of GPIO pins.
++ */
++void
++ar6000_gpio_intr_rx(A_UINT32 intr_mask, A_UINT32 input_values)
++{
++ gpio_intr_results.intr_mask = intr_mask;
++ gpio_intr_results.input_values = input_values;
++ *((volatile A_BOOL *)&gpio_intr_available) = TRUE;
++ wake_up(&arEvent);
++}
++
++/*
++ * This is called when a response is received from the Target
++ * for a previous or ar6000_gpio_input_get or ar6000_gpio_register_get
++ * call.
++ */
++void
++ar6000_gpio_data_rx(A_UINT32 reg_id, A_UINT32 value)
++{
++ gpio_reg_results.gpioreg_id = reg_id;
++ gpio_reg_results.value = value;
++ *((volatile A_BOOL *)&gpio_data_available) = TRUE;
++ wake_up(&arEvent);
++}
++
++/*
++ * This is called when an acknowledgement is received from the Target
++ * for a previous or ar6000_gpio_output_set or ar6000_gpio_register_set
++ * call.
++ */
++void
++ar6000_gpio_ack_rx(void)
++{
++ gpio_ack_received = TRUE;
++ wake_up(&arEvent);
++}
++
++A_STATUS
++ar6000_gpio_output_set(struct net_device *dev,
++ A_UINT32 set_mask,
++ A_UINT32 clear_mask,
++ A_UINT32 enable_mask,
++ A_UINT32 disable_mask)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++
++ gpio_ack_received = FALSE;
++ return wmi_gpio_output_set(ar->arWmi,
++ set_mask, clear_mask, enable_mask, disable_mask);
++}
++
++static A_STATUS
++ar6000_gpio_input_get(struct net_device *dev)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++
++ *((volatile A_BOOL *)&gpio_data_available) = FALSE;
++ return wmi_gpio_input_get(ar->arWmi);
++}
++
++static A_STATUS
++ar6000_gpio_register_set(struct net_device *dev,
++ A_UINT32 gpioreg_id,
++ A_UINT32 value)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++
++ gpio_ack_received = FALSE;
++ return wmi_gpio_register_set(ar->arWmi, gpioreg_id, value);
++}
++
++static A_STATUS
++ar6000_gpio_register_get(struct net_device *dev,
++ A_UINT32 gpioreg_id)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++
++ *((volatile A_BOOL *)&gpio_data_available) = FALSE;
++ return wmi_gpio_register_get(ar->arWmi, gpioreg_id);
++}
++
++static A_STATUS
++ar6000_gpio_intr_ack(struct net_device *dev,
++ A_UINT32 ack_mask)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++
++ gpio_intr_available = FALSE;
++ return wmi_gpio_intr_ack(ar->arWmi, ack_mask);
++}
++#endif /* CONFIG_HOST_GPIO_SUPPORT */
++
++int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ HIF_DEVICE *hifDevice = ar->arHifDevice;
++ int ret, param, param2;
++ unsigned int address = 0;
++ unsigned int length = 0;
++ unsigned char *buffer;
++ char *userdata;
++ A_UINT32 connectCtrlFlags;
++
++
++ static WMI_SCAN_PARAMS_CMD scParams = {0, 0, 0, 0, 0,
++ WMI_SHORTSCANRATIO_DEFAULT,
++ DEFAULT_SCAN_CTRL_FLAGS,
++ 0};
++ WMI_SET_AKMP_PARAMS_CMD akmpParams;
++ WMI_SET_PMKID_LIST_CMD pmkidInfo;
++
++ if (cmd == AR6000_IOCTL_EXTENDED)
++ {
++ /*
++ * This allows for many more wireless ioctls than would otherwise
++ * be available. Applications embed the actual ioctl command in
++ * the first word of the parameter block, and use the command
++ * AR6000_IOCTL_EXTENDED_CMD on the ioctl call.
++ */
++ get_user(cmd, (int *)rq->ifr_data);
++ userdata = (char *)(((unsigned int *)rq->ifr_data)+1);
++ }
++ else
++ {
++ userdata = (char *)rq->ifr_data;
++ }
++
++ if ((ar->arWlanState == WLAN_DISABLED) &&
++ ((cmd != AR6000_XIOCTRL_WMI_SET_WLAN_STATE) &&
++ (cmd != AR6000_XIOCTL_DIAG_READ) &&
++ (cmd != AR6000_XIOCTL_DIAG_WRITE)))
++ {
++ return -EIO;
++ }
++
++ ret = 0;
++ switch(cmd)
++ {
++#ifdef CONFIG_HOST_TCMD_SUPPORT
++ case AR6000_XIOCTL_TCMD_CONT_TX:
++ {
++ TCMD_CONT_TX txCmd;
++
++ if (ar->tcmdPm == TCMD_PM_SLEEP) {
++ A_PRINTF("Can NOT send tx tcmd when target is asleep! \n");
++ return -EFAULT;
++ }
++
++ if(copy_from_user(&txCmd, userdata, sizeof(TCMD_CONT_TX)))
++ return -EFAULT;
++ wmi_test_cmd(ar->arWmi,(A_UINT8 *)&txCmd, sizeof(TCMD_CONT_TX));
++ }
++ break;
++ case AR6000_XIOCTL_TCMD_CONT_RX:
++ {
++ TCMD_CONT_RX rxCmd;
++
++ if (ar->tcmdPm == TCMD_PM_SLEEP) {
++ A_PRINTF("Can NOT send rx tcmd when target is asleep! \n");
++ return -EFAULT;
++ }
++ if(copy_from_user(&rxCmd, userdata, sizeof(TCMD_CONT_RX)))
++ return -EFAULT;
++ switch(rxCmd.act)
++ {
++ case TCMD_CONT_RX_PROMIS:
++ case TCMD_CONT_RX_FILTER:
++ case TCMD_CONT_RX_SETMAC:
++ wmi_test_cmd(ar->arWmi,(A_UINT8 *)&rxCmd,
++ sizeof(TCMD_CONT_RX));
++ break;
++ case TCMD_CONT_RX_REPORT:
++ ar6000_ioctl_tcmd_get_rx_report(dev, rq,
++ (A_UINT8 *)&rxCmd, sizeof(TCMD_CONT_RX));
++ break;
++ default:
++ A_PRINTF("Unknown Cont Rx mode: %d\n",rxCmd.act);
++ return -EINVAL;
++ }
++ }
++ break;
++ case AR6000_XIOCTL_TCMD_PM:
++ {
++ TCMD_PM pmCmd;
++
++ if(copy_from_user(&pmCmd, userdata, sizeof(TCMD_PM)))
++ return -EFAULT;
++ ar->tcmdPm = pmCmd.mode;
++ wmi_test_cmd(ar->arWmi, (A_UINT8*)&pmCmd, sizeof(TCMD_PM));
++ }
++ break;
++#endif /* CONFIG_HOST_TCMD_SUPPORT */
++
++ case AR6000_XIOCTL_BMI_DONE:
++ ret = BMIDone(hifDevice);
++ break;
++
++ case AR6000_XIOCTL_BMI_READ_MEMORY:
++ get_user(address, (unsigned int *)userdata);
++ get_user(length, (unsigned int *)userdata + 1);
++ AR_DEBUG_PRINTF("Read Memory (address: 0x%x, length: %d)\n",
++ address, length);
++ if ((buffer = (unsigned char *)A_MALLOC(length)) != NULL) {
++ A_MEMZERO(buffer, length);
++ ret = BMIReadMemory(hifDevice, address, buffer, length);
++ if (copy_to_user(rq->ifr_data, buffer, length)) {
++ ret = -EFAULT;
++ }
++ A_FREE(buffer);
++ } else {
++ ret = -ENOMEM;
++ }
++ break;
++
++ case AR6000_XIOCTL_BMI_WRITE_MEMORY:
++ get_user(address, (unsigned int *)userdata);
++ get_user(length, (unsigned int *)userdata + 1);
++ AR_DEBUG_PRINTF("Write Memory (address: 0x%x, length: %d)\n",
++ address, length);
++ if ((buffer = (unsigned char *)A_MALLOC(length)) != NULL) {
++ A_MEMZERO(buffer, length);
++ if (copy_from_user(buffer, &userdata[sizeof(address) +
++ sizeof(length)], length))
++ {
++ ret = -EFAULT;
++ } else {
++ ret = BMIWriteMemory(hifDevice, address, buffer, length);
++ }
++ A_FREE(buffer);
++ } else {
++ ret = -ENOMEM;
++ }
++ break;
++
++ case AR6000_XIOCTL_BMI_TEST:
++ AR_DEBUG_PRINTF("No longer supported\n");
++ ret = -EOPNOTSUPP;
++ break;
++
++ case AR6000_XIOCTL_BMI_EXECUTE:
++ get_user(address, (unsigned int *)userdata);
++ get_user(param, (unsigned int *)userdata + 1);
++ AR_DEBUG_PRINTF("Execute (address: 0x%x, param: %d)\n",
++ address, param);
++ ret = BMIExecute(hifDevice, address, &param);
++ put_user(param, (unsigned int *)rq->ifr_data); /* return value */
++ break;
++
++ case AR6000_XIOCTL_BMI_SET_APP_START:
++ get_user(address, (unsigned int *)userdata);
++ AR_DEBUG_PRINTF("Set App Start (address: 0x%x)\n", address);
++ ret = BMISetAppStart(hifDevice, address);
++ break;
++
++ case AR6000_XIOCTL_BMI_READ_SOC_REGISTER:
++ get_user(address, (unsigned int *)userdata);
++ ret = BMIReadSOCRegister(hifDevice, address, &param);
++ put_user(param, (unsigned int *)rq->ifr_data); /* return value */
++ break;
++
++ case AR6000_XIOCTL_BMI_WRITE_SOC_REGISTER:
++ get_user(address, (unsigned int *)userdata);
++ get_user(param, (unsigned int *)userdata + 1);
++ ret = BMIWriteSOCRegister(hifDevice, address, param);
++ break;
++
++#ifdef HTC_RAW_INTERFACE
++ case AR6000_XIOCTL_HTC_RAW_OPEN:
++ ret = A_OK;
++ if (!arRawIfEnabled(ar)) {
++ /* make sure block size is set in case the target was reset since last
++ * BMI phase (i.e. flashup downloads) */
++ ret = ar6000_SetHTCBlockSize(ar);
++ if (A_FAILED(ret)) {
++ break;
++ }
++ /* Terminate the BMI phase */
++ ret = BMIDone(hifDevice);
++ if (ret == A_OK) {
++ ret = ar6000_htc_raw_open(ar);
++ }
++ }
++ break;
++
++ case AR6000_XIOCTL_HTC_RAW_CLOSE:
++ if (arRawIfEnabled(ar)) {
++ ret = ar6000_htc_raw_close(ar);
++ arRawIfEnabled(ar) = FALSE;
++ } else {
++ ret = A_ERROR;
++ }
++ break;
++
++ case AR6000_XIOCTL_HTC_RAW_READ:
++ if (arRawIfEnabled(ar)) {
++ unsigned int streamID;
++ get_user(streamID, (unsigned int *)userdata);
++ get_user(length, (unsigned int *)userdata + 1);
++ buffer = rq->ifr_data + sizeof(length);
++ ret = ar6000_htc_raw_read(ar, (HTC_RAW_STREAM_ID)streamID,
++ buffer, length);
++ put_user(ret, (unsigned int *)rq->ifr_data);
++ } else {
++ ret = A_ERROR;
++ }
++ break;
++
++ case AR6000_XIOCTL_HTC_RAW_WRITE:
++ if (arRawIfEnabled(ar)) {
++ unsigned int streamID;
++ get_user(streamID, (unsigned int *)userdata);
++ get_user(length, (unsigned int *)userdata + 1);
++ buffer = userdata + sizeof(streamID) + sizeof(length);
++ ret = ar6000_htc_raw_write(ar, (HTC_RAW_STREAM_ID)streamID,
++ buffer, length);
++ put_user(ret, (unsigned int *)rq->ifr_data);
++ } else {
++ ret = A_ERROR;
++ }
++ break;
++#endif /* HTC_RAW_INTERFACE */
++
++ case AR6000_IOCTL_WMI_GETREV:
++ {
++ if (copy_to_user(rq->ifr_data, &ar->arVersion,
++ sizeof(ar->arVersion)))
++ {
++ ret = -EFAULT;
++ }
++ break;
++ }
++ case AR6000_IOCTL_WMI_SETPWR:
++ {
++ WMI_POWER_MODE_CMD pwrModeCmd;
++
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else if (copy_from_user(&pwrModeCmd, userdata,
++ sizeof(pwrModeCmd)))
++ {
++ ret = -EFAULT;
++ } else {
++ if (wmi_powermode_cmd(ar->arWmi, pwrModeCmd.powerMode)
++ != A_OK)
++ {
++ ret = -EIO;
++ }
++ }
++ break;
++ }
++ case AR6000_IOCTL_WMI_SET_IBSS_PM_CAPS:
++ {
++ WMI_IBSS_PM_CAPS_CMD ibssPmCaps;
++
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else if (copy_from_user(&ibssPmCaps, userdata,
++ sizeof(ibssPmCaps)))
++ {
++ ret = -EFAULT;
++ } else {
++ if (wmi_ibsspmcaps_cmd(ar->arWmi, ibssPmCaps.power_saving, ibssPmCaps.ttl,
++ ibssPmCaps.atim_windows, ibssPmCaps.timeout_value) != A_OK)
++ {
++ ret = -EIO;
++ }
++ AR6000_SPIN_LOCK(&ar->arLock, 0);
++ ar->arIbssPsEnable = ibssPmCaps.power_saving;
++ AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++ }
++ break;
++ }
++ case AR6000_IOCTL_WMI_SET_PMPARAMS:
++ {
++ WMI_POWER_PARAMS_CMD pmParams;
++
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else if (copy_from_user(&pmParams, userdata,
++ sizeof(pmParams)))
++ {
++ ret = -EFAULT;
++ } else {
++ if (wmi_pmparams_cmd(ar->arWmi, pmParams.idle_period,
++ pmParams.pspoll_number,
++ pmParams.dtim_policy) != A_OK)
++ {
++ ret = -EIO;
++ }
++ }
++ break;
++ }
++ case AR6000_IOCTL_WMI_SETSCAN:
++ {
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else if (copy_from_user(&scParams, userdata,
++ sizeof(scParams)))
++ {
++ ret = -EFAULT;
++ } else {
++ if (CAN_SCAN_IN_CONNECT(scParams.scanCtrlFlags)) {
++ ar->arSkipScan = FALSE;
++ } else {
++ ar->arSkipScan = TRUE;
++ }
++
++ if (wmi_scanparams_cmd(ar->arWmi, scParams.fg_start_period,
++ scParams.fg_end_period,
++ scParams.bg_period,
++ scParams.minact_chdwell_time,
++ scParams.maxact_chdwell_time,
++ scParams.pas_chdwell_time,
++ scParams.shortScanRatio,
++ scParams.scanCtrlFlags,
++ scParams.max_dfsch_act_time) != A_OK)
++ {
++ ret = -EIO;
++ }
++ }
++ break;
++ }
++ case AR6000_IOCTL_WMI_SETLISTENINT:
++ {
++ WMI_LISTEN_INT_CMD listenCmd;
++
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else if (copy_from_user(&listenCmd, userdata,
++ sizeof(listenCmd)))
++ {
++ ret = -EFAULT;
++ } else {
++ if (wmi_listeninterval_cmd(ar->arWmi, listenCmd.listenInterval, listenCmd.numBeacons) != A_OK) {
++ ret = -EIO;
++ } else {
++ AR6000_SPIN_LOCK(&ar->arLock, 0);
++ ar->arListenInterval = param;
++ AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++ }
++
++ }
++ break;
++ }
++ case AR6000_IOCTL_WMI_SET_BMISS_TIME:
++ {
++ WMI_BMISS_TIME_CMD bmissCmd;
++
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else if (copy_from_user(&bmissCmd, userdata,
++ sizeof(bmissCmd)))
++ {
++ ret = -EFAULT;
++ } else {
++ if (wmi_bmisstime_cmd(ar->arWmi, bmissCmd.bmissTime, bmissCmd.numBeacons) != A_OK) {
++ ret = -EIO;
++ }
++ }
++ break;
++ }
++ case AR6000_IOCTL_WMI_SETBSSFILTER:
++ {
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else {
++
++ get_user(param, (unsigned char *)userdata);
++ get_user(param2, (unsigned int *)(userdata + 1));
++ printk("SETBSSFILTER: filter 0x%x, mask: 0x%x\n", param, param2);
++ if (wmi_bssfilter_cmd(ar->arWmi, param, param2) != A_OK) {
++ ret = -EIO;
++ }
++ }
++ break;
++ }
++ case AR6000_IOCTL_WMI_SET_SNRTHRESHOLD:
++ {
++ ret = ar6000_ioctl_set_snr_threshold(dev, rq);
++ break;
++ }
++ case AR6000_XIOCTL_WMI_SET_RSSITHRESHOLD:
++ {
++ ret = ar6000_ioctl_set_rssi_threshold(dev, rq);
++ break;
++ }
++ case AR6000_XIOCTL_WMI_CLR_RSSISNR:
++ {
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ }
++ ret = wmi_clr_rssi_snr(ar->arWmi);
++ break;
++ }
++ case AR6000_XIOCTL_WMI_SET_LQTHRESHOLD:
++ {
++ ret = ar6000_ioctl_set_lq_threshold(dev, rq);
++ break;
++ }
++ case AR6000_XIOCTL_WMI_SET_LPREAMBLE:
++ {
++ WMI_SET_LPREAMBLE_CMD setLpreambleCmd;
++
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else if (copy_from_user(&setLpreambleCmd, userdata,
++ sizeof(setLpreambleCmd)))
++ {
++ ret = -EFAULT;
++ } else {
++ if (wmi_set_lpreamble_cmd(ar->arWmi, setLpreambleCmd.status)
++ != A_OK)
++ {
++ ret = -EIO;
++ }
++ }
++
++ break;
++ }
++ case AR6000_XIOCTL_WMI_SET_RTS:
++ {
++ WMI_SET_RTS_CMD rtsCmd;
++
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else if (copy_from_user(&rtsCmd, userdata,
++ sizeof(rtsCmd)))
++ {
++ ret = -EFAULT;
++ } else {
++ if (wmi_set_rts_cmd(ar->arWmi, rtsCmd.threshold)
++ != A_OK)
++ {
++ ret = -EIO;
++ }
++ }
++
++ break;
++ }
++ case AR6000_XIOCTL_WMI_SET_WMM:
++ {
++ ret = ar6000_ioctl_set_wmm(dev, rq);
++ break;
++ }
++ case AR6000_XIOCTL_WMI_SET_TXOP:
++ {
++ ret = ar6000_ioctl_set_txop(dev, rq);
++ break;
++ }
++ case AR6000_XIOCTL_WMI_GET_RD:
++ {
++ ret = ar6000_ioctl_get_rd(dev, rq);
++ break;
++ }
++ case AR6000_IOCTL_WMI_SET_CHANNELPARAMS:
++ {
++ ret = ar6000_ioctl_set_channelParams(dev, rq);
++ break;
++ }
++ case AR6000_IOCTL_WMI_SET_PROBEDSSID:
++ {
++ ret = ar6000_ioctl_set_probedSsid(dev, rq);
++ break;
++ }
++ case AR6000_IOCTL_WMI_SET_BADAP:
++ {
++ ret = ar6000_ioctl_set_badAp(dev, rq);
++ break;
++ }
++ case AR6000_IOCTL_WMI_CREATE_QOS:
++ {
++ ret = ar6000_ioctl_create_qos(dev, rq);
++ break;
++ }
++ case AR6000_IOCTL_WMI_DELETE_QOS:
++ {
++ ret = ar6000_ioctl_delete_qos(dev, rq);
++ break;
++ }
++ case AR6000_IOCTL_WMI_GET_QOS_QUEUE:
++ {
++ ret = ar6000_ioctl_get_qos_queue(dev, rq);
++ break;
++ }
++ case AR6000_IOCTL_WMI_GET_TARGET_STATS:
++ {
++ ret = ar6000_ioctl_get_target_stats(dev, rq);
++ break;
++ }
++ case AR6000_IOCTL_WMI_SET_ERROR_REPORT_BITMASK:
++ {
++ ret = ar6000_ioctl_set_error_report_bitmask(dev, rq);
++ break;
++ }
++ case AR6000_IOCTL_WMI_SET_ASSOC_INFO:
++ {
++ WMI_SET_ASSOC_INFO_CMD cmd;
++ A_UINT8 assocInfo[WMI_MAX_ASSOC_INFO_LEN];
++
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else {
++ get_user(cmd.ieType, userdata);
++ if (cmd.ieType >= WMI_MAX_ASSOC_INFO_TYPE) {
++ ret = -EIO;
++ } else {
++ get_user(cmd.bufferSize, userdata + 1);
++ if (cmd.bufferSize > WMI_MAX_ASSOC_INFO_LEN) {
++ ret = -EFAULT;
++ break;
++ }
++ if (copy_from_user(assocInfo, userdata + 2,
++ cmd.bufferSize))
++ {
++ ret = -EFAULT;
++ } else {
++ if (wmi_associnfo_cmd(ar->arWmi, cmd.ieType,
++ cmd.bufferSize,
++ assocInfo) != A_OK)
++ {
++ ret = -EIO;
++ }
++ }
++ }
++ }
++ break;
++ }
++ case AR6000_IOCTL_WMI_SET_ACCESS_PARAMS:
++ {
++ ret = ar6000_ioctl_set_access_params(dev, rq);
++ break;
++ }
++ case AR6000_IOCTL_WMI_SET_DISC_TIMEOUT:
++ {
++ ret = ar6000_ioctl_set_disconnect_timeout(dev, rq);
++ break;
++ }
++ case AR6000_XIOCTL_FORCE_TARGET_RESET:
++ {
++ if (ar->arHtcTarget)
++ {
++// HTCForceReset(htcTarget);
++ }
++ else
++ {
++ AR_DEBUG_PRINTF("ar6000_ioctl cannot attempt reset.\n");
++ }
++ break;
++ }
++ case AR6000_XIOCTL_TARGET_INFO:
++ case AR6000_XIOCTL_CHECK_TARGET_READY: /* backwards compatibility */
++ {
++ /* If we made it to here, then the Target exists and is ready. */
++
++ if (cmd == AR6000_XIOCTL_TARGET_INFO) {
++ if (copy_to_user((A_UINT32 *)rq->ifr_data, &ar->arVersion.target_ver,
++ sizeof(ar->arVersion.target_ver)))
++ {
++ ret = -EFAULT;
++ }
++ if (copy_to_user(((A_UINT32 *)rq->ifr_data)+1, &ar->arTargetType,
++ sizeof(ar->arTargetType)))
++ {
++ ret = -EFAULT;
++ }
++ }
++ break;
++ }
++ case AR6000_XIOCTL_WMI_SET_HB_CHALLENGE_RESP_PARAMS:
++ {
++ WMI_SET_HB_CHALLENGE_RESP_PARAMS_CMD hbparam;
++
++ if (copy_from_user(&hbparam, userdata, sizeof(hbparam)))
++ {
++ ret = -EFAULT;
++ } else {
++ AR6000_SPIN_LOCK(&ar->arLock, 0);
++ /* Start a cyclic timer with the parameters provided. */
++ if (hbparam.frequency) {
++ ar->arHBChallengeResp.frequency = hbparam.frequency;
++ }
++ if (hbparam.threshold) {
++ ar->arHBChallengeResp.missThres = hbparam.threshold;
++ }
++
++ /* Delete the pending timer and start a new one */
++ if (timer_pending(&ar->arHBChallengeResp.timer)) {
++ A_UNTIMEOUT(&ar->arHBChallengeResp.timer);
++ }
++ A_TIMEOUT_MS(&ar->arHBChallengeResp.timer, ar->arHBChallengeResp.frequency * 1000, 0);
++ AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++ }
++ break;
++ }
++ case AR6000_XIOCTL_WMI_GET_HB_CHALLENGE_RESP:
++ {
++ A_UINT32 cookie;
++
++ if (copy_from_user(&cookie, userdata, sizeof(cookie))) {
++ return -EFAULT;
++ }
++
++ /* Send the challenge on the control channel */
++ if (wmi_get_challenge_resp_cmd(ar->arWmi, cookie, APP_HB_CHALLENGE) != A_OK) {
++ return -EIO;
++ }
++ break;
++ }
++#ifdef USER_KEYS
++ case AR6000_XIOCTL_USER_SETKEYS:
++ {
++
++ ar->user_savedkeys_stat = USER_SAVEDKEYS_STAT_RUN;
++
++ if (copy_from_user(&ar->user_key_ctrl, userdata,
++ sizeof(ar->user_key_ctrl)))
++ {
++ return -EFAULT;
++ }
++
++ A_PRINTF("ar6000 USER set key %x\n", ar->user_key_ctrl);
++ break;
++ }
++#endif /* USER_KEYS */
++
++#ifdef CONFIG_HOST_GPIO_SUPPORT
++ case AR6000_XIOCTL_GPIO_OUTPUT_SET:
++ {
++ struct ar6000_gpio_output_set_cmd_s gpio_output_set_cmd;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++ if (down_interruptible(&ar->arSem)) {
++ return -ERESTARTSYS;
++ }
++
++ if (copy_from_user(&gpio_output_set_cmd, userdata,
++ sizeof(gpio_output_set_cmd)))
++ {
++ ret = -EFAULT;
++ } else {
++ ret = ar6000_gpio_output_set(dev,
++ gpio_output_set_cmd.set_mask,
++ gpio_output_set_cmd.clear_mask,
++ gpio_output_set_cmd.enable_mask,
++ gpio_output_set_cmd.disable_mask);
++ if (ret != A_OK) {
++ ret = EIO;
++ }
++ }
++ up(&ar->arSem);
++ break;
++ }
++ case AR6000_XIOCTL_GPIO_INPUT_GET:
++ {
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++ if (down_interruptible(&ar->arSem)) {
++ return -ERESTARTSYS;
++ }
++
++ ret = ar6000_gpio_input_get(dev);
++ if (ret != A_OK) {
++ up(&ar->arSem);
++ return -EIO;
++ }
++
++ /* Wait for Target to respond. */
++ wait_event_interruptible(arEvent, gpio_data_available);
++ if (signal_pending(current)) {
++ ret = -EINTR;
++ } else {
++ A_ASSERT(gpio_reg_results.gpioreg_id == GPIO_ID_NONE);
++
++ if (copy_to_user(userdata, &gpio_reg_results.value,
++ sizeof(gpio_reg_results.value)))
++ {
++ ret = -EFAULT;
++ }
++ }
++ up(&ar->arSem);
++ break;
++ }
++ case AR6000_XIOCTL_GPIO_REGISTER_SET:
++ {
++ struct ar6000_gpio_register_cmd_s gpio_register_cmd;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++ if (down_interruptible(&ar->arSem)) {
++ return -ERESTARTSYS;
++ }
++
++ if (copy_from_user(&gpio_register_cmd, userdata,
++ sizeof(gpio_register_cmd)))
++ {
++ ret = -EFAULT;
++ } else {
++ ret = ar6000_gpio_register_set(dev,
++ gpio_register_cmd.gpioreg_id,
++ gpio_register_cmd.value);
++ if (ret != A_OK) {
++ ret = EIO;
++ }
++
++ /* Wait for acknowledgement from Target */
++ wait_event_interruptible(arEvent, gpio_ack_received);
++ if (signal_pending(current)) {
++ ret = -EINTR;
++ }
++ }
++ up(&ar->arSem);
++ break;
++ }
++ case AR6000_XIOCTL_GPIO_REGISTER_GET:
++ {
++ struct ar6000_gpio_register_cmd_s gpio_register_cmd;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++ if (down_interruptible(&ar->arSem)) {
++ return -ERESTARTSYS;
++ }
++
++ if (copy_from_user(&gpio_register_cmd, userdata,
++ sizeof(gpio_register_cmd)))
++ {
++ ret = -EFAULT;
++ } else {
++ ret = ar6000_gpio_register_get(dev, gpio_register_cmd.gpioreg_id);
++ if (ret != A_OK) {
++ up(&ar->arSem);
++ return -EIO;
++ }
++
++ /* Wait for Target to respond. */
++ wait_event_interruptible(arEvent, gpio_data_available);
++ if (signal_pending(current)) {
++ ret = -EINTR;
++ } else {
++ A_ASSERT(gpio_register_cmd.gpioreg_id == gpio_reg_results.gpioreg_id);
++ if (copy_to_user(userdata, &gpio_reg_results,
++ sizeof(gpio_reg_results)))
++ {
++ ret = -EFAULT;
++ }
++ }
++ }
++ up(&ar->arSem);
++ break;
++ }
++ case AR6000_XIOCTL_GPIO_INTR_ACK:
++ {
++ struct ar6000_gpio_intr_ack_cmd_s gpio_intr_ack_cmd;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++ if (down_interruptible(&ar->arSem)) {
++ return -ERESTARTSYS;
++ }
++
++ if (copy_from_user(&gpio_intr_ack_cmd, userdata,
++ sizeof(gpio_intr_ack_cmd)))
++ {
++ ret = -EFAULT;
++ } else {
++ ret = ar6000_gpio_intr_ack(dev, gpio_intr_ack_cmd.ack_mask);
++ if (ret != A_OK) {
++ ret = EIO;
++ }
++ }
++ up(&ar->arSem);
++ break;
++ }
++ case AR6000_XIOCTL_GPIO_INTR_WAIT:
++ {
++ /* Wait for Target to report an interrupt. */
++ dev_hold(dev);
++ rtnl_unlock();
++ wait_event_interruptible(arEvent, gpio_intr_available);
++ rtnl_lock();
++ __dev_put(dev);
++
++ if (signal_pending(current)) {
++ ret = -EINTR;
++ } else {
++ if (copy_to_user(userdata, &gpio_intr_results,
++ sizeof(gpio_intr_results)))
++ {
++ ret = -EFAULT;
++ }
++ }
++ break;
++ }
++#endif /* CONFIG_HOST_GPIO_SUPPORT */
++
++ case AR6000_XIOCTL_DBGLOG_CFG_MODULE:
++ {
++ struct ar6000_dbglog_module_config_s config;
++
++ if (copy_from_user(&config, userdata, sizeof(config))) {
++ return -EFAULT;
++ }
++
++ /* Send the challenge on the control channel */
++ if (wmi_config_debug_module_cmd(ar->arWmi, config.mmask,
++ config.tsr, config.rep,
++ config.size, config.valid) != A_OK)
++ {
++ return -EIO;
++ }
++ break;
++ }
++
++ case AR6000_XIOCTL_DBGLOG_GET_DEBUG_LOGS:
++ {
++ /* Send the challenge on the control channel */
++ if (ar6000_dbglog_get_debug_logs(ar) != A_OK)
++ {
++ return -EIO;
++ }
++ break;
++ }
++
++ case AR6000_XIOCTL_SET_ADHOC_BSSID:
++ {
++ WMI_SET_ADHOC_BSSID_CMD adhocBssid;
++
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else if (copy_from_user(&adhocBssid, userdata,
++ sizeof(adhocBssid)))
++ {
++ ret = -EFAULT;
++ } else if (A_MEMCMP(adhocBssid.bssid, bcast_mac,
++ AR6000_ETH_ADDR_LEN) == 0)
++ {
++ ret = -EFAULT;
++ } else {
++
++ A_MEMCPY(ar->arReqBssid, adhocBssid.bssid, sizeof(ar->arReqBssid));
++ }
++ break;
++ }
++
++ case AR6000_XIOCTL_SET_OPT_MODE:
++ {
++ WMI_SET_OPT_MODE_CMD optModeCmd;
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else if (copy_from_user(&optModeCmd, userdata,
++ sizeof(optModeCmd)))
++ {
++ ret = -EFAULT;
++ } else if (ar->arConnected && optModeCmd.optMode == SPECIAL_ON) {
++ ret = -EFAULT;
++
++ } else if (wmi_set_opt_mode_cmd(ar->arWmi, optModeCmd.optMode)
++ != A_OK)
++ {
++ ret = -EIO;
++ }
++ break;
++ }
++
++ case AR6000_XIOCTL_OPT_SEND_FRAME:
++ {
++ WMI_OPT_TX_FRAME_CMD optTxFrmCmd;
++ A_UINT8 data[MAX_OPT_DATA_LEN];
++
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else if (copy_from_user(&optTxFrmCmd, userdata,
++ sizeof(optTxFrmCmd)))
++ {
++ ret = -EFAULT;
++ } else if (copy_from_user(data,
++ userdata+sizeof(WMI_OPT_TX_FRAME_CMD)-1,
++ optTxFrmCmd.optIEDataLen))
++ {
++ ret = -EFAULT;
++ } else {
++ ret = wmi_opt_tx_frame_cmd(ar->arWmi,
++ optTxFrmCmd.frmType,
++ optTxFrmCmd.dstAddr,
++ optTxFrmCmd.bssid,
++ optTxFrmCmd.optIEDataLen,
++ data);
++ }
++
++ break;
++ }
++ case AR6000_XIOCTL_WMI_SETRETRYLIMITS:
++ {
++ WMI_SET_RETRY_LIMITS_CMD setRetryParams;
++
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else if (copy_from_user(&setRetryParams, userdata,
++ sizeof(setRetryParams)))
++ {
++ ret = -EFAULT;
++ } else {
++ if (wmi_set_retry_limits_cmd(ar->arWmi, setRetryParams.frameType,
++ setRetryParams.trafficClass,
++ setRetryParams.maxRetries,
++ setRetryParams.enableNotify) != A_OK)
++ {
++ ret = -EIO;
++ }
++ AR6000_SPIN_LOCK(&ar->arLock, 0);
++ ar->arMaxRetries = setRetryParams.maxRetries;
++ AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++ }
++ break;
++ }
++
++ case AR6000_XIOCTL_SET_ADHOC_BEACON_INTVAL:
++ {
++ WMI_BEACON_INT_CMD bIntvlCmd;
++
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else if (copy_from_user(&bIntvlCmd, userdata,
++ sizeof(bIntvlCmd)))
++ {
++ ret = -EFAULT;
++ } else if (wmi_set_adhoc_bconIntvl_cmd(ar->arWmi, bIntvlCmd.beaconInterval)
++ != A_OK)
++ {
++ ret = -EIO;
++ }
++ break;
++ }
++ case IEEE80211_IOCTL_SETAUTHALG:
++ {
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ struct ieee80211req_authalg req;
++
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else if (copy_from_user(&req, userdata,
++ sizeof(struct ieee80211req_authalg)))
++ {
++ ret = -EFAULT;
++ } else if (req.auth_alg == AUTH_ALG_OPEN_SYSTEM) {
++ ar->arDot11AuthMode = OPEN_AUTH;
++ ar->arPairwiseCrypto = NONE_CRYPT;
++ ar->arGroupCrypto = NONE_CRYPT;
++ } else if (req.auth_alg == AUTH_ALG_LEAP) {
++ ar->arDot11AuthMode = LEAP_AUTH;
++ } else {
++ ret = -EIO;
++ }
++ break;
++ }
++
++ case AR6000_XIOCTL_SET_VOICE_PKT_SIZE:
++ ret = ar6000_xioctl_set_voice_pkt_size(dev, userdata);
++ break;
++
++ case AR6000_XIOCTL_SET_MAX_SP:
++ ret = ar6000_xioctl_set_max_sp_len(dev, userdata);
++ break;
++
++ case AR6000_XIOCTL_WMI_GET_ROAM_TBL:
++ ret = ar6000_ioctl_get_roam_tbl(dev, rq);
++ break;
++ case AR6000_XIOCTL_WMI_SET_ROAM_CTRL:
++ ret = ar6000_ioctl_set_roam_ctrl(dev, userdata);
++ break;
++ case AR6000_XIOCTRL_WMI_SET_POWERSAVE_TIMERS:
++ ret = ar6000_ioctl_set_powersave_timers(dev, userdata);
++ break;
++ case AR6000_XIOCTRL_WMI_GET_POWER_MODE:
++ ret = ar6000_ioctl_get_power_mode(dev, rq);
++ break;
++ case AR6000_XIOCTRL_WMI_SET_WLAN_STATE:
++ get_user(ar->arWlanState, (unsigned int *)userdata);
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ break;
++ }
++
++ if (ar->arWlanState == WLAN_ENABLED) {
++ /* Enable foreground scanning */
++ if (wmi_scanparams_cmd(ar->arWmi, scParams.fg_start_period,
++ scParams.fg_end_period,
++ scParams.bg_period,
++ scParams.minact_chdwell_time,
++ scParams.maxact_chdwell_time,
++ scParams.pas_chdwell_time,
++ scParams.shortScanRatio,
++ scParams.scanCtrlFlags,
++ scParams.max_dfsch_act_time) != A_OK)
++ {
++ ret = -EIO;
++ }
++ if (ar->arSsidLen) {
++ ar->arConnectPending = TRUE;
++ if (wmi_connect_cmd(ar->arWmi, ar->arNetworkType,
++ ar->arDot11AuthMode, ar->arAuthMode,
++ ar->arPairwiseCrypto,
++ ar->arPairwiseCryptoLen,
++ ar->arGroupCrypto, ar->arGroupCryptoLen,
++ ar->arSsidLen, ar->arSsid,
++ ar->arReqBssid, ar->arChannelHint,
++ ar->arConnectCtrlFlags) != A_OK)
++ {
++ ret = -EIO;
++ ar->arConnectPending = FALSE;
++ }
++ }
++ } else {
++ /* Disconnect from the AP and disable foreground scanning */
++ AR6000_SPIN_LOCK(&ar->arLock, 0);
++ if (ar->arConnected == TRUE || ar->arConnectPending == TRUE) {
++ AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++ wmi_disconnect_cmd(ar->arWmi);
++ } else {
++ AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++ }
++
++ if (wmi_scanparams_cmd(ar->arWmi, 0xFFFF, 0, 0, 0, 0, 0, 0, 0xFF, 0) != A_OK)
++ {
++ ret = -EIO;
++ }
++ }
++ break;
++ case AR6000_XIOCTL_WMI_GET_ROAM_DATA:
++ ret = ar6000_ioctl_get_roam_data(dev, rq);
++ break;
++ case AR6000_XIOCTL_WMI_SET_BT_STATUS:
++ ret = ar6000_xioctl_set_bt_status_cmd(dev, userdata);
++ break;
++ case AR6000_XIOCTL_WMI_SET_BT_PARAMS:
++ ret = ar6000_xioctl_set_bt_params_cmd(dev, userdata);
++ break;
++ case AR6000_XIOCTL_WMI_STARTSCAN:
++ {
++ WMI_START_SCAN_CMD setStartScanCmd;
++
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else if (copy_from_user(&setStartScanCmd, userdata,
++ sizeof(setStartScanCmd)))
++ {
++ ret = -EFAULT;
++ } else {
++ if (wmi_startscan_cmd(ar->arWmi, setStartScanCmd.scanType,
++ setStartScanCmd.forceFgScan,
++ setStartScanCmd.isLegacy,
++ setStartScanCmd.homeDwellTime,
++ setStartScanCmd.forceScanInterval) != A_OK)
++ {
++ ret = -EIO;
++ }
++ }
++ break;
++ }
++ case AR6000_XIOCTL_WMI_SETFIXRATES:
++ {
++ WMI_FIX_RATES_CMD setFixRatesCmd;
++ A_STATUS returnStatus;
++
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else if (copy_from_user(&setFixRatesCmd, userdata,
++ sizeof(setFixRatesCmd)))
++ {
++ ret = -EFAULT;
++ } else {
++ returnStatus = wmi_set_fixrates_cmd(ar->arWmi, setFixRatesCmd.fixRateMask);
++ if (returnStatus == A_EINVAL)
++ {
++ ret = -EINVAL;
++ }
++ else if(returnStatus != A_OK) {
++ ret = -EIO;
++ }
++ }
++ break;
++ }
++
++ case AR6000_XIOCTL_WMI_GETFIXRATES:
++ {
++ WMI_FIX_RATES_CMD getFixRatesCmd;
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ int ret = 0;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++ if (down_interruptible(&ar->arSem)) {
++ return -ERESTARTSYS;
++ }
++ /* Used copy_from_user/copy_to_user to access user space data */
++ if (copy_from_user(&getFixRatesCmd, userdata, sizeof(getFixRatesCmd))) {
++ ret = -EFAULT;
++ } else {
++ ar->arRateMask = 0xFFFF;
++
++ if (wmi_get_ratemask_cmd(ar->arWmi) != A_OK) {
++ up(&ar->arSem);
++ return -EIO;
++ }
++
++ wait_event_interruptible_timeout(arEvent, ar->arRateMask != 0xFFFF, wmitimeout * HZ);
++
++ if (signal_pending(current)) {
++ ret = -EINTR;
++ }
++
++ if (!ret) {
++ getFixRatesCmd.fixRateMask = ar->arRateMask;
++ }
++
++ if(copy_to_user(userdata, &getFixRatesCmd, sizeof(getFixRatesCmd))) {
++ ret = -EFAULT;
++ }
++
++ up(&ar->arSem);
++ }
++ break;
++ }
++ case AR6000_XIOCTL_WMI_SET_AUTHMODE:
++ {
++ WMI_SET_AUTH_MODE_CMD setAuthMode;
++
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else if (copy_from_user(&setAuthMode, userdata,
++ sizeof(setAuthMode)))
++ {
++ ret = -EFAULT;
++ } else {
++ if (wmi_set_authmode_cmd(ar->arWmi, setAuthMode.mode) != A_OK)
++ {
++ ret = -EIO;
++ }
++ }
++ break;
++ }
++ case AR6000_XIOCTL_WMI_SET_REASSOCMODE:
++ {
++ WMI_SET_REASSOC_MODE_CMD setReassocMode;
++
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else if (copy_from_user(&setReassocMode, userdata,
++ sizeof(setReassocMode)))
++ {
++ ret = -EFAULT;
++ } else {
++ if (wmi_set_reassocmode_cmd(ar->arWmi, setReassocMode.mode) != A_OK)
++ {
++ ret = -EIO;
++ }
++ }
++ break;
++ }
++ case AR6000_XIOCTL_DIAG_READ:
++ {
++ A_UINT32 addr, data;
++ get_user(addr, (unsigned int *)userdata);
++ if (ar6000_ReadRegDiag(ar->arHifDevice, &addr, &data) != A_OK) {
++ ret = -EIO;
++ }
++ put_user(data, (unsigned int *)userdata + 1);
++ break;
++ }
++ case AR6000_XIOCTL_DIAG_WRITE:
++ {
++ A_UINT32 addr, data;
++ get_user(addr, (unsigned int *)userdata);
++ get_user(data, (unsigned int *)userdata + 1);
++ if (ar6000_WriteRegDiag(ar->arHifDevice, &addr, &data) != A_OK) {
++ ret = -EIO;
++ }
++ break;
++ }
++ case AR6000_XIOCTL_WMI_SET_KEEPALIVE:
++ {
++ WMI_SET_KEEPALIVE_CMD setKeepAlive;
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ } else if (copy_from_user(&setKeepAlive, userdata,
++ sizeof(setKeepAlive))){
++ ret = -EFAULT;
++ } else {
++ if (wmi_set_keepalive_cmd(ar->arWmi, setKeepAlive.keepaliveInterval) != A_OK) {
++ ret = -EIO;
++ }
++ }
++ break;
++ }
++ case AR6000_XIOCTL_WMI_GET_KEEPALIVE:
++ {
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ WMI_GET_KEEPALIVE_CMD getKeepAlive;
++ int ret = 0;
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++ if (down_interruptible(&ar->arSem)) {
++ return -ERESTARTSYS;
++ }
++ if (copy_from_user(&getKeepAlive, userdata,sizeof(getKeepAlive))) {
++ ret = -EFAULT;
++ } else {
++ getKeepAlive.keepaliveInterval = wmi_get_keepalive_cmd(ar->arWmi);
++ ar->arKeepaliveConfigured = 0xFF;
++ if (wmi_get_keepalive_configured(ar->arWmi) != A_OK){
++ up(&ar->arSem);
++ return -EIO;
++ }
++ wait_event_interruptible_timeout(arEvent, ar->arKeepaliveConfigured != 0xFF, wmitimeout * HZ);
++ if (signal_pending(current)) {
++ ret = -EINTR;
++ }
++
++ if (!ret) {
++ getKeepAlive.configured = ar->arKeepaliveConfigured;
++ }
++ if (copy_to_user(userdata, &getKeepAlive, sizeof(getKeepAlive))) {
++ ret = -EFAULT;
++ }
++ up(&ar->arSem);
++ }
++ break;
++ }
++ case AR6000_XIOCTL_WMI_SET_APPIE:
++ {
++ WMI_SET_APPIE_CMD appIEcmd;
++ A_UINT8 appIeInfo[IEEE80211_APPIE_FRAME_MAX_LEN];
++ A_UINT32 fType,ieLen;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++ get_user(fType, (A_UINT32 *)userdata);
++ appIEcmd.mgmtFrmType = fType;
++ if (appIEcmd.mgmtFrmType >= IEEE80211_APPIE_NUM_OF_FRAME) {
++ ret = -EIO;
++ } else {
++ get_user(ieLen, (A_UINT32 *)(userdata + 4));
++ appIEcmd.ieLen = ieLen;
++ if (appIEcmd.ieLen > IEEE80211_APPIE_FRAME_MAX_LEN) {
++ ret = -EIO;
++ break;
++ }
++ if (copy_from_user(appIeInfo, userdata + 8, appIEcmd.ieLen)) {
++ ret = -EFAULT;
++ } else {
++ if (wmi_set_appie_cmd(ar->arWmi, appIEcmd.mgmtFrmType,
++ appIEcmd.ieLen, appIeInfo) != A_OK)
++ {
++ ret = -EIO;
++ }
++ }
++ }
++ break;
++ }
++ case AR6000_XIOCTL_WMI_SET_MGMT_FRM_RX_FILTER:
++ {
++ WMI_BSS_FILTER_CMD cmd;
++ A_UINT32 filterType;
++
++ if (copy_from_user(&filterType, userdata, sizeof(A_UINT32)))
++ {
++ return -EFAULT;
++ }
++ if (filterType & (IEEE80211_FILTER_TYPE_BEACON |
++ IEEE80211_FILTER_TYPE_PROBE_RESP))
++ {
++ cmd.bssFilter = ALL_BSS_FILTER;
++ } else {
++ cmd.bssFilter = NONE_BSS_FILTER;
++ }
++ if (wmi_bssfilter_cmd(ar->arWmi, cmd.bssFilter, 0) != A_OK) {
++ ret = -EIO;
++ }
++
++ AR6000_SPIN_LOCK(&ar->arLock, 0);
++ ar->arMgmtFilter = filterType;
++ AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++ break;
++ }
++ case AR6000_XIOCTL_WMI_SET_WSC_STATUS:
++ {
++ A_UINT32 wsc_status;
++
++ if (copy_from_user(&wsc_status, userdata, sizeof(A_UINT32)))
++ {
++ return -EFAULT;
++ }
++ if (wmi_set_wsc_status_cmd(ar->arWmi, wsc_status) != A_OK) {
++ ret = -EIO;
++ }
++ break;
++ }
++ case AR6000_XIOCTL_BMI_ROMPATCH_INSTALL:
++ {
++ A_UINT32 ROM_addr;
++ A_UINT32 RAM_addr;
++ A_UINT32 nbytes;
++ A_UINT32 do_activate;
++ A_UINT32 rompatch_id;
++
++ get_user(ROM_addr, (A_UINT32 *)userdata);
++ get_user(RAM_addr, (A_UINT32 *)userdata + 1);
++ get_user(nbytes, (A_UINT32 *)userdata + 2);
++ get_user(do_activate, (A_UINT32 *)userdata + 3);
++ AR_DEBUG_PRINTF("Install rompatch from ROM: 0x%x to RAM: 0x%x length: %d\n",
++ ROM_addr, RAM_addr, nbytes);
++ ret = BMIrompatchInstall(hifDevice, ROM_addr, RAM_addr,
++ nbytes, do_activate, &rompatch_id);
++ if (ret == A_OK) {
++ put_user(rompatch_id, (unsigned int *)rq->ifr_data); /* return value */
++ }
++ break;
++ }
++
++ case AR6000_XIOCTL_BMI_ROMPATCH_UNINSTALL:
++ {
++ A_UINT32 rompatch_id;
++
++ get_user(rompatch_id, (A_UINT32 *)userdata);
++ AR_DEBUG_PRINTF("UNinstall rompatch_id %d\n", rompatch_id);
++ ret = BMIrompatchUninstall(hifDevice, rompatch_id);
++ break;
++ }
++
++ case AR6000_XIOCTL_BMI_ROMPATCH_ACTIVATE:
++ case AR6000_XIOCTL_BMI_ROMPATCH_DEACTIVATE:
++ {
++ A_UINT32 rompatch_count;
++
++ get_user(rompatch_count, (A_UINT32 *)userdata);
++ AR_DEBUG_PRINTF("Change rompatch activation count=%d\n", rompatch_count);
++ length = sizeof(A_UINT32) * rompatch_count;
++ if ((buffer = (unsigned char *)A_MALLOC(length)) != NULL) {
++ A_MEMZERO(buffer, length);
++ if (copy_from_user(buffer, &userdata[sizeof(rompatch_count)], length))
++ {
++ ret = -EFAULT;
++ } else {
++ if (cmd == AR6000_XIOCTL_BMI_ROMPATCH_ACTIVATE) {
++ ret = BMIrompatchActivate(hifDevice, rompatch_count, (A_UINT32 *)buffer);
++ } else {
++ ret = BMIrompatchDeactivate(hifDevice, rompatch_count, (A_UINT32 *)buffer);
++ }
++ }
++ A_FREE(buffer);
++ } else {
++ ret = -ENOMEM;
++ }
++
++ break;
++ }
++
++ case AR6000_XIOCTL_WMI_SET_HOST_SLEEP_MODE:
++ {
++ WMI_SET_HOST_SLEEP_MODE_CMD setHostSleepMode;
++
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else if (copy_from_user(&setHostSleepMode, userdata,
++ sizeof(setHostSleepMode)))
++ {
++ ret = -EFAULT;
++ } else {
++ if (wmi_set_host_sleep_mode_cmd(ar->arWmi,
++ &setHostSleepMode) != A_OK)
++ {
++ ret = -EIO;
++ }
++ }
++ break;
++ }
++ case AR6000_XIOCTL_WMI_SET_WOW_MODE:
++ {
++ WMI_SET_WOW_MODE_CMD setWowMode;
++
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else if (copy_from_user(&setWowMode, userdata,
++ sizeof(setWowMode)))
++ {
++ ret = -EFAULT;
++ } else {
++ if (wmi_set_wow_mode_cmd(ar->arWmi,
++ &setWowMode) != A_OK)
++ {
++ ret = -EIO;
++ }
++ }
++ break;
++ }
++ case AR6000_XIOCTL_WMI_GET_WOW_LIST:
++ {
++ WMI_GET_WOW_LIST_CMD getWowList;
++
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else if (copy_from_user(&getWowList, userdata,
++ sizeof(getWowList)))
++ {
++ ret = -EFAULT;
++ } else {
++ if (wmi_get_wow_list_cmd(ar->arWmi,
++ &getWowList) != A_OK)
++ {
++ ret = -EIO;
++ }
++ }
++ break;
++ }
++ case AR6000_XIOCTL_WMI_ADD_WOW_PATTERN:
++ {
++#define WOW_PATTERN_SIZE 64
++#define WOW_MASK_SIZE 64
++
++ WMI_ADD_WOW_PATTERN_CMD cmd;
++ A_UINT8 mask_data[WOW_PATTERN_SIZE]={0};
++ A_UINT8 pattern_data[WOW_PATTERN_SIZE]={0};
++
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else {
++
++ if(copy_from_user(&cmd, userdata,
++ sizeof(WMI_ADD_WOW_PATTERN_CMD)))
++ return -EFAULT;
++ if (copy_from_user(pattern_data,
++ userdata + 3,
++ cmd.filter_size)){
++ ret = -EFAULT;
++ break;
++ }
++ if (copy_from_user(mask_data,
++ (userdata + 3 + cmd.filter_size),
++ cmd.filter_size)){
++ ret = -EFAULT;
++ break;
++ } else {
++ if (wmi_add_wow_pattern_cmd(ar->arWmi,
++ &cmd, pattern_data, mask_data, cmd.filter_size) != A_OK){
++ ret = -EIO;
++ }
++ }
++ }
++#undef WOW_PATTERN_SIZE
++#undef WOW_MASK_SIZE
++ break;
++ }
++ case AR6000_XIOCTL_WMI_DEL_WOW_PATTERN:
++ {
++ WMI_DEL_WOW_PATTERN_CMD delWowPattern;
++
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else if (copy_from_user(&delWowPattern, userdata,
++ sizeof(delWowPattern)))
++ {
++ ret = -EFAULT;
++ } else {
++ if (wmi_del_wow_pattern_cmd(ar->arWmi,
++ &delWowPattern) != A_OK)
++ {
++ ret = -EIO;
++ }
++ }
++ break;
++ }
++ case AR6000_XIOCTL_DUMP_HTC_CREDIT_STATE:
++ if (ar->arHtcTarget != NULL) {
++ HTCDumpCreditStates(ar->arHtcTarget);
++ }
++ break;
++ case AR6000_XIOCTL_TRAFFIC_ACTIVITY_CHANGE:
++ if (ar->arHtcTarget != NULL) {
++ struct ar6000_traffic_activity_change data;
++
++ if (copy_from_user(&data, userdata, sizeof(data)))
++ {
++ return -EFAULT;
++ }
++ /* note, this is used for testing (mbox ping testing), indicate activity
++ * change using the stream ID as the traffic class */
++ ar6000_indicate_tx_activity(ar,
++ (A_UINT8)data.StreamID,
++ data.Active ? TRUE : FALSE);
++ }
++ break;
++ case AR6000_XIOCTL_WMI_SET_CONNECT_CTRL_FLAGS:
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else if (copy_from_user(&connectCtrlFlags, userdata,
++ sizeof(connectCtrlFlags)))
++ {
++ ret = -EFAULT;
++ } else {
++ ar->arConnectCtrlFlags = connectCtrlFlags;
++ }
++ break;
++ case AR6000_XIOCTL_WMI_SET_AKMP_PARAMS:
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else if (copy_from_user(&akmpParams, userdata,
++ sizeof(WMI_SET_AKMP_PARAMS_CMD)))
++ {
++ ret = -EFAULT;
++ } else {
++ if (wmi_set_akmp_params_cmd(ar->arWmi, &akmpParams) != A_OK) {
++ ret = -EIO;
++ }
++ }
++ break;
++ case AR6000_XIOCTL_WMI_SET_PMKID_LIST:
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else {
++ if (copy_from_user(&pmkidInfo.numPMKID, userdata,
++ sizeof(pmkidInfo.numPMKID)))
++ {
++ ret = -EFAULT;
++ break;
++ }
++ if (copy_from_user(&pmkidInfo.pmkidList,
++ userdata + sizeof(pmkidInfo.numPMKID),
++ pmkidInfo.numPMKID * sizeof(WMI_PMKID)))
++ {
++ ret = -EFAULT;
++ break;
++ }
++ if (wmi_set_pmkid_list_cmd(ar->arWmi, &pmkidInfo) != A_OK) {
++ ret = -EIO;
++ }
++ }
++ break;
++ case AR6000_XIOCTL_WMI_GET_PMKID_LIST:
++ if (ar->arWmiReady == FALSE) {
++ ret = -EIO;
++ } else {
++ if (wmi_get_pmkid_list_cmd(ar->arWmi) != A_OK) {
++ ret = -EIO;
++ }
++ }
++ break;
++ default:
++ ret = -EOPNOTSUPP;
++ }
++ return ret;
++}
++
+diff --git a/drivers/ar6000/ar6000/netbuf.c b/drivers/ar6000/ar6000/netbuf.c
+new file mode 100644
+index 0000000..97b273b
+--- /dev/null
++++ b/drivers/ar6000/ar6000/netbuf.c
+@@ -0,0 +1,225 @@
++
++/*
++ *
++ * Copyright (c) 2004-2007 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation;
++ *
++ * Software distributed under the License is distributed on an "AS
++ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
++ * implied. See the License for the specific language governing
++ * rights and limitations under the License.
++ *
++ *
++ *
++ */
++#include <linux/kernel.h>
++#include <linux/skbuff.h>
++#include <a_config.h>
++#include "athdefs.h"
++#include "a_types.h"
++#include "a_osapi.h"
++#include "htc_packet.h"
++
++#define AR6000_DATA_OFFSET 64
++
++void a_netbuf_enqueue(A_NETBUF_QUEUE_T *q, void *pkt)
++{
++ skb_queue_tail((struct sk_buff_head *) q, (struct sk_buff *) pkt);
++}
++
++void a_netbuf_prequeue(A_NETBUF_QUEUE_T *q, void *pkt)
++{
++ skb_queue_head((struct sk_buff_head *) q, (struct sk_buff *) pkt);
++}
++
++void *a_netbuf_dequeue(A_NETBUF_QUEUE_T *q)
++{
++ return((void *) skb_dequeue((struct sk_buff_head *) q));
++}
++
++int a_netbuf_queue_size(A_NETBUF_QUEUE_T *q)
++{
++ return(skb_queue_len((struct sk_buff_head *) q));
++}
++
++int a_netbuf_queue_empty(A_NETBUF_QUEUE_T *q)
++{
++ return(skb_queue_empty((struct sk_buff_head *) q));
++}
++
++void a_netbuf_queue_init(A_NETBUF_QUEUE_T *q)
++{
++ skb_queue_head_init((struct sk_buff_head *) q);
++}
++
++void *
++a_netbuf_alloc(int size)
++{
++ struct sk_buff *skb;
++ skb = dev_alloc_skb(AR6000_DATA_OFFSET + sizeof(HTC_PACKET) + size);
++ skb_reserve(skb, AR6000_DATA_OFFSET + sizeof(HTC_PACKET));
++ return ((void *)skb);
++}
++
++/*
++ * Allocate an SKB w.o. any encapsulation requirement.
++ */
++void *
++a_netbuf_alloc_raw(int size)
++{
++ struct sk_buff *skb;
++
++ skb = dev_alloc_skb(size);
++
++ return ((void *)skb);
++}
++
++void
++a_netbuf_free(void *bufPtr)
++{
++ struct sk_buff *skb = (struct sk_buff *)bufPtr;
++
++ dev_kfree_skb(skb);
++}
++
++A_UINT32
++a_netbuf_to_len(void *bufPtr)
++{
++ return (((struct sk_buff *)bufPtr)->len);
++}
++
++void *
++a_netbuf_to_data(void *bufPtr)
++{
++ return (((struct sk_buff *)bufPtr)->data);
++}
++
++/*
++ * Add len # of bytes to the beginning of the network buffer
++ * pointed to by bufPtr
++ */
++A_STATUS
++a_netbuf_push(void *bufPtr, A_INT32 len)
++{
++ skb_push((struct sk_buff *)bufPtr, len);
++
++ return A_OK;
++}
++
++/*
++ * Add len # of bytes to the beginning of the network buffer
++ * pointed to by bufPtr and also fill with data
++ */
++A_STATUS
++a_netbuf_push_data(void *bufPtr, char *srcPtr, A_INT32 len)
++{
++ skb_push((struct sk_buff *) bufPtr, len);
++ A_MEMCPY(((struct sk_buff *)bufPtr)->data, srcPtr, len);
++
++ return A_OK;
++}
++
++/*
++ * Add len # of bytes to the end of the network buffer
++ * pointed to by bufPtr
++ */
++A_STATUS
++a_netbuf_put(void *bufPtr, A_INT32 len)
++{
++ skb_put((struct sk_buff *)bufPtr, len);
++
++ return A_OK;
++}
++
++/*
++ * Add len # of bytes to the end of the network buffer
++ * pointed to by bufPtr and also fill with data
++ */
++A_STATUS
++a_netbuf_put_data(void *bufPtr, char *srcPtr, A_INT32 len)
++{
++ char *start = ((struct sk_buff *)bufPtr)->data +
++ ((struct sk_buff *)bufPtr)->len;
++ skb_put((struct sk_buff *)bufPtr, len);
++ A_MEMCPY(start, srcPtr, len);
++
++ return A_OK;
++}
++
++
++/*
++ * Trim the network buffer pointed to by bufPtr to len # of bytes
++ */
++A_STATUS
++a_netbuf_setlen(void *bufPtr, A_INT32 len)
++{
++ skb_trim((struct sk_buff *)bufPtr, len);
++
++ return A_OK;
++}
++
++/*
++ * Chop of len # of bytes from the end of the buffer.
++ */
++A_STATUS
++a_netbuf_trim(void *bufPtr, A_INT32 len)
++{
++ skb_trim((struct sk_buff *)bufPtr, ((struct sk_buff *)bufPtr)->len - len);
++
++ return A_OK;
++}
++
++/*
++ * Chop of len # of bytes from the end of the buffer and return the data.
++ */
++A_STATUS
++a_netbuf_trim_data(void *bufPtr, char *dstPtr, A_INT32 len)
++{
++ char *start = ((struct sk_buff *)bufPtr)->data +
++ (((struct sk_buff *)bufPtr)->len - len);
++
++ A_MEMCPY(dstPtr, start, len);
++ skb_trim((struct sk_buff *)bufPtr, ((struct sk_buff *)bufPtr)->len - len);
++
++ return A_OK;
++}
++
++
++/*
++ * Returns the number of bytes available to a a_netbuf_push()
++ */
++A_INT32
++a_netbuf_headroom(void *bufPtr)
++{
++ return (skb_headroom((struct sk_buff *)bufPtr));
++}
++
++/*
++ * Removes specified number of bytes from the beginning of the buffer
++ */
++A_STATUS
++a_netbuf_pull(void *bufPtr, A_INT32 len)
++{
++ skb_pull((struct sk_buff *)bufPtr, len);
++
++ return A_OK;
++}
++
++/*
++ * Removes specified number of bytes from the beginning of the buffer
++ * and return the data
++ */
++A_STATUS
++a_netbuf_pull_data(void *bufPtr, char *dstPtr, A_INT32 len)
++{
++ A_MEMCPY(dstPtr, ((struct sk_buff *)bufPtr)->data, len);
++ skb_pull((struct sk_buff *)bufPtr, len);
++
++ return A_OK;
++}
++
+diff --git a/drivers/ar6000/ar6000/osapi_linux.h b/drivers/ar6000/ar6000/osapi_linux.h
+new file mode 100644
+index 0000000..5b64212
+--- /dev/null
++++ b/drivers/ar6000/ar6000/osapi_linux.h
+@@ -0,0 +1,319 @@
++/*
++ * $Id: //depot/sw/releases/olca2.0-GPL/host/os/linux/include/osapi_linux.h#1 $
++ *
++ * This file contains the definitions of the basic atheros data types.
++ * It is used to map the data types in atheros files to a platform specific
++ * type.
++ *
++ * Copyright 2003-2005 Atheros Communications, Inc., All Rights Reserved.
++ *
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation;
++ *
++ * Software distributed under the License is distributed on an "AS
++ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
++ * implied. See the License for the specific language governing
++ * rights and limitations under the License.
++ *
++ *
++ *
++ */
++
++#ifndef _OSAPI_LINUX_H_
++#define _OSAPI_LINUX_H_
++
++#ifdef __KERNEL__
++
++#include <linux/version.h>
++#include <linux/types.h>
++#include <linux/kernel.h>
++#include <linux/string.h>
++#include <linux/skbuff.h>
++#include <linux/netdevice.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
++#include <linux/jiffies.h>
++#endif
++#include <linux/timer.h>
++#include <linux/delay.h>
++#include <linux/wait.h>
++#ifdef KERNEL_2_4
++#include <asm/arch/irq.h>
++#include <asm/irq.h>
++#endif
++
++#ifdef __GNUC__
++#define __ATTRIB_PACK __attribute__ ((packed))
++#define __ATTRIB_PRINTF __attribute__ ((format (printf, 1, 2)))
++#define __ATTRIB_NORETURN __attribute__ ((noreturn))
++#ifndef INLINE
++#define INLINE __inline__
++#endif
++#else /* Not GCC */
++#define __ATTRIB_PACK
++#define __ATTRIB_PRINTF
++#define __ATTRIB_NORETURN
++#ifndef INLINE
++#define INLINE __inline
++#endif
++#endif /* End __GNUC__ */
++
++#define PREPACK
++#define POSTPACK __ATTRIB_PACK
++
++/*
++ * Endianes macros
++ */
++#define A_BE2CPU8(x) ntohb(x)
++#define A_BE2CPU16(x) ntohs(x)
++#define A_BE2CPU32(x) ntohl(x)
++
++#define A_LE2CPU8(x) (x)
++#define A_LE2CPU16(x) (x)
++#define A_LE2CPU32(x) (x)
++
++#define A_CPU2BE8(x) htonb(x)
++#define A_CPU2BE16(x) htons(x)
++#define A_CPU2BE32(x) htonl(x)
++
++#define A_MEMCPY(dst, src, len) memcpy((A_UINT8 *)(dst), (src), (len))
++#define A_MEMZERO(addr, len) memset(addr, 0, len)
++#define A_MEMCMP(addr1, addr2, len) memcmp((addr1), (addr2), (len))
++#define A_MALLOC(size) kmalloc((size), GFP_KERNEL)
++#define A_MALLOC_NOWAIT(size) kmalloc((size), GFP_ATOMIC)
++#define A_FREE(addr) kfree(addr)
++#define A_PRINTF(args...) printk(args)
++
++/* Mutual Exclusion */
++typedef spinlock_t A_MUTEX_T;
++#define A_MUTEX_INIT(mutex) spin_lock_init(mutex)
++#define A_MUTEX_LOCK(mutex) spin_lock_bh(mutex)
++#define A_MUTEX_UNLOCK(mutex) spin_unlock_bh(mutex)
++#define A_IS_MUTEX_VALID(mutex) TRUE /* okay to return true, since A_MUTEX_DELETE does nothing */
++#define A_MUTEX_DELETE(mutex) /* spin locks are not kernel resources so nothing to free.. */
++
++/* Get current time in ms adding a constant offset (in ms) */
++#define A_GET_MS(offset) \
++ (jiffies + ((offset) / 1000) * HZ)
++
++/*
++ * Timer Functions
++ */
++#define A_MDELAY(msecs) mdelay(msecs)
++typedef struct timer_list A_TIMER;
++
++#define A_INIT_TIMER(pTimer, pFunction, pArg) do { \
++ init_timer(pTimer); \
++ (pTimer)->function = (pFunction); \
++ (pTimer)->data = (unsigned long)(pArg); \
++} while (0)
++
++/*
++ * Start a Timer that elapses after 'periodMSec' milli-seconds
++ * Support is provided for a one-shot timer. The 'repeatFlag' is
++ * ignored.
++ */
++#define A_TIMEOUT_MS(pTimer, periodMSec, repeatFlag) do { \
++ if (repeatFlag) { \
++ printk("\n" __FILE__ ":%d: Timer Repeat requested\n",__LINE__); \
++ panic("Timer Repeat"); \
++ } \
++ mod_timer((pTimer), jiffies + HZ * (periodMSec) / 1000); \
++} while (0)
++
++/*
++ * Cancel the Timer.
++ */
++#define A_UNTIMEOUT(pTimer) do { \
++ del_timer((pTimer)); \
++} while (0)
++
++#define A_DELETE_TIMER(pTimer) do { \
++} while (0)
++
++/*
++ * Wait Queue related functions
++ */
++typedef wait_queue_head_t A_WAITQUEUE_HEAD;
++#define A_INIT_WAITQUEUE_HEAD(head) init_waitqueue_head(head)
++#ifndef wait_event_interruptible_timeout
++#define __wait_event_interruptible_timeout(wq, condition, ret) \
++do { \
++ wait_queue_t __wait; \
++ init_waitqueue_entry(&__wait, current); \
++ \
++ add_wait_queue(&wq, &__wait); \
++ for (;;) { \
++ set_current_state(TASK_INTERRUPTIBLE); \
++ if (condition) \
++ break; \
++ if (!signal_pending(current)) { \
++ ret = schedule_timeout(ret); \
++ if (!ret) \
++ break; \
++ continue; \
++ } \
++ ret = -ERESTARTSYS; \
++ break; \
++ } \
++ current->state = TASK_RUNNING; \
++ remove_wait_queue(&wq, &__wait); \
++} while (0)
++
++#define wait_event_interruptible_timeout(wq, condition, timeout) \
++({ \
++ long __ret = timeout; \
++ if (!(condition)) \
++ __wait_event_interruptible_timeout(wq, condition, __ret); \
++ __ret; \
++})
++#endif /* wait_event_interruptible_timeout */
++
++#define A_WAIT_EVENT_INTERRUPTIBLE_TIMEOUT(head, condition, timeout) do { \
++ wait_event_interruptible_timeout(head, condition, timeout); \
++} while (0)
++
++#define A_WAKE_UP(head) wake_up(head)
++
++#ifdef DEBUG
++#define A_ASSERT(expr) \
++ if (!(expr)) { \
++ printk(KERN_ALERT "\n" __FILE__ ":%d: Assertion " #expr " failed!\n",__LINE__); \
++ panic(#expr); \
++ }
++
++#else
++#define A_ASSERT(expr)
++#endif /* DEBUG */
++
++/*
++ * Initialization of the network buffer subsystem
++ */
++#define A_NETBUF_INIT()
++
++/*
++ * Network buffer queue support
++ */
++typedef struct sk_buff_head A_NETBUF_QUEUE_T;
++
++#define A_NETBUF_QUEUE_INIT(q) \
++ a_netbuf_queue_init(q)
++
++#define A_NETBUF_ENQUEUE(q, pkt) \
++ a_netbuf_enqueue((q), (pkt))
++#define A_NETBUF_PREQUEUE(q, pkt) \
++ a_netbuf_prequeue((q), (pkt))
++#define A_NETBUF_DEQUEUE(q) \
++ (a_netbuf_dequeue(q))
++#define A_NETBUF_QUEUE_SIZE(q) \
++ a_netbuf_queue_size(q)
++#define A_NETBUF_QUEUE_EMPTY(q) \
++ a_netbuf_queue_empty(q)
++
++/*
++ * Network buffer support
++ */
++#define A_NETBUF_ALLOC(size) \
++ a_netbuf_alloc(size)
++#define A_NETBUF_ALLOC_RAW(size) \
++ a_netbuf_alloc_raw(size)
++#define A_NETBUF_FREE(bufPtr) \
++ a_netbuf_free(bufPtr)
++#define A_NETBUF_DATA(bufPtr) \
++ a_netbuf_to_data(bufPtr)
++#define A_NETBUF_LEN(bufPtr) \
++ a_netbuf_to_len(bufPtr)
++#define A_NETBUF_PUSH(bufPtr, len) \
++ a_netbuf_push(bufPtr, len)
++#define A_NETBUF_PUT(bufPtr, len) \
++ a_netbuf_put(bufPtr, len)
++#define A_NETBUF_TRIM(bufPtr,len) \
++ a_netbuf_trim(bufPtr, len)
++#define A_NETBUF_PULL(bufPtr, len) \
++ a_netbuf_pull(bufPtr, len)
++#define A_NETBUF_HEADROOM(bufPtr)\
++ a_netbuf_headroom(bufPtr)
++#define A_NETBUF_SETLEN(bufPtr,len) \
++ a_netbuf_setlen(bufPtr, len)
++
++/* Add data to end of a buffer */
++#define A_NETBUF_PUT_DATA(bufPtr, srcPtr, len) \
++ a_netbuf_put_data(bufPtr, srcPtr, len)
++
++/* Add data to start of the buffer */
++#define A_NETBUF_PUSH_DATA(bufPtr, srcPtr, len) \
++ a_netbuf_push_data(bufPtr, srcPtr, len)
++
++/* Remove data at start of the buffer */
++#define A_NETBUF_PULL_DATA(bufPtr, dstPtr, len) \
++ a_netbuf_pull_data(bufPtr, dstPtr, len)
++
++/* Remove data from the end of the buffer */
++#define A_NETBUF_TRIM_DATA(bufPtr, dstPtr, len) \
++ a_netbuf_trim_data(bufPtr, dstPtr, len)
++
++/* View data as "size" contiguous bytes of type "t" */
++#define A_NETBUF_VIEW_DATA(bufPtr, t, size) \
++ (t )( ((struct skbuf *)(bufPtr))->data)
++
++/* return the beginning of the headroom for the buffer */
++#define A_NETBUF_HEAD(bufPtr) \
++ ((((struct sk_buff *)(bufPtr))->head))
++
++/*
++ * OS specific network buffer access routines
++ */
++void *a_netbuf_alloc(int size);
++void *a_netbuf_alloc_raw(int size);
++void a_netbuf_free(void *bufPtr);
++void *a_netbuf_to_data(void *bufPtr);
++A_UINT32 a_netbuf_to_len(void *bufPtr);
++A_STATUS a_netbuf_push(void *bufPtr, A_INT32 len);
++A_STATUS a_netbuf_push_data(void *bufPtr, char *srcPtr, A_INT32 len);
++A_STATUS a_netbuf_put(void *bufPtr, A_INT32 len);
++A_STATUS a_netbuf_put_data(void *bufPtr, char *srcPtr, A_INT32 len);
++A_STATUS a_netbuf_pull(void *bufPtr, A_INT32 len);
++A_STATUS a_netbuf_pull_data(void *bufPtr, char *dstPtr, A_INT32 len);
++A_STATUS a_netbuf_trim(void *bufPtr, A_INT32 len);
++A_STATUS a_netbuf_trim_data(void *bufPtr, char *dstPtr, A_INT32 len);
++A_STATUS a_netbuf_setlen(void *bufPtr, A_INT32 len);
++A_INT32 a_netbuf_headroom(void *bufPtr);
++void a_netbuf_enqueue(A_NETBUF_QUEUE_T *q, void *pkt);
++void a_netbuf_prequeue(A_NETBUF_QUEUE_T *q, void *pkt);
++void *a_netbuf_dequeue(A_NETBUF_QUEUE_T *q);
++int a_netbuf_queue_size(A_NETBUF_QUEUE_T *q);
++int a_netbuf_queue_empty(A_NETBUF_QUEUE_T *q);
++int a_netbuf_queue_empty(A_NETBUF_QUEUE_T *q);
++void a_netbuf_queue_init(A_NETBUF_QUEUE_T *q);
++
++/*
++ * Kernel v.s User space functions
++ */
++A_UINT32 a_copy_to_user(void *to, const void *from, A_UINT32 n);
++A_UINT32 a_copy_from_user(void *to, const void *from, A_UINT32 n);
++
++#else /* __KERNEL__ */
++
++#ifdef __GNUC__
++#define __ATTRIB_PACK __attribute__ ((packed))
++#define __ATTRIB_PRINTF __attribute__ ((format (printf, 1, 2)))
++#define __ATTRIB_NORETURN __attribute__ ((noreturn))
++#ifndef INLINE
++#define INLINE __inline__
++#endif
++#else /* Not GCC */
++#define __ATTRIB_PACK
++#define __ATTRIB_PRINTF
++#define __ATTRIB_NORETURN
++#ifndef INLINE
++#define INLINE __inline
++#endif
++#endif /* End __GNUC__ */
++
++#define PREPACK
++#define POSTPACK __ATTRIB_PACK
++
++#endif /* __KERNEL__ */
++
++#endif /* _OSAPI_LINUX_H_ */
+diff --git a/drivers/ar6000/ar6000/wireless_ext.c b/drivers/ar6000/ar6000/wireless_ext.c
+new file mode 100644
+index 0000000..af78ae0
+--- /dev/null
++++ b/drivers/ar6000/ar6000/wireless_ext.c
+@@ -0,0 +1,1979 @@
++/*
++ *
++ * Copyright (c) 2004-2007 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation;
++ *
++ * Software distributed under the License is distributed on an "AS
++ * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
++ * implied. See the License for the specific language governing
++ * rights and limitations under the License.
++ *
++ *
++ *
++ */
++
++#include "ar6000_drv.h"
++
++static A_UINT8 bcast_mac[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
++static void ar6000_set_quality(struct iw_quality *iq, A_INT8 rssi);
++extern unsigned int wmitimeout;
++extern A_WAITQUEUE_HEAD arEvent;
++extern wait_queue_head_t ar6000_scan_queue;
++
++/*
++ * Encode a WPA or RSN information element as a custom
++ * element using the hostap format.
++ */
++static u_int
++encode_ie(void *buf, size_t bufsize,
++ const u_int8_t *ie, size_t ielen,
++ const char *leader, size_t leader_len)
++{
++ u_int8_t *p;
++ int i;
++
++ if (bufsize < leader_len)
++ return 0;
++ p = buf;
++ memcpy(p, leader, leader_len);
++ bufsize -= leader_len;
++ p += leader_len;
++ for (i = 0; i < ielen && bufsize > 2; i++)
++ p += sprintf(p, "%02x", ie[i]);
++ return (i == ielen ? p - (u_int8_t *)buf : 0);
++}
++
++void
++ar6000_scan_node(void *arg, bss_t *ni)
++{
++ struct iw_event iwe;
++#if WIRELESS_EXT > 14
++ char buf[64*2 + 30];
++#endif
++ struct ar_giwscan_param *param;
++ A_CHAR *current_ev;
++ A_CHAR *end_buf;
++ struct ieee80211_common_ie *cie;
++ struct iw_request_info info;
++
++ info.cmd = 0;
++ info.flags = 0;
++
++ param = (struct ar_giwscan_param *)arg;
++
++ if (param->current_ev >= param->end_buf) {
++ return;
++ }
++ if ((param->firstPass == TRUE) &&
++ ((ni->ni_cie.ie_wpa == NULL) && (ni->ni_cie.ie_rsn == NULL))) {
++ /*
++ * Only forward wpa bss's in first pass
++ */
++ return;
++ }
++
++ if ((param->firstPass == FALSE) &&
++ ((ni->ni_cie.ie_wpa != NULL) || (ni->ni_cie.ie_rsn != NULL))) {
++ /*
++ * Only forward non-wpa bss's in 2nd pass
++ */
++ return;
++ }
++
++ current_ev = param->current_ev;
++ end_buf = param->end_buf;
++
++ cie = &ni->ni_cie;
++
++ A_MEMZERO(&iwe, sizeof(iwe));
++ iwe.cmd = SIOCGIWAP;
++ iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
++ A_MEMCPY(iwe.u.ap_addr.sa_data, ni->ni_macaddr, 6);
++ current_ev = iwe_stream_add_event(&info, current_ev, end_buf, &iwe,
++ IW_EV_ADDR_LEN);
++
++ A_MEMZERO(&iwe, sizeof(iwe));
++ iwe.cmd = SIOCGIWESSID;
++ iwe.u.data.flags = 1;
++ iwe.u.data.length = cie->ie_ssid[1];
++ current_ev = iwe_stream_add_point(&info, current_ev, end_buf, &iwe,
++ &cie->ie_ssid[2]);
++
++ if (cie->ie_capInfo & (IEEE80211_CAPINFO_ESS|IEEE80211_CAPINFO_IBSS)) {
++ A_MEMZERO(&iwe, sizeof(iwe));
++ iwe.cmd = SIOCGIWMODE;
++ iwe.u.mode = cie->ie_capInfo & IEEE80211_CAPINFO_ESS ?
++ IW_MODE_MASTER : IW_MODE_ADHOC;
++ current_ev = iwe_stream_add_event(&info, current_ev, end_buf, &iwe,
++ IW_EV_UINT_LEN);
++ }
++
++ A_MEMZERO(&iwe, sizeof(iwe));
++ iwe.cmd = SIOCGIWFREQ;
++ iwe.u.freq.m = cie->ie_chan * 100000;
++ iwe.u.freq.e = 1;
++ current_ev = iwe_stream_add_event(&info, current_ev, end_buf, &iwe,
++ IW_EV_FREQ_LEN);
++
++ A_MEMZERO(&iwe, sizeof(iwe));
++ iwe.cmd = IWEVQUAL;
++ ar6000_set_quality(&iwe.u.qual, ni->ni_snr);
++ current_ev = iwe_stream_add_event(&info, current_ev, end_buf, &iwe,
++ IW_EV_QUAL_LEN);
++
++ A_MEMZERO(&iwe, sizeof(iwe));
++ iwe.cmd = SIOCGIWENCODE;
++ if (cie->ie_capInfo & IEEE80211_CAPINFO_PRIVACY) {
++ iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY;
++ } else {
++ iwe.u.data.flags = IW_ENCODE_DISABLED;
++ }
++ iwe.u.data.length = 0;
++ current_ev = iwe_stream_add_point(&info, current_ev, end_buf, &iwe, "");
++
++ A_MEMZERO(&iwe, sizeof(iwe));
++ iwe.cmd = IWEVCUSTOM;
++ snprintf(buf, sizeof(buf), "bcn_int=%d", cie->ie_beaconInt);
++ iwe.u.data.length = strlen(buf);
++ current_ev = iwe_stream_add_point(&info, current_ev, end_buf, &iwe, buf);
++
++ if (cie->ie_wpa != NULL) {
++ static const char wpa_leader[] = "wpa_ie=";
++
++ A_MEMZERO(&iwe, sizeof(iwe));
++ iwe.cmd = IWEVCUSTOM;
++ iwe.u.data.length = encode_ie(buf, sizeof(buf), cie->ie_wpa,
++ cie->ie_wpa[1]+2,
++ wpa_leader, sizeof(wpa_leader)-1);
++
++ if (iwe.u.data.length != 0) {
++ current_ev = iwe_stream_add_point(&info, current_ev, end_buf, &iwe,
++ buf);
++ }
++ }
++
++ if (cie->ie_rsn != NULL && cie->ie_rsn[0] == IEEE80211_ELEMID_RSN) {
++ static const char rsn_leader[] = "rsn_ie=";
++
++ A_MEMZERO(&iwe, sizeof(iwe));
++ iwe.cmd = IWEVCUSTOM;
++ iwe.u.data.length = encode_ie(buf, sizeof(buf), cie->ie_rsn,
++ cie->ie_rsn[1]+2,
++ rsn_leader, sizeof(rsn_leader)-1);
++
++ if (iwe.u.data.length != 0) {
++ current_ev = iwe_stream_add_point(&info, current_ev, end_buf, &iwe,
++ buf);
++ }
++ }
++
++ if (cie->ie_wmm != NULL) {
++ static const char wmm_leader[] = "wmm_ie=";
++
++ A_MEMZERO(&iwe, sizeof(iwe));
++ iwe.cmd = IWEVCUSTOM;
++ iwe.u.data.length = encode_ie(buf, sizeof(buf), cie->ie_wmm,
++ cie->ie_wmm[1]+2,
++ wmm_leader, sizeof(wmm_leader)-1);
++ if (iwe.u.data.length != 0) {
++ current_ev = iwe_stream_add_point(&info, current_ev, end_buf, &iwe,
++ buf);
++ }
++ }
++
++ if (cie->ie_ath != NULL) {
++ static const char ath_leader[] = "ath_ie=";
++
++ A_MEMZERO(&iwe, sizeof(iwe));
++ iwe.cmd = IWEVCUSTOM;
++ iwe.u.data.length = encode_ie(buf, sizeof(buf), cie->ie_ath,
++ cie->ie_ath[1]+2,
++ ath_leader, sizeof(ath_leader)-1);
++ if (iwe.u.data.length != 0) {
++ current_ev = iwe_stream_add_point(&info, current_ev, end_buf, &iwe,
++ buf);
++ }
++ }
++
++ param->current_ev = current_ev;
++}
++
++int
++ar6000_ioctl_giwscan(struct net_device *dev,
++ struct iw_request_info *info,
++ struct iw_point *data, char *extra)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ struct ar_giwscan_param param;
++ int i;
++
++ if (ar->arWlanState == WLAN_DISABLED) {
++ return -EIO;
++ }
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++ param.current_ev = extra;
++ param.end_buf = extra + IW_SCAN_MAX_DATA;
++ param.firstPass = TRUE;
++
++ /*
++ * Do two passes to insure WPA scan candidates
++ * are sorted to the front. This is a hack to deal with
++ * the wireless extensions capping scan results at
++ * IW_SCAN_MAX_DATA bytes. In densely populated environments
++ * it's easy to overflow this buffer (especially with WPA/RSN
++ * information elements). Note this sorting hack does not
++ * guarantee we won't overflow anyway.
++ */
++ for (i = 0; i < 2; i++) {
++ /*
++ * Translate data to WE format.
++ */
++ wmi_iterate_nodes(ar->arWmi, ar6000_scan_node, &param);
++ param.firstPass = FALSE;
++ if (param.current_ev >= param.end_buf) {
++ data->length = param.current_ev - extra;
++ return -E2BIG;
++ }
++ }
++
++ data->length = param.current_ev - extra;
++ return 0;
++}
++
++extern int reconnect_flag;
++/* SIOCSIWESSID */
++static int
++ar6000_ioctl_siwessid(struct net_device *dev,
++ struct iw_request_info *info,
++ struct iw_point *data, char *ssid)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ A_STATUS status;
++ A_UINT8 arNetworkType;
++
++ if (ar->arWlanState == WLAN_DISABLED) {
++ return -EIO;
++ }
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++ /*
++ * iwconfig passes a string with length excluding any trailing NUL.
++ * FIXME: we should be able to set an ESSID of 32 bytes, yet things fall
++ * over badly if we do. So we limit the ESSID to 31 bytes.
++ */
++ if (data->flags && (!data->length || data->length >= sizeof(ar->arSsid))) {
++ /*
++ * ssid is invalid
++ */
++ return -EINVAL;
++ }
++ /* Added for bug 25178, return an IOCTL error instead of target returning
++ Illegal parameter error when either the BSSID or channel is missing
++ and we cannot scan during connect.
++ */
++ if (data->flags) {
++ if (ar->arSkipScan == TRUE &&
++ (ar->arChannelHint == 0 ||
++ (!ar->arReqBssid[0] && !ar->arReqBssid[1] && !ar->arReqBssid[2] &&
++ !ar->arReqBssid[3] && !ar->arReqBssid[4] && !ar->arReqBssid[5])))
++ {
++ return -EINVAL;
++ }
++ }
++
++ if (down_interruptible(&ar->arSem)) {
++ return -ERESTARTSYS;
++ }
++
++ if (ar->arTxPending[WMI_CONTROL_PRI]) {
++ /*
++ * sleep until the command queue drains
++ */
++ wait_event_interruptible_timeout(arEvent,
++ ar->arTxPending[WMI_CONTROL_PRI] == 0, wmitimeout * HZ);
++ if (signal_pending(current)) {
++ return -EINTR;
++ }
++ }
++
++ if (!data->flags) {
++ arNetworkType = ar->arNetworkType;
++ ar6000_init_profile_info(ar);
++ ar->arNetworkType = arNetworkType;
++ }
++
++ /*
++ * The original logic here prevented a disconnect if issuing an "essid off"
++ * if no ESSID was set, presumably to prevent sending multiple disconnects
++ * to the WMI.
++ *
++ * Unfortunately, this also meant that no disconnect was sent when we were
++ * already connected, but the profile has been changed since (which also
++ * clears the ESSID as a reminder that the WMI needs updating.)
++ *
++ * The "1 ||" makes sure we always disconnect or reconnect. The WMI doesn't
++ * seem to mind being sent multiple disconnects.
++ */
++ if (1 || (ar->arSsidLen) || (!data->flags))
++ {
++ if ((!data->flags) ||
++ (A_MEMCMP(ar->arSsid, ssid, ar->arSsidLen) != 0) ||
++ (ar->arSsidLen != (data->length)))
++ {
++ /*
++ * SSID set previously or essid off has been issued.
++ *
++ * Disconnect Command is issued in two cases after wmi is ready
++ * (1) ssid is different from the previous setting
++ * (2) essid off has been issued
++ *
++ */
++ if (ar->arWmiReady == TRUE) {
++ reconnect_flag = 0;
++ status = wmi_disconnect_cmd(ar->arWmi);
++ A_MEMZERO(ar->arSsid, sizeof(ar->arSsid));
++ ar->arSsidLen = 0;
++ if (ar->arSkipScan == FALSE) {
++ A_MEMZERO(ar->arReqBssid, sizeof(ar->arReqBssid));
++ }
++ if (!data->flags) {
++ up(&ar->arSem);
++ return 0;
++ }
++ } else {
++ up(&ar->arSem);
++ }
++ }
++ else
++ {
++ /*
++ * SSID is same, so we assume profile hasn't changed.
++ * If the interface is up and wmi is ready, we issue
++ * a reconnect cmd. Issue a reconnect only we are already
++ * connected.
++ */
++ if((ar->arConnected == TRUE) && (ar->arWmiReady == TRUE))
++ {
++ reconnect_flag = TRUE;
++ status = wmi_reconnect_cmd(ar->arWmi,ar->arReqBssid,
++ ar->arChannelHint);
++ up(&ar->arSem);
++ if (status != A_OK) {
++ return -EIO;
++ }
++ return 0;
++ }
++ else{
++ /*
++ * Dont return if connect is pending.
++ */
++ if(!(ar->arConnectPending)) {
++ up(&ar->arSem);
++ return 0;
++ }
++ }
++ }
++ }
++
++ ar->arSsidLen = data->length;
++ A_MEMCPY(ar->arSsid, ssid, ar->arSsidLen);
++
++ /* The ssid length check prevents second "essid off" from the user,
++ to be treated as a connect cmd. The second "essid off" is ignored.
++ */
++ if((ar->arWmiReady == TRUE) && (ar->arSsidLen > 0) )
++ {
++ AR6000_SPIN_LOCK(&ar->arLock, 0);
++ if (SHARED_AUTH == ar->arDot11AuthMode) {
++ ar6000_install_static_wep_keys(ar);
++ }
++ AR_DEBUG_PRINTF("Connect called with authmode %d dot11 auth %d"\
++ " PW crypto %d PW crypto Len %d GRP crypto %d"\
++ " GRP crypto Len %d\n",
++ ar->arAuthMode, ar->arDot11AuthMode,
++ ar->arPairwiseCrypto, ar->arPairwiseCryptoLen,
++ ar->arGroupCrypto, ar->arGroupCryptoLen);
++ reconnect_flag = 0;
++ AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++ status = wmi_connect_cmd(ar->arWmi, ar->arNetworkType,
++ ar->arDot11AuthMode, ar->arAuthMode,
++ ar->arPairwiseCrypto, ar->arPairwiseCryptoLen,
++ ar->arGroupCrypto,ar->arGroupCryptoLen,
++ ar->arSsidLen, ar->arSsid,
++ ar->arReqBssid, ar->arChannelHint,
++ ar->arConnectCtrlFlags);
++
++
++ up(&ar->arSem);
++
++ if (status != A_OK) {
++ return -EIO;
++ }
++ ar->arConnectPending = TRUE;
++ }else{
++ up(&ar->arSem);
++ }
++ return 0;
++}
++
++/* SIOCGIWESSID */
++static int
++ar6000_ioctl_giwessid(struct net_device *dev,
++ struct iw_request_info *info,
++ struct iw_point *data, char *essid)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++
++ if (ar->arWlanState == WLAN_DISABLED) {
++ return -EIO;
++ }
++
++ data->flags = 1;
++ data->length = ar->arSsidLen;
++ A_MEMCPY(essid, ar->arSsid, ar->arSsidLen);
++
++ return 0;
++}
++
++
++void ar6000_install_static_wep_keys(AR_SOFTC_T *ar)
++{
++ A_UINT8 index;
++ A_UINT8 keyUsage;
++
++ for (index = WMI_MIN_KEY_INDEX; index <= WMI_MAX_KEY_INDEX; index++) {
++ if (ar->arWepKeyList[index].arKeyLen) {
++ keyUsage = GROUP_USAGE;
++ if (index == ar->arDefTxKeyIndex) {
++ keyUsage |= TX_USAGE;
++ }
++ wmi_addKey_cmd(ar->arWmi,
++ index,
++ WEP_CRYPT,
++ keyUsage,
++ ar->arWepKeyList[index].arKeyLen,
++ NULL,
++ ar->arWepKeyList[index].arKey, KEY_OP_INIT_VAL,
++ NO_SYNC_WMIFLAG);
++ }
++ }
++}
++
++int
++ar6000_ioctl_delkey(struct net_device *dev, struct iw_request_info *info,
++ void *w, char *extra)
++{
++ return 0;
++}
++
++int
++ar6000_ioctl_setmlme(struct net_device *dev, struct iw_request_info *info,
++ void *w, char *extra)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ struct ieee80211req_mlme *mlme = (struct ieee80211req_mlme *)extra;
++
++ if ((ar->arWmiReady == FALSE) || (ar->arConnected != TRUE))
++ return -EIO;
++
++ switch (mlme->im_op) {
++ case IEEE80211_MLME_DISASSOC:
++ case IEEE80211_MLME_DEAUTH:
++ /* Not Supported */
++ break;
++ default:
++ break;
++ }
++ return 0;
++}
++
++
++int
++ar6000_ioctl_setwmmparams(struct net_device *dev, struct iw_request_info *info,
++ void *w, char *extra)
++{
++ return -EIO; /* for now */
++}
++
++int
++ar6000_ioctl_getwmmparams(struct net_device *dev, struct iw_request_info *info,
++ void *w, char *extra)
++{
++ return -EIO; /* for now */
++}
++
++int ar6000_ioctl_setoptie(struct net_device *dev, struct iw_request_info *info,
++ struct iw_point *data, char *extra)
++{
++ /* The target generates the WPA/RSN IE */
++ return 0;
++}
++
++int
++ar6000_ioctl_setauthalg(struct net_device *dev, struct iw_request_info *info,
++ void *w, char *extra)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ struct ieee80211req_authalg *req = (struct ieee80211req_authalg *)extra;
++ int ret = 0;
++
++
++ AR6000_SPIN_LOCK(&ar->arLock, 0);
++
++ if (req->auth_alg == AUTH_ALG_OPEN_SYSTEM) {
++ ar->arDot11AuthMode = OPEN_AUTH;
++ } else if (req->auth_alg == AUTH_ALG_LEAP) {
++ ar->arDot11AuthMode = LEAP_AUTH;
++ ar->arPairwiseCrypto = WEP_CRYPT;
++ ar->arGroupCrypto = WEP_CRYPT;
++ } else {
++ ret = -EIO;
++ }
++
++ AR6000_SPIN_UNLOCK(&ar->arLock, 0);
++
++ return ret;
++}
++static int
++ar6000_ioctl_addpmkid(struct net_device *dev, struct iw_request_info *info,
++ void *w, char *extra)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ struct ieee80211req_addpmkid *req = (struct ieee80211req_addpmkid *)extra;
++ A_STATUS status;
++
++ if (ar->arWlanState == WLAN_DISABLED) {
++ return -EIO;
++ }
++
++ AR_DEBUG_PRINTF("Add pmkid for %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x en=%d\n",
++ req->pi_bssid[0], req->pi_bssid[1], req->pi_bssid[2],
++ req->pi_bssid[3], req->pi_bssid[4], req->pi_bssid[5],
++ req->pi_enable);
++
++ status = wmi_setPmkid_cmd(ar->arWmi, req->pi_bssid, req->pi_pmkid,
++ req->pi_enable);
++
++ if (status != A_OK) {
++ return -EIO;
++ }
++
++ return 0;
++}
++
++/*
++ * SIOCSIWRATE
++ */
++int
++ar6000_ioctl_siwrate(struct net_device *dev,
++ struct iw_request_info *info,
++ struct iw_param *rrq, char *extra)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ A_UINT32 kbps;
++
++ if (rrq->fixed) {
++ kbps = rrq->value / 1000; /* rrq->value is in bps */
++ } else {
++ kbps = -1; /* -1 indicates auto rate */
++ }
++ if(kbps != -1 && wmi_validate_bitrate(ar->arWmi, kbps) == A_EINVAL)
++ {
++ AR_DEBUG_PRINTF("BitRate is not Valid %d\n", kbps);
++ return -EINVAL;
++ }
++ ar->arBitRate = kbps;
++ if(ar->arWmiReady == TRUE)
++ {
++ if (wmi_set_bitrate_cmd(ar->arWmi, kbps) != A_OK) {
++ return -EINVAL;
++ }
++ }
++ return 0;
++}
++
++/*
++ * SIOCGIWRATE
++ */
++int
++ar6000_ioctl_giwrate(struct net_device *dev,
++ struct iw_request_info *info,
++ struct iw_param *rrq, char *extra)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ int ret = 0;
++
++ if (down_interruptible(&ar->arSem)) {
++ return -ERESTARTSYS;
++ }
++ if(ar->arWmiReady == TRUE)
++ {
++ ar->arBitRate = 0xFFFF;
++ if (wmi_get_bitrate_cmd(ar->arWmi) != A_OK) {
++ up(&ar->arSem);
++ return -EIO;
++ }
++ wait_event_interruptible_timeout(arEvent, ar->arBitRate != 0xFFFF, wmitimeout * HZ);
++ if (signal_pending(current)) {
++ ret = -EINTR;
++ }
++ }
++ /* If the interface is down or wmi is not ready or the target is not
++ connected - return the value stored in the device structure */
++ if (!ret) {
++ if (ar->arBitRate == -1) {
++ rrq->fixed = TRUE;
++ rrq->value = 0;
++ } else {
++ rrq->value = ar->arBitRate * 1000;
++ }
++ }
++
++ up(&ar->arSem);
++
++ return ret;
++}
++
++/*
++ * SIOCSIWTXPOW
++ */
++static int
++ar6000_ioctl_siwtxpow(struct net_device *dev,
++ struct iw_request_info *info,
++ struct iw_param *rrq, char *extra)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ A_UINT8 dbM;
++
++ if (ar->arWlanState == WLAN_DISABLED) {
++ return -EIO;
++ }
++
++ if (ar->arRadioSwitch == WLAN_ENABLED
++ && rrq->disabled) {
++ if (wmi_switch_radio(ar->arWmi, WLAN_DISABLED) < 0)
++ return -EIO;
++ ar->arRadioSwitch = WLAN_DISABLED;
++ } else if (ar->arRadioSwitch == WLAN_DISABLED
++ && !rrq->disabled) {
++ if (wmi_switch_radio(ar->arWmi, WLAN_ENABLED) < 0)
++ return -EIO;
++ ar->arRadioSwitch = WLAN_ENABLED;
++ }
++
++ if (rrq->fixed) {
++ if (rrq->flags != IW_TXPOW_DBM) {
++ return -EOPNOTSUPP;
++ }
++ ar->arTxPwr= dbM = rrq->value;
++ ar->arTxPwrSet = TRUE;
++ } else {
++ ar->arTxPwr = dbM = 0;
++ ar->arTxPwrSet = FALSE;
++ }
++ if(ar->arWmiReady == TRUE)
++ {
++ AR_DEBUG_PRINTF("Set tx pwr cmd %d dbM\n", dbM);
++ wmi_set_txPwr_cmd(ar->arWmi, dbM);
++ }
++ return 0;
++}
++
++/*
++ * SIOCGIWTXPOW
++ */
++int
++ar6000_ioctl_giwtxpow(struct net_device *dev,
++ struct iw_request_info *info,
++ struct iw_param *rrq, char *extra)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ int ret = 0;
++
++ if (ar->arWlanState == WLAN_DISABLED) {
++ return -EIO;
++ }
++
++ if (ar->arRadioSwitch == WLAN_DISABLED) {
++ rrq->disabled = 1;
++ return 0;
++ }
++
++ if (down_interruptible(&ar->arSem)) {
++ return -ERESTARTSYS;
++ }
++ if((ar->arWmiReady == TRUE) && (ar->arConnected == TRUE))
++ {
++ ar->arTxPwr = 0;
++
++ if (wmi_get_txPwr_cmd(ar->arWmi) != A_OK) {
++ up(&ar->arSem);
++ return -EIO;
++ }
++
++ wait_event_interruptible_timeout(arEvent, ar->arTxPwr != 0, wmitimeout * HZ);
++
++ if (signal_pending(current)) {
++ ret = -EINTR;
++ }
++ }
++ /* If the interace is down or wmi is not ready or target is not connected
++ then return value stored in the device structure */
++
++ if (!ret) {
++ if (ar->arTxPwrSet == TRUE) {
++ rrq->fixed = TRUE;
++ }
++ rrq->value = ar->arTxPwr;
++ rrq->flags = IW_TXPOW_DBM;
++ }
++
++ up(&ar->arSem);
++
++ return ret;
++}
++
++/*
++ * SIOCSIWRETRY
++ * since iwconfig only provides us with one max retry value, we use it
++ * to apply to data frames of the BE traffic class.
++ */
++static int
++ar6000_ioctl_siwretry(struct net_device *dev,
++ struct iw_request_info *info,
++ struct iw_param *rrq, char *extra)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++
++ if (ar->arWlanState == WLAN_DISABLED) {
++ return -EIO;
++ }
++
++ if (rrq->disabled) {
++ return -EOPNOTSUPP;
++ }
++
++ if ((rrq->flags & IW_RETRY_TYPE) != IW_RETRY_LIMIT) {
++ return -EOPNOTSUPP;
++ }
++
++ if ( !(rrq->value >= WMI_MIN_RETRIES) || !(rrq->value <= WMI_MAX_RETRIES)) {
++ return - EINVAL;
++ }
++ if(ar->arWmiReady == TRUE)
++ {
++ if (wmi_set_retry_limits_cmd(ar->arWmi, DATA_FRAMETYPE, WMM_AC_BE,
++ rrq->value, 0) != A_OK){
++ return -EINVAL;
++ }
++ }
++ ar->arMaxRetries = rrq->value;
++ return 0;
++}
++
++/*
++ * SIOCGIWRETRY
++ */
++static int
++ar6000_ioctl_giwretry(struct net_device *dev,
++ struct iw_request_info *info,
++ struct iw_param *rrq, char *extra)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++
++ if (ar->arWlanState == WLAN_DISABLED) {
++ return -EIO;
++ }
++
++ rrq->disabled = 0;
++ switch (rrq->flags & IW_RETRY_TYPE) {
++ case IW_RETRY_LIFETIME:
++ return -EOPNOTSUPP;
++ break;
++ case IW_RETRY_LIMIT:
++ rrq->flags = IW_RETRY_LIMIT;
++ switch (rrq->flags & IW_RETRY_MODIFIER) {
++ case IW_RETRY_MIN:
++ rrq->flags |= IW_RETRY_MIN;
++ rrq->value = WMI_MIN_RETRIES;
++ break;
++ case IW_RETRY_MAX:
++ rrq->flags |= IW_RETRY_MAX;
++ rrq->value = ar->arMaxRetries;
++ break;
++ }
++ break;
++ }
++ return 0;
++}
++
++/*
++ * SIOCSIWENCODE
++ */
++static int
++ar6000_ioctl_siwencode(struct net_device *dev,
++ struct iw_request_info *info,
++ struct iw_point *erq, char *keybuf)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ int index;
++ A_INT32 auth = ar->arDot11AuthMode;
++
++ if (ar->arWlanState == WLAN_DISABLED) {
++ return -EIO;
++ }
++
++ index = erq->flags & IW_ENCODE_INDEX;
++
++ if (index && (((index - 1) < WMI_MIN_KEY_INDEX) ||
++ ((index - 1) > WMI_MAX_KEY_INDEX)))
++ {
++ return -EIO;
++ }
++
++ if (erq->flags & IW_ENCODE_DISABLED) {
++ /*
++ * Encryption disabled
++ */
++ if (index) {
++ /*
++ * If key index was specified then clear the specified key
++ */
++ index--;
++ A_MEMZERO(ar->arWepKeyList[index].arKey,
++ sizeof(ar->arWepKeyList[index].arKey));
++ ar->arWepKeyList[index].arKeyLen = 0;
++ }
++ ar->arDot11AuthMode = OPEN_AUTH;
++ ar->arPairwiseCrypto = NONE_CRYPT;
++ ar->arGroupCrypto = NONE_CRYPT;
++ ar->arAuthMode = NONE_AUTH;
++ } else {
++ /*
++ * Enabling WEP encryption
++ */
++ if (index) {
++ index--; /* keyindex is off base 1 in iwconfig */
++ }
++
++ if (erq->flags & IW_ENCODE_OPEN) {
++ auth = OPEN_AUTH;
++ } else if (erq->flags & IW_ENCODE_RESTRICTED) {
++ auth = SHARED_AUTH;
++ }
++
++ if (erq->length) {
++ if (!IEEE80211_IS_VALID_WEP_CIPHER_LEN(erq->length)) {
++ return -EIO;
++ }
++
++ A_MEMZERO(ar->arWepKeyList[index].arKey,
++ sizeof(ar->arWepKeyList[index].arKey));
++ A_MEMCPY(ar->arWepKeyList[index].arKey, keybuf, erq->length);
++ ar->arWepKeyList[index].arKeyLen = erq->length;
++ } else {
++ if (ar->arWepKeyList[index].arKeyLen == 0) {
++ return -EIO;
++ }
++ ar->arDefTxKeyIndex = index;
++ }
++
++ ar->arPairwiseCrypto = WEP_CRYPT;
++ ar->arGroupCrypto = WEP_CRYPT;
++ ar->arDot11AuthMode = auth;
++ ar->arAuthMode = NONE_AUTH;
++ }
++
++ /*
++ * profile has changed. Erase ssid to signal change
++ */
++ A_MEMZERO(ar->arSsid, sizeof(ar->arSsid));
++ ar->arSsidLen = 0;
++
++ return 0;
++}
++
++static int
++ar6000_ioctl_giwencode(struct net_device *dev,
++ struct iw_request_info *info,
++ struct iw_point *erq, char *key)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ A_UINT8 keyIndex;
++ struct ar_wep_key *wk;
++
++ if (ar->arWlanState == WLAN_DISABLED) {
++ return -EIO;
++ }
++
++ if (ar->arPairwiseCrypto == NONE_CRYPT) {
++ erq->length = 0;
++ erq->flags = IW_ENCODE_DISABLED;
++ } else {
++ /* get the keyIndex */
++ keyIndex = erq->flags & IW_ENCODE_INDEX;
++ if (0 == keyIndex) {
++ keyIndex = ar->arDefTxKeyIndex;
++ } else if ((keyIndex - 1 < WMI_MIN_KEY_INDEX) ||
++ (keyIndex - 1 > WMI_MAX_KEY_INDEX))
++ {
++ keyIndex = WMI_MIN_KEY_INDEX;
++ } else {
++ keyIndex--;
++ }
++ erq->flags = keyIndex + 1;
++ erq->flags |= IW_ENCODE_ENABLED;
++ wk = &ar->arWepKeyList[keyIndex];
++ if (erq->length > wk->arKeyLen) {
++ erq->length = wk->arKeyLen;
++ }
++ if (wk->arKeyLen) {
++ A_MEMCPY(key, wk->arKey, erq->length);
++ }
++ if (ar->arDot11AuthMode == OPEN_AUTH) {
++ erq->flags |= IW_ENCODE_OPEN;
++ } else if (ar->arDot11AuthMode == SHARED_AUTH) {
++ erq->flags |= IW_ENCODE_RESTRICTED;
++ }
++ }
++
++ return 0;
++}
++
++static int ar6000_ioctl_siwpower(struct net_device *dev,
++ struct iw_request_info *info,
++ union iwreq_data *wrqu, char *extra)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ WMI_POWER_MODE power_mode;
++
++ if (wrqu->power.disabled)
++ power_mode = MAX_PERF_POWER;
++ else
++ power_mode = REC_POWER;
++
++ if (wmi_powermode_cmd(ar->arWmi, power_mode) < 0)
++ return -EIO;
++
++ return 0;
++}
++
++static int ar6000_ioctl_giwpower(struct net_device *dev,
++ struct iw_request_info *info,
++ union iwreq_data *wrqu, char *extra)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++
++ /*
++ * FIXME:
++ * https://docs.openmoko.org/trac/ticket/2267
++ * When starting wpa_supplicant the kernel oopses.
++ * The following condition avoids the oops.
++ * Remove this comment to bless this solution.
++ */
++ if (ar->arWlanState == WLAN_DISABLED || ar->arWmiReady == FALSE)
++ return -EIO;
++
++ return wmi_get_power_mode_cmd(ar->arWmi);
++}
++
++static int ar6000_ioctl_siwgenie(struct net_device *dev,
++ struct iw_request_info *info,
++ struct iw_point *dwrq,
++ char *extra)
++{
++ /* The target does that for us */
++ return 0;
++}
++
++static int ar6000_ioctl_giwgenie(struct net_device *dev,
++ struct iw_request_info *info,
++ struct iw_point *dwrq,
++ char *extra)
++{
++ return 0;
++}
++
++static int ar6000_ioctl_siwauth(struct net_device *dev,
++ struct iw_request_info *info,
++ struct iw_param *param,
++ char *extra)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ int reset = 0;
++
++ switch (param->flags & IW_AUTH_INDEX) {
++ case IW_AUTH_WPA_VERSION:
++ if (param->value & IW_AUTH_WPA_VERSION_DISABLED) {
++ ar->arAuthMode = NONE_AUTH;
++ }
++ if (param->value & IW_AUTH_WPA_VERSION_WPA) {
++ ar->arAuthMode = WPA_AUTH;
++ }
++ if (param->value & IW_AUTH_WPA_VERSION_WPA2) {
++ ar->arAuthMode = WPA2_AUTH;
++ }
++
++ reset = 1;
++ break;
++ case IW_AUTH_CIPHER_PAIRWISE:
++ if (param->value & IW_AUTH_CIPHER_NONE) {
++ ar->arPairwiseCrypto = NONE_CRYPT;
++ }
++ if (param->value & IW_AUTH_CIPHER_WEP40) {
++ ar->arPairwiseCrypto = WEP_CRYPT;
++ }
++ if (param->value & IW_AUTH_CIPHER_TKIP) {
++ ar->arPairwiseCrypto = TKIP_CRYPT;
++ }
++ if (param->value & IW_AUTH_CIPHER_CCMP) {
++ ar->arPairwiseCrypto = AES_CRYPT;
++ }
++
++ reset = 1;
++ break;
++ case IW_AUTH_CIPHER_GROUP:
++ if (param->value & IW_AUTH_CIPHER_NONE) {
++ ar->arGroupCrypto = NONE_CRYPT;
++ }
++ if (param->value & IW_AUTH_CIPHER_WEP40) {
++ ar->arGroupCrypto = WEP_CRYPT;
++ }
++ if (param->value & IW_AUTH_CIPHER_TKIP) {
++ ar->arGroupCrypto = TKIP_CRYPT;
++ }
++ if (param->value & IW_AUTH_CIPHER_CCMP) {
++ ar->arGroupCrypto = AES_CRYPT;
++ }
++
++ reset = 1;
++ break;
++ case IW_AUTH_KEY_MGMT:
++ if (param->value & IW_AUTH_KEY_MGMT_PSK) {
++ if (ar->arAuthMode == WPA_AUTH) {
++ ar->arAuthMode = WPA_PSK_AUTH;
++ } else if (ar->arAuthMode == WPA2_AUTH) {
++ ar->arAuthMode = WPA2_PSK_AUTH;
++ }
++
++ reset = 1;
++ }
++ break;
++
++ case IW_AUTH_TKIP_COUNTERMEASURES:
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++ wmi_set_tkip_countermeasures_cmd(ar->arWmi, param->value);
++ break;
++
++ case IW_AUTH_DROP_UNENCRYPTED:
++ break;
++
++ case IW_AUTH_80211_AUTH_ALG:
++ if (param->value & IW_AUTH_ALG_OPEN_SYSTEM) {
++ ar->arDot11AuthMode = OPEN_AUTH;
++ }
++ if (param->value & IW_AUTH_ALG_SHARED_KEY) {
++ ar->arDot11AuthMode = SHARED_AUTH;
++ }
++ if (param->value & IW_AUTH_ALG_LEAP) {
++ ar->arDot11AuthMode = LEAP_AUTH;
++ ar->arPairwiseCrypto = WEP_CRYPT;
++ ar->arGroupCrypto = WEP_CRYPT;
++ }
++
++ reset = 1;
++ break;
++
++ case IW_AUTH_WPA_ENABLED:
++ reset = 1;
++ break;
++
++ case IW_AUTH_RX_UNENCRYPTED_EAPOL:
++ break;
++
++ case IW_AUTH_PRIVACY_INVOKED:
++ break;
++
++ default:
++ printk("%s(): Unknown flag 0x%x\n", __FUNCTION__, param->flags);
++ return -EOPNOTSUPP;
++ }
++
++ if (reset) {
++ A_MEMZERO(ar->arSsid, sizeof(ar->arSsid));
++ ar->arSsidLen = 0;
++ }
++
++ return 0;
++}
++
++static int ar6000_ioctl_giwauth(struct net_device *dev,
++ struct iw_request_info *info,
++ struct iw_param *dwrq,
++ char *extra)
++{
++ return 0;
++}
++
++static int ar6000_ioctl_siwencodeext(struct net_device *dev,
++ struct iw_request_info *info,
++ union iwreq_data *wrqu,
++ char *extra)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ struct iw_point *encoding = &wrqu->encoding;
++ struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
++ int alg = ext->alg, idx;
++
++ if (ar->arWlanState == WLAN_DISABLED) {
++ return -EIO;
++ }
++
++ /* Determine and validate the key index */
++ idx = (encoding->flags & IW_ENCODE_INDEX) - 1;
++ if (idx) {
++ if (idx < 0 || idx > 3)
++ return -EINVAL;
++ }
++
++ if ((alg == IW_ENCODE_ALG_TKIP) || (alg == IW_ENCODE_ALG_CCMP)) {
++ struct ieee80211req_key ik;
++ KEY_USAGE key_usage;
++ CRYPTO_TYPE key_type = NONE_CRYPT;
++ int status;
++
++ ar->user_saved_keys.keyOk = FALSE;
++
++ if (alg == IW_ENCODE_ALG_TKIP) {
++ key_type = TKIP_CRYPT;
++ ik.ik_type = IEEE80211_CIPHER_TKIP;
++ } else {
++ key_type = AES_CRYPT;
++ ik.ik_type = IEEE80211_CIPHER_AES_CCM;
++ }
++
++ ik.ik_keyix = idx;
++ ik.ik_keylen = ext->key_len;
++ ik.ik_flags = IEEE80211_KEY_RECV;
++ if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
++ ik.ik_flags |= IEEE80211_KEY_XMIT
++ | IEEE80211_KEY_DEFAULT;
++ }
++
++ if (ext->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) {
++ memcpy(&ik.ik_keyrsc, ext->rx_seq, 8);
++ }
++
++ memcpy(ik.ik_keydata, ext->key, ext->key_len);
++
++ ar->user_saved_keys.keyType = key_type;
++ if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) {
++ key_usage = GROUP_USAGE;
++ memset(ik.ik_macaddr, 0, ETH_ALEN);
++ memcpy(&ar->user_saved_keys.bcast_ik, &ik,
++ sizeof(struct ieee80211req_key));
++ } else {
++ key_usage = PAIRWISE_USAGE;
++ memcpy(ik.ik_macaddr, ext->addr.sa_data, ETH_ALEN);
++ memcpy(&ar->user_saved_keys.ucast_ik, &ik,
++ sizeof(struct ieee80211req_key));
++ }
++
++ status = wmi_addKey_cmd(ar->arWmi, ik.ik_keyix, key_type,
++ key_usage, ik.ik_keylen,
++ (A_UINT8 *)&ik.ik_keyrsc,
++ ik.ik_keydata,
++ KEY_OP_INIT_VAL, SYNC_BEFORE_WMIFLAG);
++
++ if (status < 0)
++ return -EIO;
++
++ ar->user_saved_keys.keyOk = TRUE;
++
++ return 0;
++
++ } else {
++ /* WEP falls back to SIWENCODE */
++ return -EOPNOTSUPP;
++ }
++
++ return 0;
++}
++
++
++static int ar6000_ioctl_giwencodeext(struct net_device *dev,
++ struct iw_request_info *info,
++ struct iw_point *dwrq,
++ char *extra)
++{
++ return 0;
++}
++
++
++static int
++ar6000_ioctl_setparam(struct net_device *dev,
++ struct iw_request_info *info,
++ void *erq, char *extra)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ int *i = (int *)extra;
++ int param = i[0];
++ int value = i[1];
++ int ret = 0;
++ A_BOOL profChanged = FALSE;
++
++ if (ar->arWlanState == WLAN_DISABLED) {
++ return -EIO;
++ }
++
++ switch (param) {
++ case IEEE80211_PARAM_WPA:
++ switch (value) {
++ case WPA_MODE_WPA1:
++ ar->arAuthMode = WPA_AUTH;
++ profChanged = TRUE;
++ break;
++ case WPA_MODE_WPA2:
++ ar->arAuthMode = WPA2_AUTH;
++ profChanged = TRUE;
++ break;
++ case WPA_MODE_NONE:
++ ar->arAuthMode = NONE_AUTH;
++ profChanged = TRUE;
++ break;
++ default:
++ printk("IEEE80211_PARAM_WPA: Unknown value %d\n", value);
++ }
++ break;
++ case IEEE80211_PARAM_AUTHMODE:
++ switch(value) {
++ case IEEE80211_AUTH_WPA_PSK:
++ if (WPA_AUTH == ar->arAuthMode) {
++ ar->arAuthMode = WPA_PSK_AUTH;
++ profChanged = TRUE;
++ } else if (WPA2_AUTH == ar->arAuthMode) {
++ ar->arAuthMode = WPA2_PSK_AUTH;
++ profChanged = TRUE;
++ } else {
++ AR_DEBUG_PRINTF("Error - Setting PSK mode when WPA "\
++ "param was set to %d\n",
++ ar->arAuthMode);
++ ret = -1;
++ }
++ break;
++ case IEEE80211_AUTH_WPA_CCKM:
++ if (WPA2_AUTH == ar->arAuthMode) {
++ ar->arAuthMode = WPA2_AUTH_CCKM;
++ } else {
++ ar->arAuthMode = WPA_AUTH_CCKM;
++ }
++ break;
++ default:
++ break;
++ }
++ break;
++ case IEEE80211_PARAM_UCASTCIPHER:
++ switch (value) {
++ case IEEE80211_CIPHER_AES_CCM:
++ ar->arPairwiseCrypto = AES_CRYPT;
++ profChanged = TRUE;
++ break;
++ case IEEE80211_CIPHER_TKIP:
++ ar->arPairwiseCrypto = TKIP_CRYPT;
++ profChanged = TRUE;
++ break;
++ case IEEE80211_CIPHER_WEP:
++ ar->arPairwiseCrypto = WEP_CRYPT;
++ profChanged = TRUE;
++ break;
++ case IEEE80211_CIPHER_NONE:
++ ar->arPairwiseCrypto = NONE_CRYPT;
++ profChanged = TRUE;
++ break;
++ }
++ break;
++ case IEEE80211_PARAM_UCASTKEYLEN:
++ if (!IEEE80211_IS_VALID_WEP_CIPHER_LEN(value)) {
++ ret = -EIO;
++ } else {
++ ar->arPairwiseCryptoLen = value;
++ }
++ break;
++ case IEEE80211_PARAM_MCASTCIPHER:
++ switch (value) {
++ case IEEE80211_CIPHER_AES_CCM:
++ ar->arGroupCrypto = AES_CRYPT;
++ profChanged = TRUE;
++ break;
++ case IEEE80211_CIPHER_TKIP:
++ ar->arGroupCrypto = TKIP_CRYPT;
++ profChanged = TRUE;
++ break;
++ case IEEE80211_CIPHER_WEP:
++ ar->arGroupCrypto = WEP_CRYPT;
++ profChanged = TRUE;
++ break;
++ case IEEE80211_CIPHER_NONE:
++ ar->arGroupCrypto = NONE_CRYPT;
++ profChanged = TRUE;
++ break;
++ }
++ break;
++ case IEEE80211_PARAM_MCASTKEYLEN:
++ if (!IEEE80211_IS_VALID_WEP_CIPHER_LEN(value)) {
++ ret = -EIO;
++ } else {
++ ar->arGroupCryptoLen = value;
++ }
++ break;
++ case IEEE80211_PARAM_COUNTERMEASURES:
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++ wmi_set_tkip_countermeasures_cmd(ar->arWmi, value);
++ break;
++ default:
++ break;
++ }
++
++ if (profChanged == TRUE) {
++ /*
++ * profile has changed. Erase ssid to signal change
++ */
++ A_MEMZERO(ar->arSsid, sizeof(ar->arSsid));
++ ar->arSsidLen = 0;
++ }
++
++ return ret;
++}
++
++int
++ar6000_ioctl_getparam(struct net_device *dev, struct iw_request_info *info,
++ void *w, char *extra)
++{
++ return -EIO; /* for now */
++}
++
++int
++ar6000_ioctl_setkey(struct net_device *dev, struct iw_request_info *info,
++ void *w, char *extra)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ struct ieee80211req_key *ik = (struct ieee80211req_key *)extra;
++ KEY_USAGE keyUsage;
++ A_STATUS status;
++ CRYPTO_TYPE keyType = NONE_CRYPT;
++
++ if (ar->arWlanState == WLAN_DISABLED) {
++ return -EIO;
++ }
++
++ ar->user_saved_keys.keyOk = FALSE;
++
++ if ( 0 == memcmp(ik->ik_macaddr, "\x00\x00\x00\x00\x00\x00",
++ IEEE80211_ADDR_LEN)) {
++ keyUsage = GROUP_USAGE;
++ A_MEMCPY(&ar->user_saved_keys.bcast_ik, ik,
++ sizeof(struct ieee80211req_key));
++ } else {
++ keyUsage = PAIRWISE_USAGE;
++ A_MEMCPY(&ar->user_saved_keys.ucast_ik, ik,
++ sizeof(struct ieee80211req_key));
++ }
++
++ switch (ik->ik_type) {
++ case IEEE80211_CIPHER_WEP:
++ keyType = WEP_CRYPT;
++ break;
++ case IEEE80211_CIPHER_TKIP:
++ keyType = TKIP_CRYPT;
++ break;
++ case IEEE80211_CIPHER_AES_CCM:
++ keyType = AES_CRYPT;
++ break;
++ default:
++ break;
++ }
++ ar->user_saved_keys.keyType = keyType;
++
++ if (IEEE80211_CIPHER_CCKM_KRK != ik->ik_type) {
++ if (NONE_CRYPT == keyType) {
++ return -EIO;
++ }
++
++ status = wmi_addKey_cmd(ar->arWmi, ik->ik_keyix, keyType, keyUsage,
++ ik->ik_keylen, (A_UINT8 *)&ik->ik_keyrsc,
++ ik->ik_keydata, KEY_OP_INIT_VAL,
++ SYNC_BEFORE_WMIFLAG);
++
++ if (status != A_OK) {
++ return -EIO;
++ }
++ } else {
++ status = wmi_add_krk_cmd(ar->arWmi, ik->ik_keydata);
++ }
++
++ ar->user_saved_keys.keyOk = TRUE;
++
++ return 0;
++}
++
++
++/*
++ * SIOCGIWNAME
++ */
++int
++ar6000_ioctl_giwname(struct net_device *dev,
++ struct iw_request_info *info,
++ char *name, char *extra)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++
++ if (ar->arWlanState == WLAN_DISABLED) {
++ return -EIO;
++ }
++
++ switch (ar->arPhyCapability) {
++ case (WMI_11A_CAPABILITY):
++ strncpy(name, "AR6000 802.11a", IFNAMSIZ);
++ break;
++ case (WMI_11G_CAPABILITY):
++ strncpy(name, "AR6000 802.11g", IFNAMSIZ);
++ break;
++ case (WMI_11AG_CAPABILITY):
++ strncpy(name, "AR6000 802.11ag", IFNAMSIZ);
++ break;
++ default:
++ strncpy(name, "AR6000 802.11", IFNAMSIZ);
++ break;
++ }
++
++ return 0;
++}
++
++/*
++ * SIOCSIWFREQ
++ */
++int
++ar6000_ioctl_siwfreq(struct net_device *dev,
++ struct iw_request_info *info,
++ struct iw_freq *freq, char *extra)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++
++ if (ar->arWlanState == WLAN_DISABLED) {
++ return -EIO;
++ }
++
++ /*
++ * We support limiting the channels via wmiconfig.
++ *
++ * We use this command to configure the channel hint for the connect cmd
++ * so it is possible the target will end up connecting to a different
++ * channel.
++ */
++ if (freq->e > 1) {
++ return -EINVAL;
++ } else if (freq->e == 1) {
++ ar->arChannelHint = freq->m / 100000;
++ } else {
++ ar->arChannelHint = wlan_ieee2freq(freq->m);
++ }
++
++ A_PRINTF("channel hint set to %d\n", ar->arChannelHint);
++ return 0;
++}
++
++/*
++ * SIOCGIWFREQ
++ */
++int
++ar6000_ioctl_giwfreq(struct net_device *dev,
++ struct iw_request_info *info,
++ struct iw_freq *freq, char *extra)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++
++ if (ar->arWlanState == WLAN_DISABLED) {
++ return -EIO;
++ }
++
++ if (ar->arConnected != TRUE) {
++ return -EINVAL;
++ }
++
++ freq->m = ar->arBssChannel * 100000;
++ freq->e = 1;
++
++ return 0;
++}
++
++/*
++ * SIOCSIWMODE
++ */
++int
++ar6000_ioctl_siwmode(struct net_device *dev,
++ struct iw_request_info *info,
++ __u32 *mode, char *extra)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++
++ if (ar->arWlanState == WLAN_DISABLED) {
++ return -EIO;
++ }
++
++ switch (*mode) {
++ case IW_MODE_INFRA:
++ ar->arNetworkType = INFRA_NETWORK;
++ break;
++ case IW_MODE_ADHOC:
++ ar->arNetworkType = ADHOC_NETWORK;
++ break;
++ default:
++ return -EINVAL;
++ }
++
++ return 0;
++}
++
++/*
++ * SIOCGIWMODE
++ */
++int
++ar6000_ioctl_giwmode(struct net_device *dev,
++ struct iw_request_info *info,
++ __u32 *mode, char *extra)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++
++ if (ar->arWlanState == WLAN_DISABLED) {
++ return -EIO;
++ }
++
++ switch (ar->arNetworkType) {
++ case INFRA_NETWORK:
++ *mode = IW_MODE_INFRA;
++ break;
++ case ADHOC_NETWORK:
++ *mode = IW_MODE_ADHOC;
++ break;
++ default:
++ return -EIO;
++ }
++ return 0;
++}
++
++/*
++ * SIOCSIWSENS
++ */
++int
++ar6000_ioctl_siwsens(struct net_device *dev,
++ struct iw_request_info *info,
++ struct iw_param *sens, char *extra)
++{
++ return 0;
++}
++
++/*
++ * SIOCGIWSENS
++ */
++int
++ar6000_ioctl_giwsens(struct net_device *dev,
++ struct iw_request_info *info,
++ struct iw_param *sens, char *extra)
++{
++ sens->value = 0;
++ sens->fixed = 1;
++
++ return 0;
++}
++
++/*
++ * SIOCGIWRANGE
++ */
++int
++ar6000_ioctl_giwrange(struct net_device *dev,
++ struct iw_request_info *info,
++ struct iw_point *data, char *extra)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ struct iw_range *range = (struct iw_range *) extra;
++ int i, ret = 0;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++ if (ar->arWlanState == WLAN_DISABLED) {
++ return -EIO;
++ }
++
++ if (down_interruptible(&ar->arSem)) {
++ return -ERESTARTSYS;
++ }
++ ar->arNumChannels = -1;
++ A_MEMZERO(ar->arChannelList, sizeof (ar->arChannelList));
++
++ if (wmi_get_channelList_cmd(ar->arWmi) != A_OK) {
++ up(&ar->arSem);
++ return -EIO;
++ }
++
++ wait_event_interruptible_timeout(arEvent, ar->arNumChannels != -1, wmitimeout * HZ);
++
++ if (signal_pending(current)) {
++ up(&ar->arSem);
++ return -EINTR;
++ }
++
++ data->length = sizeof(struct iw_range);
++ A_MEMZERO(range, sizeof(struct iw_range));
++
++ range->txpower_capa = IW_TXPOW_DBM;
++
++ range->min_pmp = 1 * 1024;
++ range->max_pmp = 65535 * 1024;
++ range->min_pmt = 1 * 1024;
++ range->max_pmt = 1000 * 1024;
++ range->pmp_flags = IW_POWER_PERIOD;
++ range->pmt_flags = IW_POWER_TIMEOUT;
++ range->pm_capa = 0;
++
++ range->we_version_compiled = WIRELESS_EXT;
++ range->we_version_source = 13;
++
++ range->retry_capa = IW_RETRY_LIMIT;
++ range->retry_flags = IW_RETRY_LIMIT;
++ range->min_retry = 0;
++ range->max_retry = 255;
++
++ range->num_frequency = range->num_channels = ar->arNumChannels;
++ for (i = 0; i < ar->arNumChannels; i++) {
++ range->freq[i].i = wlan_freq2ieee(ar->arChannelList[i]);
++ range->freq[i].m = ar->arChannelList[i] * 100000;
++ range->freq[i].e = 1;
++ /*
++ * Linux supports max of 32 channels, bail out once you
++ * reach the max.
++ */
++ if (i == IW_MAX_FREQUENCIES) {
++ break;
++ }
++ }
++
++ /* Max quality is max field value minus noise floor */
++ range->max_qual.qual = 0xff - 161;
++
++ /*
++ * In order to use dBm measurements, 'level' must be lower
++ * than any possible measurement (see iw_print_stats() in
++ * wireless tools). It's unclear how this is meant to be
++ * done, but setting zero in these values forces dBm and
++ * the actual numbers are not used.
++ */
++ range->max_qual.level = 0;
++ range->max_qual.noise = 0;
++
++ range->sensitivity = 3;
++
++ range->max_encoding_tokens = 4;
++ /* XXX query driver to find out supported key sizes */
++ range->num_encoding_sizes = 3;
++ range->encoding_size[0] = 5; /* 40-bit */
++ range->encoding_size[1] = 13; /* 104-bit */
++ range->encoding_size[2] = 16; /* 128-bit */
++
++ range->num_bitrates = 0;
++
++ /* estimated maximum TCP throughput values (bps) */
++ range->throughput = 22000000;
++
++ range->min_rts = 0;
++ range->max_rts = 2347;
++ range->min_frag = 256;
++ range->max_frag = 2346;
++
++ up(&ar->arSem);
++
++ return ret;
++}
++
++
++/*
++ * SIOCSIWAP
++ * This ioctl is used to set the desired bssid for the connect command.
++ */
++int
++ar6000_ioctl_siwap(struct net_device *dev,
++ struct iw_request_info *info,
++ struct sockaddr *ap_addr, char *extra)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++
++ if (ar->arWlanState == WLAN_DISABLED) {
++ return -EIO;
++ }
++
++ if (ap_addr->sa_family != ARPHRD_ETHER) {
++ return -EIO;
++ }
++
++ if (A_MEMCMP(&ap_addr->sa_data, bcast_mac, AR6000_ETH_ADDR_LEN) == 0) {
++ A_MEMZERO(ar->arReqBssid, sizeof(ar->arReqBssid));
++ } else {
++ A_MEMCPY(ar->arReqBssid, &ap_addr->sa_data, sizeof(ar->arReqBssid));
++ }
++
++ return 0;
++}
++
++/*
++ * SIOCGIWAP
++ */
++int
++ar6000_ioctl_giwap(struct net_device *dev,
++ struct iw_request_info *info,
++ struct sockaddr *ap_addr, char *extra)
++{
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++
++ if (ar->arWlanState == WLAN_DISABLED) {
++ return -EIO;
++ }
++
++ if (ar->arConnected != TRUE) {
++ return -EINVAL;
++ }
++
++ A_MEMCPY(&ap_addr->sa_data, ar->arBssid, sizeof(ar->arBssid));
++ ap_addr->sa_family = ARPHRD_ETHER;
++
++ return 0;
++}
++
++/*
++ * SIOCGIWAPLIST
++ */
++int
++ar6000_ioctl_iwaplist(struct net_device *dev,
++ struct iw_request_info *info,
++ struct iw_point *data, char *extra)
++{
++ return -EIO; /* for now */
++}
++
++/*
++ * SIOCSIWSCAN
++ */
++int
++ar6000_ioctl_siwscan(struct net_device *dev,
++ struct iw_request_info *info,
++ struct iw_point *data, char *extra)
++{
++#define ACT_DWELLTIME_DEFAULT 105
++#define HOME_TXDRAIN_TIME 100
++#define SCAN_INT HOME_TXDRAIN_TIME + ACT_DWELLTIME_DEFAULT
++ AR_SOFTC_T *ar = (AR_SOFTC_T *)netdev_priv(dev);
++ int ret = 0;
++
++ if (ar->arWmiReady == FALSE) {
++ return -EIO;
++ }
++
++ if (ar->arWlanState == WLAN_DISABLED) {
++ return -EIO;
++ }
++
++ /* We ask for everything from the target */
++ if (wmi_bssfilter_cmd(ar->arWmi, ALL_BSS_FILTER, 0) != A_OK) {
++ printk("Couldn't set filtering\n");
++ ret = -EIO;
++ }
++
++ if (wmi_startscan_cmd(ar->arWmi, WMI_LONG_SCAN, FALSE, FALSE, \
++ HOME_TXDRAIN_TIME, SCAN_INT) != A_OK) {
++ ret = -EIO;
++ }
++
++ ar->scan_complete = 0;
++ wait_event_interruptible_timeout(ar6000_scan_queue, ar->scan_complete,
++ 5 * HZ);
++
++ if (wmi_bssfilter_cmd(ar->arWmi, NONE_BSS_FILTER, 0) != A_OK) {
++ printk("Couldn't set filtering\n");
++ ret = -EIO;
++ }
++
++ return ret;
++#undef ACT_DWELLTIME_DEFAULT
++#undef HOME_TXDRAIN_TIME
++#undef SCAN_INT
++}
++
++
++/*
++ * Units are in db above the noise floor. That means the
++ * rssi values reported in the tx/rx descriptors in the
++ * driver are the SNR expressed in db.
++ *
++ * If you assume that the noise floor is -95, which is an
++ * excellent assumption 99.5 % of the time, then you can
++ * derive the absolute signal level (i.e. -95 + rssi).
++ * There are some other slight factors to take into account
++ * depending on whether the rssi measurement is from 11b,
++ * 11g, or 11a. These differences are at most 2db and
++ * can be documented.
++ *
++ * NB: various calculations are based on the orinoco/wavelan
++ * drivers for compatibility
++ */
++static void
++ar6000_set_quality(struct iw_quality *iq, A_INT8 rssi)
++{
++ if (rssi < 0) {
++ iq->qual = 0;
++ } else {
++ iq->qual = rssi;
++ }
++
++ /* NB: max is 94 because noise is hardcoded to 161 */
++ if (iq->qual > 94)
++ iq->qual = 94;
++
++ iq->noise = 161; /* -95dBm */
++ iq->level = iq->noise + iq->qual;
++ iq->updated = 7;
++}
++
++
++/* Structures to export the Wireless Handlers */
++static const iw_handler ath_handlers[] = {
++ (iw_handler) NULL, /* SIOCSIWCOMMIT */
++ (iw_handler) ar6000_ioctl_giwname, /* SIOCGIWNAME */
++ (iw_handler) NULL, /* SIOCSIWNWID */
++ (iw_handler) NULL, /* SIOCGIWNWID */
++ (iw_handler) ar6000_ioctl_siwfreq, /* SIOCSIWFREQ */
++ (iw_handler) ar6000_ioctl_giwfreq, /* SIOCGIWFREQ */
++ (iw_handler) ar6000_ioctl_siwmode, /* SIOCSIWMODE */
++ (iw_handler) ar6000_ioctl_giwmode, /* SIOCGIWMODE */
++ (iw_handler) ar6000_ioctl_siwsens, /* SIOCSIWSENS */
++ (iw_handler) ar6000_ioctl_giwsens, /* SIOCGIWSENS */
++ (iw_handler) NULL /* not _used */, /* SIOCSIWRANGE */
++ (iw_handler) ar6000_ioctl_giwrange, /* SIOCGIWRANGE */
++ (iw_handler) NULL /* not used */, /* SIOCSIWPRIV */
++ (iw_handler) NULL /* kernel code */, /* SIOCGIWPRIV */
++ (iw_handler) NULL /* not used */, /* SIOCSIWSTATS */
++ (iw_handler) NULL /* kernel code */, /* SIOCGIWSTATS */
++ (iw_handler) NULL, /* SIOCSIWSPY */
++ (iw_handler) NULL, /* SIOCGIWSPY */
++ (iw_handler) NULL, /* SIOCSIWTHRSPY */
++ (iw_handler) NULL, /* SIOCGIWTHRSPY */
++ (iw_handler) ar6000_ioctl_siwap, /* SIOCSIWAP */
++ (iw_handler) ar6000_ioctl_giwap, /* SIOCGIWAP */
++ (iw_handler) NULL, /* -- hole -- */
++ (iw_handler) ar6000_ioctl_iwaplist, /* SIOCGIWAPLIST */
++ (iw_handler) ar6000_ioctl_siwscan, /* SIOCSIWSCAN */
++ (iw_handler) ar6000_ioctl_giwscan, /* SIOCGIWSCAN */
++ (iw_handler) ar6000_ioctl_siwessid, /* SIOCSIWESSID */
++ (iw_handler) ar6000_ioctl_giwessid, /* SIOCGIWESSID */
++ (iw_handler) NULL, /* SIOCSIWNICKN */
++ (iw_handler) NULL, /* SIOCGIWNICKN */
++ (iw_handler) NULL, /* -- hole -- */
++ (iw_handler) NULL, /* -- hole -- */
++ (iw_handler) ar6000_ioctl_siwrate, /* SIOCSIWRATE */
++ (iw_handler) ar6000_ioctl_giwrate, /* SIOCGIWRATE */
++ (iw_handler) NULL, /* SIOCSIWRTS */
++ (iw_handler) NULL, /* SIOCGIWRTS */
++ (iw_handler) NULL, /* SIOCSIWFRAG */
++ (iw_handler) NULL, /* SIOCGIWFRAG */
++ (iw_handler) ar6000_ioctl_siwtxpow, /* SIOCSIWTXPOW */
++ (iw_handler) ar6000_ioctl_giwtxpow, /* SIOCGIWTXPOW */
++ (iw_handler) ar6000_ioctl_siwretry, /* SIOCSIWRETRY */
++ (iw_handler) ar6000_ioctl_giwretry, /* SIOCGIWRETRY */
++ (iw_handler) ar6000_ioctl_siwencode, /* SIOCSIWENCODE */
++ (iw_handler) ar6000_ioctl_giwencode, /* SIOCGIWENCODE */
++ (iw_handler) ar6000_ioctl_siwpower, /* SIOCSIWPOWER */
++ (iw_handler) ar6000_ioctl_giwpower, /* SIOCGIWPOWER */
++ (iw_handler) NULL, /* -- hole -- */
++ (iw_handler) NULL, /* -- hole -- */
++ (iw_handler) ar6000_ioctl_siwgenie, /* SIOCSIWGENIE */
++ (iw_handler) ar6000_ioctl_giwgenie, /* SIOCGIWGENIE */
++ (iw_handler) ar6000_ioctl_siwauth, /* SIOCSIWAUTH */
++ (iw_handler) ar6000_ioctl_giwauth, /* SIOCGIWAUTH */
++ (iw_handler) ar6000_ioctl_siwencodeext,/* SIOCSIWENCODEEXT */
++ (iw_handler) ar6000_ioctl_giwencodeext,/* SIOCGIWENCODEEXT */
++ (iw_handler) NULL, /* SIOCSIWPMKSA */
++};
++
++static const iw_handler ath_priv_handlers[] = {
++ (iw_handler) ar6000_ioctl_setparam, /* SIOCWFIRSTPRIV+0 */
++ (iw_handler) ar6000_ioctl_getparam, /* SIOCWFIRSTPRIV+1 */
++ (iw_handler) ar6000_ioctl_setkey, /* SIOCWFIRSTPRIV+2 */
++ (iw_handler) ar6000_ioctl_setwmmparams, /* SIOCWFIRSTPRIV+3 */
++ (iw_handler) ar6000_ioctl_delkey, /* SIOCWFIRSTPRIV+4 */
++ (iw_handler) ar6000_ioctl_getwmmparams, /* SIOCWFIRSTPRIV+5 */
++ (iw_handler) ar6000_ioctl_setoptie, /* SIOCWFIRSTPRIV+6 */
++ (iw_handler) ar6000_ioctl_setmlme, /* SIOCWFIRSTPRIV+7 */
++ (iw_handler) ar6000_ioctl_addpmkid, /* SIOCWFIRSTPRIV+8 */
++};
++
++#define IW_PRIV_TYPE_KEY \
++ (IW_PRIV_TYPE_BYTE | sizeof(struct ieee80211req_key))
++#define IW_PRIV_TYPE_DELKEY \
++ (IW_PRIV_TYPE_BYTE | sizeof(struct ieee80211req_del_key))
++#define IW_PRIV_TYPE_MLME \
++ (IW_PRIV_TYPE_BYTE | sizeof(struct ieee80211req_mlme))
++#define IW_PRIV_TYPE_ADDPMKID \
++ (IW_PRIV_TYPE_BYTE | sizeof(struct ieee80211req_addpmkid))
++
++static const struct iw_priv_args ar6000_priv_args[] = {
++ { IEEE80211_IOCTL_SETKEY,
++ IW_PRIV_TYPE_KEY | IW_PRIV_SIZE_FIXED, 0, "setkey"},
++ { IEEE80211_IOCTL_DELKEY,
++ IW_PRIV_TYPE_DELKEY | IW_PRIV_SIZE_FIXED, 0, "delkey"},
++ { IEEE80211_IOCTL_SETPARAM,
++ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 0, "setparam"},
++ { IEEE80211_IOCTL_GETPARAM,
++ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
++ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getparam"},
++ { IEEE80211_IOCTL_SETWMMPARAMS,
++ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 4, 0, "setwmmparams"},
++ { IEEE80211_IOCTL_GETWMMPARAMS,
++ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3,
++ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getwmmparams"},
++ { IEEE80211_IOCTL_SETOPTIE,
++ IW_PRIV_TYPE_BYTE, 0, "setie"},
++ { IEEE80211_IOCTL_SETMLME,
++ IW_PRIV_TYPE_MLME, 0, "setmlme"},
++ { IEEE80211_IOCTL_ADDPMKID,
++ IW_PRIV_TYPE