aboutsummaryrefslogtreecommitdiffstats
path: root/recipes
diff options
context:
space:
mode:
authorMichael 'Mickey' Lauer <mickey@vanille-media.de>2011-06-03 17:27:07 +0200
committerMichael 'Mickey' Lauer <mickey@vanille-media.de>2011-06-03 17:27:07 +0200
commit7ae56b81f8cc22f9ef13a48cde000e32138948ea (patch)
tree661a63084f86cf46f797066db4c018afb31dc164 /recipes
parent449f80f331c643138569917343f690923bc88e0b (diff)
parente61d3d899099af68fa0fafac75a666c9029869ea (diff)
downloadopenembedded-7ae56b81f8cc22f9ef13a48cde000e32138948ea.tar.gz
Merge branch 'org.openembedded.dev' of git@git.openembedded.net:openembedded into org.openembedded.dev
Diffstat (limited to 'recipes')
-rw-r--r--recipes/acpid/acpid-1.0.10/netlink.diff2
-rw-r--r--recipes/alsa/alsa-state/bug20/asound.state882
-rw-r--r--recipes/angstrom/bigbuckbunny-720p.bb2
-rw-r--r--recipes/apr/apr-util_1.3.10.bb3
-rw-r--r--recipes/at91bootstrap/at91bootstrap-3.0/0001-Update-.gitignore.patch2
-rw-r--r--recipes/at91bootstrap/at91bootstrap-3.0/0002-Add-KConfig-support-for-booting-U-Boot.patch2
-rw-r--r--recipes/at91bootstrap/at91bootstrap-3.0/0003-Generate-a-BOOT.BIN-file-instead-of-boot.bin.patch2
-rw-r--r--recipes/at91bootstrap/at91bootstrap-3.0/0004-Add-support-for-dual-boot.patch2
-rw-r--r--recipes/at91bootstrap/at91bootstrap-3.0/0005-Remove-old-afeb9260-files.patch2
-rw-r--r--recipes/at91bootstrap/at91bootstrap-3.0/0006-Use-BOARD-instead-of-BOARDNAME-to-define-directory.patch2
-rw-r--r--recipes/at91bootstrap/at91bootstrap-3.0/0007-Add-board-support-for-alternate-boot.patch2
-rw-r--r--recipes/at91bootstrap/at91bootstrap-3.0/0008-Clean-up-printouts.patch2
-rw-r--r--recipes/at91bootstrap/at91bootstrap-3.0/0009-Update-configs.patch2
-rw-r--r--recipes/at91bootstrap/at91bootstrap-3.0/0010-Update-build-scripts.patch2
-rw-r--r--recipes/at91bootstrap/at91bootstrap-3.0/0011-Fix-Cut-n-Paste-error.patch2
-rw-r--r--recipes/at91bootstrap/at91bootstrap-3.0/0013-Fix-Cut-n-Paste-error-in-Makefile.patch2
-rw-r--r--recipes/at91bootstrap/at91bootstrap-3.0/0014-Add-support-for-alternate-jump-address.patch2
-rw-r--r--recipes/at91bootstrap/at91bootstrap-3.0/0015-Make-MAKENEW-useful.patch2
-rw-r--r--recipes/at91bootstrap/at91bootstrap-3.0/0016-Update-configs.patch2
-rw-r--r--recipes/at91bootstrap/at91bootstrap-3.0/0017-at91bootstrap-fix-build-error-in-openembedded-due-to.patch49
-rw-r--r--recipes/at91bootstrap/at91bootstrap-3.0/0018-Change-switch-statements-to-if-statements-to-avoid-b.patch70
-rw-r--r--recipes/at91bootstrap/at91bootstrap_3.0.bb2
-rw-r--r--recipes/at91bootstrap/at91bootstrap_3.0.inc2
-rw-r--r--recipes/aurora/aurora-version.bb13
-rw-r--r--recipes/avahi/avahi-ui_0.6.25.bb2
-rw-r--r--recipes/avahi/avahi-ui_0.6.30.bb20
-rw-r--r--recipes/avahi/mango-lassi_git.bb16
-rw-r--r--recipes/avrgal/avrgal_1.0.bb20
-rw-r--r--recipes/balsa/balsa_2.4.7.bb6
-rw-r--r--recipes/bluez/bluez-hcidump-2.0/fix-declaration-clash.patch27
-rw-r--r--recipes/bluez/bluez-hcidump_2.0.bb7
-rw-r--r--recipes/boa/boa_0.94.13.bb1
-rw-r--r--recipes/buglabs-apps/bug-app.inc5
-rw-r--r--recipes/buglabs-apps/com.buglabs.app.bugdash2.bb10
-rw-r--r--recipes/buglabs-osgi/bug-osgi.inc14
-rw-r--r--recipes/buglabs-osgi/com.buglabs.bug.jni.motion.bb8
-rw-r--r--recipes/buglabs-osgi/com.buglabs.bug.module.motion.bb3
-rwxr-xr-xrecipes/buglabs/matchbox-theme-bug/session2
-rw-r--r--recipes/busybox/busybox_1.18.4.bb7
-rw-r--r--recipes/busybox/busybox_git.bb7
-rw-r--r--recipes/cacao/cacao-native_hg.bb2
-rw-r--r--recipes/cacao/files/cacao-shutdownguard.patch32
-rw-r--r--recipes/crda/crda_1.1.1.bb11
-rw-r--r--recipes/dri/libdrm-2.4.25/glamo.patch (renamed from recipes/dri/libdrm-2.4.23/glamo.patch)0
-rw-r--r--recipes/dri/libdrm-2.4.25/installtests.patch49
-rw-r--r--recipes/dri/libdrm.inc20
-rw-r--r--recipes/dri/libdrm_2.4.23.bb14
-rw-r--r--recipes/dri/libdrm_2.4.25.bb37
-rw-r--r--recipes/dri/libdrm_git.bb18
-rw-r--r--recipes/dvnixload/dvnixload_0.2.6.bb2
-rw-r--r--recipes/e17/e-wm_svn.bb2
-rw-r--r--recipes/efl1/efreet_svn.bb4
-rw-r--r--recipes/eglibc/eglibc_2.12.bb2
-rw-r--r--recipes/freescale/elftosb/uclibc_and_eglibc_have_no_powf.patch12
-rw-r--r--recipes/freescale/elftosb_10.12.01.bb20
-rw-r--r--recipes/freesmartphone/aurora/aurora-daemon44
-rw-r--r--recipes/freesmartphone/aurora_git.bb46
-rw-r--r--recipes/freesmartphone/cornucopia.inc2
-rw-r--r--recipes/freesmartphone/fso-specs_git.bb4
-rw-r--r--recipes/freesmartphone/fsoaudiod_git.bb7
-rw-r--r--recipes/freesmartphone/fsogsmd_git.bb6
-rw-r--r--recipes/freesmartphone/libfso-glib_git.bb4
-rw-r--r--recipes/freesmartphone/libgisi_git.bb2
-rw-r--r--recipes/freesmartphone/msmcomm.inc2
-rw-r--r--recipes/freesmartphone/qfsodbusxml2cpp-native_git.bb12
-rw-r--r--recipes/gammu/gammu_1.29.0.bb (renamed from recipes/gammu/gammu_1.26.1.bb)17
-rw-r--r--recipes/glib-2.0/glib-2.0_git.bb3
-rw-r--r--recipes/gnome/gnome-bluetooth_2.32.0.bb3
-rw-r--r--recipes/gnome/gnome-desktop.inc5
-rw-r--r--recipes/gnuradio/gnuradio-git/0001-volk-Remove-all-traces-of-volk-from-configure-for-OE.patch42
-rw-r--r--recipes/gnuradio/gnuradio_git.bb9
-rw-r--r--recipes/images/angstrom-systemd-image.bb19
-rw-r--r--recipes/images/aurora-fb-image.bb15
-rw-r--r--recipes/images/aurora-image.inc24
-rw-r--r--recipes/images/console-at91sam9-image.bb13
-rw-r--r--recipes/images/shr-image.inc1
-rw-r--r--recipes/images/x11-at91sam9-image.bb46
-rw-r--r--recipes/images/x11-at91sam9m10-image.bb102
-rw-r--r--recipes/iproute2/iproute2-2.6.38/configure-cross.patch58
-rw-r--r--recipes/iproute2/iproute2_2.6.38.bb20
-rw-r--r--recipes/kexecboot/kexecboot-klibc_git.bb4
-rw-r--r--recipes/kexecboot/kexecboot.inc3
-rw-r--r--recipes/kexecboot/kexecboot_git.bb4
-rw-r--r--recipes/klibc/klcc-cross_1.5.22.bb (renamed from recipes/klibc/klcc-cross_1.5.21.bb)2
-rw-r--r--recipes/klibc/klibc-1.5.22/arm-signal-cleanup.patch (renamed from recipes/klibc/klibc-1.5.21/arm-signal-cleanup.patch)0
-rw-r--r--recipes/klibc/klibc-1.5.22/dash_readopt.patch (renamed from recipes/klibc/klibc-1.5.21/dash_readopt.patch)0
-rw-r--r--recipes/klibc/klibc-1.5.22/fstype-sane-vfat-and-jffs2-for-1.5.patch (renamed from recipes/klibc/klibc-1.5.21/fstype-sane-vfat-and-jffs2-for-1.5.patch)0
-rw-r--r--recipes/klibc/klibc-1.5.22/getrusage.patch (renamed from recipes/klibc/klibc-1.5.21/getrusage.patch)0
-rw-r--r--recipes/klibc/klibc-1.5.22/isystem.patch (renamed from recipes/klibc/klibc-1.5.21/isystem.patch)0
-rw-r--r--recipes/klibc/klibc-1.5.22/klcc_prefix.patch (renamed from recipes/klibc/klibc-1.5.21/klcc_prefix.patch)0
-rw-r--r--recipes/klibc/klibc-1.5.22/klibc-config-eabi.patch (renamed from recipes/klibc/klibc-1.5.21/klibc-config-eabi.patch)0
-rw-r--r--recipes/klibc/klibc-1.5.22/klibc_kexecsyscall.patch (renamed from recipes/klibc/klibc-1.5.21/klibc_kexecsyscall.patch)0
-rw-r--r--recipes/klibc/klibc-1.5.22/mntproc-definitions.patch (renamed from recipes/klibc/klibc-1.5.21/mntproc-definitions.patch)0
-rw-r--r--recipes/klibc/klibc-1.5.22/modprobe.patch (renamed from recipes/klibc/klibc-1.5.21/modprobe.patch)0
-rw-r--r--recipes/klibc/klibc-1.5.22/socket.h.patch (renamed from recipes/klibc/klibc-1.5.21/socket.h.patch)0
-rw-r--r--recipes/klibc/klibc-1.5.22/staging.patch (renamed from recipes/klibc/klibc-1.5.21/staging.patch)0
-rw-r--r--recipes/klibc/klibc-1.5.22/use-env-for-perl.patch (renamed from recipes/klibc/klibc-1.5.21/use-env-for-perl.patch)0
-rw-r--r--recipes/klibc/klibc-1.5.22/wc.patch (renamed from recipes/klibc/klibc-1.5.21/wc.patch)0
-rw-r--r--recipes/klibc/klibc-checksums_1.5.21.inc2
-rw-r--r--recipes/klibc/klibc-checksums_1.5.22.inc2
-rw-r--r--recipes/klibc/klibc-static-utils_1.5.22.bb (renamed from recipes/klibc/klibc-static-utils_1.5.21.bb)0
-rw-r--r--recipes/klibc/klibc_1.5.22.bb (renamed from recipes/klibc/klibc_1.5.21.bb)16
-rw-r--r--recipes/libosip2/libosip2_3.5.0.bb (renamed from recipes/libosip2/libosip2_3.1.0.bb)4
-rw-r--r--recipes/linux/linux-2.6.30/at91/exp.2/linux-2.6.30-001-configurable-partition-size.patch362
-rw-r--r--recipes/linux/linux-2.6.30/at91/exp.2/linux-2.6.30-002-mach-at91-Kconfig.patch196
-rw-r--r--recipes/linux/linux-2.6.30/at91/exp.2/linux-2.6.30-003-sam9m10g45ek.patch29
-rw-r--r--recipes/linux/linux-2.6.30/at91/exp.4/0001-Configurable-partition-size.patch403
-rw-r--r--recipes/linux/linux-2.6.30/at91/exp.4/0002-mach-at91-KConfig-cleanup.patch202
-rw-r--r--recipes/linux/linux-2.6.36/warpcomm/defconfig1700
-rw-r--r--recipes/linux/linux-2.6.37/om-gta01/defconfig1837
-rw-r--r--recipes/linux/linux-2.6.37/om-gta02/defconfig1848
-rw-r--r--recipes/linux/linux-2.6.37/openmoko.patch4
-rw-r--r--recipes/linux/linux-2.6.37/shr.patch1584
-rw-r--r--recipes/linux/linux-2.6.39/akita/defconfig381
-rw-r--r--recipes/linux/linux-2.6.39/c7x0/defconfig378
-rw-r--r--recipes/linux/linux-2.6.39/collie/defconfig324
-rw-r--r--recipes/linux/linux-2.6.39/om-gta01/defconfig481
-rw-r--r--recipes/linux/linux-2.6.39/om-gta02/defconfig490
-rw-r--r--recipes/linux/linux-2.6.39/openmoko.patch46285
-rw-r--r--recipes/linux/linux-2.6.39/poodle/defconfig380
-rw-r--r--recipes/linux/linux-2.6.39/shr.patch2021
-rw-r--r--recipes/linux/linux-2.6.39/spitz/defconfig381
-rw-r--r--recipes/linux/linux-2.6.39/tosa/defconfig381
-rw-r--r--recipes/linux/linux-bug20-linaro_2.6.35.bb4
-rw-r--r--recipes/linux/linux-imx-git/mx28evk/defconfig2132
-rw-r--r--recipes/linux/linux-imx_git.bb53
-rw-r--r--recipes/linux/linux-kexecboot-2.6.39/akita/defconfig133
-rw-r--r--recipes/linux/linux-kexecboot-2.6.39/c7x0/defconfig135
-rw-r--r--recipes/linux/linux-kexecboot-2.6.39/collie/defconfig145
-rw-r--r--recipes/linux/linux-kexecboot-2.6.39/poodle/defconfig137
-rw-r--r--recipes/linux/linux-kexecboot-2.6.39/spitz/defconfig133
-rw-r--r--recipes/linux/linux-kexecboot-2.6.39/tosa/defconfig135
-rw-r--r--recipes/linux/linux-kexecboot/akita/defconfig2
-rw-r--r--recipes/linux/linux-kexecboot/c7x0/defconfig2
-rw-r--r--recipes/linux/linux-kexecboot/collie/defconfig2
-rw-r--r--recipes/linux/linux-kexecboot/poodle/defconfig2
-rw-r--r--recipes/linux/linux-kexecboot/spitz/defconfig2
-rw-r--r--recipes/linux/linux-kexecboot/tosa/defconfig2
-rw-r--r--recipes/linux/linux-kexecboot_2.6.39.bb21
-rw-r--r--recipes/linux/linux-nokia900-meego/defconfig2288
-rw-r--r--recipes/linux/linux-omap-2.6.39/beagle/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch117
-rw-r--r--recipes/linux/linux-omap-2.6.39/beagle/0002-OMAP3-beagle-add-support-for-expansionboards.patch359
-rw-r--r--recipes/linux/linux-omap-2.6.39/beagle/0003-OMAP3-beagle-add-MADC-support.patch36
-rw-r--r--recipes/linux/linux-omap-2.6.39/beagle/0004-OMAP3-beagle-add-regulators-for-camera-interface.patch88
-rw-r--r--recipes/linux/linux-omap-2.6.39/beagle/0005-OMAP3-beagle-HACK-add-in-1GHz-OPP.patch31
-rw-r--r--recipes/linux/linux-omap-2.6.39/beagleboard/configs/stock3490
-rw-r--r--recipes/linux/linux-omap-2.6.39/beagleboard/defconfig3516
-rw-r--r--recipes/linux/linux-omap-2.6.39/camera/0001-Add-support-for-mt9p031-Aptina-Micron-sensor.patch773
-rw-r--r--recipes/linux/linux-omap-2.6.39/camera/0002-v4l-Add-mt9v032-sensor-driver.patch853
-rw-r--r--recipes/linux/linux-omap-2.6.39/camera/0003-Add-support-for-mt9p031-LI-5M03-module-in-Beagleboar.patch158
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0001-OMAP2-cpufreq-free-up-table-on-exit.patch38
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0002-OMAP2-cpufreq-handle-invalid-cpufreq-table.patch44
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0003-OMAP2-cpufreq-minor-comment-cleanup.patch33
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0004-OMAP2-cpufreq-use-clk_init_cpufreq_table-if-OPPs-not.patch48
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0005-OMAP2-cpufreq-use-cpufreq_frequency_table_target.patch78
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0006-OMAP2-cpufreq-fix-freq_table-leak.patch100
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-hotplug/0001-cpufreq-helpers-for-walking-the-frequency-table.patch134
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-hotplug/0002-cpufreq-introduce-hotplug-governor.patch879
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0001-OMAP-CPUfreq-ensure-driver-initializes-after-cpufreq.patch27
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0002-OMAP-CPUfreq-ensure-policy-is-fully-initialized.patch31
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0003-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch263
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0004-OMAP-PM-CPUFREQ-Fix-conditional-compilation.patch32
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0005-cpufreq-fixup-after-new-OPP-layer-merged.patch33
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0006-OMAP-cpufreq-Split-OMAP1-and-OMAP2PLUS-CPUfreq-drive.patch669
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0007-OMAP2PLUS-cpufreq-Add-SMP-support-to-cater-OMAP4430.patch170
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0008-OMAP2PLUS-cpufreq-Fix-typo-when-attempting-to-set-mp.patch29
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0001-OMAP2-clockdomain-Add-an-api-to-read-idle-mode.patch77
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0002-OMAP2-clockdomain-Add-SoC-support-for-clkdm_is_idle.patch86
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0003-OMAP2-PM-Initialise-sleep_switch-to-a-non-valid-valu.patch35
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0004-OMAP2-PM-idle-clkdms-only-if-already-in-idle.patch50
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0005-OMAP2-hwmod-Follow-the-recomended-PRCM-sequence.patch46
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0006-OMAP-Serial-Check-wk_st-only-if-present.patch33
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0001-OMAP3-voltage-remove-spurious-pr_notice-for-debugfs.patch30
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0002-OMAP4-PM-remove-redundant-ifdef-CONFIG_PM.patch41
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0003-OMAP3-smartreflex-fix-sr_late_init-error-path-in-pro.patch30
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0004-OMAP3-smartreflex-request-the-memory-region.patch36
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0005-OMAP3-smartreflex-fix-ioremap-leak-on-probe-error.patch66
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0006-OMAP3-smartreflex-delete-instance-from-sr_list-on-pr.patch29
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0007-OMAP3-smartreflex-delete-debugfs-entries-on-probe-er.patch48
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0008-OMAP3-cpuidle-remove-useless-SDP-specific-timings.patch57
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0009-OMAP3-SR-make-notify-independent-of-class.patch48
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0010-OMAP3-SR-disable-interrupt-by-default.patch37
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0011-OMAP3-SR-enable-disable-SR-only-on-need.patch41
-rw-r--r--recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0012-OMAP3-SR-fix-cosmetic-indentation.patch49
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0001-OMAP-DSS2-DSI-fix-use_sys_clk-highfreq.patch33
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0002-OMAP-DSS2-DSI-fix-dsi_dump_clocks.patch49
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0003-OMAP2PLUS-DSS2-Fix-Return-correct-lcd-clock-source-f.patch43
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0004-OMAP-DSS-DSI-Fix-DSI-PLL-power-bug.patch64
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0005-OMAP-DSS2-fix-panel-Kconfig-dependencies.patch61
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0006-OMAP-DSS2-add-bootarg-for-selecting-svideo-or-compos.patch75
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0007-video-add-timings-for-hd720.patch27
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0008-drivers-net-smsc911x-return-ENODEV-if-device-is-not-.patch29
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0009-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch47
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0010-Revert-omap2_mcspi-Flush-posted-writes.patch25
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0011-Revert-omap_hsmmc-improve-interrupt-synchronisation.patch482
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0012-Don-t-turn-SDIO-cards-off-to-save-power.-Doing-so-wi.patch51
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0013-Enable-the-use-of-SDIO-card-interrupts.patch288
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0014-soc-codecs-Enable-audio-capture-by-default-for-twl40.patch27
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0015-soc-codecs-twl4030-Turn-on-mic-bias-by-default.patch25
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0016-RTC-add-support-for-backup-battery-recharge.patch55
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0017-ARM-OMAP2-mmc-twl4030-move-clock-input-selection-pri.patch39
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0018-Add-power-off-support-for-the-TWL4030-companion.patch103
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0019-ARM-OMAP-Add-twl4030-madc-support-to-Overo.patch33
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0020-Enabling-Hwmon-driver-for-twl4030-madc.patch46
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0021-mfd-twl-core-enable-madc-clock.patch54
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0022-rtc-twl-Switch-to-using-threaded-irq.patch25
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0023-ARM-OMAP-automatically-set-musb-mode-in-platform-dat.patch49
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0024-omap-mmc-Adjust-dto-to-eliminate-timeout-errors.patch28
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0025-omap-Fix-mtd-subpage-read-alignment.patch95
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0026-mtd-nand-omap2-Force-all-buffer-reads-to-u32-alignme.patch35
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0027-omap-nand-fix-subpage-ecc-issue-with-prefetch.patch63
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0028-OMAP-Overo-Add-support-for-spidev.patch46
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0029-unionfs-Add-support-for-unionfs-2.5.9.patch11494
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0030-omap-Change-omap_device-activate-latency-messages-fr.patch34
-rw-r--r--recipes/linux/linux-omap-2.6.39/sakoman/0031-omap-overo-Add-opp-init.patch105
-rw-r--r--recipes/linux/linux-omap-hah_2.6.31.bb4
-rw-r--r--recipes/linux/linux-omap-psp-2.6.32/0003-Makefile-change-to-revert-am3517-evm-support-and-to-.patch36
-rw-r--r--recipes/linux/linux-omap-psp_2.6.32.bb1
-rw-r--r--recipes/linux/linux-omap_2.6.39.bb104
-rw-r--r--recipes/linux/linux-openmoko.inc4
-rw-r--r--recipes/linux/linux-openmoko_2.6.34.bb2
-rw-r--r--recipes/linux/linux-openmoko_2.6.37.bb2
-rw-r--r--recipes/linux/linux-openmoko_2.6.39.bb3
-rw-r--r--recipes/linux/linux.inc6
-rw-r--r--recipes/linux/linux/akita/defconfig20
-rw-r--r--recipes/linux/linux/c7x0/defconfig20
-rw-r--r--recipes/linux/linux/collie/defconfig18
-rw-r--r--recipes/linux/linux/poodle/defconfig20
-rw-r--r--recipes/linux/linux/spitz/defconfig20
-rw-r--r--recipes/linux/linux/tosa/defconfig20
-rw-r--r--recipes/linux/linux_2.6.30.bb55
-rw-r--r--recipes/linux/linux_2.6.36.bb7
-rw-r--r--recipes/linux/linux_2.6.37.bb12
-rw-r--r--recipes/linux/linux_2.6.38.bb8
-rw-r--r--recipes/linux/linux_2.6.39.bb34
-rw-r--r--recipes/llvm/llvm2.7/include-fixes.patch55
-rw-r--r--recipes/llvm/llvm2.7_2.7.bb3
-rw-r--r--recipes/lm_sensors/lmsensors-apps_3.2.0.bb14
-rw-r--r--recipes/lmbench/lmbench-3.0-a9/obey-ranlib.patch25
-rw-r--r--recipes/lmbench/lmbench_3.0-a9.bb7
-rw-r--r--recipes/lttng/userspace-rcu_0.5.4.bb3
-rw-r--r--recipes/lttng/ust_0.12.bb4
-rw-r--r--recipes/lynx/files/locale-charset.patch13
-rw-r--r--recipes/lynx/lynx_2.8.7.bb43
-rw-r--r--recipes/manufacturers/manufacturers_20031209.bb3
-rw-r--r--recipes/mozilla/firefox_3.6.8.bb4
-rw-r--r--recipes/mtkbabel/files/fast-logging.patch45
-rw-r--r--recipes/mtkbabel/mtkbabel_0.8.2.bb (renamed from recipes/mtkbabel/mtkbabel_0.8.bb)9
-rw-r--r--recipes/mumpot/mumpot_0.6.bb (renamed from recipes/mumpot/mumpot_0.4.bb)6
-rw-r--r--recipes/mypaint/files/scons-adapt.patch50
-rw-r--r--recipes/mypaint/mypaint_0.9.1.bb37
-rw-r--r--recipes/navit/navit_svn.bb4
-rw-r--r--recipes/netbase/netbase/bug20/interfaces17
-rw-r--r--recipes/networkmanager/networkmanager/0002-respect-libnl-flags-also-in-dns-manager-vpn-manager-.patch72
-rw-r--r--recipes/networkmanager/networkmanager/0002-respect-libnl-flags-also-in-dns-manager.patch32
-rw-r--r--recipes/networkmanager/networkmanager_git.bb2
-rw-r--r--recipes/nodejs/nodejs_0.4.2.bb2
-rw-r--r--recipes/ntp/ntp_4.2.6p3.bb6
-rw-r--r--recipes/opencv/opencv-dsp-acceleration_svn.bb1
-rw-r--r--recipes/openssh/openssh-5.2p1/aurora/sshd_config119
-rw-r--r--recipes/openssh/openssh_5.2p1.bb2
-rw-r--r--recipes/openssl/openssl.inc5
-rw-r--r--recipes/opkg-utils/opkg-utils/arfile_header_split.patch17
-rw-r--r--recipes/opkg-utils/opkg-utils_svn.bb3
-rw-r--r--recipes/ortp/ortp_0.13.1.bb5
-rw-r--r--recipes/ortp/ortp_0.16.5.bb5
-rw-r--r--recipes/owl-wifi/files/0001-owl-wifi-include-linux-semaphore.h.patch25
-rw-r--r--recipes/owl-wifi/files/0002-owl-wifi-Add-include-file-for-kmalloc-kfree.patch25
-rw-r--r--recipes/owl-wifi/files/0003-owl-wifi-include-sched.h.patch24
-rw-r--r--recipes/owl-wifi/owl-wifi_1.0.4.bb9
-rw-r--r--recipes/perl/files/ubuntu-11.04-multiarch.patch12
-rw-r--r--recipes/perl/perl-native_5.10.1.bb6
-rw-r--r--recipes/pkgconfig/pkgconfig-0.23.inc14
-rw-r--r--recipes/pkgconfig/pkgconfig-native_0.23.bb6
-rw-r--r--recipes/pkgconfig/pkgconfig-sdk_0.23.bb6
-rw-r--r--recipes/pkgconfig/pkgconfig.inc11
-rw-r--r--recipes/pkgconfig/pkgconfig_0.23.bb7
-rw-r--r--recipes/powervr-drivers/libgles-omap3.inc3
-rw-r--r--recipes/proxy-libintl/proxy-libintl_20080418.bb5
-rw-r--r--recipes/pulseaudio/files/ubacktrace.patch13
-rw-r--r--recipes/pulseaudio/pulseaudio.inc4
-rw-r--r--recipes/pulseaudio/pulseaudio_0.9.22.bb3
-rw-r--r--recipes/pyside/libshiboken_1.0.2.bb20
-rw-r--r--recipes/pyside/python-pyside-embedded/support-qws.patch15
-rw-r--r--recipes/pyside/python-pyside-embedded_1.0.2.bb3
-rw-r--r--recipes/pyside/python-pyside.inc6
-rw-r--r--recipes/pyside/shiboken.inc4
-rw-r--r--recipes/python/python-2.6.6/pkgconfig-support.patch94
-rw-r--r--recipes/python/python-numpy_1.1.1.bb2
-rw-r--r--recipes/python/python-pyqt-4.8.4/assistantclient-fix.patch (renamed from recipes/python/python-pyqt-4.8.3/assistantclient-fix.patch)0
-rw-r--r--recipes/python/python-pyqt-4.8.4/debian_configure_changes.diff (renamed from recipes/python/python-pyqt-4.8.3/debian_configure_changes.diff)0
-rw-r--r--recipes/python/python-pyqt-4.8.4/fix_qthelp_ftbfs.diff (renamed from recipes/python/python-pyqt-4.8.3/fix_qthelp_ftbfs.diff)0
-rw-r--r--recipes/python/python-pyqt-4.8.4/fix_the_QAssitant_ftbfs.diff (renamed from recipes/python/python-pyqt-4.8.3/fix_the_QAssitant_ftbfs.diff)0
-rw-r--r--recipes/python/python-pyqt-4.8.4/fix_uiparser_buttonbox.diff (renamed from recipes/python/python-pyqt-4.8.3/fix_uiparser_buttonbox.diff)0
-rw-r--r--recipes/python/python-pyqt-4.8.4/qreal_float_support.diff (renamed from recipes/python/python-pyqt-4.8.3/qreal_float_support.diff)0
-rw-r--r--recipes/python/python-pyqt_4.8.4.bb (renamed from recipes/python/python-pyqt_4.8.3.bb)7
-rw-r--r--recipes/python/python-sip_4.12.1.bb7
-rw-r--r--recipes/python/python-sip_4.12.2.bb8
-rw-r--r--recipes/python/python_2.6.6.bb3
-rw-r--r--recipes/qt4/files/palmpre/qte.sh7
-rw-r--r--recipes/qt4/qt-4.6.3.inc8
-rw-r--r--recipes/qt4/qt-4.7.3.inc (renamed from recipes/qt4/qt-4.7.2.inc)26
-rw-r--r--recipes/qt4/qt-4.7.3/0001-Added-Openembedded-crossarch-option.patch (renamed from recipes/qt4/qt-4.7.2/0001-Added-Openembedded-crossarch-option.patch)0
-rw-r--r--recipes/qt4/qt-4.7.3/0001-wsegl2-support.patch997
-rw-r--r--recipes/qt4/qt-4.7.3/0010-phonon-gstreamer-rgb-endianess.patch (renamed from recipes/qt4/qt-4.7.2/0010-phonon-gstreamer-rgb-endianess.patch)0
-rw-r--r--recipes/qt4/qt-4.7.3/fix-translations.patch22
-rw-r--r--recipes/qt4/qt-4.7.3/g++.conf (renamed from recipes/qt4/qt-4.7.2/g++.conf)0
-rw-r--r--recipes/qt4/qt-4.7.3/hack-out-pg2-4.7.0.patch (renamed from recipes/qt4/qt-4.7.2/hack-out-pg2-4.7.0.patch)0
-rw-r--r--recipes/qt4/qt-4.7.3/linux.conf (renamed from recipes/qt4/qt-4.7.2/linux.conf)0
-rw-r--r--recipes/qt4/qt4-embedded-gles_4.7.3.bb (renamed from recipes/qt4/qt4-embedded-gles_4.7.2.bb)0
-rw-r--r--recipes/qt4/qt4-embedded.inc2
-rw-r--r--recipes/qt4/qt4-embedded_4.6.3.bb4
-rw-r--r--recipes/qt4/qt4-embedded_4.7.3.bb (renamed from recipes/qt4/qt4-embedded_4.7.2.bb)4
-rw-r--r--recipes/qt4/qt4-native.inc18
-rw-r--r--recipes/qt4/qt4-native_4.7.3.bb (renamed from recipes/qt4/qt4-native_4.7.2.bb)4
-rw-r--r--recipes/qt4/qt4-tools-sdk_4.7.2.bb8
-rw-r--r--recipes/qt4/qt4-tools-sdk_4.7.3.bb8
-rw-r--r--recipes/qt4/qt4-x11-free-gles_4.7.3.bb (renamed from recipes/qt4/qt4-x11-free-gles_4.7.2.bb)0
-rw-r--r--recipes/qt4/qt4-x11-free.inc2
-rw-r--r--recipes/qt4/qt4-x11-free_4.7.3.bb (renamed from recipes/qt4/qt4-x11-free_4.7.2.bb)0
-rw-r--r--recipes/qt4/qt4.inc13
-rw-r--r--recipes/qte/qte-2.3.10/support_18bpp.patch275
-rw-r--r--recipes/qte/qte-common_2.3.10.inc3
-rw-r--r--recipes/qte/qte-mt_2.3.10.bb2
-rw-r--r--recipes/qte/qte_2.3.10.bb2
-rw-r--r--recipes/sdr/dttsp_svn.bb2
-rw-r--r--recipes/sdr/sdrshell-qt4_svn.bb5
-rw-r--r--recipes/sflphone/sflphone-common/fix-Makefile.patch274
-rw-r--r--recipes/sflphone/sflphone-common_0.9.13.bb (renamed from recipes/sflphone/sflphone-common_0.9.12.bb)19
-rw-r--r--recipes/sflphone/sflphone-pjproject/fix-Makefile.patch42
-rw-r--r--recipes/sflphone/sflphone-pjproject_0.9.12.bb21
-rw-r--r--recipes/sip/sip-native_4.12.2.bb (renamed from recipes/sip/sip-native_4.12.1.bb)4
-rw-r--r--recipes/systemd/systemd-v26/0002-systemd-analyze-print-hostname-kernelversion-and-arc.patch36
-rw-r--r--recipes/systemd/systemd-v26/0003-Angstrom-support.patch165
-rw-r--r--recipes/systemd/systemd-v26/systemadm.patch13
-rw-r--r--recipes/systemd/systemd/0001-systemd-disable-xml-file-stuff-and-introspection.patch (renamed from recipes/systemd/systemd-v26/0001-systemd-disable-xml-file-stuff-and-introspection.patch)0
-rw-r--r--recipes/systemd/systemd/execute.patch (renamed from recipes/systemd/systemd-v26/execute.patch)0
-rw-r--r--recipes/systemd/systemd/serial-getty@.service (renamed from recipes/systemd/systemd-v26/serial-getty@.service)0
-rw-r--r--recipes/systemd/systemd_git.bb19
-rw-r--r--recipes/sysvinit/sysvinit-2.86/100_fix_ftbfs_enoioctlcmd.patch16
-rw-r--r--recipes/sysvinit/sysvinit_2.86.bb3
-rw-r--r--recipes/tasks/task-base.bb7
-rw-r--r--recipes/tasks/task-bug-feed-extra.bb3
-rw-r--r--recipes/tasks/task-bug.bb8
-rw-r--r--recipes/tasks/task-sdk-gnuradio-native.bb6
-rw-r--r--recipes/tasks/task-shr-feed.bb1
-rw-r--r--recipes/tasks/task-x11.bb2
-rw-r--r--recipes/ti/matrix-gui-common_1.4.bb4
-rw-r--r--recipes/ti/matrix-gui-e_1.3.bb4
-rw-r--r--recipes/ti/matrix-gui_1.3.bb4
-rw-r--r--recipes/ti/ti-wifi-utils_git.bb4
-rw-r--r--recipes/u-boot/u-boot-2009.11/at91/0001-Add-environment-size.patch26
-rw-r--r--recipes/u-boot/u-boot-2009.11/at91/0016-SupportEnv-load-from-SD-Card.patch126
-rw-r--r--recipes/u-boot/u-boot-2009.11/at91/0017-SD-Card-boot-patch-for-SAM9M10-G45.patch151
-rw-r--r--recipes/u-boot/u-boot-2009.11/at91/0018-ADD-AT91-Build-script.patch45
-rw-r--r--recipes/u-boot/u-boot-git/am3517-crane/0004-Ethernet-MACID-display-fix-for-am3517-craneboard.patch108
-rw-r--r--recipes/u-boot/u-boot_2009.11.bb22
-rw-r--r--recipes/u-boot/u-boot_git.bb27
-rw-r--r--recipes/u-boot/u-boot_r2.inc90
-rw-r--r--recipes/uclibc/uclibc-git/fts-support.patch1375
-rw-r--r--recipes/uclibc/uclibc-git/orign_path.patch178
-rw-r--r--recipes/uclibc/uclibc-git/rtld_no.patch210
-rw-r--r--recipes/uclibc/uclibc-git/uClibc.distro1
-rw-r--r--recipes/uclibc/uclibc_git.bb13
-rw-r--r--recipes/udev-rules-buglabs/bug-udev/00-bug20.rules7
-rw-r--r--recipes/udev-rules-buglabs/bug-udev/wlan-trigger.sh7
-rw-r--r--recipes/udev-rules-buglabs/bug-udev_0.1.bb9
-rw-r--r--recipes/udev/udev/0001-rip-put-doc-generation-it-depends-on-a-working-docto.patch45
-rw-r--r--recipes/udev/udev/gtk-doc.make230
-rw-r--r--recipes/udev/udev_165.bb4
-rw-r--r--recipes/udev/udev_171.bb125
-rw-r--r--recipes/udev/udev_git.bb126
-rw-r--r--recipes/uhd/uhd-firmware_003.000.001.bb7
-rw-r--r--recipes/uhd/uhd-firmware_003.001.000.bb7
-rw-r--r--recipes/uhd/uhd_git.bb4
-rw-r--r--recipes/v4l2apps/media-ctl_git.bb16
-rw-r--r--recipes/v4l2apps/yavta_git.bb16
-rw-r--r--recipes/vsftpd/vsftpd_2.0.5.bb4
-rw-r--r--recipes/watchdog/watchdog_5.2.6.bb13
-rw-r--r--recipes/wordwarvi/wordwarvi_0.26.bb4
-rw-r--r--recipes/x-load/x-load_git.bb4
-rw-r--r--recipes/xerces-c/xerces-c_3.1.1.bb32
-rw-r--r--recipes/xinput-calibrator/pointercal-xinput/bug20/pointercal.xinput1
-rw-r--r--recipes/xinput-calibrator/pointercal-xinput_0.0.bb8
-rw-r--r--recipes/xinput-calibrator/xinput-calibrator-0.5.0/xinput-calibrator.desktop11
-rw-r--r--recipes/xinput-calibrator/xinput-calibrator-0.5.0/xinput_calibrator_once.sh11
-rw-r--r--recipes/xinput-calibrator/xinput-calibrator-0.6.0/0001-calibratorXorgPrint.cpp-fix-miny-and-maxx-printing-o.patch36
-rw-r--r--recipes/xinput-calibrator/xinput-calibrator.inc8
-rw-r--r--recipes/xinput-calibrator/xinput-calibrator_0.5.0.bb19
-rw-r--r--recipes/xinput-calibrator/xinput-calibrator_0.6.0.bb18
-rw-r--r--recipes/xinput-calibrator/xinput-calibrator_0.6.1.bb16
-rw-r--r--recipes/xinput-calibrator/xinput-calibrator_0.7.5.bb22
-rw-r--r--recipes/xinput-calibrator/xinput-calibrator_git.bb20
-rw-r--r--recipes/xorg-app/xlsclients_1.1.1.bb7
-rw-r--r--recipes/xorg-app/xlsclients_1.1.2.bb7
-rw-r--r--recipes/xorg-driver/xf86-video-intel_2.15.0.bb (renamed from recipes/xorg-driver/xf86-video-intel_2.14.902.bb)4
-rw-r--r--recipes/xorg-driver/xf86-video-omapfb_git.bb4
-rw-r--r--recipes/xorg-driver/xorg-driver-common.inc2
-rw-r--r--recipes/xorg-lib/libxaw_1.0.9.bb5
-rw-r--r--recipes/xorg-lib/libxext-1.2.0/xgeExtRegister.hidden.patch44
-rw-r--r--recipes/xorg-lib/libxext_1.2.0.bb14
-rw-r--r--recipes/xorg-lib/libxext_1.3.0.bb12
-rw-r--r--recipes/xorg-proto/dri2proto-2.4/f3c211e1ae183dab5c7529814c9f42af2c29fc6c.patch32
-rw-r--r--recipes/xorg-proto/dri2proto_2.3.bb6
-rw-r--r--recipes/xorg-proto/dri2proto_2.4.bb8
-rw-r--r--recipes/xorg-proto/glproto-1.4.13/7196c9441af941be74180f8e8d4e10a08659b80f.patch32
-rw-r--r--recipes/xorg-proto/glproto_1.4.12.bb6
-rw-r--r--recipes/xorg-proto/glproto_1.4.13.bb8
-rw-r--r--recipes/xorg-xserver/xserver-xorg-1.10.2/50b9d3142ff90af2f7fa35b7b1bf9e5a07723dbd.patch61
-rw-r--r--recipes/xorg-xserver/xserver-xorg-1.10.2/hack-assume-pixman-supports-overlapped-blt.patch (renamed from recipes/xorg-xserver/xserver-xorg-1.10.0.902/hack-assume-pixman-supports-overlapped-blt.patch)0
-rw-r--r--recipes/xorg-xserver/xserver-xorg-1.10.2/hack-fbdev-ignore-return-mode.patch (renamed from recipes/xorg-xserver/xserver-xorg-1.10.0.902/hack-fbdev-ignore-return-mode.patch)0
-rw-r--r--recipes/xorg-xserver/xserver-xorg-1.10.2/randr-support.patch102
-rw-r--r--recipes/xorg-xserver/xserver-xorg-conf/om-gta01/xorg.conf3
-rw-r--r--recipes/xorg-xserver/xserver-xorg-conf/om-gta02/xorg.conf3
-rw-r--r--recipes/xorg-xserver/xserver-xorg-conf_0.1.bb2
-rw-r--r--recipes/xorg-xserver/xserver-xorg_1.10.2.bb (renamed from recipes/xorg-xserver/xserver-xorg_1.10.0.902.bb)7
-rw-r--r--recipes/xserver-common/files/Xserver.htcdream.patch14
-rw-r--r--recipes/xserver-common/files/gplv2-license.patch353
-rw-r--r--recipes/xserver-common/xserver-common_1.34.bb46
419 files changed, 92012 insertions, 8861 deletions
diff --git a/recipes/acpid/acpid-1.0.10/netlink.diff b/recipes/acpid/acpid-1.0.10/netlink.diff
index 635c550853..ebdec58188 100644
--- a/recipes/acpid/acpid-1.0.10/netlink.diff
+++ b/recipes/acpid/acpid-1.0.10/netlink.diff
@@ -2019,7 +2019,7 @@ diff -ruN acpid-1.0.10/libnetlink.c acpid-1.0.10-netlink2/libnetlink.c
+
+int addraw_l(struct nlmsghdr *n, int maxlen, const void *data, int len)
+{
-+ if ((int)NLMSG_ALIGN(n->nlmsg_len) + NLMSG_ALIGN(len) > maxlen) {
++ if ((int)NLMSG_ALIGN(n->nlmsg_len) + (int)NLMSG_ALIGN(len) > maxlen) {
+ fprintf(stderr, "addraw_l ERROR: message exceeded bound of %d\n",maxlen);
+ return -1;
+ }
diff --git a/recipes/alsa/alsa-state/bug20/asound.state b/recipes/alsa/alsa-state/bug20/asound.state
index 84fd24df1f..234dae3de2 100644
--- a/recipes/alsa/alsa-state/bug20/asound.state
+++ b/recipes/alsa/alsa-state/bug20/asound.state
@@ -1,646 +1,836 @@
state.omap3bug {
control.1 {
- comment.access 'read write'
- comment.type ENUMERATED
- comment.count 1
- comment.item.0 'Option 2 (voice/audio)'
- comment.item.1 'Option 1 (audio)'
iface MIXER
name 'Codec Operation Mode'
value 'Option 1 (audio)'
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 'Option 2 (voice/audio)'
+ item.1 'Option 1 (audio)'
+ }
}
control.2 {
- comment.access 'read write'
- comment.type INTEGER
- comment.count 2
- comment.range '0 - 63'
- comment.dbmin -6300
- comment.dbmax 0
iface MIXER
name 'DAC1 Digital Fine Playback Volume'
value.0 0
value.1 0
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 63'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -9999999
+ dbvalue.1 -9999999
+ }
}
control.3 {
- comment.access 'read write'
- comment.type INTEGER
- comment.count 2
- comment.range '0 - 63'
- comment.dbmin -6300
- comment.dbmax 0
iface MIXER
name 'DAC2 Digital Fine Playback Volume'
value.0 44
value.1 44
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 63'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -1900
+ dbvalue.1 -1900
+ }
}
control.4 {
- comment.access 'read write'
- comment.type INTEGER
- comment.count 2
- comment.range '0 - 2'
- comment.dbmin 0
- comment.dbmax 1200
iface MIXER
name 'DAC1 Digital Coarse Playback Volume'
value.0 0
value.1 0
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 2'
+ dbmin 0
+ dbmax 1200
+ dbvalue.0 0
+ dbvalue.1 0
+ }
}
control.5 {
- comment.access 'read write'
- comment.type INTEGER
- comment.count 2
- comment.range '0 - 2'
- comment.dbmin 0
- comment.dbmax 1200
iface MIXER
name 'DAC2 Digital Coarse Playback Volume'
value.0 1
value.1 1
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 2'
+ dbmin 0
+ dbmax 1200
+ dbvalue.0 600
+ dbvalue.1 600
+ }
}
control.6 {
- comment.access 'read write'
- comment.type INTEGER
- comment.count 2
- comment.range '0 - 18'
- comment.dbmin -2400
- comment.dbmax 1200
iface MIXER
name 'DAC1 Analog Playback Volume'
value.0 18
value.1 18
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 18'
+ dbmin -2400
+ dbmax 1200
+ dbvalue.0 1200
+ dbvalue.1 1200
+ }
}
control.7 {
- comment.access 'read write'
- comment.type INTEGER
- comment.count 2
- comment.range '0 - 18'
- comment.dbmin -2400
- comment.dbmax 1200
iface MIXER
name 'DAC2 Analog Playback Volume'
value.0 9
value.1 9
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 18'
+ dbmin -2400
+ dbmax 1200
+ dbvalue.0 -600
+ dbvalue.1 -600
+ }
}
control.8 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 2
iface MIXER
name 'DAC1 Analog Playback Switch'
value.0 false
value.1 false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 2
+ }
}
control.9 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 2
iface MIXER
name 'DAC2 Analog Playback Switch'
value.0 true
value.1 true
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 2
+ }
}
control.10 {
- comment.access 'read write'
- comment.type INTEGER
- comment.count 1
- comment.range '0 - 49'
- comment.dbmin -3700
- comment.dbmax 1200
iface MIXER
name 'DAC Voice Digital Downlink Volume'
value 0
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 49'
+ dbmin -9999999
+ dbmax 1200
+ dbvalue.0 -9999999
+ }
}
control.11 {
- comment.access 'read write'
- comment.type INTEGER
- comment.count 1
- comment.range '0 - 18'
- comment.dbmin -2400
- comment.dbmax 1200
iface MIXER
name 'DAC Voice Analog Downlink Volume'
value 18
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 18'
+ dbmin -2400
+ dbmax 1200
+ dbvalue.0 1200
+ }
}
control.12 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
iface MIXER
name 'DAC Voice Analog Downlink Switch'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
control.13 {
- comment.access 'read write'
- comment.type INTEGER
- comment.count 2
- comment.range '0 - 3'
- comment.dbmin -1200
- comment.dbmax 600
iface MIXER
name 'PreDriv Playback Volume'
value.0 3
value.1 3
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 3'
+ dbmin -9999999
+ dbmax 600
+ dbvalue.0 600
+ dbvalue.1 600
+ }
}
control.14 {
- comment.access 'read write'
- comment.type INTEGER
- comment.count 2
- comment.range '0 - 3'
- comment.dbmin -1200
- comment.dbmax 600
iface MIXER
name 'Headset Playback Volume'
value.0 2
value.1 2
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 3'
+ dbmin -9999999
+ dbmax 600
+ dbvalue.0 0
+ dbvalue.1 0
+ }
}
control.15 {
- comment.access 'read write'
- comment.type INTEGER
- comment.count 2
- comment.range '0 - 3'
- comment.dbmin -1200
- comment.dbmax 600
iface MIXER
name 'Carkit Playback Volume'
value.0 0
value.1 0
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 3'
+ dbmin -9999999
+ dbmax 600
+ dbvalue.0 -9999999
+ dbvalue.1 -9999999
+ }
}
control.16 {
- comment.access 'read write'
- comment.type INTEGER
- comment.count 1
- comment.range '0 - 3'
- comment.dbmin -600
- comment.dbmax 1200
iface MIXER
name 'Earpiece Playback Volume'
value 0
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 3'
+ dbmin -9999999
+ dbmax 1200
+ dbvalue.0 -9999999
+ }
}
control.17 {
- comment.access 'read write'
- comment.type INTEGER
- comment.count 2
- comment.range '0 - 31'
- comment.dbmin 0
- comment.dbmax 3100
iface MIXER
name 'TX1 Digital Capture Volume'
value.0 12
value.1 12
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 31'
+ dbmin 0
+ dbmax 3100
+ dbvalue.0 1200
+ dbvalue.1 1200
+ }
}
control.18 {
- comment.access 'read write'
- comment.type INTEGER
- comment.count 2
- comment.range '0 - 31'
- comment.dbmin 0
- comment.dbmax 3100
iface MIXER
name 'TX2 Digital Capture Volume'
value.0 0
value.1 0
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 31'
+ dbmin 0
+ dbmax 3100
+ dbvalue.0 0
+ dbvalue.1 0
+ }
}
control.19 {
- comment.access 'read write'
- comment.type INTEGER
- comment.count 2
- comment.range '0 - 5'
- comment.dbmin 0
- comment.dbmax 3000
iface MIXER
name 'Analog Capture Volume'
value.0 0
value.1 0
+ comment {
+ access 'read write'
+ type INTEGER
+ count 2
+ range '0 - 5'
+ dbmin 0
+ dbmax 3000
+ dbvalue.0 0
+ dbvalue.1 0
+ }
}
control.20 {
- comment.access 'read write'
- comment.type ENUMERATED
- comment.count 1
- comment.item.0 '27/20/14 ms'
- comment.item.1 '55/40/27 ms'
- comment.item.2 '109/81/55 ms'
- comment.item.3 '218/161/109 ms'
- comment.item.4 '437/323/218 ms'
- comment.item.5 '874/645/437 ms'
- comment.item.6 '1748/1291/874 ms'
- comment.item.7 '3495/2581/1748 ms'
+ iface MIXER
+ name 'AVADC Clock Priority'
+ value 'Voice high priority'
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 'Voice high priority'
+ item.1 'HiFi high priority'
+ }
+ }
+ control.21 {
iface MIXER
name 'HS ramp delay'
value '437/323/218 ms'
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 '27/20/14 ms'
+ item.1 '55/40/27 ms'
+ item.2 '109/81/55 ms'
+ item.3 '218/161/109 ms'
+ item.4 '437/323/218 ms'
+ item.5 '874/645/437 ms'
+ item.6 '1748/1291/874 ms'
+ item.7 '3495/2581/1748 ms'
+ }
}
- control.21 {
- comment.access 'read write'
- comment.type ENUMERATED
- comment.count 1
- comment.item.0 'Vibra H-bridge direction'
- comment.item.1 'Audio data MSB'
+ control.22 {
iface MIXER
name 'Vibra H-bridge mode'
value 'Vibra H-bridge direction'
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 'Vibra H-bridge direction'
+ item.1 'Audio data MSB'
+ }
}
- control.22 {
- comment.access 'read write'
- comment.type ENUMERATED
- comment.count 1
- comment.item.0 'Positive polarity'
- comment.item.1 'Negative polarity'
+ control.23 {
iface MIXER
name 'Vibra H-bridge direction'
value 'Positive polarity'
- }
- control.23 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
- iface MIXER
- name 'Analog Right Capture Route Sub mic'
- value false
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 'Positive polarity'
+ item.1 'Negative polarity'
+ }
}
control.24 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
iface MIXER
- name 'Analog Right Capture Route AUXR'
- value false
+ name 'Digimic LR Swap'
+ value 'Not swapped'
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 'Not swapped'
+ item.1 Swapped
+ }
}
control.25 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
iface MIXER
- name 'Analog Left Capture Route Main mic'
+ name 'Analog Right Sub Mic Capture Switch'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
control.26 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
iface MIXER
- name 'Analog Left Capture Route Headset mic'
+ name 'Analog Right AUXR Capture Switch'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
control.27 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
iface MIXER
- name 'Analog Left Capture Route AUXL'
+ name 'Analog Left Main Mic Capture Switch'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
control.28 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
iface MIXER
- name 'Analog Left Capture Route Carkit mic'
+ name 'Analog Left Headset Mic Capture Switch'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
control.29 {
- comment.access 'read write'
- comment.type ENUMERATED
- comment.count 1
- comment.item.0 Analog
- comment.item.1 Digimic1
+ iface MIXER
+ name 'Analog Left AUXL Capture Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.30 {
+ iface MIXER
+ name 'Analog Left Carkit Mic Capture Switch'
+ value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
+ }
+ control.31 {
iface MIXER
name 'TX2 Capture Route'
value Analog
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 Analog
+ item.1 Digimic1
+ }
}
- control.30 {
- comment.access 'read write'
- comment.type ENUMERATED
- comment.count 1
- comment.item.0 Analog
- comment.item.1 Digimic0
+ control.32 {
iface MIXER
name 'TX1 Capture Route'
value Analog
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 Analog
+ item.1 Digimic0
+ }
}
- control.31 {
- comment.access 'read write'
- comment.type ENUMERATED
- comment.count 1
- comment.item.0 'Local vibrator'
- comment.item.1 Audio
+ control.33 {
iface MIXER
name 'Vibra Route'
value 'Local vibrator'
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 'Local vibrator'
+ item.1 Audio
+ }
}
- control.32 {
- comment.access 'read write'
- comment.type ENUMERATED
- comment.count 1
- comment.item.0 AudioL1
- comment.item.1 AudioR1
- comment.item.2 AudioL2
- comment.item.3 AudioR2
+ control.34 {
iface MIXER
name 'Vibra Mux'
value AudioL1
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 AudioL1
+ item.1 AudioR1
+ item.2 AudioL2
+ item.3 AudioR2
+ }
}
- control.33 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.35 {
iface MIXER
- name 'HandsfreeR Switch Switch'
+ name 'HandsfreeR Switch'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.34 {
- comment.access 'read write'
- comment.type ENUMERATED
- comment.count 1
- comment.item.0 Voice
- comment.item.1 AudioR1
- comment.item.2 AudioR2
- comment.item.3 AudioL2
+ control.36 {
iface MIXER
name 'HandsfreeR Mux'
value Voice
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 Voice
+ item.1 AudioR1
+ item.2 AudioR2
+ item.3 AudioL2
+ }
}
- control.35 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.37 {
iface MIXER
- name 'HandsfreeL Switch Switch'
+ name 'HandsfreeL Switch'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.36 {
- comment.access 'read write'
- comment.type ENUMERATED
- comment.count 1
- comment.item.0 Voice
- comment.item.1 AudioL1
- comment.item.2 AudioL2
- comment.item.3 AudioR2
+ control.38 {
iface MIXER
name 'HandsfreeL Mux'
value Voice
+ comment {
+ access 'read write'
+ type ENUMERATED
+ count 1
+ item.0 Voice
+ item.1 AudioL1
+ item.2 AudioL2
+ item.3 AudioR2
+ }
}
- control.37 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.39 {
iface MIXER
name 'CarkitR Mixer Voice'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.38 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.40 {
iface MIXER
name 'CarkitR Mixer AudioR1'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.39 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.41 {
iface MIXER
name 'CarkitR Mixer AudioR2'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.40 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.42 {
iface MIXER
name 'CarkitL Mixer Voice'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.41 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.43 {
iface MIXER
name 'CarkitL Mixer AudioL1'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.42 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.44 {
iface MIXER
name 'CarkitL Mixer AudioL2'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.43 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.45 {
iface MIXER
name 'HeadsetR Mixer Voice'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.44 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.46 {
iface MIXER
name 'HeadsetR Mixer AudioR1'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.45 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.47 {
iface MIXER
name 'HeadsetR Mixer AudioR2'
value true
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.46 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.48 {
iface MIXER
name 'HeadsetL Mixer Voice'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.47 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.49 {
iface MIXER
name 'HeadsetL Mixer AudioL1'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.48 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.50 {
iface MIXER
name 'HeadsetL Mixer AudioL2'
value true
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.49 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.51 {
iface MIXER
name 'PredriveR Mixer Voice'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.50 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.52 {
iface MIXER
name 'PredriveR Mixer AudioR1'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.51 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.53 {
iface MIXER
name 'PredriveR Mixer AudioR2'
value true
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.52 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.54 {
iface MIXER
name 'PredriveR Mixer AudioL2'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.53 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.55 {
iface MIXER
name 'PredriveL Mixer Voice'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.54 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.56 {
iface MIXER
name 'PredriveL Mixer AudioL1'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.55 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.57 {
iface MIXER
name 'PredriveL Mixer AudioL2'
value true
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.56 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.58 {
iface MIXER
name 'PredriveL Mixer AudioR2'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.57 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.59 {
iface MIXER
name 'Earpiece Mixer Voice'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.58 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.60 {
iface MIXER
name 'Earpiece Mixer AudioL1'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.59 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.61 {
iface MIXER
name 'Earpiece Mixer AudioL2'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.60 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.62 {
iface MIXER
name 'Earpiece Mixer AudioR1'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.61 {
- comment.access 'read write'
- comment.type INTEGER
- comment.count 1
- comment.range '0 - 41'
- comment.dbmin -5100
- comment.dbmax -1000
+ control.63 {
iface MIXER
name 'Voice Digital Loopback Volume'
value 0
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 41'
+ dbmin -9999999
+ dbmax -1000
+ dbvalue.0 -9999999
+ }
}
- control.62 {
- comment.access 'read write'
- comment.type INTEGER
- comment.count 1
- comment.range '0 - 7'
- comment.dbmin -2400
- comment.dbmax 0
+ control.64 {
iface MIXER
name 'Right Digital Loopback Volume'
- value 0
+ value 1
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 7'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -2400
+ }
}
- control.63 {
- comment.access 'read write'
- comment.type INTEGER
- comment.count 1
- comment.range '0 - 7'
- comment.dbmin -2400
- comment.dbmax 0
+ control.65 {
iface MIXER
name 'Left Digital Loopback Volume'
- value 0
+ value 1
+ comment {
+ access 'read write'
+ type INTEGER
+ count 1
+ range '0 - 7'
+ dbmin -9999999
+ dbmax 0
+ dbvalue.0 -2400
+ }
}
- control.64 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.66 {
iface MIXER
name 'Voice Analog Loopback Switch'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.65 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.67 {
iface MIXER
name 'Left2 Analog Loopback Switch'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.66 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.68 {
iface MIXER
name 'Right2 Analog Loopback Switch'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.67 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.69 {
iface MIXER
name 'Left1 Analog Loopback Switch'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
- control.68 {
- comment.access 'read write'
- comment.type BOOLEAN
- comment.count 1
+ control.70 {
iface MIXER
name 'Right1 Analog Loopback Switch'
value false
+ comment {
+ access 'read write'
+ type BOOLEAN
+ count 1
+ }
}
}
diff --git a/recipes/angstrom/bigbuckbunny-720p.bb b/recipes/angstrom/bigbuckbunny-720p.bb
index 69839d1bef..ed46f8bf2f 100644
--- a/recipes/angstrom/bigbuckbunny-720p.bb
+++ b/recipes/angstrom/bigbuckbunny-720p.bb
@@ -1,7 +1,7 @@
DESCRIPTION = "Big Buck Bunny movie"
LICENSE = "CC-BY"
-SRC_URI = "http://mirror.bigbuckbunny.de/peach/bigbuckbunny_movies/big_buck_bunny_720p_surround.avi"
+SRC_URI = "http://mirrorblender.top-ix.org/peach/bigbuckbunny_movies/big_buck_bunny_720p_surround.avi"
do_install() {
install -d ${D}${datadir}/movies
diff --git a/recipes/apr/apr-util_1.3.10.bb b/recipes/apr/apr-util_1.3.10.bb
index ee32ddde41..32b568ec0d 100644
--- a/recipes/apr/apr-util_1.3.10.bb
+++ b/recipes/apr/apr-util_1.3.10.bb
@@ -3,7 +3,7 @@ SECTION = "libs"
DEPENDS = "apr expat gdbm"
LICENSE = "Apache License, Version 2.0"
-PR = "r0"
+PR = "r1"
SRC_URI = "${APACHE_MIRROR}/apr/${P}.tar.gz \
file://configfix.patch \
@@ -15,6 +15,7 @@ EXTRA_OECONF = "--with-apr=${STAGING_BINDIR_CROSS}/apr-1-config \
--without-sqlite2 \
--without-sqlite3 \
--without-pgsql \
+ --without-odbc \
--with-expat=${STAGING_DIR_HOST}${layout_prefix}"
SRC_URI[md5sum] = "82acd25cf3df8c72eba44eaee8b80c19"
diff --git a/recipes/at91bootstrap/at91bootstrap-3.0/0001-Update-.gitignore.patch b/recipes/at91bootstrap/at91bootstrap-3.0/0001-Update-.gitignore.patch
index ff2140199b..9cbe6440d5 100644
--- a/recipes/at91bootstrap/at91bootstrap-3.0/0001-Update-.gitignore.patch
+++ b/recipes/at91bootstrap/at91bootstrap-3.0/0001-Update-.gitignore.patch
@@ -1,7 +1,7 @@
From 91717f6a6591a6fae538447261ddbe58f6df3d38 Mon Sep 17 00:00:00 2001
From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
Date: Tue, 25 Jan 2011 22:20:29 +0100
-Subject: [PATCH v3] Update .gitignore
+Subject: [PATCH 01/16] Update .gitignore
---
.gitignore | 13 ++++++++-----
diff --git a/recipes/at91bootstrap/at91bootstrap-3.0/0002-Add-KConfig-support-for-booting-U-Boot.patch b/recipes/at91bootstrap/at91bootstrap-3.0/0002-Add-KConfig-support-for-booting-U-Boot.patch
index 5b0a9d27da..623536e1b7 100644
--- a/recipes/at91bootstrap/at91bootstrap-3.0/0002-Add-KConfig-support-for-booting-U-Boot.patch
+++ b/recipes/at91bootstrap/at91bootstrap-3.0/0002-Add-KConfig-support-for-booting-U-Boot.patch
@@ -1,7 +1,7 @@
From 07cb6b03e0bd1d8f643f497128f05776f943fe69 Mon Sep 17 00:00:00 2001
From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
Date: Sun, 23 Jan 2011 19:16:46 +0100
-Subject: [PATCH v3 02/08] Add KConfig support for booting U-Boot
+Subject: [PATCH 02/16] Add KConfig support for booting U-Boot
---
Config.in | 13 +++++++++++++
diff --git a/recipes/at91bootstrap/at91bootstrap-3.0/0003-Generate-a-BOOT.BIN-file-instead-of-boot.bin.patch b/recipes/at91bootstrap/at91bootstrap-3.0/0003-Generate-a-BOOT.BIN-file-instead-of-boot.bin.patch
index 05138cb4ea..06f329a05f 100644
--- a/recipes/at91bootstrap/at91bootstrap-3.0/0003-Generate-a-BOOT.BIN-file-instead-of-boot.bin.patch
+++ b/recipes/at91bootstrap/at91bootstrap-3.0/0003-Generate-a-BOOT.BIN-file-instead-of-boot.bin.patch
@@ -1,7 +1,7 @@
From 7213e685dcaac83610352316bd94938b31f9e3a5 Mon Sep 17 00:00:00 2001
From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
Date: Sun, 23 Jan 2011 19:32:31 +0100
-Subject: [PATCH v3 03/08] Generate a "BOOT.BIN" file, instead of "boot.bin"
+Subject: [PATCH 03/16] Generate a "BOOT.BIN" file, instead of "boot.bin"
---
Makefile | 5 +++++
diff --git a/recipes/at91bootstrap/at91bootstrap-3.0/0004-Add-support-for-dual-boot.patch b/recipes/at91bootstrap/at91bootstrap-3.0/0004-Add-support-for-dual-boot.patch
index ebf99af57a..97ced7711e 100644
--- a/recipes/at91bootstrap/at91bootstrap-3.0/0004-Add-support-for-dual-boot.patch
+++ b/recipes/at91bootstrap/at91bootstrap-3.0/0004-Add-support-for-dual-boot.patch
@@ -1,7 +1,7 @@
From 102651cd96baa14c35febb1ea1ee66a2ff7e5f0d Mon Sep 17 00:00:00 2001
From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
Date: Sun, 23 Jan 2011 19:34:13 +0100
-Subject: [PATCH v3 04/08] Add support for dual boot
+Subject: [PATCH 04/16] Add support for dual boot
---
Config.in | 32 +++++++++++++++++++++++++++++++-
diff --git a/recipes/at91bootstrap/at91bootstrap-3.0/0005-Remove-old-afeb9260-files.patch b/recipes/at91bootstrap/at91bootstrap-3.0/0005-Remove-old-afeb9260-files.patch
index 6b48c98208..718396a222 100644
--- a/recipes/at91bootstrap/at91bootstrap-3.0/0005-Remove-old-afeb9260-files.patch
+++ b/recipes/at91bootstrap/at91bootstrap-3.0/0005-Remove-old-afeb9260-files.patch
@@ -1,7 +1,7 @@
From 0a71b107335e139f648a6d86ce4891e62f026228 Mon Sep 17 00:00:00 2001
From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
Date: Sun, 23 Jan 2011 19:36:57 +0100
-Subject: [PATCH v3 05/08] Remove old afeb9260 files
+Subject: [PATCH 05/16] Remove old afeb9260 files
---
board/afeb9260/old/afeb9260.c | 248 -----------------------------
diff --git a/recipes/at91bootstrap/at91bootstrap-3.0/0006-Use-BOARD-instead-of-BOARDNAME-to-define-directory.patch b/recipes/at91bootstrap/at91bootstrap-3.0/0006-Use-BOARD-instead-of-BOARDNAME-to-define-directory.patch
index e37e113664..49e1710184 100644
--- a/recipes/at91bootstrap/at91bootstrap-3.0/0006-Use-BOARD-instead-of-BOARDNAME-to-define-directory.patch
+++ b/recipes/at91bootstrap/at91bootstrap-3.0/0006-Use-BOARD-instead-of-BOARDNAME-to-define-directory.patch
@@ -1,7 +1,7 @@
From d2db62d2c891693358d0cfd79a462609441715ed Mon Sep 17 00:00:00 2001
From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
Date: Sun, 23 Jan 2011 19:38:04 +0100
-Subject: [PATCH v3 06/08] Use BOARD instead of BOARDNAME to define directory
+Subject: [PATCH 06/16] Use BOARD instead of BOARDNAME to define directory
---
Makefile | 4 ++--
diff --git a/recipes/at91bootstrap/at91bootstrap-3.0/0007-Add-board-support-for-alternate-boot.patch b/recipes/at91bootstrap/at91bootstrap-3.0/0007-Add-board-support-for-alternate-boot.patch
index 1b2f0a169e..99b9726f13 100644
--- a/recipes/at91bootstrap/at91bootstrap-3.0/0007-Add-board-support-for-alternate-boot.patch
+++ b/recipes/at91bootstrap/at91bootstrap-3.0/0007-Add-board-support-for-alternate-boot.patch
@@ -1,7 +1,7 @@
From 4e319cdec2e32cc29f545830a4c1534c056e3abc Mon Sep 17 00:00:00 2001
From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
Date: Sun, 23 Jan 2011 20:02:23 +0100
-Subject: [PATCH v3 07/08] Add board support for alternate boot
+Subject: [PATCH 07/16] Add board support for alternate boot
---
board/at91sam9g45ek/at91sam9g45ek.c | 29 +++++++++++++++++++++++++
diff --git a/recipes/at91bootstrap/at91bootstrap-3.0/0008-Clean-up-printouts.patch b/recipes/at91bootstrap/at91bootstrap-3.0/0008-Clean-up-printouts.patch
index 0b60f45587..6f8bd1d775 100644
--- a/recipes/at91bootstrap/at91bootstrap-3.0/0008-Clean-up-printouts.patch
+++ b/recipes/at91bootstrap/at91bootstrap-3.0/0008-Clean-up-printouts.patch
@@ -1,7 +1,7 @@
From 8512356f4eb3b6e796fef0fc1d8d4cfca7f66934 Mon Sep 17 00:00:00 2001
From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
Date: Sun, 23 Jan 2011 20:03:30 +0100
-Subject: [PATCH v3 08/08] Clean up printouts
+Subject: [PATCH 08/16] Clean up printouts
---
driver/MEDSdcard.c | 4 ++--
diff --git a/recipes/at91bootstrap/at91bootstrap-3.0/0009-Update-configs.patch b/recipes/at91bootstrap/at91bootstrap-3.0/0009-Update-configs.patch
index 5653da5417..80fd3294c9 100644
--- a/recipes/at91bootstrap/at91bootstrap-3.0/0009-Update-configs.patch
+++ b/recipes/at91bootstrap/at91bootstrap-3.0/0009-Update-configs.patch
@@ -1,7 +1,7 @@
From 0f9b0b7586d1e66998fead980dd8d54a90f40a5c Mon Sep 17 00:00:00 2001
From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
Date: Sun, 23 Jan 2011 20:05:45 +0100
-Subject: [PATCH v3 09/08] Update configs
+Subject: [PATCH 09/16] Update configs
---
board/afeb9260/afeb9260_defconfig | 22 ++++-
diff --git a/recipes/at91bootstrap/at91bootstrap-3.0/0010-Update-build-scripts.patch b/recipes/at91bootstrap/at91bootstrap-3.0/0010-Update-build-scripts.patch
index 746e45e815..6ff73157a6 100644
--- a/recipes/at91bootstrap/at91bootstrap-3.0/0010-Update-build-scripts.patch
+++ b/recipes/at91bootstrap/at91bootstrap-3.0/0010-Update-build-scripts.patch
@@ -1,7 +1,7 @@
From 0db54ff2e7a532bcb04db3f6130fbcdd1f2ff853 Mon Sep 17 00:00:00 2001
From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
Date: Sun, 23 Jan 2011 20:07:06 +0100
-Subject: [PATCH v3 10/08] Update build scripts
+Subject: [PATCH 10/16] Update build scripts
---
ALLCONFIGS | 17 +++++++++++++
diff --git a/recipes/at91bootstrap/at91bootstrap-3.0/0011-Fix-Cut-n-Paste-error.patch b/recipes/at91bootstrap/at91bootstrap-3.0/0011-Fix-Cut-n-Paste-error.patch
index 81ba1193c8..bf474b2231 100644
--- a/recipes/at91bootstrap/at91bootstrap-3.0/0011-Fix-Cut-n-Paste-error.patch
+++ b/recipes/at91bootstrap/at91bootstrap-3.0/0011-Fix-Cut-n-Paste-error.patch
@@ -1,7 +1,7 @@
From a8685e5dd8f32b77d83e3a5dfb39146a913e4ca0 Mon Sep 17 00:00:00 2001
From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
Date: Sun, 23 Jan 2011 20:13:58 +0100
-Subject: [PATCH v3 11/08] Fix Cut-n-Paste error
+Subject: [PATCH 11/16] Fix Cut-n-Paste error
---
board/at91sam9m10ekes/at91sam9m10ekes.c | 8 +-------
diff --git a/recipes/at91bootstrap/at91bootstrap-3.0/0013-Fix-Cut-n-Paste-error-in-Makefile.patch b/recipes/at91bootstrap/at91bootstrap-3.0/0013-Fix-Cut-n-Paste-error-in-Makefile.patch
index ec6a344a52..290dca5678 100644
--- a/recipes/at91bootstrap/at91bootstrap-3.0/0013-Fix-Cut-n-Paste-error-in-Makefile.patch
+++ b/recipes/at91bootstrap/at91bootstrap-3.0/0013-Fix-Cut-n-Paste-error-in-Makefile.patch
@@ -1,7 +1,7 @@
From 6c5e9dd8b079ce8bf07240a81cd991d9bba7c4cd Mon Sep 17 00:00:00 2001
From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
Date: Sun, 23 Jan 2011 20:23:29 +0100
-Subject: [PATCH v3 13/08] Fix Cut-n-Paste error in Makefile
+Subject: [PATCH 13/16] Fix Cut-n-Paste error in Makefile
---
Makefile | 2 +-
diff --git a/recipes/at91bootstrap/at91bootstrap-3.0/0014-Add-support-for-alternate-jump-address.patch b/recipes/at91bootstrap/at91bootstrap-3.0/0014-Add-support-for-alternate-jump-address.patch
index 02ea9d72a6..4f0fd0b45a 100644
--- a/recipes/at91bootstrap/at91bootstrap-3.0/0014-Add-support-for-alternate-jump-address.patch
+++ b/recipes/at91bootstrap/at91bootstrap-3.0/0014-Add-support-for-alternate-jump-address.patch
@@ -1,7 +1,7 @@
From e480f602a4b5e6481f4c0590fca16a9cd7ee3570 Mon Sep 17 00:00:00 2001
From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
Date: Mon, 24 Jan 2011 19:37:15 +0100
-Subject: [PATCH v3 14/08] Add support for alternate jump address
+Subject: [PATCH 14/16] Add support for alternate jump address
---
Config.in | 11 +++++++++
diff --git a/recipes/at91bootstrap/at91bootstrap-3.0/0015-Make-MAKENEW-useful.patch b/recipes/at91bootstrap/at91bootstrap-3.0/0015-Make-MAKENEW-useful.patch
index 64fff8ab23..5e293751aa 100644
--- a/recipes/at91bootstrap/at91bootstrap-3.0/0015-Make-MAKENEW-useful.patch
+++ b/recipes/at91bootstrap/at91bootstrap-3.0/0015-Make-MAKENEW-useful.patch
@@ -1,7 +1,7 @@
From 044592d20881ee9f61c29db3bc7b00424145e136 Mon Sep 17 00:00:00 2001
From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
Date: Mon, 24 Jan 2011 19:37:56 +0100
-Subject: [PATCH v3 15/08] Make MAKENEW useful
+Subject: [PATCH 15/16] Make MAKENEW useful
---
MAKENEW | 12 ++++++++----
diff --git a/recipes/at91bootstrap/at91bootstrap-3.0/0016-Update-configs.patch b/recipes/at91bootstrap/at91bootstrap-3.0/0016-Update-configs.patch
index e53ab6f018..3a93975afa 100644
--- a/recipes/at91bootstrap/at91bootstrap-3.0/0016-Update-configs.patch
+++ b/recipes/at91bootstrap/at91bootstrap-3.0/0016-Update-configs.patch
@@ -1,7 +1,7 @@
From 03db7b119864eb99b6d6abd6d0e44f3d369f6212 Mon Sep 17 00:00:00 2001
From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
Date: Mon, 24 Jan 2011 19:41:35 +0100
-Subject: [PATCH v3 16/08] Update configs
+Subject: [PATCH 16/16] Update configs
---
board/afeb9260/afeb9260_defconfig | 3 ++-
diff --git a/recipes/at91bootstrap/at91bootstrap-3.0/0017-at91bootstrap-fix-build-error-in-openembedded-due-to.patch b/recipes/at91bootstrap/at91bootstrap-3.0/0017-at91bootstrap-fix-build-error-in-openembedded-due-to.patch
new file mode 100644
index 0000000000..78e1d1defc
--- /dev/null
+++ b/recipes/at91bootstrap/at91bootstrap-3.0/0017-at91bootstrap-fix-build-error-in-openembedded-due-to.patch
@@ -0,0 +1,49 @@
+From 7487f5e8836f27806ca734e856cdced8a9edc2c3 Mon Sep 17 00:00:00 2001
+From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
+Date: Sat, 16 Apr 2011 12:57:26 +0200
+Subject: [PATCH 1/2] at91bootstrap: fix build error in openembedded due to compiler error
+
+undefined reference to `__gnu_thumb1_case_uqi'
+when using unsigned char in a switch statement
+
+Signed-off-by: Ulf Samuelsson <ulf.samuelsson@atmel.com>
+---
+ driver/dma.c | 8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/driver/dma.c b/driver/dma.c
+index 1373525..33e8466 100644
+--- a/driver/dma.c
++++ b/driver/dma.c
+@@ -257,11 +257,11 @@ void DMA_SetSourceBufferMode(unsigned char channel,
+ unsigned char addressingType)
+ {
+ unsigned int value;
+-
++ unsigned int mode = transferMode;
+ value = (*(volatile unsigned int *)
+ (AT91C_BASE_HDMA_CH_0 + channel * 40 + HDMA_CTRLB));
+ value &= ~(AT91C_SRC_DSCR | AT91C_SRC_INCR | 1 << 31);
+- switch (transferMode) {
++ switch (mode) {
+ case DMA_TRANSFER_SINGLE:
+ value |= AT91C_SRC_DSCR | addressingType << 24;
+ break;
+@@ -308,12 +308,12 @@ void DMA_SetDestBufferMode(unsigned char channel,
+ unsigned char addressingType)
+ {
+ unsigned int value;
+-
++ unsigned int mode = transferMode;
+ value = (*(volatile unsigned int *)
+ (AT91C_BASE_HDMA_CH_0 + channel * 40 + HDMA_CTRLB));
+ value &= ~(unsigned int)(AT91C_DST_DSCR | AT91C_DST_INCR);
+
+- switch (transferMode) {
++ switch (mode) {
+ case DMA_TRANSFER_SINGLE:
+ case DMA_TRANSFER_RELOAD:
+ case DMA_TRANSFER_CONTIGUOUS:
+--
+1.6.3.3
+
diff --git a/recipes/at91bootstrap/at91bootstrap-3.0/0018-Change-switch-statements-to-if-statements-to-avoid-b.patch b/recipes/at91bootstrap/at91bootstrap-3.0/0018-Change-switch-statements-to-if-statements-to-avoid-b.patch
new file mode 100644
index 0000000000..7964ae90a6
--- /dev/null
+++ b/recipes/at91bootstrap/at91bootstrap-3.0/0018-Change-switch-statements-to-if-statements-to-avoid-b.patch
@@ -0,0 +1,70 @@
+From 6c1b7e91de44526d97ee99fa98ca8514aaf84be7 Mon Sep 17 00:00:00 2001
+From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
+Date: Sat, 16 Apr 2011 13:31:00 +0200
+Subject: [PATCH 2/2] Change switch statements to if statements to avoid build bug
+
+OE generates
+undefined reference to `__gnu_thumb1_case_uqi'
+when compiling.
+This is a routine which optimizes switch statements in thumb mode
+when only a few casew statements are present.
+---
+ driver/dma.c | 24 ++++++------------------
+ 1 files changed, 6 insertions(+), 18 deletions(-)
+
+diff --git a/driver/dma.c b/driver/dma.c
+index 33e8466..036f39d 100644
+--- a/driver/dma.c
++++ b/driver/dma.c
+@@ -257,21 +257,15 @@ void DMA_SetSourceBufferMode(unsigned char channel,
+ unsigned char addressingType)
+ {
+ unsigned int value;
+- unsigned int mode = transferMode;
+ value = (*(volatile unsigned int *)
+ (AT91C_BASE_HDMA_CH_0 + channel * 40 + HDMA_CTRLB));
+ value &= ~(AT91C_SRC_DSCR | AT91C_SRC_INCR | 1 << 31);
+- switch (mode) {
+- case DMA_TRANSFER_SINGLE:
++ if (transferMode == DMA_TRANSFER_SINGLE) {
+ value |= AT91C_SRC_DSCR | addressingType << 24;
+- break;
+- case DMA_TRANSFER_LLI:
++ } else if(transferMode == DMA_TRANSFER_LLI) {
+ value |= addressingType << 24;
+- break;
+- case DMA_TRANSFER_RELOAD:
+- case DMA_TRANSFER_CONTIGUOUS:
++ } else if((transferMode == DMA_TRANSFER_RELOAD) || (transferMode == DMA_TRANSFER_CONTIGUOUS)) {
+ value |= AT91C_SRC_DSCR | addressingType << 24 | 1 << 31;
+- break;
+ }
+ (*(volatile unsigned int *)
+ (AT91C_BASE_HDMA_CH_0 + channel * 40 + HDMA_CTRLB)) = value;
+@@ -308,20 +302,14 @@ void DMA_SetDestBufferMode(unsigned char channel,
+ unsigned char addressingType)
+ {
+ unsigned int value;
+- unsigned int mode = transferMode;
+ value = (*(volatile unsigned int *)
+ (AT91C_BASE_HDMA_CH_0 + channel * 40 + HDMA_CTRLB));
+ value &= ~(unsigned int)(AT91C_DST_DSCR | AT91C_DST_INCR);
+
+- switch (mode) {
+- case DMA_TRANSFER_SINGLE:
+- case DMA_TRANSFER_RELOAD:
+- case DMA_TRANSFER_CONTIGUOUS:
+- value |= AT91C_DST_DSCR | addressingType << 28;
+- break;
+- case DMA_TRANSFER_LLI:
++ if(transferMode == DMA_TRANSFER_LLI) {
+ value |= addressingType << 28;
+- break;
++ } else { /* DMA_TRANSFER_SINGLE,DMA_TRANSFER_RELOAD,DMA_TRANSFER_CONTIGUOUS */
++ value |= AT91C_DST_DSCR | addressingType << 28;
+ }
+ (*(volatile unsigned int *)
+ (AT91C_BASE_HDMA_CH_0 + channel * 40 + HDMA_CTRLB)) = value;
+--
+1.6.3.3
+
diff --git a/recipes/at91bootstrap/at91bootstrap_3.0.bb b/recipes/at91bootstrap/at91bootstrap_3.0.bb
index 82a91c6261..6d16134329 100644
--- a/recipes/at91bootstrap/at91bootstrap_3.0.bb
+++ b/recipes/at91bootstrap/at91bootstrap_3.0.bb
@@ -25,6 +25,8 @@ SRC_URI_append = " \
file://0014-Add-support-for-alternate-jump-address.patch;apply=yes \
file://0015-Make-MAKENEW-useful.patch;apply=yes \
file://0016-Update-configs.patch;apply=yes \
+ file://0017-at91bootstrap-fix-build-error-in-openembedded-due-to.patch;apply=yes \
+ file://0018-Change-switch-statements-to-if-statements-to-avoid-b.patch;apply=yes \
"
# S = "${WORKDIR}/${PN}-${PV}"
diff --git a/recipes/at91bootstrap/at91bootstrap_3.0.inc b/recipes/at91bootstrap/at91bootstrap_3.0.inc
index ca213d1c78..8da9657d6b 100644
--- a/recipes/at91bootstrap/at91bootstrap_3.0.inc
+++ b/recipes/at91bootstrap/at91bootstrap_3.0.inc
@@ -15,7 +15,7 @@ do_compile () {
for board in ${AT91BOOTSTRAP_BOARD} ; do
oe_runmake mrproper
filename=`find board -name ${board}_defconfig`
- if ! [ "x$filename" == "x" ] ; then
+ if ! [ "x$filename" == "x" ] ; then
cp $filename .config
oe_runmake AT91_CUSTOM_FLAGS="${AT91BOOTSTRAP_FLAGS}"
oe_runmake AT91_CUSTOM_FLAGS="${AT91BOOTSTRAP_FLAGS}" boot
diff --git a/recipes/aurora/aurora-version.bb b/recipes/aurora/aurora-version.bb
new file mode 100644
index 0000000000..3dbed101f7
--- /dev/null
+++ b/recipes/aurora/aurora-version.bb
@@ -0,0 +1,13 @@
+LICENSE = "MIT"
+
+PV = "${DISTRO_VERSION}"
+
+PACKAGES = "${PN}"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+do_install() {
+ mkdir -p ${D}${sysconfdir}
+ echo "Aurora ${DISTRO_VERSION}" > ${D}${sysconfdir}/aurora-version
+ echo "Built from branch: ${METADATA_BRANCH}" >> ${D}${sysconfdir}/aurora-version
+ echo "Revision: ${METADATA_REVISION}" >> ${D}${sysconfdir}/aurora-version
+}
diff --git a/recipes/avahi/avahi-ui_0.6.25.bb b/recipes/avahi/avahi-ui_0.6.25.bb
index 6ae35ef33b..268ec37f42 100644
--- a/recipes/avahi/avahi-ui_0.6.25.bb
+++ b/recipes/avahi/avahi-ui_0.6.25.bb
@@ -1,7 +1,7 @@
require avahi.inc
PR = "${INC_PR}.0"
-DEPENDS += "avahi gtk+"
+DEPENDS += "avahi gtk+ libglade"
AVAHI_GTK = "--enable-gtk"
diff --git a/recipes/avahi/avahi-ui_0.6.30.bb b/recipes/avahi/avahi-ui_0.6.30.bb
new file mode 100644
index 0000000000..c939f418db
--- /dev/null
+++ b/recipes/avahi/avahi-ui_0.6.30.bb
@@ -0,0 +1,20 @@
+require avahi.inc
+PR = "${INC_PR}.1"
+
+DEPENDS += "avahi gtk+"
+
+AVAHI_GTK = "--enable-gtk --disable-gtk3"
+
+S = "${WORKDIR}/avahi-${PV}"
+
+PACKAGES = "${PN} ${PN}-utils ${PN}-dbg ${PN}-dev"
+
+FILES_${PN} = "${libdir}/libavahi-ui*.so.*"
+FILES_${PN}-dbg += "${libdir}/.debug/libavah-ui*"
+FILES_${PN}-dev += "${libdir}/libavahi-ui*"
+
+FILES_${PN}-utils = "${bindir}/b* ${datadir}/applications/b*"
+
+SRC_URI[md5sum] = "e4db89a2a403ff4c47d66ac66fad1f43"
+SRC_URI[sha256sum] = "f9e4316c2339d0020726edd846d01bee0c39980906db0c247479e5807457ff1f"
+
diff --git a/recipes/avahi/mango-lassi_git.bb b/recipes/avahi/mango-lassi_git.bb
index 049ac24b2a..fbdf5d9d02 100644
--- a/recipes/avahi/mango-lassi_git.bb
+++ b/recipes/avahi/mango-lassi_git.bb
@@ -1,16 +1,20 @@
DESCRIPTION = "Input sharing, the avahi way"
-DEPENDS = "avahi-ui libglade libnotify"
+DEPENDS = "libxtst avahi-ui libnotify gnome-doc-utils-native scrollkeeper-native"
+LICENSE = "GPLv2+"
-SRCREV = "73638817126a68d62f1233f6e6859ce75a259e93"
-PV = "0.0+${PR}+gitr${SRCREV}"
-PR = "r2"
+SRCREV = "d50141ce4eb96e7326ba"
+PV = "001+${PR}+gitr${SRCREV}"
+PR = "r0"
-SRC_URI = "git://git.0pointer.de/repos/mango-lassi.git/;protocol=http"
+SRC_URI = "git://github.com/herzi/mango-lassi.git;protocol=git"
S = "${WORKDIR}/git"
inherit autotools
do_configure_prepend() {
- touch config.rpath
+ touch config.rpath
+ gnome-doc-prepare --automake
}
+
+FILES_${PN} += "${datadir}/icons"
diff --git a/recipes/avrgal/avrgal_1.0.bb b/recipes/avrgal/avrgal_1.0.bb
new file mode 100644
index 0000000000..f6f6f37622
--- /dev/null
+++ b/recipes/avrgal/avrgal_1.0.bb
@@ -0,0 +1,20 @@
+DESCRIPTION = "AVRGAL is a hacked light version of AVRDUDE intended to make it easier to cross compile and use for uploading programs to the Arduino boootloader"
+HOMEPAGE = "http://elinux.org/Avrgal"
+SECTION = "console"
+LICENSE = "GPLv2"
+
+DEPENDS = "virtual/libusb0 ncurses"
+
+SRC_URI = "http://elinux.org/images/8/8a/Avrgal.tar.gz"
+
+inherit autotools
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+do_install() {
+ mkdir -p ${D}${bindir}
+ install -m 0755 ${S}/avrgal ${D}${bindir}
+}
+
+SRC_URI[md5sum] = "7af51d301edf8548314d28d6d2cc1bc0"
+SRC_URI[sha256sum] = "43bc8442ea9c0df2a5e172cea8630969c541025587eb8c81f0eb703ac6a2d709"
diff --git a/recipes/balsa/balsa_2.4.7.bb b/recipes/balsa/balsa_2.4.7.bb
index 7cc0b7ad3b..70d704bed2 100644
--- a/recipes/balsa/balsa_2.4.7.bb
+++ b/recipes/balsa/balsa_2.4.7.bb
@@ -4,9 +4,9 @@ SECTION = "x11/network"
LICENSE = "GPL"
SRC_URI = "http://pawsa.fedorapeople.org/balsa/${P}.tar.bz2 \
file://obsolete-icon.patch"
-PR = "r0"
+PR = "r1"
-DEPENDS = "glib-2.0 gmime gnome-icon-theme gtk+ intltool-native libesmtp libxml-parser-perl-native"
+DEPENDS = "glib-2.0 gmime gnome-doc-utils-native gnome-icon-theme gtk+ intltool-native libesmtp libxml-parser-perl-native libxslt-native"
RDEPENDS_${PN} = "gnome-icon-theme"
# FIXME: It is possible to build several variants of balsa: lite (SSL, gqlite/GPE, maybe HTML),
# standard (GNOME, spell checking, HTML), full (Kerberos, LDAP, PGP, Rubrica, X-Face)
@@ -88,6 +88,8 @@ EXTRA_OECONF="--with-ssl \
# --with-canberra \
do_configure_prepend() {
+ # doc is not yet buildable with OE
+ sed -i -e 's: doc : :g' ${S}/Makefile.am
# aclocal seems to insist on looking in here. Make sure it exists.
mkdir -p ${S}/m4
}
diff --git a/recipes/bluez/bluez-hcidump-2.0/fix-declaration-clash.patch b/recipes/bluez/bluez-hcidump-2.0/fix-declaration-clash.patch
new file mode 100644
index 0000000000..0f1a2f7109
--- /dev/null
+++ b/recipes/bluez/bluez-hcidump-2.0/fix-declaration-clash.patch
@@ -0,0 +1,27 @@
+Index: bluez-hcidump-2.0/src/hcidump.c
+===================================================================
+--- bluez-hcidump-2.0.orig/src/hcidump.c
++++ bluez-hcidump-2.0/src/hcidump.c
+@@ -50,22 +50,6 @@
+ #include "parser/parser.h"
+ #include "parser/sdp.h"
+
+-#if __BYTE_ORDER == __LITTLE_ENDIAN
+-static inline uint64_t ntoh64(uint64_t n)
+-{
+- uint64_t h;
+- uint64_t tmp = ntohl(n & 0x00000000ffffffff);
+- h = ntohl(n >> 32);
+- h |= tmp << 32;
+- return h;
+-}
+-#elif __BYTE_ORDER == __BIG_ENDIAN
+-#define ntoh64(x) (x)
+-#else
+-#error "Unknown byte order"
+-#endif
+-#define hton64(x) ntoh64(x)
+-
+ #define SNAP_LEN HCI_MAX_FRAME_SIZE
+ #define DEFAULT_PORT "10839";
+
diff --git a/recipes/bluez/bluez-hcidump_2.0.bb b/recipes/bluez/bluez-hcidump_2.0.bb
index 94a7097594..2193ff456f 100644
--- a/recipes/bluez/bluez-hcidump_2.0.bb
+++ b/recipes/bluez/bluez-hcidump_2.0.bb
@@ -3,11 +3,10 @@ SECTION = "console"
PRIORITY = "optional"
DEPENDS = "bluez-libs"
LICENSE = "GPLv2"
-PR = "r0"
+PR = "r1"
-DEFAULT_PREFERENCE = "-1"
-
-SRC_URI = "http://www.kernel.org/pub/linux/bluetooth/bluez-hcidump-${PV}.tar.gz"
+SRC_URI = "http://www.kernel.org/pub/linux/bluetooth/bluez-hcidump-${PV}.tar.gz\
+ file://fix-declaration-clash.patch"
S = "${WORKDIR}/bluez-hcidump-${PV}"
EXTRA_OECONF = "--with-bluez-libs=${STAGING_LIBDIR} --with-bluez-includes=${STAGING_INCDIR}"
diff --git a/recipes/boa/boa_0.94.13.bb b/recipes/boa/boa_0.94.13.bb
index 7e42cf7e35..cc5f7adf6c 100644
--- a/recipes/boa/boa_0.94.13.bb
+++ b/recipes/boa/boa_0.94.13.bb
@@ -1,6 +1,7 @@
DESCRIPTION = "Lightweight and High Performance WebServer"
SECTION = "console/network"
LICENSE = "GPL"
+DEPENDS = "bison-native flex-native"
RDEPENDS_${PN} = "mime-support"
RPROVIDES_${PN} = "httpd"
PR = "r4"
diff --git a/recipes/buglabs-apps/bug-app.inc b/recipes/buglabs-apps/bug-app.inc
index 9e85237127..019769af2b 100644
--- a/recipes/buglabs-apps/bug-app.inc
+++ b/recipes/buglabs-apps/bug-app.inc
@@ -11,6 +11,9 @@ S = "${WORKDIR}"
datadir_java="/usr/share/java/apps"
+JAVAC_COMMAND ?= "javac"
+JAVAC_OPTIONS ?= "-source 1.6"
+
do_compile() {
mkdir -p build
oe_makeclasspath cp -s ${DEPENDS} ${EXTRA_CP}
@@ -20,7 +23,7 @@ do_compile() {
echo $cp | awk 'BEGIN {FS=":"} {split($0,a,":"); for (i=1; i<=NF; i++) print a[i]; }'
echo "-------------------------"
- javac -sourcepath . -cp $cp -d build `find . -name \*.java`
+ ${JAVAC_COMMAND} ${JAVAC_OPTIONS} -sourcepath . -cp $cp -d build `find . -name \*.java`
pwd
ls -haltr ${WORKDIR}/`basename ${SRC_LINK}`
diff --git a/recipes/buglabs-apps/com.buglabs.app.bugdash2.bb b/recipes/buglabs-apps/com.buglabs.app.bugdash2.bb
index ac20d3971a..476466c8aa 100644
--- a/recipes/buglabs-apps/com.buglabs.app.bugdash2.bb
+++ b/recipes/buglabs-apps/com.buglabs.app.bugdash2.bb
@@ -1,13 +1,13 @@
require bug-app.inc
-DESCRIPTION = "A prototype application launcher."
-HOMEPAGE = "http://buglabs.net/applications/AppUI"
+DESCRIPTION = "BUGdash is a web-based admin tool for managing software and viewing settings on BUG."
+HOMEPAGE = "http://buglabs.net/applications/bugdash2"
DEPENDS += "com.buglabs.bug.base com.buglabs.common com.buglabs.osgi.sewing com.sun.javax.servlet com.buglabs.nmea com.buglabs.bug.program com.buglabs.osgi.shell felix"
-PV = "8"
+PV = "14"
-SRC_LINK = "http://www.buglabs.net/program_version/download/1346"
+SRC_LINK = "http://www.buglabs.net/program_version/download/1360"
JARFILENAME = "bugdash2.jar"
FILES_${PN} += "/usr/share/java/apps/bugdash2.jar"
-APIVERSION = ""
+APIVERSION = "2.0.2"
diff --git a/recipes/buglabs-osgi/bug-osgi.inc b/recipes/buglabs-osgi/bug-osgi.inc
index 75908bb69b..56374b6a8e 100644
--- a/recipes/buglabs-osgi/bug-osgi.inc
+++ b/recipes/buglabs-osgi/bug-osgi.inc
@@ -1,6 +1,7 @@
DESCRIPTION = "Bug Labs OSGi bundle: ${PN}"
LICENSE = "BSD"
DEPENDS = "felix felix-log service-tracker com.buglabs.osgi felix-configadmin"
+
PE = "1"
inherit bug-java-library
@@ -24,9 +25,10 @@ S = "${WORKDIR}/${PN}"
datadir_java = ${datadir}/java/bundle/
-EXTRA_OEMAKE+="CLASSPATH_INCDIR=${STAGING_INCDIR}/classpath"
+EXTRA_OEMAKE += "CLASSPATH_INCDIR=${STAGING_INCDIR}/classpath"
-JAVAC_OPTIONS="-source 1.6"
+JAVAC_COMMAND ?= "javac"
+JAVAC_OPTIONS ?= "-source 1.6"
CXXFLAGS += "-fPIC"
@@ -34,12 +36,14 @@ do_compile() {
mkdir -p build
oe_makeclasspath cp -s ${DEPENDS} ${EXTRA_CP}
cp=$cp:${STAGING_DIR_JAVA}/felix.jar
-
- echo "--- JAVAC CLASSPATH ---------------"
+
+ echo "javac version: `${JAVAC_COMMAND} -version`"
+ echo "javac params: ${JAVAC_COMMAND} ${JAVAC_OPTIONS} -sourcepath . -cp $cp -d build"
+ echo "javac classpath:"
echo $cp | awk 'BEGIN {FS=":"} {split($0,a,":"); for (i=1; i<=NF; i++) print a[i]; }'
echo "-------------------------"
- javac ${JAVAC_OPTIONS} -sourcepath . -cp $cp -d build `find . -name \*.java`
+ ${JAVAC_COMMAND} ${JAVAC_OPTIONS} -sourcepath . -cp $cp -d build `find . -name \*.java`
}
addtask jar_package after do_compile before do_install
diff --git a/recipes/buglabs-osgi/com.buglabs.bug.jni.motion.bb b/recipes/buglabs-osgi/com.buglabs.bug.jni.motion.bb
new file mode 100644
index 0000000000..bef3f3cba4
--- /dev/null
+++ b/recipes/buglabs-osgi/com.buglabs.bug.jni.motion.bb
@@ -0,0 +1,8 @@
+require bug-osgi.inc
+inherit jni-library
+
+SRC_URI = "svn://bugcamp.net/bug/branches/trunk-precleaned;module=${PN};proto=svn "
+PR = "${INC_PR}.5+svnr${SRCREV}"
+FILES_${PN} += "${JNI_LIB_DIR}/libMotion.so"
+
+DEPENDS += "com.buglabs.common com.buglabs.bug.jni.common com.buglabs.bug.jni.accelerometer classpath virtual/kernel"
diff --git a/recipes/buglabs-osgi/com.buglabs.bug.module.motion.bb b/recipes/buglabs-osgi/com.buglabs.bug.module.motion.bb
new file mode 100644
index 0000000000..b4f6d22426
--- /dev/null
+++ b/recipes/buglabs-osgi/com.buglabs.bug.module.motion.bb
@@ -0,0 +1,3 @@
+require bug-osgi.inc
+PR = "${INC_PR}.5+svnr${SRCREV}"
+DEPENDS += "com.buglabs.common com.buglabs.bug.module com.buglabs.bug.jni.motion com.buglabs.bug.jni.accelerometer com.buglabs.bug.jni.common felix-configadmin"
diff --git a/recipes/buglabs/matchbox-theme-bug/session b/recipes/buglabs/matchbox-theme-bug/session
index 82cbf6f645..3e7b3ccd45 100755
--- a/recipes/buglabs/matchbox-theme-bug/session
+++ b/recipes/buglabs/matchbox-theme-bug/session
@@ -4,6 +4,6 @@ SHOWCURSOR="no"
matchbox-desktop-2 &
-matchbox-panel-2 --titlebar --start-applets showdesktop,windowselector --end-applets clock,battery,systray,startup-notify,notify &
+matchbox-panel-2 --titlebar --start-applets showdesktop,windowselector --end-applets clock,systray,startup-notify,notify &
exec matchbox-window-manager -theme Bug-Dark -use_desktop_mode decorated -use_cursor $SHOWCURSOR $@
diff --git a/recipes/busybox/busybox_1.18.4.bb b/recipes/busybox/busybox_1.18.4.bb
index 0a62d335dc..68a023a457 100644
--- a/recipes/busybox/busybox_1.18.4.bb
+++ b/recipes/busybox/busybox_1.18.4.bb
@@ -1,8 +1,11 @@
require busybox_1.1x.inc
-SRC_URI += "file://fix-iptunnel-location.patch"
+SRC_URI += "file://fix-iptunnel-location.patch \
+ http://busybox.net/downloads/fixes-1.18.4/busybox-1.18.4-hush.patch;name=patch01"
-PR = "${INC_PR}.1"
+PR = "${INC_PR}.2"
SRC_URI[md5sum] = "b03c5b46ced732679e525a920a1a62f5"
SRC_URI[sha256sum] = "4d24d37bd6f1bd153e8cf9a984ec2f32f18464f73ca535e2cc2e8be9694097fa"
+SRC_URI[patch01.md5sum] = "a81f2d7d3bdf1a35ab77c4414a530d38"
+SRC_URI[patch01.sha256sum] = "c87e73ad942d53c8a2a5ffe6037c1cdf52d4b20d3f29caae5fffc7a99009b7cb"
diff --git a/recipes/busybox/busybox_git.bb b/recipes/busybox/busybox_git.bb
index 3a6477f9ee..a12eef23e9 100644
--- a/recipes/busybox/busybox_git.bb
+++ b/recipes/busybox/busybox_git.bb
@@ -3,9 +3,9 @@ PR = "${INC_PR}.0"
FILESPATHPKG =. "busybox-git:"
-SRCREV = "6596380f52cd48b8b44443bb5677ec8caf538761"
+SRCREV = "10c0131a8a1b3db7fd6b23b72ebd7b33afc7b018"
-PV = "1.18.2+gitr${SRCREV}"
+PV = "1.18.4+gitr${SRCREV}"
S = "${WORKDIR}/git"
@@ -20,8 +20,11 @@ SRC_URI = "\
file://busybox-httpd \
file://busybox-udhcpd \
file://default.script file://simple.script \
+ file://group \
file://hwclock.sh \
file://hwclock-default \
+ file://inetd \
+ file://inetd.conf \
file://mount.busybox \
file://mountall \
file://passwd \
diff --git a/recipes/cacao/cacao-native_hg.bb b/recipes/cacao/cacao-native_hg.bb
index dc35ce8dd3..020dee39fe 100644
--- a/recipes/cacao/cacao-native_hg.bb
+++ b/recipes/cacao/cacao-native_hg.bb
@@ -1,7 +1,7 @@
require cacao-native.inc
PV = "1.1.0+hgr${SRCPV}"
-PR = "r4"
+PR = "r5"
SRCREV = "c7bf150bfa46"
SRC_URI = "hg://mips.complang.tuwien.ac.at/hg/;module=cacao;rev=${SRCREV} \
diff --git a/recipes/cacao/files/cacao-shutdownguard.patch b/recipes/cacao/files/cacao-shutdownguard.patch
index b89170c780..b0d9d9237e 100644
--- a/recipes/cacao/files/cacao-shutdownguard.patch
+++ b/recipes/cacao/files/cacao-shutdownguard.patch
@@ -1,6 +1,7 @@
-diff -r c7bf150bfa46 src/threads/posix/mutex-posix.hpp
---- a/src/threads/posix/mutex-posix.hpp Fri Mar 11 23:35:56 2011 +0100
-+++ b/src/threads/posix/mutex-posix.hpp Fri Apr 01 16:16:07 2011 +0200
+Index: cacao/src/threads/posix/mutex-posix.hpp
+===================================================================
+--- cacao.orig/src/threads/posix/mutex-posix.hpp 2011-03-08 13:13:00.000000000 +0100
++++ cacao/src/threads/posix/mutex-posix.hpp 2011-05-10 11:51:48.534869875 +0200
@@ -53,6 +53,9 @@
inline void lock();
@@ -80,9 +81,10 @@ diff -r c7bf150bfa46 src/threads/posix/mutex-posix.hpp
#else
// This structure must have the same layout as the class above.
-diff -r c7bf150bfa46 src/threads/posix/thread-posix.cpp
---- a/src/threads/posix/thread-posix.cpp Fri Mar 11 23:35:56 2011 +0100
-+++ b/src/threads/posix/thread-posix.cpp Fri Apr 01 16:16:07 2011 +0200
+Index: cacao/src/threads/posix/thread-posix.cpp
+===================================================================
+--- cacao.orig/src/threads/posix/thread-posix.cpp 2011-03-17 10:41:29.000000000 +0100
++++ cacao/src/threads/posix/thread-posix.cpp 2011-05-10 11:51:48.534869875 +0200
@@ -74,6 +74,23 @@
#include "vm/string.hpp"
#include "vm/vm.hpp"
@@ -107,9 +109,10 @@ diff -r c7bf150bfa46 src/threads/posix/thread-posix.cpp
#if defined(ENABLE_STATISTICS)
# include "vm/statistics.h"
#endif
-diff -r c7bf150bfa46 src/vm/vm.cpp
---- a/src/vm/vm.cpp Fri Mar 11 23:35:56 2011 +0100
-+++ b/src/vm/vm.cpp Fri Apr 01 16:16:07 2011 +0200
+Index: cacao/src/vm/vm.cpp
+===================================================================
+--- cacao.orig/src/vm/vm.cpp 2011-03-17 10:41:29.000000000 +0100
++++ cacao/src/vm/vm.cpp 2011-05-10 11:56:36.564882762 +0200
@@ -52,6 +52,7 @@
#include "native/vm/nativevm.hpp"
@@ -141,12 +144,10 @@ diff -r c7bf150bfa46 src/vm/vm.cpp
/* vm_run **********************************************************************
-@@ -1865,6 +1882,15 @@
+@@ -1865,6 +1882,13 @@
void vm_shutdown(s4 status)
{
-+ log_println("vm_shutdown");
-+
+ if (VM::get_current()->shutdown_guard())
+ {
+ /* Shutdown in progress by another thread already.
@@ -157,9 +158,10 @@ diff -r c7bf150bfa46 src/vm/vm.cpp
if (opt_verbose
#if defined(ENABLE_STATISTICS)
|| opt_getcompilingtime || opt_stat
-diff -r c7bf150bfa46 src/vm/vm.hpp
---- a/src/vm/vm.hpp Fri Mar 11 23:35:56 2011 +0100
-+++ b/src/vm/vm.hpp Fri Apr 01 16:16:07 2011 +0200
+Index: cacao/src/vm/vm.hpp
+===================================================================
+--- cacao.orig/src/vm/vm.hpp 2011-03-08 13:13:00.000000000 +0100
++++ cacao/src/vm/vm.hpp 2011-05-10 11:51:48.554844342 +0200
@@ -64,6 +64,7 @@
bool _initializing;
bool _created;
diff --git a/recipes/crda/crda_1.1.1.bb b/recipes/crda/crda_1.1.1.bb
index cc19b908f8..b45c7bcc36 100644
--- a/recipes/crda/crda_1.1.1.bb
+++ b/recipes/crda/crda_1.1.1.bb
@@ -3,15 +3,16 @@ HOMEPAGE = "http://wireless.kernel.org/en/developers/Regulatory/CRDA"
SECTION = "base"
PRIORITY = "optional"
LICENSE = "ISC"
-PR = "r1"
+PR = "r2"
DEPENDS = "libgcrypt libnl python-native python-m2crypto-native"
RDEPENDS_${PN} = "udev"
SRC_URI = "http://wireless.kernel.org/download/crda/${P}.tar.bz2;name=crda \
- http://wireless.kernel.org/download/wireless-regdb/regulatory.bins/2009.11.25-regulatory.bin;name=reg \
+ http://wireless.kernel.org/download/wireless-regdb/regulatory.bins/2011.04.28-regulatory.bin;name=reg \
"
+EXTRA_OEMAKE = "MAKEFLAGS="
do_compile() {
oe_runmake all_noverify
}
@@ -19,13 +20,13 @@ do_compile() {
do_install() {
oe_runmake DESTDIR=${D} install
install -d ${D}/usr/lib/crda/
- install -m 0644 ${WORKDIR}/2009.11.25-regulatory.bin ${D}/usr/lib/crda/regulatory.bin
+ install -m 0644 ${WORKDIR}/2011.04.28-regulatory.bin ${D}/usr/lib/crda/regulatory.bin
}
SRC_URI[crda.md5sum] = "5fc77af68b3e21736b8ef2f8b061c810"
SRC_URI[crda.sha256sum] = "59b4760da44a8f803caeaaa7fb97e0c6bd3f35f40445b28258e7f14c2fbe13b5"
-SRC_URI[reg.md5sum] = "873b5c55a26c8ba7674e083f51cb10aa"
-SRC_URI[reg.sha256sum] = "3ac77fa4d8034e4f5bc484adc4b073c3636dea26803e5e695cc54c15b629154a"
+SRC_URI[reg.md5sum] = "1535e98bcaba732e2f8e8f62dac6f369"
+SRC_URI[reg.sha256sum] = "bb6ba6f5dcdf7106a19c588b0e4d43ab7af26f6474fe01011a318b3dceaba33b"
FILES_${PN} += "\
/lib/udev/rules.d/85-regulatory.rules \
diff --git a/recipes/dri/libdrm-2.4.23/glamo.patch b/recipes/dri/libdrm-2.4.25/glamo.patch
index b397ded580..b397ded580 100644
--- a/recipes/dri/libdrm-2.4.23/glamo.patch
+++ b/recipes/dri/libdrm-2.4.25/glamo.patch
diff --git a/recipes/dri/libdrm-2.4.25/installtests.patch b/recipes/dri/libdrm-2.4.25/installtests.patch
new file mode 100644
index 0000000000..2704ee6c6b
--- /dev/null
+++ b/recipes/dri/libdrm-2.4.25/installtests.patch
@@ -0,0 +1,49 @@
+tests: also install tests app
+
+Upstream-Status: Pending
+
+Signed-off-by: Yu Ke <ke.yu@intel.com>
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index bf1987f..d909e19 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -6,10 +6,11 @@ AM_CPPFLAGS = \
+
+ LDADD = $(top_builddir)/libdrm.la
+
+-check_PROGRAMS = \
++bin_PROGRAMS = \
+ dristat \
+ drmstat
+
++check_PROGRAMS =
+ SUBDIRS = modeprint
+
+ if HAVE_LIBKMS
+diff --git a/tests/modeprint/Makefile.am b/tests/modeprint/Makefile.am
+index c4862ac..7db76ea 100644
+--- a/tests/modeprint/Makefile.am
++++ b/tests/modeprint/Makefile.am
+@@ -2,7 +2,7 @@ AM_CFLAGS = \
+ -I$(top_srcdir)/include/drm \
+ -I$(top_srcdir)
+
+-noinst_PROGRAMS = \
++bin_PROGRAMS = \
+ modeprint
+
+ modeprint_SOURCES = \
+diff --git a/tests/modetest/Makefile.am b/tests/modetest/Makefile.am
+index 2191242..1d2c1b0 100644
+--- a/tests/modetest/Makefile.am
++++ b/tests/modetest/Makefile.am
+@@ -4,7 +4,7 @@ AM_CFLAGS = \
+ -I$(top_srcdir) \
+ $(CAIRO_CFLAGS)
+
+-noinst_PROGRAMS = \
++bin_PROGRAMS = \
+ modetest
+
+ modetest_SOURCES = \
diff --git a/recipes/dri/libdrm.inc b/recipes/dri/libdrm.inc
deleted file mode 100644
index 549611136f..0000000000
--- a/recipes/dri/libdrm.inc
+++ /dev/null
@@ -1,20 +0,0 @@
-SECTION = "x11/base"
-LICENSE = "MIT"
-SRC_URI = "http://dri.freedesktop.org/libdrm/libdrm-${PV}.tar.bz2"
-PROVIDES = "drm"
-DEPENDS = "libpthread-stubs cairo"
-
-INC_PR = "r7"
-PE = "1"
-
-inherit autotools pkgconfig
-
-PACKAGES =+ "${PN}-drivers ${PN}-kms ${@base_contains('MACHINE_FEATURES', 'x86', '${PN}-intel', '',d)}"
-FILES_${PN}-drivers = "${libdir}/libdrm_*.so.*"
-FILES_${PN}-intel = "${libdir}/libdrm_intel.so.*"
-FILES_${PN}-kms = "${libdir}/libkms*.so.*"
-
-EXTRA_OECONF_append = " ${@base_contains('MACHINE_FEATURES', 'x86', '', '--disable-intel --disable-radeon',d)}"
-EXTRA_OECONF_append_shr = " --enable-glamo-experimental-api"
-
-LEAD_SONAME = "libdrm.so"
diff --git a/recipes/dri/libdrm_2.4.23.bb b/recipes/dri/libdrm_2.4.23.bb
deleted file mode 100644
index f4feae51b7..0000000000
--- a/recipes/dri/libdrm_2.4.23.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-require libdrm.inc
-
-PR = "${INC_PR}.0"
-
-SRC_URI += "file://glamo.patch"
-
-SRC_URI[md5sum] = "7577ff36ec364d88fae466d4f7fc5fc6"
-SRC_URI[sha256sum] = "c0f06d68c3edba7a1ad937f5481a8c287efd4cd368cee66cd9e678b06a911c18"
-
-do_compile_prepend_libc-uclibc() {
- eval "${@base_contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "/_FILE_OFFSET_BITS/d" ${S}/libkms/intel.c', d)}"
- eval "${@base_contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "/_FILE_OFFSET_BITS/d" ${S}/libkms/vmwgfx.c', d)}"
- eval "${@base_contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "/_FILE_OFFSET_BITS/d" ${S}/libkms/nouveau.c', d)}"
-}
diff --git a/recipes/dri/libdrm_2.4.25.bb b/recipes/dri/libdrm_2.4.25.bb
new file mode 100644
index 0000000000..4ffdcac9fc
--- /dev/null
+++ b/recipes/dri/libdrm_2.4.25.bb
@@ -0,0 +1,37 @@
+SUMMARY = "Userspace interface to the kernel DRM services"
+DESCRIPTION = "The runtime library for accessing the kernel DRM services. DRM \
+stands for \"Direct Rendering Manager\", which is the kernel portion of the \
+\"Direct Rendering Infrastructure\" (DRI). DRI is required for many hardware \
+accelerated OpenGL drivers."
+HOMEPAGE = "http://dri.freedesktop.org"
+SECTION = "x11/base"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://xf86drm.c;beginline=9;endline=32;md5=c8a3b961af7667c530816761e949dc71"
+SRC_URI = "http://dri.freedesktop.org/libdrm/libdrm-${PV}.tar.bz2"
+PROVIDES = "drm"
+DEPENDS = "libpthread-stubs udev cairo virtual/libx11"
+
+inherit autotools pkgconfig
+
+PACKAGES =+ "${PN}-tests ${PN}-drivers ${PN}-kms ${@base_contains('MACHINE_FEATURES', 'x86', '${PN}-intel', '',d)}"
+FILES_${PN}-tests = "${bindir}/dr* ${bindir}/mode*"
+FILES_${PN}-drivers = "${libdir}/libdrm_*.so.*"
+FILES_${PN}-intel = "${libdir}/libdrm_intel.so.*"
+FILES_${PN}-kms = "${libdir}/libkms*.so.*"
+
+LEAD_SONAME = "libdrm.so"
+
+EXTRA_OECONF_append = " ${@base_contains('MACHINE_FEATURES', 'x86', '', '--disable-intel --disable-radeon',d)}"
+EXTRA_OECONF_append_shr = " --enable-glamo-experimental-api"
+
+SRC_URI += "file://installtests.patch"
+SRC_URI += "file://glamo.patch"
+
+SRC_URI[md5sum] = "f53dc4c72109b17908e4113c3b8addfe"
+SRC_URI[sha256sum] = "51f99a815a18876977991bbc6f190607791d25a6e47a3269880ce7679dbd0e9f"
+
+do_compile_prepend_libc-uclibc() {
+ eval "${@base_contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "/_FILE_OFFSET_BITS/d" ${S}/libkms/intel.c', d)}"
+ eval "${@base_contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "/_FILE_OFFSET_BITS/d" ${S}/libkms/vmwgfx.c', d)}"
+ eval "${@base_contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "/_FILE_OFFSET_BITS/d" ${S}/libkms/nouveau.c', d)}"
+}
diff --git a/recipes/dri/libdrm_git.bb b/recipes/dri/libdrm_git.bb
deleted file mode 100644
index e1966310f6..0000000000
--- a/recipes/dri/libdrm_git.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-require libdrm.inc
-SRC_URI = "git://anongit.freedesktop.org/mesa/drm;protocol=git;branch=master"
-SRC_URI_shr = "git://git.bitwiz.org.uk/libdrm.git;protocol=git;branch=glamo"
-
-DEPENDS = "libpthread-stubs virtual/kernel"
-
-PR = "${INC_PR}.0"
-
-PV = "2.4.20+gitr${SRCPV}"
-
-SRCREV = "a3305b076c005e0d3bd55da0214e91413cf65b48"
-SRCREV_shr = "9411b0ca002b34d2d13a132038170c2e7b08945c"
-
-DEFAULT_PREFERENCE = "-1"
-
-S = "${WORKDIR}/git"
-
-EXTRA_OECONF_append_shr = " --enable-glamo-experimental-api --disable-radeon --disable-intel"
diff --git a/recipes/dvnixload/dvnixload_0.2.6.bb b/recipes/dvnixload/dvnixload_0.2.6.bb
index a0bae350aa..80a4dfac56 100644
--- a/recipes/dvnixload/dvnixload_0.2.6.bb
+++ b/recipes/dvnixload/dvnixload_0.2.6.bb
@@ -1,7 +1,7 @@
DESCRIPTION = "UBL and second stage bootloader flasher for davinci"
HOMEPAGE = "http://www.hugovil.com/en/dvnixload/"
LICENSE = "GPLv2"
-SRC_URI = "http://www.hugovil.com/repository/dvnixload-0.2.6.tar.gz"
+SRC_URI = "http://www.hugovil.com/repository/dvnixload/dvnixload-0.2.6.tar.gz"
inherit autotools
diff --git a/recipes/e17/e-wm_svn.bb b/recipes/e17/e-wm_svn.bb
index baed2334bc..04996b38ad 100644
--- a/recipes/e17/e-wm_svn.bb
+++ b/recipes/e17/e-wm_svn.bb
@@ -4,7 +4,7 @@ LICENSE = "MIT BSD"
LIC_FILES_CHKSUM = "file://COPYING;md5=f523ab5986cc79b52a90d2ac3d5454a2"
SRCNAME = "e"
PV = "0.16.999.060+svnr${SRCPV}"
-PR = "r19"
+PR = "r20"
SRCREV = "${EFL_SRCREV}"
inherit e update-alternatives gettext
diff --git a/recipes/efl1/efreet_svn.bb b/recipes/efl1/efreet_svn.bb
index df7903bb42..179c374f79 100644
--- a/recipes/efl1/efreet_svn.bb
+++ b/recipes/efl1/efreet_svn.bb
@@ -1,11 +1,11 @@
require efreet.inc
-SRCREV = "${EFL_SRCREV}"
+SRCREV = "56910"
PV = "1.0.999+svnr${SRCPV}"
PR = "${INC_PR}.0"
-DEFAULT_PREFERENCE = "-1"
SRC_URI = "\
${E_SVN}/trunk;module=${SRCNAME};proto=http;scmdata=keep \
+ file://changeset_trunk_r57435.patch;maxrev=57434 \
"
S = "${WORKDIR}/${SRCNAME}"
diff --git a/recipes/eglibc/eglibc_2.12.bb b/recipes/eglibc/eglibc_2.12.bb
index db0f707ab1..3fb565439a 100644
--- a/recipes/eglibc/eglibc_2.12.bb
+++ b/recipes/eglibc/eglibc_2.12.bb
@@ -6,7 +6,7 @@ FILESPATHPKG =. "eglibc-svn:"
PV = "2.12"
PR = "${INC_PR}.8"
PR_append = "+svnr${SRCPV}"
-SRCREV="12323"
+SRCREV="13230"
EGLIBC_BRANCH="eglibc-2_12"
SRC_URI = "svn://svn.eglibc.org/branches;module=${EGLIBC_BRANCH};proto=svn \
file://eglibc-svn-arm-lowlevellock-include-tls.patch \
diff --git a/recipes/freescale/elftosb/uclibc_and_eglibc_have_no_powf.patch b/recipes/freescale/elftosb/uclibc_and_eglibc_have_no_powf.patch
new file mode 100644
index 0000000000..78740230bf
--- /dev/null
+++ b/recipes/freescale/elftosb/uclibc_and_eglibc_have_no_powf.patch
@@ -0,0 +1,12 @@
+--- a/elftosb2/ElftosbAST.cpp.old 2010-09-20 15:28:03.000000000 +0200
++++ b/elftosb2/ElftosbAST.cpp 2011-04-18 22:25:54.000000000 +0200
+@@ -755,7 +755,8 @@
+ #ifdef WIN32
+ result = 0;
+ #else
+- result = lroundf(powf(float(leftValue), float(rightValue)));
++ //result = lroundf(powf(float(leftValue), float(rightValue)));
++ result = 0;
+ #endif
+ break;
+ case kBitwiseAnd:
diff --git a/recipes/freescale/elftosb_10.12.01.bb b/recipes/freescale/elftosb_10.12.01.bb
new file mode 100644
index 0000000000..9fc18a0cda
--- /dev/null
+++ b/recipes/freescale/elftosb_10.12.01.bb
@@ -0,0 +1,20 @@
+LICENSE = "FREESCALE"
+PR = "r0"
+
+SRC_URI = "http://foss.doredevelopment.dk/mirrors/imx/elftosb-${PV}.tar.gz \
+ file://uclibc_and_eglibc_have_no_powf.patch"
+
+SRC_URI[md5sum] = "e8005d606c1e0bb3507c82f6eceb3056"
+SRC_URI[sha256sum] = "77bb6981620f7575b87d136d94c7daa88dd09195959cc75fc18b138369ecd42b"
+
+BBCLASSEXTEND = "native"
+
+do_install() {
+ install -d ${D}${bindir}
+ install ${S}/bld/linux/elftosb ${D}${bindir}/
+ install ${S}/bld/linux/keygen ${D}${bindir}/
+ install ${S}/bld/linux/sbtool ${D}${bindir}/
+}
+
+NATIVE_INSTALL_WORKS = "1"
+
diff --git a/recipes/freesmartphone/aurora/aurora-daemon b/recipes/freesmartphone/aurora/aurora-daemon
new file mode 100644
index 0000000000..3c57fc3949
--- /dev/null
+++ b/recipes/freesmartphone/aurora/aurora-daemon
@@ -0,0 +1,44 @@
+#! /bin/sh
+#
+# aurora-daemon -- This shell script starts and stops the FSO feature phone client
+#
+# chkconfig: 345 90 10
+# description: aurora is the feature phone client for the FSO framework
+# processname: aurora
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+NAME=aurora
+
+[ -f /etc/default/rcS ] && . /etc/default/rcS
+
+# to get the correct configuration of the touchscreen as /etc/profile is maybe not
+# evaluated at this time.
+[ -f /etc/profile.d/qte.sh ] && . /etc/profile.d/qte.sh
+
+case "$1" in
+ start)
+ echo -n "Starting aurora-daemon: "
+ start-stop-daemon --start --pidfile /var/run/${NAME}.pid --make-pidfile --background -x /usr/bin/${NAME} -- -qws
+ if [ $? = 0 ]; then
+ echo "(ok)"
+ else
+ echo "(failed)"
+ fi
+ ;;
+ stop)
+ echo -n "Stopping aurora-daemon: "
+ start-stop-daemon --stop --pidfile /var/run/${NAME}.pid --oknodo
+ rm -f /var/run/${NAME}.pid
+ echo "(done)"
+ ;;
+ restart|force-reload)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "Usage: /etc/init.d/aurora-daemon {start|stop|restart|force-reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/recipes/freesmartphone/aurora_git.bb b/recipes/freesmartphone/aurora_git.bb
new file mode 100644
index 0000000000..f321c530ab
--- /dev/null
+++ b/recipes/freesmartphone/aurora_git.bb
@@ -0,0 +1,46 @@
+DESCRIPTION = "Aurora is the new phone UI for the FreeSmartphone framework. It is \
+clean and simple and is build on top of the powerful Declarative component of the Qt framework."
+AUTHOR = "Simon Busch <morphis@gravedo.de>"
+HOMEPAGE = "http://www.freesmartphone.org"
+SECTION = "fso"
+LICENSE = "GPLv2"
+SRCREV = "1043282ce2c9e7c8378c3ab6477e146cfe507577"
+PV = "0.1.0+gitr${SRCPV}"
+PR = "r6"
+
+SRC_URI = "\
+ ${FREESMARTPHONE_GIT}/aurora.git;protocol=git;branch=master \
+ file://aurora-daemon \
+"
+S = "${WORKDIR}/git/aurora"
+
+DEPENDS = "shiboken-native libshiboken python"
+
+RDEPENDS_${PN} = "\
+ python-logging \
+ python-textutils \
+ python-dbus \
+ python-pyside-embedded \
+ python-pygobject \
+ python-phoneutils \
+"
+
+inherit autotools python-dir update-rc.d
+
+QT_DIR_NAME = "qtopia"
+EXTRA_OECONF_append = "--enable-qws-support --with-qt-basedir=${QT_DIR_NAME}"
+
+INITSCRIPT_NAME = "aurora-daemon"
+INITSCRIPT_PARAMS = "defaults 90"
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/init.d/
+ install -m 0755 ${WORKDIR}/${INITSCRIPT_NAME} ${D}${sysconfdir}/init.d/
+}
+
+PACKAGES = "${PN}-dbg ${PN}"
+FILES_${PN}-dbg += "${libdir}/${QT_DIR_NAME}/imports/Aurora/*/.debug"
+FILES_${PN} += " \
+ ${PYTHON_SITEPACKAGES_DIR}/aurora \
+ ${libdir}/${QT_DIR_NAME}/imports/Aurora \
+"
diff --git a/recipes/freesmartphone/cornucopia.inc b/recipes/freesmartphone/cornucopia.inc
index d1a41d686e..9869d51836 100644
--- a/recipes/freesmartphone/cornucopia.inc
+++ b/recipes/freesmartphone/cornucopia.inc
@@ -8,7 +8,7 @@ DEPENDS = "vala-native glib-2.0 libfso-glib libgee"
DEPENDS += "${@['libfsoframework', ''][(bb.data.getVar('PN', d, 1) in 'libfsoframework libfsobasics'.split())]}"
PV = "invalid, please override"
-FSO_CORNUCOPIA_SRCREV ?= "bc407cbeb930e721375e5dd2e0a777479a5d5bb5"
+FSO_CORNUCOPIA_SRCREV ?= "cc88bb83bbcb98f4cc8b799b58c4901642a140ca"
INC_PR = "r5"
SRC_URI = "${FREESMARTPHONE_GIT}/cornucopia;protocol=git;branch=master"
diff --git a/recipes/freesmartphone/fso-specs_git.bb b/recipes/freesmartphone/fso-specs_git.bb
index af98f0aa37..6c99bfea1b 100644
--- a/recipes/freesmartphone/fso-specs_git.bb
+++ b/recipes/freesmartphone/fso-specs_git.bb
@@ -5,8 +5,8 @@ LICENSE = "CC-BY-SA"
LIC_FILES_CHKSUM = "file://COPYING;md5=ebef999b5d8aea38d9eb30772557f175"
DEPENDS = "libxslt-native"
SECTION = "devel/specifications"
-SRCREV = "d8a8104b703027a230cff64f7995c5cf4276c167"
-PV = "2011.04.15.1+gitr${SRCPV}"
+SRCREV = "feedad3d03bba6cab6ddc0441a359a27eacf9817"
+PV = "2011.05.18.1+gitr${SRCPV}"
PE = "1"
SRC_URI = "${FREESMARTPHONE_GIT}/specs.git;protocol=git;branch=master"
diff --git a/recipes/freesmartphone/fsoaudiod_git.bb b/recipes/freesmartphone/fsoaudiod_git.bb
index 57540c19e2..a6f1933b92 100644
--- a/recipes/freesmartphone/fsoaudiod_git.bb
+++ b/recipes/freesmartphone/fsoaudiod_git.bb
@@ -14,7 +14,7 @@ DEPENDS += "alsa-lib"
SRCREV = "${FSO_CORNUCOPIA_SRCREV}"
PV = "0.1.0+gitr${SRCPV}"
PE = "2"
-PR = "${INC_PR}.2"
+PR = "${INC_PR}.3"
inherit update-rc.d
@@ -33,3 +33,8 @@ do_install_append() {
install -d ${D}${sysconfdir}/init.d/
install -m 0755 ${WORKDIR}/fsoaudiod ${D}${sysconfdir}/init.d/
}
+
+PACKAGES =+ "${PN}-alsa-plugins ${PN}-alsa-plugins-dbg ${PN}-alsa-plugins-dev"
+FILES_${PN}-alsa-plugins = "${libdir}/alsa-lib/fsoaudio_session.so"
+FILES_${PN}-alsa-plugins-dev = "${libdir}/alsa-lib/fsoaudio_session.la"
+FILES_${PN}-alsa-plugins-dbg = "${libdir}/alsa-lib/.debug/fsoaudio_session.so"
diff --git a/recipes/freesmartphone/fsogsmd_git.bb b/recipes/freesmartphone/fsogsmd_git.bb
index 3e3e3efca2..52c602bf56 100644
--- a/recipes/freesmartphone/fsogsmd_git.bb
+++ b/recipes/freesmartphone/fsogsmd_git.bb
@@ -55,12 +55,6 @@ FILES_${PN}-module-modem-qualcomm-htc-dev = "${CORNUCOPIA_MODULE_DIR}/modem_qual
FILES_${PN}-module-modem-qualcomm-htc-dbg = "${CORNUCOPIA_MODULE_DIR}/.debug/modem_qualcomm_htc*"
RDEPENDS_${PN}-config_htcdream += "${PN}-module-modem-qualcomm-htc"
-PACKAGES =+ "${PN}-module-lowlevel-nokia900 ${PN}-module-lowlevel-nokia900-dev ${PN}-module-lowlevel-nokia900-dbg"
-FILES_${PN}-module-lowlevel-nokia900 = "${CORNUCOPIA_MODULE_DIR}/lowlevel_nokia900.so"
-FILES_${PN}-module-lowlevel-nokia900-dev = "${CORNUCOPIA_MODULE_DIR}/lowlevel_nokia900.la"
-FILES_${PN}-module-lowlevel-nokia900-dbg = "${CORNUCOPIA_MODULE_DIR}/.debug/lowlevel_nokia900*"
-RDEPENDS_${PN}-config_nokia900 += "${PN}-module-lowlevel-nokia900"
-
PACKAGES =+ "${PN}-module-modem-nokia-isi ${PN}-module-modem-nokia-isi-dev ${PN}-module-modem-nokia-isi-dbg"
FILES_${PN}-module-modem-nokia-isi = "${CORNUCOPIA_MODULE_DIR}/modem_nokia_isi.so"
FILES_${PN}-module-modem-nokia-isi-dev = "${CORNUCOPIA_MODULE_DIR}/modem_nokia_isi.la"
diff --git a/recipes/freesmartphone/libfso-glib_git.bb b/recipes/freesmartphone/libfso-glib_git.bb
index a43a5c3928..30a15212f5 100644
--- a/recipes/freesmartphone/libfso-glib_git.bb
+++ b/recipes/freesmartphone/libfso-glib_git.bb
@@ -4,8 +4,8 @@ LICENSE = "LGPLv2.1"
LIC_FILES_CHKSUM = "file://COPYING;md5=fad9b3332be894bab9bc501572864b29"
SECTION = "devel"
DEPENDS = "vala-dbus-binding-tool-native glib-2.0 fso-specs"
-SRCREV = "592ddbc1c05decb5dc69cde7063fb3e3056e7ee6"
-PV = "2011.04.15.1+gitr${SRCPV}"
+SRCREV = "a20d2a99764331b6d82d479336fa90b910724ad3"
+PV = "2011.05.18.1+gitr${SRCPV}"
PE = "1"
inherit autotools vala
diff --git a/recipes/freesmartphone/libgisi_git.bb b/recipes/freesmartphone/libgisi_git.bb
index 0da9fc247a..c503640887 100644
--- a/recipes/freesmartphone/libgisi_git.bb
+++ b/recipes/freesmartphone/libgisi_git.bb
@@ -7,7 +7,7 @@ DEPENDS = "glib-2.0"
SRC_URI = "${FREESMARTPHONE_GIT}/libgisi.git;protocol=git;branch=master"
S = "${WORKDIR}/git"
-SRCREV = "40ae784c8ee36ee5411ce20627ff8522a9bff1ac"
+SRCREV = "c993ee694ea98597d619a1ffae397d3416233354"
PV = "0.1.0+gitr${SRCPV}"
inherit vala autotools
diff --git a/recipes/freesmartphone/msmcomm.inc b/recipes/freesmartphone/msmcomm.inc
index 74e63184af..826b92f4ef 100644
--- a/recipes/freesmartphone/msmcomm.inc
+++ b/recipes/freesmartphone/msmcomm.inc
@@ -7,6 +7,6 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
INC_PR = "r4"
PV = "Please override!"
-SRCREV = "4b0e59936eb15fcb9fa4c83edca106cf4e4a5eb0"
+SRCREV = "856bd8fca6e1b1142dd89b22b1628243f467e455"
SRC_URI = "${FREESMARTPHONE_GIT}/msmcomm.git;protocol=git;branch=master"
diff --git a/recipes/freesmartphone/qfsodbusxml2cpp-native_git.bb b/recipes/freesmartphone/qfsodbusxml2cpp-native_git.bb
new file mode 100644
index 0000000000..34d021fe12
--- /dev/null
+++ b/recipes/freesmartphone/qfsodbusxml2cpp-native_git.bb
@@ -0,0 +1,12 @@
+DESCRIPTION = "FSO's variant of the qdbusxml2cpp utility"
+SECTION = "devel"
+DEPENDS = "qt4-native"
+LICENSE = "LGPLv2"
+INC_PR = "r0"
+
+SRCREV = "de705c0b633c612aedb1273340c36fae59be9511"
+
+SRC_URI = "${FREESMARTPHONE_GIT}/qfsodbusxml2cpp.git;protocol=git;branch=master"
+S = "${WORKDIR}/git"
+
+inherit autotools native
diff --git a/recipes/gammu/gammu_1.26.1.bb b/recipes/gammu/gammu_1.29.0.bb
index 7b88a525ac..c22bb915e1 100644
--- a/recipes/gammu/gammu_1.26.1.bb
+++ b/recipes/gammu/gammu_1.29.0.bb
@@ -1,6 +1,6 @@
DESCRIPTION = "GNU All Mobile Managment Utilities"
SECTION = "console/network"
-DEPENDS = "bluez-libs cmake-native python mysql"
+DEPENDS = "bluez-libs cmake-native curl python mysql"
RDEPENDS_python-${PN} = "python-core"
LICENSE = "GPL"
HOMEPAGE = "http://www.gammu.org/"
@@ -10,20 +10,15 @@ SRC_URI = "http://dl.cihar.com/gammu/releases/gammu-${PV}.tar.bz2"
inherit distutils-common-base cmake
+# FIXME: Ugly!
+PYTHON_VERSION = "2.6"
do_configure() {
cd ${S}
- sed -i 's@^cmake [^$]*\$@cmake -DCMAKE_FIND_ROOT_PATH=${STAGING_DIR_TARGET} $@' configure
+ sed -i 's@^cmake [^$]*\$@cmake -DCMAKE_FIND_ROOT_PATH=${STAGING_DIR_TARGET} -DPYTHON_INCLUDE_DIR=${STAGING_INCDIR}/python${PYTHON_VERSION} $@' configure
sed -i 's@\${PYTHON_SITEDIR}@${PYTHON_SITEPACKAGES_DIR}@g' python/gammu/CMakeLists.txt
./configure --prefix=${prefix} --enable-shared --enable-backup
}
-# gammu has a non-standard uninstalled .pc file, which confuses pkgconfig.bbclass.
-# Replace it by custom do_stage_append():
-#do_stage_append () {
-# install -d ${PKG_CONFIG_DIR}
-# cat build-configure/cfg/gammu.pc > ${PKG_CONFIG_DIR}/gammu.pc
-#}
-
PACKAGES =+ "${PN}-smsd libgammu libgsmsd python-${PN}"
FILES_${PN} = "${bindir}/gammu ${bindir}/jadmaker ${sysconfdir}/bash_completion.d/gammu"
@@ -34,5 +29,5 @@ FILES_libgammu = "${libdir}/libGammu.so.*"
FILES_libgsmsd = "${libdir}/libgsmsd.so.*"
FILES_python-${PN} = "${PYTHON_SITEPACKAGES_DIR}/gammu/*.??"
-SRC_URI[md5sum] = "ba8caab6b21a2ce0fa668f9403b8319a"
-SRC_URI[sha256sum] = "668eb037af6aa81cc104067dcb8e1cf44000b82a58638cfd485297eec76fda8d"
+SRC_URI[md5sum] = "5a860f37519fab3d2e7a42349b413738"
+SRC_URI[sha256sum] = "0f7c3122e5f5e246b3ce7fb128b42c1d679ebb3f11f805ea17f1ba86400e1bbf"
diff --git a/recipes/glib-2.0/glib-2.0_git.bb b/recipes/glib-2.0/glib-2.0_git.bb
index bee9333aff..3aeb9fc355 100644
--- a/recipes/glib-2.0/glib-2.0_git.bb
+++ b/recipes/glib-2.0/glib-2.0_git.bb
@@ -51,7 +51,7 @@ SRC_URI = "git://git.gnome.org/glib;protocol=git;branch=master \
file://configure-libtool.patch \
file://60_wait-longer-for-threads-to-die.patch \
file://g_once_init_enter.patch \
- file://remove.test.for.qsort_r.patch \
+ file://remove.test.for.qsort_r.patch \
"
SRCREV = "d97cbc6731deab137770bc0fe9c69b06f689f5b4"
PV = "2.29.3"
@@ -68,4 +68,5 @@ do_configure_prepend() {
# missing ${topdir}/gtk-doc.make and --disable-gtk-doc* is not enough, because it calls gtkdocize (not provided by gtk-doc-native)
sed -i '/^docs/d' ${S}/configure.ac
sed -i 's/SUBDIRS = . m4macros glib gmodule gthread gobject gio tests po docs/SUBDIRS = . m4macros glib gmodule gthread gobject gio tests po/g' ${S}/Makefile.am
+ sed -i -e "s:TEST_PROGS += gdbus-serialization::g" ${S}/gio/tests/Makefile.am
}
diff --git a/recipes/gnome/gnome-bluetooth_2.32.0.bb b/recipes/gnome/gnome-bluetooth_2.32.0.bb
index 3ab181ccfe..86f5abcbd8 100644
--- a/recipes/gnome/gnome-bluetooth_2.32.0.bb
+++ b/recipes/gnome/gnome-bluetooth_2.32.0.bb
@@ -3,6 +3,8 @@ LICENSE = "GPL"
SECTION = "x11/gnome"
DEPENDS = "gnome-doc-utils-native obexd obex-data-server gconf gtk+ dbus-glib libunique libnotify hal bluez4 gnome-keyring libx11 libxi"
+PR = "r1"
+
inherit gnome
SRC_URI[archive.md5sum] = "f129686fe46c4c98eb70a0cc85d59cae"
@@ -23,4 +25,5 @@ do_configure_append() {
RRECOMMENDS_${PN} += "obexd obex-data-server"
RCONFLICTS_${PN} = "bluez-gnome"
+FILES_${PN} += "${datadir}/GConf/ ${datadir}/glib-2.0/"
FILES_${PN}-dbg += "${libdir}/gnome-bluetooth/plugins/.debug/"
diff --git a/recipes/gnome/gnome-desktop.inc b/recipes/gnome/gnome-desktop.inc
index b96e34b76a..396f213e3d 100644
--- a/recipes/gnome/gnome-desktop.inc
+++ b/recipes/gnome/gnome-desktop.inc
@@ -3,9 +3,10 @@ SECTION = "x11/gnome"
LICENSE = "GPL"
DEPENDS = "gnome-common libgnomeui"
-PR = "r1"
+PR = "r2"
-EXTRA_OECONF = "--disable-scrollkeeper"
+# FIXME: OE does not contain all recipes to enable doc: failed to load external entity "/usr/share/xml/gnome/xslt/docbook/omf/db2omf.xsl"
+EXTRA_OECONF = "--disable-scrollkeeper --disable-gtk-doc"
do_configure_prepend () {
cp ${STAGING_DATADIR}/gnome-common/data/omf.make ${S}
diff --git a/recipes/gnuradio/gnuradio-git/0001-volk-Remove-all-traces-of-volk-from-configure-for-OE.patch b/recipes/gnuradio/gnuradio-git/0001-volk-Remove-all-traces-of-volk-from-configure-for-OE.patch
new file mode 100644
index 0000000000..e2f674b752
--- /dev/null
+++ b/recipes/gnuradio/gnuradio-git/0001-volk-Remove-all-traces-of-volk-from-configure-for-OE.patch
@@ -0,0 +1,42 @@
+From 857c38eb8201e2a34b524fcabea21b1accbdb288 Mon Sep 17 00:00:00 2001
+From: Philip Balister <philip@opensdr.com>
+Date: Fri, 13 May 2011 12:26:14 -0400
+Subject: [PATCH] volk : Remove all traces of volk from configure for OE builds.
+
+Signed-off-by: Philip Balister <philip@opensdr.com>
+---
+ Makefile.common | 4 ++--
+ configure.ac | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile.common b/Makefile.common
+index 20b8a78..aeda1dd 100644
+--- a/Makefile.common
++++ b/Makefile.common
+@@ -92,8 +92,8 @@ GRUEL_INCLUDES = @gruel_INCLUDES@
+ GRUEL_LA = @gruel_LA@
+
+ # How to link in the VOLK library from inside the tree
+-VOLK_INCLUDES = @volk_INCLUDES@
+-VOLK_LA = @volk_LA@
++#VOLK_INCLUDES = @volk_INCLUDES@
++#VOLK_LA = @volk_LA@
+
+ # How to link in the USRP library from inside the tree
+ USRP_INCLUDES = @usrp_INCLUDES@
+diff --git a/configure.ac b/configure.ac
+index 73ebbd6..e5cf7a2 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -349,7 +349,7 @@ AC_ARG_ENABLE(
+
+ build_dirs="config"
+ GRC_GRUEL dnl must come first
+-GRC_VOLK
++dnl GRC_VOLK
+ GRC_GCELL
+ GRC_GNURADIO_CORE
+ GRC_USRP
+--
+1.7.3.4
+
diff --git a/recipes/gnuradio/gnuradio_git.bb b/recipes/gnuradio/gnuradio_git.bb
index bc18d9e765..cf3bf5d408 100644
--- a/recipes/gnuradio/gnuradio_git.bb
+++ b/recipes/gnuradio/gnuradio_git.bb
@@ -1,15 +1,18 @@
require recipes/gnuradio/gnuradio.inc
PR = "${INC_PR}.1"
-PV = "3.3.0-${PR}+gitr${SRCREV}"
+PV = "3.4.0-${PR}+gitr${SRCREV}"
-SRCREV = "cdca1c917626f7c63f820da921a17187efc92cd5"
+SRCREV = "f53fef3d2bc39b2020b8bce3d88b43569dd16605"
# Make it easy to test against developer repos and branches
GIT_REPO = "gnuradio.git"
-GIT_BRANCH = "next"
+GIT_BRANCH = "master"
+
+FILESPATHPKG_prepend = "gnuradio-git:"
SRC_URI = "git://gnuradio.org/git/${GIT_REPO};branch=${GIT_BRANCH};protocol=http \
+ file://0001-volk-Remove-all-traces-of-volk-from-configure-for-OE.patch \
"
S="${WORKDIR}/git"
diff --git a/recipes/images/angstrom-systemd-image.bb b/recipes/images/angstrom-systemd-image.bb
new file mode 100644
index 0000000000..9e2133522b
--- /dev/null
+++ b/recipes/images/angstrom-systemd-image.bb
@@ -0,0 +1,19 @@
+#Angstrom image to test systemd
+
+IMAGE_PREPROCESS_COMMAND = "create_etc_timestamp"
+
+IMAGE_INSTALL = " \
+ busybox \
+ bash-sh \
+ dropbear \
+ e2fsprogs-e2fsck \
+ avahi-daemon avahi-utils \
+ connman connman-plugin-loopback connman-plugin-ethernet connman-plugin-wifi"
+
+IMAGE_DEV_MANAGER = "udev"
+IMAGE_INIT_MANAGER = "systemd"
+IMAGE_INITSCRIPTS = " "
+IMAGE_LOGIN_MANAGER = "tinylogin shadow"
+
+
+inherit image
diff --git a/recipes/images/aurora-fb-image.bb b/recipes/images/aurora-fb-image.bb
new file mode 100644
index 0000000000..a561394236
--- /dev/null
+++ b/recipes/images/aurora-fb-image.bb
@@ -0,0 +1,15 @@
+###############################################################################
+# Aurora Framebuffer Image
+###############################################################################
+
+require aurora-image.inc
+
+TOUCH = ' ${@base_contains("MACHINE_FEATURES", "touchscreen", "tslib tslib-calibrate tslib-tests", "",d)}'
+
+export IMAGE_BASENAME = "aurora-fb-image"
+
+IMAGE_INSTALL += " \
+ task-qt4e-base \
+ ${TOUCH} \
+ pointercal \
+"
diff --git a/recipes/images/aurora-image.inc b/recipes/images/aurora-image.inc
new file mode 100644
index 0000000000..86289a5e6d
--- /dev/null
+++ b/recipes/images/aurora-image.inc
@@ -0,0 +1,24 @@
+###############################################################################
+# Aurora Base Image
+###############################################################################
+
+PV = "0.1"
+
+IMAGE_DEBUG_APPEND = '${@base_conditional("DISTRO_TYPE", "debug", "gdb strace mdbus2", "",d)}'
+
+IMAGE_INSTALL = " \
+ task-base \
+ task-cli-tools \
+ task-cli-tools-python \
+ task-fso2-compliance \
+ \
+ ttf-ubuntu-sans \
+ aurora \
+ \
+ ${IMAGE_DEBUG_APPEND} \
+"
+IMAGE_PREPROCESS_COMMAND = "create_etc_timestamp"
+export IMAGE_BASENAME = "aurora-image"
+
+inherit image
+
diff --git a/recipes/images/console-at91sam9-image.bb b/recipes/images/console-at91sam9-image.bb
index 8b066e283f..7aae0fb13e 100644
--- a/recipes/images/console-at91sam9-image.bb
+++ b/recipes/images/console-at91sam9-image.bb
@@ -3,17 +3,16 @@
IMAGE_PREPROCESS_COMMAND = "create_etc_timestamp"
ANGSTROM_EXTRA_INSTALL += " \
- alsa-utils-amixer \
+ usbview \
+ mplayer \
+ thttpd \
+ madplay \
alsa-utils-aplay \
- dosfstools \
+ alsa-utils-amixer \
iperf \
- madplay \
- mplayer \
+ dosfstools \
mtd-utils \
# nbench-byte \
- owl-wifi \
- thttpd \
- usbview \
"
DEPENDS = "task-base-extended \
diff --git a/recipes/images/shr-image.inc b/recipes/images/shr-image.inc
index 29c60af033..462f05eb54 100644
--- a/recipes/images/shr-image.inc
+++ b/recipes/images/shr-image.inc
@@ -10,6 +10,7 @@ IMAGE_LOGIN_MANAGER = "shadow"
IMAGE_DEV_MANAGER_om-gta01 = ""
IMAGE_DEV_MANAGER_om-gta02 = ""
IMAGE_DEV_MANAGER_htcdream = ""
+IMAGE_DEV_MANAGER_nokia900 = ""
RDEPENDS_${PN} += "\
task-shr-minimal-base \
diff --git a/recipes/images/x11-at91sam9-image.bb b/recipes/images/x11-at91sam9-image.bb
index 39178731a3..d0ca0b64b6 100644
--- a/recipes/images/x11-at91sam9-image.bb
+++ b/recipes/images/x11-at91sam9-image.bb
@@ -1,13 +1,20 @@
# Angstrom x11-gpe-image with additional apps included
XSERVER = "xserver-xorg \
xf86-input-evdev \
- xf86-input-tslib \
- xf86-video-fbdev "
+ xf86-input-mouse \
+ xf86-video-fbdev \
+ xf86-input-keyboard \
+ xinput-calibrator \
+ "
+# xf86-input-tslib \
+
require x11-gpe-image.bb
export IMAGE_BASENAME = "x11-at91sam9-image"
+# SPLASH = "exquisite exquisite-themes exquisite-theme-angstrom"
+
DEPENDS = "task-base"
IMAGE_INSTALL += "\
@@ -39,17 +46,46 @@ IMAGE_INSTALL += "\
fbv \
dosfstools \
mtd-utils \
- gpe-mini-browser \
+# gpe-mini-browser2 \
tslib-conf \
tslib-calibrate \
tslib-tests \
libstdc++ \
- ${IMAGE_EXTRA_INSTALL} \
+ nano \
# nbench-byte \
-# pointercal \
+ pointercal \
+ gstreamer \
+ gst-plugins-base \
+ gst-plugins-good \
+ gst-plugins-bad \
+ gst-plugins-ugly \
+ gst-plugin-avi \
+ gst-plugin-mpegstream \
+ gst-plugin-qtdemux \
+ gst-plugin-mpegvideoparse \
+ gst-plugin-asf \
+ gst-plugin-alsa \
+ gst-plugin-ossaudio \
+ gst-plugin-audioresample \
+ gst-plugin-audioconvert \
+ gst-plugin-ximagesink \
+ gst-plugin-fbdevsink \
+ gst-plugin-faad \
+ gst-plugin-mad \
+ gst-plugin-playbin \
+ gst-plugin-decodebin \
+ gst-plugin-typefindfunctions \
+ gst-ffmpeg \
+# gst-plugin-on2-8170 \
+# on2-8170-libs \
+ owl-wifi \
"
+IMAGE_PREPROCESS_COMMAND = "create_etc_timestamp"
+
# IMAGE_LINGUAS += " se no dk fi"
+#zap root password for release images
+ROOTFS_POSTPROCESS_COMMAND += '${@base_conditional("DISTRO_TYPE", "release", "zap_root_password; ", "",d)}'
ROOTFS_POSTPROCESS_COMMAND += "set_image_autologin; "
ROOTFS_POSTPROCESS_COMMAND += "install_linguas; "
diff --git a/recipes/images/x11-at91sam9m10-image.bb b/recipes/images/x11-at91sam9m10-image.bb
new file mode 100644
index 0000000000..416ae636a3
--- /dev/null
+++ b/recipes/images/x11-at91sam9m10-image.bb
@@ -0,0 +1,102 @@
+#Angstrom X11 at91sam9 image
+
+XSERVER ?= ""
+
+ANGSTROM_EXTRA_INSTALL += " \
+ gpe-irc \
+ gpe-sketchbook \
+ gpe-filemanager \
+ gpe-tetris \
+ gpe-go \
+ gpe-calendar \
+ gpe-contacts \
+ gpe-edit \
+ gpe-gallery \
+ gpe-calculator \
+ gpe-clock \
+ gpe-terminal \
+ gpe-watch \
+ matchbox-panel-hacks \
+ gpe-scap \
+ gpe-windowlist \
+ gpe-mixer \
+ usbview \
+ mplayer \
+ thttpd \
+ madplay \
+ alsa-utils-aplay \
+ alsa-utils-amixer \
+ iperf \
+ dosfstools \
+ mtd-utils \
+# nbench-byte \
+ gpe-mini-browser \
+ pointercal \
+ gstreamer \
+ gst-plugins-base \
+ gst-plugins-good \
+ gst-plugins-bad \
+ gst-plugins-ugly \
+ gst-plugin-avi \
+ gst-plugin-mpegstream \
+ gst-plugin-qtdemux \
+ gst-plugin-mpegvideoparse \
+ gst-plugin-asf \
+ gst-plugin-alsa \
+ gst-plugin-ossaudio \
+ gst-plugin-audioresample \
+ gst-plugin-audioconvert \
+ gst-plugin-ximagesink \
+ gst-plugin-fbdevsink \
+ gst-plugin-faad \
+ gst-plugin-mad \
+ gst-plugin-playbin \
+ gst-plugin-decodebin \
+ gst-plugin-typefindfunctions \
+ gst-ffmpeg \
+ gst-plugin-on2-8170 \
+ on2-8170-libs \
+ owl-wifi \
+ "
+
+export IMAGE_BASENAME = "x11-at91sam9m10-image"
+
+DEPENDS = "task-base"
+IMAGE_INSTALL = "\
+ ${XSERVER} \
+ task-base-extended \
+ angstrom-x11-base-depends \
+ angstrom-gpe-task-base \
+ angstrom-gpe-task-settings \
+ ${ANGSTROM_EXTRA_INSTALL}"
+
+IMAGE_PREPROCESS_COMMAND = "create_etc_timestamp"
+
+at91sam9m10_rootfs_postprocess() {
+ curdir=$PWD
+ cd ${IMAGE_ROOTFS}
+
+ # add init script to cratee hantro modules /dev files
+ echo 'MAJOR=`cat /proc/devices |grep hx170|cut -f1 -d\ `' >> ${IMAGE_ROOTFS}//etc/init.d/hantro
+ echo 'mknod /dev/hx170 c $MAJOR 0' >> ${IMAGE_ROOTFS}/etc/init.d/hantro
+ echo 'MAJOR=`cat /proc/devices |grep memalloc|cut -f1 -d\ `' >> ${IMAGE_ROOTFS}//etc/init.d/hantro
+ echo 'mknod /dev/memalloc c $MAJOR 0' >> ${IMAGE_ROOTFS}/etc/init.d/hantro
+ chmod a+x ${IMAGE_ROOTFS}/etc/init.d/hantro
+ cd ${IMAGE_ROOTFS}/etc/rc5.d
+ ln -s ../init.d/hantro S51hantro
+
+ # back on track
+ cd $curdir
+}
+
+#zap root password for release images
+ROOTFS_POSTPROCESS_COMMAND += '${@base_conditional("DISTRO_TYPE", "release", "zap_root_password; ", "",d)}'
+ROOTFS_POSTPROCESS_COMMAND += "set_image_autologin; "
+
+#we dont need the kernel in the image
+ROOTFS_POSTPROCESS_COMMAND += "rm -f ${IMAGE_ROOTFS}/boot/*Image*; "
+
+#load sam9m10 vdec modules and create file descriptor at boot
+ROOTFS_POSTPROCESS_COMMAND += "at91sam9m10_rootfs_postprocess; "
+
+inherit image
diff --git a/recipes/iproute2/iproute2-2.6.38/configure-cross.patch b/recipes/iproute2/iproute2-2.6.38/configure-cross.patch
new file mode 100644
index 0000000000..631d6bf958
--- /dev/null
+++ b/recipes/iproute2/iproute2-2.6.38/configure-cross.patch
@@ -0,0 +1,58 @@
+Index: iproute2-2.6.34/configure
+===================================================================
+--- iproute2-2.6.34.orig/configure
++++ iproute2-2.6.34/configure
+@@ -4,7 +4,7 @@
+ INCLUDE=${1:-"$PWD/include"}
+
+ TABLES=
+-
++SYSROOT=$1
+ check_atm()
+ {
+ cat >/tmp/atmtest.c <<EOF
+@@ -15,7 +15,7 @@ int main(int argc, char **argv) {
+ return 0;
+ }
+ EOF
+-gcc -I$INCLUDE -o /tmp/atmtest /tmp/atmtest.c -latm >/dev/null 2>&1
++$CC -I$INCLUDE -o /tmp/atmtest /tmp/atmtest.c -latm >/dev/null 2>&1
+ if [ $? -eq 0 ]
+ then
+ echo "TC_CONFIG_ATM:=y" >>Config
+@@ -49,7 +49,7 @@ int main(int argc, char **argv)
+
+ EOF
+
+-if gcc -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL -ldl -lxtables >/dev/null 2>&1
++if $CC -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL -ldl -lxtables >/dev/null 2>&1
+ then
+ echo "TC_CONFIG_XT:=y" >>Config
+ echo "using xtables"
+@@ -86,7 +86,7 @@ int main(int argc, char **argv) {
+ }
+
+ EOF
+-gcc -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL -ldl >/dev/null 2>&1
++$CC -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL -ldl >/dev/null 2>&1
+
+ if [ $? -eq 0 ]
+ then
+@@ -126,7 +126,7 @@ int main(int argc, char **argv) {
+ }
+
+ EOF
+-gcc -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL -ldl >/dev/null 2>&1
++$CC -I$INCLUDE $IPTC -o /tmp/ipttest /tmp/ipttest.c $IPTL -ldl >/dev/null 2>&1
+
+ if [ $? -eq 0 ]
+ then
+@@ -150,7 +150,7 @@ check_ipt()
+ check_ipt_lib_dir()
+ {
+ IPT_LIB_DIR=""
+- for dir in /lib /usr/lib /usr/local/lib
++ for dir in $SYSROOT/lib $SYSROOT/usr/lib $SYSROOT/usr/local/lib
+ do
+ for file in $dir/$TABLES/lib*t_*so ; do
+ if [ -f $file ]; then
diff --git a/recipes/iproute2/iproute2_2.6.38.bb b/recipes/iproute2/iproute2_2.6.38.bb
new file mode 100644
index 0000000000..6a72999d15
--- /dev/null
+++ b/recipes/iproute2/iproute2_2.6.38.bb
@@ -0,0 +1,20 @@
+require iproute2.inc
+
+PR = "${INC_PR}.0"
+
+SRC_URI = "http://developer.osdl.org/dev/iproute2/download/${P}.tar.bz2 \
+ file://configure-cross.patch \
+ "
+
+SRC_URI[md5sum] = "a243bfea837e71824b7ca26c3bb45fa8"
+SRC_URI[sha256sum] = "47629a4f547f21d94d8e823a87dd8e13042cadecefea2e2dc433e4134fa9aec4"
+
+S = "${WORKDIR}/iproute2-${PV}"
+
+do_configure () {
+ ./configure ${STAGING_DIR_TARGET}
+}
+
+do_install_append() {
+ install -m 0755 tc/tc ${D}${base_sbindir}
+}
diff --git a/recipes/kexecboot/kexecboot-klibc_git.bb b/recipes/kexecboot/kexecboot-klibc_git.bb
index 2e8c2dd18c..a3725fdfba 100644
--- a/recipes/kexecboot/kexecboot-klibc_git.bb
+++ b/recipes/kexecboot/kexecboot-klibc_git.bb
@@ -1,9 +1,9 @@
RDEPENDS_${PN} = "kexec-klibc"
PV = "0.5.9"
-PR = "r3+gitr${SRCREV}"
+PR = "r4+gitr${SRCREV}"
SRC_URI = "git://git.linuxtogo.org/home/groups/kexecboot/kexecboot.git;protocol=git "
-SRCREV = "bb849a9bc6aaa397336fcd83c67a194036f7f19b"
+SRCREV = "698cf7185e013e873aa7df9388a31d857727d408"
S = "${WORKDIR}/git"
# the binary is statically linked against klibc
diff --git a/recipes/kexecboot/kexecboot.inc b/recipes/kexecboot/kexecboot.inc
index ef110661a0..1bb48e29b4 100644
--- a/recipes/kexecboot/kexecboot.inc
+++ b/recipes/kexecboot/kexecboot.inc
@@ -17,8 +17,9 @@
# --enable-debug enable debug output [default=no]
# --enable-host-debug allow for non-destructive executing of kexecboot on
# host system [default=no]
+# --enable-numkeys enable menu item selection by keys [0-9] [default=yes]
# --enable-bg-buffer enable buffer for pre-drawed FB GUI background
-# [default=no]
+#
# --enable-timeout allow to boot 1st kernel after timeout in seconds
# [default=no]
# --enable-delay specify delay before device scanning, allowing
diff --git a/recipes/kexecboot/kexecboot_git.bb b/recipes/kexecboot/kexecboot_git.bb
index 2f2bf13b84..dba92c752e 100644
--- a/recipes/kexecboot/kexecboot_git.bb
+++ b/recipes/kexecboot/kexecboot_git.bb
@@ -1,9 +1,9 @@
RDEPENDS_${PN} = "kexec"
PV = "0.5.9"
-PR = "r3+gitr${SRCREV}"
+PR = "r4+gitr${SRCREV}"
SRC_URI = "git://git.linuxtogo.org/home/groups/kexecboot/kexecboot.git;protocol=git "
-SRCREV = "bb849a9bc6aaa397336fcd83c67a194036f7f19b"
+SRCREV = "698cf7185e013e873aa7df9388a31d857727d408"
S = "${WORKDIR}/git"
require kexecboot.inc
diff --git a/recipes/klibc/klcc-cross_1.5.21.bb b/recipes/klibc/klcc-cross_1.5.22.bb
index 541d6740b5..8f701fd911 100644
--- a/recipes/klibc/klcc-cross_1.5.21.bb
+++ b/recipes/klibc/klcc-cross_1.5.22.bb
@@ -1,4 +1,4 @@
-PR = "${INC_PR}.1"
+PR = "${INC_PR}.0"
require klibc.inc
require klibc-checksums_${PV}.inc
diff --git a/recipes/klibc/klibc-1.5.21/arm-signal-cleanup.patch b/recipes/klibc/klibc-1.5.22/arm-signal-cleanup.patch
index b95d6aec95..b95d6aec95 100644
--- a/recipes/klibc/klibc-1.5.21/arm-signal-cleanup.patch
+++ b/recipes/klibc/klibc-1.5.22/arm-signal-cleanup.patch
diff --git a/recipes/klibc/klibc-1.5.21/dash_readopt.patch b/recipes/klibc/klibc-1.5.22/dash_readopt.patch
index 0633417f38..0633417f38 100644
--- a/recipes/klibc/klibc-1.5.21/dash_readopt.patch
+++ b/recipes/klibc/klibc-1.5.22/dash_readopt.patch
diff --git a/recipes/klibc/klibc-1.5.21/fstype-sane-vfat-and-jffs2-for-1.5.patch b/recipes/klibc/klibc-1.5.22/fstype-sane-vfat-and-jffs2-for-1.5.patch
index 4448fe26e9..4448fe26e9 100644
--- a/recipes/klibc/klibc-1.5.21/fstype-sane-vfat-and-jffs2-for-1.5.patch
+++ b/recipes/klibc/klibc-1.5.22/fstype-sane-vfat-and-jffs2-for-1.5.patch
diff --git a/recipes/klibc/klibc-1.5.21/getrusage.patch b/recipes/klibc/klibc-1.5.22/getrusage.patch
index 224ab321d7..224ab321d7 100644
--- a/recipes/klibc/klibc-1.5.21/getrusage.patch
+++ b/recipes/klibc/klibc-1.5.22/getrusage.patch
diff --git a/recipes/klibc/klibc-1.5.21/isystem.patch b/recipes/klibc/klibc-1.5.22/isystem.patch
index ccdf9ed92d..ccdf9ed92d 100644
--- a/recipes/klibc/klibc-1.5.21/isystem.patch
+++ b/recipes/klibc/klibc-1.5.22/isystem.patch
diff --git a/recipes/klibc/klibc-1.5.21/klcc_prefix.patch b/recipes/klibc/klibc-1.5.22/klcc_prefix.patch
index e4fe2411ba..e4fe2411ba 100644
--- a/recipes/klibc/klibc-1.5.21/klcc_prefix.patch
+++ b/recipes/klibc/klibc-1.5.22/klcc_prefix.patch
diff --git a/recipes/klibc/klibc-1.5.21/klibc-config-eabi.patch b/recipes/klibc/klibc-1.5.22/klibc-config-eabi.patch
index 86517f0594..86517f0594 100644
--- a/recipes/klibc/klibc-1.5.21/klibc-config-eabi.patch
+++ b/recipes/klibc/klibc-1.5.22/klibc-config-eabi.patch
diff --git a/recipes/klibc/klibc-1.5.21/klibc_kexecsyscall.patch b/recipes/klibc/klibc-1.5.22/klibc_kexecsyscall.patch
index 6243db6c18..6243db6c18 100644
--- a/recipes/klibc/klibc-1.5.21/klibc_kexecsyscall.patch
+++ b/recipes/klibc/klibc-1.5.22/klibc_kexecsyscall.patch
diff --git a/recipes/klibc/klibc-1.5.21/mntproc-definitions.patch b/recipes/klibc/klibc-1.5.22/mntproc-definitions.patch
index 5db24cd3aa..5db24cd3aa 100644
--- a/recipes/klibc/klibc-1.5.21/mntproc-definitions.patch
+++ b/recipes/klibc/klibc-1.5.22/mntproc-definitions.patch
diff --git a/recipes/klibc/klibc-1.5.21/modprobe.patch b/recipes/klibc/klibc-1.5.22/modprobe.patch
index d89010cc1c..d89010cc1c 100644
--- a/recipes/klibc/klibc-1.5.21/modprobe.patch
+++ b/recipes/klibc/klibc-1.5.22/modprobe.patch
diff --git a/recipes/klibc/klibc-1.5.21/socket.h.patch b/recipes/klibc/klibc-1.5.22/socket.h.patch
index 864fa2296c..864fa2296c 100644
--- a/recipes/klibc/klibc-1.5.21/socket.h.patch
+++ b/recipes/klibc/klibc-1.5.22/socket.h.patch
diff --git a/recipes/klibc/klibc-1.5.21/staging.patch b/recipes/klibc/klibc-1.5.22/staging.patch
index 9418c6b764..9418c6b764 100644
--- a/recipes/klibc/klibc-1.5.21/staging.patch
+++ b/recipes/klibc/klibc-1.5.22/staging.patch
diff --git a/recipes/klibc/klibc-1.5.21/use-env-for-perl.patch b/recipes/klibc/klibc-1.5.22/use-env-for-perl.patch
index 8609864251..8609864251 100644
--- a/recipes/klibc/klibc-1.5.21/use-env-for-perl.patch
+++ b/recipes/klibc/klibc-1.5.22/use-env-for-perl.patch
diff --git a/recipes/klibc/klibc-1.5.21/wc.patch b/recipes/klibc/klibc-1.5.22/wc.patch
index 9063a5a1c3..9063a5a1c3 100644
--- a/recipes/klibc/klibc-1.5.21/wc.patch
+++ b/recipes/klibc/klibc-1.5.22/wc.patch
diff --git a/recipes/klibc/klibc-checksums_1.5.21.inc b/recipes/klibc/klibc-checksums_1.5.21.inc
deleted file mode 100644
index 6b257029e8..0000000000
--- a/recipes/klibc/klibc-checksums_1.5.21.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-SRC_URI[md5sum] = "c232f3fd4e733f4d6ff8909fd54b9970"
-SRC_URI[sha256sum] = "d1de0d4a6a4a337624d19587713d253ce4636dd5492d23bad75f89e4b679e202"
diff --git a/recipes/klibc/klibc-checksums_1.5.22.inc b/recipes/klibc/klibc-checksums_1.5.22.inc
new file mode 100644
index 0000000000..3966142668
--- /dev/null
+++ b/recipes/klibc/klibc-checksums_1.5.22.inc
@@ -0,0 +1,2 @@
+SRC_URI[md5sum] = "2eb5ef12978099736be9b0d0d7d5e946"
+SRC_URI[sha256sum] = "0011ef50cb69b62033faa2d4a5e557f8998560ba97440af3962c1bc7bdaf8033"
diff --git a/recipes/klibc/klibc-static-utils_1.5.21.bb b/recipes/klibc/klibc-static-utils_1.5.22.bb
index 681d6f012a..681d6f012a 100644
--- a/recipes/klibc/klibc-static-utils_1.5.21.bb
+++ b/recipes/klibc/klibc-static-utils_1.5.22.bb
diff --git a/recipes/klibc/klibc_1.5.21.bb b/recipes/klibc/klibc_1.5.22.bb
index 65efa3eb9f..11faee4355 100644
--- a/recipes/klibc/klibc_1.5.21.bb
+++ b/recipes/klibc/klibc_1.5.22.bb
@@ -4,12 +4,17 @@ export INST=${D}
do_install() {
-# klcc for target host needs to be fixed
-# removed also from FILES_${PN}-dev
+ oe_runmake install
- rm klcc/klcc
+# the crosscompiler is packaged by klcc-cross
+# remove klcc
+# remove also from FILES_${PN}-dev
+ rm ${D}${base_bindir}/klcc
+
+ # remove Linux headers .install and ..install.cmd files
+ find ${D}${base_libdir}/klibc/include -name '.install' -delete
+ find ${D}${base_libdir}/klibc/include -name '..install.cmd' -delete
- oe_runmake install
install -d ${D}${base_bindir}
install -m 755 usr/dash/sh.${KLIBC_UTILS_VARIANT} ${D}${base_bindir}/sh
install -m 755 usr/kinit/kinit.${KLIBC_UTILS_VARIANT} ${D}${base_bindir}/kinit
@@ -17,6 +22,7 @@ do_install() {
install -d ${D}${base_libdir}
install -m 755 usr/klibc/klibc-*.so ${D}${base_libdir}
(cd ${D}${base_libdir}; ln -s klibc-*.so klibc.so)
+
}
PACKAGES = "${PN} ${PN}-dev"
@@ -24,6 +30,8 @@ FILES_${PN} = "${base_libdir}/klibc-*.so"
FILES_${PN}-dev = "${base_libdir}/klibc.so \
${base_libdir}/klibc/lib/* \
${base_libdir}/klibc/include/* \
+# see above
+# do not package it
# ${base_bindir}/klcc \
"
diff --git a/recipes/libosip2/libosip2_3.1.0.bb b/recipes/libosip2/libosip2_3.5.0.bb
index fa1321cf9f..0491c0e49e 100644
--- a/recipes/libosip2/libosip2_3.1.0.bb
+++ b/recipes/libosip2/libosip2_3.5.0.bb
@@ -7,5 +7,5 @@ SRC_URI = "${GNU_MIRROR}/osip/libosip2-${PV}.tar.gz"
inherit autotools pkgconfig
-SRC_URI[md5sum] = "7eb305608256ac2a7a27b66ce52627c8"
-SRC_URI[sha256sum] = "245911a9a48bbe868c4518faf86191f6568fb99d9967d368164a17a83671e8fb"
+SRC_URI[md5sum] = "7691546f6b3349d10007fc1aaff0f4e0"
+SRC_URI[sha256sum] = "dd955daa24d9ce2de6709b8c13e7c04ebc3afa8ac094d6a15a02a075be719a91"
diff --git a/recipes/linux/linux-2.6.30/at91/exp.2/linux-2.6.30-001-configurable-partition-size.patch b/recipes/linux/linux-2.6.30/at91/exp.2/linux-2.6.30-001-configurable-partition-size.patch
new file mode 100644
index 0000000000..ae24d12d1d
--- /dev/null
+++ b/recipes/linux/linux-2.6.30/at91/exp.2/linux-2.6.30-001-configurable-partition-size.patch
@@ -0,0 +1,362 @@
+diff -urN linux-2.6.30-0rig/arch/arm/mach-at91/board-at572d940hf_ek.c linux-2.6.30/arch/arm/mach-at91/board-at572d940hf_ek.c
+--- linux-2.6.30-0rig/arch/arm/mach-at91/board-at572d940hf_ek.c 2010-03-14 11:13:34.000000000 +0100
++++ linux-2.6.30/arch/arm/mach-at91/board-at572d940hf_ek.c 2010-03-14 11:28:55.000000000 +0100
+@@ -114,10 +114,20 @@
+ */
+ static struct mtd_partition __initdata eb_nand_partition[] = {
+ {
+- .name = "Partition 1",
+- .offset = 0,
++ .name = "Bootstrap",
++ .offset = 0,
++ .size = 4 * SZ_1M,
++ },
++ {
++ .name = "Root File System",
++ .offset = MTDPART_OFS_NXTBLK,
++ .size = CONFIG_MTD_NAND_ATMEL_ROOTFS_SIZE * SZ_1M,
++ },
++ {
++ .name = "Data",
++ .offset = MTDPART_OFS_NXTBLK,
+ .size = MTDPART_SIZ_FULL,
+- }
++ },
+ };
+
+ static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
+diff -urN linux-2.6.30-0rig/arch/arm/mach-at91/board-cap9adk.c linux-2.6.30/arch/arm/mach-at91/board-cap9adk.c
+--- linux-2.6.30-0rig/arch/arm/mach-at91/board-cap9adk.c 2010-03-14 11:13:34.000000000 +0100
++++ linux-2.6.30/arch/arm/mach-at91/board-cap9adk.c 2010-03-14 11:28:36.000000000 +0100
+@@ -167,8 +167,18 @@
+ */
+ static struct mtd_partition __initdata cap9adk_nand_partitions[] = {
+ {
+- .name = "NAND partition",
+- .offset = 0,
++ .name = "Bootstrap",
++ .offset = 0,
++ .size = 4 * SZ_1M,
++ },
++ {
++ .name = "Root File System",
++ .offset = MTDPART_OFS_NXTBLK,
++ .size = CONFIG_MTD_NAND_ATMEL_ROOTFS_SIZE * SZ_1M,
++ },
++ {
++ .name = "Data",
++ .offset = MTDPART_OFS_NXTBLK,
+ .size = MTDPART_SIZ_FULL,
+ },
+ };
+diff -urN linux-2.6.30-0rig/arch/arm/mach-at91/board-dk.c linux-2.6.30/arch/arm/mach-at91/board-dk.c
+--- linux-2.6.30-0rig/arch/arm/mach-at91/board-dk.c 2010-03-14 11:13:34.000000000 +0100
++++ linux-2.6.30/arch/arm/mach-at91/board-dk.c 2010-03-14 11:28:43.000000000 +0100
+@@ -314,8 +314,18 @@
+
+ static struct mtd_partition __initdata dk_nand_partition[] = {
+ {
+- .name = "NAND Partition 1",
+- .offset = 0,
++ .name = "Bootstrap",
++ .offset = 0,
++ .size = 4 * SZ_1M,
++ },
++ {
++ .name = "Root File System",
++ .offset = MTDPART_OFS_NXTBLK,
++ .size = CONFIG_MTD_NAND_ATMEL_ROOTFS_SIZE * SZ_1M,
++ },
++ {
++ .name = "Data",
++ .offset = MTDPART_OFS_NXTBLK,
+ .size = MTDPART_SIZ_FULL,
+ },
+ };
+diff -urN linux-2.6.30-0rig/arch/arm/mach-at91/board-sam9260ek.c linux-2.6.30/arch/arm/mach-at91/board-sam9260ek.c
+--- linux-2.6.30-0rig/arch/arm/mach-at91/board-sam9260ek.c 2010-03-14 11:13:34.000000000 +0100
++++ linux-2.6.30/arch/arm/mach-at91/board-sam9260ek.c 2010-03-14 11:26:57.000000000 +0100
+@@ -177,12 +177,17 @@
+ */
+ static struct mtd_partition __initdata ek_nand_partition[] = {
+ {
+- .name = "Partition 1",
+- .offset = 0,
+- .size = SZ_256K,
++ .name = "Bootstrap",
++ .offset = 0,
++ .size = 4 * SZ_1M,
+ },
+ {
+- .name = "Partition 2",
++ .name = "Root File System",
++ .offset = MTDPART_OFS_NXTBLK,
++ .size = CONFIG_MTD_NAND_ATMEL_ROOTFS_SIZE * SZ_1M,
++ },
++ {
++ .name = "Data",
+ .offset = MTDPART_OFS_NXTBLK,
+ .size = MTDPART_SIZ_FULL,
+ },
+diff -urN linux-2.6.30-0rig/arch/arm/mach-at91/board-sam9261ek.c linux-2.6.30/arch/arm/mach-at91/board-sam9261ek.c
+--- linux-2.6.30-0rig/arch/arm/mach-at91/board-sam9261ek.c 2010-03-14 11:13:34.000000000 +0100
++++ linux-2.6.30/arch/arm/mach-at91/board-sam9261ek.c 2010-03-14 11:26:57.000000000 +0100
+@@ -184,12 +184,17 @@
+ */
+ static struct mtd_partition __initdata ek_nand_partition[] = {
+ {
+- .name = "Partition 1",
+- .offset = 0,
+- .size = SZ_256K,
++ .name = "Bootstrap",
++ .offset = 0,
++ .size = 4 * SZ_1M,
+ },
+ {
+- .name = "Partition 2",
++ .name = "Root File System",
++ .offset = MTDPART_OFS_NXTBLK,
++ .size = CONFIG_MTD_NAND_ATMEL_ROOTFS_SIZE * SZ_1M,
++ },
++ {
++ .name = "Data",
+ .offset = MTDPART_OFS_NXTBLK,
+ .size = MTDPART_SIZ_FULL,
+ },
+diff -urN linux-2.6.30-0rig/arch/arm/mach-at91/board-sam9263ek.c linux-2.6.30/arch/arm/mach-at91/board-sam9263ek.c
+--- linux-2.6.30-0rig/arch/arm/mach-at91/board-sam9263ek.c 2010-03-14 11:13:34.000000000 +0100
++++ linux-2.6.30/arch/arm/mach-at91/board-sam9263ek.c 2010-03-14 11:26:57.000000000 +0100
+@@ -174,12 +174,17 @@
+ */
+ static struct mtd_partition __initdata ek_nand_partition[] = {
+ {
+- .name = "Partition 1",
+- .offset = 0,
+- .size = SZ_64M,
++ .name = "Bootstrap",
++ .offset = 0,
++ .size = 4 * SZ_1M,
+ },
+ {
+- .name = "Partition 2",
++ .name = "Root File System",
++ .offset = MTDPART_OFS_NXTBLK,
++ .size = CONFIG_MTD_NAND_ATMEL_ROOTFS_SIZE * SZ_1M,
++ },
++ {
++ .name = "Data",
+ .offset = MTDPART_OFS_NXTBLK,
+ .size = MTDPART_SIZ_FULL,
+ },
+diff -urN linux-2.6.30-0rig/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c linux-2.6.30/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c
+--- linux-2.6.30-0rig/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c 2010-03-14 11:13:34.000000000 +0100
++++ linux-2.6.30/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c 2010-03-14 11:28:29.000000000 +0100
+@@ -130,12 +130,12 @@
+ .size = 4 * SZ_1M,
+ },
+ {
+- .name = "Partition 1",
++ .name = "Root File System",
+ .offset = MTDPART_OFS_NXTBLK,
+- .size = 60 * SZ_1M,
++ .size = CONFIG_MTD_NAND_ATMEL_ROOTFS_SIZE * SZ_1M,
+ },
+ {
+- .name = "Partition 2",
++ .name = "Data",
+ .offset = MTDPART_OFS_NXTBLK,
+ .size = MTDPART_SIZ_FULL,
+ },
+diff -urN linux-2.6.30-0rig/arch/arm/mach-at91/board-sam9g20ek.c linux-2.6.30/arch/arm/mach-at91/board-sam9g20ek.c
+--- linux-2.6.30-0rig/arch/arm/mach-at91/board-sam9g20ek.c 2010-03-14 11:13:34.000000000 +0100
++++ linux-2.6.30/arch/arm/mach-at91/board-sam9g20ek.c 2010-03-14 11:26:57.000000000 +0100
+@@ -129,12 +129,12 @@
+ .size = 4 * SZ_1M,
+ },
+ {
+- .name = "Partition 1",
++ .name = "Root File System",
+ .offset = MTDPART_OFS_NXTBLK,
+- .size = 60 * SZ_1M,
++ .size = CONFIG_MTD_NAND_ATMEL_ROOTFS_SIZE * SZ_1M,
+ },
+ {
+- .name = "Partition 2",
++ .name = "Data",
+ .offset = MTDPART_OFS_NXTBLK,
+ .size = MTDPART_SIZ_FULL,
+ },
+diff -urN linux-2.6.30-0rig/arch/arm/mach-at91/board-sam9m10g45ek.c linux-2.6.30/arch/arm/mach-at91/board-sam9m10g45ek.c
+--- linux-2.6.30-0rig/arch/arm/mach-at91/board-sam9m10g45ek.c 2010-03-14 11:13:34.000000000 +0100
++++ linux-2.6.30/arch/arm/mach-at91/board-sam9m10g45ek.c 2010-03-14 11:26:57.000000000 +0100
+@@ -133,12 +133,17 @@
+ */
+ static struct mtd_partition __initdata ek_nand_partition[] = {
+ {
+- .name = "Partition 1",
+- .offset = 0,
+- .size = SZ_64M,
++ .name = "Bootstrap",
++ .offset = 0,
++ .size = 4 * SZ_1M,
+ },
+ {
+- .name = "Partition 2",
++ .name = "Root File System",
++ .offset = MTDPART_OFS_NXTBLK,
++ .size = CONFIG_MTD_NAND_ATMEL_ROOTFS_SIZE * SZ_1M,
++ },
++ {
++ .name = "Data",
+ .offset = MTDPART_OFS_NXTBLK,
+ .size = MTDPART_SIZ_FULL,
+ },
+diff -urN linux-2.6.30-0rig/arch/arm/mach-at91/board-sam9rlek.c linux-2.6.30/arch/arm/mach-at91/board-sam9rlek.c
+--- linux-2.6.30-0rig/arch/arm/mach-at91/board-sam9rlek.c 2010-03-14 11:13:34.000000000 +0100
++++ linux-2.6.30/arch/arm/mach-at91/board-sam9rlek.c 2010-03-14 11:26:57.000000000 +0100
+@@ -83,12 +83,17 @@
+ */
+ static struct mtd_partition __initdata ek_nand_partition[] = {
+ {
+- .name = "Partition 1",
+- .offset = 0,
+- .size = SZ_256K,
++ .name = "Bootstrap",
++ .offset = 0,
++ .size = 4 * SZ_1M,
+ },
+ {
+- .name = "Partition 2",
++ .name = "Root File System",
++ .offset = MTDPART_OFS_NXTBLK,
++ .size = CONFIG_MTD_NAND_ATMEL_ROOTFS_SIZE * SZ_1M,
++ },
++ {
++ .name = "Data",
+ .offset = MTDPART_OFS_NXTBLK,
+ .size = MTDPART_SIZ_FULL,
+ },
+diff -urN linux-2.6.30-0rig/arch/arm/mach-at91/Kconfig linux-2.6.30/arch/arm/mach-at91/Kconfig
+--- linux-2.6.30-0rig/arch/arm/mach-at91/Kconfig 2010-03-14 11:13:34.000000000 +0100
++++ linux-2.6.30/arch/arm/mach-at91/Kconfig 2010-03-14 11:32:54.000000000 +0100
+@@ -96,6 +96,7 @@
+ config ARCH_AT91RM9200DK
+ bool "Atmel AT91RM9200-DK Development board"
+ depends on ARCH_AT91RM9200
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
+ help
+ Select this if you are using Atmel's AT91RM9200-DK Development board.
+ (Discontinued)
+@@ -213,6 +214,7 @@
+ config MACH_AT91SAM9260EK
+ bool "Atmel AT91SAM9260-EK / AT91SAM9XE Evaluation Kit"
+ depends on ARCH_AT91SAM9260
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
+ help
+ Select this if you are using Atmel's AT91SAM9260-EK or AT91SAM9XE Evaluation Kit
+ <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3933>
+@@ -278,6 +280,7 @@
+ config MACH_AT91SAM9261EK
+ bool "Atmel AT91SAM9261-EK Evaluation Kit"
+ depends on ARCH_AT91SAM9261
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
+ help
+ Select this if you are using Atmel's AT91SAM9261-EK Evaluation Kit.
+ <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3820>
+@@ -293,6 +296,7 @@
+ config MACH_AT91SAM9G10EK
+ bool "Atmel AT91SAM9G10-EK Evaluation Kit"
+ depends on ARCH_AT91SAM9G10
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
+ help
+ Select this if you are using Atmel's AT91SAM9G10-EK Evaluation Kit.
+ <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4588>
+@@ -308,6 +312,7 @@
+ config MACH_AT91SAM9263EK
+ bool "Atmel AT91SAM9263-EK Evaluation Kit"
+ depends on ARCH_AT91SAM9263
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
+ help
+ Select this if you are using Atmel's AT91SAM9263-EK Evaluation Kit.
+ <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4057>
+@@ -350,6 +355,7 @@
+ config MACH_AT91SAM9RLEK
+ bool "Atmel AT91SAM9RL-EK Evaluation Kit"
+ depends on ARCH_AT91SAM9RL
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
+ help
+ Select this if you are using Atmel's AT91SAM9RL-EK Evaluation Kit.
+
+@@ -364,6 +370,7 @@
+ config MACH_AT91SAM9G20EK
+ bool "Atmel AT91SAM9G20-EK Evaluation Kit"
+ depends on ARCH_AT91SAM9G20
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
+ help
+ Select this if you are using Atmel's AT91SAM9G20-EK Evaluation Kit
+ that embeds only one SD/MMC slot.
+@@ -371,6 +378,7 @@
+ config MACH_AT91SAM9G20EK_2MMC
+ bool "Atmel AT91SAM9G20-EK Evaluation Kit with 2 SD/MMC Slots"
+ depends on ARCH_AT91SAM9G20
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
+ help
+ Select this if you are using an Atmel AT91SAM9G20-EK Evaluation Kit
+ with 2 SD/MMC Slots. This is the case for AT91SAM9G20-EK rev. C and
+@@ -408,6 +416,7 @@
+ config MACH_AT91SAM9G45EKES
+ bool "Atmel AT91SAM9G45-EKES Evaluation Kit"
+ depends on ARCH_AT91SAM9G45
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
+ help
+ Select this if you are using Atmel's AT91SAM9G45-EKES Evaluation Kit.
+ "ES" at the end of the name means that this board is an
+@@ -424,6 +433,7 @@
+ config MACH_AT91SAM9M10EKES
+ bool "Atmel AT91SAM9M10-EKES Evaluation Kit"
+ depends on ARCH_AT91SAM9M10
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
+ help
+ Select this if you are using Atmel's AT91SAM9M10-EKES Evaluation Kit.
+ "ES" at the end of the name means that this board is an
+@@ -440,6 +450,7 @@
+ config MACH_AT91CAP9ADK
+ bool "Atmel AT91CAP9A-DK Evaluation Kit"
+ depends on ARCH_AT91CAP9
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
+ help
+ Select this if you are using Atmel's AT91CAP9A-DK Evaluation Kit.
+ <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4138>
+@@ -455,6 +466,7 @@
+ config MACH_AT572D940HFEB
+ bool "AT572D940HF-EK"
+ depends on ARCH_AT572D940HF
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
+ help
+ Select this if you are using Atmel's AT572D940HF-EK evaluation kit.
+ <http://www.atmel.com/products/diopsis/default.asp>
+@@ -494,6 +506,24 @@
+ On AT91SAM926x boards both types of NAND flash can be present
+ (8 and 16 bit data bus width).
+
++config MTD_NAND_ATMEL_ROOTFS_SIZE
++ int "Size NAND rootfs in MB"
++ range 8 250
++ depends on MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ default "124"
++ help
++ Many Atmel development boards has a NAND Flash,
++ divided into three partitions.
++ 1) Boot partition (4 MB)
++ 2) Root FS
++ 3) Data partition
++ This allows you to configure the size of the root fs
++ with the remainder ending up in the data partition.
++ The legal values are between 8 and 250
++
++config MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ bool
++
+ # ----------------------------------------------------------
+
+ comment "AT91 Feature Selections"
diff --git a/recipes/linux/linux-2.6.30/at91/exp.2/linux-2.6.30-002-mach-at91-Kconfig.patch b/recipes/linux/linux-2.6.30/at91/exp.2/linux-2.6.30-002-mach-at91-Kconfig.patch
new file mode 100644
index 0000000000..a2d3965f13
--- /dev/null
+++ b/recipes/linux/linux-2.6.30/at91/exp.2/linux-2.6.30-002-mach-at91-Kconfig.patch
@@ -0,0 +1,196 @@
+diff -urN linux-2.6.30-0rig/arch/arm/mach-at91/Kconfig linux-2.6.30/arch/arm/mach-at91/Kconfig
+--- linux-2.6.30-0rig/arch/arm/mach-at91/Kconfig 2010-03-14 11:41:36.000000000 +0100
++++ linux-2.6.30/arch/arm/mach-at91/Kconfig 2010-03-14 12:00:27.000000000 +0100
+@@ -97,6 +97,7 @@
+ bool "Atmel AT91RM9200-DK Development board"
+ depends on ARCH_AT91RM9200
+ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using Atmel's AT91RM9200-DK Development board.
+ (Discontinued)
+@@ -104,6 +105,7 @@
+ config MACH_AT91RM9200EK
+ bool "Atmel AT91RM9200-EK Evaluation Kit"
+ depends on ARCH_AT91RM9200
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using Atmel's AT91RM9200-EK Evaluation Kit.
+ <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3507>
+@@ -172,6 +174,7 @@
+ config MACH_ECBAT91
+ bool "emQbit ECB_AT91 SBC"
+ depends on ARCH_AT91RM9200
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using emQbit's ECB_AT91 board.
+ <http://wiki.emqbit.com/free-ecb-at91>
+@@ -215,6 +218,8 @@
+ bool "Atmel AT91SAM9260-EK / AT91SAM9XE Evaluation Kit"
+ depends on ARCH_AT91SAM9260
+ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using Atmel's AT91SAM9260-EK or AT91SAM9XE Evaluation Kit
+ <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3933>
+@@ -229,6 +234,7 @@
+ config MACH_SAM9_L9260
+ bool "Olimex SAM9-L9260 board"
+ depends on ARCH_AT91SAM9260
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using Olimex's SAM9-L9260 board based on the Atmel AT91SAM9260.
+ <http://www.olimex.com/dev/sam9-L9260.html>
+@@ -281,6 +287,8 @@
+ bool "Atmel AT91SAM9261-EK Evaluation Kit"
+ depends on ARCH_AT91SAM9261
+ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using Atmel's AT91SAM9261-EK Evaluation Kit.
+ <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3820>
+@@ -297,6 +305,8 @@
+ bool "Atmel AT91SAM9G10-EK Evaluation Kit"
+ depends on ARCH_AT91SAM9G10
+ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using Atmel's AT91SAM9G10-EK Evaluation Kit.
+ <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4588>
+@@ -313,6 +323,8 @@
+ bool "Atmel AT91SAM9263-EK Evaluation Kit"
+ depends on ARCH_AT91SAM9263
+ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using Atmel's AT91SAM9263-EK Evaluation Kit.
+ <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4057>
+@@ -334,6 +346,7 @@
+ config MACH_TOTEMNOVA
+ bool "TotemNova Micronova industrial supervisor"
+ depends on ARCH_AT91SAM9263
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using Micronova's TotemNova industrial supervisor
+ <http://www.micronovasrl.com>
+@@ -341,6 +354,7 @@
+ config MACH_NEOCORE926
+ bool "Adeneo NEOCORE926"
+ depends on ARCH_AT91SAM9263
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using the Adeneo Neocore 926 board.
+
+@@ -371,6 +385,8 @@
+ bool "Atmel AT91SAM9G20-EK Evaluation Kit"
+ depends on ARCH_AT91SAM9G20
+ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using Atmel's AT91SAM9G20-EK Evaluation Kit
+ that embeds only one SD/MMC slot.
+@@ -379,6 +395,7 @@
+ bool "Atmel AT91SAM9G20-EK Evaluation Kit with 2 SD/MMC Slots"
+ depends on ARCH_AT91SAM9G20
+ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
+ help
+ Select this if you are using an Atmel AT91SAM9G20-EK Evaluation Kit
+ with 2 SD/MMC Slots. This is the case for AT91SAM9G20-EK rev. C and
+@@ -417,13 +434,23 @@
+ bool "Atmel AT91SAM9G45-EKES Evaluation Kit"
+ depends on ARCH_AT91SAM9G45
+ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
+ help
+ Select this if you are using Atmel's AT91SAM9G45-EKES Evaluation Kit.
+ "ES" at the end of the name means that this board is an
+ Engineering Sample.
+
+-endif
++config MACH_AT91SAM9M10G45EK
++ bool "Atmel AT91SAM9M10G45-EK Evaluation Kit"
++ depends on ARCH_AT91SAM9G45
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
++ help
++ Select this if you are using Atmel's AT91SAM9M10G45-EK Evaluation Kit.
++ "ES2" at the end of the name means that this board is an
++ Engineering Sample.
+
++endif
+ # ----------------------------------------------------------
+
+ if ARCH_AT91SAM9M10
+@@ -434,11 +461,22 @@
+ bool "Atmel AT91SAM9M10-EKES Evaluation Kit"
+ depends on ARCH_AT91SAM9M10
+ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
+ help
+ Select this if you are using Atmel's AT91SAM9M10-EKES Evaluation Kit.
+ "ES" at the end of the name means that this board is an
+ Engineering Sample.
+
++config MACH_AT91SAM9M10G45EK
++ bool "Atmel AT91SAM9M10G45-EK Evaluation Kit"
++ depends on ARCH_AT91SAM9M10
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
++ help
++ Select this if you are using Atmel's AT91SAM9M10G45-EK Evaluation Kit.
++ "ES2" at the end of the name means that this board is an
++ Engineering Sample.
++
+ endif
+
+ # ----------------------------------------------------------
+@@ -451,6 +489,8 @@
+ bool "Atmel AT91CAP9A-DK Evaluation Kit"
+ depends on ARCH_AT91CAP9
+ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using Atmel's AT91CAP9A-DK Evaluation Kit.
+ <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4138>
+@@ -467,6 +507,8 @@
+ bool "AT572D940HF-EK"
+ depends on ARCH_AT572D940HF
+ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using Atmel's AT572D940HF-EK evaluation kit.
+ <http://www.atmel.com/products/diopsis/default.asp>
+@@ -495,17 +537,23 @@
+
+ config MTD_AT91_DATAFLASH_CARD
+ bool "Enable DataFlash Card support"
+- depends on (ARCH_AT91RM9200DK || MACH_AT91RM9200EK || MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_AT91SAM9G10EK || MACH_AT91SAM9263EK || MACH_AT91SAM9G20EK || MACH_ECBAT91 || MACH_SAM9_L9260 || MACH_AT91CAP9ADK || MACH_AT572D940HFEB || MACH_TOTEMNOVA || MACH_NEOCORE926)
++ depends on MTD_ALLOW_DATAFLASHCARD
+ help
+ Enable support for the DataFlash card.
+
++config MTD_ALLOW_DATAFLASHCARD
++ bool
++
+ config MTD_NAND_ATMEL_BUSWIDTH_16
+ bool "Enable 16-bit data bus interface to NAND flash"
+- depends on (MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_AT91SAM9G10EK || MACH_AT91SAM9263EK || MACH_AT91SAM9G20EK || MACH_AT91SAM9G20EK_2MMC || MACH_AT91SAM9G45EKES || MACH_AT91CAP9ADK || MACH_AT572D940HFEB)
++ depends on MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
+ help
+ On AT91SAM926x boards both types of NAND flash can be present
+ (8 and 16 bit data bus width).
+
++config MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
++ bool
++
+ config MTD_NAND_ATMEL_ROOTFS_SIZE
+ int "Size NAND rootfs in MB"
+ range 8 250
diff --git a/recipes/linux/linux-2.6.30/at91/exp.2/linux-2.6.30-003-sam9m10g45ek.patch b/recipes/linux/linux-2.6.30/at91/exp.2/linux-2.6.30-003-sam9m10g45ek.patch
new file mode 100644
index 0000000000..05a81bffc7
--- /dev/null
+++ b/recipes/linux/linux-2.6.30/at91/exp.2/linux-2.6.30-003-sam9m10g45ek.patch
@@ -0,0 +1,29 @@
+diff -urN linux-2.6.30-0rig/arch/arm/mach-at91/board-sam9m10g45ek.c linux-2.6.30/arch/arm/mach-at91/board-sam9m10g45ek.c
+--- linux-2.6.30-0rig/arch/arm/mach-at91/board-sam9m10g45ek.c 2010-03-14 11:41:36.000000000 +0100
++++ linux-2.6.30/arch/arm/mach-at91/board-sam9m10g45ek.c 2010-03-14 12:07:05.000000000 +0100
+@@ -432,9 +432,13 @@
+
+ #if defined(CONFIG_MACH_AT91SAM9G45EKES)
+ MACHINE_START(AT91SAM9G45EKES, "Atmel AT91SAM9G45-EKES")
+-#else
++#endif
++#if defined(CONFIG_MACH_AT91SAM9M10EKES)
+ MACHINE_START(AT91SAM9M10EKES, "Atmel AT91SAM9M10-EKES")
+ #endif
++#if defined(CONFIG_MACH_AT91SAM9M10G45EK)
++MACHINE_START(AT91SAM9M10G45EK, "Atmel AT91SAM9M10G45-EK")
++#endif
+ /* Maintainer: Atmel */
+ .phys_io = AT91_BASE_SYS,
+ .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
+diff -urN linux-2.6.30-0rig/arch/arm/mach-at91/Makefile linux-2.6.30/arch/arm/mach-at91/Makefile
+--- linux-2.6.30-0rig/arch/arm/mach-at91/Makefile 2010-03-14 11:13:34.000000000 +0100
++++ linux-2.6.30/arch/arm/mach-at91/Makefile 2010-03-14 12:08:01.000000000 +0100
+@@ -74,6 +74,7 @@
+ # AT91SAM9G45 board-specific support
+ obj-$(CONFIG_MACH_AT91SAM9G45EKES) += board-sam9m10g45ek.o
+ obj-$(CONFIG_MACH_AT91SAM9M10EKES) += board-sam9m10g45ek.o
++obj-$(CONFIG_MACH_AT91SAM9M10G45EK) += board-sam9m10g45ek.o
+
+ # AT91CAP9 board-specific support
+ obj-$(CONFIG_MACH_AT91CAP9ADK) += board-cap9adk.o
diff --git a/recipes/linux/linux-2.6.30/at91/exp.4/0001-Configurable-partition-size.patch b/recipes/linux/linux-2.6.30/at91/exp.4/0001-Configurable-partition-size.patch
new file mode 100644
index 0000000000..d384e5ca94
--- /dev/null
+++ b/recipes/linux/linux-2.6.30/at91/exp.4/0001-Configurable-partition-size.patch
@@ -0,0 +1,403 @@
+From ed00f95d313707ff049d8a2edd283d5496a85cbf Mon Sep 17 00:00:00 2001
+From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
+Date: Wed, 26 Jan 2011 09:21:10 +0100
+Subject: [PATCH 1/2] Configurable partition size
+
+---
+ arch/arm/mach-at91/Kconfig | 31 ++++++++++++++++++++++++
+ arch/arm/mach-at91/board-at572d940hf_ek.c | 16 ++++++++++--
+ arch/arm/mach-at91/board-cap9adk.c | 14 +++++++++-
+ arch/arm/mach-at91/board-dk.c | 14 +++++++++-
+ arch/arm/mach-at91/board-sam9260ek.c | 13 +++++++---
+ arch/arm/mach-at91/board-sam9261ek.c | 13 +++++++---
+ arch/arm/mach-at91/board-sam9263ek.c | 13 +++++++---
+ arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c | 6 ++--
+ arch/arm/mach-at91/board-sam9g20ek.c | 6 ++--
+ arch/arm/mach-at91/board-sam9m10g45ek.c | 13 +++++++---
+ arch/arm/mach-at91/board-sam9rlek.c | 13 +++++++---
+ 11 files changed, 119 insertions(+), 33 deletions(-)
+
+diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
+index 17e09cb..46d1926 100644
+--- a/arch/arm/mach-at91/Kconfig
++++ b/arch/arm/mach-at91/Kconfig
+@@ -96,6 +96,7 @@ config MACH_ONEARM
+ config ARCH_AT91RM9200DK
+ bool "Atmel AT91RM9200-DK Development board"
+ depends on ARCH_AT91RM9200
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
+ help
+ Select this if you are using Atmel's AT91RM9200-DK Development board.
+ (Discontinued)
+@@ -213,6 +214,7 @@ comment "AT91SAM9260 / AT91SAM9XE Board Type"
+ config MACH_AT91SAM9260EK
+ bool "Atmel AT91SAM9260-EK / AT91SAM9XE Evaluation Kit"
+ depends on ARCH_AT91SAM9260
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
+ help
+ Select this if you are using Atmel's AT91SAM9260-EK or AT91SAM9XE Evaluation Kit
+ <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3933>
+@@ -278,6 +280,7 @@ comment "AT91SAM9261 Board Type"
+ config MACH_AT91SAM9261EK
+ bool "Atmel AT91SAM9261-EK Evaluation Kit"
+ depends on ARCH_AT91SAM9261
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
+ help
+ Select this if you are using Atmel's AT91SAM9261-EK Evaluation Kit.
+ <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3820>
+@@ -293,6 +296,7 @@ comment "AT91SAM9G10 Board Type"
+ config MACH_AT91SAM9G10EK
+ bool "Atmel AT91SAM9G10-EK Evaluation Kit"
+ depends on ARCH_AT91SAM9G10
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
+ help
+ Select this if you are using Atmel's AT91SAM9G10-EK Evaluation Kit.
+ <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4588>
+@@ -308,6 +312,7 @@ comment "AT91SAM9263 Board Type"
+ config MACH_AT91SAM9263EK
+ bool "Atmel AT91SAM9263-EK Evaluation Kit"
+ depends on ARCH_AT91SAM9263
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
+ help
+ Select this if you are using Atmel's AT91SAM9263-EK Evaluation Kit.
+ <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4057>
+@@ -350,6 +355,7 @@ comment "AT91SAM9RL Board Type"
+ config MACH_AT91SAM9RLEK
+ bool "Atmel AT91SAM9RL-EK Evaluation Kit"
+ depends on ARCH_AT91SAM9RL
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
+ help
+ Select this if you are using Atmel's AT91SAM9RL-EK Evaluation Kit.
+
+@@ -364,6 +370,7 @@ comment "AT91SAM9G20 Board Type"
+ config MACH_AT91SAM9G20EK
+ bool "Atmel AT91SAM9G20-EK Evaluation Kit"
+ depends on ARCH_AT91SAM9G20
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
+ help
+ Select this if you are using Atmel's AT91SAM9G20-EK Evaluation Kit
+ that embeds only one SD/MMC slot.
+@@ -371,6 +378,7 @@ config MACH_AT91SAM9G20EK
+ config MACH_AT91SAM9G20EK_2MMC
+ bool "Atmel AT91SAM9G20-EK Evaluation Kit with 2 SD/MMC Slots"
+ depends on ARCH_AT91SAM9G20
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
+ help
+ Select this if you are using an Atmel AT91SAM9G20-EK Evaluation Kit
+ with 2 SD/MMC Slots. This is the case for AT91SAM9G20-EK rev. C and
+@@ -408,6 +416,7 @@ comment "AT91SAM9G45 Board Type"
+ config MACH_AT91SAM9G45EKES
+ bool "Atmel AT91SAM9G45-EKES Evaluation Kit"
+ depends on ARCH_AT91SAM9G45
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
+ help
+ Select this if you are using Atmel's AT91SAM9G45-EKES Evaluation Kit.
+ "ES" at the end of the name means that this board is an
+@@ -426,6 +435,7 @@ choice
+
+ config MACH_AT91SAM9M10EKES
+ bool "Atmel AT91SAM9M10-EKES Evaluation Kit"
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
+ help
+ Select this if you are using Atmel's AT91SAM9M10-EKES Evaluation Kit.
+ "ES" at the end of the name means that this board is an
+@@ -433,6 +443,7 @@ config MACH_AT91SAM9M10EKES
+
+ config MACH_AT91SAM9M10G45EK
+ bool "Atmel AT91SAM9M10G45-EK Evaluation Kit"
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
+ help
+ Select this if you are using Atmel's AT91SAM9M10G45-EK Evaluation Kit.
+ <http://atmel.com/dyn/products/tools_card_v2.asp?tool_id=4735>
+@@ -450,6 +461,7 @@ comment "AT91CAP9 Board Type"
+ config MACH_AT91CAP9ADK
+ bool "Atmel AT91CAP9A-DK Evaluation Kit"
+ depends on ARCH_AT91CAP9
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
+ help
+ Select this if you are using Atmel's AT91CAP9A-DK Evaluation Kit.
+ <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4138>
+@@ -465,6 +477,7 @@ comment "AT572D940HF Board Type"
+ config MACH_AT572D940HFEB
+ bool "AT572D940HF-EK"
+ depends on ARCH_AT572D940HF
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
+ help
+ Select this if you are using Atmel's AT572D940HF-EK evaluation kit.
+ <http://www.atmel.com/products/diopsis/default.asp>
+@@ -504,6 +517,24 @@ config MTD_NAND_ATMEL_BUSWIDTH_16
+ On AT91SAM926x boards both types of NAND flash can be present
+ (8 and 16 bit data bus width).
+
++config MTD_NAND_ATMEL_ROOTFS_SIZE
++ int "Size NAND rootfs in MB"
++ range 8 250
++ depends on MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ default "124"
++ help
++ Many Atmel development boards has a NAND Flash,
++ divided into three partitions.
++ 1) Boot partition (4 MB)
++ 2) Root FS
++ 3) Data partition
++ This allows you to configure the size of the root fs
++ with the remainder ending up in the data partition.
++ The legal values are between 8 and 250
++
++config MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ bool
++
+ # ----------------------------------------------------------
+
+ comment "AT91 Feature Selections"
+diff --git a/arch/arm/mach-at91/board-at572d940hf_ek.c b/arch/arm/mach-at91/board-at572d940hf_ek.c
+index f5bd486..171d675 100644
+--- a/arch/arm/mach-at91/board-at572d940hf_ek.c
++++ b/arch/arm/mach-at91/board-at572d940hf_ek.c
+@@ -114,10 +114,20 @@ static struct at91_eth_data __initdata eb_eth_data = {
+ */
+ static struct mtd_partition __initdata eb_nand_partition[] = {
+ {
+- .name = "Partition 1",
+- .offset = 0,
++ .name = "Bootstrap",
++ .offset = 0,
++ .size = 4 * SZ_1M,
++ },
++ {
++ .name = "Root File System",
++ .offset = MTDPART_OFS_NXTBLK,
++ .size = CONFIG_MTD_NAND_ATMEL_ROOTFS_SIZE * SZ_1M,
++ },
++ {
++ .name = "Data",
++ .offset = MTDPART_OFS_NXTBLK,
+ .size = MTDPART_SIZ_FULL,
+- }
++ },
+ };
+
+ static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
+diff --git a/arch/arm/mach-at91/board-cap9adk.c b/arch/arm/mach-at91/board-cap9adk.c
+index 52f75c6..de9f921 100644
+--- a/arch/arm/mach-at91/board-cap9adk.c
++++ b/arch/arm/mach-at91/board-cap9adk.c
+@@ -167,8 +167,18 @@ static struct at91_eth_data __initdata cap9adk_macb_data = {
+ */
+ static struct mtd_partition __initdata cap9adk_nand_partitions[] = {
+ {
+- .name = "NAND partition",
+- .offset = 0,
++ .name = "Bootstrap",
++ .offset = 0,
++ .size = 4 * SZ_1M,
++ },
++ {
++ .name = "Root File System",
++ .offset = MTDPART_OFS_NXTBLK,
++ .size = CONFIG_MTD_NAND_ATMEL_ROOTFS_SIZE * SZ_1M,
++ },
++ {
++ .name = "Data",
++ .offset = MTDPART_OFS_NXTBLK,
+ .size = MTDPART_SIZ_FULL,
+ },
+ };
+diff --git a/arch/arm/mach-at91/board-dk.c b/arch/arm/mach-at91/board-dk.c
+index 3efca21..b521503 100644
+--- a/arch/arm/mach-at91/board-dk.c
++++ b/arch/arm/mach-at91/board-dk.c
+@@ -314,8 +314,18 @@ static struct i2c_board_info __initdata dk_i2c_devices[] = {
+
+ static struct mtd_partition __initdata dk_nand_partition[] = {
+ {
+- .name = "NAND Partition 1",
+- .offset = 0,
++ .name = "Bootstrap",
++ .offset = 0,
++ .size = 4 * SZ_1M,
++ },
++ {
++ .name = "Root File System",
++ .offset = MTDPART_OFS_NXTBLK,
++ .size = CONFIG_MTD_NAND_ATMEL_ROOTFS_SIZE * SZ_1M,
++ },
++ {
++ .name = "Data",
++ .offset = MTDPART_OFS_NXTBLK,
+ .size = MTDPART_SIZ_FULL,
+ },
+ };
+diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c
+index e6cab50..c098216 100644
+--- a/arch/arm/mach-at91/board-sam9260ek.c
++++ b/arch/arm/mach-at91/board-sam9260ek.c
+@@ -177,12 +177,17 @@ static struct at91_eth_data __initdata ek_macb_data = {
+ */
+ static struct mtd_partition __initdata ek_nand_partition[] = {
+ {
+- .name = "Partition 1",
+- .offset = 0,
+- .size = SZ_256K,
++ .name = "Bootstrap",
++ .offset = 0,
++ .size = 4 * SZ_1M,
+ },
+ {
+- .name = "Partition 2",
++ .name = "Root File System",
++ .offset = MTDPART_OFS_NXTBLK,
++ .size = CONFIG_MTD_NAND_ATMEL_ROOTFS_SIZE * SZ_1M,
++ },
++ {
++ .name = "Data",
+ .offset = MTDPART_OFS_NXTBLK,
+ .size = MTDPART_SIZ_FULL,
+ },
+diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c
+index 8bcd631..66cd246 100644
+--- a/arch/arm/mach-at91/board-sam9261ek.c
++++ b/arch/arm/mach-at91/board-sam9261ek.c
+@@ -184,12 +184,17 @@ static struct at91_mmc_data __initdata ek_mmc_data = {
+ */
+ static struct mtd_partition __initdata ek_nand_partition[] = {
+ {
+- .name = "Partition 1",
+- .offset = 0,
+- .size = SZ_256K,
++ .name = "Bootstrap",
++ .offset = 0,
++ .size = 4 * SZ_1M,
+ },
+ {
+- .name = "Partition 2",
++ .name = "Root File System",
++ .offset = MTDPART_OFS_NXTBLK,
++ .size = CONFIG_MTD_NAND_ATMEL_ROOTFS_SIZE * SZ_1M,
++ },
++ {
++ .name = "Data",
+ .offset = MTDPART_OFS_NXTBLK,
+ .size = MTDPART_SIZ_FULL,
+ },
+diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c
+index 7cbec96..f3ad0f4 100644
+--- a/arch/arm/mach-at91/board-sam9263ek.c
++++ b/arch/arm/mach-at91/board-sam9263ek.c
+@@ -174,12 +174,17 @@ static struct at91_eth_data __initdata ek_macb_data = {
+ */
+ static struct mtd_partition __initdata ek_nand_partition[] = {
+ {
+- .name = "Partition 1",
+- .offset = 0,
+- .size = SZ_64M,
++ .name = "Bootstrap",
++ .offset = 0,
++ .size = 4 * SZ_1M,
+ },
+ {
+- .name = "Partition 2",
++ .name = "Root File System",
++ .offset = MTDPART_OFS_NXTBLK,
++ .size = CONFIG_MTD_NAND_ATMEL_ROOTFS_SIZE * SZ_1M,
++ },
++ {
++ .name = "Data",
+ .offset = MTDPART_OFS_NXTBLK,
+ .size = MTDPART_SIZ_FULL,
+ },
+diff --git a/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c b/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c
+index 4061d82..51b3008 100644
+--- a/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c
++++ b/arch/arm/mach-at91/board-sam9g20ek-2slot-mmc.c
+@@ -130,12 +130,12 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
+ .size = 4 * SZ_1M,
+ },
+ {
+- .name = "Partition 1",
++ .name = "Root File System",
+ .offset = MTDPART_OFS_NXTBLK,
+- .size = 60 * SZ_1M,
++ .size = CONFIG_MTD_NAND_ATMEL_ROOTFS_SIZE * SZ_1M,
+ },
+ {
+- .name = "Partition 2",
++ .name = "Data",
+ .offset = MTDPART_OFS_NXTBLK,
+ .size = MTDPART_SIZ_FULL,
+ },
+diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c
+index b2117b9..811dd09 100644
+--- a/arch/arm/mach-at91/board-sam9g20ek.c
++++ b/arch/arm/mach-at91/board-sam9g20ek.c
+@@ -129,12 +129,12 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
+ .size = 4 * SZ_1M,
+ },
+ {
+- .name = "Partition 1",
++ .name = "Root File System",
+ .offset = MTDPART_OFS_NXTBLK,
+- .size = 60 * SZ_1M,
++ .size = CONFIG_MTD_NAND_ATMEL_ROOTFS_SIZE * SZ_1M,
+ },
+ {
+- .name = "Partition 2",
++ .name = "Data",
+ .offset = MTDPART_OFS_NXTBLK,
+ .size = MTDPART_SIZ_FULL,
+ },
+diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c
+index 0277e6b..6f5d02a 100644
+--- a/arch/arm/mach-at91/board-sam9m10g45ek.c
++++ b/arch/arm/mach-at91/board-sam9m10g45ek.c
+@@ -134,12 +134,17 @@ static struct at91_eth_data __initdata ek_macb_data = {
+ */
+ static struct mtd_partition __initdata ek_nand_partition[] = {
+ {
+- .name = "Partition 1",
+- .offset = 0,
+- .size = SZ_64M,
++ .name = "Bootstrap",
++ .offset = 0,
++ .size = 4 * SZ_1M,
+ },
+ {
+- .name = "Partition 2",
++ .name = "Root File System",
++ .offset = MTDPART_OFS_NXTBLK,
++ .size = CONFIG_MTD_NAND_ATMEL_ROOTFS_SIZE * SZ_1M,
++ },
++ {
++ .name = "Data",
+ .offset = MTDPART_OFS_NXTBLK,
+ .size = MTDPART_SIZ_FULL,
+ },
+diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c
+index 23e6546..07f0c03 100644
+--- a/arch/arm/mach-at91/board-sam9rlek.c
++++ b/arch/arm/mach-at91/board-sam9rlek.c
+@@ -83,12 +83,17 @@ static struct at91_mmc_data __initdata ek_mmc_data = {
+ */
+ static struct mtd_partition __initdata ek_nand_partition[] = {
+ {
+- .name = "Partition 1",
+- .offset = 0,
+- .size = SZ_256K,
++ .name = "Bootstrap",
++ .offset = 0,
++ .size = 4 * SZ_1M,
+ },
+ {
+- .name = "Partition 2",
++ .name = "Root File System",
++ .offset = MTDPART_OFS_NXTBLK,
++ .size = CONFIG_MTD_NAND_ATMEL_ROOTFS_SIZE * SZ_1M,
++ },
++ {
++ .name = "Data",
+ .offset = MTDPART_OFS_NXTBLK,
+ .size = MTDPART_SIZ_FULL,
+ },
+--
+1.7.1
+
diff --git a/recipes/linux/linux-2.6.30/at91/exp.4/0002-mach-at91-KConfig-cleanup.patch b/recipes/linux/linux-2.6.30/at91/exp.4/0002-mach-at91-KConfig-cleanup.patch
new file mode 100644
index 0000000000..a58008cb1e
--- /dev/null
+++ b/recipes/linux/linux-2.6.30/at91/exp.4/0002-mach-at91-KConfig-cleanup.patch
@@ -0,0 +1,202 @@
+From 13d462c45ddcb46e6a7de700ee9b6eaafdb0a728 Mon Sep 17 00:00:00 2001
+From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
+Date: Wed, 26 Jan 2011 09:34:00 +0100
+Subject: [PATCH 2/2] mach-at91 KConfig cleanup
+
+---
+ arch/arm/mach-at91/Kconfig | 45 +++++++++++++++++++++++++++++++++++++++++--
+ 1 files changed, 42 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
+index 46d1926..3ff11ab 100644
+--- a/arch/arm/mach-at91/Kconfig
++++ b/arch/arm/mach-at91/Kconfig
+@@ -97,6 +97,7 @@ config ARCH_AT91RM9200DK
+ bool "Atmel AT91RM9200-DK Development board"
+ depends on ARCH_AT91RM9200
+ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using Atmel's AT91RM9200-DK Development board.
+ (Discontinued)
+@@ -104,6 +105,7 @@ config ARCH_AT91RM9200DK
+ config MACH_AT91RM9200EK
+ bool "Atmel AT91RM9200-EK Evaluation Kit"
+ depends on ARCH_AT91RM9200
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using Atmel's AT91RM9200-EK Evaluation Kit.
+ <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3507>
+@@ -172,6 +174,7 @@ config MACH_HOMEMATIC
+ config MACH_ECBAT91
+ bool "emQbit ECB_AT91 SBC"
+ depends on ARCH_AT91RM9200
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using emQbit's ECB_AT91 board.
+ <http://wiki.emqbit.com/free-ecb-at91>
+@@ -215,6 +218,8 @@ config MACH_AT91SAM9260EK
+ bool "Atmel AT91SAM9260-EK / AT91SAM9XE Evaluation Kit"
+ depends on ARCH_AT91SAM9260
+ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using Atmel's AT91SAM9260-EK or AT91SAM9XE Evaluation Kit
+ <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3933>
+@@ -229,6 +234,7 @@ config MACH_CAM60
+ config MACH_SAM9_L9260
+ bool "Olimex SAM9-L9260 board"
+ depends on ARCH_AT91SAM9260
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using Olimex's SAM9-L9260 board based on the Atmel AT91SAM9260.
+ <http://www.olimex.com/dev/sam9-L9260.html>
+@@ -281,6 +287,8 @@ config MACH_AT91SAM9261EK
+ bool "Atmel AT91SAM9261-EK Evaluation Kit"
+ depends on ARCH_AT91SAM9261
+ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using Atmel's AT91SAM9261-EK Evaluation Kit.
+ <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3820>
+@@ -297,6 +305,8 @@ config MACH_AT91SAM9G10EK
+ bool "Atmel AT91SAM9G10-EK Evaluation Kit"
+ depends on ARCH_AT91SAM9G10
+ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using Atmel's AT91SAM9G10-EK Evaluation Kit.
+ <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4588>
+@@ -313,6 +323,8 @@ config MACH_AT91SAM9263EK
+ bool "Atmel AT91SAM9263-EK Evaluation Kit"
+ depends on ARCH_AT91SAM9263
+ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using Atmel's AT91SAM9263-EK Evaluation Kit.
+ <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4057>
+@@ -334,6 +346,7 @@ config MACH_CSB737
+ config MACH_TOTEMNOVA
+ bool "TotemNova Micronova industrial supervisor"
+ depends on ARCH_AT91SAM9263
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using Micronova's TotemNova industrial supervisor
+ <http://www.micronovasrl.com>
+@@ -341,6 +354,7 @@ config MACH_TOTEMNOVA
+ config MACH_NEOCORE926
+ bool "Adeneo NEOCORE926"
+ depends on ARCH_AT91SAM9263
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using the Adeneo Neocore 926 board.
+
+@@ -371,6 +385,8 @@ config MACH_AT91SAM9G20EK
+ bool "Atmel AT91SAM9G20-EK Evaluation Kit"
+ depends on ARCH_AT91SAM9G20
+ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using Atmel's AT91SAM9G20-EK Evaluation Kit
+ that embeds only one SD/MMC slot.
+@@ -379,6 +395,7 @@ config MACH_AT91SAM9G20EK_2MMC
+ bool "Atmel AT91SAM9G20-EK Evaluation Kit with 2 SD/MMC Slots"
+ depends on ARCH_AT91SAM9G20
+ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
+ help
+ Select this if you are using an Atmel AT91SAM9G20-EK Evaluation Kit
+ with 2 SD/MMC Slots. This is the case for AT91SAM9G20-EK rev. C and
+@@ -417,13 +434,23 @@ config MACH_AT91SAM9G45EKES
+ bool "Atmel AT91SAM9G45-EKES Evaluation Kit"
+ depends on ARCH_AT91SAM9G45
+ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
+ help
+ Select this if you are using Atmel's AT91SAM9G45-EKES Evaluation Kit.
+ "ES" at the end of the name means that this board is an
+ Engineering Sample.
+
+-endif
++config MACH_AT91SAM9M10G45EK
++ bool "Atmel AT91SAM9M10G45-EK Evaluation Kit"
++ depends on ARCH_AT91SAM9G45
++ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
++ help
++ Select this if you are using Atmel's AT91SAM9M10G45-EK Evaluation Kit.
++ "ES2" at the end of the name means that this board is an
++ Engineering Sample.
+
++endif
+ # ----------------------------------------------------------
+
+ if ARCH_AT91SAM9M10
+@@ -436,6 +463,7 @@ choice
+ config MACH_AT91SAM9M10EKES
+ bool "Atmel AT91SAM9M10-EKES Evaluation Kit"
+ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
+ help
+ Select this if you are using Atmel's AT91SAM9M10-EKES Evaluation Kit.
+ "ES" at the end of the name means that this board is an
+@@ -444,6 +472,7 @@ config MACH_AT91SAM9M10EKES
+ config MACH_AT91SAM9M10G45EK
+ bool "Atmel AT91SAM9M10G45-EK Evaluation Kit"
+ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
+ help
+ Select this if you are using Atmel's AT91SAM9M10G45-EK Evaluation Kit.
+ <http://atmel.com/dyn/products/tools_card_v2.asp?tool_id=4735>
+@@ -462,6 +491,8 @@ config MACH_AT91CAP9ADK
+ bool "Atmel AT91CAP9A-DK Evaluation Kit"
+ depends on ARCH_AT91CAP9
+ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using Atmel's AT91CAP9A-DK Evaluation Kit.
+ <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4138>
+@@ -478,6 +509,8 @@ config MACH_AT572D940HFEB
+ bool "AT572D940HF-EK"
+ depends on ARCH_AT572D940HF
+ select MTD_NAND_ALLOW_CONFIGURABLE_ROOTFS_SIZE
++ select MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
++ select MTD_ALLOW_DATAFLASHCARD
+ help
+ Select this if you are using Atmel's AT572D940HF-EK evaluation kit.
+ <http://www.atmel.com/products/diopsis/default.asp>
+@@ -506,17 +539,23 @@ comment "AT91 Board Options"
+
+ config MTD_AT91_DATAFLASH_CARD
+ bool "Enable DataFlash Card support"
+- depends on (ARCH_AT91RM9200DK || MACH_AT91RM9200EK || MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_AT91SAM9G10EK || MACH_AT91SAM9263EK || MACH_AT91SAM9G20EK || MACH_ECBAT91 || MACH_SAM9_L9260 || MACH_AT91CAP9ADK || MACH_AT572D940HFEB || MACH_TOTEMNOVA || MACH_NEOCORE926)
++ depends on MTD_ALLOW_DATAFLASHCARD
+ help
+ Enable support for the DataFlash card.
+
++config MTD_ALLOW_DATAFLASHCARD
++ bool
++
+ config MTD_NAND_ATMEL_BUSWIDTH_16
+ bool "Enable 16-bit data bus interface to NAND flash"
+- depends on (MACH_AT91SAM9260EK || MACH_AT91SAM9261EK || MACH_AT91SAM9G10EK || MACH_AT91SAM9263EK || MACH_AT91SAM9G20EK || MACH_AT91SAM9G20EK_2MMC || MACH_AT91SAM9G45EKES || MACH_AT91SAM9M10EKES || MACH_AT91SAM9M10G45EK || MACH_AT91CAP9ADK || MACH_AT572D940HFEB)
++ depends on MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
+ help
+ On AT91SAM926x boards both types of NAND flash can be present
+ (8 and 16 bit data bus width).
+
++config MTD_NAND_ALLOW_CONFIGURABLE_NAND_BUSWIDTH
++ bool
++
+ config MTD_NAND_ATMEL_ROOTFS_SIZE
+ int "Size NAND rootfs in MB"
+ range 8 250
+--
+1.7.1
+
diff --git a/recipes/linux/linux-2.6.36/warpcomm/defconfig b/recipes/linux/linux-2.6.36/warpcomm/defconfig
new file mode 100644
index 0000000000..a41e452d2d
--- /dev/null
+++ b/recipes/linux/linux-2.6.36/warpcomm/defconfig
@@ -0,0 +1,1700 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.36
+# Thu Oct 28 19:51:12 2010
+#
+CONFIG_ARM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_GENERIC_GPIO=y
+# CONFIG_ARCH_USES_GETTIMEOFFSET is not set
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_HAVE_PROC_CPU=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_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_CONSTRUCTORS=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=y
+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
+
+#
+# RCU Subsystem
+#
+CONFIG_TREE_RCU=y
+# CONFIG_TINY_RCU is not set
+# CONFIG_RCU_TRACE is not set
+CONFIG_RCU_FANOUT=32
+# CONFIG_RCU_FANOUT_EXACT is not set
+# CONFIG_TREE_RCU_TRACE is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=15
+# CONFIG_CGROUPS is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
+# CONFIG_RELAY 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_BLK_DEV_INITRD is not set
+# 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_PCI_QUIRKS=y
+CONFIG_SLUB_DEBUG=y
+CONFIG_COMPAT_BRK=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# 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
+
+#
+# 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 is not set
+# 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 is not set
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+# 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=y
+# 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 is not set
+# CONFIG_ARCH_S3C64XX is not set
+# CONFIG_ARCH_S5P6440 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_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
+
+#
+# Marvell Kirkwood Implementations
+#
+# CONFIG_MACH_DB88F6281_BP is not set
+# CONFIG_MACH_RD88F6192_NAS is not set
+# CONFIG_MACH_RD88F6281 is not set
+# CONFIG_MACH_MV88F6281GTW_GE is not set
+# CONFIG_MACH_SHEEVAPLUG is not set
+# CONFIG_MACH_ESATA_SHEEVAPLUG is not set
+# CONFIG_MACH_GURUPLUG is not set
+# CONFIG_MACH_TS219 is not set
+# CONFIG_MACH_TS41X is not set
+# CONFIG_MACH_OPENRD_BASE is not set
+# CONFIG_MACH_OPENRD_CLIENT is not set
+# CONFIG_MACH_OPENRD_ULTIMATE is not set
+# CONFIG_MACH_NETSPACE_V2 is not set
+CONFIG_MACH_TK71=y
+# CONFIG_MACH_INETSPACE_V2 is not set
+# CONFIG_MACH_NETSPACE_MAX_V2 is not set
+# CONFIG_MACH_NET2BIG_V2 is not set
+# CONFIG_MACH_NET5BIG_V2 is not set
+# CONFIG_MACH_T5325 is not set
+CONFIG_PLAT_ORION=y
+
+#
+# Processor Type
+#
+CONFIG_CPU_FEROCEON=y
+# CONFIG_CPU_FEROCEON_OLD_ID is not set
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5T=y
+CONFIG_CPU_PABRT_LEGACY=y
+CONFIG_CPU_CACHE_VIVT=y
+CONFIG_CPU_COPY_FEROCEON=y
+CONFIG_CPU_TLB_FEROCEON=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_OUTER_CACHE=y
+CONFIG_CACHE_FEROCEON_L2=y
+# CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH is not set
+CONFIG_ARM_L1_CACHE_SHIFT=5
+
+#
+# Bus support
+#
+CONFIG_PCI=y
+CONFIG_PCI_SYSCALL=y
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCI_STUB is not set
+# CONFIG_PCI_IOV is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+# CONFIG_PREEMPT_NONE is not set
+CONFIG_PREEMPT_VOLUNTARY=y
+# CONFIG_PREEMPT is not set
+CONFIG_HZ=100
+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_SPARSE_IRQ 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_FORCE_MAX_ZONEORDER=11
+CONFIG_ALIGNMENT_TRAP=y
+# CONFIG_UACCESS_WITH_MEMCPY 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=""
+# CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
+# CONFIG_AUTO_ZRELADDR is not set
+
+#
+# CPU Power Management
+#
+CONFIG_CPU_IDLE=y
+CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_IDLE_GOV_MENU=y
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+# CONFIG_VFP is not set
+
+#
+# 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=y
+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 is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# 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=y
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# 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_BRIDGE is not set
+# CONFIG_NET_DSA is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_PHONET is not set
+# CONFIG_IEEE802154 is not set
+# CONFIG_NET_SCHED is not set
+# 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 is not set
+# CONFIG_AF_RXRPC is not set
+CONFIG_WIRELESS=y
+# CONFIG_CFG80211 is not set
+# 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
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_DEVTMPFS=y
+# CONFIG_DEVTMPFS_MOUNT is not set
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+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 is not set
+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=y
+CONFIG_MTD_GEN_PROBE=y
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+CONFIG_MTD_CFI_NOSWAP=y
+# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
+# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
+CONFIG_MTD_CFI_GEOMETRY=y
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set
+# 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 is not set
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_OTP is not set
+# CONFIG_MTD_CFI_INTELEXT is not set
+# 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 is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PHYSMAP is not set
+# CONFIG_MTD_ARM_INTEGRATOR is not set
+# CONFIG_MTD_IMPA7 is not set
+# CONFIG_MTD_INTEL_VR_NOR is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_PMC551 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 is not set
+# CONFIG_MTD_SM_COMMON is not set
+# CONFIG_MTD_NAND_MUSEUM_IDS is not set
+# CONFIG_MTD_NAND_DENALI is not set
+# CONFIG_MTD_NAND_GPIO is not set
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_RICOH is not set
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_CAFE 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_NAND_ORION=y
+# CONFIG_MTD_ONENAND is not set
+
+#
+# LPDDR flash memory drivers
+#
+# CONFIG_MTD_LPDDR is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+
+#
+# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
+#
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_UB is not set
+# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_MG_DISK 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=y
+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=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+CONFIG_BLK_DEV_SR=y
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=y
+# CONFIG_CHR_DEV_SCH is not set
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+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_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+# CONFIG_SCSI_LOWLEVEL is not set
+# CONFIG_SCSI_DH is not set
+# CONFIG_SCSI_OSD_INITIATOR is not set
+CONFIG_ATA=y
+# CONFIG_ATA_NONSTANDARD is not set
+CONFIG_ATA_VERBOSE_ERROR=y
+CONFIG_SATA_PMP=y
+
+#
+# Controllers with non-SFF native interface
+#
+# CONFIG_SATA_AHCI is not set
+# CONFIG_SATA_AHCI_PLATFORM is not set
+# CONFIG_SATA_INIC162X is not set
+# CONFIG_SATA_SIL24 is not set
+CONFIG_ATA_SFF=y
+
+#
+# SFF controllers with custom DMA interface
+#
+# CONFIG_PDC_ADMA is not set
+# CONFIG_SATA_QSTOR is not set
+# CONFIG_SATA_SX4 is not set
+CONFIG_ATA_BMDMA=y
+
+#
+# SATA SFF controllers with BMDMA
+#
+# CONFIG_ATA_PIIX is not set
+CONFIG_SATA_MV=y
+# CONFIG_SATA_NV is not set
+# CONFIG_SATA_PROMISE is not set
+# CONFIG_SATA_SIL is not set
+# CONFIG_SATA_SIS is not set
+# CONFIG_SATA_SVW is not set
+# CONFIG_SATA_ULI is not set
+# CONFIG_SATA_VIA is not set
+# CONFIG_SATA_VITESSE is not set
+
+#
+# PATA SFF controllers with BMDMA
+#
+# CONFIG_PATA_ALI is not set
+# CONFIG_PATA_AMD is not set
+# CONFIG_PATA_ARTOP is not set
+# CONFIG_PATA_ATIIXP is not set
+# CONFIG_PATA_ATP867X is not set
+# CONFIG_PATA_CMD64X is not set
+# CONFIG_PATA_CS5520 is not set
+# CONFIG_PATA_CS5530 is not set
+# CONFIG_PATA_CYPRESS is not set
+# CONFIG_PATA_EFAR is not set
+# CONFIG_PATA_HPT366 is not set
+# CONFIG_PATA_HPT37X is not set
+# CONFIG_PATA_HPT3X2N is not set
+# CONFIG_PATA_HPT3X3 is not set
+# CONFIG_PATA_IT8213 is not set
+# CONFIG_PATA_IT821X is not set
+# CONFIG_PATA_JMICRON is not set
+# CONFIG_PATA_MARVELL is not set
+# CONFIG_PATA_NETCELL is not set
+# CONFIG_PATA_NINJA32 is not set
+# CONFIG_PATA_NS87415 is not set
+# CONFIG_PATA_OLDPIIX is not set
+# CONFIG_PATA_OPTIDMA is not set
+# CONFIG_PATA_PDC2027X is not set
+# CONFIG_PATA_PDC_OLD is not set
+# CONFIG_PATA_RADISYS is not set
+# CONFIG_PATA_RDC is not set
+# CONFIG_PATA_SC1200 is not set
+# CONFIG_PATA_SCH is not set
+# CONFIG_PATA_SERVERWORKS is not set
+# CONFIG_PATA_SIL680 is not set
+# CONFIG_PATA_SIS is not set
+# CONFIG_PATA_TOSHIBA is not set
+# CONFIG_PATA_TRIFLEX is not set
+# CONFIG_PATA_VIA is not set
+# CONFIG_PATA_WINBOND is not set
+
+#
+# PIO-only SFF controllers
+#
+# CONFIG_PATA_CMD640_PCI is not set
+# CONFIG_PATA_MPIIX is not set
+# CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_OPTI is not set
+# CONFIG_PATA_RZ1000 is not set
+
+#
+# Generic fallback / legacy drivers
+#
+# CONFIG_ATA_GENERIC is not set
+# CONFIG_PATA_LEGACY is not set
+# CONFIG_MD is not set
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+
+#
+# You can enable one or both FireWire driver stacks.
+#
+
+#
+# The newer stack is recommended.
+#
+# CONFIG_FIREWIRE is not set
+# CONFIG_IEEE1394 is not set
+# CONFIG_FIREWIRE_NOSY is not set
+# CONFIG_I2O 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 is not set
+# CONFIG_VETH is not set
+# CONFIG_ARCNET is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+CONFIG_MARVELL_PHY=y
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_MICREL_PHY is not set
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
+# CONFIG_NET_ETHERNET is not set
+CONFIG_NETDEV_1000=y
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_E1000E is not set
+# CONFIG_IP1000 is not set
+# CONFIG_IGB is not set
+# CONFIG_IGBVF is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
+# CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
+# CONFIG_VIA_VELOCITY is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+# CONFIG_CNIC is not set
+CONFIG_MV643XX_ETH=y
+# CONFIG_QLA3XXX is not set
+# CONFIG_ATL1 is not set
+# CONFIG_ATL1E is not set
+# CONFIG_ATL1C is not set
+# CONFIG_JME is not set
+# CONFIG_NETDEV_10000 is not set
+# CONFIG_TR is not set
+CONFIG_WLAN=y
+# CONFIG_ATMEL is not set
+# CONFIG_PRISM54 is not set
+# 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_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_VMXNET3 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=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO 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 is not set
+# CONFIG_DEVKMEM is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_N_GSM is not set
+# CONFIG_NOZOMI is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=2
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_MFD_HSU is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+# 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=y
+CONFIG_LEGACY_PTY_COUNT=16
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_HW_RANDOM_TIMERIOMEM is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_DEVPORT=y
+# 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=y
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# PC SMBus host controller drivers
+#
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_ISCH is not set
+# CONFIG_I2C_PIIX4 is not set
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_GPIO is not set
+CONFIG_I2C_MV64XXX=y
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_PCA_PLATFORM is not set
+# 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 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_IT8761E is not set
+# CONFIG_GPIO_SCH 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
+
+#
+# PCI GPIO expanders:
+#
+# CONFIG_GPIO_CS5535 is not set
+# CONFIG_GPIO_BT8XX is not set
+# CONFIG_GPIO_LANGWELL is not set
+# CONFIG_GPIO_RDC321X is not set
+
+#
+# SPI GPIO expanders:
+#
+
+#
+# AC97 GPIO expanders:
+#
+
+#
+# MODULbus GPIO expanders:
+#
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY 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_ORION_WATCHDOG=y
+# CONFIG_MAX63XX_WATCHDOG is not set
+# CONFIG_ALIM7101_WDT is not set
+
+#
+# PCI-based Watchdog Cards
+#
+# CONFIG_PCIPCWATCHDOG is not set
+# CONFIG_WDTPCI 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 is not set
+# 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_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 is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_WM8994 is not set
+# CONFIG_MFD_PCF50633 is not set
+# CONFIG_ABX500_CORE is not set
+# CONFIG_MFD_TIMBERDALE is not set
+# CONFIG_LPC_SCH is not set
+# CONFIG_MFD_RDC321X is not set
+# CONFIG_MFD_JANZ_CMODIO is not set
+# CONFIG_MFD_TPS6586X is not set
+# CONFIG_REGULATOR is not set
+# CONFIG_MEDIA_SUPPORT is not set
+
+#
+# Graphics support
+#
+CONFIG_VGA_ARB=y
+CONFIG_VGA_ARB_MAX_GPUS=16
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Console display driver support
+#
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FONT_8x16=y
+# CONFIG_SOUND is not set
+# CONFIG_HID_SUPPORT is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_DEVICE_CLASS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_SUSPEND 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_XHCI_HCD is not set
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+CONFIG_USB_EHCI_TT_NEWSCHED=y
+# 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 is not set
+# CONFIG_USB_UHCI_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_WHCI_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_STORAGE=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_ONETOUCH is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
+CONFIG_USB_LIBUSUAL=y
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK 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_SISUSBVGA=m
+CONFIG_USB_SISUSBVGA_CON=y
+# 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_GADGET 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_UWB is not set
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+# CONFIG_MMC_UNSAFE_RESUME is not set
+
+#
+# MMC/SD/SDIO Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+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_TIFM_SD is not set
+CONFIG_MMC_MVSDIO=y
+# CONFIG_MMC_CB710 is not set
+# CONFIG_MMC_VIA_SDMMC is not set
+# CONFIG_MEMSTICK is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+# CONFIG_LEDS_PCA9532 is not set
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_GPIO_PLATFORM=y
+# CONFIG_LEDS_LP3944 is not set
+# CONFIG_LEDS_PCA955X 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=y
+
+#
+# iptables trigger is under Netfilter config (LED target)
+#
+# CONFIG_ACCESSIBILITY is not set
+# CONFIG_INFINIBAND 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
+#
+
+#
+# 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
+
+#
+# on-CPU RTC drivers
+#
+CONFIG_RTC_DRV_MV=y
+CONFIG_DMADEVICES=y
+# CONFIG_DMADEVICES_DEBUG is not set
+
+#
+# DMA Devices
+#
+CONFIG_MV_XOR=y
+# CONFIG_TIMB_DMA is not set
+CONFIG_DMA_ENGINE=y
+
+#
+# DMA Clients
+#
+# CONFIG_NET_DMA is not set
+# CONFIG_ASYNC_TX_DMA is not set
+# CONFIG_DMATEST is not set
+# CONFIG_AUXDISPLAY is not set
+# CONFIG_UIO is not set
+# CONFIG_STAGING 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 is not set
+# CONFIG_JFS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+# 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=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# Caches
+#
+CONFIG_FSCACHE=y
+# CONFIG_FSCACHE_STATS is not set
+# CONFIG_FSCACHE_HISTOGRAM is not set
+# CONFIG_FSCACHE_DEBUG is not set
+# CONFIG_FSCACHE_OBJECT_LIST is not set
+# CONFIG_CACHEFILES is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=y
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+# CONFIG_MSDOS_FS is not set
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=850
+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=y
+CONFIG_JFFS2_FS_POSIX_ACL=y
+CONFIG_JFFS2_FS_SECURITY=y
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+# CONFIG_JFFS2_CMODE_NONE is not set
+# CONFIG_JFFS2_CMODE_PRIORITY is not set
+# CONFIG_JFFS2_CMODE_SIZE is not set
+CONFIG_JFFS2_CMODE_FAVOURLZO=y
+# 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=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+# CONFIG_NFS_V4 is not set
+CONFIG_ROOT_NFS=y
+# CONFIG_NFS_FSCACHE is not set
+CONFIG_NFSD=y
+CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V3=y
+CONFIG_NFSD_V3_ACL=y
+# CONFIG_NFSD_V4 is not set
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=y
+CONFIG_NFS_ACL_SUPPORT=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CEPH_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+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=y
+# 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=y
+# 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=y
+# CONFIG_STRIP_ASM_SYMS is not set
+# 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_SLUB_DEBUG_ON is not set
+# CONFIG_SLUB_STATS is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+CONFIG_DEBUG_MEMORY_INIT=y
+CONFIG_FRAME_POINTER=y
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+CONFIG_HAVE_FUNCTION_TRACER=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_ARM_UNWIND is not set
+# CONFIG_DEBUG_USER is not set
+# CONFIG_OC_ETM is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS 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_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_PCOMP2=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_NULL is not set
+CONFIG_CRYPTO_WORKQUEUE=y
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+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=y
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+CONFIG_CRYPTO_ECB=y
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+CONFIG_CRYPTO_HMAC=y
+# 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 is not set
+# 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=y
+# 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=y
+# 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 is not set
+# CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_CRYPTO_HW=y
+CONFIG_CRYPTO_DEV_MV_CESA=y
+# CONFIG_CRYPTO_DEV_HIFN_795X is not set
+# CONFIG_BINARY_PRINTF is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_T10DIF is not set
+CONFIG_CRC_ITU_T=y
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
+CONFIG_NLATTR=y
+CONFIG_GENERIC_ATOMIC64=y
diff --git a/recipes/linux/linux-2.6.37/om-gta01/defconfig b/recipes/linux/linux-2.6.37/om-gta01/defconfig
index bb95fc062a..24ee0c9552 100644
--- a/recipes/linux/linux-2.6.37/om-gta01/defconfig
+++ b/recipes/linux/linux-2.6.37/om-gta01/defconfig
@@ -1,550 +1,79 @@
-#
-# Automatically generated make config: don't edit
-# Linux/arm 2.6.37.1 Kernel Configuration
-# Tue Feb 22 11:01:17 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_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 is not set
CONFIG_KERNEL_LZMA=y
-# 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_UP=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_S3C2410_ONLY=y
-CONFIG_CPU_LLSERIAL_S3C2410=y
-CONFIG_S3C2410_CLOCK=y
CONFIG_S3C24XX_PWM=y
-CONFIG_S3C24XX_GPIO_EXTRA=0
-CONFIG_S3C2410_DMA=y
-# CONFIG_S3C2410_DMA_DEBUG is not set
-
-#
-# S3C2400 Machines
-#
-CONFIG_CPU_S3C2410=y
-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
CONFIG_MACH_NEO1973_GTA01=y
-
-#
-# 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
-
-#
-# S3C2440 and S3C2442 Machines
-#
-# CONFIG_MACH_ANUBIS is not set
-# CONFIG_MACH_NEO1973_GTA02 is not set
-# 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=100
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_CMDLINE="unused -- bootloader passes ATAG list quiet"
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
@@ -554,65 +83,32 @@ 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
@@ -621,16 +117,7 @@ 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
@@ -641,33 +128,16 @@ 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
@@ -682,7 +152,6 @@ 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
@@ -691,7 +160,6 @@ 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
@@ -704,39 +172,12 @@ 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
@@ -744,37 +185,15 @@ 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
@@ -784,317 +203,51 @@ 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_CFG80211 is not set
-# 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_OPENMOKO_RESUME_REASON=y
-# 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
@@ -1103,620 +256,122 @@ 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_PCF8574 is not set
-# CONFIG_INPUT_PWM_BEEPER is not set
-CONFIG_INPUT_PCF50606_PMU=y
-# 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=m
-
-#
-# 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_S3C2410=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_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
-
-#
-# 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 is not set
-# CONFIG_BATTERY_MAX17040 is not set
-# CONFIG_BATTERY_S3C_ADC is not set
-CONFIG_CHARGER_PCF50606=y
CONFIG_BATTERY_PLATFORM=y
# 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_PCF50606_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 is not set
-# 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 is not set
-# CONFIG_MFD_MC13XXX is not set
-# CONFIG_ABX500_CORE is not set
-# CONFIG_EZX_PCAP is not set
-# CONFIG_MFD_GLAMO is not set
-# CONFIG_MFD_TPS6586X is not set
-CONFIG_MFD_PCF50606=y
-CONFIG_PCF50606_ADC=y
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_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_REGULATOR_PCF50606=y
-# CONFIG_MEDIA_SUPPORT is not set
-
-#
-# Graphics support
-#
-# CONFIG_DRM is not set
-# 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_S3C2410=y
-# CONFIG_FB_S3C2410_DEBUG 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_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
-
-#
-# 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
@@ -1728,7 +383,6 @@ 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
@@ -1736,612 +390,123 @@ 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_USHC is not set
-# CONFIG_MEMSTICK is not set
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
-
-#
-# LED drivers
-#
CONFIG_LEDS_S3C24XX=y
-# 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=y
-# 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=y
CONFIG_LEDS_TRIGGER_GPIO=y
-# 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_PCF50606=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 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_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=y
-# 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/om-gta02/defconfig b/recipes/linux/linux-2.6.37/om-gta02/defconfig
index 77d1651e50..69204a63c5 100644
--- a/recipes/linux/linux-2.6.37/om-gta02/defconfig
+++ b/recipes/linux/linux-2.6.37/om-gta02/defconfig
@@ -1,553 +1,79 @@
-#
-# Automatically generated make config: don't edit
-# Linux/arm 2.6.37.1 Kernel Configuration
-# Tue Feb 22 10:58:18 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 is not set
CONFIG_KERNEL_LZMA=y
-# 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
-# CONFIG_MACH_NEO1973_GTA01 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=100
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_CMDLINE=" quiet"
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
@@ -557,65 +83,32 @@ 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
@@ -624,16 +117,7 @@ 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
@@ -644,33 +128,16 @@ 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
@@ -685,7 +152,6 @@ 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
@@ -694,7 +160,6 @@ 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
@@ -707,39 +172,12 @@ 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
@@ -747,37 +185,15 @@ 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
@@ -787,322 +203,52 @@ 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_BMP085=m
CONFIG_OPENMOKO_RESUME_REASON=y
-# 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
@@ -1111,625 +257,130 @@ 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_INPUT_LIS302DL=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=m
-
-#
-# 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_MFD_PCF50606 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 is not set
-# 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
@@ -1741,7 +392,6 @@ 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
@@ -1749,615 +399,123 @@ 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=y
-
-#
-# LED drivers
-#
CONFIG_LEDS_S3C24XX=y
-# 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=y
-# 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=y
CONFIG_LEDS_TRIGGER_GPIO=y
-# 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=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_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=y
-# 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
index c0d0ecbbea..e609755580 100644
--- a/recipes/linux/linux-2.6.37/openmoko.patch
+++ b/recipes/linux/linux-2.6.37/openmoko.patch
@@ -25531,7 +25531,7 @@ index 0000000..46b613c
+#endif /* _IEEE80211_NODE_H_ */
diff --git a/drivers/ar6000/include/ini_dset.h b/drivers/ar6000/include/ini_dset.h
new file mode 100644
-index 0000000..410f2b5
+index 0000000..410f2b52
--- /dev/null
+++ b/drivers/ar6000/include/ini_dset.h
@@ -0,0 +1,40 @@
@@ -51089,7 +51089,7 @@ index e97bdf1..0000000
-MODULE_DESCRIPTION("ALSA SoC WM8753 Neo1973 GTA02");
-MODULE_LICENSE("GPL");
diff --git a/sound/soc/s3c24xx/neo1973_wm8753.c b/sound/soc/s3c24xx/neo1973_wm8753.c
-index f4f2ee7..dc5893d 100644
+index f4f2ee7..dc5893d4 100644
--- a/sound/soc/s3c24xx/neo1973_wm8753.c
+++ b/sound/soc/s3c24xx/neo1973_wm8753.c
@@ -1,15 +1,16 @@
diff --git a/recipes/linux/linux-2.6.37/shr.patch b/recipes/linux/linux-2.6.37/shr.patch
index bcca6efc49..09c89c8978 100644
--- a/recipes/linux/linux-2.6.37/shr.patch
+++ b/recipes/linux/linux-2.6.37/shr.patch
@@ -1,25 +1,31 @@
All patches from shr kernel repository
rebased on top of openmoko kernel repository
-http://gitorious.org/~jama/htc-msm-2-6-32/openmoko-kernel/commits/shr-2.6.37
+https://gitorious.org/shr/linux/commits/shr-2.6.37-nodrm
-ccd549e Use 100 as HZ value on S3C24XX
-7afc3f0 wm8753: use snd_soc_jack on neo1973
-4941630 Force GPS power up on resume if it were powered up on suspend
-ef4b55b s3c2410_ts: jitter less touchscreen for glamo, version 4
-dc7bd23 Openmoko resume reason sysfs node ported from 2.6.29
-40e1523 Rename /dev/s3c2410_serialXXX to /dev/ttySACXXX
-41fb019 glamo-display: fix WSOD for 242 timming
-2d81aa9 Enable powering off after 8s POWER press
-743f76b Fix high power consumption in suspend
-3adb6be tslib relies on ts pressures events so this hack is needed to get tslib stuff working
-dcd1e55 ar6000_delay.patch
-f00d735 usbhost.patch
-4633ec7 touchscreen: ignore unexpected interrupts
-1b95598 wm8753: fix build with gcc-4.4.2, which works ok with 4.1.2
+bd961d3 nand/s3c2410: add mising badblocksbits value
+f12719d nand: Fix S3C NAND clok stop
+acf3f89 input: lis302dl: fix the resume path
+4682e58 (AG: there's some more rationale for changing this here
+0737f9a Temporarily rename pcf50633-gpio -> pcf50633-gpio.0
+3d04b2b lis302dl accelerometer driver
+58aa277 Use 100 as HZ value on S3C24XX
+42920dc wm8753: use snd_soc_jack on neo1973
+8d2fadf Force GPS power up on resume if it were powered up on suspend
+3f2ddad s3c2410_ts: jitter less touchscreen for glamo, version 4
+6f5f745 Openmoko resume reason sysfs node ported from 2.6.29
+9b2268e Rename /dev/s3c2410_serialXXX to /dev/ttySACXXX
+8a3a0a2 glamo-display: fix WSOD for 242 timming
+0b6c220 Enable powering off after 8s POWER press
+d96f9c7 Fix high power consumption in suspend
+2475b0a tslib relies on ts pressures events so this hack is needed to get tslib stuff working
+f4fdac1 ar6000_delay.patch
+85ee74f usbhost.patch
+1cbab82 touchscreen: ignore unexpected interrupts
+516ebb8 wm8753: fix build with gcc-4.4.2, which works ok with 4.1.2
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
-index d56d21c..fea7f49 100644
+index d56d21c0..fea7f49 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1302,7 +1302,7 @@ source kernel/Kconfig.preempt
@@ -282,10 +288,18 @@ index 0000000..233340a
+MODULE_AUTHOR("Harald Welte <laforge@openmoko.org>");
+MODULE_DESCRIPTION("Openmoko Freerunner USBHOST Power Management");
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c
-index 450f1f2..b4b60aa 100644
+index 450f1f2..6c2279e 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c2440/mach-gta02.c
-@@ -109,6 +109,7 @@
+@@ -62,6 +62,7 @@
+
+ #include <linux/input.h>
+ #include <linux/gpio_keys.h>
++#include <linux/lis302dl.h>
+
+ #include <linux/leds.h>
+ #include <linux/leds_pwm.h>
+@@ -109,6 +110,7 @@
#include <linux/jbt6k74.h>
#include <linux/glamofb.h>
#include <linux/mfd/glamo.h>
@@ -293,7 +307,7 @@ index 450f1f2..b4b60aa 100644
static struct pcf50633 *gta02_pcf;
-@@ -127,6 +128,10 @@ static long gta02_panic_blink(int state)
+@@ -127,6 +129,10 @@ static long gta02_panic_blink(int state)
return delay;
}
@@ -304,7 +318,7 @@ index 450f1f2..b4b60aa 100644
static struct map_desc gta02_iodesc[] __initdata = {
{
-@@ -177,6 +182,10 @@ static struct platform_device gta02_pm_gsm_dev = {
+@@ -177,6 +183,10 @@ static struct platform_device gta02_pm_gsm_dev = {
.name = "gta02-pm-gsm",
};
@@ -315,7 +329,7 @@ index 450f1f2..b4b60aa 100644
static struct platform_device gta02_pm_wlan_dev = {
.name = "gta02-pm-wlan",
};
-@@ -186,6 +195,11 @@ static struct regulator_consumer_supply gsm_supply_consumer = {
+@@ -186,6 +196,11 @@ static struct regulator_consumer_supply gsm_supply_consumer = {
.supply = "GSM",
};
@@ -327,7 +341,7 @@ index 450f1f2..b4b60aa 100644
static struct regulator_init_data gsm_supply_init_data = {
.constraints = {
.min_uV = 3700000,
-@@ -197,6 +211,17 @@ static struct regulator_init_data gsm_supply_init_data = {
+@@ -197,6 +212,17 @@ static struct regulator_init_data gsm_supply_init_data = {
.consumer_supplies = &gsm_supply_consumer,
};
@@ -345,7 +359,7 @@ index 450f1f2..b4b60aa 100644
static struct fixed_voltage_config gsm_supply_config = {
.supply_name = "GSM",
.microvolts = 3700000,
-@@ -205,6 +230,14 @@ static struct fixed_voltage_config gsm_supply_config = {
+@@ -205,6 +231,14 @@ static struct fixed_voltage_config gsm_supply_config = {
.init_data = &gsm_supply_init_data,
};
@@ -360,7 +374,7 @@ index 450f1f2..b4b60aa 100644
static struct platform_device gta02_gsm_supply_device = {
.name = "reg-fixed-voltage",
.id = 1,
-@@ -213,6 +246,14 @@ static struct platform_device gta02_gsm_supply_device = {
+@@ -213,6 +247,14 @@ static struct platform_device gta02_gsm_supply_device = {
},
};
@@ -375,7 +389,210 @@ index 450f1f2..b4b60aa 100644
/*
* we crank down SD Card clock dynamically when GPS is powered
*/
-@@ -498,6 +539,11 @@ static struct regulator_consumer_supply hcldo_consumers[] = {
+@@ -304,6 +346,202 @@ static struct glamo_platform_data gta02_glamo_pdata = {
+ .glamo_external_reset = gta02_glamo_external_reset,
+ };
+
++/* SPI: Accelerometers attached to SPI of s3c244x */
++
++/*
++ * Situation is that Linux SPI can't work in an interrupt context, so we
++ * implement our own bitbang here. Arbitration is needed because not only
++ * can this interrupt happen at any time even if foreground wants to use
++ * the bitbang API from Linux, but multiple motion sensors can be on the
++ * same SPI bus, and multiple interrupts can happen.
++ *
++ * Foreground / interrupt arbitration is okay because the interrupts are
++ * disabled around all the foreground SPI code.
++ *
++ * Interrupt / Interrupt arbitration is evidently needed, otherwise we
++ * lose edge-triggered service after a while due to the two sensors sharing
++ * the SPI bus having irqs at the same time eventually.
++ *
++ * Servicing is typ 75 - 100us at 400MHz.
++ */
++
++/* #define DEBUG_SPEW_MS */
++#define MG_PER_SAMPLE 18
++
++struct lis302dl_platform_data lis302_pdata_top;
++struct lis302dl_platform_data lis302_pdata_bottom;
++
++/*
++ * generic SPI RX and TX bitbang
++ * only call with interrupts off!
++ */
++
++static void __gta02_lis302dl_bitbang(struct lis302dl_info *lis, u8 *tx,
++ int tx_bytes, u8 *rx, int rx_bytes)
++{
++ struct lis302dl_platform_data *pdata = lis->pdata;
++ int n;
++ u8 shifter = 0;
++ unsigned long other_cs;
++
++ /*
++ * Huh... "quirk"... CS on this device is not really "CS" like you can
++ * expect.
++ *
++ * When it is 0 it selects SPI interface mode.
++ * When it is 1 it selects I2C interface mode.
++ *
++ * Because we have 2 devices on one interface we have to make sure
++ * that the "disabled" device (actually in I2C mode) don't think we're
++ * talking to it.
++ *
++ * When we talk to the "enabled" device, the "disabled" device sees
++ * the clocks as I2C clocks, creating havoc.
++ *
++ * I2C sees MOSI going LOW while CLK HIGH as a START action, thus we
++ * must ensure this is never issued.
++ */
++
++ if (&lis302_pdata_top == pdata)
++ other_cs = lis302_pdata_bottom.pin_chip_select;
++ else
++ other_cs = lis302_pdata_top.pin_chip_select;
++
++ s3c2410_gpio_setpin(other_cs, 1);
++ s3c2410_gpio_setpin(pdata->pin_chip_select, 1);
++ s3c2410_gpio_setpin(pdata->pin_clk, 1);
++ s3c2410_gpio_setpin(pdata->pin_chip_select, 0);
++
++ /* send the register index, r/w and autoinc bits */
++ for (n = 0; n < (tx_bytes << 3); n++) {
++ if (!(n & 7))
++ shifter = ~tx[n >> 3];
++ s3c2410_gpio_setpin(pdata->pin_clk, 0);
++ s3c2410_gpio_setpin(pdata->pin_mosi, !(shifter & 0x80));
++ s3c2410_gpio_setpin(pdata->pin_clk, 1);
++ shifter <<= 1;
++ }
++
++ for (n = 0; n < (rx_bytes << 3); n++) { /* 8 bits each */
++ s3c2410_gpio_setpin(pdata->pin_clk, 0);
++ shifter <<= 1;
++ if (s3c2410_gpio_getpin(pdata->pin_miso))
++ shifter |= 1;
++ if ((n & 7) == 7)
++ rx[n >> 3] = shifter;
++ s3c2410_gpio_setpin(pdata->pin_clk, 1);
++ }
++ s3c2410_gpio_setpin(pdata->pin_chip_select, 1);
++ s3c2410_gpio_setpin(other_cs, 1);
++}
++
++
++static int gta02_lis302dl_bitbang_read_reg(struct lis302dl_info *lis, u8 reg)
++{
++ u8 data = 0xc0 | reg; /* read, autoincrement */
++ unsigned long flags;
++
++ local_irq_save(flags);
++
++ __gta02_lis302dl_bitbang(lis, &data, 1, &data, 1);
++
++ local_irq_restore(flags);
++
++ return data;
++}
++
++static void gta02_lis302dl_bitbang_write_reg(struct lis302dl_info *lis, u8 reg,
++ u8 val)
++{
++ u8 data[2] = { 0x00 | reg, val }; /* write, no autoincrement */
++ unsigned long flags;
++
++ local_irq_save(flags);
++
++ __gta02_lis302dl_bitbang(lis, &data[0], 2, NULL, 0);
++
++ local_irq_restore(flags);
++
++}
++
++
++void gta02_lis302dl_suspend_io(struct lis302dl_info *lis, int resume)
++{
++ struct lis302dl_platform_data *pdata = lis->pdata;
++
++ if (!resume) {
++ /*
++ * we don't want to power them with a high level
++ * because GSENSOR_3V3 is not up during suspend
++ */
++ s3c2410_gpio_setpin(pdata->pin_chip_select, 0);
++ s3c2410_gpio_setpin(pdata->pin_clk, 0);
++ s3c2410_gpio_setpin(pdata->pin_mosi, 0);
++ /* misnomer: it is a pullDOWN in 2442 */
++ s3c2410_gpio_pullup(pdata->pin_miso, 1);
++ return;
++ }
++
++ /* back to normal */
++ s3c2410_gpio_setpin(pdata->pin_chip_select, 1);
++ s3c2410_gpio_setpin(pdata->pin_clk, 1);
++ /* misnomer: it is a pullDOWN in 2442 */
++ s3c2410_gpio_pullup(pdata->pin_miso, 0);
++
++ s3c2410_gpio_cfgpin(pdata->pin_chip_select, S3C2410_GPIO_OUTPUT);
++ s3c2410_gpio_cfgpin(pdata->pin_clk, S3C2410_GPIO_OUTPUT);
++ s3c2410_gpio_cfgpin(pdata->pin_mosi, S3C2410_GPIO_OUTPUT);
++ s3c2410_gpio_cfgpin(pdata->pin_miso, S3C2410_GPIO_INPUT);
++
++}
++
++
++
++struct lis302dl_platform_data lis302_pdata_top = {
++ .name = "lis302-1 (top)",
++ .pin_chip_select= S3C2410_GPD(12),
++ .pin_clk = S3C2410_GPG(7),
++ .pin_mosi = S3C2410_GPG(6),
++ .pin_miso = S3C2410_GPG(5),
++ .interrupt = GTA02_IRQ_GSENSOR_1,
++ .open_drain = 1, /* altered at runtime by PCB rev */
++ .lis302dl_bitbang = __gta02_lis302dl_bitbang,
++ .lis302dl_bitbang_reg_read = gta02_lis302dl_bitbang_read_reg,
++ .lis302dl_bitbang_reg_write = gta02_lis302dl_bitbang_write_reg,
++ .lis302dl_suspend_io = gta02_lis302dl_suspend_io,
++};
++
++struct lis302dl_platform_data lis302_pdata_bottom = {
++ .name = "lis302-2 (bottom)",
++ .pin_chip_select= S3C2410_GPD(13),
++ .pin_clk = S3C2410_GPG(7),
++ .pin_mosi = S3C2410_GPG(6),
++ .pin_miso = S3C2410_GPG(5),
++ .interrupt = GTA02_IRQ_GSENSOR_2,
++ .open_drain = 1, /* altered at runtime by PCB rev */
++ .lis302dl_bitbang = __gta02_lis302dl_bitbang,
++ .lis302dl_bitbang_reg_read = gta02_lis302dl_bitbang_read_reg,
++ .lis302dl_bitbang_reg_write = gta02_lis302dl_bitbang_write_reg,
++ .lis302dl_suspend_io = gta02_lis302dl_suspend_io,
++};
++
++
++static struct platform_device s3c_device_spi_acc1 = {
++ .name = "lis302dl",
++ .id = 1,
++ .dev = {
++ .platform_data = &lis302_pdata_top,
++ },
++};
++
++static struct platform_device s3c_device_spi_acc2 = {
++ .name = "lis302dl",
++ .id = 2,
++ .dev = {
++ .platform_data = &lis302_pdata_bottom,
++ },
++};
++
+ /* JBT6k74 display controller */
+ static void gta02_jbt6k74_probe_completed(struct device *dev)
+ {
+@@ -498,6 +736,11 @@ static struct regulator_consumer_supply hcldo_consumers[] = {
},
};
@@ -387,7 +604,7 @@ index 450f1f2..b4b60aa 100644
struct pcf50633_platform_data gta02_pcf_pdata = {
.resumers = {
[0] = PCF50633_INT1_USBINS |
-@@ -534,7 +580,7 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
+@@ -534,7 +777,7 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
.min_uV = 1300000,
.max_uV = 1600000,
.valid_modes_mask = REGULATOR_MODE_NORMAL,
@@ -396,7 +613,7 @@ index 450f1f2..b4b60aa 100644
.apply_uV = 1,
},
},
-@@ -626,6 +672,7 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
+@@ -626,6 +869,7 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
},
.probe_done = gta02_pmu_attach_child_devices,
.mbc_event_callback = gta02_pmu_event_callback,
@@ -404,7 +621,7 @@ index 450f1f2..b4b60aa 100644
};
-@@ -728,11 +775,31 @@ static struct s3c2410_hcd_info gta02_usb_info __initdata = {
+@@ -728,11 +972,31 @@ static struct s3c2410_hcd_info gta02_usb_info __initdata = {
},
};
@@ -438,15 +655,17 @@ index 450f1f2..b4b60aa 100644
};
/* Buttons */
-@@ -1073,6 +1140,7 @@ static struct platform_device *gta02_devices[] __initdata = {
+@@ -1073,6 +1337,9 @@ static struct platform_device *gta02_devices[] __initdata = {
static struct platform_device *gta02_devices_pmu_children[] = {
&gta02_hdq_device,
&gta02_platform_bat,
+ &gta02_resume_reason_device,
++ &s3c_device_spi_acc1,
++ &s3c_device_spi_acc2,
};
-@@ -1102,11 +1170,6 @@ static void gta02_pmu_attach_child_devices(struct pcf50633 *pcf)
+@@ -1102,11 +1369,6 @@ static void gta02_pmu_attach_child_devices(struct pcf50633 *pcf)
regulator_has_full_constraints();
}
@@ -458,7 +677,7 @@ index 450f1f2..b4b60aa 100644
struct gta02_device_children {
const char *dev_name;
size_t num_children;
-@@ -1116,12 +1179,17 @@ struct gta02_device_children {
+@@ -1116,12 +1378,17 @@ struct gta02_device_children {
static struct platform_device* gta02_pcf50633_gpio_children[] = {
&gta02_gsm_supply_device,
@@ -476,7 +695,7 @@ index 450f1f2..b4b60aa 100644
static struct platform_device* gta02_hdq_children[] = {
&bq27000_battery_device,
};
-@@ -1130,7 +1198,7 @@ static struct platform_device* gta02_hdq_children[] = {
+@@ -1130,7 +1397,7 @@ static struct platform_device* gta02_hdq_children[] = {
static struct gta02_device_children gta02_device_children[] = {
{
.dev_name = "pcf50633-gpio.0",
@@ -485,7 +704,7 @@ index 450f1f2..b4b60aa 100644
.children = gta02_pcf50633_gpio_children,
},
{
-@@ -1139,6 +1207,11 @@ static struct gta02_device_children gta02_device_children[] = {
+@@ -1139,6 +1406,11 @@ static struct gta02_device_children gta02_device_children[] = {
.children = gta02_gsm_supply_children,
},
{
@@ -497,6 +716,17 @@ index 450f1f2..b4b60aa 100644
.dev_name = "spi2.0",
.probed_callback = gta02_jbt6k74_probe_completed,
},
+@@ -1228,6 +1500,10 @@ static void __init gta02_machine_init(void)
+
+ s3c_pm_init();
+
++ /* we need push-pull interrupt from motion sensors */
++ lis302_pdata_top.open_drain = 0;
++ lis302_pdata_bottom.open_drain = 0;
++
+ #ifdef CONFIG_CHARGER_PCF50633
+ INIT_DELAYED_WORK(&gta02_charger_work, gta02_charger_worker);
+ #endif
diff --git a/arch/arm/plat-samsung/include/plat/ts.h b/arch/arm/plat-samsung/include/plat/ts.h
index 26fdb22..f475349 100644
--- a/arch/arm/plat-samsung/include/plat/ts.h
@@ -543,6 +773,951 @@ index 386d96e..90178d0 100644
ret = htcCallbacks.deviceInsertedHandler(hif);
if (ret == A_OK)
return 0;
+diff --git a/drivers/gpio/pcf50633-gpio.c b/drivers/gpio/pcf50633-gpio.c
+index eb044e8..9dd3735 100644
+--- a/drivers/gpio/pcf50633-gpio.c
++++ b/drivers/gpio/pcf50633-gpio.c
+@@ -206,7 +206,7 @@ static struct platform_driver pcf50633_gpio_driver = {
+ .probe = pcf50633_gpio_probe,
+ .remove = __devexit_p(pcf50633_gpio_remove),
+ .driver = {
+- .name = "pcf50633-gpio",
++ .name = "pcf50633-gpio.0",
+ .owner = THIS_MODULE,
+ },
+ };
+diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
+index e8c0b55..cd31e49 100644
+--- a/drivers/input/misc/Kconfig
++++ b/drivers/input/misc/Kconfig
+@@ -455,4 +455,13 @@ config INPUT_ADXL34X_SPI
+ To compile this driver as a module, choose M here: the
+ module will be called adxl34x-spi.
+
++config INPUT_LIS302DL
++ tristate "STmicro LIS302DL 3-axis accelerometer"
++ depends on SPI_MASTER
++ help
++ SPI driver for the STmicro LIS302DL 3-axis accelerometer.
++
++ The userspece interface is a 3-axis (X/Y/Z) relative movement
++ Linux input device, reporting REL_[XYZ] events.
++
+ endif
+diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
+index 4d5cea7..63b49bc 100644
+--- a/drivers/input/misc/Makefile
++++ b/drivers/input/misc/Makefile
+@@ -43,4 +43,5 @@ obj-$(CONFIG_INPUT_WINBOND_CIR) += winbond-cir.o
+ obj-$(CONFIG_INPUT_WISTRON_BTNS) += wistron_btns.o
+ obj-$(CONFIG_INPUT_WM831X_ON) += wm831x-on.o
+ obj-$(CONFIG_INPUT_YEALINK) += yealink.o
++obj-$(CONFIG_INPUT_LIS302DL) += lis302dl.o
+
+diff --git a/drivers/input/misc/lis302dl.c b/drivers/input/misc/lis302dl.c
+new file mode 100644
+index 0000000..1ba7a8f
+--- /dev/null
++++ b/drivers/input/misc/lis302dl.c
+@@ -0,0 +1,898 @@
++/* Linux kernel driver for the ST LIS302D 3-axis accelerometer
++ *
++ * Copyright (C) 2007-2008 by Openmoko, Inc.
++ * Author: Harald Welte <laforge@openmoko.org>
++ * converted to private bitbang by:
++ * Andy Green <andy@openmoko.com>
++ * ability to set acceleration threshold added by:
++ * Simon Kagstrom <simon.kagstrom@gmail.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 as
++ * published by the Free Software Foundation; either version 2 of
++ * the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ *
++ * TODO
++ * * statistics for overflow events
++ * * configuration interface (sysfs) for
++ * * enable/disable x/y/z axis data ready
++ * * enable/disable resume from freee fall / click
++ * * free fall / click parameters
++ * * high pass filter parameters
++ */
++#include <linux/kernel.h>
++#include <linux/types.h>
++#include <linux/module.h>
++#include <linux/device.h>
++#include <linux/platform_device.h>
++#include <linux/delay.h>
++#include <linux/irq.h>
++#include <linux/interrupt.h>
++#include <linux/sysfs.h>
++
++#include <linux/lis302dl.h>
++
++/* Utility functions */
++static u8 __reg_read(struct lis302dl_info *lis, u8 reg)
++{
++ return (lis->pdata->lis302dl_bitbang_reg_read)(lis, reg);
++}
++
++static void __reg_write(struct lis302dl_info *lis, u8 reg, u8 val)
++{
++ (lis->pdata->lis302dl_bitbang_reg_write)(lis, reg, val);
++}
++
++static void __reg_set_bit_mask(struct lis302dl_info *lis, u8 reg, u8 mask,
++ u8 val)
++{
++ u_int8_t tmp;
++
++ val &= mask;
++
++ tmp = __reg_read(lis, reg);
++ tmp &= ~mask;
++ tmp |= val;
++ __reg_write(lis, reg, tmp);
++}
++
++static int __ms_to_duration(struct lis302dl_info *lis, int ms)
++{
++ /* If we have 400 ms sampling rate, the stepping is 2.5 ms,
++ * on 100 ms the stepping is 10ms */
++ if (lis->flags & LIS302DL_F_DR)
++ return min((ms * 10) / 25, 637);
++
++ return min(ms / 10, 2550);
++}
++
++static int __duration_to_ms(struct lis302dl_info *lis, int duration)
++{
++ if (lis->flags & LIS302DL_F_DR)
++ return (duration * 25) / 10;
++
++ return duration * 10;
++}
++
++static u8 __mg_to_threshold(struct lis302dl_info *lis, int mg)
++{
++ /* If FS is set each bit is 71mg, otherwise 18mg. The THS register
++ * has 7 bits for the threshold value */
++ if (lis->flags & LIS302DL_F_FS)
++ return min(mg / 71, 127);
++
++ return min(mg / 18, 127);
++}
++
++static int __threshold_to_mg(struct lis302dl_info *lis, u8 threshold)
++{
++ if (lis->flags & LIS302DL_F_FS)
++ return threshold * 71;
++
++ return threshold * 18;
++}
++
++/* interrupt handling related */
++
++enum lis302dl_intmode {
++ LIS302DL_INTMODE_GND = 0x00,
++ LIS302DL_INTMODE_FF_WU_1 = 0x01,
++ LIS302DL_INTMODE_FF_WU_2 = 0x02,
++ LIS302DL_INTMODE_FF_WU_12 = 0x03,
++ LIS302DL_INTMODE_DATA_READY = 0x04,
++ LIS302DL_INTMODE_CLICK = 0x07,
++};
++
++static void __lis302dl_int_mode(struct device *dev, int int_pin,
++ enum lis302dl_intmode mode)
++{
++ struct lis302dl_info *lis = dev_get_drvdata(dev);
++
++ switch (int_pin) {
++ case 1:
++ __reg_set_bit_mask(lis, LIS302DL_REG_CTRL3, 0x07, mode);
++ break;
++ case 2:
++ __reg_set_bit_mask(lis, LIS302DL_REG_CTRL3, 0x38, mode << 3);
++ break;
++ default:
++ BUG();
++ }
++}
++
++static void __enable_wakeup(struct lis302dl_info *lis)
++{
++ __reg_write(lis, LIS302DL_REG_CTRL1, 0);
++
++ /* First zero to get to a known state */
++ __reg_write(lis, LIS302DL_REG_FF_WU_CFG_1, LIS302DL_FFWUCFG_XHIE |
++ LIS302DL_FFWUCFG_YHIE | LIS302DL_FFWUCFG_ZHIE |
++ LIS302DL_FFWUCFG_LIR);
++ __reg_write(lis, LIS302DL_REG_FF_WU_THS_1,
++ __mg_to_threshold(lis, lis->wakeup.threshold));
++ __reg_write(lis, LIS302DL_REG_FF_WU_DURATION_1,
++ __ms_to_duration(lis, lis->wakeup.duration));
++
++ /* Route the interrupt for wakeup */
++ __lis302dl_int_mode(lis->dev, 1,
++ LIS302DL_INTMODE_FF_WU_1);
++
++ __reg_read(lis, LIS302DL_REG_HP_FILTER_RESET);
++ __reg_read(lis, LIS302DL_REG_OUT_X);
++ __reg_read(lis, LIS302DL_REG_OUT_Y);
++ __reg_read(lis, LIS302DL_REG_OUT_Z);
++ __reg_read(lis, LIS302DL_REG_STATUS);
++ __reg_read(lis, LIS302DL_REG_FF_WU_SRC_1);
++ __reg_read(lis, LIS302DL_REG_FF_WU_SRC_2);
++ __reg_write(lis, LIS302DL_REG_CTRL1, LIS302DL_CTRL1_PD | 7);
++}
++
++static void __enable_data_collection(struct lis302dl_info *lis)
++{
++ u_int8_t ctrl1 = LIS302DL_CTRL1_PD | LIS302DL_CTRL1_Xen |
++ LIS302DL_CTRL1_Yen | LIS302DL_CTRL1_Zen;
++
++ /* make sure we're powered up and generate data ready */
++ __reg_set_bit_mask(lis, LIS302DL_REG_CTRL1, ctrl1, ctrl1);
++
++ /* If the threshold is zero, let the device generated an interrupt
++ * on each datum */
++ if (lis->threshold == 0) {
++ __reg_write(lis, LIS302DL_REG_CTRL2, 0);
++ __lis302dl_int_mode(lis->dev, 1, LIS302DL_INTMODE_DATA_READY);
++ __lis302dl_int_mode(lis->dev, 2, LIS302DL_INTMODE_DATA_READY);
++ } else {
++ __reg_write(lis, LIS302DL_REG_CTRL2,
++ LIS302DL_CTRL2_HPFF1);
++ __reg_write(lis, LIS302DL_REG_FF_WU_THS_1,
++ __mg_to_threshold(lis, lis->threshold));
++ __reg_write(lis, LIS302DL_REG_FF_WU_DURATION_1,
++ __ms_to_duration(lis, lis->duration));
++
++ /* Clear the HP filter "starting point" */
++ __reg_read(lis, LIS302DL_REG_HP_FILTER_RESET);
++ __reg_write(lis, LIS302DL_REG_FF_WU_CFG_1,
++ LIS302DL_FFWUCFG_XHIE | LIS302DL_FFWUCFG_YHIE |
++ LIS302DL_FFWUCFG_ZHIE | LIS302DL_FFWUCFG_LIR);
++ __lis302dl_int_mode(lis->dev, 1, LIS302DL_INTMODE_FF_WU_12);
++ __lis302dl_int_mode(lis->dev, 2, LIS302DL_INTMODE_FF_WU_12);
++ }
++}
++
++#if 0
++static void _report_btn_single(struct input_dev *inp, int btn)
++{
++ input_report_key(inp, btn, 1);
++ input_sync(inp);
++ input_report_key(inp, btn, 0);
++}
++
++static void _report_btn_double(struct input_dev *inp, int btn)
++{
++ input_report_key(inp, btn, 1);
++ input_sync(inp);
++ input_report_key(inp, btn, 0);
++ input_sync(inp);
++ input_report_key(inp, btn, 1);
++ input_sync(inp);
++ input_report_key(inp, btn, 0);
++}
++#endif
++
++
++static void lis302dl_bitbang_read_sample(struct lis302dl_info *lis)
++{
++ u8 data = 0xc0 | LIS302DL_REG_STATUS; /* read, autoincrement */
++ u8 read[(LIS302DL_REG_OUT_Z - LIS302DL_REG_STATUS) + 1];
++ unsigned long flags;
++ int mg_per_sample = __threshold_to_mg(lis, 1);
++
++ /* grab the set of register containing status and XYZ data */
++
++ local_irq_save(flags);
++ (lis->pdata->lis302dl_bitbang)(lis, &data, 1, &read[0], sizeof(read));
++ local_irq_restore(flags);
++
++ /*
++ * at the minute the test below fails 50% of the time due to
++ * a problem with level interrupts causing ISRs to get called twice.
++ * This is a workaround for that, but actually this test is still
++ * valid and the information can be used for overrrun stats.
++ */
++
++ /* has any kind of overrun been observed by the lis302dl? */
++ if (read[0] & (LIS302DL_STATUS_XOR |
++ LIS302DL_STATUS_YOR |
++ LIS302DL_STATUS_ZOR))
++ lis->overruns++;
++
++ /* we have a valid sample set? */
++ if (read[0] & LIS302DL_STATUS_XYZDA) {
++ input_report_abs(lis->input_dev, ABS_X, mg_per_sample *
++ (s8)read[LIS302DL_REG_OUT_X - LIS302DL_REG_STATUS]);
++ input_report_abs(lis->input_dev, ABS_Y, mg_per_sample *
++ (s8)read[LIS302DL_REG_OUT_Y - LIS302DL_REG_STATUS]);
++ input_report_abs(lis->input_dev, ABS_Z, mg_per_sample *
++ (s8)read[LIS302DL_REG_OUT_Z - LIS302DL_REG_STATUS]);
++
++ input_sync(lis->input_dev);
++ }
++
++ if (lis->threshold)
++ /* acknowledge the wakeup source */
++ __reg_read(lis, LIS302DL_REG_FF_WU_SRC_1);
++}
++
++static irqreturn_t lis302dl_interrupt(int irq, void *_lis)
++{
++ struct lis302dl_info *lis = _lis;
++
++ lis302dl_bitbang_read_sample(lis);
++ return IRQ_HANDLED;
++}
++
++/* sysfs */
++
++static ssize_t show_overruns(struct device *dev, struct device_attribute *attr,
++ char *buf)
++{
++ struct lis302dl_info *lis = dev_get_drvdata(dev);
++
++ return sprintf(buf, "%u\n", lis->overruns);
++}
++
++static DEVICE_ATTR(overruns, S_IRUGO, show_overruns, NULL);
++
++static ssize_t show_rate(struct device *dev, struct device_attribute *attr,
++ char *buf)
++{
++ struct lis302dl_info *lis = dev_get_drvdata(dev);
++ u8 ctrl1;
++ unsigned long flags;
++
++ local_irq_save(flags);
++ ctrl1 = __reg_read(lis, LIS302DL_REG_CTRL1);
++ local_irq_restore(flags);
++
++ return sprintf(buf, "%d\n", ctrl1 & LIS302DL_CTRL1_DR ? 400 : 100);
++}
++
++static ssize_t set_rate(struct device *dev, struct device_attribute *attr,
++ const char *buf, size_t count)
++{
++ struct lis302dl_info *lis = dev_get_drvdata(dev);
++ unsigned long flags;
++
++ local_irq_save(flags);
++
++ if (!strcmp(buf, "400\n")) {
++ __reg_set_bit_mask(lis, LIS302DL_REG_CTRL1, LIS302DL_CTRL1_DR,
++ LIS302DL_CTRL1_DR);
++ lis->flags |= LIS302DL_F_DR;
++ } else {
++ __reg_set_bit_mask(lis, LIS302DL_REG_CTRL1, LIS302DL_CTRL1_DR,
++ 0);
++ lis->flags &= ~LIS302DL_F_DR;
++ }
++ local_irq_restore(flags);
++
++ return count;
++}
++
++static DEVICE_ATTR(sample_rate, S_IRUGO | S_IWUSR, show_rate, set_rate);
++
++static ssize_t show_scale(struct device *dev, struct device_attribute *attr,
++ char *buf)
++{
++ struct lis302dl_info *lis = dev_get_drvdata(dev);
++ u_int8_t ctrl1;
++ unsigned long flags;
++
++ local_irq_save(flags);
++ ctrl1 = __reg_read(lis, LIS302DL_REG_CTRL1);
++ local_irq_restore(flags);
++
++ return sprintf(buf, "%s\n", ctrl1 & LIS302DL_CTRL1_FS ? "9.2" : "2.3");
++}
++
++static ssize_t set_scale(struct device *dev, struct device_attribute *attr,
++ const char *buf, size_t count)
++{
++ struct lis302dl_info *lis = dev_get_drvdata(dev);
++ unsigned long flags;
++
++ local_irq_save(flags);
++
++ if (!strcmp(buf, "9.2\n")) {
++ __reg_set_bit_mask(lis, LIS302DL_REG_CTRL1, LIS302DL_CTRL1_FS,
++ LIS302DL_CTRL1_FS);
++ lis->flags |= LIS302DL_F_FS;
++ } else {
++ __reg_set_bit_mask(lis, LIS302DL_REG_CTRL1, LIS302DL_CTRL1_FS,
++ 0);
++ lis->flags &= ~LIS302DL_F_FS;
++ }
++
++ if (lis->flags & LIS302DL_F_INPUT_OPEN)
++ __enable_data_collection(lis);
++
++ local_irq_restore(flags);
++
++ return count;
++}
++
++static DEVICE_ATTR(full_scale, S_IRUGO | S_IWUSR, show_scale, set_scale);
++
++static ssize_t show_threshold(struct device *dev, struct device_attribute *attr,
++ char *buf)
++{
++ struct lis302dl_info *lis = dev_get_drvdata(dev);
++
++ /* Display the device view of the threshold setting */
++ return sprintf(buf, "%d\n", __threshold_to_mg(lis,
++ __mg_to_threshold(lis, lis->threshold)));
++}
++
++static ssize_t set_threshold(struct device *dev, struct device_attribute *attr,
++ const char *buf, size_t count)
++{
++ struct lis302dl_info *lis = dev_get_drvdata(dev);
++ unsigned int val;
++
++ if (sscanf(buf, "%u\n", &val) != 1)
++ return -EINVAL;
++ /* 8g is the maximum if FS is 1 */
++ if (val > 8000)
++ return -ERANGE;
++
++ /* Set the threshold and write it out if the device is used */
++ lis->threshold = val;
++
++ if (lis->flags & LIS302DL_F_INPUT_OPEN) {
++ unsigned long flags;
++
++ local_irq_save(flags);
++ __enable_data_collection(lis);
++ local_irq_restore(flags);
++ }
++
++ return count;
++}
++
++static DEVICE_ATTR(threshold, S_IRUGO | S_IWUSR, show_threshold, set_threshold);
++
++static ssize_t show_duration(struct device *dev, struct device_attribute *attr,
++ char *buf)
++{
++ struct lis302dl_info *lis = dev_get_drvdata(dev);
++
++ return sprintf(buf, "%d\n", __duration_to_ms(lis,
++ __ms_to_duration(lis, lis->duration)));
++}
++
++static ssize_t set_duration(struct device *dev, struct device_attribute *attr,
++ const char *buf, size_t count)
++{
++ struct lis302dl_info *lis = dev_get_drvdata(dev);
++ unsigned int val;
++
++ if (sscanf(buf, "%u\n", &val) != 1)
++ return -EINVAL;
++ if (val > 2550)
++ return -ERANGE;
++
++ lis->duration = val;
++ if (lis->flags & LIS302DL_F_INPUT_OPEN)
++ __reg_write(lis, LIS302DL_REG_FF_WU_DURATION_1,
++ __ms_to_duration(lis, lis->duration));
++
++ return count;
++}
++
++static DEVICE_ATTR(duration, S_IRUGO | S_IWUSR, show_duration, set_duration);
++
++static ssize_t lis302dl_dump(struct device *dev, struct device_attribute *attr,
++ char *buf)
++{
++ struct lis302dl_info *lis = dev_get_drvdata(dev);
++ int n = 0;
++ u8 reg[0x40];
++ char *end = buf;
++ unsigned long flags;
++
++ local_irq_save(flags);
++
++ for (n = 0; n < sizeof(reg); n++)
++ reg[n] = __reg_read(lis, n);
++
++ local_irq_restore(flags);
++
++ for (n = 0; n < sizeof(reg); n += 16) {
++ hex_dump_to_buffer(reg + n, 16, 16, 1, end, 128, 0);
++ end += strlen(end);
++ *end++ = '\n';
++ *end++ = '\0';
++ }
++
++ return end - buf;
++}
++static DEVICE_ATTR(dump, S_IRUGO, lis302dl_dump, NULL);
++
++/* Configure freefall/wakeup interrupts */
++static ssize_t set_wakeup_threshold(struct device *dev,
++ struct device_attribute *attr, const char *buf, size_t count)
++{
++ struct lis302dl_info *lis = dev_get_drvdata(dev);
++ unsigned int threshold;
++
++ if (sscanf(buf, "%u\n", &threshold) != 1)
++ return -EINVAL;
++
++ if (threshold > 8000)
++ return -ERANGE;
++
++ /* Zero turns the feature off */
++ if (threshold == 0) {
++ if (lis->flags & LIS302DL_F_IRQ_WAKE) {
++ disable_irq_wake(lis->pdata->interrupt);
++ lis->flags &= ~LIS302DL_F_IRQ_WAKE;
++ }
++
++ return count;
++ }
++
++ lis->wakeup.threshold = threshold;
++
++ if (!(lis->flags & LIS302DL_F_IRQ_WAKE)) {
++ enable_irq_wake(lis->pdata->interrupt);
++ lis->flags |= LIS302DL_F_IRQ_WAKE;
++ }
++
++ return count;
++}
++
++static ssize_t show_wakeup_threshold(struct device *dev,
++ struct device_attribute *attr, char *buf)
++{
++ struct lis302dl_info *lis = dev_get_drvdata(dev);
++
++ /* All events off? */
++ if (lis->wakeup.threshold == 0)
++ return sprintf(buf, "off\n");
++
++ return sprintf(buf, "%u\n", lis->wakeup.threshold);
++}
++
++static DEVICE_ATTR(wakeup_threshold, S_IRUGO | S_IWUSR, show_wakeup_threshold,
++ set_wakeup_threshold);
++
++static ssize_t set_wakeup_duration(struct device *dev,
++ struct device_attribute *attr, const char *buf, size_t count)
++{
++ struct lis302dl_info *lis = dev_get_drvdata(dev);
++ unsigned int duration;
++
++ if (sscanf(buf, "%u\n", &duration) != 1)
++ return -EINVAL;
++
++ if (duration > 2550)
++ return -ERANGE;
++
++ lis->wakeup.duration = duration;
++
++ return count;
++}
++
++static ssize_t show_wakeup_duration(struct device *dev,
++ struct device_attribute *attr, char *buf)
++{
++ struct lis302dl_info *lis = dev_get_drvdata(dev);
++
++ return sprintf(buf, "%u\n", lis->wakeup.duration);
++}
++
++static DEVICE_ATTR(wakeup_duration, S_IRUGO | S_IWUSR, show_wakeup_duration,
++ set_wakeup_duration);
++
++static struct attribute *lis302dl_sysfs_entries[] = {
++ &dev_attr_sample_rate.attr,
++ &dev_attr_full_scale.attr,
++ &dev_attr_threshold.attr,
++ &dev_attr_duration.attr,
++ &dev_attr_dump.attr,
++ &dev_attr_wakeup_threshold.attr,
++ &dev_attr_wakeup_duration.attr,
++ &dev_attr_overruns.attr,
++ NULL
++};
++
++static struct attribute_group lis302dl_attr_group = {
++ .name = NULL,
++ .attrs = lis302dl_sysfs_entries,
++};
++
++/* input device handling and driver core interaction */
++
++static int lis302dl_input_open(struct input_dev *inp)
++{
++ struct lis302dl_info *lis = input_get_drvdata(inp);
++ unsigned long flags;
++
++ local_irq_save(flags);
++
++ __enable_data_collection(lis);
++ lis->flags |= LIS302DL_F_INPUT_OPEN;
++
++ local_irq_restore(flags);
++
++ return 0;
++}
++
++static void lis302dl_input_close(struct input_dev *inp)
++{
++ struct lis302dl_info *lis = input_get_drvdata(inp);
++ u_int8_t ctrl1 = LIS302DL_CTRL1_Xen | LIS302DL_CTRL1_Yen |
++ LIS302DL_CTRL1_Zen;
++ unsigned long flags;
++
++ local_irq_save(flags);
++
++ /* since the input core already serializes access and makes sure we
++ * only see close() for the close of the last user, we can safely
++ * disable the data ready events */
++ __reg_set_bit_mask(lis, LIS302DL_REG_CTRL1, ctrl1, 0x00);
++ lis->flags &= ~LIS302DL_F_INPUT_OPEN;
++
++ /* however, don't power down the whole device if still needed */
++ if (!(lis->flags & LIS302DL_F_WUP_FF ||
++ lis->flags & LIS302DL_F_WUP_CLICK)) {
++ __reg_set_bit_mask(lis, LIS302DL_REG_CTRL1, LIS302DL_CTRL1_PD,
++ 0x00);
++ }
++ local_irq_restore(flags);
++}
++
++/* get the device to reload its coefficients from EEPROM and wait for it
++ * to complete
++ */
++
++static int __lis302dl_reset_device(struct lis302dl_info *lis)
++{
++ int timeout = 10;
++
++ __reg_write(lis, LIS302DL_REG_CTRL2,
++ LIS302DL_CTRL2_BOOT | LIS302DL_CTRL2_FDS);
++
++ while ((__reg_read(lis, LIS302DL_REG_CTRL2)
++ & LIS302DL_CTRL2_BOOT) && (timeout--))
++ mdelay(1);
++
++ return !!(timeout < 0);
++}
++
++static int __devinit lis302dl_probe(struct platform_device *pdev)
++{
++ int rc;
++ struct lis302dl_info *lis;
++ u_int8_t wai;
++ unsigned long flags;
++ struct lis302dl_platform_data *pdata = pdev->dev.platform_data;
++
++ lis = kzalloc(sizeof(*lis), GFP_KERNEL);
++ if (!lis)
++ return -ENOMEM;
++
++ lis->dev = &pdev->dev;
++
++ dev_set_drvdata(lis->dev, lis);
++
++ lis->pdata = pdata;
++
++ rc = sysfs_create_group(&lis->dev->kobj, &lis302dl_attr_group);
++ if (rc) {
++ dev_err(lis->dev, "error creating sysfs group\n");
++ goto bail_free_lis;
++ }
++
++ /* initialize input layer details */
++ lis->input_dev = input_allocate_device();
++ if (!lis->input_dev) {
++ dev_err(lis->dev, "Unable to allocate input device\n");
++ goto bail_sysfs;
++ }
++
++ input_set_drvdata(lis->input_dev, lis);
++ lis->input_dev->name = pdata->name;
++ /* SPI Bus not defined as a valid bus for input subsystem*/
++ lis->input_dev->id.bustype = BUS_I2C; /* lie about it */
++ lis->input_dev->open = lis302dl_input_open;
++ lis->input_dev->close = lis302dl_input_close;
++
++ rc = input_register_device(lis->input_dev);
++ if (rc) {
++ dev_err(lis->dev, "error %d registering input device\n", rc);
++ goto bail_inp_dev;
++ }
++
++ local_irq_save(flags);
++ /* Configure our IO */
++ (lis->pdata->lis302dl_suspend_io)(lis, 1);
++
++ wai = __reg_read(lis, LIS302DL_REG_WHO_AM_I);
++ if (wai != LIS302DL_WHO_AM_I_MAGIC) {
++ dev_err(lis->dev, "unknown who_am_i signature 0x%02x\n", wai);
++ dev_set_drvdata(lis->dev, NULL);
++ rc = -ENODEV;
++ local_irq_restore(flags);
++ goto bail_inp_reg;
++ }
++
++ set_bit(EV_ABS, lis->input_dev->evbit);
++ input_set_abs_params(lis->input_dev, ABS_X, 0, 0, 0, 0);
++ input_set_abs_params(lis->input_dev, ABS_Y, 0, 0, 0, 0);
++ input_set_abs_params(lis->input_dev, ABS_Z, 0, 0, 0, 0);
++
++
++ lis->threshold = 0;
++ lis->duration = 0;
++ memset(&lis->wakeup, 0, sizeof(lis->wakeup));
++
++ if (__lis302dl_reset_device(lis))
++ dev_err(lis->dev, "device BOOT reload failed\n");
++
++ /* force us powered */
++ __reg_write(lis, LIS302DL_REG_CTRL1, LIS302DL_CTRL1_PD |
++ LIS302DL_CTRL1_Xen |
++ LIS302DL_CTRL1_Yen |
++ LIS302DL_CTRL1_Zen);
++ mdelay(1);
++
++ __reg_write(lis, LIS302DL_REG_CTRL2, 0);
++ __reg_write(lis, LIS302DL_REG_CTRL3,
++ LIS302DL_CTRL3_PP_OD | LIS302DL_CTRL3_IHL);
++ __reg_write(lis, LIS302DL_REG_FF_WU_THS_1, 0x0);
++ __reg_write(lis, LIS302DL_REG_FF_WU_DURATION_1, 0x00);
++ __reg_write(lis, LIS302DL_REG_FF_WU_CFG_1, 0x0);
++
++ /* start off in powered down mode; we power up when someone opens us */
++ __reg_write(lis, LIS302DL_REG_CTRL1, LIS302DL_CTRL1_Xen |
++ LIS302DL_CTRL1_Yen | LIS302DL_CTRL1_Zen);
++
++ if (pdata->open_drain)
++ /* switch interrupt to open collector, active-low */
++ __reg_write(lis, LIS302DL_REG_CTRL3,
++ LIS302DL_CTRL3_PP_OD | LIS302DL_CTRL3_IHL);
++ else
++ /* push-pull, active-low */
++ __reg_write(lis, LIS302DL_REG_CTRL3, LIS302DL_CTRL3_IHL);
++
++ __lis302dl_int_mode(lis->dev, 1, LIS302DL_INTMODE_GND);
++ __lis302dl_int_mode(lis->dev, 2, LIS302DL_INTMODE_GND);
++
++ __reg_read(lis, LIS302DL_REG_STATUS);
++ __reg_read(lis, LIS302DL_REG_FF_WU_SRC_1);
++ __reg_read(lis, LIS302DL_REG_FF_WU_SRC_2);
++ __reg_read(lis, LIS302DL_REG_CLICK_SRC);
++ local_irq_restore(flags);
++
++ dev_info(lis->dev, "Found %s\n", pdata->name);
++
++ lis->pdata = pdata;
++
++ set_irq_handler(lis->pdata->interrupt, handle_level_irq);
++
++ rc = request_irq(lis->pdata->interrupt, lis302dl_interrupt,
++ IRQF_TRIGGER_LOW, "lis302dl", lis);
++
++ if (rc < 0) {
++ dev_err(lis->dev, "error requesting IRQ %d\n",
++ lis->pdata->interrupt);
++ goto bail_inp_reg;
++ }
++ return 0;
++
++bail_inp_reg:
++ input_unregister_device(lis->input_dev);
++bail_inp_dev:
++ input_free_device(lis->input_dev);
++bail_sysfs:
++ sysfs_remove_group(&lis->dev->kobj, &lis302dl_attr_group);
++bail_free_lis:
++ kfree(lis);
++ return rc;
++}
++
++static int __devexit lis302dl_remove(struct platform_device *pdev)
++{
++ struct lis302dl_info *lis = dev_get_drvdata(&pdev->dev);
++ unsigned long flags;
++
++ /* Disable interrupts */
++ if (lis->flags & LIS302DL_F_IRQ_WAKE)
++ disable_irq_wake(lis->pdata->interrupt);
++ free_irq(lis->pdata->interrupt, lis);
++
++ /* Reset and power down the device */
++ local_irq_save(flags);
++ __reg_write(lis, LIS302DL_REG_CTRL3, 0x00);
++ __reg_write(lis, LIS302DL_REG_CTRL2, 0x00);
++ __reg_write(lis, LIS302DL_REG_CTRL1, 0x00);
++ local_irq_restore(flags);
++
++ /* Cleanup resources */
++ sysfs_remove_group(&pdev->dev.kobj, &lis302dl_attr_group);
++ input_unregister_device(lis->input_dev);
++ if (lis->input_dev)
++ input_free_device(lis->input_dev);
++ dev_set_drvdata(lis->dev, NULL);
++ kfree(lis);
++
++ return 0;
++}
++
++#ifdef CONFIG_PM
++
++static u8 regs_to_save[] = {
++ LIS302DL_REG_CTRL2,
++ LIS302DL_REG_CTRL3,
++ LIS302DL_REG_FF_WU_CFG_1,
++ LIS302DL_REG_FF_WU_THS_1,
++ LIS302DL_REG_FF_WU_DURATION_1,
++ LIS302DL_REG_FF_WU_CFG_2,
++ LIS302DL_REG_FF_WU_THS_2,
++ LIS302DL_REG_FF_WU_DURATION_2,
++ LIS302DL_REG_CLICK_CFG,
++ LIS302DL_REG_CLICK_THSY_X,
++ LIS302DL_REG_CLICK_THSZ,
++ LIS302DL_REG_CLICK_TIME_LIMIT,
++ LIS302DL_REG_CLICK_LATENCY,
++ LIS302DL_REG_CLICK_WINDOW,
++ LIS302DL_REG_CTRL1,
++};
++
++static int lis302dl_suspend(struct platform_device *pdev, pm_message_t state)
++{
++ struct lis302dl_info *lis = dev_get_drvdata(&pdev->dev);
++ unsigned long flags;
++ u_int8_t tmp;
++ int n;
++
++ /* determine if we want to wake up from the accel. */
++ if (lis->flags & LIS302DL_F_WUP_CLICK)
++ return 0;
++
++ disable_irq(lis->pdata->interrupt);
++ local_irq_save(flags);
++
++ /*
++ * When we share SPI over multiple sensors, there is a race here
++ * that one or more sensors will lose. In that case, the shared
++ * SPI bus GPIO will be in sleep mode and partially pulled down. So
++ * we explicitly put our IO into "wake" mode here before the final
++ * traffic to the sensor.
++ */
++ (lis->pdata->lis302dl_suspend_io)(lis, 1);
++
++ /* save registers */
++ for (n = 0; n < ARRAY_SIZE(regs_to_save); n++)
++ lis->regs[regs_to_save[n]] =
++ __reg_read(lis, regs_to_save[n]);
++
++ /* power down or enable wakeup */
++
++ if (lis->wakeup.threshold == 0) {
++ tmp = __reg_read(lis, LIS302DL_REG_CTRL1);
++ tmp &= ~LIS302DL_CTRL1_PD;
++ __reg_write(lis, LIS302DL_REG_CTRL1, tmp);
++ } else
++ __enable_wakeup(lis);
++
++ /* place our IO to the device in sleep-compatible states */
++ (lis->pdata->lis302dl_suspend_io)(lis, 0);
++
++ local_irq_restore(flags);
++
++ return 0;
++}
++
++static int lis302dl_resume(struct platform_device *pdev)
++{
++ struct lis302dl_info *lis = dev_get_drvdata(&pdev->dev);
++ unsigned long flags;
++ int n;
++
++ if (lis->flags & LIS302DL_F_WUP_CLICK)
++ return 0;
++
++ local_irq_save(flags);
++
++ /* get our IO to the device back in operational states */
++ (lis->pdata->lis302dl_suspend_io)(lis, 1);
++
++ /* resume from powerdown first! */
++ __reg_write(lis, LIS302DL_REG_CTRL1,
++ LIS302DL_CTRL1_PD |
++ LIS302DL_CTRL1_Xen |
++ LIS302DL_CTRL1_Yen |
++ LIS302DL_CTRL1_Zen);
++ mdelay(1);
++
++ if (__lis302dl_reset_device(lis))
++ dev_err(&pdev->dev, "device BOOT reload failed\n");
++
++ /* restore registers after resume */
++ for (n = 0; n < ARRAY_SIZE(regs_to_save); n++)
++ __reg_write(lis, regs_to_save[n], lis->regs[regs_to_save[n]]);
++
++ /* if someone had us open, reset the non-wake threshold stuff */
++ if (lis->flags & LIS302DL_F_INPUT_OPEN)
++ __enable_data_collection(lis);
++
++ local_irq_restore(flags);
++ enable_irq(lis->pdata->interrupt);
++
++ return 0;
++}
++#else
++#define lis302dl_suspend NULL
++#define lis302dl_resume NULL
++#endif
++
++static struct platform_driver lis302dl_driver = {
++ .driver = {
++ .name = "lis302dl",
++ .owner = THIS_MODULE,
++ },
++
++ .probe = lis302dl_probe,
++ .remove = __devexit_p(lis302dl_remove),
++ .suspend = lis302dl_suspend,
++ .resume = lis302dl_resume,
++};
++
++static int __devinit lis302dl_init(void)
++{
++ return platform_driver_register(&lis302dl_driver);
++}
++
++static void __exit lis302dl_exit(void)
++{
++ platform_driver_unregister(&lis302dl_driver);
++}
++
++MODULE_AUTHOR("Harald Welte <laforge@openmoko.org>");
++MODULE_LICENSE("GPL");
++
++module_init(lis302dl_init);
++module_exit(lis302dl_exit);
diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c
index 8feb7f3..21c113b 100644
--- a/drivers/input/touchscreen/s3c2410_ts.c
@@ -803,6 +1978,19 @@ index 8880263..a0556b8 100644
if (!glamo->base) {
dev_err(&pdev->dev, "Failed to ioremap() memory region\n");
goto err_release_mem_region;
+diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c
+index f9ad427..56dd025 100644
+--- a/drivers/mfd/pcf50633-core.c
++++ b/drivers/mfd/pcf50633-core.c
+@@ -376,7 +376,7 @@ static struct mfd_cell pcf50633_cells[] = {
+ PCF50633_CELL_RESOURCES("pcf50633-mbc", pcf50633_mbc_resources),
+ PCF50633_CELL_RESOURCES("pcf50633-adc", pcf50633_adc_resources),
+ PCF50633_CELL("pcf50633-backlight"),
+- PCF50633_CELL("pcf50633-gpio"),
++ PCF50633_CELL("pcf50633-gpio.0"),
+ PCF50633_CELL_ID("pcf50633-regltr", 0),
+ PCF50633_CELL_ID("pcf50633-regltr", 1),
+ PCF50633_CELL_ID("pcf50633-regltr", 2),
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 4d073f1..35c3563 100644
--- a/drivers/misc/Kconfig
@@ -978,6 +2166,173 @@ index 0000000..5bcc818
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Andy Green <andy@openmoko.com>");
+MODULE_DESCRIPTION("Neo1973 resume_reason");
+diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
+index cb5d2c0..9ca6a0e 100644
+--- a/drivers/mtd/nand/s3c2410.c
++++ b/drivers/mtd/nand/s3c2410.c
+@@ -55,7 +55,7 @@ static int hardware_ecc = 0;
+ #endif
+
+ #ifdef CONFIG_MTD_NAND_S3C2410_CLKSTOP
+-static int clock_stop = 1;
++static const int clock_stop = 1;
+ #else
+ static const int clock_stop = 0;
+ #endif
+@@ -96,6 +96,12 @@ enum s3c_cpu_type {
+ TYPE_S3C2440,
+ };
+
++enum s3c_nand_clk_state {
++ CLOCK_DISABLE = 0,
++ CLOCK_ENABLE,
++ CLOCK_SUSPEND,
++};
++
+ /* overview of the s3c2410 nand state */
+
+ /**
+@@ -111,6 +117,7 @@ enum s3c_cpu_type {
+ * @mtd_count: The number of MTDs created from this controller.
+ * @save_sel: The contents of @sel_reg to be saved over suspend.
+ * @clk_rate: The clock rate from @clk.
++ * @clk_state: The current clock state.
+ * @cpu_type: The exact type of this controller.
+ */
+ struct s3c2410_nand_info {
+@@ -129,6 +136,7 @@ struct s3c2410_nand_info {
+ int mtd_count;
+ unsigned long save_sel;
+ unsigned long clk_rate;
++ enum s3c_nand_clk_state clk_state;
+
+ enum s3c_cpu_type cpu_type;
+
+@@ -159,11 +167,33 @@ static struct s3c2410_platform_nand *to_nand_plat(struct platform_device *dev)
+ return dev->dev.platform_data;
+ }
+
+-static inline int allow_clk_stop(struct s3c2410_nand_info *info)
++static inline int allow_clk_suspend(struct s3c2410_nand_info *info)
+ {
+ return clock_stop;
+ }
+
++/**
++ * s3c2410_nand_clk_set_state - Enable, disable or suspend NAND clock.
++ * @info: The controller instance.
++ * @new_state: State to which clock should be set.
++ */
++static void s3c2410_nand_clk_set_state(struct s3c2410_nand_info *info,
++ enum s3c_nand_clk_state new_state)
++{
++ if (!allow_clk_suspend(info) && new_state == CLOCK_SUSPEND)
++ return;
++
++ if (info->clk_state == CLOCK_ENABLE) {
++ if (new_state != CLOCK_ENABLE)
++ clk_disable(info->clk);
++ } else {
++ if (new_state == CLOCK_ENABLE)
++ clk_enable(info->clk);
++ }
++
++ info->clk_state = new_state;
++}
++
+ /* timing calculations */
+
+ #define NS_IN_KHZ 1000000
+@@ -333,8 +363,8 @@ static void s3c2410_nand_select_chip(struct mtd_info *mtd, int chip)
+ nmtd = this->priv;
+ info = nmtd->info;
+
+- if (chip != -1 && allow_clk_stop(info))
+- clk_enable(info->clk);
++ if (chip != -1)
++ s3c2410_nand_clk_set_state(info, CLOCK_ENABLE);
+
+ cur = readl(info->sel_reg);
+
+@@ -356,8 +386,8 @@ static void s3c2410_nand_select_chip(struct mtd_info *mtd, int chip)
+
+ writel(cur, info->sel_reg);
+
+- if (chip == -1 && allow_clk_stop(info))
+- clk_disable(info->clk);
++ if (chip == -1)
++ s3c2410_nand_clk_set_state(info, CLOCK_SUSPEND);
+ }
+
+ /* s3c2410_nand_hwcontrol
+@@ -694,8 +724,7 @@ static int s3c24xx_nand_remove(struct platform_device *pdev)
+ /* free the common resources */
+
+ if (info->clk != NULL && !IS_ERR(info->clk)) {
+- if (!allow_clk_stop(info))
+- clk_disable(info->clk);
++ s3c2410_nand_clk_set_state(info, CLOCK_DISABLE);
+ clk_put(info->clk);
+ }
+
+@@ -773,6 +802,7 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info,
+ chip->priv = nmtd;
+ chip->options = set->options;
+ chip->controller = &info->controller;
++ chip->badblockbits = 8;
+
+ switch (info->cpu_type) {
+ case TYPE_S3C2410:
+@@ -947,7 +977,7 @@ static int s3c24xx_nand_probe(struct platform_device *pdev)
+ goto exit_error;
+ }
+
+- clk_enable(info->clk);
++ s3c2410_nand_clk_set_state(info, CLOCK_ENABLE);
+
+ /* allocate and map the resource */
+
+@@ -1026,9 +1056,9 @@ static int s3c24xx_nand_probe(struct platform_device *pdev)
+ goto exit_error;
+ }
+
+- if (allow_clk_stop(info)) {
++ if (allow_clk_suspend(info)) {
+ dev_info(&pdev->dev, "clock idle support enabled\n");
+- clk_disable(info->clk);
++ s3c2410_nand_clk_set_state(info, CLOCK_SUSPEND);
+ }
+
+ pr_debug("initialised ok\n");
+@@ -1059,8 +1089,7 @@ static int s3c24xx_nand_suspend(struct platform_device *dev, pm_message_t pm)
+
+ writel(info->save_sel | info->sel_bit, info->sel_reg);
+
+- if (!allow_clk_stop(info))
+- clk_disable(info->clk);
++ s3c2410_nand_clk_set_state(info, CLOCK_DISABLE);
+ }
+
+ return 0;
+@@ -1072,7 +1101,7 @@ static int s3c24xx_nand_resume(struct platform_device *dev)
+ unsigned long sel;
+
+ if (info) {
+- clk_enable(info->clk);
++ s3c2410_nand_clk_set_state(info, CLOCK_ENABLE);
+ s3c2410_nand_inithw(info);
+
+ /* Restore the state of the nFCE line. */
+@@ -1082,8 +1111,7 @@ static int s3c24xx_nand_resume(struct platform_device *dev)
+ sel |= info->save_sel & info->sel_bit;
+ writel(sel, info->sel_reg);
+
+- if (allow_clk_stop(info))
+- clk_disable(info->clk);
++ s3c2410_nand_clk_set_state(info, CLOCK_SUSPEND);
+ }
+
+ return 0;
diff --git a/drivers/serial/samsung.c b/drivers/serial/samsung.c
index ac1f0b0..3a1fdb7 100644
--- a/drivers/serial/samsung.c
@@ -1086,6 +2441,167 @@ index 3f8ec8d..a428047 100644
glamofb_reg_write(gfb, GLAMO_REG_LCD_COMMAND1,
GLAMO_LCD_CMD_TYPE_DISP |
GLAMO_LCD_CMD_DATA_DISP_FIRE);
+diff --git a/include/linux/lis302dl.h b/include/linux/lis302dl.h
+new file mode 100644
+index 0000000..01c4ac9
+--- /dev/null
++++ b/include/linux/lis302dl.h
+@@ -0,0 +1,155 @@
++#ifndef _LINUX_LIS302DL_H
++#define _LINUX_LIS302DL_H
++
++#include <linux/types.h>
++#include <linux/spi/spi.h>
++#include <linux/input.h>
++
++
++struct lis302dl_info;
++
++struct lis302dl_platform_data {
++ char *name;
++ unsigned long pin_chip_select;
++ unsigned long pin_clk;
++ unsigned long pin_mosi;
++ unsigned long pin_miso;
++ int open_drain;
++ int interrupt;
++ void (*lis302dl_bitbang)(struct lis302dl_info *lis, u8 *tx,
++ int tx_bytes, u8 *rx, int rx_bytes);
++ void (*lis302dl_suspend_io)(struct lis302dl_info *, int resuming);
++ int (*lis302dl_bitbang_reg_read)(struct lis302dl_info *, u8 reg);
++ void (*lis302dl_bitbang_reg_write)(struct lis302dl_info *, u8 reg,
++ u8 val);
++};
++
++struct lis302dl_info {
++ struct lis302dl_platform_data *pdata;
++ struct device *dev;
++ struct input_dev *input_dev;
++ unsigned int flags;
++ unsigned int threshold;
++ unsigned int duration;
++ u32 overruns;
++ struct {
++ unsigned int threshold; /* mg */
++ unsigned int duration; /* ms */
++ } wakeup;
++ u_int8_t regs[0x40];
++};
++
++enum lis302dl_reg {
++ LIS302DL_REG_WHO_AM_I = 0x0f,
++ LIS302DL_REG_CTRL1 = 0x20,
++ LIS302DL_REG_CTRL2 = 0x21,
++ LIS302DL_REG_CTRL3 = 0x22,
++ LIS302DL_REG_HP_FILTER_RESET = 0x23,
++ LIS302DL_REG_STATUS = 0x27,
++ LIS302DL_REG_OUT_X = 0x29,
++ LIS302DL_REG_OUT_Y = 0x2b,
++ LIS302DL_REG_OUT_Z = 0x2d,
++ LIS302DL_REG_FF_WU_CFG_1 = 0x30,
++ LIS302DL_REG_FF_WU_SRC_1 = 0x31,
++ LIS302DL_REG_FF_WU_THS_1 = 0x32,
++ LIS302DL_REG_FF_WU_DURATION_1 = 0x33,
++ LIS302DL_REG_FF_WU_CFG_2 = 0x34,
++ LIS302DL_REG_FF_WU_SRC_2 = 0x35,
++ LIS302DL_REG_FF_WU_THS_2 = 0x36,
++ LIS302DL_REG_FF_WU_DURATION_2 = 0x37,
++ LIS302DL_REG_CLICK_CFG = 0x38,
++ LIS302DL_REG_CLICK_SRC = 0x39,
++ LIS302DL_REG_CLICK_THSY_X = 0x3b,
++ LIS302DL_REG_CLICK_THSZ = 0x3c,
++ LIS302DL_REG_CLICK_TIME_LIMIT = 0x3d,
++ LIS302DL_REG_CLICK_LATENCY = 0x3e,
++ LIS302DL_REG_CLICK_WINDOW = 0x3f,
++};
++
++enum lis302dl_reg_ctrl1 {
++ LIS302DL_CTRL1_Xen = 0x01,
++ LIS302DL_CTRL1_Yen = 0x02,
++ LIS302DL_CTRL1_Zen = 0x04,
++ LIS302DL_CTRL1_STM = 0x08,
++ LIS302DL_CTRL1_STP = 0x10,
++ LIS302DL_CTRL1_FS = 0x20,
++ LIS302DL_CTRL1_PD = 0x40,
++ LIS302DL_CTRL1_DR = 0x80,
++};
++
++enum lis302dl_reg_ctrl2 {
++ LIS302DL_CTRL2_HPC1 = 0x01,
++ LIS302DL_CTRL2_HPC2 = 0x02,
++ LIS302DL_CTRL2_HPFF1 = 0x04,
++ LIS302DL_CTRL2_HPFF2 = 0x08,
++ LIS302DL_CTRL2_FDS = 0x10,
++ LIS302DL_CTRL2_BOOT = 0x40,
++ LIS302DL_CTRL2_SIM = 0x80,
++};
++enum lis302dl_reg_ctrl3 {
++ LIS302DL_CTRL3_PP_OD = 0x40,
++ LIS302DL_CTRL3_IHL = 0x80,
++};
++
++enum lis302dl_reg_status {
++ LIS302DL_STATUS_XDA = 0x01,
++ LIS302DL_STATUS_YDA = 0x02,
++ LIS302DL_STATUS_ZDA = 0x04,
++ LIS302DL_STATUS_XYZDA = 0x08,
++ LIS302DL_STATUS_XOR = 0x10,
++ LIS302DL_STATUS_YOR = 0x20,
++ LIS302DL_STATUS_ZOR = 0x40,
++ LIS302DL_STATUS_XYZOR = 0x80,
++};
++
++/* Wakeup/freefall interrupt defs */
++enum lis302dl_reg_ffwucfg {
++ LIS302DL_FFWUCFG_XLIE = 0x01,
++ LIS302DL_FFWUCFG_XHIE = 0x02,
++ LIS302DL_FFWUCFG_YLIE = 0x04,
++ LIS302DL_FFWUCFG_YHIE = 0x08,
++ LIS302DL_FFWUCFG_ZLIE = 0x10,
++ LIS302DL_FFWUCFG_ZHIE = 0x20,
++ LIS302DL_FFWUCFG_LIR = 0x40,
++ LIS302DL_FFWUCFG_AOI = 0x80,
++};
++
++enum lis302dl_reg_ffwuths {
++ LIS302DL_FFWUTHS_DCRM = 0x80,
++};
++
++enum lis302dl_reg_ffwusrc {
++ LIS302DL_FFWUSRC_XL = 0x01,
++ LIS302DL_FFWUSRC_XH = 0x02,
++ LIS302DL_FFWUSRC_YL = 0x04,
++ LIS302DL_FFWUSRC_YH = 0x08,
++ LIS302DL_FFWUSRC_ZL = 0x10,
++ LIS302DL_FFWUSRC_ZH = 0x20,
++ LIS302DL_FFWUSRC_IA = 0x40,
++};
++
++enum lis302dl_reg_cloik_src {
++ LIS302DL_CLICKSRC_SINGLE_X = 0x01,
++ LIS302DL_CLICKSRC_DOUBLE_X = 0x02,
++ LIS302DL_CLICKSRC_SINGLE_Y = 0x04,
++ LIS302DL_CLICKSRC_DOUBLE_Y = 0x08,
++ LIS302DL_CLICKSRC_SINGLE_Z = 0x10,
++ LIS302DL_CLICKSRC_DOUBLE_Z = 0x20,
++ LIS302DL_CLICKSRC_IA = 0x40,
++};
++
++#define LIS302DL_WHO_AM_I_MAGIC 0x3b
++
++#define LIS302DL_F_WUP_FF_1 0x0001 /* wake up from free fall */
++#define LIS302DL_F_WUP_FF_2 0x0002
++#define LIS302DL_F_WUP_FF 0x0003
++#define LIS302DL_F_WUP_CLICK 0x0004
++#define LIS302DL_F_POWER 0x0010
++#define LIS302DL_F_FS 0x0020 /* ADC full scale */
++#define LIS302DL_F_INPUT_OPEN 0x0040 /* Set if input device is opened */
++#define LIS302DL_F_IRQ_WAKE 0x0080 /* IRQ is setup in wake mode */
++#define LIS302DL_F_DR 0x0100 /* Data rate, 400Hz/100Hz */
++
++
++#endif /* _LINUX_LIS302DL_H */
++
diff --git a/include/linux/mfd/glamo-core.h b/include/linux/mfd/glamo-core.h
index 8275a2f..8e3e56e 100644
--- a/include/linux/mfd/glamo-core.h
@@ -1121,7 +2637,7 @@ index 28ee2e6..d5b4a40 100644
K = Kpart & 0xFFFFFFFF;
diff --git a/sound/soc/s3c24xx/neo1973_wm8753.c b/sound/soc/s3c24xx/neo1973_wm8753.c
-index dc5893d..37835ca 100644
+index dc5893d4..37835ca 100644
--- a/sound/soc/s3c24xx/neo1973_wm8753.c
+++ b/sound/soc/s3c24xx/neo1973_wm8753.c
@@ -23,6 +23,7 @@
diff --git a/recipes/linux/linux-2.6.39/akita/defconfig b/recipes/linux/linux-2.6.39/akita/defconfig
new file mode 100644
index 0000000000..43b22dc597
--- /dev/null
+++ b/recipes/linux/linux-2.6.39/akita/defconfig
@@ -0,0 +1,381 @@
+CONFIG_EXPERIMENTAL=y
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SYSVIPC=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
+CONFIG_IKCONFIG=m
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_RD_BZIP2=y
+CONFIG_RD_LZMA=y
+CONFIG_RD_LZO=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_EMBEDDED=y
+CONFIG_SLOB=y
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=m
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+# CONFIG_LBDAF is not set
+CONFIG_IOSCHED_DEADLINE=m
+CONFIG_IOSCHED_CFQ=m
+CONFIG_ARCH_PXA=y
+CONFIG_PXA_SHARPSL=y
+CONFIG_MACH_AKITA=y
+CONFIG_MACH_BORZOI=y
+CONFIG_PCCARD=y
+CONFIG_PCMCIA_PXA2XX=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="console=ttyS0,115200n8 console=tty1 fbcon=rotate:1 quiet"
+CONFIG_KEXEC=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_BINFMT_AOUT=m
+CONFIG_BINFMT_MISC=m
+CONFIG_PM_RUNTIME=y
+CONFIG_NET=y
+CONFIG_PACKET=m
+CONFIG_UNIX=y
+CONFIG_XFRM_USER=m
+CONFIG_INET=y
+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_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+CONFIG_IPV6_TUNNEL=m
+CONFIG_NETFILTER=y
+CONFIG_NF_CONNTRACK=m
+CONFIG_NF_CONNTRACK_FTP=m
+CONFIG_NF_CONNTRACK_H323=m
+CONFIG_NF_CONNTRACK_IRC=m
+CONFIG_NF_CONNTRACK_SIP=m
+CONFIG_NF_CONNTRACK_IPV4=m
+CONFIG_IP_NF_IPTABLES=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_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+CONFIG_IRDA=m
+CONFIG_IRLAN=m
+CONFIG_IRNET=m
+CONFIG_IRCOMM=m
+CONFIG_PXA_FICP=m
+CONFIG_BT=m
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=m
+CONFIG_BT_HCIBTUSB=m
+CONFIG_BT_HCIBTSDIO=m
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIUART_ATH3K=y
+CONFIG_BT_HCIUART_LL=y
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBPA10X=m
+CONFIG_BT_HCIBFUSB=m
+CONFIG_BT_HCIDTL1=m
+CONFIG_BT_HCIBT3C=m
+CONFIG_BT_HCIBLUECARD=m
+CONFIG_BT_HCIBTUART=m
+CONFIG_BT_HCIVHCI=m
+CONFIG_BT_MRVL=m
+CONFIG_BT_MRVL_SDIO=m
+CONFIG_BT_ATH3K=m
+CONFIG_CFG80211=m
+# CONFIG_CFG80211_DEFAULT_PS is not set
+CONFIG_MAC80211=m
+# CONFIG_MAC80211_RC_MINSTREL is not set
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_MTD=y
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_ROM=y
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_VERIFY_WRITE=y
+CONFIG_MTD_NAND_SHARPSL=y
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_GLUEBI=m
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_MISC_DEVICES=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_BLK_DEV_SR=m
+CONFIG_CHR_DEV_SG=m
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_ATA=y
+CONFIG_PATA_PXA=y
+CONFIG_PATA_PCMCIA=y
+CONFIG_NETDEVICES=y
+CONFIG_TUN=m
+CONFIG_NET_ETHERNET=y
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+CONFIG_AIRO_CS=m
+CONFIG_HOSTAP=m
+CONFIG_HOSTAP_FIRMWARE=y
+CONFIG_HOSTAP_CS=m
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_NET_DM9601=m
+# CONFIG_USB_NET_CDC_SUBSET is not set
+CONFIG_USB_SIERRA_NET=m
+CONFIG_NET_PCMCIA=y
+CONFIG_PCMCIA_PCNET=m
+CONFIG_PPP=m
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=640
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=480
+CONFIG_INPUT_EVDEV=y
+CONFIG_INPUT_APMPOWER=y
+# CONFIG_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_MATRIX=y
+# CONFIG_INPUT_MOUSE is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_ADS7846=y
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_UINPUT=m
+# CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_SERIAL_8250=m
+CONFIG_SERIAL_8250_CS=m
+CONFIG_SERIAL_PXA=y
+CONFIG_SERIAL_PXA_CONSOLE=y
+CONFIG_RAMOOPS=y
+CONFIG_SPI=y
+CONFIG_SPI_PXA2XX=y
+CONFIG_GPIO_SYSFS=y
+CONFIG_POWER_SUPPLY=y
+CONFIG_POWER_SUPPLY_DEBUG=y
+CONFIG_PDA_POWER=y
+CONFIG_APM_POWER=y
+CONFIG_FB=y
+CONFIG_FB_PXA=y
+CONFIG_FB_PXA_OVERLAY=y
+CONFIG_FB_PXA_SMARTPANEL=y
+CONFIG_FB_PXA_PARAMETERS=y
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=y
+CONFIG_LCD_CORGI=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+CONFIG_DISPLAY_SUPPORT=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+CONFIG_FONTS=y
+CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_SOUND=m
+CONFIG_SND=m
+CONFIG_SND_SEQUENCER=m
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_PXA2XX_AC97=m
+CONFIG_SND_USB_AUDIO=m
+CONFIG_SND_SOC=m
+CONFIG_SND_PXA2XX_SOC=m
+CONFIG_SND_PXA2XX_SOC_SPITZ=m
+CONFIG_HID=m
+CONFIG_USB_KBD=m
+CONFIG_USB_MOUSE=m
+CONFIG_USB=m
+CONFIG_USB_DEBUG=y
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_OTG_WHITELIST=y
+CONFIG_USB_MON=m
+CONFIG_USB_OHCI_HCD=m
+CONFIG_USB_SL811_HCD=m
+CONFIG_USB_SL811_CS=m
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+CONFIG_USB_STORAGE=m
+CONFIG_USB_MDC800=m
+CONFIG_USB_MICROTEK=m
+CONFIG_USB_SERIAL=m
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_BELKIN=m
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+CONFIG_USB_SERIAL_CYPRESS_M8=m
+CONFIG_USB_SERIAL_EMPEG=m
+CONFIG_USB_SERIAL_FTDI_SIO=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_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_PL2303=m
+CONFIG_USB_SERIAL_SAFE=m
+CONFIG_USB_SERIAL_TI=m
+CONFIG_USB_SERIAL_CYBERJACK=m
+CONFIG_USB_SERIAL_XIRCOM=m
+CONFIG_USB_SERIAL_OMNINET=m
+CONFIG_USB_EMI62=m
+CONFIG_USB_EMI26=m
+CONFIG_USB_RIO500=m
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+CONFIG_USB_LED=m
+CONFIG_USB_CYTHERM=m
+CONFIG_USB_IDMOUSE=m
+CONFIG_USB_GADGET=m
+CONFIG_USB_GADGET_DEBUG_FILES=y
+CONFIG_USB_GADGET_DEBUG_FS=y
+CONFIG_USB_GADGET_PXA27X=y
+CONFIG_USB_ZERO=m
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_EEM=y
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+CONFIG_USB_MASS_STORAGE=m
+CONFIG_USB_G_SERIAL=m
+CONFIG_USB_CDC_COMPOSITE=m
+CONFIG_USB_G_MULTI=m
+CONFIG_USB_G_MULTI_CDC=y
+CONFIG_USB_GPIO_VBUS=m
+CONFIG_USB_ULPI=y
+CONFIG_NOP_USB_XCEIV=m
+CONFIG_MMC=y
+CONFIG_MMC_UNSAFE_RESUME=y
+CONFIG_MMC_PXA=y
+CONFIG_MMC_SPI=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_RTC_CLASS=m
+CONFIG_RTC_DRV_SA1100=m
+CONFIG_RTC_DRV_PXA=m
+CONFIG_EXT2_FS=y
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+# CONFIG_EXT3_FS_XATTR is not set
+CONFIG_EXT4_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_SUMMARY=y
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RUBIN=y
+CONFIG_UBIFS_FS=y
+CONFIG_UBIFS_FS_ADVANCED_COMPR=y
+CONFIG_CRAMFS=m
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+CONFIG_NFS_V4=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V4=y
+CONFIG_CIFS=m
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_NLS_DEFAULT="cp437"
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=y
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_FS=y
+CONFIG_SYSCTL_SYSCALL_CHECK=y
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_TEST=m
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_TWOFISH=m
+# CONFIG_CRYPTO_HW is not set
+CONFIG_CRC_CCITT=y
+CONFIG_LIBCRC32C=m
diff --git a/recipes/linux/linux-2.6.39/c7x0/defconfig b/recipes/linux/linux-2.6.39/c7x0/defconfig
new file mode 100644
index 0000000000..4e00cd764c
--- /dev/null
+++ b/recipes/linux/linux-2.6.39/c7x0/defconfig
@@ -0,0 +1,378 @@
+CONFIG_EXPERIMENTAL=y
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SYSVIPC=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
+CONFIG_IKCONFIG=m
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_RD_BZIP2=y
+CONFIG_RD_LZMA=y
+CONFIG_RD_LZO=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_EMBEDDED=y
+CONFIG_SLOB=y
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=m
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+# CONFIG_LBDAF is not set
+CONFIG_IOSCHED_DEADLINE=m
+CONFIG_IOSCHED_CFQ=m
+CONFIG_ARCH_PXA=y
+CONFIG_PXA_SHARPSL=y
+CONFIG_MACH_CORGI=y
+CONFIG_MACH_SHEPHERD=y
+CONFIG_MACH_HUSKY=y
+CONFIG_PCCARD=y
+CONFIG_PCMCIA_PXA2XX=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="console=ttyS0,115200n8 console=tty1 quiet"
+CONFIG_KEXEC=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_BINFMT_AOUT=m
+CONFIG_BINFMT_MISC=m
+CONFIG_PM_RUNTIME=y
+CONFIG_NET=y
+CONFIG_PACKET=m
+CONFIG_UNIX=y
+CONFIG_XFRM_USER=m
+CONFIG_INET=y
+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_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+CONFIG_IPV6_TUNNEL=m
+CONFIG_NETFILTER=y
+CONFIG_NF_CONNTRACK=m
+CONFIG_NF_CONNTRACK_FTP=m
+CONFIG_NF_CONNTRACK_H323=m
+CONFIG_NF_CONNTRACK_IRC=m
+CONFIG_NF_CONNTRACK_SIP=m
+CONFIG_NF_CONNTRACK_IPV4=m
+CONFIG_IP_NF_IPTABLES=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_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+CONFIG_IRDA=m
+CONFIG_IRLAN=m
+CONFIG_IRNET=m
+CONFIG_IRCOMM=m
+CONFIG_PXA_FICP=m
+CONFIG_BT=m
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=m
+CONFIG_BT_HCIBTUSB=m
+CONFIG_BT_HCIBTSDIO=m
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIUART_ATH3K=y
+CONFIG_BT_HCIUART_LL=y
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBPA10X=m
+CONFIG_BT_HCIBFUSB=m
+CONFIG_BT_HCIDTL1=m
+CONFIG_BT_HCIBT3C=m
+CONFIG_BT_HCIBLUECARD=m
+CONFIG_BT_HCIBTUART=m
+CONFIG_BT_HCIVHCI=m
+CONFIG_BT_MRVL=m
+CONFIG_BT_MRVL_SDIO=m
+CONFIG_BT_ATH3K=m
+CONFIG_CFG80211=m
+# CONFIG_CFG80211_DEFAULT_PS is not set
+CONFIG_MAC80211=m
+# CONFIG_MAC80211_RC_MINSTREL is not set
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_MTD=y
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_ROM=y
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_VERIFY_WRITE=y
+CONFIG_MTD_NAND_SHARPSL=y
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_GLUEBI=m
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_MISC_DEVICES=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_BLK_DEV_SR=m
+CONFIG_CHR_DEV_SG=m
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_ATA=y
+CONFIG_PATA_PXA=y
+CONFIG_PATA_PCMCIA=y
+CONFIG_NETDEVICES=y
+CONFIG_TUN=m
+CONFIG_NET_ETHERNET=y
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+CONFIG_AIRO_CS=m
+CONFIG_HOSTAP=m
+CONFIG_HOSTAP_FIRMWARE=y
+CONFIG_HOSTAP_CS=m
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_NET_DM9601=m
+# CONFIG_USB_NET_CDC_SUBSET is not set
+CONFIG_USB_SIERRA_NET=m
+CONFIG_NET_PCMCIA=y
+CONFIG_PCMCIA_PCNET=m
+CONFIG_PPP=m
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=640
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=480
+CONFIG_INPUT_EVDEV=y
+CONFIG_INPUT_APMPOWER=y
+# CONFIG_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_MATRIX=y
+# CONFIG_INPUT_MOUSE is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_ADS7846=y
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_UINPUT=m
+# CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_SERIAL_8250=m
+CONFIG_SERIAL_8250_CS=m
+CONFIG_SERIAL_PXA=y
+CONFIG_SERIAL_PXA_CONSOLE=y
+CONFIG_RAMOOPS=y
+CONFIG_I2C=y
+CONFIG_I2C_PXA=y
+CONFIG_SPI=y
+CONFIG_SPI_PXA2XX=y
+CONFIG_GPIO_SYSFS=y
+CONFIG_POWER_SUPPLY=y
+CONFIG_POWER_SUPPLY_DEBUG=y
+CONFIG_PDA_POWER=y
+CONFIG_APM_POWER=y
+CONFIG_FB=y
+CONFIG_FB_W100=y
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=y
+CONFIG_LCD_CORGI=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+CONFIG_DISPLAY_SUPPORT=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FONTS=y
+CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_SOUND=m
+CONFIG_SND=m
+CONFIG_SND_SEQUENCER=m
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_PXA2XX_AC97=m
+CONFIG_SND_USB_AUDIO=m
+CONFIG_SND_SOC=m
+CONFIG_SND_PXA2XX_SOC=m
+CONFIG_SND_PXA2XX_SOC_CORGI=m
+CONFIG_HID=m
+CONFIG_USB_KBD=m
+CONFIG_USB_MOUSE=m
+CONFIG_USB=m
+CONFIG_USB_DEBUG=y
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_OTG_WHITELIST=y
+CONFIG_USB_MON=m
+CONFIG_USB_SL811_HCD=m
+CONFIG_USB_SL811_CS=m
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+CONFIG_USB_STORAGE=m
+CONFIG_USB_MDC800=m
+CONFIG_USB_MICROTEK=m
+CONFIG_USB_SERIAL=m
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_BELKIN=m
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+CONFIG_USB_SERIAL_CYPRESS_M8=m
+CONFIG_USB_SERIAL_EMPEG=m
+CONFIG_USB_SERIAL_FTDI_SIO=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_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_PL2303=m
+CONFIG_USB_SERIAL_SAFE=m
+CONFIG_USB_SERIAL_TI=m
+CONFIG_USB_SERIAL_CYBERJACK=m
+CONFIG_USB_SERIAL_XIRCOM=m
+CONFIG_USB_SERIAL_OMNINET=m
+CONFIG_USB_EMI62=m
+CONFIG_USB_EMI26=m
+CONFIG_USB_RIO500=m
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+CONFIG_USB_LED=m
+CONFIG_USB_CYTHERM=m
+CONFIG_USB_IDMOUSE=m
+CONFIG_USB_GADGET=m
+CONFIG_USB_GADGET_DEBUG_FILES=y
+CONFIG_USB_GADGET_DEBUG_FS=y
+CONFIG_USB_ZERO=m
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_EEM=y
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+CONFIG_USB_MASS_STORAGE=m
+CONFIG_USB_G_SERIAL=m
+CONFIG_USB_CDC_COMPOSITE=m
+CONFIG_USB_G_MULTI=m
+CONFIG_USB_G_MULTI_CDC=y
+CONFIG_USB_GPIO_VBUS=m
+CONFIG_USB_ULPI=y
+CONFIG_NOP_USB_XCEIV=m
+CONFIG_MMC=y
+CONFIG_MMC_UNSAFE_RESUME=y
+CONFIG_MMC_PXA=y
+CONFIG_MMC_SPI=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_RTC_CLASS=m
+CONFIG_RTC_DRV_SA1100=m
+CONFIG_RTC_DRV_PXA=m
+CONFIG_EXT2_FS=y
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+# CONFIG_EXT3_FS_XATTR is not set
+CONFIG_EXT4_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_SUMMARY=y
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RUBIN=y
+CONFIG_UBIFS_FS=y
+CONFIG_UBIFS_FS_ADVANCED_COMPR=y
+CONFIG_CRAMFS=m
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+CONFIG_NFS_V4=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V4=y
+CONFIG_CIFS=m
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_NLS_DEFAULT="cp437"
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=y
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_FS=y
+CONFIG_SYSCTL_SYSCALL_CHECK=y
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_TEST=m
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_TWOFISH=m
+# CONFIG_CRYPTO_HW is not set
+CONFIG_CRC_CCITT=y
+CONFIG_LIBCRC32C=m
diff --git a/recipes/linux/linux-2.6.39/collie/defconfig b/recipes/linux/linux-2.6.39/collie/defconfig
new file mode 100644
index 0000000000..4711f095ae
--- /dev/null
+++ b/recipes/linux/linux-2.6.39/collie/defconfig
@@ -0,0 +1,324 @@
+CONFIG_EXPERIMENTAL=y
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SYSVIPC=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
+CONFIG_SPARSE_IRQ=y
+CONFIG_IKCONFIG=m
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_RD_BZIP2=y
+CONFIG_RD_LZMA=y
+CONFIG_RD_LZO=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_EMBEDDED=y
+CONFIG_SLOB=y
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=m
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+# CONFIG_LBDAF is not set
+CONFIG_IOSCHED_DEADLINE=m
+CONFIG_IOSCHED_CFQ=m
+CONFIG_ARCH_SA1100=y
+CONFIG_SA1100_COLLIE=y
+CONFIG_PCCARD=y
+CONFIG_PCMCIA_SA1100=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="console=ttySA0,115200n8 console=tty1 mem=64M fbcon=rotate:1 quiet"
+CONFIG_KEXEC=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_BINFMT_AOUT=m
+CONFIG_BINFMT_MISC=m
+CONFIG_PM_RUNTIME=y
+CONFIG_APM_EMULATION=y
+CONFIG_NET=y
+CONFIG_PACKET=m
+CONFIG_UNIX=y
+CONFIG_XFRM_USER=m
+CONFIG_INET=y
+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_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+CONFIG_IPV6_TUNNEL=m
+CONFIG_NETFILTER=y
+CONFIG_NF_CONNTRACK=m
+CONFIG_NF_CONNTRACK_FTP=m
+CONFIG_NF_CONNTRACK_H323=m
+CONFIG_NF_CONNTRACK_IRC=m
+CONFIG_NF_CONNTRACK_SIP=m
+CONFIG_NF_CONNTRACK_IPV4=m
+CONFIG_IP_NF_IPTABLES=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_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+CONFIG_IRDA=m
+CONFIG_IRLAN=m
+CONFIG_IRNET=m
+CONFIG_IRCOMM=m
+CONFIG_BT=m
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=m
+CONFIG_BT_HCIBTSDIO=m
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIUART_ATH3K=y
+CONFIG_BT_HCIUART_LL=y
+CONFIG_BT_HCIDTL1=m
+CONFIG_BT_HCIBT3C=m
+CONFIG_BT_HCIBLUECARD=m
+CONFIG_BT_HCIBTUART=m
+CONFIG_BT_HCIVHCI=m
+CONFIG_BT_MRVL=m
+CONFIG_BT_MRVL_SDIO=m
+CONFIG_CFG80211=m
+# CONFIG_CFG80211_DEFAULT_PS is not set
+CONFIG_MAC80211=m
+# CONFIG_MAC80211_RC_MINSTREL is not set
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_MTD=y
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_CFI=y
+CONFIG_MTD_JEDECPROBE=y
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+CONFIG_MTD_CFI_GEOMETRY=y
+# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_2 is not set
+# CONFIG_MTD_CFI_I1 is not set
+# CONFIG_MTD_CFI_I2 is not set
+CONFIG_MTD_CFI_I4=y
+CONFIG_MTD_CFI_INTELEXT=y
+CONFIG_MTD_ROM=y
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_SA1100=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_VERIFY_WRITE=y
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_GLUEBI=m
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_MISC_DEVICES=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_BLK_DEV_SR=m
+CONFIG_CHR_DEV_SG=m
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_ATA=y
+CONFIG_PATA_PCMCIA=y
+CONFIG_NETDEVICES=y
+CONFIG_TUN=m
+CONFIG_MII=m
+CONFIG_NET_ETHERNET=y
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+CONFIG_AIRO_CS=m
+CONFIG_HOSTAP=m
+CONFIG_HOSTAP_FIRMWARE=y
+CONFIG_HOSTAP_CS=m
+CONFIG_NET_PCMCIA=y
+CONFIG_PCMCIA_PCNET=m
+CONFIG_PPP=m
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=240
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=320
+CONFIG_INPUT_EVDEV=y
+CONFIG_INPUT_APMPOWER=y
+# CONFIG_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_LOCOMO=y
+# CONFIG_INPUT_MOUSE is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_ADS7846=y
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_UINPUT=m
+# CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_SERIAL_8250=m
+CONFIG_SERIAL_8250_CS=m
+CONFIG_SERIAL_SA1100=y
+CONFIG_SERIAL_SA1100_CONSOLE=y
+CONFIG_RAMOOPS=y
+CONFIG_I2C=y
+CONFIG_SPI=y
+CONFIG_GPIO_SYSFS=y
+CONFIG_POWER_SUPPLY=y
+CONFIG_POWER_SUPPLY_DEBUG=y
+CONFIG_PDA_POWER=y
+CONFIG_APM_POWER=y
+CONFIG_SENSORS_MAX1111=y
+CONFIG_MCP_SA11X0=y
+CONFIG_MCP_UCB1200=y
+CONFIG_MCP_UCB1200_TS=y
+CONFIG_FB=y
+CONFIG_FB_SA1100=y
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+# CONFIG_BACKLIGHT_GENERIC is not set
+CONFIG_DISPLAY_SUPPORT=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+CONFIG_FONTS=y
+CONFIG_FONT_8x8=y
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_SOUND=m
+CONFIG_SND=m
+CONFIG_SND_SEQUENCER=m
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_SOC=m
+CONFIG_HID=m
+CONFIG_USB_OTG_WHITELIST=y
+CONFIG_USB_GADGET=m
+CONFIG_USB_GADGET_DEBUG_FILES=y
+CONFIG_USB_GADGET_DEBUG_FS=y
+CONFIG_USB_ZERO=m
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_EEM=y
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+CONFIG_USB_MASS_STORAGE=m
+CONFIG_USB_G_SERIAL=m
+CONFIG_USB_CDC_COMPOSITE=m
+CONFIG_USB_G_MULTI=m
+CONFIG_USB_G_MULTI_CDC=y
+CONFIG_USB_GPIO_VBUS=m
+CONFIG_USB_ULPI=y
+CONFIG_NOP_USB_XCEIV=m
+CONFIG_MMC=y
+CONFIG_MMC_UNSAFE_RESUME=y
+CONFIG_MMC_SPI=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_LOCOMO=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_RTC_CLASS=m
+CONFIG_RTC_DRV_SA1100=m
+CONFIG_EXT2_FS=y
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+# CONFIG_EXT3_FS_XATTR is not set
+CONFIG_EXT4_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_SUMMARY=y
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RUBIN=y
+CONFIG_UBIFS_FS=y
+CONFIG_UBIFS_FS_ADVANCED_COMPR=y
+CONFIG_CRAMFS=m
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+CONFIG_NFS_V4=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V4=y
+CONFIG_CIFS=m
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_NLS_DEFAULT="cp437"
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=y
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_FS=y
+CONFIG_SYSCTL_SYSCALL_CHECK=y
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_TEST=m
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_TWOFISH=m
+# CONFIG_CRYPTO_HW is not set
+CONFIG_CRC_CCITT=y
+CONFIG_LIBCRC32C=m
diff --git a/recipes/linux/linux-2.6.39/om-gta01/defconfig b/recipes/linux/linux-2.6.39/om-gta01/defconfig
new file mode 100644
index 0000000000..619104e46e
--- /dev/null
+++ b/recipes/linux/linux-2.6.39/om-gta01/defconfig
@@ -0,0 +1,481 @@
+CONFIG_EXPERIMENTAL=y
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_KERNEL_LZMA=y
+CONFIG_SYSVIPC=y
+CONFIG_IKCONFIG=m
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=18
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_RD_BZIP2=y
+CONFIG_RD_LZMA=y
+CONFIG_RD_LZO=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_EXPERT=y
+CONFIG_SLAB=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+# CONFIG_LBDAF is not set
+# CONFIG_IOSCHED_CFQ is not set
+CONFIG_ARCH_S3C2410=y
+CONFIG_S3C_LOWLEVEL_UART_PORT=2
+CONFIG_SAMSUNG_GPIO_EXTRA=64
+CONFIG_S3C24XX_PWM=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="unused -- bootloader passes ATAG list quiet"
+CONFIG_CPU_IDLE=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_PM_RUNTIME=y
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_XFRM_USER=m
+CONFIG_NET_KEY=m
+CONFIG_NET_KEY_MIGRATE=y
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_PNP=y
+CONFIG_NET_IPIP=m
+CONFIG_IP_MROUTE=y
+CONFIG_SYN_COOKIES=y
+CONFIG_INET_AH=m
+CONFIG_INET_ESP=m
+CONFIG_INET_IPCOMP=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_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_MD5SIG=y
+CONFIG_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+CONFIG_IPV6_TUNNEL=m
+CONFIG_NETFILTER=y
+CONFIG_NF_CONNTRACK=m
+CONFIG_NF_CT_PROTO_SCTP=m
+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_XT_TARGET_CLASSIFY=m
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
+CONFIG_NETFILTER_XT_TARGET_DSCP=m
+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_TCPMSS=m
+CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
+CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
+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_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_POLICY=m
+CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+CONFIG_NETFILTER_XT_MATCH_QUOTA=m
+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_NF_CONNTRACK_IPV4=m
+CONFIG_IP_NF_IPTABLES=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_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_REDIRECT=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_NF_CONNTRACK_IPV6=m
+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_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_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=m
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_CBQ=m
+CONFIG_NET_SCH_HTB=m
+CONFIG_NET_SCH_HFSC=m
+CONFIG_NET_SCH_PRIO=m
+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_CLS_BASIC=m
+CONFIG_NET_CLS_TCINDEX=m
+CONFIG_NET_CLS_ROUTE4=m
+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_BT=m
+CONFIG_BT_HCIBTUSB=m
+CONFIG_RFKILL=y
+CONFIG_RFKILL_INPUT=y
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+# CONFIG_FIRMWARE_IN_KERNEL is not set
+CONFIG_CONNECTOR=m
+CONFIG_MTD=y
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_CFI=y
+CONFIG_MTD_CFI_INTELEXT=y
+CONFIG_MTD_ROM=y
+CONFIG_MTD_ABSENT=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_VERIFY_WRITE=y
+CONFIG_MTD_NAND_S3C2410=y
+CONFIG_MTD_NAND_S3C2410_HWECC=y
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_GLUEBI=y
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_UB=m
+CONFIG_BLK_DEV_RAM=y
+CONFIG_MISC_DEVICES=y
+CONFIG_SCSI=m
+CONFIG_BLK_DEV_SD=m
+CONFIG_BLK_DEV_SR=m
+CONFIG_CHR_DEV_SG=m
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_SCSI_SCAN_ASYNC=y
+CONFIG_NETDEVICES=y
+CONFIG_TUN=m
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+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_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_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_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_STOWAWAY=m
+# CONFIG_INPUT_MOUSE is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_S3C2410=y
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_UINPUT=m
+# CONFIG_SERIO_SERPORT is not set
+CONFIG_VT_HW_CONSOLE_BINDING=y
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_N_GSM=m
+# CONFIG_DEVKMEM is not set
+CONFIG_SERIAL_SAMSUNG=y
+CONFIG_SERIAL_SAMSUNG_CONSOLE=y
+# CONFIG_HW_RANDOM is not set
+CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
+# CONFIG_I2C_HELPER_AUTO is not set
+CONFIG_I2C_ALGOBIT=y
+CONFIG_I2C_S3C2410=y
+CONFIG_SPI=y
+CONFIG_SPI_GPIO=y
+CONFIG_SPI_S3C24XX=y
+CONFIG_GPIO_SYSFS=y
+# CONFIG_HWMON is not set
+CONFIG_WATCHDOG=y
+CONFIG_S3C2410_WATCHDOG=y
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_FIXED_VOLTAGE=y
+CONFIG_FB=y
+CONFIG_FB_S3C2410=y
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=y
+CONFIG_LCD_JBT6K74=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+# CONFIG_BACKLIGHT_GENERIC is not set
+CONFIG_BACKLIGHT_PWM=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_SOUND=m
+CONFIG_SND=m
+CONFIG_SND_SEQUENCER=m
+CONFIG_SND_SEQ_DUMMY=m
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_SEQUENCER_OSS=y
+# CONFIG_SND_SUPPORT_OLD_API is not set
+# CONFIG_SND_VERBOSE_PROCFS 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_HID_A4TECH=m
+CONFIG_HID_APPLE=m
+CONFIG_HID_BELKIN=m
+CONFIG_HID_CHERRY=m
+CONFIG_HID_CHICONY=m
+CONFIG_HID_CYPRESS=m
+CONFIG_HID_DRAGONRISE=m
+CONFIG_HID_EZKEY=m
+CONFIG_HID_KYE=m
+CONFIG_HID_GYRATION=m
+CONFIG_HID_TWINHAN=m
+CONFIG_HID_KENSINGTON=m
+CONFIG_HID_LOGITECH=m
+CONFIG_HID_MICROSOFT=m
+CONFIG_HID_MONTEREY=m
+CONFIG_HID_NTRIG=m
+CONFIG_HID_ORTEK=m
+CONFIG_HID_PANTHERLORD=m
+CONFIG_HID_PETALYNX=m
+CONFIG_HID_SAMSUNG=m
+CONFIG_HID_SONY=m
+CONFIG_HID_SUNPLUS=m
+CONFIG_HID_GREENASIA=m
+CONFIG_HID_SMARTJOYPLUS=m
+CONFIG_HID_TOPSEED=m
+CONFIG_HID_THRUSTMASTER=m
+CONFIG_HID_ZEROPLUS=m
+CONFIG_USB=m
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+# CONFIG_USB_DEVICE_CLASS is not set
+CONFIG_USB_OHCI_HCD=m
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+CONFIG_USB_TMC=m
+CONFIG_USB_STORAGE=m
+CONFIG_USB_STORAGE_DATAFAB=m
+CONFIG_USB_STORAGE_FREECOM=m
+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_KARMA=m
+CONFIG_USB_SERIAL=m
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_AIRCABLE=m
+CONFIG_USB_SERIAL_ARK3116=m
+CONFIG_USB_SERIAL_BELKIN=m
+CONFIG_USB_SERIAL_WHITEHEAT=m
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+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_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_NAVMAN=m
+CONFIG_USB_SERIAL_PL2303=m
+CONFIG_USB_SERIAL_HP4X=m
+CONFIG_USB_SERIAL_SAFE=m
+CONFIG_USB_SERIAL_SAFE_PADDED=y
+CONFIG_USB_SERIAL_SIERRAWIRELESS=m
+CONFIG_USB_SERIAL_TI=m
+CONFIG_USB_SERIAL_CYBERJACK=m
+CONFIG_USB_SERIAL_XIRCOM=m
+CONFIG_USB_SERIAL_OPTION=m
+CONFIG_USB_SERIAL_OMNINET=m
+CONFIG_USB_TRANCEVIBRATOR=m
+CONFIG_USB_IOWARRIOR=m
+CONFIG_USB_GADGET=m
+CONFIG_USB_GADGET_VBUS_DRAW=500
+CONFIG_USB_GADGET_S3C2410=y
+CONFIG_USB_ETH=m
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+CONFIG_USB_MASS_STORAGE=m
+CONFIG_USB_G_SERIAL=m
+CONFIG_USB_CDC_COMPOSITE=m
+CONFIG_MMC=y
+CONFIG_MMC_UNSAFE_RESUME=y
+CONFIG_MMC_S3C=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_S3C24XX=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_PWM=y
+CONFIG_LEDS_REGULATOR=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_BACKLIGHT=y
+CONFIG_LEDS_TRIGGER_GPIO=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_S3C=y
+# CONFIG_AR6000_WLAN is not set
+CONFIG_EXT2_FS=y
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+# CONFIG_EXT3_FS_XATTR is not set
+CONFIG_REISERFS_FS=y
+CONFIG_XFS_FS=m
+CONFIG_BTRFS_FS=m
+# CONFIG_DNOTIFY is not set
+CONFIG_AUTOFS4_FS=m
+CONFIG_FUSE_FS=m
+CONFIG_CUSE=m
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+CONFIG_UDF_FS=m
+CONFIG_VFAT_FS=m
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_CONFIGFS_FS=m
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_SUMMARY=y
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_UBIFS_FS=y
+CONFIG_UBIFS_FS_XATTR=y
+CONFIG_UBIFS_FS_ADVANCED_COMPR=y
+CONFIG_SQUASHFS=m
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V3_ACL=y
+CONFIG_NFSD_V4=y
+CONFIG_CIFS=m
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_EFI_PARTITION=y
+CONFIG_NLS=y
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+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_UTF8=m
+CONFIG_PRINTK_TIME=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_STRIP_ASM_SYMS=y
+CONFIG_DEBUG_S3C_UART=2
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_TEST=m
+CONFIG_CRYPTO_LRW=m
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_XCBC=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_FCRYPT=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_ZLIB=y
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_HW is not set
+CONFIG_CRC_CCITT=y
+CONFIG_CRC_T10DIF=y
+CONFIG_CRC_ITU_T=y
+CONFIG_CRC7=y
+CONFIG_LIBCRC32C=y
diff --git a/recipes/linux/linux-2.6.39/om-gta02/defconfig b/recipes/linux/linux-2.6.39/om-gta02/defconfig
new file mode 100644
index 0000000000..94e3b4065c
--- /dev/null
+++ b/recipes/linux/linux-2.6.39/om-gta02/defconfig
@@ -0,0 +1,490 @@
+CONFIG_EXPERIMENTAL=y
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_KERNEL_LZMA=y
+CONFIG_SYSVIPC=y
+CONFIG_IKCONFIG=m
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=18
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_RD_BZIP2=y
+CONFIG_RD_LZMA=y
+CONFIG_RD_LZO=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_EXPERT=y
+CONFIG_SLAB=y
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+# CONFIG_LBDAF is not set
+# CONFIG_IOSCHED_CFQ is not set
+CONFIG_ARCH_S3C2410=y
+CONFIG_S3C_LOWLEVEL_UART_PORT=2
+CONFIG_SAMSUNG_GPIO_EXTRA=64
+CONFIG_S3C24XX_PWM=y
+CONFIG_MACH_NEO1973_GTA02=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="unused -- bootloader passes ATAG list quiet"
+CONFIG_CPU_IDLE=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_PM_RUNTIME=y
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_XFRM_USER=m
+CONFIG_NET_KEY=m
+CONFIG_NET_KEY_MIGRATE=y
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_PNP=y
+CONFIG_NET_IPIP=m
+CONFIG_IP_MROUTE=y
+CONFIG_SYN_COOKIES=y
+CONFIG_INET_AH=m
+CONFIG_INET_ESP=m
+CONFIG_INET_IPCOMP=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_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_MD5SIG=y
+CONFIG_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+CONFIG_IPV6_TUNNEL=m
+CONFIG_NETFILTER=y
+CONFIG_NF_CONNTRACK=m
+CONFIG_NF_CT_PROTO_SCTP=m
+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_XT_TARGET_CLASSIFY=m
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
+CONFIG_NETFILTER_XT_TARGET_DSCP=m
+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_TCPMSS=m
+CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
+CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
+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_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_POLICY=m
+CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+CONFIG_NETFILTER_XT_MATCH_QUOTA=m
+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_NF_CONNTRACK_IPV4=m
+CONFIG_IP_NF_IPTABLES=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_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_REDIRECT=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_NF_CONNTRACK_IPV6=m
+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_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_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=m
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_CBQ=m
+CONFIG_NET_SCH_HTB=m
+CONFIG_NET_SCH_HFSC=m
+CONFIG_NET_SCH_PRIO=m
+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_CLS_BASIC=m
+CONFIG_NET_CLS_TCINDEX=m
+CONFIG_NET_CLS_ROUTE4=m
+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_BT=m
+CONFIG_BT_HCIBTUSB=m
+CONFIG_RFKILL=y
+CONFIG_RFKILL_INPUT=y
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+# CONFIG_FIRMWARE_IN_KERNEL is not set
+CONFIG_CONNECTOR=m
+CONFIG_MTD=y
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_CFI=y
+CONFIG_MTD_CFI_INTELEXT=y
+CONFIG_MTD_ROM=y
+CONFIG_MTD_ABSENT=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_VERIFY_WRITE=y
+CONFIG_MTD_NAND_S3C2410=y
+CONFIG_MTD_NAND_S3C2410_HWECC=y
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_GLUEBI=y
+CONFIG_BLK_DEV_LOOP=m
+CONFIG_BLK_DEV_UB=m
+CONFIG_BLK_DEV_RAM=y
+CONFIG_MISC_DEVICES=y
+CONFIG_SCSI=m
+CONFIG_BLK_DEV_SD=m
+CONFIG_BLK_DEV_SR=m
+CONFIG_CHR_DEV_SG=m
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_SCSI_SCAN_ASYNC=y
+CONFIG_NETDEVICES=y
+CONFIG_TUN=m
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+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_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_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_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_STOWAWAY=m
+# CONFIG_INPUT_MOUSE is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_S3C2410=y
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_UINPUT=m
+CONFIG_INPUT_PCF50633_PMU=y
+# CONFIG_SERIO_SERPORT is not set
+CONFIG_VT_HW_CONSOLE_BINDING=y
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_N_GSM=m
+# CONFIG_DEVKMEM is not set
+CONFIG_SERIAL_SAMSUNG=y
+CONFIG_SERIAL_SAMSUNG_CONSOLE=y
+# CONFIG_HW_RANDOM is not set
+CONFIG_I2C_CHARDEV=y
+# CONFIG_I2C_HELPER_AUTO is not set
+CONFIG_I2C_ALGOBIT=y
+CONFIG_I2C_S3C2410=y
+CONFIG_SPI=y
+CONFIG_SPI_GPIO=y
+CONFIG_SPI_S3C24XX=y
+CONFIG_GPIO_SYSFS=y
+CONFIG_GPIO_GLAMO=y
+CONFIG_BATTERY_PLATFORM=y
+CONFIG_CHARGER_PCF50633=y
+# CONFIG_HWMON is not set
+CONFIG_WATCHDOG=y
+CONFIG_S3C2410_WATCHDOG=y
+CONFIG_PCF50633_ADC=y
+CONFIG_MFD_GLAMO=y
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_FIXED_VOLTAGE=y
+CONFIG_REGULATOR_PCF50633=y
+CONFIG_FB=y
+CONFIG_FB_S3C2410=y
+CONFIG_FB_GLAMO=y
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=y
+CONFIG_LCD_JBT6K74=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+# CONFIG_BACKLIGHT_GENERIC is not set
+CONFIG_BACKLIGHT_PWM=y
+CONFIG_BACKLIGHT_PCF50633=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_SOUND=m
+CONFIG_SND=m
+CONFIG_SND_SEQUENCER=m
+CONFIG_SND_SEQ_DUMMY=m
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_SEQUENCER_OSS=y
+# CONFIG_SND_SUPPORT_OLD_API is not set
+# CONFIG_SND_VERBOSE_PROCFS 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_HID_A4TECH=m
+CONFIG_HID_APPLE=m
+CONFIG_HID_BELKIN=m
+CONFIG_HID_CHERRY=m
+CONFIG_HID_CHICONY=m
+CONFIG_HID_CYPRESS=m
+CONFIG_HID_DRAGONRISE=m
+CONFIG_HID_EZKEY=m
+CONFIG_HID_KYE=m
+CONFIG_HID_GYRATION=m
+CONFIG_HID_TWINHAN=m
+CONFIG_HID_KENSINGTON=m
+CONFIG_HID_LOGITECH=m
+CONFIG_HID_MICROSOFT=m
+CONFIG_HID_MONTEREY=m
+CONFIG_HID_NTRIG=m
+CONFIG_HID_ORTEK=m
+CONFIG_HID_PANTHERLORD=m
+CONFIG_HID_PETALYNX=m
+CONFIG_HID_SAMSUNG=m
+CONFIG_HID_SONY=m
+CONFIG_HID_SUNPLUS=m
+CONFIG_HID_GREENASIA=m
+CONFIG_HID_SMARTJOYPLUS=m
+CONFIG_HID_TOPSEED=m
+CONFIG_HID_THRUSTMASTER=m
+CONFIG_HID_ZEROPLUS=m
+CONFIG_USB=m
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+# CONFIG_USB_DEVICE_CLASS is not set
+CONFIG_USB_OHCI_HCD=m
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+CONFIG_USB_TMC=m
+CONFIG_USB_STORAGE=m
+CONFIG_USB_STORAGE_DATAFAB=m
+CONFIG_USB_STORAGE_FREECOM=m
+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_KARMA=m
+CONFIG_USB_SERIAL=m
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_AIRCABLE=m
+CONFIG_USB_SERIAL_ARK3116=m
+CONFIG_USB_SERIAL_BELKIN=m
+CONFIG_USB_SERIAL_WHITEHEAT=m
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+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_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_NAVMAN=m
+CONFIG_USB_SERIAL_PL2303=m
+CONFIG_USB_SERIAL_HP4X=m
+CONFIG_USB_SERIAL_SAFE=m
+CONFIG_USB_SERIAL_SAFE_PADDED=y
+CONFIG_USB_SERIAL_SIERRAWIRELESS=m
+CONFIG_USB_SERIAL_TI=m
+CONFIG_USB_SERIAL_CYBERJACK=m
+CONFIG_USB_SERIAL_XIRCOM=m
+CONFIG_USB_SERIAL_OPTION=m
+CONFIG_USB_SERIAL_OMNINET=m
+CONFIG_USB_TRANCEVIBRATOR=m
+CONFIG_USB_IOWARRIOR=m
+CONFIG_USB_GADGET=m
+CONFIG_USB_GADGET_VBUS_DRAW=500
+CONFIG_USB_GADGET_S3C2410=y
+CONFIG_USB_ETH=m
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+CONFIG_USB_MASS_STORAGE=m
+CONFIG_USB_G_SERIAL=m
+CONFIG_USB_CDC_COMPOSITE=m
+CONFIG_MMC=y
+CONFIG_MMC_UNSAFE_RESUME=y
+CONFIG_MMC_S3C=y
+CONFIG_MMC_GLAMO=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_S3C24XX=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_PWM=y
+CONFIG_LEDS_REGULATOR=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_LEDS_TRIGGER_BACKLIGHT=y
+CONFIG_LEDS_TRIGGER_GPIO=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_PCF50633=y
+CONFIG_RTC_DRV_S3C=y
+CONFIG_EXT2_FS=y
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+# CONFIG_EXT3_FS_XATTR is not set
+CONFIG_REISERFS_FS=y
+CONFIG_XFS_FS=m
+CONFIG_BTRFS_FS=m
+# CONFIG_DNOTIFY is not set
+CONFIG_AUTOFS4_FS=m
+CONFIG_FUSE_FS=m
+CONFIG_CUSE=m
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+CONFIG_UDF_FS=m
+CONFIG_VFAT_FS=m
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_CONFIGFS_FS=m
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_SUMMARY=y
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_UBIFS_FS=y
+CONFIG_UBIFS_FS_XATTR=y
+CONFIG_UBIFS_FS_ADVANCED_COMPR=y
+CONFIG_SQUASHFS=m
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V3_ACL=y
+CONFIG_NFSD_V4=y
+CONFIG_CIFS=m
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_EFI_PARTITION=y
+CONFIG_NLS=y
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+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_UTF8=m
+CONFIG_PRINTK_TIME=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_STRIP_ASM_SYMS=y
+CONFIG_DEBUG_S3C_UART=2
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_TEST=m
+CONFIG_CRYPTO_LRW=m
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_XCBC=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_FCRYPT=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_ZLIB=y
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_HW is not set
+CONFIG_CRC_CCITT=y
+CONFIG_CRC_T10DIF=y
+CONFIG_CRC_ITU_T=y
+CONFIG_LIBCRC32C=y
diff --git a/recipes/linux/linux-2.6.39/openmoko.patch b/recipes/linux/linux-2.6.39/openmoko.patch
new file mode 100644
index 0000000000..5c4af4f0e7
--- /dev/null
+++ b/recipes/linux/linux-2.6.39/openmoko.patch
@@ -0,0 +1,46285 @@
+All patches from openmoko repository
+
+http://git.openmoko.org/?p=kernel.git;a=commit;h=164905f9f5843aa94b04eef724238c77dc47af0f
+
+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 e72dc34..0dd0fc0 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.
+@@ -130,6 +132,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-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig
+index 50825a3..5122b3e 100644
+--- a/arch/arm/mach-s3c2440/Kconfig
++++ b/arch/arm/mach-s3c2440/Kconfig
+@@ -93,13 +93,16 @@ config MACH_ANUBIS
+ config MACH_NEO1973_GTA02
+ bool "Openmoko GTA02 / Freerunner phone"
+ select CPU_S3C2442
++ select S3C24XX_GPIO_EXTRA64
+ 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 SPARSE_IRQ
++ select FIQ
+ 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..6a9061d
+--- /dev/null
++++ b/arch/arm/mach-s3c2440/gta02-fiq.c
+@@ -0,0 +1,133 @@
++#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(KERN_ERR "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(KERN_ERR "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..a1dadc2
+--- /dev/null
++++ b/arch/arm/mach-s3c2440/gta02-hdq.c
+@@ -0,0 +1,414 @@
++/*
++ * 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 {
++ struct mutex lock; /* if you want to use hdq, you have to take lock */
++ u8 hdq_probed; /* nonzero after HDQ driver probed */
++ 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 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;
++ int transact;
++
++ request = (volatile u8)hdq_priv.hdq_request_ctr;
++ 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.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.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.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..28aaa3c
+--- /dev/null
++++ b/arch/arm/mach-s3c2440/gta02-pm-bt.c
+@@ -0,0 +1,264 @@
++/*
++ * 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)
++{
++ int ret;
++ unsigned long on;
++ struct gta02_pm_bt_data *bt_data = dev_get_drvdata(dev);
++
++ ret = strict_strtoul(buf, 10, &on);
++ if (ret)
++ return ret;
++
++ 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 __devinit 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 __devexit 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 = __devexit_p(gta02_bt_remove),
++ .suspend = gta02_bt_suspend,
++ .resume = gta02_bt_resume,
++ .driver = {
++ .name = "gta02-pm-bt",
++ },
++};
++
++static int __init gta02_bt_init(void)
++{
++ return platform_driver_register(&gta02_bt_driver);
++}
++module_init(gta02_bt_init);
++
++static void __exit 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..4ca3ac6
+--- /dev/null
++++ b/arch/arm/mach-s3c2440/gta02-pm-gps.c
+@@ -0,0 +1,229 @@
++/*
++ * 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)
++{
++ int ret;
++ unsigned long on;
++
++ ret = strict_strtoul(buf, 10, &on);
++ if (ret)
++ return ret;
++
++ 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 const 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 __devinit 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 __devexit 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 = __devexit_p(gta02_pm_gps_remove),
++ .driver = {
++ .name = "gta02-pm-gps",
++ .pm = GTA02_GPS_PM_OPS,
++ },
++};
++
++static int __init gta02_pm_gps_init(void)
++{
++ return platform_driver_register(&gta02_pm_gps_driver);
++}
++module_init(gta02_pm_gps_init);
++
++static void __exit 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..a2b4e91
+--- /dev/null
++++ b/arch/arm/mach-s3c2440/gta02-pm-gsm.c
+@@ -0,0 +1,368 @@
++/*
++ * 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;
++
++ console_lock();
++
++ for (con = console_drivers; con; con = con->next) {
++ if (!strcmp(con->name, "ttySAC"))
++ break;
++ }
++
++ console_unlock();
++
++ 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)
++{
++ int ret;
++ unsigned long on;
++
++ ret = strict_strtoul(buf, 10, &on);
++ if (ret)
++ return ret;
++
++ 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 const 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 __devinit 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 __devexit 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 = __devexit_p(gta02_gsm_remove),
++ .driver = {
++ .name = "gta02-pm-gsm",
++ .pm = GTA02_GSM_PM_OPS,
++ },
++};
++
++static int __init gta02_gsm_init(void)
++{
++ return platform_driver_register(&gta02_gsm_driver);
++}
++module_init(gta02_gsm_init);
++
++static void __exit 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..1c8da2c
+--- /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 __devinit 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 __devexit 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 = __devexit_p(gta02_wlan_remove),
++ .driver = {
++ .name = "gta02-pm-wlan",
++ },
++};
++
++static int __init gta02_wlan_init(void)
++{
++ return platform_driver_register(&gta02_wlan_driver);
++}
++module_init(gta02_wlan_init);
++
++static void __exit 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 3a56a22..2e84b5a 100644
+--- a/arch/arm/mach-s3c2440/include/mach/gta02.h
++++ b/arch/arm/mach-s3c2440/include/mach/gta02.h
+@@ -79,6 +79,11 @@
+ #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))
++
+ 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 7166620..aa31b8d 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>
+@@ -61,6 +63,9 @@
+ #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>
+@@ -92,6 +97,19 @@
+ #include <plat/ts.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;
+
+ /*
+@@ -147,6 +165,183 @@ 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 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,
++};
++
++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,
++ },
++};
++
++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.
+@@ -159,22 +354,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);
+@@ -235,6 +436,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
+
+ /*
+@@ -258,6 +461,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 |
+@@ -276,6 +505,7 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
+ .charger_reference_current_ma = 1000,
+
+ .backlight_data = &gta02_backlight_data,
++ .gpio_base = GTA02_GPIO_PCF_BASE,
+
+ .reg_init_data = {
+ [PCF50633_REGULATOR_AUTO] = {
+@@ -313,6 +543,8 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
+ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
+ REGULATOR_CHANGE_STATUS,
+ },
++ .num_consumer_supplies = ARRAY_SIZE(hcldo_consumers),
++ .consumer_supplies = hcldo_consumers,
+ },
+ [PCF50633_REGULATOR_LDO1] = {
+ .constraints = {
+@@ -347,6 +579,8 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ .apply_uV = 1,
+ },
++ .num_consumer_supplies = ARRAY_SIZE(ldo4_consumers),
++ .consumer_supplies = ldo4_consumers,
+ },
+ [PCF50633_REGULATOR_LDO5] = {
+ .constraints = {
+@@ -356,13 +590,18 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ .apply_uV = 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 = {
+@@ -403,7 +642,6 @@ static struct platform_device gta02_nor_flash = {
+ .num_resources = 1,
+ };
+
+-
+ struct platform_device s3c24xx_pwm_device = {
+ .name = "s3c24xx_pwm",
+ .num_resources = 0,
+@@ -449,6 +687,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,
+ };
+
+
+@@ -506,6 +745,273 @@ static struct platform_device gta02_buttons_device = {
+ },
+ };
+
++/* 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)
+ {
+ s3c24xx_init_io(gta02_iodesc, ARRAY_SIZE(gta02_iodesc));
+@@ -523,19 +1029,30 @@ 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,
+ &samsung_asoc_dma,
+ &s3c_device_i2c0,
+ &gta02_dfbmcs320_device,
+ &gta02_buttons_device,
++ &gta02_leds_device,
++ &gta02_pwm_leds_device,
+ &s3c_device_adc,
+ &s3c_device_ts,
++ &gta02_pm_bt_dev,
++ &gta02_pm_gps_dev,
++ &gta02_pm_wlan_dev,
++ &gta02_glamo_dev,
+ };
+
+ /* These guys DO need to be children of PMU. */
+
+ static struct platform_device *gta02_devices_pmu_children[] = {
++ &gta02_hdq_device,
++ &gta02_platform_bat,
+ };
+
+
+@@ -568,11 +1085,118 @@ 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_glamo_gpio_children[] = {
++ &spigpio_device,
++};
++
++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 = "glamo-gpio.0",
++ .num_children = ARRAY_SIZE(gta02_glamo_gpio_children),
++ .children = gta02_glamo_gpio_children,
++ },
++ {
++ .dev_name = "pcf50633-gpio",
++ .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 __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);
++
+ s3c_pm_init();
+
+ #ifdef CONFIG_CHARGER_PCF50633
+@@ -584,10 +1208,13 @@ static void __init gta02_machine_init(void)
+ 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;
+
+ regulator_has_full_constraints();
+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 ec087d6..3256861 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 9aee7e1..1317f04 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>
+@@ -39,9 +41,20 @@ s3c_irq_mask(struct irq_data *data)
+ unsigned int irqno = data->irq - IRQ_EINT0;
+ unsigned long mask;
+
++#ifdef CONFIG_S3C2440_C_FIQ
++ unsigned long flags;
++
++ 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
+@@ -58,9 +71,19 @@ s3c_irq_maskack(struct irq_data *data)
+ {
+ unsigned long bitval = 1UL << (data->irq - 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 +95,25 @@ s3c_irq_unmask(struct irq_data *data)
+ {
+ unsigned int irqno = data->irq;
+ 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 = {
+@@ -553,26 +586,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;
+ }
+
+@@ -624,14 +657,14 @@ void __init s3c24xx_init_irq(void)
+ for (irqno = IRQ_EINT0; irqno <= IRQ_EINT3; irqno++) {
+ irqdbf("registering irq %d (ext int)\n", irqno);
+ irq_set_chip_and_handler(irqno, &s3c_irq_eint0t4,
+- handle_edge_irq);
++ 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);
+ irq_set_chip_and_handler(irqno, &s3c_irqext_chip,
+- handle_edge_irq);
++ 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/drivers/Kconfig b/drivers/Kconfig
+index 177c7d1..14e9dd6 100644
+--- a/drivers/Kconfig
++++ b/drivers/Kconfig
+@@ -116,6 +116,8 @@ source "drivers/staging/Kconfig"
+
+ source "drivers/platform/Kconfig"
+
++source "drivers/ar6000/Kconfig"
++
+ source "drivers/clk/Kconfig"
+
+ source "drivers/hwspinlock/Kconfig"
+diff --git a/drivers/Makefile b/drivers/Makefile
+index 3f135b6..1077025 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_ADDPMKID | IW_PRIV_SIZE_FIXED, 0, "addpmkid"},
++};
++
++void ar6000_ioctl_iwsetup(struct iw_handler_def *def)
++{
++ def->private_args = (struct iw_priv_args *)ar6000_priv_args;
++ def->num_private_args = ARRAY_SIZE(ar6000_priv_args);
++}
++
++struct iw_handler_def ath_iw_handler_def = {
++ .standard = (iw_handler *)ath_handlers,
++ .num_standard = ARRAY_SIZE(ath_handlers),
++ .private = (iw_handler *)ath_priv_handlers,
++ .num_private = ARRAY_SIZE(ath_priv_handlers),
++};
++
++
+diff --git a/drivers/ar6000/bmi/bmi.c b/drivers/ar6000/bmi/bmi.c
+new file mode 100644
+index 0000000..d7b610c
+--- /dev/null
++++ b/drivers/ar6000/bmi/bmi.c
+@@ -0,0 +1,657 @@
++/*
++ * 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 "hif.h"
++#include "bmi.h"
++#include "htc_api.h"
++#include "bmi_internal.h"
++
++/*
++Although we had envisioned BMI to run on top of HTC, this is not what the
++final implementation boiled down to on dragon. Its a part of BSP and does
++not use the HTC protocol either. On the host side, however, we were still
++living with the original idea. I think the time has come to accept the truth
++and separate it from HTC which has been carrying BMI's burden all this while.
++It shall make HTC state machine relatively simpler
++*/
++
++/* APIs visible to the driver */
++void
++BMIInit(void)
++{
++ bmiDone = FALSE;
++}
++
++A_STATUS
++BMIDone(HIF_DEVICE *device)
++{
++ A_STATUS status;
++ A_UINT32 cid;
++
++ if (bmiDone) {
++ AR_DEBUG_PRINTF (ATH_DEBUG_BMI, ("BMIDone skipped\n"));
++ return A_OK;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI Done: Enter (device: 0x%p)\n", device));
++ bmiDone = TRUE;
++ cid = BMI_DONE;
++
++ status = bmiBufferSend(device, (A_UCHAR *)&cid, sizeof(cid));
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
++ return A_ERROR;
++ }
++ AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI Done: Exit\n"));
++
++ return A_OK;
++}
++
++A_STATUS
++BMIGetTargetInfo(HIF_DEVICE *device, struct bmi_target_info *targ_info)
++{
++ A_STATUS status;
++ A_UINT32 cid;
++
++ if (bmiDone) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Command disallowed\n"));
++ return A_ERROR;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI Get Target Info: Enter (device: 0x%p)\n", device));
++ cid = BMI_GET_TARGET_INFO;
++
++ status = bmiBufferSend(device, (A_UCHAR *)&cid, sizeof(cid));
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
++ return A_ERROR;
++ }
++
++ status = bmiBufferReceive(device, (A_UCHAR *)&targ_info->target_ver,
++ sizeof(targ_info->target_ver));
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read Target Version from the device\n"));
++ return A_ERROR;
++ }
++
++ if (targ_info->target_ver == TARGET_VERSION_SENTINAL) {
++ /* Determine how many bytes are in the Target's targ_info */
++ status = bmiBufferReceive(device, (A_UCHAR *)&targ_info->target_info_byte_count,
++ sizeof(targ_info->target_info_byte_count));
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read Target Info Byte Count from the device\n"));
++ return A_ERROR;
++ }
++
++ /*
++ * The Target's targ_info doesn't match the Host's targ_info.
++ * We need to do some backwards compatibility work to make this OK.
++ */
++ A_ASSERT(targ_info->target_info_byte_count == sizeof(*targ_info));
++
++ /* Read the remainder of the targ_info */
++ status = bmiBufferReceive(device,
++ ((A_UCHAR *)targ_info)+sizeof(targ_info->target_info_byte_count),
++ sizeof(*targ_info)-sizeof(targ_info->target_info_byte_count));
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read Target Info (%d bytes) from the device\n",
++ targ_info->target_info_byte_count));
++ return A_ERROR;
++ }
++ } else {
++ /*
++ * Target must be an AR6001 whose firmware does not
++ * support BMI_GET_TARGET_INFO. Construct the data
++ * that it would have sent.
++ */
++ targ_info->target_info_byte_count = sizeof(targ_info);
++ targ_info->target_type = TARGET_TYPE_AR6001;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI Get Target Info: Exit (ver: 0x%x type: 0x%x)\n",
++ targ_info->target_ver, targ_info->target_type));
++ printk("BMI Get Target Info: Exit (ver: 0x%x type: 0x%x)\n",
++ targ_info->target_ver, targ_info->target_type);
++
++ return A_OK;
++}
++
++A_STATUS
++BMIReadMemory(HIF_DEVICE *device,
++ A_UINT32 address,
++ A_UCHAR *buffer,
++ A_UINT32 length)
++{
++ A_UINT32 cid;
++ A_STATUS status;
++ A_UINT32 offset;
++ A_UINT32 remaining, rxlen;
++ static A_UCHAR data[BMI_DATASZ_MAX + sizeof(cid) + sizeof(address) + sizeof(length)];
++ memset (&data, 0, BMI_DATASZ_MAX + sizeof(cid) + sizeof(address) + sizeof(length));
++
++ if (bmiDone) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Command disallowed\n"));
++ return A_ERROR;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_BMI,
++ ("BMI Read Memory: Enter (device: 0x%p, address: 0x%x, length: %d)\n",
++ device, address, length));
++
++ cid = BMI_READ_MEMORY;
++
++ remaining = length;
++
++ while (remaining)
++ {
++ rxlen = (remaining < BMI_DATASZ_MAX) ? remaining : BMI_DATASZ_MAX;
++ offset = 0;
++ A_MEMCPY(&data[offset], &cid, sizeof(cid));
++ offset += sizeof(cid);
++ A_MEMCPY(&data[offset], &address, sizeof(address));
++ offset += sizeof(address);
++ A_MEMCPY(&data[offset], &rxlen, sizeof(rxlen));
++ offset += sizeof(length);
++
++ status = bmiBufferSend(device, data, offset);
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
++ return A_ERROR;
++ }
++ status = bmiBufferReceive(device, data, rxlen);
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n"));
++ return A_ERROR;
++ }
++ A_MEMCPY(&buffer[length - remaining], data, rxlen);
++ remaining -= rxlen; address += rxlen;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI Read Memory: Exit\n"));
++ return A_OK;
++}
++
++A_STATUS
++BMIWriteMemory(HIF_DEVICE *device,
++ A_UINT32 address,
++ A_UCHAR *buffer,
++ A_UINT32 length)
++{
++ A_UINT32 cid;
++ A_STATUS status;
++ A_UINT32 offset;
++ A_UINT32 remaining, txlen;
++ const A_UINT32 header = sizeof(cid) + sizeof(address) + sizeof(length);
++ static A_UCHAR data[BMI_DATASZ_MAX + sizeof(cid) + sizeof(address) + sizeof(length)];
++ memset (&data, 0, header);
++
++ if (bmiDone) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Command disallowed\n"));
++ return A_ERROR;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_BMI,
++ ("BMI Write Memory: Enter (device: 0x%p, address: 0x%x, length: %d)\n",
++ device, address, length));
++
++ cid = BMI_WRITE_MEMORY;
++
++ remaining = length;
++ while (remaining)
++ {
++ txlen = (remaining < (BMI_DATASZ_MAX - header)) ?
++ remaining : (BMI_DATASZ_MAX - header);
++ offset = 0;
++ A_MEMCPY(&data[offset], &cid, sizeof(cid));
++ offset += sizeof(cid);
++ A_MEMCPY(&data[offset], &address, sizeof(address));
++ offset += sizeof(address);
++ A_MEMCPY(&data[offset], &txlen, sizeof(txlen));
++ offset += sizeof(txlen);
++ A_MEMCPY(&data[offset], &buffer[length - remaining], txlen);
++ offset += txlen;
++ status = bmiBufferSend(device, data, offset);
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
++ return A_ERROR;
++ }
++ remaining -= txlen; address += txlen;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI Write Memory: Exit\n"));
++
++ return A_OK;
++}
++
++A_STATUS
++BMIExecute(HIF_DEVICE *device,
++ A_UINT32 address,
++ A_UINT32 *param)
++{
++ A_UINT32 cid;
++ A_STATUS status;
++ A_UINT32 offset;
++ static A_UCHAR data[sizeof(cid) + sizeof(address) + sizeof(*param)];
++ memset (&data, 0, sizeof(cid) + sizeof(address) + sizeof(*param));
++
++ if (bmiDone) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Command disallowed\n"));
++ return A_ERROR;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_BMI,
++ ("BMI Execute: Enter (device: 0x%p, address: 0x%x, param: %d)\n",
++ device, address, *param));
++
++ cid = BMI_EXECUTE;
++
++ offset = 0;
++ A_MEMCPY(&data[offset], &cid, sizeof(cid));
++ offset += sizeof(cid);
++ A_MEMCPY(&data[offset], &address, sizeof(address));
++ offset += sizeof(address);
++ A_MEMCPY(&data[offset], param, sizeof(*param));
++ offset += sizeof(*param);
++ status = bmiBufferSend(device, data, offset);
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
++ return A_ERROR;
++ }
++
++ status = bmiBufferReceive(device, data, sizeof(*param));
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n"));
++ return A_ERROR;
++ }
++
++ A_MEMCPY(param, data, sizeof(*param));
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI Execute: Exit (param: %d)\n", *param));
++ return A_OK;
++}
++
++A_STATUS
++BMISetAppStart(HIF_DEVICE *device,
++ A_UINT32 address)
++{
++ A_UINT32 cid;
++ A_STATUS status;
++ A_UINT32 offset;
++ static A_UCHAR data[sizeof(cid) + sizeof(address)];
++ memset (&data, 0, sizeof(cid) + sizeof(address));
++
++ if (bmiDone) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Command disallowed\n"));
++ return A_ERROR;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_BMI,
++ ("BMI Set App Start: Enter (device: 0x%p, address: 0x%x)\n",
++ device, address));
++
++ cid = BMI_SET_APP_START;
++
++ offset = 0;
++ A_MEMCPY(&data[offset], &cid, sizeof(cid));
++ offset += sizeof(cid);
++ A_MEMCPY(&data[offset], &address, sizeof(address));
++ offset += sizeof(address);
++ status = bmiBufferSend(device, data, offset);
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
++ return A_ERROR;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI Set App Start: Exit\n"));
++ return A_OK;
++}
++
++A_STATUS
++BMIReadSOCRegister(HIF_DEVICE *device,
++ A_UINT32 address,
++ A_UINT32 *param)
++{
++ A_UINT32 cid;
++ A_STATUS status;
++ A_UINT32 offset;
++ static A_UCHAR data[sizeof(cid) + sizeof(address)];
++ memset (&data, 0, sizeof(cid) + sizeof(address));
++
++ if (bmiDone) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Command disallowed\n"));
++ return A_ERROR;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_BMI,
++ ("BMI Read SOC Register: Enter (device: 0x%p, address: 0x%x)\n",
++ device, address));
++
++ cid = BMI_READ_SOC_REGISTER;
++
++ offset = 0;
++ A_MEMCPY(&data[offset], &cid, sizeof(cid));
++ offset += sizeof(cid);
++ A_MEMCPY(&data[offset], &address, sizeof(address));
++ offset += sizeof(address);
++
++ status = bmiBufferSend(device, data, offset);
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
++ return A_ERROR;
++ }
++
++ status = bmiBufferReceive(device, data, sizeof(*param));
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n"));
++ return A_ERROR;
++ }
++ A_MEMCPY(param, data, sizeof(*param));
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI Read SOC Register: Exit (value: %d)\n", *param));
++ return A_OK;
++}
++
++A_STATUS
++BMIWriteSOCRegister(HIF_DEVICE *device,
++ A_UINT32 address,
++ A_UINT32 param)
++{
++ A_UINT32 cid;
++ A_STATUS status;
++ A_UINT32 offset;
++ static A_UCHAR data[sizeof(cid) + sizeof(address) + sizeof(param)];
++
++ memset (&data, 0, sizeof(cid) + sizeof(address) + sizeof(param));
++
++ if (bmiDone) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Command disallowed\n"));
++ return A_ERROR;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_BMI,
++ ("BMI Write SOC Register: Enter (device: 0x%p, address: 0x%x, param: %d)\n",
++ device, address, param));
++
++ cid = BMI_WRITE_SOC_REGISTER;
++
++ offset = 0;
++ A_MEMCPY(&data[offset], &cid, sizeof(cid));
++ offset += sizeof(cid);
++ A_MEMCPY(&data[offset], &address, sizeof(address));
++ offset += sizeof(address);
++ A_MEMCPY(&data[offset], &param, sizeof(param));
++ offset += sizeof(param);
++ status = bmiBufferSend(device, data, offset);
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
++ return A_ERROR;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI Read SOC Register: Exit\n"));
++ return A_OK;
++}
++
++A_STATUS
++BMIrompatchInstall(HIF_DEVICE *device,
++ A_UINT32 ROM_addr,
++ A_UINT32 RAM_addr,
++ A_UINT32 nbytes,
++ A_UINT32 do_activate,
++ A_UINT32 *rompatch_id)
++{
++ A_UINT32 cid;
++ A_STATUS status;
++ A_UINT32 offset;
++ static A_UCHAR data[sizeof(cid) + sizeof(ROM_addr) + sizeof(RAM_addr) +
++ sizeof(nbytes) + sizeof(do_activate)];
++
++ memset (&data, 0, sizeof(cid) + sizeof(ROM_addr) + sizeof(RAM_addr) +
++ sizeof(nbytes) + sizeof(do_activate));
++
++ if (bmiDone) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Command disallowed\n"));
++ return A_ERROR;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_BMI,
++ ("BMI rompatch Install: Enter (device: 0x%p, ROMaddr: 0x%x, RAMaddr: 0x%x length: %d activate: %d)\n",
++ device, ROM_addr, RAM_addr, nbytes, do_activate));
++
++ cid = BMI_ROMPATCH_INSTALL;
++
++ offset = 0;
++ A_MEMCPY(&data[offset], &cid, sizeof(cid));
++ offset += sizeof(cid);
++ A_MEMCPY(&data[offset], &ROM_addr, sizeof(ROM_addr));
++ offset += sizeof(ROM_addr);
++ A_MEMCPY(&data[offset], &RAM_addr, sizeof(RAM_addr));
++ offset += sizeof(RAM_addr);
++ A_MEMCPY(&data[offset], &nbytes, sizeof(nbytes));
++ offset += sizeof(nbytes);
++ A_MEMCPY(&data[offset], &do_activate, sizeof(do_activate));
++ offset += sizeof(do_activate);
++ status = bmiBufferSend(device, data, offset);
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
++ return A_ERROR;
++ }
++
++ status = bmiBufferReceive(device, (A_UCHAR *)rompatch_id, sizeof(*rompatch_id));
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n"));
++ return A_ERROR;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI rompatch Install: (rompatch_id=%d)\n", *rompatch_id));
++ return A_OK;
++}
++
++A_STATUS
++BMIrompatchUninstall(HIF_DEVICE *device,
++ A_UINT32 rompatch_id)
++{
++ A_UINT32 cid;
++ A_STATUS status;
++ A_UINT32 offset;
++ static A_UCHAR data[sizeof(cid) + sizeof(rompatch_id)];
++ memset (&data, 0, sizeof(cid) + sizeof(rompatch_id));
++
++ if (bmiDone) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Command disallowed\n"));
++ return A_ERROR;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_BMI,
++ ("BMI rompatch Uninstall: Enter (device: 0x%p, rompatch_id: %d)\n",
++ device, rompatch_id));
++
++ cid = BMI_ROMPATCH_UNINSTALL;
++
++ offset = 0;
++ A_MEMCPY(&data[offset], &cid, sizeof(cid));
++ offset += sizeof(cid);
++ A_MEMCPY(&data[offset], &rompatch_id, sizeof(rompatch_id));
++ offset += sizeof(rompatch_id);
++ status = bmiBufferSend(device, data, offset);
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
++ return A_ERROR;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI rompatch UNinstall: (rompatch_id=0x%x)\n", rompatch_id));
++ return A_OK;
++}
++
++static A_STATUS
++_BMIrompatchChangeActivation(HIF_DEVICE *device,
++ A_UINT32 rompatch_count,
++ A_UINT32 *rompatch_list,
++ A_UINT32 do_activate)
++{
++ A_UINT32 cid;
++ A_STATUS status;
++ A_UINT32 offset;
++ static A_UCHAR data[BMI_DATASZ_MAX + sizeof(cid) + sizeof(rompatch_count)];
++ A_UINT32 length;
++
++ memset (&data, 0, BMI_DATASZ_MAX + sizeof(cid) + sizeof(rompatch_count));
++
++ if (bmiDone) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Command disallowed\n"));
++ return A_ERROR;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_BMI,
++ ("BMI Change rompatch Activation: Enter (device: 0x%p, count: %d)\n",
++ device, rompatch_count));
++
++ cid = do_activate ? BMI_ROMPATCH_ACTIVATE : BMI_ROMPATCH_DEACTIVATE;
++
++ offset = 0;
++ A_MEMCPY(&data[offset], &cid, sizeof(cid));
++ offset += sizeof(cid);
++ A_MEMCPY(&data[offset], &rompatch_count, sizeof(rompatch_count));
++ offset += sizeof(rompatch_count);
++ length = rompatch_count * sizeof(*rompatch_list);
++ A_MEMCPY(&data[offset], rompatch_list, length);
++ offset += length;
++ status = bmiBufferSend(device, data, offset);
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
++ return A_ERROR;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI Change rompatch Activation: Exit\n"));
++
++ return A_OK;
++}
++
++A_STATUS
++BMIrompatchActivate(HIF_DEVICE *device,
++ A_UINT32 rompatch_count,
++ A_UINT32 *rompatch_list)
++{
++ return _BMIrompatchChangeActivation(device, rompatch_count, rompatch_list, 1);
++}
++
++A_STATUS
++BMIrompatchDeactivate(HIF_DEVICE *device,
++ A_UINT32 rompatch_count,
++ A_UINT32 *rompatch_list)
++{
++ return _BMIrompatchChangeActivation(device, rompatch_count, rompatch_list, 0);
++}
++
++/* BMI Access routines */
++A_STATUS
++bmiBufferSend(HIF_DEVICE *device,
++ A_UCHAR *buffer,
++ A_UINT32 length)
++{
++ A_STATUS status;
++ A_UINT32 timeout;
++ A_UINT32 address;
++ static A_UINT32 cmdCredits;
++ A_UINT32 mboxAddress[HTC_MAILBOX_NUM_MAX];
++
++ HIFConfigureDevice(device, HIF_DEVICE_GET_MBOX_ADDR,
++ &mboxAddress, sizeof(mboxAddress));
++
++ cmdCredits = 0;
++ timeout = BMI_COMMUNICATION_TIMEOUT;
++
++ while(timeout-- && !cmdCredits) {
++ /* Read the counter register to get the command credits */
++ address = COUNT_DEC_ADDRESS + (HTC_MAILBOX_NUM_MAX + ENDPOINT1) * 4;
++ /* hit the credit counter with a 4-byte access, the first byte read will hit the counter and cause
++ * a decrement, while the remaining 3 bytes has no effect. The rationale behind this is to
++ * make all HIF accesses 4-byte aligned */
++ status = HIFReadWrite(device, address, (A_UINT8 *)&cmdCredits, 4,
++ HIF_RD_SYNC_BYTE_INC, NULL);
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to decrement the command credit count register\n"));
++ return A_ERROR;
++ }
++ /* the counter is only 8=bits, ignore anything in the upper 3 bytes */
++ cmdCredits &= 0xFF;
++ }
++
++ if (cmdCredits) {
++ address = mboxAddress[ENDPOINT1];
++ status = HIFReadWrite(device, address, buffer, length,
++ HIF_WR_SYNC_BYTE_INC, NULL);
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to send the BMI data to the device\n"));
++ return A_ERROR;
++ }
++ } else {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("BMI Communication timeout\n"));
++ return A_ERROR;
++ }
++
++ return status;
++}
++
++A_STATUS
++bmiBufferReceive(HIF_DEVICE *device,
++ A_UCHAR *buffer,
++ A_UINT32 length)
++{
++ A_STATUS status;
++ A_UINT32 address;
++ A_UINT32 timeout;
++ static A_UINT32 cmdCredits;
++ A_UINT32 mboxAddress[HTC_MAILBOX_NUM_MAX];
++
++ HIFConfigureDevice(device, HIF_DEVICE_GET_MBOX_ADDR,
++ &mboxAddress, sizeof(mboxAddress));
++
++ cmdCredits = 0;
++ timeout = BMI_COMMUNICATION_TIMEOUT;
++ while(timeout-- && !cmdCredits) {
++ /* Read the counter register to get the command credits */
++ address = COUNT_ADDRESS + (HTC_MAILBOX_NUM_MAX + ENDPOINT1) * 1;
++ /* read the counter using a 4-byte read. Since the counter is NOT auto-decrementing,
++ * we can read this counter multiple times using a non-incrementing address mode.
++ * The rationale here is to make all HIF accesses a multiple of 4 bytes */
++ status = HIFReadWrite(device, address, (A_UINT8 *)&cmdCredits, sizeof(cmdCredits),
++ HIF_RD_SYNC_BYTE_FIX, NULL);
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read the command credit count register\n"));
++ return A_ERROR;
++ }
++ /* we did a 4-byte read to the same count register so mask off upper bytes */
++ cmdCredits &= 0xFF;
++ status = A_ERROR;
++ }
++
++ if (cmdCredits) {
++ address = mboxAddress[ENDPOINT1];
++ status = HIFReadWrite(device, address, buffer, length,
++ HIF_RD_SYNC_BYTE_INC, NULL);
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read the BMI data from the device\n"));
++ return A_ERROR;
++ }
++ } else {
++ AR_DEBUG_PRINTF(ATH_DEBUG_BMI, ("BMI Communication timeout\n"));
++ return A_ERROR;
++ }
++
++ return status;
++}
+diff --git a/drivers/ar6000/bmi/bmi_internal.h b/drivers/ar6000/bmi/bmi_internal.h
+new file mode 100644
+index 0000000..1e21354
+--- /dev/null
++++ b/drivers/ar6000/bmi/bmi_internal.h
+@@ -0,0 +1,45 @@
++#ifndef BMI_INTERNAL_H
++#define BMI_INTERNAL_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.
++ *
++ *
++ *
++ */
++
++#include "a_config.h"
++#include "athdefs.h"
++#include "a_types.h"
++#include "a_osapi.h"
++#include "a_debug.h"
++#include "AR6Khwreg.h"
++#include "bmi_msg.h"
++
++#define BMI_COMMUNICATION_TIMEOUT 100000
++
++/* ------ Global Variable Declarations ------- */
++A_BOOL bmiDone;
++
++A_STATUS
++bmiBufferSend(HIF_DEVICE *device,
++ A_UCHAR *buffer,
++ A_UINT32 length);
++
++A_STATUS
++bmiBufferReceive(HIF_DEVICE *device,
++ A_UCHAR *buffer,
++ A_UINT32 length);
++
++#endif
+diff --git a/drivers/ar6000/hif/hif.c b/drivers/ar6000/hif/hif.c
+new file mode 100644
+index 0000000..d04486c
+--- /dev/null
++++ b/drivers/ar6000/hif/hif.c
+@@ -0,0 +1,824 @@
++/*
++ * @file: hif.c
++ *
++ * @abstract: HIF layer reference implementation for Atheros SDIO stack
++ *
++ * @notice: Copyright (c) 2004-2006 Atheros Communications Inc.
++ *
++ *
++ * 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 "hif_internal.h"
++
++/* ------ Static Variables ------ */
++
++/* ------ Global Variable Declarations ------- */
++SD_PNP_INFO Ids[] = {
++ {
++ .SDIO_ManufacturerID = MANUFACTURER_ID_AR6001_BASE | 0xB,
++ .SDIO_ManufacturerCode = MANUFACTURER_CODE,
++ .SDIO_FunctionClass = FUNCTION_CLASS,
++ .SDIO_FunctionNo = 1
++ },
++ {
++ .SDIO_ManufacturerID = MANUFACTURER_ID_AR6001_BASE | 0xA,
++ .SDIO_ManufacturerCode = MANUFACTURER_CODE,
++ .SDIO_FunctionClass = FUNCTION_CLASS,
++ .SDIO_FunctionNo = 1
++ },
++ {
++ .SDIO_ManufacturerID = MANUFACTURER_ID_AR6001_BASE | 0x9,
++ .SDIO_ManufacturerCode = MANUFACTURER_CODE,
++ .SDIO_FunctionClass = FUNCTION_CLASS,
++ .SDIO_FunctionNo = 1
++ },
++ {
++ .SDIO_ManufacturerID = MANUFACTURER_ID_AR6001_BASE | 0x8,
++ .SDIO_ManufacturerCode = MANUFACTURER_CODE,
++ .SDIO_FunctionClass = FUNCTION_CLASS,
++ .SDIO_FunctionNo = 1
++ },
++ {
++ .SDIO_ManufacturerID = MANUFACTURER_ID_AR6002_BASE | 0x0,
++ .SDIO_ManufacturerCode = MANUFACTURER_CODE,
++ .SDIO_FunctionClass = FUNCTION_CLASS,
++ .SDIO_FunctionNo = 1
++ },
++ {
++ .SDIO_ManufacturerID = MANUFACTURER_ID_AR6002_BASE | 0x1,
++ .SDIO_ManufacturerCode = MANUFACTURER_CODE,
++ .SDIO_FunctionClass = FUNCTION_CLASS,
++ .SDIO_FunctionNo = 1
++ },
++ {
++ } //list is null termintaed
++};
++
++TARGET_FUNCTION_CONTEXT FunctionContext = {
++ .function.Version = CT_SDIO_STACK_VERSION_CODE,
++ .function.pName = "sdio_wlan",
++ .function.MaxDevices = 1,
++ .function.NumDevices = 0,
++ .function.pIds = Ids,
++ .function.pProbe = hifDeviceInserted,
++ .function.pRemove = hifDeviceRemoved,
++ .function.pSuspend = NULL,
++ .function.pResume = NULL,
++ .function.pWake = NULL,
++ .function.pContext = &FunctionContext,
++};
++
++HIF_DEVICE hifDevice[HIF_MAX_DEVICES];
++HTC_CALLBACKS htcCallbacks;
++BUS_REQUEST busRequest[BUS_REQUEST_MAX_NUM];
++static BUS_REQUEST *s_busRequestFreeQueue = NULL;
++OS_CRITICALSECTION lock;
++extern A_UINT32 onebitmode;
++extern A_UINT32 busspeedlow;
++
++#ifdef DEBUG
++extern A_UINT32 debughif;
++#define ATH_DEBUG_ERROR 1
++#define ATH_DEBUG_WARN 2
++#define ATH_DEBUG_TRACE 3
++#define _AR_DEBUG_PRINTX_ARG(arg...) arg
++#define AR_DEBUG_PRINTF(lvl, args)\
++ {if (lvl <= debughif)\
++ A_PRINTF(KERN_ALERT _AR_DEBUG_PRINTX_ARG args);\
++ }
++#else
++#define AR_DEBUG_PRINTF(lvl, args)
++#endif
++
++static BUS_REQUEST *hifAllocateBusRequest(void);
++static void hifFreeBusRequest(BUS_REQUEST *busrequest);
++static THREAD_RETURN insert_helper_func(POSKERNEL_HELPER pHelper);
++static void ResetAllCards(void);
++
++/* ------ Functions ------ */
++int HIFInit(HTC_CALLBACKS *callbacks)
++{
++ SDIO_STATUS status;
++ DBG_ASSERT(callbacks != NULL);
++
++ /* Store the callback and event handlers */
++ htcCallbacks.deviceInsertedHandler = callbacks->deviceInsertedHandler;
++ htcCallbacks.deviceRemovedHandler = callbacks->deviceRemovedHandler;
++ htcCallbacks.deviceSuspendHandler = callbacks->deviceSuspendHandler;
++ htcCallbacks.deviceResumeHandler = callbacks->deviceResumeHandler;
++ htcCallbacks.deviceWakeupHandler = callbacks->deviceWakeupHandler;
++ htcCallbacks.rwCompletionHandler = callbacks->rwCompletionHandler;
++ htcCallbacks.dsrHandler = callbacks->dsrHandler;
++
++ CriticalSectionInit(&lock);
++
++ /* Register with bus driver core */
++ status = SDIO_RegisterFunction(&FunctionContext.function);
++ DBG_ASSERT(SDIO_SUCCESS(status));
++
++ return(0);
++}
++
++A_STATUS
++HIFReadWrite(HIF_DEVICE *device,
++ A_UINT32 address,
++ A_UCHAR *buffer,
++ A_UINT32 length,
++ A_UINT32 request,
++ void *context)
++{
++ A_UINT8 rw;
++ A_UINT8 mode;
++ A_UINT8 funcNo;
++ A_UINT8 opcode;
++ A_UINT16 count;
++ SDREQUEST *sdrequest;
++ SDIO_STATUS sdiostatus;
++ BUS_REQUEST *busrequest;
++ A_STATUS status = A_OK;
++
++ DBG_ASSERT(device != NULL);
++ DBG_ASSERT(device->handle != NULL);
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("Device: %p\n", device));
++
++ do {
++ busrequest = hifAllocateBusRequest();
++ if (busrequest == NULL) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("HIF Unable to allocate bus request\n"));
++ status = A_NO_RESOURCE;
++ break;
++ }
++
++ sdrequest = busrequest->request;
++ busrequest->context = context;
++
++ sdrequest->pDataBuffer = buffer;
++ if (request & HIF_SYNCHRONOUS) {
++ sdrequest->Flags = SDREQ_FLAGS_RESP_SDIO_R5 | SDREQ_FLAGS_DATA_TRANS;
++ sdrequest->pCompleteContext = NULL;
++ sdrequest->pCompletion = NULL;
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("Execution mode: Synchronous\n"));
++ } else if (request & HIF_ASYNCHRONOUS) {
++ sdrequest->Flags = SDREQ_FLAGS_RESP_SDIO_R5 | SDREQ_FLAGS_DATA_TRANS |
++ SDREQ_FLAGS_TRANS_ASYNC;
++ sdrequest->pCompleteContext = busrequest;
++ sdrequest->pCompletion = hifRWCompletionHandler;
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("Execution mode: Asynchronous\n"));
++ } else {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERROR,
++ ("Invalid execution mode: 0x%08x\n", request));
++ status = A_EINVAL;
++ break;
++ }
++
++ if (request & HIF_EXTENDED_IO) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("Command type: CMD53\n"));
++ sdrequest->Command = CMD53;
++ } else {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERROR,
++ ("Invalid command type: 0x%08x\n", request));
++ status = A_EINVAL;
++ break;
++ }
++
++ if (request & HIF_BLOCK_BASIS) {
++ mode = CMD53_BLOCK_BASIS;
++ sdrequest->BlockLen = HIF_MBOX_BLOCK_SIZE;
++ sdrequest->BlockCount = length / HIF_MBOX_BLOCK_SIZE;
++ count = sdrequest->BlockCount;
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE,
++ ("Block mode (BlockLen: %d, BlockCount: %d)\n",
++ sdrequest->BlockLen, sdrequest->BlockCount));
++ } else if (request & HIF_BYTE_BASIS) {
++ mode = CMD53_BYTE_BASIS;
++ sdrequest->BlockLen = length;
++ sdrequest->BlockCount = 1;
++ count = sdrequest->BlockLen;
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE,
++ ("Byte mode (BlockLen: %d, BlockCount: %d)\n",
++ sdrequest->BlockLen, sdrequest->BlockCount));
++ } else {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERROR,
++ ("Invalid data mode: 0x%08x\n", request));
++ status = A_EINVAL;
++ break;
++ }
++
++#if 0
++ /* useful for checking register accesses */
++ if (length & 0x3) {
++ A_PRINTF(KERN_ALERT"HIF (%s) is not a multiple of 4 bytes, addr:0x%X, len:%d\n",
++ request & HIF_WRITE ? "write":"read", address, length);
++ }
++#endif
++
++ if ((address >= HIF_MBOX_START_ADDR(0)) &&
++ (address <= HIF_MBOX_END_ADDR(3)))
++ {
++
++ DBG_ASSERT(length <= HIF_MBOX_WIDTH);
++
++ /*
++ * Mailbox write. Adjust the address so that the last byte
++ * falls on the EOM address.
++ */
++ address += (HIF_MBOX_WIDTH - length);
++ }
++
++
++
++ if (request & HIF_WRITE) {
++ rw = CMD53_WRITE;
++ sdrequest->Flags |= SDREQ_FLAGS_DATA_WRITE;
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("Direction: Write\n"));
++ } else if (request & HIF_READ) {
++ rw = CMD53_READ;
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("Direction: Read\n"));
++ } else {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERROR,
++ ("Invalid direction: 0x%08x\n", request));
++ status = A_EINVAL;
++ break;
++ }
++
++ if (request & HIF_FIXED_ADDRESS) {
++ opcode = CMD53_FIXED_ADDRESS;
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("Address mode: Fixed\n"));
++ } else if (request & HIF_INCREMENTAL_ADDRESS) {
++ opcode = CMD53_INCR_ADDRESS;
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("Address mode: Incremental\n"));
++ } else {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERROR,
++ ("Invalid address mode: 0x%08x\n", request));
++ status = A_EINVAL;
++ break;
++ }
++
++ funcNo = SDDEVICE_GET_SDIO_FUNCNO(device->handle);
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("Function number: %d\n", funcNo));
++ SDIO_SET_CMD53_ARG(sdrequest->Argument, rw, funcNo,
++ mode, opcode, address, count);
++
++ /* Send the command out */
++ sdiostatus = SDDEVICE_CALL_REQUEST_FUNC(device->handle, sdrequest);
++
++ if (!SDIO_SUCCESS(sdiostatus)) {
++ status = A_ERROR;
++ }
++
++ } while (FALSE);
++
++ if (A_FAILED(status) || (request & HIF_SYNCHRONOUS)) {
++ if (busrequest != NULL) {
++ hifFreeBusRequest(busrequest);
++ }
++ }
++
++ if (A_FAILED(status) && (request & HIF_ASYNCHRONOUS)) {
++ /* call back async handler on failure */
++ htcCallbacks.rwCompletionHandler(context, status);
++ }
++
++ return status;
++}
++
++A_STATUS
++HIFConfigureDevice(HIF_DEVICE *device, HIF_DEVICE_CONFIG_OPCODE opcode,
++ void *config, A_UINT32 configLen)
++{
++ A_UINT32 count;
++
++ switch(opcode) {
++ case HIF_DEVICE_GET_MBOX_BLOCK_SIZE:
++ ((A_UINT32 *)config)[0] = HIF_MBOX0_BLOCK_SIZE;
++ ((A_UINT32 *)config)[1] = HIF_MBOX1_BLOCK_SIZE;
++ ((A_UINT32 *)config)[2] = HIF_MBOX2_BLOCK_SIZE;
++ ((A_UINT32 *)config)[3] = HIF_MBOX3_BLOCK_SIZE;
++ break;
++
++ case HIF_DEVICE_GET_MBOX_ADDR:
++ for (count = 0; count < 4; count ++) {
++ ((A_UINT32 *)config)[count] = HIF_MBOX_START_ADDR(count);
++ }
++ break;
++ case HIF_DEVICE_GET_IRQ_PROC_MODE:
++ /* the SDIO stack allows the interrupts to be processed either way, ASYNC or SYNC */
++ *((HIF_DEVICE_IRQ_PROCESSING_MODE *)config) = HIF_DEVICE_IRQ_ASYNC_SYNC;
++ break;
++ default:
++ AR_DEBUG_PRINTF(ATH_DEBUG_WARN,
++ ("Unsupported configuration opcode: %d\n", opcode));
++ return A_ERROR;
++ }
++
++ return A_OK;
++}
++
++void
++HIFShutDownDevice(HIF_DEVICE *device)
++{
++ A_UINT8 data;
++ A_UINT32 count;
++ SDIO_STATUS status;
++ SDCONFIG_BUS_MODE_DATA busSettings;
++ SDCONFIG_FUNC_ENABLE_DISABLE_DATA fData;
++
++ if (device != NULL) {
++ DBG_ASSERT(device->handle != NULL);
++
++ /* Remove the allocated current if any */
++ status = SDLIB_IssueConfig(device->handle,
++ SDCONFIG_FUNC_FREE_SLOT_CURRENT, NULL, 0);
++ DBG_ASSERT(SDIO_SUCCESS(status));
++
++ /* Disable the card */
++ fData.EnableFlags = SDCONFIG_DISABLE_FUNC;
++ fData.TimeOut = 1;
++ status = SDLIB_IssueConfig(device->handle, SDCONFIG_FUNC_ENABLE_DISABLE,
++ &fData, sizeof(fData));
++ DBG_ASSERT(SDIO_SUCCESS(status));
++
++ /* Perform a soft I/O reset */
++ data = SDIO_IO_RESET;
++ status = SDLIB_IssueCMD52(device->handle, 0, SDIO_IO_ABORT_REG,
++ &data, 1, 1);
++ DBG_ASSERT(SDIO_SUCCESS(status));
++
++ /*
++ * WAR - Codetelligence driver does not seem to shutdown correctly in 1
++ * bit mode. By default it configures the HC in the 4 bit. Its later in
++ * our driver that we switch to 1 bit mode. If we try to shutdown, the
++ * driver hangs so we revert to 4 bit mode, to be transparent to the
++ * underlying bus driver.
++ */
++ if (onebitmode) {
++ ZERO_OBJECT(busSettings);
++ busSettings.BusModeFlags = SDDEVICE_GET_BUSMODE_FLAGS(device->handle);
++ SDCONFIG_SET_BUS_WIDTH(busSettings.BusModeFlags,
++ SDCONFIG_BUS_WIDTH_4_BIT);
++
++ /* Issue config request to change the bus width to 4 bit */
++ status = SDLIB_IssueConfig(device->handle, SDCONFIG_BUS_MODE_CTRL,
++ &busSettings,
++ sizeof(SDCONFIG_BUS_MODE_DATA));
++ DBG_ASSERT(SDIO_SUCCESS(status));
++ }
++
++ /* Free the bus requests */
++ for (count = 0; count < BUS_REQUEST_MAX_NUM; count ++) {
++ SDDeviceFreeRequest(device->handle, busRequest[count].request);
++ }
++ /* Clean up the queue */
++ s_busRequestFreeQueue = NULL;
++ } else {
++ /* since we are unloading the driver anyways, reset all cards in case the SDIO card
++ * is externally powered and we are unloading the SDIO stack. This avoids the problem when
++ * the SDIO stack is reloaded and attempts are made to re-enumerate a card that is already
++ * enumerated */
++ ResetAllCards();
++ /* Unregister with bus driver core */
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE,
++ ("Unregistering with the bus driver\n"));
++ status = SDIO_UnregisterFunction(&FunctionContext.function);
++ DBG_ASSERT(SDIO_SUCCESS(status));
++ }
++}
++
++void
++hifRWCompletionHandler(SDREQUEST *request)
++{
++ A_STATUS status;
++ void *context;
++ BUS_REQUEST *busrequest;
++
++ if (SDIO_SUCCESS(request->Status)) {
++ status = A_OK;
++ } else {
++ status = A_ERROR;
++ }
++
++ DBG_ASSERT(status == A_OK);
++ busrequest = (BUS_REQUEST *) request->pCompleteContext;
++ context = (void *) busrequest->context;
++ /* free the request before calling the callback, in case the
++ * callback submits another request, this guarantees that
++ * there is at least 1 free request available everytime the callback
++ * is invoked */
++ hifFreeBusRequest(busrequest);
++ htcCallbacks.rwCompletionHandler(context, status);
++}
++
++void
++hifIRQHandler(void *context)
++{
++ A_STATUS status;
++ HIF_DEVICE *device;
++
++ device = (HIF_DEVICE *)context;
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("Device: %p\n", device));
++ status = htcCallbacks.dsrHandler(device->htc_handle);
++ DBG_ASSERT(status == A_OK);
++}
++
++BOOL
++hifDeviceInserted(SDFUNCTION *function, SDDEVICE *handle)
++{
++ BOOL enabled;
++ A_UINT8 data;
++ A_UINT32 count;
++ HIF_DEVICE *device;
++ SDIO_STATUS status;
++ A_UINT16 maxBlocks;
++ A_UINT16 maxBlockSize;
++ SDCONFIG_BUS_MODE_DATA busSettings;
++ SDCONFIG_FUNC_ENABLE_DISABLE_DATA fData;
++ TARGET_FUNCTION_CONTEXT *functionContext;
++ SDCONFIG_FUNC_SLOT_CURRENT_DATA slotCurrent;
++ SD_BUSCLOCK_RATE currentBusClock;
++
++ DBG_ASSERT(function != NULL);
++ DBG_ASSERT(handle != NULL);
++
++ device = addHifDevice(handle);
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("Device: %p\n", device));
++ functionContext = (TARGET_FUNCTION_CONTEXT *)function->pContext;
++
++ /*
++ * Issue commands to get the manufacturer ID and stuff and compare it
++ * against the rev Id derived from the ID registered during the
++ * initialization process. Report the device only in the case there
++ * is a match. In the case od SDIO, the bus driver has already queried
++ * these details so we just need to use their data structures to get the
++ * relevant values. Infact, the driver has already matched it against
++ * the Ids that we registered with it so we dont need to the step here.
++ */
++
++ /* Configure the SDIO Bus Width */
++ if (onebitmode) {
++ data = SDIO_BUS_WIDTH_1_BIT;
++ status = SDLIB_IssueCMD52(handle, 0, SDIO_BUS_IF_REG, &data, 1, 1);
++ if (!SDIO_SUCCESS(status)) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERROR,
++ ("Unable to set the bus width to 1 bit\n"));
++ return FALSE;
++ }
++ }
++
++ /* Get current bus flags */
++ ZERO_OBJECT(busSettings);
++
++ busSettings.BusModeFlags = SDDEVICE_GET_BUSMODE_FLAGS(handle);
++ if (onebitmode) {
++ SDCONFIG_SET_BUS_WIDTH(busSettings.BusModeFlags,
++ SDCONFIG_BUS_WIDTH_1_BIT);
++ }
++
++ /* get the current operating clock, the bus driver sets us up based
++ * on what our CIS reports and what the host controller can handle
++ * we can use this to determine whether we want to drop our clock rate
++ * down */
++ currentBusClock = SDDEVICE_GET_OPER_CLOCK(handle);
++ busSettings.ClockRate = currentBusClock;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE,
++ ("HIF currently running at: %d \n",currentBusClock));
++
++ /* see if HIF wants to run at a lower clock speed, we may already be
++ * at that lower clock speed */
++ if (currentBusClock > (SDIO_CLOCK_FREQUENCY_DEFAULT >> busspeedlow)) {
++ busSettings.ClockRate = SDIO_CLOCK_FREQUENCY_DEFAULT >> busspeedlow;
++ AR_DEBUG_PRINTF(ATH_DEBUG_WARN,
++ ("HIF overriding clock to %d \n",busSettings.ClockRate));
++ }
++
++ /* Issue config request to override clock rate */
++ status = SDLIB_IssueConfig(handle, SDCONFIG_FUNC_CHANGE_BUS_MODE, &busSettings,
++ sizeof(SDCONFIG_BUS_MODE_DATA));
++ if (!SDIO_SUCCESS(status)) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERROR,
++ ("Unable to configure the host clock\n"));
++ return FALSE;
++ } else {
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE,
++ ("Configured clock: %d, Maximum clock: %d\n",
++ busSettings.ActualClockRate,
++ SDDEVICE_GET_MAX_CLOCK(handle)));
++ }
++
++ /*
++ * Check if the target supports block mode. This result of this check
++ * can be used to implement the HIFReadWrite API.
++ */
++ if (SDDEVICE_GET_SDIO_FUNC_MAXBLKSIZE(handle)) {
++ /* Limit block size to operational block limit or card function
++ capability */
++ maxBlockSize = min(SDDEVICE_GET_OPER_BLOCK_LEN(handle),
++ SDDEVICE_GET_SDIO_FUNC_MAXBLKSIZE(handle));
++
++ /* check if the card support multi-block transfers */
++ if (!(SDDEVICE_GET_SDIOCARD_CAPS(handle) & SDIO_CAPS_MULTI_BLOCK)) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("Byte basis only\n"));
++
++ /* Limit block size to max byte basis */
++ maxBlockSize = min(maxBlockSize,
++ (A_UINT16)SDIO_MAX_LENGTH_BYTE_BASIS);
++ maxBlocks = 1;
++ } else {
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("Multi-block capable\n"));
++ maxBlocks = SDDEVICE_GET_OPER_BLOCKS(handle);
++ status = SDLIB_SetFunctionBlockSize(handle, HIF_MBOX_BLOCK_SIZE);
++ if (!SDIO_SUCCESS(status)) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERROR,
++ ("Failed to set block size. Err:%d\n", status));
++ return FALSE;
++ }
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE,
++ ("Bytes Per Block: %d bytes, Block Count:%d \n",
++ maxBlockSize, maxBlocks));
++ } else {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERROR,
++ ("Function does not support Block Mode!\n"));
++ return FALSE;
++ }
++
++ /* Allocate the slot current */
++ status = SDLIB_GetDefaultOpCurrent(handle, &slotCurrent.SlotCurrent);
++ if (SDIO_SUCCESS(status)) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("Allocating Slot current: %d mA\n",
++ slotCurrent.SlotCurrent));
++ status = SDLIB_IssueConfig(handle, SDCONFIG_FUNC_ALLOC_SLOT_CURRENT,
++ &slotCurrent, sizeof(slotCurrent));
++ if (!SDIO_SUCCESS(status)) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERROR,
++ ("Failed to allocate slot current %d\n", status));
++ return FALSE;
++ }
++ }
++
++ /* Enable the dragon function */
++ count = 0;
++ enabled = FALSE;
++ fData.TimeOut = 1;
++ fData.EnableFlags = SDCONFIG_ENABLE_FUNC;
++ while ((count++ < SDWLAN_ENABLE_DISABLE_TIMEOUT) && !enabled)
++ {
++ /* Enable dragon */
++ status = SDLIB_IssueConfig(handle, SDCONFIG_FUNC_ENABLE_DISABLE,
++ &fData, sizeof(fData));
++ if (!SDIO_SUCCESS(status)) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE,
++ ("Attempting to enable the card again\n"));
++ continue;
++ }
++
++ /* Mark the status as enabled */
++ enabled = TRUE;
++ }
++
++ /* Check if we were succesful in enabling the target */
++ if (!enabled) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERROR,
++ ("Failed to communicate with the target\n"));
++ return FALSE;
++ }
++
++ /* Allocate the bus requests to be used later */
++ A_MEMZERO(busRequest, sizeof(busRequest));
++ for (count = 0; count < BUS_REQUEST_MAX_NUM; count ++) {
++ if ((busRequest[count].request = SDDeviceAllocRequest(handle)) == NULL){
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERROR, ("Unable to allocate memory\n"));
++ /* TODO: Free the memory that has already been allocated */
++ return FALSE;
++ }
++ hifFreeBusRequest(&busRequest[count]);
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE,
++ ("0x%08x = busRequest[%d].request = 0x%08x\n",
++ (unsigned int) &busRequest[count], count,
++ (unsigned int) busRequest[count].request));
++ }
++
++ /* Schedule a worker to handle device inserted, this is a temporary workaround
++ * to fix a deadlock if the device fails to intialize in the insertion handler
++ * The failure causes the instance to shutdown the HIF layer and unregister the
++ * function driver within the busdriver probe context which can deadlock
++ *
++ * NOTE: we cannot use the default work queue because that would block
++ * SD bus request processing for all synchronous I/O. We must use a kernel
++ * thread that is creating using the helper library.
++ * */
++
++ if (SDIO_SUCCESS(SDLIB_OSCreateHelper(&device->insert_helper,
++ insert_helper_func,
++ device))) {
++ device->helper_started = TRUE;
++ }
++
++ return TRUE;
++}
++
++static THREAD_RETURN insert_helper_func(POSKERNEL_HELPER pHelper)
++{
++
++ /*
++ * Adding a wait of around a second before we issue the very first
++ * command to dragon. During the process of loading/unloading the
++ * driver repeatedly it was observed that we get a data timeout
++ * while accessing function 1 registers in the chip. The theory at
++ * this point is that some initialization delay in dragon is
++ * causing the SDIO state in dragon core to be not ready even after
++ * the ready bit indicates that function 1 is ready. Accomodating
++ * for this behavior by adding some delay in the driver before it
++ * issues the first command after switching on dragon. Need to
++ * investigate this a bit more - TODO
++ */
++
++ A_MDELAY(1000);
++ /* Inform HTC */
++ if ((htcCallbacks.deviceInsertedHandler(SD_GET_OS_HELPER_CONTEXT(pHelper))) != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("Device rejected\n"));
++ }
++
++ return 0;
++}
++
++void
++HIFAckInterrupt(HIF_DEVICE *device)
++{
++ SDIO_STATUS status;
++ DBG_ASSERT(device != NULL);
++ DBG_ASSERT(device->handle != NULL);
++
++ /* Acknowledge our function IRQ */
++ status = SDLIB_IssueConfig(device->handle, SDCONFIG_FUNC_ACK_IRQ,
++ NULL, 0);
++ DBG_ASSERT(SDIO_SUCCESS(status));
++}
++
++void
++HIFUnMaskInterrupt(HIF_DEVICE *device)
++{
++ SDIO_STATUS status;
++
++ DBG_ASSERT(device != NULL);
++ DBG_ASSERT(device->handle != NULL);
++
++ /* Register the IRQ Handler */
++ SDDEVICE_SET_IRQ_HANDLER(device->handle, hifIRQHandler, device);
++
++ /* Unmask our function IRQ */
++ status = SDLIB_IssueConfig(device->handle, SDCONFIG_FUNC_UNMASK_IRQ,
++ NULL, 0);
++ DBG_ASSERT(SDIO_SUCCESS(status));
++}
++
++void HIFMaskInterrupt(HIF_DEVICE *device)
++{
++ SDIO_STATUS status;
++ DBG_ASSERT(device != NULL);
++ DBG_ASSERT(device->handle != NULL);
++
++ /* Mask our function IRQ */
++ status = SDLIB_IssueConfig(device->handle, SDCONFIG_FUNC_MASK_IRQ,
++ NULL, 0);
++ DBG_ASSERT(SDIO_SUCCESS(status));
++
++ /* Unregister the IRQ Handler */
++ SDDEVICE_SET_IRQ_HANDLER(device->handle, NULL, NULL);
++}
++
++static BUS_REQUEST *hifAllocateBusRequest(void)
++{
++ BUS_REQUEST *busrequest;
++
++ /* Acquire lock */
++ CriticalSectionAcquire(&lock);
++
++ /* Remove first in list */
++ if((busrequest = s_busRequestFreeQueue) != NULL)
++ {
++ s_busRequestFreeQueue = busrequest->next;
++ }
++
++ /* Release lock */
++ CriticalSectionRelease(&lock);
++
++ return busrequest;
++}
++
++static void
++hifFreeBusRequest(BUS_REQUEST *busrequest)
++{
++ DBG_ASSERT(busrequest != NULL);
++
++ /* Acquire lock */
++ CriticalSectionAcquire(&lock);
++
++ /* Insert first in list */
++ busrequest->next = s_busRequestFreeQueue;
++ s_busRequestFreeQueue = busrequest;
++
++ /* Release lock */
++ CriticalSectionRelease(&lock);
++}
++
++void
++hifDeviceRemoved(SDFUNCTION *function, SDDEVICE *handle)
++{
++ A_STATUS status;
++ HIF_DEVICE *device;
++ DBG_ASSERT(function != NULL);
++ DBG_ASSERT(handle != NULL);
++
++ device = getHifDevice(handle);
++ status = htcCallbacks.deviceRemovedHandler(device->htc_handle, A_OK);
++
++ /* cleanup the helper thread */
++ if (device->helper_started) {
++ SDLIB_OSDeleteHelper(&device->insert_helper);
++ device->helper_started = FALSE;
++ }
++
++ delHifDevice(handle);
++ DBG_ASSERT(status == A_OK);
++}
++
++HIF_DEVICE *
++addHifDevice(SDDEVICE *handle)
++{
++ DBG_ASSERT(handle != NULL);
++ hifDevice[0].handle = handle;
++ return &hifDevice[0];
++}
++
++HIF_DEVICE *
++getHifDevice(SDDEVICE *handle)
++{
++ DBG_ASSERT(handle != NULL);
++ return &hifDevice[0];
++}
++
++void
++delHifDevice(SDDEVICE *handle)
++{
++ DBG_ASSERT(handle != NULL);
++ hifDevice[0].handle = NULL;
++}
++
++struct device*
++HIFGetOSDevice(HIF_DEVICE *device)
++{
++ return &device->handle->Device->dev;
++}
++
++static void ResetAllCards(void)
++{
++ UINT8 data;
++ SDIO_STATUS status;
++ int i;
++
++ data = SDIO_IO_RESET;
++
++ /* set the I/O CARD reset bit:
++ * NOTE: we are exploiting a "feature" of the SDIO core that resets the core when you
++ * set the RES bit in the SDIO_IO_ABORT register. This bit however "normally" resets the
++ * I/O functions leaving the SDIO core in the same state (as per SDIO spec).
++ * In this design, this reset can be used to reset the SDIO core itself */
++ for (i = 0; i < HIF_MAX_DEVICES; i++) {
++ if (hifDevice[i].handle != NULL) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRACE,
++ ("Issuing I/O Card reset for instance: %d \n",i));
++ /* set the I/O Card reset bit */
++ status = SDLIB_IssueCMD52(hifDevice[i].handle,
++ 0, /* function 0 space */
++ SDIO_IO_ABORT_REG,
++ &data,
++ 1, /* 1 byte */
++ TRUE); /* write */
++ }
++ }
++
++}
++
++void HIFSetHandle(void *hif_handle, void *handle)
++{
++ HIF_DEVICE *device = (HIF_DEVICE *) hif_handle;
++
++ device->htc_handle = handle;
++
++ return;
++}
+diff --git a/drivers/ar6000/hif/hif2.c b/drivers/ar6000/hif/hif2.c
+new file mode 100644
+index 0000000..386d96e
+--- /dev/null
++++ b/drivers/ar6000/hif/hif2.c
+@@ -0,0 +1,768 @@
++/*
++ * hif2.c - HIF layer re-implementation for the Linux SDIO stack
++ *
++ * Copyright (C) 2008, 2009 by OpenMoko, Inc.
++ * Written by Werner Almesberger <werner@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;
++ *
++ * Based on:
++ *
++ * @abstract: HIF layer reference implementation for Atheros SDIO stack
++ * @notice: Copyright (c) 2004-2006 Atheros Communications Inc.
++ */
++
++
++#include <linux/kernel.h>
++#include <linux/kthread.h>
++#include <linux/list.h>
++#include <linux/wait.h>
++#include <linux/spinlock.h>
++#include <linux/mutex.h>
++#include <linux/sched.h>
++#include <linux/mmc/sdio_func.h>
++#include <linux/mmc/sdio.h>
++#include <linux/mmc/sdio_ids.h>
++
++#include "athdefs.h"
++#include "a_types.h"
++#include "hif.h"
++
++
++/* @@@ Hack - this wants cleaning up */
++
++#ifdef CONFIG_MACH_NEO1973_GTA02
++
++#include <mach/gta02-pm-wlan.h>
++
++#else /* CONFIG_MACH_NEO1973_GTA02 */
++
++#define gta02_wlan_query_rfkill_lock() 1
++#define gta02_wlan_set_rfkill_cb(cb, hif) ((void) cb)
++#define gta02_wlan_query_rfkill_unlock()
++#define gta02_wlan_clear_rfkill_cb()
++
++#endif /* !CONFIG_MACH_NEO1973_GTA02 */
++
++
++/*
++ * KNOWN BUGS:
++ *
++ * - HIF_DEVICE_IRQ_ASYNC_SYNC doesn't work yet (gets MMC errors)
++ * - latency can reach hundreds of ms, probably because of scheduling delays
++ * - packets go through about three queues before finally hitting the network
++ */
++
++/*
++ * Differences from Atheros' HIFs:
++ *
++ * - synchronous and asynchronous requests may get reordered with respect to
++ * each other, e.g., if HIFReadWrite returns for an asynchronous request and
++ * then HIFReadWrite is called for a synchronous request, the synchronous
++ * request may be executed before the asynchronous request.
++ *
++ * - request queue locking seems unnecessarily complex in the Atheros HIFs.
++ *
++ * - Atheros mask interrupts by calling sdio_claim_irq/sdio_release_irq, which
++ * can cause quite a bit of overhead. This HIF has its own light-weight
++ * interrupt masking.
++ *
++ * - Atheros call deviceInsertedHandler from a thread spawned off the probe or
++ * device insertion function. The original explanation for the Atheros SDIO
++ * stack said that this is done because a delay is needed to let the chip
++ * complete initialization. There is indeed a one second delay in the thread.
++ *
++ * The Atheros Linux SDIO HIF removes the delay and only retains the thread.
++ * Experimentally removing the thread didn't show any conflicts, so let's get
++ * rid of it for good.
++ *
++ * - The Atheros SDIO stack with Samuel's driver sets SDIO_CCCR_POWER in
++ * SDIO_POWER_EMPC. Atheros' Linux SDIO code apparently doesn't. We don't
++ * either, and this seems to work fine.
++ * @@@ Need to check this with Atheros.
++ */
++
++
++#define MBOXES 4
++
++#define HIF_MBOX_BLOCK_SIZE 128
++#define HIF_MBOX_BASE_ADDR 0x800
++#define HIF_MBOX_WIDTH 0x800
++#define HIF_MBOX_START_ADDR(mbox) \
++ (HIF_MBOX_BASE_ADDR+(mbox)*HIF_MBOX_WIDTH)
++
++
++struct hif_device {
++ void *htc_handle;
++ struct sdio_func *func;
++
++ /*
++ * @@@ our sweet little bit of bogosity - the mechanism that lets us
++ * use the SDIO stack from softirqs. This really wants to use skbs.
++ */
++ struct list_head queue;
++ spinlock_t queue_lock;
++ struct task_struct *io_task;
++ wait_queue_head_t wait;
++
++ /*
++ * activate_lock protects "active" and the activation/deactivation
++ * process itself.
++ *
++ * Relation to other locks: The SDIO function can be claimed while
++ * activate_lock is being held, but trying to acquire activate_lock
++ * while having ownership of the SDIO function could cause a deadlock.
++ */
++ int active;
++ struct mutex activate_lock;
++};
++
++struct hif_request {
++ struct list_head list;
++ struct sdio_func *func;
++ int (*read)(struct sdio_func *func,
++ void *dst, unsigned int addr, int count);
++ int (*write)(struct sdio_func *func,
++ unsigned int addr, void *src, int count);
++ void *buf;
++ unsigned long addr;
++ int len;
++ A_STATUS (*completion)(void *context, A_STATUS status);
++ void *context;
++};
++
++
++static HTC_CALLBACKS htcCallbacks;
++
++/*
++ * shutdown_lock prevents recursion through HIFShutDownDevice
++ */
++static DEFINE_MUTEX(shutdown_lock);
++
++
++/* ----- Request processing ------------------------------------------------ */
++
++
++static A_STATUS process_request(struct hif_request *req)
++{
++ int ret;
++ A_STATUS status;
++
++ dev_dbg(&req->func->dev, "process_request(req %p)\n", req);
++ sdio_claim_host(req->func);
++ if (req->read) {
++ ret = req->read(req->func, req->buf, req->addr, req->len);
++ } else {
++ ret = req->write(req->func, req->addr, req->buf, req->len);
++ }
++ sdio_release_host(req->func);
++ status = ret ? A_ERROR : A_OK;
++ if (req->completion)
++ req->completion(req->context, status);
++ kfree(req);
++ return status;
++}
++
++
++static void enqueue_request(struct hif_device *hif, struct hif_request *req)
++{
++ unsigned long flags;
++
++ dev_dbg(&req->func->dev, "enqueue_request(req %p)\n", req);
++ spin_lock_irqsave(&hif->queue_lock, flags);
++ list_add_tail(&req->list, &hif->queue);
++ spin_unlock_irqrestore(&hif->queue_lock, flags);
++ wake_up(&hif->wait);
++}
++
++
++static struct hif_request *dequeue_request(struct hif_device *hif)
++{
++ struct hif_request *req;
++ unsigned long flags;
++
++ spin_lock_irqsave(&hif->queue_lock, flags);
++ if (list_empty(&hif->queue))
++ req = NULL;
++ else {
++ req = list_first_entry(&hif->queue,
++ struct hif_request, list);
++ list_del(&req->list);
++ }
++ spin_unlock_irqrestore(&hif->queue_lock, flags);
++ return req;
++}
++
++
++static void wait_queue_empty(struct hif_device *hif)
++{
++ unsigned long flags;
++ int empty;
++
++ while (1) {
++ spin_lock_irqsave(&hif->queue_lock, flags);
++ empty = list_empty(&hif->queue);
++ spin_unlock_irqrestore(&hif->queue_lock, flags);
++ if (empty)
++ break;
++ else
++ yield();
++ }
++}
++
++
++static int io(void *data)
++{
++ struct hif_device *hif = data;
++ struct sched_param param = { .sched_priority = 2 };
++ /* one priority level slower than ksdioirqd (which is at 1) */
++ DEFINE_WAIT(wait);
++ struct hif_request *req;
++
++ sched_setscheduler(current, SCHED_FIFO, &param);
++
++ while (1) {
++ while (1) {
++ /*
++ * Since we never use signals here, one might think
++ * that this ought to be TASK_UNINTERRUPTIBLE. However,
++ * such a task would increase the load average and,
++ * worse, it would trigger the softlockup check.
++ */
++ prepare_to_wait(&hif->wait, &wait, TASK_INTERRUPTIBLE);
++ if (kthread_should_stop()) {
++ finish_wait(&hif->wait, &wait);
++ return 0;
++ }
++ req = dequeue_request(hif);
++ if (req)
++ break;
++ schedule();
++ }
++ finish_wait(&hif->wait, &wait);
++
++ (void) process_request(req);
++ }
++ return 0;
++}
++
++
++A_STATUS HIFReadWrite(HIF_DEVICE *hif, A_UINT32 address, A_UCHAR *buffer,
++ A_UINT32 length, A_UINT32 request, void *context)
++{
++ struct device *dev = HIFGetOSDevice(hif);
++ struct hif_request *req;
++
++ dev_dbg(dev, "HIFReadWrite(device %p, address 0x%x, buffer %p, "
++ "length %d, request 0x%x, context %p)\n",
++ hif, address, buffer, length, request, context);
++
++ BUG_ON(!(request & (HIF_SYNCHRONOUS | HIF_ASYNCHRONOUS)));
++ BUG_ON(!(request & (HIF_BYTE_BASIS | HIF_BLOCK_BASIS)));
++ BUG_ON(!(request & (HIF_READ | HIF_WRITE)));
++ BUG_ON(!(request & HIF_EXTENDED_IO));
++
++ if (address >= HIF_MBOX_START_ADDR(0) &&
++ address < HIF_MBOX_START_ADDR(MBOXES+1)) {
++ BUG_ON(length > HIF_MBOX_WIDTH);
++ /* Adjust the address so that the last byte falls on the EOM
++ address. */
++ address += HIF_MBOX_WIDTH-length;
++ }
++
++ req = kzalloc(sizeof(*req), GFP_ATOMIC);
++ if (!req) {
++ if (request & HIF_ASYNCHRONOUS)
++ htcCallbacks.rwCompletionHandler(context, A_ERROR);
++ return A_ERROR;
++ }
++
++ req->func = hif->func;
++ req->addr = address;
++ req->buf = buffer;
++ req->len = length;
++
++ if (request & HIF_READ) {
++ if (request & HIF_FIXED_ADDRESS)
++ req->read = sdio_readsb;
++ else
++ req->read = sdio_memcpy_fromio;
++ } else {
++ if (request & HIF_FIXED_ADDRESS)
++ req->write = sdio_writesb;
++ else
++ req->write = sdio_memcpy_toio;
++ }
++
++ if (!(request & HIF_ASYNCHRONOUS))
++ return process_request(req);
++
++ req->completion = htcCallbacks.rwCompletionHandler;
++ req->context = context;
++ enqueue_request(hif, req);
++
++ return A_OK;
++}
++
++
++/* ----- Interrupt handling ------------------------------------------------ */
++
++/*
++ * Volatile ought to be good enough to make gcc do the right thing on S3C24xx.
++ * No need to use atomic or put barriers, keeping the code more readable.
++ *
++ * Warning: this story changes if going SMP/SMT.
++ */
++
++static volatile int masked = 1;
++static volatile int pending;
++static volatile int in_interrupt;
++
++
++static void ar6000_do_irq(struct sdio_func *func)
++{
++ HIF_DEVICE *hif = sdio_get_drvdata(func);
++ struct device *dev = HIFGetOSDevice(hif);
++ A_STATUS status;
++
++ dev_dbg(dev, "ar6000_do_irq -> %p\n", htcCallbacks.dsrHandler);
++
++ status = htcCallbacks.dsrHandler(hif->htc_handle);
++ BUG_ON(status != A_OK);
++}
++
++
++static void sdio_ar6000_irq(struct sdio_func *func)
++{
++ HIF_DEVICE *hif = sdio_get_drvdata(func);
++ struct device *dev = HIFGetOSDevice(hif);
++
++ dev_dbg(dev, "sdio_ar6000_irq\n");
++
++ in_interrupt = 1;
++ if (masked) {
++ in_interrupt = 0;
++ pending++;
++ return;
++ }
++ /*
++ * @@@ This is ugly. If we don't drop the lock, we'll deadlock when
++ * the handler tries to do SDIO. So there are four choices:
++ *
++ * 1) Break the call chain by calling the callback from a workqueue.
++ * Ugh.
++ * 2) Make process_request aware that we already have the lock.
++ * 3) Drop the lock. Which is ugly but should be safe as long as we're
++ * making sure the device doesn't go away.
++ * 4) Change the AR6k driver such that it only issues asynchronous
++ * quests when called from an interrupt.
++ *
++ * Solution 2) is probably the best for now. Will try it later.
++ */
++ sdio_release_host(func);
++ ar6000_do_irq(func);
++ sdio_claim_host(func);
++ in_interrupt = 0;
++}
++
++
++void HIFAckInterrupt(HIF_DEVICE *hif)
++{
++ struct device *dev = HIFGetOSDevice(hif);
++
++ dev_dbg(dev, "HIFAckInterrupt\n");
++ /* do nothing */
++}
++
++
++void HIFUnMaskInterrupt(HIF_DEVICE *hif)
++{
++ struct device *dev = HIFGetOSDevice(hif);
++
++ dev_dbg(dev, "HIFUnMaskInterrupt\n");
++ do {
++ masked = 1;
++ if (pending) {
++ pending = 0;
++ ar6000_do_irq(hif->func);
++ /* We may take an interrupt before unmasking and thus
++ get it pending. In this case, we just loop back. */
++ }
++ masked = 0;
++ }
++ while (pending);
++}
++
++
++void HIFMaskInterrupt(HIF_DEVICE *hif)
++{
++ struct device *dev = HIFGetOSDevice(hif);
++
++ dev_dbg(dev, "HIFMaskInterrupt\n");
++ /*
++ * Since sdio_ar6000_irq can also be called from a process context, we
++ * may conceivably end up racing with it. Thus, we need to wait until
++ * we can be sure that no concurrent interrupt processing is going on
++ * before we return.
++ *
++ * Note: this may be a bit on the paranoid side - the callers may
++ * actually be nice enough to disable scheduling. Check later.
++ */
++ masked = 1;
++ while (in_interrupt)
++ yield();
++}
++
++
++/* ----- HIF API glue functions -------------------------------------------- */
++
++
++struct device *HIFGetOSDevice(HIF_DEVICE *hif)
++{
++ return &hif->func->dev;
++}
++
++
++void HIFSetHandle(void *hif_handle, void *handle)
++{
++ HIF_DEVICE *hif = (HIF_DEVICE *) hif_handle;
++
++ hif->htc_handle = handle;
++}
++
++
++/* ----- Device configuration (HIF side) ----------------------------------- */
++
++
++A_STATUS HIFConfigureDevice(HIF_DEVICE *hif,
++ HIF_DEVICE_CONFIG_OPCODE opcode, void *config, A_UINT32 configLen)
++{
++ struct device *dev = HIFGetOSDevice(hif);
++ HIF_DEVICE_IRQ_PROCESSING_MODE *ipm_cfg = config;
++ A_UINT32 *mbs_cfg = config;
++ int i;
++
++ dev_dbg(dev, "HIFConfigureDevice\n");
++
++ switch (opcode) {
++ case HIF_DEVICE_GET_MBOX_BLOCK_SIZE:
++ for (i = 0; i != MBOXES; i++)
++ mbs_cfg[i] = HIF_MBOX_BLOCK_SIZE;
++ break;
++ case HIF_DEVICE_GET_MBOX_ADDR:
++ for (i = 0; i != MBOXES; i++)
++ mbs_cfg[i] = HIF_MBOX_START_ADDR(i);
++ break;
++ case HIF_DEVICE_GET_IRQ_PROC_MODE:
++ *ipm_cfg = HIF_DEVICE_IRQ_SYNC_ONLY;
++// *ipm_cfg = HIF_DEVICE_IRQ_ASYNC_SYNC;
++ break;
++ default:
++ return A_ERROR;
++ }
++ return A_OK;
++}
++
++
++/* ----- Device probe and removal (Linux side) ----------------------------- */
++
++
++static int ar6000_do_activate(struct hif_device *hif)
++{
++ struct sdio_func *func = hif->func;
++ struct device *dev = &func->dev;
++ int ret;
++
++ dev_dbg(dev, "ar6000_do_activate\n");
++
++ sdio_claim_host(func);
++ sdio_enable_func(func);
++
++ INIT_LIST_HEAD(&hif->queue);
++ init_waitqueue_head(&hif->wait);
++ spin_lock_init(&hif->queue_lock);
++
++ ret = sdio_set_block_size(func, HIF_MBOX_BLOCK_SIZE);
++ if (ret < 0) {
++ dev_err(dev, "sdio_set_block_size returns %d\n", ret);
++ goto out_enabled;
++ }
++ ret = sdio_claim_irq(func, sdio_ar6000_irq);
++ if (ret) {
++ dev_err(dev, "sdio_claim_irq returns %d\n", ret);
++ goto out_enabled;
++ }
++ /* Set SDIO_BUS_CD_DISABLE in SDIO_CCCR_IF ? */
++#if 0
++ sdio_f0_writeb(func, SDIO_CCCR_CAP_E4MI, SDIO_CCCR_CAPS, &ret);
++ if (ret) {
++ dev_err(dev, "sdio_f0_writeb(SDIO_CCCR_CAPS) returns %d\n",
++ ret);
++ goto out_got_irq;
++ }
++#else
++ if (0) /* avoid warning */
++ goto out_got_irq;
++#endif
++
++ sdio_release_host(func);
++
++ hif->io_task = kthread_run(io, hif, "ar6000_io");
++ ret = IS_ERR(hif->io_task);
++ if (ret) {
++ dev_err(dev, "kthread_run(ar6000_io): %d\n", ret);
++ goto out_func_ready;
++ }
++
++ ret = htcCallbacks.deviceInsertedHandler(hif);
++ if (ret == A_OK)
++ return 0;
++
++ dev_err(dev, "deviceInsertedHandler: %d\n", ret);
++
++ ret = kthread_stop(hif->io_task);
++ if (ret)
++ dev_err(dev, "kthread_stop (ar6000_io): %d\n", ret);
++
++out_func_ready:
++ sdio_claim_host(func);
++
++out_got_irq:
++ sdio_release_irq(func);
++
++out_enabled:
++ sdio_disable_func(func);
++ sdio_release_host(func);
++
++ return ret;
++}
++
++
++static void ar6000_do_deactivate(struct hif_device *hif)
++{
++ struct sdio_func *func = hif->func;
++ struct device *dev = &func->dev;
++ int ret;
++
++ dev_dbg(dev, "ar6000_do_deactivate\n");
++ if (!hif->active)
++ return;
++
++ if (mutex_trylock(&shutdown_lock)) {
++ /*
++ * Funny, Atheros' HIF does this call, but this just puts us in
++ * a recursion through HTCShutDown/HIFShutDown if unloading the
++ * module.
++ *
++ * However, we need it for suspend/resume. See the comment at
++ * HIFShutDown, below.
++ */
++ ret = htcCallbacks.deviceRemovedHandler(hif->htc_handle, A_OK);
++ if (ret != A_OK)
++ dev_err(dev, "deviceRemovedHandler: %d\n", ret);
++ mutex_unlock(&shutdown_lock);
++ }
++ wait_queue_empty(hif);
++ ret = kthread_stop(hif->io_task);
++ if (ret)
++ dev_err(dev, "kthread_stop (ar6000_io): %d\n", ret);
++ sdio_claim_host(func);
++ sdio_release_irq(func);
++ sdio_disable_func(func);
++ sdio_release_host(func);
++}
++
++
++static int ar6000_activate(struct hif_device *hif)
++{
++ int ret = 0;
++
++ dev_dbg(&hif->func->dev, "ar6000_activate\n");
++ mutex_lock(&hif->activate_lock);
++ if (!hif->active) {
++ ret = ar6000_do_activate(hif);
++ if (ret) {
++ printk(KERN_ERR "%s: Failed to activate %d\n",
++ __func__, ret);
++ goto out;
++ }
++ hif->active = 1;
++ }
++out:
++ mutex_unlock(&hif->activate_lock);
++ return ret;
++}
++
++
++static void ar6000_deactivate(struct hif_device *hif)
++{
++ dev_dbg(&hif->func->dev, "ar6000_deactivate\n");
++ mutex_lock(&hif->activate_lock);
++ if (hif->active) {
++ ar6000_do_deactivate(hif);
++ hif->active = 0;
++ }
++ mutex_unlock(&hif->activate_lock);
++}
++
++
++static int ar6000_rfkill_cb(void *data, int on)
++{
++ struct hif_device *hif = data;
++ struct sdio_func *func = hif->func;
++ struct device *dev = &func->dev;
++
++ dev_dbg(dev, "ar6000_rfkill_cb: on %d\n", on);
++ if (on)
++ return ar6000_activate(hif);
++ ar6000_deactivate(hif);
++ return 0;
++}
++
++
++static int sdio_ar6000_probe(struct sdio_func *func,
++ const struct sdio_device_id *id)
++{
++ struct device *dev = &func->dev;
++ struct hif_device *hif;
++ int ret = 0;
++
++ dev_dbg(dev, "sdio_ar6000_probe\n");
++ BUG_ON(!htcCallbacks.deviceInsertedHandler);
++
++ hif = kzalloc(sizeof(*hif), GFP_KERNEL);
++ if (!hif)
++ return -ENOMEM;
++
++ sdio_set_drvdata(func, hif);
++ hif->func = func;
++ mutex_init(&hif->activate_lock);
++ hif->active = 0;
++
++ if (gta02_wlan_query_rfkill_lock())
++ ret = ar6000_activate(hif);
++ if (!ret) {
++ gta02_wlan_set_rfkill_cb(ar6000_rfkill_cb, hif);
++ return 0;
++ }
++ gta02_wlan_query_rfkill_unlock();
++ sdio_set_drvdata(func, NULL);
++ kfree(hif);
++ return ret;
++}
++
++
++static void sdio_ar6000_remove(struct sdio_func *func)
++{
++ struct device *dev = &func->dev;
++ HIF_DEVICE *hif = sdio_get_drvdata(func);
++
++ dev_dbg(dev, "sdio_ar6000_remove\n");
++ gta02_wlan_clear_rfkill_cb();
++ ar6000_deactivate(hif);
++ sdio_set_drvdata(func, NULL);
++ kfree(hif);
++}
++
++
++/* ----- Device registration/unregistration (called by HIF) ---------------- */
++
++
++#define ATHEROS_SDIO_DEVICE(id, offset) \
++ SDIO_DEVICE(SDIO_VENDOR_ID_ATHEROS, SDIO_DEVICE_ID_ATHEROS_##id | (offset))
++
++static const struct sdio_device_id sdio_ar6000_ids[] = {
++ { ATHEROS_SDIO_DEVICE(AR6002, 0) },
++ { ATHEROS_SDIO_DEVICE(AR6002, 0x1) },
++ { ATHEROS_SDIO_DEVICE(AR6001, 0x8) },
++ { ATHEROS_SDIO_DEVICE(AR6001, 0x9) },
++ { ATHEROS_SDIO_DEVICE(AR6001, 0xa) },
++ { ATHEROS_SDIO_DEVICE(AR6001, 0xb) },
++ { /* end: all zeroes */ },
++};
++
++MODULE_DEVICE_TABLE(sdio, sdio_ar6000_ids);
++
++
++static struct sdio_driver sdio_ar6000_driver = {
++ .probe = sdio_ar6000_probe,
++ .remove = sdio_ar6000_remove,
++ .name = "sdio_ar6000",
++ .id_table = sdio_ar6000_ids,
++};
++
++
++int HIFInit(HTC_CALLBACKS *callbacks)
++{
++ int ret;
++
++ BUG_ON(!callbacks);
++
++ printk(KERN_DEBUG "HIFInit\n");
++ htcCallbacks = *callbacks;
++
++ ret = sdio_register_driver(&sdio_ar6000_driver);
++ if (ret) {
++ printk(KERN_ERR
++ "sdio_register_driver(sdio_ar6000_driver): %d\n", ret);
++ return A_ERROR;
++ }
++
++ return 0;
++}
++
++
++/*
++ * We have four possible call chains here:
++ *
++ * System shutdown/reboot:
++ *
++ * kernel_restart_prepare ...> device_shutdown ... > s3cmci_shutdown ->
++ * mmc_remove_host ..> sdio_bus_remove -> sdio_ar6000_remove ->
++ * ar6000_deactivate -> ar6000_do_deactivate ->
++ * deviceRemovedHandler (HTCTargetRemovedHandler) -> HIFShutDownDevice
++ *
++ * This is roughly the same sequence as suspend, described below.
++ *
++ * Module removal:
++ *
++ * sys_delete_module -> ar6000_cleanup_module -> HTCShutDown ->
++ * HIFShutDownDevice -> sdio_unregister_driver ...> sdio_bus_remove ->
++ * sdio_ar6000_remove -> ar6000_deactivate -> ar6000_do_deactivate
++ *
++ * In this case, HIFShutDownDevice must call sdio_unregister_driver to
++ * notify the driver about its removal. ar6000_do_deactivate must not call
++ * deviceRemovedHandler, because that would loop back into HIFShutDownDevice.
++ *
++ * Suspend:
++ *
++ * device_suspend ...> s3cmci_suspend ...> sdio_bus_remove ->
++ * sdio_ar6000_remove -> ar6000_deactivate -> ar6000_do_deactivate ->
++ * deviceRemovedHandler (HTCTargetRemovedHandler) -> HIFShutDownDevice
++ *
++ * We must call deviceRemovedHandler to inform the ar6k stack that the device
++ * has been removed. Since HTCTargetRemovedHandler calls back into
++ * HIFShutDownDevice, we must also prevent the call to
++ * sdio_unregister_driver, or we'd end up recursing into the SDIO stack,
++ * eventually deadlocking somewhere.
++ *
++ * rfkill:
++ *
++ * rfkill_state_store -> rfkill_toggle_radio -> gta02_wlan_toggle_radio ->
++ * ar6000_rfkill_cb -> ar6000_deactivate -> ar6000_do_deactivate ->
++ * deviceRemovedHandler (HTCTargetRemovedHandler) -> HIFShutDownDevice
++ *
++ * This is similar to suspend - only the entry point changes.
++ */
++
++void HIFShutDownDevice(HIF_DEVICE *hif)
++{
++ /* Beware, HTCShutDown calls us with hif == NULL ! */
++ if (mutex_trylock(&shutdown_lock)) {
++ sdio_unregister_driver(&sdio_ar6000_driver);
++ mutex_unlock(&shutdown_lock);
++ }
++}
+diff --git a/drivers/ar6000/hif/hif_internal.h b/drivers/ar6000/hif/hif_internal.h
+new file mode 100644
+index 0000000..d8fc101
+--- /dev/null
++++ b/drivers/ar6000/hif/hif_internal.h
+@@ -0,0 +1,102 @@
++/*
++ * @file: hif_internal.h
++ *
++ * @abstract: internal header file for hif layer
++ *
++ * @notice: Copyright (c) 2004-2006 Atheros Communications Inc.
++ *
++ *
++ * 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/sdio/ctsystem.h>
++#include <linux/sdio/sdio_busdriver.h>
++#include <linux/sdio/_sdio_defs.h>
++#include <linux/sdio/sdio_lib.h>
++#include "a_config.h"
++#include "athdefs.h"
++#include "a_types.h"
++#include "a_osapi.h"
++#include "hif.h"
++
++#define MANUFACTURER_ID_AR6001_BASE 0x100
++#define MANUFACTURER_ID_AR6002_BASE 0x200
++#define FUNCTION_CLASS 0x0
++#define MANUFACTURER_CODE 0x271
++
++#define BUS_REQUEST_MAX_NUM 64
++
++#define SDIO_CLOCK_FREQUENCY_DEFAULT 25000000
++#define SDWLAN_ENABLE_DISABLE_TIMEOUT 20
++#define FLAGS_CARD_ENAB 0x02
++#define FLAGS_CARD_IRQ_UNMSK 0x04
++
++#define HIF_MBOX_BLOCK_SIZE 128
++#define HIF_MBOX_BASE_ADDR 0x800
++#define HIF_MBOX_WIDTH 0x800
++#define HIF_MBOX0_BLOCK_SIZE 1
++#define HIF_MBOX1_BLOCK_SIZE HIF_MBOX_BLOCK_SIZE
++#define HIF_MBOX2_BLOCK_SIZE HIF_MBOX_BLOCK_SIZE
++#define HIF_MBOX3_BLOCK_SIZE HIF_MBOX_BLOCK_SIZE
++
++#define HIF_MBOX_START_ADDR(mbox) \
++ HIF_MBOX_BASE_ADDR + mbox * HIF_MBOX_WIDTH
++
++#define HIF_MBOX_END_ADDR(mbox) \
++ HIF_MBOX_START_ADDR(mbox) + HIF_MBOX_WIDTH - 1
++
++struct hif_device {
++ SDDEVICE *handle;
++ void *htc_handle;
++ OSKERNEL_HELPER insert_helper;
++ BOOL helper_started;
++};
++
++typedef struct target_function_context {
++ SDFUNCTION function; /* function description of the bus driver */
++ OS_SEMAPHORE instanceSem; /* instance lock. Unused */
++ SDLIST instanceList; /* list of instances. Unused */
++} TARGET_FUNCTION_CONTEXT;
++
++typedef struct bus_request {
++ struct bus_request *next;
++ SDREQUEST *request;
++ void *context;
++} BUS_REQUEST;
++
++BOOL
++hifDeviceInserted(SDFUNCTION *function, SDDEVICE *device);
++
++void
++hifDeviceRemoved(SDFUNCTION *function, SDDEVICE *device);
++
++SDREQUEST *
++hifAllocateDeviceRequest(SDDEVICE *device);
++
++void
++hifFreeDeviceRequest(SDREQUEST *request);
++
++void
++hifRWCompletionHandler(SDREQUEST *request);
++
++void
++hifIRQHandler(void *context);
++
++HIF_DEVICE *
++addHifDevice(SDDEVICE *handle);
++
++HIF_DEVICE *
++getHifDevice(SDDEVICE *handle);
++
++void
++delHifDevice(SDDEVICE *handle);
+diff --git a/drivers/ar6000/htc/ar6k.c b/drivers/ar6000/htc/ar6k.c
+new file mode 100644
+index 0000000..72472ab
+--- /dev/null
++++ b/drivers/ar6000/htc/ar6k.c
+@@ -0,0 +1,991 @@
++/*
++ * AR6K device layer that handles register level I/O
++ *
++ * Copyright (c) 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 "a_config.h"
++#include "athdefs.h"
++#include "a_types.h"
++#include "AR6Khwreg.h"
++#include "a_osapi.h"
++#include "a_debug.h"
++#include "hif.h"
++#include "htc_packet.h"
++#include "ar6k.h"
++
++#define MAILBOX_FOR_BLOCK_SIZE 1
++
++extern A_UINT32 resetok;
++
++static A_STATUS DevEnableInterrupts(AR6K_DEVICE *pDev);
++static A_STATUS DevDisableInterrupts(AR6K_DEVICE *pDev);
++
++#define LOCK_AR6K(p) A_MUTEX_LOCK(&(p)->Lock);
++#define UNLOCK_AR6K(p) A_MUTEX_UNLOCK(&(p)->Lock);
++
++void AR6KFreeIOPacket(AR6K_DEVICE *pDev, HTC_PACKET *pPacket)
++{
++ LOCK_AR6K(pDev);
++ HTC_PACKET_ENQUEUE(&pDev->RegisterIOList,pPacket);
++ UNLOCK_AR6K(pDev);
++}
++
++HTC_PACKET *AR6KAllocIOPacket(AR6K_DEVICE *pDev)
++{
++ HTC_PACKET *pPacket;
++
++ LOCK_AR6K(pDev);
++ pPacket = HTC_PACKET_DEQUEUE(&pDev->RegisterIOList);
++ UNLOCK_AR6K(pDev);
++
++ return pPacket;
++}
++
++A_STATUS DevSetup(AR6K_DEVICE *pDev)
++{
++ A_UINT32 mailboxaddrs[AR6K_MAILBOXES];
++ A_UINT32 blocksizes[AR6K_MAILBOXES];
++ A_STATUS status = A_OK;
++ int i;
++
++ AR_DEBUG_ASSERT(AR6K_IRQ_PROC_REGS_SIZE == 16);
++ AR_DEBUG_ASSERT(AR6K_IRQ_ENABLE_REGS_SIZE == 4);
++
++ do {
++ /* give a handle to HIF for this target */
++ HIFSetHandle(pDev->HIFDevice, (void *)pDev);
++ /* initialize our free list of IO packets */
++ INIT_HTC_PACKET_QUEUE(&pDev->RegisterIOList);
++ A_MUTEX_INIT(&pDev->Lock);
++
++ /* get the addresses for all 4 mailboxes */
++ status = HIFConfigureDevice(pDev->HIFDevice, HIF_DEVICE_GET_MBOX_ADDR,
++ mailboxaddrs, sizeof(mailboxaddrs));
++
++ if (status != A_OK) {
++ AR_DEBUG_ASSERT(FALSE);
++ break;
++ }
++
++ /* carve up register I/O packets (these are for ASYNC register I/O ) */
++ for (i = 0; i < AR6K_MAX_REG_IO_BUFFERS; i++) {
++ HTC_PACKET *pIOPacket;
++ pIOPacket = &pDev->RegIOBuffers[i].HtcPacket;
++ SET_HTC_PACKET_INFO_RX_REFILL(pIOPacket,
++ pDev,
++ pDev->RegIOBuffers[i].Buffer,
++ AR6K_REG_IO_BUFFER_SIZE,
++ 0); /* don't care */
++ AR6KFreeIOPacket(pDev,pIOPacket);
++ }
++
++ /* get the address of the mailbox we are using */
++ pDev->MailboxAddress = mailboxaddrs[HTC_MAILBOX];
++
++ /* get the block sizes */
++ status = HIFConfigureDevice(pDev->HIFDevice, HIF_DEVICE_GET_MBOX_BLOCK_SIZE,
++ blocksizes, sizeof(blocksizes));
++
++ if (status != A_OK) {
++ AR_DEBUG_ASSERT(FALSE);
++ break;
++ }
++
++ /* note: we actually get the block size of a mailbox other than 0, for SDIO the block
++ * size on mailbox 0 is artificially set to 1. So we use the block size that is set
++ * for the other 3 mailboxes */
++ pDev->BlockSize = blocksizes[MAILBOX_FOR_BLOCK_SIZE];
++ /* must be a power of 2 */
++ AR_DEBUG_ASSERT((pDev->BlockSize & (pDev->BlockSize - 1)) == 0);
++
++ /* assemble mask, used for padding to a block */
++ pDev->BlockMask = pDev->BlockSize - 1;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("BlockSize: %d, MailboxAddress:0x%X \n",
++ pDev->BlockSize, pDev->MailboxAddress));
++
++ pDev->GetPendingEventsFunc = NULL;
++ /* see if the HIF layer implements the get pending events function */
++ HIFConfigureDevice(pDev->HIFDevice,
++ HIF_DEVICE_GET_PENDING_EVENTS_FUNC,
++ &pDev->GetPendingEventsFunc,
++ sizeof(pDev->GetPendingEventsFunc));
++
++ /* assume we can process HIF interrupt events asynchronously */
++ pDev->HifIRQProcessingMode = HIF_DEVICE_IRQ_ASYNC_SYNC;
++
++ /* see if the HIF layer overrides this assumption */
++ HIFConfigureDevice(pDev->HIFDevice,
++ HIF_DEVICE_GET_IRQ_PROC_MODE,
++ &pDev->HifIRQProcessingMode,
++ sizeof(pDev->HifIRQProcessingMode));
++
++ switch (pDev->HifIRQProcessingMode) {
++ case HIF_DEVICE_IRQ_SYNC_ONLY:
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("HIF Interrupt processing is SYNC ONLY\n"));
++ break;
++ case HIF_DEVICE_IRQ_ASYNC_SYNC:
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("HIF Interrupt processing is ASYNC and SYNC\n"));
++ break;
++ default:
++ AR_DEBUG_ASSERT(FALSE);
++ }
++
++ pDev->HifMaskUmaskRecvEvent = NULL;
++
++ /* see if the HIF layer implements the mask/unmask recv events function */
++ HIFConfigureDevice(pDev->HIFDevice,
++ HIF_DEVICE_GET_RECV_EVENT_MASK_UNMASK_FUNC,
++ &pDev->HifMaskUmaskRecvEvent,
++ sizeof(pDev->HifMaskUmaskRecvEvent));
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("HIF special overrides : 0x%X , 0x%X\n",
++ (A_UINT32)pDev->GetPendingEventsFunc, (A_UINT32)pDev->HifMaskUmaskRecvEvent));
++
++ status = DevDisableInterrupts(pDev);
++
++ } while (FALSE);
++
++ if (A_FAILED(status)) {
++ /* make sure handle is cleared */
++ HIFSetHandle(pDev->HIFDevice, NULL);
++ }
++
++ return status;
++
++}
++
++static A_STATUS DevEnableInterrupts(AR6K_DEVICE *pDev)
++{
++ A_STATUS status;
++ AR6K_IRQ_ENABLE_REGISTERS regs;
++
++ LOCK_AR6K(pDev);
++
++ /* Enable all the interrupts except for the dragon interrupt */
++ pDev->IrqEnableRegisters.int_status_enable = INT_STATUS_ENABLE_ERROR_SET(0x01) |
++ INT_STATUS_ENABLE_CPU_SET(0x01) |
++ INT_STATUS_ENABLE_COUNTER_SET(0x01);
++
++ if (NULL == pDev->GetPendingEventsFunc) {
++ pDev->IrqEnableRegisters.int_status_enable |= INT_STATUS_ENABLE_MBOX_DATA_SET(0x01);
++ } else {
++ /* The HIF layer provided us with a pending events function which means that
++ * the detection of pending mbox messages is handled in the HIF layer.
++ * This is the case for the SPI2 interface.
++ * In the normal case we enable MBOX interrupts, for the case
++ * with HIFs that offer this mechanism, we keep these interrupts
++ * masked */
++ pDev->IrqEnableRegisters.int_status_enable &= ~INT_STATUS_ENABLE_MBOX_DATA_SET(0x01);
++ }
++
++
++ /* Set up the CPU Interrupt Status Register */
++ pDev->IrqEnableRegisters.cpu_int_status_enable = CPU_INT_STATUS_ENABLE_BIT_SET(0x00);
++
++ /* Set up the Error Interrupt Status Register */
++ pDev->IrqEnableRegisters.error_status_enable =
++ ERROR_STATUS_ENABLE_RX_UNDERFLOW_SET(0x01) |
++ ERROR_STATUS_ENABLE_TX_OVERFLOW_SET(0x01);
++
++ /* Set up the Counter Interrupt Status Register (only for debug interrupt to catch fatal errors) */
++ pDev->IrqEnableRegisters.counter_int_status_enable =
++ COUNTER_INT_STATUS_ENABLE_BIT_SET(AR6K_TARGET_DEBUG_INTR_MASK);
++
++ /* copy into our temp area */
++ A_MEMCPY(&regs,&pDev->IrqEnableRegisters,AR6K_IRQ_ENABLE_REGS_SIZE);
++
++ UNLOCK_AR6K(pDev);
++
++ /* always synchronous */
++ status = HIFReadWrite(pDev->HIFDevice,
++ INT_STATUS_ENABLE_ADDRESS,
++ &regs.int_status_enable,
++ AR6K_IRQ_ENABLE_REGS_SIZE,
++ HIF_WR_SYNC_BYTE_INC,
++ NULL);
++
++ if (status != A_OK) {
++ /* Can't write it for some reason */
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
++ ("Failed to update interrupt control registers err: %d\n", status));
++
++ }
++
++ return status;
++}
++
++static A_STATUS DevDisableInterrupts(AR6K_DEVICE *pDev)
++{
++ AR6K_IRQ_ENABLE_REGISTERS regs;
++
++ LOCK_AR6K(pDev);
++ /* Disable all interrupts */
++ pDev->IrqEnableRegisters.int_status_enable = 0;
++ pDev->IrqEnableRegisters.cpu_int_status_enable = 0;
++ pDev->IrqEnableRegisters.error_status_enable = 0;
++ pDev->IrqEnableRegisters.counter_int_status_enable = 0;
++ /* copy into our temp area */
++ A_MEMCPY(&regs,&pDev->IrqEnableRegisters,AR6K_IRQ_ENABLE_REGS_SIZE);
++
++ UNLOCK_AR6K(pDev);
++
++ /* always synchronous */
++ return HIFReadWrite(pDev->HIFDevice,
++ INT_STATUS_ENABLE_ADDRESS,
++ &regs.int_status_enable,
++ AR6K_IRQ_ENABLE_REGS_SIZE,
++ HIF_WR_SYNC_BYTE_INC,
++ NULL);
++}
++
++/* enable device interrupts */
++A_STATUS DevUnmaskInterrupts(AR6K_DEVICE *pDev)
++{
++ /* Unmask the host controller interrupts */
++ HIFUnMaskInterrupt(pDev->HIFDevice);
++
++ return DevEnableInterrupts(pDev);
++}
++
++/* disable all device interrupts */
++A_STATUS DevMaskInterrupts(AR6K_DEVICE *pDev)
++{
++ A_STATUS status;
++
++ status = DevDisableInterrupts(pDev);
++
++ if (A_SUCCESS(status)) {
++ /* Disable the interrupt at the HIF layer */
++ HIFMaskInterrupt(pDev->HIFDevice);
++ }
++
++ return status;
++}
++
++/* callback when our fetch to enable/disable completes */
++static void DevDoEnableDisableRecvAsyncHandler(void *Context, HTC_PACKET *pPacket)
++{
++ AR6K_DEVICE *pDev = (AR6K_DEVICE *)Context;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("+DevDoEnableDisableRecvAsyncHandler: (dev: 0x%X)\n", (A_UINT32)pDev));
++
++ if (A_FAILED(pPacket->Status)) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
++ (" Failed to disable receiver, status:%d \n", pPacket->Status));
++ }
++ /* free this IO packet */
++ AR6KFreeIOPacket(pDev,pPacket);
++ AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("-DevDoEnableDisableRecvAsyncHandler \n"));
++}
++
++/* disable packet reception (used in case the host runs out of buffers)
++ * this is the "override" method when the HIF reports another methods to
++ * disable recv events */
++static A_STATUS DevDoEnableDisableRecvOverride(AR6K_DEVICE *pDev, A_BOOL EnableRecv, A_BOOL AsyncMode)
++{
++ A_STATUS status = A_OK;
++ HTC_PACKET *pIOPacket = NULL;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("DevDoEnableDisableRecvOverride: Enable:%d Mode:%d\n",
++ EnableRecv,AsyncMode));
++
++ do {
++
++ if (AsyncMode) {
++
++ pIOPacket = AR6KAllocIOPacket(pDev);
++
++ if (NULL == pIOPacket) {
++ status = A_NO_MEMORY;
++ AR_DEBUG_ASSERT(FALSE);
++ break;
++ }
++
++ /* stick in our completion routine when the I/O operation completes */
++ pIOPacket->Completion = DevDoEnableDisableRecvAsyncHandler;
++ pIOPacket->pContext = pDev;
++
++ /* call the HIF layer override and do this asynchronously */
++ status = pDev->HifMaskUmaskRecvEvent(pDev->HIFDevice,
++ EnableRecv ? HIF_UNMASK_RECV : HIF_MASK_RECV,
++ pIOPacket);
++ break;
++ }
++
++ /* if we get here we are doing it synchronously */
++ status = pDev->HifMaskUmaskRecvEvent(pDev->HIFDevice,
++ EnableRecv ? HIF_UNMASK_RECV : HIF_MASK_RECV,
++ NULL);
++
++ } while (FALSE);
++
++ if (A_FAILED(status) && (pIOPacket != NULL)) {
++ AR6KFreeIOPacket(pDev,pIOPacket);
++ }
++
++ return status;
++}
++
++/* disable packet reception (used in case the host runs out of buffers)
++ * this is the "normal" method using the interrupt enable registers through
++ * the host I/F */
++static A_STATUS DevDoEnableDisableRecvNormal(AR6K_DEVICE *pDev, A_BOOL EnableRecv, A_BOOL AsyncMode)
++{
++ A_STATUS status = A_OK;
++ HTC_PACKET *pIOPacket = NULL;
++ AR6K_IRQ_ENABLE_REGISTERS regs;
++
++ /* take the lock to protect interrupt enable shadows */
++ LOCK_AR6K(pDev);
++
++ if (EnableRecv) {
++ pDev->IrqEnableRegisters.int_status_enable |= INT_STATUS_ENABLE_MBOX_DATA_SET(0x01);
++ } else {
++ pDev->IrqEnableRegisters.int_status_enable &= ~INT_STATUS_ENABLE_MBOX_DATA_SET(0x01);
++ }
++
++ /* copy into our temp area */
++ A_MEMCPY(&regs,&pDev->IrqEnableRegisters,AR6K_IRQ_ENABLE_REGS_SIZE);
++ UNLOCK_AR6K(pDev);
++
++ do {
++
++ if (AsyncMode) {
++
++ pIOPacket = AR6KAllocIOPacket(pDev);
++
++ if (NULL == pIOPacket) {
++ status = A_NO_MEMORY;
++ AR_DEBUG_ASSERT(FALSE);
++ break;
++ }
++
++ /* copy values to write to our async I/O buffer */
++ A_MEMCPY(pIOPacket->pBuffer,&regs,AR6K_IRQ_ENABLE_REGS_SIZE);
++
++ /* stick in our completion routine when the I/O operation completes */
++ pIOPacket->Completion = DevDoEnableDisableRecvAsyncHandler;
++ pIOPacket->pContext = pDev;
++
++ /* write it out asynchronously */
++ HIFReadWrite(pDev->HIFDevice,
++ INT_STATUS_ENABLE_ADDRESS,
++ pIOPacket->pBuffer,
++ AR6K_IRQ_ENABLE_REGS_SIZE,
++ HIF_WR_ASYNC_BYTE_INC,
++ pIOPacket);
++ break;
++ }
++
++ /* if we get here we are doing it synchronously */
++
++ status = HIFReadWrite(pDev->HIFDevice,
++ INT_STATUS_ENABLE_ADDRESS,
++ &regs.int_status_enable,
++ AR6K_IRQ_ENABLE_REGS_SIZE,
++ HIF_WR_SYNC_BYTE_INC,
++ NULL);
++
++ } while (FALSE);
++
++ if (A_FAILED(status) && (pIOPacket != NULL)) {
++ AR6KFreeIOPacket(pDev,pIOPacket);
++ }
++
++ return status;
++}
++
++
++A_STATUS DevStopRecv(AR6K_DEVICE *pDev, A_BOOL AsyncMode)
++{
++ if (NULL == pDev->HifMaskUmaskRecvEvent) {
++ return DevDoEnableDisableRecvNormal(pDev,FALSE,AsyncMode);
++ } else {
++ return DevDoEnableDisableRecvOverride(pDev,FALSE,AsyncMode);
++ }
++}
++
++A_STATUS DevEnableRecv(AR6K_DEVICE *pDev, A_BOOL AsyncMode)
++{
++ if (NULL == pDev->HifMaskUmaskRecvEvent) {
++ return DevDoEnableDisableRecvNormal(pDev,TRUE,AsyncMode);
++ } else {
++ return DevDoEnableDisableRecvOverride(pDev,TRUE,AsyncMode);
++ }
++}
++
++void DevDumpRegisters(AR6K_IRQ_PROC_REGISTERS *pIrqProcRegs,
++ AR6K_IRQ_ENABLE_REGISTERS *pIrqEnableRegs)
++{
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_DUMP, ("\n<------- Register Table -------->\n"));
++
++ if (pIrqProcRegs != NULL) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_DUMP,
++ ("Int Status: 0x%x\n",pIrqProcRegs->host_int_status));
++ AR_DEBUG_PRINTF(ATH_DEBUG_DUMP,
++ ("CPU Int Status: 0x%x\n",pIrqProcRegs->cpu_int_status));
++ AR_DEBUG_PRINTF(ATH_DEBUG_DUMP,
++ ("Error Int Status: 0x%x\n",pIrqProcRegs->error_int_status));
++ AR_DEBUG_PRINTF(ATH_DEBUG_DUMP,
++ ("Counter Int Status: 0x%x\n",pIrqProcRegs->counter_int_status));
++ AR_DEBUG_PRINTF(ATH_DEBUG_DUMP,
++ ("Mbox Frame: 0x%x\n",pIrqProcRegs->mbox_frame));
++ AR_DEBUG_PRINTF(ATH_DEBUG_DUMP,
++ ("Rx Lookahead Valid: 0x%x\n",pIrqProcRegs->rx_lookahead_valid));
++ AR_DEBUG_PRINTF(ATH_DEBUG_DUMP,
++ ("Rx Lookahead 0: 0x%x\n",pIrqProcRegs->rx_lookahead[0]));
++ AR_DEBUG_PRINTF(ATH_DEBUG_DUMP,
++ ("Rx Lookahead 1: 0x%x\n",pIrqProcRegs->rx_lookahead[1]));
++ }
++
++ if (pIrqEnableRegs != NULL) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_DUMP,
++ ("Int Status Enable: 0x%x\n",pIrqEnableRegs->int_status_enable));
++ AR_DEBUG_PRINTF(ATH_DEBUG_DUMP,
++ ("Counter Int Status Enable: 0x%x\n",pIrqEnableRegs->counter_int_status_enable));
++ AR_DEBUG_PRINTF(ATH_DEBUG_DUMP, ("<------------------------------->\n"));
++ }
++}
++
++
++#ifdef MBOXHW_UNIT_TEST
++
++
++/* This is a mailbox hardware unit test that must be called in a schedulable context
++ * This test is very simple, it will send a list of buffers with a counting pattern
++ * and the target will invert the data and send the message back
++ *
++ * the unit test has the following constraints:
++ *
++ * The target has at least 8 buffers of 256 bytes each. The host will send
++ * the following pattern of buffers in rapid succession :
++ *
++ * 1 buffer - 128 bytes
++ * 1 buffer - 256 bytes
++ * 1 buffer - 512 bytes
++ * 1 buffer - 1024 bytes
++ *
++ * The host will send the buffers to one mailbox and wait for buffers to be reflected
++ * back from the same mailbox. The target sends the buffers FIFO order.
++ * Once the final buffer has been received for a mailbox, the next mailbox is tested.
++ *
++ *
++ * Note: To simplifythe test , we assume that the chosen buffer sizes
++ * will fall on a nice block pad
++ *
++ * It is expected that higher-order tests will be written to stress the mailboxes using
++ * a message-based protocol (with some performance timming) that can create more
++ * randomness in the packets sent over mailboxes.
++ *
++ * */
++
++#define A_ROUND_UP_PWR2(x, align) (((int) (x) + ((align)-1)) & ~((align)-1))
++
++#define BUFFER_BLOCK_PAD 128
++
++#if 0
++#define BUFFER1 128
++#define BUFFER2 256
++#define BUFFER3 512
++#define BUFFER4 1024
++#endif
++
++#if 1
++#define BUFFER1 80
++#define BUFFER2 200
++#define BUFFER3 444
++#define BUFFER4 800
++#endif
++
++#define TOTAL_BYTES (A_ROUND_UP_PWR2(BUFFER1,BUFFER_BLOCK_PAD) + \
++ A_ROUND_UP_PWR2(BUFFER2,BUFFER_BLOCK_PAD) + \
++ A_ROUND_UP_PWR2(BUFFER3,BUFFER_BLOCK_PAD) + \
++ A_ROUND_UP_PWR2(BUFFER4,BUFFER_BLOCK_PAD) )
++
++#define TEST_BYTES (BUFFER1 + BUFFER2 + BUFFER3 + BUFFER4)
++
++#define TEST_CREDITS_RECV_TIMEOUT 100
++
++static A_UINT8 g_Buffer[TOTAL_BYTES];
++static A_UINT32 g_MailboxAddrs[AR6K_MAILBOXES];
++static A_UINT32 g_BlockSizes[AR6K_MAILBOXES];
++
++#define BUFFER_PROC_LIST_DEPTH 4
++
++typedef struct _BUFFER_PROC_LIST{
++ A_UINT8 *pBuffer;
++ A_UINT32 length;
++}BUFFER_PROC_LIST;
++
++
++#define PUSH_BUFF_PROC_ENTRY(pList,len,pCurrpos) \
++{ \
++ (pList)->pBuffer = (pCurrpos); \
++ (pList)->length = (len); \
++ (pCurrpos) += (len); \
++ (pList)++; \
++}
++
++/* a simple and crude way to send different "message" sizes */
++static void AssembleBufferList(BUFFER_PROC_LIST *pList)
++{
++ A_UINT8 *pBuffer = g_Buffer;
++
++#if BUFFER_PROC_LIST_DEPTH < 4
++#error "Buffer processing list depth is not deep enough!!"
++#endif
++
++ PUSH_BUFF_PROC_ENTRY(pList,BUFFER1,pBuffer);
++ PUSH_BUFF_PROC_ENTRY(pList,BUFFER2,pBuffer);
++ PUSH_BUFF_PROC_ENTRY(pList,BUFFER3,pBuffer);
++ PUSH_BUFF_PROC_ENTRY(pList,BUFFER4,pBuffer);
++
++}
++
++#define FILL_ZERO TRUE
++#define FILL_COUNTING FALSE
++static void InitBuffers(A_BOOL Zero)
++{
++ A_UINT16 *pBuffer16 = (A_UINT16 *)g_Buffer;
++ int i;
++
++ /* fill buffer with 16 bit counting pattern or zeros */
++ for (i = 0; i < (TOTAL_BYTES / 2) ; i++) {
++ if (!Zero) {
++ pBuffer16[i] = (A_UINT16)i;
++ } else {
++ pBuffer16[i] = 0;
++ }
++ }
++}
++
++
++static A_BOOL CheckOneBuffer(A_UINT16 *pBuffer16, int Length)
++{
++ int i;
++ A_UINT16 startCount;
++ A_BOOL success = TRUE;
++
++ /* get the starting count */
++ startCount = pBuffer16[0];
++ /* invert it, this is the expected value */
++ startCount = ~startCount;
++ /* scan the buffer and verify */
++ for (i = 0; i < (Length / 2) ; i++,startCount++) {
++ /* target will invert all the data */
++ if ((A_UINT16)pBuffer16[i] != (A_UINT16)~startCount) {
++ success = FALSE;
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Invalid Data Got:0x%X, Expecting:0x%X (offset:%d, total:%d) \n",
++ pBuffer16[i], ((A_UINT16)~startCount), i, Length));
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("0x%X 0x%X 0x%X 0x%X \n",
++ pBuffer16[i], pBuffer16[i + 1], pBuffer16[i + 2],pBuffer16[i+3]));
++ break;
++ }
++ }
++
++ return success;
++}
++
++static A_BOOL CheckBuffers(void)
++{
++ int i;
++ A_BOOL success = TRUE;
++ BUFFER_PROC_LIST checkList[BUFFER_PROC_LIST_DEPTH];
++
++ /* assemble the list */
++ AssembleBufferList(checkList);
++
++ /* scan the buffers and verify */
++ for (i = 0; i < BUFFER_PROC_LIST_DEPTH ; i++) {
++ success = CheckOneBuffer((A_UINT16 *)checkList[i].pBuffer, checkList[i].length);
++ if (!success) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Buffer : 0x%X, Length:%d failed verify \n",
++ (A_UINT32)checkList[i].pBuffer, checkList[i].length));
++ break;
++ }
++ }
++
++ return success;
++}
++
++ /* find the end marker for the last buffer we will be sending */
++static A_UINT16 GetEndMarker(void)
++{
++ A_UINT8 *pBuffer;
++ BUFFER_PROC_LIST checkList[BUFFER_PROC_LIST_DEPTH];
++
++ /* fill up buffers with the normal counting pattern */
++ InitBuffers(FILL_COUNTING);
++
++ /* assemble the list we will be sending down */
++ AssembleBufferList(checkList);
++ /* point to the last 2 bytes of the last buffer */
++ pBuffer = &(checkList[BUFFER_PROC_LIST_DEPTH - 1].pBuffer[(checkList[BUFFER_PROC_LIST_DEPTH - 1].length) - 2]);
++
++ /* the last count in the last buffer is the marker */
++ return (A_UINT16)pBuffer[0] | ((A_UINT16)pBuffer[1] << 8);
++}
++
++#define ATH_PRINT_OUT_ZONE ATH_DEBUG_ERR
++
++/* send the ordered buffers to the target */
++static A_STATUS SendBuffers(AR6K_DEVICE *pDev, int mbox)
++{
++ A_STATUS status = A_OK;
++ A_UINT32 request = HIF_WR_SYNC_BLOCK_INC;
++ BUFFER_PROC_LIST sendList[BUFFER_PROC_LIST_DEPTH];
++ int i;
++ int totalBytes = 0;
++ int paddedLength;
++ int totalwPadding = 0;
++
++ AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, ("Sending buffers on mailbox : %d \n",mbox));
++
++ /* fill buffer with counting pattern */
++ InitBuffers(FILL_COUNTING);
++
++ /* assemble the order in which we send */
++ AssembleBufferList(sendList);
++
++ for (i = 0; i < BUFFER_PROC_LIST_DEPTH; i++) {
++
++ /* we are doing block transfers, so we need to pad everything to a block size */
++ paddedLength = (sendList[i].length + (g_BlockSizes[mbox] - 1)) &
++ (~(g_BlockSizes[mbox] - 1));
++
++ /* send each buffer synchronously */
++ status = HIFReadWrite(pDev->HIFDevice,
++ g_MailboxAddrs[mbox],
++ sendList[i].pBuffer,
++ paddedLength,
++ request,
++ NULL);
++ if (status != A_OK) {
++ break;
++ }
++ totalBytes += sendList[i].length;
++ totalwPadding += paddedLength;
++ }
++
++ AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, ("Sent %d bytes (%d padded bytes) to mailbox : %d \n",totalBytes,totalwPadding,mbox));
++
++ return status;
++}
++
++/* poll the mailbox credit counter until we get a credit or timeout */
++static A_STATUS GetCredits(AR6K_DEVICE *pDev, int mbox, int *pCredits)
++{
++ A_STATUS status = A_OK;
++ int timeout = TEST_CREDITS_RECV_TIMEOUT;
++ A_UINT8 credits = 0;
++ A_UINT32 address;
++
++ while (TRUE) {
++
++ /* Read the counter register to get credits, this auto-decrements */
++ address = COUNT_DEC_ADDRESS + (AR6K_MAILBOXES + mbox) * 4;
++ status = HIFReadWrite(pDev->HIFDevice, address, &credits, sizeof(credits),
++ HIF_RD_SYNC_BYTE_FIX, NULL);
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
++ ("Unable to decrement the command credit count register (mbox=%d)\n",mbox));
++ status = A_ERROR;
++ break;
++ }
++
++ if (credits) {
++ break;
++ }
++
++ timeout--;
++
++ if (timeout <= 0) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
++ (" Timeout reading credit registers (mbox=%d, address:0x%X) \n",mbox,address));
++ status = A_ERROR;
++ break;
++ }
++
++ /* delay a little, target may not be ready */
++ msleep(1000);
++
++ }
++
++ if (status == A_OK) {
++ *pCredits = credits;
++ }
++
++ return status;
++}
++
++
++/* wait for the buffers to come back */
++static A_STATUS RecvBuffers(AR6K_DEVICE *pDev, int mbox)
++{
++ A_STATUS status = A_OK;
++ A_UINT32 request = HIF_RD_SYNC_BLOCK_INC;
++ BUFFER_PROC_LIST recvList[BUFFER_PROC_LIST_DEPTH];
++ int curBuffer;
++ int credits;
++ int i;
++ int totalBytes = 0;
++ int paddedLength;
++ int totalwPadding = 0;
++
++ AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, ("Waiting for buffers on mailbox : %d \n",mbox));
++
++ /* zero the buffers */
++ InitBuffers(FILL_ZERO);
++
++ /* assemble the order in which we should receive */
++ AssembleBufferList(recvList);
++
++ curBuffer = 0;
++
++ while (curBuffer < BUFFER_PROC_LIST_DEPTH) {
++
++ /* get number of buffers that have been completed, this blocks
++ * until we get at least 1 credit or it times out */
++ status = GetCredits(pDev, mbox, &credits);
++
++ if (status != A_OK) {
++ break;
++ }
++
++ AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, ("Got %d messages on mailbox : %d \n",credits, mbox));
++
++ /* get all the buffers that are sitting on the queue */
++ for (i = 0; i < credits; i++) {
++ AR_DEBUG_ASSERT(curBuffer < BUFFER_PROC_LIST_DEPTH);
++ /* recv the current buffer synchronously, the buffers should come back in
++ * order... with padding applied by the target */
++ paddedLength = (recvList[curBuffer].length + (g_BlockSizes[mbox] - 1)) &
++ (~(g_BlockSizes[mbox] - 1));
++
++ status = HIFReadWrite(pDev->HIFDevice,
++ g_MailboxAddrs[mbox],
++ recvList[curBuffer].pBuffer,
++ paddedLength,
++ request,
++ NULL);
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to read %d bytes on mailbox:%d : address:0x%X \n",
++ recvList[curBuffer].length, mbox, g_MailboxAddrs[mbox]));
++ break;
++ }
++
++ totalwPadding += paddedLength;
++ totalBytes += recvList[curBuffer].length;
++ curBuffer++;
++ }
++
++ if (status != A_OK) {
++ break;
++ }
++ /* go back and get some more */
++ credits = 0;
++ }
++
++ if (totalBytes != TEST_BYTES) {
++ AR_DEBUG_ASSERT(FALSE);
++ } else {
++ AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, ("Got all buffers on mbox:%d total recv :%d (w/Padding : %d) \n",
++ mbox, totalBytes, totalwPadding));
++ }
++
++ return status;
++
++
++}
++
++static A_STATUS DoOneMboxHWTest(AR6K_DEVICE *pDev, int mbox)
++{
++ A_STATUS status;
++
++ do {
++ /* send out buffers */
++ status = SendBuffers(pDev,mbox);
++
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Sending buffers Failed : %d mbox:%d\n",status,mbox));
++ break;
++ }
++
++ /* go get them, this will block */
++ status = RecvBuffers(pDev, mbox);
++
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Recv buffers Failed : %d mbox:%d\n",status,mbox));
++ break;
++ }
++
++ /* check the returned data patterns */
++ if (!CheckBuffers()) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Buffer Verify Failed : mbox:%d\n",mbox));
++ status = A_ERROR;
++ break;
++ }
++
++ AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, (" Send/Recv success! mailbox : %d \n",mbox));
++
++ } while (FALSE);
++
++ return status;
++}
++
++/* here is where the test starts */
++A_STATUS DoMboxHWTest(AR6K_DEVICE *pDev)
++{
++ int i;
++ A_STATUS status;
++ int credits = 0;
++ A_UINT8 params[4];
++ int numBufs;
++ int bufferSize;
++ A_UINT16 temp;
++
++
++ AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, (" DoMboxHWTest START - \n"));
++
++ do {
++ /* get the addresses for all 4 mailboxes */
++ status = HIFConfigureDevice(pDev->HIFDevice, HIF_DEVICE_GET_MBOX_ADDR,
++ g_MailboxAddrs, sizeof(g_MailboxAddrs));
++
++ if (status != A_OK) {
++ AR_DEBUG_ASSERT(FALSE);
++ break;
++ }
++
++ /* get the block sizes */
++ status = HIFConfigureDevice(pDev->HIFDevice, HIF_DEVICE_GET_MBOX_BLOCK_SIZE,
++ g_BlockSizes, sizeof(g_BlockSizes));
++
++ if (status != A_OK) {
++ AR_DEBUG_ASSERT(FALSE);
++ break;
++ }
++
++ /* note, the HIF layer usually reports mbox 0 to have a block size of
++ * 1, but our test wants to run in block-mode for all mailboxes, so we treat all mailboxes
++ * the same. */
++ g_BlockSizes[0] = g_BlockSizes[1];
++ AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, ("Block Size to use: %d \n",g_BlockSizes[0]));
++
++ if (g_BlockSizes[1] > BUFFER_BLOCK_PAD) {
++ AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, ("%d Block size is too large for buffer pad %d\n",
++ g_BlockSizes[1], BUFFER_BLOCK_PAD));
++ break;
++ }
++
++ AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, ("Waiting for target.... \n"));
++
++ /* the target lets us know it is ready by giving us 1 credit on
++ * mailbox 0 */
++ status = GetCredits(pDev, 0, &credits);
++
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to wait for target ready \n"));
++ break;
++ }
++
++ AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, ("Target is ready ...\n"));
++
++ /* read the first 4 scratch registers */
++ status = HIFReadWrite(pDev->HIFDevice,
++ SCRATCH_ADDRESS,
++ params,
++ 4,
++ HIF_RD_SYNC_BYTE_INC,
++ NULL);
++
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to wait get parameters \n"));
++ break;
++ }
++
++ numBufs = params[0];
++ bufferSize = (int)(((A_UINT16)params[2] << 8) | (A_UINT16)params[1]);
++
++ AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE,
++ ("Target parameters: bufs per mailbox:%d, buffer size:%d bytes (total space: %d, minimum required space (w/padding): %d) \n",
++ numBufs, bufferSize, (numBufs * bufferSize), TOTAL_BYTES));
++
++ if ((numBufs * bufferSize) < TOTAL_BYTES) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Not Enough buffer space to run test! need:%d, got:%d \n",
++ TOTAL_BYTES, (numBufs*bufferSize)));
++ status = A_ERROR;
++ break;
++ }
++
++ temp = GetEndMarker();
++
++ status = HIFReadWrite(pDev->HIFDevice,
++ SCRATCH_ADDRESS + 4,
++ (A_UINT8 *)&temp,
++ 2,
++ HIF_WR_SYNC_BYTE_INC,
++ NULL);
++
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to write end marker \n"));
++ break;
++ }
++
++ AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, ("End Marker: 0x%X \n",temp));
++
++ temp = (A_UINT16)g_BlockSizes[1];
++ /* convert to a mask */
++ temp = temp - 1;
++ status = HIFReadWrite(pDev->HIFDevice,
++ SCRATCH_ADDRESS + 6,
++ (A_UINT8 *)&temp,
++ 2,
++ HIF_WR_SYNC_BYTE_INC,
++ NULL);
++
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to write block mask \n"));
++ break;
++ }
++
++ AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, ("Set Block Mask: 0x%X \n",temp));
++
++ /* execute the test on each mailbox */
++ for (i = 0; i < AR6K_MAILBOXES; i++) {
++ status = DoOneMboxHWTest(pDev, i);
++ if (status != A_OK) {
++ break;
++ }
++ }
++
++ } while (FALSE);
++
++ if (status == A_OK) {
++ AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, (" DoMboxHWTest DONE - SUCCESS! - \n"));
++ } else {
++ AR_DEBUG_PRINTF(ATH_PRINT_OUT_ZONE, (" DoMboxHWTest DONE - FAILED! - \n"));
++ }
++ /* don't let HTC_Start continue, the target is actually not running any HTC code */
++ return A_ERROR;
++}
++#endif
++
++
++
+diff --git a/drivers/ar6000/htc/ar6k.h b/drivers/ar6000/htc/ar6k.h
+new file mode 100644
+index 0000000..301ab34
+--- /dev/null
++++ b/drivers/ar6000/htc/ar6k.h
+@@ -0,0 +1,191 @@
++/*
++ *
++ * Copyright (c) 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 AR6K_H_
++#define AR6K_H_
++
++#define AR6K_MAILBOXES 4
++
++/* HTC runs over mailbox 0 */
++#define HTC_MAILBOX 0
++
++#define AR6K_TARGET_DEBUG_INTR_MASK 0x01
++
++#define OTHER_INTS_ENABLED (INT_STATUS_ENABLE_ERROR_MASK | \
++ INT_STATUS_ENABLE_CPU_MASK | \
++ INT_STATUS_ENABLE_COUNTER_MASK)
++
++//#define MBOXHW_UNIT_TEST 1
++
++#include "athstartpack.h"
++typedef PREPACK struct _AR6K_IRQ_PROC_REGISTERS {
++ A_UINT8 host_int_status;
++ A_UINT8 cpu_int_status;
++ A_UINT8 error_int_status;
++ A_UINT8 counter_int_status;
++ A_UINT8 mbox_frame;
++ A_UINT8 rx_lookahead_valid;
++ A_UINT8 hole[2];
++ A_UINT32 rx_lookahead[2];
++} POSTPACK AR6K_IRQ_PROC_REGISTERS;
++
++#define AR6K_IRQ_PROC_REGS_SIZE sizeof(AR6K_IRQ_PROC_REGISTERS)
++
++
++
++typedef PREPACK struct _AR6K_IRQ_ENABLE_REGISTERS {
++ A_UINT8 int_status_enable;
++ A_UINT8 cpu_int_status_enable;
++ A_UINT8 error_status_enable;
++ A_UINT8 counter_int_status_enable;
++} POSTPACK AR6K_IRQ_ENABLE_REGISTERS;
++
++#include "athendpack.h"
++
++#define AR6K_IRQ_ENABLE_REGS_SIZE sizeof(AR6K_IRQ_ENABLE_REGISTERS)
++
++#define AR6K_REG_IO_BUFFER_SIZE 32
++#define AR6K_MAX_REG_IO_BUFFERS 8
++
++/* buffers for ASYNC I/O */
++typedef struct AR6K_ASYNC_REG_IO_BUFFER {
++ HTC_PACKET HtcPacket; /* we use an HTC packet as a wrapper for our async register-based I/O */
++ A_UINT8 Buffer[AR6K_REG_IO_BUFFER_SIZE];
++} AR6K_ASYNC_REG_IO_BUFFER;
++
++typedef struct _AR6K_DEVICE {
++ A_MUTEX_T Lock;
++ AR6K_IRQ_PROC_REGISTERS IrqProcRegisters;
++ AR6K_IRQ_ENABLE_REGISTERS IrqEnableRegisters;
++ void *HIFDevice;
++ A_UINT32 BlockSize;
++ A_UINT32 BlockMask;
++ A_UINT32 MailboxAddress;
++ HIF_PENDING_EVENTS_FUNC GetPendingEventsFunc;
++ void *HTCContext;
++ HTC_PACKET_QUEUE RegisterIOList;
++ AR6K_ASYNC_REG_IO_BUFFER RegIOBuffers[AR6K_MAX_REG_IO_BUFFERS];
++ void (*TargetFailureCallback)(void *Context);
++ A_STATUS (*MessagePendingCallback)(void *Context, A_UINT32 LookAhead, A_BOOL *pAsyncProc);
++ HIF_DEVICE_IRQ_PROCESSING_MODE HifIRQProcessingMode;
++ HIF_MASK_UNMASK_RECV_EVENT HifMaskUmaskRecvEvent;
++} AR6K_DEVICE;
++
++#define IS_DEV_IRQ_PROCESSING_ASYNC_ALLOWED(pDev) ((pDev)->HifIRQProcessingMode != HIF_DEVICE_IRQ_SYNC_ONLY)
++
++A_STATUS DevSetup(AR6K_DEVICE *pDev);
++A_STATUS DevUnmaskInterrupts(AR6K_DEVICE *pDev);
++A_STATUS DevMaskInterrupts(AR6K_DEVICE *pDev);
++A_STATUS DevPollMboxMsgRecv(AR6K_DEVICE *pDev,
++ A_UINT32 *pLookAhead,
++ int TimeoutMS);
++A_STATUS DevRWCompletionHandler(void *context, A_STATUS status);
++A_STATUS DevDsrHandler(void *context);
++A_STATUS DevCheckPendingRecvMsgsAsync(void *context);
++void DevDumpRegisters(AR6K_IRQ_PROC_REGISTERS *pIrqProcRegs,
++ AR6K_IRQ_ENABLE_REGISTERS *pIrqEnableRegs);
++
++#define DEV_STOP_RECV_ASYNC TRUE
++#define DEV_STOP_RECV_SYNC FALSE
++#define DEV_ENABLE_RECV_ASYNC TRUE
++#define DEV_ENABLE_RECV_SYNC FALSE
++A_STATUS DevStopRecv(AR6K_DEVICE *pDev, A_BOOL ASyncMode);
++A_STATUS DevEnableRecv(AR6K_DEVICE *pDev, A_BOOL ASyncMode);
++
++static INLINE A_STATUS DevSendPacket(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_UINT32 SendLength) {
++ A_UINT32 paddedLength;
++ A_BOOL sync = (pPacket->Completion == NULL) ? TRUE : FALSE;
++ A_STATUS status;
++
++ /* adjust the length to be a multiple of block size if appropriate */
++ paddedLength = (SendLength + (pDev->BlockMask)) &
++ (~(pDev->BlockMask));
++#if 0 // BufferLength may not be set in , fix this...
++ if (paddedLength > pPacket->BufferLength) {
++ AR_DEBUG_ASSERT(FALSE);
++ if (pPacket->Completion != NULL) {
++ COMPLETE_HTC_PACKET(pPacket,A_EINVAL);
++ }
++ return A_EINVAL;
++ }
++#endif
++ AR_DEBUG_PRINTF(ATH_DEBUG_SEND,
++ ("DevSendPacket, Padded Length: %d Mbox:0x%X (mode:%s)\n",
++ paddedLength,
++ pDev->MailboxAddress,
++ sync ? "SYNC" : "ASYNC"));
++
++ status = HIFReadWrite(pDev->HIFDevice,
++ pDev->MailboxAddress,
++ pPacket->pBuffer,
++ paddedLength, /* the padded length */
++ sync ? HIF_WR_SYNC_BLOCK_INC : HIF_WR_ASYNC_BLOCK_INC,
++ sync ? NULL : pPacket); /* pass the packet as the context to the HIF request */
++
++ if (sync) {
++ pPacket->Status = status;
++ }
++
++ return status;
++}
++
++static INLINE A_STATUS DevRecvPacket(AR6K_DEVICE *pDev, HTC_PACKET *pPacket, A_UINT32 RecvLength) {
++ A_UINT32 paddedLength;
++ A_STATUS status;
++ A_BOOL sync = (pPacket->Completion == NULL) ? TRUE : FALSE;
++
++ /* adjust the length to be a multiple of block size if appropriate */
++ paddedLength = (RecvLength + (pDev->BlockMask)) &
++ (~(pDev->BlockMask));
++ if (paddedLength > pPacket->BufferLength) {
++ AR_DEBUG_ASSERT(FALSE);
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
++ ("DevRecvPacket, Not enough space for padlen:%d recvlen:%d bufferlen:%d \n",
++ paddedLength,RecvLength,pPacket->BufferLength));
++ if (pPacket->Completion != NULL) {
++ COMPLETE_HTC_PACKET(pPacket,A_EINVAL);
++ }
++ return A_EINVAL;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_RECV,
++ ("DevRecvPacket, Padded Length: %d Mbox:0x%X (mode:%s)\n",
++ paddedLength,
++ pDev->MailboxAddress,
++ sync ? "SYNC" : "ASYNC"));
++
++ status = HIFReadWrite(pDev->HIFDevice,
++ pDev->MailboxAddress,
++ pPacket->pBuffer,
++ paddedLength,
++ sync ? HIF_RD_SYNC_BLOCK_INC : HIF_RD_ASYNC_BLOCK_INC,
++ sync ? NULL : pPacket); /* pass the packet as the context to the HIF request */
++
++ if (sync) {
++ pPacket->Status = status;
++ }
++
++ return status;
++}
++
++#ifdef MBOXHW_UNIT_TEST
++A_STATUS DoMboxHWTest(AR6K_DEVICE *pDev);
++#endif
++
++#endif /*AR6K_H_*/
+diff --git a/drivers/ar6000/htc/ar6k_events.c b/drivers/ar6000/htc/ar6k_events.c
+new file mode 100644
+index 0000000..91b29af
+--- /dev/null
++++ b/drivers/ar6000/htc/ar6k_events.c
+@@ -0,0 +1,638 @@
++/*
++ * AR6K Driver layer event handling (i.e. interrupts, message polling)
++ *
++ * Copyright (c) 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 "a_config.h"
++#include "athdefs.h"
++#include "a_types.h"
++#include "AR6Khwreg.h"
++#include "a_osapi.h"
++#include "a_debug.h"
++#include "hif.h"
++#include "htc_packet.h"
++#include "ar6k.h"
++
++extern void AR6KFreeIOPacket(AR6K_DEVICE *pDev, HTC_PACKET *pPacket);
++extern HTC_PACKET *AR6KAllocIOPacket(AR6K_DEVICE *pDev);
++
++static A_STATUS DevServiceDebugInterrupt(AR6K_DEVICE *pDev);
++
++#define DELAY_PER_INTERVAL_MS 10 /* 10 MS delay per polling interval */
++
++/* completion routine for ALL HIF layer async I/O */
++A_STATUS DevRWCompletionHandler(void *context, A_STATUS status)
++{
++ HTC_PACKET *pPacket = (HTC_PACKET *)context;
++
++ COMPLETE_HTC_PACKET(pPacket,status);
++
++ return A_OK;
++}
++
++/* mailbox recv message polling */
++A_STATUS DevPollMboxMsgRecv(AR6K_DEVICE *pDev,
++ A_UINT32 *pLookAhead,
++ int TimeoutMS)
++{
++ A_STATUS status = A_OK;
++ int timeout = TimeoutMS/DELAY_PER_INTERVAL_MS;
++
++ AR_DEBUG_ASSERT(timeout > 0);
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("+DevPollMboxMsgRecv \n"));
++
++ while (TRUE) {
++
++ if (pDev->GetPendingEventsFunc != NULL)
++ {
++
++ HIF_PENDING_EVENTS_INFO events;
++
++ /* the HIF layer uses a special mechanism to get events, do this
++ * synchronously */
++ status = pDev->GetPendingEventsFunc(pDev->HIFDevice,
++ &events,
++ NULL);
++ if (A_FAILED(status))
++ {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Failed to get pending events \n"));
++ break;
++ }
++
++ if (events.Events & HIF_RECV_MSG_AVAIL)
++ {
++ /* there is a message available, the lookahead should be valid now */
++ *pLookAhead = events.LookAhead;
++
++ break;
++ }
++ }
++ else
++ {
++
++ /* this is the standard HIF way.... */
++ /* load the register table */
++ status = HIFReadWrite(pDev->HIFDevice,
++ HOST_INT_STATUS_ADDRESS,
++ (A_UINT8 *)&pDev->IrqProcRegisters,
++ AR6K_IRQ_PROC_REGS_SIZE,
++ HIF_RD_SYNC_BYTE_INC,
++ NULL);
++
++ if (A_FAILED(status))
++ {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Failed to read register table \n"));
++ break;
++ }
++
++ /* check for MBOX data and valid lookahead */
++ if (pDev->IrqProcRegisters.host_int_status & (1 << HTC_MAILBOX))
++ {
++ if (pDev->IrqProcRegisters.rx_lookahead_valid & (1 << HTC_MAILBOX))
++ {
++ /* mailbox has a message and the look ahead is valid */
++ *pLookAhead = pDev->IrqProcRegisters.rx_lookahead[HTC_MAILBOX];
++ break;
++ }
++ }
++
++ }
++
++ timeout--;
++
++ if (timeout <= 0)
++ {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, (" Timeout waiting for recv message \n"));
++ status = A_ERROR;
++
++ /* check if the target asserted */
++ if ( pDev->IrqProcRegisters.counter_int_status & AR6K_TARGET_DEBUG_INTR_MASK) {
++ /* target signaled an assert, process this pending interrupt
++ * this will call the target failure handler */
++ DevServiceDebugInterrupt(pDev);
++ }
++
++ break;
++ }
++
++ /* delay a little */
++ msleep(DELAY_PER_INTERVAL_MS);
++ AR_DEBUG_PRINTF(ATH_DEBUG_RECV,(" Retry Mbox Poll : %d \n",timeout));
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("-DevPollMboxMsgRecv \n"));
++
++ return status;
++}
++
++static A_STATUS DevServiceCPUInterrupt(AR6K_DEVICE *pDev)
++{
++ A_STATUS status;
++ A_UINT8 cpu_int_status;
++ A_UINT8 regBuffer[4];
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, ("CPU Interrupt\n"));
++ cpu_int_status = pDev->IrqProcRegisters.cpu_int_status &
++ pDev->IrqEnableRegisters.cpu_int_status_enable;
++ AR_DEBUG_ASSERT(cpu_int_status);
++ AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,
++ ("Valid interrupt source(s) in CPU_INT_STATUS: 0x%x\n",
++ cpu_int_status));
++
++ /* Clear the interrupt */
++ pDev->IrqProcRegisters.cpu_int_status &= ~cpu_int_status; /* W1C */
++
++ /* set up the register transfer buffer to hit the register 4 times , this is done
++ * to make the access 4-byte aligned to mitigate issues with host bus interconnects that
++ * restrict bus transfer lengths to be a multiple of 4-bytes */
++
++ /* set W1C value to clear the interrupt, this hits the register first */
++ regBuffer[0] = cpu_int_status;
++ /* the remaining 4 values are set to zero which have no-effect */
++ regBuffer[1] = 0;
++ regBuffer[2] = 0;
++ regBuffer[3] = 0;
++
++ status = HIFReadWrite(pDev->HIFDevice,
++ CPU_INT_STATUS_ADDRESS,
++ regBuffer,
++ 4,
++ HIF_WR_SYNC_BYTE_FIX,
++ NULL);
++
++ AR_DEBUG_ASSERT(status == A_OK);
++ return status;
++}
++
++
++static A_STATUS DevServiceErrorInterrupt(AR6K_DEVICE *pDev)
++{
++ A_STATUS status;
++ A_UINT8 error_int_status;
++ A_UINT8 regBuffer[4];
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, ("Error Interrupt\n"));
++ error_int_status = pDev->IrqProcRegisters.error_int_status & 0x0F;
++ AR_DEBUG_ASSERT(error_int_status);
++ AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,
++ ("Valid interrupt source(s) in ERROR_INT_STATUS: 0x%x\n",
++ error_int_status));
++
++ if (ERROR_INT_STATUS_WAKEUP_GET(error_int_status)) {
++ /* Wakeup */
++ AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, ("Error : Wakeup\n"));
++ }
++
++ if (ERROR_INT_STATUS_RX_UNDERFLOW_GET(error_int_status)) {
++ /* Rx Underflow */
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Error : Rx Underflow\n"));
++ }
++
++ if (ERROR_INT_STATUS_TX_OVERFLOW_GET(error_int_status)) {
++ /* Tx Overflow */
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Error : Tx Overflow\n"));
++ }
++
++ /* Clear the interrupt */
++ pDev->IrqProcRegisters.error_int_status &= ~error_int_status; /* W1C */
++
++ /* set up the register transfer buffer to hit the register 4 times , this is done
++ * to make the access 4-byte aligned to mitigate issues with host bus interconnects that
++ * restrict bus transfer lengths to be a multiple of 4-bytes */
++
++ /* set W1C value to clear the interrupt, this hits the register first */
++ regBuffer[0] = error_int_status;
++ /* the remaining 4 values are set to zero which have no-effect */
++ regBuffer[1] = 0;
++ regBuffer[2] = 0;
++ regBuffer[3] = 0;
++
++ status = HIFReadWrite(pDev->HIFDevice,
++ ERROR_INT_STATUS_ADDRESS,
++ regBuffer,
++ 4,
++ HIF_WR_SYNC_BYTE_FIX,
++ NULL);
++
++ AR_DEBUG_ASSERT(status == A_OK);
++ return status;
++}
++
++static A_STATUS DevServiceDebugInterrupt(AR6K_DEVICE *pDev)
++{
++ A_UINT32 dummy;
++ A_STATUS status;
++
++ /* Send a target failure event to the application */
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Target debug interrupt\n"));
++
++ if (pDev->TargetFailureCallback != NULL) {
++ pDev->TargetFailureCallback(pDev->HTCContext);
++ }
++
++ /* clear the interrupt , the debug error interrupt is
++ * counter 0 */
++ /* read counter to clear interrupt */
++ status = HIFReadWrite(pDev->HIFDevice,
++ COUNT_DEC_ADDRESS,
++ (A_UINT8 *)&dummy,
++ 4,
++ HIF_RD_SYNC_BYTE_INC,
++ NULL);
++
++ AR_DEBUG_ASSERT(status == A_OK);
++ return status;
++}
++
++static A_STATUS DevServiceCounterInterrupt(AR6K_DEVICE *pDev)
++{
++ A_UINT8 counter_int_status;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_IRQ, ("Counter Interrupt\n"));
++
++ counter_int_status = pDev->IrqProcRegisters.counter_int_status &
++ pDev->IrqEnableRegisters.counter_int_status_enable;
++
++ AR_DEBUG_ASSERT(counter_int_status);
++ AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,
++ ("Valid interrupt source(s) in COUNTER_INT_STATUS: 0x%x\n",
++ counter_int_status));
++
++ /* Check if the debug interrupt is pending */
++ if (counter_int_status & AR6K_TARGET_DEBUG_INTR_MASK) {
++ return DevServiceDebugInterrupt(pDev);
++ }
++
++ return A_OK;
++}
++
++/* callback when our fetch to get interrupt status registers completes */
++static void DevGetEventAsyncHandler(void *Context, HTC_PACKET *pPacket)
++{
++ AR6K_DEVICE *pDev = (AR6K_DEVICE *)Context;
++ A_UINT32 lookAhead = 0;
++ A_BOOL otherInts = FALSE;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("+DevGetEventAsyncHandler: (dev: 0x%X)\n", (A_UINT32)pDev));
++
++ do {
++
++ if (A_FAILED(pPacket->Status)) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
++ (" GetEvents I/O request failed, status:%d \n", pPacket->Status));
++ /* bail out, don't unmask HIF interrupt */
++ break;
++ }
++
++ if (pDev->GetPendingEventsFunc != NULL) {
++ /* the HIF layer collected the information for us */
++ HIF_PENDING_EVENTS_INFO *pEvents = (HIF_PENDING_EVENTS_INFO *)pPacket->pBuffer;
++ if (pEvents->Events & HIF_RECV_MSG_AVAIL) {
++ lookAhead = pEvents->LookAhead;
++ if (0 == lookAhead) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,(" DevGetEventAsyncHandler1, lookAhead is zero! \n"));
++ }
++ }
++ if (pEvents->Events & HIF_OTHER_EVENTS) {
++ otherInts = TRUE;
++ }
++ } else {
++ /* standard interrupt table handling.... */
++ AR6K_IRQ_PROC_REGISTERS *pReg = (AR6K_IRQ_PROC_REGISTERS *)pPacket->pBuffer;
++ A_UINT8 host_int_status;
++
++ host_int_status = pReg->host_int_status & pDev->IrqEnableRegisters.int_status_enable;
++
++ if (host_int_status & (1 << HTC_MAILBOX)) {
++ host_int_status &= ~(1 << HTC_MAILBOX);
++ if (pReg->rx_lookahead_valid & (1 << HTC_MAILBOX)) {
++ /* mailbox has a message and the look ahead is valid */
++ lookAhead = pReg->rx_lookahead[HTC_MAILBOX];
++ if (0 == lookAhead) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,(" DevGetEventAsyncHandler2, lookAhead is zero! \n"));
++ }
++ }
++ }
++
++ if (host_int_status) {
++ /* there are other interrupts to handle */
++ otherInts = TRUE;
++ }
++ }
++
++ if (otherInts || (lookAhead == 0)) {
++ /* if there are other interrupts to process, we cannot do this in the async handler so
++ * ack the interrupt which will cause our sync handler to run again
++ * if however there are no more messages, we can now ack the interrupt */
++ AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,
++ (" Acking interrupt from DevGetEventAsyncHandler (otherints:%d, lookahead:0x%X)\n",
++ otherInts, lookAhead));
++ HIFAckInterrupt(pDev->HIFDevice);
++ } else {
++ AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,
++ (" DevGetEventAsyncHandler : detected another message, lookahead :0x%X \n",
++ lookAhead));
++ /* lookahead is non-zero and there are no other interrupts to service,
++ * go get the next message */
++ pDev->MessagePendingCallback(pDev->HTCContext, lookAhead, NULL);
++ }
++
++ } while (FALSE);
++
++ /* free this IO packet */
++ AR6KFreeIOPacket(pDev,pPacket);
++ AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("-DevGetEventAsyncHandler \n"));
++}
++
++/* called by the HTC layer when it wants us to check if the device has any more pending
++ * recv messages, this starts off a series of async requests to read interrupt registers */
++A_STATUS DevCheckPendingRecvMsgsAsync(void *context)
++{
++ AR6K_DEVICE *pDev = (AR6K_DEVICE *)context;
++ A_STATUS status = A_OK;
++ HTC_PACKET *pIOPacket;
++
++ /* this is called in an ASYNC only context, we may NOT block, sleep or call any apis that can
++ * cause us to switch contexts */
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("+DevCheckPendingRecvMsgsAsync: (dev: 0x%X)\n", (A_UINT32)pDev));
++
++ do {
++
++ if (HIF_DEVICE_IRQ_SYNC_ONLY == pDev->HifIRQProcessingMode) {
++ /* break the async processing chain right here, no need to continue.
++ * The DevDsrHandler() will handle things in a loop when things are driven
++ * synchronously */
++ break;
++ }
++ /* first allocate one of our HTC packets we created for async I/O
++ * we reuse HTC packet definitions so that we can use the completion mechanism
++ * in DevRWCompletionHandler() */
++ pIOPacket = AR6KAllocIOPacket(pDev);
++
++ if (NULL == pIOPacket) {
++ /* there should be only 1 asynchronous request out at a time to read these registers
++ * so this should actually never happen */
++ status = A_NO_MEMORY;
++ AR_DEBUG_ASSERT(FALSE);
++ break;
++ }
++
++ /* stick in our completion routine when the I/O operation completes */
++ pIOPacket->Completion = DevGetEventAsyncHandler;
++ pIOPacket->pContext = pDev;
++
++ if (pDev->GetPendingEventsFunc) {
++ /* HIF layer has it's own mechanism, pass the IO to it.. */
++ status = pDev->GetPendingEventsFunc(pDev->HIFDevice,
++ (HIF_PENDING_EVENTS_INFO *)pIOPacket->pBuffer,
++ pIOPacket);
++
++ } else {
++ /* standard way, read the interrupt register table asynchronously again */
++ status = HIFReadWrite(pDev->HIFDevice,
++ HOST_INT_STATUS_ADDRESS,
++ pIOPacket->pBuffer,
++ AR6K_IRQ_PROC_REGS_SIZE,
++ HIF_RD_ASYNC_BYTE_INC,
++ pIOPacket);
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,(" Async IO issued to get interrupt status...\n"));
++ } while (FALSE);
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("-DevCheckPendingRecvMsgsAsync \n"));
++
++ return status;
++}
++
++/* process pending interrupts synchronously */
++static A_STATUS ProcessPendingIRQs(AR6K_DEVICE *pDev, A_BOOL *pDone, A_BOOL *pASyncProcessing)
++{
++ A_STATUS status = A_OK;
++ A_UINT8 host_int_status = 0;
++ A_UINT32 lookAhead = 0;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("+ProcessPendingIRQs: (dev: 0x%X)\n", (A_UINT32)pDev));
++
++ /*** NOTE: the HIF implementation guarantees that the context of this call allows
++ * us to perform SYNCHRONOUS I/O, that is we can block, sleep or call any API that
++ * can block or switch thread/task ontexts.
++ * This is a fully schedulable context.
++ * */
++ do {
++
++ if (pDev->GetPendingEventsFunc != NULL) {
++ HIF_PENDING_EVENTS_INFO events;
++
++ /* the HIF layer uses a special mechanism to get events
++ * get this synchronously */
++ status = pDev->GetPendingEventsFunc(pDev->HIFDevice,
++ &events,
++ NULL);
++
++ if (A_FAILED(status)) {
++ break;
++ }
++
++ if (events.Events & HIF_RECV_MSG_AVAIL) {
++ lookAhead = events.LookAhead;
++ if (0 == lookAhead) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,(" ProcessPendingIRQs1 lookAhead is zero! \n"));
++ }
++ }
++
++ if (!(events.Events & HIF_OTHER_EVENTS) ||
++ !(pDev->IrqEnableRegisters.int_status_enable & OTHER_INTS_ENABLED)) {
++ /* no need to read the register table, no other interesting interrupts.
++ * Some interfaces (like SPI) can shadow interrupt sources without
++ * requiring the host to do a full table read */
++ break;
++ }
++
++ /* otherwise fall through and read the register table */
++ }
++
++ /*
++ * Read the first 28 bytes of the HTC register table. This will yield us
++ * the value of different int status registers and the lookahead
++ * registers.
++ * length = sizeof(int_status) + sizeof(cpu_int_status) +
++ * sizeof(error_int_status) + sizeof(counter_int_status) +
++ * sizeof(mbox_frame) + sizeof(rx_lookahead_valid) +
++ * sizeof(hole) + sizeof(rx_lookahead) +
++ * sizeof(int_status_enable) + sizeof(cpu_int_status_enable) +
++ * sizeof(error_status_enable) +
++ * sizeof(counter_int_status_enable);
++ *
++ */
++ status = HIFReadWrite(pDev->HIFDevice,
++ HOST_INT_STATUS_ADDRESS,
++ (A_UINT8 *)&pDev->IrqProcRegisters,
++ AR6K_IRQ_PROC_REGS_SIZE,
++ HIF_RD_SYNC_BYTE_INC,
++ NULL);
++
++ if (A_FAILED(status)) {
++ break;
++ }
++
++ if (AR_DEBUG_LVL_CHECK(ATH_DEBUG_IRQ)) {
++ DevDumpRegisters(&pDev->IrqProcRegisters,
++ &pDev->IrqEnableRegisters);
++ }
++
++ /* Update only those registers that are enabled */
++ host_int_status = pDev->IrqProcRegisters.host_int_status &
++ pDev->IrqEnableRegisters.int_status_enable;
++
++ if (NULL == pDev->GetPendingEventsFunc) {
++ /* only look at mailbox status if the HIF layer did not provide this function,
++ * on some HIF interfaces reading the RX lookahead is not valid to do */
++ if (host_int_status & (1 << HTC_MAILBOX)) {
++ /* mask out pending mailbox value, we use "lookAhead" as the real flag for
++ * mailbox processing below */
++ host_int_status &= ~(1 << HTC_MAILBOX);
++ if (pDev->IrqProcRegisters.rx_lookahead_valid & (1 << HTC_MAILBOX)) {
++ /* mailbox has a message and the look ahead is valid */
++ lookAhead = pDev->IrqProcRegisters.rx_lookahead[HTC_MAILBOX];
++ if (0 == lookAhead) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,(" ProcessPendingIRQs2, lookAhead is zero! \n"));
++ }
++ }
++ }
++ } else {
++ /* not valid to check if the HIF has another mechanism for reading mailbox pending status*/
++ host_int_status &= ~(1 << HTC_MAILBOX);
++ }
++
++ } while (FALSE);
++
++
++ do {
++
++ /* did the interrupt status fetches succeed? */
++ if (A_FAILED(status)) {
++ break;
++ }
++
++ if ((0 == host_int_status) && (0 == lookAhead)) {
++ /* nothing to process, the caller can use this to break out of a loop */
++ *pDone = TRUE;
++ break;
++ }
++
++ if (lookAhead != 0) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("Pending mailbox message, LookAhead: 0x%X\n",lookAhead));
++ /* Mailbox Interrupt, the HTC layer may issue async requests to empty the
++ * mailbox...
++ * When emptying the recv mailbox we use the async handler above called from the
++ * completion routine of the callers read request. This can improve performance
++ * by reducing context switching when we rapidly pull packets */
++ status = pDev->MessagePendingCallback(pDev->HTCContext, lookAhead, pASyncProcessing);
++ if (A_FAILED(status)) {
++ break;
++ }
++ }
++
++ /* now handle the rest of them */
++ AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,
++ (" Valid interrupt source(s) for OTHER interrupts: 0x%x\n",
++ host_int_status));
++
++ if (HOST_INT_STATUS_CPU_GET(host_int_status)) {
++ /* CPU Interrupt */
++ status = DevServiceCPUInterrupt(pDev);
++ if (A_FAILED(status)){
++ break;
++ }
++ }
++
++ if (HOST_INT_STATUS_ERROR_GET(host_int_status)) {
++ /* Error Interrupt */
++ status = DevServiceErrorInterrupt(pDev);
++ if (A_FAILED(status)){
++ break;
++ }
++ }
++
++ if (HOST_INT_STATUS_COUNTER_GET(host_int_status)) {
++ /* Counter Interrupt */
++ status = DevServiceCounterInterrupt(pDev);
++ if (A_FAILED(status)){
++ break;
++ }
++ }
++
++ } while (FALSE);
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("-ProcessPendingIRQs: (done:%d, async:%d) status=%d \n",
++ *pDone, *pASyncProcessing, status));
++
++ return status;
++}
++
++
++/* Synchronousinterrupt handler, this handler kicks off all interrupt processing.*/
++A_STATUS DevDsrHandler(void *context)
++{
++ AR6K_DEVICE *pDev = (AR6K_DEVICE *)context;
++ A_STATUS status = A_OK;
++ A_BOOL done = FALSE;
++ A_BOOL asyncProc = FALSE;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("+DevDsrHandler: (dev: 0x%X)\n", (A_UINT32)pDev));
++
++
++ while (!done) {
++ status = ProcessPendingIRQs(pDev, &done, &asyncProc);
++ if (A_FAILED(status)) {
++ break;
++ }
++
++ if (HIF_DEVICE_IRQ_SYNC_ONLY == pDev->HifIRQProcessingMode) {
++ /* the HIF layer does not allow async IRQ processing, override the asyncProc flag */
++ asyncProc = FALSE;
++ /* this will cause us to re-enter ProcessPendingIRQ() and re-read interrupt status registers.
++ * this has a nice side effect of blocking us until all async read requests are completed.
++ * This behavior is required on some HIF implementations that do not allow ASYNC
++ * processing in interrupt handlers (like Windows CE) */
++ }
++
++ if (asyncProc) {
++ /* the function performed some async I/O for performance, we
++ need to exit the ISR immediately, the check below will prevent the interrupt from being
++ Ack'd while we handle it asynchronously */
++ break;
++ }
++
++ }
++
++ if (A_SUCCESS(status) && !asyncProc) {
++ /* Ack the interrupt only if :
++ * 1. we did not get any errors in processing interrupts
++ * 2. there are no outstanding async processing requests */
++ AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,(" Acking interrupt from DevDsrHandler \n"));
++ HIFAckInterrupt(pDev->HIFDevice);
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("-DevDsrHandler \n"));
++ return A_OK;
++}
++
++
+diff --git a/drivers/ar6000/htc/htc.c b/drivers/ar6000/htc/htc.c
+new file mode 100644
+index 0000000..d52ed94
+--- /dev/null
++++ b/drivers/ar6000/htc/htc.c
+@@ -0,0 +1,508 @@
++/*
++ *
++ * Copyright (c) 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 "htc_internal.h"
++
++
++static HTC_INIT_INFO HTCInitInfo = {NULL,NULL,NULL};
++static A_BOOL HTCInitialized = FALSE;
++
++static A_STATUS HTCTargetInsertedHandler(void *hif_handle);
++static A_STATUS HTCTargetRemovedHandler(void *handle, A_STATUS status);
++static void HTCReportFailure(void *Context);
++
++/* Initializes the HTC layer */
++A_STATUS HTCInit(HTC_INIT_INFO *pInitInfo)
++{
++ HTC_CALLBACKS htcCallbacks;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("HTCInit: Enter\n"));
++ if (HTCInitialized) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("HTCInit: Exit\n"));
++ return A_OK;
++ }
++
++ A_MEMCPY(&HTCInitInfo,pInitInfo,sizeof(HTC_INIT_INFO));
++
++ A_MEMZERO(&htcCallbacks, sizeof(HTC_CALLBACKS));
++
++ /* setup HIF layer callbacks */
++ htcCallbacks.deviceInsertedHandler = HTCTargetInsertedHandler;
++ htcCallbacks.deviceRemovedHandler = HTCTargetRemovedHandler;
++ /* the device layer handles these */
++ htcCallbacks.rwCompletionHandler = DevRWCompletionHandler;
++ htcCallbacks.dsrHandler = DevDsrHandler;
++ HIFInit(&htcCallbacks);
++ HTCInitialized = TRUE;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("HTCInit: Exit\n"));
++ return A_OK;
++}
++
++void HTCFreeControlBuffer(HTC_TARGET *target, HTC_PACKET *pPacket, HTC_PACKET_QUEUE *pList)
++{
++ LOCK_HTC(target);
++ HTC_PACKET_ENQUEUE(pList,pPacket);
++ UNLOCK_HTC(target);
++}
++
++HTC_PACKET *HTCAllocControlBuffer(HTC_TARGET *target, HTC_PACKET_QUEUE *pList)
++{
++ HTC_PACKET *pPacket;
++
++ LOCK_HTC(target);
++ pPacket = HTC_PACKET_DEQUEUE(pList);
++ UNLOCK_HTC(target);
++
++ return pPacket;
++}
++
++/* cleanup the HTC instance */
++static void HTCCleanup(HTC_TARGET *target)
++{
++ if (A_IS_MUTEX_VALID(&target->HTCLock)) {
++ A_MUTEX_DELETE(&target->HTCLock);
++ }
++
++ if (A_IS_MUTEX_VALID(&target->HTCRxLock)) {
++ A_MUTEX_DELETE(&target->HTCRxLock);
++ }
++
++ if (A_IS_MUTEX_VALID(&target->HTCTxLock)) {
++ A_MUTEX_DELETE(&target->HTCTxLock);
++ }
++ /* free our instance */
++ A_FREE(target);
++}
++
++/* registered target arrival callback from the HIF layer */
++static A_STATUS HTCTargetInsertedHandler(void *hif_handle)
++{
++ HTC_TARGET *target = NULL;
++ A_STATUS status;
++ int i;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("htcTargetInserted - Enter\n"));
++
++ do {
++
++ /* allocate target memory */
++ if ((target = (HTC_TARGET *)A_MALLOC(sizeof(HTC_TARGET))) == NULL) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to allocate memory\n"));
++ status = A_ERROR;
++ break;
++ }
++
++ A_MEMZERO(target, sizeof(HTC_TARGET));
++ A_MUTEX_INIT(&target->HTCLock);
++ A_MUTEX_INIT(&target->HTCRxLock);
++ A_MUTEX_INIT(&target->HTCTxLock);
++ INIT_HTC_PACKET_QUEUE(&target->ControlBufferTXFreeList);
++ INIT_HTC_PACKET_QUEUE(&target->ControlBufferRXFreeList);
++
++ /* give device layer the hif device handle */
++ target->Device.HIFDevice = hif_handle;
++ /* give the device layer our context (for event processing)
++ * the device layer will register it's own context with HIF
++ * so we need to set this so we can fetch it in the target remove handler */
++ target->Device.HTCContext = target;
++ /* set device layer target failure callback */
++ target->Device.TargetFailureCallback = HTCReportFailure;
++ /* set device layer recv message pending callback */
++ target->Device.MessagePendingCallback = HTCRecvMessagePendingHandler;
++ target->EpWaitingForBuffers = ENDPOINT_MAX;
++
++ /* setup device layer */
++ status = DevSetup(&target->Device);
++
++ if (A_FAILED(status)) {
++ break;
++ }
++
++ /* carve up buffers/packets for control messages */
++ for (i = 0; i < NUM_CONTROL_RX_BUFFERS; i++) {
++ HTC_PACKET *pControlPacket;
++ pControlPacket = &target->HTCControlBuffers[i].HtcPacket;
++ SET_HTC_PACKET_INFO_RX_REFILL(pControlPacket,
++ target,
++ target->HTCControlBuffers[i].Buffer,
++ HTC_CONTROL_BUFFER_SIZE,
++ ENDPOINT_0);
++ HTC_FREE_CONTROL_RX(target,pControlPacket);
++ }
++
++ for (;i < NUM_CONTROL_BUFFERS;i++) {
++ HTC_PACKET *pControlPacket;
++ pControlPacket = &target->HTCControlBuffers[i].HtcPacket;
++ INIT_HTC_PACKET_INFO(pControlPacket,
++ target->HTCControlBuffers[i].Buffer,
++ HTC_CONTROL_BUFFER_SIZE);
++ HTC_FREE_CONTROL_TX(target,pControlPacket);
++ }
++
++ } while (FALSE);
++
++ if (A_SUCCESS(status)) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC, (" calling AddInstance callback \n"));
++ /* announce ourselves */
++ HTCInitInfo.AddInstance((HTC_HANDLE)target);
++ } else {
++ if (target != NULL) {
++ HTCCleanup(target);
++ }
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("htcTargetInserted - Exit\n"));
++
++ return status;
++}
++
++/* registered removal callback from the HIF layer */
++static A_STATUS HTCTargetRemovedHandler(void *handle, A_STATUS status)
++{
++ HTC_TARGET *target;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("+HTCTargetRemovedHandler handle:0x%X \n",(A_UINT32)handle));
++
++ if (NULL == handle) {
++ /* this could be NULL in the event that target initialization failed */
++ return A_OK;
++ }
++
++ target = ((AR6K_DEVICE *)handle)->HTCContext;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC, (" removing target:0x%X instance:0x%X ... \n",
++ (A_UINT32)target, (A_UINT32)target->pInstanceContext));
++
++ if (target->pInstanceContext != NULL) {
++ /* let upper layer know, it needs to call HTCStop() */
++ HTCInitInfo.DeleteInstance(target->pInstanceContext);
++ }
++
++ HIFShutDownDevice(target->Device.HIFDevice);
++
++ HTCCleanup(target);
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("-HTCTargetRemovedHandler \n"));
++ return A_OK;
++}
++
++/* get the low level HIF device for the caller , the caller may wish to do low level
++ * HIF requests */
++void *HTCGetHifDevice(HTC_HANDLE HTCHandle)
++{
++ HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
++ return target->Device.HIFDevice;
++}
++
++/* set the instance block for this HTC handle, so that on removal, the blob can be
++ * returned to the caller */
++void HTCSetInstance(HTC_HANDLE HTCHandle, void *Instance)
++{
++ HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
++
++ target->pInstanceContext = Instance;
++}
++
++/* wait for the target to arrive (sends HTC Ready message)
++ * this operation is fully synchronous and the message is polled for */
++A_STATUS HTCWaitTarget(HTC_HANDLE HTCHandle)
++{
++ HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
++ A_STATUS status;
++ HTC_PACKET *pPacket = NULL;
++ HTC_READY_MSG *pRdyMsg;
++ HTC_SERVICE_CONNECT_REQ connect;
++ HTC_SERVICE_CONNECT_RESP resp;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("HTCWaitTarget - Enter (target:0x%X) \n", (A_UINT32)target));
++
++ do {
++
++#ifdef MBOXHW_UNIT_TEST
++
++ status = DoMboxHWTest(&target->Device);
++
++ if (status != A_OK) {
++ break;
++ }
++
++#endif
++
++ /* we should be getting 1 control message that the target is ready */
++ status = HTCWaitforControlMessage(target, &pPacket);
++
++ if (A_FAILED(status)) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, (" Target Not Available!!\n"));
++ break;
++ }
++
++ /* we controlled the buffer creation so it has to be properly aligned */
++ pRdyMsg = (HTC_READY_MSG *)pPacket->pBuffer;
++
++ if ((pRdyMsg->MessageID != HTC_MSG_READY_ID) ||
++ (pPacket->ActualLength < sizeof(HTC_READY_MSG))) {
++ /* this message is not valid */
++ AR_DEBUG_ASSERT(FALSE);
++ status = A_EPROTO;
++ break;
++ }
++
++ if (pRdyMsg->CreditCount == 0 || pRdyMsg->CreditSize == 0) {
++ /* this message is not valid */
++ AR_DEBUG_ASSERT(FALSE);
++ status = A_EPROTO;
++ break;
++ }
++
++ target->TargetCredits = pRdyMsg->CreditCount;
++ target->TargetCreditSize = pRdyMsg->CreditSize;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC, (" Target Ready: credits: %d credit size: %d\n",
++ target->TargetCredits, target->TargetCreditSize));
++
++ /* setup our pseudo HTC control endpoint connection */
++ A_MEMZERO(&connect,sizeof(connect));
++ A_MEMZERO(&resp,sizeof(resp));
++ connect.EpCallbacks.pContext = target;
++ connect.EpCallbacks.EpTxComplete = HTCControlTxComplete;
++ connect.EpCallbacks.EpRecv = HTCControlRecv;
++ connect.EpCallbacks.EpRecvRefill = NULL; /* not needed */
++ connect.EpCallbacks.EpSendFull = NULL; /* not needed */
++ connect.EpCallbacks.EpSendAvail = NULL; /* not needed */
++ connect.MaxSendQueueDepth = NUM_CONTROL_BUFFERS;
++ connect.ServiceID = HTC_CTRL_RSVD_SVC;
++
++ /* connect fake service */
++ status = HTCConnectService((HTC_HANDLE)target,
++ &connect,
++ &resp);
++
++ if (!A_FAILED(status)) {
++ break;
++ }
++
++ } while (FALSE);
++
++ if (pPacket != NULL) {
++ HTC_FREE_CONTROL_RX(target,pPacket);
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("HTCWaitTarget - Exit\n"));
++
++ return status;
++}
++
++
++
++/* Start HTC, enable interrupts and let the target know host has finished setup */
++A_STATUS HTCStart(HTC_HANDLE HTCHandle)
++{
++ HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
++ HTC_PACKET *pPacket;
++ A_STATUS status;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("HTCStart Enter\n"));
++
++ /* now that we are starting, push control receive buffers into the
++ * HTC control endpoint */
++
++ while (1) {
++ pPacket = HTC_ALLOC_CONTROL_RX(target);
++ if (NULL == pPacket) {
++ break;
++ }
++ HTCAddReceivePkt((HTC_HANDLE)target,pPacket);
++ }
++
++ do {
++
++ AR_DEBUG_ASSERT(target->InitCredits != NULL);
++ AR_DEBUG_ASSERT(target->EpCreditDistributionListHead != NULL);
++ AR_DEBUG_ASSERT(target->EpCreditDistributionListHead->pNext != NULL);
++
++ /* call init credits callback to do the distribution ,
++ * NOTE: the first entry in the distribution list is ENDPOINT_0, so
++ * we pass the start of the list after this one. */
++ target->InitCredits(target->pCredDistContext,
++ target->EpCreditDistributionListHead->pNext,
++ target->TargetCredits);
++
++ if (AR_DEBUG_LVL_CHECK(ATH_DEBUG_TRC)) {
++ DumpCreditDistStates(target);
++ }
++
++ /* the caller is done connecting to services, so we can indicate to the
++ * target that the setup phase is complete */
++ status = HTCSendSetupComplete(target);
++
++ if (A_FAILED(status)) {
++ break;
++ }
++
++ /* unmask interrupts */
++ status = DevUnmaskInterrupts(&target->Device);
++
++ if (A_FAILED(status)) {
++ HTCStop(target);
++ }
++
++ } while (FALSE);
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("HTCStart Exit\n"));
++ return status;
++}
++
++
++/* stop HTC communications, i.e. stop interrupt reception, and flush all queued buffers */
++void HTCStop(HTC_HANDLE HTCHandle)
++{
++ HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("+HTCStop \n"));
++
++ /* mark that we are shutting down .. */
++ target->HTCStateFlags |= HTC_STATE_STOPPING;
++
++ /* Masking interrupts is a synchronous operation, when this function returns
++ * all pending HIF I/O has completed, we can safely flush the queues */
++ DevMaskInterrupts(&target->Device);
++
++ /* flush all send packets */
++ HTCFlushSendPkts(target);
++ /* flush all recv buffers */
++ HTCFlushRecvBuffers(target);
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("-HTCStop \n"));
++}
++
++/* undo what was done in HTCInit() */
++void HTCShutDown(void)
++{
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("+HTCShutDown: \n"));
++ HTCInitialized = FALSE;
++ /* undo HTCInit */
++ HIFShutDownDevice(NULL);
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("-HTCShutDown: \n"));
++}
++
++void HTCDumpCreditStates(HTC_HANDLE HTCHandle)
++{
++ HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
++
++ LOCK_HTC_TX(target);
++
++ DumpCreditDistStates(target);
++
++ UNLOCK_HTC_TX(target);
++}
++
++/* report a target failure from the device, this is a callback from the device layer
++ * which uses a mechanism to report errors from the target (i.e. special interrupts) */
++static void HTCReportFailure(void *Context)
++{
++ HTC_TARGET *target = (HTC_TARGET *)Context;
++
++ target->TargetFailure = TRUE;
++
++ if ((target->pInstanceContext != NULL) && (HTCInitInfo.TargetFailure != NULL)) {
++ /* let upper layer know, it needs to call HTCStop() */
++ HTCInitInfo.TargetFailure(target->pInstanceContext, A_ERROR);
++ }
++}
++
++void DebugDumpBytes(A_UCHAR *buffer, A_UINT16 length, char *pDescription)
++{
++ A_CHAR stream[60];
++ A_UINT32 i;
++ A_UINT16 offset, count;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_ANY, ("<---------Dumping %d Bytes : %s ------>\n", length, pDescription));
++
++ count = 0;
++ offset = 0;
++ for(i = 0; i < length; i++) {
++ sprintf(stream + offset, "%2.2X ", buffer[i]);
++ count ++;
++ offset += 3;
++
++ if(count == 16) {
++ count = 0;
++ offset = 0;
++ AR_DEBUG_PRINTF(ATH_DEBUG_ANY, ("[H]: %s\n", stream));
++ A_MEMZERO(stream, 60);
++ }
++ }
++
++ if(offset != 0) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ANY, ("[H]: %s\n", stream));
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_ANY, ("<------------------------------------------------->\n"));
++}
++
++A_BOOL HTCGetEndpointStatistics(HTC_HANDLE HTCHandle,
++ HTC_ENDPOINT_ID Endpoint,
++ HTC_ENDPOINT_STAT_ACTION Action,
++ HTC_ENDPOINT_STATS *pStats)
++{
++
++#ifdef HTC_EP_STAT_PROFILING
++ HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
++ A_BOOL clearStats = FALSE;
++ A_BOOL sample = FALSE;
++
++ switch (Action) {
++ case HTC_EP_STAT_SAMPLE :
++ sample = TRUE;
++ break;
++ case HTC_EP_STAT_SAMPLE_AND_CLEAR :
++ sample = TRUE;
++ clearStats = TRUE;
++ break;
++ case HTC_EP_STAT_CLEAR :
++ clearStats = TRUE;
++ break;
++ default:
++ break;
++ }
++
++ A_ASSERT(Endpoint < ENDPOINT_MAX);
++
++ /* lock out TX and RX while we sample and/or clear */
++ LOCK_HTC_TX(target);
++ LOCK_HTC_RX(target);
++
++ if (sample) {
++ A_ASSERT(pStats != NULL);
++ /* return the stats to the caller */
++ A_MEMCPY(pStats, &target->EndPoint[Endpoint].EndPointStats, sizeof(HTC_ENDPOINT_STATS));
++ }
++
++ if (clearStats) {
++ /* reset stats */
++ A_MEMZERO(&target->EndPoint[Endpoint].EndPointStats, sizeof(HTC_ENDPOINT_STATS));
++ }
++
++ UNLOCK_HTC_RX(target);
++ UNLOCK_HTC_TX(target);
++
++ return TRUE;
++#else
++ return FALSE;
++#endif
++}
+diff --git a/drivers/ar6000/htc/htc_debug.h b/drivers/ar6000/htc/htc_debug.h
+new file mode 100644
+index 0000000..08080be
+--- /dev/null
++++ b/drivers/ar6000/htc/htc_debug.h
+@@ -0,0 +1,65 @@
++#ifndef HTC_DEBUG_H_
++#define HTC_DEBUG_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.
++ *
++ *
++ *
++ */
++
++/* ------- 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_DEBUG_ANY = 0xFFFF,
++};
++
++#ifdef DEBUG
++
++// 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
++#endif
++
++void DebugDumpBytes(A_UCHAR *buffer, A_UINT16 length, char *pDescription);
++
++#endif /*HTC_DEBUG_H_*/
+diff --git a/drivers/ar6000/htc/htc_internal.h b/drivers/ar6000/htc/htc_internal.h
+new file mode 100644
+index 0000000..ebb8ac1
+--- /dev/null
++++ b/drivers/ar6000/htc/htc_internal.h
+@@ -0,0 +1,168 @@
++/*
++ *
++ * Copyright (c) 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 _HTC_INTERNAL_H_
++#define _HTC_INTERNAL_H_
++
++/* for debugging, uncomment this to capture the last frame header, on frame header
++ * processing errors, the last frame header is dump for comparison */
++//#define HTC_CAPTURE_LAST_FRAME
++
++//#define HTC_EP_STAT_PROFILING
++
++#ifdef __cplusplus
++extern "C" {
++#endif /* __cplusplus */
++
++/* Header files */
++#include "a_config.h"
++#include "athdefs.h"
++#include "a_types.h"
++#include "a_osapi.h"
++#include "a_debug.h"
++#include "htc.h"
++#include "htc_api.h"
++#include "bmi_msg.h"
++#include "hif.h"
++#include "ar6k.h"
++
++/* HTC operational parameters */
++#define HTC_TARGET_RESPONSE_TIMEOUT 2000 /* in ms */
++#define HTC_TARGET_DEBUG_INTR_MASK 0x01
++#define HTC_TARGET_CREDIT_INTR_MASK 0xF0
++
++typedef struct _HTC_ENDPOINT {
++ HTC_SERVICE_ID ServiceID; /* service ID this endpoint is bound to
++ non-zero value means this endpoint is in use */
++ HTC_PACKET_QUEUE TxQueue; /* HTC frame buffer TX queue */
++ HTC_PACKET_QUEUE RxBuffers; /* HTC frame buffer RX list */
++ HTC_ENDPOINT_CREDIT_DIST CreditDist; /* credit distribution structure (exposed to driver layer) */
++ HTC_EP_CALLBACKS EpCallBacks; /* callbacks associated with this endpoint */
++ int MaxTxQueueDepth; /* max depth of the TX queue before we need to
++ call driver's full handler */
++ int CurrentTxQueueDepth; /* current TX queue depth */
++ int MaxMsgLength; /* max length of endpoint message */
++#ifdef HTC_EP_STAT_PROFILING
++ HTC_ENDPOINT_STATS EndPointStats; /* endpoint statistics */
++#endif
++} HTC_ENDPOINT;
++
++#ifdef HTC_EP_STAT_PROFILING
++#define INC_HTC_EP_STAT(p,stat,count) (p)->EndPointStats.stat += (count);
++#else
++#define INC_HTC_EP_STAT(p,stat,count)
++#endif
++
++#define HTC_SERVICE_TX_PACKET_TAG HTC_TX_PACKET_TAG_INTERNAL
++
++#define NUM_CONTROL_BUFFERS 8
++#define NUM_CONTROL_TX_BUFFERS 2
++#define NUM_CONTROL_RX_BUFFERS (NUM_CONTROL_BUFFERS - NUM_CONTROL_TX_BUFFERS)
++
++#define HTC_CONTROL_BUFFER_SIZE (HTC_MAX_CONTROL_MESSAGE_LENGTH + HTC_HDR_LENGTH)
++
++typedef struct HTC_CONTROL_BUFFER {
++ HTC_PACKET HtcPacket;
++ A_UINT8 Buffer[HTC_CONTROL_BUFFER_SIZE];
++} HTC_CONTROL_BUFFER;
++
++/* our HTC target state */
++typedef struct _HTC_TARGET {
++ HTC_ENDPOINT EndPoint[ENDPOINT_MAX];
++ HTC_CONTROL_BUFFER HTCControlBuffers[NUM_CONTROL_BUFFERS];
++ HTC_ENDPOINT_CREDIT_DIST *EpCreditDistributionListHead;
++ HTC_PACKET_QUEUE ControlBufferTXFreeList;
++ HTC_PACKET_QUEUE ControlBufferRXFreeList;
++ HTC_CREDIT_DIST_CALLBACK DistributeCredits;
++ HTC_CREDIT_INIT_CALLBACK InitCredits;
++ void *pCredDistContext;
++ int TargetCredits;
++ int TargetCreditSize;
++ A_MUTEX_T HTCLock;
++ A_MUTEX_T HTCRxLock;
++ A_MUTEX_T HTCTxLock;
++ AR6K_DEVICE Device; /* AR6K - specific state */
++ A_UINT32 HTCStateFlags;
++ HTC_ENDPOINT_ID EpWaitingForBuffers;
++ A_BOOL TargetFailure;
++ void *pInstanceContext;
++#define HTC_STATE_WAIT_BUFFERS (1 << 0)
++#define HTC_STATE_STOPPING (1 << 1)
++#ifdef HTC_CAPTURE_LAST_FRAME
++ HTC_FRAME_HDR LastFrameHdr; /* useful for debugging */
++ A_UINT8 LastTrailer[256];
++ A_UINT8 LastTrailerLength;
++#endif
++} HTC_TARGET;
++
++#define HTC_STOPPING(t) ((t)->HTCStateFlags & HTC_STATE_STOPPING)
++#define LOCK_HTC(t) A_MUTEX_LOCK(&(t)->HTCLock);
++#define UNLOCK_HTC(t) A_MUTEX_UNLOCK(&(t)->HTCLock);
++#define LOCK_HTC_RX(t) A_MUTEX_LOCK(&(t)->HTCRxLock);
++#define UNLOCK_HTC_RX(t) A_MUTEX_UNLOCK(&(t)->HTCRxLock);
++#define LOCK_HTC_TX(t) A_MUTEX_LOCK(&(t)->HTCTxLock);
++#define UNLOCK_HTC_TX(t) A_MUTEX_UNLOCK(&(t)->HTCTxLock);
++
++#define GET_HTC_TARGET_FROM_HANDLE(hnd) ((HTC_TARGET *)(hnd))
++#define HTC_RECYCLE_RX_PKT(target,p) \
++{ \
++ HTC_PACKET_RESET_RX(pPacket); \
++ HTCAddReceivePkt((HTC_HANDLE)(target),(p)); \
++}
++
++/* internal HTC functions */
++void HTCControlTxComplete(void *Context, HTC_PACKET *pPacket);
++void HTCControlRecv(void *Context, HTC_PACKET *pPacket);
++A_STATUS HTCWaitforControlMessage(HTC_TARGET *target, HTC_PACKET **ppControlPacket);
++HTC_PACKET *HTCAllocControlBuffer(HTC_TARGET *target, HTC_PACKET_QUEUE *pList);
++void HTCFreeControlBuffer(HTC_TARGET *target, HTC_PACKET *pPacket, HTC_PACKET_QUEUE *pList);
++A_STATUS HTCIssueSend(HTC_TARGET *target, HTC_PACKET *pPacket, A_UINT8 Flags);
++A_STATUS HTCIssueRecv(HTC_TARGET *target, HTC_PACKET *pPacket);
++void HTCRecvCompleteHandler(void *Context, HTC_PACKET *pPacket);
++A_STATUS HTCRecvMessagePendingHandler(void *Context, A_UINT32 LookAhead, A_BOOL *pAsyncProc);
++void HTCProcessCreditRpt(HTC_TARGET *target, HTC_CREDIT_REPORT *pRpt, int NumEntries, HTC_ENDPOINT_ID FromEndpoint);
++A_STATUS HTCSendSetupComplete(HTC_TARGET *target);
++void HTCFlushRecvBuffers(HTC_TARGET *target);
++void HTCFlushSendPkts(HTC_TARGET *target);
++void DumpCreditDist(HTC_ENDPOINT_CREDIT_DIST *pEPDist);
++void DumpCreditDistStates(HTC_TARGET *target);
++void DebugDumpBytes(A_UCHAR *buffer, A_UINT16 length, char *pDescription);
++
++static INLINE HTC_PACKET *HTC_ALLOC_CONTROL_TX(HTC_TARGET *target) {
++ HTC_PACKET *pPacket = HTCAllocControlBuffer(target,&target->ControlBufferTXFreeList);
++ if (pPacket != NULL) {
++ /* set payload pointer area with some headroom */
++ pPacket->pBuffer = pPacket->pBufferStart + HTC_HDR_LENGTH;
++ }
++ return pPacket;
++}
++
++#define HTC_FREE_CONTROL_TX(t,p) HTCFreeControlBuffer((t),(p),&(t)->ControlBufferTXFreeList)
++#define HTC_ALLOC_CONTROL_RX(t) HTCAllocControlBuffer((t),&(t)->ControlBufferRXFreeList)
++#define HTC_FREE_CONTROL_RX(t,p) \
++{ \
++ HTC_PACKET_RESET_RX(p); \
++ HTCFreeControlBuffer((t),(p),&(t)->ControlBufferRXFreeList); \
++}
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* _HTC_INTERNAL_H_ */
+diff --git a/drivers/ar6000/htc/htc_recv.c b/drivers/ar6000/htc/htc_recv.c
+new file mode 100644
+index 0000000..4be2b08
+--- /dev/null
++++ b/drivers/ar6000/htc/htc_recv.c
+@@ -0,0 +1,703 @@
++/*
++ *
++ * Copyright (c) 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 "htc_internal.h"
++
++#define HTCIssueRecv(t, p) \
++ DevRecvPacket(&(t)->Device, \
++ (p), \
++ (p)->ActualLength)
++
++#define DO_RCV_COMPLETION(t,p,e) \
++{ \
++ if ((p)->ActualLength > 0) { \
++ AR_DEBUG_PRINTF(ATH_DEBUG_RECV, (" completing packet 0x%X (%d bytes) on ep : %d \n", \
++ (A_UINT32)(p), (p)->ActualLength, (p)->Endpoint)); \
++ (e)->EpCallBacks.EpRecv((e)->EpCallBacks.pContext, \
++ (p)); \
++ } else { \
++ AR_DEBUG_PRINTF(ATH_DEBUG_RECV, (" recycling empty packet \n")); \
++ HTC_RECYCLE_RX_PKT((t), (p)); \
++ } \
++}
++
++#ifdef HTC_EP_STAT_PROFILING
++#define HTC_RX_STAT_PROFILE(t,ep,lookAhead) \
++{ \
++ LOCK_HTC_RX((t)); \
++ INC_HTC_EP_STAT((ep), RxReceived, 1); \
++ if ((lookAhead) != 0) { \
++ INC_HTC_EP_STAT((ep), RxLookAheads, 1); \
++ } \
++ UNLOCK_HTC_RX((t)); \
++}
++#else
++#define HTC_RX_STAT_PROFILE(t,ep,lookAhead)
++#endif
++
++static INLINE A_STATUS HTCProcessTrailer(HTC_TARGET *target,
++ A_UINT8 *pBuffer,
++ int Length,
++ A_UINT32 *pNextLookAhead,
++ HTC_ENDPOINT_ID FromEndpoint)
++{
++ HTC_RECORD_HDR *pRecord;
++ A_UINT8 *pRecordBuf;
++ HTC_LOOKAHEAD_REPORT *pLookAhead;
++ A_UINT8 *pOrigBuffer;
++ int origLength;
++ A_STATUS status;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_RECV, ("+HTCProcessTrailer (length:%d) \n", Length));
++
++ if (AR_DEBUG_LVL_CHECK(ATH_DEBUG_RECV)) {
++ AR_DEBUG_PRINTBUF(pBuffer,Length,"Recv Trailer");
++ }
++
++ pOrigBuffer = pBuffer;
++ origLength = Length;
++ status = A_OK;
++
++ while (Length > 0) {
++
++ if (Length < sizeof(HTC_RECORD_HDR)) {
++ status = A_EPROTO;
++ break;
++ }
++ /* these are byte aligned structs */
++ pRecord = (HTC_RECORD_HDR *)pBuffer;
++ Length -= sizeof(HTC_RECORD_HDR);
++ pBuffer += sizeof(HTC_RECORD_HDR);
++
++ if (pRecord->Length > Length) {
++ /* no room left in buffer for record */
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
++ (" invalid record length: %d (id:%d) buffer has: %d bytes left \n",
++ pRecord->Length, pRecord->RecordID, Length));
++ status = A_EPROTO;
++ break;
++ }
++ /* start of record follows the header */
++ pRecordBuf = pBuffer;
++
++ switch (pRecord->RecordID) {
++ case HTC_RECORD_CREDITS:
++ AR_DEBUG_ASSERT(pRecord->Length >= sizeof(HTC_CREDIT_REPORT));
++ HTCProcessCreditRpt(target,
++ (HTC_CREDIT_REPORT *)pRecordBuf,
++ pRecord->Length / (sizeof(HTC_CREDIT_REPORT)),
++ FromEndpoint);
++ break;
++ case HTC_RECORD_LOOKAHEAD:
++ AR_DEBUG_ASSERT(pRecord->Length >= sizeof(HTC_LOOKAHEAD_REPORT));
++ pLookAhead = (HTC_LOOKAHEAD_REPORT *)pRecordBuf;
++ if ((pLookAhead->PreValid == ((~pLookAhead->PostValid) & 0xFF)) &&
++ (pNextLookAhead != NULL)) {
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_RECV,
++ (" LookAhead Report Found (pre valid:0x%X, post valid:0x%X) \n",
++ pLookAhead->PreValid,
++ pLookAhead->PostValid));
++
++ /* look ahead bytes are valid, copy them over */
++ ((A_UINT8 *)pNextLookAhead)[0] = pLookAhead->LookAhead[0];
++ ((A_UINT8 *)pNextLookAhead)[1] = pLookAhead->LookAhead[1];
++ ((A_UINT8 *)pNextLookAhead)[2] = pLookAhead->LookAhead[2];
++ ((A_UINT8 *)pNextLookAhead)[3] = pLookAhead->LookAhead[3];
++
++ if (AR_DEBUG_LVL_CHECK(ATH_DEBUG_RECV)) {
++ DebugDumpBytes((A_UINT8 *)pNextLookAhead,4,"Next Look Ahead");
++ }
++ }
++ break;
++ default:
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, (" unhandled record: id:%d length:%d \n",
++ pRecord->RecordID, pRecord->Length));
++ break;
++ }
++
++ if (A_FAILED(status)) {
++ break;
++ }
++
++ /* advance buffer past this record for next time around */
++ pBuffer += pRecord->Length;
++ Length -= pRecord->Length;
++ }
++
++ if (A_FAILED(status)) {
++ DebugDumpBytes(pOrigBuffer,origLength,"BAD Recv Trailer");
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_RECV, ("-HTCProcessTrailer \n"));
++ return status;
++
++}
++
++/* process a received message (i.e. strip off header, process any trailer data)
++ * note : locks must be released when this function is called */
++static A_STATUS HTCProcessRecvHeader(HTC_TARGET *target, HTC_PACKET *pPacket, A_UINT32 *pNextLookAhead)
++{
++ A_UINT8 temp;
++ A_UINT8 *pBuf;
++ A_STATUS status = A_OK;
++ A_UINT16 payloadLen;
++ A_UINT32 lookAhead;
++
++ pBuf = pPacket->pBuffer;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_RECV, ("+HTCProcessRecvHeader \n"));
++
++ if (AR_DEBUG_LVL_CHECK(ATH_DEBUG_RECV)) {
++ AR_DEBUG_PRINTBUF(pBuf,pPacket->ActualLength,"HTC Recv PKT");
++ }
++
++ do {
++ /* note, we cannot assume the alignment of pBuffer, so we use the safe macros to
++ * retrieve 16 bit fields */
++ payloadLen = A_GET_UINT16_FIELD(pBuf, HTC_FRAME_HDR, PayloadLen);
++
++ ((A_UINT8 *)&lookAhead)[0] = pBuf[0];
++ ((A_UINT8 *)&lookAhead)[1] = pBuf[1];
++ ((A_UINT8 *)&lookAhead)[2] = pBuf[2];
++ ((A_UINT8 *)&lookAhead)[3] = pBuf[3];
++
++ if (lookAhead != pPacket->HTCReserved) {
++ /* somehow the lookahead that gave us the full read length did not
++ * reflect the actual header in the pending message */
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
++ ("HTCProcessRecvHeader, lookahead mismatch! \n"));
++ DebugDumpBytes((A_UINT8 *)&pPacket->HTCReserved,4,"Expected Message LookAhead");
++ DebugDumpBytes(pBuf,sizeof(HTC_FRAME_HDR),"Current Frame Header");
++#ifdef HTC_CAPTURE_LAST_FRAME
++ DebugDumpBytes((A_UINT8 *)&target->LastFrameHdr,sizeof(HTC_FRAME_HDR),"Last Frame Header");
++ if (target->LastTrailerLength != 0) {
++ DebugDumpBytes(target->LastTrailer,
++ target->LastTrailerLength,
++ "Last trailer");
++ }
++#endif
++ status = A_EPROTO;
++ break;
++ }
++
++ /* get flags */
++ temp = A_GET_UINT8_FIELD(pBuf, HTC_FRAME_HDR, Flags);
++
++ if (temp & HTC_FLAGS_RECV_TRAILER) {
++ /* this packet has a trailer */
++
++ /* extract the trailer length in control byte 0 */
++ temp = A_GET_UINT8_FIELD(pBuf, HTC_FRAME_HDR, ControlBytes[0]);
++
++ if ((temp < sizeof(HTC_RECORD_HDR)) || (temp > payloadLen)) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
++ ("HTCProcessRecvHeader, invalid header (payloadlength should be :%d, CB[0] is:%d) \n",
++ payloadLen, temp));
++ status = A_EPROTO;
++ break;
++ }
++
++ /* process trailer data that follows HDR + application payload */
++ status = HTCProcessTrailer(target,
++ (pBuf + HTC_HDR_LENGTH + payloadLen - temp),
++ temp,
++ pNextLookAhead,
++ pPacket->Endpoint);
++
++ if (A_FAILED(status)) {
++ break;
++ }
++
++#ifdef HTC_CAPTURE_LAST_FRAME
++ A_MEMCPY(target->LastTrailer, (pBuf + HTC_HDR_LENGTH + payloadLen - temp), temp);
++ target->LastTrailerLength = temp;
++#endif
++ /* trim length by trailer bytes */
++ pPacket->ActualLength -= temp;
++ }
++#ifdef HTC_CAPTURE_LAST_FRAME
++ else {
++ target->LastTrailerLength = 0;
++ }
++#endif
++
++ /* if we get to this point, the packet is good */
++ /* remove header and adjust length */
++ pPacket->pBuffer += HTC_HDR_LENGTH;
++ pPacket->ActualLength -= HTC_HDR_LENGTH;
++
++ } while (FALSE);
++
++ if (A_FAILED(status)) {
++ /* dump the whole packet */
++ DebugDumpBytes(pBuf,pPacket->ActualLength,"BAD HTC Recv PKT");
++ } else {
++#ifdef HTC_CAPTURE_LAST_FRAME
++ A_MEMCPY(&target->LastFrameHdr,pBuf,sizeof(HTC_FRAME_HDR));
++#endif
++ if (AR_DEBUG_LVL_CHECK(ATH_DEBUG_RECV)) {
++ if (pPacket->ActualLength > 0) {
++ AR_DEBUG_PRINTBUF(pPacket->pBuffer,pPacket->ActualLength,"HTC - Application Msg");
++ }
++ }
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_RECV, ("-HTCProcessRecvHeader \n"));
++ return status;
++}
++
++/* asynchronous completion handler for recv packet fetching, when the device layer
++ * completes a read request, it will call this completion handler */
++void HTCRecvCompleteHandler(void *Context, HTC_PACKET *pPacket)
++{
++ HTC_TARGET *target = (HTC_TARGET *)Context;
++ HTC_ENDPOINT *pEndpoint;
++ A_UINT32 nextLookAhead = 0;
++ A_STATUS status;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_RECV, ("+HTCRecvCompleteHandler (status:%d, ep:%d) \n",
++ pPacket->Status, pPacket->Endpoint));
++
++ AR_DEBUG_ASSERT(pPacket->Endpoint < ENDPOINT_MAX);
++ pEndpoint = &target->EndPoint[pPacket->Endpoint];
++ pPacket->Completion = NULL;
++
++ /* get completion status */
++ status = pPacket->Status;
++
++ do {
++ if (A_FAILED(status)) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("HTCRecvCompleteHandler: request failed (status:%d, ep:%d) \n",
++ pPacket->Status, pPacket->Endpoint));
++ break;
++ }
++ /* process the header for any trailer data */
++ status = HTCProcessRecvHeader(target,pPacket,&nextLookAhead);
++
++ if (A_FAILED(status)) {
++ break;
++ }
++ /* was there a lookahead for the next packet? */
++ if (nextLookAhead != 0) {
++ A_STATUS nextStatus;
++ AR_DEBUG_PRINTF(ATH_DEBUG_RECV,
++ ("HTCRecvCompleteHandler - next look ahead was non-zero : 0x%X \n",
++ nextLookAhead));
++ /* we have another packet, get the next packet fetch started (pipelined) before
++ * we call into the endpoint's callback, this will start another async request */
++ nextStatus = HTCRecvMessagePendingHandler(target,nextLookAhead,NULL);
++ if (A_EPROTO == nextStatus) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
++ ("Next look ahead from recv header was INVALID\n"));
++ DebugDumpBytes((A_UINT8 *)&nextLookAhead,
++ 4,
++ "BAD lookahead from lookahead report");
++ }
++ } else {
++ AR_DEBUG_PRINTF(ATH_DEBUG_RECV,
++ ("HTCRecvCompleteHandler - rechecking for more messages...\n"));
++ /* if we did not get anything on the look-ahead,
++ * call device layer to asynchronously re-check for messages. If we can keep the async
++ * processing going we get better performance. If there is a pending message we will keep processing
++ * messages asynchronously which should pipeline things nicely */
++ DevCheckPendingRecvMsgsAsync(&target->Device);
++ }
++
++ HTC_RX_STAT_PROFILE(target,pEndpoint,nextLookAhead);
++ DO_RCV_COMPLETION(target,pPacket,pEndpoint);
++
++ } while (FALSE);
++
++ if (A_FAILED(status)) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
++ ("HTCRecvCompleteHandler , message fetch failed (status = %d) \n",
++ status));
++ /* recyle this packet */
++ HTC_RECYCLE_RX_PKT(target, pPacket);
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_RECV, ("-HTCRecvCompleteHandler\n"));
++}
++
++/* synchronously wait for a control message from the target,
++ * This function is used at initialization time ONLY. At init messages
++ * on ENDPOINT 0 are expected. */
++A_STATUS HTCWaitforControlMessage(HTC_TARGET *target, HTC_PACKET **ppControlPacket)
++{
++ A_STATUS status;
++ A_UINT32 lookAhead;
++ HTC_PACKET *pPacket = NULL;
++ HTC_FRAME_HDR *pHdr;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("+HTCWaitforControlMessage \n"));
++
++ do {
++
++ *ppControlPacket = NULL;
++
++ /* call the polling function to see if we have a message */
++ status = DevPollMboxMsgRecv(&target->Device,
++ &lookAhead,
++ HTC_TARGET_RESPONSE_TIMEOUT);
++
++ if (A_FAILED(status)) {
++ break;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_RECV,
++ ("HTCWaitforControlMessage : lookAhead : 0x%X \n", lookAhead));
++
++ /* check the lookahead */
++ pHdr = (HTC_FRAME_HDR *)&lookAhead;
++
++ if (pHdr->EndpointID != ENDPOINT_0) {
++ /* unexpected endpoint number, should be zero */
++ AR_DEBUG_ASSERT(FALSE);
++ status = A_EPROTO;
++ break;
++ }
++
++ if (A_FAILED(status)) {
++ /* bad message */
++ AR_DEBUG_ASSERT(FALSE);
++ status = A_EPROTO;
++ break;
++ }
++
++ pPacket = HTC_ALLOC_CONTROL_RX(target);
++
++ if (pPacket == NULL) {
++ AR_DEBUG_ASSERT(FALSE);
++ status = A_NO_MEMORY;
++ break;
++ }
++
++ pPacket->HTCReserved = lookAhead;
++ pPacket->ActualLength = pHdr->PayloadLen + HTC_HDR_LENGTH;
++
++ if (pPacket->ActualLength > pPacket->BufferLength) {
++ AR_DEBUG_ASSERT(FALSE);
++ status = A_EPROTO;
++ break;
++ }
++
++ /* we want synchronous operation */
++ pPacket->Completion = NULL;
++
++ /* get the message from the device, this will block */
++ status = HTCIssueRecv(target, pPacket);
++
++ if (A_FAILED(status)) {
++ break;
++ }
++
++ /* process receive header */
++ status = HTCProcessRecvHeader(target,pPacket,NULL);
++
++ pPacket->Status = status;
++
++ if (A_FAILED(status)) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
++ ("HTCWaitforControlMessage, HTCProcessRecvHeader failed (status = %d) \n",
++ status));
++ break;
++ }
++
++ /* give the caller this control message packet, they are responsible to free */
++ *ppControlPacket = pPacket;
++
++ } while (FALSE);
++
++ if (A_FAILED(status)) {
++ if (pPacket != NULL) {
++ /* cleanup buffer on error */
++ HTC_FREE_CONTROL_RX(target,pPacket);
++ }
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("-HTCWaitforControlMessage \n"));
++
++ return status;
++}
++
++/* callback when device layer or lookahead report parsing detects a pending message */
++A_STATUS HTCRecvMessagePendingHandler(void *Context, A_UINT32 LookAhead, A_BOOL *pAsyncProc)
++{
++ HTC_TARGET *target = (HTC_TARGET *)Context;
++ A_STATUS status = A_OK;
++ HTC_PACKET *pPacket = NULL;
++ HTC_FRAME_HDR *pHdr;
++ HTC_ENDPOINT *pEndpoint;
++ A_BOOL asyncProc = FALSE;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("+HTCRecvMessagePendingHandler LookAhead:0x%X \n",LookAhead));
++
++ if (IS_DEV_IRQ_PROCESSING_ASYNC_ALLOWED(&target->Device)) {
++ /* We use async mode to get the packets if the device layer supports it.
++ * The device layer interfaces with HIF in which HIF may have restrictions on
++ * how interrupts are processed */
++ asyncProc = TRUE;
++ }
++
++ if (pAsyncProc != NULL) {
++ /* indicate to caller how we decided to process this */
++ *pAsyncProc = asyncProc;
++ }
++
++ while (TRUE) {
++
++ pHdr = (HTC_FRAME_HDR *)&LookAhead;
++
++ if (pHdr->EndpointID >= ENDPOINT_MAX) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Invalid Endpoint in look-ahead: %d \n",pHdr->EndpointID));
++ /* invalid endpoint */
++ status = A_EPROTO;
++ break;
++ }
++
++ if (pHdr->PayloadLen > HTC_MAX_PAYLOAD_LENGTH) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Payload length %d exceeds max HTC : %d !\n",
++ pHdr->PayloadLen, HTC_MAX_PAYLOAD_LENGTH));
++ status = A_EPROTO;
++ break;
++ }
++
++ pEndpoint = &target->EndPoint[pHdr->EndpointID];
++
++ if (0 == pEndpoint->ServiceID) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Endpoint %d is not connected !\n",pHdr->EndpointID));
++ /* endpoint isn't even connected */
++ status = A_EPROTO;
++ break;
++ }
++
++ /* lock RX to get a buffer */
++ LOCK_HTC_RX(target);
++
++ /* get a packet from the endpoint recv queue */
++ pPacket = HTC_PACKET_DEQUEUE(&pEndpoint->RxBuffers);
++
++ if (NULL == pPacket) {
++ /* check for refill handler */
++ if (pEndpoint->EpCallBacks.EpRecvRefill != NULL) {
++ UNLOCK_HTC_RX(target);
++ /* call the re-fill handler */
++ pEndpoint->EpCallBacks.EpRecvRefill(pEndpoint->EpCallBacks.pContext,
++ pHdr->EndpointID);
++ LOCK_HTC_RX(target);
++ /* check if we have more buffers */
++ pPacket = HTC_PACKET_DEQUEUE(&pEndpoint->RxBuffers);
++ /* fall through */
++ }
++ }
++
++ if (NULL == pPacket) {
++ /* this is not an error, we simply need to mark that we are waiting for buffers.*/
++ target->HTCStateFlags |= HTC_STATE_WAIT_BUFFERS;
++ target->EpWaitingForBuffers = pHdr->EndpointID;
++ status = A_NO_MEMORY;
++ }
++
++ UNLOCK_HTC_RX(target);
++
++ if (A_FAILED(status)) {
++ /* no buffers */
++ break;
++ }
++
++ AR_DEBUG_ASSERT(pPacket->Endpoint == pHdr->EndpointID);
++
++ /* make sure this message can fit in the endpoint buffer */
++ if ((pHdr->PayloadLen + HTC_HDR_LENGTH) > pPacket->BufferLength) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
++ ("Payload Length Error : header reports payload of: %d, endpoint buffer size: %d \n",
++ pHdr->PayloadLen, pPacket->BufferLength));
++ status = A_EPROTO;
++ break;
++ }
++
++ pPacket->HTCReserved = LookAhead; /* set expected look ahead */
++ /* set the amount of data to fetch */
++ pPacket->ActualLength = pHdr->PayloadLen + HTC_HDR_LENGTH;
++
++ if (asyncProc) {
++ /* we use async mode to get the packet if the device layer supports it
++ * set our callback and context */
++ pPacket->Completion = HTCRecvCompleteHandler;
++ pPacket->pContext = target;
++ } else {
++ /* fully synchronous */
++ pPacket->Completion = NULL;
++ }
++
++ /* go fetch the packet */
++ status = HTCIssueRecv(target, pPacket);
++
++ if (A_FAILED(status)) {
++ break;
++ }
++
++ if (asyncProc) {
++ /* we did this asynchronously so we can get out of the loop, the asynch processing
++ * creates a chain of requests to continue processing pending messages in the
++ * context of callbacks */
++ break;
++ }
++
++ /* in the sync case, we process the packet, check lookaheads and then repeat */
++
++ LookAhead = 0;
++ status = HTCProcessRecvHeader(target,pPacket,&LookAhead);
++
++ if (A_FAILED(status)) {
++ break;
++ }
++
++ HTC_RX_STAT_PROFILE(target,pEndpoint,LookAhead);
++ DO_RCV_COMPLETION(target,pPacket,pEndpoint);
++
++ pPacket = NULL;
++
++ if (0 == LookAhead) {
++ break;
++ }
++
++ }
++
++ if (A_NO_MEMORY == status) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
++ (" Endpoint :%d has no buffers, blocking receiver to prevent overrun.. \n",
++ pHdr->EndpointID));
++ /* try to stop receive at the device layer */
++ DevStopRecv(&target->Device, asyncProc ? DEV_STOP_RECV_ASYNC : DEV_STOP_RECV_SYNC);
++ status = A_OK;
++ } else if (A_FAILED(status)) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
++ ("Failed to get pending message : LookAhead Value: 0x%X (status = %d) \n",
++ LookAhead, status));
++ if (pPacket != NULL) {
++ /* clean up packet on error */
++ HTC_RECYCLE_RX_PKT(target, pPacket);
++ }
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("-HTCRecvMessagePendingHandler \n"));
++
++ return status;
++}
++
++/* Makes a buffer available to the HTC module */
++A_STATUS HTCAddReceivePkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket)
++{
++ HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
++ HTC_ENDPOINT *pEndpoint;
++ A_BOOL unblockRecv = FALSE;
++ A_STATUS status = A_OK;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_SEND,
++ ("+- HTCAddReceivePkt: endPointId: %d, buffer: 0x%X, length: %d\n",
++ pPacket->Endpoint, (A_UINT32)pPacket->pBuffer, pPacket->BufferLength));
++
++ do {
++
++ if (HTC_STOPPING(target)) {
++ status = A_ECANCELED;
++ break;
++ }
++
++ AR_DEBUG_ASSERT(pPacket->Endpoint < ENDPOINT_MAX);
++
++ pEndpoint = &target->EndPoint[pPacket->Endpoint];
++
++ LOCK_HTC_RX(target);
++
++ /* store receive packet */
++ HTC_PACKET_ENQUEUE(&pEndpoint->RxBuffers, pPacket);
++
++ /* check if we are blocked waiting for a new buffer */
++ if (target->HTCStateFlags & HTC_STATE_WAIT_BUFFERS) {
++ if (target->EpWaitingForBuffers == pPacket->Endpoint) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_RECV,(" receiver was blocked on ep:%d, unblocking.. \n",
++ target->EpWaitingForBuffers));
++ target->HTCStateFlags &= ~HTC_STATE_WAIT_BUFFERS;
++ target->EpWaitingForBuffers = ENDPOINT_MAX;
++ unblockRecv = TRUE;
++ }
++ }
++
++ UNLOCK_HTC_RX(target);
++
++ if (unblockRecv && !HTC_STOPPING(target)) {
++ /* TODO : implement a buffer threshold count? */
++ DevEnableRecv(&target->Device,DEV_ENABLE_RECV_SYNC);
++ }
++
++ } while (FALSE);
++
++ return status;
++}
++
++static void HTCFlushEndpointRX(HTC_TARGET *target, HTC_ENDPOINT *pEndpoint)
++{
++ HTC_PACKET *pPacket;
++
++ LOCK_HTC_RX(target);
++
++ while (1) {
++ pPacket = HTC_PACKET_DEQUEUE(&pEndpoint->RxBuffers);
++ if (NULL == pPacket) {
++ break;
++ }
++ UNLOCK_HTC_RX(target);
++ pPacket->Status = A_ECANCELED;
++ pPacket->ActualLength = 0;
++ AR_DEBUG_PRINTF(ATH_DEBUG_RECV, (" Flushing RX packet:0x%X, length:%d, ep:%d \n",
++ (A_UINT32)pPacket, pPacket->BufferLength, pPacket->Endpoint));
++ /* give the packet back */
++ pEndpoint->EpCallBacks.EpRecv(pEndpoint->EpCallBacks.pContext,
++ pPacket);
++ LOCK_HTC_RX(target);
++ }
++
++ UNLOCK_HTC_RX(target);
++
++
++}
++
++void HTCFlushRecvBuffers(HTC_TARGET *target)
++{
++ HTC_ENDPOINT *pEndpoint;
++ int i;
++
++ /* NOTE: no need to flush endpoint 0, these buffers were
++ * allocated as part of the HTC struct */
++ for (i = ENDPOINT_1; i < ENDPOINT_MAX; i++) {
++ pEndpoint = &target->EndPoint[i];
++ if (pEndpoint->ServiceID == 0) {
++ /* not in use.. */
++ continue;
++ }
++ HTCFlushEndpointRX(target,pEndpoint);
++ }
++
++
++}
++
++
+diff --git a/drivers/ar6000/htc/htc_send.c b/drivers/ar6000/htc/htc_send.c
+new file mode 100644
+index 0000000..cf0dabe
+--- /dev/null
++++ b/drivers/ar6000/htc/htc_send.c
+@@ -0,0 +1,538 @@
++/*
++ *
++ * Copyright (c) 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 "htc_internal.h"
++
++#define DO_EP_TX_COMPLETION(ep,p) \
++{ \
++ (p)->Completion = NULL; \
++ (ep)->EpCallBacks.EpTxComplete((ep)->EpCallBacks.pContext,(p)); \
++}
++
++
++/* call the distribute credits callback with the distribution */
++#define DO_DISTRIBUTION(t,reason,description,pList) \
++{ \
++ AR_DEBUG_PRINTF(ATH_DEBUG_SEND, \
++ (" calling distribute function (%s) (dfn:0x%X, ctxt:0x%X, dist:0x%X) \n", \
++ (description), \
++ (A_UINT32)(t)->DistributeCredits, \
++ (A_UINT32)(t)->pCredDistContext, \
++ (A_UINT32)pList)); \
++ (t)->DistributeCredits((t)->pCredDistContext, \
++ (pList), \
++ (reason)); \
++}
++
++/* our internal send packet completion handler when packets are submited to the AR6K device
++ * layer */
++static void HTCSendPktCompletionHandler(void *Context, HTC_PACKET *pPacket)
++{
++ HTC_TARGET *target = (HTC_TARGET *)Context;
++ HTC_ENDPOINT *pEndpoint = &target->EndPoint[pPacket->Endpoint];
++
++
++ if (A_FAILED(pPacket->Status)) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
++ ("HTCSendPktCompletionHandler: request failed (status:%d, ep:%d) \n",
++ pPacket->Status, pPacket->Endpoint));
++ }
++ /* first, fixup the head room we allocated */
++ pPacket->pBuffer += HTC_HDR_LENGTH;
++ /* do completion */
++ DO_EP_TX_COMPLETION(pEndpoint,pPacket);
++}
++
++A_STATUS HTCIssueSend(HTC_TARGET *target, HTC_PACKET *pPacket, A_UINT8 SendFlags)
++{
++ A_STATUS status;
++ A_UINT8 *pHdrBuf;
++ A_BOOL sync = FALSE;
++
++ /* caller always provides headrooom */
++ pPacket->pBuffer -= HTC_HDR_LENGTH;
++ pHdrBuf = pPacket->pBuffer;
++ /* setup frame header */
++ A_SET_UINT16_FIELD(pHdrBuf,HTC_FRAME_HDR,PayloadLen,(A_UINT16)pPacket->ActualLength);
++ A_SET_UINT8_FIELD(pHdrBuf,HTC_FRAME_HDR,Flags,SendFlags);
++ A_SET_UINT8_FIELD(pHdrBuf,HTC_FRAME_HDR,EndpointID, (A_UINT8)pPacket->Endpoint);
++
++ if (pPacket->Completion == NULL) {
++ /* mark that this request was synchronously issued */
++ sync = TRUE;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_SEND,
++ ("+-HTCIssueSend: transmit length : %d (%s) \n",
++ pPacket->ActualLength + HTC_HDR_LENGTH,
++ sync ? "SYNC" : "ASYNC" ));
++
++ /* send message to device */
++ status = DevSendPacket(&target->Device,
++ pPacket,
++ pPacket->ActualLength + HTC_HDR_LENGTH);
++
++ if (sync) {
++ /* use local sync variable. If this was issued asynchronously, pPacket is no longer
++ * safe to access. */
++ pPacket->pBuffer += HTC_HDR_LENGTH;
++ }
++
++ /* if this request was asynchronous, the packet completion routine will be invoked by
++ * the device layer when the HIF layer completes the request */
++
++ return status;
++}
++
++/* try to send the current packet or a packet at the head of the TX queue,
++ * if there are no credits, the packet remains in the queue. */
++static void HTCTrySend(HTC_TARGET *target,
++ HTC_PACKET *pPacketToSend,
++ HTC_ENDPOINT_ID ep)
++{
++ HTC_PACKET *pPacket;
++ HTC_ENDPOINT *pEndpoint;
++ int creditsRequired;
++ A_UINT8 sendFlags;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("+HTCTrySend (pPkt:0x%X)\n",(A_UINT32)pPacketToSend));
++
++ pEndpoint = &target->EndPoint[ep];
++
++ LOCK_HTC_TX(target);
++
++ if (pPacketToSend != NULL) {
++ /* caller supplied us a packet to queue to the tail of the HTC TX queue before
++ * we check the tx queue */
++ HTC_PACKET_ENQUEUE(&pEndpoint->TxQueue,pPacketToSend);
++ pEndpoint->CurrentTxQueueDepth++;
++ }
++
++ /* now drain the TX queue for transmission as long as we have enough
++ * credits */
++
++ while (1) {
++
++ if (HTC_QUEUE_EMPTY(&pEndpoint->TxQueue)) {
++ /* nothing in the queue */
++ break;
++ }
++
++ sendFlags = 0;
++
++ /* get packet at head, but don't remove it */
++ pPacket = HTC_GET_PKT_AT_HEAD(&pEndpoint->TxQueue);
++ AR_DEBUG_PRINTF(ATH_DEBUG_SEND,(" Got head packet:0x%X , Queue Depth: %d\n",
++ (A_UINT32)pPacket, pEndpoint->CurrentTxQueueDepth));
++
++ /* figure out how many credits this message requires */
++ creditsRequired = pPacket->ActualLength + HTC_HDR_LENGTH;
++ creditsRequired += target->TargetCreditSize - 1;
++ creditsRequired /= target->TargetCreditSize;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_SEND,(" Creds Required:%d Got:%d\n",
++ creditsRequired, pEndpoint->CreditDist.TxCredits));
++
++ if (pEndpoint->CreditDist.TxCredits < creditsRequired) {
++
++ /* not enough credits */
++
++ if (pPacket->Endpoint == ENDPOINT_0) {
++ /* leave it in the queue */
++ break;
++ }
++ /* invoke the registered distribution function only if this is not
++ * endpoint 0, we let the driver layer provide more credits if it can.
++ * We pass the credit distribution list starting at the endpoint in question
++ * */
++
++ /* set how many credits we need */
++ pEndpoint->CreditDist.TxCreditsSeek =
++ creditsRequired - pEndpoint->CreditDist.TxCredits;
++ DO_DISTRIBUTION(target,
++ HTC_CREDIT_DIST_SEEK_CREDITS,
++ "Seek Credits",
++ &pEndpoint->CreditDist);
++
++ pEndpoint->CreditDist.TxCreditsSeek = 0;
++
++ if (pEndpoint->CreditDist.TxCredits < creditsRequired) {
++ /* still not enough credits to send, leave packet in the queue */
++ AR_DEBUG_PRINTF(ATH_DEBUG_SEND,
++ (" Not enough credits for ep %d leaving packet in queue..\n",
++ pPacket->Endpoint));
++ break;
++ }
++
++ }
++
++ pEndpoint->CreditDist.TxCredits -= creditsRequired;
++ INC_HTC_EP_STAT(pEndpoint, TxCreditsConsummed, creditsRequired);
++
++ /* check if we need credits */
++ if (pEndpoint->CreditDist.TxCredits < pEndpoint->CreditDist.TxCreditsPerMaxMsg) {
++ sendFlags |= HTC_FLAGS_NEED_CREDIT_UPDATE;
++ INC_HTC_EP_STAT(pEndpoint, TxCreditLowIndications, 1);
++ AR_DEBUG_PRINTF(ATH_DEBUG_SEND,(" Host Needs Credits \n"));
++ }
++
++ /* now we can fully dequeue */
++ pPacket = HTC_PACKET_DEQUEUE(&pEndpoint->TxQueue);
++ pEndpoint->CurrentTxQueueDepth--;
++
++ INC_HTC_EP_STAT(pEndpoint, TxIssued, 1);
++
++ UNLOCK_HTC_TX(target);
++
++ HTCIssueSend(target, pPacket, sendFlags);
++
++ LOCK_HTC_TX(target);
++
++ /* go back and check for more messages */
++ }
++
++ if (pEndpoint->CurrentTxQueueDepth >= pEndpoint->MaxTxQueueDepth) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_SEND, (" Endpoint %d, TX queue is full, Depth:%d, Max:%d \n",
++ ep, pEndpoint->CurrentTxQueueDepth, pEndpoint->MaxTxQueueDepth));
++ UNLOCK_HTC_TX(target);
++ /* queue is now full, let caller know */
++ if (pEndpoint->EpCallBacks.EpSendFull != NULL) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_SEND, (" Calling driver's send full callback.... \n"));
++ pEndpoint->EpCallBacks.EpSendFull(pEndpoint->EpCallBacks.pContext, ep);
++ }
++ } else {
++ UNLOCK_HTC_TX(target);
++ /* queue is now available for new packet, let caller know */
++ if (pEndpoint->EpCallBacks.EpSendAvail)
++ pEndpoint->EpCallBacks.EpSendAvail(pEndpoint->EpCallBacks.pContext, ep);
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("-HTCTrySend: \n"));
++}
++
++/* HTC API - HTCSendPkt */
++A_STATUS HTCSendPkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket)
++{
++ HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
++ HTC_ENDPOINT *pEndpoint;
++ HTC_ENDPOINT_ID ep;
++ A_STATUS status = A_OK;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_SEND,
++ ("+HTCSendPkt: Enter endPointId: %d, buffer: 0x%X, length: %d \n",
++ pPacket->Endpoint, (A_UINT32)pPacket->pBuffer, pPacket->ActualLength));
++
++ ep = pPacket->Endpoint;
++ AR_DEBUG_ASSERT(ep < ENDPOINT_MAX);
++ pEndpoint = &target->EndPoint[ep];
++
++ do {
++
++ if (HTC_STOPPING(target)) {
++ status = A_ECANCELED;
++ pPacket->Status = status;
++ DO_EP_TX_COMPLETION(pEndpoint,pPacket);
++ break;
++ }
++ /* everything sent through this interface is asynchronous */
++ /* fill in HTC completion routines */
++ pPacket->Completion = HTCSendPktCompletionHandler;
++ pPacket->pContext = target;
++
++ HTCTrySend(target, pPacket, ep);
++
++ } while (FALSE);
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_SEND, ("-HTCSendPkt \n"));
++
++ return status;
++}
++
++
++/* check TX queues to drain because of credit distribution update */
++static INLINE void HTCCheckEndpointTxQueues(HTC_TARGET *target)
++{
++ HTC_ENDPOINT *pEndpoint;
++ HTC_ENDPOINT_CREDIT_DIST *pDistItem;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_SEND, ("+HTCCheckEndpointTxQueues \n"));
++ pDistItem = target->EpCreditDistributionListHead;
++
++ /* run through the credit distribution list to see
++ * if there are packets queued
++ * NOTE: no locks need to be taken since the distribution list
++ * is not dynamic (cannot be re-ordered) and we are not modifying any state */
++ while (pDistItem != NULL) {
++ pEndpoint = (HTC_ENDPOINT *)pDistItem->pHTCReserved;
++
++ if (pEndpoint->CurrentTxQueueDepth > 0) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_SEND, (" Ep %d has %d credits and %d Packets in TX Queue \n",
++ pDistItem->Endpoint, pEndpoint->CreditDist.TxCredits, pEndpoint->CurrentTxQueueDepth));
++ /* try to start the stalled queue, this list is ordered by priority.
++ * Highest priority queue get's processed first, if there are credits available the
++ * highest priority queue will get a chance to reclaim credits from lower priority
++ * ones */
++ HTCTrySend(target, NULL, pDistItem->Endpoint);
++ }
++
++ pDistItem = pDistItem->pNext;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_SEND, ("-HTCCheckEndpointTxQueues \n"));
++}
++
++/* process credit reports and call distribution function */
++void HTCProcessCreditRpt(HTC_TARGET *target, HTC_CREDIT_REPORT *pRpt, int NumEntries, HTC_ENDPOINT_ID FromEndpoint)
++{
++ int i;
++ HTC_ENDPOINT *pEndpoint;
++ int totalCredits = 0;
++ A_BOOL doDist = FALSE;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_SEND, ("+HTCProcessCreditRpt, Credit Report Entries:%d \n", NumEntries));
++
++ /* lock out TX while we update credits */
++ LOCK_HTC_TX(target);
++
++ for (i = 0; i < NumEntries; i++, pRpt++) {
++ if (pRpt->EndpointID >= ENDPOINT_MAX) {
++ AR_DEBUG_ASSERT(FALSE);
++ break;
++ }
++
++ pEndpoint = &target->EndPoint[pRpt->EndpointID];
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_SEND, (" Endpoint %d got %d credits \n",
++ pRpt->EndpointID, pRpt->Credits));
++
++
++#ifdef HTC_EP_STAT_PROFILING
++
++ INC_HTC_EP_STAT(pEndpoint, TxCreditRpts, 1);
++ INC_HTC_EP_STAT(pEndpoint, TxCreditsReturned, pRpt->Credits);
++
++ if (FromEndpoint == pRpt->EndpointID) {
++ /* this credit report arrived on the same endpoint indicating it arrived in an RX
++ * packet */
++ INC_HTC_EP_STAT(pEndpoint, TxCreditsFromRx, pRpt->Credits);
++ INC_HTC_EP_STAT(pEndpoint, TxCreditRptsFromRx, 1);
++ } else if (FromEndpoint == ENDPOINT_0) {
++ /* this credit arrived on endpoint 0 as a NULL message */
++ INC_HTC_EP_STAT(pEndpoint, TxCreditsFromEp0, pRpt->Credits);
++ INC_HTC_EP_STAT(pEndpoint, TxCreditRptsFromEp0, 1);
++ } else {
++ /* arrived on another endpoint */
++ INC_HTC_EP_STAT(pEndpoint, TxCreditsFromOther, pRpt->Credits);
++ INC_HTC_EP_STAT(pEndpoint, TxCreditRptsFromOther, 1);
++ }
++
++#endif
++
++ if (ENDPOINT_0 == pRpt->EndpointID) {
++ /* always give endpoint 0 credits back */
++ pEndpoint->CreditDist.TxCredits += pRpt->Credits;
++ } else {
++ /* for all other endpoints, update credits to distribute, the distribution function
++ * will handle giving out credits back to the endpoints */
++ pEndpoint->CreditDist.TxCreditsToDist += pRpt->Credits;
++ /* flag that we have to do the distribution */
++ doDist = TRUE;
++ }
++
++ totalCredits += pRpt->Credits;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_SEND, (" Report indicated %d credits to distribute \n", totalCredits));
++
++ if (doDist) {
++ /* this was a credit return based on a completed send operations
++ * note, this is done with the lock held */
++ DO_DISTRIBUTION(target,
++ HTC_CREDIT_DIST_SEND_COMPLETE,
++ "Send Complete",
++ target->EpCreditDistributionListHead->pNext);
++ }
++
++ UNLOCK_HTC_TX(target);
++
++ if (totalCredits) {
++ HTCCheckEndpointTxQueues(target);
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_SEND, ("-HTCProcessCreditRpt \n"));
++}
++
++/* flush endpoint TX queue */
++static void HTCFlushEndpointTX(HTC_TARGET *target, HTC_ENDPOINT *pEndpoint, HTC_TX_TAG Tag)
++{
++ HTC_PACKET *pPacket;
++ HTC_PACKET_QUEUE discardQueue;
++
++ /* initialize the discard queue */
++ INIT_HTC_PACKET_QUEUE(&discardQueue);
++
++ LOCK_HTC_TX(target);
++
++ /* interate from the front of the TX queue and flush out packets */
++ ITERATE_OVER_LIST_ALLOW_REMOVE(&pEndpoint->TxQueue, pPacket, HTC_PACKET, ListLink) {
++
++ /* check for removal */
++ if ((HTC_TX_PACKET_TAG_ALL == Tag) || (Tag == pPacket->PktInfo.AsTx.Tag)) {
++ /* remove from queue */
++ HTC_PACKET_REMOVE(pPacket);
++ /* add it to the discard pile */
++ HTC_PACKET_ENQUEUE(&discardQueue, pPacket);
++ pEndpoint->CurrentTxQueueDepth--;
++ }
++
++ } ITERATE_END;
++
++ UNLOCK_HTC_TX(target);
++
++ /* empty the discard queue */
++ while (1) {
++ pPacket = HTC_PACKET_DEQUEUE(&discardQueue);
++ if (NULL == pPacket) {
++ break;
++ }
++ pPacket->Status = A_ECANCELED;
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC, (" Flushing TX packet:0x%X, length:%d, ep:%d tag:0x%X \n",
++ (A_UINT32)pPacket, pPacket->ActualLength, pPacket->Endpoint, pPacket->PktInfo.AsTx.Tag));
++ DO_EP_TX_COMPLETION(pEndpoint,pPacket);
++ }
++
++}
++
++void DumpCreditDist(HTC_ENDPOINT_CREDIT_DIST *pEPDist)
++{
++#ifdef DEBUG
++ HTC_ENDPOINT *pEndpoint = (HTC_ENDPOINT *)pEPDist->pHTCReserved;
++#endif
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_ANY, ("--- EP : %d ServiceID: 0x%X --------------\n",
++ pEPDist->Endpoint, pEPDist->ServiceID));
++ AR_DEBUG_PRINTF(ATH_DEBUG_ANY, (" this:0x%X next:0x%X prev:0x%X\n",
++ (A_UINT32)pEPDist, (A_UINT32)pEPDist->pNext, (A_UINT32)pEPDist->pPrev));
++ AR_DEBUG_PRINTF(ATH_DEBUG_ANY, (" DistFlags : 0x%X \n", pEPDist->DistFlags));
++ AR_DEBUG_PRINTF(ATH_DEBUG_ANY, (" TxCreditsNorm : %d \n", pEPDist->TxCreditsNorm));
++ AR_DEBUG_PRINTF(ATH_DEBUG_ANY, (" TxCreditsMin : %d \n", pEPDist->TxCreditsMin));
++ AR_DEBUG_PRINTF(ATH_DEBUG_ANY, (" TxCredits : %d \n", pEPDist->TxCredits));
++ AR_DEBUG_PRINTF(ATH_DEBUG_ANY, (" TxCreditsAssigned : %d \n", pEPDist->TxCreditsAssigned));
++ AR_DEBUG_PRINTF(ATH_DEBUG_ANY, (" TxCreditsSeek : %d \n", pEPDist->TxCreditsSeek));
++ AR_DEBUG_PRINTF(ATH_DEBUG_ANY, (" TxCreditSize : %d \n", pEPDist->TxCreditSize));
++ AR_DEBUG_PRINTF(ATH_DEBUG_ANY, (" TxCreditsPerMaxMsg : %d \n", pEPDist->TxCreditsPerMaxMsg));
++ AR_DEBUG_PRINTF(ATH_DEBUG_ANY, (" TxCreditsToDist : %d \n", pEPDist->TxCreditsToDist));
++ AR_DEBUG_PRINTF(ATH_DEBUG_ANY, (" TxQueueDepth : %d \n", pEndpoint->CurrentTxQueueDepth));
++ AR_DEBUG_PRINTF(ATH_DEBUG_ANY, ("----------------------------------------------------\n"));
++}
++
++void DumpCreditDistStates(HTC_TARGET *target)
++{
++ HTC_ENDPOINT_CREDIT_DIST *pEPList = target->EpCreditDistributionListHead;
++
++ while (pEPList != NULL) {
++ DumpCreditDist(pEPList);
++ pEPList = pEPList->pNext;
++ }
++
++ if (target->DistributeCredits != NULL) {
++ DO_DISTRIBUTION(target,
++ HTC_DUMP_CREDIT_STATE,
++ "Dump State",
++ NULL);
++ }
++}
++
++/* flush all send packets from all endpoint queues */
++void HTCFlushSendPkts(HTC_TARGET *target)
++{
++ HTC_ENDPOINT *pEndpoint;
++ int i;
++
++ DumpCreditDistStates(target);
++
++ for (i = ENDPOINT_0; i < ENDPOINT_MAX; i++) {
++ pEndpoint = &target->EndPoint[i];
++ if (pEndpoint->ServiceID == 0) {
++ /* not in use.. */
++ continue;
++ }
++ HTCFlushEndpointTX(target,pEndpoint,HTC_TX_PACKET_TAG_ALL);
++ }
++
++}
++
++/* HTC API to flush an endpoint's TX queue*/
++void HTCFlushEndpoint(HTC_HANDLE HTCHandle, HTC_ENDPOINT_ID Endpoint, HTC_TX_TAG Tag)
++{
++ HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
++ HTC_ENDPOINT *pEndpoint = &target->EndPoint[Endpoint];
++
++ if (pEndpoint->ServiceID == 0) {
++ AR_DEBUG_ASSERT(FALSE);
++ /* not in use.. */
++ return;
++ }
++
++ HTCFlushEndpointTX(target, pEndpoint, Tag);
++}
++
++/* HTC API to indicate activity to the credit distribution function */
++void HTCIndicateActivityChange(HTC_HANDLE HTCHandle,
++ HTC_ENDPOINT_ID Endpoint,
++ A_BOOL Active)
++{
++ HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
++ HTC_ENDPOINT *pEndpoint = &target->EndPoint[Endpoint];
++ A_BOOL doDist = FALSE;
++
++ if (pEndpoint->ServiceID == 0) {
++ AR_DEBUG_ASSERT(FALSE);
++ /* not in use.. */
++ return;
++ }
++
++ LOCK_HTC_TX(target);
++
++ if (Active) {
++ if (!(pEndpoint->CreditDist.DistFlags & HTC_EP_ACTIVE)) {
++ /* mark active now */
++ pEndpoint->CreditDist.DistFlags |= HTC_EP_ACTIVE;
++ doDist = TRUE;
++ }
++ } else {
++ if (pEndpoint->CreditDist.DistFlags & HTC_EP_ACTIVE) {
++ /* mark inactive now */
++ pEndpoint->CreditDist.DistFlags &= ~HTC_EP_ACTIVE;
++ doDist = TRUE;
++ }
++ }
++
++ if (doDist) {
++ /* do distribution again based on activity change
++ * note, this is done with the lock held */
++ DO_DISTRIBUTION(target,
++ HTC_CREDIT_DIST_ACTIVITY_CHANGE,
++ "Activity Change",
++ target->EpCreditDistributionListHead->pNext);
++ }
++
++ UNLOCK_HTC_TX(target);
++
++}
+diff --git a/drivers/ar6000/htc/htc_services.c b/drivers/ar6000/htc/htc_services.c
+new file mode 100644
+index 0000000..e5d50d1
+--- /dev/null
++++ b/drivers/ar6000/htc/htc_services.c
+@@ -0,0 +1,403 @@
++/*
++ *
++ * Copyright (c) 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 "htc_internal.h"
++
++void HTCControlTxComplete(void *Context, HTC_PACKET *pPacket)
++{
++ /* not implemented
++ * we do not send control TX frames during normal runtime, only during setup */
++ AR_DEBUG_ASSERT(FALSE);
++}
++
++ /* callback when a control message arrives on this endpoint */
++void HTCControlRecv(void *Context, HTC_PACKET *pPacket)
++{
++ AR_DEBUG_ASSERT(pPacket->Endpoint == ENDPOINT_0);
++
++ /* the only control messages we are expecting are NULL messages (credit resports), which should
++ * never get here */
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
++ ("HTCControlRecv, got message with length:%d \n",
++ pPacket->ActualLength + HTC_HDR_LENGTH));
++
++ /* dump header and message */
++ DebugDumpBytes(pPacket->pBuffer - HTC_HDR_LENGTH,
++ pPacket->ActualLength + HTC_HDR_LENGTH,
++ "Unexpected ENDPOINT 0 Message");
++
++ HTC_RECYCLE_RX_PKT((HTC_TARGET*)Context,pPacket);
++}
++
++A_STATUS HTCSendSetupComplete(HTC_TARGET *target)
++{
++ HTC_PACKET *pSendPacket = NULL;
++ A_STATUS status;
++ HTC_SETUP_COMPLETE_MSG *pSetupComplete;
++
++ do {
++ /* allocate a packet to send to the target */
++ pSendPacket = HTC_ALLOC_CONTROL_TX(target);
++
++ if (NULL == pSendPacket) {
++ status = A_NO_MEMORY;
++ break;
++ }
++
++ /* assemble setup complete message */
++ pSetupComplete = (HTC_SETUP_COMPLETE_MSG *)pSendPacket->pBuffer;
++ A_MEMZERO(pSetupComplete,sizeof(HTC_SETUP_COMPLETE_MSG));
++ pSetupComplete->MessageID = HTC_MSG_SETUP_COMPLETE_ID;
++
++ SET_HTC_PACKET_INFO_TX(pSendPacket,
++ NULL,
++ (A_UINT8 *)pSetupComplete,
++ sizeof(HTC_SETUP_COMPLETE_MSG),
++ ENDPOINT_0,
++ HTC_SERVICE_TX_PACKET_TAG);
++
++ /* we want synchronous operation */
++ pSendPacket->Completion = NULL;
++ /* send the message */
++ status = HTCIssueSend(target,pSendPacket,0);
++
++ } while (FALSE);
++
++ if (pSendPacket != NULL) {
++ HTC_FREE_CONTROL_TX(target,pSendPacket);
++ }
++
++ return status;
++}
++
++
++A_STATUS HTCConnectService(HTC_HANDLE HTCHandle,
++ HTC_SERVICE_CONNECT_REQ *pConnectReq,
++ HTC_SERVICE_CONNECT_RESP *pConnectResp)
++{
++ HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
++ A_STATUS status = A_OK;
++ HTC_PACKET *pRecvPacket = NULL;
++ HTC_PACKET *pSendPacket = NULL;
++ HTC_CONNECT_SERVICE_RESPONSE_MSG *pResponseMsg;
++ HTC_CONNECT_SERVICE_MSG *pConnectMsg;
++ HTC_ENDPOINT_ID assignedEndpoint = ENDPOINT_MAX;
++ HTC_ENDPOINT *pEndpoint;
++ int maxMsgSize = 0;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("+HTCConnectService, target:0x%X SvcID:0x%X \n",
++ (A_UINT32)target, pConnectReq->ServiceID));
++
++ do {
++
++ AR_DEBUG_ASSERT(pConnectReq->ServiceID != 0);
++
++ if (HTC_CTRL_RSVD_SVC == pConnectReq->ServiceID) {
++ /* special case for pseudo control service */
++ assignedEndpoint = ENDPOINT_0;
++ maxMsgSize = HTC_MAX_CONTROL_MESSAGE_LENGTH;
++ } else {
++ /* allocate a packet to send to the target */
++ pSendPacket = HTC_ALLOC_CONTROL_TX(target);
++
++ if (NULL == pSendPacket) {
++ AR_DEBUG_ASSERT(FALSE);
++ status = A_NO_MEMORY;
++ break;
++ }
++ /* assemble connect service message */
++ pConnectMsg = (HTC_CONNECT_SERVICE_MSG *)pSendPacket->pBuffer;
++ AR_DEBUG_ASSERT(pConnectMsg != NULL);
++ A_MEMZERO(pConnectMsg,sizeof(HTC_CONNECT_SERVICE_MSG));
++ pConnectMsg->MessageID = HTC_MSG_CONNECT_SERVICE_ID;
++ pConnectMsg->ServiceID = pConnectReq->ServiceID;
++ pConnectMsg->ConnectionFlags = pConnectReq->ConnectionFlags;
++ /* check caller if it wants to transfer meta data */
++ if ((pConnectReq->pMetaData != NULL) &&
++ (pConnectReq->MetaDataLength <= HTC_SERVICE_META_DATA_MAX_LENGTH)) {
++ /* copy meta data into message buffer (after header ) */
++ A_MEMCPY((A_UINT8 *)pConnectMsg + sizeof(HTC_CONNECT_SERVICE_MSG),
++ pConnectReq->pMetaData,
++ pConnectReq->MetaDataLength);
++ pConnectMsg->ServiceMetaLength = pConnectReq->MetaDataLength;
++ }
++
++ SET_HTC_PACKET_INFO_TX(pSendPacket,
++ NULL,
++ (A_UINT8 *)pConnectMsg,
++ sizeof(HTC_CONNECT_SERVICE_MSG) + pConnectMsg->ServiceMetaLength,
++ ENDPOINT_0,
++ HTC_SERVICE_TX_PACKET_TAG);
++
++ /* we want synchronous operation */
++ pSendPacket->Completion = NULL;
++
++ status = HTCIssueSend(target,pSendPacket,0);
++
++ if (A_FAILED(status)) {
++ break;
++ }
++
++ /* wait for response */
++ status = HTCWaitforControlMessage(target, &pRecvPacket);
++
++ if (A_FAILED(status)) {
++ break;
++ }
++ /* we controlled the buffer creation so it has to be properly aligned */
++ pResponseMsg = (HTC_CONNECT_SERVICE_RESPONSE_MSG *)pRecvPacket->pBuffer;
++
++ if ((pResponseMsg->MessageID != HTC_MSG_CONNECT_SERVICE_RESPONSE_ID) ||
++ (pRecvPacket->ActualLength < sizeof(HTC_CONNECT_SERVICE_RESPONSE_MSG))) {
++ /* this message is not valid */
++ AR_DEBUG_ASSERT(FALSE);
++ status = A_EPROTO;
++ break;
++ }
++
++ pConnectResp->ConnectRespCode = pResponseMsg->Status;
++ /* check response status */
++ if (pResponseMsg->Status != HTC_SERVICE_SUCCESS) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
++ (" Target failed service 0x%X connect request (status:%d)\n",
++ pResponseMsg->ServiceID, pResponseMsg->Status));
++ status = A_EPROTO;
++ break;
++ }
++
++ assignedEndpoint = pResponseMsg->EndpointID;
++ maxMsgSize = pResponseMsg->MaxMsgSize;
++
++ if ((pConnectResp->pMetaData != NULL) &&
++ (pResponseMsg->ServiceMetaLength > 0) &&
++ (pResponseMsg->ServiceMetaLength <= HTC_SERVICE_META_DATA_MAX_LENGTH)) {
++ /* caller supplied a buffer and the target responded with data */
++ int copyLength = min((int)pConnectResp->BufferLength, (int)pResponseMsg->ServiceMetaLength);
++ /* copy the meta data */
++ A_MEMCPY(pConnectResp->pMetaData,
++ ((A_UINT8 *)pResponseMsg) + sizeof(HTC_CONNECT_SERVICE_RESPONSE_MSG),
++ copyLength);
++ pConnectResp->ActualLength = copyLength;
++ }
++
++ }
++
++ /* the rest of these are parameter checks so set the error status */
++ status = A_EPROTO;
++
++ if (assignedEndpoint >= ENDPOINT_MAX) {
++ AR_DEBUG_ASSERT(FALSE);
++ break;
++ }
++
++ if (0 == maxMsgSize) {
++ AR_DEBUG_ASSERT(FALSE);
++ break;
++ }
++
++ pEndpoint = &target->EndPoint[assignedEndpoint];
++
++ if (pEndpoint->ServiceID != 0) {
++ /* endpoint already in use! */
++ AR_DEBUG_ASSERT(FALSE);
++ break;
++ }
++
++ /* return assigned endpoint to caller */
++ pConnectResp->Endpoint = assignedEndpoint;
++ pConnectResp->MaxMsgLength = maxMsgSize;
++
++ /* setup the endpoint */
++ pEndpoint->ServiceID = pConnectReq->ServiceID; /* this marks the endpoint in use */
++ pEndpoint->MaxTxQueueDepth = pConnectReq->MaxSendQueueDepth;
++ pEndpoint->MaxMsgLength = maxMsgSize;
++ /* copy all the callbacks */
++ pEndpoint->EpCallBacks = pConnectReq->EpCallbacks;
++ INIT_HTC_PACKET_QUEUE(&pEndpoint->RxBuffers);
++ INIT_HTC_PACKET_QUEUE(&pEndpoint->TxQueue);
++ /* set the credit distribution info for this endpoint, this information is
++ * passed back to the credit distribution callback function */
++ pEndpoint->CreditDist.ServiceID = pConnectReq->ServiceID;
++ pEndpoint->CreditDist.pHTCReserved = pEndpoint;
++ pEndpoint->CreditDist.Endpoint = assignedEndpoint;
++ pEndpoint->CreditDist.TxCreditSize = target->TargetCreditSize;
++ pEndpoint->CreditDist.TxCreditsPerMaxMsg = maxMsgSize / target->TargetCreditSize;
++
++ if (0 == pEndpoint->CreditDist.TxCreditsPerMaxMsg) {
++ pEndpoint->CreditDist.TxCreditsPerMaxMsg = 1;
++ }
++
++ status = A_OK;
++
++ } while (FALSE);
++
++ if (pSendPacket != NULL) {
++ HTC_FREE_CONTROL_TX(target,pSendPacket);
++ }
++
++ if (pRecvPacket != NULL) {
++ HTC_FREE_CONTROL_RX(target,pRecvPacket);
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("-HTCConnectService \n"));
++
++ return status;
++}
++
++static void AddToEndpointDistList(HTC_TARGET *target, HTC_ENDPOINT_CREDIT_DIST *pEpDist)
++{
++ HTC_ENDPOINT_CREDIT_DIST *pCurEntry,*pLastEntry;
++
++ if (NULL == target->EpCreditDistributionListHead) {
++ target->EpCreditDistributionListHead = pEpDist;
++ pEpDist->pNext = NULL;
++ pEpDist->pPrev = NULL;
++ return;
++ }
++
++ /* queue to the end of the list, this does not have to be very
++ * fast since this list is built at startup time */
++ pCurEntry = target->EpCreditDistributionListHead;
++
++ while (pCurEntry) {
++ pLastEntry = pCurEntry;
++ pCurEntry = pCurEntry->pNext;
++ }
++
++ pLastEntry->pNext = pEpDist;
++ pEpDist->pPrev = pLastEntry;
++ pEpDist->pNext = NULL;
++}
++
++
++
++/* default credit init callback */
++static void HTCDefaultCreditInit(void *Context,
++ HTC_ENDPOINT_CREDIT_DIST *pEPList,
++ int TotalCredits)
++{
++ HTC_ENDPOINT_CREDIT_DIST *pCurEpDist;
++ int totalEps = 0;
++ int creditsPerEndpoint;
++
++ pCurEpDist = pEPList;
++ /* first run through the list and figure out how many endpoints we are dealing with */
++ while (pCurEpDist != NULL) {
++ pCurEpDist = pCurEpDist->pNext;
++ totalEps++;
++ }
++
++ /* even distribution */
++ creditsPerEndpoint = TotalCredits/totalEps;
++
++ pCurEpDist = pEPList;
++ /* run through the list and set minimum and normal credits and
++ * provide the endpoint with some credits to start */
++ while (pCurEpDist != NULL) {
++
++ if (creditsPerEndpoint < pCurEpDist->TxCreditsPerMaxMsg) {
++ /* too many endpoints and not enough credits */
++ AR_DEBUG_ASSERT(FALSE);
++ break;
++ }
++ /* our minimum is set for at least 1 max message */
++ pCurEpDist->TxCreditsMin = pCurEpDist->TxCreditsPerMaxMsg;
++ /* this value is ignored by our credit alg, since we do
++ * not dynamically adjust credits, this is the policy of
++ * the "default" credit distribution, something simple and easy */
++ pCurEpDist->TxCreditsNorm = 0xFFFF;
++ /* give the endpoint minimum credits */
++ pCurEpDist->TxCredits = creditsPerEndpoint;
++ pCurEpDist->TxCreditsAssigned = creditsPerEndpoint;
++ pCurEpDist = pCurEpDist->pNext;
++ }
++
++}
++
++/* default credit distribution callback, NOTE, this callback holds the TX lock */
++void HTCDefaultCreditDist(void *Context,
++ HTC_ENDPOINT_CREDIT_DIST *pEPDistList,
++ HTC_CREDIT_DIST_REASON Reason)
++{
++ HTC_ENDPOINT_CREDIT_DIST *pCurEpDist;
++
++ if (Reason == HTC_CREDIT_DIST_SEND_COMPLETE) {
++ pCurEpDist = pEPDistList;
++ /* simple distribution */
++ while (pCurEpDist != NULL) {
++ if (pCurEpDist->TxCreditsToDist > 0) {
++ /* just give the endpoint back the credits */
++ pCurEpDist->TxCredits += pCurEpDist->TxCreditsToDist;
++ pCurEpDist->TxCreditsToDist = 0;
++ }
++ pCurEpDist = pCurEpDist->pNext;
++ }
++ }
++
++ /* note we do not need to handle the other reason codes as this is a very
++ * simple distribution scheme, no need to seek for more credits or handle inactivity */
++}
++
++void HTCSetCreditDistribution(HTC_HANDLE HTCHandle,
++ void *pCreditDistContext,
++ HTC_CREDIT_DIST_CALLBACK CreditDistFunc,
++ HTC_CREDIT_INIT_CALLBACK CreditInitFunc,
++ HTC_SERVICE_ID ServicePriorityOrder[],
++ int ListLength)
++{
++ HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
++ int i;
++ int ep;
++
++ if (CreditInitFunc != NULL) {
++ /* caller has supplied their own distribution functions */
++ target->InitCredits = CreditInitFunc;
++ AR_DEBUG_ASSERT(CreditDistFunc != NULL);
++ target->DistributeCredits = CreditDistFunc;
++ target->pCredDistContext = pCreditDistContext;
++ } else {
++ /* caller wants HTC to do distribution */
++ /* if caller wants service to handle distributions then
++ * it must set both of these to NULL! */
++ AR_DEBUG_ASSERT(CreditDistFunc == NULL);
++ target->InitCredits = HTCDefaultCreditInit;
++ target->DistributeCredits = HTCDefaultCreditDist;
++ target->pCredDistContext = target;
++ }
++
++ /* always add HTC control endpoint first, we only expose the list after the
++ * first one, this is added for TX queue checking */
++ AddToEndpointDistList(target, &target->EndPoint[ENDPOINT_0].CreditDist);
++
++ /* build the list of credit distribution structures in priority order
++ * supplied by the caller, these will follow endpoint 0 */
++ for (i = 0; i < ListLength; i++) {
++ /* match services with endpoints and add the endpoints to the distribution list
++ * in FIFO order */
++ for (ep = ENDPOINT_1; ep < ENDPOINT_MAX; ep++) {
++ if (target->EndPoint[ep].ServiceID == ServicePriorityOrder[i]) {
++ /* queue this one to the list */
++ AddToEndpointDistList(target, &target->EndPoint[ep].CreditDist);
++ break;
++ }
++ }
++ AR_DEBUG_ASSERT(ep < ENDPOINT_MAX);
++ }
++
++}
+diff --git a/drivers/ar6000/include/AR6001_regdump.h b/drivers/ar6000/include/AR6001_regdump.h
+new file mode 100644
+index 0000000..c1bcade
+--- /dev/null
++++ b/drivers/ar6000/include/AR6001_regdump.h
+@@ -0,0 +1,100 @@
++/*
++ * Copyright (c) 2006 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ * $ATH_LICENSE_HOSTSDK0_C$
++ *
++ */
++
++#ifndef __AR6000_REGDUMP_H__
++#define __AR6000_REGDUMP_H__
++
++#if !defined(__ASSEMBLER__)
++/*
++ * Target CPU state at the time of failure is reflected
++ * in a register dump, which the Host can fetch through
++ * the diagnostic window.
++ */
++
++struct MIPS_exception_frame_s {
++ A_UINT32 pc; /* Program Counter */
++ A_UINT32 at; /* MIPS General Purpose registers */
++ A_UINT32 v0;
++ A_UINT32 v1;
++ A_UINT32 a0;
++ A_UINT32 a1;
++ A_UINT32 a2;
++ A_UINT32 a3;
++ A_UINT32 t0;
++ A_UINT32 t1;
++ A_UINT32 t2;
++ A_UINT32 t3;
++ A_UINT32 t4;
++ A_UINT32 t5;
++ A_UINT32 t6;
++ A_UINT32 t7;
++ A_UINT32 s0;
++ A_UINT32 s1;
++ A_UINT32 s2;
++ A_UINT32 s3;
++ A_UINT32 s4;
++ A_UINT32 s5;
++ A_UINT32 s6;
++ A_UINT32 s7;
++ A_UINT32 t8;
++ A_UINT32 t9;
++ A_UINT32 k0;
++ A_UINT32 k1;
++ A_UINT32 gp;
++ A_UINT32 sp;
++ A_UINT32 s8;
++ A_UINT32 ra;
++ A_UINT32 cause; /* Selected coprocessor regs */
++ A_UINT32 status;
++};
++typedef struct MIPS_exception_frame_s CPU_exception_frame_t;
++
++#endif
++
++/*
++ * Offsets into MIPS_exception_frame structure, for use in assembler code
++ * MUST MATCH C STRUCTURE ABOVE
++ */
++#define RD_pc 0
++#define RD_at 1
++#define RD_v0 2
++#define RD_v1 3
++#define RD_a0 4
++#define RD_a1 5
++#define RD_a2 6
++#define RD_a3 7
++#define RD_t0 8
++#define RD_t1 9
++#define RD_t2 10
++#define RD_t3 11
++#define RD_t4 12
++#define RD_t5 13
++#define RD_t6 14
++#define RD_t7 15
++#define RD_s0 16
++#define RD_s1 17
++#define RD_s2 18
++#define RD_s3 19
++#define RD_s4 20
++#define RD_s5 21
++#define RD_s6 22
++#define RD_s7 23
++#define RD_t8 24
++#define RD_t9 25
++#define RD_k0 26
++#define RD_k1 27
++#define RD_gp 28
++#define RD_sp 29
++#define RD_s8 30
++#define RD_ra 31
++#define RD_cause 32
++#define RD_status 33
++
++#define RD_SIZE (34*4) /* Space for this number of words */
++
++#endif /* __AR6000_REGDUMP_H__ */
+diff --git a/drivers/ar6000/include/AR6K_version.h b/drivers/ar6000/include/AR6K_version.h
+new file mode 100644
+index 0000000..d5b2a20
+--- /dev/null
++++ b/drivers/ar6000/include/AR6K_version.h
+@@ -0,0 +1,36 @@
++#define __VER_MAJOR_ 2
++#define __VER_MINOR_ 0
++#define __VER_PATCH_ 0
++
++
++/*
++ * Copyright (c) 2004-2007 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ * $ATH_LICENSE_HOSTSDK0_C$
++ *
++ * The makear6ksdk script (used for release builds) modifies the following line.
++ */
++#define __BUILD_NUMBER_ 18
++
++
++/* Format of the version number. */
++#define VER_MAJOR_BIT_OFFSET 28
++#define VER_MINOR_BIT_OFFSET 24
++#define VER_PATCH_BIT_OFFSET 16
++#define VER_BUILD_NUM_BIT_OFFSET 0
++
++
++/*
++ * The version has the following format:
++ * Bits 28-31: Major version
++ * Bits 24-27: Minor version
++ * Bits 16-23: Patch version
++ * Bits 0-15: Build number (automatically generated during build process )
++ * E.g. Build 1.1.3.7 would be represented as 0x11030007.
++ *
++ * DO NOT split the following macro into multiple lines as this may confuse the build scripts.
++ */
++#define AR6K_SW_VERSION ( ( __VER_MAJOR_ << VER_MAJOR_BIT_OFFSET ) + ( __VER_MINOR_ << VER_MINOR_BIT_OFFSET ) + ( __VER_PATCH_ << VER_PATCH_BIT_OFFSET ) + ( __BUILD_NUMBER_ << VER_BUILD_NUM_BIT_OFFSET ) )
++
++
+diff --git a/drivers/ar6000/include/AR6K_version.h.NEW b/drivers/ar6000/include/AR6K_version.h.NEW
+new file mode 100644
+index 0000000..d5b2a20
+--- /dev/null
++++ b/drivers/ar6000/include/AR6K_version.h.NEW
+@@ -0,0 +1,36 @@
++#define __VER_MAJOR_ 2
++#define __VER_MINOR_ 0
++#define __VER_PATCH_ 0
++
++
++/*
++ * Copyright (c) 2004-2007 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ * $ATH_LICENSE_HOSTSDK0_C$
++ *
++ * The makear6ksdk script (used for release builds) modifies the following line.
++ */
++#define __BUILD_NUMBER_ 18
++
++
++/* Format of the version number. */
++#define VER_MAJOR_BIT_OFFSET 28
++#define VER_MINOR_BIT_OFFSET 24
++#define VER_PATCH_BIT_OFFSET 16
++#define VER_BUILD_NUM_BIT_OFFSET 0
++
++
++/*
++ * The version has the following format:
++ * Bits 28-31: Major version
++ * Bits 24-27: Minor version
++ * Bits 16-23: Patch version
++ * Bits 0-15: Build number (automatically generated during build process )
++ * E.g. Build 1.1.3.7 would be represented as 0x11030007.
++ *
++ * DO NOT split the following macro into multiple lines as this may confuse the build scripts.
++ */
++#define AR6K_SW_VERSION ( ( __VER_MAJOR_ << VER_MAJOR_BIT_OFFSET ) + ( __VER_MINOR_ << VER_MINOR_BIT_OFFSET ) + ( __VER_PATCH_ << VER_PATCH_BIT_OFFSET ) + ( __BUILD_NUMBER_ << VER_BUILD_NUM_BIT_OFFSET ) )
++
++
+diff --git a/drivers/ar6000/include/AR6Khwreg.h b/drivers/ar6000/include/AR6Khwreg.h
+new file mode 100644
+index 0000000..ecfdf20
+--- /dev/null
++++ b/drivers/ar6000/include/AR6Khwreg.h
+@@ -0,0 +1,147 @@
++/*
++ * Copyright (c) 2004-2007 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ * $ATH_LICENSE_HOSTSDK0_C$
++ *
++ * This file contains the definitions for AR6001 registers
++ * that may be directly manipulated by Host software.
++ */
++
++#ifndef __AR6KHWREG_H__
++#define __AR6KHWREG_H__
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++/* Host registers */
++#define HOST_INT_STATUS_ADDRESS 0x00000400
++#define CPU_INT_STATUS_ADDRESS 0x00000401
++#define ERROR_INT_STATUS_ADDRESS 0x00000402
++#define INT_STATUS_ENABLE_ADDRESS 0x00000418
++#define CPU_INT_STATUS_ENABLE_ADDRESS 0x00000419
++#define COUNT_ADDRESS 0x00000420
++#define COUNT_DEC_ADDRESS 0x00000440
++#define WINDOW_DATA_ADDRESS 0x00000474
++#define WINDOW_WRITE_ADDR_ADDRESS 0x00000478
++#define WINDOW_READ_ADDR_ADDRESS 0x0000047c
++
++/* Target addresses */
++#define RESET_CONTROL_ADDRESS 0x0c000000
++#define MC_REMAP_VALID_ADDRESS 0x0c004080
++#define MC_REMAP_SIZE_ADDRESS 0x0c004100
++#define MC_REMAP_COMPARE_ADDRESS 0x0c004180
++#define MC_REMAP_TARGET_ADDRESS 0x0c004200
++#define LOCAL_COUNT_ADDRESS 0x0c014080
++#define LOCAL_SCRATCH_ADDRESS 0x0c0140c0
++
++
++#define INT_STATUS_ENABLE_ERROR_MSB 7
++#define INT_STATUS_ENABLE_ERROR_LSB 7
++#define INT_STATUS_ENABLE_ERROR_MASK 0x00000080
++#define INT_STATUS_ENABLE_ERROR_GET(x) (((x) & INT_STATUS_ENABLE_ERROR_MASK) >> INT_STATUS_ENABLE_ERROR_LSB)
++#define INT_STATUS_ENABLE_ERROR_SET(x) (((x) << INT_STATUS_ENABLE_ERROR_LSB) & INT_STATUS_ENABLE_ERROR_MASK)
++
++#define INT_STATUS_ENABLE_CPU_MSB 6
++#define INT_STATUS_ENABLE_CPU_LSB 6
++#define INT_STATUS_ENABLE_CPU_MASK 0x00000040
++#define INT_STATUS_ENABLE_CPU_GET(x) (((x) & INT_STATUS_ENABLE_CPU_MASK) >> INT_STATUS_ENABLE_CPU_LSB)
++#define INT_STATUS_ENABLE_CPU_SET(x) (((x) << INT_STATUS_ENABLE_CPU_LSB) & INT_STATUS_ENABLE_CPU_MASK)
++
++#define INT_STATUS_ENABLE_COUNTER_MSB 4
++#define INT_STATUS_ENABLE_COUNTER_LSB 4
++#define INT_STATUS_ENABLE_COUNTER_MASK 0x00000010
++#define INT_STATUS_ENABLE_COUNTER_GET(x) (((x) & INT_STATUS_ENABLE_COUNTER_MASK) >> INT_STATUS_ENABLE_COUNTER_LSB)
++#define INT_STATUS_ENABLE_COUNTER_SET(x) (((x) << INT_STATUS_ENABLE_COUNTER_LSB) & INT_STATUS_ENABLE_COUNTER_MASK)
++
++#define INT_STATUS_ENABLE_MBOX_DATA_MSB 3
++#define INT_STATUS_ENABLE_MBOX_DATA_LSB 0
++#define INT_STATUS_ENABLE_MBOX_DATA_MASK 0x0000000f
++#define INT_STATUS_ENABLE_MBOX_DATA_GET(x) (((x) & INT_STATUS_ENABLE_MBOX_DATA_MASK) >> INT_STATUS_ENABLE_MBOX_DATA_LSB)
++#define INT_STATUS_ENABLE_MBOX_DATA_SET(x) (((x) << INT_STATUS_ENABLE_MBOX_DATA_LSB) & INT_STATUS_ENABLE_MBOX_DATA_MASK)
++
++#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_MSB 1
++#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB 1
++#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK 0x00000002
++#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_GET(x) (((x) & ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK) >> ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB)
++#define ERROR_STATUS_ENABLE_RX_UNDERFLOW_SET(x) (((x) << ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB) & ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK)
++
++#define ERROR_STATUS_ENABLE_TX_OVERFLOW_MSB 0
++#define ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB 0
++#define ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK 0x00000001
++#define ERROR_STATUS_ENABLE_TX_OVERFLOW_GET(x) (((x) & ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK) >> ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB)
++#define ERROR_STATUS_ENABLE_TX_OVERFLOW_SET(x) (((x) << ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB) & ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK)
++
++
++#define CPU_INT_STATUS_ENABLE_BIT_MSB 7
++#define CPU_INT_STATUS_ENABLE_BIT_LSB 0
++#define CPU_INT_STATUS_ENABLE_BIT_MASK 0x000000ff
++#define CPU_INT_STATUS_ENABLE_BIT_GET(x) (((x) & CPU_INT_STATUS_ENABLE_BIT_MASK) >> CPU_INT_STATUS_ENABLE_BIT_LSB)
++#define CPU_INT_STATUS_ENABLE_BIT_SET(x) (((x) << CPU_INT_STATUS_ENABLE_BIT_LSB) & CPU_INT_STATUS_ENABLE_BIT_MASK)
++
++#define COUNTER_INT_STATUS_ENABLE_BIT_MSB 7
++#define COUNTER_INT_STATUS_ENABLE_BIT_LSB 0
++#define COUNTER_INT_STATUS_ENABLE_BIT_MASK 0x000000ff
++#define COUNTER_INT_STATUS_ENABLE_BIT_GET(x) (((x) & COUNTER_INT_STATUS_ENABLE_BIT_MASK) >> COUNTER_INT_STATUS_ENABLE_BIT_LSB)
++#define COUNTER_INT_STATUS_ENABLE_BIT_SET(x) (((x) << COUNTER_INT_STATUS_ENABLE_BIT_LSB) & COUNTER_INT_STATUS_ENABLE_BIT_MASK)
++
++#define ERROR_INT_STATUS_WAKEUP_MSB 2
++#define ERROR_INT_STATUS_WAKEUP_LSB 2
++#define ERROR_INT_STATUS_WAKEUP_MASK 0x00000004
++#define ERROR_INT_STATUS_WAKEUP_GET(x) (((x) & ERROR_INT_STATUS_WAKEUP_MASK) >> ERROR_INT_STATUS_WAKEUP_LSB)
++#define ERROR_INT_STATUS_WAKEUP_SET(x) (((x) << ERROR_INT_STATUS_WAKEUP_LSB) & ERROR_INT_STATUS_WAKEUP_MASK)
++
++#define ERROR_INT_STATUS_RX_UNDERFLOW_MSB 1
++#define ERROR_INT_STATUS_RX_UNDERFLOW_LSB 1
++#define ERROR_INT_STATUS_RX_UNDERFLOW_MASK 0x00000002
++#define ERROR_INT_STATUS_RX_UNDERFLOW_GET(x) (((x) & ERROR_INT_STATUS_RX_UNDERFLOW_MASK) >> ERROR_INT_STATUS_RX_UNDERFLOW_LSB)
++#define ERROR_INT_STATUS_RX_UNDERFLOW_SET(x) (((x) << ERROR_INT_STATUS_RX_UNDERFLOW_LSB) & ERROR_INT_STATUS_RX_UNDERFLOW_MASK)
++
++#define ERROR_INT_STATUS_TX_OVERFLOW_MSB 0
++#define ERROR_INT_STATUS_TX_OVERFLOW_LSB 0
++#define ERROR_INT_STATUS_TX_OVERFLOW_MASK 0x00000001
++#define ERROR_INT_STATUS_TX_OVERFLOW_GET(x) (((x) & ERROR_INT_STATUS_TX_OVERFLOW_MASK) >> ERROR_INT_STATUS_TX_OVERFLOW_LSB)
++#define ERROR_INT_STATUS_TX_OVERFLOW_SET(x) (((x) << ERROR_INT_STATUS_TX_OVERFLOW_LSB) & ERROR_INT_STATUS_TX_OVERFLOW_MASK)
++
++#define HOST_INT_STATUS_ERROR_MSB 7
++#define HOST_INT_STATUS_ERROR_LSB 7
++#define HOST_INT_STATUS_ERROR_MASK 0x00000080
++#define HOST_INT_STATUS_ERROR_GET(x) (((x) & HOST_INT_STATUS_ERROR_MASK) >> HOST_INT_STATUS_ERROR_LSB)
++#define HOST_INT_STATUS_ERROR_SET(x) (((x) << HOST_INT_STATUS_ERROR_LSB) & HOST_INT_STATUS_ERROR_MASK)
++
++#define HOST_INT_STATUS_CPU_MSB 6
++#define HOST_INT_STATUS_CPU_LSB 6
++#define HOST_INT_STATUS_CPU_MASK 0x00000040
++#define HOST_INT_STATUS_CPU_GET(x) (((x) & HOST_INT_STATUS_CPU_MASK) >> HOST_INT_STATUS_CPU_LSB)
++#define HOST_INT_STATUS_CPU_SET(x) (((x) << HOST_INT_STATUS_CPU_LSB) & HOST_INT_STATUS_CPU_MASK)
++
++#define HOST_INT_STATUS_COUNTER_MSB 4
++#define HOST_INT_STATUS_COUNTER_LSB 4
++#define HOST_INT_STATUS_COUNTER_MASK 0x00000010
++#define HOST_INT_STATUS_COUNTER_GET(x) (((x) & HOST_INT_STATUS_COUNTER_MASK) >> HOST_INT_STATUS_COUNTER_LSB)
++#define HOST_INT_STATUS_COUNTER_SET(x) (((x) << HOST_INT_STATUS_COUNTER_LSB) & HOST_INT_STATUS_COUNTER_MASK)
++
++#define RESET_CONTROL_WARM_RST_MSB 7
++#define RESET_CONTROL_WARM_RST_LSB 7
++#define RESET_CONTROL_WARM_RST_MASK 0x00000080
++#define RESET_CONTROL_WARM_RST_GET(x) (((x) & RESET_CONTROL_WARM_RST_MASK) >> RESET_CONTROL_WARM_RST_LSB)
++#define RESET_CONTROL_WARM_RST_SET(x) (((x) << RESET_CONTROL_WARM_RST_LSB) & RESET_CONTROL_WARM_RST_MASK)
++
++#define RESET_CONTROL_COLD_RST_MSB 8
++#define RESET_CONTROL_COLD_RST_LSB 8
++#define RESET_CONTROL_COLD_RST_MASK 0x00000100
++#define RESET_CONTROL_COLD_RST_GET(x) (((x) & RESET_CONTROL_COLD_RST_MASK) >> RESET_CONTROL_COLD_RST_LSB)
++#define RESET_CONTROL_COLD_RST_SET(x) (((x) << RESET_CONTROL_COLD_RST_LSB) & RESET_CONTROL_COLD_RST_MASK)
++
++#define RESET_CAUSE_LAST_MSB 2
++#define RESET_CAUSE_LAST_LSB 0
++#define RESET_CAUSE_LAST_MASK 0x00000007
++#define RESET_CAUSE_LAST_GET(x) (((x) & RESET_CAUSE_LAST_MASK) >> RESET_CAUSE_LAST_LSB)
++#define RESET_CAUSE_LAST_SET(x) (((x) << RESET_CAUSE_LAST_LSB) & RESET_CAUSE_LAST_MASK)
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* __AR6KHWREG_H__ */
+diff --git a/drivers/ar6000/include/a_config.h b/drivers/ar6000/include/a_config.h
+new file mode 100644
+index 0000000..627b298
+--- /dev/null
++++ b/drivers/ar6000/include/a_config.h
+@@ -0,0 +1,27 @@
++#ifndef _A_CONFIG_H_
++#define _A_CONFIG_H_
++/*
++ * Copyright (c) 2004-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.
++ *
++ *
++ *
++ */
++
++/*
++ * This file contains software configuration options that enables
++ * specific software "features"
++ */
++#include "../ar6000/config_linux.h"
++
++#endif
+diff --git a/drivers/ar6000/include/a_debug.h b/drivers/ar6000/include/a_debug.h
+new file mode 100644
+index 0000000..4b0b351
+--- /dev/null
++++ b/drivers/ar6000/include/a_debug.h
+@@ -0,0 +1,41 @@
++#ifndef _A_DEBUG_H_
++#define _A_DEBUG_H_
++/*
++ * Copyright (c) 2004-2006 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ * 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 <a_types.h>
++#include <a_osapi.h>
++
++#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)
++
++#include "../ar6000/debug_linux.h"
++
++#endif
+diff --git a/drivers/ar6000/include/a_drv.h b/drivers/ar6000/include/a_drv.h
+new file mode 100644
+index 0000000..07e52d1
+--- /dev/null
++++ b/drivers/ar6000/include/a_drv.h
+@@ -0,0 +1,28 @@
++#ifndef _A_DRV_H_
++#define _A_DRV_H_
++/*
++ * $Id: //depot/sw/releases/olca2.0-GPL/host/include/a_drv.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.
++ *
++ *
++ *
++ */
++
++#include "../ar6000/athdrv_linux.h"
++
++#endif /* _ADRV_H_ */
+diff --git a/drivers/ar6000/include/a_drv_api.h b/drivers/ar6000/include/a_drv_api.h
+new file mode 100644
+index 0000000..7531726
+--- /dev/null
++++ b/drivers/ar6000/include/a_drv_api.h
+@@ -0,0 +1,185 @@
++#ifndef _A_DRV_API_H_
++#define _A_DRV_API_H_
++/*
++ * 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.
++ *
++ *
++ *
++ */
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++/****************************************************************************/
++/****************************************************************************/
++/** **/
++/** WMI related hooks **/
++/** **/
++/****************************************************************************/
++/****************************************************************************/
++
++#include <ar6000_api.h>
++
++#define A_WMI_CHANNELLIST_RX(devt, numChan, chanList) \
++ ar6000_channelList_rx((devt), (numChan), (chanList))
++
++#define A_WMI_SET_NUMDATAENDPTS(devt, num) \
++ ar6000_set_numdataendpts((devt), (num))
++
++#define A_WMI_CONTROL_TX(devt, osbuf, streamID) \
++ ar6000_control_tx((devt), (osbuf), (streamID))
++
++#define A_WMI_TARGETSTATS_EVENT(devt, pStats) \
++ ar6000_targetStats_event((devt), (pStats))
++
++#define A_WMI_SCANCOMPLETE_EVENT(devt, status) \
++ ar6000_scanComplete_event((devt), (status))
++
++#ifdef CONFIG_HOST_DSET_SUPPORT
++
++#define A_WMI_DSET_DATA_REQ(devt, access_cookie, offset, length, targ_buf, targ_reply_fn, targ_reply_arg) \
++ ar6000_dset_data_req((devt), (access_cookie), (offset), (length), (targ_buf), (targ_reply_fn), (targ_reply_arg))
++
++#define A_WMI_DSET_CLOSE(devt, access_cookie) \
++ ar6000_dset_close((devt), (access_cookie))
++
++#endif
++
++#define A_WMI_DSET_OPEN_REQ(devt, id, targ_handle, targ_reply_fn, targ_reply_arg) \
++ ar6000_dset_open_req((devt), (id), (targ_handle), (targ_reply_fn), (targ_reply_arg))
++
++#define A_WMI_CONNECT_EVENT(devt, channel, bssid, listenInterval, beaconInterval, networkType, beaconIeLen, assocReqLen, assocRespLen, assocInfo) \
++ ar6000_connect_event((devt), (channel), (bssid), (listenInterval), (beaconInterval), (networkType), (beaconIeLen), (assocReqLen), (assocRespLen), (assocInfo))
++
++#define A_WMI_REGDOMAIN_EVENT(devt, regCode) \
++ ar6000_regDomain_event((devt), (regCode))
++
++#define A_WMI_NEIGHBORREPORT_EVENT(devt, numAps, info) \
++ ar6000_neighborReport_event((devt), (numAps), (info))
++
++#define A_WMI_DISCONNECT_EVENT(devt, reason, bssid, assocRespLen, assocInfo, protocolReasonStatus) \
++ ar6000_disconnect_event((devt), (reason), (bssid), (assocRespLen), (assocInfo), (protocolReasonStatus))
++
++#define A_WMI_TKIP_MICERR_EVENT(devt, keyid, ismcast) \
++ ar6000_tkip_micerr_event((devt), (keyid), (ismcast))
++
++#define A_WMI_BITRATE_RX(devt, rateKbps) \
++ ar6000_bitrate_rx((devt), (rateKbps))
++
++#define A_WMI_TXPWR_RX(devt, txPwr) \
++ ar6000_txPwr_rx((devt), (txPwr))
++
++#define A_WMI_READY_EVENT(devt, datap, phyCap) \
++ ar6000_ready_event((devt), (datap), (phyCap))
++
++#define A_WMI_DBGLOG_INIT_DONE(ar) \
++ ar6000_dbglog_init_done(ar);
++
++#define A_WMI_RSSI_THRESHOLD_EVENT(devt, newThreshold, rssi) \
++ ar6000_rssiThreshold_event((devt), (newThreshold), (rssi))
++
++#define A_WMI_REPORT_ERROR_EVENT(devt, errorVal) \
++ ar6000_reportError_event((devt), (errorVal))
++
++#define A_WMI_ROAM_TABLE_EVENT(devt, pTbl) \
++ ar6000_roam_tbl_event((devt), (pTbl))
++
++#define A_WMI_ROAM_DATA_EVENT(devt, p) \
++ ar6000_roam_data_event((devt), (p))
++
++#define A_WMI_WOW_LIST_EVENT(devt, num_filters, wow_filters) \
++ ar6000_wow_list_event((devt), (num_filters), (wow_filters))
++
++#define A_WMI_CAC_EVENT(devt, ac, cac_indication, statusCode, tspecSuggestion) \
++ ar6000_cac_event((devt), (ac), (cac_indication), (statusCode), (tspecSuggestion))
++
++#define A_WMI_IPTOS_TO_USERPRIORITY(pkt) \
++ ar6000_iptos_to_userPriority((pkt))
++
++#define A_WMI_PMKID_LIST_EVENT(devt, num_pmkid, pmkid_list) \
++ ar6000_pmkid_list_event((devt), (num_pmkid), (pmkid_list))
++
++#ifdef CONFIG_HOST_GPIO_SUPPORT
++
++#define A_WMI_GPIO_INTR_RX(intr_mask, input_values) \
++ ar6000_gpio_intr_rx((intr_mask), (input_values))
++
++#define A_WMI_GPIO_DATA_RX(reg_id, value) \
++ ar6000_gpio_data_rx((reg_id), (value))
++
++#define A_WMI_GPIO_ACK_RX() \
++ ar6000_gpio_ack_rx()
++
++#endif
++
++#ifdef SEND_EVENT_TO_APP
++
++#define A_WMI_SEND_EVENT_TO_APP(ar, eventId, datap, len) \
++ ar6000_send_event_to_app((ar), (eventId), (datap), (len))
++
++#else
++
++#define A_WMI_SEND_EVENT_TO_APP(ar, eventId, datap, len)
++
++#endif
++
++#ifdef CONFIG_HOST_TCMD_SUPPORT
++#define A_WMI_TCMD_RX_REPORT_EVENT(devt, results, len) \
++ ar6000_tcmd_rx_report_event((devt), (results), (len))
++#endif
++
++#define A_WMI_HBCHALLENGERESP_EVENT(devt, cookie, source) \
++ ar6000_hbChallengeResp_event((devt), (cookie), (source))
++
++#define A_WMI_TX_RETRY_ERR_EVENT(devt) \
++ ar6000_tx_retry_err_event((devt))
++
++#define A_WMI_SNR_THRESHOLD_EVENT_RX(devt, newThreshold, snr) \
++ ar6000_snrThresholdEvent_rx((devt), (newThreshold), (snr))
++
++#define A_WMI_LQ_THRESHOLD_EVENT_RX(devt, range, lqVal) \
++ ar6000_lqThresholdEvent_rx((devt), (range), (lqVal))
++
++#define A_WMI_RATEMASK_RX(devt, ratemask) \
++ ar6000_ratemask_rx((devt), (ratemask))
++
++#define A_WMI_KEEPALIVE_RX(devt, configured) \
++ ar6000_keepalive_rx((devt), (configured))
++
++#define A_WMI_BSSINFO_EVENT_RX(ar, datp, len) \
++ ar6000_bssInfo_event_rx((ar), (datap), (len))
++
++#define A_WMI_DBGLOG_EVENT(ar, dropped, buffer, length) \
++ ar6000_dbglog_event((ar), (dropped), (buffer), (length));
++
++#define A_WMI_STREAM_TX_ACTIVE(devt,trafficClass) \
++ ar6000_indicate_tx_activity((devt),(trafficClass), TRUE)
++
++#define A_WMI_STREAM_TX_INACTIVE(devt,trafficClass) \
++ ar6000_indicate_tx_activity((devt),(trafficClass), FALSE)
++
++/****************************************************************************/
++/****************************************************************************/
++/** **/
++/** HTC related hooks **/
++/** **/
++/****************************************************************************/
++/****************************************************************************/
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif
+diff --git a/drivers/ar6000/include/a_osapi.h b/drivers/ar6000/include/a_osapi.h
+new file mode 100644
+index 0000000..7d60867
+--- /dev/null
++++ b/drivers/ar6000/include/a_osapi.h
+@@ -0,0 +1,28 @@
++#ifndef _A_OSAPI_H_
++#define _A_OSAPI_H_
++/*
++ * $Id: //depot/sw/releases/olca2.0-GPL/host/include/a_osapi.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.
++ *
++ *
++ *
++ */
++
++#include "../ar6000/osapi_linux.h"
++
++#endif /* _OSAPI_H_ */
+diff --git a/drivers/ar6000/include/a_types.h b/drivers/ar6000/include/a_types.h
+new file mode 100644
+index 0000000..e2ed090
+--- /dev/null
++++ b/drivers/ar6000/include/a_types.h
+@@ -0,0 +1,28 @@
++#ifndef _A_TYPES_H_
++#define _A_TYPES_H_
++/*
++ * $Id: //depot/sw/releases/olca2.0-GPL/host/include/a_types.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.
++ *
++ *
++ *
++ */
++
++#include "../ar6000/athtypes_linux.h"
++
++#endif /* _ATHTYPES_H_ */
+diff --git a/drivers/ar6000/include/ar6000_api.h b/drivers/ar6000/include/ar6000_api.h
+new file mode 100644
+index 0000000..abe5de7
+--- /dev/null
++++ b/drivers/ar6000/include/ar6000_api.h
+@@ -0,0 +1,29 @@
++#ifndef _AR6000_API_H_
++#define _AR6000_API_H_
++/*
++ * Copyright (c) 2004-2005 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ * This file contains the API to access the OS dependent atheros host driver
++ * by the WMI or WLAN generic modules.
++ *
++ * $Id: //depot/sw/releases/olca2.0-GPL/host/include/ar6000_api.h#1 $
++ *
++ *
++ * 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/ar6xapi_linux.h"
++
++#endif /* _AR6000_API_H */
++
+diff --git a/drivers/ar6000/include/ar6000_diag.h b/drivers/ar6000/include/ar6000_diag.h
+new file mode 100644
+index 0000000..2df131d
+--- /dev/null
++++ b/drivers/ar6000/include/ar6000_diag.h
+@@ -0,0 +1,38 @@
++/*
++ *
++ * 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_DIAG_H_
++#define AR6000_DIAG_H_
++
++
++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);
++
++A_STATUS
++ar6000_ReadDataDiag(HIF_DEVICE *hifDevice, A_UINT32 address,
++ A_UCHAR *data, A_UINT32 length);
++
++A_STATUS
++ar6000_WriteDataDiag(HIF_DEVICE *hifDevice, A_UINT32 address,
++ A_UCHAR *data, A_UINT32 length);
++
++#endif /*AR6000_DIAG_H_*/
+diff --git a/drivers/ar6000/include/athdefs.h b/drivers/ar6000/include/athdefs.h
+new file mode 100644
+index 0000000..c28c871
+--- /dev/null
++++ b/drivers/ar6000/include/athdefs.h
+@@ -0,0 +1,85 @@
++#ifndef __ATHDEFS_H__
++#define __ATHDEFS_H__
++
++/*
++ * Copyright (c) 2004-2007 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ * $ATH_LICENSE_HOSTSDK0_C$
++ *
++ * This file contains definitions that may be used across both
++ * Host and Target software. Nothing here is module-dependent
++ * or platform-dependent.
++ */
++
++/*
++ * Generic error codes that can be used by hw, sta, ap, sim, dk
++ * and any other environments. Since these are enums, feel free to
++ * add any more codes that you need.
++ */
++
++typedef enum {
++ A_ERROR = -1, /* Generic error return */
++ A_OK = 0, /* success */
++ /* Following values start at 1 */
++ A_DEVICE_NOT_FOUND, /* not able to find PCI device */
++ A_NO_MEMORY, /* not able to allocate memory, not available */
++ A_MEMORY_NOT_AVAIL, /* memory region is not free for mapping */
++ A_NO_FREE_DESC, /* no free descriptors available */
++ A_BAD_ADDRESS, /* address does not match descriptor */
++ A_WIN_DRIVER_ERROR, /* used in NT_HW version, if problem at init */
++ A_REGS_NOT_MAPPED, /* registers not correctly mapped */
++ A_EPERM, /* Not superuser */
++ A_EACCES, /* Access denied */
++ A_ENOENT, /* No such entry, search failed, etc. */
++ A_EEXIST, /* The object already exists (can't create) */
++ A_EFAULT, /* Bad address fault */
++ A_EBUSY, /* Object is busy */
++ A_EINVAL, /* Invalid parameter */
++ A_EMSGSIZE, /* Inappropriate message buffer length */
++ A_ECANCELED, /* Operation canceled */
++ A_ENOTSUP, /* Operation not supported */
++ A_ECOMM, /* Communication error on send */
++ A_EPROTO, /* Protocol error */
++ A_ENODEV, /* No such device */
++ A_EDEVNOTUP, /* device is not UP */
++ A_NO_RESOURCE, /* No resources for requested operation */
++ A_HARDWARE, /* Hardware failure */
++ A_PENDING, /* Asynchronous routine; will send up results la
++ter (typically in callback) */
++ A_EBADCHANNEL, /* The channel cannot be used */
++ A_DECRYPT_ERROR, /* Decryption error */
++ A_PHY_ERROR, /* RX PHY error */
++ A_CONSUMED /* Object was consumed */
++} A_STATUS;
++
++#define A_SUCCESS(x) (x == A_OK)
++#define A_FAILED(x) (!A_SUCCESS(x))
++
++#ifndef TRUE
++#define TRUE 1
++#endif
++
++#ifndef FALSE
++#define FALSE 0
++#endif
++
++/*
++ * The following definition is WLAN specific definition
++ */
++typedef enum {
++ MODE_11A = 0, /* 11a Mode */
++ MODE_11G = 1, /* 11g + 11b Mode */
++ MODE_11B = 2, /* 11b Mode */
++ MODE_11GONLY = 3, /* 11g only Mode */
++ MODE_UNKNOWN = 4,
++ MODE_MAX = 4
++} WLAN_PHY_MODE;
++
++typedef enum {
++ WLAN_11A_CAPABILITY = 1,
++ WLAN_11G_CAPABILITY = 2,
++ WLAN_11AG_CAPABILITY = 3,
++}WLAN_CAPABILITY;
++
++#endif /* __ATHDEFS_H__ */
+diff --git a/drivers/ar6000/include/athdrv.h b/drivers/ar6000/include/athdrv.h
+new file mode 100644
+index 0000000..19da97e
+--- /dev/null
++++ b/drivers/ar6000/include/athdrv.h
+@@ -0,0 +1,32 @@
++/*
++ * 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_H_
++#define _ATHDRV_H_
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* _ATHDRV_H_ */
+diff --git a/drivers/ar6000/include/athendpack.h b/drivers/ar6000/include/athendpack.h
+new file mode 100644
+index 0000000..42921ae
+--- /dev/null
++++ b/drivers/ar6000/include/athendpack.h
+@@ -0,0 +1,41 @@
++/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++ * @file: athendpack.h
++ *
++ * @abstract: end compiler-specific structure packing
++ *
++ * 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 VXWORKS
++#endif /* VXWORKS */
++
++#ifdef LINUX
++#endif /* LINUX */
++
++#ifdef QNX
++#endif /* QNX */
++
++#ifdef INTEGRITY
++#include "integrity/athendpack_integrity.h"
++#endif /* INTEGRITY */
++
++#ifdef NUCLEUS
++#endif /* NUCLEUS */
++
++#ifdef UNDER_CE
++#include "../os/wince/include/athendpack_wince.h"
++#endif /* WINCE */
++
+diff --git a/drivers/ar6000/include/athstartpack.h b/drivers/ar6000/include/athstartpack.h
+new file mode 100644
+index 0000000..6632cc2
+--- /dev/null
++++ b/drivers/ar6000/include/athstartpack.h
+@@ -0,0 +1,42 @@
++/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++ * @file: athstartpack.h
++ *
++ * @abstract: start compiler-specific structure packing
++ *
++ * 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 VXWORKS
++#endif /* VXWORKS */
++
++#ifdef LINUX
++#endif /* LINUX */
++
++#ifdef QNX
++#endif /* QNX */
++
++#ifdef INTEGRITY
++#include "integrity/athstartpack_integrity.h"
++#endif /* INTEGRITY */
++
++#ifdef NUCLEUS
++#endif /* NUCLEUS */
++
++#ifdef UNDER_CE
++#include "../os/wince/include/athstartpack_wince.h"
++#endif /* WINCE */
++
+diff --git a/drivers/ar6000/include/bmi.h b/drivers/ar6000/include/bmi.h
+new file mode 100644
+index 0000000..2eb7134
+--- /dev/null
++++ b/drivers/ar6000/include/bmi.h
+@@ -0,0 +1,100 @@
++#ifndef _BMI_H_
++#define _BMI_H_
++/*
++ * Copyright (c) 2004-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.
++ *
++ *
++ *
++ * BMI declarations and prototypes
++ */
++
++#ifdef __cplusplus
++extern "C" {
++#endif /* __cplusplus */
++
++/* Header files */
++#include "a_config.h"
++#include "athdefs.h"
++#include "a_types.h"
++#include "hif.h"
++#include "a_osapi.h"
++#include "bmi_msg.h"
++
++void
++BMIInit(void);
++
++A_STATUS
++BMIDone(HIF_DEVICE *device);
++
++A_STATUS
++BMIGetTargetInfo(HIF_DEVICE *device, struct bmi_target_info *targ_info);
++
++A_STATUS
++BMIReadMemory(HIF_DEVICE *device,
++ A_UINT32 address,
++ A_UCHAR *buffer,
++ A_UINT32 length);
++
++A_STATUS
++BMIWriteMemory(HIF_DEVICE *device,
++ A_UINT32 address,
++ A_UCHAR *buffer,
++ A_UINT32 length);
++
++A_STATUS
++BMIExecute(HIF_DEVICE *device,
++ A_UINT32 address,
++ A_UINT32 *param);
++
++A_STATUS
++BMISetAppStart(HIF_DEVICE *device,
++ A_UINT32 address);
++
++A_STATUS
++BMIReadSOCRegister(HIF_DEVICE *device,
++ A_UINT32 address,
++ A_UINT32 *param);
++
++A_STATUS
++BMIWriteSOCRegister(HIF_DEVICE *device,
++ A_UINT32 address,
++ A_UINT32 param);
++
++A_STATUS
++BMIrompatchInstall(HIF_DEVICE *device,
++ A_UINT32 ROM_addr,
++ A_UINT32 RAM_addr,
++ A_UINT32 nbytes,
++ A_UINT32 do_activate,
++ A_UINT32 *patch_id);
++
++A_STATUS
++BMIrompatchUninstall(HIF_DEVICE *device,
++ A_UINT32 rompatch_id);
++
++A_STATUS
++BMIrompatchActivate(HIF_DEVICE *device,
++ A_UINT32 rompatch_count,
++ A_UINT32 *rompatch_list);
++
++A_STATUS
++BMIrompatchDeactivate(HIF_DEVICE *device,
++ A_UINT32 rompatch_count,
++ A_UINT32 *rompatch_list);
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* _BMI_H_ */
+diff --git a/drivers/ar6000/include/bmi_msg.h b/drivers/ar6000/include/bmi_msg.h
+new file mode 100644
+index 0000000..7c91ef4
+--- /dev/null
++++ b/drivers/ar6000/include/bmi_msg.h
+@@ -0,0 +1,199 @@
++#ifndef __BMI_MSG_H__
++#define __BMI_MSG_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.
++ *
++ *
++ *
++ */
++
++/*
++ * Bootloader Messaging Interface (BMI)
++ *
++ * BMI is a very simple messaging interface used during initialization
++ * to read memory, write memory, execute code, and to define an
++ * application entry PC.
++ *
++ * It is used to download an application to AR6K, to provide
++ * patches to code that is already resident on AR6K, and generally
++ * to examine and modify state. The Host has an opportunity to use
++ * BMI only once during bootup. Once the Host issues a BMI_DONE
++ * command, this opportunity ends.
++ *
++ * The Host writes BMI requests to mailbox0, and reads BMI responses
++ * from mailbox0. BMI requests all begin with a command
++ * (see below for specific commands), and are followed by
++ * command-specific data.
++ *
++ * Flow control:
++ * The Host can only issue a command once the Target gives it a
++ * "BMI Command Credit", using AR6K Counter #4. As soon as the
++ * Target has completed a command, it issues another BMI Command
++ * Credit (so the Host can issue the next command).
++ *
++ * BMI handles all required Target-side cache flushing.
++ */
++
++
++/* Maximum data size used for BMI transfers */
++#define BMI_DATASZ_MAX 32
++
++/* BMI Commands */
++
++#define BMI_NO_COMMAND 0
++
++#define BMI_DONE 1
++ /*
++ * Semantics: Host is done using BMI
++ * Request format:
++ * A_UINT32 command (BMI_DONE)
++ * Response format: none
++ */
++
++#define BMI_READ_MEMORY 2
++ /*
++ * Semantics: Host reads AR6K memory
++ * Request format:
++ * A_UINT32 command (BMI_READ_MEMORY)
++ * A_UINT32 address
++ * A_UINT32 length, at most BMI_DATASZ_MAX
++ * Response format:
++ * A_UINT8 data[length]
++ */
++
++#define BMI_WRITE_MEMORY 3
++ /*
++ * Semantics: Host writes AR6K memory
++ * Request format:
++ * A_UINT32 command (BMI_WRITE_MEMORY)
++ * A_UINT32 address
++ * A_UINT32 length, at most BMI_DATASZ_MAX
++ * A_UINT8 data[length]
++ * Response format: none
++ */
++
++#define BMI_EXECUTE 4
++ /*
++ * Semantics: Causes AR6K to execute code
++ * Request format:
++ * A_UINT32 command (BMI_EXECUTE)
++ * A_UINT32 address
++ * A_UINT32 parameter
++ * Response format:
++ * A_UINT32 return value
++ */
++
++#define BMI_SET_APP_START 5
++ /*
++ * Semantics: Set Target application starting address
++ * Request format:
++ * A_UINT32 command (BMI_SET_APP_START)
++ * A_UINT32 address
++ * Response format: none
++ */
++
++#define BMI_READ_SOC_REGISTER 6
++ /*
++ * Semantics: Read a 32-bit Target SOC register.
++ * Request format:
++ * A_UINT32 command (BMI_READ_REGISTER)
++ * A_UINT32 address
++ * Response format:
++ * A_UINT32 value
++ */
++
++#define BMI_WRITE_SOC_REGISTER 7
++ /*
++ * Semantics: Write a 32-bit Target SOC register.
++ * Request format:
++ * A_UINT32 command (BMI_WRITE_REGISTER)
++ * A_UINT32 address
++ * A_UINT32 value
++ *
++ * Response format: none
++ */
++
++#define BMI_GET_TARGET_ID 8
++#define BMI_GET_TARGET_INFO 8
++ /*
++ * Semantics: Fetch the 4-byte Target information
++ * Request format:
++ * A_UINT32 command (BMI_GET_TARGET_ID/INFO)
++ * Response format1 (old firmware):
++ * A_UINT32 TargetVersionID
++ * Response format2 (newer firmware):
++ * A_UINT32 TARGET_VERSION_SENTINAL
++ * struct bmi_target_info;
++ */
++
++struct bmi_target_info {
++ A_UINT32 target_info_byte_count; /* size of this structure */
++ A_UINT32 target_ver; /* Target Version ID */
++ A_UINT32 target_type; /* Target type */
++};
++#define TARGET_VERSION_SENTINAL 0xffffffff
++#define TARGET_TYPE_AR6001 1
++#define TARGET_TYPE_AR6002 2
++
++
++#define BMI_ROMPATCH_INSTALL 9
++ /*
++ * Semantics: Install a ROM Patch.
++ * Request format:
++ * A_UINT32 command (BMI_ROMPATCH_INSTALL)
++ * A_UINT32 Target ROM Address
++ * A_UINT32 Target RAM Address
++ * A_UINT32 Size, in bytes
++ * A_UINT32 Activate? 1-->activate;
++ * 0-->install but do not activate
++ * Response format:
++ * A_UINT32 PatchID
++ */
++
++#define BMI_ROMPATCH_UNINSTALL 10
++ /*
++ * Semantics: Uninstall a previously-installed ROM Patch,
++ * automatically deactivating, if necessary.
++ * Request format:
++ * A_UINT32 command (BMI_ROMPATCH_UNINSTALL)
++ * A_UINT32 PatchID
++ *
++ * Response format: none
++ */
++
++#define BMI_ROMPATCH_ACTIVATE 11
++ /*
++ * Semantics: Activate a list of previously-installed ROM Patches.
++ * Request format:
++ * A_UINT32 command (BMI_ROMPATCH_ACTIVATE)
++ * A_UINT32 rompatch_count
++ * A_UINT32 PatchID[rompatch_count]
++ *
++ * Response format: none
++ */
++
++#define BMI_ROMPATCH_DEACTIVATE 12
++ /*
++ * Semantics: Deactivate a list of active ROM Patches.
++ * Request format:
++ * A_UINT32 command (BMI_ROMPATCH_DEACTIVATE)
++ * A_UINT32 rompatch_count
++ * A_UINT32 PatchID[rompatch_count]
++ *
++ * Response format: none
++ */
++
++
++#endif /* __BMI_MSG_H__ */
+diff --git a/drivers/ar6000/include/common_drv.h b/drivers/ar6000/include/common_drv.h
+new file mode 100644
+index 0000000..1bdc3da
+--- /dev/null
++++ b/drivers/ar6000/include/common_drv.h
+@@ -0,0 +1,61 @@
++/*
++ *
++ * 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 COMMON_DRV_H_
++#define COMMON_DRV_H_
++
++#include "hif.h"
++#include "htc_packet.h"
++
++
++
++/* structure that is the state information for the default credit distribution callback
++ * drivers should instantiate (zero-init as well) this structure in their driver instance
++ * and pass it as a context to the HTC credit distribution functions */
++typedef struct _COMMON_CREDIT_STATE_INFO {
++ int TotalAvailableCredits; /* total credits in the system at startup */
++ int CurrentFreeCredits; /* credits available in the pool that have not been
++ given out to endpoints */
++ HTC_ENDPOINT_CREDIT_DIST *pLowestPriEpDist; /* pointer to the lowest priority endpoint dist struct */
++} COMMON_CREDIT_STATE_INFO;
++
++
++/* HTC TX packet tagging definitions */
++#define AR6K_CONTROL_PKT_TAG HTC_TX_PACKET_TAG_USER_DEFINED
++#define AR6K_DATA_PKT_TAG (AR6K_CONTROL_PKT_TAG + 1)
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++/* OS-independent APIs */
++A_STATUS ar6000_setup_credit_dist(HTC_HANDLE HTCHandle, COMMON_CREDIT_STATE_INFO *pCredInfo);
++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);
++A_STATUS ar6000_ReadDataDiag(HIF_DEVICE *hifDevice, A_UINT32 address, A_UCHAR *data, A_UINT32 length);
++A_STATUS ar6000_reset_device(HIF_DEVICE *hifDevice, A_UINT32 TargetType);
++void ar6000_dump_target_assert_info(HIF_DEVICE *hifDevice, A_UINT32 TargetType);
++A_STATUS ar6000_reset_device_skipflash(HIF_DEVICE *hifDevice);
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /*COMMON_DRV_H_*/
+diff --git a/drivers/ar6000/include/dbglog.h b/drivers/ar6000/include/dbglog.h
+new file mode 100644
+index 0000000..3d1e528
+--- /dev/null
++++ b/drivers/ar6000/include/dbglog.h
+@@ -0,0 +1,107 @@
++/*
++ * Copyright (c) 2004-2007 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ * $ATH_LICENSE_HOSTSDK0_C$
++ *
++ * This file contains the definitions and data structures associated with
++ * the log based debug mechanism.
++ *
++ */
++
++#ifndef _DBGLOG_H_
++#define _DBGLOG_H_
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#define DBGLOG_TIMESTAMP_OFFSET 0
++#define DBGLOG_TIMESTAMP_MASK 0x0000FFFF /* Bit 0-15. Contains bit
++ 8-23 of the LF0 timer */
++#define DBGLOG_DBGID_OFFSET 16
++#define DBGLOG_DBGID_MASK 0x03FF0000 /* Bit 16-25 */
++#define DBGLOG_DBGID_NUM_MAX 256 /* Upper limit is width of mask */
++
++#define DBGLOG_MODULEID_OFFSET 26
++#define DBGLOG_MODULEID_MASK 0x3C000000 /* Bit 26-29 */
++#define DBGLOG_MODULEID_NUM_MAX 16 /* Upper limit is width of mask */
++
++/*
++ * Please ensure that the definition of any new module intrduced is captured
++ * between the DBGLOG_MODULEID_START and DBGLOG_MODULEID_END defines. The
++ * structure is required for the parser to correctly pick up the values for
++ * different modules.
++ */
++#define DBGLOG_MODULEID_START
++#define DBGLOG_MODULEID_INF 0
++#define DBGLOG_MODULEID_WMI 1
++#define DBGLOG_MODULEID_CSERV 2
++#define DBGLOG_MODULEID_PM 3
++#define DBGLOG_MODULEID_TXRX_MGMTBUF 4
++#define DBGLOG_MODULEID_TXRX_TXBUF 5
++#define DBGLOG_MODULEID_TXRX_RXBUF 6
++#define DBGLOG_MODULEID_WOW 7
++#define DBGLOG_MODULEID_WHAL 8
++#define DBGLOG_MODULEID_END
++
++#define DBGLOG_NUM_ARGS_OFFSET 30
++#define DBGLOG_NUM_ARGS_MASK 0xC0000000 /* Bit 30-31 */
++#define DBGLOG_NUM_ARGS_MAX 2 /* Upper limit is width of mask */
++
++#define DBGLOG_MODULE_LOG_ENABLE_OFFSET 0
++#define DBGLOG_MODULE_LOG_ENABLE_MASK 0x0000FFFF
++
++#define DBGLOG_REPORTING_ENABLED_OFFSET 16
++#define DBGLOG_REPORTING_ENABLED_MASK 0x00010000
++
++#define DBGLOG_TIMESTAMP_RESOLUTION_OFFSET 17
++#define DBGLOG_TIMESTAMP_RESOLUTION_MASK 0x000E0000
++
++#define DBGLOG_REPORT_SIZE_OFFSET 20
++#define DBGLOG_REPORT_SIZE_MASK 0x3FF00000
++
++#define DBGLOG_LOG_BUFFER_SIZE 1500
++#define DBGLOG_DBGID_DEFINITION_LEN_MAX 64
++
++struct dbglog_buf_s {
++ struct dbglog_buf_s *next;
++ A_INT8 *buffer;
++ A_UINT32 bufsize;
++ A_UINT32 length;
++ A_UINT32 count;
++ A_UINT32 free;
++};
++
++struct dbglog_hdr_s {
++ struct dbglog_buf_s *dbuf;
++ A_UINT32 dropped;
++};
++
++struct dbglog_config_s {
++ A_UINT32 cfgvalid; /* Mask with valid config bits */
++ union {
++ /* TODO: Take care of endianness */
++ struct {
++ A_UINT32 mmask:16; /* Mask of modules with logging on */
++ A_UINT32 rep:1; /* Reporting enabled or not */
++ A_UINT32 tsr:3; /* Time stamp resolution. Def: 1 ms */
++ A_UINT32 size:10; /* Report size in number of messages */
++ A_UINT32 reserved:2;
++ } dbglog_config;
++
++ A_UINT32 value;
++ } u;
++};
++
++#define cfgmmask u.dbglog_config.mmask
++#define cfgrep u.dbglog_config.rep
++#define cfgtsr u.dbglog_config.tsr
++#define cfgsize u.dbglog_config.size
++#define cfgvalue u.value
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* _DBGLOG_H_ */
+diff --git a/drivers/ar6000/include/dbglog_api.h b/drivers/ar6000/include/dbglog_api.h
+new file mode 100644
+index 0000000..06c8102
+--- /dev/null
++++ b/drivers/ar6000/include/dbglog_api.h
+@@ -0,0 +1,46 @@
++#ifndef _DBGLOG_API_H_
++#define _DBGLOG_API_H_
++/*
++ * 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.
++ *
++ *
++ *
++ * This file contains host side debug primitives.
++ */
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#include "dbglog.h"
++
++#define DBGLOG_HOST_LOG_BUFFER_SIZE DBGLOG_LOG_BUFFER_SIZE
++
++#define DBGLOG_GET_DBGID(arg) \
++ ((arg & DBGLOG_DBGID_MASK) >> DBGLOG_DBGID_OFFSET)
++
++#define DBGLOG_GET_MODULEID(arg) \
++ ((arg & DBGLOG_MODULEID_MASK) >> DBGLOG_MODULEID_OFFSET)
++
++#define DBGLOG_GET_NUMARGS(arg) \
++ ((arg & DBGLOG_NUM_ARGS_MASK) >> DBGLOG_NUM_ARGS_OFFSET)
++
++#define DBGLOG_GET_TIMESTAMP(arg) \
++ ((arg & DBGLOG_TIMESTAMP_MASK) >> DBGLOG_TIMESTAMP_OFFSET)
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* _DBGLOG_API_H_ */
+diff --git a/drivers/ar6000/include/dbglog_id.h b/drivers/ar6000/include/dbglog_id.h
+new file mode 100644
+index 0000000..ce22b16
+--- /dev/null
++++ b/drivers/ar6000/include/dbglog_id.h
+@@ -0,0 +1,307 @@
++/*
++ *
++ * Copyright (c) 2004-2007 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ * $ATH_LICENSE_HOSTSDK0_C$
++ *
++ * This file contains the definitions of the debug identifiers for different
++ * modules.
++ *
++ */
++
++#ifndef _DBGLOG_ID_H_
++#define _DBGLOG_ID_H_
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++/*
++ * The nomenclature for the debug identifiers is MODULE_DESCRIPTION.
++ * Please ensure that the definition of any new debugid introduced is captured
++ * between the <MODULE>_DBGID_DEFINITION_START and
++ * <MODULE>_DBGID_DEFINITION_END defines. The structure is required for the
++ * parser to correctly pick up the values for different debug identifiers.
++ */
++
++/* INF debug identifier definitions */
++#define INF_DBGID_DEFINITION_START
++#define INF_ASSERTION_FAILED 1
++#define INF_TARGET_ID 2
++#define INF_DBGID_DEFINITION_END
++
++/* WMI debug identifier definitions */
++#define WMI_DBGID_DEFINITION_START
++#define WMI_CMD_RX_XTND_PKT_TOO_SHORT 1
++#define WMI_EXTENDED_CMD_NOT_HANDLED 2
++#define WMI_CMD_RX_PKT_TOO_SHORT 3
++#define WMI_CALLING_WMI_EXTENSION_FN 4
++#define WMI_CMD_NOT_HANDLED 5
++#define WMI_IN_SYNC 6
++#define WMI_TARGET_WMI_SYNC_CMD 7
++#define WMI_SET_SNR_THRESHOLD_PARAMS 8
++#define WMI_SET_RSSI_THRESHOLD_PARAMS 9
++#define WMI_SET_LQ_TRESHOLD_PARAMS 10
++#define WMI_TARGET_CREATE_PSTREAM_CMD 11
++#define WMI_WI_DTM_INUSE 12
++#define WMI_TARGET_DELETE_PSTREAM_CMD 13
++#define WMI_TARGET_IMPLICIT_DELETE_PSTREAM_CMD 14
++#define WMI_TARGET_GET_BIT_RATE_CMD 15
++#define WMI_GET_RATE_MASK_CMD_FIX_RATE_MASK_IS 16
++#define WMI_TARGET_GET_AVAILABLE_CHANNELS_CMD 17
++#define WMI_TARGET_GET_TX_PWR_CMD 18
++#define WMI_FREE_EVBUF_WMIBUF 19
++#define WMI_FREE_EVBUF_DATABUF 20
++#define WMI_FREE_EVBUF_BADFLAG 21
++#define WMI_HTC_RX_ERROR_DATA_PACKET 22
++#define WMI_HTC_RX_SYNC_PAUSING_FOR_MBOX 23
++#define WMI_INCORRECT_WMI_DATA_HDR_DROPPING_PKT 24
++#define WMI_SENDING_READY_EVENT 25
++#define WMI_SETPOWER_MDOE_TO_MAXPERF 26
++#define WMI_SETPOWER_MDOE_TO_REC 27
++#define WMI_BSSINFO_EVENT_FROM 28
++#define WMI_TARGET_GET_STATS_CMD 29
++#define WMI_SENDING_SCAN_COMPLETE_EVENT 30
++#define WMI_SENDING_RSSI_INDB_THRESHOLD_EVENT 31
++#define WMI_SENDING_RSSI_INDBM_THRESHOLD_EVENT 32
++#define WMI_SENDING_LINK_QUALITY_THRESHOLD_EVENT 33
++#define WMI_SENDING_ERROR_REPORT_EVENT 34
++#define WMI_SENDING_CAC_EVENT 35
++#define WMI_TARGET_GET_ROAM_TABLE_CMD 36
++#define WMI_TARGET_GET_ROAM_DATA_CMD 37
++#define WMI_SENDING_GPIO_INTR_EVENT 38
++#define WMI_SENDING_GPIO_ACK_EVENT 39
++#define WMI_SENDING_GPIO_DATA_EVENT 40
++#define WMI_CMD_RX 41
++#define WMI_CMD_RX_XTND 42
++#define WMI_EVENT_SEND 43
++#define WMI_EVENT_SEND_XTND 44
++#define WMI_DBGID_DEFINITION_END
++
++/* CSERV debug identifier definitions */
++#define CSERV_DBGID_DEFINITION_START
++#define CSERV_BEGIN_SCAN1 1
++#define CSERV_BEGIN_SCAN2 2
++#define CSERV_END_SCAN1 3
++#define CSERV_END_SCAN2 4
++#define CSERV_CHAN_SCAN_START 5
++#define CSERV_CHAN_SCAN_STOP 6
++#define CSERV_CHANNEL_OPPPORTUNITY 7
++#define CSERV_NC_TIMEOUT 8
++#define CSERV_BACK_HOME 10
++#define CSERV_CHMGR_CH_CALLBACK1 11
++#define CSERV_CHMGR_CH_CALLBACK2 12
++#define CSERV_CHMGR_CH_CALLBACK3 13
++#define CSERV_SET_SCAN_PARAMS1 14
++#define CSERV_SET_SCAN_PARAMS2 15
++#define CSERV_SET_SCAN_PARAMS3 16
++#define CSERV_SET_SCAN_PARAMS4 17
++#define CSERV_ABORT_SCAN 18
++#define CSERV_NEWSTATE 19
++#define CSERV_MINCHMGR_OP_END 20
++#define CSERV_CHMGR_OP_END 21
++#define CSERV_DISCONNECT_TIMEOUT 22
++#define CSERV_ROAM_TIMEOUT 23
++#define CSERV_FORCE_SCAN1 24
++#define CSERV_FORCE_SCAN2 25
++#define CSERV_FORCE_SCAN3 26
++#define CSERV_UTIL_TIMEOUT 27
++#define CSERV_RSSIPOLLER 28
++#define CSERV_RETRY_CONNECT_TIMEOUT 29
++#define CSERV_RSSIINDBMPOLLER 30
++#define CSERV_BGSCAN_ENABLE 31
++#define CSERV_BGSCAN_DISABLE 32
++#define CSERV_WLAN_START_SCAN_CMD1 33
++#define CSERV_WLAN_START_SCAN_CMD2 34
++#define CSERV_WLAN_START_SCAN_CMD3 35
++#define CSERV_START_SCAN_CMD 36
++#define CSERV_START_FORCE_SCAN 37
++#define CSERV_NEXT_CHAN 38
++#define CSERV_SET_REGCODE 39
++#define CSERV_START_ADHOC 40
++#define CSERV_ADHOC_AT_HOME 41
++#define CSERV_OPT_AT_HOME 42
++#define CSERV_WLAN_CONNECT_CMD 43
++#define CSERV_WLAN_RECONNECT_CMD 44
++#define CSERV_WLAN_DISCONNECT_CMD 45
++#define CSERV_BSS_CHANGE_CHANNEL 46
++#define CSERV_BEACON_RX 47
++#define CSERV_KEEPALIVE_CHECK 48
++#define CSERV_RC_BEGIN_SCAN 49
++#define CSERV_RC_SCAN_START 50
++#define CSERV_RC_SCAN_STOP 51
++#define CSERV_RC_NEXT 52
++#define CSERV_RC_SCAN_END 53
++#define CSERV_PROBE_CALLBACK 54
++#define CSERV_ROAM1 55
++#define CSERV_ROAM2 56
++#define CSERV_ROAM3 57
++#define CSERV_CONNECT_EVENT 58
++#define CSERV_DISCONNECT_EVENT 59
++#define CSERV_BMISS_HANDLER1 60
++#define CSERV_BMISS_HANDLER2 61
++#define CSERV_BMISS_HANDLER3 62
++#define CSERV_LOWRSSI_HANDLER 63
++#define CSERV_WLAN_SET_PMKID_CMD 64
++#define CSERV_RECONNECT_REQUEST 65
++#define CSERV_KEYSPLUMBED_EVENT 66
++#define CSERV_NEW_REG 67
++#define CSERV_SET_RSSI_THOLD 68
++#define CSERV_RSSITHRESHOLDCHECK 69
++#define CSERV_RSSIINDBMTHRESHOLDCHECK 70
++#define CSERV_WLAN_SET_OPT_CMD1 71
++#define CSERV_WLAN_SET_OPT_CMD2 72
++#define CSERV_WLAN_SET_OPT_CMD3 73
++#define CSERV_WLAN_SET_OPT_CMD4 74
++#define CSERV_SCAN_CONNECT_STOP 75
++#define CSERV_BMISS_HANDLER4 76
++#define CSERV_INITIALIZE_TIMER 77
++#define CSERV_ARM_TIMER 78
++#define CSERV_DISARM_TIMER 79
++#define CSERV_UNINITIALIZE_TIMER 80
++#define CSERV_DISCONNECT_EVENT2 81
++#define CSERV_SCAN_CONNECT_START 82
++#define CSERV_BSSINFO_MEMORY_ALLOC_FAILED 83
++#define CSERV_SET_SCAN_PARAMS5 84
++#define CSERV_DBGID_DEFINITION_END
++
++/* TXRX debug identifier definitions */
++#define TXRX_TXBUF_DBGID_DEFINITION_START
++#define TXRX_TXBUF_ALLOCATE_BUF 1
++#define TXRX_TXBUF_QUEUE_BUF_TO_MBOX 2
++#define TXRX_TXBUF_QUEUE_BUF_TO_TXQ 3
++#define TXRX_TXBUF_TXQ_DEPTH 4
++#define TXRX_TXBUF_IBSS_QUEUE_TO_SFQ 5
++#define TXRX_TXBUF_IBSS_QUEUE_TO_TXQ_FRM_SFQ 6
++#define TXRX_TXBUF_INITIALIZE_TIMER 7
++#define TXRX_TXBUF_ARM_TIMER 8
++#define TXRX_TXBUF_DISARM_TIMER 9
++#define TXRX_TXBUF_UNINITIALIZE_TIMER 10
++#define TXRX_TXBUF_DBGID_DEFINITION_END
++
++#define TXRX_RXBUF_DBGID_DEFINITION_START
++#define TXRX_RXBUF_ALLOCATE_BUF 1
++#define TXRX_RXBUF_QUEUE_TO_HOST 2
++#define TXRX_RXBUF_QUEUE_TO_WLAN 3
++#define TXRX_RXBUF_ZERO_LEN_BUF 4
++#define TXRX_RXBUF_QUEUE_TO_HOST_LASTBUF_IN_RXCHAIN 5
++#define TXRX_RXBUF_LASTBUF_IN_RXCHAIN_ZEROBUF 6
++#define TXRX_RXBUF_QUEUE_EMPTY_QUEUE_TO_WLAN 7
++#define TXRX_RXBUF_SEND_TO_RECV_MGMT 8
++#define TXRX_RXBUF_SEND_TO_IEEE_LAYER 9
++#define TXRX_RXBUF_DBGID_DEFINITION_END
++
++#define TXRX_MGMTBUF_DBGID_DEFINITION_START
++#define TXRX_MGMTBUF_ALLOCATE_BUF 1
++#define TXRX_MGMTBUF_ALLOCATE_SM_BUF 2
++#define TXRX_MGMTBUF_ALLOCATE_RMBUF 3
++#define TXRX_MGMTBUF_GET_BUF 4
++#define TXRX_MGMTBUF_GET_SM_BUF 5
++#define TXRX_MGMTBUF_QUEUE_BUF_TO_TXQ 6
++#define TXRX_MGMTBUF_REAPED_BUF 7
++#define TXRX_MGMTBUF_REAPED_SM_BUF 8
++#define TXRX_MGMTBUF_WAIT_FOR_TXQ_DRAIN 9
++#define TXRX_MGMTBUF_WAIT_FOR_TXQ_SFQ_DRAIN 10
++#define TXRX_MGMTBUF_ENQUEUE_INTO_SFQ 11
++#define TXRX_MGMTBUF_DEQUEUE_FROM_SFQ 12
++#define TXRX_MGMTBUF_PAUSE_TXQ 13
++#define TXRX_MGMTBUF_RESUME_TXQ 14
++#define TXRX_MGMTBUF_WAIT_FORTXQ_DRAIN_TIMEOUT 15
++#define TXRX_MGMTBUF_DRAINQ 16
++#define TXRX_MGMTBUF_INDICATE_Q_DRAINED 17
++#define TXRX_MGMTBUF_DBGID_DEFINITION_END
++
++/* PM (Power Module) debug identifier definitions */
++#define PM_DBGID_DEFINITION_START
++#define PM_INIT 1
++#define PM_ENABLE 2
++#define PM_SET_STATE 3
++#define PM_SET_POWERMODE 4
++#define PM_CONN_NOTIFY 5
++#define PM_REF_COUNT_NEGATIVE 6
++#define PM_APSD_ENABLE 7
++#define PM_UPDATE_APSD_STATE 8
++#define PM_CHAN_OP_REQ 9
++#define PM_SET_MY_BEACON_POLICY 10
++#define PM_SET_ALL_BEACON_POLICY 11
++#define PM_SET_PM_PARAMS1 12
++#define PM_SET_PM_PARAMS2 13
++#define PM_ADHOC_SET_PM_CAPS_FAIL 14
++#define PM_ADHOC_UNKNOWN_IBSS_ATTRIB_ID 15
++#define PM_DBGID_DEFINITION_END
++
++/* Wake on Wireless debug identifier definitions */
++#define WOW_DBGID_DEFINITION_START
++#define WOW_INIT 1
++#define WOW_GET_CONFIG_DSET 2
++#define WOW_NO_CONFIG_DSET 3
++#define WOW_INVALID_CONFIG_DSET 4
++#define WOW_USE_DEFAULT_CONFIG 5
++#define WOW_SETUP_GPIO 6
++#define WOW_INIT_DONE 7
++#define WOW_SET_GPIO_PIN 8
++#define WOW_CLEAR_GPIO_PIN 9
++#define WOW_SET_WOW_MODE_CMD 10
++#define WOW_SET_HOST_MODE_CMD 11
++#define WOW_ADD_WOW_PATTERN_CMD 12
++#define WOW_NEW_WOW_PATTERN_AT_INDEX 13
++#define WOW_DEL_WOW_PATTERN_CMD 14
++#define WOW_LIST_CONTAINS_PATTERNS 15
++#define WOW_GET_WOW_LIST_CMD 16
++#define WOW_INVALID_FILTER_ID 17
++#define WOW_INVALID_FILTER_LISTID 18
++#define WOW_NO_VALID_FILTER_AT_ID 19
++#define WOW_NO_VALID_LIST_AT_ID 20
++#define WOW_NUM_PATTERNS_EXCEEDED 21
++#define WOW_NUM_LISTS_EXCEEDED 22
++#define WOW_GET_WOW_STATS 23
++#define WOW_CLEAR_WOW_STATS 24
++#define WOW_WAKEUP_HOST 25
++#define WOW_EVENT_WAKEUP_HOST 26
++#define WOW_EVENT_DISCARD 27
++#define WOW_PATTERN_MATCH 28
++#define WOW_PATTERN_NOT_MATCH 29
++#define WOW_PATTERN_NOT_MATCH_OFFSET 30
++#define WOW_DISABLED_HOST_ASLEEP 31
++#define WOW_ENABLED_HOST_ASLEEP_NO_PATTERNS 32
++#define WOW_ENABLED_HOST_ASLEEP_NO_MATCH_FOUND 33
++#define WOW_DBGID_DEFINITION_END
++
++/* WHAL debug identifier definitions */
++#define WHAL_DBGID_DEFINITION_START
++#define WHAL_ERROR_ANI_CONTROL 1
++#define WHAL_ERROR_CHIP_TEST1 2
++#define WHAL_ERROR_CHIP_TEST2 3
++#define WHAL_ERROR_EEPROM_CHECKSUM 4
++#define WHAL_ERROR_EEPROM_MACADDR 5
++#define WHAL_ERROR_INTERRUPT_HIU 6
++#define WHAL_ERROR_KEYCACHE_RESET 7
++#define WHAL_ERROR_KEYCACHE_SET 8
++#define WHAL_ERROR_KEYCACHE_TYPE 9
++#define WHAL_ERROR_KEYCACHE_TKIPENTRY 10
++#define WHAL_ERROR_KEYCACHE_WEPLENGTH 11
++#define WHAL_ERROR_PHY_INVALID_CHANNEL 12
++#define WHAL_ERROR_POWER_AWAKE 13
++#define WHAL_ERROR_POWER_SET 14
++#define WHAL_ERROR_RECV_STOPDMA 15
++#define WHAL_ERROR_RECV_STOPPCU 16
++#define WHAL_ERROR_RESET_CHANNF1 17
++#define WHAL_ERROR_RESET_CHANNF2 18
++#define WHAL_ERROR_RESET_PM 19
++#define WHAL_ERROR_RESET_OFFSETCAL 20
++#define WHAL_ERROR_RESET_RFGRANT 21
++#define WHAL_ERROR_RESET_RXFRAME 22
++#define WHAL_ERROR_RESET_STOPDMA 23
++#define WHAL_ERROR_RESET_RECOVER 24
++#define WHAL_ERROR_XMIT_COMPUTE 25
++#define WHAL_ERROR_XMIT_NOQUEUE 26
++#define WHAL_ERROR_XMIT_ACTIVEQUEUE 27
++#define WHAL_ERROR_XMIT_BADTYPE 28
++#define WHAL_DBGID_DEFINITION_END
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* _DBGLOG_ID_H_ */
+diff --git a/drivers/ar6000/include/dl_list.h b/drivers/ar6000/include/dl_list.h
+new file mode 100644
+index 0000000..4b9c581
+--- /dev/null
++++ b/drivers/ar6000/include/dl_list.h
+@@ -0,0 +1,114 @@
++/*
++ *
++ * Double-link list definitions (adapted from Atheros SDIO stack)
++ *
++ * Copyright (c) 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 __DL_LIST_H___
++#define __DL_LIST_H___
++
++#define A_CONTAINING_STRUCT(address, struct_type, field_name)\
++ ((struct_type *)((A_UINT32)(address) - (A_UINT32)(&((struct_type *)0)->field_name)))
++
++/* list functions */
++/* pointers for the list */
++typedef struct _DL_LIST {
++ struct _DL_LIST *pPrev;
++ struct _DL_LIST *pNext;
++}DL_LIST, *PDL_LIST;
++/*
++ * DL_LIST_INIT , initialize doubly linked list
++*/
++#define DL_LIST_INIT(pList)\
++ {(pList)->pPrev = pList; (pList)->pNext = pList;}
++
++#define DL_LIST_IS_EMPTY(pList) (((pList)->pPrev == (pList)) && ((pList)->pNext == (pList)))
++#define DL_LIST_GET_ITEM_AT_HEAD(pList) (pList)->pNext
++#define DL_LIST_GET_ITEM_AT_TAIL(pList) (pList)->pPrev
++/*
++ * ITERATE_OVER_LIST pStart is the list, pTemp is a temp list member
++ * NOT: do not use this function if the items in the list are deleted inside the
++ * iteration loop
++*/
++#define ITERATE_OVER_LIST(pStart, pTemp) \
++ for((pTemp) =(pStart)->pNext; pTemp != (pStart); (pTemp) = (pTemp)->pNext)
++
++
++/* safe iterate macro that allows the item to be removed from the list
++ * the iteration continues to the next item in the list
++ */
++#define ITERATE_OVER_LIST_ALLOW_REMOVE(pStart,pItem,st,offset) \
++{ \
++ PDL_LIST pTemp; \
++ pTemp = (pStart)->pNext; \
++ while (pTemp != (pStart)) { \
++ (pItem) = A_CONTAINING_STRUCT(pTemp,st,offset); \
++ pTemp = pTemp->pNext; \
++
++#define ITERATE_END }}
++
++/*
++ * DL_ListInsertTail - insert pAdd to the end of the list
++*/
++static INLINE PDL_LIST DL_ListInsertTail(PDL_LIST pList, PDL_LIST pAdd) {
++ /* insert at tail */
++ pAdd->pPrev = pList->pPrev;
++ pAdd->pNext = pList;
++ pList->pPrev->pNext = pAdd;
++ pList->pPrev = pAdd;
++ return pAdd;
++}
++
++/*
++ * DL_ListInsertHead - insert pAdd into the head of the list
++*/
++static INLINE PDL_LIST DL_ListInsertHead(PDL_LIST pList, PDL_LIST pAdd) {
++ /* insert at head */
++ pAdd->pPrev = pList;
++ pAdd->pNext = pList->pNext;
++ pList->pNext->pPrev = pAdd;
++ pList->pNext = pAdd;
++ return pAdd;
++}
++
++#define DL_ListAdd(pList,pItem) DL_ListInsertHead((pList),(pItem))
++/*
++ * DL_ListRemove - remove pDel from list
++*/
++static INLINE PDL_LIST DL_ListRemove(PDL_LIST pDel) {
++ pDel->pNext->pPrev = pDel->pPrev;
++ pDel->pPrev->pNext = pDel->pNext;
++ /* point back to itself just to be safe, incase remove is called again */
++ pDel->pNext = pDel;
++ pDel->pPrev = pDel;
++ return pDel;
++}
++
++/*
++ * DL_ListRemoveItemFromHead - get a list item from the head
++*/
++static INLINE PDL_LIST DL_ListRemoveItemFromHead(PDL_LIST pList) {
++ PDL_LIST pItem = NULL;
++ if (pList->pNext != pList) {
++ pItem = pList->pNext;
++ /* remove the first item from head */
++ DL_ListRemove(pItem);
++ }
++ return pItem;
++}
++
++#endif /* __DL_LIST_H___ */
+diff --git a/drivers/ar6000/include/dset_api.h b/drivers/ar6000/include/dset_api.h
+new file mode 100644
+index 0000000..de5cc6a
+--- /dev/null
++++ b/drivers/ar6000/include/dset_api.h
+@@ -0,0 +1,63 @@
++/*
++ * 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.
++ *
++ *
++ *
++ * $Id: //depot/sw/releases/olca2.0-GPL/host/include/dset_api.h#1 $
++ *
++ * Host-side DataSet API.
++ *
++ */
++
++#ifndef _DSET_API_H_
++#define _DSET_API_H_
++
++#ifdef __cplusplus
++extern "C" {
++#endif /* __cplusplus */
++
++/*
++ * Host-side DataSet support is optional, and is not
++ * currently required for correct operation. To disable
++ * Host-side DataSet support, set this to 0.
++ */
++#ifndef CONFIG_HOST_DSET_SUPPORT
++#define CONFIG_HOST_DSET_SUPPORT 1
++#endif
++
++/* Called to send a DataSet Open Reply back to the Target. */
++A_STATUS wmi_dset_open_reply(struct wmi_t *wmip,
++ A_UINT32 status,
++ A_UINT32 access_cookie,
++ A_UINT32 size,
++ A_UINT32 version,
++ A_UINT32 targ_handle,
++ A_UINT32 targ_reply_fn,
++ A_UINT32 targ_reply_arg);
++
++/* Called to send a DataSet Data Reply back to the Target. */
++A_STATUS wmi_dset_data_reply(struct wmi_t *wmip,
++ A_UINT32 status,
++ A_UINT8 *host_buf,
++ A_UINT32 length,
++ A_UINT32 targ_buf,
++ A_UINT32 targ_reply_fn,
++ A_UINT32 targ_reply_arg);
++
++#ifdef __cplusplus
++}
++#endif /* __cplusplus */
++
++
++#endif /* _DSET_API_H_ */
+diff --git a/drivers/ar6000/include/dset_internal.h b/drivers/ar6000/include/dset_internal.h
+new file mode 100644
+index 0000000..f0be380
+--- /dev/null
++++ b/drivers/ar6000/include/dset_internal.h
+@@ -0,0 +1,39 @@
++/*
++ * Copyright (c) 2007 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ * $ATH_LICENSE_HOSTSDK0_C$
++ *
++ */
++
++#ifndef __DSET_INTERNAL_H__
++#define __DSET_INTERNAL_H__
++
++/*
++ * Internal dset definitions, common for DataSet layer.
++ */
++
++#define DSET_TYPE_STANDARD 0
++#define DSET_TYPE_BPATCHED 1
++#define DSET_TYPE_COMPRESSED 2
++
++/* Dataset descriptor */
++
++typedef struct dset_descriptor_s {
++ struct dset_descriptor_s *next; /* List link. NULL only at the last
++ descriptor */
++ A_UINT16 id; /* Dset ID */
++ A_UINT16 size; /* Dset size. */
++ void *DataPtr; /* Pointer to raw data for standard
++ DataSet or pointer to original
++ dset_descriptor for patched
++ DataSet */
++ A_UINT32 data_type; /* DSET_TYPE_*, above */
++
++ void *AuxPtr; /* Additional data that might
++ needed for data_type. For
++ example, pointer to patch
++ Dataset descriptor for BPatch. */
++} dset_descriptor_t;
++
++#endif /* __DSET_INTERNAL_H__ */
+diff --git a/drivers/ar6000/include/dsetid.h b/drivers/ar6000/include/dsetid.h
+new file mode 100644
+index 0000000..85729f8
+--- /dev/null
++++ b/drivers/ar6000/include/dsetid.h
+@@ -0,0 +1,110 @@
++/*
++ * Copyright (c) 2004-2007 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ * $ATH_LICENSE_HOSTSDK0_C$
++ *
++ */
++
++#ifndef __DSETID_H__
++#define __DSETID_H__
++
++/* Well-known DataSet IDs */
++#define DSETID_UNUSED 0x00000000
++#define DSETID_BOARD_DATA 0x00000001 /* Cal and board data */
++#define DSETID_REGDB 0x00000002 /* Regulatory Database */
++#define DSETID_POWER_CONTROL 0x00000003 /* TX Pwr Lim & Ant Gain */
++#define DSETID_USER_CONFIG 0x00000004 /* User Configuration */
++
++#define DSETID_ANALOG_CONTROL_DATA_START 0x00000005
++#define DSETID_ANALOG_CONTROL_DATA_END 0x00000025
++/*
++ * Get DSETID for various reference clock speeds.
++ * For each speed there are three DataSets that correspond
++ * to the three columns of bank6 data (addr, 11a, 11b/g).
++ * This macro returns the dsetid of the first of those
++ * three DataSets.
++ */
++#define ANALOG_CONTROL_DATA_DSETID(refclk) \
++ (DSETID_ANALOG_CONTROL_DATA_START + 3*refclk)
++
++/*
++ * There are TWO STARTUP_PATCH DataSets.
++ * DSETID_STARTUP_PATCH is historical, and was applied before BMI on
++ * earlier systems. On AR6002, it is applied after BMI, just like
++ * DSETID_STARTUP_PATCH2.
++ */
++#define DSETID_STARTUP_PATCH 0x00000026
++#define DSETID_GPIO_CONFIG_PATCH 0x00000027
++#define DSETID_WLANREGS 0x00000028 /* override wlan regs */
++#define DSETID_STARTUP_PATCH2 0x00000029
++
++#define DSETID_WOW_CONFIG 0x00000090 /* WoW Configuration */
++
++/* Add WHAL_INI_DATA_ID to DSETID_INI_DATA for a specific WHAL INI table. */
++#define DSETID_INI_DATA 0x00000100
++/* Reserved for WHAL INI Tables: 0x100..0x11f */
++#define DSETID_INI_DATA_END 0x0000011f
++
++#define DSETID_VENDOR_START 0x00010000 /* Vendor-defined DataSets */
++
++#define DSETID_INDEX_END 0xfffffffe /* Reserved to indicate the
++ end of a memory-based
++ DataSet Index */
++#define DSETID_INDEX_FREE 0xffffffff /* An unused index entry */
++
++/*
++ * PATCH DataSet format:
++ * A list of patches, terminated by a patch with
++ * address=PATCH_END.
++ *
++ * This allows for patches to be stored in flash.
++ */
++struct patch_s {
++ A_UINT32 *address;
++ A_UINT32 data;
++};
++
++/*
++ * Skip some patches. Can be used to erase a single patch in a
++ * patch DataSet without having to re-write the DataSet. May
++ * also be used to embed information for use by subsequent
++ * patch code. The "data" in a PATCH_SKIP tells how many
++ * bytes of length "patch_s" to skip.
++ */
++#define PATCH_SKIP ((A_UINT32 *)0x00000000)
++
++/*
++ * Execute code at the address specified by "data".
++ * The address of the patch structure is passed as
++ * the one parameter.
++ */
++#define PATCH_CODE_ABS ((A_UINT32 *)0x00000001)
++
++/*
++ * Same as PATCH_CODE_ABS, but treat "data" as an
++ * offset from the start of the patch word.
++ */
++#define PATCH_CODE_REL ((A_UINT32 *)0x00000002)
++
++/* Mark the end of this patch DataSet. */
++#define PATCH_END ((A_UINT32 *)0xffffffff)
++
++/*
++ * A DataSet which contains a Binary Patch to some other DataSet
++ * uses the original dsetid with the DSETID_BPATCH_FLAG bit set.
++ * Such a BPatch DataSet consists of BPatch metadata followed by
++ * the bdiff bytes. BPatch metadata consists of a single 32-bit
++ * word that contains the size of the BPatched final image.
++ *
++ * To create a suitable bdiff DataSet, use bdiff in host/tools/bdiff
++ * to create "diffs":
++ * bdiff -q -O -nooldmd5 -nonewmd5 -d ORIGfile NEWfile diffs
++ * Then add BPatch metadata to the start of "diffs".
++ *
++ * NB: There are some implementation-induced restrictions
++ * on which DataSets can be BPatched.
++ */
++#define DSETID_BPATCH_FLAG 0x80000000
++
++#endif /* __DSETID_H__ */
+diff --git a/drivers/ar6000/include/gpio.h b/drivers/ar6000/include/gpio.h
+new file mode 100644
+index 0000000..2203c7e
+--- /dev/null
++++ b/drivers/ar6000/include/gpio.h
+@@ -0,0 +1,34 @@
++/*
++ * Copyright (c) 2005 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ * $ATH_LICENSE_HOSTSDK0_C$
++ *
++ */
++
++#if defined(AR6001)
++#define GPIO_PIN_COUNT 18
++#else
++#define GPIO_PIN_COUNT 18
++#endif
++
++/*
++ * Possible values for WMIX_GPIO_SET_REGISTER_CMDID.
++ * NB: These match hardware order, so that addresses can
++ * easily be computed.
++ */
++#define GPIO_ID_OUT 0x00000000
++#define GPIO_ID_OUT_W1TS 0x00000001
++#define GPIO_ID_OUT_W1TC 0x00000002
++#define GPIO_ID_ENABLE 0x00000003
++#define GPIO_ID_ENABLE_W1TS 0x00000004
++#define GPIO_ID_ENABLE_W1TC 0x00000005
++#define GPIO_ID_IN 0x00000006
++#define GPIO_ID_STATUS 0x00000007
++#define GPIO_ID_STATUS_W1TS 0x00000008
++#define GPIO_ID_STATUS_W1TC 0x00000009
++#define GPIO_ID_PIN0 0x0000000a
++#define GPIO_ID_PIN(n) (GPIO_ID_PIN0+(n))
++
++#define GPIO_LAST_REGISTER_ID GPIO_ID_PIN(17)
++#define GPIO_ID_NONE 0xffffffff
+diff --git a/drivers/ar6000/include/gpio_api.h b/drivers/ar6000/include/gpio_api.h
+new file mode 100644
+index 0000000..8078aa5
+--- /dev/null
++++ b/drivers/ar6000/include/gpio_api.h
+@@ -0,0 +1,57 @@
++#ifndef _GPIO_API_H_
++#define _GPIO_API_H_
++/*
++ * Copyright 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.
++ *
++ *
++ *
++ */
++
++/*
++ * Host-side General Purpose I/O API.
++ *
++ * $Id: //depot/sw/releases/olca2.0-GPL/host/include/gpio_api.h#1 $
++ */
++
++/*
++ * Send a command to the Target in order to change output on GPIO pins.
++ */
++A_STATUS wmi_gpio_output_set(struct wmi_t *wmip,
++ A_UINT32 set_mask,
++ A_UINT32 clear_mask,
++ A_UINT32 enable_mask,
++ A_UINT32 disable_mask);
++
++/*
++ * Send a command to the Target requesting input state of GPIO pins.
++ */
++A_STATUS wmi_gpio_input_get(struct wmi_t *wmip);
++
++/*
++ * Send a command to the Target to change the value of a GPIO register.
++ */
++A_STATUS wmi_gpio_register_set(struct wmi_t *wmip,
++ A_UINT32 gpioreg_id,
++ A_UINT32 value);
++
++/*
++ * Send a command to the Target to fetch the value of a GPIO register.
++ */
++A_STATUS wmi_gpio_register_get(struct wmi_t *wmip, A_UINT32 gpioreg_id);
++
++/*
++ * Send a command to the Target, acknowledging some GPIO interrupts.
++ */
++A_STATUS wmi_gpio_intr_ack(struct wmi_t *wmip, A_UINT32 ack_mask);
++
++#endif /* _GPIO_API_H_ */
+diff --git a/drivers/ar6000/include/hif.h b/drivers/ar6000/include/hif.h
+new file mode 100644
+index 0000000..846a69f
+--- /dev/null
++++ b/drivers/ar6000/include/hif.h
+@@ -0,0 +1,296 @@
++/*
++ * 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.
++ *
++ *
++ *
++ * HIF specific declarations and prototypes
++ */
++
++#ifndef _HIF_H_
++#define _HIF_H_
++
++#ifdef __cplusplus
++extern "C" {
++#endif /* __cplusplus */
++
++/* Header files */
++#include "a_config.h"
++#include "athdefs.h"
++#include "a_types.h"
++#include "a_osapi.h"
++
++typedef struct htc_callbacks HTC_CALLBACKS;
++typedef struct hif_device HIF_DEVICE;
++
++/*
++ * direction - Direction of transfer (HIF_READ/HIF_WRITE).
++ */
++#define HIF_READ 0x00000001
++#define HIF_WRITE 0x00000002
++#define HIF_DIR_MASK (HIF_READ | HIF_WRITE)
++
++/*
++ * type - An interface may support different kind of read/write commands.
++ * The command type is divided into a basic and an extended command
++ * and can be specified using HIF_BASIC_IO/HIF_EXTENDED_IO.
++ */
++#define HIF_BASIC_IO 0x00000004
++#define HIF_EXTENDED_IO 0x00000008
++#define HIF_TYPE_MASK (HIF_BASIC_IO | HIF_EXTENDED_IO)
++
++/*
++ * emode - This indicates the whether the command is to be executed in a
++ * blocking or non-blocking fashion (HIF_SYNCHRONOUS/
++ * HIF_ASYNCHRONOUS). The read/write data paths in HTC have been
++ * implemented using the asynchronous mode allowing the the bus
++ * driver to indicate the completion of operation through the
++ * registered callback routine. The requirement primarily comes
++ * from the contexts these operations get called from (a driver's
++ * transmit context or the ISR context in case of receive).
++ * Support for both of these modes is essential.
++ */
++#define HIF_SYNCHRONOUS 0x00000010
++#define HIF_ASYNCHRONOUS 0x00000020
++#define HIF_EMODE_MASK (HIF_SYNCHRONOUS | HIF_ASYNCHRONOUS)
++
++/*
++ * dmode - An interface may support different kinds of commands based on
++ * the tradeoff between the amount of data it can carry and the
++ * setup time. Byte and Block modes are supported (HIF_BYTE_BASIS/
++ * HIF_BLOCK_BASIS). In case of latter, the data is rounded off
++ * to the nearest block size by padding. The size of the block is
++ * configurable at compile time using the HIF_BLOCK_SIZE and is
++ * negotiated with the target during initialization after the
++ * dragon interrupts are enabled.
++ */
++#define HIF_BYTE_BASIS 0x00000040
++#define HIF_BLOCK_BASIS 0x00000080
++#define HIF_DMODE_MASK (HIF_BYTE_BASIS | HIF_BLOCK_BASIS)
++
++/*
++ * amode - This indicates if the address has to be incremented on dragon
++ * after every read/write operation (HIF?FIXED_ADDRESS/
++ * HIF_INCREMENTAL_ADDRESS).
++ */
++#define HIF_FIXED_ADDRESS 0x00000100
++#define HIF_INCREMENTAL_ADDRESS 0x00000200
++#define HIF_AMODE_MASK (HIF_FIXED_ADDRESS | HIF_INCREMENTAL_ADDRESS)
++
++#define HIF_WR_ASYNC_BYTE_FIX \
++ (HIF_WRITE | HIF_ASYNCHRONOUS | HIF_EXTENDED_IO | HIF_BYTE_BASIS | HIF_FIXED_ADDRESS)
++#define HIF_WR_ASYNC_BYTE_INC \
++ (HIF_WRITE | HIF_ASYNCHRONOUS | HIF_EXTENDED_IO | HIF_BYTE_BASIS | HIF_INCREMENTAL_ADDRESS)
++#define HIF_WR_ASYNC_BLOCK_INC \
++ (HIF_WRITE | HIF_ASYNCHRONOUS | HIF_EXTENDED_IO | HIF_BLOCK_BASIS | HIF_INCREMENTAL_ADDRESS)
++#define HIF_WR_SYNC_BYTE_FIX \
++ (HIF_WRITE | HIF_SYNCHRONOUS | HIF_EXTENDED_IO | HIF_BYTE_BASIS | HIF_FIXED_ADDRESS)
++#define HIF_WR_SYNC_BYTE_INC \
++ (HIF_WRITE | HIF_SYNCHRONOUS | HIF_EXTENDED_IO | HIF_BYTE_BASIS | HIF_INCREMENTAL_ADDRESS)
++#define HIF_WR_SYNC_BLOCK_INC \
++ (HIF_WRITE | HIF_SYNCHRONOUS | HIF_EXTENDED_IO | HIF_BLOCK_BASIS | HIF_INCREMENTAL_ADDRESS)
++#define HIF_RD_SYNC_BYTE_INC \
++ (HIF_READ | HIF_SYNCHRONOUS | HIF_EXTENDED_IO | HIF_BYTE_BASIS | HIF_INCREMENTAL_ADDRESS)
++#define HIF_RD_SYNC_BYTE_FIX \
++ (HIF_READ | HIF_SYNCHRONOUS | HIF_EXTENDED_IO | HIF_BYTE_BASIS | HIF_FIXED_ADDRESS)
++#define HIF_RD_ASYNC_BYTE_FIX \
++ (HIF_READ | HIF_ASYNCHRONOUS | HIF_EXTENDED_IO | HIF_BYTE_BASIS | HIF_FIXED_ADDRESS)
++#define HIF_RD_ASYNC_BLOCK_FIX \
++ (HIF_READ | HIF_ASYNCHRONOUS | HIF_EXTENDED_IO | HIF_BLOCK_BASIS | HIF_FIXED_ADDRESS)
++#define HIF_RD_ASYNC_BYTE_INC \
++ (HIF_READ | HIF_ASYNCHRONOUS | HIF_EXTENDED_IO | HIF_BYTE_BASIS | HIF_INCREMENTAL_ADDRESS)
++#define HIF_RD_ASYNC_BLOCK_INC \
++ (HIF_READ | HIF_ASYNCHRONOUS | HIF_EXTENDED_IO | HIF_BLOCK_BASIS | HIF_INCREMENTAL_ADDRESS)
++#define HIF_RD_SYNC_BLOCK_INC \
++ (HIF_READ | HIF_SYNCHRONOUS | HIF_EXTENDED_IO | HIF_BLOCK_BASIS | HIF_INCREMENTAL_ADDRESS)
++
++
++typedef enum {
++ HIF_DEVICE_POWER_STATE = 0,
++ HIF_DEVICE_GET_MBOX_BLOCK_SIZE,
++ HIF_DEVICE_GET_MBOX_ADDR,
++ HIF_DEVICE_GET_PENDING_EVENTS_FUNC,
++ HIF_DEVICE_GET_IRQ_PROC_MODE,
++ HIF_DEVICE_GET_RECV_EVENT_MASK_UNMASK_FUNC,
++} HIF_DEVICE_CONFIG_OPCODE;
++
++/*
++ * HIF CONFIGURE definitions:
++ *
++ * HIF_DEVICE_GET_MBOX_BLOCK_SIZE
++ * input : none
++ * output : array of 4 A_UINT32s
++ * notes: block size is returned for each mailbox (4)
++ *
++ * HIF_DEVICE_GET_MBOX_ADDR
++ * input : none
++ * output : array of 4 A_UINT32
++ * notes: address is returned for each mailbox (4) in the array
++ *
++ * HIF_DEVICE_GET_PENDING_EVENTS_FUNC
++ * input : none
++ * output: HIF_PENDING_EVENTS_FUNC function pointer
++ * notes: this is optional for the HIF layer, if the request is
++ * not handled then it indicates that the upper layer can use
++ * the standard device methods to get pending events (IRQs, mailbox messages etc..)
++ * otherwise it can call the function pointer to check pending events.
++ *
++ * HIF_DEVICE_GET_IRQ_PROC_MODE
++ * input : none
++ * output : HIF_DEVICE_IRQ_PROCESSING_MODE (interrupt processing mode)
++ * note: the hif layer interfaces with the underlying OS-specific bus driver. The HIF
++ * layer can report whether IRQ processing is requires synchronous behavior or
++ * can be processed using asynchronous bus requests (typically faster).
++ *
++ * HIF_DEVICE_GET_RECV_EVENT_MASK_UNMASK_FUNC
++ * input :
++ * output : HIF_MASK_UNMASK_RECV_EVENT function pointer
++ * notes: this is optional for the HIF layer. The HIF layer may require a special mechanism
++ * to mask receive message events. The upper layer can call this pointer when it needs
++ * to mask/unmask receive events (in case it runs out of buffers).
++ *
++ *
++ */
++
++typedef enum {
++ HIF_DEVICE_IRQ_SYNC_ONLY, /* for HIF implementations that require the DSR to process all
++ interrupts before returning */
++ HIF_DEVICE_IRQ_ASYNC_SYNC, /* for HIF implementations that allow DSR to process interrupts
++ using ASYNC I/O (that is HIFAckInterrupt can be called at a
++ later time */
++} HIF_DEVICE_IRQ_PROCESSING_MODE;
++
++#define HIF_MAX_DEVICES 1
++
++struct htc_callbacks {
++ A_UCHAR *name;
++ A_UINT32 id;
++ A_STATUS (* deviceInsertedHandler)(void *hif_handle);
++ A_STATUS (* deviceRemovedHandler)(void *htc_handle, A_STATUS status);
++ A_STATUS (* deviceSuspendHandler)(void *htc_handle);
++ A_STATUS (* deviceResumeHandler)(void *htc_handle);
++ A_STATUS (* deviceWakeupHandler)(void *htc_handle);
++ A_STATUS (* rwCompletionHandler)(void *context, A_STATUS status);
++ A_STATUS (* dsrHandler)(void *htc_handle);
++};
++
++
++#define HIF_OTHER_EVENTS (1 << 0) /* other interrupts (non-Recv) are pending, host
++ needs to read the register table to figure out what */
++#define HIF_RECV_MSG_AVAIL (1 << 1) /* pending recv packet */
++
++typedef struct _HIF_PENDING_EVENTS_INFO {
++ A_UINT32 Events;
++ A_UINT32 LookAhead;
++} HIF_PENDING_EVENTS_INFO;
++
++ /* function to get pending events , some HIF modules use special mechanisms
++ * to detect packet available and other interrupts */
++typedef A_STATUS ( *HIF_PENDING_EVENTS_FUNC)(HIF_DEVICE *device,
++ HIF_PENDING_EVENTS_INFO *pEvents,
++ void *AsyncContext);
++
++#define HIF_MASK_RECV TRUE
++#define HIF_UNMASK_RECV FALSE
++ /* function to mask recv events */
++typedef A_STATUS ( *HIF_MASK_UNMASK_RECV_EVENT)(HIF_DEVICE *device,
++ A_BOOL Mask,
++ void *AsyncContext);
++
++
++/*
++ * This API is used by the HTC layer to initialize the HIF layer and to
++ * register different callback routines. Support for following events has
++ * been captured - DSR, Read/Write completion, Device insertion/removal,
++ * Device suspension/resumption/wakeup. In addition to this, the API is
++ * also used to register the name and the revision of the chip. The latter
++ * can be used to verify the revision of the chip read from the device
++ * before reporting it to HTC.
++ */
++int HIFInit(HTC_CALLBACKS *callbacks);
++
++/*
++ * This API is used to provide the read/write interface over the specific bus
++ * interface.
++ * address - Starting address in the dragon's address space. For mailbox
++ * writes, it refers to the start of the mbox boundary. It should
++ * be ensured that the last byte falls on the mailbox's EOM. For
++ * mailbox reads, it refers to the end of the mbox boundary.
++ * buffer - Pointer to the buffer containg the data to be transmitted or
++ * received.
++ * length - Amount of data to be transmitted or received.
++ * request - Characterizes the attributes of the command.
++ */
++A_STATUS
++HIFReadWrite(HIF_DEVICE *device,
++ A_UINT32 address,
++ A_UCHAR *buffer,
++ A_UINT32 length,
++ A_UINT32 request,
++ void *context);
++
++/*
++ * This can be initiated from the unload driver context ie when the HTCShutdown
++ * routine is called.
++ */
++void HIFShutDownDevice(HIF_DEVICE *device);
++
++/*
++ * This should translate to an acknowledgment to the bus driver indicating that
++ * the previous interrupt request has been serviced and the all the relevant
++ * sources have been cleared. HTC is ready to process more interrupts.
++ * This should prevent the bus driver from raising an interrupt unless the
++ * previous one has been serviced and acknowledged using the previous API.
++ */
++void HIFAckInterrupt(HIF_DEVICE *device);
++
++void HIFMaskInterrupt(HIF_DEVICE *device);
++
++void HIFUnMaskInterrupt(HIF_DEVICE *device);
++
++/*
++ * This set of functions are to be used by the bus driver to notify
++ * the HIF module about various events.
++ * These are not implemented if the bus driver provides an alternative
++ * way for this notification though callbacks for instance.
++ */
++int HIFInsertEventNotify(void);
++
++int HIFRemoveEventNotify(void);
++
++int HIFIRQEventNotify(void);
++
++int HIFRWCompleteEventNotify(void);
++
++/*
++ * This function associates a opaque handle with the HIF layer
++ * to be used in communication with upper layer i.e. HTC.
++ * This would normaly be a pointer to htc_target data structure.
++ */
++void HIFSetHandle(void *hif_handle, void *handle);
++
++A_STATUS
++HIFConfigureDevice(HIF_DEVICE *device, HIF_DEVICE_CONFIG_OPCODE opcode,
++ void *config, A_UINT32 configLen);
++
++
++struct device;
++struct device*
++HIFGetOSDevice(HIF_DEVICE *device);
++
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* _HIF_H_ */
+diff --git a/drivers/ar6000/include/host_version.h b/drivers/ar6000/include/host_version.h
+new file mode 100644
+index 0000000..c090115
+--- /dev/null
++++ b/drivers/ar6000/include/host_version.h
+@@ -0,0 +1,49 @@
++#ifndef _HOST_VERSION_H_
++#define _HOST_VERSION_H_
++/*
++ * Copyright (c) 2004-2005 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ * This file contains version information for the sample host driver for the
++ * AR6000 chip
++ *
++ * $Id: //depot/sw/releases/olca2.0-GPL/host/include/host_version.h#2 $
++ *
++ *
++ * 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
++
++#include <AR6K_version.h>
++
++/*
++ * The version number is made up of major, minor, patch and build
++ * numbers. These are 16 bit numbers. The build and release script will
++ * set the build number using a Perforce counter. Here the build number is
++ * set to 9999 so that builds done without the build-release script are easily
++ * identifiable.
++ */
++
++#define ATH_SW_VER_MAJOR __VER_MAJOR_
++#define ATH_SW_VER_MINOR __VER_MINOR_
++#define ATH_SW_VER_PATCH __VER_PATCH_
++#define ATH_SW_VER_BUILD 9999
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* _HOST_VERSION_H_ */
+diff --git a/drivers/ar6000/include/htc.h b/drivers/ar6000/include/htc.h
+new file mode 100644
+index 0000000..152d867
+--- /dev/null
++++ b/drivers/ar6000/include/htc.h
+@@ -0,0 +1,190 @@
++/*
++ * Copyright (c) 2007 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ * $ATH_LICENSE_HOSTSDK0_C$
++ *
++ */
++
++
++#ifndef __HTC_H__
++#define __HTC_H__
++
++#ifndef ATH_TARGET
++#include "athstartpack.h"
++#endif
++
++#define A_OFFSETOF(type,field) (int)(&(((type *)NULL)->field))
++
++#define ASSEMBLE_UNALIGNED_UINT16(p,highbyte,lowbyte) \
++ (((A_UINT16)(((A_UINT8 *)(p))[(highbyte)])) << 8 | (A_UINT16)(((A_UINT8 *)(p))[(lowbyte)]))
++
++/* alignment independent macros (little-endian) to fetch UINT16s or UINT8s from a
++ * structure using only the type and field name.
++ * Use these macros if there is the potential for unaligned buffer accesses. */
++#define A_GET_UINT16_FIELD(p,type,field) \
++ ASSEMBLE_UNALIGNED_UINT16(p,\
++ A_OFFSETOF(type,field) + 1, \
++ A_OFFSETOF(type,field))
++
++#define A_SET_UINT16_FIELD(p,type,field,value) \
++{ \
++ ((A_UINT8 *)(p))[A_OFFSETOF(type,field)] = (A_UINT8)(value); \
++ ((A_UINT8 *)(p))[A_OFFSETOF(type,field) + 1] = (A_UINT8)((value) >> 8); \
++}
++
++#define A_GET_UINT8_FIELD(p,type,field) \
++ ((A_UINT8 *)(p))[A_OFFSETOF(type,field)]
++
++#define A_SET_UINT8_FIELD(p,type,field,value) \
++ ((A_UINT8 *)(p))[A_OFFSETOF(type,field)] = (value)
++
++/****** DANGER DANGER ***************
++ *
++ * The frame header length and message formats defined herein were
++ * selected to accommodate optimal alignment for target processing. This reduces code
++ * size and improves performance.
++ *
++ * Any changes to the header length may alter the alignment and cause exceptions
++ * on the target. When adding to the message structures insure that fields are
++ * properly aligned.
++ *
++ */
++
++/* HTC frame header */
++typedef PREPACK struct _HTC_FRAME_HDR{
++ /* do not remove or re-arrange these fields, these are minimally required
++ * to take advantage of 4-byte lookaheads in some hardware implementations */
++ A_UINT8 EndpointID;
++ A_UINT8 Flags;
++ A_UINT16 PayloadLen; /* length of data (including trailer) that follows the header */
++
++ /***** end of 4-byte lookahead ****/
++
++ A_UINT8 ControlBytes[2];
++
++ /* message payload starts after the header */
++
++} POSTPACK HTC_FRAME_HDR;
++
++/* frame header flags */
++#define HTC_FLAGS_NEED_CREDIT_UPDATE (1 << 0)
++#define HTC_FLAGS_RECV_TRAILER (1 << 1)
++
++
++#define HTC_HDR_LENGTH (sizeof(HTC_FRAME_HDR))
++#define HTC_MAX_TRAILER_LENGTH 255
++#define HTC_MAX_PAYLOAD_LENGTH (2048 - sizeof(HTC_FRAME_HDR))
++
++/* HTC control message IDs */
++typedef enum {
++ HTC_MSG_READY_ID = 1,
++ HTC_MSG_CONNECT_SERVICE_ID = 2,
++ HTC_MSG_CONNECT_SERVICE_RESPONSE_ID = 3,
++ HTC_MSG_SETUP_COMPLETE_ID = 4,
++} HTC_MSG_IDS;
++
++#define HTC_MAX_CONTROL_MESSAGE_LENGTH 256
++
++/* base message ID header */
++typedef PREPACK struct {
++ A_UINT16 MessageID;
++} POSTPACK HTC_UNKNOWN_MSG;
++
++/* HTC ready message
++ * direction : target-to-host */
++typedef PREPACK struct {
++ A_UINT16 MessageID; /* ID */
++ A_UINT16 CreditCount; /* number of credits the target can offer */
++ A_UINT16 CreditSize; /* size of each credit */
++ A_UINT8 MaxEndpoints; /* maximum number of endpoints the target has resources for */
++ A_UINT8 _Pad1;
++} POSTPACK HTC_READY_MSG;
++
++#define HTC_SERVICE_META_DATA_MAX_LENGTH 128
++
++/* connect service
++ * direction : host-to-target */
++typedef PREPACK struct {
++ A_UINT16 MessageID;
++ A_UINT16 ServiceID; /* service ID of the service to connect to */
++ A_UINT16 ConnectionFlags; /* connection flags */
++
++#define HTC_CONNECT_FLAGS_REDUCE_CREDIT_DRIBBLE (1 << 2) /* reduce credit dribbling when
++ the host needs credits */
++#define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_MASK (0x3)
++#define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_ONE_FOURTH 0x0
++#define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_ONE_HALF 0x1
++#define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_THREE_FOURTHS 0x2
++#define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_UNITY 0x3
++
++ A_UINT8 ServiceMetaLength; /* length of meta data that follows */
++ A_UINT8 _Pad1;
++
++ /* service-specific meta data starts after the header */
++
++} POSTPACK HTC_CONNECT_SERVICE_MSG;
++
++/* connect response
++ * direction : target-to-host */
++typedef PREPACK struct {
++ A_UINT16 MessageID;
++ A_UINT16 ServiceID; /* service ID that the connection request was made */
++ A_UINT8 Status; /* service connection status */
++ A_UINT8 EndpointID; /* assigned endpoint ID */
++ A_UINT16 MaxMsgSize; /* maximum expected message size on this endpoint */
++ A_UINT8 ServiceMetaLength; /* length of meta data that follows */
++ A_UINT8 _Pad1;
++
++ /* service-specific meta data starts after the header */
++
++} POSTPACK HTC_CONNECT_SERVICE_RESPONSE_MSG;
++
++typedef PREPACK struct {
++ A_UINT16 MessageID;
++ /* currently, no other fields */
++} POSTPACK HTC_SETUP_COMPLETE_MSG;
++
++
++/* connect response status codes */
++#define HTC_SERVICE_SUCCESS 0 /* success */
++#define HTC_SERVICE_NOT_FOUND 1 /* service could not be found */
++#define HTC_SERVICE_FAILED 2 /* specific service failed the connect */
++#define HTC_SERVICE_NO_RESOURCES 3 /* no resources (i.e. no more endpoints) */
++#define HTC_SERVICE_NO_MORE_EP 4 /* specific service is not allowing any more
++ endpoints */
++
++/* report record IDs */
++typedef enum {
++ HTC_RECORD_NULL = 0,
++ HTC_RECORD_CREDITS = 1,
++ HTC_RECORD_LOOKAHEAD = 2,
++} HTC_RPT_IDS;
++
++typedef PREPACK struct {
++ A_UINT8 RecordID; /* Record ID */
++ A_UINT8 Length; /* Length of record */
++} POSTPACK HTC_RECORD_HDR;
++
++typedef PREPACK struct {
++ A_UINT8 EndpointID; /* Endpoint that owns these credits */
++ A_UINT8 Credits; /* credits to report since last report */
++} POSTPACK HTC_CREDIT_REPORT;
++
++typedef PREPACK struct {
++ A_UINT8 PreValid; /* pre valid guard */
++ A_UINT8 LookAhead[4]; /* 4 byte lookahead */
++ A_UINT8 PostValid; /* post valid guard */
++
++ /* NOTE: the LookAhead array is guarded by a PreValid and Post Valid guard bytes.
++ * The PreValid bytes must equal the inverse of the PostValid byte */
++
++} POSTPACK HTC_LOOKAHEAD_REPORT;
++
++#ifndef ATH_TARGET
++#include "athendpack.h"
++#endif
++
++
++#endif /* __HTC_H__ */
++
+diff --git a/drivers/ar6000/include/htc_api.h b/drivers/ar6000/include/htc_api.h
+new file mode 100644
+index 0000000..e75692d
+--- /dev/null
++++ b/drivers/ar6000/include/htc_api.h
+@@ -0,0 +1,439 @@
++/*
++ *
++ * Copyright (c) 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 _HTC_API_H_
++#define _HTC_API_H_
++
++#include <htc.h>
++#include <htc_services.h>
++#include "htc_packet.h"
++
++#ifdef __cplusplus
++extern "C" {
++#endif /* __cplusplus */
++
++/* TODO.. for BMI */
++#define ENDPOINT1 0
++// TODO -remove me, but we have to fix BMI first
++#define HTC_MAILBOX_NUM_MAX 4
++
++
++/* ------ Endpoint IDS ------ */
++typedef enum
++{
++ ENDPOINT_UNUSED = -1,
++ ENDPOINT_0 = 0,
++ ENDPOINT_1 = 1,
++ ENDPOINT_2 = 2,
++ ENDPOINT_3,
++ ENDPOINT_4,
++ ENDPOINT_5,
++ ENDPOINT_6,
++ ENDPOINT_7,
++ ENDPOINT_8,
++ ENDPOINT_MAX,
++} HTC_ENDPOINT_ID;
++
++/* this is the amount of header room required by users of HTC */
++#define HTC_HEADER_LEN HTC_HDR_LENGTH
++
++typedef void *HTC_HANDLE;
++
++typedef A_UINT16 HTC_SERVICE_ID;
++
++typedef struct _HTC_INIT_INFO {
++ void (*AddInstance)(HTC_HANDLE);
++ void (*DeleteInstance)(void *Instance);
++ void (*TargetFailure)(void *Instance, A_STATUS Status);
++} HTC_INIT_INFO;
++
++/* per service connection send completion */
++typedef void (*HTC_EP_SEND_PKT_COMPLETE)(void *,HTC_PACKET *);
++/* per service connection pkt received */
++typedef void (*HTC_EP_RECV_PKT)(void *,HTC_PACKET *);
++
++/* Optional per service connection receive buffer re-fill callback,
++ * On some OSes (like Linux) packets are allocated from a global pool and indicated up
++ * to the network stack. The driver never gets the packets back from the OS. For these OSes
++ * a refill callback can be used to allocate and re-queue buffers into HTC.
++ *
++ * On other OSes, the network stack can call into the driver's OS-specifc "return_packet" handler and
++ * the driver can re-queue these buffers into HTC. In this regard a refill callback is
++ * unnecessary */
++typedef void (*HTC_EP_RECV_REFILL)(void *, HTC_ENDPOINT_ID Endpoint);
++
++/* Optional per service connection callback when a send queue is full. This can occur if the
++ * host continues queueing up TX packets faster than credits can arrive
++ * To prevent the host (on some Oses like Linux) from continuously queueing packets
++ * and consuming resources, this callback is provided so that that the host
++ * can disable TX in the subsystem (i.e. network stack)
++ * Other OSes require a "per-packet" indication_RAW_STREAM_NUM_MAX for each completed TX packet, this
++ * closed loop mechanism will prevent the network stack from overunning the NIC */
++typedef void (*HTC_EP_SEND_QUEUE_FULL)(void *, HTC_ENDPOINT_ID Endpoint);
++/* Optional per service connection callback when a send queue is available for receive new packet. */
++typedef void (*HTC_EP_SEND_QUEUE_AVAIL)(void *, HTC_ENDPOINT_ID Endpoint);
++
++typedef struct _HTC_EP_CALLBACKS {
++ void *pContext; /* context for each callback */
++ HTC_EP_SEND_PKT_COMPLETE EpTxComplete; /* tx completion callback for connected endpoint */
++ HTC_EP_RECV_PKT EpRecv; /* receive callback for connected endpoint */
++ HTC_EP_RECV_REFILL EpRecvRefill; /* OPTIONAL receive re-fill callback for connected endpoint */
++ HTC_EP_SEND_QUEUE_FULL EpSendFull; /* OPTIONAL send full callback */
++ HTC_EP_SEND_QUEUE_AVAIL EpSendAvail; /* OPTIONAL send available callback */
++} HTC_EP_CALLBACKS;
++
++/* service connection information */
++typedef struct _HTC_SERVICE_CONNECT_REQ {
++ HTC_SERVICE_ID ServiceID; /* service ID to connect to */
++ A_UINT16 ConnectionFlags; /* connection flags, see htc protocol definition */
++ A_UINT8 *pMetaData; /* ptr to optional service-specific meta-data */
++ A_UINT8 MetaDataLength; /* optional meta data length */
++ HTC_EP_CALLBACKS EpCallbacks; /* endpoint callbacks */
++ int MaxSendQueueDepth; /* maximum depth of any send queue */
++} HTC_SERVICE_CONNECT_REQ;
++
++/* service connection response information */
++typedef struct _HTC_SERVICE_CONNECT_RESP {
++ A_UINT8 *pMetaData; /* caller supplied buffer to optional meta-data */
++ A_UINT8 BufferLength; /* length of caller supplied buffer */
++ A_UINT8 ActualLength; /* actual length of meta data */
++ HTC_ENDPOINT_ID Endpoint; /* endpoint to communicate over */
++ int MaxMsgLength; /* max length of all messages over this endpoint */
++ A_UINT8 ConnectRespCode; /* connect response code from target */
++} HTC_SERVICE_CONNECT_RESP;
++
++/* endpoint distribution structure */
++typedef struct _HTC_ENDPOINT_CREDIT_DIST {
++ struct _HTC_ENDPOINT_CREDIT_DIST *pNext;
++ struct _HTC_ENDPOINT_CREDIT_DIST *pPrev;
++ HTC_SERVICE_ID ServiceID; /* Service ID (set by HTC) */
++ HTC_ENDPOINT_ID Endpoint; /* endpoint for this distribution struct (set by HTC) */
++ A_UINT32 DistFlags; /* distribution flags, distribution function can
++ set default activity using SET_EP_ACTIVE() macro */
++ int TxCreditsNorm; /* credits for normal operation, anything above this
++ indicates the endpoint is over-subscribed, this field
++ is only relevant to the credit distribution function */
++ int TxCreditsMin; /* floor for credit distribution, this field is
++ only relevant to the credit distribution function */
++ int TxCreditsAssigned; /* number of credits assigned to this EP, this field
++ is only relevant to the credit dist function */
++ int TxCredits; /* current credits available, this field is used by
++ HTC to determine whether a message can be sent or
++ must be queued */
++ int TxCreditsToDist; /* pending credits to distribute on this endpoint, this
++ is set by HTC when credit reports arrive.
++ The credit distribution functions sets this to zero
++ when it distributes the credits */
++ int TxCreditsSeek; /* this is the number of credits that the current pending TX
++ packet needs to transmit. This is set by HTC when
++ and endpoint needs credits in order to transmit */
++ int TxCreditSize; /* size in bytes of each credit (set by HTC) */
++ int TxCreditsPerMaxMsg; /* credits required for a maximum sized messages (set by HTC) */
++ void *pHTCReserved; /* reserved for HTC use */
++} HTC_ENDPOINT_CREDIT_DIST;
++
++#define HTC_EP_ACTIVE (1 << 31)
++
++/* macro to check if an endpoint has gone active, useful for credit
++ * distributions */
++#define IS_EP_ACTIVE(epDist) ((epDist)->DistFlags & HTC_EP_ACTIVE)
++#define SET_EP_ACTIVE(epDist) (epDist)->DistFlags |= HTC_EP_ACTIVE
++
++ /* credit distibution code that is passed into the distrbution function,
++ * there are mandatory and optional codes that must be handled */
++typedef enum _HTC_CREDIT_DIST_REASON {
++ HTC_CREDIT_DIST_SEND_COMPLETE = 0, /* credits available as a result of completed
++ send operations (MANDATORY) resulting in credit reports */
++ HTC_CREDIT_DIST_ACTIVITY_CHANGE = 1, /* a change in endpoint activity occured (OPTIONAL) */
++ HTC_CREDIT_DIST_SEEK_CREDITS, /* an endpoint needs to "seek" credits (OPTIONAL) */
++ HTC_DUMP_CREDIT_STATE /* for debugging, dump any state information that is kept by
++ the distribution function */
++} HTC_CREDIT_DIST_REASON;
++
++typedef void (*HTC_CREDIT_DIST_CALLBACK)(void *Context,
++ HTC_ENDPOINT_CREDIT_DIST *pEPList,
++ HTC_CREDIT_DIST_REASON Reason);
++
++typedef void (*HTC_CREDIT_INIT_CALLBACK)(void *Context,
++ HTC_ENDPOINT_CREDIT_DIST *pEPList,
++ int TotalCredits);
++
++ /* endpoint statistics action */
++typedef enum _HTC_ENDPOINT_STAT_ACTION {
++ HTC_EP_STAT_SAMPLE = 0, /* only read statistics */
++ HTC_EP_STAT_SAMPLE_AND_CLEAR = 1, /* sample and immediately clear statistics */
++ HTC_EP_STAT_CLEAR /* clear only */
++} HTC_ENDPOINT_STAT_ACTION;
++
++ /* endpoint statistics */
++typedef struct _HTC_ENDPOINT_STATS {
++ A_UINT32 TxCreditLowIndications; /* number of times the host set the credit-low flag in a send message on
++ this endpoint */
++ A_UINT32 TxIssued; /* running count of TX packets issued */
++ A_UINT32 TxCreditRpts; /* running count of total credit reports received for this endpoint */
++ A_UINT32 TxCreditRptsFromRx;
++ A_UINT32 TxCreditRptsFromOther;
++ A_UINT32 TxCreditRptsFromEp0;
++ A_UINT32 TxCreditsFromRx; /* count of credits received via Rx packets on this endpoint */
++ A_UINT32 TxCreditsFromOther; /* count of credits received via another endpoint */
++ A_UINT32 TxCreditsFromEp0; /* count of credits received via another endpoint */
++ A_UINT32 TxCreditsConsummed; /* count of consummed credits */
++ A_UINT32 TxCreditsReturned; /* count of credits returned */
++ A_UINT32 RxReceived; /* count of RX packets received */
++ A_UINT32 RxLookAheads; /* count of lookahead records
++ found in messages received on this endpoint */
++} HTC_ENDPOINT_STATS;
++
++/* ------ Function Prototypes ------ */
++/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++ @desc: Initialize HTC
++ @function name: HTCInit
++ @input: pInfo - initialization information
++ @output:
++ @return: A_OK on success
++ @notes: The caller initializes global HTC state and registers various instance
++ notification callbacks (see HTC_INIT_INFO).
++
++ @example:
++ @see also: HTCShutdown
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
++A_STATUS HTCInit(HTC_INIT_INFO *pInfo);
++/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++ @desc: Get the underlying HIF device handle
++ @function name: HTCGetHifDevice
++ @input: HTCHandle - handle passed into the AddInstance callback
++ @output:
++ @return: opaque HIF device handle usable in HIF API calls.
++ @notes:
++ @example:
++ @see also:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
++void *HTCGetHifDevice(HTC_HANDLE HTCHandle);
++/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++ @desc: Set the associated instance for the HTC handle
++ @function name: HTCSetInstance
++ @input: HTCHandle - handle passed into the AddInstance callback
++ Instance - caller supplied instance object
++ @output:
++ @return:
++ @notes: Caller must set the instance information for the HTC handle in order to receive
++ notifications for instance deletion (DeleteInstance callback is called) and for target
++ failure notification.
++ @example:
++ @see also:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
++void HTCSetInstance(HTC_HANDLE HTCHandle, void *Instance);
++/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++ @desc: Set credit distribution parameters
++ @function name: HTCSetCreditDistribution
++ @input: HTCHandle - HTC handle
++ pCreditDistCont - caller supplied context to pass into distribution functions
++ CreditDistFunc - Distribution function callback
++ CreditDistInit - Credit Distribution initialization callback
++ ServicePriorityOrder - Array containing list of service IDs, lowest index is highest
++ priority
++ ListLength - number of elements in ServicePriorityOrder
++ @output:
++ @return:
++ @notes: The user can set a custom credit distribution function to handle special requirements
++ for each endpoint. A default credit distribution routine can be used by setting
++ CreditInitFunc to NULL. The default credit distribution is only provided for simple
++ "fair" credit distribution without regard to any prioritization.
++
++ @example:
++ @see also:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
++void HTCSetCreditDistribution(HTC_HANDLE HTCHandle,
++ void *pCreditDistContext,
++ HTC_CREDIT_DIST_CALLBACK CreditDistFunc,
++ HTC_CREDIT_INIT_CALLBACK CreditInitFunc,
++ HTC_SERVICE_ID ServicePriorityOrder[],
++ int ListLength);
++/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++ @desc: Wait for the target to indicate the HTC layer is ready
++ @function name: HTCWaitTarget
++ @input: HTCHandle - HTC handle
++ @output:
++ @return:
++ @notes: This API blocks until the target responds with an HTC ready message.
++ The caller should not connect services until the target has indicated it is
++ ready.
++ @example:
++ @see also: HTCConnectService
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
++A_STATUS HTCWaitTarget(HTC_HANDLE HTCHandle);
++/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++ @desc: Start target service communications
++ @function name: HTCStart
++ @input: HTCHandle - HTC handle
++ @output:
++ @return:
++ @notes: This API indicates to the target that the service connection phase is complete
++ and the target can freely start all connected services. This API should only be
++ called AFTER all service connections have been made. TCStart will issue a
++ SETUP_COMPLETE message to the target to indicate that all service connections
++ have been made and the target can start communicating over the endpoints.
++ @example:
++ @see also: HTCConnectService
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
++A_STATUS HTCStart(HTC_HANDLE HTCHandle);
++/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++ @desc: Add receive packet to HTC
++ @function name: HTCAddReceivePkt
++ @input: HTCHandle - HTC handle
++ pPacket - HTC receive packet to add
++ @output:
++ @return: A_OK on success
++ @notes: user must supply HTC packets for capturing incomming HTC frames. The caller
++ must initialize each HTC packet using the SET_HTC_PACKET_INFO_RX_REFILL()
++ macro.
++ @example:
++ @see also:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
++A_STATUS HTCAddReceivePkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket);
++/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++ @desc: Connect to an HTC service
++ @function name: HTCConnectService
++ @input: HTCHandle - HTC handle
++ pReq - connection details
++ @output: pResp - connection response
++ @return:
++ @notes: Service connections must be performed before HTCStart. User provides callback handlers
++ for various endpoint events.
++ @example:
++ @see also: HTCStart
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
++A_STATUS HTCConnectService(HTC_HANDLE HTCHandle,
++ HTC_SERVICE_CONNECT_REQ *pReq,
++ HTC_SERVICE_CONNECT_RESP *pResp);
++/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++ @desc: Send an HTC packet
++ @function name: HTCSendPkt
++ @input: HTCHandle - HTC handle
++ pPacket - packet to send
++ @output:
++ @return: A_OK
++ @notes: Caller must initialize packet using SET_HTC_PACKET_INFO_TX() macro.
++ This interface is fully asynchronous. On error, HTC SendPkt will
++ call the registered Endpoint callback to cleanup the packet.
++ @example:
++ @see also: HTCFlushEndpoint
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
++A_STATUS HTCSendPkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket);
++/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++ @desc: Stop HTC service communications
++ @function name: HTCStop
++ @input: HTCHandle - HTC handle
++ @output:
++ @return:
++ @notes: HTC communications is halted. All receive and pending TX packets will
++ be flushed.
++ @example:
++ @see also:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
++void HTCStop(HTC_HANDLE HTCHandle);
++/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++ @desc: Shutdown HTC
++ @function name: HTCShutdown
++ @input:
++ @output:
++ @return:
++ @notes: This cleans up all resources allocated by HTCInit().
++ @example:
++ @see also: HTCInit
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
++void HTCShutDown(void);
++/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++ @desc: Flush pending TX packets
++ @function name: HTCFlushEndpoint
++ @input: HTCHandle - HTC handle
++ Endpoint - Endpoint to flush
++ Tag - flush tag
++ @output:
++ @return:
++ @notes: The Tag parameter is used to selectively flush packets with matching tags.
++ The value of 0 forces all packets to be flush regardless of tag.
++ @example:
++ @see also: HTCSendPkt
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
++void HTCFlushEndpoint(HTC_HANDLE HTCHandle, HTC_ENDPOINT_ID Endpoint, HTC_TX_TAG Tag);
++/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++ @desc: Dump credit distribution state
++ @function name: HTCDumpCreditStates
++ @input: HTCHandle - HTC handle
++ @output:
++ @return:
++ @notes: This dumps all credit distribution information to the debugger
++ @example:
++ @see also:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
++void HTCDumpCreditStates(HTC_HANDLE HTCHandle);
++/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++ @desc: Indicate a traffic activity change on an endpoint
++ @function name: HTCIndicateActivityChange
++ @input: HTCHandle - HTC handle
++ Endpoint - endpoint in which activity has changed
++ Active - TRUE if active, FALSE if it has become inactive
++ @output:
++ @return:
++ @notes: This triggers the registered credit distribution function to
++ re-adjust credits for active/inactive endpoints.
++ @example:
++ @see also:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
++void HTCIndicateActivityChange(HTC_HANDLE HTCHandle,
++ HTC_ENDPOINT_ID Endpoint,
++ A_BOOL Active);
++
++/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++ @desc: Get endpoint statistics
++ @function name: HTCGetEndpointStatistics
++ @input: HTCHandle - HTC handle
++ Endpoint - Endpoint identifier
++ Action - action to take with statistics
++ @output:
++ pStats - statistics that were sampled (can be NULL if Action is HTC_EP_STAT_CLEAR)
++
++ @return: TRUE if statistics profiling is enabled, otherwise FALSE.
++
++ @notes: Statistics is a compile-time option and this function may return FALSE
++ if HTC is not compiled with profiling.
++
++ The caller can specify the statistic "action" to take when sampling
++ the statistics. This includes:
++
++ HTC_EP_STAT_SAMPLE: The pStats structure is filled with the current values.
++ HTC_EP_STAT_SAMPLE_AND_CLEAR: The structure is filled and the current statistics
++ are cleared.
++ HTC_EP_STAT_CLEA : the statistics are cleared, the called can pass a NULL value for
++ pStats
++
++ @example:
++ @see also:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
++A_BOOL HTCGetEndpointStatistics(HTC_HANDLE HTCHandle,
++ HTC_ENDPOINT_ID Endpoint,
++ HTC_ENDPOINT_STAT_ACTION Action,
++ HTC_ENDPOINT_STATS *pStats);
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* _HTC_API_H_ */
+diff --git a/drivers/ar6000/include/htc_packet.h b/drivers/ar6000/include/htc_packet.h
+new file mode 100644
+index 0000000..9ce8718
+--- /dev/null
++++ b/drivers/ar6000/include/htc_packet.h
+@@ -0,0 +1,138 @@
++/*
++ *
++ * Copyright (c) 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 HTC_PACKET_H_
++#define HTC_PACKET_H_
++
++
++#include "dl_list.h"
++
++struct _HTC_PACKET;
++
++typedef void (* HTC_PACKET_COMPLETION)(void *,struct _HTC_PACKET *);
++
++typedef A_UINT16 HTC_TX_TAG;
++
++typedef struct _HTC_TX_PACKET_INFO {
++ HTC_TX_TAG Tag; /* tag used to selective flush packets */
++} HTC_TX_PACKET_INFO;
++
++#define HTC_TX_PACKET_TAG_ALL 0 /* a tag of zero is reserved and used to flush ALL packets */
++#define HTC_TX_PACKET_TAG_INTERNAL 1 /* internal tags start here */
++#define HTC_TX_PACKET_TAG_USER_DEFINED (HTC_TX_PACKET_TAG_INTERNAL + 9) /* user-defined tags start here */
++
++typedef struct _HTC_RX_PACKET_INFO {
++ A_UINT32 Unused; /* for future use and to make compilers happy */
++} HTC_RX_PACKET_INFO;
++
++/* wrapper around endpoint-specific packets */
++typedef struct _HTC_PACKET {
++ DL_LIST ListLink; /* double link */
++ void *pPktContext; /* caller's per packet specific context */
++
++ A_UINT8 *pBufferStart; /* the true buffer start , the caller can
++ store the real buffer start here. In
++ receive callbacks, the HTC layer sets pBuffer
++ to the start of the payload past the header. This
++ field allows the caller to reset pBuffer when it
++ recycles receive packets back to HTC */
++ /*
++ * Pointer to the start of the buffer. In the transmit
++ * direction this points to the start of the payload. In the
++ * receive direction, however, the buffer when queued up
++ * points to the start of the HTC header but when returned
++ * to the caller points to the start of the payload
++ */
++ A_UINT8 *pBuffer; /* payload start (RX/TX) */
++ A_UINT32 BufferLength; /* length of buffer */
++ A_UINT32 ActualLength; /* actual length of payload */
++ int Endpoint; /* endpoint that this packet was sent/recv'd from */
++ A_STATUS Status; /* completion status */
++ union {
++ HTC_TX_PACKET_INFO AsTx; /* Tx Packet specific info */
++ HTC_RX_PACKET_INFO AsRx; /* Rx Packet specific info */
++ } PktInfo;
++
++ /* the following fields are for internal HTC use */
++ HTC_PACKET_COMPLETION Completion; /* completion */
++ void *pContext; /* HTC private completion context */
++ A_UINT32 HTCReserved; /* reserved */
++} HTC_PACKET;
++
++
++
++#define COMPLETE_HTC_PACKET(p,status) \
++{ \
++ (p)->Status = (status); \
++ (p)->Completion((p)->pContext,(p)); \
++}
++
++#define INIT_HTC_PACKET_INFO(p,b,len) \
++{ \
++ (p)->pBufferStart = (b); \
++ (p)->BufferLength = (len); \
++}
++
++/* macro to set an initial RX packet for refilling HTC */
++#define SET_HTC_PACKET_INFO_RX_REFILL(p,c,b,len,ep) \
++{ \
++ (p)->pPktContext = (c); \
++ (p)->pBuffer = (b); \
++ (p)->pBufferStart = (b); \
++ (p)->BufferLength = (len); \
++ (p)->Endpoint = (ep); \
++}
++
++/* fast macro to recycle an RX packet that will be re-queued to HTC */
++#define HTC_PACKET_RESET_RX(p) \
++ (p)->pBuffer = (p)->pBufferStart
++
++/* macro to set packet parameters for TX */
++#define SET_HTC_PACKET_INFO_TX(p,c,b,len,ep,tag) \
++{ \
++ (p)->pPktContext = (c); \
++ (p)->pBuffer = (b); \
++ (p)->ActualLength = (len); \
++ (p)->Endpoint = (ep); \
++ (p)->PktInfo.AsTx.Tag = (tag); \
++}
++
++/* HTC Packet Queueing Macros */
++typedef DL_LIST HTC_PACKET_QUEUE;
++/* initialize queue */
++#define INIT_HTC_PACKET_QUEUE(pQ) DL_LIST_INIT((pQ))
++/* enqueue HTC packet to the tail of the queue */
++#define HTC_PACKET_ENQUEUE(pQ,p) DL_ListInsertTail((pQ),&(p)->ListLink)
++/* test if a queue is empty */
++#define HTC_QUEUE_EMPTY(pQ) DL_LIST_IS_EMPTY((pQ))
++/* get packet at head without removing it */
++#define HTC_GET_PKT_AT_HEAD(pQ) A_CONTAINING_STRUCT((DL_LIST_GET_ITEM_AT_HEAD(pQ)),HTC_PACKET,ListLink);
++/* remove a packet from the current list it is linked to */
++#define HTC_PACKET_REMOVE(p) DL_ListRemove(&(p)->ListLink)
++
++/* dequeue an HTC packet from the head of the queue */
++static INLINE HTC_PACKET *HTC_PACKET_DEQUEUE(HTC_PACKET_QUEUE *queue) {
++ DL_LIST *pItem = DL_ListRemoveItemFromHead(queue);
++ if (pItem != NULL) {
++ return A_CONTAINING_STRUCT(pItem, HTC_PACKET, ListLink);
++ }
++ return NULL;
++}
++
++#endif /*HTC_PACKET_H_*/
+diff --git a/drivers/ar6000/include/htc_services.h b/drivers/ar6000/include/htc_services.h
+new file mode 100644
+index 0000000..fc6fc29
+--- /dev/null
++++ b/drivers/ar6000/include/htc_services.h
+@@ -0,0 +1,37 @@
++/*
++ * Copyright (c) 2007 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ * $ATH_LICENSE_HOSTSDK0_C$
++ *
++ */
++
++#ifndef __HTC_SERVICES_H__
++#define __HTC_SERVICES_H__
++
++/* Current service IDs */
++
++typedef enum {
++ RSVD_SERVICE_GROUP = 0,
++ WMI_SERVICE_GROUP = 1,
++
++ HTC_TEST_GROUP = 254,
++ HTC_SERVICE_GROUP_LAST = 255
++}HTC_SERVICE_GROUP_IDS;
++
++#define MAKE_SERVICE_ID(group,index) \
++ (int)(((int)group << 8) | (int)(index))
++
++/* NOTE: service ID of 0x0000 is reserved and should never be used */
++#define HTC_CTRL_RSVD_SVC MAKE_SERVICE_ID(RSVD_SERVICE_GROUP,1)
++#define WMI_CONTROL_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,0)
++#define WMI_DATA_BE_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,1)
++#define WMI_DATA_BK_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,2)
++#define WMI_DATA_VI_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,3)
++#define WMI_DATA_VO_SVC MAKE_SERVICE_ID(WMI_SERVICE_GROUP,4)
++#define WMI_MAX_SERVICES 5
++
++/* raw stream service (i.e. flash, tcmd, calibration apps) */
++#define HTC_RAW_STREAMS_SVC MAKE_SERVICE_ID(HTC_TEST_GROUP,0)
++
++#endif /*HTC_SERVICES_H_*/
+diff --git a/drivers/ar6000/include/ieee80211.h b/drivers/ar6000/include/ieee80211.h
+new file mode 100644
+index 0000000..7090040
+--- /dev/null
++++ b/drivers/ar6000/include/ieee80211.h
+@@ -0,0 +1,342 @@
++/*-
++ * Copyright (c) 2001 Atsushi Onoe
++ * Copyright (c) 2002-2004 Sam Leffler, Errno Consulting
++ * Copyright (c) 2006 Atheros Communications, Inc.
++ *
++ * Wireless Network driver for Atheros AR6001
++ * All rights reserved.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ */
++#ifndef _NET80211_IEEE80211_H_
++#define _NET80211_IEEE80211_H_
++
++#include "athstartpack.h"
++
++/*
++ * 802.11 protocol definitions.
++ */
++
++#define IEEE80211_ADDR_LEN 6 /* size of 802.11 address */
++/* is 802.11 address multicast/broadcast? */
++#define IEEE80211_IS_MULTICAST(_a) (*(_a) & 0x01)
++#define IEEE80211_ADDR_EQ(addr1, addr2) \
++ (A_MEMCMP(addr1, addr2, IEEE80211_ADDR_LEN) == 0)
++
++#define IEEE80211_KEYBUF_SIZE 16
++#define IEEE80211_MICBUF_SIZE (8+8) /* space for both tx and rx */
++
++/*
++ * NB: these values are ordered carefully; there are lots of
++ * of implications in any reordering. In particular beware
++ * that 4 is not used to avoid conflicting with IEEE80211_F_PRIVACY.
++ */
++#define IEEE80211_CIPHER_WEP 0
++#define IEEE80211_CIPHER_TKIP 1
++#define IEEE80211_CIPHER_AES_OCB 2
++#define IEEE80211_CIPHER_AES_CCM 3
++#define IEEE80211_CIPHER_CKIP 5
++#define IEEE80211_CIPHER_CCKM_KRK 6
++#define IEEE80211_CIPHER_NONE 7 /* pseudo value */
++
++#define IEEE80211_CIPHER_MAX (IEEE80211_CIPHER_NONE+1)
++
++#define IEEE80211_IS_VALID_WEP_CIPHER_LEN(len) \
++ (((len) == 5) || ((len) == 13) || ((len) == 16))
++
++
++
++/*
++ * generic definitions for IEEE 802.11 frames
++ */
++PREPACK struct ieee80211_frame {
++ A_UINT8 i_fc[2];
++ A_UINT8 i_dur[2];
++ A_UINT8 i_addr1[IEEE80211_ADDR_LEN];
++ A_UINT8 i_addr2[IEEE80211_ADDR_LEN];
++ A_UINT8 i_addr3[IEEE80211_ADDR_LEN];
++ A_UINT8 i_seq[2];
++ /* possibly followed by addr4[IEEE80211_ADDR_LEN]; */
++ /* see below */
++} POSTPACK;
++
++#define IEEE80211_FC0_VERSION_MASK 0x03
++#define IEEE80211_FC0_VERSION_SHIFT 0
++#define IEEE80211_FC0_VERSION_0 0x00
++#define IEEE80211_FC0_TYPE_MASK 0x0c
++#define IEEE80211_FC0_TYPE_SHIFT 2
++#define IEEE80211_FC0_TYPE_MGT 0x00
++#define IEEE80211_FC0_TYPE_CTL 0x04
++#define IEEE80211_FC0_TYPE_DATA 0x08
++
++#define IEEE80211_FC0_SUBTYPE_MASK 0xf0
++#define IEEE80211_FC0_SUBTYPE_SHIFT 4
++/* for TYPE_MGT */
++#define IEEE80211_FC0_SUBTYPE_ASSOC_REQ 0x00
++#define IEEE80211_FC0_SUBTYPE_ASSOC_RESP 0x10
++#define IEEE80211_FC0_SUBTYPE_REASSOC_REQ 0x20
++#define IEEE80211_FC0_SUBTYPE_REASSOC_RESP 0x30
++#define IEEE80211_FC0_SUBTYPE_PROBE_REQ 0x40
++#define IEEE80211_FC0_SUBTYPE_PROBE_RESP 0x50
++#define IEEE80211_FC0_SUBTYPE_BEACON 0x80
++#define IEEE80211_FC0_SUBTYPE_ATIM 0x90
++#define IEEE80211_FC0_SUBTYPE_DISASSOC 0xa0
++#define IEEE80211_FC0_SUBTYPE_AUTH 0xb0
++#define IEEE80211_FC0_SUBTYPE_DEAUTH 0xc0
++/* for TYPE_CTL */
++#define IEEE80211_FC0_SUBTYPE_PS_POLL 0xa0
++#define IEEE80211_FC0_SUBTYPE_RTS 0xb0
++#define IEEE80211_FC0_SUBTYPE_CTS 0xc0
++#define IEEE80211_FC0_SUBTYPE_ACK 0xd0
++#define IEEE80211_FC0_SUBTYPE_CF_END 0xe0
++#define IEEE80211_FC0_SUBTYPE_CF_END_ACK 0xf0
++/* for TYPE_DATA (bit combination) */
++#define IEEE80211_FC0_SUBTYPE_DATA 0x00
++#define IEEE80211_FC0_SUBTYPE_CF_ACK 0x10
++#define IEEE80211_FC0_SUBTYPE_CF_POLL 0x20
++#define IEEE80211_FC0_SUBTYPE_CF_ACPL 0x30
++#define IEEE80211_FC0_SUBTYPE_NODATA 0x40
++#define IEEE80211_FC0_SUBTYPE_CFACK 0x50
++#define IEEE80211_FC0_SUBTYPE_CFPOLL 0x60
++#define IEEE80211_FC0_SUBTYPE_CF_ACK_CF_ACK 0x70
++#define IEEE80211_FC0_SUBTYPE_QOS 0x80
++#define IEEE80211_FC0_SUBTYPE_QOS_NULL 0xc0
++
++#define IEEE80211_FC1_DIR_MASK 0x03
++#define IEEE80211_FC1_DIR_NODS 0x00 /* STA->STA */
++#define IEEE80211_FC1_DIR_TODS 0x01 /* STA->AP */
++#define IEEE80211_FC1_DIR_FROMDS 0x02 /* AP ->STA */
++#define IEEE80211_FC1_DIR_DSTODS 0x03 /* AP ->AP */
++
++#define IEEE80211_FC1_MORE_FRAG 0x04
++#define IEEE80211_FC1_RETRY 0x08
++#define IEEE80211_FC1_PWR_MGT 0x10
++#define IEEE80211_FC1_MORE_DATA 0x20
++#define IEEE80211_FC1_WEP 0x40
++#define IEEE80211_FC1_ORDER 0x80
++
++#define IEEE80211_SEQ_FRAG_MASK 0x000f
++#define IEEE80211_SEQ_FRAG_SHIFT 0
++#define IEEE80211_SEQ_SEQ_MASK 0xfff0
++#define IEEE80211_SEQ_SEQ_SHIFT 4
++
++#define IEEE80211_NWID_LEN 32
++
++/*
++ * 802.11 rate set.
++ */
++#define IEEE80211_RATE_SIZE 8 /* 802.11 standard */
++#define IEEE80211_RATE_MAXSIZE 15 /* max rates we'll handle */
++
++#define WMM_NUM_AC 4 /* 4 AC categories */
++
++#define WMM_PARAM_ACI_M 0x60 /* Mask for ACI field */
++#define WMM_PARAM_ACI_S 5 /* Shift for ACI field */
++#define WMM_PARAM_ACM_M 0x10 /* Mask for ACM bit */
++#define WMM_PARAM_ACM_S 4 /* Shift for ACM bit */
++#define WMM_PARAM_AIFSN_M 0x0f /* Mask for aifsn field */
++#define WMM_PARAM_LOGCWMIN_M 0x0f /* Mask for CwMin field (in log) */
++#define WMM_PARAM_LOGCWMAX_M 0xf0 /* Mask for CwMax field (in log) */
++#define WMM_PARAM_LOGCWMAX_S 4 /* Shift for CwMax field */
++
++#define WMM_AC_TO_TID(_ac) ( \
++ ((_ac) == WMM_AC_VO) ? 6 : \
++ ((_ac) == WMM_AC_VI) ? 5 : \
++ ((_ac) == WMM_AC_BK) ? 1 : \
++ 0)
++
++#define TID_TO_WMM_AC(_tid) ( \
++ ((_tid) < 1) ? WMM_AC_BE : \
++ ((_tid) < 3) ? WMM_AC_BK : \
++ ((_tid) < 6) ? WMM_AC_VI : \
++ WMM_AC_VO)
++/*
++ * Management information element payloads.
++ */
++
++enum {
++ IEEE80211_ELEMID_SSID = 0,
++ IEEE80211_ELEMID_RATES = 1,
++ IEEE80211_ELEMID_FHPARMS = 2,
++ IEEE80211_ELEMID_DSPARMS = 3,
++ IEEE80211_ELEMID_CFPARMS = 4,
++ IEEE80211_ELEMID_TIM = 5,
++ IEEE80211_ELEMID_IBSSPARMS = 6,
++ IEEE80211_ELEMID_COUNTRY = 7,
++ IEEE80211_ELEMID_CHALLENGE = 16,
++ /* 17-31 reserved for challenge text extension */
++ IEEE80211_ELEMID_PWRCNSTR = 32,
++ IEEE80211_ELEMID_PWRCAP = 33,
++ IEEE80211_ELEMID_TPCREQ = 34,
++ IEEE80211_ELEMID_TPCREP = 35,
++ IEEE80211_ELEMID_SUPPCHAN = 36,
++ IEEE80211_ELEMID_CHANSWITCH = 37,
++ IEEE80211_ELEMID_MEASREQ = 38,
++ IEEE80211_ELEMID_MEASREP = 39,
++ IEEE80211_ELEMID_QUIET = 40,
++ IEEE80211_ELEMID_IBSSDFS = 41,
++ IEEE80211_ELEMID_ERP = 42,
++ IEEE80211_ELEMID_RSN = 48,
++ IEEE80211_ELEMID_XRATES = 50,
++ IEEE80211_ELEMID_TPC = 150,
++ IEEE80211_ELEMID_CCKM = 156,
++ IEEE80211_ELEMID_VENDOR = 221, /* vendor private */
++};
++
++#define ATH_OUI 0x7f0300 /* Atheros OUI */
++#define ATH_OUI_TYPE 0x01
++#define ATH_OUI_SUBTYPE 0x01
++#define ATH_OUI_VERSION 0x00
++
++#define WPA_OUI 0xf25000
++#define WPA_OUI_TYPE 0x01
++#define WPA_VERSION 1 /* current supported version */
++
++#define WPA_CSE_NULL 0x00
++#define WPA_CSE_WEP40 0x01
++#define WPA_CSE_TKIP 0x02
++#define WPA_CSE_CCMP 0x04
++#define WPA_CSE_WEP104 0x05
++
++#define WPA_ASE_NONE 0x00
++#define WPA_ASE_8021X_UNSPEC 0x01
++#define WPA_ASE_8021X_PSK 0x02
++
++#define RSN_OUI 0xac0f00
++#define RSN_VERSION 1 /* current supported version */
++
++#define RSN_CSE_NULL 0x00
++#define RSN_CSE_WEP40 0x01
++#define RSN_CSE_TKIP 0x02
++#define RSN_CSE_WRAP 0x03
++#define RSN_CSE_CCMP 0x04
++#define RSN_CSE_WEP104 0x05
++
++#define RSN_ASE_NONE 0x00
++#define RSN_ASE_8021X_UNSPEC 0x01
++#define RSN_ASE_8021X_PSK 0x02
++
++#define RSN_CAP_PREAUTH 0x01
++
++#define WMM_OUI 0xf25000
++#define WMM_OUI_TYPE 0x02
++#define WMM_INFO_OUI_SUBTYPE 0x00
++#define WMM_PARAM_OUI_SUBTYPE 0x01
++#define WMM_VERSION 1
++
++/* WMM stream classes */
++#define WMM_NUM_AC 4
++#define WMM_AC_BE 0 /* best effort */
++#define WMM_AC_BK 1 /* background */
++#define WMM_AC_VI 2 /* video */
++#define WMM_AC_VO 3 /* voice */
++
++/* TSPEC related */
++#define ACTION_CATEGORY_CODE_TSPEC 17
++#define ACTION_CODE_TSPEC_ADDTS 0
++#define ACTION_CODE_TSPEC_ADDTS_RESP 1
++#define ACTION_CODE_TSPEC_DELTS 2
++
++typedef enum {
++ TSPEC_STATUS_CODE_ADMISSION_ACCEPTED = 0,
++ TSPEC_STATUS_CODE_ADDTS_INVALID_PARAMS = 0x1,
++ TSPEC_STATUS_CODE_ADDTS_REQUEST_REFUSED = 0x3,
++ TSPEC_STATUS_CODE_UNSPECIFIED_QOS_RELATED_FAILURE = 0xC8,
++ TSPEC_STATUS_CODE_REQUESTED_REFUSED_POLICY_CONFIGURATION = 0xC9,
++ TSPEC_STATUS_CODE_INSUFFCIENT_BANDWIDTH = 0xCA,
++ TSPEC_STATUS_CODE_INVALID_PARAMS = 0xCB,
++ TSPEC_STATUS_CODE_DELTS_SENT = 0x30,
++ TSPEC_STATUS_CODE_DELTS_RECV = 0x31,
++} TSPEC_STATUS_CODE;
++
++/*
++ * WMM/802.11e Tspec Element
++ */
++typedef PREPACK struct wmm_tspec_ie_t {
++ A_UINT8 elementId;
++ A_UINT8 len;
++ A_UINT8 oui[3];
++ A_UINT8 ouiType;
++ A_UINT8 ouiSubType;
++ A_UINT8 version;
++ A_UINT16 tsInfo_info;
++ A_UINT8 tsInfo_reserved;
++ A_UINT16 nominalMSDU;
++ A_UINT16 maxMSDU;
++ A_UINT32 minServiceInt;
++ A_UINT32 maxServiceInt;
++ A_UINT32 inactivityInt;
++ A_UINT32 suspensionInt;
++ A_UINT32 serviceStartTime;
++ A_UINT32 minDataRate;
++ A_UINT32 meanDataRate;
++ A_UINT32 peakDataRate;
++ A_UINT32 maxBurstSize;
++ A_UINT32 delayBound;
++ A_UINT32 minPhyRate;
++ A_UINT16 sba;
++ A_UINT16 mediumTime;
++} POSTPACK WMM_TSPEC_IE;
++
++
++/*
++ * BEACON management packets
++ *
++ * octet timestamp[8]
++ * octet beacon interval[2]
++ * octet capability information[2]
++ * information element
++ * octet elemid
++ * octet length
++ * octet information[length]
++ */
++
++#define IEEE80211_BEACON_INTERVAL(beacon) \
++ ((beacon)[8] | ((beacon)[9] << 8))
++#define IEEE80211_BEACON_CAPABILITY(beacon) \
++ ((beacon)[10] | ((beacon)[11] << 8))
++
++#define IEEE80211_CAPINFO_ESS 0x0001
++#define IEEE80211_CAPINFO_IBSS 0x0002
++#define IEEE80211_CAPINFO_CF_POLLABLE 0x0004
++#define IEEE80211_CAPINFO_CF_POLLREQ 0x0008
++#define IEEE80211_CAPINFO_PRIVACY 0x0010
++#define IEEE80211_CAPINFO_SHORT_PREAMBLE 0x0020
++#define IEEE80211_CAPINFO_PBCC 0x0040
++#define IEEE80211_CAPINFO_CHNL_AGILITY 0x0080
++/* bits 8-9 are reserved */
++#define IEEE80211_CAPINFO_SHORT_SLOTTIME 0x0400
++#define IEEE80211_CAPINFO_APSD 0x0800
++/* bit 12 is reserved */
++#define IEEE80211_CAPINFO_DSSSOFDM 0x2000
++/* bits 14-15 are reserved */
++
++/*
++ * Authentication Modes
++ */
++
++enum ieee80211_authmode {
++ IEEE80211_AUTH_NONE = 0,
++ IEEE80211_AUTH_OPEN = 1,
++ IEEE80211_AUTH_SHARED = 2,
++ IEEE80211_AUTH_8021X = 3,
++ IEEE80211_AUTH_AUTO = 4, /* auto-select/accept */
++ /* NB: these are used only for ioctls */
++ IEEE80211_AUTH_WPA = 5, /* WPA/RSN w/ 802.1x */
++ IEEE80211_AUTH_WPA_PSK = 6, /* WPA/RSN w/ PSK */
++ IEEE80211_AUTH_WPA_CCKM = 7, /* WPA/RSN IE w/ CCKM */
++};
++
++#include "athendpack.h"
++
++#endif /* _NET80211_IEEE80211_H_ */
+diff --git a/drivers/ar6000/include/ieee80211_ioctl.h b/drivers/ar6000/include/ieee80211_ioctl.h
+new file mode 100644
+index 0000000..dab6747
+--- /dev/null
++++ b/drivers/ar6000/include/ieee80211_ioctl.h
+@@ -0,0 +1,163 @@
++/*
++ * Copyright (c) 2004-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.
++ *
++ *
++ *
++ *
++ * $Id: //depot/sw/releases/olca2.0-GPL/host/os/linux/include/ieee80211_ioctl.h#1 $
++ */
++
++#ifndef _IEEE80211_IOCTL_H_
++#define _IEEE80211_IOCTL_H_
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++/*
++ * Extracted from the MADWIFI net80211/ieee80211_ioctl.h
++ */
++
++/*
++ * WPA/RSN get/set key request. Specify the key/cipher
++ * type and whether the key is to be used for sending and/or
++ * receiving. The key index should be set only when working
++ * with global keys (use IEEE80211_KEYIX_NONE for ``no index'').
++ * Otherwise a unicast/pairwise key is specified by the bssid
++ * (on a station) or mac address (on an ap). They key length
++ * must include any MIC key data; otherwise it should be no
++ more than IEEE80211_KEYBUF_SIZE.
++ */
++struct ieee80211req_key {
++ u_int8_t ik_type; /* key/cipher type */
++ u_int8_t ik_pad;
++ u_int16_t ik_keyix; /* key index */
++ u_int8_t ik_keylen; /* key length in bytes */
++ u_int8_t ik_flags;
++#define IEEE80211_KEY_XMIT 0x01
++#define IEEE80211_KEY_RECV 0x02
++#define IEEE80211_KEY_DEFAULT 0x80 /* default xmit key */
++ u_int8_t ik_macaddr[IEEE80211_ADDR_LEN];
++ u_int64_t ik_keyrsc; /* key receive sequence counter */
++ u_int64_t ik_keytsc; /* key transmit sequence counter */
++ u_int8_t ik_keydata[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE];
++};
++/*
++ * Delete a key either by index or address. Set the index
++ * to IEEE80211_KEYIX_NONE when deleting a unicast key.
++ */
++struct ieee80211req_del_key {
++ u_int8_t idk_keyix; /* key index */
++ u_int8_t idk_macaddr[IEEE80211_ADDR_LEN];
++};
++/*
++ * MLME state manipulation request. IEEE80211_MLME_ASSOC
++ * only makes sense when operating as a station. The other
++ * requests can be used when operating as a station or an
++ * ap (to effect a station).
++ */
++struct ieee80211req_mlme {
++ u_int8_t im_op; /* operation to perform */
++#define IEEE80211_MLME_ASSOC 1 /* associate station */
++#define IEEE80211_MLME_DISASSOC 2 /* disassociate station */
++#define IEEE80211_MLME_DEAUTH 3 /* deauthenticate station */
++#define IEEE80211_MLME_AUTHORIZE 4 /* authorize station */
++#define IEEE80211_MLME_UNAUTHORIZE 5 /* unauthorize station */
++ u_int16_t im_reason; /* 802.11 reason code */
++ u_int8_t im_macaddr[IEEE80211_ADDR_LEN];
++};
++
++struct ieee80211req_addpmkid {
++ u_int8_t pi_bssid[IEEE80211_ADDR_LEN];
++ u_int8_t pi_enable;
++ u_int8_t pi_pmkid[16];
++};
++
++#define AUTH_ALG_OPEN_SYSTEM 0x01
++#define AUTH_ALG_SHARED_KEY 0x02
++#define AUTH_ALG_LEAP 0x04
++
++struct ieee80211req_authalg {
++ u_int8_t auth_alg;
++};
++
++/*
++ * Request to add an IE to a Management Frame
++ */
++enum{
++ IEEE80211_APPIE_FRAME_BEACON = 0,
++ IEEE80211_APPIE_FRAME_PROBE_REQ = 1,
++ IEEE80211_APPIE_FRAME_PROBE_RESP = 2,
++ IEEE80211_APPIE_FRAME_ASSOC_REQ = 3,
++ IEEE80211_APPIE_FRAME_ASSOC_RESP = 4,
++ IEEE80211_APPIE_NUM_OF_FRAME = 5
++};
++
++/*
++ * The Maximum length of the IE that can be added to a Management frame
++ */
++#define IEEE80211_APPIE_FRAME_MAX_LEN 78
++
++struct ieee80211req_getset_appiebuf {
++ u_int32_t app_frmtype; /* management frame type for which buffer is added */
++ u_int32_t app_buflen; /*application supplied buffer length */
++ u_int8_t app_buf[];
++};
++
++/*
++ * The following definitions are used by an application to set filter
++ * for receiving management frames
++ */
++enum {
++ IEEE80211_FILTER_TYPE_BEACON = 0x1,
++ IEEE80211_FILTER_TYPE_PROBE_REQ = 0x2,
++ IEEE80211_FILTER_TYPE_PROBE_RESP = 0x4,
++ IEEE80211_FILTER_TYPE_ASSOC_REQ = 0x8,
++ IEEE80211_FILTER_TYPE_ASSOC_RESP = 0x10,
++ IEEE80211_FILTER_TYPE_AUTH = 0x20,
++ IEEE80211_FILTER_TYPE_DEAUTH = 0x40,
++ IEEE80211_FILTER_TYPE_DISASSOC = 0x80,
++ IEEE80211_FILTER_TYPE_ALL = 0xFF /* used to check the valid filter bits */
++};
++
++struct ieee80211req_set_filter {
++ u_int32_t app_filterype; /* management frame filter type */
++};
++
++enum {
++ IEEE80211_PARAM_AUTHMODE = 3, /* Authentication Mode */
++ IEEE80211_PARAM_MCASTCIPHER = 5,
++ IEEE80211_PARAM_MCASTKEYLEN = 6, /* multicast key length */
++ IEEE80211_PARAM_UCASTCIPHER = 8,
++ IEEE80211_PARAM_UCASTKEYLEN = 9, /* unicast key length */
++ IEEE80211_PARAM_WPA = 10, /* WPA mode (0,1,2) */
++ IEEE80211_PARAM_ROAMING = 12, /* roaming mode */
++ IEEE80211_PARAM_PRIVACY = 13, /* privacy invoked */
++ IEEE80211_PARAM_COUNTERMEASURES = 14, /* WPA/TKIP countermeasures */
++ IEEE80211_PARAM_DROPUNENCRYPTED = 15, /* discard unencrypted frames */
++};
++
++/*
++ * Values for IEEE80211_PARAM_WPA
++ */
++#define WPA_MODE_WPA1 1
++#define WPA_MODE_WPA2 2
++#define WPA_MODE_AUTO 3
++#define WPA_MODE_NONE 4
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* _IEEE80211_IOCTL_H_ */
+diff --git a/drivers/ar6000/include/ieee80211_node.h b/drivers/ar6000/include/ieee80211_node.h
+new file mode 100644
+index 0000000..46b613c
+--- /dev/null
++++ b/drivers/ar6000/include/ieee80211_node.h
+@@ -0,0 +1,77 @@
++/*-
++ * Copyright (c) 2001 Atsushi Onoe
++ * Copyright (c) 2002-2004 Sam Leffler, Errno Consulting
++ * Copyright (c) 2006 Atheros Communications, Inc.
++ *
++ * Wireless Network driver for Atheros AR6001
++ * All rights reserved.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ */
++#ifndef _IEEE80211_NODE_H_
++#define _IEEE80211_NODE_H_
++
++/*
++ * Node locking definitions.
++ */
++#define IEEE80211_NODE_LOCK_INIT(_nt) A_MUTEX_INIT(&(_nt)->nt_nodelock)
++#define IEEE80211_NODE_LOCK_DESTROY(_nt)
++#define IEEE80211_NODE_LOCK(_nt) A_MUTEX_LOCK(&(_nt)->nt_nodelock)
++#define IEEE80211_NODE_UNLOCK(_nt) A_MUTEX_UNLOCK(&(_nt)->nt_nodelock)
++#define IEEE80211_NODE_LOCK_BH(_nt) A_MUTEX_LOCK(&(_nt)->nt_nodelock)
++#define IEEE80211_NODE_UNLOCK_BH(_nt) A_MUTEX_UNLOCK(&(_nt)->nt_nodelock)
++#define IEEE80211_NODE_LOCK_ASSERT(_nt)
++
++/*
++ * Node reference counting definitions.
++ *
++ * ieee80211_node_initref initialize the reference count to 1
++ * ieee80211_node_incref add a reference
++ * ieee80211_node_decref remove a reference
++ * ieee80211_node_dectestref remove a reference and return 1 if this
++ * is the last reference, otherwise 0
++ * ieee80211_node_refcnt reference count for printing (only)
++ */
++#define ieee80211_node_initref(_ni) ((_ni)->ni_refcnt = 1)
++#define ieee80211_node_incref(_ni) ((_ni)->ni_refcnt++)
++#define ieee80211_node_decref(_ni) ((_ni)->ni_refcnt--)
++#define ieee80211_node_dectestref(_ni) (((_ni)->ni_refcnt--) == 0)
++#define ieee80211_node_refcnt(_ni) ((_ni)->ni_refcnt)
++
++#define IEEE80211_NODE_HASHSIZE 32
++/* simple hash is enough for variation of macaddr */
++#define IEEE80211_NODE_HASH(addr) \
++ (((const A_UINT8 *)(addr))[IEEE80211_ADDR_LEN - 1] % \
++ IEEE80211_NODE_HASHSIZE)
++
++/*
++ * Table of ieee80211_node instances. Each ieee80211com
++ * has at least one for holding the scan candidates.
++ * When operating as an access point or in ibss mode there
++ * is a second table for associated stations or neighbors.
++ */
++struct ieee80211_node_table {
++ void *nt_wmip; /* back reference */
++ A_MUTEX_T nt_nodelock; /* on node table */
++ struct bss *nt_node_first; /* information of all nodes */
++ struct bss *nt_node_last; /* information of all nodes */
++ struct bss *nt_hash[IEEE80211_NODE_HASHSIZE];
++ const char *nt_name; /* for debugging */
++ A_UINT32 nt_scangen; /* gen# for timeout scan */
++ A_TIMER nt_inact_timer;
++ A_UINT8 isTimerArmed; /* is the node timer armed */
++};
++
++#define WLAN_NODE_INACT_TIMEOUT_MSEC 10000
++
++#endif /* _IEEE80211_NODE_H_ */
+diff --git a/drivers/ar6000/include/ini_dset.h b/drivers/ar6000/include/ini_dset.h
+new file mode 100644
+index 0000000..410f2b52
+--- /dev/null
++++ b/drivers/ar6000/include/ini_dset.h
+@@ -0,0 +1,40 @@
++/*
++ * Copyright (c) 2004-2007 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ * $ATH_LICENSE_HOSTSDK0_C$
++ *
++ */
++#ifndef _INI_DSET_H_
++#define _INI_DSET_H_
++
++/*
++ * Each of these represents a WHAL INI table, which consists
++ * of an "address column" followed by 1 or more "value columns".
++ *
++ * Software uses the base WHAL_INI_DATA_ID+column to access a
++ * DataSet that holds a particular column of data.
++ */
++typedef enum {
++ WHAL_INI_DATA_ID_NULL =0,
++ WHAL_INI_DATA_ID_MODE_SPECIFIC =1, /* 2,3 */
++ WHAL_INI_DATA_ID_COMMON =4, /* 5 */
++ WHAL_INI_DATA_ID_BB_RFGAIN =6, /* 7,8 */
++ WHAL_INI_DATA_ID_ANALOG_BANK1 =9, /* 10 */
++ WHAL_INI_DATA_ID_ANALOG_BANK2 =11, /* 12 */
++ WHAL_INI_DATA_ID_ANALOG_BANK3 =13, /* 14, 15 */
++ WHAL_INI_DATA_ID_ANALOG_BANK6 =16, /* 17, 18 */
++ WHAL_INI_DATA_ID_ANALOG_BANK7 =19, /* 20 */
++ WHAL_INI_DATA_ID_MODE_OVERRIDES =21, /* 22,23 */
++ WHAL_INI_DATA_ID_COMMON_OVERRIDES =24, /* 25 */
++
++ WHAL_INI_DATA_ID_MAX =25
++} WHAL_INI_DATA_ID;
++
++typedef PREPACK struct {
++ A_UINT16 freqIndex; // 1 - A mode 2 - B or G mode 0 - common
++ A_UINT16 offset;
++ A_UINT32 newValue;
++} POSTPACK INI_DSET_REG_OVERRIDE;
++
++#endif
+diff --git a/drivers/ar6000/include/regDb.h b/drivers/ar6000/include/regDb.h
+new file mode 100644
+index 0000000..b3f665f
+--- /dev/null
++++ b/drivers/ar6000/include/regDb.h
+@@ -0,0 +1,19 @@
++/*
++ * Copyright (c) 2005 Atheros Communications, Inc.
++ * All rights reserved.
++ *
++ *
++ * $ATH_LICENSE_HOSTSDK0_C$
++ *
++ * This module contains the header files for regulatory module,
++ * which include the DB schema and DB values.
++ * $Id:
++ */
++
++#ifndef __REG_DB_H__
++#define __REG_DB_H__
++
++#include "./regulatory/reg_dbschema.h"
++#include "./regulatory/reg_dbvalues.h"
++
++#endif /* __REG_DB_H__ */
+diff --git a/drivers/ar6000/include/regdump.h b/drivers/ar6000/include/regdump.h
+new file mode 100644
+index 0000000..0106825
+--- /dev/null
++++ b/drivers/ar6000/include/regdump.h
+@@ -0,0 +1,33 @@
++#ifndef __REGDUMP_H__
++#define __REGDUMP_H__
++/*
++ * Copyright (c) 2004-2007 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ * $ATH_LICENSE_HOSTSDK0_C$
++ *
++ */
++#if defined(AR6001)
++#include "AR6001/AR6001_regdump.h"
++#endif
++#if defined(AR6002)
++#include "AR6002/AR6002_regdump.h"
++#endif
++
++#if !defined(__ASSEMBLER__)
++/*
++ * Target CPU state at the time of failure is reflected
++ * in a register dump, which the Host can fetch through
++ * the diagnostic window.
++ */
++struct register_dump_s {
++ A_UINT32 target_id; /* Target ID */
++ A_UINT32 assline; /* Line number (if assertion failure) */
++ A_UINT32 pc; /* Program Counter at time of exception */
++ A_UINT32 badvaddr; /* Virtual address causing exception */
++ CPU_exception_frame_t exc_frame; /* CPU-specific exception info */
++
++ /* Could copy top of stack here, too.... */
++};
++#endif /* __ASSEMBLER__ */
++#endif /* __REGDUMP_H__ */
+diff --git a/drivers/ar6000/include/targaddrs.h b/drivers/ar6000/include/targaddrs.h
+new file mode 100644
+index 0000000..da2a650
+--- /dev/null
++++ b/drivers/ar6000/include/targaddrs.h
+@@ -0,0 +1,158 @@
++/*
++ * Copyright (c) 2004-2007 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ * $ATH_LICENSE_HOSTSDK0_C$
++ *
++ */
++
++#ifndef __TARGADDRS_H__
++#define __TARGADDRS_H__
++#if defined(AR6001)
++#include "AR6001/addrs.h"
++#endif
++#if defined(AR6002)
++#include "AR6002/addrs.h"
++#endif
++
++/*
++ * AR6K option bits, to enable/disable various features.
++ * By default, all option bits are 0.
++ * These bits can be set in LOCAL_SCRATCH register 0.
++ */
++#define AR6K_OPTION_BMI_DISABLE 0x01 /* Disable BMI comm with Host */
++#define AR6K_OPTION_SERIAL_ENABLE 0x02 /* Enable serial port msgs */
++#define AR6K_OPTION_WDT_DISABLE 0x04 /* WatchDog Timer override */
++#define AR6K_OPTION_SLEEP_DISABLE 0x08 /* Disable system sleep */
++#define AR6K_OPTION_STOP_BOOT 0x10 /* Stop boot processes (for ATE) */
++#define AR6K_OPTION_ENABLE_NOANI 0x20 /* Operate without ANI */
++#define AR6K_OPTION_DSET_DISABLE 0x40 /* Ignore DataSets */
++#define AR6K_OPTION_IGNORE_FLASH 0x80 /* Ignore flash during bootup */
++
++/*
++ * xxx_HOST_INTEREST_ADDRESS is the address in Target RAM of the
++ * host_interest structure. It must match the address of the _host_interest
++ * symbol (see linker script).
++ *
++ * Host Interest is shared between Host and Target in order to coordinate
++ * between the two, and is intended to remain constant (with additions only
++ * at the end) across software releases.
++ */
++#define AR6001_HOST_INTEREST_ADDRESS 0x80000600
++#define AR6002_HOST_INTEREST_ADDRESS 0x00500400
++
++#define HOST_INTEREST_MAX_SIZE 0x100
++
++#if !defined(__ASSEMBLER__)
++struct register_dump_s;
++struct dbglog_hdr_s;
++
++/*
++ * These are items that the Host may need to access
++ * via BMI or via the Diagnostic Window. The position
++ * of items in this structure must remain constant
++ * across firmware revisions!
++ *
++ * Types for each item must be fixed size across
++ * target and host platforms.
++ *
++ * More items may be added at the end.
++ */
++struct host_interest_s {
++ /*
++ * Pointer to application-defined area, if any.
++ * Set by Target application during startup.
++ */
++ A_UINT32 hi_app_host_interest; /* 0x00 */
++
++ /* Pointer to register dump area, valid after Target crash. */
++ A_UINT32 hi_failure_state; /* 0x04 */
++
++ /* Pointer to debug logging header */
++ A_UINT32 hi_dbglog_hdr; /* 0x08 */
++
++ /* Indicates whether or not flash is present on Target.
++ * NB: flash_is_present indicator is here not just
++ * because it might be of interest to the Host; but
++ * also because it's set early on by Target's startup
++ * asm code and we need it to have a special RAM address
++ * so that it doesn't get reinitialized with the rest
++ * of data.
++ */
++ A_UINT32 hi_flash_is_present; /* 0x0c */
++
++ /*
++ * General-purpose flag bits, similar to AR6000_OPTION_* flags.
++ * Can be used by application rather than by OS.
++ */
++ A_UINT32 hi_option_flag; /* 0x10 */
++
++ /*
++ * Boolean that determines whether or not to
++ * display messages on the serial port.
++ */
++ A_UINT32 hi_serial_enable; /* 0x14 */
++
++ /* Start address of Flash DataSet index, if any */
++ A_UINT32 hi_dset_list_head; /* 0x18 */
++
++ /* Override Target application start address */
++ A_UINT32 hi_app_start; /* 0x1c */
++
++ /* Clock and voltage tuning */
++ A_UINT32 hi_skip_clock_init; /* 0x20 */
++ A_UINT32 hi_core_clock_setting; /* 0x24 */
++ A_UINT32 hi_cpu_clock_setting; /* 0x28 */
++ A_UINT32 hi_system_sleep_setting; /* 0x2c */
++ A_UINT32 hi_xtal_control_setting; /* 0x30 */
++ A_UINT32 hi_pll_ctrl_setting_24ghz; /* 0x34 */
++ A_UINT32 hi_pll_ctrl_setting_5ghz; /* 0x38 */
++ A_UINT32 hi_ref_voltage_trim_setting; /* 0x3c */
++ A_UINT32 hi_clock_info; /* 0x40 */
++
++ /*
++ * Flash configuration overrides, used only
++ * when firmware is not executing from flash.
++ * (When using flash, modify the global variables
++ * with equivalent names.)
++ */
++ A_UINT32 hi_bank0_addr_value; /* 0x44 */
++ A_UINT32 hi_bank0_read_value; /* 0x48 */
++ A_UINT32 hi_bank0_write_value; /* 0x4c */
++ A_UINT32 hi_bank0_config_value; /* 0x50 */
++
++ /* Pointer to Board Data */
++ A_UINT32 hi_board_data; /* 0x54 */
++ A_UINT32 hi_board_data_initialized; /* 0x58 */
++
++ A_UINT32 hi_dset_RAM_index_table; /* 0x5c */
++
++ A_UINT32 hi_desired_baud_rate; /* 0x60 */
++ A_UINT32 hi_dbglog_config; /* 0x64 */
++ A_UINT32 hi_end_RAM_reserve_sz; /* 0x68 */
++ A_UINT32 hi_mbox_io_block_sz; /* 0x6c */
++
++ A_UINT32 hi_num_bpatch_streams; /* 0x70 */
++ A_UINT32 hi_mbox_isr_yield_limit; /* 0x74 */
++
++ A_UINT32 hi_refclk_hz; /* 0x78 */
++};
++
++/* Bits defined in hi_option_flag */
++#define HI_OPTION_TIMER_WAR 1 /* not really used */
++
++/*
++ * Intended for use by Host software, this macro returns the Target RAM
++ * address of any item in the host_interest structure.
++ * Example: target_addr = AR6001_HOST_INTEREST_ITEM_ADDRESS(hi_board_data);
++ */
++#define AR6001_HOST_INTEREST_ITEM_ADDRESS(item) \
++ ((A_UINT32)&((((struct host_interest_s *)(AR6001_HOST_INTEREST_ADDRESS))->item)))
++
++#define AR6002_HOST_INTEREST_ITEM_ADDRESS(item) \
++ ((A_UINT32)&((((struct host_interest_s *)(AR6002_HOST_INTEREST_ADDRESS))->item)))
++
++
++#endif /* !__ASSEMBLER__ */
++
++#endif /* __TARGADDRS_H__ */
+diff --git a/drivers/ar6000/include/testcmd.h b/drivers/ar6000/include/testcmd.h
+new file mode 100644
+index 0000000..737533a
+--- /dev/null
++++ b/drivers/ar6000/include/testcmd.h
+@@ -0,0 +1,144 @@
++/*
++ * Copyright (c) 2004-2005 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ *
++ * $ATH_LICENSE_HOSTSDK0_C$
++ *
++ */
++
++#ifndef TESTCMD_H_
++#define TESTCMD_H_
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++typedef enum {
++ ZEROES_PATTERN = 0,
++ ONES_PATTERN,
++ REPEATING_10,
++ PN7_PATTERN,
++ PN9_PATTERN,
++ PN15_PATTERN
++}TX_DATA_PATTERN;
++
++/* Continous tx
++ mode : TCMD_CONT_TX_OFF - Disabling continous tx
++ TCMD_CONT_TX_SINE - Enable continuous unmodulated tx
++ TCMD_CONT_TX_FRAME- Enable continuous modulated tx
++ freq : Channel freq in Mhz. (e.g 2412 for channel 1 in 11 g)
++dataRate: 0 - 1 Mbps
++ 1 - 2 Mbps
++ 2 - 5.5 Mbps
++ 3 - 11 Mbps
++ 4 - 6 Mbps
++ 5 - 9 Mbps
++ 6 - 12 Mbps
++ 7 - 18 Mbps
++ 8 - 24 Mbps
++ 9 - 36 Mbps
++ 10 - 28 Mbps
++ 11 - 54 Mbps
++ txPwr: Tx power in dBm[5 -11] for unmod Tx, [5-14] for mod Tx
++antenna: 1 - one antenna
++ 2 - two antenna
++Note : Enable/disable continuous tx test cmd works only when target is awake.
++*/
++
++typedef enum {
++ TCMD_CONT_TX_OFF = 0,
++ TCMD_CONT_TX_SINE,
++ TCMD_CONT_TX_FRAME,
++ TCMD_CONT_TX_TX99,
++ TCMD_CONT_TX_TX100
++} TCMD_CONT_TX_MODE;
++
++typedef PREPACK struct {
++ A_UINT32 testCmdId;
++ A_UINT32 mode;
++ A_UINT32 freq;
++ A_UINT32 dataRate;
++ A_INT32 txPwr;
++ A_UINT32 antenna;
++ A_UINT32 enANI;
++ A_UINT32 scramblerOff;
++ A_UINT32 aifsn;
++ A_UINT16 pktSz;
++ A_UINT16 txPattern;
++} POSTPACK TCMD_CONT_TX;
++
++#define TCMD_TXPATTERN_ZERONE 0x1
++#define TCMD_TXPATTERN_ZERONE_DIS_SCRAMBLE 0x2
++
++/* Continuous Rx
++ act: TCMD_CONT_RX_PROMIS - promiscuous mode (accept all incoming frames)
++ TCMD_CONT_RX_FILTER - filter mode (accept only frames with dest
++ address equal specified
++ mac address (set via act =3)
++ TCMD_CONT_RX_REPORT off mode (disable cont rx mode and get the
++ report from the last cont
++ Rx test)
++
++ TCMD_CONT_RX_SETMAC - set MacAddr mode (sets the MAC address for the
++ target. This Overrides
++ the default MAC address.)
++
++*/
++typedef enum {
++ TCMD_CONT_RX_PROMIS =0,
++ TCMD_CONT_RX_FILTER,
++ TCMD_CONT_RX_REPORT,
++ TCMD_CONT_RX_SETMAC
++} TCMD_CONT_RX_ACT;
++
++typedef PREPACK struct {
++ A_UINT32 testCmdId;
++ A_UINT32 act;
++ A_UINT32 enANI;
++ PREPACK union {
++ struct PREPACK TCMD_CONT_RX_PARA {
++ A_UINT32 freq;
++ A_UINT32 antenna;
++ } POSTPACK para;
++ struct PREPACK TCMD_CONT_RX_REPORT {
++ A_UINT32 totalPkt;
++ A_INT32 rssiInDBm;
++ } POSTPACK report;
++ struct PREPACK TCMD_CONT_RX_MAC {
++ A_UCHAR addr[ATH_MAC_LEN];
++ } POSTPACK mac;
++ } POSTPACK u;
++} POSTPACK TCMD_CONT_RX;
++
++/* Force sleep/wake test cmd
++ mode: TCMD_PM_WAKEUP - Wakeup the target
++ TCMD_PM_SLEEP - Force the target to sleep.
++ */
++typedef enum {
++ TCMD_PM_WAKEUP = 1, /* be consistent with target */
++ TCMD_PM_SLEEP
++} TCMD_PM_MODE;
++
++typedef PREPACK struct {
++ A_UINT32 testCmdId;
++ A_UINT32 mode;
++} POSTPACK TCMD_PM;
++
++typedef enum{
++ TCMD_CONT_TX_ID,
++ TCMD_CONT_RX_ID,
++ TCMD_PM_ID
++ } TCMD_ID;
++
++typedef PREPACK union {
++ TCMD_CONT_TX contTx;
++ TCMD_CONT_RX contRx;
++ TCMD_PM pm ;
++} POSTPACK TEST_CMD;
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* TESTCMD_H_ */
+diff --git a/drivers/ar6000/include/wlan_api.h b/drivers/ar6000/include/wlan_api.h
+new file mode 100644
+index 0000000..aabca4b
+--- /dev/null
++++ b/drivers/ar6000/include/wlan_api.h
+@@ -0,0 +1,101 @@
++#ifndef _HOST_WLAN_API_H_
++#define _HOST_WLAN_API_H_
++/*
++ * Copyright (c) 2004-2005 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ * This file contains the API for the host wlan module
++ *
++ * $Id: //depot/sw/releases/olca2.0-GPL/host/include/wlan_api.h#1 $
++ *
++ *
++ * 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 ieee80211_node_table;
++struct ieee80211_frame;
++
++struct ieee80211_common_ie {
++ A_UINT16 ie_chan;
++ A_UINT8 *ie_tstamp;
++ A_UINT8 *ie_ssid;
++ A_UINT8 *ie_rates;
++ A_UINT8 *ie_xrates;
++ A_UINT8 *ie_country;
++ A_UINT8 *ie_wpa;
++ A_UINT8 *ie_rsn;
++ A_UINT8 *ie_wmm;
++ A_UINT8 *ie_ath;
++ A_UINT16 ie_capInfo;
++ A_UINT16 ie_beaconInt;
++ A_UINT8 *ie_tim;
++ A_UINT8 *ie_chswitch;
++ A_UINT8 ie_erp;
++ A_UINT8 *ie_wsc;
++};
++
++typedef struct bss {
++ A_UINT8 ni_macaddr[6];
++ A_UINT8 ni_snr;
++ A_INT16 ni_rssi;
++ struct bss *ni_list_next;
++ struct bss *ni_list_prev;
++ struct bss *ni_hash_next;
++ struct bss *ni_hash_prev;
++ struct ieee80211_common_ie ni_cie;
++ A_UINT8 *ni_buf;
++ struct ieee80211_node_table *ni_table;
++ A_UINT32 ni_refcnt;
++ int ni_scangen;
++ A_UINT32 ni_tstamp;
++} bss_t;
++
++typedef void wlan_node_iter_func(void *arg, bss_t *);
++
++bss_t *wlan_node_alloc(struct ieee80211_node_table *nt, int wh_size);
++void wlan_node_free(bss_t *ni);
++void wlan_setup_node(struct ieee80211_node_table *nt, bss_t *ni,
++ const A_UINT8 *macaddr);
++bss_t *wlan_find_node(struct ieee80211_node_table *nt, const A_UINT8 *macaddr);
++void wlan_node_reclaim(struct ieee80211_node_table *nt, bss_t *ni);
++void wlan_free_allnodes(struct ieee80211_node_table *nt);
++void wlan_iterate_nodes(struct ieee80211_node_table *nt, wlan_node_iter_func *f,
++ void *arg);
++
++void wlan_node_table_init(void *wmip, struct ieee80211_node_table *nt);
++void wlan_node_table_reset(struct ieee80211_node_table *nt);
++void wlan_node_table_cleanup(struct ieee80211_node_table *nt);
++
++A_STATUS wlan_parse_beacon(A_UINT8 *buf, int framelen,
++ struct ieee80211_common_ie *cie);
++
++A_UINT16 wlan_ieee2freq(int chan);
++A_UINT32 wlan_freq2ieee(A_UINT16 freq);
++
++
++bss_t *
++wlan_find_Ssidnode (struct ieee80211_node_table *nt, A_UCHAR *pSsid,
++ A_UINT32 ssidLength, A_BOOL bIsWPA2);
++
++void
++wlan_node_return (struct ieee80211_node_table *nt, bss_t *ni);
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* _HOST_WLAN_API_H_ */
+diff --git a/drivers/ar6000/include/wlan_dset.h b/drivers/ar6000/include/wlan_dset.h
+new file mode 100644
+index 0000000..8a876d6
+--- /dev/null
++++ b/drivers/ar6000/include/wlan_dset.h
+@@ -0,0 +1,20 @@
++/*
++ * Copyright (c) 2007 Atheros Communications, Inc.
++ * All rights reserved.
++ *
++ *
++ * $ATH_LICENSE_HOSTSDK0_C$
++ *
++ */
++
++#ifndef __WLAN_DSET_H__
++#define __WKAN_DSET_H__
++
++typedef PREPACK struct wow_config_dset {
++
++ A_UINT8 valid_dset;
++ A_UINT8 gpio_enable;
++ A_UINT16 gpio_pin;
++} POSTPACK WOW_CONFIG_DSET;
++
++#endif
+diff --git a/drivers/ar6000/include/wmi.h b/drivers/ar6000/include/wmi.h
+new file mode 100644
+index 0000000..045acd4
+--- /dev/null
++++ b/drivers/ar6000/include/wmi.h
+@@ -0,0 +1,1743 @@
++/*
++ * Copyright (c) 2004-2006 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ *
++ * $ATH_LICENSE_HOSTSDK0_C$
++ *
++ * This file contains the definitions of the WMI protocol specified in the
++ * Wireless Module Interface (WMI). It includes definitions of all the
++ * commands and events. Commands are messages from the host to the WM.
++ * Events and Replies are messages from the WM to the host.
++ *
++ * Ownership of correctness in regards to WMI commands
++ * belongs to the host driver and the WM is not required to validate
++ * parameters for value, proper range, or any other checking.
++ *
++ */
++
++#ifndef _WMI_H_
++#define _WMI_H_
++
++#ifndef ATH_TARGET
++#include "athstartpack.h"
++#endif
++
++#include "wmix.h"
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#define WMI_PROTOCOL_VERSION 0x0002
++#define WMI_PROTOCOL_REVISION 0x0000
++
++#define ATH_MAC_LEN 6 /* length of mac in bytes */
++#define WMI_CMD_MAX_LEN 100
++#define WMI_CONTROL_MSG_MAX_LEN 256
++#define WMI_OPT_CONTROL_MSG_MAX_LEN 1536
++#define IS_ETHERTYPE(_typeOrLen) ((_typeOrLen) >= 0x0600)
++#define RFC1042OUI {0x00, 0x00, 0x00}
++
++#define IP_ETHERTYPE 0x0800
++
++#define WMI_IMPLICIT_PSTREAM 0xFF
++#define WMI_MAX_THINSTREAM 15
++
++struct host_app_area_s {
++ A_UINT32 wmi_protocol_ver;
++};
++
++/*
++ * Data Path
++ */
++typedef PREPACK struct {
++ A_UINT8 dstMac[ATH_MAC_LEN];
++ A_UINT8 srcMac[ATH_MAC_LEN];
++ A_UINT16 typeOrLen;
++} POSTPACK ATH_MAC_HDR;
++
++typedef PREPACK struct {
++ A_UINT8 dsap;
++ A_UINT8 ssap;
++ A_UINT8 cntl;
++ A_UINT8 orgCode[3];
++ A_UINT16 etherType;
++} POSTPACK ATH_LLC_SNAP_HDR;
++
++typedef enum {
++ DATA_MSGTYPE = 0x0,
++ CNTL_MSGTYPE,
++ SYNC_MSGTYPE
++} WMI_MSG_TYPE;
++
++
++typedef PREPACK struct {
++ A_INT8 rssi;
++ A_UINT8 info; /* WMI_MSG_TYPE in lower 2 bits - b1b0 */
++ /* UP in next 3 bits - b4b3b2 */
++#define WMI_DATA_HDR_MSG_TYPE_MASK 0x03
++#define WMI_DATA_HDR_MSG_TYPE_SHIFT 0
++#define WMI_DATA_HDR_UP_MASK 0x07
++#define WMI_DATA_HDR_UP_SHIFT 2
++#define WMI_DATA_HDR_IS_MSG_TYPE(h, t) (((h)->info & (WMI_DATA_HDR_MSG_TYPE_MASK)) == (t))
++} POSTPACK WMI_DATA_HDR;
++
++
++#define WMI_DATA_HDR_SET_MSG_TYPE(h, t) (h)->info = (((h)->info & ~(WMI_DATA_HDR_MSG_TYPE_MASK << WMI_DATA_HDR_MSG_TYPE_SHIFT)) | (t << WMI_DATA_HDR_MSG_TYPE_SHIFT))
++#define WMI_DATA_HDR_SET_UP(h, p) (h)->info = (((h)->info & ~(WMI_DATA_HDR_UP_MASK << WMI_DATA_HDR_UP_SHIFT)) | (p << WMI_DATA_HDR_UP_SHIFT))
++
++/*
++ * Control Path
++ */
++typedef PREPACK struct {
++ A_UINT16 commandId;
++} POSTPACK WMI_CMD_HDR; /* used for commands and events */
++
++/*
++ * List of Commnands
++ */
++typedef enum {
++ WMI_CONNECT_CMDID = 0x0001,
++ WMI_RECONNECT_CMDID,
++ WMI_DISCONNECT_CMDID,
++ WMI_SYNCHRONIZE_CMDID,
++ WMI_CREATE_PSTREAM_CMDID,
++ WMI_DELETE_PSTREAM_CMDID,
++ WMI_START_SCAN_CMDID,
++ WMI_SET_SCAN_PARAMS_CMDID,
++ WMI_SET_BSS_FILTER_CMDID,
++ WMI_SET_PROBED_SSID_CMDID,
++ WMI_SET_LISTEN_INT_CMDID,
++ WMI_SET_BMISS_TIME_CMDID,
++ WMI_SET_DISC_TIMEOUT_CMDID,
++ WMI_GET_CHANNEL_LIST_CMDID,
++ WMI_SET_BEACON_INT_CMDID,
++ WMI_GET_STATISTICS_CMDID,
++ WMI_SET_CHANNEL_PARAMS_CMDID,
++ WMI_SET_POWER_MODE_CMDID,
++ WMI_SET_IBSS_PM_CAPS_CMDID,
++ WMI_SET_POWER_PARAMS_CMDID,
++ WMI_SET_POWERSAVE_TIMERS_POLICY_CMDID,
++ WMI_ADD_CIPHER_KEY_CMDID,
++ WMI_DELETE_CIPHER_KEY_CMDID,
++ WMI_ADD_KRK_CMDID,
++ WMI_DELETE_KRK_CMDID,
++ WMI_SET_PMKID_CMDID,
++ WMI_SET_TX_PWR_CMDID,
++ WMI_GET_TX_PWR_CMDID,
++ WMI_SET_ASSOC_INFO_CMDID,
++ WMI_ADD_BAD_AP_CMDID,
++ WMI_DELETE_BAD_AP_CMDID,
++ WMI_SET_TKIP_COUNTERMEASURES_CMDID,
++ WMI_RSSI_THRESHOLD_PARAMS_CMDID,
++ WMI_TARGET_ERROR_REPORT_BITMASK_CMDID,
++ WMI_SET_ACCESS_PARAMS_CMDID,
++ WMI_SET_RETRY_LIMITS_CMDID,
++ WMI_SET_OPT_MODE_CMDID,
++ WMI_OPT_TX_FRAME_CMDID,
++ WMI_SET_VOICE_PKT_SIZE_CMDID,
++ WMI_SET_MAX_SP_LEN_CMDID,
++ WMI_SET_ROAM_CTRL_CMDID,
++ WMI_GET_ROAM_TBL_CMDID,
++ WMI_GET_ROAM_DATA_CMDID,
++ WMI_ENABLE_RM_CMDID,
++ WMI_SET_MAX_OFFHOME_DURATION_CMDID,
++ WMI_EXTENSION_CMDID, /* Non-wireless extensions */
++ WMI_SNR_THRESHOLD_PARAMS_CMDID,
++ WMI_LQ_THRESHOLD_PARAMS_CMDID,
++ WMI_SET_LPREAMBLE_CMDID,
++ WMI_SET_RTS_CMDID,
++ WMI_CLR_RSSI_SNR_CMDID,
++ WMI_SET_FIXRATES_CMDID,
++ WMI_GET_FIXRATES_CMDID,
++ WMI_SET_AUTH_MODE_CMDID,
++ WMI_SET_REASSOC_MODE_CMDID,
++ WMI_SET_WMM_CMDID,
++ WMI_SET_WMM_TXOP_CMDID,
++ WMI_TEST_CMDID,
++ WMI_SET_BT_STATUS_CMDID,
++ WMI_SET_BT_PARAMS_CMDID,
++
++ WMI_SET_KEEPALIVE_CMDID,
++ WMI_GET_KEEPALIVE_CMDID,
++ WMI_SET_APPIE_CMDID,
++ WMI_GET_APPIE_CMDID,
++ WMI_SET_WSC_STATUS_CMDID,
++
++ /* Wake on Wireless */
++ WMI_SET_HOST_SLEEP_MODE_CMDID,
++ WMI_SET_WOW_MODE_CMDID,
++ WMI_GET_WOW_LIST_CMDID,
++ WMI_ADD_WOW_PATTERN_CMDID,
++ WMI_DEL_WOW_PATTERN_CMDID,
++ WMI_SET_MAC_ADDRESS_CMDID,
++ WMI_SET_AKMP_PARAMS_CMDID,
++ WMI_SET_PMKID_LIST_CMDID,
++ WMI_GET_PMKID_LIST_CMDID,
++
++ /*
++ * Developer commands starts at 0xF000
++ */
++ WMI_SET_BITRATE_CMDID = 0xF000,
++ WMI_GET_BITRATE_CMDID,
++ WMI_SET_WHALPARAM_CMDID,
++
++} WMI_COMMAND_ID;
++
++/*
++ * Frame Types
++ */
++typedef enum {
++ WMI_FRAME_BEACON = 0,
++ WMI_FRAME_PROBE_REQ,
++ WMI_FRAME_PROBE_RESP,
++ WMI_FRAME_ASSOC_REQ,
++ WMI_FRAME_ASSOC_RESP,
++ WMI_NUM_MGMT_FRAME
++} WMI_MGMT_FRAME_TYPE;
++
++/*
++ * Connect Command
++ */
++typedef enum {
++ INFRA_NETWORK = 0x01,
++ ADHOC_NETWORK = 0x02,
++ ADHOC_CREATOR = 0x04,
++} NETWORK_TYPE;
++
++typedef enum {
++ OPEN_AUTH = 0x01,
++ SHARED_AUTH = 0x02,
++ LEAP_AUTH = 0x04, /* different from IEEE_AUTH_MODE definitions */
++} DOT11_AUTH_MODE;
++
++typedef enum {
++ NONE_AUTH = 0x01,
++ WPA_AUTH = 0x02,
++ WPA_PSK_AUTH = 0x03,
++ WPA2_AUTH = 0x04,
++ WPA2_PSK_AUTH = 0x05,
++ WPA_AUTH_CCKM = 0x06,
++ WPA2_AUTH_CCKM = 0x07,
++} AUTH_MODE;
++
++typedef enum {
++ NONE_CRYPT = 0x01,
++ WEP_CRYPT = 0x02,
++ TKIP_CRYPT = 0x03,
++ AES_CRYPT = 0x04,
++} CRYPTO_TYPE;
++
++#define WMI_MIN_CRYPTO_TYPE NONE_CRYPT
++#define WMI_MAX_CRYPTO_TYPE (AES_CRYPT + 1)
++
++#define WMI_MIN_KEY_INDEX 0
++#define WMI_MAX_KEY_INDEX 3
++
++#define WMI_MAX_KEY_LEN 32
++
++#define WMI_MAX_SSID_LEN 32
++
++typedef enum {
++ CONNECT_ASSOC_POLICY_USER = 0x0001,
++ CONNECT_SEND_REASSOC = 0x0002,
++ CONNECT_IGNORE_WPAx_GROUP_CIPHER = 0x0004,
++ CONNECT_PROFILE_MATCH_DONE = 0x0008,
++ CONNECT_IGNORE_AAC_BEACON = 0x0010,
++ CONNECT_CSA_FOLLOW_BSS = 0x0020,
++} WMI_CONNECT_CTRL_FLAGS_BITS;
++
++#define DEFAULT_CONNECT_CTRL_FLAGS (CONNECT_CSA_FOLLOW_BSS)
++
++typedef PREPACK struct {
++ A_UINT8 networkType;
++ A_UINT8 dot11AuthMode;
++ A_UINT8 authMode;
++ A_UINT8 pairwiseCryptoType;
++ A_UINT8 pairwiseCryptoLen;
++ A_UINT8 groupCryptoType;
++ A_UINT8 groupCryptoLen;
++ A_UINT8 ssidLength;
++ A_UCHAR ssid[WMI_MAX_SSID_LEN];
++ A_UINT16 channel;
++ A_UINT8 bssid[ATH_MAC_LEN];
++ A_UINT32 ctrl_flags;
++} POSTPACK WMI_CONNECT_CMD;
++
++/*
++ * WMI_RECONNECT_CMDID
++ */
++typedef PREPACK struct {
++ A_UINT16 channel; /* hint */
++ A_UINT8 bssid[ATH_MAC_LEN]; /* mandatory if set */
++} POSTPACK WMI_RECONNECT_CMD;
++
++/*
++ * WMI_ADD_CIPHER_KEY_CMDID
++ */
++typedef enum {
++ PAIRWISE_USAGE = 0x00,
++ GROUP_USAGE = 0x01,
++ TX_USAGE = 0x02, /* default Tx Key - Static WEP only */
++} KEY_USAGE;
++
++/*
++ * Bit Flag
++ * Bit 0 - Initialise TSC - default is Initialize
++ */
++#define KEY_OP_INIT_TSC 0x01
++#define KEY_OP_INIT_RSC 0x02
++
++#define KEY_OP_INIT_VAL 0x03 /* Default Initialise the TSC & RSC */
++#define KEY_OP_VALID_MASK 0x03
++
++typedef PREPACK struct {
++ A_UINT8 keyIndex;
++ A_UINT8 keyType;
++ A_UINT8 keyUsage; /* KEY_USAGE */
++ A_UINT8 keyLength;
++ A_UINT8 keyRSC[8]; /* key replay sequence counter */
++ A_UINT8 key[WMI_MAX_KEY_LEN];
++ A_UINT8 key_op_ctrl; /* Additional Key Control information */
++} POSTPACK WMI_ADD_CIPHER_KEY_CMD;
++
++/*
++ * WMI_DELETE_CIPHER_KEY_CMDID
++ */
++typedef PREPACK struct {
++ A_UINT8 keyIndex;
++} POSTPACK WMI_DELETE_CIPHER_KEY_CMD;
++
++#define WMI_KRK_LEN 16
++/*
++ * WMI_ADD_KRK_CMDID
++ */
++typedef PREPACK struct {
++ A_UINT8 krk[WMI_KRK_LEN];
++} POSTPACK WMI_ADD_KRK_CMD;
++
++/*
++ * WMI_SET_TKIP_COUNTERMEASURES_CMDID
++ */
++typedef enum {
++ WMI_TKIP_CM_DISABLE = 0x0,
++ WMI_TKIP_CM_ENABLE = 0x1,
++} WMI_TKIP_CM_CONTROL;
++
++typedef PREPACK struct {
++ A_UINT8 cm_en; /* WMI_TKIP_CM_CONTROL */
++} POSTPACK WMI_SET_TKIP_COUNTERMEASURES_CMD;
++
++/*
++ * WMI_SET_PMKID_CMDID
++ */
++
++#define WMI_PMKID_LEN 16
++
++typedef enum {
++ PMKID_DISABLE = 0,
++ PMKID_ENABLE = 1,
++} PMKID_ENABLE_FLG;
++
++typedef PREPACK struct {
++ A_UINT8 bssid[ATH_MAC_LEN];
++ A_UINT8 enable; /* PMKID_ENABLE_FLG */
++ A_UINT8 pmkid[WMI_PMKID_LEN];
++} POSTPACK WMI_SET_PMKID_CMD;
++
++/*
++ * WMI_START_SCAN_CMD
++ */
++typedef enum {
++ WMI_LONG_SCAN = 0,
++ WMI_SHORT_SCAN = 1,
++} WMI_SCAN_TYPE;
++
++typedef PREPACK struct {
++ A_BOOL forceFgScan;
++ A_BOOL isLegacy; /* For Legacy Cisco AP compatibility */
++ A_UINT32 homeDwellTime; /* Maximum duration in the home channel(milliseconds) */
++ A_UINT32 forceScanInterval; /* Time interval between scans (milliseconds)*/
++ A_UINT8 scanType; /* WMI_SCAN_TYPE */
++} POSTPACK WMI_START_SCAN_CMD;
++
++/*
++ * WMI_SET_SCAN_PARAMS_CMDID
++ */
++#define WMI_SHORTSCANRATIO_DEFAULT 3
++typedef enum {
++ CONNECT_SCAN_CTRL_FLAGS = 0x01, /* set if can scan in the Connect cmd */
++ SCAN_CONNECTED_CTRL_FLAGS = 0x02, /* set if scan for the SSID it is */
++ /* already connected to */
++ ACTIVE_SCAN_CTRL_FLAGS = 0x04, /* set if enable active scan */
++ ROAM_SCAN_CTRL_FLAGS = 0x08, /* set if enable roam scan when bmiss and lowrssi */
++ REPORT_BSSINFO_CTRL_FLAGS = 0x10, /* set if follows customer BSSINFO reporting rule */
++ ENABLE_AUTO_CTRL_FLAGS = 0x20, /* if disabled, target doesn't
++ scan after a disconnect event */
++ ENABLE_SCAN_ABORT_EVENT = 0x40 /* Scan complete event with canceled status will be generated when a scan is prempted before it gets completed */
++
++} WMI_SCAN_CTRL_FLAGS_BITS;
++
++#define CAN_SCAN_IN_CONNECT(flags) (flags & CONNECT_SCAN_CTRL_FLAGS)
++#define CAN_SCAN_CONNECTED(flags) (flags & SCAN_CONNECTED_CTRL_FLAGS)
++#define ENABLE_ACTIVE_SCAN(flags) (flags & ACTIVE_SCAN_CTRL_FLAGS)
++#define ENABLE_ROAM_SCAN(flags) (flags & ROAM_SCAN_CTRL_FLAGS)
++#define CONFIG_REPORT_BSSINFO(flags) (flags & REPORT_BSSINFO_CTRL_FLAGS)
++#define IS_AUTO_SCAN_ENABLED(flags) (flags & ENABLE_AUTO_CTRL_FLAGS)
++#define SCAN_ABORT_EVENT_ENABLED(flags) (flags & ENABLE_SCAN_ABORT_EVENT)
++
++#define DEFAULT_SCAN_CTRL_FLAGS (CONNECT_SCAN_CTRL_FLAGS| SCAN_CONNECTED_CTRL_FLAGS| ACTIVE_SCAN_CTRL_FLAGS| ROAM_SCAN_CTRL_FLAGS | ENABLE_AUTO_CTRL_FLAGS)
++
++
++typedef PREPACK struct {
++ A_UINT16 fg_start_period; /* seconds */
++ A_UINT16 fg_end_period; /* seconds */
++ A_UINT16 bg_period; /* seconds */
++ A_UINT16 maxact_chdwell_time; /* msec */
++ A_UINT16 pas_chdwell_time; /* msec */
++ A_UINT8 shortScanRatio; /* how many shorts scan for one long */
++ A_UINT8 scanCtrlFlags;
++ A_UINT16 minact_chdwell_time; /* msec */
++ A_UINT32 max_dfsch_act_time; /* msecs */
++} POSTPACK WMI_SCAN_PARAMS_CMD;
++
++/*
++ * WMI_SET_BSS_FILTER_CMDID
++ */
++typedef enum {
++ NONE_BSS_FILTER = 0x0, /* no beacons forwarded */
++ ALL_BSS_FILTER, /* all beacons forwarded */
++ PROFILE_FILTER, /* only beacons matching profile */
++ ALL_BUT_PROFILE_FILTER, /* all but beacons matching profile */
++ CURRENT_BSS_FILTER, /* only beacons matching current BSS */
++ ALL_BUT_BSS_FILTER, /* all but beacons matching BSS */
++ PROBED_SSID_FILTER, /* beacons matching probed ssid */
++ LAST_BSS_FILTER, /* marker only */
++} WMI_BSS_FILTER;
++
++typedef PREPACK struct {
++ A_UINT8 bssFilter; /* see WMI_BSS_FILTER */
++ A_UINT32 ieMask;
++} POSTPACK WMI_BSS_FILTER_CMD;
++
++/*
++ * WMI_SET_PROBED_SSID_CMDID
++ */
++#define MAX_PROBED_SSID_INDEX 5
++
++typedef enum {
++ DISABLE_SSID_FLAG = 0, /* disables entry */
++ SPECIFIC_SSID_FLAG = 0x01, /* probes specified ssid */
++ ANY_SSID_FLAG = 0x02, /* probes for any ssid */
++} WMI_SSID_FLAG;
++
++typedef PREPACK struct {
++ A_UINT8 entryIndex; /* 0 to MAX_PROBED_SSID_INDEX */
++ A_UINT8 flag; /* WMI_SSID_FLG */
++ A_UINT8 ssidLength;
++ A_UINT8 ssid[32];
++} POSTPACK WMI_PROBED_SSID_CMD;
++
++/*
++ * WMI_SET_LISTEN_INT_CMDID
++ * The Listen interval is between 15 and 3000 TUs
++ */
++#define MIN_LISTEN_INTERVAL 15
++#define MAX_LISTEN_INTERVAL 5000
++#define MIN_LISTEN_BEACONS 1
++#define MAX_LISTEN_BEACONS 50
++
++typedef PREPACK struct {
++ A_UINT16 listenInterval;
++ A_UINT16 numBeacons;
++} POSTPACK WMI_LISTEN_INT_CMD;
++
++/*
++ * WMI_SET_BEACON_INT_CMDID
++ */
++typedef PREPACK struct {
++ A_UINT16 beaconInterval;
++} POSTPACK WMI_BEACON_INT_CMD;
++
++/*
++ * WMI_SET_BMISS_TIME_CMDID
++ * valid values are between 1000 and 5000 TUs
++ */
++
++#define MIN_BMISS_TIME 1000
++#define MAX_BMISS_TIME 5000
++#define MIN_BMISS_BEACONS 1
++#define MAX_BMISS_BEACONS 50
++
++typedef PREPACK struct {
++ A_UINT16 bmissTime;
++ A_UINT16 numBeacons;
++} POSTPACK WMI_BMISS_TIME_CMD;
++
++/*
++ * WMI_SET_POWER_MODE_CMDID
++ */
++typedef enum {
++ REC_POWER = 0x01,
++ MAX_PERF_POWER,
++} WMI_POWER_MODE;
++
++typedef PREPACK struct {
++ A_UINT8 powerMode; /* WMI_POWER_MODE */
++} POSTPACK WMI_POWER_MODE_CMD;
++
++/*
++ * WMI_SET_POWER_PARAMS_CMDID
++ */
++typedef enum {
++ IGNORE_DTIM = 0x01,
++ NORMAL_DTIM = 0x02,
++ STICK_DTIM = 0x03,
++} WMI_DTIM_POLICY;
++
++typedef PREPACK struct {
++ A_UINT16 idle_period; /* msec */
++ A_UINT16 pspoll_number;
++ A_UINT16 dtim_policy;
++} POSTPACK WMI_POWER_PARAMS_CMD;
++
++typedef PREPACK struct {
++ A_UINT8 power_saving;
++ A_UINT8 ttl; /* number of beacon periods */
++ A_UINT16 atim_windows; /* msec */
++ A_UINT16 timeout_value; /* msec */
++} POSTPACK WMI_IBSS_PM_CAPS_CMD;
++
++/*
++ * WMI_SET_POWERSAVE_TIMERS_POLICY_CMDID
++ */
++typedef enum {
++ IGNORE_TIM_ALL_QUEUES_APSD = 0,
++ PROCESS_TIM_ALL_QUEUES_APSD = 1,
++ IGNORE_TIM_SIMULATED_APSD = 2,
++ PROCESS_TIM_SIMULATED_APSD = 3,
++} APSD_TIM_POLICY;
++
++typedef PREPACK struct {
++ A_UINT16 psPollTimeout; /* msec */
++ A_UINT16 triggerTimeout; /* msec */
++ A_UINT32 apsdTimPolicy; /* TIM behavior with ques APSD enabled. Default is IGNORE_TIM_ALL_QUEUES_APSD */
++ A_UINT32 simulatedAPSDTimPolicy; /* TIM behavior with simulated APSD enabled. Default is PROCESS_TIM_SIMULATED_APSD */
++} POSTPACK WMI_POWERSAVE_TIMERS_POLICY_CMD;
++
++/*
++ * WMI_SET_VOICE_PKT_SIZE_CMDID
++ */
++typedef PREPACK struct {
++ A_UINT16 voicePktSize;
++} POSTPACK WMI_SET_VOICE_PKT_SIZE_CMD;
++
++/*
++ * WMI_SET_MAX_SP_LEN_CMDID
++ */
++typedef enum {
++ DELIVER_ALL_PKT = 0x0,
++ DELIVER_2_PKT = 0x1,
++ DELIVER_4_PKT = 0x2,
++ DELIVER_6_PKT = 0x3,
++} APSD_SP_LEN_TYPE;
++
++typedef PREPACK struct {
++ A_UINT8 maxSPLen;
++} POSTPACK WMI_SET_MAX_SP_LEN_CMD;
++
++/*
++ * WMI_SET_DISC_TIMEOUT_CMDID
++ */
++typedef PREPACK struct {
++ A_UINT8 disconnectTimeout; /* seconds */
++} POSTPACK WMI_DISC_TIMEOUT_CMD;
++
++typedef enum {
++ UPLINK_TRAFFIC = 0,
++ DNLINK_TRAFFIC = 1,
++ BIDIR_TRAFFIC = 2,
++} DIR_TYPE;
++
++typedef enum {
++ DISABLE_FOR_THIS_AC = 0,
++ ENABLE_FOR_THIS_AC = 1,
++ ENABLE_FOR_ALL_AC = 2,
++} VOICEPS_CAP_TYPE;
++
++typedef enum {
++ TRAFFIC_TYPE_APERIODIC = 0,
++ TRAFFIC_TYPE_PERIODIC = 1,
++}TRAFFIC_TYPE;
++
++/*
++ * WMI_CREATE_PSTREAM_CMDID
++ */
++typedef PREPACK struct {
++ A_UINT32 minServiceInt; /* in milli-sec */
++ A_UINT32 maxServiceInt; /* in milli-sec */
++ A_UINT32 inactivityInt; /* in milli-sec */
++ A_UINT32 suspensionInt; /* in milli-sec */
++ A_UINT32 serviceStartTime;
++ A_UINT32 minDataRate; /* in bps */
++ A_UINT32 meanDataRate; /* in bps */
++ A_UINT32 peakDataRate; /* in bps */
++ A_UINT32 maxBurstSize;
++ A_UINT32 delayBound;
++ A_UINT32 minPhyRate; /* in bps */
++ A_UINT32 sba;
++ A_UINT32 mediumTime;
++ A_UINT16 nominalMSDU; /* in octects */
++ A_UINT16 maxMSDU; /* in octects */
++ A_UINT8 trafficClass;
++ A_UINT8 trafficType; /* TRAFFIC_TYPE */
++ A_UINT8 trafficDirection; /* TRAFFIC_DIR */
++ A_UINT8 voicePSCapability; /* VOICEPS_CAP_TYPE */
++ A_UINT8 tsid;
++ A_UINT8 userPriority; /* 802.1D user priority */
++} POSTPACK WMI_CREATE_PSTREAM_CMD;
++
++/*
++ * WMI_DELETE_PSTREAM_CMDID
++ */
++typedef PREPACK struct {
++ A_UINT8 trafficClass;
++ A_UINT8 tsid;
++} POSTPACK WMI_DELETE_PSTREAM_CMD;
++
++/*
++ * WMI_SET_CHANNEL_PARAMS_CMDID
++ */
++typedef enum {
++ WMI_11A_MODE = 0x1,
++ WMI_11G_MODE = 0x2,
++ WMI_11AG_MODE = 0x3,
++ WMI_11B_MODE = 0x4,
++ WMI_11GONLY_MODE = 0x5,
++} WMI_PHY_MODE;
++
++#define WMI_MAX_CHANNELS 32
++
++typedef PREPACK struct {
++ A_UINT8 reserved1;
++ A_UINT8 scanParam; /* set if enable scan */
++ A_UINT8 phyMode; /* see WMI_PHY_MODE */
++ A_UINT8 numChannels; /* how many channels follow */
++ A_UINT16 channelList[1]; /* channels in Mhz */
++} POSTPACK WMI_CHANNEL_PARAMS_CMD;
++
++
++/*
++ * WMI_RSSI_THRESHOLD_PARAMS_CMDID
++ * Setting the polltime to 0 would disable polling.
++ * Threshold values are in the ascending order, and should agree to:
++ * (lowThreshold_lowerVal < lowThreshold_upperVal < highThreshold_lowerVal
++ * < highThreshold_upperVal)
++ */
++
++typedef PREPACK struct WMI_RSSI_THRESHOLD_PARAMS{
++ A_UINT32 pollTime; /* Polling time as a factor of LI */
++ A_INT16 thresholdAbove1_Val; /* lowest of upper */
++ A_INT16 thresholdAbove2_Val;
++ A_INT16 thresholdAbove3_Val;
++ A_INT16 thresholdAbove4_Val;
++ A_INT16 thresholdAbove5_Val;
++ A_INT16 thresholdAbove6_Val; /* highest of upper */
++ A_INT16 thresholdBelow1_Val; /* lowest of bellow */
++ A_INT16 thresholdBelow2_Val;
++ A_INT16 thresholdBelow3_Val;
++ A_INT16 thresholdBelow4_Val;
++ A_INT16 thresholdBelow5_Val;
++ A_INT16 thresholdBelow6_Val; /* highest of bellow */
++ A_UINT8 weight; /* "alpha" */
++ A_UINT8 reserved[3];
++} POSTPACK WMI_RSSI_THRESHOLD_PARAMS_CMD;
++
++/*
++ * WMI_SNR_THRESHOLD_PARAMS_CMDID
++ * Setting the polltime to 0 would disable polling.
++ */
++
++typedef PREPACK struct WMI_SNR_THRESHOLD_PARAMS{
++ A_UINT32 pollTime; /* Polling time as a factor of LI */
++ A_UINT8 weight; /* "alpha" */
++ A_UINT8 thresholdAbove1_Val; /* lowest of uppper*/
++ A_UINT8 thresholdAbove2_Val;
++ A_UINT8 thresholdAbove3_Val;
++ A_UINT8 thresholdAbove4_Val; /* highest of upper */
++ A_UINT8 thresholdBelow1_Val; /* lowest of bellow */
++ A_UINT8 thresholdBelow2_Val;
++ A_UINT8 thresholdBelow3_Val;
++ A_UINT8 thresholdBelow4_Val; /* highest of bellow */
++ A_UINT8 reserved[3];
++} POSTPACK WMI_SNR_THRESHOLD_PARAMS_CMD;
++
++/*
++ * WMI_LQ_THRESHOLD_PARAMS_CMDID
++ */
++typedef PREPACK struct WMI_LQ_THRESHOLD_PARAMS {
++ A_UINT8 enable;
++ A_UINT8 thresholdAbove1_Val;
++ A_UINT8 thresholdAbove2_Val;
++ A_UINT8 thresholdAbove3_Val;
++ A_UINT8 thresholdAbove4_Val;
++ A_UINT8 thresholdBelow1_Val;
++ A_UINT8 thresholdBelow2_Val;
++ A_UINT8 thresholdBelow3_Val;
++ A_UINT8 thresholdBelow4_Val;
++ A_UINT8 reserved[3];
++} POSTPACK WMI_LQ_THRESHOLD_PARAMS_CMD;
++
++typedef enum {
++ WMI_LPREAMBLE_DISABLED = 0,
++ WMI_LPREAMBLE_ENABLED
++} WMI_LPREAMBLE_STATUS;
++
++typedef PREPACK struct {
++ A_UINT8 status;
++}POSTPACK WMI_SET_LPREAMBLE_CMD;
++
++typedef PREPACK struct {
++ A_UINT16 threshold;
++}POSTPACK WMI_SET_RTS_CMD;
++
++/*
++ * WMI_TARGET_ERROR_REPORT_BITMASK_CMDID
++ * Sets the error reporting event bitmask in target. Target clears it
++ * upon an error. Subsequent errors are counted, but not reported
++ * via event, unless the bitmask is set again.
++ */
++typedef PREPACK struct {
++ A_UINT32 bitmask;
++} POSTPACK WMI_TARGET_ERROR_REPORT_BITMASK;
++
++/*
++ * WMI_SET_TX_PWR_CMDID
++ */
++typedef PREPACK struct {
++ A_UINT8 dbM; /* in dbM units */
++} POSTPACK WMI_SET_TX_PWR_CMD, WMI_TX_PWR_REPLY;
++
++/*
++ * WMI_SET_ASSOC_INFO_CMDID
++ *
++ * A maximum of 2 private IEs can be sent in the [Re]Assoc request.
++ * A 3rd one, the CCX version IE can also be set from the host.
++ */
++#define WMI_MAX_ASSOC_INFO_TYPE 2
++#define WMI_CCX_VER_IE 2 /* ieType to set CCX Version IE */
++
++#define WMI_MAX_ASSOC_INFO_LEN 240
++
++typedef PREPACK struct {
++ A_UINT8 ieType;
++ A_UINT8 bufferSize;
++ A_UINT8 assocInfo[1]; /* up to WMI_MAX_ASSOC_INFO_LEN */
++} POSTPACK WMI_SET_ASSOC_INFO_CMD;
++
++
++/*
++ * WMI_GET_TX_PWR_CMDID does not take any parameters
++ */
++
++/*
++ * WMI_ADD_BAD_AP_CMDID
++ */
++#define WMI_MAX_BAD_AP_INDEX 1
++
++typedef PREPACK struct {
++ A_UINT8 badApIndex; /* 0 to WMI_MAX_BAD_AP_INDEX */
++ A_UINT8 bssid[ATH_MAC_LEN];
++} POSTPACK WMI_ADD_BAD_AP_CMD;
++
++/*
++ * WMI_DELETE_BAD_AP_CMDID
++ */
++typedef PREPACK struct {
++ A_UINT8 badApIndex; /* 0 to WMI_MAX_BAD_AP_INDEX */
++} POSTPACK WMI_DELETE_BAD_AP_CMD;
++
++/*
++ * WMI_SET_ACCESS_PARAMS_CMDID
++ */
++#define WMI_DEFAULT_TXOP_ACPARAM 0 /* implies one MSDU */
++#define WMI_DEFAULT_ECWMIN_ACPARAM 4 /* corresponds to CWmin of 15 */
++#define WMI_DEFAULT_ECWMAX_ACPARAM 10 /* corresponds to CWmax of 1023 */
++#define WMI_MAX_CW_ACPARAM 15 /* maximum eCWmin or eCWmax */
++#define WMI_DEFAULT_AIFSN_ACPARAM 2
++#define WMI_MAX_AIFSN_ACPARAM 15
++typedef PREPACK struct {
++ A_UINT16 txop; /* in units of 32 usec */
++ A_UINT8 eCWmin;
++ A_UINT8 eCWmax;
++ A_UINT8 aifsn;
++} POSTPACK WMI_SET_ACCESS_PARAMS_CMD;
++
++
++/*
++ * WMI_SET_RETRY_LIMITS_CMDID
++ *
++ * This command is used to customize the number of retries the
++ * wlan device will perform on a given frame.
++ */
++#define WMI_MIN_RETRIES 2
++#define WMI_MAX_RETRIES 13
++typedef enum {
++ MGMT_FRAMETYPE = 0,
++ CONTROL_FRAMETYPE = 1,
++ DATA_FRAMETYPE = 2
++} WMI_FRAMETYPE;
++
++typedef PREPACK struct {
++ A_UINT8 frameType; /* WMI_FRAMETYPE */
++ A_UINT8 trafficClass; /* applies only to DATA_FRAMETYPE */
++ A_UINT8 maxRetries;
++ A_UINT8 enableNotify;
++} POSTPACK WMI_SET_RETRY_LIMITS_CMD;
++
++/*
++ * WMI_SET_ROAM_CTRL_CMDID
++ *
++ * This command is used to influence the Roaming behaviour
++ * Set the host biases of the BSSs before setting the roam mode as bias
++ * based.
++ */
++
++/*
++ * Different types of Roam Control
++ */
++
++typedef enum {
++ WMI_FORCE_ROAM = 1, /* Roam to the specified BSSID */
++ WMI_SET_ROAM_MODE = 2, /* default ,progd bias, no roam */
++ WMI_SET_HOST_BIAS = 3, /* Set the Host Bias */
++ WMI_SET_LOWRSSI_SCAN_PARAMS = 4, /* Set lowrssi Scan parameters */
++} WMI_ROAM_CTRL_TYPE;
++
++#define WMI_MIN_ROAM_CTRL_TYPE WMI_FORCE_ROAM
++#define WMI_MAX_ROAM_CTRL_TYPE WMI_SET_LOWRSSI_SCAN_PARAMS
++
++/*
++ * ROAM MODES
++ */
++
++typedef enum {
++ WMI_DEFAULT_ROAM_MODE = 1, /* RSSI based ROAM */
++ WMI_HOST_BIAS_ROAM_MODE = 2, /* HOST BIAS based ROAM */
++ WMI_LOCK_BSS_MODE = 3 /* Lock to the Current BSS - no Roam */
++} WMI_ROAM_MODE;
++
++/*
++ * BSS HOST BIAS INFO
++ */
++
++typedef PREPACK struct {
++ A_UINT8 bssid[ATH_MAC_LEN];
++ A_INT8 bias;
++} POSTPACK WMI_BSS_BIAS;
++
++typedef PREPACK struct {
++ A_UINT8 numBss;
++ WMI_BSS_BIAS bssBias[1];
++} POSTPACK WMI_BSS_BIAS_INFO;
++
++typedef PREPACK struct WMI_LOWRSSI_SCAN_PARAMS {
++ A_UINT16 lowrssi_scan_period;
++ A_INT16 lowrssi_scan_threshold;
++ A_INT16 lowrssi_roam_threshold;
++ A_UINT8 roam_rssi_floor;
++ A_UINT8 reserved[1]; /* For alignment */
++} POSTPACK WMI_LOWRSSI_SCAN_PARAMS;
++
++typedef PREPACK struct {
++ PREPACK union {
++ A_UINT8 bssid[ATH_MAC_LEN]; /* WMI_FORCE_ROAM */
++ A_UINT8 roamMode; /* WMI_SET_ROAM_MODE */
++ WMI_BSS_BIAS_INFO bssBiasInfo; /* WMI_SET_HOST_BIAS */
++ WMI_LOWRSSI_SCAN_PARAMS lrScanParams;
++ } POSTPACK info;
++ A_UINT8 roamCtrlType ;
++} POSTPACK WMI_SET_ROAM_CTRL_CMD;
++
++/*
++ * WMI_ENABLE_RM_CMDID
++ */
++typedef PREPACK struct {
++ A_BOOL enable_radio_measurements;
++} POSTPACK WMI_ENABLE_RM_CMD;
++
++/*
++ * WMI_SET_MAX_OFFHOME_DURATION_CMDID
++ */
++typedef PREPACK struct {
++ A_UINT8 max_offhome_duration;
++} POSTPACK WMI_SET_MAX_OFFHOME_DURATION_CMD;
++
++typedef PREPACK struct {
++ A_UINT32 frequency;
++ A_UINT8 threshold;
++} POSTPACK WMI_SET_HB_CHALLENGE_RESP_PARAMS_CMD;
++
++typedef enum {
++ BT_STREAM_UNDEF = 0,
++ BT_STREAM_SCO, /* SCO stream */
++ BT_STREAM_A2DP, /* A2DP stream */
++ BT_STREAM_MAX
++} BT_STREAM_TYPE;
++
++typedef enum {
++ BT_PARAM_SCO = 1, /* SCO stream parameters */
++ BT_PARAM_A2DP, /* A2DP stream parameters */
++ BT_PARAM_MISC, /* miscellaneous parameters */
++ BT_PARAM_REGS, /* co-existence register parameters */
++ BT_PARAM_MAX
++} BT_PARAM_TYPE;
++
++typedef enum {
++ BT_STATUS_UNDEF = 0,
++ BT_STATUS_START,
++ BT_STATUS_STOP,
++ BT_STATUS_RESUME,
++ BT_STATUS_SUSPEND,
++ BT_STATUS_MAX
++} BT_STREAM_STATUS;
++
++typedef PREPACK struct {
++ A_UINT8 streamType;
++ A_UINT8 status;
++} POSTPACK WMI_SET_BT_STATUS_CMD;
++
++typedef PREPACK struct {
++ A_UINT8 noSCOPkts;
++ A_UINT8 pspollTimeout;
++ A_UINT8 stompbt;
++} POSTPACK BT_PARAMS_SCO;
++
++typedef PREPACK struct {
++ A_UINT32 period;
++ A_UINT32 dutycycle;
++ A_UINT8 stompbt;
++} POSTPACK BT_PARAMS_A2DP;
++
++typedef PREPACK struct {
++ A_UINT32 mode;
++ A_UINT32 scoWghts;
++ A_UINT32 a2dpWghts;
++ A_UINT32 genWghts;
++ A_UINT32 mode2;
++ A_UINT8 setVal;
++} POSTPACK BT_COEX_REGS;
++
++typedef enum {
++ WLAN_PROTECT_POLICY = 1,
++ WLAN_COEX_CTRL_FLAGS
++} BT_PARAMS_MISC_TYPE;
++
++typedef enum {
++ WLAN_PROTECT_PER_STREAM = 0x01, /* default */
++ WLAN_PROTECT_ANY_TX = 0x02
++} WLAN_PROTECT_FLAGS;
++
++
++#define WLAN_DISABLE_COEX_IN_DISCONNECT 0x01 /* default */
++#define WLAN_KEEP_COEX_IN_DISCONNECT 0x02
++#define WLAN_STOMPBT_IN_DISCONNECT 0x04
++
++#define WLAN_DISABLE_COEX_IN_ROAM 0x10 /* default */
++#define WLAN_KEEP_COEX_IN_ROAM 0x20
++#define WLAN_STOMPBT_IN_ROAM 0x40
++
++#define WLAN_DISABLE_COEX_IN_SCAN 0x100 /* default */
++#define WLAN_KEEP_COEX_IN_SCAN 0x200
++#define WLAN_STOMPBT_IN_SCAN 0x400
++
++#define WLAN_DISABLE_COEX_BT_OFF 0x1000 /* default */
++#define WLAN_KEEP_COEX_BT_OFF 0x2000
++#define WLAN_STOMPBT_BT_OFF 0x4000
++
++typedef PREPACK struct {
++ A_UINT32 period;
++ A_UINT32 dutycycle;
++ A_UINT8 stompbt;
++ A_UINT8 policy;
++} POSTPACK WLAN_PROTECT_POLICY_TYPE;
++
++typedef PREPACK struct {
++ PREPACK union {
++ WLAN_PROTECT_POLICY_TYPE protectParams;
++ A_UINT16 wlanCtrlFlags;
++ } POSTPACK info;
++ A_UINT8 paramType;
++} POSTPACK BT_PARAMS_MISC;
++
++typedef PREPACK struct {
++ PREPACK union {
++ BT_PARAMS_SCO scoParams;
++ BT_PARAMS_A2DP a2dpParams;
++ BT_PARAMS_MISC miscParams;
++ BT_COEX_REGS regs;
++ } POSTPACK info;
++ A_UINT8 paramType;
++} POSTPACK WMI_SET_BT_PARAMS_CMD;
++
++/*
++ * Command Replies
++ */
++
++/*
++ * WMI_GET_CHANNEL_LIST_CMDID reply
++ */
++typedef PREPACK struct {
++ A_UINT8 reserved1;
++ A_UINT8 numChannels; /* number of channels in reply */
++ A_UINT16 channelList[1]; /* channel in Mhz */
++} POSTPACK WMI_CHANNEL_LIST_REPLY;
++
++typedef enum {
++ A_SUCCEEDED = A_OK,
++ A_FAILED_DELETE_STREAM_DOESNOT_EXIST=250,
++ A_SUCCEEDED_MODIFY_STREAM=251,
++ A_FAILED_INVALID_STREAM = 252,
++ A_FAILED_MAX_THINSTREAMS = 253,
++ A_FAILED_CREATE_REMOVE_PSTREAM_FIRST = 254,
++} PSTREAM_REPLY_STATUS;
++
++/*
++ * List of Events (target to host)
++ */
++typedef enum {
++ WMI_READY_EVENTID = 0x1001,
++ WMI_CONNECT_EVENTID,
++ WMI_DISCONNECT_EVENTID,
++ WMI_BSSINFO_EVENTID,
++ WMI_CMDERROR_EVENTID,
++ WMI_REGDOMAIN_EVENTID,
++ WMI_PSTREAM_TIMEOUT_EVENTID,
++ WMI_NEIGHBOR_REPORT_EVENTID,
++ WMI_TKIP_MICERR_EVENTID,
++ WMI_SCAN_COMPLETE_EVENTID,
++ WMI_REPORT_STATISTICS_EVENTID,
++ WMI_RSSI_THRESHOLD_EVENTID,
++ WMI_ERROR_REPORT_EVENTID,
++ WMI_OPT_RX_FRAME_EVENTID,
++ WMI_REPORT_ROAM_TBL_EVENTID,
++ WMI_EXTENSION_EVENTID,
++ WMI_CAC_EVENTID,
++ WMI_SNR_THRESHOLD_EVENTID,
++ WMI_LQ_THRESHOLD_EVENTID,
++ WMI_TX_RETRY_ERR_EVENTID,
++ WMI_REPORT_ROAM_DATA_EVENTID,
++ WMI_TEST_EVENTID,
++ WMI_APLIST_EVENTID,
++ WMI_GET_WOW_LIST_EVENTID,
++ WMI_GET_PMKID_LIST_EVENTID
++} WMI_EVENT_ID;
++
++typedef enum {
++ WMI_11A_CAPABILITY = 1,
++ WMI_11G_CAPABILITY = 2,
++ WMI_11AG_CAPABILITY = 3,
++} WMI_PHY_CAPABILITY;
++
++typedef PREPACK struct {
++ A_UINT8 macaddr[ATH_MAC_LEN];
++ A_UINT8 phyCapability; /* WMI_PHY_CAPABILITY */
++} POSTPACK WMI_READY_EVENT;
++
++/*
++ * Connect Event
++ */
++typedef PREPACK struct {
++ A_UINT16 channel;
++ A_UINT8 bssid[ATH_MAC_LEN];
++ A_UINT16 listenInterval;
++ A_UINT16 beaconInterval;
++ A_UINT32 networkType;
++ A_UINT8 beaconIeLen;
++ A_UINT8 assocReqLen;
++ A_UINT8 assocRespLen;
++ A_UINT8 assocInfo[1];
++} POSTPACK WMI_CONNECT_EVENT;
++
++/*
++ * Disconnect Event
++ */
++typedef enum {
++ NO_NETWORK_AVAIL = 0x01,
++ LOST_LINK = 0x02, /* bmiss */
++ DISCONNECT_CMD = 0x03,
++ BSS_DISCONNECTED = 0x04,
++ AUTH_FAILED = 0x05,
++ ASSOC_FAILED = 0x06,
++ NO_RESOURCES_AVAIL = 0x07,
++ CSERV_DISCONNECT = 0x08,
++ INVALID_PROFILE = 0x0a,
++ DOT11H_CHANNEL_SWITCH = 0x0b,
++} WMI_DISCONNECT_REASON;
++
++typedef PREPACK struct {
++ A_UINT16 protocolReasonStatus; /* reason code, see 802.11 spec. */
++ A_UINT8 bssid[ATH_MAC_LEN]; /* set if known */
++ A_UINT8 disconnectReason ; /* see WMI_DISCONNECT_REASON */
++ A_UINT8 assocRespLen;
++ A_UINT8 assocInfo[1];
++} POSTPACK WMI_DISCONNECT_EVENT;
++
++/*
++ * BSS Info Event.
++ * Mechanism used to inform host of the presence and characteristic of
++ * wireless networks present. Consists of bss info header followed by
++ * the beacon or probe-response frame body. The 802.11 header is not included.
++ */
++typedef enum {
++ BEACON_FTYPE = 0x1,
++ PROBERESP_FTYPE,
++ ACTION_MGMT_FTYPE,
++} WMI_BI_FTYPE;
++
++enum {
++ BSS_ELEMID_CHANSWITCH = 0x01,
++ BSS_ELEMID_ATHEROS = 0x02,
++};
++
++typedef PREPACK struct {
++ A_UINT16 channel;
++ A_UINT8 frameType; /* see WMI_BI_FTYPE */
++ A_UINT8 snr;
++ A_INT16 rssi;
++ A_UINT8 bssid[ATH_MAC_LEN];
++ A_UINT32 ieMask;
++} POSTPACK WMI_BSS_INFO_HDR;
++
++/*
++ * Command Error Event
++ */
++typedef enum {
++ INVALID_PARAM = 0x01,
++ ILLEGAL_STATE = 0x02,
++ INTERNAL_ERROR = 0x03,
++} WMI_ERROR_CODE;
++
++typedef PREPACK struct {
++ A_UINT16 commandId;
++ A_UINT8 errorCode;
++} POSTPACK WMI_CMD_ERROR_EVENT;
++
++/*
++ * New Regulatory Domain Event
++ */
++typedef PREPACK struct {
++ A_UINT32 regDomain;
++} POSTPACK WMI_REG_DOMAIN_EVENT;
++
++typedef PREPACK struct {
++ A_UINT8 trafficClass;
++} POSTPACK WMI_PSTREAM_TIMEOUT_EVENT;
++
++/*
++ * The WMI_NEIGHBOR_REPORT Event is generated by the target to inform
++ * the host of BSS's it has found that matches the current profile.
++ * It can be used by the host to cache PMKs and/to initiate pre-authentication
++ * if the BSS supports it. The first bssid is always the current associated
++ * BSS.
++ * The bssid and bssFlags information repeats according to the number
++ * or APs reported.
++ */
++typedef enum {
++ WMI_DEFAULT_BSS_FLAGS = 0x00,
++ WMI_PREAUTH_CAPABLE_BSS = 0x01,
++ WMI_PMKID_VALID_BSS = 0x02,
++} WMI_BSS_FLAGS;
++
++typedef PREPACK struct {
++ A_UINT8 bssid[ATH_MAC_LEN];
++ A_UINT8 bssFlags; /* see WMI_BSS_FLAGS */
++} POSTPACK WMI_NEIGHBOR_INFO;
++
++typedef PREPACK struct {
++ A_INT8 numberOfAps;
++ WMI_NEIGHBOR_INFO neighbor[1];
++} POSTPACK WMI_NEIGHBOR_REPORT_EVENT;
++
++/*
++ * TKIP MIC Error Event
++ */
++typedef PREPACK struct {
++ A_UINT8 keyid;
++ A_UINT8 ismcast;
++} POSTPACK WMI_TKIP_MICERR_EVENT;
++
++/*
++ * WMI_SCAN_COMPLETE_EVENTID - no parameters (old), staus parameter (new)
++ */
++typedef PREPACK struct {
++ A_STATUS status;
++} POSTPACK WMI_SCAN_COMPLETE_EVENT;
++
++#define MAX_OPT_DATA_LEN 1400
++
++/*
++ * WMI_SET_ADHOC_BSSID_CMDID
++ */
++typedef PREPACK struct {
++ A_UINT8 bssid[ATH_MAC_LEN];
++} POSTPACK WMI_SET_ADHOC_BSSID_CMD;
++
++/*
++ * WMI_SET_OPT_MODE_CMDID
++ */
++typedef enum {
++ SPECIAL_OFF,
++ SPECIAL_ON,
++} OPT_MODE_TYPE;
++
++typedef PREPACK struct {
++ A_UINT8 optMode;
++} POSTPACK WMI_SET_OPT_MODE_CMD;
++
++/*
++ * WMI_TX_OPT_FRAME_CMDID
++ */
++typedef enum {
++ OPT_PROBE_REQ = 0x01,
++ OPT_PROBE_RESP = 0x02,
++ OPT_CPPP_START = 0x03,
++ OPT_CPPP_STOP = 0x04,
++} WMI_OPT_FTYPE;
++
++typedef PREPACK struct {
++ A_UINT16 optIEDataLen;
++ A_UINT8 frmType;
++ A_UINT8 dstAddr[ATH_MAC_LEN];
++ A_UINT8 bssid[ATH_MAC_LEN];
++ A_UINT8 reserved; /* For alignment */
++ A_UINT8 optIEData[1];
++} POSTPACK WMI_OPT_TX_FRAME_CMD;
++
++/*
++ * Special frame receive Event.
++ * Mechanism used to inform host of the receiption of the special frames.
++ * Consists of special frame info header followed by special frame body.
++ * The 802.11 header is not included.
++ */
++typedef PREPACK struct {
++ A_UINT16 channel;
++ A_UINT8 frameType; /* see WMI_OPT_FTYPE */
++ A_INT8 snr;
++ A_UINT8 srcAddr[ATH_MAC_LEN];
++ A_UINT8 bssid[ATH_MAC_LEN];
++} POSTPACK WMI_OPT_RX_INFO_HDR;
++
++/*
++ * Reporting statistics.
++ */
++typedef PREPACK struct {
++ A_UINT32 tx_packets;
++ A_UINT32 tx_bytes;
++ A_UINT32 tx_unicast_pkts;
++ A_UINT32 tx_unicast_bytes;
++ A_UINT32 tx_multicast_pkts;
++ A_UINT32 tx_multicast_bytes;
++ A_UINT32 tx_broadcast_pkts;
++ A_UINT32 tx_broadcast_bytes;
++ A_UINT32 tx_rts_success_cnt;
++ A_UINT32 tx_packet_per_ac[4];
++ A_UINT32 tx_errors_per_ac[4];
++
++ A_UINT32 tx_errors;
++ A_UINT32 tx_failed_cnt;
++ A_UINT32 tx_retry_cnt;
++ A_UINT32 tx_rts_fail_cnt;
++ A_INT32 tx_unicast_rate;
++}POSTPACK tx_stats_t;
++
++typedef PREPACK struct {
++ A_UINT32 rx_packets;
++ A_UINT32 rx_bytes;
++ A_UINT32 rx_unicast_pkts;
++ A_UINT32 rx_unicast_bytes;
++ A_UINT32 rx_multicast_pkts;
++ A_UINT32 rx_multicast_bytes;
++ A_UINT32 rx_broadcast_pkts;
++ A_UINT32 rx_broadcast_bytes;
++ A_UINT32 rx_fragment_pkt;
++
++ A_UINT32 rx_errors;
++ A_UINT32 rx_crcerr;
++ A_UINT32 rx_key_cache_miss;
++ A_UINT32 rx_decrypt_err;
++ A_UINT32 rx_duplicate_frames;
++ A_INT32 rx_unicast_rate;
++}POSTPACK rx_stats_t;
++
++typedef PREPACK struct {
++ A_UINT32 tkip_local_mic_failure;
++ A_UINT32 tkip_counter_measures_invoked;
++ A_UINT32 tkip_replays;
++ A_UINT32 tkip_format_errors;
++ A_UINT32 ccmp_format_errors;
++ A_UINT32 ccmp_replays;
++}POSTPACK tkip_ccmp_stats_t;
++
++typedef PREPACK struct {
++ A_UINT32 power_save_failure_cnt;
++}POSTPACK pm_stats_t;
++
++typedef PREPACK struct {
++ A_UINT32 cs_bmiss_cnt;
++ A_UINT32 cs_lowRssi_cnt;
++ A_UINT16 cs_connect_cnt;
++ A_UINT16 cs_disconnect_cnt;
++ A_INT16 cs_aveBeacon_rssi;
++ A_UINT16 cs_roam_count;
++ A_UINT16 cs_rssi;
++ A_UINT8 cs_snr;
++ A_UINT8 cs_aveBeacon_snr;
++ A_UINT8 cs_lastRoam_msec;
++} POSTPACK cserv_stats_t;
++
++typedef PREPACK struct {
++ tx_stats_t tx_stats;
++ rx_stats_t rx_stats;
++ tkip_ccmp_stats_t tkipCcmpStats;
++}POSTPACK wlan_net_stats_t;
++
++typedef PREPACK struct {
++ A_UINT32 wow_num_pkts_dropped;
++ A_UINT16 wow_num_events_discarded;
++ A_UINT8 wow_num_host_pkt_wakeups;
++ A_UINT8 wow_num_host_event_wakeups;
++} POSTPACK wlan_wow_stats_t;
++
++typedef PREPACK struct {
++ A_UINT32 lqVal;
++ A_INT32 noise_floor_calibation;
++ pm_stats_t pmStats;
++ wlan_net_stats_t txrxStats;
++ wlan_wow_stats_t wowStats;
++ cserv_stats_t cservStats;
++} POSTPACK WMI_TARGET_STATS;
++
++/*
++ * WMI_RSSI_THRESHOLD_EVENTID.
++ * Indicate the RSSI events to host. Events are indicated when we breach a
++ * thresold value.
++ */
++typedef enum{
++ WMI_RSSI_THRESHOLD1_ABOVE = 0,
++ WMI_RSSI_THRESHOLD2_ABOVE,
++ WMI_RSSI_THRESHOLD3_ABOVE,
++ WMI_RSSI_THRESHOLD4_ABOVE,
++ WMI_RSSI_THRESHOLD5_ABOVE,
++ WMI_RSSI_THRESHOLD6_ABOVE,
++ WMI_RSSI_THRESHOLD1_BELOW,
++ WMI_RSSI_THRESHOLD2_BELOW,
++ WMI_RSSI_THRESHOLD3_BELOW,
++ WMI_RSSI_THRESHOLD4_BELOW,
++ WMI_RSSI_THRESHOLD5_BELOW,
++ WMI_RSSI_THRESHOLD6_BELOW
++}WMI_RSSI_THRESHOLD_VAL;
++
++typedef PREPACK struct {
++ A_INT16 rssi;
++ A_UINT8 range;
++}POSTPACK WMI_RSSI_THRESHOLD_EVENT;
++
++/*
++ * WMI_ERROR_REPORT_EVENTID
++ */
++typedef enum{
++ WMI_TARGET_PM_ERR_FAIL = 0x00000001,
++ WMI_TARGET_KEY_NOT_FOUND = 0x00000002,
++ WMI_TARGET_DECRYPTION_ERR = 0x00000004,
++ WMI_TARGET_BMISS = 0x00000008,
++ WMI_PSDISABLE_NODE_JOIN = 0x00000010,
++ WMI_TARGET_COM_ERR = 0x00000020,
++ WMI_TARGET_FATAL_ERR = 0x00000040
++} WMI_TARGET_ERROR_VAL;
++
++typedef PREPACK struct {
++ A_UINT32 errorVal;
++}POSTPACK WMI_TARGET_ERROR_REPORT_EVENT;
++
++typedef PREPACK struct {
++ A_UINT8 retrys;
++}POSTPACK WMI_TX_RETRY_ERR_EVENT;
++
++typedef enum{
++ WMI_SNR_THRESHOLD1_ABOVE = 1,
++ WMI_SNR_THRESHOLD1_BELOW,
++ WMI_SNR_THRESHOLD2_ABOVE,
++ WMI_SNR_THRESHOLD2_BELOW,
++ WMI_SNR_THRESHOLD3_ABOVE,
++ WMI_SNR_THRESHOLD3_BELOW,
++ WMI_SNR_THRESHOLD4_ABOVE,
++ WMI_SNR_THRESHOLD4_BELOW
++} WMI_SNR_THRESHOLD_VAL;
++
++typedef PREPACK struct {
++ A_UINT8 range; /* WMI_SNR_THRESHOLD_VAL */
++ A_UINT8 snr;
++}POSTPACK WMI_SNR_THRESHOLD_EVENT;
++
++typedef enum{
++ WMI_LQ_THRESHOLD1_ABOVE = 1,
++ WMI_LQ_THRESHOLD1_BELOW,
++ WMI_LQ_THRESHOLD2_ABOVE,
++ WMI_LQ_THRESHOLD2_BELOW,
++ WMI_LQ_THRESHOLD3_ABOVE,
++ WMI_LQ_THRESHOLD3_BELOW,
++ WMI_LQ_THRESHOLD4_ABOVE,
++ WMI_LQ_THRESHOLD4_BELOW
++} WMI_LQ_THRESHOLD_VAL;
++
++typedef PREPACK struct {
++ A_INT32 lq;
++ A_UINT8 range; /* WMI_LQ_THRESHOLD_VAL */
++}POSTPACK WMI_LQ_THRESHOLD_EVENT;
++/*
++ * WMI_REPORT_ROAM_TBL_EVENTID
++ */
++#define MAX_ROAM_TBL_CAND 5
++
++typedef PREPACK struct {
++ A_INT32 roam_util;
++ A_UINT8 bssid[ATH_MAC_LEN];
++ A_INT8 rssi;
++ A_INT8 rssidt;
++ A_INT8 last_rssi;
++ A_INT8 util;
++ A_INT8 bias;
++ A_UINT8 reserved; /* For alignment */
++} POSTPACK WMI_BSS_ROAM_INFO;
++
++
++typedef PREPACK struct {
++ A_UINT16 roamMode;
++ A_UINT16 numEntries;
++ WMI_BSS_ROAM_INFO bssRoamInfo[1];
++} POSTPACK WMI_TARGET_ROAM_TBL;
++
++/*
++ * WMI_CAC_EVENTID
++ */
++typedef enum {
++ CAC_INDICATION_ADMISSION = 0x00,
++ CAC_INDICATION_ADMISSION_RESP = 0x01,
++ CAC_INDICATION_DELETE = 0x02,
++ CAC_INDICATION_NO_RESP = 0x03,
++}CAC_INDICATION;
++
++#define WMM_TSPEC_IE_LEN 63
++
++typedef PREPACK struct {
++ A_UINT8 ac;
++ A_UINT8 cac_indication;
++ A_UINT8 statusCode;
++ A_UINT8 tspecSuggestion[WMM_TSPEC_IE_LEN];
++}POSTPACK WMI_CAC_EVENT;
++
++/*
++ * WMI_APLIST_EVENTID
++ */
++
++typedef enum {
++ APLIST_VER1 = 1,
++} APLIST_VER;
++
++typedef PREPACK struct {
++ A_UINT8 bssid[ATH_MAC_LEN];
++ A_UINT16 channel;
++} POSTPACK WMI_AP_INFO_V1;
++
++typedef PREPACK union {
++ WMI_AP_INFO_V1 apInfoV1;
++} POSTPACK WMI_AP_INFO;
++
++typedef PREPACK struct {
++ A_UINT8 apListVer;
++ A_UINT8 numAP;
++ WMI_AP_INFO apList[1];
++} POSTPACK WMI_APLIST_EVENT;
++
++/*
++ * developer commands
++ */
++
++/*
++ * WMI_SET_BITRATE_CMDID
++ *
++ * Get bit rate cmd uses same definition as set bit rate cmd
++ */
++typedef enum {
++ RATE_AUTO = -1,
++ RATE_1Mb = 0,
++ RATE_2Mb = 1,
++ RATE_5_5Mb = 2,
++ RATE_11Mb = 3,
++ RATE_6Mb = 4,
++ RATE_9Mb = 5,
++ RATE_12Mb = 6,
++ RATE_18Mb = 7,
++ RATE_24Mb = 8,
++ RATE_36Mb = 9,
++ RATE_48Mb = 10,
++ RATE_54Mb = 11,
++} WMI_BIT_RATE;
++
++typedef PREPACK struct {
++ A_INT8 rateIndex; /* see WMI_BIT_RATE */
++} POSTPACK WMI_BIT_RATE_CMD, WMI_BIT_RATE_REPLY;
++
++/*
++ * WMI_SET_FIXRATES_CMDID
++ *
++ * Get fix rates cmd uses same definition as set fix rates cmd
++ */
++typedef enum {
++ FIX_RATE_1Mb = 0x1,
++ FIX_RATE_2Mb = 0x2,
++ FIX_RATE_5_5Mb = 0x4,
++ FIX_RATE_11Mb = 0x8,
++ FIX_RATE_6Mb = 0x10,
++ FIX_RATE_9Mb = 0x20,
++ FIX_RATE_12Mb = 0x40,
++ FIX_RATE_18Mb = 0x80,
++ FIX_RATE_24Mb = 0x100,
++ FIX_RATE_36Mb = 0x200,
++ FIX_RATE_48Mb = 0x400,
++ FIX_RATE_54Mb = 0x800,
++} WMI_FIX_RATES_MASK;
++
++typedef PREPACK struct {
++ A_UINT16 fixRateMask; /* see WMI_BIT_RATE */
++} POSTPACK WMI_FIX_RATES_CMD, WMI_FIX_RATES_REPLY;
++
++/*
++ * WMI_SET_RECONNECT_AUTH_MODE_CMDID
++ *
++ * Set authentication mode
++ */
++typedef enum {
++ RECONN_DO_AUTH = 0x00,
++ RECONN_NOT_AUTH = 0x01
++} WMI_AUTH_MODE;
++
++typedef PREPACK struct {
++ A_UINT8 mode;
++} POSTPACK WMI_SET_AUTH_MODE_CMD;
++
++/*
++ * WMI_SET_REASSOC_MODE_CMDID
++ *
++ * Set authentication mode
++ */
++typedef enum {
++ REASSOC_DO_DISASSOC = 0x00,
++ REASSOC_DONOT_DISASSOC = 0x01
++} WMI_REASSOC_MODE;
++
++typedef PREPACK struct {
++ A_UINT8 mode;
++}POSTPACK WMI_SET_REASSOC_MODE_CMD;
++
++typedef enum {
++ ROAM_DATA_TIME = 1, /* Get The Roam Time Data */
++} ROAM_DATA_TYPE;
++
++typedef PREPACK struct {
++ A_UINT32 disassoc_time;
++ A_UINT32 no_txrx_time;
++ A_UINT32 assoc_time;
++ A_UINT32 allow_txrx_time;
++ A_UINT32 last_data_txrx_time;
++ A_UINT32 first_data_txrx_time;
++ A_UINT8 disassoc_bssid[ATH_MAC_LEN];
++ A_INT8 disassoc_bss_rssi;
++ A_UINT8 assoc_bssid[ATH_MAC_LEN];
++ A_INT8 assoc_bss_rssi;
++} POSTPACK WMI_TARGET_ROAM_TIME;
++
++typedef PREPACK struct {
++ PREPACK union {
++ WMI_TARGET_ROAM_TIME roamTime;
++ } POSTPACK u;
++ A_UINT8 roamDataType ;
++} POSTPACK WMI_TARGET_ROAM_DATA;
++
++typedef enum {
++ WMI_WMM_DISABLED = 0,
++ WMI_WMM_ENABLED
++} WMI_WMM_STATUS;
++
++typedef PREPACK struct {
++ A_UINT8 status;
++}POSTPACK WMI_SET_WMM_CMD;
++
++typedef enum {
++ WMI_TXOP_DISABLED = 0,
++ WMI_TXOP_ENABLED
++} WMI_TXOP_CFG;
++
++typedef PREPACK struct {
++ A_UINT8 txopEnable;
++}POSTPACK WMI_SET_WMM_TXOP_CMD;
++
++typedef PREPACK struct {
++ A_UINT8 keepaliveInterval;
++} POSTPACK WMI_SET_KEEPALIVE_CMD;
++
++typedef PREPACK struct {
++ A_BOOL configured;
++ A_UINT8 keepaliveInterval;
++} POSTPACK WMI_GET_KEEPALIVE_CMD;
++
++/*
++ * Add Application specified IE to a management frame
++ */
++#define WMI_MAX_IE_LEN 78
++
++typedef PREPACK struct {
++ A_UINT8 mgmtFrmType; /* one of WMI_MGMT_FRAME_TYPE */
++ A_UINT8 ieLen; /* Length of the IE that should be added to the MGMT frame */
++ A_UINT8 ieInfo[1];
++} POSTPACK WMI_SET_APPIE_CMD;
++
++/*
++ * Notify the WSC registration status to the target
++ */
++#define WSC_REG_ACTIVE 1
++#define WSC_REG_INACTIVE 0
++/* Generic Hal Interface for setting hal paramters. */
++/* Add new Set HAL Param cmdIds here for newer params */
++typedef enum {
++ WHAL_SETCABTO_CMDID = 1,
++}WHAL_CMDID;
++
++typedef PREPACK struct {
++ A_UINT8 cabTimeOut;
++} POSTPACK WHAL_SETCABTO_PARAM;
++
++typedef PREPACK struct {
++ A_UINT8 whalCmdId;
++ A_UINT8 data[1];
++} POSTPACK WHAL_PARAMCMD;
++
++
++#define WOW_MAX_FILTER_LISTS 1 /*4*/
++#define WOW_MAX_FILTERS_PER_LIST 4
++#define WOW_PATTERN_SIZE 64
++#define WOW_MASK_SIZE 64
++
++typedef PREPACK struct {
++ A_UINT8 wow_valid_filter;
++ A_UINT8 wow_filter_id;
++ A_UINT8 wow_filter_size;
++ A_UINT8 wow_filter_offset;
++ A_UINT8 wow_filter_mask[WOW_MASK_SIZE];
++ A_UINT8 wow_filter_pattern[WOW_PATTERN_SIZE];
++} POSTPACK WOW_FILTER;
++
++
++typedef PREPACK struct {
++ A_UINT8 wow_valid_list;
++ A_UINT8 wow_list_id;
++ A_UINT8 wow_num_filters;
++ A_UINT8 wow_total_list_size;
++ WOW_FILTER list[WOW_MAX_FILTERS_PER_LIST];
++} POSTPACK WOW_FILTER_LIST;
++
++typedef PREPACK struct {
++ A_BOOL awake;
++ A_BOOL asleep;
++} POSTPACK WMI_SET_HOST_SLEEP_MODE_CMD;
++
++typedef PREPACK struct {
++ A_BOOL enable_wow;
++} POSTPACK WMI_SET_WOW_MODE_CMD;
++
++typedef PREPACK struct {
++ A_UINT8 filter_list_id;
++} POSTPACK WMI_GET_WOW_LIST_CMD;
++
++/*
++ * WMI_GET_WOW_LIST_CMD reply
++ */
++typedef PREPACK struct {
++ A_UINT8 num_filters; /* number of patterns in reply */
++ A_UINT8 this_filter_num; /* this is filter # x of total num_filters */
++ A_UINT8 wow_mode;
++ A_UINT8 host_mode;
++ WOW_FILTER wow_filters[1];
++} POSTPACK WMI_GET_WOW_LIST_REPLY;
++
++typedef PREPACK struct {
++ A_UINT8 filter_list_id;
++ A_UINT8 filter_size;
++ A_UINT8 filter_offset;
++ A_UINT8 filter[1];
++} POSTPACK WMI_ADD_WOW_PATTERN_CMD;
++
++typedef PREPACK struct {
++ A_UINT16 filter_list_id;
++ A_UINT16 filter_id;
++} POSTPACK WMI_DEL_WOW_PATTERN_CMD;
++
++typedef PREPACK struct {
++ A_UINT8 macaddr[ATH_MAC_LEN];
++} POSTPACK WMI_SET_MAC_ADDRESS_CMD;
++
++/*
++ * WMI_SET_AKMP_PARAMS_CMD
++ */
++
++#define WMI_AKMP_MULTI_PMKID_EN 0x000001
++
++typedef PREPACK struct {
++ A_UINT32 akmpInfo;
++} POSTPACK WMI_SET_AKMP_PARAMS_CMD;
++
++typedef PREPACK struct {
++ A_UINT8 pmkid[WMI_PMKID_LEN];
++} POSTPACK WMI_PMKID;
++
++/*
++ * WMI_SET_PMKID_LIST_CMD
++ */
++#define WMI_MAX_PMKID_CACHE 8
++
++typedef PREPACK struct {
++ A_UINT32 numPMKID;
++ WMI_PMKID pmkidList[WMI_MAX_PMKID_CACHE];
++} POSTPACK WMI_SET_PMKID_LIST_CMD;
++
++/*
++ * WMI_GET_PMKID_LIST_CMD Reply
++ * Following the Number of PMKIDs is the list of PMKIDs
++ */
++typedef PREPACK struct {
++ A_UINT32 numPMKID;
++ WMI_PMKID pmkidList[1];
++} POSTPACK WMI_PMKID_LIST_REPLY;
++
++/* index used for priority streams */
++typedef enum {
++ WMI_NOT_MAPPED = -1,
++ WMI_CONTROL_PRI = 0,
++ WMI_BEST_EFFORT_PRI = 1,
++ WMI_LOW_PRI = 2,
++ WMI_HIGH_PRI = 3,
++ WMI_HIGHEST_PRI,
++ WMI_PRI_MAX_COUNT
++} WMI_PRI_STREAM_ID;
++
++#ifndef ATH_TARGET
++#include "athendpack.h"
++#endif
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* _WMI_H_ */
+diff --git a/drivers/ar6000/include/wmi_api.h b/drivers/ar6000/include/wmi_api.h
+new file mode 100644
+index 0000000..267edfd
+--- /dev/null
++++ b/drivers/ar6000/include/wmi_api.h
+@@ -0,0 +1,260 @@
++#ifndef _WMI_API_H_
++#define _WMI_API_H_
++/*
++ * Copyright (c) 2004-2006 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ * This file contains the definitions for the Wireless Module Interface (WMI).
++ *
++ * $Id: //depot/sw/releases/olca2.0-GPL/host/include/wmi_api.h#2 $
++ *
++ *
++ * 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
++
++/*
++ * IP QoS Field definitions according to 802.1p
++ */
++#define BEST_EFFORT_PRI 0
++#define BACKGROUND_PRI 1
++#define EXCELLENT_EFFORT_PRI 3
++#define CONTROLLED_LOAD_PRI 4
++#define VIDEO_PRI 5
++#define VOICE_PRI 6
++#define NETWORK_CONTROL_PRI 7
++#define MAX_NUM_PRI 8
++
++#define UNDEFINED_PRI (0xff)
++
++/* simple mapping of IP TOS field to a WMI priority stream
++ * this mapping was taken from the original linux driver implementation
++ * The operation maps the following
++ *
++ * */
++#define IP_TOS_TO_WMI_PRI(tos) \
++ ((WMI_PRI_STREAM_ID)(((tos) >> 1) & 0x03))
++
++#define WMI_IMPLICIT_PSTREAM_INACTIVITY_INT 5000 /* 5 seconds */
++
++
++struct wmi_t;
++
++void *wmi_init(void *devt);
++
++void wmi_qos_state_init(struct wmi_t *wmip);
++void wmi_shutdown(struct wmi_t *wmip);
++A_UINT16 wmi_get_mapped_qos_queue(struct wmi_t *, A_UINT8);
++A_STATUS wmi_dix_2_dot3(struct wmi_t *wmip, void *osbuf);
++A_STATUS wmi_data_hdr_add(struct wmi_t *wmip, void *osbuf, A_UINT8 msgType);
++A_STATUS wmi_dot3_2_dix(struct wmi_t *wmip, void *osbuf);
++A_STATUS wmi_data_hdr_remove(struct wmi_t *wmip, void *osbuf);
++A_STATUS wmi_syncpoint(struct wmi_t *wmip);
++A_STATUS wmi_syncpoint_reset(struct wmi_t *wmip);
++WMI_PRI_STREAM_ID wmi_get_stream_id(struct wmi_t *wmip, A_UINT8 trafficClass);
++A_UINT8 wmi_implicit_create_pstream(struct wmi_t *wmip, void *osbuf, A_UINT8 dir, A_UINT8 up);
++
++A_STATUS wmi_control_rx(struct wmi_t *wmip, void *osbuf);
++void wmi_iterate_nodes(struct wmi_t *wmip, wlan_node_iter_func *f, void *arg);
++void wmi_free_allnodes(struct wmi_t *wmip);
++bss_t *wmi_find_node(struct wmi_t *wmip, const A_UINT8 *macaddr);
++
++
++typedef enum {
++ NO_SYNC_WMIFLAG = 0,
++ SYNC_BEFORE_WMIFLAG, /* transmit all queued data before cmd */
++ SYNC_AFTER_WMIFLAG, /* any new data waits until cmd execs */
++ SYNC_BOTH_WMIFLAG,
++ END_WMIFLAG /* end marker */
++} WMI_SYNC_FLAG;
++
++A_STATUS wmi_cmd_send(struct wmi_t *wmip, void *osbuf, WMI_COMMAND_ID cmdId,
++ WMI_SYNC_FLAG flag);
++A_STATUS wmi_connect_cmd(struct wmi_t *wmip,
++ NETWORK_TYPE netType,
++ DOT11_AUTH_MODE dot11AuthMode,
++ AUTH_MODE authMode,
++ CRYPTO_TYPE pairwiseCrypto,
++ A_UINT8 pairwiseCryptoLen,
++ CRYPTO_TYPE groupCrypto,
++ A_UINT8 groupCryptoLen,
++ int ssidLength,
++ A_UCHAR *ssid,
++ A_UINT8 *bssid,
++ A_UINT16 channel,
++ A_UINT32 ctrl_flags);
++A_STATUS wmi_reconnect_cmd(struct wmi_t *wmip,
++ A_UINT8 *bssid,
++ A_UINT16 channel);
++A_STATUS wmi_disconnect_cmd(struct wmi_t *wmip);
++A_STATUS wmi_getrev_cmd(struct wmi_t *wmip);
++A_STATUS wmi_startscan_cmd(struct wmi_t *wmip, WMI_SCAN_TYPE scanType,
++ A_BOOL forceFgScan, A_BOOL isLegacy,
++ A_UINT32 homeDwellTime, A_UINT32 forceScanInterval);
++A_STATUS wmi_scanparams_cmd(struct wmi_t *wmip, A_UINT16 fg_start_sec,
++ A_UINT16 fg_end_sec, A_UINT16 bg_sec,
++ A_UINT16 minact_chdw_msec,
++ A_UINT16 maxact_chdw_msec, A_UINT16 pas_chdw_msec,
++ A_UINT8 shScanRatio, A_UINT8 scanCtrlFlags,
++ A_UINT32 max_dfsch_act_time);
++A_STATUS wmi_bssfilter_cmd(struct wmi_t *wmip, A_UINT8 filter, A_UINT32 ieMask);
++A_STATUS wmi_probedSsid_cmd(struct wmi_t *wmip, A_UINT8 index, A_UINT8 flag,
++ A_UINT8 ssidLength, A_UCHAR *ssid);
++A_STATUS wmi_listeninterval_cmd(struct wmi_t *wmip, A_UINT16 listenInterval, A_UINT16 listenBeacons);
++A_STATUS wmi_bmisstime_cmd(struct wmi_t *wmip, A_UINT16 bmisstime, A_UINT16 bmissbeacons);
++A_STATUS wmi_associnfo_cmd(struct wmi_t *wmip, A_UINT8 ieType,
++ A_UINT8 ieLen, A_UINT8 *ieInfo);
++A_STATUS wmi_powermode_cmd(struct wmi_t *wmip, A_UINT8 powerMode);
++A_STATUS wmi_ibsspmcaps_cmd(struct wmi_t *wmip, A_UINT8 pmEnable, A_UINT8 ttl,
++ A_UINT16 atim_windows, A_UINT16 timeout_value);
++A_STATUS wmi_pmparams_cmd(struct wmi_t *wmip, A_UINT16 idlePeriod,
++ A_UINT16 psPollNum, A_UINT16 dtimPolicy);
++A_STATUS wmi_disctimeout_cmd(struct wmi_t *wmip, A_UINT8 timeout);
++A_STATUS wmi_sync_cmd(struct wmi_t *wmip, A_UINT8 syncNumber);
++A_STATUS wmi_create_pstream_cmd(struct wmi_t *wmip, WMI_CREATE_PSTREAM_CMD *pstream);
++A_STATUS wmi_delete_pstream_cmd(struct wmi_t *wmip, A_UINT8 trafficClass, A_UINT8 streamID);
++A_STATUS wmi_set_bitrate_cmd(struct wmi_t *wmip, A_INT32 rate);
++A_STATUS wmi_get_bitrate_cmd(struct wmi_t *wmip);
++A_INT8 wmi_validate_bitrate(struct wmi_t *wmip, A_INT32 rate);
++A_STATUS wmi_get_regDomain_cmd(struct wmi_t *wmip);
++A_STATUS wmi_get_channelList_cmd(struct wmi_t *wmip);
++A_STATUS wmi_set_channelParams_cmd(struct wmi_t *wmip, A_UINT8 scanParam,
++ WMI_PHY_MODE mode, A_INT8 numChan,
++ A_UINT16 *channelList);
++
++A_STATUS wmi_set_snr_threshold_params(struct wmi_t *wmip,
++ WMI_SNR_THRESHOLD_PARAMS_CMD *snrCmd);
++A_STATUS wmi_set_rssi_threshold_params(struct wmi_t *wmip,
++ WMI_RSSI_THRESHOLD_PARAMS_CMD *rssiCmd);
++A_STATUS wmi_clr_rssi_snr(struct wmi_t *wmip);
++A_STATUS wmi_set_lq_threshold_params(struct wmi_t *wmip,
++ WMI_LQ_THRESHOLD_PARAMS_CMD *lqCmd);
++A_STATUS wmi_set_rts_cmd(struct wmi_t *wmip, A_UINT16 threshold);
++A_STATUS wmi_set_lpreamble_cmd(struct wmi_t *wmip, A_UINT8 status);
++
++A_STATUS wmi_set_error_report_bitmask(struct wmi_t *wmip, A_UINT32 bitmask);
++
++A_STATUS wmi_get_challenge_resp_cmd(struct wmi_t *wmip, A_UINT32 cookie,
++ A_UINT32 source);
++A_STATUS wmi_config_debug_module_cmd(struct wmi_t *wmip, A_UINT16 mmask,
++ A_UINT16 tsr, A_BOOL rep, A_UINT16 size,
++ A_UINT32 valid);
++A_STATUS wmi_get_stats_cmd(struct wmi_t *wmip);
++A_STATUS wmi_addKey_cmd(struct wmi_t *wmip, A_UINT8 keyIndex,
++ CRYPTO_TYPE keyType, A_UINT8 keyUsage,
++ A_UINT8 keyLength,A_UINT8 *keyRSC,
++ A_UINT8 *keyMaterial, A_UINT8 key_op_ctrl,
++ WMI_SYNC_FLAG sync_flag);
++A_STATUS wmi_add_krk_cmd(struct wmi_t *wmip, A_UINT8 *krk);
++A_STATUS wmi_delete_krk_cmd(struct wmi_t *wmip);
++A_STATUS wmi_deleteKey_cmd(struct wmi_t *wmip, A_UINT8 keyIndex);
++A_STATUS wmi_set_akmp_params_cmd(struct wmi_t *wmip,
++ WMI_SET_AKMP_PARAMS_CMD *akmpParams);
++A_STATUS wmi_get_pmkid_list_cmd(struct wmi_t *wmip);
++A_STATUS wmi_set_pmkid_list_cmd(struct wmi_t *wmip,
++ WMI_SET_PMKID_LIST_CMD *pmkInfo);
++A_STATUS wmi_set_txPwr_cmd(struct wmi_t *wmip, A_UINT8 dbM);
++A_STATUS wmi_get_txPwr_cmd(struct wmi_t *wmip);
++A_STATUS wmi_switch_radio(struct wmi_t *wmip, A_UINT8 on);
++A_STATUS wmi_addBadAp_cmd(struct wmi_t *wmip, A_UINT8 apIndex, A_UINT8 *bssid);
++A_STATUS wmi_deleteBadAp_cmd(struct wmi_t *wmip, A_UINT8 apIndex);
++A_STATUS wmi_set_tkip_countermeasures_cmd(struct wmi_t *wmip, A_BOOL en);
++A_STATUS wmi_setPmkid_cmd(struct wmi_t *wmip, A_UINT8 *bssid, A_UINT8 *pmkId,
++ A_BOOL set);
++A_STATUS wmi_set_access_params_cmd(struct wmi_t *wmip, A_UINT16 txop,
++ A_UINT8 eCWmin, A_UINT8 eCWmax,
++ A_UINT8 aifsn);
++A_STATUS wmi_set_retry_limits_cmd(struct wmi_t *wmip, A_UINT8 frameType,
++ A_UINT8 trafficClass, A_UINT8 maxRetries,
++ A_UINT8 enableNotify);
++
++void wmi_get_current_bssid(struct wmi_t *wmip, A_UINT8 *bssid);
++
++A_STATUS wmi_get_roam_tbl_cmd(struct wmi_t *wmip);
++A_STATUS wmi_get_roam_data_cmd(struct wmi_t *wmip, A_UINT8 roamDataType);
++A_STATUS wmi_set_roam_ctrl_cmd(struct wmi_t *wmip, WMI_SET_ROAM_CTRL_CMD *p,
++ A_UINT8 size);
++A_STATUS wmi_set_powersave_timers_cmd(struct wmi_t *wmip,
++ WMI_POWERSAVE_TIMERS_POLICY_CMD *pCmd,
++ A_UINT8 size);
++
++A_STATUS wmi_set_opt_mode_cmd(struct wmi_t *wmip, A_UINT8 optMode);
++A_STATUS wmi_opt_tx_frame_cmd(struct wmi_t *wmip,
++ A_UINT8 frmType,
++ A_UINT8 *dstMacAddr,
++ A_UINT8 *bssid,
++ A_UINT16 optIEDataLen,
++ A_UINT8 *optIEData);
++
++A_STATUS wmi_set_adhoc_bconIntvl_cmd(struct wmi_t *wmip, A_UINT16 intvl);
++A_STATUS wmi_set_voice_pkt_size_cmd(struct wmi_t *wmip, A_UINT16 voicePktSize);
++A_STATUS wmi_set_max_sp_len_cmd(struct wmi_t *wmip, A_UINT8 maxSpLen);
++A_UINT8 convert_userPriority_to_trafficClass(A_UINT8 userPriority);
++A_UINT8 wmi_get_power_mode_cmd(struct wmi_t *wmip);
++A_STATUS wmi_verify_tspec_params(WMI_CREATE_PSTREAM_CMD *pCmd, A_BOOL tspecCompliance);
++
++#ifdef CONFIG_HOST_TCMD_SUPPORT
++A_STATUS wmi_test_cmd(struct wmi_t *wmip, A_UINT8 *buf, A_UINT32 len);
++#endif
++
++A_STATUS wmi_set_bt_status_cmd(struct wmi_t *wmip, A_UINT8 streamType, A_UINT8 status);
++A_STATUS wmi_set_bt_params_cmd(struct wmi_t *wmip, WMI_SET_BT_PARAMS_CMD* cmd);
++
++
++/*
++ * This function is used to configure the fix rates mask to the target.
++ */
++A_STATUS wmi_set_fixrates_cmd(struct wmi_t *wmip, A_INT16 fixRatesMask);
++A_STATUS wmi_get_ratemask_cmd(struct wmi_t *wmip);
++
++A_STATUS wmi_set_authmode_cmd(struct wmi_t *wmip, A_UINT8 mode);
++
++A_STATUS wmi_set_reassocmode_cmd(struct wmi_t *wmip, A_UINT8 mode);
++
++A_STATUS wmi_set_wmm_cmd(struct wmi_t *wmip, WMI_WMM_STATUS status);
++A_STATUS wmi_set_wmm_txop(struct wmi_t *wmip, WMI_TXOP_CFG txEnable);
++
++A_STATUS wmi_get_keepalive_configured(struct wmi_t *wmip);
++A_UINT8 wmi_get_keepalive_cmd(struct wmi_t *wmip);
++A_STATUS wmi_set_keepalive_cmd(struct wmi_t *wmip, A_UINT8 keepaliveInterval);
++
++A_STATUS wmi_set_appie_cmd(struct wmi_t *wmip, A_UINT8 mgmtFrmType,
++ A_UINT8 ieLen,A_UINT8 *ieInfo);
++
++A_STATUS wmi_set_halparam_cmd(struct wmi_t *wmip, A_UINT8 *cmd, A_UINT16 dataLen);
++A_INT32 wmi_get_rate(A_INT8 rateindex);
++
++/*Wake on Wireless WMI commands*/
++A_STATUS wmi_set_host_sleep_mode_cmd(struct wmi_t *wmip, WMI_SET_HOST_SLEEP_MODE_CMD *cmd);
++A_STATUS wmi_set_wow_mode_cmd(struct wmi_t *wmip, WMI_SET_WOW_MODE_CMD *cmd);
++A_STATUS wmi_get_wow_list_cmd(struct wmi_t *wmip, WMI_GET_WOW_LIST_CMD *cmd);
++A_STATUS wmi_add_wow_pattern_cmd(struct wmi_t *wmip,
++ WMI_ADD_WOW_PATTERN_CMD *cmd, A_UINT8* pattern, A_UINT8* mask, A_UINT8 pattern_size);
++A_STATUS wmi_del_wow_pattern_cmd(struct wmi_t *wmip,
++ WMI_DEL_WOW_PATTERN_CMD *cmd);
++A_STATUS wmi_set_wsc_status_cmd(struct wmi_t *wmip, A_UINT32 status);
++
++bss_t *
++wmi_find_Ssidnode (struct wmi_t *wmip, A_UCHAR *pSsid,
++ A_UINT32 ssidLength, A_BOOL bIsWPA2);
++
++void
++wmi_node_return (struct wmi_t *wmip, bss_t *bss);
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* _WMI_API_H_ */
+diff --git a/drivers/ar6000/include/wmix.h b/drivers/ar6000/include/wmix.h
+new file mode 100644
+index 0000000..8f12b5e
+--- /dev/null
++++ b/drivers/ar6000/include/wmix.h
+@@ -0,0 +1,233 @@
++/*
++ * Copyright (c) 2004-2005 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ *
++ * $ATH_LICENSE_HOSTSDK0_C$
++ *
++ * This file contains extensions of the WMI protocol specified in the
++ * Wireless Module Interface (WMI). It includes definitions of all
++ * extended commands and events. Extensions include useful commands
++ * that are not directly related to wireless activities. They may
++ * be hardware-specific, and they might not be supported on all
++ * implementations.
++ *
++ * Extended WMIX commands are encapsulated in a WMI message with
++ * cmd=WMI_EXTENSION_CMD.
++ *
++ */
++
++#ifndef _WMIX_H_
++#define _WMIX_H_
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#ifndef ATH_TARGET
++#include "athstartpack.h"
++#endif
++
++#include "dbglog.h"
++
++/*
++ * Extended WMI commands are those that are needed during wireless
++ * operation, but which are not really wireless commands. This allows,
++ * for instance, platform-specific commands. Extended WMI commands are
++ * embedded in a WMI command message with WMI_COMMAND_ID=WMI_EXTENSION_CMDID.
++ * Extended WMI events are similarly embedded in a WMI event message with
++ * WMI_EVENT_ID=WMI_EXTENSION_EVENTID.
++ */
++typedef PREPACK struct {
++ A_UINT32 commandId;
++} POSTPACK WMIX_CMD_HDR;
++
++typedef enum {
++ WMIX_DSETOPEN_REPLY_CMDID = 0x2001,
++ WMIX_DSETDATA_REPLY_CMDID,
++ WMIX_GPIO_OUTPUT_SET_CMDID,
++ WMIX_GPIO_INPUT_GET_CMDID,
++ WMIX_GPIO_REGISTER_SET_CMDID,
++ WMIX_GPIO_REGISTER_GET_CMDID,
++ WMIX_GPIO_INTR_ACK_CMDID,
++ WMIX_HB_CHALLENGE_RESP_CMDID,
++ WMIX_DBGLOG_CFG_MODULE_CMDID,
++} WMIX_COMMAND_ID;
++
++typedef enum {
++ WMIX_DSETOPENREQ_EVENTID = 0x3001,
++ WMIX_DSETCLOSE_EVENTID,
++ WMIX_DSETDATAREQ_EVENTID,
++ WMIX_GPIO_INTR_EVENTID,
++ WMIX_GPIO_DATA_EVENTID,
++ WMIX_GPIO_ACK_EVENTID,
++ WMIX_HB_CHALLENGE_RESP_EVENTID,
++ WMIX_DBGLOG_EVENTID,
++} WMIX_EVENT_ID;
++
++/*
++ * =============DataSet support=================
++ */
++
++/*
++ * WMIX_DSETOPENREQ_EVENTID
++ * DataSet Open Request Event
++ */
++typedef PREPACK struct {
++ A_UINT32 dset_id;
++ A_UINT32 targ_dset_handle; /* echo'ed, not used by Host, */
++ A_UINT32 targ_reply_fn; /* echo'ed, not used by Host, */
++ A_UINT32 targ_reply_arg; /* echo'ed, not used by Host, */
++} POSTPACK WMIX_DSETOPENREQ_EVENT;
++
++/*
++ * WMIX_DSETCLOSE_EVENTID
++ * DataSet Close Event
++ */
++typedef PREPACK struct {
++ A_UINT32 access_cookie;
++} POSTPACK WMIX_DSETCLOSE_EVENT;
++
++/*
++ * WMIX_DSETDATAREQ_EVENTID
++ * DataSet Data Request Event
++ */
++typedef PREPACK struct {
++ A_UINT32 access_cookie;
++ A_UINT32 offset;
++ A_UINT32 length;
++ A_UINT32 targ_buf; /* echo'ed, not used by Host, */
++ A_UINT32 targ_reply_fn; /* echo'ed, not used by Host, */
++ A_UINT32 targ_reply_arg; /* echo'ed, not used by Host, */
++} POSTPACK WMIX_DSETDATAREQ_EVENT;
++
++typedef PREPACK struct {
++ A_UINT32 status;
++ A_UINT32 targ_dset_handle;
++ A_UINT32 targ_reply_fn;
++ A_UINT32 targ_reply_arg;
++ A_UINT32 access_cookie;
++ A_UINT32 size;
++ A_UINT32 version;
++} POSTPACK WMIX_DSETOPEN_REPLY_CMD;
++
++typedef PREPACK struct {
++ A_UINT32 status;
++ A_UINT32 targ_buf;
++ A_UINT32 targ_reply_fn;
++ A_UINT32 targ_reply_arg;
++ A_UINT32 length;
++ A_UINT8 buf[1];
++} POSTPACK WMIX_DSETDATA_REPLY_CMD;
++
++
++/*
++ * =============GPIO support=================
++ * All masks are 18-bit masks with bit N operating on GPIO pin N.
++ */
++
++#include "gpio.h"
++
++/*
++ * Set GPIO pin output state.
++ * In order for output to be driven, a pin must be enabled for output.
++ * This can be done during initialization through the GPIO Configuration
++ * DataSet, or during operation with the enable_mask.
++ *
++ * If a request is made to simultaneously set/clear or set/disable or
++ * clear/disable or disable/enable, results are undefined.
++ */
++typedef PREPACK struct {
++ A_UINT32 set_mask; /* pins to set */
++ A_UINT32 clear_mask; /* pins to clear */
++ A_UINT32 enable_mask; /* pins to enable for output */
++ A_UINT32 disable_mask; /* pins to disable/tristate */
++} POSTPACK WMIX_GPIO_OUTPUT_SET_CMD;
++
++/*
++ * Set a GPIO register. For debug/exceptional cases.
++ * Values for gpioreg_id are GPIO_REGISTER_IDs, defined in a
++ * platform-dependent header.
++ */
++typedef PREPACK struct {
++ A_UINT32 gpioreg_id; /* GPIO register ID */
++ A_UINT32 value; /* value to write */
++} POSTPACK WMIX_GPIO_REGISTER_SET_CMD;
++
++/* Get a GPIO register. For debug/exceptional cases. */
++typedef PREPACK struct {
++ A_UINT32 gpioreg_id; /* GPIO register to read */
++} POSTPACK WMIX_GPIO_REGISTER_GET_CMD;
++
++/*
++ * Host acknowledges and re-arms GPIO interrupts. A single
++ * message should be used to acknowledge all interrupts that
++ * were delivered in an earlier WMIX_GPIO_INTR_EVENT message.
++ */
++typedef PREPACK struct {
++ A_UINT32 ack_mask; /* interrupts to acknowledge */
++} POSTPACK WMIX_GPIO_INTR_ACK_CMD;
++
++/*
++ * Target informs Host of GPIO interrupts that have ocurred since the
++ * last WMIX_GIPO_INTR_ACK_CMD was received. Additional information --
++ * the current GPIO input values is provided -- in order to support
++ * use of a GPIO interrupt as a Data Valid signal for other GPIO pins.
++ */
++typedef PREPACK struct {
++ A_UINT32 intr_mask; /* pending GPIO interrupts */
++ A_UINT32 input_values; /* recent GPIO input values */
++} POSTPACK WMIX_GPIO_INTR_EVENT;
++
++/*
++ * Target responds to Host's earlier WMIX_GPIO_INPUT_GET_CMDID request
++ * using a GPIO_DATA_EVENT with
++ * value set to the mask of GPIO pin inputs and
++ * reg_id set to GPIO_ID_NONE
++ *
++ *
++ * Target responds to Hosts's earlier WMIX_GPIO_REGISTER_GET_CMDID request
++ * using a GPIO_DATA_EVENT with
++ * value set to the value of the requested register and
++ * reg_id identifying the register (reflects the original request)
++ * NB: reg_id supports the future possibility of unsolicited
++ * WMIX_GPIO_DATA_EVENTs (for polling GPIO input), and it may
++ * simplify Host GPIO support.
++ */
++typedef PREPACK struct {
++ A_UINT32 value;
++ A_UINT32 reg_id;
++} POSTPACK WMIX_GPIO_DATA_EVENT;
++
++/*
++ * =============Error Detection support=================
++ */
++
++/*
++ * WMIX_HB_CHALLENGE_RESP_CMDID
++ * Heartbeat Challenge Response command
++ */
++typedef PREPACK struct {
++ A_UINT32 cookie;
++ A_UINT32 source;
++} POSTPACK WMIX_HB_CHALLENGE_RESP_CMD;
++
++/*
++ * WMIX_HB_CHALLENGE_RESP_EVENTID
++ * Heartbeat Challenge Response Event
++ */
++#define WMIX_HB_CHALLENGE_RESP_EVENT WMIX_HB_CHALLENGE_RESP_CMD
++
++typedef PREPACK struct {
++ struct dbglog_config_s config;
++} POSTPACK WMIX_DBGLOG_CFG_MODULE_CMD;
++
++#ifndef ATH_TARGET
++#include "athendpack.h"
++#endif
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* _WMIX_H_ */
+diff --git a/drivers/ar6000/miscdrv/common_drv.c b/drivers/ar6000/miscdrv/common_drv.c
+new file mode 100644
+index 0000000..4f12734
+--- /dev/null
++++ b/drivers/ar6000/miscdrv/common_drv.c
+@@ -0,0 +1,467 @@
++
++/*
++ *
++ * 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 "a_config.h"
++#include "athdefs.h"
++#include "a_types.h"
++#include "AR6Khwreg.h"
++#include "targaddrs.h"
++#include "a_osapi.h"
++#include "hif.h"
++#include "htc_api.h"
++#include "bmi.h"
++#include "bmi_msg.h"
++#include "common_drv.h"
++#include "a_debug.h"
++#include "targaddrs.h"
++
++#define HOST_INTEREST_ITEM_ADDRESS(target, item) \
++(((TargetType) == TARGET_TYPE_AR6001) ? \
++ AR6001_HOST_INTEREST_ITEM_ADDRESS(item) : \
++ AR6002_HOST_INTEREST_ITEM_ADDRESS(item))
++
++
++/* Compile the 4BYTE version of the window register setup routine,
++ * This mitigates host interconnect issues with non-4byte aligned bus requests, some
++ * interconnects use bus adapters that impose strict limitations.
++ * Since diag window access is not intended for performance critical operations, the 4byte mode should
++ * be satisfactory even though it generates 4X the bus activity. */
++
++#ifdef USE_4BYTE_REGISTER_ACCESS
++
++ /* set the window address register (using 4-byte register access ). */
++A_STATUS ar6000_SetAddressWindowRegister(HIF_DEVICE *hifDevice, A_UINT32 RegisterAddr, A_UINT32 Address)
++{
++ A_STATUS status;
++ A_UINT8 addrValue[4];
++ int i;
++
++ /* write bytes 1,2,3 of the register to set the upper address bytes, the LSB is written
++ * last to initiate the access cycle */
++
++ for (i = 1; i <= 3; i++) {
++ /* fill the buffer with the address byte value we want to hit 4 times*/
++ addrValue[0] = ((A_UINT8 *)&Address)[i];
++ addrValue[1] = addrValue[0];
++ addrValue[2] = addrValue[0];
++ addrValue[3] = addrValue[0];
++
++ /* hit each byte of the register address with a 4-byte write operation to the same address,
++ * this is a harmless operation */
++ status = HIFReadWrite(hifDevice,
++ RegisterAddr+i,
++ addrValue,
++ 4,
++ HIF_WR_SYNC_BYTE_FIX,
++ NULL);
++ if (status != A_OK) {
++ break;
++ }
++ }
++
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write initial bytes of 0x%x to window reg: 0x%X \n",
++ RegisterAddr, Address));
++ return status;
++ }
++
++ /* write the address register again, this time write the whole 4-byte value.
++ * The effect here is that the LSB write causes the cycle to start, the extra
++ * 3 byte write to bytes 1,2,3 has no effect since we are writing the same values again */
++ status = HIFReadWrite(hifDevice,
++ RegisterAddr,
++ (A_UCHAR *)(&Address),
++ 4,
++ HIF_WR_SYNC_BYTE_INC,
++ NULL);
++
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write 0x%x to window reg: 0x%X \n",
++ RegisterAddr, Address));
++ return status;
++ }
++
++ return A_OK;
++
++
++
++}
++
++
++#else
++
++ /* set the window address register */
++A_STATUS ar6000_SetAddressWindowRegister(HIF_DEVICE *hifDevice, A_UINT32 RegisterAddr, A_UINT32 Address)
++{
++ A_STATUS status;
++
++ /* write bytes 1,2,3 of the register to set the upper address bytes, the LSB is written
++ * last to initiate the access cycle */
++ status = HIFReadWrite(hifDevice,
++ RegisterAddr+1, /* write upper 3 bytes */
++ ((A_UCHAR *)(&Address))+1,
++ sizeof(A_UINT32)-1,
++ HIF_WR_SYNC_BYTE_INC,
++ NULL);
++
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write initial bytes of 0x%x to window reg: 0x%X \n",
++ RegisterAddr, Address));
++ return status;
++ }
++
++ /* write the LSB of the register, this initiates the operation */
++ status = HIFReadWrite(hifDevice,
++ RegisterAddr,
++ (A_UCHAR *)(&Address),
++ sizeof(A_UINT8),
++ HIF_WR_SYNC_BYTE_INC,
++ NULL);
++
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write 0x%x to window reg: 0x%X \n",
++ RegisterAddr, Address));
++ return status;
++ }
++
++ return A_OK;
++}
++
++#endif
++
++/*
++ * Read from the AR6000 through its diagnostic window.
++ * No cooperation from the Target is required for this.
++ */
++A_STATUS
++ar6000_ReadRegDiag(HIF_DEVICE *hifDevice, A_UINT32 *address, A_UINT32 *data)
++{
++ A_STATUS status;
++
++ /* set window register to start read cycle */
++ status = ar6000_SetAddressWindowRegister(hifDevice,
++ WINDOW_READ_ADDR_ADDRESS,
++ *address);
++
++ if (status != A_OK) {
++ return status;
++ }
++
++ /* read the data */
++ status = HIFReadWrite(hifDevice,
++ WINDOW_DATA_ADDRESS,
++ (A_UCHAR *)data,
++ sizeof(A_UINT32),
++ HIF_RD_SYNC_BYTE_INC,
++ NULL);
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot read from WINDOW_DATA_ADDRESS\n"));
++ return status;
++ }
++
++ return status;
++}
++
++
++/*
++ * Write to the AR6000 through its diagnostic window.
++ * No cooperation from the Target is required for this.
++ */
++A_STATUS
++ar6000_WriteRegDiag(HIF_DEVICE *hifDevice, A_UINT32 *address, A_UINT32 *data)
++{
++ A_STATUS status;
++
++ /* set write data */
++ status = HIFReadWrite(hifDevice,
++ WINDOW_DATA_ADDRESS,
++ (A_UCHAR *)data,
++ sizeof(A_UINT32),
++ HIF_WR_SYNC_BYTE_INC,
++ NULL);
++ if (status != A_OK) {
++ AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write 0x%x to WINDOW_DATA_ADDRESS\n", *data));
++ return status;
++ }
++
++ /* set window register, which starts the write cycle */
++ return ar6000_SetAddressWindowRegister(hifDevice,
++ WINDOW_WRITE_ADDR_ADDRESS,
++ *address);
++}
++
++A_STATUS
++ar6000_ReadDataDiag(HIF_DEVICE *hifDevice, A_UINT32 address,
++ A_UCHAR *data, A_UINT32 length)
++{
++ A_UINT32 count;
++ A_STATUS status = A_OK;
++
++ for (count = 0; count < length; count += 4, address += 4) {
++ if ((status = ar6000_ReadRegDiag(hifDevice, &address,
++ (A_UINT32 *)&data[count])) != A_OK)
++ {
++ break;
++ }
++ }
++
++ return status;
++}
++
++A_STATUS
++ar6000_WriteDataDiag(HIF_DEVICE *hifDevice, A_UINT32 address,
++ A_UCHAR *data, A_UINT32 length)
++{
++ A_UINT32 count;
++ A_STATUS status = A_OK;
++
++ for (count = 0; count < length; count += 4, address += 4) {
++ if ((status = ar6000_WriteRegDiag(hifDevice, &address,
++ (A_UINT32 *)&data[count])) != A_OK)
++ {
++ break;
++ }
++ }
++
++ return status;
++}
++
++A_STATUS
++ar6000_reset_device_skipflash(HIF_DEVICE *hifDevice)
++{
++ int i;
++ struct forceROM_s {
++ A_UINT32 addr;
++ A_UINT32 data;
++ };
++ struct forceROM_s *ForceROM;
++ int szForceROM;
++ A_UINT32 instruction;
++
++ static struct forceROM_s ForceROM_REV2[] = {
++ /* NB: This works for old REV2 ROM (old). */
++ {0x00001ff0, 0x175b0027}, /* jump instruction at 0xa0001ff0 */
++ {0x00001ff4, 0x00000000}, /* nop instruction at 0xa0001ff4 */
++
++ {MC_REMAP_TARGET_ADDRESS, 0x00001ff0}, /* remap to 0xa0001ff0 */
++ {MC_REMAP_COMPARE_ADDRESS, 0x01000040},/* ...from 0xbfc00040 */
++ {MC_REMAP_SIZE_ADDRESS, 0x00000000}, /* ...1 cache line */
++ {MC_REMAP_VALID_ADDRESS, 0x00000001}, /* ...remap is valid */
++
++ {LOCAL_COUNT_ADDRESS+0x10, 0}, /* clear BMI credit counter */
++
++ {RESET_CONTROL_ADDRESS, RESET_CONTROL_WARM_RST_MASK},
++ };
++
++ static struct forceROM_s ForceROM_NEW[] = {
++ /* NB: This works for AR6000 ROM REV3 and beyond. */
++ {LOCAL_SCRATCH_ADDRESS, AR6K_OPTION_IGNORE_FLASH},
++ {LOCAL_COUNT_ADDRESS+0x10, 0}, /* clear BMI credit counter */
++ {RESET_CONTROL_ADDRESS, RESET_CONTROL_WARM_RST_MASK},
++ };
++
++ /*
++ * Examine a semi-arbitrary instruction that's different
++ * in REV2 and other revisions.
++ * NB: If a Host port does not require simultaneous support
++ * for multiple revisions of Target ROM, this code can be elided.
++ */
++ (void)ar6000_ReadDataDiag(hifDevice, 0x01000040,
++ (A_UCHAR *)&instruction, 4);
++
++ AR_DEBUG_PRINTF(ATH_LOG_ERR, ("instruction=0x%x\n", instruction));
++
++ if (instruction == 0x3c1aa200) {
++ /* It's an old ROM */
++ ForceROM = ForceROM_REV2;
++ szForceROM = sizeof(ForceROM_REV2)/sizeof(*ForceROM);
++ AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Using OLD method\n"));
++ } else {
++ ForceROM = ForceROM_NEW;
++ szForceROM = sizeof(ForceROM_NEW)/sizeof(*ForceROM);
++ AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Using NEW method\n"));
++ }
++
++ AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Force Target to execute from ROM....\n"));
++ for (i = 0; i < szForceROM; i++)
++ {
++ if (ar6000_WriteRegDiag(hifDevice,
++ &ForceROM[i].addr,
++ &ForceROM[i].data) != A_OK)
++ {
++ AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot force Target to execute ROM!\n"));
++ return A_ERROR;
++ }
++ }
++
++ msleep(50); /* delay to allow dragon to come to BMI phase */
++ return A_OK;
++}
++
++/* reset device */
++A_STATUS ar6000_reset_device(HIF_DEVICE *hifDevice, A_UINT32 TargetType)
++{
++
++#if !defined(DWSIM)
++ A_STATUS status = A_OK;
++ A_UINT32 address;
++ A_UINT32 data;
++
++ do {
++
++ // address = RESET_CONTROL_ADDRESS;
++ data = RESET_CONTROL_COLD_RST_MASK;
++
++ /* Hardcode the address of RESET_CONTROL_ADDRESS based on the target type */
++ if (TargetType == TARGET_TYPE_AR6001) {
++ address = 0x0C000000;
++ } else {
++ if (TargetType == TARGET_TYPE_AR6002) {
++ address = 0x00004000;
++ } else {
++ A_ASSERT(0);
++ }
++ }
++
++ status = ar6000_WriteRegDiag(hifDevice, &address, &data);
++
++ if (A_FAILED(status)) {
++ break;
++ }
++
++ /*
++ * Read back the RESET CAUSE register to ensure that the cold reset
++ * went through.
++ */
++ msleep(2000); /* 2 second delay to allow things to settle down */
++
++
++ // address = RESET_CAUSE_ADDRESS;
++ /* Hardcode the address of RESET_CAUSE_ADDRESS based on the target type */
++ if (TargetType == TARGET_TYPE_AR6001) {
++ address = 0x0C0000CC;
++ } else {
++ if (TargetType == TARGET_TYPE_AR6002) {
++ address = 0x000040C0;
++ } else {
++ A_ASSERT(0);
++ }
++ }
++
++ data = 0;
++ status = ar6000_ReadRegDiag(hifDevice, &address, &data);
++
++ if (A_FAILED(status)) {
++ break;
++ }
++
++ AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Reset Cause readback: 0x%X \n",data));
++ data &= RESET_CAUSE_LAST_MASK;
++ if (data != 2) {
++ AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Unable to cold reset the target \n"));
++ }
++
++ } while (FALSE);
++
++ if (A_FAILED(status)) {
++ AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Failed to reset target \n"));
++ }
++#endif
++ return A_OK;
++}
++
++#define REG_DUMP_COUNT_AR6001 38 /* WORDs, derived from AR6001_regdump.h */
++#define REG_DUMP_COUNT_AR6002 32 /* WORDs, derived from AR6002_regdump.h */
++
++
++#if REG_DUMP_COUNT_AR6001 <= REG_DUMP_COUNT_AR6002
++#define REGISTER_DUMP_LEN_MAX REG_DUMP_COUNT_AR6002
++#else
++#define REGISTER_DUMP_LEN_MAX REG_DUMP_COUNT_AR6001
++#endif
++
++void ar6000_dump_target_assert_info(HIF_DEVICE *hifDevice, A_UINT32 TargetType)
++{
++ A_UINT32 address;
++ A_UINT32 regDumpArea = 0;
++ A_STATUS status;
++ A_UINT32 regDumpValues[REGISTER_DUMP_LEN_MAX];
++ A_UINT32 regDumpCount = 0;
++ A_UINT32 i;
++
++ do {
++
++ /* the reg dump pointer is copied to the host interest area */
++ address = HOST_INTEREST_ITEM_ADDRESS(TargetType, hi_failure_state);
++
++ if (TargetType == TARGET_TYPE_AR6001) {
++ /* for AR6001, this is a fixed location because the ptr is actually stuck in cache,
++ * this may be fixed in later firmware versions */
++ address = 0x18a0;
++ regDumpCount = REG_DUMP_COUNT_AR6001;
++
++ } else if (TargetType == TARGET_TYPE_AR6002) {
++
++ regDumpCount = REG_DUMP_COUNT_AR6002;
++
++ } else {
++ A_ASSERT(0);
++ }
++
++ /* read RAM location through diagnostic window */
++ status = ar6000_ReadRegDiag(hifDevice, &address, &regDumpArea);
++
++ if (A_FAILED(status)) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("AR6K: Failed to get ptr to register dump area \n"));
++ break;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("AR6K: Location of register dump data: 0x%X \n",regDumpArea));
++
++ if (regDumpArea == 0) {
++ /* no reg dump */
++ break;
++ }
++
++ if (TargetType == TARGET_TYPE_AR6001) {
++ regDumpArea &= 0x0FFFFFFF; /* convert to physical address in target memory */
++ }
++
++ /* fetch register dump data */
++ status = ar6000_ReadDataDiag(hifDevice,
++ regDumpArea,
++ (A_UCHAR *)&regDumpValues[0],
++ regDumpCount * (sizeof(A_UINT32)));
++
++ if (A_FAILED(status)) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("AR6K: Failed to get register dump \n"));
++ break;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("AR6K: Register Dump: \n"));
++
++ for (i = 0; i < regDumpCount; i++) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,(" %d : 0x%8.8X \n",i, regDumpValues[i]));
++ }
++
++ } while (FALSE);
++
++}
++
+diff --git a/drivers/ar6000/miscdrv/credit_dist.c b/drivers/ar6000/miscdrv/credit_dist.c
+new file mode 100644
+index 0000000..8d37d62
+--- /dev/null
++++ b/drivers/ar6000/miscdrv/credit_dist.c
+@@ -0,0 +1,346 @@
++
++/*
++ *
++ * 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 "a_config.h"
++#include "athdefs.h"
++#include "a_types.h"
++#include "a_osapi.h"
++#include "a_debug.h"
++#include "htc_api.h"
++#include "common_drv.h"
++
++/********* CREDIT DISTRIBUTION FUNCTIONS ******************************************/
++
++#define NO_VO_SERVICE 1 /* currently WMI only uses 3 data streams, so we leave VO service inactive */
++
++#ifdef NO_VO_SERVICE
++#define DATA_SVCS_USED 3
++#else
++#define DATA_SVCS_USED 4
++#endif
++
++static void RedistributeCredits(COMMON_CREDIT_STATE_INFO *pCredInfo,
++ HTC_ENDPOINT_CREDIT_DIST *pEPDistList);
++
++static void SeekCredits(COMMON_CREDIT_STATE_INFO *pCredInfo,
++ HTC_ENDPOINT_CREDIT_DIST *pEPDistList);
++
++/* reduce an ep's credits back to a set limit */
++static INLINE void ReduceCredits(COMMON_CREDIT_STATE_INFO *pCredInfo,
++ HTC_ENDPOINT_CREDIT_DIST *pEpDist,
++ int Limit)
++{
++ int credits;
++
++ /* set the new limit */
++ pEpDist->TxCreditsAssigned = Limit;
++
++ if (pEpDist->TxCredits <= Limit) {
++ return;
++ }
++
++ /* figure out how much to take away */
++ credits = pEpDist->TxCredits - Limit;
++ /* take them away */
++ pEpDist->TxCredits -= credits;
++ pCredInfo->CurrentFreeCredits += credits;
++}
++
++/* give an endpoint some credits from the free credit pool */
++#define GiveCredits(pCredInfo,pEpDist,credits) \
++{ \
++ (pEpDist)->TxCredits += (credits); \
++ (pEpDist)->TxCreditsAssigned += (credits); \
++ (pCredInfo)->CurrentFreeCredits -= (credits); \
++}
++
++
++/* default credit init callback.
++ * This function is called in the context of HTCStart() to setup initial (application-specific)
++ * credit distributions */
++static void ar6000_credit_init(void *Context,
++ HTC_ENDPOINT_CREDIT_DIST *pEPList,
++ int TotalCredits)
++{
++ HTC_ENDPOINT_CREDIT_DIST *pCurEpDist;
++ int count;
++ COMMON_CREDIT_STATE_INFO *pCredInfo = (COMMON_CREDIT_STATE_INFO *)Context;
++
++ pCredInfo->CurrentFreeCredits = TotalCredits;
++ pCredInfo->TotalAvailableCredits = TotalCredits;
++
++ pCurEpDist = pEPList;
++
++ /* run through the list and initialize */
++ while (pCurEpDist != NULL) {
++
++ /* set minimums for each endpoint */
++ pCurEpDist->TxCreditsMin = pCurEpDist->TxCreditsPerMaxMsg;
++
++ if (pCurEpDist->ServiceID == WMI_CONTROL_SVC) {
++ /* give control service some credits */
++ GiveCredits(pCredInfo,pCurEpDist,pCurEpDist->TxCreditsMin);
++ /* control service is always marked active, it never goes inactive EVER */
++ SET_EP_ACTIVE(pCurEpDist);
++ } else if (pCurEpDist->ServiceID == WMI_DATA_BK_SVC) {
++ /* this is the lowest priority data endpoint, save this off for easy access */
++ pCredInfo->pLowestPriEpDist = pCurEpDist;
++ }
++
++ /* Streams have to be created (explicit | implicit)for all kinds
++ * of traffic. BE endpoints are also inactive in the beginning.
++ * When BE traffic starts it creates implicit streams that
++ * redistributes credits.
++ */
++
++ /* note, all other endpoints have minimums set but are initially given NO credits.
++ * Credits will be distributed as traffic activity demands */
++ pCurEpDist = pCurEpDist->pNext;
++ }
++
++ if (pCredInfo->CurrentFreeCredits <= 0) {
++ AR_DEBUG_PRINTF(ATH_LOG_INF, ("Not enough credits (%d) to do credit distributions \n", TotalCredits));
++ A_ASSERT(FALSE);
++ return;
++ }
++
++ /* reset list */
++ pCurEpDist = pEPList;
++ /* now run through the list and set max operating credit limits for everyone */
++ while (pCurEpDist != NULL) {
++ if (pCurEpDist->ServiceID == WMI_CONTROL_SVC) {
++ /* control service max is just 1 max message */
++ pCurEpDist->TxCreditsNorm = pCurEpDist->TxCreditsPerMaxMsg;
++ } else {
++ /* for the remaining data endpoints, we assume that each TxCreditsPerMaxMsg are
++ * the same.
++ * We use a simple calculation here, we take the remaining credits and
++ * determine how many max messages this can cover and then set each endpoint's
++ * normal value equal to half this amount.
++ * */
++ count = (pCredInfo->CurrentFreeCredits/pCurEpDist->TxCreditsPerMaxMsg) * pCurEpDist->TxCreditsPerMaxMsg;
++ count = count >> 1;
++ count = max(count,pCurEpDist->TxCreditsPerMaxMsg);
++ /* set normal */
++ pCurEpDist->TxCreditsNorm = count;
++
++ }
++ pCurEpDist = pCurEpDist->pNext;
++ }
++
++}
++
++
++/* default credit distribution callback
++ * This callback is invoked whenever endpoints require credit distributions.
++ * A lock is held while this function is invoked, this function shall NOT block.
++ * The pEPDistList is a list of distribution structures in prioritized order as
++ * defined by the call to the HTCSetCreditDistribution() api.
++ *
++ */
++static void ar6000_credit_distribute(void *Context,
++ HTC_ENDPOINT_CREDIT_DIST *pEPDistList,
++ HTC_CREDIT_DIST_REASON Reason)
++{
++ HTC_ENDPOINT_CREDIT_DIST *pCurEpDist;
++ COMMON_CREDIT_STATE_INFO *pCredInfo = (COMMON_CREDIT_STATE_INFO *)Context;
++
++ switch (Reason) {
++ case HTC_CREDIT_DIST_SEND_COMPLETE :
++ pCurEpDist = pEPDistList;
++ /* we are given the start of the endpoint distribution list.
++ * There may be one or more endpoints to service.
++ * Run through the list and distribute credits */
++ while (pCurEpDist != NULL) {
++
++ if (pCurEpDist->TxCreditsToDist > 0) {
++ /* return the credits back to the endpoint */
++ pCurEpDist->TxCredits += pCurEpDist->TxCreditsToDist;
++ /* always zero out when we are done */
++ pCurEpDist->TxCreditsToDist = 0;
++
++ if (pCurEpDist->TxCredits > pCurEpDist->TxCreditsAssigned) {
++ /* reduce to the assigned limit, previous credit reductions
++ * could have caused the limit to change */
++ ReduceCredits(pCredInfo, pCurEpDist, pCurEpDist->TxCreditsAssigned);
++ }
++
++ if (pCurEpDist->TxCredits > pCurEpDist->TxCreditsNorm) {
++ /* oversubscribed endpoints need to reduce back to normal */
++ ReduceCredits(pCredInfo, pCurEpDist, pCurEpDist->TxCreditsNorm);
++ }
++ }
++
++ pCurEpDist = pCurEpDist->pNext;
++ }
++
++ A_ASSERT(pCredInfo->CurrentFreeCredits <= pCredInfo->TotalAvailableCredits);
++
++ break;
++
++ case HTC_CREDIT_DIST_ACTIVITY_CHANGE :
++ RedistributeCredits(pCredInfo,pEPDistList);
++ break;
++ case HTC_CREDIT_DIST_SEEK_CREDITS :
++ SeekCredits(pCredInfo,pEPDistList);
++ break;
++ case HTC_DUMP_CREDIT_STATE :
++ AR_DEBUG_PRINTF(ATH_LOG_INF, ("Credit Distribution, total : %d, free : %d\n",
++ pCredInfo->TotalAvailableCredits, pCredInfo->CurrentFreeCredits));
++ break;
++ default:
++ break;
++
++ }
++
++}
++
++/* redistribute credits based on activity change */
++static void RedistributeCredits(COMMON_CREDIT_STATE_INFO *pCredInfo,
++ HTC_ENDPOINT_CREDIT_DIST *pEPDistList)
++{
++ HTC_ENDPOINT_CREDIT_DIST *pCurEpDist = pEPDistList;
++
++ /* walk through the list and remove credits from inactive endpoints */
++ while (pCurEpDist != NULL) {
++
++ if (pCurEpDist->ServiceID != WMI_CONTROL_SVC) {
++ if (!IS_EP_ACTIVE(pCurEpDist)) {
++ /* EP is inactive, reduce credits back to zero */
++ ReduceCredits(pCredInfo, pCurEpDist, 0);
++ }
++ }
++
++ /* NOTE in the active case, we do not need to do anything further,
++ * when an EP goes active and needs credits, HTC will call into
++ * our distribution function using a reason code of HTC_CREDIT_DIST_SEEK_CREDITS */
++
++ pCurEpDist = pCurEpDist->pNext;
++ }
++
++ A_ASSERT(pCredInfo->CurrentFreeCredits <= pCredInfo->TotalAvailableCredits);
++
++}
++
++/* HTC has an endpoint that needs credits, pEPDist is the endpoint in question */
++static void SeekCredits(COMMON_CREDIT_STATE_INFO *pCredInfo,
++ HTC_ENDPOINT_CREDIT_DIST *pEPDist)
++{
++ HTC_ENDPOINT_CREDIT_DIST *pCurEpDist;
++ int credits = 0;
++ int need;
++
++ do {
++
++ if (pEPDist->ServiceID == WMI_CONTROL_SVC) {
++ /* we never oversubscribe on the control service, this is not
++ * a high performance path and the target never holds onto control
++ * credits for too long */
++ break;
++ }
++
++ /* for all other services, we follow a simple algorithm of
++ * 1. checking the free pool for credits
++ * 2. checking lower priority endpoints for credits to take */
++
++ if (pCredInfo->CurrentFreeCredits >= 2 * pEPDist->TxCreditsSeek) {
++ /* try to give more credits than it needs */
++ credits = 2 * pEPDist->TxCreditsSeek;
++ } else {
++ /* give what we can */
++ credits = min(pCredInfo->CurrentFreeCredits,pEPDist->TxCreditsSeek);
++ }
++
++ if (credits >= pEPDist->TxCreditsSeek) {
++ /* we found some to fullfill the seek request */
++ break;
++ }
++
++ /* we don't have enough in the free pool, try taking away from lower priority services
++ *
++ * The rule for taking away credits:
++ * 1. Only take from lower priority endpoints
++ * 2. Only take what is allocated above the minimum (never starve an endpoint completely)
++ * 3. Only take what you need.
++ *
++ * */
++
++ /* starting at the lowest priority */
++ pCurEpDist = pCredInfo->pLowestPriEpDist;
++
++ /* work backwards until we hit the endpoint again */
++ while (pCurEpDist != pEPDist) {
++ /* calculate how many we need so far */
++ need = pEPDist->TxCreditsSeek - pCredInfo->CurrentFreeCredits;
++
++ if ((pCurEpDist->TxCreditsAssigned - need) > pCurEpDist->TxCreditsMin) {
++ /* the current one has been allocated more than it's minimum and it
++ * has enough credits assigned above it's minimum to fullfill our need
++ * try to take away just enough to fullfill our need */
++ ReduceCredits(pCredInfo,
++ pCurEpDist,
++ pCurEpDist->TxCreditsAssigned - need);
++
++ if (pCredInfo->CurrentFreeCredits >= pEPDist->TxCreditsSeek) {
++ /* we have enough */
++ break;
++ }
++ }
++
++ pCurEpDist = pCurEpDist->pPrev;
++ }
++
++ /* return what we can get */
++ credits = min(pCredInfo->CurrentFreeCredits,pEPDist->TxCreditsSeek);
++
++ } while (FALSE);
++
++ /* did we find some credits? */
++ if (credits) {
++ /* give what we can */
++ GiveCredits(pCredInfo, pEPDist, credits);
++ }
++
++}
++
++/* initialize and setup credit distribution */
++A_STATUS ar6000_setup_credit_dist(HTC_HANDLE HTCHandle, COMMON_CREDIT_STATE_INFO *pCredInfo)
++{
++ HTC_SERVICE_ID servicepriority[5];
++
++ A_MEMZERO(pCredInfo,sizeof(COMMON_CREDIT_STATE_INFO));
++
++ servicepriority[0] = WMI_CONTROL_SVC; /* highest */
++ servicepriority[1] = WMI_DATA_VO_SVC;
++ servicepriority[2] = WMI_DATA_VI_SVC;
++ servicepriority[3] = WMI_DATA_BE_SVC;
++ servicepriority[4] = WMI_DATA_BK_SVC; /* lowest */
++
++ /* set callbacks and priority list */
++ HTCSetCreditDistribution(HTCHandle,
++ pCredInfo,
++ ar6000_credit_distribute,
++ ar6000_credit_init,
++ servicepriority,
++ 5);
++
++ return A_OK;
++}
++
+diff --git a/drivers/ar6000/wlan/wlan_node.c b/drivers/ar6000/wlan/wlan_node.c
+new file mode 100644
+index 0000000..b124845
+--- /dev/null
++++ b/drivers/ar6000/wlan/wlan_node.c
+@@ -0,0 +1,371 @@
++/*-
++ * Copyright (c) 2001 Atsushi Onoe
++ * Copyright (c) 2002-2004 Sam Leffler, Errno Consulting
++ * Copyright (c) 2004-2005 Atheros Communications
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * Alternatively, this software may be distributed under the terms of the
++ * GNU General Public License ("GPL") version 2 as published by the Free
++ * Software Foundation.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ * $Id: //depot/sw/releases/olca2.0-GPL/host/wlan/src/wlan_node.c#1 $
++ */
++/*
++ * IEEE 802.11 node handling support.
++ */
++#include <a_config.h>
++#include <athdefs.h>
++#include <a_types.h>
++#include <a_osapi.h>
++#include <a_debug.h>
++#include <ieee80211.h>
++#include <wlan_api.h>
++#include <ieee80211_node.h>
++#include <htc_api.h>
++#include <wmi.h>
++#include <wmi_api.h>
++
++static void wlan_node_timeout(A_ATH_TIMER arg);
++static bss_t * _ieee80211_find_node(struct ieee80211_node_table *nt,
++ const A_UINT8 *macaddr);
++
++bss_t *
++wlan_node_alloc(struct ieee80211_node_table *nt, int wh_size)
++{
++ bss_t *ni;
++
++ ni = A_MALLOC_NOWAIT(sizeof(bss_t));
++
++ if (ni != NULL) {
++ ni->ni_buf = A_MALLOC_NOWAIT(wh_size);
++ if (ni->ni_buf == NULL) {
++ A_FREE(ni);
++ ni = NULL;
++ return ni;
++ }
++ } else {
++ return ni;
++ }
++
++ /* Make sure our lists are clean */
++ ni->ni_list_next = NULL;
++ ni->ni_list_prev = NULL;
++ ni->ni_hash_next = NULL;
++ ni->ni_hash_prev = NULL;
++
++ //
++ // ni_scangen never initialized before and during suspend/resume of winmobile, customer (LG/SEMCO) identified
++ // that some junk has been stored in this, due to this scan list didn't properly updated
++ //
++ ni->ni_scangen = 0;
++
++ return ni;
++}
++
++void
++wlan_node_free(bss_t *ni)
++{
++ if (ni->ni_buf != NULL) {
++ A_FREE(ni->ni_buf);
++ }
++ A_FREE(ni);
++}
++
++void
++wlan_setup_node(struct ieee80211_node_table *nt, bss_t *ni,
++ const A_UINT8 *macaddr)
++{
++ int hash;
++
++ A_MEMCPY(ni->ni_macaddr, macaddr, IEEE80211_ADDR_LEN);
++ hash = IEEE80211_NODE_HASH(macaddr);
++ ieee80211_node_initref(ni); /* mark referenced */
++
++ ni->ni_tstamp = A_GET_MS(WLAN_NODE_INACT_TIMEOUT_MSEC);
++ IEEE80211_NODE_LOCK_BH(nt);
++
++ /* Insert at the end of the node list */
++ ni->ni_list_next = NULL;
++ ni->ni_list_prev = nt->nt_node_last;
++ if(nt->nt_node_last != NULL)
++ {
++ nt->nt_node_last->ni_list_next = ni;
++ }
++ nt->nt_node_last = ni;
++ if(nt->nt_node_first == NULL)
++ {
++ nt->nt_node_first = ni;
++ }
++
++ /* Insert into the hash list i.e. the bucket */
++ if((ni->ni_hash_next = nt->nt_hash[hash]) != NULL)
++ {
++ nt->nt_hash[hash]->ni_hash_prev = ni;
++ }
++ ni->ni_hash_prev = NULL;
++ nt->nt_hash[hash] = ni;
++
++ if (!nt->isTimerArmed) {
++ A_TIMEOUT_MS(&nt->nt_inact_timer, WLAN_NODE_INACT_TIMEOUT_MSEC, 0);
++ nt->isTimerArmed = TRUE;
++ }
++
++ IEEE80211_NODE_UNLOCK_BH(nt);
++}
++
++static bss_t *
++_ieee80211_find_node(struct ieee80211_node_table *nt,
++ const A_UINT8 *macaddr)
++{
++ bss_t *ni;
++ int hash;
++
++ IEEE80211_NODE_LOCK_ASSERT(nt);
++
++ hash = IEEE80211_NODE_HASH(macaddr);
++ for(ni = nt->nt_hash[hash]; ni; ni = ni->ni_hash_next) {
++ if (IEEE80211_ADDR_EQ(ni->ni_macaddr, macaddr)) {
++ ieee80211_node_incref(ni); /* mark referenced */
++ return ni;
++ }
++ }
++ return NULL;
++}
++
++bss_t *
++wlan_find_node(struct ieee80211_node_table *nt, const A_UINT8 *macaddr)
++{
++ bss_t *ni;
++
++ IEEE80211_NODE_LOCK(nt);
++ ni = _ieee80211_find_node(nt, macaddr);
++ IEEE80211_NODE_UNLOCK(nt);
++ return ni;
++}
++
++/*
++ * Reclaim a node. If this is the last reference count then
++ * do the normal free work. Otherwise remove it from the node
++ * table and mark it gone by clearing the back-reference.
++ */
++void
++wlan_node_reclaim(struct ieee80211_node_table *nt, bss_t *ni)
++{
++ IEEE80211_NODE_LOCK(nt);
++
++ if(ni->ni_list_prev == NULL)
++ {
++ /* First in list so fix the list head */
++ nt->nt_node_first = ni->ni_list_next;
++ }
++ else
++ {
++ ni->ni_list_prev->ni_list_next = ni->ni_list_next;
++ }
++
++ if(ni->ni_list_next == NULL)
++ {
++ /* Last in list so fix list tail */
++ nt->nt_node_last = ni->ni_list_prev;
++ }
++ else
++ {
++ ni->ni_list_next->ni_list_prev = ni->ni_list_prev;
++ }
++
++ if(ni->ni_hash_prev == NULL)
++ {
++ /* First in list so fix the list head */
++ int hash;
++ hash = IEEE80211_NODE_HASH(ni->ni_macaddr);
++ nt->nt_hash[hash] = ni->ni_hash_next;
++ }
++ else
++ {
++ ni->ni_hash_prev->ni_hash_next = ni->ni_hash_next;
++ }
++
++ if(ni->ni_hash_next != NULL)
++ {
++ ni->ni_hash_next->ni_hash_prev = ni->ni_hash_prev;
++ }
++ wlan_node_free(ni);
++
++ IEEE80211_NODE_UNLOCK(nt);
++}
++
++static void
++wlan_node_dec_free(bss_t *ni)
++{
++ if (ieee80211_node_dectestref(ni)) {
++ wlan_node_free(ni);
++ }
++}
++
++void
++wlan_free_allnodes(struct ieee80211_node_table *nt)
++{
++ bss_t *ni;
++
++ while ((ni = nt->nt_node_first) != NULL) {
++ wlan_node_reclaim(nt, ni);
++ }
++}
++
++void
++wlan_iterate_nodes(struct ieee80211_node_table *nt, wlan_node_iter_func *f,
++ void *arg)
++{
++ bss_t *ni;
++ A_UINT32 gen;
++
++ gen = ++nt->nt_scangen;
++
++ IEEE80211_NODE_LOCK(nt);
++ for (ni = nt->nt_node_first; ni; ni = ni->ni_list_next) {
++ if (ni->ni_scangen != gen) {
++ ni->ni_scangen = gen;
++ (void) ieee80211_node_incref(ni);
++ (*f)(arg, ni);
++ wlan_node_dec_free(ni);
++ }
++ }
++ IEEE80211_NODE_UNLOCK(nt);
++}
++
++/*
++ * Node table support.
++ */
++void
++wlan_node_table_init(void *wmip, struct ieee80211_node_table *nt)
++{
++ int i;
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_WLAN, ("node table = 0x%x\n", (A_UINT32)nt));
++ IEEE80211_NODE_LOCK_INIT(nt);
++
++ nt->nt_node_first = nt->nt_node_last = NULL;
++ for(i = 0; i < IEEE80211_NODE_HASHSIZE; i++)
++ {
++ nt->nt_hash[i] = NULL;
++ }
++ A_INIT_TIMER(&nt->nt_inact_timer, wlan_node_timeout, nt);
++ nt->isTimerArmed = FALSE;
++ nt->nt_wmip = wmip;
++}
++
++static void
++wlan_node_timeout(A_ATH_TIMER arg)
++{
++ struct ieee80211_node_table *nt = (struct ieee80211_node_table *)arg;
++ bss_t *bss, *nextBss;
++ A_UINT8 myBssid[IEEE80211_ADDR_LEN], reArmTimer = FALSE;
++
++ wmi_get_current_bssid(nt->nt_wmip, myBssid);
++
++ bss = nt->nt_node_first;
++ while (bss != NULL)
++ {
++ nextBss = bss->ni_list_next;
++ if (A_MEMCMP(myBssid, bss->ni_macaddr, sizeof(myBssid)) != 0)
++ {
++
++ if (bss->ni_tstamp <= A_GET_MS(0))
++ {
++ /*
++ * free up all but the current bss - if set
++ */
++ wlan_node_reclaim(nt, bss);
++ }
++ else
++ {
++ /*
++ * Re-arm timer, only when we have a bss other than
++ * current bss AND it is not aged-out.
++ */
++ reArmTimer = TRUE;
++ }
++ }
++ bss = nextBss;
++ }
++
++ if(reArmTimer)
++ A_TIMEOUT_MS(&nt->nt_inact_timer, WLAN_NODE_INACT_TIMEOUT_MSEC, 0);
++
++ nt->isTimerArmed = reArmTimer;
++}
++
++void
++wlan_node_table_cleanup(struct ieee80211_node_table *nt)
++{
++ A_UNTIMEOUT(&nt->nt_inact_timer);
++ A_DELETE_TIMER(&nt->nt_inact_timer);
++ wlan_free_allnodes(nt);
++ IEEE80211_NODE_LOCK_DESTROY(nt);
++}
++
++bss_t *
++wlan_find_Ssidnode (struct ieee80211_node_table *nt, A_UCHAR *pSsid,
++ A_UINT32 ssidLength, A_BOOL bIsWPA2)
++{
++ bss_t *ni = NULL;
++ A_UCHAR *pIESsid = NULL;
++
++ IEEE80211_NODE_LOCK (nt);
++
++ for (ni = nt->nt_node_first; ni; ni = ni->ni_list_next) {
++ pIESsid = ni->ni_cie.ie_ssid;
++ if (pIESsid[1] <= 32) {
++
++ // Step 1 : Check SSID
++ if (0x00 == memcmp (pSsid, &pIESsid[2], ssidLength)) {
++
++ // Step 2 : if SSID matches, check WPA or WPA2
++ if (TRUE == bIsWPA2 && NULL != ni->ni_cie.ie_rsn) {
++ ieee80211_node_incref (ni); /* mark referenced */
++ IEEE80211_NODE_UNLOCK (nt);
++ return ni;
++ }
++ if (FALSE == bIsWPA2 && NULL != ni->ni_cie.ie_wpa) {
++ ieee80211_node_incref(ni); /* mark referenced */
++ IEEE80211_NODE_UNLOCK (nt);
++ return ni;
++ }
++ }
++ }
++ }
++
++ IEEE80211_NODE_UNLOCK (nt);
++
++ return NULL;
++}
++
++void
++wlan_node_return (struct ieee80211_node_table *nt, bss_t *ni)
++{
++ IEEE80211_NODE_LOCK (nt);
++ wlan_node_dec_free (ni);
++ IEEE80211_NODE_UNLOCK (nt);
++}
+diff --git a/drivers/ar6000/wlan/wlan_recv_beacon.c b/drivers/ar6000/wlan/wlan_recv_beacon.c
+new file mode 100644
+index 0000000..15beabb
+--- /dev/null
++++ b/drivers/ar6000/wlan/wlan_recv_beacon.c
+@@ -0,0 +1,192 @@
++/*-
++ * Copyright (c) 2001 Atsushi Onoe
++ * Copyright (c) 2002-2004 Sam Leffler, Errno Consulting
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The name of the author may not be used to endorse or promote products
++ * derived from this software without specific prior written permission.
++ *
++ * Alternatively, this software may be distributed under the terms of the
++ * GNU General Public License ("GPL") version 2 as published by the Free
++ * Software Foundation.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++/*
++ * IEEE 802.11 input handling.
++ */
++
++#include "a_config.h"
++#include "athdefs.h"
++#include "a_types.h"
++#include "a_osapi.h"
++#include <wmi.h>
++#include <ieee80211.h>
++#include <wlan_api.h>
++
++#define IEEE80211_VERIFY_LENGTH(_len, _minlen) do { \
++ if ((_len) < (_minlen)) { \
++ return A_EINVAL; \
++ } \
++} while (0)
++
++#define IEEE80211_VERIFY_ELEMENT(__elem, __maxlen) do { \
++ if ((__elem) == NULL) { \
++ return A_EINVAL; \
++ } \
++ if ((__elem)[1] > (__maxlen)) { \
++ return A_EINVAL; \
++ } \
++} while (0)
++
++
++/* unaligned little endian access */
++#define LE_READ_2(p) \
++ ((A_UINT16) \
++ ((((A_UINT8 *)(p))[0] ) | (((A_UINT8 *)(p))[1] << 8)))
++
++#define LE_READ_4(p) \
++ ((A_UINT32) \
++ ((((A_UINT8 *)(p))[0] ) | (((A_UINT8 *)(p))[1] << 8) | \
++ (((A_UINT8 *)(p))[2] << 16) | (((A_UINT8 *)(p))[3] << 24)))
++
++
++static int __inline
++iswpaoui(const A_UINT8 *frm)
++{
++ return frm[1] > 3 && LE_READ_4(frm+2) == ((WPA_OUI_TYPE<<24)|WPA_OUI);
++}
++
++static int __inline
++iswmmoui(const A_UINT8 *frm)
++{
++ return frm[1] > 3 && LE_READ_4(frm+2) == ((WMM_OUI_TYPE<<24)|WMM_OUI);
++}
++
++static int __inline
++iswmmparam(const A_UINT8 *frm)
++{
++ return frm[1] > 5 && frm[6] == WMM_PARAM_OUI_SUBTYPE;
++}
++
++static int __inline
++iswmminfo(const A_UINT8 *frm)
++{
++ return frm[1] > 5 && frm[6] == WMM_INFO_OUI_SUBTYPE;
++}
++
++static int __inline
++isatherosoui(const A_UINT8 *frm)
++{
++ return frm[1] > 3 && LE_READ_4(frm+2) == ((ATH_OUI_TYPE<<24)|ATH_OUI);
++}
++
++static int __inline
++iswscoui(const A_UINT8 *frm)
++{
++ return frm[1] > 3 && LE_READ_4(frm+2) == ((0x04<<24)|WPA_OUI);
++}
++
++A_STATUS
++wlan_parse_beacon(A_UINT8 *buf, int framelen, struct ieee80211_common_ie *cie)
++{
++ A_UINT8 *frm, *efrm;
++
++ frm = buf;
++ efrm = (A_UINT8 *) (frm + framelen);
++
++ /*
++ * beacon/probe response frame format
++ * [8] time stamp
++ * [2] beacon interval
++ * [2] capability information
++ * [tlv] ssid
++ * [tlv] supported rates
++ * [tlv] country information
++ * [tlv] parameter set (FH/DS)
++ * [tlv] erp information
++ * [tlv] extended supported rates
++ * [tlv] WMM
++ * [tlv] WPA or RSN
++ * [tlv] Atheros Advanced Capabilities
++ */
++ IEEE80211_VERIFY_LENGTH(efrm - frm, 12);
++ A_MEMZERO(cie, sizeof(*cie));
++
++ cie->ie_tstamp = frm; frm += 8;
++ cie->ie_beaconInt = A_LE2CPU16(*(A_UINT16 *)frm); frm += 2;
++ cie->ie_capInfo = A_LE2CPU16(*(A_UINT16 *)frm); frm += 2;
++ cie->ie_chan = 0;
++
++ while (frm < efrm) {
++ switch (*frm) {
++ case IEEE80211_ELEMID_SSID:
++ cie->ie_ssid = frm;
++ break;
++ case IEEE80211_ELEMID_RATES:
++ cie->ie_rates = frm;
++ break;
++ case IEEE80211_ELEMID_COUNTRY:
++ cie->ie_country = frm;
++ break;
++ case IEEE80211_ELEMID_FHPARMS:
++ break;
++ case IEEE80211_ELEMID_DSPARMS:
++ cie->ie_chan = frm[2];
++ break;
++ case IEEE80211_ELEMID_TIM:
++ cie->ie_tim = frm;
++ break;
++ case IEEE80211_ELEMID_IBSSPARMS:
++ break;
++ case IEEE80211_ELEMID_XRATES:
++ cie->ie_xrates = frm;
++ break;
++ case IEEE80211_ELEMID_ERP:
++ if (frm[1] != 1) {
++ //A_PRINTF("Discarding ERP Element - Bad Len\n");
++ return A_EINVAL;
++ }
++ cie->ie_erp = frm[2];
++ break;
++ case IEEE80211_ELEMID_RSN:
++ cie->ie_rsn = frm;
++ break;
++ case IEEE80211_ELEMID_VENDOR:
++ if (iswpaoui(frm)) {
++ cie->ie_wpa = frm;
++ } else if (iswmmoui(frm)) {
++ cie->ie_wmm = frm;
++ } else if (isatherosoui(frm)) {
++ cie->ie_ath = frm;
++ } else if(iswscoui(frm)) {
++ cie->ie_wsc = frm;
++ }
++ break;
++ default:
++ break;
++ }
++ frm += frm[1] + 2;
++ }
++ IEEE80211_VERIFY_ELEMENT(cie->ie_rates, IEEE80211_RATE_MAXSIZE);
++ IEEE80211_VERIFY_ELEMENT(cie->ie_ssid, IEEE80211_NWID_LEN);
++
++ return A_OK;
++}
+diff --git a/drivers/ar6000/wlan/wlan_utils.c b/drivers/ar6000/wlan/wlan_utils.c
+new file mode 100644
+index 0000000..fd5aac9
+--- /dev/null
++++ b/drivers/ar6000/wlan/wlan_utils.c
+@@ -0,0 +1,59 @@
++/*
++ * Copyright (c) 2004-2005 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ * This module implements frequently used wlan utilies
++ *
++ * $Id: //depot/sw/releases/olca2.0-GPL/host/wlan/src/wlan_utils.c#1 $
++ *
++ *
++ * 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 <a_config.h>
++#include <athdefs.h>
++#include <a_types.h>
++#include <a_osapi.h>
++
++/*
++ * converts ieee channel number to frequency
++ */
++A_UINT16
++wlan_ieee2freq(int chan)
++{
++ if (chan == 14) {
++ return 2484;
++ }
++ if (chan < 14) { /* 0-13 */
++ return (2407 + (chan*5));
++ }
++ if (chan < 27) { /* 15-26 */
++ return (2512 + ((chan-15)*20));
++ }
++ return (5000 + (chan*5));
++}
++
++/*
++ * Converts MHz frequency to IEEE channel number.
++ */
++A_UINT32
++wlan_freq2ieee(A_UINT16 freq)
++{
++ if (freq == 2484)
++ return 14;
++ if (freq < 2484)
++ return (freq - 2407) / 5;
++ if (freq < 5000)
++ return 15 + ((freq - 2512) / 20);
++ return (freq - 5000) / 5;
++}
+diff --git a/drivers/ar6000/wmi/wmi.c b/drivers/ar6000/wmi/wmi.c
+new file mode 100644
+index 0000000..d322cf3
+--- /dev/null
++++ b/drivers/ar6000/wmi/wmi.c
+@@ -0,0 +1,3954 @@
++/*
++ * Copyright (c) 2004-2007 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ * This module implements the hardware independent layer of the
++ * Wireless Module Interface (WMI) protocol.
++ *
++ * $Id: //depot/sw/releases/olca2.0-GPL/host/wmi/wmi.c#3 $
++ *
++ *
++ * 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 <a_config.h>
++#include <athdefs.h>
++#include <a_types.h>
++#include <a_osapi.h>
++#include "htc.h"
++#include "htc_api.h"
++#include "wmi.h"
++#include <ieee80211.h>
++#include <ieee80211_node.h>
++#include <wlan_api.h>
++#include <wmi_api.h>
++#include "dset_api.h"
++#include "gpio_api.h"
++#include "wmi_host.h"
++#include "a_drv.h"
++#include "a_drv_api.h"
++#include "a_debug.h"
++#include "dbglog_api.h"
++
++static A_STATUS wmi_ready_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
++
++static A_STATUS wmi_connect_event_rx(struct wmi_t *wmip, A_UINT8 *datap,
++ int len);
++static A_STATUS wmi_disconnect_event_rx(struct wmi_t *wmip, A_UINT8 *datap,
++ int len);
++static A_STATUS wmi_tkip_micerr_event_rx(struct wmi_t *wmip, A_UINT8 *datap,
++ int len);
++static A_STATUS wmi_bssInfo_event_rx(struct wmi_t *wmip, A_UINT8 *datap,
++ int len);
++static A_STATUS wmi_opt_frame_event_rx(struct wmi_t *wmip, A_UINT8 *datap,
++ int len);
++static A_STATUS wmi_pstream_timeout_event_rx(struct wmi_t *wmip, A_UINT8 *datap,
++ int len);
++static A_STATUS wmi_sync_point(struct wmi_t *wmip);
++
++static A_STATUS wmi_bitrate_reply_rx(struct wmi_t *wmip, A_UINT8 *datap,
++ int len);
++static A_STATUS wmi_ratemask_reply_rx(struct wmi_t *wmip, A_UINT8 *datap,
++ int len);
++static A_STATUS wmi_channelList_reply_rx(struct wmi_t *wmip, A_UINT8 *datap,
++ int len);
++static A_STATUS wmi_regDomain_event_rx(struct wmi_t *wmip, A_UINT8 *datap,
++ int len);
++static A_STATUS wmi_txPwr_reply_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
++static A_STATUS wmi_neighborReport_event_rx(struct wmi_t *wmip, A_UINT8 *datap,
++ int len);
++
++static A_STATUS wmi_dset_open_req_rx(struct wmi_t *wmip, A_UINT8 *datap,
++ int len);
++#ifdef CONFIG_HOST_DSET_SUPPORT
++static A_STATUS wmi_dset_close_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
++static A_STATUS wmi_dset_data_req_rx(struct wmi_t *wmip, A_UINT8 *datap,
++ int len);
++#endif /* CONFIG_HOST_DSET_SUPPORT */
++
++
++static A_STATUS wmi_scanComplete_rx(struct wmi_t *wmip, A_UINT8 *datap,
++ int len);
++static A_STATUS wmi_errorEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
++static A_STATUS wmi_statsEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
++static A_STATUS wmi_rssiThresholdEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
++static A_STATUS wmi_hbChallengeResp_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
++static A_STATUS wmi_reportErrorEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
++static A_STATUS wmi_cac_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
++static A_STATUS wmi_roam_tbl_event_rx(struct wmi_t *wmip, A_UINT8 *datap,
++ int len);
++static A_STATUS wmi_roam_data_event_rx(struct wmi_t *wmip, A_UINT8 *datap,
++ int len);
++static A_STATUS wmi_get_wow_list_event_rx(struct wmi_t *wmip, A_UINT8 *datap,
++ int len);
++static A_STATUS
++wmi_get_pmkid_list_event_rx(struct wmi_t *wmip, A_UINT8 *datap, A_UINT32 len);
++
++#ifdef CONFIG_HOST_GPIO_SUPPORT
++static A_STATUS wmi_gpio_intr_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
++static A_STATUS wmi_gpio_data_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
++static A_STATUS wmi_gpio_ack_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
++#endif /* CONFIG_HOST_GPIO_SUPPORT */
++
++#ifdef CONFIG_HOST_TCMD_SUPPORT
++static A_STATUS
++wmi_tcmd_test_report_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
++#endif
++
++static A_STATUS
++wmi_txRetryErrEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
++
++static A_STATUS
++wmi_snrThresholdEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
++
++static A_STATUS
++wmi_lqThresholdEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
++
++static A_BOOL
++wmi_is_bitrate_index_valid(struct wmi_t *wmip, A_UINT32 rateIndex);
++
++static A_STATUS
++wmi_aplistEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
++
++static A_STATUS
++wmi_dbglog_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
++
++static A_STATUS wmi_keepalive_reply_rx(struct wmi_t *wmip, A_UINT8 *datap, int len);
++
++int wps_enable;
++static const A_INT32 wmi_rateTable[] = {
++ 1000,
++ 2000,
++ 5500,
++ 11000,
++ 6000,
++ 9000,
++ 12000,
++ 18000,
++ 24000,
++ 36000,
++ 48000,
++ 54000,
++ 0};
++
++#define MODE_A_SUPPORT_RATE_START 4
++#define MODE_A_SUPPORT_RATE_STOP 11
++
++#define MODE_GONLY_SUPPORT_RATE_START MODE_A_SUPPORT_RATE_START
++#define MODE_GONLY_SUPPORT_RATE_STOP MODE_A_SUPPORT_RATE_STOP
++
++#define MODE_B_SUPPORT_RATE_START 0
++#define MODE_B_SUPPORT_RATE_STOP 3
++
++#define MODE_G_SUPPORT_RATE_START 0
++#define MODE_G_SUPPORT_RATE_STOP 11
++
++#define MAX_NUMBER_OF_SUPPORT_RATES (MODE_G_SUPPORT_RATE_STOP + 1)
++
++/* 802.1d to AC mapping. Refer pg 57 of WMM-test-plan-v1.2 */
++const A_UINT8 up_to_ac[]= {
++ WMM_AC_BE,
++ WMM_AC_BK,
++ WMM_AC_BK,
++ WMM_AC_BE,
++ WMM_AC_VI,
++ WMM_AC_VI,
++ WMM_AC_VO,
++ WMM_AC_VO,
++ };
++
++void *
++wmi_init(void *devt)
++{
++ struct wmi_t *wmip;
++
++ wmip = A_MALLOC(sizeof(struct wmi_t));
++ if (wmip == NULL) {
++ return (NULL);
++ }
++ A_MEMZERO(wmip, sizeof(*wmip));
++ A_MUTEX_INIT(&wmip->wmi_lock);
++ wmip->wmi_devt = devt;
++ wlan_node_table_init(wmip, &wmip->wmi_scan_table);
++ wmi_qos_state_init(wmip);
++ wmip->wmi_powerMode = REC_POWER;
++ wmip->wmi_phyMode = WMI_11G_MODE;
++
++ return (wmip);
++}
++
++void
++wmi_qos_state_init(struct wmi_t *wmip)
++{
++ A_UINT8 i;
++
++ if (wmip == NULL) {
++ return;
++ }
++ LOCK_WMI(wmip);
++
++ /* Initialize QoS States */
++ wmip->wmi_numQoSStream = 0;
++
++ wmip->wmi_fatPipeExists = 0;
++
++ for (i=0; i < WMM_NUM_AC; i++) {
++ wmip->wmi_streamExistsForAC[i]=0;
++ }
++
++ /* Initialize the static Wmi stream Pri to WMM AC mappings Arrays */
++ WMI_INIT_WMISTREAM_AC_MAP(wmip);
++
++ UNLOCK_WMI(wmip);
++
++ A_WMI_SET_NUMDATAENDPTS(wmip->wmi_devt, 1);
++}
++
++void
++wmi_shutdown(struct wmi_t *wmip)
++{
++ if (wmip != NULL) {
++ wlan_node_table_cleanup(&wmip->wmi_scan_table);
++ if (A_IS_MUTEX_VALID(&wmip->wmi_lock)) {
++ A_MUTEX_DELETE(&wmip->wmi_lock);
++ }
++ A_FREE(wmip);
++ }
++}
++
++/*
++ * performs DIX to 802.3 encapsulation for transmit packets.
++ * uses passed in buffer. Returns buffer or NULL if failed.
++ * Assumes the entire DIX header is contigous and that there is
++ * enough room in the buffer for a 802.3 mac header and LLC+SNAP headers.
++ */
++A_STATUS
++wmi_dix_2_dot3(struct wmi_t *wmip, void *osbuf)
++{
++ A_UINT8 *datap;
++ A_UINT16 typeorlen;
++ ATH_MAC_HDR macHdr;
++ ATH_LLC_SNAP_HDR *llcHdr;
++
++ A_ASSERT(osbuf != NULL);
++
++ if (A_NETBUF_HEADROOM(osbuf) <
++ (sizeof(ATH_LLC_SNAP_HDR) + sizeof(WMI_DATA_HDR)))
++ {
++ return A_NO_MEMORY;
++ }
++
++ datap = A_NETBUF_DATA(osbuf);
++
++ typeorlen = *(A_UINT16 *)(datap + ATH_MAC_LEN + ATH_MAC_LEN);
++
++ if (!IS_ETHERTYPE(A_BE2CPU16(typeorlen))) {
++ /*
++ * packet is already in 802.3 format - return success
++ */
++ A_DPRINTF(DBG_WMI, (DBGFMT "packet already 802.3\n", DBGARG));
++ return (A_OK);
++ }
++
++ /*
++ * Save mac fields and length to be inserted later
++ */
++ A_MEMCPY(macHdr.dstMac, datap, ATH_MAC_LEN);
++ A_MEMCPY(macHdr.srcMac, datap + ATH_MAC_LEN, ATH_MAC_LEN);
++ macHdr.typeOrLen = A_CPU2BE16(A_NETBUF_LEN(osbuf) - sizeof(ATH_MAC_HDR) +
++ sizeof(ATH_LLC_SNAP_HDR));
++
++ /*
++ * Make room for LLC+SNAP headers
++ */
++ if (A_NETBUF_PUSH(osbuf, sizeof(ATH_LLC_SNAP_HDR)) != A_OK) {
++ return A_NO_MEMORY;
++ }
++
++ datap = A_NETBUF_DATA(osbuf);
++
++ A_MEMCPY(datap, &macHdr, sizeof (ATH_MAC_HDR));
++
++ llcHdr = (ATH_LLC_SNAP_HDR *)(datap + sizeof(ATH_MAC_HDR));
++ llcHdr->dsap = 0xAA;
++ llcHdr->ssap = 0xAA;
++ llcHdr->cntl = 0x03;
++ llcHdr->orgCode[0] = 0x0;
++ llcHdr->orgCode[1] = 0x0;
++ llcHdr->orgCode[2] = 0x0;
++ llcHdr->etherType = typeorlen;
++
++ return (A_OK);
++}
++
++/*
++ * Adds a WMI data header
++ * Assumes there is enough room in the buffer to add header.
++ */
++A_STATUS
++wmi_data_hdr_add(struct wmi_t *wmip, void *osbuf, A_UINT8 msgType)
++{
++ WMI_DATA_HDR *dtHdr;
++
++ A_ASSERT(osbuf != NULL);
++
++ if (A_NETBUF_PUSH(osbuf, sizeof(WMI_DATA_HDR)) != A_OK) {
++ return A_NO_MEMORY;
++ }
++
++ dtHdr = (WMI_DATA_HDR *)A_NETBUF_DATA(osbuf);
++ dtHdr->info = msgType;
++ dtHdr->rssi = 0;
++
++ return (A_OK);
++}
++
++A_UINT8 wmi_implicit_create_pstream(struct wmi_t *wmip, void *osbuf, A_UINT8 dir, A_UINT8 up)
++{
++ A_UINT8 *datap;
++ A_UINT8 trafficClass = WMM_AC_BE, userPriority = up;
++ ATH_LLC_SNAP_HDR *llcHdr;
++ A_UINT16 ipType = IP_ETHERTYPE;
++ WMI_DATA_HDR *dtHdr;
++ WMI_CREATE_PSTREAM_CMD cmd;
++ A_BOOL streamExists = FALSE;
++
++ A_ASSERT(osbuf != NULL);
++
++ datap = A_NETBUF_DATA(osbuf);
++
++ if (up == UNDEFINED_PRI) {
++ llcHdr = (ATH_LLC_SNAP_HDR *)(datap + sizeof(WMI_DATA_HDR) +
++ sizeof(ATH_MAC_HDR));
++
++ if (llcHdr->etherType == A_CPU2BE16(ipType)) {
++ /* Extract the endpoint info from the TOS field in the IP header */
++ userPriority = A_WMI_IPTOS_TO_USERPRIORITY(((A_UINT8 *)llcHdr) + sizeof(ATH_LLC_SNAP_HDR));
++ }
++ }
++
++ if (userPriority < MAX_NUM_PRI) {
++ trafficClass = convert_userPriority_to_trafficClass(userPriority);
++ }
++
++ dtHdr = (WMI_DATA_HDR *)datap;
++ if(dir==UPLINK_TRAFFIC)
++ dtHdr->info |= (userPriority & WMI_DATA_HDR_UP_MASK) << WMI_DATA_HDR_UP_SHIFT; /* lower 3-bits are 802.1d priority */
++
++ LOCK_WMI(wmip);
++ streamExists = wmip->wmi_fatPipeExists;
++ UNLOCK_WMI(wmip);
++
++ if (!(streamExists & (1 << trafficClass))) {
++
++ A_MEMZERO(&cmd, sizeof(cmd));
++ cmd.trafficClass = trafficClass;
++ cmd.userPriority = userPriority;
++ cmd.inactivityInt = WMI_IMPLICIT_PSTREAM_INACTIVITY_INT;
++ /* Implicit streams are created with TSID 0xFF */
++ cmd.tsid = WMI_IMPLICIT_PSTREAM;
++ wmi_create_pstream_cmd(wmip, &cmd);
++ }
++
++ return trafficClass;
++}
++
++WMI_PRI_STREAM_ID
++wmi_get_stream_id(struct wmi_t *wmip, A_UINT8 trafficClass)
++{
++ return WMI_ACCESSCATEGORY_WMISTREAM(wmip, trafficClass);
++}
++
++/*
++ * performs 802.3 to DIX encapsulation for received packets.
++ * Assumes the entire 802.3 header is contigous.
++ */
++A_STATUS
++wmi_dot3_2_dix(struct wmi_t *wmip, void *osbuf)
++{
++ A_UINT8 *datap;
++ ATH_MAC_HDR macHdr;
++ ATH_LLC_SNAP_HDR *llcHdr;
++
++ A_ASSERT(osbuf != NULL);
++ datap = A_NETBUF_DATA(osbuf);
++
++ A_MEMCPY(&macHdr, datap, sizeof(ATH_MAC_HDR));
++ llcHdr = (ATH_LLC_SNAP_HDR *)(datap + sizeof(ATH_MAC_HDR));
++ macHdr.typeOrLen = llcHdr->etherType;
++
++ if (A_NETBUF_PULL(osbuf, sizeof(ATH_LLC_SNAP_HDR)) != A_OK) {
++ return A_NO_MEMORY;
++ }
++
++ datap = A_NETBUF_DATA(osbuf);
++
++ A_MEMCPY(datap, &macHdr, sizeof (ATH_MAC_HDR));
++
++ return (A_OK);
++}
++
++/*
++ * Removes a WMI data header
++ */
++A_STATUS
++wmi_data_hdr_remove(struct wmi_t *wmip, void *osbuf)
++{
++ A_ASSERT(osbuf != NULL);
++
++ return (A_NETBUF_PULL(osbuf, sizeof(WMI_DATA_HDR)));
++}
++
++void
++wmi_iterate_nodes(struct wmi_t *wmip, wlan_node_iter_func *f, void *arg)
++{
++ wlan_iterate_nodes(&wmip->wmi_scan_table, f, arg);
++}
++
++/*
++ * WMI Extended Event received from Target.
++ */
++A_STATUS
++wmi_control_rx_xtnd(struct wmi_t *wmip, void *osbuf)
++{
++ WMIX_CMD_HDR *cmd;
++ A_UINT16 id;
++ A_UINT8 *datap;
++ A_UINT32 len;
++ A_STATUS status = A_OK;
++
++ if (A_NETBUF_LEN(osbuf) < sizeof(WMIX_CMD_HDR)) {
++ A_DPRINTF(DBG_WMI, (DBGFMT "bad packet 1\n", DBGARG));
++ wmip->wmi_stats.cmd_len_err++;
++ A_NETBUF_FREE(osbuf);
++ return A_ERROR;
++ }
++
++ cmd = (WMIX_CMD_HDR *)A_NETBUF_DATA(osbuf);
++ id = cmd->commandId;
++
++ if (A_NETBUF_PULL(osbuf, sizeof(WMIX_CMD_HDR)) != A_OK) {
++ A_DPRINTF(DBG_WMI, (DBGFMT "bad packet 2\n", DBGARG));
++ wmip->wmi_stats.cmd_len_err++;
++ A_NETBUF_FREE(osbuf);
++ return A_ERROR;
++ }
++
++ datap = A_NETBUF_DATA(osbuf);
++ len = A_NETBUF_LEN(osbuf);
++
++ switch (id) {
++ case (WMIX_DSETOPENREQ_EVENTID):
++ status = wmi_dset_open_req_rx(wmip, datap, len);
++ break;
++#ifdef CONFIG_HOST_DSET_SUPPORT
++ case (WMIX_DSETCLOSE_EVENTID):
++ status = wmi_dset_close_rx(wmip, datap, len);
++ break;
++ case (WMIX_DSETDATAREQ_EVENTID):
++ status = wmi_dset_data_req_rx(wmip, datap, len);
++ break;
++#endif /* CONFIG_HOST_DSET_SUPPORT */
++#ifdef CONFIG_HOST_GPIO_SUPPORT
++ case (WMIX_GPIO_INTR_EVENTID):
++ wmi_gpio_intr_rx(wmip, datap, len);
++ break;
++ case (WMIX_GPIO_DATA_EVENTID):
++ wmi_gpio_data_rx(wmip, datap, len);
++ break;
++ case (WMIX_GPIO_ACK_EVENTID):
++ wmi_gpio_ack_rx(wmip, datap, len);
++ break;
++#endif /* CONFIG_HOST_GPIO_SUPPORT */
++ case (WMIX_HB_CHALLENGE_RESP_EVENTID):
++ wmi_hbChallengeResp_rx(wmip, datap, len);
++ break;
++ case (WMIX_DBGLOG_EVENTID):
++ wmi_dbglog_event_rx(wmip, datap, len);
++ break;
++ default:
++ A_DPRINTF(DBG_WMI|DBG_ERROR,
++ (DBGFMT "Unknown id 0x%x\n", DBGARG, id));
++ wmip->wmi_stats.cmd_id_err++;
++ status = A_ERROR;
++ break;
++ }
++
++ return status;
++}
++
++/*
++ * Control Path
++ */
++A_UINT32 cmdRecvNum;
++
++A_STATUS
++wmi_control_rx(struct wmi_t *wmip, void *osbuf)
++{
++ WMI_CMD_HDR *cmd;
++ A_UINT16 id;
++ A_UINT8 *datap;
++ A_UINT32 len, i, loggingReq;
++ A_STATUS status = A_OK;
++
++ A_ASSERT(osbuf != NULL);
++ if (A_NETBUF_LEN(osbuf) < sizeof(WMI_CMD_HDR)) {
++ A_DPRINTF(DBG_WMI, (DBGFMT "bad packet 1\n", DBGARG));
++ wmip->wmi_stats.cmd_len_err++;
++ A_NETBUF_FREE(osbuf);
++ return A_ERROR;
++ }
++
++ cmd = (WMI_CMD_HDR *)A_NETBUF_DATA(osbuf);
++ id = cmd->commandId;
++
++ if (A_NETBUF_PULL(osbuf, sizeof(WMI_CMD_HDR)) != A_OK) {
++ A_DPRINTF(DBG_WMI, (DBGFMT "bad packet 2\n", DBGARG));
++ wmip->wmi_stats.cmd_len_err++;
++ A_NETBUF_FREE(osbuf);
++ return A_ERROR;
++ }
++
++ datap = A_NETBUF_DATA(osbuf);
++ len = A_NETBUF_LEN(osbuf);
++
++ ar6000_get_driver_cfg(wmip->wmi_devt,
++ AR6000_DRIVER_CFG_LOG_RAW_WMI_MSGS,
++ &loggingReq);
++
++ if(loggingReq) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_WMI, ("WMI %d \n",id));
++ AR_DEBUG_PRINTF(ATH_DEBUG_WMI, ("WMI recv, MsgNo %d : ", cmdRecvNum));
++ for(i = 0; i < len; i++)
++ AR_DEBUG_PRINTF(ATH_DEBUG_WMI, ("%x ", datap[i]));
++ AR_DEBUG_PRINTF(ATH_DEBUG_WMI, ("\n"));
++ }
++
++ LOCK_WMI(wmip);
++ cmdRecvNum++;
++ UNLOCK_WMI(wmip);
++
++ switch (id) {
++ case (WMI_GET_BITRATE_CMDID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_GET_BITRATE_CMDID\n", DBGARG));
++ status = wmi_bitrate_reply_rx(wmip, datap, len);
++ break;
++ case (WMI_GET_CHANNEL_LIST_CMDID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_GET_CHANNEL_LIST_CMDID\n", DBGARG));
++ status = wmi_channelList_reply_rx(wmip, datap, len);
++ break;
++ case (WMI_GET_TX_PWR_CMDID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_GET_TX_PWR_CMDID\n", DBGARG));
++ status = wmi_txPwr_reply_rx(wmip, datap, len);
++ break;
++ case (WMI_READY_EVENTID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_READY_EVENTID\n", DBGARG));
++ status = wmi_ready_event_rx(wmip, datap, len);
++ A_WMI_SEND_EVENT_TO_APP(wmip->wmi_devt, id, datap, len);
++ A_WMI_DBGLOG_INIT_DONE(wmip->wmi_devt);
++ break;
++ case (WMI_CONNECT_EVENTID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_CONNECT_EVENTID\n", DBGARG));
++ status = wmi_connect_event_rx(wmip, datap, len);
++ A_WMI_SEND_EVENT_TO_APP(wmip->wmi_devt, id, datap, len);
++ break;
++ case (WMI_DISCONNECT_EVENTID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_DISCONNECT_EVENTID\n", DBGARG));
++ status = wmi_disconnect_event_rx(wmip, datap, len);
++ A_WMI_SEND_EVENT_TO_APP(wmip->wmi_devt, id, datap, len);
++ break;
++ case (WMI_TKIP_MICERR_EVENTID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_TKIP_MICERR_EVENTID\n", DBGARG));
++ status = wmi_tkip_micerr_event_rx(wmip, datap, len);
++ break;
++ case (WMI_BSSINFO_EVENTID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_BSSINFO_EVENTID\n", DBGARG));
++ status = wmi_bssInfo_event_rx(wmip, datap, len);
++ A_WMI_SEND_EVENT_TO_APP(wmip->wmi_devt, id, datap, len);
++ break;
++ case (WMI_REGDOMAIN_EVENTID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_REGDOMAIN_EVENTID\n", DBGARG));
++ status = wmi_regDomain_event_rx(wmip, datap, len);
++ break;
++ case (WMI_PSTREAM_TIMEOUT_EVENTID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_PSTREAM_TIMEOUT_EVENTID\n", DBGARG));
++ status = wmi_pstream_timeout_event_rx(wmip, datap, len);
++ /* pstreams are fatpipe abstractions that get implicitly created.
++ * User apps only deal with thinstreams. creation of a thinstream
++ * by the user or data traffic flow in an AC triggers implicit
++ * pstream creation. Do we need to send this event to App..?
++ * no harm in sending it.
++ */
++ A_WMI_SEND_EVENT_TO_APP(wmip->wmi_devt, id, datap, len);
++ break;
++ case (WMI_NEIGHBOR_REPORT_EVENTID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_NEIGHBOR_REPORT_EVENTID\n", DBGARG));
++ status = wmi_neighborReport_event_rx(wmip, datap, len);
++ break;
++ case (WMI_SCAN_COMPLETE_EVENTID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_SCAN_COMPLETE_EVENTID\n", DBGARG));
++ status = wmi_scanComplete_rx(wmip, datap, len);
++ A_WMI_SEND_EVENT_TO_APP(wmip->wmi_devt, id, datap, len);
++ break;
++ case (WMI_CMDERROR_EVENTID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_CMDERROR_EVENTID\n", DBGARG));
++ status = wmi_errorEvent_rx(wmip, datap, len);
++ break;
++ case (WMI_REPORT_STATISTICS_EVENTID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_REPORT_STATISTICS_EVENTID\n", DBGARG));
++ status = wmi_statsEvent_rx(wmip, datap, len);
++ break;
++ case (WMI_RSSI_THRESHOLD_EVENTID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_RSSI_THRESHOLD_EVENTID\n", DBGARG));
++ status = wmi_rssiThresholdEvent_rx(wmip, datap, len);
++ break;
++ case (WMI_ERROR_REPORT_EVENTID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_ERROR_REPORT_EVENTID\n", DBGARG));
++ status = wmi_reportErrorEvent_rx(wmip, datap, len);
++ A_WMI_SEND_EVENT_TO_APP(wmip->wmi_devt, id, datap, len);
++ break;
++ case (WMI_OPT_RX_FRAME_EVENTID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_OPT_RX_FRAME_EVENTID\n", DBGARG));
++ status = wmi_opt_frame_event_rx(wmip, datap, len);
++ break;
++ case (WMI_REPORT_ROAM_TBL_EVENTID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_REPORT_ROAM_TBL_EVENTID\n", DBGARG));
++ status = wmi_roam_tbl_event_rx(wmip, datap, len);
++ break;
++ case (WMI_EXTENSION_EVENTID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_EXTENSION_EVENTID\n", DBGARG));
++ status = wmi_control_rx_xtnd(wmip, osbuf);
++ break;
++ case (WMI_CAC_EVENTID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_CAC_EVENTID\n", DBGARG));
++ status = wmi_cac_event_rx(wmip, datap, len);
++ break;
++ case (WMI_REPORT_ROAM_DATA_EVENTID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_REPORT_ROAM_DATA_EVENTID\n", DBGARG));
++ status = wmi_roam_data_event_rx(wmip, datap, len);
++ break;
++#ifdef CONFIG_HOST_TCMD_SUPPORT
++ case (WMI_TEST_EVENTID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_TEST_EVENTID\n", DBGARG));
++ status = wmi_tcmd_test_report_rx(wmip, datap, len);
++ break;
++#endif
++ case (WMI_GET_FIXRATES_CMDID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_GET_FIXRATES_CMDID\n", DBGARG));
++ status = wmi_ratemask_reply_rx(wmip, datap, len);
++ break;
++ case (WMI_TX_RETRY_ERR_EVENTID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_TX_RETRY_ERR_EVENTID\n", DBGARG));
++ status = wmi_txRetryErrEvent_rx(wmip, datap, len);
++ A_WMI_SEND_EVENT_TO_APP(wmip->wmi_devt, id, datap, len);
++ break;
++ case (WMI_SNR_THRESHOLD_EVENTID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_SNR_THRESHOLD_EVENTID\n", DBGARG));
++ status = wmi_snrThresholdEvent_rx(wmip, datap, len);
++ A_WMI_SEND_EVENT_TO_APP(wmip->wmi_devt, id, datap, len);
++ break;
++ case (WMI_LQ_THRESHOLD_EVENTID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_LQ_THRESHOLD_EVENTID\n", DBGARG));
++ status = wmi_lqThresholdEvent_rx(wmip, datap, len);
++ A_WMI_SEND_EVENT_TO_APP(wmip->wmi_devt, id, datap, len);
++ break;
++ case (WMI_APLIST_EVENTID):
++ AR_DEBUG_PRINTF(ATH_DEBUG_WMI, ("Received APLIST Event\n"));
++ status = wmi_aplistEvent_rx(wmip, datap, len);
++ break;
++ case (WMI_GET_KEEPALIVE_CMDID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_GET_KEEPALIVE_CMDID\n", DBGARG));
++ status = wmi_keepalive_reply_rx(wmip, datap, len);
++ break;
++ case (WMI_GET_WOW_LIST_EVENTID):
++ status = wmi_get_wow_list_event_rx(wmip, datap, len);
++ break;
++ case (WMI_GET_PMKID_LIST_EVENTID):
++ A_DPRINTF(DBG_WMI, (DBGFMT "WMI_GET_PMKID_LIST Event\n", DBGARG));
++ status = wmi_get_pmkid_list_event_rx(wmip, datap, len);
++ break;
++ default:
++ A_DPRINTF(DBG_WMI|DBG_ERROR,
++ (DBGFMT "Unknown id 0x%x\n", DBGARG, id));
++ wmip->wmi_stats.cmd_id_err++;
++ status = A_ERROR;
++ break;
++ }
++
++ A_NETBUF_FREE(osbuf);
++
++ return status;
++}
++
++static A_STATUS
++wmi_ready_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMI_READY_EVENT *ev = (WMI_READY_EVENT *)datap;
++
++ if (len < sizeof(WMI_READY_EVENT)) {
++ return A_EINVAL;
++ }
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG));
++ wmip->wmi_ready = TRUE;
++ A_WMI_READY_EVENT(wmip->wmi_devt, ev->macaddr, ev->phyCapability);
++
++ return A_OK;
++}
++
++static A_STATUS
++wmi_connect_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMI_CONNECT_EVENT *ev;
++
++ if (len < sizeof(WMI_CONNECT_EVENT)) {
++ return A_EINVAL;
++ }
++ ev = (WMI_CONNECT_EVENT *)datap;
++ A_DPRINTF(DBG_WMI,
++ (DBGFMT "freq %d bssid %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n",
++ DBGARG, ev->channel,
++ ev->bssid[0], ev->bssid[1], ev->bssid[2],
++ ev->bssid[3], ev->bssid[4], ev->bssid[5]));
++
++ A_MEMCPY(wmip->wmi_bssid, ev->bssid, ATH_MAC_LEN);
++
++ A_WMI_CONNECT_EVENT(wmip->wmi_devt, ev->channel, ev->bssid,
++ ev->listenInterval, ev->beaconInterval,
++ ev->networkType, ev->beaconIeLen,
++ ev->assocReqLen, ev->assocRespLen,
++ ev->assocInfo);
++
++ return A_OK;
++}
++
++static A_STATUS
++wmi_regDomain_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMI_REG_DOMAIN_EVENT *ev;
++
++ if (len < sizeof(*ev)) {
++ return A_EINVAL;
++ }
++ ev = (WMI_REG_DOMAIN_EVENT *)datap;
++
++ A_WMI_REGDOMAIN_EVENT(wmip->wmi_devt, ev->regDomain);
++
++ return A_OK;
++}
++
++static A_STATUS
++wmi_neighborReport_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMI_NEIGHBOR_REPORT_EVENT *ev;
++ int numAps;
++
++ if (len < sizeof(*ev)) {
++ return A_EINVAL;
++ }
++ ev = (WMI_NEIGHBOR_REPORT_EVENT *)datap;
++ numAps = ev->numberOfAps;
++
++ if (len < (int)(sizeof(*ev) + ((numAps - 1) * sizeof(WMI_NEIGHBOR_INFO)))) {
++ return A_EINVAL;
++ }
++
++ A_WMI_NEIGHBORREPORT_EVENT(wmip->wmi_devt, numAps, ev->neighbor);
++
++ return A_OK;
++}
++
++static A_STATUS
++wmi_disconnect_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMI_DISCONNECT_EVENT *ev;
++
++ if (len < sizeof(WMI_DISCONNECT_EVENT)) {
++ return A_EINVAL;
++ }
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG));
++
++ ev = (WMI_DISCONNECT_EVENT *)datap;
++
++ A_MEMZERO(wmip->wmi_bssid, sizeof(wmip->wmi_bssid));
++
++ A_WMI_DISCONNECT_EVENT(wmip->wmi_devt, ev->disconnectReason, ev->bssid,
++ ev->assocRespLen, ev->assocInfo, ev->protocolReasonStatus);
++
++ return A_OK;
++}
++
++static A_STATUS
++wmi_tkip_micerr_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMI_TKIP_MICERR_EVENT *ev;
++
++ if (len < sizeof(*ev)) {
++ return A_EINVAL;
++ }
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG));
++
++ ev = (WMI_TKIP_MICERR_EVENT *)datap;
++ A_WMI_TKIP_MICERR_EVENT(wmip->wmi_devt, ev->keyid, ev->ismcast);
++
++ return A_OK;
++}
++
++static A_STATUS
++wmi_bssInfo_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ bss_t *bss;
++ WMI_BSS_INFO_HDR *bih;
++ A_UINT8 *buf;
++ A_UINT32 nodeCachingAllowed;
++
++ if (len <= sizeof(WMI_BSS_INFO_HDR)) {
++ return A_EINVAL;
++ }
++
++ A_WMI_BSSINFO_EVENT_RX(wmip->wmi_devt, datap, len);
++ /* What is driver config for wlan node caching? */
++ if(ar6000_get_driver_cfg(wmip->wmi_devt,
++ AR6000_DRIVER_CFG_GET_WLANNODECACHING,
++ &nodeCachingAllowed) != A_OK) {
++ return A_EINVAL;
++ }
++
++ if(!nodeCachingAllowed) {
++ return A_OK;
++ }
++
++
++ bih = (WMI_BSS_INFO_HDR *)datap;
++ buf = datap + sizeof(WMI_BSS_INFO_HDR);
++ len -= sizeof(WMI_BSS_INFO_HDR);
++
++ A_DPRINTF(DBG_WMI2, (DBGFMT "bssInfo event - ch %u, rssi %02x, "
++ "bssid \"%02x:%02x:%02x:%02x:%02x:%02x\"\n", DBGARG,
++ bih->channel, (unsigned char) bih->rssi, bih->bssid[0],
++ bih->bssid[1], bih->bssid[2], bih->bssid[3], bih->bssid[4],
++ bih->bssid[5]));
++
++ if(wps_enable && (bih->frameType == PROBERESP_FTYPE) ) {
++ printk("%s() A_OK 2\n", __FUNCTION__);
++ return A_OK;
++ }
++
++ bss = wlan_find_node(&wmip->wmi_scan_table, bih->bssid);
++ if (bss != NULL) {
++ /*
++ * Free up the node. Not the most efficient process given
++ * we are about to allocate a new node but it is simple and should be
++ * adequate.
++ */
++ wlan_node_reclaim(&wmip->wmi_scan_table, bss);
++ }
++
++ bss = wlan_node_alloc(&wmip->wmi_scan_table, len);
++ if (bss == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ bss->ni_snr = bih->snr;
++ bss->ni_rssi = bih->rssi;
++ A_ASSERT(bss->ni_buf != NULL);
++ A_MEMCPY(bss->ni_buf, buf, len);
++
++ if (wlan_parse_beacon(bss->ni_buf, len, &bss->ni_cie) != A_OK) {
++ wlan_node_free(bss);
++ return A_EINVAL;
++ }
++
++ /*
++ * Update the frequency in ie_chan, overwriting of channel number
++ * which is done in wlan_parse_beacon
++ */
++ bss->ni_cie.ie_chan = bih->channel;
++ wlan_setup_node(&wmip->wmi_scan_table, bss, bih->bssid);
++
++ return A_OK;
++}
++
++static A_STATUS
++wmi_opt_frame_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ bss_t *bss;
++ WMI_OPT_RX_INFO_HDR *bih;
++ A_UINT8 *buf;
++
++ if (len <= sizeof(WMI_OPT_RX_INFO_HDR)) {
++ return A_EINVAL;
++ }
++
++ bih = (WMI_OPT_RX_INFO_HDR *)datap;
++ buf = datap + sizeof(WMI_OPT_RX_INFO_HDR);
++ len -= sizeof(WMI_OPT_RX_INFO_HDR);
++
++ A_DPRINTF(DBG_WMI2, (DBGFMT "opt frame event %2.2x:%2.2x\n", DBGARG,
++ bih->bssid[4], bih->bssid[5]));
++
++ bss = wlan_find_node(&wmip->wmi_scan_table, bih->bssid);
++ if (bss != NULL) {
++ /*
++ * Free up the node. Not the most efficient process given
++ * we are about to allocate a new node but it is simple and should be
++ * adequate.
++ */
++ wlan_node_reclaim(&wmip->wmi_scan_table, bss);
++ }
++
++ bss = wlan_node_alloc(&wmip->wmi_scan_table, len);
++ if (bss == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ bss->ni_snr = bih->snr;
++ bss->ni_cie.ie_chan = bih->channel;
++ A_ASSERT(bss->ni_buf != NULL);
++ A_MEMCPY(bss->ni_buf, buf, len);
++ wlan_setup_node(&wmip->wmi_scan_table, bss, bih->bssid);
++
++ return A_OK;
++}
++
++ /* This event indicates inactivity timeout of a fatpipe(pstream)
++ * at the target
++ */
++static A_STATUS
++wmi_pstream_timeout_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMI_PSTREAM_TIMEOUT_EVENT *ev;
++
++ if (len < sizeof(WMI_PSTREAM_TIMEOUT_EVENT)) {
++ return A_EINVAL;
++ }
++
++ A_DPRINTF(DBG_WMI, (DBGFMT "wmi_pstream_timeout_event_rx\n", DBGARG));
++
++ ev = (WMI_PSTREAM_TIMEOUT_EVENT *)datap;
++
++ /* When the pstream (fat pipe == AC) timesout, it means there were no
++ * thinStreams within this pstream & it got implicitly created due to
++ * data flow on this AC. We start the inactivity timer only for
++ * implicitly created pstream. Just reset the host state.
++ */
++ /* Set the activeTsids for this AC to 0 */
++ LOCK_WMI(wmip);
++ wmip->wmi_streamExistsForAC[ev->trafficClass]=0;
++ wmip->wmi_fatPipeExists &= ~(1 << ev->trafficClass);
++ UNLOCK_WMI(wmip);
++
++ /*Indicate inactivity to driver layer for this fatpipe (pstream)*/
++ A_WMI_STREAM_TX_INACTIVE(wmip->wmi_devt, ev->trafficClass);
++
++ return A_OK;
++}
++
++static A_STATUS
++wmi_bitrate_reply_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMI_BIT_RATE_CMD *reply;
++ A_INT32 rate;
++
++ if (len < sizeof(WMI_BIT_RATE_CMD)) {
++ return A_EINVAL;
++ }
++ reply = (WMI_BIT_RATE_CMD *)datap;
++ A_DPRINTF(DBG_WMI,
++ (DBGFMT "Enter - rateindex %d\n", DBGARG, reply->rateIndex));
++
++ if (reply->rateIndex == RATE_AUTO) {
++ rate = RATE_AUTO;
++ } else {
++ rate = wmi_rateTable[(A_UINT32) reply->rateIndex];
++ }
++
++ A_WMI_BITRATE_RX(wmip->wmi_devt, rate);
++
++ return A_OK;
++}
++
++static A_STATUS
++wmi_ratemask_reply_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMI_FIX_RATES_CMD *reply;
++
++ if (len < sizeof(WMI_BIT_RATE_CMD)) {
++ return A_EINVAL;
++ }
++ reply = (WMI_FIX_RATES_CMD *)datap;
++ A_DPRINTF(DBG_WMI,
++ (DBGFMT "Enter - fixed rate mask %x\n", DBGARG, reply->fixRateMask));
++
++ A_WMI_RATEMASK_RX(wmip->wmi_devt, reply->fixRateMask);
++
++ return A_OK;
++}
++
++static A_STATUS
++wmi_channelList_reply_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMI_CHANNEL_LIST_REPLY *reply;
++
++ if (len < sizeof(WMI_CHANNEL_LIST_REPLY)) {
++ return A_EINVAL;
++ }
++ reply = (WMI_CHANNEL_LIST_REPLY *)datap;
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG));
++
++ A_WMI_CHANNELLIST_RX(wmip->wmi_devt, reply->numChannels,
++ reply->channelList);
++
++ return A_OK;
++}
++
++static A_STATUS
++wmi_txPwr_reply_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMI_TX_PWR_REPLY *reply;
++
++ if (len < sizeof(*reply)) {
++ return A_EINVAL;
++ }
++ reply = (WMI_TX_PWR_REPLY *)datap;
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG));
++
++ A_WMI_TXPWR_RX(wmip->wmi_devt, reply->dbM);
++
++ return A_OK;
++}
++static A_STATUS
++wmi_keepalive_reply_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMI_GET_KEEPALIVE_CMD *reply;
++
++ if (len < sizeof(*reply)) {
++ return A_EINVAL;
++ }
++ reply = (WMI_GET_KEEPALIVE_CMD *)datap;
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG));
++
++ A_WMI_KEEPALIVE_RX(wmip->wmi_devt, reply->configured);
++
++ return A_OK;
++}
++
++
++static A_STATUS
++wmi_dset_open_req_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMIX_DSETOPENREQ_EVENT *dsetopenreq;
++
++ if (len < sizeof(WMIX_DSETOPENREQ_EVENT)) {
++ return A_EINVAL;
++ }
++ dsetopenreq = (WMIX_DSETOPENREQ_EVENT *)datap;
++ A_DPRINTF(DBG_WMI,
++ (DBGFMT "Enter - dset_id=0x%x\n", DBGARG, dsetopenreq->dset_id));
++ A_WMI_DSET_OPEN_REQ(wmip->wmi_devt,
++ dsetopenreq->dset_id,
++ dsetopenreq->targ_dset_handle,
++ dsetopenreq->targ_reply_fn,
++ dsetopenreq->targ_reply_arg);
++
++ return A_OK;
++}
++
++#ifdef CONFIG_HOST_DSET_SUPPORT
++static A_STATUS
++wmi_dset_close_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMIX_DSETCLOSE_EVENT *dsetclose;
++
++ if (len < sizeof(WMIX_DSETCLOSE_EVENT)) {
++ return A_EINVAL;
++ }
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG));
++
++ dsetclose = (WMIX_DSETCLOSE_EVENT *)datap;
++ A_WMI_DSET_CLOSE(wmip->wmi_devt, dsetclose->access_cookie);
++
++ return A_OK;
++}
++
++static A_STATUS
++wmi_dset_data_req_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMIX_DSETDATAREQ_EVENT *dsetdatareq;
++
++ if (len < sizeof(WMIX_DSETDATAREQ_EVENT)) {
++ return A_EINVAL;
++ }
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG));
++
++ dsetdatareq = (WMIX_DSETDATAREQ_EVENT *)datap;
++ A_WMI_DSET_DATA_REQ(wmip->wmi_devt,
++ dsetdatareq->access_cookie,
++ dsetdatareq->offset,
++ dsetdatareq->length,
++ dsetdatareq->targ_buf,
++ dsetdatareq->targ_reply_fn,
++ dsetdatareq->targ_reply_arg);
++
++ return A_OK;
++}
++#endif /* CONFIG_HOST_DSET_SUPPORT */
++
++static A_STATUS
++wmi_scanComplete_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMI_SCAN_COMPLETE_EVENT *ev;
++
++ ev = (WMI_SCAN_COMPLETE_EVENT *)datap;
++ A_WMI_SCANCOMPLETE_EVENT(wmip->wmi_devt, ev->status);
++
++ return A_OK;
++}
++
++/*
++ * Target is reporting a programming error. This is for
++ * developer aid only. Target only checks a few common violations
++ * and it is responsibility of host to do all error checking.
++ * Behavior of target after wmi error event is undefined.
++ * A reset is recommended.
++ */
++static A_STATUS
++wmi_errorEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMI_CMD_ERROR_EVENT *ev;
++
++ ev = (WMI_CMD_ERROR_EVENT *)datap;
++ AR_DEBUG_PRINTF(ATH_DEBUG_WMI, ("Programming Error: cmd=%d ", ev->commandId));
++ switch (ev->errorCode) {
++ case (INVALID_PARAM):
++ AR_DEBUG_PRINTF(ATH_DEBUG_WMI, ("Illegal Parameter\n"));
++ break;
++ case (ILLEGAL_STATE):
++ AR_DEBUG_PRINTF(ATH_DEBUG_WMI, ("Illegal State\n"));
++ break;
++ case (INTERNAL_ERROR):
++ AR_DEBUG_PRINTF(ATH_DEBUG_WMI, ("Internal Error\n"));
++ break;
++ }
++
++ return A_OK;
++}
++
++
++static A_STATUS
++wmi_statsEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMI_TARGET_STATS *reply;
++
++ if (len < sizeof(*reply)) {
++ return A_EINVAL;
++ }
++ reply = (WMI_TARGET_STATS *)datap;
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG));
++
++ A_WMI_TARGETSTATS_EVENT(wmip->wmi_devt, reply);
++
++ return A_OK;
++}
++
++static A_STATUS
++wmi_rssiThresholdEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMI_RSSI_THRESHOLD_EVENT *reply;
++
++ if (len < sizeof(*reply)) {
++ return A_EINVAL;
++ }
++ reply = (WMI_RSSI_THRESHOLD_EVENT *)datap;
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG));
++
++ A_WMI_RSSI_THRESHOLD_EVENT(wmip->wmi_devt, reply->range, reply->rssi);
++
++ return A_OK;
++}
++
++
++static A_STATUS
++wmi_reportErrorEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMI_TARGET_ERROR_REPORT_EVENT *reply;
++
++ if (len < sizeof(*reply)) {
++ return A_EINVAL;
++ }
++ reply = (WMI_TARGET_ERROR_REPORT_EVENT *)datap;
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG));
++
++ A_WMI_REPORT_ERROR_EVENT(wmip->wmi_devt, reply->errorVal);
++
++ return A_OK;
++}
++
++static A_STATUS
++wmi_cac_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMI_CAC_EVENT *reply;
++
++ if (len < sizeof(*reply)) {
++ return A_EINVAL;
++ }
++ reply = (WMI_CAC_EVENT *)datap;
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG));
++
++ A_WMI_CAC_EVENT(wmip->wmi_devt, reply->ac,
++ reply->cac_indication, reply->statusCode,
++ reply->tspecSuggestion);
++
++ return A_OK;
++}
++
++static A_STATUS
++wmi_hbChallengeResp_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMIX_HB_CHALLENGE_RESP_EVENT *reply;
++
++ if (len < sizeof(*reply)) {
++ return A_EINVAL;
++ }
++ reply = (WMIX_HB_CHALLENGE_RESP_EVENT *)datap;
++ A_DPRINTF(DBG_WMI, (DBGFMT "wmi: challenge response event\n", DBGARG));
++
++ A_WMI_HBCHALLENGERESP_EVENT(wmip->wmi_devt, reply->cookie, reply->source);
++
++ return A_OK;
++}
++
++static A_STATUS
++wmi_roam_tbl_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMI_TARGET_ROAM_TBL *reply;
++
++ if (len < sizeof(*reply)) {
++ return A_EINVAL;
++ }
++ reply = (WMI_TARGET_ROAM_TBL *)datap;
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG));
++
++ A_WMI_ROAM_TABLE_EVENT(wmip->wmi_devt, reply);
++
++ return A_OK;
++}
++
++static A_STATUS
++wmi_roam_data_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMI_TARGET_ROAM_DATA *reply;
++
++ if (len < sizeof(*reply)) {
++ return A_EINVAL;
++ }
++ reply = (WMI_TARGET_ROAM_DATA *)datap;
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG));
++
++ A_WMI_ROAM_DATA_EVENT(wmip->wmi_devt, reply);
++
++ return A_OK;
++}
++
++static A_STATUS
++wmi_txRetryErrEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMI_TX_RETRY_ERR_EVENT *reply;
++
++ if (len < sizeof(*reply)) {
++ return A_EINVAL;
++ }
++ reply = (WMI_TX_RETRY_ERR_EVENT *)datap;
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG));
++
++ A_WMI_TX_RETRY_ERR_EVENT(wmip->wmi_devt);
++
++ return A_OK;
++}
++
++static A_STATUS
++wmi_snrThresholdEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMI_SNR_THRESHOLD_EVENT *reply;
++
++ if (len < sizeof(*reply)) {
++ return A_EINVAL;
++ }
++ reply = (WMI_SNR_THRESHOLD_EVENT *)datap;
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG));
++
++ A_WMI_SNR_THRESHOLD_EVENT_RX(wmip->wmi_devt, reply->range, reply->snr);
++
++ return A_OK;
++}
++
++static A_STATUS
++wmi_lqThresholdEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMI_LQ_THRESHOLD_EVENT *reply;
++
++ if (len < sizeof(*reply)) {
++ return A_EINVAL;
++ }
++ reply = (WMI_LQ_THRESHOLD_EVENT *)datap;
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG));
++
++ A_WMI_LQ_THRESHOLD_EVENT_RX(wmip->wmi_devt, reply->range, reply->lq);
++
++ return A_OK;
++}
++
++static A_STATUS
++wmi_aplistEvent_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ A_UINT16 ap_info_entry_size;
++ WMI_APLIST_EVENT *ev = (WMI_APLIST_EVENT *)datap;
++ WMI_AP_INFO_V1 *ap_info_v1;
++ A_UINT8 i;
++
++ if (len < sizeof(WMI_APLIST_EVENT)) {
++ return A_EINVAL;
++ }
++
++ if (ev->apListVer == APLIST_VER1) {
++ ap_info_entry_size = sizeof(WMI_AP_INFO_V1);
++ ap_info_v1 = (WMI_AP_INFO_V1 *)ev->apList;
++ } else {
++ return A_EINVAL;
++ }
++
++ AR_DEBUG_PRINTF(ATH_DEBUG_WMI, ("Number of APs in APLIST Event is %d\n", ev->numAP));
++ if (len < (int)(sizeof(WMI_APLIST_EVENT) +
++ (ev->numAP - 1) * ap_info_entry_size))
++ {
++ return A_EINVAL;
++ }
++
++ /*
++ * AP List Ver1 Contents
++ */
++ for (i = 0; i < ev->numAP; i++) {
++ AR_DEBUG_PRINTF(ATH_DEBUG_WMI, ("AP#%d BSSID %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x "\
++ "Channel %d\n", i,
++ ap_info_v1->bssid[0], ap_info_v1->bssid[1],
++ ap_info_v1->bssid[2], ap_info_v1->bssid[3],
++ ap_info_v1->bssid[4], ap_info_v1->bssid[5],
++ ap_info_v1->channel));
++ ap_info_v1++;
++ }
++ return A_OK;
++}
++
++static A_STATUS
++wmi_dbglog_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ A_UINT32 dropped;
++
++ dropped = *((A_UINT32 *)datap);
++ datap += sizeof(dropped);
++ len -= sizeof(dropped);
++ A_WMI_DBGLOG_EVENT(wmip->wmi_devt, dropped, datap, len);
++ return A_OK;
++}
++
++#ifdef CONFIG_HOST_GPIO_SUPPORT
++static A_STATUS
++wmi_gpio_intr_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMIX_GPIO_INTR_EVENT *gpio_intr = (WMIX_GPIO_INTR_EVENT *)datap;
++
++ A_DPRINTF(DBG_WMI,
++ (DBGFMT "Enter - intrmask=0x%x input=0x%x.\n", DBGARG,
++ gpio_intr->intr_mask, gpio_intr->input_values));
++
++ A_WMI_GPIO_INTR_RX(gpio_intr->intr_mask, gpio_intr->input_values);
++
++ return A_OK;
++}
++
++static A_STATUS
++wmi_gpio_data_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMIX_GPIO_DATA_EVENT *gpio_data = (WMIX_GPIO_DATA_EVENT *)datap;
++
++ A_DPRINTF(DBG_WMI,
++ (DBGFMT "Enter - reg=%d value=0x%x\n", DBGARG,
++ gpio_data->reg_id, gpio_data->value));
++
++ A_WMI_GPIO_DATA_RX(gpio_data->reg_id, gpio_data->value);
++
++ return A_OK;
++}
++
++static A_STATUS
++wmi_gpio_ack_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG));
++
++ A_WMI_GPIO_ACK_RX();
++
++ return A_OK;
++}
++#endif /* CONFIG_HOST_GPIO_SUPPORT */
++
++/*
++ * Called to send a wmi command. Command specific data is already built
++ * on osbuf and current osbuf->data points to it.
++ */
++A_STATUS
++wmi_cmd_send(struct wmi_t *wmip, void *osbuf, WMI_COMMAND_ID cmdId,
++ WMI_SYNC_FLAG syncflag)
++{
++#define IS_LONG_CMD(cmdId) ((cmdId == WMI_OPT_TX_FRAME_CMDID) || (cmdId == WMI_ADD_WOW_PATTERN_CMDID))
++ WMI_CMD_HDR *cHdr;
++ WMI_PRI_STREAM_ID streamID = WMI_CONTROL_PRI;
++
++ A_ASSERT(osbuf != NULL);
++
++ if (syncflag >= END_WMIFLAG) {
++ return A_EINVAL;
++ }
++
++ if ((syncflag == SYNC_BEFORE_WMIFLAG) || (syncflag == SYNC_BOTH_WMIFLAG)) {
++ /*
++ * We want to make sure all data currently queued is transmitted before
++ * the cmd execution. Establish a new sync point.
++ */
++ wmi_sync_point(wmip);
++ }
++
++ if (A_NETBUF_PUSH(osbuf, sizeof(WMI_CMD_HDR)) != A_OK) {
++ return A_NO_MEMORY;
++ }
++
++ cHdr = (WMI_CMD_HDR *)A_NETBUF_DATA(osbuf);
++ cHdr->commandId = cmdId;
++
++ /*
++ * Send cmd, some via control pipe, others via data pipe
++ */
++ if (IS_LONG_CMD(cmdId)) {
++ wmi_data_hdr_add(wmip, osbuf, CNTL_MSGTYPE);
++ // TODO ... these can now go through the control endpoint via HTC 2.0
++ streamID = WMI_BEST_EFFORT_PRI;
++ }
++ A_WMI_CONTROL_TX(wmip->wmi_devt, osbuf, streamID);
++
++ if ((syncflag == SYNC_AFTER_WMIFLAG) || (syncflag == SYNC_BOTH_WMIFLAG)) {
++ /*
++ * We want to make sure all new data queued waits for the command to
++ * execute. Establish a new sync point.
++ */
++ wmi_sync_point(wmip);
++ }
++ return (A_OK);
++#undef IS_LONG_CMD
++}
++
++A_STATUS
++wmi_cmd_send_xtnd(struct wmi_t *wmip, void *osbuf, WMI_COMMAND_ID cmdId,
++ WMI_SYNC_FLAG syncflag)
++{
++ WMIX_CMD_HDR *cHdr;
++
++ if (A_NETBUF_PUSH(osbuf, sizeof(WMIX_CMD_HDR)) != A_OK) {
++ return A_NO_MEMORY;
++ }
++
++ cHdr = (WMIX_CMD_HDR *)A_NETBUF_DATA(osbuf);
++ cHdr->commandId = cmdId;
++
++ return wmi_cmd_send(wmip, osbuf, WMI_EXTENSION_CMDID, syncflag);
++}
++
++A_STATUS
++wmi_connect_cmd(struct wmi_t *wmip, NETWORK_TYPE netType,
++ DOT11_AUTH_MODE dot11AuthMode, AUTH_MODE authMode,
++ CRYPTO_TYPE pairwiseCrypto, A_UINT8 pairwiseCryptoLen,
++ CRYPTO_TYPE groupCrypto,A_UINT8 groupCryptoLen,
++ int ssidLength, A_UCHAR *ssid,
++ A_UINT8 *bssid, A_UINT16 channel, A_UINT32 ctrl_flags)
++{
++ void *osbuf;
++ WMI_CONNECT_CMD *cc;
++
++ if ((pairwiseCrypto == NONE_CRYPT) && (groupCrypto != NONE_CRYPT)) {
++ return A_EINVAL;
++ }
++ if ((pairwiseCrypto != NONE_CRYPT) && (groupCrypto == NONE_CRYPT)) {
++ return A_EINVAL;
++ }
++
++ osbuf = A_NETBUF_ALLOC(sizeof(WMI_CONNECT_CMD));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(WMI_CONNECT_CMD));
++
++ cc = (WMI_CONNECT_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cc, sizeof(*cc));
++
++ A_MEMCPY(cc->ssid, ssid, ssidLength);
++ cc->ssidLength = ssidLength;
++ cc->networkType = netType;
++ cc->dot11AuthMode = dot11AuthMode;
++ cc->authMode = authMode;
++ cc->pairwiseCryptoType = pairwiseCrypto;
++ cc->pairwiseCryptoLen = pairwiseCryptoLen;
++ cc->groupCryptoType = groupCrypto;
++ cc->groupCryptoLen = groupCryptoLen;
++ cc->channel = channel;
++ cc->ctrl_flags = ctrl_flags;
++
++ if (bssid != NULL) {
++ A_MEMCPY(cc->bssid, bssid, ATH_MAC_LEN);
++ }
++ if (wmi_set_keepalive_cmd(wmip, wmip->wmi_keepaliveInterval) != A_OK) {
++ return(A_ERROR);
++ }
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_CONNECT_CMDID, NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_reconnect_cmd(struct wmi_t *wmip, A_UINT8 *bssid, A_UINT16 channel)
++{
++ void *osbuf;
++ WMI_RECONNECT_CMD *cc;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(WMI_RECONNECT_CMD));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(WMI_RECONNECT_CMD));
++
++ cc = (WMI_RECONNECT_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cc, sizeof(*cc));
++
++ cc->channel = channel;
++
++ if (bssid != NULL) {
++ A_MEMCPY(cc->bssid, bssid, ATH_MAC_LEN);
++ }
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_RECONNECT_CMDID, NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_disconnect_cmd(struct wmi_t *wmip)
++{
++ void *osbuf;
++ A_STATUS status;
++
++ osbuf = A_NETBUF_ALLOC(0); /* no payload */
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ /* Bug fix for 24817(elevator bug) - the disconnect command does not
++ need to do a SYNC before.*/
++ status = (wmi_cmd_send(wmip, osbuf, WMI_DISCONNECT_CMDID,
++ NO_SYNC_WMIFLAG));
++
++ return status;
++}
++
++A_STATUS
++wmi_startscan_cmd(struct wmi_t *wmip, WMI_SCAN_TYPE scanType,
++ A_BOOL forceFgScan, A_BOOL isLegacy,
++ A_UINT32 homeDwellTime, A_UINT32 forceScanInterval)
++{
++ void *osbuf;
++ WMI_START_SCAN_CMD *sc;
++
++ if ((scanType != WMI_LONG_SCAN) && (scanType != WMI_SHORT_SCAN)) {
++ return A_EINVAL;
++ }
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*sc));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*sc));
++
++ sc = (WMI_START_SCAN_CMD *)(A_NETBUF_DATA(osbuf));
++ sc->scanType = scanType;
++ sc->forceFgScan = forceFgScan;
++ sc->isLegacy = isLegacy;
++ sc->homeDwellTime = homeDwellTime;
++ sc->forceScanInterval = forceScanInterval;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_START_SCAN_CMDID, NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_scanparams_cmd(struct wmi_t *wmip, A_UINT16 fg_start_sec,
++ A_UINT16 fg_end_sec, A_UINT16 bg_sec,
++ A_UINT16 minact_chdw_msec, A_UINT16 maxact_chdw_msec,
++ A_UINT16 pas_chdw_msec,
++ A_UINT8 shScanRatio, A_UINT8 scanCtrlFlags,
++ A_UINT32 max_dfsch_act_time)
++{
++ void *osbuf;
++ WMI_SCAN_PARAMS_CMD *sc;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*sc));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*sc));
++
++ sc = (WMI_SCAN_PARAMS_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(sc, sizeof(*sc));
++ sc->fg_start_period = fg_start_sec;
++ sc->fg_end_period = fg_end_sec;
++ sc->bg_period = bg_sec;
++ sc->minact_chdwell_time = minact_chdw_msec;
++ sc->maxact_chdwell_time = maxact_chdw_msec;
++ sc->pas_chdwell_time = pas_chdw_msec;
++ sc->shortScanRatio = shScanRatio;
++ sc->scanCtrlFlags = scanCtrlFlags;
++ sc->max_dfsch_act_time = max_dfsch_act_time;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_SCAN_PARAMS_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_bssfilter_cmd(struct wmi_t *wmip, A_UINT8 filter, A_UINT32 ieMask)
++{
++ void *osbuf;
++ WMI_BSS_FILTER_CMD *cmd;
++
++ if (filter >= LAST_BSS_FILTER) {
++ return A_EINVAL;
++ }
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_BSS_FILTER_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++ cmd->bssFilter = filter;
++ cmd->ieMask = ieMask;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_BSS_FILTER_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_probedSsid_cmd(struct wmi_t *wmip, A_UINT8 index, A_UINT8 flag,
++ A_UINT8 ssidLength, A_UCHAR *ssid)
++{
++ void *osbuf;
++ WMI_PROBED_SSID_CMD *cmd;
++
++ if (index > MAX_PROBED_SSID_INDEX) {
++ return A_EINVAL;
++ }
++ if (ssidLength > sizeof(cmd->ssid)) {
++ return A_EINVAL;
++ }
++ if ((flag & (DISABLE_SSID_FLAG | ANY_SSID_FLAG)) && (ssidLength > 0)) {
++ return A_EINVAL;
++ }
++ if ((flag & SPECIFIC_SSID_FLAG) && !ssidLength) {
++ return A_EINVAL;
++ }
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_PROBED_SSID_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++ cmd->entryIndex = index;
++ cmd->flag = flag;
++ cmd->ssidLength = ssidLength;
++ A_MEMCPY(cmd->ssid, ssid, ssidLength);
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_PROBED_SSID_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_listeninterval_cmd(struct wmi_t *wmip, A_UINT16 listenInterval, A_UINT16 listenBeacons)
++{
++ void *osbuf;
++ WMI_LISTEN_INT_CMD *cmd;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_LISTEN_INT_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++ cmd->listenInterval = listenInterval;
++ cmd->numBeacons = listenBeacons;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_LISTEN_INT_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_bmisstime_cmd(struct wmi_t *wmip, A_UINT16 bmissTime, A_UINT16 bmissBeacons)
++{
++ void *osbuf;
++ WMI_BMISS_TIME_CMD *cmd;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_BMISS_TIME_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++ cmd->bmissTime = bmissTime;
++ cmd->numBeacons = bmissBeacons;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_BMISS_TIME_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_associnfo_cmd(struct wmi_t *wmip, A_UINT8 ieType,
++ A_UINT8 ieLen, A_UINT8 *ieInfo)
++{
++ void *osbuf;
++ WMI_SET_ASSOC_INFO_CMD *cmd;
++ A_UINT16 cmdLen;
++
++ cmdLen = sizeof(*cmd) + ieLen - 1;
++ osbuf = A_NETBUF_ALLOC(cmdLen);
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, cmdLen);
++
++ cmd = (WMI_SET_ASSOC_INFO_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, cmdLen);
++ cmd->ieType = ieType;
++ cmd->bufferSize = ieLen;
++ A_MEMCPY(cmd->assocInfo, ieInfo, ieLen);
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_ASSOC_INFO_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_powermode_cmd(struct wmi_t *wmip, A_UINT8 powerMode)
++{
++ void *osbuf;
++ WMI_POWER_MODE_CMD *cmd;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_POWER_MODE_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++ cmd->powerMode = powerMode;
++ wmip->wmi_powerMode = powerMode;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_POWER_MODE_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_ibsspmcaps_cmd(struct wmi_t *wmip, A_UINT8 pmEnable, A_UINT8 ttl,
++ A_UINT16 atim_windows, A_UINT16 timeout_value)
++{
++ void *osbuf;
++ WMI_IBSS_PM_CAPS_CMD *cmd;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_IBSS_PM_CAPS_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++ cmd->power_saving = pmEnable;
++ cmd->ttl = ttl;
++ cmd->atim_windows = atim_windows;
++ cmd->timeout_value = timeout_value;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_IBSS_PM_CAPS_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_pmparams_cmd(struct wmi_t *wmip, A_UINT16 idlePeriod,
++ A_UINT16 psPollNum, A_UINT16 dtimPolicy)
++{
++ void *osbuf;
++ WMI_POWER_PARAMS_CMD *pm;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*pm));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*pm));
++
++ pm = (WMI_POWER_PARAMS_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(pm, sizeof(*pm));
++ pm->idle_period = idlePeriod;
++ pm->pspoll_number = psPollNum;
++ pm->dtim_policy = dtimPolicy;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_POWER_PARAMS_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_disctimeout_cmd(struct wmi_t *wmip, A_UINT8 timeout)
++{
++ void *osbuf;
++ WMI_DISC_TIMEOUT_CMD *cmd;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_DISC_TIMEOUT_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++ cmd->disconnectTimeout = timeout;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_DISC_TIMEOUT_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_addKey_cmd(struct wmi_t *wmip, A_UINT8 keyIndex, CRYPTO_TYPE keyType,
++ A_UINT8 keyUsage, A_UINT8 keyLength, A_UINT8 *keyRSC,
++ A_UINT8 *keyMaterial, A_UINT8 key_op_ctrl,
++ WMI_SYNC_FLAG sync_flag)
++{
++ void *osbuf;
++ WMI_ADD_CIPHER_KEY_CMD *cmd;
++
++ if ((keyIndex > WMI_MAX_KEY_INDEX) || (keyLength > WMI_MAX_KEY_LEN) ||
++ (keyMaterial == NULL))
++ {
++ return A_EINVAL;
++ }
++
++ if ((WEP_CRYPT != keyType) && (NULL == keyRSC)) {
++ return A_EINVAL;
++ }
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_ADD_CIPHER_KEY_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++ cmd->keyIndex = keyIndex;
++ cmd->keyType = keyType;
++ cmd->keyUsage = keyUsage;
++ cmd->keyLength = keyLength;
++ A_MEMCPY(cmd->key, keyMaterial, keyLength);
++ if (NULL != keyRSC) {
++ A_MEMCPY(cmd->keyRSC, keyRSC, sizeof(cmd->keyRSC));
++ }
++ cmd->key_op_ctrl = key_op_ctrl;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_ADD_CIPHER_KEY_CMDID, sync_flag));
++}
++
++A_STATUS
++wmi_add_krk_cmd(struct wmi_t *wmip, A_UINT8 *krk)
++{
++ void *osbuf;
++ WMI_ADD_KRK_CMD *cmd;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_ADD_KRK_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++ A_MEMCPY(cmd->krk, krk, WMI_KRK_LEN);
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_ADD_KRK_CMDID, NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_delete_krk_cmd(struct wmi_t *wmip)
++{
++ void *osbuf;
++
++ osbuf = A_NETBUF_ALLOC(0);
++
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_DELETE_KRK_CMDID, NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_deleteKey_cmd(struct wmi_t *wmip, A_UINT8 keyIndex)
++{
++ void *osbuf;
++ WMI_DELETE_CIPHER_KEY_CMD *cmd;
++
++ if (keyIndex > WMI_MAX_KEY_INDEX) {
++ return A_EINVAL;
++ }
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_DELETE_CIPHER_KEY_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++ cmd->keyIndex = keyIndex;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_DELETE_CIPHER_KEY_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_setPmkid_cmd(struct wmi_t *wmip, A_UINT8 *bssid, A_UINT8 *pmkId,
++ A_BOOL set)
++{
++ void *osbuf;
++ WMI_SET_PMKID_CMD *cmd;
++
++ if (bssid == NULL) {
++ return A_EINVAL;
++ }
++
++ if ((set == TRUE) && (pmkId == NULL)) {
++ return A_EINVAL;
++ }
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_SET_PMKID_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMCPY(cmd->bssid, bssid, sizeof(cmd->bssid));
++ if (set == TRUE) {
++ A_MEMCPY(cmd->pmkid, pmkId, sizeof(cmd->pmkid));
++ cmd->enable = PMKID_ENABLE;
++ } else {
++ A_MEMZERO(cmd->pmkid, sizeof(cmd->pmkid));
++ cmd->enable = PMKID_DISABLE;
++ }
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_PMKID_CMDID, NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_set_tkip_countermeasures_cmd(struct wmi_t *wmip, A_BOOL en)
++{
++ void *osbuf;
++ WMI_SET_TKIP_COUNTERMEASURES_CMD *cmd;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_SET_TKIP_COUNTERMEASURES_CMD *)(A_NETBUF_DATA(osbuf));
++ cmd->cm_en = (en == TRUE)? WMI_TKIP_CM_ENABLE : WMI_TKIP_CM_DISABLE;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_TKIP_COUNTERMEASURES_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_set_akmp_params_cmd(struct wmi_t *wmip,
++ WMI_SET_AKMP_PARAMS_CMD *akmpParams)
++{
++ void *osbuf;
++ WMI_SET_AKMP_PARAMS_CMD *cmd;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++ cmd = (WMI_SET_AKMP_PARAMS_CMD *)(A_NETBUF_DATA(osbuf));
++ cmd->akmpInfo = akmpParams->akmpInfo;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_AKMP_PARAMS_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_set_pmkid_list_cmd(struct wmi_t *wmip,
++ WMI_SET_PMKID_LIST_CMD *pmkInfo)
++{
++ void *osbuf;
++ WMI_SET_PMKID_LIST_CMD *cmd;
++ A_UINT16 cmdLen;
++ A_UINT8 i;
++
++ cmdLen = sizeof(pmkInfo->numPMKID) +
++ pmkInfo->numPMKID * sizeof(WMI_PMKID);
++
++ osbuf = A_NETBUF_ALLOC(cmdLen);
++
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, cmdLen);
++ cmd = (WMI_SET_PMKID_LIST_CMD *)(A_NETBUF_DATA(osbuf));
++ cmd->numPMKID = pmkInfo->numPMKID;
++
++ for (i = 0; i < cmd->numPMKID; i++) {
++ A_MEMCPY(&cmd->pmkidList[i], &pmkInfo->pmkidList[i],
++ WMI_PMKID_LEN);
++ }
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_PMKID_LIST_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_get_pmkid_list_cmd(struct wmi_t *wmip)
++{
++ void *osbuf;
++
++ osbuf = A_NETBUF_ALLOC(0); /* no payload */
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_GET_PMKID_LIST_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_dataSync_send(struct wmi_t *wmip, void *osbuf, WMI_PRI_STREAM_ID streamID)
++{
++ WMI_DATA_HDR *dtHdr;
++
++ A_ASSERT(streamID != WMI_CONTROL_PRI);
++ A_ASSERT(osbuf != NULL);
++
++ if (A_NETBUF_PUSH(osbuf, sizeof(WMI_DATA_HDR)) != A_OK) {
++ return A_NO_MEMORY;
++ }
++
++ dtHdr = (WMI_DATA_HDR *)A_NETBUF_DATA(osbuf);
++ dtHdr->info =
++ (SYNC_MSGTYPE & WMI_DATA_HDR_MSG_TYPE_MASK) << WMI_DATA_HDR_MSG_TYPE_SHIFT;
++
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter - streamID %d\n", DBGARG, streamID));
++
++ return (A_WMI_CONTROL_TX(wmip->wmi_devt, osbuf, streamID));
++}
++
++typedef struct _WMI_DATA_SYNC_BUFS {
++ A_UINT8 trafficClass;
++ void *osbuf;
++}WMI_DATA_SYNC_BUFS;
++
++static A_STATUS
++wmi_sync_point(struct wmi_t *wmip)
++{
++ void *cmd_osbuf;
++ WMI_DATA_SYNC_BUFS dataSyncBufs[WMM_NUM_AC];
++ A_UINT8 i,numPriStreams=0;
++ A_STATUS status;
++
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG));
++
++ memset(dataSyncBufs,0,sizeof(dataSyncBufs));
++
++ /* lock out while we walk through the priority list and assemble our local array */
++ LOCK_WMI(wmip);
++
++ for (i=0; i < WMM_NUM_AC ; i++) {
++ if (wmip->wmi_fatPipeExists & (1 << i)) {
++ numPriStreams++;
++ dataSyncBufs[numPriStreams-1].trafficClass = i;
++ }
++ }
++
++ UNLOCK_WMI(wmip);
++
++ /* dataSyncBufs is now filled with entries (starting at index 0) containing valid streamIDs */
++
++ do {
++ /*
++ * We allocate all network buffers needed so we will be able to
++ * send all required frames.
++ */
++ cmd_osbuf = A_NETBUF_ALLOC(0); /* no payload */
++ if (cmd_osbuf == NULL) {
++ status = A_NO_MEMORY;
++ break;
++ }
++
++ for (i=0; i < numPriStreams ; i++) {
++ dataSyncBufs[i].osbuf = A_NETBUF_ALLOC(0);
++ if (dataSyncBufs[i].osbuf == NULL) {
++ status = A_NO_MEMORY;
++ break;
++ }
++ } //end for
++
++ /*
++ * Send sync cmd followed by sync data messages on all endpoints being
++ * used
++ */
++ status = wmi_cmd_send(wmip, cmd_osbuf, WMI_SYNCHRONIZE_CMDID,
++ NO_SYNC_WMIFLAG);
++
++ if (A_FAILED(status)) {
++ break;
++ }
++ /* cmd buffer sent, we no longer own it */
++ cmd_osbuf = NULL;
++
++ for(i=0; i < numPriStreams; i++) {
++ A_ASSERT(dataSyncBufs[i].osbuf != NULL);
++
++ status = wmi_dataSync_send(wmip, dataSyncBufs[i].osbuf,
++ WMI_ACCESSCATEGORY_WMISTREAM(wmip,dataSyncBufs[i].trafficClass));
++
++ if (A_FAILED(status)) {
++ break;
++ }
++ /* we don't own this buffer anymore, NULL it out of the array so it
++ * won't get cleaned up */
++ dataSyncBufs[i].osbuf = NULL;
++ } //end for
++
++ } while(FALSE);
++
++ /* free up any resources left over (possibly due to an error) */
++
++ if (cmd_osbuf != NULL) {
++ A_NETBUF_FREE(cmd_osbuf);
++ }
++
++ for (i = 0; i < numPriStreams; i++) {
++ if (dataSyncBufs[i].osbuf != NULL) {
++ A_NETBUF_FREE(dataSyncBufs[i].osbuf);
++ }
++ }
++
++ return (status);
++}
++
++A_STATUS
++wmi_create_pstream_cmd(struct wmi_t *wmip, WMI_CREATE_PSTREAM_CMD *params)
++{
++ void *osbuf;
++ WMI_CREATE_PSTREAM_CMD *cmd;
++ A_UINT16 activeTsids=0;
++ A_UINT8 fatPipeExistsForAC=0;
++
++ /* Validate all the parameters. */
++ if( !((params->userPriority < 8) &&
++ (params->userPriority <= 0x7) &&
++ (convert_userPriority_to_trafficClass(params->userPriority) == params->trafficClass) &&
++ (params->trafficDirection == UPLINK_TRAFFIC ||
++ params->trafficDirection == DNLINK_TRAFFIC ||
++ params->trafficDirection == BIDIR_TRAFFIC) &&
++ (params->trafficType == TRAFFIC_TYPE_APERIODIC ||
++ params->trafficType == TRAFFIC_TYPE_PERIODIC ) &&
++ (params->voicePSCapability == DISABLE_FOR_THIS_AC ||
++ params->voicePSCapability == ENABLE_FOR_THIS_AC ||
++ params->voicePSCapability == ENABLE_FOR_ALL_AC) &&
++ (params->tsid == WMI_IMPLICIT_PSTREAM || params->tsid <= WMI_MAX_THINSTREAM)) )
++ {
++ return A_EINVAL;
++ }
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ A_DPRINTF(DBG_WMI,
++ (DBGFMT "Sending create_pstream_cmd: ac=%d tsid:%d\n", DBGARG,
++ params->trafficClass, params->tsid));
++
++ cmd = (WMI_CREATE_PSTREAM_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++ A_MEMCPY(cmd, params, sizeof(*cmd));
++
++ /* this is an implicitly created Fat pipe */
++ if (params->tsid == WMI_IMPLICIT_PSTREAM) {
++ LOCK_WMI(wmip);
++ fatPipeExistsForAC = (wmip->wmi_fatPipeExists & (1 << params->trafficClass));
++ wmip->wmi_fatPipeExists |= (1<<params->trafficClass);
++ UNLOCK_WMI(wmip);
++ } else {
++ /* this is an explicitly created thin stream within a fat pipe */
++ LOCK_WMI(wmip);
++ fatPipeExistsForAC = (wmip->wmi_fatPipeExists & (1 << params->trafficClass));
++ activeTsids = wmip->wmi_streamExistsForAC[params->trafficClass];
++ wmip->wmi_streamExistsForAC[params->trafficClass] |= (1<<params->tsid);
++ /* if a thinstream becomes active, the fat pipe automatically
++ * becomes active
++ */
++ wmip->wmi_fatPipeExists |= (1<<params->trafficClass);
++ UNLOCK_WMI(wmip);
++ }
++
++ /* Indicate activty change to driver layer only if this is the
++ * first TSID to get created in this AC explicitly or an implicit
++ * fat pipe is getting created.
++ */
++ if (!fatPipeExistsForAC) {
++ A_WMI_STREAM_TX_ACTIVE(wmip->wmi_devt, params->trafficClass);
++ }
++
++ /* mike: should be SYNC_BEFORE_WMIFLAG */
++ return (wmi_cmd_send(wmip, osbuf, WMI_CREATE_PSTREAM_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_delete_pstream_cmd(struct wmi_t *wmip, A_UINT8 trafficClass, A_UINT8 tsid)
++{
++ void *osbuf;
++ WMI_DELETE_PSTREAM_CMD *cmd;
++ A_STATUS status;
++ A_UINT16 activeTsids=0;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_DELETE_PSTREAM_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++
++ cmd->trafficClass = trafficClass;
++ cmd->tsid = tsid;
++
++ LOCK_WMI(wmip);
++ activeTsids = wmip->wmi_streamExistsForAC[trafficClass];
++ UNLOCK_WMI(wmip);
++
++ /* Check if the tsid was created & exists */
++ if (!(activeTsids & (1<<tsid))) {
++
++ A_DPRINTF(DBG_WMI,
++ (DBGFMT "TSID %d does'nt exist for trafficClass: %d\n", DBGARG, tsid, trafficClass));
++ /* TODO: return a more appropriate err code */
++ return A_ERROR;
++ }
++
++ A_DPRINTF(DBG_WMI,
++ (DBGFMT "Sending delete_pstream_cmd: trafficClass: %d tsid=%d\n", DBGARG, trafficClass, tsid));
++
++ status = (wmi_cmd_send(wmip, osbuf, WMI_DELETE_PSTREAM_CMDID,
++ SYNC_BEFORE_WMIFLAG));
++
++ LOCK_WMI(wmip);
++ wmip->wmi_streamExistsForAC[trafficClass] &= ~(1<<tsid);
++ activeTsids = wmip->wmi_streamExistsForAC[trafficClass];
++ UNLOCK_WMI(wmip);
++
++
++ /* Indicate stream inactivity to driver layer only if all tsids
++ * within this AC are deleted.
++ */
++ if(!activeTsids) {
++ A_WMI_STREAM_TX_INACTIVE(wmip->wmi_devt, trafficClass);
++ wmip->wmi_fatPipeExists &= ~(1<<trafficClass);
++ }
++
++ return status;
++}
++
++/*
++ * used to set the bit rate. rate is in Kbps. If rate == -1
++ * then auto selection is used.
++ */
++A_STATUS
++wmi_set_bitrate_cmd(struct wmi_t *wmip, A_INT32 rate)
++{
++ void *osbuf;
++ WMI_BIT_RATE_CMD *cmd;
++ A_INT8 index;
++
++ if (rate != -1) {
++ index = wmi_validate_bitrate(wmip, rate);
++ if(index == A_EINVAL){
++ return A_EINVAL;
++ }
++ } else {
++ index = -1;
++ }
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_BIT_RATE_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++
++ cmd->rateIndex = index;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_BITRATE_CMDID, NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_get_bitrate_cmd(struct wmi_t *wmip)
++{
++ void *osbuf;
++
++ osbuf = A_NETBUF_ALLOC(0); /* no payload */
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_GET_BITRATE_CMDID, NO_SYNC_WMIFLAG));
++}
++
++/*
++ * Returns TRUE iff the given rate index is legal in the current PHY mode.
++ */
++A_BOOL
++wmi_is_bitrate_index_valid(struct wmi_t *wmip, A_UINT32 rateIndex)
++{
++ WMI_PHY_MODE phyMode = wmip->wmi_phyMode;
++ A_BOOL isValid = TRUE;
++ switch(phyMode) {
++ case WMI_11A_MODE:
++ if ((rateIndex < MODE_A_SUPPORT_RATE_START) || (rateIndex > MODE_A_SUPPORT_RATE_STOP)) {
++ isValid = FALSE;
++ }
++ break;
++
++ case WMI_11B_MODE:
++ if ((rateIndex < MODE_B_SUPPORT_RATE_START) || (rateIndex > MODE_B_SUPPORT_RATE_STOP)) {
++ isValid = FALSE;
++ }
++ break;
++
++ case WMI_11GONLY_MODE:
++ if ((rateIndex < MODE_GONLY_SUPPORT_RATE_START) || (rateIndex > MODE_GONLY_SUPPORT_RATE_STOP)) {
++ isValid = FALSE;
++ }
++ break;
++
++ case WMI_11G_MODE:
++ case WMI_11AG_MODE:
++ if ((rateIndex < MODE_G_SUPPORT_RATE_START) || (rateIndex > MODE_G_SUPPORT_RATE_STOP)) {
++ isValid = FALSE;
++ }
++ break;
++
++ default:
++ A_ASSERT(FALSE);
++ break;
++ }
++
++ return isValid;
++}
++
++A_INT8
++wmi_validate_bitrate(struct wmi_t *wmip, A_INT32 rate)
++{
++ A_INT8 i;
++ if (rate != -1)
++ {
++ for (i=0;;i++)
++ {
++ if (wmi_rateTable[(A_UINT32) i] == 0) {
++ return A_EINVAL;
++ }
++ if (wmi_rateTable[(A_UINT32) i] == rate) {
++ break;
++ }
++ }
++ }
++ else{
++ i = -1;
++ }
++
++ if(wmi_is_bitrate_index_valid(wmip, i) != TRUE) {
++ return A_EINVAL;
++ }
++
++ return i;
++}
++
++A_STATUS
++wmi_set_fixrates_cmd(struct wmi_t *wmip, A_INT16 fixRatesMask)
++{
++ void *osbuf;
++ WMI_FIX_RATES_CMD *cmd;
++ A_UINT32 rateIndex;
++
++ /* Make sure all rates in the mask are valid in the current PHY mode */
++ for(rateIndex = 0; rateIndex < MAX_NUMBER_OF_SUPPORT_RATES; rateIndex++) {
++ if((1 << rateIndex) & (A_UINT32)fixRatesMask) {
++ if(wmi_is_bitrate_index_valid(wmip, rateIndex) != TRUE) {
++ A_DPRINTF(DBG_WMI, (DBGFMT "Set Fix Rates command failed: Given rate is illegal in current PHY mode\n", DBGARG));
++ return A_EINVAL;
++ }
++ }
++ }
++
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_FIX_RATES_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++
++ cmd->fixRateMask = fixRatesMask;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_FIXRATES_CMDID, NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_get_ratemask_cmd(struct wmi_t *wmip)
++{
++ void *osbuf;
++
++ osbuf = A_NETBUF_ALLOC(0); /* no payload */
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_GET_FIXRATES_CMDID, NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_get_channelList_cmd(struct wmi_t *wmip)
++{
++ void *osbuf;
++
++ osbuf = A_NETBUF_ALLOC(0); /* no payload */
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_GET_CHANNEL_LIST_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++/*
++ * used to generate a wmi sey channel Parameters cmd.
++ * mode should always be specified and corresponds to the phy mode of the
++ * wlan.
++ * numChan should alway sbe specified. If zero indicates that all available
++ * channels should be used.
++ * channelList is an array of channel frequencies (in Mhz) which the radio
++ * should limit its operation to. It should be NULL if numChan == 0. Size of
++ * array should correspond to numChan entries.
++ */
++A_STATUS
++wmi_set_channelParams_cmd(struct wmi_t *wmip, A_UINT8 scanParam,
++ WMI_PHY_MODE mode, A_INT8 numChan,
++ A_UINT16 *channelList)
++{
++ void *osbuf;
++ WMI_CHANNEL_PARAMS_CMD *cmd;
++ A_INT8 size;
++
++ size = sizeof (*cmd);
++
++ if (numChan) {
++ if (numChan > WMI_MAX_CHANNELS) {
++ return A_EINVAL;
++ }
++ size += sizeof(A_UINT16) * (numChan - 1);
++ }
++
++ osbuf = A_NETBUF_ALLOC(size);
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, size);
++
++ cmd = (WMI_CHANNEL_PARAMS_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, size);
++
++ wmip->wmi_phyMode = mode;
++ cmd->scanParam = scanParam;
++ cmd->phyMode = mode;
++ cmd->numChannels = numChan;
++ A_MEMCPY(cmd->channelList, channelList, numChan * sizeof(A_UINT16));
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_CHANNEL_PARAMS_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_set_rssi_threshold_params(struct wmi_t *wmip,
++ WMI_RSSI_THRESHOLD_PARAMS_CMD *rssiCmd)
++{
++ void *osbuf;
++ A_INT8 size;
++ WMI_RSSI_THRESHOLD_PARAMS_CMD *cmd;
++ /* These values are in ascending order */
++ if( rssiCmd->thresholdAbove6_Val <= rssiCmd->thresholdAbove5_Val ||
++ rssiCmd->thresholdAbove5_Val <= rssiCmd->thresholdAbove4_Val ||
++ rssiCmd->thresholdAbove4_Val <= rssiCmd->thresholdAbove3_Val ||
++ rssiCmd->thresholdAbove3_Val <= rssiCmd->thresholdAbove2_Val ||
++ rssiCmd->thresholdAbove2_Val <= rssiCmd->thresholdAbove1_Val ||
++ rssiCmd->thresholdBelow6_Val <= rssiCmd->thresholdBelow5_Val ||
++ rssiCmd->thresholdBelow5_Val <= rssiCmd->thresholdBelow4_Val ||
++ rssiCmd->thresholdBelow4_Val <= rssiCmd->thresholdBelow3_Val ||
++ rssiCmd->thresholdBelow3_Val <= rssiCmd->thresholdBelow2_Val ||
++ rssiCmd->thresholdBelow2_Val <= rssiCmd->thresholdBelow1_Val) {
++
++ return A_EINVAL;
++ }
++
++ size = sizeof (*cmd);
++
++ osbuf = A_NETBUF_ALLOC(size);
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, size);
++
++ cmd = (WMI_RSSI_THRESHOLD_PARAMS_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, size);
++ A_MEMCPY(cmd, rssiCmd, sizeof(WMI_RSSI_THRESHOLD_PARAMS_CMD));
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_RSSI_THRESHOLD_PARAMS_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_set_host_sleep_mode_cmd(struct wmi_t *wmip,
++ WMI_SET_HOST_SLEEP_MODE_CMD *hostModeCmd)
++{
++ void *osbuf;
++ A_INT8 size;
++ WMI_SET_HOST_SLEEP_MODE_CMD *cmd;
++
++ if( hostModeCmd->awake == hostModeCmd->asleep) {
++ return A_EINVAL;
++ }
++
++ size = sizeof (*cmd);
++
++ osbuf = A_NETBUF_ALLOC(size);
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, size);
++
++ cmd = (WMI_SET_HOST_SLEEP_MODE_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, size);
++ A_MEMCPY(cmd, hostModeCmd, sizeof(WMI_SET_HOST_SLEEP_MODE_CMD));
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_HOST_SLEEP_MODE_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_set_wow_mode_cmd(struct wmi_t *wmip,
++ WMI_SET_WOW_MODE_CMD *wowModeCmd)
++{
++ void *osbuf;
++ A_INT8 size;
++ WMI_SET_WOW_MODE_CMD *cmd;
++
++ size = sizeof (*cmd);
++
++ osbuf = A_NETBUF_ALLOC(size);
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, size);
++
++ cmd = (WMI_SET_WOW_MODE_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, size);
++ A_MEMCPY(cmd, wowModeCmd, sizeof(WMI_SET_WOW_MODE_CMD));
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_WOW_MODE_CMDID,
++ NO_SYNC_WMIFLAG));
++
++}
++
++A_STATUS
++wmi_get_wow_list_cmd(struct wmi_t *wmip,
++ WMI_GET_WOW_LIST_CMD *wowListCmd)
++{
++ void *osbuf;
++ A_INT8 size;
++ WMI_GET_WOW_LIST_CMD *cmd;
++
++ size = sizeof (*cmd);
++
++ osbuf = A_NETBUF_ALLOC(size);
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, size);
++
++ cmd = (WMI_GET_WOW_LIST_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, size);
++ A_MEMCPY(cmd, wowListCmd, sizeof(WMI_GET_WOW_LIST_CMD));
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_GET_WOW_LIST_CMDID,
++ NO_SYNC_WMIFLAG));
++
++}
++
++static A_STATUS
++wmi_get_wow_list_event_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++ WMI_GET_WOW_LIST_REPLY *reply;
++
++ if (len < sizeof(WMI_GET_WOW_LIST_REPLY)) {
++ return A_EINVAL;
++ }
++ reply = (WMI_GET_WOW_LIST_REPLY *)datap;
++
++ A_WMI_WOW_LIST_EVENT(wmip->wmi_devt, reply->num_filters,
++ reply);
++
++ return A_OK;
++}
++
++A_STATUS wmi_add_wow_pattern_cmd(struct wmi_t *wmip,
++ WMI_ADD_WOW_PATTERN_CMD *addWowCmd,
++ A_UINT8* pattern, A_UINT8* mask,
++ A_UINT8 pattern_size)
++{
++ void *osbuf;
++ A_INT8 size;
++ WMI_ADD_WOW_PATTERN_CMD *cmd;
++ A_UINT8 *filter_mask = NULL;
++
++ size = sizeof (*cmd);
++
++ size += ((2 * addWowCmd->filter_size)* sizeof(A_UINT8));
++ osbuf = A_NETBUF_ALLOC(size);
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, size);
++
++ cmd = (WMI_ADD_WOW_PATTERN_CMD *)(A_NETBUF_DATA(osbuf));
++ cmd->filter_list_id = addWowCmd->filter_list_id;
++ cmd->filter_offset = addWowCmd->filter_offset;
++ cmd->filter_size = addWowCmd->filter_size;
++
++ A_MEMCPY(cmd->filter, pattern, addWowCmd->filter_size);
++
++ filter_mask = (A_UINT8*)(cmd->filter + cmd->filter_size);
++ A_MEMCPY(filter_mask, mask, addWowCmd->filter_size);
++
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_ADD_WOW_PATTERN_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_del_wow_pattern_cmd(struct wmi_t *wmip,
++ WMI_DEL_WOW_PATTERN_CMD *delWowCmd)
++{
++ void *osbuf;
++ A_INT8 size;
++ WMI_DEL_WOW_PATTERN_CMD *cmd;
++
++ size = sizeof (*cmd);
++
++ osbuf = A_NETBUF_ALLOC(size);
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, size);
++
++ cmd = (WMI_DEL_WOW_PATTERN_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, size);
++ A_MEMCPY(cmd, delWowCmd, sizeof(WMI_DEL_WOW_PATTERN_CMD));
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_DEL_WOW_PATTERN_CMDID,
++ NO_SYNC_WMIFLAG));
++
++}
++
++A_STATUS
++wmi_set_snr_threshold_params(struct wmi_t *wmip,
++ WMI_SNR_THRESHOLD_PARAMS_CMD *snrCmd)
++{
++ void *osbuf;
++ A_INT8 size;
++ WMI_SNR_THRESHOLD_PARAMS_CMD *cmd;
++ /* These values are in ascending order */
++ if( snrCmd->thresholdAbove4_Val <= snrCmd->thresholdAbove3_Val ||
++ snrCmd->thresholdAbove3_Val <= snrCmd->thresholdAbove2_Val ||
++ snrCmd->thresholdAbove2_Val <= snrCmd->thresholdAbove1_Val ||
++ snrCmd->thresholdBelow4_Val <= snrCmd->thresholdBelow3_Val ||
++ snrCmd->thresholdBelow3_Val <= snrCmd->thresholdBelow2_Val ||
++ snrCmd->thresholdBelow2_Val <= snrCmd->thresholdBelow1_Val) {
++
++ return A_EINVAL;
++ }
++
++ size = sizeof (*cmd);
++
++ osbuf = A_NETBUF_ALLOC(size);
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, size);
++
++ cmd = (WMI_SNR_THRESHOLD_PARAMS_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, size);
++ A_MEMCPY(cmd, snrCmd, sizeof(WMI_SNR_THRESHOLD_PARAMS_CMD));
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SNR_THRESHOLD_PARAMS_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_clr_rssi_snr(struct wmi_t *wmip)
++{
++ void *osbuf;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(int));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_CLR_RSSI_SNR_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_set_lq_threshold_params(struct wmi_t *wmip,
++ WMI_LQ_THRESHOLD_PARAMS_CMD *lqCmd)
++{
++ void *osbuf;
++ A_INT8 size;
++ WMI_LQ_THRESHOLD_PARAMS_CMD *cmd;
++ /* These values are in ascending order */
++ if( lqCmd->thresholdAbove4_Val <= lqCmd->thresholdAbove3_Val ||
++ lqCmd->thresholdAbove3_Val <= lqCmd->thresholdAbove2_Val ||
++ lqCmd->thresholdAbove2_Val <= lqCmd->thresholdAbove1_Val ||
++ lqCmd->thresholdBelow4_Val <= lqCmd->thresholdBelow3_Val ||
++ lqCmd->thresholdBelow3_Val <= lqCmd->thresholdBelow2_Val ||
++ lqCmd->thresholdBelow2_Val <= lqCmd->thresholdBelow1_Val ) {
++
++ return A_EINVAL;
++ }
++
++ size = sizeof (*cmd);
++
++ osbuf = A_NETBUF_ALLOC(size);
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, size);
++
++ cmd = (WMI_LQ_THRESHOLD_PARAMS_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, size);
++ A_MEMCPY(cmd, lqCmd, sizeof(WMI_LQ_THRESHOLD_PARAMS_CMD));
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_LQ_THRESHOLD_PARAMS_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_set_error_report_bitmask(struct wmi_t *wmip, A_UINT32 mask)
++{
++ void *osbuf;
++ A_INT8 size;
++ WMI_TARGET_ERROR_REPORT_BITMASK *cmd;
++
++ size = sizeof (*cmd);
++
++ osbuf = A_NETBUF_ALLOC(size);
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, size);
++
++ cmd = (WMI_TARGET_ERROR_REPORT_BITMASK *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, size);
++
++ cmd->bitmask = mask;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_TARGET_ERROR_REPORT_BITMASK_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_get_challenge_resp_cmd(struct wmi_t *wmip, A_UINT32 cookie, A_UINT32 source)
++{
++ void *osbuf;
++ WMIX_HB_CHALLENGE_RESP_CMD *cmd;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMIX_HB_CHALLENGE_RESP_CMD *)(A_NETBUF_DATA(osbuf));
++ cmd->cookie = cookie;
++ cmd->source = source;
++
++ return (wmi_cmd_send_xtnd(wmip, osbuf, WMIX_HB_CHALLENGE_RESP_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_config_debug_module_cmd(struct wmi_t *wmip, A_UINT16 mmask,
++ A_UINT16 tsr, A_BOOL rep, A_UINT16 size,
++ A_UINT32 valid)
++{
++ void *osbuf;
++ WMIX_DBGLOG_CFG_MODULE_CMD *cmd;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMIX_DBGLOG_CFG_MODULE_CMD *)(A_NETBUF_DATA(osbuf));
++ cmd->config.cfgmmask = mmask;
++ cmd->config.cfgtsr = tsr;
++ cmd->config.cfgrep = rep;
++ cmd->config.cfgsize = size;
++ cmd->config.cfgvalid = valid;
++
++ return (wmi_cmd_send_xtnd(wmip, osbuf, WMIX_DBGLOG_CFG_MODULE_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_get_stats_cmd(struct wmi_t *wmip)
++{
++ void *osbuf;
++
++ osbuf = A_NETBUF_ALLOC(0); /* no payload */
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_GET_STATISTICS_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_addBadAp_cmd(struct wmi_t *wmip, A_UINT8 apIndex, A_UINT8 *bssid)
++{
++ void *osbuf;
++ WMI_ADD_BAD_AP_CMD *cmd;
++
++ if ((bssid == NULL) || (apIndex > WMI_MAX_BAD_AP_INDEX)) {
++ return A_EINVAL;
++ }
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_ADD_BAD_AP_CMD *)(A_NETBUF_DATA(osbuf));
++ cmd->badApIndex = apIndex;
++ A_MEMCPY(cmd->bssid, bssid, sizeof(cmd->bssid));
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_ADD_BAD_AP_CMDID, NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_deleteBadAp_cmd(struct wmi_t *wmip, A_UINT8 apIndex)
++{
++ void *osbuf;
++ WMI_DELETE_BAD_AP_CMD *cmd;
++
++ if (apIndex > WMI_MAX_BAD_AP_INDEX) {
++ return A_EINVAL;
++ }
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_DELETE_BAD_AP_CMD *)(A_NETBUF_DATA(osbuf));
++ cmd->badApIndex = apIndex;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_DELETE_BAD_AP_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_set_txPwr_cmd(struct wmi_t *wmip, A_UINT8 dbM)
++{
++ void *osbuf;
++ WMI_SET_TX_PWR_CMD *cmd;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_SET_TX_PWR_CMD *)(A_NETBUF_DATA(osbuf));
++ cmd->dbM = dbM;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_TX_PWR_CMDID, NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_get_txPwr_cmd(struct wmi_t *wmip)
++{
++ void *osbuf;
++
++ osbuf = A_NETBUF_ALLOC(0); /* no payload */
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_GET_TX_PWR_CMDID, NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_switch_radio(struct wmi_t *wmip, A_UINT8 on)
++{
++ WMI_SCAN_PARAMS_CMD scParams = {0, 0, 0, 0, 0,
++ WMI_SHORTSCANRATIO_DEFAULT,
++ DEFAULT_SCAN_CTRL_FLAGS,
++ 0};
++
++ if (on) {
++ /* Enable foreground scanning */
++ if (wmi_scanparams_cmd(wmip, 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) {
++ return -EIO;
++ }
++ } else {
++ wmi_disconnect_cmd(wmip);
++ if (wmi_scanparams_cmd(wmip, 0xFFFF, 0, 0, 0,
++ 0, 0, 0, 0xFF, 0) != A_OK) {
++ return -EIO;
++ }
++ }
++
++ return A_OK;
++}
++
++
++A_UINT16
++wmi_get_mapped_qos_queue(struct wmi_t *wmip, A_UINT8 trafficClass)
++{
++ A_UINT16 activeTsids=0;
++
++ LOCK_WMI(wmip);
++ activeTsids = wmip->wmi_streamExistsForAC[trafficClass];
++ UNLOCK_WMI(wmip);
++
++ return activeTsids;
++}
++
++A_STATUS
++wmi_get_roam_tbl_cmd(struct wmi_t *wmip)
++{
++ void *osbuf;
++
++ osbuf = A_NETBUF_ALLOC(0); /* no payload */
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_GET_ROAM_TBL_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_get_roam_data_cmd(struct wmi_t *wmip, A_UINT8 roamDataType)
++{
++ void *osbuf;
++ A_UINT32 size = sizeof(A_UINT8);
++ WMI_TARGET_ROAM_DATA *cmd;
++
++ osbuf = A_NETBUF_ALLOC(size); /* no payload */
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, size);
++
++ cmd = (WMI_TARGET_ROAM_DATA *)(A_NETBUF_DATA(osbuf));
++ cmd->roamDataType = roamDataType;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_GET_ROAM_DATA_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_set_roam_ctrl_cmd(struct wmi_t *wmip, WMI_SET_ROAM_CTRL_CMD *p,
++ A_UINT8 size)
++{
++ void *osbuf;
++ WMI_SET_ROAM_CTRL_CMD *cmd;
++
++ osbuf = A_NETBUF_ALLOC(size);
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, size);
++
++ cmd = (WMI_SET_ROAM_CTRL_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, size);
++
++ A_MEMCPY(cmd, p, size);
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_ROAM_CTRL_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_set_powersave_timers_cmd(struct wmi_t *wmip,
++ WMI_POWERSAVE_TIMERS_POLICY_CMD *pCmd,
++ A_UINT8 size)
++{
++ void *osbuf;
++ WMI_POWERSAVE_TIMERS_POLICY_CMD *cmd;
++
++ /* These timers can't be zero */
++ if(!pCmd->psPollTimeout || !pCmd->triggerTimeout ||
++ !(pCmd->apsdTimPolicy == IGNORE_TIM_ALL_QUEUES_APSD ||
++ pCmd->apsdTimPolicy == PROCESS_TIM_ALL_QUEUES_APSD) ||
++ !(pCmd->simulatedAPSDTimPolicy == IGNORE_TIM_SIMULATED_APSD ||
++ pCmd->simulatedAPSDTimPolicy == PROCESS_TIM_SIMULATED_APSD))
++ return A_EINVAL;
++
++ osbuf = A_NETBUF_ALLOC(size);
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, size);
++
++ cmd = (WMI_POWERSAVE_TIMERS_POLICY_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, size);
++
++ A_MEMCPY(cmd, pCmd, size);
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_POWERSAVE_TIMERS_POLICY_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++#ifdef CONFIG_HOST_GPIO_SUPPORT
++/* Send a command to Target to change GPIO output pins. */
++A_STATUS
++wmi_gpio_output_set(struct wmi_t *wmip,
++ A_UINT32 set_mask,
++ A_UINT32 clear_mask,
++ A_UINT32 enable_mask,
++ A_UINT32 disable_mask)
++{
++ void *osbuf;
++ WMIX_GPIO_OUTPUT_SET_CMD *output_set;
++ int size;
++
++ size = sizeof(*output_set);
++
++ A_DPRINTF(DBG_WMI,
++ (DBGFMT "Enter - set=0x%x clear=0x%x enb=0x%x dis=0x%x\n", DBGARG,
++ set_mask, clear_mask, enable_mask, disable_mask));
++
++ osbuf = A_NETBUF_ALLOC(size);
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++ A_NETBUF_PUT(osbuf, size);
++ output_set = (WMIX_GPIO_OUTPUT_SET_CMD *)(A_NETBUF_DATA(osbuf));
++
++ output_set->set_mask = set_mask;
++ output_set->clear_mask = clear_mask;
++ output_set->enable_mask = enable_mask;
++ output_set->disable_mask = disable_mask;
++
++ return (wmi_cmd_send_xtnd(wmip, osbuf, WMIX_GPIO_OUTPUT_SET_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++/* Send a command to the Target requesting state of the GPIO input pins */
++A_STATUS
++wmi_gpio_input_get(struct wmi_t *wmip)
++{
++ void *osbuf;
++
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG));
++
++ osbuf = A_NETBUF_ALLOC(0);
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ return (wmi_cmd_send_xtnd(wmip, osbuf, WMIX_GPIO_INPUT_GET_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++/* Send a command to the Target that changes the value of a GPIO register. */
++A_STATUS
++wmi_gpio_register_set(struct wmi_t *wmip,
++ A_UINT32 gpioreg_id,
++ A_UINT32 value)
++{
++ void *osbuf;
++ WMIX_GPIO_REGISTER_SET_CMD *register_set;
++ int size;
++
++ size = sizeof(*register_set);
++
++ A_DPRINTF(DBG_WMI,
++ (DBGFMT "Enter - reg=%d value=0x%x\n", DBGARG, gpioreg_id, value));
++
++ osbuf = A_NETBUF_ALLOC(size);
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++ A_NETBUF_PUT(osbuf, size);
++ register_set = (WMIX_GPIO_REGISTER_SET_CMD *)(A_NETBUF_DATA(osbuf));
++
++ register_set->gpioreg_id = gpioreg_id;
++ register_set->value = value;
++
++ return (wmi_cmd_send_xtnd(wmip, osbuf, WMIX_GPIO_REGISTER_SET_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++/* Send a command to the Target to fetch the value of a GPIO register. */
++A_STATUS
++wmi_gpio_register_get(struct wmi_t *wmip,
++ A_UINT32 gpioreg_id)
++{
++ void *osbuf;
++ WMIX_GPIO_REGISTER_GET_CMD *register_get;
++ int size;
++
++ size = sizeof(*register_get);
++
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter - reg=%d\n", DBGARG, gpioreg_id));
++
++ osbuf = A_NETBUF_ALLOC(size);
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++ A_NETBUF_PUT(osbuf, size);
++ register_get = (WMIX_GPIO_REGISTER_GET_CMD *)(A_NETBUF_DATA(osbuf));
++
++ register_get->gpioreg_id = gpioreg_id;
++
++ return (wmi_cmd_send_xtnd(wmip, osbuf, WMIX_GPIO_REGISTER_GET_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++/* Send a command to the Target acknowledging some GPIO interrupts. */
++A_STATUS
++wmi_gpio_intr_ack(struct wmi_t *wmip,
++ A_UINT32 ack_mask)
++{
++ void *osbuf;
++ WMIX_GPIO_INTR_ACK_CMD *intr_ack;
++ int size;
++
++ size = sizeof(*intr_ack);
++
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter ack_mask=0x%x\n", DBGARG, ack_mask));
++
++ osbuf = A_NETBUF_ALLOC(size);
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++ A_NETBUF_PUT(osbuf, size);
++ intr_ack = (WMIX_GPIO_INTR_ACK_CMD *)(A_NETBUF_DATA(osbuf));
++
++ intr_ack->ack_mask = ack_mask;
++
++ return (wmi_cmd_send_xtnd(wmip, osbuf, WMIX_GPIO_INTR_ACK_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++#endif /* CONFIG_HOST_GPIO_SUPPORT */
++
++A_STATUS
++wmi_set_access_params_cmd(struct wmi_t *wmip, A_UINT16 txop, A_UINT8 eCWmin,
++ A_UINT8 eCWmax, A_UINT8 aifsn)
++{
++ void *osbuf;
++ WMI_SET_ACCESS_PARAMS_CMD *cmd;
++
++ if ((eCWmin > WMI_MAX_CW_ACPARAM) || (eCWmax > WMI_MAX_CW_ACPARAM) ||
++ (aifsn > WMI_MAX_AIFSN_ACPARAM))
++ {
++ return A_EINVAL;
++ }
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_SET_ACCESS_PARAMS_CMD *)(A_NETBUF_DATA(osbuf));
++ cmd->txop = txop;
++ cmd->eCWmin = eCWmin;
++ cmd->eCWmax = eCWmax;
++ cmd->aifsn = aifsn;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_ACCESS_PARAMS_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_set_retry_limits_cmd(struct wmi_t *wmip, A_UINT8 frameType,
++ A_UINT8 trafficClass, A_UINT8 maxRetries,
++ A_UINT8 enableNotify)
++{
++ void *osbuf;
++ WMI_SET_RETRY_LIMITS_CMD *cmd;
++
++ if ((frameType != MGMT_FRAMETYPE) && (frameType != CONTROL_FRAMETYPE) &&
++ (frameType != DATA_FRAMETYPE))
++ {
++ return A_EINVAL;
++ }
++
++ if (maxRetries > WMI_MAX_RETRIES) {
++ return A_EINVAL;
++ }
++
++ if (frameType != DATA_FRAMETYPE) {
++ trafficClass = 0;
++ }
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_SET_RETRY_LIMITS_CMD *)(A_NETBUF_DATA(osbuf));
++ cmd->frameType = frameType;
++ cmd->trafficClass = trafficClass;
++ cmd->maxRetries = maxRetries;
++ cmd->enableNotify = enableNotify;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_RETRY_LIMITS_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++void
++wmi_get_current_bssid(struct wmi_t *wmip, A_UINT8 *bssid)
++{
++ if (bssid != NULL) {
++ A_MEMCPY(bssid, wmip->wmi_bssid, ATH_MAC_LEN);
++ }
++}
++
++A_STATUS
++wmi_set_opt_mode_cmd(struct wmi_t *wmip, A_UINT8 optMode)
++{
++ void *osbuf;
++ WMI_SET_OPT_MODE_CMD *cmd;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_SET_OPT_MODE_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++ cmd->optMode = optMode;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_OPT_MODE_CMDID,
++ SYNC_BOTH_WMIFLAG));
++}
++
++A_STATUS
++wmi_opt_tx_frame_cmd(struct wmi_t *wmip,
++ A_UINT8 frmType,
++ A_UINT8 *dstMacAddr,
++ A_UINT8 *bssid,
++ A_UINT16 optIEDataLen,
++ A_UINT8 *optIEData)
++{
++ void *osbuf;
++ WMI_OPT_TX_FRAME_CMD *cmd;
++ osbuf = A_NETBUF_ALLOC(optIEDataLen + sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, (optIEDataLen + sizeof(*cmd)));
++
++ cmd = (WMI_OPT_TX_FRAME_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, (optIEDataLen + sizeof(*cmd)-1));
++
++ cmd->frmType = frmType;
++ cmd->optIEDataLen = optIEDataLen;
++ //cmd->optIEData = (A_UINT8 *)((int)cmd + sizeof(*cmd));
++ A_MEMCPY(cmd->bssid, bssid, sizeof(cmd->bssid));
++ A_MEMCPY(cmd->dstAddr, dstMacAddr, sizeof(cmd->dstAddr));
++ A_MEMCPY(&cmd->optIEData[0], optIEData, optIEDataLen);
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_OPT_TX_FRAME_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_set_adhoc_bconIntvl_cmd(struct wmi_t *wmip, A_UINT16 intvl)
++{
++ void *osbuf;
++ WMI_BEACON_INT_CMD *cmd;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_BEACON_INT_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++ cmd->beaconInterval = intvl;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_BEACON_INT_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++
++A_STATUS
++wmi_set_voice_pkt_size_cmd(struct wmi_t *wmip, A_UINT16 voicePktSize)
++{
++ void *osbuf;
++ WMI_SET_VOICE_PKT_SIZE_CMD *cmd;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_SET_VOICE_PKT_SIZE_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++ cmd->voicePktSize = voicePktSize;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_VOICE_PKT_SIZE_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++
++A_STATUS
++wmi_set_max_sp_len_cmd(struct wmi_t *wmip, A_UINT8 maxSPLen)
++{
++ void *osbuf;
++ WMI_SET_MAX_SP_LEN_CMD *cmd;
++
++ /* maxSPLen is a two-bit value. If user trys to set anything
++ * other than this, then its invalid
++ */
++ if(maxSPLen & ~0x03)
++ return A_EINVAL;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_SET_MAX_SP_LEN_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++ cmd->maxSPLen = maxSPLen;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_MAX_SP_LEN_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_UINT8
++convert_userPriority_to_trafficClass(A_UINT8 userPriority)
++{
++ return (up_to_ac[userPriority & 0x7]);
++}
++
++A_UINT8
++wmi_get_power_mode_cmd(struct wmi_t *wmip)
++{
++ return wmip->wmi_powerMode;
++}
++
++A_STATUS
++wmi_verify_tspec_params(WMI_CREATE_PSTREAM_CMD *pCmd, A_BOOL tspecCompliance)
++{
++ return A_OK;
++}
++
++#ifdef CONFIG_HOST_TCMD_SUPPORT
++static A_STATUS
++wmi_tcmd_test_report_rx(struct wmi_t *wmip, A_UINT8 *datap, int len)
++{
++
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG));
++
++ A_WMI_TCMD_RX_REPORT_EVENT(wmip->wmi_devt, datap, len);
++
++ return A_OK;
++}
++
++#endif /* CONFIG_HOST_TCMD_SUPPORT*/
++
++A_STATUS
++wmi_set_authmode_cmd(struct wmi_t *wmip, A_UINT8 mode)
++{
++ void *osbuf;
++ WMI_SET_AUTH_MODE_CMD *cmd;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_SET_AUTH_MODE_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++ cmd->mode = mode;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_AUTH_MODE_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_set_reassocmode_cmd(struct wmi_t *wmip, A_UINT8 mode)
++{
++ void *osbuf;
++ WMI_SET_REASSOC_MODE_CMD *cmd;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_SET_REASSOC_MODE_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++ cmd->mode = mode;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_REASSOC_MODE_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_set_lpreamble_cmd(struct wmi_t *wmip, A_UINT8 status)
++{
++ void *osbuf;
++ WMI_SET_LPREAMBLE_CMD *cmd;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_SET_LPREAMBLE_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++ cmd->status = status;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_LPREAMBLE_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_set_rts_cmd(struct wmi_t *wmip, A_UINT16 threshold)
++{
++ void *osbuf;
++ WMI_SET_RTS_CMD *cmd;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_SET_RTS_CMD*)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++ cmd->threshold = threshold;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_RTS_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_set_wmm_cmd(struct wmi_t *wmip, WMI_WMM_STATUS status)
++{
++ void *osbuf;
++ WMI_SET_WMM_CMD *cmd;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_SET_WMM_CMD*)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++ cmd->status = status;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_WMM_CMDID,
++ NO_SYNC_WMIFLAG));
++
++}
++
++A_STATUS
++wmi_set_wmm_txop(struct wmi_t *wmip, WMI_TXOP_CFG cfg)
++{
++ void *osbuf;
++ WMI_SET_WMM_TXOP_CMD *cmd;
++
++ if( !((cfg == WMI_TXOP_DISABLED) || (cfg == WMI_TXOP_ENABLED)) )
++ return A_EINVAL;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_SET_WMM_TXOP_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++ cmd->txopEnable = cfg;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_WMM_TXOP_CMDID,
++ NO_SYNC_WMIFLAG));
++
++}
++
++#ifdef CONFIG_HOST_TCMD_SUPPORT
++/* WMI layer doesn't need to know the data type of the test cmd.
++ This would be beneficial for customers like Qualcomm, who might
++ have different test command requirements from differnt manufacturers
++ */
++A_STATUS
++wmi_test_cmd(struct wmi_t *wmip, A_UINT8 *buf, A_UINT32 len)
++{
++ void *osbuf;
++ char *data;
++
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter\n", DBGARG));
++
++ osbuf= A_NETBUF_ALLOC(len);
++ if(osbuf == NULL)
++ {
++ return A_NO_MEMORY;
++ }
++ A_NETBUF_PUT(osbuf, len);
++ data = A_NETBUF_DATA(osbuf);
++ A_MEMCPY(data, buf, len);
++
++ return(wmi_cmd_send(wmip, osbuf, WMI_TEST_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++#endif
++
++A_STATUS
++wmi_set_bt_status_cmd(struct wmi_t *wmip, A_UINT8 streamType, A_UINT8 status)
++{
++ void *osbuf;
++ WMI_SET_BT_STATUS_CMD *cmd;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_SET_BT_STATUS_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++ cmd->streamType = streamType;
++ cmd->status = status;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_BT_STATUS_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_set_bt_params_cmd(struct wmi_t *wmip, WMI_SET_BT_PARAMS_CMD* cmd)
++{
++ void *osbuf;
++ WMI_SET_BT_PARAMS_CMD* alloc_cmd;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ alloc_cmd = (WMI_SET_BT_PARAMS_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(alloc_cmd, sizeof(*cmd));
++ A_MEMCPY(alloc_cmd, cmd, sizeof(*cmd));
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_BT_PARAMS_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_get_keepalive_configured(struct wmi_t *wmip)
++{
++ void *osbuf;
++ WMI_GET_KEEPALIVE_CMD *cmd;
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++ cmd = (WMI_GET_KEEPALIVE_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++ return (wmi_cmd_send(wmip, osbuf, WMI_GET_KEEPALIVE_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_UINT8
++wmi_get_keepalive_cmd(struct wmi_t *wmip)
++{
++ return wmip->wmi_keepaliveInterval;
++}
++
++A_STATUS
++wmi_set_keepalive_cmd(struct wmi_t *wmip, A_UINT8 keepaliveInterval)
++{
++ void *osbuf;
++ WMI_SET_KEEPALIVE_CMD *cmd;
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*cmd));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*cmd));
++
++ cmd = (WMI_SET_KEEPALIVE_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, sizeof(*cmd));
++ cmd->keepaliveInterval = keepaliveInterval;
++ wmip->wmi_keepaliveInterval = keepaliveInterval;
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_KEEPALIVE_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_set_appie_cmd(struct wmi_t *wmip, A_UINT8 mgmtFrmType, A_UINT8 ieLen,
++ A_UINT8 *ieInfo)
++{
++ void *osbuf;
++ WMI_SET_APPIE_CMD *cmd;
++ A_UINT16 cmdLen;
++
++ if (ieLen > WMI_MAX_IE_LEN) {
++ return A_ERROR;
++ }
++ cmdLen = sizeof(*cmd) + ieLen - 1;
++ osbuf = A_NETBUF_ALLOC(cmdLen);
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, cmdLen);
++
++ cmd = (WMI_SET_APPIE_CMD *)(A_NETBUF_DATA(osbuf));
++ A_MEMZERO(cmd, cmdLen);
++
++ cmd->mgmtFrmType = mgmtFrmType;
++ cmd->ieLen = ieLen;
++ A_MEMCPY(cmd->ieInfo, ieInfo, ieLen);
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_APPIE_CMDID, NO_SYNC_WMIFLAG));
++}
++
++A_STATUS
++wmi_set_halparam_cmd(struct wmi_t *wmip, A_UINT8 *cmd, A_UINT16 dataLen)
++{
++ void *osbuf;
++ A_UINT8 *data;
++
++ osbuf = A_NETBUF_ALLOC(dataLen);
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, dataLen);
++
++ data = A_NETBUF_DATA(osbuf);
++
++ A_MEMCPY(data, cmd, dataLen);
++
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_WHALPARAM_CMDID, NO_SYNC_WMIFLAG));
++}
++
++A_INT32
++wmi_get_rate(A_INT8 rateindex)
++{
++ if (rateindex == RATE_AUTO) {
++ return 0;
++ } else {
++ return(wmi_rateTable[(A_UINT32) rateindex]);
++ }
++}
++
++void
++wmi_node_return (struct wmi_t *wmip, bss_t *bss)
++{
++ if (NULL != bss)
++ {
++ wlan_node_return (&wmip->wmi_scan_table, bss);
++ }
++}
++
++bss_t *
++wmi_find_Ssidnode (struct wmi_t *wmip, A_UCHAR *pSsid,
++ A_UINT32 ssidLength, A_BOOL bIsWPA2)
++{
++ bss_t *node = NULL;
++ node = wlan_find_Ssidnode (&wmip->wmi_scan_table, pSsid,
++ ssidLength, bIsWPA2);
++ return node;
++}
++
++void
++wmi_free_allnodes(struct wmi_t *wmip)
++{
++ wlan_free_allnodes(&wmip->wmi_scan_table);
++}
++
++bss_t *
++wmi_find_node(struct wmi_t *wmip, const A_UINT8 *macaddr)
++{
++ bss_t *ni=NULL;
++ ni=wlan_find_node(&wmip->wmi_scan_table,macaddr);
++ return ni;
++}
++
++A_STATUS
++wmi_dset_open_reply(struct wmi_t *wmip,
++ A_UINT32 status,
++ A_UINT32 access_cookie,
++ A_UINT32 dset_size,
++ A_UINT32 dset_version,
++ A_UINT32 targ_handle,
++ A_UINT32 targ_reply_fn,
++ A_UINT32 targ_reply_arg)
++{
++ void *osbuf;
++ WMIX_DSETOPEN_REPLY_CMD *open_reply;
++
++ A_DPRINTF(DBG_WMI, (DBGFMT "Enter - wmip=0x%x\n", DBGARG, (int)wmip));
++
++ osbuf = A_NETBUF_ALLOC(sizeof(*open_reply));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ A_NETBUF_PUT(osbuf, sizeof(*open_reply));
++ open_reply = (WMIX_DSETOPEN_REPLY_CMD *)(A_NETBUF_DATA(osbuf));
++
++ open_reply->status = status;
++ open_reply->targ_dset_handle = targ_handle;
++ open_reply->targ_reply_fn = targ_reply_fn;
++ open_reply->targ_reply_arg = targ_reply_arg;
++ open_reply->access_cookie = access_cookie;
++ open_reply->size = dset_size;
++ open_reply->version = dset_version;
++
++ return (wmi_cmd_send_xtnd(wmip, osbuf, WMIX_DSETOPEN_REPLY_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
++static A_STATUS
++wmi_get_pmkid_list_event_rx(struct wmi_t *wmip, A_UINT8 *datap, A_UINT32 len)
++{
++ WMI_PMKID_LIST_REPLY *reply;
++ A_UINT32 expected_len;
++
++ if (len < sizeof(WMI_PMKID_LIST_REPLY)) {
++ return A_EINVAL;
++ }
++ reply = (WMI_PMKID_LIST_REPLY *)datap;
++ expected_len = sizeof(reply->numPMKID) + reply->numPMKID * WMI_PMKID_LEN;
++
++ if (len < expected_len) {
++ return A_EINVAL;
++ }
++
++ A_WMI_PMKID_LIST_EVENT(wmip->wmi_devt, reply->numPMKID,
++ reply->pmkidList);
++
++ return A_OK;
++}
++
++#ifdef CONFIG_HOST_DSET_SUPPORT
++A_STATUS
++wmi_dset_data_reply(struct wmi_t *wmip,
++ A_UINT32 status,
++ A_UINT8 *user_buf,
++ A_UINT32 length,
++ A_UINT32 targ_buf,
++ A_UINT32 targ_reply_fn,
++ A_UINT32 targ_reply_arg)
++{
++ void *osbuf;
++ WMIX_DSETDATA_REPLY_CMD *data_reply;
++ int size;
++
++ size = sizeof(*data_reply) + length;
++
++ A_DPRINTF(DBG_WMI,
++ (DBGFMT "Enter - length=%d status=%d\n", DBGARG, length, status));
++
++ osbuf = A_NETBUF_ALLOC(size);
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++ A_NETBUF_PUT(osbuf, size);
++ data_reply = (WMIX_DSETDATA_REPLY_CMD *)(A_NETBUF_DATA(osbuf));
++
++ data_reply->status = status;
++ data_reply->targ_buf = targ_buf;
++ data_reply->targ_reply_fn = targ_reply_fn;
++ data_reply->targ_reply_arg = targ_reply_arg;
++ data_reply->length = length;
++
++ if (status == A_OK) {
++ if (a_copy_from_user(data_reply->buf, user_buf, length)) {
++ return A_ERROR;
++ }
++ }
++
++ return (wmi_cmd_send_xtnd(wmip, osbuf, WMIX_DSETDATA_REPLY_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++#endif /* CONFIG_HOST_DSET_SUPPORT */
++
++A_STATUS
++wmi_set_wsc_status_cmd(struct wmi_t *wmip, A_UINT32 status)
++{
++ void *osbuf;
++ char *cmd;
++
++ wps_enable = status;
++
++ osbuf = a_netbuf_alloc(sizeof(1));
++ if (osbuf == NULL) {
++ return A_NO_MEMORY;
++ }
++
++ a_netbuf_put(osbuf, sizeof(1));
++
++ cmd = (char *)(a_netbuf_to_data(osbuf));
++
++ A_MEMZERO(cmd, sizeof(*cmd));
++ cmd[0] = (status?1:0);
++ return (wmi_cmd_send(wmip, osbuf, WMI_SET_WSC_STATUS_CMDID,
++ NO_SYNC_WMIFLAG));
++}
++
+diff --git a/drivers/ar6000/wmi/wmi_doc.h b/drivers/ar6000/wmi/wmi_doc.h
+new file mode 100644
+index 0000000..19cd938
+--- /dev/null
++++ b/drivers/ar6000/wmi/wmi_doc.h
+@@ -0,0 +1,4421 @@
++/*
++ *
++ * 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.
++ *
++ *
++ *
++ */
++
++
++#if 0
++Wireless Module Interface (WMI) Documentaion
++
++ This section describes the format and the usage model for WMI control and
++ data messages between the host and the AR6000-based targets. The header
++ file include/wmi.h contains all command and event manifest constants as
++ well as structure typedefs for each set of command and reply parameters.
++
++Data Frames
++
++ The data payload transmitted and received by the target follows RFC-1042
++ encapsulation and thus starts with an 802.2-style LLC-SNAP header. The
++ WLAN module completes 802.11 encapsulation of the payload, including the
++ MAC header, FCS, and WLAN security related fields. At the interface to the
++ message transport (HTC), a data frame is encapsulated in a WMI message.
++
++WMI Message Structure
++
++ The WMI protocol leverages an 802.3-style Ethernet header in communicating
++ the source and destination information between the host and the AR6000
++ modules using a 14-byte 802.3 header ahead of the 802.2-style payload. In
++ addition, the WMI protocol adds a header to all data messages:
++
++ {
++ INT8 rssi
++ The RSSI of the received packet and its units are shown in db above the
++ noise floor, and the noise floor is shown in dbm.
++ UINT8 info
++ Contains information on message type and user priority. Message type
++ differentiates between a data packet and a synchronization message.
++ } WMI_DATA_HDR
++
++ User priority contains the 802.1d user priority info from host to target. Host
++ software translates the host Ethernet format to 802.3 format prior to Tx and
++ 802.3 format to host format in the Rx direction. The host does not transmit the
++ FCS that follows the data. MsgType differentiates between a regular data
++ packet (msgType=0) and a synchronization message (msgType=1).
++
++Data Endpoints
++
++ The AR6000 chipset provides several data endpoints to support quality of
++ service (QoS) and maintains separate queues and separate DMA engines for
++ each data endpoint. A data endpoint can be bi-directional.
++
++ Best effort (BE) class traffic uses the default data endpoint (2). The host can
++ establish up to two additional data endpoints for other traffic classes. Once
++ such a data endpoint is established, it sends and receives corresponding QoS
++ traffic in a manner similar to the default data endpoint.
++
++ If QoS is desired over the interconnect, host software must classify each data
++ packet and place it on the appropriate data endpoint. The information
++ required to classify data is generally available in-band as an 802.1p/q style
++ tag or as the ToS field in the IP header. The information may also be available
++ out-of-band depending on the host DDI.
++
++Connection States
++
++ Table B-1 describes the AR6000 WLAN connection states:
++
++ Table B-1. AR6000 Connection States
++
++Connection State
++ Description
++
++ DISCONNECTED
++ In this state, the AR6000 device is not connected to a wireless
++ network. The device is in this state after reset when it sends the
++ WIRELESS MODULE “READY” EVENT, after it processes a
++ DISCONNECT command, and when it loses its link with the
++ access point (AP) that it was connected to. The device signals a
++ transition to the DISCONNECTED state with a “DISCONNECT”
++ event.
++
++CONNECTED
++ In this state, the AR6000 device is connected to wireless networks.
++ The device enters this state after successfully processing a
++ CONNECT, which establishes a connection with a wireless
++ network. The device signals a transition to the CONNECTED state
++ with a “CONNECT” event.
++
++
++Message Types
++
++ WMI uses commands, replies, and events for the control and configuration of
++ the AR6000 device. The control protocol is asynchronous. Table B-2 describes
++ AR6000 message types:
++
++Table B-2. AR6000 Message Types
++
++Message Type
++ Description
++
++Commands
++ Control messages that flow from the host to the device
++
++Replies/Events
++ Control messages that flow from the device to the host.
++
++ The device issues a reply to some WMI commands, but not to others.
++ The payload in a reply is command-specific, and some commands do
++ not trigger a reply message at all. Events are control messages issued
++ by the device to signal the occurrence of an asynchronous event.
++
++
++WMI Message Format
++
++ All WMI control commands, replies and events use the header format:
++
++ WMI_CMD_HDR Header Format
++ {
++ UINT16 id
++ This 16-bit constant identifies which WMI command the host is issuing,
++ which command the target is replying to, or which event has occurred.
++ WMI_CMD_HDR
++ }
++
++
++ A variable-size command-, reply-, or event-specific payload follows the
++ header. Over the interconnect, all fields in control messages (including
++ WMI_CMD_HDR and the command specific payload) use 32-bit little Endian
++ byte ordering and fields are packed. The AR6000 device always executes
++ commands in order, and the host may send multiple commands without
++ waiting for previous commands to complete. A majority of commands are
++ processed to completion once received. Other commands trigger a longer
++ duration activity whose completion is signaled to the host through an event.
++
++Command Restrictions
++
++ Some commands may only be issued when the AR6000 device is in a certain
++ state. The host is required to wait for an event signaling a state transition
++ before such a command can be issued. For example, if a command requires
++ the device to be in the CONNECTED state, then the host is required to wait
++ for a “CONNECT” event before it issues that command.
++
++ The device ignores any commands inappropriate for its current state. If the
++ command triggers a reply, the device generates an error reply. Otherwise, the
++ device silently ignores the inappropriate command.
++
++Command and Data Synchronization
++
++ WMI provides a mechanism for a host to advise the device of necessary
++ synchronization between commands and data. The device implements
++ synchronization; no implicit synchronization exists between endpoints.
++
++ The host controls synchronization using the “SYNCHRONIZE” command
++ over the control channel and synchronization messages over data channels.
++ The device stops each data channel upon receiving a synchronization message
++ on that channel, processing all data packets received prior to that message.
++ After the device receives synchronization messages for each data endpoint
++ and the “SYNCHRONIZE” command, it resumes all channels.
++
++ When the host must guarantee a command executes before processing new
++ data packets, it first issues the command, then issues the “SYNCHRONIZE”
++ command and sends synchronization messages on data channels. When the
++ host must guarantee the device has processed all old data packets before a
++ processing a new command, it issues a “SYNCHRONIZE” command and
++ synchronization messages on all data channels, then issues the desired
++ command.
++
++
++
++WMI Commands
++
++ ADD_BAD_AP
++ Cause the AR6000 device to avoid a particular AP
++ ADD_CIPHER_KEY
++ Add or replace any of the four AR6000 encryption keys
++ ADD_WOW_PATTERN
++ Used to add a pattern to the WoW pattern list
++ CLR_RSSI_SNR
++ Clear the current calculated RSSI and SNR value
++ CONNECT_CMD
++ Request that the AR6000 device establish a wireless connection
++ with the specified SSID
++ CREATE_PSTREAM
++ Create prioritized data endpoint between the host and device
++ DELETE_BAD_AP
++ Clear an entry in the bad AP table
++ DELETE_CIPHER_KEY
++ Delete a previously added cipher key
++ DELETE_PSTREAM
++ Delete a prioritized data endpoint
++ DELETE_WOW_PATTERN
++ Remove a pre-specified pattern from the WoW pattern list
++ EXTENSION
++ WMI message interface command
++ GET_BIT_RATE
++ Retrieve rate most recently used by the AR6000
++ GET_CHANNEL_LIST
++ Retrieve list of channels used by the AR6000
++ GET_FIXRATES
++ Retrieves the rate-mask set via the SET_FIXRATES command.
++ GET_PMKID_LIST_CMD
++ Retrieve the firmware list of PMKIDs
++ GET_ROAM_DATA
++ Internal use for data collection; available in special build only
++ GET_ROAM_TBL
++ Retrieve the roaming table maintained on the target
++ GET_TARGET_STATS
++ Request that the target send the statistics it maintains
++ GET_TX_PWR
++ Retrieve the current AR6000 device Tx power levels
++ GET_WOW_LIST
++ Retrieve the current list of WoW patterns
++ LQ_THRESHOLD_PARAMS
++ Set the link quality thresholds
++ OPT_TX_FRAME
++ Send a special frame (special feature)
++ RECONNECT
++ Request a reconnection to a BSS
++ RSSI_THRESHOLD_PARAMS
++ Configure how the AR6000 device monitors and reports signal
++ strength (RSSI) of the connected BSS
++ SCAN_PARAMS
++ Determine dwell time and changes scanned channels
++ SET_ACCESS_PARAMS
++ Set access parameters for the wireless network
++ SET_ADHOC_BSSID
++ Set the BSSID for an ad hoc network
++ SET_AKMP_PARAMS
++ Set multiPMKID mode
++ SET_APPIE
++ Add application-specified IE to a management frame
++ SET_ASSOC_INFO
++ Specify the IEs the device should add to association or
++ reassociation requests
++ SET_AUTH_MODE
++ Set 802.11 authentication mode of reconnection
++ SET_BEACON_INT
++ Set the beacon interval for an ad hoc network
++ SET_BIT_RATE
++ Set the AR6000 to a specific fixed bit rate
++ SET_BMISS_TIME
++ Set the beacon miss time
++ SET_BSS_FILTER
++ Inform the AR6000 of network types about which it wants to
++ receive information using a “BSSINFO” event
++ SET_BT_PARAMS
++ Set the status of a Bluetooth stream (SCO or A2DP) or set
++ Bluetooth coexistence register parameters
++ SET_BT_STATUS
++ Set the status of a Bluetooth stream (SCO or A2DP)
++ SET_CHANNEL_PARAMETERS
++ Configure WLAN channel parameters
++ SET_DISC_TIMEOUT
++ Set the amount of time the AR6000 spends attempting to
++ reestablish a connection
++ SET_FIXRATES
++ Set the device to a specific fixed PHY rate (supported subset)
++ SET_HALPARAM
++ Internal AR6000 command to set certain hardware parameters
++ SET_HOST_SLEEP_MODE
++ Set the host mode to asleep or awake
++ SET_IBSS_PM_CAPS
++ Support a non-standard power management scheme for an
++ ad hoc network
++ SET_LISTEN_INT
++ Request a listen interval
++ SET_LPREAMBLE
++ Override the short preamble capability of the AR6000 device
++ SET_MAX_SP_LEN
++ Set the maximum service period
++ SET_OPT_MODE
++ Set the special mode on/off (special feature)
++ SET_PMKID
++ Set the pairwise master key ID (PMKID)
++ SET_PMKID_LIST_CMD
++ Configure the firmware list of PMKIDs
++ SET_POWER_MODE
++ Set guidelines on trade-off between power utilization
++ SET_POWER_PARAMS
++ Configure power parameters
++ SET_POWERSAVE_PARAMS
++ Set the two AR6000 power save timers
++ SET_PROBED_SSID
++ Provide list of SSIDs the device should seek
++ SET_REASSOC_MODE
++ Specify whether the disassociated frame should be sent upon
++ reassociation
++ SET_RETRY_LIMITS
++ Limit how many times the device tries to send a frame
++ SET_ROAM_CTRL
++ Control roaming behavior
++ SET_RTS
++ Determine when RTS should be sent
++ SET_SCAN_PARAMS
++ Set the AR6000 scan parameters
++ SET_TKIP_COUNTERMEASURES
++ Enable/disable reports of TKIP MIC errors
++ SET_TX_PWR
++ Specify the AR6000 device Tx power levels
++ SET_VOICE_PKT_SIZE
++ Set voice packet size
++ SET_WMM
++ Override the AR6000 WMM capability
++ SET_WMM_TXOP
++ Configure TxOP bursting when sending traffic to a WMM-
++ capable AP
++ SET_WOW_MODE
++ Enable/disable WoW mode
++ SET_WSC_STATUS
++ Enable/disable profile check in cserv when the WPS protocol
++ is in progress
++ SNR_THRESHOLD_PARAMS
++ Configure how the device monitors and reports SNR of BSS
++ START_SCAN
++ Start a long or short channel scan
++ SYNCHRONIZE
++ Force a synchronization point between command and data
++ paths
++ TARGET_REPORT_ERROR_BITMASK
++ Control “ERROR_REPORT” events from the AR6000
++
++
++
++
++Name
++ ADD_BAD_AP
++
++Synopsis
++ The host uses this command to cause the AR6000 to avoid a particular AP. The
++ AR6000 maintain a table with up to two APs to avoid. An ADD_BAD_AP command
++ adds or replaces the specified entry in this bad AP table.
++
++ If the AR6000 are currently connected to the AP specified in this command, they
++ disassociate.
++
++Command
++ wmiconfig eth1 --badap <bssid> <badApIndex>
++
++Command Parameters
++ UINT8 badApIndex Index [0...1] that identifies which entry in the
++ bad AP table to use
++
++
++ UINT8 bssid[6] MAC address of the AP to avoid
++
++Command Values
++ badApIndex = 0, 1 Entry in the bad AP table to use
++
++Reset Value
++ The bad AP table is cleared
++
++Restrictions
++ None
++
++See Also
++ “DELETE_BAD_AP” on page B-13
++
++=====================================================================
++Name
++ ADD_CIPHER_KEY
++
++Synopsis
++ The host uses this command to add/replace any of four encryption keys on the
++ AR6000. The ADD_CIPHER_KEY command is issued after the CONNECT event
++ has been received by the host for all dot11Auth modes except for SHARED_AUTH.
++ When the dot11AuthMode is SHARED_AUTH, then the ADD_CIPHER_KEY
++ command should be issued before the “CONNECT” command.
++
++Command
++ wmiconfig eth1 --cipherkey <keyIndex> <keyType> <keyUsage>
++ <keyLength> <keyopctrl> <keyRSC> <key>
++
++Command Parameters
++ UINT8 keyIndex Index (0...3) of the key to add/replace;
++ uniquely identifies the key
++ UINT8 keyType CRYPTO_TYPE
++ UINT8 keyUsage Specifies usage parameters of the key when
++ keyType = WEP_CRYPT
++ UINT8 keyLength Length of the key in bytes
++ UINT8 keyOpCtrl bit[0] = Initialize TSC (default),
++ bit[1] = Initialize RSC
++ UINT8 keyRSC[8] Key replay sequence counter (RSC) initial
++ value the device should use
++ UINT8 key[32] Key material used for this connection
++ Command Values
++ {
++ NONE_CRYPT = 1
++ WEP_CRYPT = 2
++ TKIP_CRYPT = 3
++ AES_CRYPT = 4
++ KEY_OP_INIT_TSC 0x01
++ KEY_OP_INIT_RSC 0x02
++ KEY_OP_INIT_VAL 0x03
++ Default is to Initialize the TSC
++ KEY_OP_VALID_MASK 0x04
++ Two operations defined
++ } CRYPTO_TYPE
++
++ {
++ PAIRWISE_USAGE = 0 Set if the key is used for unicast traffic only
++ GROUP_USAGE = 1 Set if the key is used to receive multicast
++ traffic (also set for static WEP keys)
++ TX_USAGE = 2 Set for the GROUP key used to transmit frames
++ All others are reserved
++ } KEY_USAGE
++
++Reset Value
++ The four available keys are disabled.
++
++Restrictions
++ The cipher should correspond to the encryption mode specified in the “CONNECT”
++ command.
++
++See Also
++ “DELETE_CIPHER_KEY”
++
++=====================================================================
++
++
++Name
++ ADD_WOW_PATTERN
++
++Synopsis
++ The host uses this command to add a pattern to the WoW pattern list; used for
++ pattern-matching for host wakeups by the WoW module. If the host mode is asleep
++ and WoW is enabled, all packets are matched against the existing WoW patterns. If a
++ packet matches any of the patterns specified, the target will wake up the host. All
++ non-matching packets are discarded by the target without being sent up to the host.
++
++Command
++ wmiconfig –addwowpattern <list-id> <filter-size> <filter-offset>
++ <pattern> <mask>
++
++Command Parameters
++ A_UINT8 filter_list_id ID of the list that is to include the new pattern
++ A_UINT8 filter_size Size of the new pattern
++ A_UINT8 filter_offset Offset at which the pattern matching for this
++ new pattern should begin at
++ A_UINT8 filter[1] Byte stream that contains both the pattern and
++ the mask of the new WoW wake-up pattern
++
++Reply Parameters
++ None
++
++Reset Value
++ None defined (default host mode is awake)
++
++Restrictions
++ None
++
++See Also
++ “DELETE_WOW_PATTERN”
++
++=====================================================================
++
++
++Name
++ CLR_RSSI_SNR
++
++Synopsis
++ Clears the current calculated RSSI and SNR value. RSSI and SNR are reported by
++ running-average value. This command will clear the history and have a fresh start
++ for the running-average mechanism.
++
++Command
++ wmiconfig eth1 --cleanRssiSnr
++
++Command Parameters
++ None
++
++Reply Parameters
++ None
++
++Reset Value
++ None defined
++
++Restrictions
++ None
++
++=====================================================================
++
++Name
++ CONNECT_CMD
++
++Synopsis
++ New connect control information (connectCtrl) is added, with 32 possible modifiers.
++
++ CONNECT_SEND_REASSOC
++ Valid only for a host-controlled connection to a
++ particular AP. If this bit is set, a reassociation frame is
++ sent. If this bit is clear, an association request frame is
++ sent to the AP.
++
++ CONNECT_IGNORE_WPAx_GROUP_CIPHER
++ No group key is issued in the CONNECT command,
++ so use the group key advertised by the AP. In a target-
++ initiated roaming situation this allows a STA to roam
++ between APs that support different multicast ciphers.
++
++ CONNECT_PROFILE_MATCH_DONE
++ In a host-controlled connection case, it is possible that
++ during connect, firmware may not have the
++ information for a profile match (e.g, when the AP
++ supports hidden SSIDs and the device may not
++ transmit probe requests during connect). By setting
++ this bit in the connection control information, the
++ firmware waits for a beacon from the AP with the
++ BSSID supplied in the CONNECT command. No
++ additional profile checks are done.
++
++ CONNECT_IGNORE_AAC_BEACON
++ Ignore the Admission Capacity information in the
++ beacon of the AP
++
++ CONNECT_ASSOC_POLICY_USER
++ When set, the CONNECT_SEND_REASSOC setting
++ determines if an Assoc or Reassoc is sent to an AP
++
++Command
++ wmiconfig --setconnectctrl <ctrl flags bitmask>
++
++Command Parameters
++ typedef struct{
++ A_UINT8 networktype;
++ A_UINT8 dot11authmode;
++ A_UINT8 authmode;
++ A_UINT8 pairwiseCryptoType; /*CRYPTO_TYPE*/
++ A_UINT8 pairwiseCryptoLen;
++ A_UINT8 groupCryptoType; /*CRYPTO_TYPE*/
++ A_UINT8 groupCryptoLen;
++ A_UINT8 ssidLength;
++ A_UCHAR ssid[WMI_MAX_SSID_LEN];
++ A_UINT16 channel;
++ A_UINT8 bssid[AUTH_MAC_LEN];
++ A_UINT8 ctrl_flags; /*WMI_CONNECT_CTRL_FLAGS_BITS*/
++ } WMI_CONNECT_CMD;
++
++ ctrl flags bitmask
++ = 0x0001 CONNECT_ASSOC_POLICY_USER
++ Assoc frames are sent using the policy specified by
++ the flag
++ = 0x0002 CONNECT_SEND_REASSOC
++ Send Reassoc frame while connecting, otherwise send
++ assoc frames
++ = 0x0004 CONNECT_IGNORE_WPAx_GROUP_CIPHER
++ Ignore WPAx group cipher for WPA/WPA2
++ = 0x0008 CONNECT_PROFILE_MATCH_DONE
++ Ignore any profile check
++ = 0x0010 CONNECT_IGNORE_AAC_BEACON
++ Ignore the admission control information in the
++ beacon
++ ... CONNECT_CMD, continued
++ Command Values
++ typedef enum {
++ INFRA_NETWORK = 0x01,
++ ADHOC_NETWORK = 0x02,
++ ADHOC_CREATOR = 0x04,
++ } NETWORK_TYPE;
++
++ typedef enum {
++ OPEN_AUTH = 0x01,
++ SHARED_AUTH = 0x02,
++ LEAP_AUTH = 0x04,
++ } DOT11_AUTH_MODE;
++ typedef enum {
++ NONE_AUTH = 0x01,
++ WPA_AUTH = 0x02,
++ WPA_PSK_AUTH = 0x03,
++ WPA2_AUTH = 0x04,
++ WPA2_PSK_AUTH = 0x05,
++ WPA_AUTH_CCKM = 0x06,
++ WPA2_AUTH_CCKM = 0x07,
++ } AUTH_MODE;
++ typedef enum {
++ NONE_CRYPT = 0x01,
++ WEP_CRYPT = 0x02,
++ TKIP_CRYPT = 0x03,
++ AES_CRYPT = 0x04,
++ } CRYPTO_TYPE;
++ typedef enum {
++ CONNECT_ASSOC_POLICY_USER = 0x0001,
++ CONNECT_SEND_REASSOC = 0x0002,
++ CONNECT_IGNORE_WPAx_GROUP_CIPHER = 0x0004,
++ CONNECT_PROFILE_MATCH_DONE = 0x0008,
++ CONNECT_IGNORE_AAC_BEACON = 0x0010,
++ } WMI_CONNECT_CTRL_FLAGS_BITS;
++
++ pairwiseCryptoLen and groupCryptoLen are valid when the respective
++ CryptoTypesis WEP_CRYPT, otherwise this value should be 0. This is the length in
++ bytes.
++
++Reset Value
++ None defined
++
++Restrictions
++ None
++
++=====================================================================
++
++
++Name
++ CREATE_PSTREAM
++
++Synopsis
++ The host uses this command to create a new prioritized data endpoint between the
++ host and the AR6000 device that carries a prioritized stream of data. If the AP that the
++ device connects to requires TSPEC stream establishment, the device requests the
++ corresponding TSPEC with the AP. The maximum and minimum service interval
++ ranges from 0 – 0x7FFFFFFF (ms), where 0 = disabled. The device does not send a
++ reply event for this command, as it is always assumed the command has succeeded.
++ An AP admission control response comes to the host via a WMI_CAC_INDICATION
++ event, once the response for the ADDTS frame comes.
++
++ Examples of cases where reassociation is generated (when WMM) and cases where
++ ADDTS is generated (when WMM and enabling ACM) are when:
++ Changing UAPSD flags in WMM mode, reassociation is generated
++ Changing the interval of sending auto QoS Null frame in WMM mode;
++ reassociation is not generated
++ Issuing a command with same previous parameters in WMM mode and enabling
++ ACM, an ADDTS request is generated
++ Changing the interval of a QoS null frame sending in WMM mode and enabling
++ ACM, an ADDTS request is generated
++ Issuing the command in disconnected state, reassociation or ADDTS is not
++ generated but the parameters are available after (re)association
++
++Command
++ --createqos <user priority> <direction> <traffic class>
++<trafficType> <voice PS capability> <min service interval> <max
++service interval> <inactivity interval> <suspension interval>
++<service start time> <tsid> <nominal MSDU> <max MSDU> <min data
++rate> <mean data rate> <peak data rate> <max burst size> <delay
++bound> <min phy rate> <sba> <medium time> where:
++
++ <user priority>
++ 802.1D user priority range (0–7)
++ <direction>
++ = 0 Tx (uplink) traffic
++ = 1 Rx (downlink) traffic
++ = 2 Bi-directional traffic
++ <traffic class>
++ = 1 BK
++ = 2 VI
++ = 3 VO
++ <trafficType>
++ = 0 Aperiodic
++ = 1 Periodic
++ <voice PS capability>
++ Specifies whether the voice power save mechanism
++ (APSD if AP supports it or legacy/simulated APSD
++ [using PS-Poll]) should be used
++ = 0 Disable voice power save for traffic class
++ = 1 Enable APSD voice power save for traffic class
++ = 2 Enable voice power save for all traffic classes
++ <min service interval>
++ (In ms)
++ <max service interval>
++ Inactivity interval (in ms) (0 = Infinite)
++ <suspension interval>
++ (In ms)
++ <service start time>
++ Service start time
++ <tsid>
++ TSID range (0–15)
++ <nominal MSDU>
++ Nominal MAC SDU size
++ <max MSDU>
++ Maximum MAC SDU size
++ <min data rate>
++ Minimum data rate (in bps)
++ <mean data rate>
++ Mean data rate (in bps)
++ <peak data rate>
++ Peak data rate (in bps)
++ <max burst size>
++ Maximum burst size (in bps)
++ <delay bound>
++ Delay bound
++ <min phy rate>
++ Minimum PHY rate (in bps)
++ <sba>
++ Surplus bandwidth allowance
++ <medium time>
++ Medium time in TU of 32-ms periods per sec
++ ... CREATE_PSTREAM (continued)
++
++Command Parameters
++ UINT8 trafficClass TRAFFIC_CLASS value
++ UINT8 traffic
++ Direction
++ DIR_TYPE value
++ UINT8 rxQueueNum
++ AR6000 device mailbox index (2 or 3)
++ corresponding to the endpoint the host
++ wishes to use to receive packets for the
++ prioritized stream
++ UINT8 trafficType TRAFFIC_TYPE value
++ UINT8 voicePS
++Capability
++ VOICEPS_CAP_TYPE value
++ UINT8 tsid Traffic stream ID
++ UINT8 userPriority 802.1D user priority
++ UINT16 nominalMSDU Nominal MSDU in octets
++ UINT16 maxMSDU Maximum MSDU in octets
++ UINT32 minServiceInt Minimum service interval: the min.
++ period of traffic specified (in ms)
++ UINT32 maxServiceInt Maximum service interval: the max.
++ period of traffic specified (in ms)
++ UINT32 inactivityInt Indicates how many ms an established
++ stream is inactive before the prioritized
++ data endpoint is taken down and the
++ corresponding T-SPEC deleted
++ UINT32 suspensionInt Suspension interval (in ms)
++ UINT32 service StartTime Service start time
++ UINT32 minDataRate Minimum data rate (in bps)
++ UINT32 meanDataRate Mean data rate (in bps)
++ UINT32 peakDataRate Peak data rate (in bps)
++ UINT32 maxBurstSize
++ UINT32 delayBound
++ UINT32 minPhyRate Minimum PHY rate for TSPEC (in bps)
++ UINT32 sba Surplus bandwidth allowance
++ UINT32 mediumTime Medium TSPEC time (in units of 32 ms)
++Command Values
++ {
++ WMM_AC_BE = 0 Best Effort
++ WMM_AC_BK = 1 Background
++ WMM_AC_VI = 2 Video
++ WMM_AC_VO = 3 Voice
++ All other values reserved
++ } TRAFFIC_CLASS
++ {
++ UPLINK_TRAFFIC = 0 From the AR6000 device to the AP
++ DOWNLINK_TRAFFIC = 1 From the AP to the AR6000 device
++ BIDIR_TRAFFIC = 2 Bi-directional traffic
++ All other values reserved
++ } DIR_TYPE
++ {
++ DISABLE_FOR_THIS_AC = 0
++ ENABLE_FOR_THIS_AC = 1
++ ENABLE_FOR_ALL_AC = 2
++ All other values reserved
++ } VOICEPS_CAP_TYPE
++
++ ... CREATE_PSTREAM (continued)
++
++
++ VI BE BK Supported, Y/N?
++ 0 0 0 0 Y
++ 0 0 0 1 Y
++ 0 0 1 0 N
++ 0 0 1 1 N
++ 0 1 0 0 Y
++ 0 1 0 1 Y
++ 0 1 1 0 N
++ 0 1 1 1 N
++ 1 0 0 0 Y
++ 1 0 0 1 Y
++ 1 0 1 0 N
++ 1 1 0 0 N
++ 1 1 0 1 Y
++ 1 1 0 0 N
++ 1 1 1 0 N
++ 1 1 1 1 Y
++
++Reset Value
++ No pstream is present after reset; each of the BE, BK, VI,VO pstreams must be created
++ (either implicitly by data flow or explicitly by user)
++
++Restrictions
++ This command can only be issued when the device is in the CONNECTED state. If
++ the device receives the command while in DISCONNECTED state, it replies with a
++ failure indication. At most four prioritized data endpoints can be created, one for
++ each AC.
++
++See Also
++ “DELETE_PSTREAM”
++=====================================================================
++
++Name
++ DELETE_BAD_AP
++
++Synopsis
++ The host uses this command to clear a particular entry in the bad AP table
++
++Command
++ wmiconfig eth1 --rmAP [--num=<index>] // used to clear a badAP
++ entry. num is index from 0-3
++
++Command Parameters
++ UINT8 badApIndex Index [0...n] that identifies the entry in the bad
++ AP table to delete
++
++Command Values
++ badApIndex = 0, 1, 2, 3
++ Entry in the bad AP table
++
++Reset Value
++ None defined
++
++Restrictions
++ None
++
++See Also
++ “ADD_BAD_AP”
++
++=====================================================================
++
++
++Name
++ DELETE_CIPHER_KEY
++
++Synopsis
++ The host uses this command to delete a key that was previously added with the
++ “ADD_CIPHER_KEY” command.
++
++Command
++ TBD
++
++Command Parameters
++ UINT8 keyIndex Index (0...3) of the key to be deleted
++
++Command Values
++ keyIndex = 0, 1,2, 3 Key to delete
++
++Reset Value
++ None
++
++Restrictions
++ The host should not delete a key that is currently in use by the AR6000.
++
++See Also
++ “ADD_CIPHER_KEY”
++
++=====================================================================
++
++Name
++ DELETE_PSTREAM
++
++Synopsis
++ The host uses this command to delete a prioritized data endpoint created by a
++ previous “CREATE_PSTREAM” command
++
++Command
++ --deleteqos <trafficClass> <tsid>, where:
++
++ <traffic class>
++ = 0 BE
++ = 1 BK
++ = 2 VI
++ = 3 VO
++ <tsid>
++ The TSpec ID; use the -qosqueue option
++ to get the active TSpec IDs for each traffic class
++
++Command Parameters
++ A_UINT8 trafficClass Indicate the traffic class of the stream
++ being deleted
++
++Command Values
++ {
++ WMM_AC_BE = 0 Best effort
++ WMM_AC_BK = 1 Background
++ WMM_AC_VI = 2 Video
++ WMM_AC_VO = 3 Voice
++ } TRAFFIC CLASS
++
++ 0-15 for TSID
++
++Reply Values
++ N/A
++
++Restrictions
++ This command should only be issued after a “CREATE_PSTREAM” command has
++ successfully created a prioritized stream
++
++See Also
++ “CREATE_PSTREAM”
++
++=====================================================================
++
++
++Name
++ DELETE_WOW_PATTERN
++
++Synopsis
++ The host uses this command to remove a pre-specified pattern from the
++ WoW pattern list.
++
++Command
++ wmiconfig –delwowpattern <list-id> <pattern-id>
++
++Command Parameters
++ A_UINT8 filter_list_id ID of the list that contains the WoW filter
++ pattern to delete
++ A_UINT8 filter_id ID of the WoW filter pattern to delete
++
++Reply Parameters
++ None
++
++
++
++Reset Value
++ None defined
++
++Restrictions
++ None
++
++See Also
++ “ADD_WOW_PATTERN”
++
++=====================================================================
++
++
++Name
++ EXTENSION
++
++Synopsis
++ The WMI message interface is used mostly for wireless control messages to a wireless
++ module applicable to wireless module management regardless of the target platform
++ implementation. However, some commands only peripherally related to wireless
++ management are desired during operation. These wireless extension commands may
++ be platform-specific or implementation-dependent.
++
++Command
++ N/A
++
++Command Parameters
++ Command-specific
++
++Command Values
++ Command-specific
++
++Reply Parameters
++ Command-specific
++
++Reset Values
++ None defined
++
++Restrictions
++ None defined
++
++=====================================================================
++
++
++Name
++ GET_BIT_RATE
++
++Synopsis
++ Used by the host to obtain the rate most recently used by the AR6000 device
++
++Command
++ wmiconfig eth1 --getfixrates
++
++Command Parameters
++ None
++
++
++
++Reply Parameters
++ INT8
++ rateIndex
++ See the “SET_BIT_RATE” command
++
++Reset Values
++ None
++
++Restrictions
++ This command should only be used during development/debug; it is not intended
++for use in production. It is only valid when the device is in the CONNECTED state
++
++See Also
++ “SET_BIT_RATE”
++
++=====================================================================
++
++
++Name
++ GET_CHANNEL_LIST
++
++Synopsis
++ Used by the host uses to retrieve the list of channels that can be used by the device
++ while in the current wireless mode and in the current regulatory domain.
++
++Command
++ TBD
++
++Command Parameters
++ None
++
++Reply Parameters
++ UINT8 reserved Reserved
++ UINT8 numberOfChannels Number of channels the reply contains
++ UINT16 channelList[numberOfChannels] Array of channel frequencies (in MHz)
++
++Reset Values
++ None defined
++
++Restrictions
++ The maximum number of channels that can be reported are 32
++
++=====================================================================
++
++
++Name
++ GET_FIXRATES
++
++Synopsis
++ Clears the current calculated RSSI and SNR value. RSSI and SNR are reported by
++ running-average value. This command will clear the history and have a fresh start for
++ the running-average mechanism.
++
++Synopsis
++ This returns rate-mask set via WMI_SET_FIXRATES to retrieve the current fixed rate
++ that the AR6001 or AR6001 is using. See “SET_FIXRATES”.
++
++Command
++ wmiconfig eth1 --getfixrates
++
++Command Parameters
++ A_UINT16 fixRateMask; Note: if this command is used prior to
++ using WMI_SET_FIXRATES, AR6000
++ returns 0xffff as fixRateMask, indicating
++ all the rates are enabled
++
++Reply Parameters
++ None
++
++Reset Value
++ None defined
++
++Restrictions
++ None
++
++See Also
++ “SET_FIXRATES”
++
++=====================================================================
++
++
++
++Name
++ GET_PMKID_LIST_CMD
++
++Synopsis
++ Retrieves the list of PMKIDs on the firmware. The
++ WMI_GET_PMKID_LIST_EVENT is generated by the firmware.
++
++Command
++ TBD
++
++Command Parameters
++
++Reset Values
++ None
++
++Restrictions
++ None
++
++See Also
++ SET_PMKID_LIST_CMD GET_PMKID_LIST_EVENT
++
++=====================================================================
++
++
++Name
++ GET_ROAM_TBL
++
++Synopsis
++ Retrieve the roaming table maintained on the target. The response is reported
++ asynchronously through the ROAM_TBL_EVENT.
++
++Command
++ wmiconfig --getroamtable <roamctrl> <info>
++
++Command Parameters
++ A_UINT8 roamCtrlType;
++ A_UINT16 roamMode
++ A_UINT16 numEntries
++ WMI_BSS_ROAM_INFO bssRoamInfo[1]
++
++Reply Value
++ Reported asynchronously through the ROAM_TBL_EVENT
++
++Reset Value
++ None defined
++
++Restrictions
++ None
++
++See Also
++ SET_KEEPALIVE
++
++=====================================================================
++
++
++Name
++ GET_TARGET_STATS
++
++Synopsis
++ The host uses this command to request that the target send the statistics that it
++ maintains. The statistics obtained from the target are accrued in the host every time
++ the GET_TARGET_STATS command is issued. The --clearStats option is added to
++ clear the target statistics maintained in the host.
++
++Command
++ wmiconfig --getTargetStats --clearStats
++
++Command Parameters
++ TARGET_STATS targetStats
++ WMI_TARGET_STATS
++ UINT8 clearStats
++
++
++Reply Value
++ RSSI return value (0–100)
++
++Reset Values
++ All statistics are cleared (zeroed)
++
++Restrictions
++ The --getTargetStats option must be used; the --clearStats option is also available also
++
++
++=====================================================================
++
++Name
++ GET_TX_PWR
++
++Synopsis
++ The host uses this command to retrieve the current Tx power level
++
++Command
++ wmiconfig -i eth1 --getpower
++
++Command Parameters
++ None
++
++Reply Parameters
++ UINT16 dbM The current Tx power level specified in dbM
++
++Reset Values
++ The maximum permitted by the regulatory domain
++
++Restrictions
++ None
++
++See Also
++ “SET_TX_PWR”
++
++=====================================================================
++
++
++Name
++ GET_WOW_LIST
++
++Synopsis
++ The host uses this command to retrieve the current list of WoW patterns.
++
++Command
++ wmiconfig –getwowlist <list-id>
++
++Command Parameters
++ A_UINT8 filter_list_id ID of the list of WoW patterns to retrieve
++
++Reply Value(s)
++ A_UINT16 num_filters Number of WoW patterns contained in the list
++ A_UINT8 wow_mode Current mode of WoW (enabled or disabled)
++ A_UINT8 host_mode Current host mode (asleep or awake)
++ WOW_FILTER wow_filters[1]
++ Contents of the WoW filter pattern list
++ (contains mask, pattern, offset and size
++ information for each of the patterns)
++
++Reset Value
++ None defined
++
++Restrictions
++ None
++
++See Also
++ “SET_WSC_STATUS”
++
++=====================================================================
++
++
++Name
++ LQ_THRESHOLD_PARAMS
++
++Synopsis
++ Sets Link Quality thresholds, the sampling will happen at every unicast data frame
++ Tx if a certain threshold is met, and the corresponding event will be sent to the host.
++
++Command
++ --lqThreshold <enable> <upper_threshold_1> ...
++ <upper_threshold_4> <lower_threshold_1> ... <lower_threshold_4>
++
++Command Parameters
++ <enable> = 0 Disable link quality sampling
++ = 1 Enable link quality sampling
++ <upper_threshold_x> Above thresholds (value in [0,100]), in
++ ascending order
++ <lower_threshold_x> Below thresholds (value in [0,100]), in
++ ascending order
++
++Command Values
++ See command parameters
++
++Reset Value
++ None defined
++
++Restrictions
++ None
++
++=====================================================================
++
++
++Name
++ OPT_TX_FRAME
++
++Synopsis
++ Special feature, sends a special frame.
++
++Command
++ wmiconfig --sendframe <frmType> <dstaddr> <bssid> <optIEDatalen>
++ <optIEData>
++
++Command Parameters
++ {
++ A_UINT16 optIEDataLen;
++ A_UINT8 frmType;
++ A_UINT8 dstAddr[ATH_MAC_LEN];
++ A_UINT8 bssid[ATH_MAC_LEN];
++ A_UINT8 optIEData[1];
++ } WMI_OPT_TX_FRAME_CMD;
++
++Command Values
++ <frmtype> = 1 Probe request frame
++ = 2 Probe response frame
++ = 3 CPPP start
++ = 4 CPPP stop
++
++Reset Value
++ None defined
++
++Restrictions
++ Send a special frame only when special mode is on.
++
++=====================================================================
++
++
++Name
++ RECONNECT
++
++Synopsis
++ This command requests a reconnection to a BSS to which the AR6000 device was
++ formerly connected
++
++Command
++ TBD
++
++Command Parameters
++ UINT16 channel Provides a hint as to which channel was
++ used for a previous connection
++ UINT8 bssid[6] If set, indicates which BSSID to connect to
++
++Command Values
++ None
++
++Reset Values
++ None
++
++Restrictions
++ None
++
++See Also
++ “CONNECT_CMD”
++
++=====================================================================
++
++
++Name
++ RSSI_THRESHOLD_PARAMS
++
++Synopsis
++ Configures how the AR6000 device monitors and reports signal strength (RSSI) of the
++ connected BSS, which is used as a link quality metric. The four RSSI threshold sets (in
++ dbM) of the host specification divide the signal strength range into six segments.
++ When signal strength increases or decreases across one of the boundaries, an
++ RSSI_THRESHOLD event is signaled to the host. The host may then choose to take
++ action (such as influencing roaming).
++
++Command
++ wmiconfig eth1 --rssiThreshold <weight> <pollTime>
++ <above_threshold_val_1> ... <above_threshold_tag_6>
++ <above_threshold_val_6>
++ <below_threshold_tag_1> <below_threshold_val_1> ...
++ <below_threshold_tag_6> <below_threshold_val_6>
++
++Command Parameters
++ UINT8 weight Range in [1, 16] used to calculate average RSSI
++ UINT32 pollTime RSSI (signal strength) sampling frequency in
++ seconds (if pollTime = 0, single strength
++ sampling is disabled)
++ USER_RSS__THOLD tholds[12] Thresholds (6 x 2)
++
++Command Values
++ None defined
++
++Reset Values
++ pollTime is 0, and sampling is disabled
++
++Restrictions
++ Can only be issued if the AR6000 device is connected
++
++
++=====================================================================
++
++Name
++ SCAN_PARAMS
++
++Synopsis
++ The minact parameter determines the minimum active channel dwell time, within
++ which if the STA receives any beacon, it remains on that channel until the maxact
++ channel dwell time. If the STA does not receive a beacon within the minact dwell
++ time, it switches to scan the next channel.
++
++Command
++ wmiconfig -scan -minact=<ms> --maxact=<ms>
++
++Command Parameters
++ UINT16 maxact Channel dwell time (in ms), default = 0
++ UINT16 minact Channel dwell time (in ms), default = 105
++
++Command Values
++ See channel parameters
++
++Reset Values
++ None defined
++
++Restrictions
++ The minact value should be greater than 0; maxact should be between 5–65535 ms
++ and greater than minact
++
++=====================================================================
++
++
++Name
++ SET_ACCESS_PARAMS
++
++Synopsis
++ Allows the host to set access parameters for the wireless network. A thorough
++ understanding of IEEE 802.11 is required to properly manipulate these parameters.
++
++Command
++ wmiconfig eth1 --acparams --txop <limit> --cwmin <0-15>
++ --cwmax <0-15> --aifsn<0-15>
++
++Command Parameters
++ UINT16 txop The maximum time (expressed in units of
++ 32 ms) the device can spend transmitting
++ after acquiring the right to transmit
++ UINT8 eCWmin Minimum contention window
++ UINT8 eCWmax Maximum contention window
++ UINT8 aifsn The arbitration inter-frame space number
++
++Command Values
++ None
++
++Reset Values
++ Reasonable defaults that vary, between endpoints (prioritized streams)
++
++Restrictions
++ None
++
++=====================================================================
++
++
++Name
++ SET_ADHOC_BSSID
++
++Synopsis
++ Allows the host to set the BSSID for an ad hoc network. If a network with this BSSID
++ is not found, the target creates an ad hoc network with this BSSID after the connect
++ WMI command is triggered (e.g., by the SIOCSIWESSID IOCTL).
++
++Command
++ wmiconfig eth1 --adhocbssid <bssid>
++
++Command Parameters
++ A_UINT8 bssid[ATH_MAC_LEN] BSSID is specified in xx:xx:xx:xx:xx:xx format
++
++Command Values
++ None
++
++Reset Values
++ None
++
++Restrictions
++ None
++
++=====================================================================
++
++
++Name
++ SET_AKMP_PARAMS
++
++Synopsis
++ Enables or disables multi PMKID mode.
++
++Command
++ wmiconfig eth1 --setakmp --multipmkid=<on/off>
++
++Command Parameters
++ typedef struct {
++ A_UINT32 akmpInfo;
++ } WMI_SET_AKMP_PARAMS_CMD;
++
++Command Values
++ akmpInfo;
++ bit[0] = 0
++ MultiPMKID mode is disabled and PMKIDs that
++ were set using the WMI_SET_PMKID_CMD are
++ used in the [Re]AssocRequest frame.
++ bit[0] = 1
++ MultiPMKID mode is enabled and PMKIDs issued
++ by the WMI_SET_PMKID_LIST_CMD are used in
++ the next [Re]AssocRequest sent to the AP.
++
++Reset Values
++ MultiPMKID mode is disabled
++
++Restrictions
++ None
++
++=====================================================================
++
++
++Name
++ SET_APPIE
++
++Synopsis
++ Add an application-specified IE to a management frame. The maximum length is
++ 76 bytes. Including the length and the element ID, this translates to 78 bytes.
++
++Command
++ wmiconfig --setappie <frame> <IE>, where:
++
++ frame
++ One of beacon, probe, respon, assoc
++
++ IE
++ A hex string beginning with DD (if = 0, no
++ IE is sent in the management frame)
++
++Command Parameters
++ mgmtFrmType;
++ A WMI_MGMT_FRAME_TYPE
++
++ ieLen;
++ Length of the IE to add to the GMT frame
++
++Command Values
++ None
++
++Reset Value
++ None defined
++
++Restrictions
++ Supported only for the probe request and association request management frame
++types. Also, only one IE can be added per management frame type.
++
++=====================================================================
++
++
++Name
++ SET_ASSOC_INFO
++
++Synopsis
++ The host uses this command to specify any information elements (IEs) it wishes the
++ AR6000 device to add to all future association and reassociation requests. IEs must be
++ correct and are used as is by the device. IEs specified through this command are
++ cleared with a DISCONNECT.
++
++Command
++ wmiconfig eth1 --setAssocIe <IE>
++
++Command Parameters
++ UINT8 ieType Used directly in 802.11 frames
++ UINT8 bufferSize Size of assocInfo (in bytes) ranging from
++ 0–240. If = 0, previously set IEs are cleared.
++ UINT8 assocInfo[bufferSize] Used directly in 802.11 frames
++
++Command Values
++ None
++
++Reset Values
++ IEs are cleared
++
++Restrictions
++ This command can only be issued in the DISCONNECTED state
++
++=====================================================================
++
++
++Name
++ SET_AUTHMODE
++
++Synopsis
++ Sets the 802.11 authentication mode of reconnection
++
++Command
++ wmiconfig eth1 --setauthmode <mode>
++
++Command Parameters
++ UINT8 mode
++
++Command Values
++ mode = 0x00 Proceed with authentication during reconnect
++ = 0x01 Do not proceed with authentication during reconnect
++
++Reset Values
++ Authentication
++
++Restrictions
++ None
++
++=====================================================================
++
++
++Name
++ SET_BEACON_INT
++
++Synopsis
++ Sets the beacon interval for an ad hoc network. Beacon interval selection may have an
++ impact on power savings. To some degree, a longer interval reduces power
++ consumption but also decreases throughput. A thorough understanding of IEEE
++ 802.11 ad hoc networks is required to use this command effectively.
++
++Command
++ wmiconfig eth1 --ibssconintv
++
++Command Parameters
++ UINT16 beaconInterval Specifies the beacon interval in TU units (1024 ms)
++
++Command Values
++ None
++
++Reset Values
++ The default beacon interval is 100 TUs (102.4 ms)
++
++Restrictions
++ This command can only be issued before the AR6000 device starts an ad hoc network
++
++See Also
++ “SET_IBSS_PM_CAPS”
++
++=====================================================================
++
++
++Name
++ SET_BIT_RATE
++
++Synopsis
++ The host uses this command to set the AR6000 device to a specific fixed rate.
++
++Command
++ wmiconfig eth1 --setfixrates <rate_0> ... <rate_n>
++
++Command Parameters
++ INT8 rateIndex
++ A WMI_BIT_RATE value
++ {
++ RATE_AUTO = -1
++ RATE_1Mb = 0
++ RATE_2Mb = 1
++ RATE_5_5M = 2
++ RATE_11Mb = 3
++ RATE_6Mb = 4
++ RATE_9Mb = 5
++ RATE_12Mb = 6
++ RATE_18Mb = 7
++ RATE_24Mb = 8
++ RATE_36Mb = 9
++ RATE_48Mb = 10
++ RATE_54Mb = 11
++ } WMI_BIT_RATE
++
++
++Command Values
++ See command parameters
++
++Reset Values
++ The dynamic rate is determined by the AR6000 device
++
++Restrictions
++ This command is intended for use only during development/debug; it is not
++intended for use in production
++
++See Also
++ “GET_BIT_RATE”
++
++=====================================================================
++
++
++Name
++ SET_BMISS_TIME
++
++Synopsis
++ This command sets the beacon miss (BMISS) time, which the AR6000 hardware use
++ to recognize missed beacons. When an excessive number (15) of consecutive beacons
++ are missed, the AR6000 consider switching to a different BSS. The time can be
++ specified in number of beacons or in TUs.
++
++Command(s)
++ wmiconfig eth1 --setbmissbeacons=<val>
++ wmiconfig eth1 --setbmisstime=<val>
++
++Command Parameters
++ UINT16 bmissTime Specifies the beacon miss time
++ [1000...5000] in TUs (1024 ms)
++ UINT16 bmissbeacons Specifies the number of beacons [5...50]
++
++Command Values
++ None
++
++Reset Values
++ bmissTime is 1500 TUs (1536 ms)
++
++Restrictions
++ None
++
++=====================================================================
++
++
++Name
++ SET_BSS_FILTER
++
++Synopsis
++ The host uses this to inform the AR6000 device of the types of networks about which
++ it wants to receive information from the “BSSINFO” event. As the device performs
++ either foreground or background scans, it applies the filter and sends “BSSINFO”
++ events only for the networks that pass the filter. If any of the bssFilter or the ieMask
++ filter matches, a BSS Info is sent to the host. The ieMask currently is used as a match
++ for the IEs in the beacons, probe reponses and channel switch action management
++ frame. See also “Scan and Roam” on page C-1.
++
++ The BSS filter command has been enhanced to support IE based filtering. The IEs can
++ be specified as a bitmask through this command using this enum.
++
++Command
++ wmiconfig eth1 –filter = <filter> --ieMask 0x<mask>
++
++Command Parameters
++ UINT8 BssFilter
++
++ Command Values
++ typedef struct {
++ A_UINT8 bssFilter; See WMI_BSS_FILTER
++ A_UINT32 ieMask;
++ } __ATTRIB_PACK WMI_BSS_FILTER_CMD;
++
++ The ieMask can take this combination of values:
++
++ enum {
++ BSS_ELEMID_CHANSWITCH = 0x01
++ BSS_ELEMID_ATHEROS = 0x02,
++ }
++
++Reply Value
++ None
++
++Reset Value
++ BssFilter = NONE_BSS_FILTER (0)
++
++Restrictions
++ None
++
++See Also
++ “CONNECT_CMD”
++
++=====================================================================
++
++
++Name
++ SET_BT_PARAMS
++
++Synopsis
++ This command is used to set the status of a Bluetooth stream or set Bluetooth
++ coexistence register parameters. The stream may be an SCO or an A2DP stream and
++ its status can be started/stopped/suspended/resumed.
++
++Command
++ wmiconfig –setBTparams <paramType> <params>
++
++Command Parameters
++ struct {
++ union {
++ BT_PARAMS_SCO scoParams;
++ BT_PARAMS_A2DP a2dpParams;
++ BT_PARAMS_MISC miscParams;
++ BT_COEX_REGS regs;
++ } info;
++ A_UINT8 paramType;
++ struct {
++ A_UINT8 noSCOPkts; Number of SCO packets between consecutive PS-POLLs
++ A_UINT8 pspollTimeout;
++ A_UINT8 stompbt;
++ } BT_PARAMS_SCO;
++ struct {
++ A2DP BT stream parameters
++ A_UINT32 period;
++ A_UINT32 dutycycle;
++ A_UINT8 stompbt;
++ } BT_PARAMS_A2DP;
++ struct {
++ union {
++ WLAN_PROTECT_POLICY_TYPE protectParams;
++ A_UINT16 wlanCtrlFlags;
++ }info;
++ A_UINT8 paramType;
++ } BT_PARAMS_MISC;
++ struct {
++ BT coexistence registers values
++ A_UINT32 mode; Coexistence mode
++ A_UINT32 scoWghts; WLAN and BT weights
++ A_UINT32 a2dpWghts;
++ A_UINT32 genWghts;
++ A_UINT32 mode2; Coexistence mode2
++ A_UINT8 setVal;
++ } BT_COEX_REGS;
++
++Command Values
++ None defined
++
++Reset Value
++ None
++
++Restrictions
++ None
++
++=====================================================================
++
++
++Name
++ SET_BT_STATUS
++
++Synopsis
++ Sets the status of a Bluetooth stream. The stream may be a SCO or an A2DP stream
++ and its status can be started/stopped/suspended/resumed.
++
++Command
++ wmiconfig –setBTstatus <streamType> <status>
++
++Command Parameters
++ {
++ A_UINT8 streamType; Stream type
++ A_UINT8 status; Stream status
++ }WMI_SET_BT_STATUS_CMD;
++
++Command Values
++ {
++ BT_STREAM_UNDEF = 0
++ BT_STREAM_SCO
++ SCO stream
++ BT_STREAM_A2DP
++ A2DP stream
++ BT_STREAM_MAX
++ } BT_STREAM_TYPE;
++
++ {
++ BT_STATUS_UNDEF = 0
++ BT_STATUS_START
++ BT_STATUS_STOP
++ BT_STATUS_RESUME
++ BT_STATUS_SUSPEND
++ BT_STATUS_MAX
++ } BT_STREAM_STATUS;
++
++Reset Value
++ None defined
++
++Restrictions
++ None
++
++=====================================================================
++
++
++Name
++ SET_CHANNEL_PARAMETERS
++
++Synopsis
++ Configures various WLAN parameters related to channels, sets the wireless mode,
++ and can restrict the AR6000 device to a subset of available channels. The list of
++ available channels varies depending on the wireless mode and the regulatory
++ domain. The device never operates on a channel outside of its regulatory domain. The
++ device starts to scan the list of channels right after this command.
++
++Command
++ wmiconfig eth1 --wmode <mode> <list>
++
++Command Parameters
++ UINT8 phyMode See Values below.
++ UINT8 numberOfChannels
++ Number of channels in the channel array that
++ follows. If = 0, then the device uses all of the
++ channels permitted by the regulatory domain
++ and by the specified phyMode.
++ UINT16 channel[numberOfChannels]
++ Array listing the subset of channels (expressed
++ as frequencies in MHz) the host wants the
++ device to use. Any channel not permitted by
++ the specified phyMode or by the specified
++ regulatory domain is ignored by the device.
++
++Command Values
++ phyMode = {
++ Wireless mode
++ 11a = 0x01
++ 11g = 0x02
++ 11ag = 0x03
++ 11b = 0x04
++ 11g only = 0x05
++ }
++
++Reset Values
++ phyMode
++ 11ag
++ 802.11a/g modules
++ 11g
++ 802.11g module
++ channels
++ Defaults to all channels permitted by the
++ current regulatory domain.
++
++Restrictions
++ This command, if issued, should be issued soon after reset and prior to the first
++ connection. This command should only be issued in the DISCONNECTED state.
++
++=====================================================================
++
++
++Name
++ SET_DISC_TIMEOUT
++
++Synopsis
++ The host uses this command to configure the amount of time that the AR6000 should
++ spend when it attempts to reestablish a connection after losing link with its current
++ BSS. If this time limit is exceeded, the AR6000 send a “DISCONNECT” event. After
++ sending the “DISCONNECT” event the AR6000 continues to attempt to reestablish a
++ connection, but they do so at the interval corresponding to a foreground scan as
++ established by the “SET_SCAN_PARAMS” command.
++
++ A timeout value of 0 indicates that the AR6000 will disable all autonomous roaming,
++ so that the AR6000 will not perform any scans after sending a “DISCONNECT”
++ event to the host. The state is maintained until a shutdown or host sets different
++ timeout value from 0.
++
++Command
++ wmiconfig eth1 --disc=<timeout in seconds>
++
++Command Parameters
++ UINT8 disconnectTimeout
++ Specifies the time limit (in seconds) after
++ which a failure to reestablish a connection
++ results in a “DISCONNECT” event
++
++Command Values
++ None
++
++Reset Values
++ disconnectTimeout is 10 seconds
++
++Restrictions
++ This command can only be issued while in a DISCONNECTED state
++
++=====================================================================
++
++
++Name
++ SET_FIXRATES
++
++Synopsis
++ By default, the AR6000 device uses all PHY rates based on mode of operation. If the
++ host application requires the device to use subset of supported rates, it can set those
++ rates with this command. In 802.11g mode, the AR6000 device takes the entire
++ 802.11g basic rate set and the rates specified with this command and uses it as the
++ supported rate set.
++
++ This rate set is advertised in the probe request and the assoc/re-assoc request as
++ supported rates. Upon successful association, the device modifies the rate set pool
++ using the: intersection of AP-supported rates with the union of the 802.11g basic rate
++ set and rates set using this command. The device picks transmission rates from this
++ pool based on a rate control algorithm.
++
++Command
++ TBD
++
++Command Parameters
++ A_UINT16 fixRateMask;
++ The individual bit is an index for rate table,
++ and setting the that index to 1 would set that
++ corresponding rate. E.g., fixRateMask = 9
++ (1001) sets 1 Mbps and 11 Mbps.
++
++Command Values
++ None
++
++Reset Value
++ None defined
++
++Restrictions
++ None
++
++See Also
++ “GET_FIXRATES”
++
++=====================================================================
++
++
++Name
++ SET_WHAL_PARAM
++
++Synopsis
++ An internal AR6000 command that is used to set certain hardware parameters. The
++ description of this command is in $WORKAREA/include/halapi.h.
++
++Command
++ TBD
++
++Command Parameters
++ ATH_HAL_SETCABTO_CMDID
++ Sets the timeout waiting for the multicast
++ traffic after a DTIM beacon (in TUs).
++
++Command Values
++ None
++
++Reset Value
++ Default = 10 TUs
++
++Restrictions
++ This command should be executed before issuing a connect command.
++
++=====================================================================
++
++
++Name
++ SET_HOST_SLEEP_MODE
++
++Synopsis
++ The host uses this command to set the host mode to asleep or awake. All packets are
++ delivered to the host when the host mode is awake. When host mode is asleep, only if
++ WoW is enabled and the incoming packet matches one of the specified WoW
++ patterns, will the packet be delivered to the host. The host will also be woken up by
++ the target for pattern-matching packets and important events.
++
++Command
++ wmiconfig –sethostmode=<asleep/awake>
++
++Command Parameters
++ A_BOOL awake Set the host mode to awake
++ A_BOOL asleep Set the host mode to asleep
++
++Command Values
++ 1 = awake, 0 = asleep
++
++Reset Value
++ None defined (default host mode is awake)
++
++Restrictions
++ None
++
++
++=====================================================================
++
++Name
++ SET_IBSS_PM_CAPS
++
++Synopsis
++ Used to support a non-standard power management scheme for an ad hoc wireless
++ network consisting of up to eight stations (STAs) that support this form of power
++ saving (e.g., Atheros-based STAs). A thorough understanding of IEEE 802.11 ad hoc
++ networks is required to use this command effectively.
++
++Command
++ wmiconfig eth1 --ibsspmcaps --ps=<enable/disable>
++ --aw=<ATIM Windows in ms>
++ --ttl=<Time to live in number of beacon periods>
++ --to=<timeout in ms>
++
++Command Parameters
++ UINT8 power_saving
++ = 0
++ The non-standard power saving scheme is
++ disabled and maximum throughput (with no
++ power saving) is obtained.
++
++ = 1
++ Ad hoc power saving scheme is enabled (but
++ throughput may be decreased)
++
++ UINT16 atim_windows
++ Specifies the length (in ms) of the ad hoc traffic
++ indication message (ATIM) windows used in an ad
++ hoc network. All Atheros-based STAs that join the
++ network use this duration ATIM window.
++
++ The duration is communicated between wireless
++ STAs through an IE in beacons and probe responses.
++
++ The host sets atim_windows to control trade-offs
++ between power use and throughput. The value
++ chosen should be based on the beacon interval (see
++ the “SET_BEACON_INT” command) on the
++ expected number of STAs in the IBSS, and on the
++ amount of traffic and traffic patterns between STAs.
++
++ UINT16 timeout_value
++ Specifies the timeout (in ms). The value is the same
++ for all ad hoc connections, but tracks separately for
++ each.
++
++ Applicable only for a beacon period and used to
++ derive actual timeout values on the Tx and Rx sides.
++ On the Tx side, the value defines a window during
++ which the STA accepts the frame(s) from the host for a
++ particular connection. Until closed, the window
++ restarts with every frame received from the host. On
++ the Rx side, indicates the time until which the STA
++ continues accepting frames from a particular
++ connection. The value resets with every frame
++ received. The value can be used to determine the
++ trade off between throughput and power.
++ Default = 10 ms
++
++ UINT8 ttl
++ Specifies the value in number of beacon periods. The
++ value is used to set a limit on the time until which a
++ frame is kept alive in the AR6001 before being
++ discarded. Default = 5
++
++Command Values
++ None
++
++Reset Values
++ By default, power_saving is enabled with atim_window = 20 ms
++
++Restrictions
++ Can only be issued before the AR6000 starts an ad hoc network
++
++See Also
++ “SET_BEACON_INT”
++
++=====================================================================
++
++
++
++Name
++ SET_LISTEN_INT
++
++Synopsis
++ The host uses this command to request a listen interval, which determines how often
++ the AR6000 device should wake up and listen for traffic. The listen interval can be set
++ by the TUs or by the number of beacons. The device may not be able to comply with
++ the request (e.g., if the beacon interval is greater than the requested listen interval, the
++ device sets the listen interval to the beacon interval). The actual listen interval used
++ by the device is available in the “CONNECT” event.
++
++Command
++ wmiconfig eth1 --listen=<#of TUs, can range from 15 to 3000>
++
++ --listenbeacons=<#of beacons, can range from 1 to 50>
++
++Command Parameters
++ UINT16 listenInterval
++ Specifies the listen interval in Kms
++ (1024 ms), ranging from 100 to 1000
++
++ UINT16 listenbeacons
++ Specifies the listen interval in beacons,
++ ranging from 1 to 50
++
++Command Values
++ None
++
++Reset Values
++ The device sets the listen interval equal to the beacon interval of the AP it associates
++ to.
++
++Restrictions
++ None
++
++=====================================================================
++
++
++Name
++ SET_LPREAMBLE
++
++Synopsis
++ Overrides the short preamble capability of the AR6000 device
++
++Command
++ TBD
++
++Command Parameters
++ WMI_LPREAMBLE_DISABLED
++ The device is short-preamble capable
++
++ WMI_LPREAMBLE_ENABLED
++ The device supports only the long-
++ preamble mode
++
++Command Values
++ None
++
++Reset Value
++ None defined
++
++Restrictions
++ None
++
++
++=====================================================================
++
++Name
++ SET_MAX_SP_LEN
++
++Synopsis
++ Set the maximum service period; indicates the number of packets the AR6001 can
++ receive from the AP when triggered
++
++Command
++ wmiconfig eth1 --setMaxSPLength <maxSPLen>
++
++Command Parameters
++ UINT8 maxSPLen
++ An APSD_SP_LEN_TYPE value
++
++Command Values
++ {
++ DELIVER_ALL_PKT = 0x0
++ DELIVER_2_PKT = 0x1
++ DELIVER_4_PKT = 0x2
++ DELIVER_6_PKT = 0x3
++ }APSD_SP_LEN_TYPE
++
++
++Reset Values
++ maxSPLen is DELIVER_ALL_PKT
++
++Restrictions
++ None
++
++=====================================================================
++
++
++Name
++ SET_OPT_MODE
++
++Synopsis
++ Special feature, sets the special mode on/off
++
++Command
++ wmiconfig eth1 --mode <mode>
++ Set the optional mode, where mode is special or off
++
++Command Parameters
++ enum {
++ SPECIAL_OFF
++ SPECIAL_ON
++ } OPT_MODE_TYPE;
++
++Command Values
++
++Reset Value
++ Mode = Off
++
++Restrictions
++ None
++
++=====================================================================
++
++
++Name
++ SET_PMKID
++
++Synopsis
++ The host uses this command to enable or disable a pairwise master key ID (PMKID)
++ in the AR6000 PMKID cache. The AR6000 clears its PMKID cache on receipt of a
++ DISCONNECT command from the host. Individual entries in the cache might be
++ deleted as the AR6000 detect new APs and decides to remove old ones.
++
++Command
++ wmiconfig eth1 --setbsspmkid --bssid=<aabbccddeeff>
++ --bsspmkid=<pmkid>
++
++Command Parameters
++ UINT8 bssid[6]
++ The MAC address of the AP that the
++ PMKID corresponds to (6 bytes in hex
++ format)
++
++ UINT8 enable
++ Either PMKID_DISABLE (0) to disable
++ the PMKID or PMKID_ENABLE (1) to
++ enable it (16 bytes in hex format)
++
++ UINT8 pmkid[16]
++ Meaningful only if enable is
++ PMKID_ENABLE, when it is the PMKID
++ that the AR6000 should use on the next
++ reassociation with the specified AP
++
++Command Values
++ enable
++ = 0 (disable), 1 (enable)
++ PKMID enabled/disabled
++
++Reset Values
++ None defined
++
++Restrictions
++ Only supported in infrastructure networks
++
++=====================================================================
++
++
++Name
++ SET_PMKID_LIST_CMD
++
++Synopsis
++ Configures the list of PMKIDs on the firmware.
++
++Command
++ wmiconfig --setpmkidlist --numpmkid=<n> --pmkid=<pmkid_1>
++ ... --pmkid=<pmkid_n>
++
++ Where n is the number of pmkids (maximum = 8) and pmkid_i is the ith pmkid (16
++ bytes in hex format)
++
++Command Parameters
++ {
++ A_UINT8 pmkid[WMI_PMKID_LEN];
++ } __ATTRIB_PACK WMI_PMKID;
++
++ {
++ A_UINT32 numPMKID;
++ WMI_PMKID pmkidList[WMI_MAX_PMKID_CACHE];
++ } __ATTRIB_PACK WMI_SET_PMKID_LIST_CMD;
++
++Command Values
++ None
++
++Reset Values
++ None
++
++Restrictions
++ Supported only in infrastructure modes
++
++=====================================================================
++
++
++Name
++ SET_POWER_MODE
++
++Synopsis
++ The host uses this command to provide the AR6000 device with guidelines on the
++ desired trade-off between power utilization and performance.
++
++ In normal power mode, the device enters a sleep state if they have nothing to do,
++ which conserves power but may cost performance as it can take up to 2 ms to
++ resume operation after leaving sleep state.
++
++ In maximum performance mode, the device never enters sleep state, thus no time
++ is spent waking up, resulting in higher power consumption and better
++ performance.
++
++Command
++ TBD
++
++Command Parameters
++ UINT8 powerMode
++ WMI_POWER_MODE value
++ {
++ REC_POWER = 1
++ (Recommended setting) Tries to conserve
++ power without sacrificing performance
++ MAX_PERF_POWER = 2
++ Setting that maximizes performance at
++ the expense of power
++
++ All other values are reserved
++ } WMI_POWER_MODE
++
++Command Values
++ See command parameters
++
++Reset Values
++ powerMode is REC_POWER
++
++Restrictions
++ This command should only be issued in the DISCONNECTED state for the
++ infrastructure network.
++
++ For a PM-disabled ad hoc network, the power mode should remain in
++ MAX_PERF_POWER.
++
++ For a PM-enabled ad hoc network, the device can have REC_POWER or
++ MAX_PERF_POWER set, but either way it must follow the power save ad hoc
++ protocol. The host can change power modes in the CONNECTED state.
++
++ Host changes to the PS setting when the STA is off the home channel take no effect
++ and cause a TARGET_PM_FAIL event.
++
++=====================================================================
++
++
++Name
++ SET_POWER_PARAMS
++
++Synopsis
++ The host uses this command to configure power parameters
++
++Command
++ wmiconfig eth1 --pmparams --it=<ms> --np=<number of PS POLL>
++ --dp=<DTIM policy: ignore/normal/stick>
++
++Command Parameters
++ UINT16 idle_period
++ Length of time (in ms) the AR6000 device
++ remains awake after frame Rx/Tx before going
++ to SLEEP state
++
++ UINT16 pspoll_number
++ The number of PowerSavePoll (PS-poll)
++ messages the device should send before
++ notifying the AP it is awake
++
++ UINT16 dtim_policy
++ A WMI_POWER_PARAMS_CMD value
++
++ {
++ IGNORE_DTIM =1
++ The device does not listen to any content after
++ beacon (CAB) traffic
++ NORMAL_DTIM = 2
++ DTIM period follows the listen interval (e.g., if
++ the listen interval is 4 and the DTIM period is 2,
++ the device wakes up every fourth beacon)
++ STICK_DTIM = 3
++ Device attempt to receive all CAB traffic (e.g., if
++ the DTIM period is 2 and the listen interval is 4,
++ the device wakes up every second beacon)
++ } WMI_POWER_PARAMS_CMD
++
++Command Parameters
++ See command parameters
++
++Reset Values
++ idle_period
++ 200 ms
++
++ pspoll_number
++ = 1
++
++ dtim_policy
++ = NORMAL_DTIM
++
++Restrictions
++ None
++
++=====================================================================
++
++
++Name
++ SET_POWERSAVE_PARAMS
++
++Synopsis
++ Set the two AR6000 power save timers (PS-POLL timer and APSD trigger timer) and
++ the two ASPD TIM policies
++
++Command
++ wmiconfig eth1--psparams --psPollTimer=<psPollTimeout in ms>
++ --triggerTimer=<triggerTimeout in ms> --apsdTimPolicy=<ignore/
++ adhere> --simulatedAPSDTimPolicy=<ignore/adhere>
++
++Command Parameters
++ typedef struct {
++ A_UINT16 psPollTimeout;
++ Timeout (in ms) after sending PS-POLL; the
++ AR6000 device sleeps if it does not receive a
++ data packet from the AP
++
++ A_UINT16 triggerTimeout;
++ Timeout (in ms) after sending a trigger; the
++ device sleeps if it does not receive any data
++ or null frame from the AP
++
++ APSD_TIM_POLICY apsdTimPolicy;
++ TIM behavior with queue APSD enabled
++
++ APSD_TIM_POLICY simulatedAPSD
++
++ TimPolicy;
++ TIM behavior with simulated APSD
++ enabled
++
++ typedef enum {
++ IGNORE_TIM_ALL_QUEUES_APSD = 0,
++ PROCESS_TIM_ALL_QUEUES_APSD = 1,
++ IGNORE_TIM_SIMULATED_APSD = 2,
++ POWERSAVE_TIMERS_POLICY = 3,
++ } APSD_TIM_POLICY;
++
++Command Values
++ None
++
++Reset Values
++ psPollTimeout is 50 ms; triggerTimeout is 10 ms;
++ apsdTimPolicy = IGNORE_TIM_ALL_QUEUES_APSD;
++ simulatedAPSDTimPolicy = POWERSAVE_TIMERS_POLICY
++
++Restrictions
++ When this command is used, all parameters must be set; this command does not
++ allow setting only one parameter.
++
++=====================================================================
++
++
++Name
++ SET_PROBED_SSID
++
++Synopsis
++ The host uses this command to provide a list of up to MAX_PROBED_SSID_INDEX
++ (six) SSIDs that the AR6000 device should actively look for. It lists the active SSID
++ table. By default, the device actively looks for only the SSID specified in the
++ “CONNECT_CMD” command, and only when the regulatory domain allows active
++ probing. With this command, specified SSIDs are probed for, even if they are hidden.
++
++Command
++ wmiconfig eth1 --ssid=<ssid> [--num=<index>]
++
++Command Parameters
++ {
++ A_UINT8 numSsids
++ A number from 0 to
++ MAX_PROBED_SSID_INDEX indicating
++ the active SSID table entry index for this
++ command (if the specified entry index
++ already has an SSID, the SSID specified in
++ this command replaces it)
++
++ WMI_PROBED_SSID_INFO probedSSID[1]
++ } WMI_PROBED_SSID_CMD
++
++ {
++ A_UINT8 flag
++ WMI_SSID_FLAG indicates the current
++ entry in the active SSID table
++ A_UINT8 ssidLength
++ Length of the specified SSID in bytes.
++ If = 0, the entry corresponding to the
++ index is erased
++ A_UINT8 ssid[32]
++ SSID string actively probed for when
++ permitted by the regulatory domain
++ } WMI_PROBED_SSID_INFO
++
++Command Values
++ WMI_SSID_FLAG
++ {
++ DISABLE_SSID_FLAG = 0
++ Disables entry
++ SPECIFIC_SSID_FLAG = 1
++ Probes specified SSID
++ ANY_SSID_FLAG = 2
++ Probes for any SSID
++ } WMI_SSID_FLAG
++
++Reset Value
++ The entries are unused.
++
++Restrictions
++ None
++
++=====================================================================
++
++
++Name
++ SET_REASSOC_MODE
++
++Synopsis
++ Specify whether the disassociated frame should be sent or not upon reassociation.
++
++Command
++ wmiconfig eth1 --setreassocmode <mode>
++
++Command Parameters
++ UINT8 mode
++
++Command Values
++ mode
++ = 0x00
++ Send disassoc to a previously connected AP
++ upon reassociation
++ = 0x01
++ Do not send disassoc to previously connected
++ AP upon reassociation
++
++Reset Values
++ None defined
++
++Restrictions
++ None
++
++
++=====================================================================
++
++Name
++ SET_RETRY_LIMITS
++
++Synopsis
++ Allows the host to influence the number of times that the AR6000 device should
++ attempt to send a frame before they give up.
++
++Command
++ wmiconfig --setretrylimits <frameType> <trafficClass> <maxRetries>
++ <enableNotify>
++
++Command Parameters
++ {
++ UINT8 frameType
++ A WMI_FRAMETYPE specifying
++ which type of frame is of interest.
++ UINT8 trafficClass
++ Specifies a traffic class (see
++ “CREATE_PSTREAM”). This
++ parameter is only significant when
++ frameType = DATA_FRAMETYPE.
++ UINT8 maxRetries
++ Maximum number of times the
++ device attempts to retry a frame Tx,
++ ranging from WMI_MIN_RETRIES
++ (2) to WMI_MAX_RETRIES (15). If
++ the special value 0 is used,
++ maxRetries is set to 15.
++ A_UINT8 enableNotify
++ Notify when enabled
++ } WMI_RETRY_LIMIT_INFO
++
++ {
++ A_UINT8 numEntries
++ WMI_RETRY_LIMIT_INFO retryLimitInfo[1]
++ } WMI_SET_RETRY_LIMITS_CMD
++
++Command Values
++ {
++ MGMT_FRAMETYPE = 0 Management frame
++ CONTROL_FRAMETYPE = 1 Control frame
++ DATA_FRAMETYPE = 2 Data frame
++ } WMI_FRAMETYPE
++
++Reset Values
++ Retries are set to 15
++
++Restrictions
++ None
++
++=====================================================================
++
++
++Name
++ SET_ROAM_CTRL
++
++Synopsis
++ Affects how the AR6000 device selects a BSS. The host uses this command to set and
++ enable low RSSI scan parameters. The time period of low RSSI background scan is
++ mentioned in scan period. Low RSSI scan is triggered when the current RSSI
++ threshold (75% of current RSSI) is equal to or less than scan threshold.
++
++ Low RSSI roam is triggered when the current RSSI threshold falls below the roam
++ threshold and roams to a better AP by the end of the scan cycle. During Low RSSI
++ roam, if the STA finds a new AP with an RSSI greater than roam RSSI to floor, during
++ scan, it roams immediately to it instead of waiting for the end of the scan cycle. See
++ also “Scan and Roam” on page C-1.
++
++Command
++ wmiconfig --roam <roamctrl> <info>, where info is <scan period>
++ <scan threshold> <roam threshold> <roam rssi floor>
++
++Command Parameters
++ A_UINT8 roamCtrlType;
++
++Command Values
++ WMI_FORCE_ROAM = 1
++ Roam to the specified BSSID
++
++ WMI_SET_ROAM_MODE = 2
++ Default, progd bias, no roam
++
++ WMI_SET_HOST_BIAS = 3
++ Set the host bias
++
++ WMI_SET_LOWRSSI_SCAN_PARAMS = 4
++ Info parameters
++
++ A_UINT8 bssid[ATH_MAC_LEN];
++ WMI_FORCE_ROAM
++
++ A_UINT8 roamMode;
++ WMI_SET_ROAM_MODE
++
++ A_UINT8 bssBiasInfo;
++ WMI_SET_HOST_BIAS
++
++ A_UINT16 lowrssi_scan_period;
++ WMI_SET_LOWRSSI_SCAN_PARAMS
++
++ A_INT16
++ lowrssi_scan_threshold;
++ WMI_SET_LOWRSSI_SCAN_PARAMS
++
++ A_INT16 lowrssi_roam_threshold;
++ WMI_SET_LOWRSSI_SCAN_PARAMS
++
++ A_UINT8 roam_rssi_floor;
++ WMI_SET_LOWRSSI_SCAN_PARAMS
++
++Reset Value
++ None defined (default lowrssi scan is disabled. Enabled only when scan period is set.)
++
++Restrictions
++ None
++
++=====================================================================
++
++
++Name
++ SET_RTS
++
++Synopsis
++ Decides when RTS should be sent.
++
++Command
++ wmiconfig eth1 --setRTS <pkt length threshold>
++
++Command Parameters
++ A_UINT16
++ threshold;
++ Command parameter threshold in bytes. An RTS is
++ sent if the data length is more than this threshold.
++ The default is to NOT send RTS.
++
++Command Values
++ None
++
++Reset Value
++ Not to send RTS.
++
++Restrictions
++ None
++
++
++=====================================================================
++
++Name
++ SET_SCAN_PARAMS
++
++Synopsis
++ The host uses this command to set the AR6000 scan parameters, including the duty
++ cycle for both foreground and background scanning. Foreground scanning takes
++ place when the AR6000 device is not connected, and discovers all available wireless
++ networks to find the best BSS to join. Background scanning takes place when the
++ device is already connected to a network and scans for potential roaming candidates
++ and maintains them in order of best to worst. A second priority of background
++ scanning is to find new wireless networks.
++
++ The device initiates a scan when necessary. For example, a foreground scan is always
++ started on receipt of a “CONNECT_CMD” command or when the device cannot find
++ a BSS to connect to. Foreground scanning is disabled by default until receipt of a
++ CONNECT command. Background scanning is enabled by default and occurs every
++ 60 seconds after the device is connected.
++
++ The device implements a binary backoff interval for foreground scanning when it
++ enters the DISCONNECTED state after losing connectivity with an AP or when a
++ CONNECT command is received. The first interval is ForegroundScanStartPeriod,
++ which doubles after each scan until the interval reaches ForegroundScanEndPeriod.
++ If the host terminates a connection with DISCONNECT, the foreground scan period
++ is ForegroundScanEndPeriod. All scan intervals are measured from the time a full
++ scan ends to the time the next full scan starts. The host starts a scan by issuing a
++ “START_SCAN” command. See also “Scan and Roam” on page C-1.
++
++Command
++ wmiconfig eth1 --scan --fgstart=<sec> --fgend=<sec> --bg=<sec> --
++ act=<msec> --pas=<msec> --sr=<short scan ratio> --scanctrlflags
++ <connScan> <scanConnected> <activeScan> <reportBSSINFO>
++
++Command Parameters
++ UINT16 fgStartPeriod
++ First interval used by the device when it
++ disconnects from an AP or receives a
++ CONNECT command, specified in seconds (0–
++ 65535). If = 0, the device uses the reset value.
++ If = 65535, the device disables foreground
++ scanning.
++
++ UINT16 fgEndPeriod
++ The maximum interval the device waits between
++ foreground scans specified in seconds (from
++ ForegroundScanStartPeriod to 65535). If = 0, the
++ device uses the reset value.
++
++ UINT16 bgScanPeriod
++ The period of background scan specified in
++ seconds (0–65535). By default, it is set to the reset
++ value of 60 seconds. If 0 or 65535 is specified, the
++ device disables background scanning.
++
++ UINT16 maxactChDwellTime
++ The period of time the device stays on a
++ particular channel while active scanning. It is
++ specified in ms (10–65535). If the special value of
++ 0 is specified, the device uses the reset value.
++
++ UINT16 PasChDwellTime
++ The period of time the device remains on a
++ particular channel while passive scanning. It is
++ specified in ms (10–65535). If the special value of
++ 0 is specified, the device uses the reset value.
++
++ UINT8 shortScanRatio
++ Number of short scans to perform for each
++ long scan.
++
++ UINT8 scanCtrlFlasgs
++
++ UINT16 minactChDwellTime
++ Specified in ms
++
++ UINT32 maxDFSchActTime
++ The maximum time a DFS channel can stay
++ active before being marked passive, specified in
++ ms.
++
++Command Values
++ None
++
++Reset Values
++ ForegroundScanStart
++Period
++ 1 sec
++
++ ForegroundScanEndPeriod
++ 60 sec
++
++ BackgroundScanPeriod
++ 60 sec
++
++ ActiveChannelDwellTime
++ 105 ms
++
++=====================================================================
++
++
++Name
++ SET_TKIP_COUNTERMEASURES
++
++Synopsis
++ The host issues this command to tell the target whether to enable or disable TKIP
++ countermeasures.
++
++Command
++ TBD
++
++Command Parameters
++ UINT8 WMI_TKIP_CM_ENABLE
++ Enables the countermeasures
++
++
++ UINT8 TKIP_CM_DISABLE
++ Disables the countermeasures
++
++Command Values
++ None
++
++Reset Values
++ By default, TKIP MIC reporting is disabled
++
++Restrictions
++ None
++
++=====================================================================
++
++
++Name
++ SET_TX_PWR
++
++Synopsis
++ The host uses this command to specify the Tx power level of the AR6000. Cannot be
++ used to exceed the power limit permitted by the regulatory domain. The maximum
++ output power is limited in the chip to 31.5 dBm; the range is 0 – 31.5 dbm.
++
++Command
++ wmiconfig --power <dbM>
++
++Command Parameters
++ UINT8 dbM
++ The desired Tx power specified in dbM.
++ If = 0, the device chooses the maximum
++ permitted by the regulatory domain.
++
++Command Values
++ None
++
++Reset Values
++ The maximum permitted by the regulatory domain
++
++Restrictions
++ None
++
++See Also
++ “GET_TX_PWR”
++
++
++=====================================================================
++
++Name
++ SET_VOICE_PKT_SIZE
++
++Synopsis
++ If an AP does not support WMM, it has no way to differentiate voice from data.
++ Because the voice packet is typically small, packet in size less than voicePktSize are
++ assumed to be voice, otherwise it is treated as data.
++
++Command
++ wmiconfig eth1 --setVoicePktSize <size-in-bytes>
++
++Command Parameters
++ UINT16 voicePktSize
++ Packet size in octets
++
++Command Values
++ None
++
++Reset Values
++ voicePktSize default is 400 bytes
++
++Restrictions
++ No effect if WMM is unavailable
++
++
++=====================================================================
++
++Name
++ SET_WMM
++
++Synopsis
++ Overrides the AR6000 device WMM capability
++
++Command
++ wmiconfig eth1 --setwmm <enable>
++
++Command Parameters
++ WMI_WMM_ENABLED
++ Enables WMM
++
++ WMI_WMM_DISABLED
++ Disables WMM support
++
++Command Values
++ 0 = disabled
++ 1 = enabled
++
++Reset Value
++ WMM Disabled
++
++Restrictions
++ None
++
++
++=====================================================================
++
++Name
++ SET_WMM_TXOP
++
++Synopsis
++ Configures TxOP Bursting when sending traffic to a WMM capable AP
++
++Command
++ wmiconfig eth1 --txopbursting <burstEnable>
++
++ <burstEnable>
++ = 0
++ Disallow TxOp bursting
++
++ = 1
++ Allow TxOp bursting
++
++Command Parameters
++ txopEnable
++ = WMI_TXOP_DISABLED
++ Disabled
++
++ = WMI_TXOP_ENABLED
++ Enabled
++
++Command Values
++ txopEnable
++ = 0 Disabled
++
++ = 1 Enabled
++
++Reset Value
++ Bursting is off by default
++
++Restrictions
++ None
++
++=====================================================================
++
++
++Name
++ SET_WOW_MODE
++
++Synopsis
++ The host uses this command to enable or disable the WoW mode. When WoW mode
++ is enabled and the host is asleep, pattern matching takes place at the target level.
++ Only packets that match any of the pre-specified WoW filter patterns, will be passed
++ up to the host. The host will also be woken up by the target. Packets which do not
++ match any of the WoW patterns are discarded.
++
++Command
++ wmiconfig –setwowmode <enable/disable>
++
++Command Parameters
++ A_BOOL enable_wow
++ Enable or disable WoW:
++
++Command Values
++ = 0
++ Disable WoW
++
++ = 1
++ Enable WoW
++
++Reset Value
++ None defined (default WoW mode is disabled).
++
++Restrictions
++ None
++
++See Also
++ “GET_WOW_LIST”
++
++
++=====================================================================
++
++Name
++ SET_WSC_STATUS
++
++Synopsis
++ The supplicant uses this command to inform the target about the status of the WSC
++ registration protocol. During the WSC registration protocol, a flag is set so the target
++ bypasses some of the checks in the CSERV module. At the end of the registration, this
++ flag is reset.
++
++Command
++ N/A
++
++Command Parameters
++ A_BOOL status
++ = 1 WSC registration in progress
++ = 0 WSC protocol not running
++
++Reply Parameters
++ None
++
++Reset Value
++ None defined (default = 0)
++
++Restrictions
++ None
++
++
++=====================================================================
++
++Name
++ SNR_THRESHOLD_PARAMS
++
++Synopsis
++ Configures how the AR6000 device monitors and reports SNR of the connected BSS,
++ used as a link quality metric.
++
++Command
++ --snrThreshold <weight> <upper_threshold_1> ...
++ <upper_threshold_4> <lower_threshold_1> ... <lower_threshold_4>
++ <pollTimer>
++
++Command Parameters
++ <weight>
++ Share with rssiThreshold. Range in [1, 16], used
++ in the formula to calculate average RSSI
++
++ <upper_threshold_x>
++ Above thresholds expressed in db, in ascending
++ order
++
++ <lower_threshold_x>
++ Below thresholds expressed in db, in ascending
++ order
++
++ <pollTimer>
++ The signal strength sampling frequency in
++ seconds. If polltime = 0, signal strength
++ sampling is disabled
++
++Command Values
++ None
++
++Reset Value
++ None defined
++
++Restrictions
++ None
++
++=====================================================================
++
++
++Name
++ START_SCAN
++
++Synopsis
++ The host uses this command to start a long or short channel scan. All future scans are
++ relative to the time the AR6000 device processes this command. The device performs
++ a channel scan on receipt of this command, even if a scan was already in progress.
++ The host uses this command when it wishes to refresh its cached database of wireless
++ networks. The isLegacy field will be removed (0 for now) because it is achieved by
++ setting CONNECT_PROFILE_MATCH_DONE in the CONNECT command. See also
++ “Scan and Roam”
++
++Command
++ wmiconfig eth1 --startscan <scan type> <forcefgscan> 0
++ <homeDwellTime> <forceScanInterval>
++
++Command Parameters
++ UINT8 scanType
++ WMI_SCAN_TYPE
++
++Command Values
++ {
++ WMI_LONG_SCAN =0x0
++ Requests a full scan
++ WMI_SHORT_SCAN =0x1
++ Requests a short scan
++ } WMI_SCAN_TYPE
++
++ A_BOOL forceFgScan
++ forceFgScan
++ = 0
++ Disable the foreground scan
++
++ forceFgScan
++ = 1
++ Forces a foreground scan
++
++ A_UINT32 homeDwellTime
++ Maximum duration in the home
++ channel (in ms)
++
++ A_UINT32 forceScanInterval
++ Time interval between scans (in ms)
++
++ A_UINT32 scanType
++ WMI_SCAN_TYPE
++
++Reset Value
++ Disable forcing foreground scan
++
++Restrictions
++ isLegacy field will no longer be supported (pass as 0 for now)
++
++
++=====================================================================
++
++Name
++ SYNCHRONIZE
++
++Synopsis
++ The host uses this command to force a synchronization point between the command
++ and data paths
++
++Command
++ TBD
++
++Command Parameters
++ None
++
++
++
++Command Values
++ None
++
++
++
++Reset Values
++ None
++
++
++
++Restrictions
++ None
++
++
++=====================================================================
++
++Name
++ TARGET_ERROR_REPORT_BITMASK
++
++Synopsis
++ Allows the host to control “ERROR_REPORT” events from the AR6000 device.
++
++ If error reporting is disabled for an error type, a count of errors of that type is
++ maintained by the device.
++
++ If error reporting is enabled for an error type, an “ERROR_REPORT” event is
++ sent when an error occurs and the error report bit is cleared.
++
++ Error counts for each error type are available through the “GET_TARGET_STATS”
++ command.
++
++Command
++ wmiconfig eth1 --setErrorReportingBitmask
++
++Command Parameters
++ UINT32 bitmask
++ Represents the set of
++ WMI_TARGET_ERROR_VAL error types
++ enabled for reporting
++
++Command Values
++ {
++ WMI_TARGET_PM_ERR_FAIL = 0x00000001
++ Power save fails (only two cases):
++ Retry out of null function/QoS null
++ function to associated AP for PS
++ indication'
++ Host changes the PS setting when
++ STA is off home channel
++
++ WMI_TARGET_KEY_NOT_FOUND = 0x00000002
++ No cipher key
++ WMI_TARGET_DECRYPTION_ERR = 0x00000004
++ Decryption error
++ WMI_TARGET_BMISS = 0x00000008
++ Beacon miss
++ WMI_PSDISABLE_NODE_JOIN = 0x00000010
++ A non-PS-enabled STA joined the
++ PS-enabled network
++ WMI_TARGET_COM_ERR = 0x00000020
++ Host/target communication error
++ WMI_TARGET_FATAL_ERR = 0x00000040
++ Fatal error
++ } WMI_TARGET_ERROR_VAL
++
++Reset Values
++ Bitmask is 0, and all error reporting is disabled
++
++Restrictions
++ None
++
++
++=====================================================================
++WMI Events
++
++Event
++ Description
++ Page
++
++
++BSSINFO
++ Contains information describing BSSs collected during a scan
++
++CAC_EVENTID
++ Indicates signalling events in admission control
++
++CMDERROR
++ The AR6000 device encounters an error while attempting to process
++ a command
++
++CONNECT
++ The device has connected to a wireless network
++
++DISCONNECT
++ The device lost connectivity with a wireless network
++
++ERROR_REPORT
++ An error has occurred for which the host previously requested
++ notification with the command
++ “TARGET_ERROR_REPORT_BITMASK”
++
++EXTENSION
++ WMI extension event
++
++GET_PMKID_LIST_EVENT
++ Created in response to a “GET_PMKID_LIST_CMD” command
++
++GET_WOW_LIST_EVENT
++ Response to the wmiconfig “GET_WOW_LIST” command to
++ retrieve the configured WoW patterns
++
++NEIGHBOR_REPORT
++ Neighbor APs that match the current profile were detected
++
++OPT_RX_FRAME_EVENT
++ (Special feature) informs the host of the reception of a special frame
++
++PSTREAM_TIMEOUT
++ A prioritized stream has been idle for a specified interval
++
++READY
++ The AR6000 device is ready to accept commands
++
++REGDOMAIN
++ The regulatory domain has changed
++
++REPORT_ROAM_DATA_EVENT
++ Reports the roam time calculations made by the device
++ (generated with a special build)
++ —
++
++REPORT_STATISTICS
++ Reply to a “GET_TARGET_STATS” command
++
++ROAM_TBL_EVENT
++ Reports the roam table
++
++RSSI_THRESHOLD
++ Signal strength from the connected AP has crossed the threshold
++ defined in the “RSSI_THRESHOLD_PARAMS” command
++
++SCAN_COMPLETE_EVENT
++ A scan has completed (added status SCAN_ABORTED in release 2.0)
++
++TEST_EVENT
++ Event generated by the TCMD
++
++TKIP_MICERROR
++ TKIP MIC errors were detected
++
++=====================================================================
++
++Name
++ BSSINFO
++
++Synopsis
++ Contains information describing one or more BSSs as collected during a scan.
++ Information includes the BSSID, SSID, RSSI, network type, channel, supported rates,
++ and IEs. BSSINFO events are sent only after the device receives a beacon or probe-
++ response frame that pass the filter specified in the “SET_BSS_FILTER” command.
++ BSSINFO events consist of a small header followed by a copy of the beacon or probe
++ response frame. The 802.11 header is not present. For formats of beacon and probe-
++ response frames please consult the IEEE 802.11 specification.
++
++ The beacons or probe responses containing the IE specified by the
++ WMI_BSS_FILTER_CMD are passed to the host through the
++ WMI_BSSINFO_EVENT. The event carries a 32-bit bitmask that indicates the IEs that
++ were detected in the management frame. The frame type field has been extended to
++ indicate action management frames. This would be helpful to route these frames
++ through the same event mechanism as used by the beacon processing function.
++
++ If the bssFilter in the SET_BSS_FILTER matches, then the ieMask is not relevant
++ because the BSSINFO event is sent to the host. If the bssFilter doesnot match in the
++ beacons/probe respones, then the ieMask match dictates whether the BSSINFO
++ event is sent to the host. In the case of action management frames, the ieMask is the
++ filter that is applied.
++
++Event ID
++ 0x1004
++
++Event Parameters
++ typedef struct {
++ A_UINT16 channel;
++ Specifies the frequency (in MHz) where the
++ frame was received
++ A_UINT8 frameType;
++ A WMI_BI_FTYPE value
++ A_UINT8 snr;
++ A_INT16 rssi;
++ Indicates signal strength
++ A_UINT8 bssid[ATH_MAC_LEN];
++ A_UINT32 ieMask;
++ } _ATTRIB_PACK_WMI_BSS_INFO_HDR;
++
++ Beacon or Probe Response Frame
++
++Event Values
++ {
++ BEACON_FTYPE = 0x1
++ Indicates a beacon frame
++ PROBERESP_FTYPE
++ Indicates a probe response frame
++ ACTION_MGMT_FTYPE
++ } WMI_BI_FTYPE
++
++=====================================================================
++
++Name
++ CAC_EVENTID
++
++Synopsis
++ Indicates signalling events in admission control. Events are generated when
++ admission is accepted, rejected, or deleted by either the host or the AP. If the AP does
++ not respond to an admission request within a timeout of 500 ms, an event is
++ generated to the host.
++
++Event ID
++ 0x1011
++
++Event Parameters
++ UINT8
++ ac
++ Access class pertaining to the
++signalling
++
++ UINT8 cac_indication
++ Type of indication; indications are
++ listed in WMI_CAC_INDICATION
++
++ UINT8 statusCode
++ AP response status code for a
++ request
++
++ UINT8 tspecSuggestion[63]
++ Suggested TSPEC from AP
++
++Event Values
++ {
++ CAC_INDICATION_ADMISSION = 0x00
++ CAC_INDICATION_ADMISSION_RESP = 0x01
++ CAC_INDICATION_DELETE = 0x02
++ CAC_INDICATION_NO_RESP = 0x03
++ } WMI_CAC_INDICATION
++
++
++=====================================================================
++
++
++Name
++ CMDERROR
++
++Synopsis
++ Indicates that the AR6000 device encountered an error while attempting to process a
++ command. This error is fatal and indicates that the device requires a reset.
++
++Event ID
++ 0x1005
++
++Event Parameters
++ UINT16 commandId
++ Corresponds to the command which generated
++ the error
++ UINT8 errorCode
++ A WMI_ERROR_CODE value
++
++Event Values
++ {
++ INVALID_PARAM = 1
++ Invalid parameter
++ ILLEGAL_STATE = 2
++ Illegal state
++ INTERNAL_ERROR = 3
++ Internal Error
++ All other values reserved
++ } WMI_ERROR_CODE
++
++
++=====================================================================
++
++
++Name
++ CONNECT
++
++Synopsis
++ Signals that the AR6000 connected to a wireless network. Connection occurs due to a
++ “CONNECT” command or roaming to a new AP. For infrastructure networks, shows
++ that the AR6000 successfully performed 802.11 authentication and AP association.
++
++Event ID
++ 0x1002
++
++Event Parameters
++ UINT16 channel
++ Channel frequency (in MHz) of the network the
++ AR6000 are connected to
++
++ UINT8 bssid[6]
++ MAC address of the AP the AR6000 are
++ connected to or the BSSID of the ad hoc
++ network
++
++ UINT16 listenInterval
++ Listen interval (in Kms) that the AR6000 are
++ using
++
++ UINT 8 beaconIeLen
++ Length (in bytes) of the beacon IEs
++
++ UINT8 assocInfo
++ Pointer to an array containing beacon IEs,
++ followed first by association request IEs then by
++ association response IEs
++
++ UINT8 assocReqLen
++ Length (in bytes) of the assocReqIEs array
++
++ UINT8 assocRespLen
++ Length (in bytes) of the assocRespIEs array
++
++Event Values
++ None defined
++
++=====================================================================
++
++
++Name
++ DISCONNECT
++
++Synopsis
++ Signals that the AR6000 device lost connectivity with the wireless network.
++ DISCONENCT is generated when the device fails to complete a “CONNECT”
++ command or as a result of a transition from a connected state to disconnected state.
++
++ After sending the “DISCONNECT” event the device continually tries to re-establish
++ a connection. A LOST_LINK occurs when STA cannot receive beacons within the
++ specified time for the SET_BMISS_TIME command.
++
++Event ID
++ 0x1003
++
++Event Parameters
++ UINT8 disconnect
++ Reason
++ A WMI_DISCONNECT_REASON value
++
++ UINT8 bssid[6]
++ Indicates which BSS the device was connected to
++
++ UINT8 assocRespLen
++ Length of the 802.11 association response frame
++ that triggered this event, or 0 if not applicable
++
++ UINT8 assocInfo[assocRespLen]
++ Copy of the 802.11 association response frame
++
++Event Values
++ {
++ NO_NETWORK_AVAIL =0x01
++ Indicates that the device was unable to
++ establish or find the desired network
++ LOST_LINK =0x02
++ Indicates the devices is no longer receiving
++ beacons from the BSS it was previously
++ connected to
++
++ DISCONNECT_CMD =0x03
++ Indicates a “DISCONNECT” command was
++ processed
++ BSS_DISCONNECTED =0x04
++ Indicates the BSS explicitly disconnected the
++ device. Possible mechanisms include the AP
++ sending 802.11 management frames
++ (e.g., disassociate or deauthentication
++ messages).
++ AUTH_FAILED =0x05
++ Indicates that the device failed 802.11
++ authentication with the BSS
++ ASSOC_FAILED =0x06
++ Indicates that the device failed 802.11
++ association with the BSS
++ NO_RESOURCES_AVAIL =0x07
++ Indicates that a connection failed because the
++ AP had insufficient resources to complete the
++ connection
++ CSERV_DISCONNECT =0x08
++ Indicates that the device’s connection services
++ module decided to disconnect from a BSS,
++ which can happen for a variety of reasons (e.g.,
++ the host marks the current connected AP as a
++ bad AP).
++ INVALID_PROFILE =0x0A
++ Indicates that an attempt was made to
++ reconnect to a BSS that no longer matches the
++ current profile
++ All other values are reserved
++ } WMI_DISCONNECT_REASON
++
++
++=====================================================================
++
++
++Name
++ ERROR_REPORT
++
++Synopsis
++ Signals that a type of error has occurred for which the host previously requested
++ notification through the “TARGET_ERROR_REPORT_BITMASK” command.
++
++Event ID
++ 0x100D
++
++Event Parameters
++ UINT32 errorVal
++ WMI_TARGET_ERROR_VAL value. See
++ “TARGET_ERROR_REPORT_BITMASK”.
++
++Event Values
++ errorVal
++ = 0x00000001
++ Power save fails
++
++ = 0x00000002
++ No cipher key
++
++ = 0x00000004
++ Decryption error
++
++ = 0x00000008
++ Beacon miss
++
++ = 0x00000010
++ A non-power save disabled node has joined
++ the PS-enabled network
++
++
++=====================================================================
++
++
++Name
++ EXTENSION
++
++Synopsis
++ The WMI is used mostly for wireless control messages to a wireless module that
++ apply to wireless module management regardless of the target platform
++ implementation. However, some events peripherally related to wireless management
++ are desired during operation. These wireless extension events may be platform-
++ specific or implementation-dependent. See “WMI Extension Commands”
++
++
++Event ID
++ 0x1010
++
++
++=====================================================================
++
++
++Name
++ GET_PMKID_LIST_EVENT
++
++Synopsis
++ Generated by firmware in response to a “GET_PMKID_LIST_CMD” command.
++
++Event Parameters
++ typedef struct {
++ A_UINT32 numPMKID;
++ Contains the number of PMKIDs in the reply
++ WMI_PMKID pmkidList[1];
++ } __ATTRIB_PACK WMI_PMKID_LIST_REPLY;
++
++Event Values
++ None
++
++
++=====================================================================
++
++
++Name
++ GET_WOW_LIST_EVENT
++
++Synopsis
++ Response to the wmiconfig –getwowlist command to retrieve the configured Wake on
++ Wireless patterns
++
++Event ID
++ 0x10018
++
++Event Parameters
++ {
++
++ A_UINT8 num_filters
++ Total number of patterns in the list
++ A_UINT8 this_filter_num
++ The filter number
++ A_UINT8 wow_mode
++ Shows whether WoW is enabled or disabled
++ A_UINT8 host_mode
++ Shows whether the host is asleep or awake
++ WOW_FILTER wow_filters[1]
++ List of WoW filters (pattern and mask data bytes)
++ } WMI_GET_WOW_LIST_REPLY;
++
++ {
++ Each wow_filter_list element shows:
++ A_UINT8 wow_valid_filter
++ Whether the filter is valid
++ A_UINT8 wow_filter_list_id
++ Filter List ID (23 = default)
++ A_UINT8 wow_filter_size
++ Size in bytes of the filter
++ A_UINT8 wow_filter_offset
++ Offset of the pattern to search in the data packet
++ A_UINT8 wow_filter_mask[MASK_SIZE]
++ The mask to be applied to the pattern
++ A_UINT8 wow_filter_pattern[WOW_PATTERN_SIZE]
++ The pattern that to match to wake up the host
++ } WOW_FILTER
++
++Event Values
++ None
++
++=====================================================================
++
++
++
++Name
++ NEIGHBOR_REPORT
++
++Synopsis
++ Indicates the existence of neighbor APs that match the current profile. The host uses
++ this event to populate the PMKID cache on the AR6000 and/or to perform
++ preauthentication. This event is only generated in infrastructure mode.
++
++ A total of numberOfAps pairs of bssid/bssFlags exist, one pair for each AP.
++
++Event ID
++ 0x1008
++
++Event Parameters
++ UINT8 numberOfAps
++ The number of APs reported about in
++ this event
++ {
++ UINT8 bssid[6]
++ MAC address of a neighbor AP
++ UINT8 bssFlags
++ A WMI_BSS_FLAGS value
++ }[numberOfAps]
++
++
++Event Values
++ {
++ WMI_DEFAULT_BSS_FLAGS = 0
++ Logical OR of 1 or more
++ WMI_BSS_FLAGS
++ WMI_PREAUTH_CAPABLE_BSS
++ = 1
++ Indicates that this AP is capable of
++ preauthentication
++ WMI_PMKID_VALID_BSS
++ = 2
++ Indicates that the AR6000 have a
++ valid pairwise master key for this AP
++ } WMI_BSS_FLAGS
++
++
++=====================================================================
++
++
++
++Name
++ OPT_RX_FRAME_EVENT
++
++Synopsis
++ Special feature, informs host of the reception of a special frame.
++
++Event ID
++ 0x100E
++
++Event Parameters
++ {
++ A_UINT16 channel;
++ A_UINT8 frameType;
++ A_INT8 snr;
++ A_UINT8 srcAddr[ATH_MAC_LEN];
++ A_UINT8 bssid[ATH_MAC_LEN];
++ }WMI_OPT_RX_INFO_HDR
++
++Event Values
++ None
++
++=====================================================================
++
++
++
++Name
++ PSTREAM_TIMEOUT
++
++Synopsis
++ Indicates that a priority stream that got created as a result of priority-marked data
++ flow (priority marked in IP TOS) being idle for the default inactivity interval period
++ (specified in the “CREATE_PSTREAM” command) used for priority streams created
++ implicitly by the driver. This event is not indicated for user-created priority streams.
++ User-created priority streams exist until the users delete them explicitly. They do not
++ timeout due to data inactivity.
++
++Event ID
++ 0x1007
++
++Event Parameters
++ A_UINT8
++ trafficClass
++ Indicated the traffic class of priority
++ stream that timed out
++
++Event Values
++ {
++ WMM_AC_BE = 0
++ Best effort
++ WMM_AC_BK = 1
++ Background
++ WMM_AC_VI = 2
++ Video
++ WMM_AC_VO = 3
++ Voice
++ } TRAFFIC CLASS
++
++
++=====================================================================
++
++Name
++ READY
++
++Synopsis
++ Indicates that the AR6000 device is prepared to accept commands. It is sent once after
++ power on or reset. It also indicates the MAC address of the device.
++
++Event ID
++ 0x1001
++
++Event Parameters
++ UINT8 macAddr[6]
++ Device MAC address
++ UINT8 phyCapability
++ A WMI_PHY_CAPABILITY value. Indicates the
++ capabilities of the device wireless module’s radio
++
++Event Values
++ {
++ WMI_11A_CAPABILITY = 1
++ WMI_11G_CAPABILITY = 2
++ WMI_11AG_CAPABILITY = 3
++ } WMI_PHY_CAPABILITY
++
++
++=====================================================================
++
++Name
++ REGDOMAIN
++
++Synopsis
++ Indicates that the regulatory domain has changed. It initially occurs when the
++ AR6000 device reads the board data information. The regulatory domain can also
++ change when the device is a world-mode SKU. In this case, the regulatory domain is
++ based on the country advertised by APs per the IEEE 802.11d specification. A
++ potential side effect of a regulatory domain change is a change in the list of available
++ channels. Any channel restrictions that exist as a result of a previous
++ “SET_CHANNEL_PARAMETERS” command are lifted.
++
++Event ID
++ 0x1006
++
++Event Parameters
++ UINT32 regDomain
++ The range of 0x0000 – 0x00FF
++ corresponds to an ISO country code.
++
++ Other regCodes are reserved for world
++ mode settings and specific regulatory
++ domains.
++
++Event Values
++ None
++
++
++=====================================================================
++
++
++
++Name
++ REPORT_STATISTICS
++
++Synopsis
++ A reply to a “GET_TARGET_STATS” command.
++
++Event ID
++ 0x100B
++
++Event Parameters
++ When the statistics are sent to the host, the AR6001 clear them so that a new set of
++ statistics are collected for the next report.
++
++ UINT32 tx_packets
++ UINT32 tx_bytes
++ UINT32 tx_unicast_pkts
++ UINT32 tx_unicast_bytes
++ UINT32 tx_multicast_pkts
++ UINT32 tx_multicast_bytes
++ UINT32 tx_broadcast_pkts
++ UINT32 tx_broadcast_bytes
++ UINT32 tx_rts_success_cnt
++ UINT32 tx_packet_per_ac[4]
++ Tx packets per AC: [0] = BE, [1] = BK,
++ [2] = VI, [3] = VO
++ UINT32 tx_errors
++ Number of packets which failed Tx, due
++ to all failures
++ ... REPORT_STATISTICS, continued
++ UINT32 tx_failed_cnt
++ Number of data packets that failed Tx
++ UINT32 tx_retry_cnt
++ Number of Tx retries for all packets
++ UINT32 tx_rts_fail_cnt
++ Number of RTS Tx failed count
++ UINT32 rx_packets
++ UINT32 rx_bytes
++ UINT32 rx_unicast_pkts
++ UINT32 rx_unicast_bytes
++ UINT32 rx_multicast_pkts
++ UINT32 rx_multicast_bytes
++ UINT32 rx_broadcast_pkts
++ UINT32 rx_broadcast_bytes
++ UINT32 rx_fragment_pkt
++ Number of fragmented packets received
++ UINT32 rx_errors
++ Number of Rx errors due to all failures
++ UINT32 rx_crcerr
++ Number of Rx errors due to CRC errors
++ UINT32 rx_key_cache_miss
++ Number of Rx errors due to a key not
++ being plumbed
++ UINT32 rx_decrypt_err
++ Number of Rx errors due to decryption
++ failure
++ UINT32 rx_duplicate_frames
++ Number of duplicate frames received
++ UINT32 tkip_local_mic_failure
++ Number of TKIP MIC errors detected
++ UINT32 tkip_counter_measures_invoked
++ Number of times TKIP countermeasures
++ were invoked
++ UINT32 tkip_replays
++ Number of frames that replayed a TKIP
++ encrypted frame received earlier
++ UINT32 tkip_format_errors
++ Number of frames that did not conform
++ to the TKIP frame format
++ UINT32 ccmp_format_errors
++ Number of frames that did not conform
++ to the CCMP frame format
++ UINT32 ccmp_replays
++ Number of frames that replayed a CCMP
++ encrypted frame received earlier
++ UINT32 power_save_failure_cnt
++ Number of failures that occurred when
++ the AR6001 could not go to sleep
++ UINT32 cs_bmiss_cnt
++ Number of BMISS interrupts since
++ connection
++ UINT32 cs_lowRssi_cnt
++ Number of the times the RSSI went below
++ the low RSSI threshold
++ UINT16 cs_connect_cnt
++ Number of connection times
++ UINT16 cs_disconnect_cnt
++ Number of disconnection times
++ UINT8 cs_aveBeacon_rssi
++ The current averaged value of the RSSI
++ from the beacons of the connected BSS
++ UINT8 cs_lastRoam_msec
++ Time that the last roaming took, in ms.
++ This time is the difference between
++ roaming start and actual connection.
++
++Event Values
++ None defined
++
++
++=====================================================================
++
++Name
++ ROAM_TBL_EVENT
++
++Synopsis
++ Reports the roam table, which contains the current roam mode and this information
++ for every BSS:
++
++Event ID
++ 0x100F
++
++Event Parameters
++ A_UINT8 bssid[ATH_MAC_LEN];
++ BSSID
++ A_UINT8 rssi
++ Averaged RSSI
++ A_UINT8 rssidt
++ Change in RSSI
++ A_UINT8 last_rssi
++ Last recorded RSSI
++ A_UINT8 roam_util
++ Utility value used in roaming decision
++ A_UINT8 util
++ Base utility with the BSS
++ A_UINT8 bias
++ Host configured for this BSS
++
++Event Values
++ roamMode
++ Current roam mode
++
++ = 1
++ RSSI based roam
++
++ = 2
++ Host bias-based roam
++
++ = 3
++ Lock to the current BSS
++
++ = 4
++ Autonomous roaming disabled
++
++
++=====================================================================
++
++Name
++ RSSI_THRESHOLD
++
++Synopsis
++ Alerts the host that the signal strength from the connected AP has crossed a
++ interesting threshold as defined in a previous “RSSI_THRESHOLD_PARAMS”
++ command.
++
++Event ID
++ 0x100C
++
++Event Parameters
++ UINT8 range
++ A WMI_RSSI_THRESHOLD_VAL
++ value, which indicates the range of
++ the average signal strength
++
++Event Values
++ {
++ WMI_RSSI_LOWTHRESHOLD_BELOW_LOWERVAL = 1
++ WMI_RSSI_LOWTHRESHOLD_LOWERVAL = 2
++ WMI_RSSI_LOWTHRESHOLD_UPPERVAL = 3
++ WMI_RSSI_HIGHTHRESHOLD_LOWERVAL = 4
++ WMI_RSSI_HIGHTHRESHOLD_HIGHERVAL = 5
++ } WMI_RSSI_THRESHOLD_VAL
++
++
++=====================================================================
++
++Name
++ SCAN_COMPLETE_EVENT
++
++Synopsis
++ Indicates the scan status. if the Scan was not completed, this event is generated with
++ the status A_ECANCELED.
++
++Event ID
++ 0x100A
++
++Event Parameters
++ A_UINT8 scanStatus
++
++Event Values
++ {
++ #define SCAN_ABORTED 16
++ #define SCAN_COMPLETED 0
++ A_UINT8 scanStatus
++ A_OK or A_ECANCELED
++ } WMI_SCAN_COMPLETE_EVENT;
++
++
++=====================================================================
++
++Name
++ TEST_EVENT
++
++Synopsis
++ The TCMD application uses a single WMI event (WMI_TEST_EVENTID) to
++ communicate events from target to host. The events are parsed by the TCMD
++ application and WMI layer is oblivious of it.
++
++Event ID
++ 0x1016
++
++Event Parameters
++ WMI_TEST_EVENTID
++
++
++Event Values
++ None
++
++
++=====================================================================
++
++
++
++Name
++ TKIP_MICERR
++
++Synopsis
++ Indicates that TKIP MIC errors were detected.
++
++Event ID
++ 0x1009
++
++Event Parameters
++ UINT8 keyid
++ Indicates the TKIP key ID
++
++ UINT8 ismcast
++ 0 = Unicast
++ 1 = Multicast
++
++Event Values
++ See event parameters
++
++=====================================================================
++
++WMI Extension Commands
++
++The WMI EXTENSION command is used to multiplex a collection of
++commands that:
++
++ Are not generic wireless commands
++ May be implementation-specific
++ May be target platform-specific
++ May be optional for a host implementation
++
++ An extension command is sent to the AR6000 targets like any other WMI
++command message and uses the WMI_EXTENSION. The first field of the
++payload for this EXTENSION command is another commandId, sometimes
++called the subcommandId, which indicates which extension command is
++being used. A subcommandId-specific payload follows the subcommandId.
++
++All extensions (subcommandIds) are listed in the header file include/wmix.h.
++See also “WMI Extension Events” on page B-58.
++
++
++WMI Extension Commands
++
++
++GPIO_INPUT_GET
++ Read GPIO pins configured for input
++
++GPIO_INTR_ACK
++ Acknowledge and re-arm GPIO interrupts reported earlier
++
++GPIO_OUTPUT_SET
++ Manage output on GPIO pins configured for output
++
++GPIO_REGISTER_GET
++ Read an arbitrary GPIO register
++
++GPIO_REGISTER_SET
++ Dynamically change GPIO configuration
++
++SET_LQTHRESHOLD
++ Set link quality thresholds; the sampling happens at every unicast
++ data frame Tx, if certain thresholds are met, and corresponding
++ events are sent to the host
++
++
++=====================================================================
++
++Name
++ GPIO_INPUT_GET
++
++Synopsis
++ Allows the host to read GPIO pins that are configured for input. The values read are
++ returned through a “GPIO_DATA” extension event.
++
++NOTE: Support for GPIO is optional.
++
++Command
++ N/A
++
++Command Parameters
++ None
++
++
++
++Reply Parameters
++ None
++
++
++Reset Value
++ None
++
++
++
++Restrictions
++ None
++
++=====================================================================
++
++
++Name
++ GPIO_INTR_ACK
++
++Synopsis
++ The host uses this command to acknowledge and to re-arm GPIO interrupts reported
++ through an earlier “GPIO_INTR” extension event. A single “GPIO_INTR_ACK”
++ command should be used to acknowledge all GPIO interrupts that the host knows to
++ be outstanding (if pending interrupts are not acknowledged through
++ “GPIO_INTR_ACK”, another “GPIO_INTR” extension event is raised).
++
++NOTE: Support for GPIO is optional.
++
++Command
++ N/A
++
++Command Parameters
++ UINT32 ack_mask
++ A mask of interrupting GPIO pins (e.g., ack_mask
++ bit [3] acknowledges an interrupt from the pin GPIO3).
++
++Command Values
++ None
++
++Reset Value
++ None
++
++Restrictions
++ The host should acknowledge only interrupts about which it was notified.
++
++
++=====================================================================
++
++Name
++ GPIO_OUTPUT_SET
++
++Synopsis
++ Manages output on GPIO pins configured for output.
++
++ Conflicts between set_mask and clear_mask or enable_mask and disable_mask result
++ in undefined behavior.
++
++NOTE: Support for GPIO is optional.
++
++Command
++ N/A
++
++Command Parameters
++ UINT32 set_mask
++ Specifies which pins should drive a 1 out
++ UINT32 clear_mask
++ Specifies which pins should drive a 0 out
++ UINT32 enable_mask
++ Specifies which pins should be enabled for output
++ UINT32 disable_mask
++ Specifies which pins should be disabled for output
++
++Command Values
++ None
++
++
++Reset Value
++ None
++
++
++Restrictions
++ None
++
++
++
++=====================================================================
++
++
++Name
++ GPIO_REGISTER_GET
++
++Synopsis
++ Allows the host to read an arbitrary GPIO register. It is intended for use during
++ bringup/debug. The target responds to this command with a “GPIO_DATA” event.
++
++NOTE: Support for GPIO is optional.
++
++Command
++ N/A
++
++Command Parameters
++ UINT32
++ gpioreg_id
++ Specifies a GPIO register identifier, as defined
++in include/AR6000/AR6000_gpio.h
++
++Reply Parameters
++ None
++
++Reset Value
++ N/A
++
++Restrictions
++ None
++
++
++=====================================================================
++
++Name
++ GPIO_REGISTER_SET
++
++Synopsis
++ Allows the host to dynamically change GPIO configuration (usually handled
++ statically through the GPIO configuration DataSet).
++
++NOTE: Support for GPIO is optional.
++
++Command
++ N/A
++
++Command Parameters
++ UINT32 gpioreg_id
++ Specifies a GPIO register identifier, as defined in
++ include/AR6000/AR6000_gpio.h
++ UINT32 value
++ Specifies a value to write to the specified
++ GPIO register
++
++Command Values
++ None
++
++
++Reset Value
++ Initial hardware configuration is as defined in the AR6001 or AR6002 ROCmTM
++ Single-Chip MAC/BB/Radio for 2.4/5 GHz Embedded WLAN Applications data sheet. This
++ configuration is modified by the GPIO Configuration DataSet, if one exists.
++
++Restrictions
++ None
++
++
++=====================================================================
++
++
++Name
++ SET_LQTHRESHOLD
++
++Synopsis
++ Set link quality thresholds, the sampling happens at every unicast data frame Tx, if
++ certain threshold is met, corresponding event will be sent to host.
++
++Command
++ wmiconfig eth1 --lqThreshold <enable> <upper_threshold_1>...
++ <upper_threshold_4> <lower_threshold_1>... <lower_threshold_4>
++
++Command Parameters
++ A_UINT8 enable;
++ A_UINT8 thresholdAbove1_Val;
++ A_UINT8 thresholdAbove2_Val;
++ A_UINT8 thresholdAbove3_Val;
++ A_UINT8 thresholdAbove4_Val;
++ A_UINT8 thresholdBelow1_Val;
++ A_UINT8 thresholdBelow2_Val;
++ A_UINT8 thresholdBelow3_Val;
++ A_UINT8 thresholdBelow4_Val;
++
++Command Values
++ enable
++ = 0
++ Disable link quality sampling
++
++ = 1
++ Enable link quality sampling
++
++
++ thresholdAbove_Val
++ [1...4]
++ Above thresholds (value in [0,100]), in ascending
++ order threshold
++
++ Below_Val [1...4] = below thresholds (value
++ in [0,100]), in ascending order
++
++Reset Values
++ None
++
++Restrictions
++ None
++
++=====================================================================
++WMI Extension Events
++
++The WMI EXTENSION event is used for a collection of events that:
++
++ Are not generic wireless events
++ May be implementation-specific
++ May be target platform-specific
++ May be optional for a host implementation
++
++ An extension event is sent from the AR6000 device targets to the host just like
++any other WMI event message, using the WMI_EXTENSION_EVENTID. The
++first field of the payload for this “EXTENSION” event is another commandId
++(sometimes called the subcommandId) that indicates which “EXTENSION”
++event is being used. A subcommandId-specific payload follows the
++subcommandId.
++
++All extensions (subcommandIds) are listed in the header file include/wmix.h.
++See also “WMI Extension Commands” on page B-55.
++
++
++WMI Extension Events
++
++
++GPIO_ACK
++ Acknowledges a host set command has been processed by the device
++
++GPIO_DATA
++ Response to a host’s request for data
++
++GPIO_INTR
++ Signals that GPIO interrupts are pending
++
++
++=====================================================================
++
++Name
++ GPIO_ACK
++
++Synopsis
++ Acknowledges that a host set command (either “GPIO_OUTPUT_SET” or
++ “GPIO_REGISTER_SET”) has been processed by the AR6000 device.
++
++NOTE: Support for GPIO is optional.
++
++Event ID
++ N/A
++
++Event Parameters
++ None
++
++
++Event Values
++ None
++
++=====================================================================
++
++
++Name
++ GPIO_DATA
++
++Synopsis
++ The AR6000 device uses this event to respond to the host’s earlier request for data
++ (through either a “GPIO_REGISTER_GET” or a “GPIO_INPUT_GET” command).
++
++NOTE: Support for GPIO is optional.
++
++Event ID
++ N/A
++
++Event Parameters
++ UINT32 value
++ Holds the data of interest, which is either a register value
++ (in the case of “GPIO_REGISTER_GET”) or a mask of
++ pin inputs (in the case of “GPIO_INPUT_GET”).
++ UINT32 reg_id
++ Indicates which register was read (in the case of
++ “GPIO_REGISTER_GET”) or is GPIO_ID_NONE (in the
++ case of “GPIO_INPUT_GET”)
++
++Event Values
++ None
++
++
++=====================================================================
++
++
++
++Name
++ GPIO_INTR
++
++Synopsis
++ The AR6000 device raises this event to signal that GPIO interrupts are pending.
++ These GPIOs may be interrupts that occurred after the last “GPIO_INTR_ACK”
++ command was issued, or may be GPIO interrupts that the host failed to acknowledge
++ in the last “GPIO_INTR_ACK”. The AR6000 will not raise another GPIO_INTR
++ event until this event is acknowledged through a “GPIO_INTR_ACK” command.
++
++NOTE: Support for GPIO is optional.
++
++Event ID
++ N/A
++
++Event Parameters
++ UINT32 intr_mask
++ Indicates which GPIO interrupts are currently pending
++
++ UINT32 input_values
++ A recent copy of the GPIO input values, taken at the
++ time the most recent GPIO interrupt was processed
++
++Event Values
++ None
++
++
++
++=====================================================================
++#endif
+diff --git a/drivers/ar6000/wmi/wmi_host.h b/drivers/ar6000/wmi/wmi_host.h
+new file mode 100644
+index 0000000..57844bc
+--- /dev/null
++++ b/drivers/ar6000/wmi/wmi_host.h
+@@ -0,0 +1,71 @@
++#ifndef _WMI_HOST_H_
++#define _WMI_HOST_H_
++/*
++ * Copyright (c) 2004-2006 Atheros Communications Inc.
++ * All rights reserved.
++ *
++ * This file contains local definitios for the wmi host module.
++ *
++ * $Id: //depot/sw/releases/olca2.0-GPL/host/wmi/wmi_host.h#1 $
++ *
++ *
++ * 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 wmi_stats {
++ A_UINT32 cmd_len_err;
++ A_UINT32 cmd_id_err;
++};
++
++struct wmi_t {
++ A_BOOL wmi_ready;
++ A_BOOL wmi_numQoSStream;
++ A_UINT8 wmi_wmiStream2AcMapping[WMI_PRI_MAX_COUNT];
++ WMI_PRI_STREAM_ID wmi_ac2WmiStreamMapping[WMM_NUM_AC];
++ A_UINT16 wmi_streamExistsForAC[WMM_NUM_AC];
++ A_UINT8 wmi_fatPipeExists;
++ void *wmi_devt;
++ struct wmi_stats wmi_stats;
++ struct ieee80211_node_table wmi_scan_table;
++ A_UINT8 wmi_bssid[ATH_MAC_LEN];
++ A_UINT8 wmi_powerMode;
++ A_UINT8 wmi_phyMode;
++ A_UINT8 wmi_keepaliveInterval;
++ A_MUTEX_T wmi_lock;
++};
++
++#define WMI_INIT_WMISTREAM_AC_MAP(w) \
++{ (w)->wmi_wmiStream2AcMapping[WMI_BEST_EFFORT_PRI] = WMM_AC_BE; \
++ (w)->wmi_wmiStream2AcMapping[WMI_LOW_PRI] = WMM_AC_BK; \
++ (w)->wmi_wmiStream2AcMapping[WMI_HIGH_PRI] = WMM_AC_VI; \
++ (w)->wmi_wmiStream2AcMapping[WMI_HIGHEST_PRI] = WMM_AC_VO; \
++ (w)->wmi_ac2WmiStreamMapping[WMM_AC_BE] = WMI_BEST_EFFORT_PRI; \
++ (w)->wmi_ac2WmiStreamMapping[WMM_AC_BK] = WMI_LOW_PRI; \
++ (w)->wmi_ac2WmiStreamMapping[WMM_AC_VI] = WMI_HIGH_PRI; \
++ (w)->wmi_ac2WmiStreamMapping[WMM_AC_VO] = WMI_HIGHEST_PRI; }
++
++#define WMI_WMISTREAM_ACCESSCATEGORY(w,s) (w)->wmi_wmiStream2AcMapping[s]
++#define WMI_ACCESSCATEGORY_WMISTREAM(w,ac) (w)->wmi_ac2WmiStreamMapping[ac]
++
++#define LOCK_WMI(w) A_MUTEX_LOCK(&(w)->wmi_lock);
++#define UNLOCK_WMI(w) A_MUTEX_UNLOCK(&(w)->wmi_lock);
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* _WMI_HOST_H_ */
+diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
+index d3b2953..fea341e 100644
+--- a/drivers/gpio/Kconfig
++++ b/drivers/gpio/Kconfig
+@@ -75,6 +75,12 @@ config GPIO_BASIC_MMIO
+ help
+ Say yes here to support basic memory-mapped GPIO controllers.
+
++config GPIO_GLAMO
++ tristate "Glamo GPIO support"
++ depends on MFD_GLAMO
++ help
++ Say yes here to support GPIO functionality of the Smedia Glamo.
++
+ config GPIO_IT8761E
+ tristate "IT8761E GPIO support"
+ depends on GPIOLIB
+@@ -294,6 +300,13 @@ config GPIO_ADP5588_IRQ
+ Say yes here to enable the adp5588 to be used as an interrupt
+ controller. It requires the driver to be built in the kernel.
+
++config GPIO_PCF50633
++ tristate "GPIO support for NXP PCF50633"
++ depends on MFD_PCF50633
++ help
++ Say yes here if you want to include support GPIO for pins on
++ the PCF50633 chip.
++
+ comment "PCI GPIO expanders:"
+
+ config GPIO_CS5535
+diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
+index becef59..d5f3c31 100644
+--- a/drivers/gpio/Makefile
++++ b/drivers/gpio/Makefile
+@@ -11,6 +11,7 @@ obj-$(CONFIG_GPIOLIB) += gpiolib.o
+ obj-$(CONFIG_GPIO_ADP5520) += adp5520-gpio.o
+ obj-$(CONFIG_GPIO_ADP5588) += adp5588-gpio.o
+ obj-$(CONFIG_GPIO_BASIC_MMIO) += basic_mmio_gpio.o
++obj-$(CONFIG_GPIO_GLAMO) += glamo-gpio.o
+ obj-$(CONFIG_GPIO_LANGWELL) += langwell_gpio.o
+ obj-$(CONFIG_GPIO_MAX730X) += max730x.o
+ obj-$(CONFIG_GPIO_MAX7300) += max7300.o
+@@ -43,3 +44,4 @@ obj-$(CONFIG_GPIO_SX150X) += sx150x.o
+ obj-$(CONFIG_GPIO_VX855) += vx855_gpio.o
+ obj-$(CONFIG_GPIO_ML_IOH) += ml_ioh_gpio.o
+ obj-$(CONFIG_AB8500_GPIO) += ab8500-gpio.o
++obj-$(CONFIG_GPIO_PCF50633) += pcf50633-gpio.o
+diff --git a/drivers/gpio/glamo-gpio.c b/drivers/gpio/glamo-gpio.c
+new file mode 100644
+index 0000000..1e9986b
+--- /dev/null
++++ b/drivers/gpio/glamo-gpio.c
+@@ -0,0 +1,250 @@
++/* Smedia Glamo 336x/337x gpio driver
++ *
++ * (C) 2009,2011 Lars-Peter Clausen <lars@metafoo.de>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of
++ * the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ */
++
++#include <linux/io.h>
++#include <linux/init.h>
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/platform_device.h>
++#include <linux/slab.h>
++#include <linux/spinlock.h>
++
++#include <linux/gpio.h>
++#include <linux/mfd/glamo.h>
++#include <linux/mfd/glamo-core.h>
++#include <linux/mfd/glamo-regs.h>
++
++#define GLAMO_NR_GPIO 21
++#define GLAMO_NR_GPIO_REGS DIV_ROUND_UP(GLAMO_NR_GPIO, 4)
++
++#define GLAMO_GPIO_REG(x) (((x) * 2) + GLAMO_REG_GPIO_GEN1)
++
++struct glamo_gpio {
++ struct glamo_core *glamo;
++ struct gpio_chip chip;
++ uint16_t saved_regs[GLAMO_NR_GPIO_REGS];
++};
++
++#define GLAMO_GPIO_REG_GPIO(gpio) GLAMO_GPIO_REG((gpio) >> 2)
++#define GLAMO_GPIO_BIT(gpio, offset) BIT(((gpio) & 0x3) + (offset))
++#define GLAMO_GPIO_DIRECTION_BIT(gpio) GLAMO_GPIO_BIT((gpio), 0)
++#define GLAMO_GPIO_OUTPUT_BIT(gpio) GLAMO_GPIO_BIT((gpio), 4)
++#define GLAMO_GPIO_INPUT_BIT(gpio) GLAMO_GPIO_BIT((gpio), 8)
++#define GLAMO_GPIO_FUNC_BIT(gpio) GLAMO_GPIO_BIT((gpio), 12)
++
++
++static inline struct glamo_core *chip_to_glamo(struct gpio_chip *chip)
++{
++ return container_of(chip, struct glamo_gpio, chip)->glamo;
++}
++
++static void glamo_gpio_modify_reg(struct gpio_chip *chip, unsigned offset,
++ uint16_t set, uint16_t clear)
++{
++ struct glamo_core *glamo = chip_to_glamo(chip);
++ void __iomem *reg = glamo->base + GLAMO_GPIO_REG_GPIO(offset);
++ uint16_t tmp;
++
++ spin_lock(&glamo->lock);
++ tmp = readw(reg);
++ tmp |= set;
++ tmp &= ~clear;
++ writew(tmp, reg);
++ spin_unlock(&glamo->lock);
++}
++
++static void glamo_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
++{
++ uint16_t mask = GLAMO_GPIO_OUTPUT_BIT(offset);
++ glamo_gpio_modify_reg(chip, offset, value ? mask : 0, value ? 0 : mask);
++}
++
++static int glamo_gpio_get(struct gpio_chip *chip, unsigned offset)
++{
++ struct glamo_core *glamo = chip_to_glamo(chip);
++ void __iomem *reg = glamo->base + GLAMO_GPIO_REG_GPIO(offset);
++
++ return !!(readw(reg) & GLAMO_GPIO_INPUT_BIT(offset));
++}
++
++static int glamo_gpio_request(struct gpio_chip *chip, unsigned offset)
++{
++ glamo_gpio_modify_reg(chip, offset, GLAMO_GPIO_FUNC_BIT(offset), 0);
++
++ return 0;
++}
++
++static void glamo_gpio_free(struct gpio_chip *chip, unsigned offset)
++{
++ glamo_gpio_modify_reg(chip, offset, 0, GLAMO_GPIO_FUNC_BIT(offset));
++}
++
++static int glamo_gpio_direction_output(struct gpio_chip *chip, unsigned offset,
++ int value)
++{
++ uint16_t output_mask = GLAMO_GPIO_OUTPUT_BIT(offset);
++ uint16_t set, clear;
++
++ clear = GLAMO_GPIO_DIRECTION_BIT(offset);
++
++ if (value) {
++ set = output_mask;
++ } else {
++ set = 0;
++ clear |= output_mask;
++ }
++
++ glamo_gpio_modify_reg(chip, offset, set, clear);
++
++ return 0;
++}
++
++static int glamo_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
++{
++ glamo_gpio_modify_reg(chip, offset, GLAMO_GPIO_DIRECTION_BIT(offset), 0);
++
++ return 0;
++}
++
++static const struct __devinit gpio_chip glamo_gpio_chip = {
++ .label = "glamo",
++ .request = glamo_gpio_request,
++ .free = glamo_gpio_free,
++ .direction_input = glamo_gpio_direction_input,
++ .direction_output = glamo_gpio_direction_output,
++ .get = glamo_gpio_get,
++ .set = glamo_gpio_set,
++ .base = -1,
++ .ngpio = GLAMO_NR_GPIO,
++ .owner = THIS_MODULE,
++};
++
++static int __devinit glamo_gpio_probe(struct platform_device *pdev)
++{
++ struct glamo_platform_data *pdata = pdev->dev.parent->platform_data;
++ struct glamo_gpio *glamo_gpio;
++ int ret;
++
++ glamo_gpio = kzalloc(sizeof(*glamo_gpio), GFP_KERNEL);
++ if (!glamo_gpio)
++ return -ENOMEM;
++
++ glamo_gpio->glamo = dev_get_drvdata(pdev->dev.parent);
++ glamo_gpio->chip = glamo_gpio_chip;
++ glamo_gpio->chip.dev = &pdev->dev;
++ if (pdata && pdata->gpio_data)
++ glamo_gpio->chip.base = pdata->gpio_data->base;
++
++ ret = gpiochip_add(&glamo_gpio->chip);
++
++ if (ret) {
++ dev_err(&pdev->dev, "Could not register gpio chip: %d\n", ret);
++ goto err;
++ }
++
++ platform_set_drvdata(pdev, glamo_gpio);
++
++ return 0;
++err:
++ kfree(glamo_gpio);
++ return ret;
++}
++
++static int __devexit glamo_gpio_remove(struct platform_device *pdev)
++{
++ struct glamo_gpio *glamo_gpio = platform_get_drvdata(pdev);
++ int ret;
++
++ ret = gpiochip_remove(&glamo_gpio->chip);
++ if (!ret)
++ goto done;
++
++ platform_set_drvdata(pdev, NULL);
++ kfree(glamo_gpio);
++
++done:
++ return ret;
++}
++
++#ifdef CONFIG_PM_SLEEP
++
++static int glamo_gpio_suspend(struct device *dev)
++{
++ struct glamo_gpio *glamo_gpio = dev_get_drvdata(dev);
++ struct glamo_core *glamo = glamo_gpio->glamo;
++ uint16_t *saved_regs = glamo_gpio->saved_regs;
++ int i;
++
++ spin_lock(&glamo->lock);
++ for (i = 0; i < GLAMO_NR_GPIO_REGS; ++i)
++ saved_regs[i] = readw(glamo->base + GLAMO_GPIO_REG(i));
++ spin_unlock(&glamo->lock);
++
++ return 0;
++}
++
++static int glamo_gpio_resume(struct device *dev)
++{
++ struct glamo_gpio *glamo_gpio = dev_get_drvdata(dev);
++ struct glamo_core *glamo = glamo_gpio->glamo;
++ uint16_t *saved_regs = glamo_gpio->saved_regs;
++ int i;
++
++ spin_lock(&glamo->lock);
++ for (i = 0; i < GLAMO_NR_GPIO_REGS; ++i)
++ writew(saved_regs[i], glamo->base + GLAMO_GPIO_REG(i));
++ spin_unlock(&glamo->lock);
++ return 0;
++}
++
++static SIMPLE_DEV_PM_OPS(glamo_pm_ops, glamo_gpio_suspend, glamo_gpio_resume);
++
++#define GLAMO_GPIO_PM_OPS (&glamo_pm_ops)
++
++#else
++#define GLAMO_GPIO_PM_OPS NULL
++#endif
++
++static struct platform_driver glamo_gpio_driver = {
++ .probe = glamo_gpio_probe,
++ .remove = __devexit_p(glamo_gpio_remove),
++ .driver = {
++ .name = "glamo-gpio",
++ .owner = THIS_MODULE,
++ .pm = GLAMO_GPIO_PM_OPS,
++ },
++};
++
++static int __init glamo_gpio_init(void)
++{
++ return platform_driver_register(&glamo_gpio_driver);
++}
++module_init(glamo_gpio_init);
++
++static void __exit glamo_gpio_exit(void)
++{
++ platform_driver_unregister(&glamo_gpio_driver);
++}
++module_exit(glamo_gpio_exit);
++
++MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
++MODULE_DESCRIPTION("GPIO interface for the Glamo multimedia device");
++MODULE_LICENSE("GPL");
++MODULE_ALIAS("platform:glamo-gpio");
+diff --git a/drivers/gpio/pcf50633-gpio.c b/drivers/gpio/pcf50633-gpio.c
+new file mode 100644
+index 0000000..eb044e8
+--- /dev/null
++++ b/drivers/gpio/pcf50633-gpio.c
+@@ -0,0 +1,228 @@
++/* NXP PCF50633 GPIO Driver
++ *
++ * (C) 2006-2008 by Openmoko, Inc.
++ * Author: Balaji Rao <balajirrao@openmoko.org>
++ * Copyright 2010, Lars-Peter Clausen <lars@metafoo.de>
++ * All rights reserved.
++ *
++ * Broken down from monstrous PCF50633 driver mainly by
++ * Harald Welte, Andy Green and Werner Almesberger
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License as published by the
++ * Free Software Foundation; either version 2 of the License, or (at your
++ * option) any later version.
++ *
++ */
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/slab.h>
++#include <linux/platform_device.h>
++
++#include <linux/mfd/pcf50633/core.h>
++#include <linux/mfd/pcf50633/gpio.h>
++#include <linux/gpio.h>
++
++#define PCF50633_REG_GPIOCTL 0x13
++#define PCF50633_REG_GPIOCFG(x) (0x14 + (x))
++
++enum pcf50633_regulator_id {
++ PCF50633_REGULATOR_AUTO,
++ PCF50633_REGULATOR_DOWN1,
++ PCF50633_REGULATOR_DOWN2,
++ PCF50633_REGULATOR_LDO1,
++ PCF50633_REGULATOR_LDO2,
++ PCF50633_REGULATOR_LDO3,
++ PCF50633_REGULATOR_LDO4,
++ PCF50633_REGULATOR_LDO5,
++ PCF50633_REGULATOR_LDO6,
++ PCF50633_REGULATOR_HCLDO,
++ PCF50633_REGULATOR_MEMLDO,
++};
++
++#define PCF50633_REG_AUTOOUT 0x1a
++#define PCF50633_REG_DOWN1OUT 0x1e
++#define PCF50633_REG_DOWN2OUT 0x22
++#define PCF50633_REG_MEMLDOOUT 0x26
++#define PCF50633_REG_LDO1OUT 0x2d
++#define PCF50633_REG_LDO2OUT 0x2f
++#define PCF50633_REG_LDO3OUT 0x31
++#define PCF50633_REG_LDO4OUT 0x33
++#define PCF50633_REG_LDO5OUT 0x35
++#define PCF50633_REG_LDO6OUT 0x37
++#define PCF50633_REG_HCLDOOUT 0x39
++
++static const u8 pcf50633_regulator_registers[PCF50633_NUM_REGULATORS] = {
++ [PCF50633_REGULATOR_AUTO] = PCF50633_REG_AUTOOUT,
++ [PCF50633_REGULATOR_DOWN1] = PCF50633_REG_DOWN1OUT,
++ [PCF50633_REGULATOR_DOWN2] = PCF50633_REG_DOWN2OUT,
++ [PCF50633_REGULATOR_MEMLDO] = PCF50633_REG_MEMLDOOUT,
++ [PCF50633_REGULATOR_LDO1] = PCF50633_REG_LDO1OUT,
++ [PCF50633_REGULATOR_LDO2] = PCF50633_REG_LDO2OUT,
++ [PCF50633_REGULATOR_LDO3] = PCF50633_REG_LDO3OUT,
++ [PCF50633_REGULATOR_LDO4] = PCF50633_REG_LDO4OUT,
++ [PCF50633_REGULATOR_LDO5] = PCF50633_REG_LDO5OUT,
++ [PCF50633_REGULATOR_LDO6] = PCF50633_REG_LDO6OUT,
++ [PCF50633_REGULATOR_HCLDO] = PCF50633_REG_HCLDOOUT,
++};
++
++struct pcf50633_gpio {
++ struct pcf50633 *pcf;
++ struct gpio_chip chip;
++};
++
++static inline struct pcf50633 *gpio_chip_to_pcf50633(struct gpio_chip *chip)
++{
++ struct pcf50633 *pcf = dev_to_pcf50633(chip->dev->parent);
++ return pcf;
++}
++
++static void pcf50633_gpio_set_value(struct gpio_chip *chip, unsigned gpio, int value)
++{
++ struct pcf50633 *pcf = gpio_chip_to_pcf50633(chip);
++ u8 reg;
++
++ reg = PCF50633_REG_GPIOCFG(gpio);
++
++ pcf50633_reg_set_bit_mask(pcf, reg, 0x07, value ? 0x7 : 0x0);
++}
++
++static int pcf50633_gpio_get_value(struct gpio_chip *chip, unsigned gpio)
++{
++ struct pcf50633 *pcf = gpio_chip_to_pcf50633(chip);
++ return pcf50633_reg_read(pcf, PCF50633_REG_GPIOCFG(gpio)) >> 3;
++}
++
++
++static int pcf50633_gpio_direction_output(struct gpio_chip *chip, unsigned gpio,
++ int value)
++{
++ struct pcf50633 *pcf = gpio_chip_to_pcf50633(chip);
++ int ret;
++
++ ret = pcf50633_gpio_set_config(pcf, pcf->pdata->gpio_base + gpio,
++ PCF50633_GPIO_CONFIG_OUTPUT);
++ if (!ret)
++ pcf50633_gpio_set_value(chip, gpio, value);
++
++ return ret;
++}
++
++static int pcf50633_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)
++{
++ return -ENOSYS;
++}
++
++int pcf50633_gpio_set_config(struct pcf50633 *pcf, unsigned gpio,
++ enum pcf50633_gpio_config config)
++{
++ u8 reg;
++ u8 direction;
++ int ret;
++
++ gpio -= pcf->pdata->gpio_base;
++
++ if (gpio < 3) {
++ direction = (config == PCF50633_GPIO_CONFIG_INPUT) ? (1 << gpio) : 0;
++ ret = pcf50633_reg_set_bit_mask(pcf, PCF50633_REG_GPIOCTL, (1 << gpio),
++ direction);
++ if (ret) {
++ return ret;
++ }
++ } else if (gpio > 3 || config == PCF50633_GPIO_CONFIG_INPUT) {
++ return -EINVAL;
++ }
++
++ if (config != PCF50633_GPIO_CONFIG_INPUT) {
++ reg = PCF50633_REG_GPIOCFG(gpio);
++ ret = pcf50633_reg_set_bit_mask(pcf, reg, 0x0f, config);
++ }
++
++ return ret;
++}
++EXPORT_SYMBOL_GPL(pcf50633_gpio_set_config);
++
++int pcf50633_gpio_power_supply_set(struct pcf50633 *pcf,
++ int gpio, int regulator, int on)
++{
++ u8 reg, val, mask;
++
++ gpio -= pcf->pdata->gpio_base;
++
++ /* the *ENA register is always one after the *OUT register */
++ reg = pcf50633_regulator_registers[regulator] + 1;
++
++ val = !!on << (gpio - PCF50633_GPIO1);
++ mask = 1 << (gpio - PCF50633_GPIO1);
++
++ return pcf50633_reg_set_bit_mask(pcf, reg, mask, val);
++}
++EXPORT_SYMBOL_GPL(pcf50633_gpio_power_supply_set);
++
++
++static int __devinit pcf50633_gpio_probe(struct platform_device *pdev)
++{
++ struct pcf50633 *pcf = dev_to_pcf50633(pdev->dev.parent);
++ struct pcf50633_gpio *pcf_gpio;
++
++ pcf_gpio = kzalloc(sizeof(*pcf_gpio), GFP_KERNEL);
++
++ if (!pcf_gpio)
++ return -ENOMEM;
++
++ pcf_gpio->pcf = pcf;
++
++ pcf_gpio->chip.direction_input = pcf50633_gpio_direction_input;
++ pcf_gpio->chip.direction_output = pcf50633_gpio_direction_output;
++ pcf_gpio->chip.get = pcf50633_gpio_get_value;
++ pcf_gpio->chip.set = pcf50633_gpio_set_value;
++
++ pcf_gpio->chip.base = pcf->pdata->gpio_base;
++ pcf_gpio->chip.ngpio = 4;
++ pcf_gpio->chip.label = dev_name(pcf->dev);
++ pcf_gpio->chip.can_sleep = 1;
++ pcf_gpio->chip.owner = THIS_MODULE;
++ pcf_gpio->chip.dev = &pdev->dev;
++
++ platform_set_drvdata(pdev, pcf_gpio);
++
++ return gpiochip_add(&pcf_gpio->chip);
++}
++
++static int __devexit pcf50633_gpio_remove(struct platform_device *pdev)
++{
++ struct pcf50633_gpio *pcf_gpio = platform_get_drvdata(pdev);
++
++ gpiochip_remove(&pcf_gpio->chip);
++
++ platform_set_drvdata(pdev, NULL);
++ kfree(pcf_gpio);
++
++ return 0;
++}
++
++static struct platform_driver pcf50633_gpio_driver = {
++ .probe = pcf50633_gpio_probe,
++ .remove = __devexit_p(pcf50633_gpio_remove),
++ .driver = {
++ .name = "pcf50633-gpio",
++ .owner = THIS_MODULE,
++ },
++};
++
++int __init pcf50633_gpio_init(void)
++{
++ return platform_driver_register(&pcf50633_gpio_driver);
++}
++module_init(pcf50633_gpio_init);
++
++void __exit pcf50633_gpio_exit(void)
++{
++ platform_driver_unregister(&pcf50633_gpio_driver);
++}
++module_exit(pcf50633_gpio_exit);
++
++MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
++MODULE_DESCRIPTION("GPIO driver for the PCF50633");
++MODULE_LICENSE("GPL");
+diff --git a/drivers/input/misc/pcf50633-input.c b/drivers/input/misc/pcf50633-input.c
+index 9556273..983d5c8 100644
+--- a/drivers/input/misc/pcf50633-input.c
++++ b/drivers/input/misc/pcf50633-input.c
+@@ -20,6 +20,7 @@
+ #include <linux/device.h>
+ #include <linux/platform_device.h>
+ #include <linux/input.h>
++#include <linux/interrupt.h>
+ #include <linux/slab.h>
+
+ #include <linux/mfd/pcf50633/core.h>
+@@ -31,26 +32,27 @@
+ struct pcf50633_input {
+ struct pcf50633 *pcf;
+ struct input_dev *input_dev;
++ int irq_pressed;
++ int irq_released;
+ };
+
+-static void
+-pcf50633_input_irq(int irq, void *data)
++static irqreturn_t pcf50633_input_irq(int irq, void *data)
+ {
+- struct pcf50633_input *input;
++ struct pcf50633_input *input = data;
+ int onkey_released;
+
+- input = data;
+-
+ /* We report only one event depending on the key press status */
+ onkey_released = pcf50633_reg_read(input->pcf, PCF50633_REG_OOCSTAT)
+ & PCF50633_OOCSTAT_ONKEY;
+
+- if (irq == PCF50633_IRQ_ONKEYF && !onkey_released)
++ if (irq == input->irq_pressed && !onkey_released)
+ input_report_key(input->input_dev, KEY_POWER, 1);
+- else if (irq == PCF50633_IRQ_ONKEYR && onkey_released)
++ else if (irq == input->irq_released && onkey_released)
+ input_report_key(input->input_dev, KEY_POWER, 0);
+
+ input_sync(input->input_dev);
++
++ return IRQ_HANDLED;
+ }
+
+ static int __devinit pcf50633_input_probe(struct platform_device *pdev)
+@@ -58,7 +60,22 @@ static int __devinit pcf50633_input_probe(struct platform_device *pdev)
+ struct pcf50633_input *input;
+ struct input_dev *input_dev;
+ int ret;
++ int irq_released;
++ int irq_pressed;
++
++ irq_released = platform_get_irq_byname(pdev, "ONKEYR");
++ if (irq_released <= 0) {
++ dev_err(&pdev->dev, "Failed to get released irq: %d\n",
++ irq_released);
++ return irq_released ?: -EINVAL;
++ }
+
++ irq_pressed = platform_get_irq_byname(pdev, "ONKEYF");
++ if (irq_pressed <= 0) {
++ dev_err(&pdev->dev, "Failed to get pressed irq: %d\n",
++ irq_pressed);
++ return irq_pressed ?: -EINVAL;
++ }
+
+ input = kzalloc(sizeof(*input), GFP_KERNEL);
+ if (!input)
+@@ -85,20 +102,41 @@ static int __devinit pcf50633_input_probe(struct platform_device *pdev)
+ kfree(input);
+ return ret;
+ }
+- pcf50633_register_irq(input->pcf, PCF50633_IRQ_ONKEYR,
+- pcf50633_input_irq, input);
+- pcf50633_register_irq(input->pcf, PCF50633_IRQ_ONKEYF,
+- pcf50633_input_irq, input);
++
++ ret = request_threaded_irq(irq_released, NULL, pcf50633_input_irq, 0,
++ "onkey released", input);
++ if (ret) {
++ dev_err(&pdev->dev, "Failed to request released irq: %d\n", ret);
++ goto err_input_unregister;
++ }
++ ret = request_threaded_irq(irq_pressed, NULL, pcf50633_input_irq, 0,
++ "onkey pressed", input);
++ if (ret) {
++ dev_err(&pdev->dev, "Failed to request pressed irq: %d\n", ret);
++ goto err_free_irq;
++ }
++
++ input->irq_released = irq_released;
++ input->irq_pressed = irq_pressed;
++
+
+ return 0;
++
++err_free_irq:
++ free_irq(irq_pressed, input);
++err_input_unregister:
++ input_unregister_device(input->input_dev);
++ kfree(input);
++
++ return ret;
+ }
+
+ static int __devexit pcf50633_input_remove(struct platform_device *pdev)
+ {
+ struct pcf50633_input *input = platform_get_drvdata(pdev);
+
+- pcf50633_free_irq(input->pcf, PCF50633_IRQ_ONKEYR);
+- pcf50633_free_irq(input->pcf, PCF50633_IRQ_ONKEYF);
++ free_irq(input->irq_released, input);
++ free_irq(input->irq_pressed, input);
+
+ input_unregister_device(input->input_dev);
+ kfree(input);
+diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
+index 666daf7..46fac25 100644
+--- a/drivers/leds/leds-pwm.c
++++ b/drivers/leds/leds-pwm.c
+@@ -26,8 +26,8 @@
+ struct led_pwm_data {
+ struct led_classdev cdev;
+ struct pwm_device *pwm;
+- unsigned int active_low;
+- unsigned int period;
++ struct led_pwm *led;
++ struct device *parent;
+ };
+
+ static void led_pwm_set(struct led_classdev *led_cdev,
+@@ -35,8 +35,13 @@ static void led_pwm_set(struct led_classdev *led_cdev,
+ {
+ struct led_pwm_data *led_dat =
+ container_of(led_cdev, struct led_pwm_data, cdev);
++ struct device *parent = led_dat->parent;
++ struct led_pwm_platform_data *pdata = parent->platform_data;
+ unsigned int max = led_dat->cdev.max_brightness;
+- unsigned int period = led_dat->period;
++ unsigned int period = led_dat->led->pwm_period_ns;
++
++ if (pdata->notify)
++ brightness = pdata->notify(parent, led_dat->led, brightness);
+
+ if (brightness == 0) {
+ pwm_config(led_dat->pwm, 0, period);
+@@ -77,18 +82,28 @@ static int led_pwm_probe(struct platform_device *pdev)
+
+ led_dat->cdev.name = cur_led->name;
+ led_dat->cdev.default_trigger = cur_led->default_trigger;
+- led_dat->active_low = cur_led->active_low;
+- led_dat->period = cur_led->pwm_period_ns;
+ led_dat->cdev.brightness_set = led_pwm_set;
+ led_dat->cdev.brightness = LED_OFF;
+ led_dat->cdev.max_brightness = cur_led->max_brightness;
+ led_dat->cdev.flags |= LED_CORE_SUSPENDRESUME;
+
++ led_dat->led = cur_led;
++ led_dat->parent = &pdev->dev;
++
+ ret = led_classdev_register(&pdev->dev, &led_dat->cdev);
+ if (ret < 0) {
+ pwm_free(led_dat->pwm);
+ goto err;
+ }
++
++ if (pdata->init) {
++ ret = pdata->init(&pdev->dev, cur_led);
++ if (ret < 0) {
++ led_classdev_unregister(&led_dat->cdev);
++ pwm_free(led_dat->pwm);
++ goto err;
++ }
++ }
+ }
+
+ platform_set_drvdata(pdev, leds_data);
+@@ -98,6 +113,8 @@ static int led_pwm_probe(struct platform_device *pdev)
+ err:
+ if (i > 0) {
+ for (i = i - 1; i >= 0; i--) {
++ if (pdata->exit)
++ pdata->exit(&pdev->dev, &pdata->leds[i]);
+ led_classdev_unregister(&leds_data[i].cdev);
+ pwm_free(leds_data[i].pwm);
+ }
+@@ -117,6 +134,8 @@ static int __devexit led_pwm_remove(struct platform_device *pdev)
+ leds_data = platform_get_drvdata(pdev);
+
+ for (i = 0; i < pdata->num_leds; i++) {
++ if (pdata->exit)
++ pdata->exit(&pdev->dev, &pdata->leds[i]);
+ led_classdev_unregister(&leds_data[i].cdev);
+ pwm_free(leds_data[i].pwm);
+ }
+diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
+index 3ed3ff0..9b2b1bb 100644
+--- a/drivers/mfd/Kconfig
++++ b/drivers/mfd/Kconfig
+@@ -448,6 +448,7 @@ config MFD_WM8994
+
+ config MFD_PCF50633
+ tristate "Support for NXP PCF50633"
++ select MFD_CORE
+ depends on I2C
+ help
+ Say yes here if you have NXP PCF50633 chip on your board.
+@@ -477,13 +478,6 @@ config PCF50633_ADC
+ Say yes here if you want to include support for ADC in the
+ NXP PCF50633 chip.
+
+-config PCF50633_GPIO
+- tristate "Support for NXP PCF50633 GPIO"
+- depends on MFD_PCF50633
+- help
+- Say yes here if you want to include support GPIO for pins on
+- the PCF50633 chip.
+-
+ config ABX500_CORE
+ bool "ST-Ericsson ABX500 Mixed Signal Circuit register functions"
+ default y if ARCH_U300 || ARCH_U8500
+@@ -602,6 +596,14 @@ config LPC_SCH
+ LPC bridge function of the Intel SCH provides support for
+ System Management Bus and General Purpose I/O.
+
++config MFD_GLAMO
++ bool "Smedia Glamo 336x/337x support"
++ select MFD_CORE
++ help
++ This enables the core driver for the Smedia Glamo 336x/337x
++ multi-function device. It includes irq_chip demultiplex as
++ well as clock / power management and GPIO support.
++
+ config MFD_RDC321X
+ tristate "Support for RDC-R321x southbridge"
+ select MFD_CORE
+diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
+index 419caa9..fb5f307 100644
+--- a/drivers/mfd/Makefile
++++ b/drivers/mfd/Makefile
+@@ -6,6 +6,8 @@
+ obj-$(CONFIG_MFD_88PM860X) += 88pm860x.o
+ obj-$(CONFIG_MFD_SM501) += sm501.o
+ obj-$(CONFIG_MFD_ASIC3) += asic3.o tmio_core.o
++obj-$(CONFIG_MFD_SH_MOBILE_SDHI) += sh_mobile_sdhi.o
++obj-$(CONFIG_MFD_GLAMO) += glamo-core.o
+
+ obj-$(CONFIG_HTC_EGPIO) += htc-egpio.o
+ obj-$(CONFIG_HTC_PASIC3) += htc-pasic3.o
+@@ -68,7 +70,6 @@ obj-$(CONFIG_MFD_MAX8998) += max8998.o max8998-irq.o
+ pcf50633-objs := pcf50633-core.o pcf50633-irq.o
+ obj-$(CONFIG_MFD_PCF50633) += pcf50633.o
+ obj-$(CONFIG_PCF50633_ADC) += pcf50633-adc.o
+-obj-$(CONFIG_PCF50633_GPIO) += pcf50633-gpio.o
+ obj-$(CONFIG_ABX500_CORE) += abx500-core.o
+ obj-$(CONFIG_AB3100_CORE) += ab3100-core.o
+ obj-$(CONFIG_AB3100_OTP) += ab3100-otp.o
+diff --git a/drivers/mfd/glamo-core.c b/drivers/mfd/glamo-core.c
+new file mode 100644
+index 0000000..c9b2ae5
+--- /dev/null
++++ b/drivers/mfd/glamo-core.c
+@@ -0,0 +1,1274 @@
++/* Smedia Glamo 3362 driver
++ *
++ * (C) 2007 by Openmoko, Inc.
++ * Author: Harald Welte <laforge@openmoko.org>
++ * (C) 2009, Lars-Peter Clausen <lars@metafoo.de>
++ * 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 as
++ * published by the Free Software Foundation; either version 2 of
++ * the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ */
++
++#include <linux/module.h>
++#include <linux/kernel.h>
++#include <linux/errno.h>
++#include <linux/string.h>
++#include <linux/mm.h>
++#include <linux/delay.h>
++#include <linux/init.h>
++#include <linux/irq.h>
++#include <linux/interrupt.h>
++#include <linux/workqueue.h>
++#include <linux/platform_device.h>
++#include <linux/kernel_stat.h>
++#include <linux/spinlock.h>
++#include <linux/mfd/core.h>
++#include <linux/mfd/glamo.h>
++#include <linux/mfd/glamo-regs.h>
++#include <linux/mfd/glamo-core.h>
++#include <linux/io.h>
++#include <linux/slab.h>
++#include <linux/debugfs.h>
++#include <linux/seq_file.h>
++#include <linux/uaccess.h>
++
++#include <linux/pm.h>
++
++#define GLAMO_MEM_REFRESH_COUNT 0x100
++
++#define GLAMO_NR_IRQS 9
++
++#define GLAMO_IRQ_HOSTBUS 0
++#define GLAMO_IRQ_JPEG 1
++#define GLAMO_IRQ_MPEG 2
++#define GLAMO_IRQ_MPROC1 3
++#define GLAMO_IRQ_MPROC0 4
++#define GLAMO_IRQ_CMDQUEUE 5
++#define GLAMO_IRQ_2D 6
++#define GLAMO_IRQ_MMC 7
++#define GLAMO_IRQ_RISC 8
++
++/*
++ * Glamo internal settings
++ *
++ * We run the memory interface from the faster PLLB on 2.6.28 kernels and
++ * above. Couple of GTA02 users report trouble with memory bus when they
++ * upgraded from 2.6.24. So this parameter allows reversion to 2.6.24
++ * scheme if their Glamo chip needs it.
++ *
++ * you can override the faster default on kernel commandline using
++ *
++ * glamo3362.slow_memory=1
++ *
++ * for example
++ */
++
++static int slow_memory;
++module_param(slow_memory, int, 0644);
++
++struct reg_range {
++ int start;
++ int count;
++ char *name;
++ unsigned dump:1;
++};
++
++static const struct reg_range reg_range[] = {
++ { 0x0000, 0x76, "General", 1 },
++ { 0x0200, 0x18, "Host Bus", 1 },
++ { 0x0300, 0x38, "Memory", 1 },
++/* { 0x0400, 0x100, "Sensor", 0 }, */
++/* { 0x0500, 0x300, "ISP", 0 }, */
++/* { 0x0800, 0x400, "JPEG", 0 }, */
++/* { 0x0c00, 0xcc, "MPEG", 0 }, */
++ { 0x1100, 0xb2, "LCD 1", 0 },
++ { 0x1200, 0x64, "LCD 2", 0 },
++ { 0x1400, 0x42, "MMC", 0 },
++/* { 0x1500, 0x080, "MPU 0", 0 },
++ { 0x1580, 0x080, "MPU 1", 0 },
++ { 0x1600, 0x080, "Cmd Queue", 0 },
++ { 0x1680, 0x080, "RISC CPU", 0 },*/
++ { 0x1700, 0x400, "2D Unit", 0 },
++/* { 0x1b00, 0x900, "3D Unit", 0 }, */
++};
++
++static inline void __reg_write(struct glamo_core *glamo,
++ uint16_t reg, uint16_t val)
++{
++ writew(val, glamo->base + reg);
++}
++
++void glamo_reg_write(struct glamo_core *glamo,
++ uint16_t reg, uint16_t val)
++{
++ spin_lock(&glamo->lock);
++ __reg_write(glamo, reg, val);
++ spin_unlock(&glamo->lock);
++}
++EXPORT_SYMBOL_GPL(glamo_reg_write);
++
++
++static inline uint16_t __reg_read(struct glamo_core *glamo,
++ uint16_t reg)
++{
++ return readw(glamo->base + reg);
++}
++
++uint16_t glamo_reg_read(struct glamo_core *glamo, uint16_t reg)
++{
++ uint16_t val;
++ spin_lock(&glamo->lock);
++ val = __reg_read(glamo, reg);
++ spin_unlock(&glamo->lock);
++
++ return val;
++}
++EXPORT_SYMBOL_GPL(glamo_reg_read);
++
++static void __reg_set_bit_mask(struct glamo_core *glamo,
++ uint16_t reg, uint16_t mask,
++ uint16_t val)
++{
++ uint16_t tmp;
++
++ val &= mask;
++
++ tmp = __reg_read(glamo, reg);
++ tmp &= ~mask;
++ tmp |= val;
++ __reg_write(glamo, reg, tmp);
++}
++
++static void reg_set_bit_mask(struct glamo_core *glamo,
++ uint16_t reg, uint16_t mask,
++ uint16_t val)
++{
++ spin_lock(&glamo->lock);
++ __reg_set_bit_mask(glamo, reg, mask, val);
++ spin_unlock(&glamo->lock);
++}
++
++static inline void __reg_set_bit(struct glamo_core *glamo,
++ uint16_t reg, uint16_t bit)
++{
++ uint16_t tmp;
++ tmp = __reg_read(glamo, reg);
++ tmp |= bit;
++ __reg_write(glamo, reg, tmp);
++}
++
++static inline void __reg_clear_bit(struct glamo_core *glamo,
++ uint16_t reg, uint16_t bit)
++{
++ uint16_t tmp;
++ tmp = __reg_read(glamo, reg);
++ tmp &= ~bit;
++ __reg_write(glamo, reg, tmp);
++}
++
++/***********************************************************************
++ * resources of sibling devices
++ ***********************************************************************/
++
++static struct resource glamo_fb_resources[] = {
++ {
++ .name = "glamo-fb-regs",
++ .start = GLAMO_REGOFS_LCD,
++ .end = GLAMO_REGOFS_MMC - 1,
++ .flags = IORESOURCE_MEM,
++ }, {
++ .name = "glamo-fb-mem",
++ .start = GLAMO_OFFSET_FB,
++ .end = GLAMO_OFFSET_FB + GLAMO_FB_SIZE - 1,
++ .flags = IORESOURCE_MEM,
++ },
++};
++
++static struct resource glamo_mmc_resources[] = {
++ {
++ .name = "glamo-mmc-regs",
++ .start = GLAMO_REGOFS_MMC,
++ .end = GLAMO_REGOFS_MPROC0 - 1,
++ .flags = IORESOURCE_MEM
++ }, {
++ .name = "glamo-mmc-mem",
++ .start = GLAMO_OFFSET_FB + GLAMO_FB_SIZE,
++ .end = GLAMO_OFFSET_FB + GLAMO_FB_SIZE +
++ GLAMO_MMC_BUFFER_SIZE - 1,
++ .flags = IORESOURCE_MEM
++ }, {
++ .start = GLAMO_IRQ_MMC,
++ .end = GLAMO_IRQ_MMC,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++enum glamo_cells {
++ GLAMO_CELL_FB,
++ GLAMO_CELL_MMC,
++ GLAMO_CELL_GPIO,
++};
++
++static const struct mfd_cell glamo_cells[] = {
++ [GLAMO_CELL_FB] = {
++ .name = "glamo-fb",
++ .num_resources = ARRAY_SIZE(glamo_fb_resources),
++ .resources = glamo_fb_resources,
++ },
++ [GLAMO_CELL_MMC] = {
++ .name = "glamo-mci",
++ .num_resources = ARRAY_SIZE(glamo_mmc_resources),
++ .resources = glamo_mmc_resources,
++ },
++ [GLAMO_CELL_GPIO] = {
++ .name = "glamo-gpio",
++ },
++};
++
++/***********************************************************************
++ * IRQ demultiplexer
++ ***********************************************************************/
++static inline unsigned int glamo_irq_bit(struct glamo_core *glamo,
++ struct irq_data *data)
++{
++ return BIT(data->irq - glamo->irq_base);
++}
++
++static void glamo_ack_irq(struct irq_data *data)
++{
++ struct glamo_core *glamo = irq_data_get_irq_chip_data(data);
++ /* clear interrupt source */
++ __reg_write(glamo, GLAMO_REG_IRQ_CLEAR, glamo_irq_bit(glamo, data));
++}
++
++static void glamo_mask_irq(struct irq_data *data)
++{
++ struct glamo_core *glamo = irq_data_get_irq_chip_data(data);
++
++ /* clear bit in enable register */
++ __reg_clear_bit(glamo, GLAMO_REG_IRQ_ENABLE, glamo_irq_bit(glamo, data));
++}
++
++static void glamo_unmask_irq(struct irq_data *data)
++{
++ struct glamo_core *glamo = irq_data_get_irq_chip_data(data);
++
++ /* set bit in enable register */
++ __reg_set_bit(glamo, GLAMO_REG_IRQ_ENABLE, glamo_irq_bit(glamo, data));
++}
++
++static struct irq_chip glamo_irq_chip = {
++ .name = "glamo",
++ .irq_ack = glamo_ack_irq,
++ .irq_mask = glamo_mask_irq,
++ .irq_unmask = glamo_unmask_irq,
++};
++
++static irqreturn_t glamo_irq_handler(int irq, void *devid)
++{
++ struct glamo_core *glamo = devid;
++ uint16_t irqstatus;
++ int i;
++
++ irqstatus = __reg_read(glamo, GLAMO_REG_IRQ_STATUS);
++ for (i = 0; i < 9; ++i) {
++ if (irqstatus & BIT(i))
++ generic_handle_irq(glamo->irq_base + i);
++ }
++
++ return IRQ_HANDLED;
++}
++
++struct glamo_engine_reg_set {
++ uint16_t reg;
++ uint16_t mask_suspended;
++ uint16_t mask_enabled;
++};
++
++/*
++debugfs
++*/
++
++#ifdef CONFIG_DEBUG_FS
++static ssize_t debugfs_regs_write(struct file *file,
++ const char __user *user_buf,
++ size_t count, loff_t *ppos)
++{
++ struct glamo_core *glamo = ((struct seq_file *)file->private_data)->private;
++ char buf[14];
++ unsigned int reg;
++ unsigned int val;
++ int buf_size;
++
++ buf_size = min(count, sizeof(buf) - 1);
++ if (copy_from_user(buf, user_buf, buf_size))
++ return -EFAULT;
++ if (sscanf(buf, "%x %x", &reg, &val) != 2)
++ return -EFAULT;
++
++ dev_info(&glamo->pdev->dev, "reg %#02x <-- %#04x\n", reg, val);
++
++ glamo_reg_write(glamo, reg, val);
++
++ return count;
++}
++
++static int glamo_show_regs(struct seq_file *s, void *pos)
++{
++ struct glamo_core *glamo = s->private;
++ const struct reg_range *rr = reg_range;
++ int i, n;
++
++ spin_lock(&glamo->lock);
++ for (i = 0; i < ARRAY_SIZE(reg_range); ++i, ++rr) {
++ if (!rr->dump)
++ continue;
++ seq_printf(s, "\n%s\n", rr->name);
++ for (n = rr->start; n < rr->start + rr->count; n += 2) {
++ if ((n & 15) == 0)
++ seq_printf(s, "\n%04X: ", n);
++ seq_printf(s, "%04x ", __reg_read(glamo, n));
++ }
++ seq_printf(s, "\n");
++ }
++ spin_unlock(&glamo->lock);
++
++ return 0;
++}
++
++static int debugfs_open_file(struct inode *inode, struct file *file)
++{
++ return single_open(file, glamo_show_regs, inode->i_private);
++}
++
++static const struct file_operations debugfs_regs_ops = {
++ .open = debugfs_open_file,
++ .read = seq_read,
++ .llseek = seq_lseek,
++ .write = debugfs_regs_write,
++ .release = single_release,
++};
++
++static void glamo_init_debugfs(struct glamo_core *glamo)
++{
++ glamo->debugfs_dir = debugfs_create_dir("glamo3362", NULL);
++ if (glamo->debugfs_dir)
++ debugfs_create_file("regs", S_IRUGO | S_IWUSR,
++ glamo->debugfs_dir,
++ glamo, &debugfs_regs_ops);
++ else
++ dev_warn(&glamo->pdev->dev, "Failed to set up debugfs.\n");
++}
++
++static void glamo_exit_debugfs(struct glamo_core *glamo)
++{
++ if (glamo->debugfs_dir)
++ debugfs_remove_recursive(glamo->debugfs_dir);
++}
++#else
++static void glamo_init_debugfs(struct glamo_core *glamo)
++{
++}
++
++static void glamo_exit_debugfs(struct glamo_core *glamo)
++{
++}
++#endif
++
++struct glamo_engine_desc {
++ const char *name;
++ uint16_t hostbus;
++ const struct glamo_engine_reg_set *regs;
++ size_t num_regs;
++};
++
++static const struct glamo_engine_reg_set glamo_lcd_regs[] = {
++ { GLAMO_REG_CLOCK_LCD,
++ GLAMO_CLOCK_LCD_EN_M5CLK |
++ GLAMO_CLOCK_LCD_DG_M5CLK |
++ GLAMO_CLOCK_LCD_EN_DMCLK,
++
++ GLAMO_CLOCK_LCD_EN_DHCLK |
++ GLAMO_CLOCK_LCD_EN_DCLK
++ },
++ { GLAMO_REG_CLOCK_GEN5_1,
++ GLAMO_CLOCK_GEN51_EN_DIV_DMCLK,
++
++ GLAMO_CLOCK_GEN51_EN_DIV_DHCLK |
++ GLAMO_CLOCK_GEN51_EN_DIV_DCLK
++ }
++};
++
++static const struct glamo_engine_reg_set glamo_mmc_regs[] = {
++ { GLAMO_REG_CLOCK_MMC,
++ GLAMO_CLOCK_MMC_EN_M9CLK |
++ GLAMO_CLOCK_MMC_DG_M9CLK,
++
++ GLAMO_CLOCK_MMC_EN_TCLK |
++ GLAMO_CLOCK_MMC_DG_TCLK
++ },
++ { GLAMO_REG_CLOCK_GEN5_1,
++ 0,
++ GLAMO_CLOCK_GEN51_EN_DIV_TCLK
++ }
++};
++
++static const struct glamo_engine_reg_set glamo_2d_regs[] = {
++ { GLAMO_REG_CLOCK_2D,
++ GLAMO_CLOCK_2D_EN_M7CLK |
++ GLAMO_CLOCK_2D_DG_M7CLK,
++
++ GLAMO_CLOCK_2D_EN_GCLK |
++ GLAMO_CLOCK_2D_DG_GCLK
++ },
++ { GLAMO_REG_CLOCK_GEN5_1,
++ 0,
++ GLAMO_CLOCK_GEN51_EN_DIV_GCLK,
++ }
++};
++
++static const struct glamo_engine_reg_set glamo_cmdq_regs[] = {
++ { GLAMO_REG_CLOCK_2D,
++ GLAMO_CLOCK_2D_EN_M6CLK,
++ 0
++ },
++};
++
++#define GLAMO_ENGINE(xname, xhostbus, xregs) { \
++ .name = xname, \
++ .hostbus = xhostbus, \
++ .num_regs = ARRAY_SIZE(xregs), \
++ .regs = xregs, \
++}
++
++static const struct glamo_engine_desc glamo_engines[] = {
++ [GLAMO_ENGINE_LCD] = GLAMO_ENGINE("LCD", GLAMO_HOSTBUS2_MMIO_EN_LCD,
++ glamo_lcd_regs),
++ [GLAMO_ENGINE_MMC] = GLAMO_ENGINE("MMC", GLAMO_HOSTBUS2_MMIO_EN_MMC,
++ glamo_mmc_regs),
++ [GLAMO_ENGINE_2D] = GLAMO_ENGINE("2D", GLAMO_HOSTBUS2_MMIO_EN_2D,
++ glamo_2d_regs),
++ [GLAMO_ENGINE_CMDQ] = GLAMO_ENGINE("CMDQ", GLAMO_HOSTBUS2_MMIO_EN_CQ,
++ glamo_cmdq_regs),
++};
++
++static inline const char *glamo_engine_name(enum glamo_engine engine)
++{
++ return glamo_engines[engine].name;
++}
++
++/***********************************************************************
++ * 'engine' support
++ ***********************************************************************/
++
++int __glamo_engine_enable(struct glamo_core *glamo, enum glamo_engine engine)
++{
++ int i;
++ const struct glamo_engine_desc *engine_desc = &glamo_engines[engine];
++ const struct glamo_engine_reg_set *reg;
++
++ switch (engine) {
++ case GLAMO_ENGINE_LCD:
++ case GLAMO_ENGINE_MMC:
++ case GLAMO_ENGINE_2D:
++ case GLAMO_ENGINE_CMDQ:
++ break;
++ default:
++ return -EINVAL;
++ }
++
++ reg = engine_desc->regs;
++
++ __reg_set_bit(glamo, GLAMO_REG_HOSTBUS(2),
++ engine_desc->hostbus);
++ for (i = engine_desc->num_regs; i; --i, ++reg)
++ __reg_set_bit(glamo, reg->reg,
++ reg->mask_suspended | reg->mask_enabled);
++
++ return 0;
++}
++
++int glamo_engine_enable(struct glamo_core *glamo, enum glamo_engine engine)
++{
++ int ret = 0;
++
++ spin_lock(&glamo->lock);
++
++ if (glamo->engine_state[engine] != GLAMO_ENGINE_ENABLED) {
++ ret = __glamo_engine_enable(glamo, engine);
++ if (!ret)
++ glamo->engine_state[engine] = GLAMO_ENGINE_ENABLED;
++ }
++
++ spin_unlock(&glamo->lock);
++
++ return ret;
++}
++EXPORT_SYMBOL_GPL(glamo_engine_enable);
++
++int __glamo_engine_disable(struct glamo_core *glamo, enum glamo_engine engine)
++{
++ int i;
++ const struct glamo_engine_desc *engine_desc = &glamo_engines[engine];
++ const struct glamo_engine_reg_set *reg;
++
++ switch (engine) {
++ case GLAMO_ENGINE_LCD:
++ case GLAMO_ENGINE_MMC:
++ case GLAMO_ENGINE_2D:
++ case GLAMO_ENGINE_CMDQ:
++ break;
++ default:
++ return -EINVAL;
++ }
++
++ reg = engine_desc->regs;
++
++ __reg_clear_bit(glamo, GLAMO_REG_HOSTBUS(2),
++ engine_desc->hostbus);
++ for (i = engine_desc->num_regs; i; --i, ++reg)
++ __reg_clear_bit(glamo, reg->reg,
++ reg->mask_suspended | reg->mask_enabled);
++
++ return 0;
++}
++int glamo_engine_disable(struct glamo_core *glamo, enum glamo_engine engine)
++{
++ int ret = 0;
++
++ spin_lock(&glamo->lock);
++
++ if (glamo->engine_state[engine] != GLAMO_ENGINE_DISABLED) {
++ ret = __glamo_engine_disable(glamo, engine);
++ if (!ret)
++ glamo->engine_state[engine] = GLAMO_ENGINE_DISABLED;
++ }
++
++ spin_unlock(&glamo->lock);
++
++ return ret;
++}
++EXPORT_SYMBOL_GPL(glamo_engine_disable);
++
++int __glamo_engine_suspend(struct glamo_core *glamo, enum glamo_engine engine)
++{
++ int i;
++ const struct glamo_engine_desc *engine_desc = &glamo_engines[engine];
++ const struct glamo_engine_reg_set *reg;
++
++ switch (engine) {
++ case GLAMO_ENGINE_LCD:
++ case GLAMO_ENGINE_MMC:
++ case GLAMO_ENGINE_2D:
++ case GLAMO_ENGINE_CMDQ:
++ break;
++ default:
++ return -EINVAL;
++ }
++
++ reg = engine_desc->regs;
++
++ __reg_set_bit(glamo, GLAMO_REG_HOSTBUS(2),
++ engine_desc->hostbus);
++ for (i = engine_desc->num_regs; i; --i, ++reg) {
++ __reg_set_bit(glamo, reg->reg, reg->mask_suspended);
++ __reg_clear_bit(glamo, reg->reg, reg->mask_enabled);
++ }
++
++ return 0;
++}
++
++int glamo_engine_suspend(struct glamo_core *glamo, enum glamo_engine engine)
++{
++ int ret = 0;
++
++ spin_lock(&glamo->lock);
++
++ if (glamo->engine_state[engine] != GLAMO_ENGINE_SUSPENDED) {
++ ret = __glamo_engine_suspend(glamo, engine);
++ if (!ret)
++ glamo->engine_state[engine] = GLAMO_ENGINE_SUSPENDED;
++ }
++
++ spin_unlock(&glamo->lock);
++
++ return ret;
++}
++EXPORT_SYMBOL_GPL(glamo_engine_suspend);
++
++static const struct glamo_script reset_regs[] = {
++ [GLAMO_ENGINE_LCD] = {
++ GLAMO_REG_CLOCK_LCD, GLAMO_CLOCK_LCD_RESET
++ },
++ [GLAMO_ENGINE_MMC] = {
++ GLAMO_REG_CLOCK_MMC, GLAMO_CLOCK_MMC_RESET
++ },
++ [GLAMO_ENGINE_CMDQ] = {
++ GLAMO_REG_CLOCK_2D, GLAMO_CLOCK_2D_CQ_RESET
++ },
++ [GLAMO_ENGINE_2D] = {
++ GLAMO_REG_CLOCK_2D, GLAMO_CLOCK_2D_RESET
++ },
++ [GLAMO_ENGINE_JPEG] = {
++ GLAMO_REG_CLOCK_JPEG, GLAMO_CLOCK_JPEG_RESET
++ },
++};
++
++void glamo_engine_reset(struct glamo_core *glamo, enum glamo_engine engine)
++{
++ uint16_t reg = reset_regs[engine].reg;
++ uint16_t val = reset_regs[engine].val;
++
++ if (engine >= ARRAY_SIZE(reset_regs)) {
++ dev_warn(&glamo->pdev->dev, "unknown engine %u ", engine);
++ return;
++ }
++
++ spin_lock(&glamo->lock);
++ __reg_set_bit(glamo, reg, val);
++ __reg_clear_bit(glamo, reg, val);
++ spin_unlock(&glamo->lock);
++}
++EXPORT_SYMBOL_GPL(glamo_engine_reset);
++
++int glamo_pll_rate(struct glamo_core *glamo,
++ enum glamo_pll pll)
++{
++ uint16_t reg;
++ unsigned int osci = glamo->pdata->osci_clock_rate;
++
++ switch (pll) {
++ case GLAMO_PLL1:
++ reg = __reg_read(glamo, GLAMO_REG_PLL_GEN1);
++ break;
++ case GLAMO_PLL2:
++ reg = __reg_read(glamo, GLAMO_REG_PLL_GEN3);
++ break;
++ default:
++ return -EINVAL;
++ }
++
++ return (int)osci * (int)reg;
++}
++EXPORT_SYMBOL_GPL(glamo_pll_rate);
++
++int glamo_engine_reclock(struct glamo_core *glamo,
++ enum glamo_engine engine,
++ int hz)
++{
++ int pll;
++ uint16_t reg, mask, div;
++
++ if (!hz)
++ return -EINVAL;
++
++ switch (engine) {
++ case GLAMO_ENGINE_LCD:
++ pll = GLAMO_PLL1;
++ reg = GLAMO_REG_CLOCK_GEN7;
++ mask = 0xff;
++ break;
++ case GLAMO_ENGINE_MMC:
++ pll = GLAMO_PLL1;
++ reg = GLAMO_REG_CLOCK_GEN8;
++ mask = 0xff;
++ break;
++ default:
++ dev_warn(&glamo->pdev->dev,
++ "reclock of engine 0x%x not supported\n", engine);
++ return -EINVAL;
++ break;
++ }
++
++ pll = glamo_pll_rate(glamo, pll);
++
++ div = pll / hz;
++
++ if (div != 0 && pll / div <= hz)
++ --div;
++
++ if (div > mask)
++ div = mask;
++
++ dev_dbg(&glamo->pdev->dev,
++ "PLL %d, kHZ %d, div %d\n", pll, hz / 1000, div);
++
++ reg_set_bit_mask(glamo, reg, mask, div);
++ mdelay(5); /* wait some time to stabilize */
++
++ return pll / (div + 1);
++}
++EXPORT_SYMBOL_GPL(glamo_engine_reclock);
++
++/***********************************************************************
++ * script support
++ ***********************************************************************/
++
++#define GLAMO_SCRIPT_END 0xffff
++#define GLAMO_SCRIPT_WAIT 0xfffe
++#define GLAMO_SCRIPT_LOCK_PLL 0xfffd
++
++/*
++ * couple of people reported artefacts with 2.6.28 changes, this
++ * allows reversion to 2.6.24 settings
++*/
++static const uint16_t reg_0x200[] = {
++ 0xe03, /* 0 waits on Async BB R & W, Use PLL 2 for mem bus */
++ 0xef0, /* 3 waits on Async BB R & W, Use PLL 1 for mem bus */
++ 0xea0, /* 2 waits on Async BB R & W, Use PLL 1 for mem bus */
++ 0xe50, /* 1 waits on Async BB R & W, Use PLL 1 for mem bus */
++ 0xe00, /* 0 waits on Async BB R & W, Use PLL 1 for mem bus */
++ 0xef3, /* 3 waits on Async BB R & W, Use PLL 2 for mem bus */
++ 0xea3, /* 2 waits on Async BB R & W, Use PLL 2 for mem bus */
++ 0xe53, /* 1 waits on Async BB R & W, Use PLL 2 for mem bus */
++};
++
++static int glamo_run_script(struct glamo_core *glamo,
++ const struct glamo_script *script, int len,
++ int may_sleep)
++{
++ int i;
++ uint16_t status;
++ const struct glamo_script *line = script;
++
++ for (i = 0; i < len; ++i, ++line) {
++ switch (line->reg) {
++ case GLAMO_SCRIPT_END:
++ return 0;
++ case GLAMO_SCRIPT_WAIT:
++ if (may_sleep)
++ msleep(line->val);
++ else
++ mdelay(line->val * 4);
++ break;
++ case GLAMO_SCRIPT_LOCK_PLL:
++ /* spin until PLLs lock */
++ do {
++ status = __reg_read(glamo, GLAMO_REG_PLL_GEN5);
++ } while ((status & 3) != 3);
++ break;
++ case 0x200:
++ __reg_write(glamo, line->reg,
++ reg_0x200[slow_memory & 0x7]);
++ break;
++ default:
++ __reg_write(glamo, line->reg, line->val);
++ break;
++ }
++ }
++
++ return 0;
++}
++
++static const struct glamo_script glamo_init_script[] = {
++ { GLAMO_REG_CLOCK_HOST, 0x1000 },
++ { GLAMO_SCRIPT_WAIT, 2 },
++ { GLAMO_REG_CLOCK_MEMORY, 0x1000 },
++ { GLAMO_REG_CLOCK_MEMORY, 0x2000 },
++ { GLAMO_REG_CLOCK_LCD, 0x1000 },
++ { GLAMO_REG_CLOCK_MMC, 0x1000 },
++ { GLAMO_REG_CLOCK_ISP, 0x1000 },
++ { GLAMO_REG_CLOCK_ISP, 0x3000 },
++ { GLAMO_REG_CLOCK_JPEG, 0x1000 },
++ { GLAMO_REG_CLOCK_3D, 0x1000 },
++ { GLAMO_REG_CLOCK_3D, 0x3000 },
++ { GLAMO_REG_CLOCK_2D, 0x1000 },
++ { GLAMO_REG_CLOCK_2D, 0x3000 },
++ { GLAMO_REG_CLOCK_RISC1, 0x1000 },
++ { GLAMO_REG_CLOCK_MPEG, 0x1000 },
++ { GLAMO_REG_CLOCK_MPEG, 0x3000 },
++ { GLAMO_REG_CLOCK_MPROC, 0x1000 /*0x100f*/ },
++ { GLAMO_SCRIPT_WAIT, 2 },
++ { GLAMO_REG_CLOCK_HOST, 0x0000 },
++ { GLAMO_REG_CLOCK_MEMORY, 0x0000 },
++ { GLAMO_REG_CLOCK_LCD, 0x0000 },
++ { GLAMO_REG_CLOCK_MMC, 0x0000 },
++ { GLAMO_REG_PLL_GEN1, 0x05db }, /* 48MHz */
++ { GLAMO_REG_PLL_GEN3, 0x0aba }, /* 90MHz */
++ { GLAMO_SCRIPT_LOCK_PLL, 0 },
++ /*
++ * b9 of this register MUST be zero to get any interrupts on INT#
++ * the other set bits enable all the engine interrupt sources
++ */
++ { GLAMO_REG_IRQ_ENABLE, 0x0100 },
++ { GLAMO_REG_CLOCK_GEN6, 0x2000 },
++ { GLAMO_REG_CLOCK_GEN7, 0x0101 },
++ { GLAMO_REG_CLOCK_GEN8, 0x0100 },
++ { GLAMO_REG_CLOCK_HOST, 0x000d },
++ /*
++ * b7..b4 = 0 = no wait states on read or write
++ * b0 = 1 select PLL2 for Host interface, b1 = enable it
++ */
++ { GLAMO_REG_HOSTBUS(1), 0x0e03 /* this is replaced by script parser */ },
++ { GLAMO_REG_HOSTBUS(2), 0x07ff }, /* TODO: Disable all */
++ { GLAMO_REG_HOSTBUS(10), 0x0000 },
++ { GLAMO_REG_HOSTBUS(11), 0x4000 },
++ { GLAMO_REG_HOSTBUS(12), 0xf00e },
++
++ /* S-Media recommended "set tiling mode to 512 mode for memory access
++ * more efficiency when 640x480" */
++ { GLAMO_REG_MEM_TYPE, 0x0c74 }, /* 8MB, 16 word pg wr+rd */
++ { GLAMO_REG_MEM_GEN, 0xafaf }, /* 63 grants min + max */
++
++ { GLAMO_REG_MEM_TIMING1, 0x0108 },
++ { GLAMO_REG_MEM_TIMING2, 0x0010 }, /* Taa = 3 MCLK */
++ { GLAMO_REG_MEM_TIMING3, 0x0000 },
++ { GLAMO_REG_MEM_TIMING4, 0x0000 }, /* CE1# delay fall/rise */
++ { GLAMO_REG_MEM_TIMING5, 0x0000 }, /* UB# LB# */
++ { GLAMO_REG_MEM_TIMING6, 0x0000 }, /* OE# */
++ { GLAMO_REG_MEM_TIMING7, 0x0000 }, /* WE# */
++ { GLAMO_REG_MEM_TIMING8, 0x1002 }, /* MCLK delay, was 0x1000 */
++ { GLAMO_REG_MEM_TIMING9, 0x6006 },
++ { GLAMO_REG_MEM_TIMING10, 0x00ff },
++ { GLAMO_REG_MEM_TIMING11, 0x0001 },
++ { GLAMO_REG_MEM_POWER1, 0x0020 },
++ { GLAMO_REG_MEM_POWER2, 0x0000 },
++ { GLAMO_REG_MEM_DRAM1, 0x0000 },
++ { GLAMO_SCRIPT_WAIT, 1 },
++ { GLAMO_REG_MEM_DRAM1, 0xc100 },
++ { GLAMO_SCRIPT_WAIT, 1 },
++ { GLAMO_REG_MEM_DRAM1, 0xe100 },
++ { GLAMO_REG_MEM_DRAM2, 0x01d6 },
++ { GLAMO_REG_CLOCK_MEMORY, 0x000b },
++};
++
++/* Find out if we can support this version of the Glamo chip */
++static int __devinit glamo_supported(struct glamo_core *glamo)
++{
++ uint16_t dev_id, rev_id;
++
++ dev_id = __reg_read(glamo, GLAMO_REG_DEVICE_ID);
++ rev_id = __reg_read(glamo, GLAMO_REG_REVISION_ID);
++
++ switch (dev_id) {
++ case 0x3650:
++ switch (rev_id) {
++ case GLAMO_CORE_REV_A2:
++ break;
++ case GLAMO_CORE_REV_A0:
++ case GLAMO_CORE_REV_A1:
++ case GLAMO_CORE_REV_A3:
++ dev_warn(&glamo->pdev->dev, "untested core revision "
++ "%04x, your mileage may vary\n", rev_id);
++ break;
++ default:
++ dev_warn(&glamo->pdev->dev, "unknown glamo revision "
++ "%04x, your mileage may vary\n", rev_id);
++ }
++ break;
++ default:
++ dev_err(&glamo->pdev->dev, "unsupported Glamo device %04x\n",
++ dev_id);
++ return 0;
++ }
++
++ dev_dbg(&glamo->pdev->dev, "Detected Glamo core %04x Revision %04x "
++ "(%uHz CPU / %uHz Memory)\n", dev_id, rev_id,
++ glamo_pll_rate(glamo, GLAMO_PLL1),
++ glamo_pll_rate(glamo, GLAMO_PLL2));
++
++ return 1;
++}
++
++static int __devinit glamo_probe(struct platform_device *pdev)
++{
++ int ret = 0, n, irq, irq_base;
++ struct glamo_core *glamo;
++ struct resource *mem;
++
++ glamo = kmalloc(GFP_KERNEL, sizeof(*glamo));
++ if (!glamo)
++ return -ENOMEM;
++
++ for (n = 0; n < __NUM_GLAMO_ENGINES; n++)
++ glamo->engine_state[n] = GLAMO_ENGINE_DISABLED;
++
++ spin_lock_init(&glamo->lock);
++
++ glamo->pdev = pdev;
++ mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ glamo->irq = platform_get_irq(pdev, 0);
++ glamo->pdata = pdev->dev.platform_data;
++
++ if (glamo->irq < 0) {
++ ret = glamo->irq;
++ dev_err(&pdev->dev, "Failed to get platform irq: %d\n", ret);
++ goto err_free;
++ }
++
++ if (!mem) {
++ dev_err(&pdev->dev, "Failed to get platform memory\n");
++ ret = -ENOENT;
++ goto err_free;
++ }
++
++ if (!glamo->pdata) {
++ dev_err(&pdev->dev, "Missing platform data\n");
++ ret = -ENOENT;
++ goto err_free;
++ }
++
++ irq_base = irq_alloc_descs(-1, 0, GLAMO_NR_IRQS, 0);
++ if (irq_base < 0) {
++ dev_err(&pdev->dev, "Failed to allocate irqs: %d\n", irq_base);
++ goto err_free;
++ }
++ glamo->irq_base = irq_base;
++
++
++ /* only request the generic, hostbus and memory controller registers */
++ glamo->mem = request_mem_region(mem->start, GLAMO_REGOFS_VIDCAP,
++ pdev->name);
++
++ if (!glamo->mem) {
++ dev_err(&pdev->dev, "Failed to request io memory region\n");
++ ret = -ENOENT;
++ goto err_irq_free_descs;
++ }
++
++ glamo->base = ioremap(glamo->mem->start, resource_size(glamo->mem));
++ if (!glamo->base) {
++ dev_err(&pdev->dev, "Failed to ioremap() memory region\n");
++ goto err_release_mem_region;
++ }
++
++ /* confirm it isn't insane version */
++ if (!glamo_supported(glamo)) {
++ dev_err(&pdev->dev,
++ "This version of the Glamo is not supported\n");
++ goto err_iounmap;
++ }
++
++ platform_set_drvdata(pdev, glamo);
++
++ /* debugfs */
++ glamo_init_debugfs(glamo);
++
++ /* init the chip with canned register set */
++ glamo_run_script(glamo, glamo_init_script,
++ ARRAY_SIZE(glamo_init_script), 1);
++
++ /*
++ * finally set the mfd interrupts up
++ */
++ for (irq = irq_base; irq < irq_base + GLAMO_NR_IRQS; ++irq) {
++#ifdef CONFIG_ARM
++ set_irq_flags(irq, IRQF_VALID);
++#else
++ irq_set_noprobe(irq);
++#endif
++ irq_set_chip_data(irq, glamo);
++ irq_set_chip_and_handler(irq, &glamo_irq_chip,
++ handle_level_irq);
++ }
++
++ ret = request_any_context_irq(glamo->irq, glamo_irq_handler,
++ IRQF_TRIGGER_FALLING, "glamo irq demux", glamo);
++ if (ret) {
++ dev_err(&pdev->dev, "Failed to request irq: %d\n", ret);
++ goto err_free_irqs;
++ }
++
++ ret = mfd_add_devices(&pdev->dev, pdev->id, glamo_cells,
++ ARRAY_SIZE(glamo_cells), mem, glamo->irq_base);
++
++ if (ret) {
++ dev_err(&pdev->dev, "Failed to add child devices: %d\n", ret);
++ goto err_free_irq;
++ }
++
++ dev_info(&glamo->pdev->dev, "Glamo core PLL1: %uHz, PLL2: %uHz\n",
++ glamo_pll_rate(glamo, GLAMO_PLL1),
++ glamo_pll_rate(glamo, GLAMO_PLL2));
++
++ return 0;
++
++err_free_irq:
++ free_irq(glamo->irq, glamo);
++err_free_irqs:
++ for (irq = irq_base; irq < irq_base + GLAMO_NR_IRQS; ++irq) {
++ irq_set_chip(irq, NULL);
++#ifdef CONFIG_ARM
++ set_irq_flags(irq, 0);
++#else
++ irq_set_probe(irq);
++#endif
++ irq_set_chip_data(irq, NULL);
++ }
++err_iounmap:
++ iounmap(glamo->base);
++err_release_mem_region:
++ release_mem_region(glamo->mem->start, resource_size(glamo->mem));
++err_irq_free_descs:
++ irq_free_descs(irq_base, GLAMO_NR_IRQS);
++err_free:
++ platform_set_drvdata(pdev, NULL);
++ kfree(glamo);
++
++ return ret;
++}
++
++static int __devexit glamo_remove(struct platform_device *pdev)
++{
++ struct glamo_core *glamo = platform_get_drvdata(pdev);
++ int irq;
++ int irq_base = glamo->irq_base;
++
++ glamo_exit_debugfs(glamo);
++
++ mfd_remove_devices(&pdev->dev);
++
++ free_irq(glamo->irq, glamo);
++
++ for (irq = irq_base; irq < irq_base + GLAMO_NR_IRQS; ++irq) {
++#ifdef CONFIG_ARM
++ set_irq_flags(irq, 0);
++#else
++ irq_set_noprobe();
++#endif
++ irq_set_chip(irq, NULL);
++ irq_set_chip_data(irq, NULL);
++ }
++
++ platform_set_drvdata(pdev, NULL);
++ iounmap(glamo->base);
++ release_mem_region(glamo->mem->start, resource_size(glamo->mem));
++ irq_free_descs(irq_base, GLAMO_NR_IRQS);
++ kfree(glamo);
++
++ return 0;
++}
++
++#ifdef CONFIG_PM
++#if 0
++static struct glamo_script glamo_resume_script[] = {
++
++ { GLAMO_REG_PLL_GEN1, 0x05db }, /* 48MHz */
++ { GLAMO_REG_PLL_GEN3, 0x0aba }, /* 90MHz */
++ { GLAMO_REG_DFT_GEN6, 1 },
++ { 0xfffe, 100 },
++ { 0xfffd, 0 },
++ { 0x200, 0x0e03 },
++
++ /*
++ * b9 of this register MUST be zero to get any interrupts on INT#
++ * the other set bits enable all the engine interrupt sources
++ */
++ { GLAMO_REG_IRQ_ENABLE, 0x01ff },
++ { GLAMO_REG_CLOCK_HOST, 0x0018 },
++ { GLAMO_REG_CLOCK_GEN5_1, 0x18b1 },
++
++ { GLAMO_REG_MEM_DRAM1, 0x0000 },
++ { 0xfffe, 1 },
++ { GLAMO_REG_MEM_DRAM1, 0xc100 },
++ { 0xfffe, 1 },
++ { GLAMO_REG_MEM_DRAM1, 0xe100 },
++ { GLAMO_REG_MEM_DRAM2, 0x01d6 },
++ { GLAMO_REG_CLOCK_MEMORY, 0x000b },
++};
++#endif
++
++#if 0
++static void glamo_power(struct glamo_core *glamo)
++{
++ unsigned long flags;
++
++ spin_lock_irqsave(&glamo->lock, flags);
++
++ /*
++Power management
++static const REG_VALUE_MASK_TYPE reg_powerOn[] =
++{
++ { REG_GEN_DFT6, REG_BIT_ALL, REG_DATA(1u << 0) },
++ { REG_GEN_PLL3, 0u, REG_DATA(1u << 13) },
++ { REG_GEN_MEM_CLK, REG_BIT_ALL, REG_BIT_EN_MOCACLK },
++ { REG_MEM_DRAM2, 0u, REG_BIT_EN_DEEP_POWER_DOWN },
++ { REG_MEM_DRAM1, 0u, REG_BIT_SELF_REFRESH }
++};
++
++static const REG_VALUE_MASK_TYPE reg_powerStandby[] =
++{
++ { REG_MEM_DRAM1, REG_BIT_ALL, REG_BIT_SELF_REFRESH },
++ { REG_GEN_MEM_CLK, 0u, REG_BIT_EN_MOCACLK },
++ { REG_GEN_PLL3, REG_BIT_ALL, REG_DATA(1u << 13) },
++ { REG_GEN_DFT5, REG_BIT_ALL, REG_DATA(1u << 0) }
++};
++
++static const REG_VALUE_MASK_TYPE reg_powerSuspend[] =
++{
++ { REG_MEM_DRAM2, REG_BIT_ALL, REG_BIT_EN_DEEP_POWER_DOWN },
++ { REG_GEN_MEM_CLK, 0u, REG_BIT_EN_MOCACLK },
++ { REG_GEN_PLL3, REG_BIT_ALL, REG_DATA(1u << 13) },
++ { REG_GEN_DFT5, REG_BIT_ALL, REG_DATA(1u << 0) }
++};
++*/
++ switch (new_state) {
++ case GLAMO_POWER_ON:
++
++ /*
++ * glamo state on resume is nondeterministic in some
++ * fundamental way, it has also been observed that the
++ * Glamo reset pin can get asserted by, eg, touching it with
++ * a scope probe. So the only answer is to roll with it and
++ * force an external reset on the Glamo during resume.
++ */
++
++
++ break;
++
++ case GLAMO_POWER_SUSPEND:
++
++ break;
++ }
++ spin_unlock_irqrestore(&glamo->lock, flags);
++}
++#endif
++
++static int glamo_suspend(struct device *dev)
++{
++ struct glamo_core *glamo = dev_get_drvdata(dev);
++ int n;
++
++ spin_lock(&glamo->lock);
++
++ glamo->saved_irq_mask = __reg_read(glamo, GLAMO_REG_IRQ_ENABLE);
++
++ /* nuke interrupts */
++ __reg_write(glamo, GLAMO_REG_IRQ_ENABLE, 0x200);
++
++ /* take down each engine before we kill mem and pll */
++ for (n = 0; n < __NUM_GLAMO_ENGINES; n++) {
++ if (glamo->engine_state[n] != GLAMO_ENGINE_DISABLED)
++ __glamo_engine_disable(glamo, n);
++ }
++
++ /* enable self-refresh */
++
++ __reg_write(glamo, GLAMO_REG_MEM_DRAM1,
++ GLAMO_MEM_DRAM1_EN_DRAM_REFRESH |
++ GLAMO_MEM_DRAM1_EN_GATE_CKE |
++ GLAMO_MEM_DRAM1_SELF_REFRESH |
++ GLAMO_MEM_REFRESH_COUNT);
++ __reg_write(glamo, GLAMO_REG_MEM_DRAM1,
++ GLAMO_MEM_DRAM1_EN_MODEREG_SET |
++ GLAMO_MEM_DRAM1_EN_DRAM_REFRESH |
++ GLAMO_MEM_DRAM1_EN_GATE_CKE |
++ GLAMO_MEM_DRAM1_SELF_REFRESH |
++ GLAMO_MEM_REFRESH_COUNT);
++
++ /* force RAM into deep powerdown */
++ __reg_write(glamo, GLAMO_REG_MEM_DRAM2,
++ GLAMO_MEM_DRAM2_DEEP_PWRDOWN |
++ (7 << 6) | /* tRC */
++ (1 << 4) | /* tRP */
++ (1 << 2) | /* tRCD */
++ 2); /* CAS latency */
++
++ /* disable clocks to memory */
++ __reg_write(glamo, GLAMO_REG_CLOCK_MEMORY, 0);
++
++ /* all dividers from OSCI */
++ __reg_set_bit_mask(glamo, GLAMO_REG_CLOCK_GEN5_1, 0x400, 0x400);
++
++ /* PLL2 into bypass */
++ __reg_set_bit_mask(glamo, GLAMO_REG_PLL_GEN3, 1 << 12, 1 << 12);
++
++ __reg_write(glamo, GLAMO_BASIC_MMC_EN_TCLK_DLYA1, 0x0e00);
++
++ /* kill PLLS 1 then 2 */
++ __reg_write(glamo, GLAMO_REG_DFT_GEN5, 0x0001);
++ __reg_set_bit_mask(glamo, GLAMO_REG_PLL_GEN3, 1 << 13, 1 << 13);
++
++ spin_unlock(&glamo->lock);
++
++ return 0;
++}
++
++static int glamo_resume(struct device *dev)
++{
++ struct glamo_core *glamo = dev_get_drvdata(dev);
++ int n;
++
++ (glamo->pdata->glamo_external_reset)(0);
++ udelay(10);
++ (glamo->pdata->glamo_external_reset)(1);
++ mdelay(5);
++
++ spin_lock(&glamo->lock);
++
++ glamo_run_script(glamo, glamo_init_script,
++ ARRAY_SIZE(glamo_init_script), 0);
++
++
++ for (n = 0; n < __NUM_GLAMO_ENGINES; n++) {
++ switch (glamo->engine_state[n]) {
++ case GLAMO_ENGINE_SUSPENDED:
++ __glamo_engine_suspend(glamo, n);
++ break;
++ case GLAMO_ENGINE_ENABLED:
++ __glamo_engine_enable(glamo, n);
++ break;
++ default:
++ break;
++ }
++ }
++
++ __reg_write(glamo, GLAMO_REG_IRQ_ENABLE, glamo->saved_irq_mask);
++
++ spin_unlock(&glamo->lock);
++
++ return 0;
++}
++
++static const struct dev_pm_ops glamo_pm_ops = {
++ .suspend = glamo_suspend,
++ .resume = glamo_resume,
++ .poweroff = glamo_suspend,
++ .restore = glamo_resume,
++};
++
++#define GLAMO_PM_OPS (&glamo_pm_ops)
++
++#else
++#define GLAMO_PM_OPS NULL
++#endif
++
++static struct platform_driver glamo_driver = {
++ .probe = glamo_probe,
++ .remove = __devexit_p(glamo_remove),
++ .driver = {
++ .name = "glamo3362",
++ .owner = THIS_MODULE,
++ .pm = GLAMO_PM_OPS,
++ },
++};
++
++static int __init glamo_init(void)
++{
++ return platform_driver_register(&glamo_driver);
++}
++module_init(glamo_init);
++
++static void __exit glamo_exit(void)
++{
++ platform_driver_unregister(&glamo_driver);
++}
++module_exit(glamo_exit);
++
++MODULE_AUTHOR("Harald Welte <laforge@openmoko.org>");
++MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
++MODULE_DESCRIPTION("Smedia Glamo 3362 core/resource driver");
++MODULE_LICENSE("GPL");
++MODULE_ALIAS("platform:glamo3362");
+diff --git a/drivers/mfd/pcf50633-adc.c b/drivers/mfd/pcf50633-adc.c
+index aed0d2a..54a78c1 100644
+--- a/drivers/mfd/pcf50633-adc.c
++++ b/drivers/mfd/pcf50633-adc.c
+@@ -24,6 +24,8 @@
+ #include <linux/platform_device.h>
+ #include <linux/completion.h>
+
++#include <linux/interrupt.h>
++
+ #include <linux/mfd/pcf50633/core.h>
+ #include <linux/mfd/pcf50633/adc.h>
+
+@@ -49,13 +51,9 @@ struct pcf50633_adc {
+ int queue_head;
+ int queue_tail;
+ struct mutex queue_mutex;
++ int irq;
+ };
+
+-static inline struct pcf50633_adc *__to_adc(struct pcf50633 *pcf)
+-{
+- return platform_get_drvdata(pcf->adc_pdev);
+-}
+-
+ static void adc_setup(struct pcf50633 *pcf, int channel, int avg)
+ {
+ channel &= PCF50633_ADCC1_ADCMUX_MASK;
+@@ -71,7 +69,7 @@ static void adc_setup(struct pcf50633 *pcf, int channel, int avg)
+
+ static void trigger_next_adc_job_if_any(struct pcf50633 *pcf)
+ {
+- struct pcf50633_adc *adc = __to_adc(pcf);
++ struct pcf50633_adc *adc = pcf->adc;
+ int head;
+
+ head = adc->queue_head;
+@@ -85,7 +83,7 @@ static void trigger_next_adc_job_if_any(struct pcf50633 *pcf)
+ static int
+ adc_enqueue_request(struct pcf50633 *pcf, struct pcf50633_adc_request *req)
+ {
+- struct pcf50633_adc *adc = __to_adc(pcf);
++ struct pcf50633_adc *adc = pcf->adc;
+ int head, tail;
+
+ mutex_lock(&adc->queue_mutex);
+@@ -170,7 +168,7 @@ static int adc_result(struct pcf50633 *pcf)
+ return result;
+ }
+
+-static void pcf50633_adc_irq(int irq, void *data)
++static irqreturn_t pcf50633_adc_irq(int irq, void *data)
+ {
+ struct pcf50633_adc *adc = data;
+ struct pcf50633 *pcf = adc->pcf;
+@@ -184,7 +182,7 @@ static void pcf50633_adc_irq(int irq, void *data)
+ if (WARN_ON(!req)) {
+ dev_err(pcf->dev, "pcf50633-adc irq: ADC queue empty!\n");
+ mutex_unlock(&adc->queue_mutex);
+- return;
++ return IRQ_HANDLED;
+ }
+ adc->queue[head] = NULL;
+ adc->queue_head = (head + 1) &
+@@ -197,25 +195,49 @@ static void pcf50633_adc_irq(int irq, void *data)
+
+ req->callback(pcf, req->callback_param, res);
+ kfree(req);
++
++ return IRQ_HANDLED;
+ }
+
+ static int __devinit pcf50633_adc_probe(struct platform_device *pdev)
+ {
++ struct pcf50633 *pcf = dev_to_pcf50633(pdev->dev.parent);
+ struct pcf50633_adc *adc;
++ int irq;
++ int ret;
+
+ adc = kzalloc(sizeof(*adc), GFP_KERNEL);
+ if (!adc)
+ return -ENOMEM;
+
+- adc->pcf = dev_to_pcf50633(pdev->dev.parent);
++ adc->pcf = pcf;
+ platform_set_drvdata(pdev, adc);
+
+- pcf50633_register_irq(adc->pcf, PCF50633_IRQ_ADCRDY,
+- pcf50633_adc_irq, adc);
++ irq = platform_get_irq(pdev, 0);
++ if (irq <= 0) {
++ ret = irq;
++ dev_err(&pdev->dev, "Failed to get irq: %d\n", ret);
++ goto err_free;
++ }
+
+ mutex_init(&adc->queue_mutex);
+
++ ret = request_threaded_irq(irq, NULL, pcf50633_adc_irq, 0,
++ dev_name(&pdev->dev), adc);
++ if (ret) {
++ dev_err(&pdev->dev, "Failed to request irq: %d\n", ret);
++ goto err_free;
++ }
++
++ adc->irq = irq;
++
++ pcf->adc = adc;
++
+ return 0;
++
++err_free:
++ kfree(adc);
++ return ret;
+ }
+
+ static int __devexit pcf50633_adc_remove(struct platform_device *pdev)
+@@ -223,7 +245,9 @@ static int __devexit pcf50633_adc_remove(struct platform_device *pdev)
+ struct pcf50633_adc *adc = platform_get_drvdata(pdev);
+ int i, head;
+
+- pcf50633_free_irq(adc->pcf, PCF50633_IRQ_ADCRDY);
++ adc->pcf->adc = NULL;
++
++ free_irq(adc->irq, adc);
+
+ mutex_lock(&adc->queue_mutex);
+ head = adc->queue_head;
+diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c
+index 57868416..165a3f3 100644
+--- a/drivers/mfd/pcf50633-core.c
++++ b/drivers/mfd/pcf50633-core.c
+@@ -24,6 +24,8 @@
+ #include <linux/pm.h>
+ #include <linux/slab.h>
+
++#include <linux/mfd/core.h>
++
+ #include <linux/mfd/pcf50633/core.h>
+
+ static int __pcf50633_read(struct pcf50633 *pcf, u8 reg, int num, u8 *data)
+@@ -51,7 +53,7 @@ static int __pcf50633_write(struct pcf50633 *pcf, u8 reg, int num, u8 *data)
+
+ }
+
+-/* Read a block of up to 32 regs */
++/* Read a block of upto 32 regs */
+ int pcf50633_read_block(struct pcf50633 *pcf, u8 reg,
+ int nr_regs, u8 *data)
+ {
+@@ -65,7 +67,7 @@ int pcf50633_read_block(struct pcf50633 *pcf, u8 reg,
+ }
+ EXPORT_SYMBOL_GPL(pcf50633_read_block);
+
+-/* Write a block of up to 32 regs */
++/* Write a block of upto 32 regs */
+ int pcf50633_write_block(struct pcf50633 *pcf , u8 reg,
+ int nr_regs, u8 *data)
+ {
+@@ -209,27 +211,6 @@ static struct attribute_group pcf_attr_group = {
+ .attrs = pcf_sysfs_entries,
+ };
+
+-static void
+-pcf50633_client_dev_register(struct pcf50633 *pcf, const char *name,
+- struct platform_device **pdev)
+-{
+- int ret;
+-
+- *pdev = platform_device_alloc(name, -1);
+- if (!*pdev) {
+- dev_err(pcf->dev, "Falied to allocate %s\n", name);
+- return;
+- }
+-
+- (*pdev)->dev.parent = pcf->dev;
+-
+- ret = platform_device_add(*pdev);
+- if (ret) {
+- dev_err(pcf->dev, "Failed to register %s: %d\n", name, ret);
+- platform_device_put(*pdev);
+- *pdev = NULL;
+- }
+-}
+
+ #ifdef CONFIG_PM_SLEEP
+ static int pcf50633_suspend(struct device *dev)
+@@ -251,12 +232,166 @@ static int pcf50633_resume(struct device *dev)
+
+ static SIMPLE_DEV_PM_OPS(pcf50633_pm, pcf50633_suspend, pcf50633_resume);
+
++#define PCF50633_CELL(_name) \
++ { \
++ .name = _name, \
++ .id = -1, \
++ } \
++
++#define PCF50633_CELL_RESOURCES(_name, _resources) \
++ { \
++ .name = _name, \
++ .num_resources = ARRAY_SIZE(_resources), \
++ .resources = _resources, \
++ .id = -1, \
++ } \
++
++#define PCF50633_CELL_ID(_name, _id) \
++ { \
++ .name = _name, \
++ .id = _id, \
++ } \
++
++static struct resource pcf50633_adc_resources[] = {
++ {
++ .start = PCF50633_IRQ_ADCRDY,
++ .end = PCF50633_IRQ_ADCRDY,
++ .flags = IORESOURCE_IRQ,
++ .name = "ADCRDY",
++ }
++};
++
++static struct resource pcf50633_input_resources[] = {
++ {
++ .start = PCF50633_IRQ_ONKEYR,
++ .end = PCF50633_IRQ_ONKEYR,
++ .flags = IORESOURCE_IRQ,
++ .name = "ONKEYR",
++ },
++ {
++ .start = PCF50633_IRQ_ONKEYF,
++ .end = PCF50633_IRQ_ONKEYF,
++ .flags = IORESOURCE_IRQ,
++ .name = "ONKEYF",
++ }
++};
++
++static struct resource pcf50633_rtc_resources[] = {
++ {
++ .start = PCF50633_IRQ_ALARM,
++ .end = PCF50633_IRQ_ALARM,
++ .flags = IORESOURCE_IRQ,
++ .name = "ALARM",
++ },
++ {
++ .start = PCF50633_IRQ_SECOND,
++ .end = PCF50633_IRQ_SECOND,
++ .flags = IORESOURCE_IRQ,
++ .name = "SECOND",
++ }
++};
++
++static struct resource pcf50633_mbc_resources[] = {
++ {
++ .start = PCF50633_IRQ_ADPINS,
++ .end = PCF50633_IRQ_ADPINS,
++ .flags = IORESOURCE_IRQ,
++ .name = "ADPINS",
++ },
++ {
++ .start = PCF50633_IRQ_ADPREM,
++ .end = PCF50633_IRQ_ADPREM,
++ .flags = IORESOURCE_IRQ,
++ .name = "ADPREM",
++ },
++ {
++ .start = PCF50633_IRQ_USBINS,
++ .end = PCF50633_IRQ_USBINS,
++ .flags = IORESOURCE_IRQ,
++ .name = "USBINS",
++ },
++ {
++ .start = PCF50633_IRQ_USBREM,
++ .end = PCF50633_IRQ_USBREM,
++ .flags = IORESOURCE_IRQ,
++ .name = "USBREM",
++ },
++ {
++ .start = PCF50633_IRQ_BATFULL,
++ .end = PCF50633_IRQ_BATFULL,
++ .flags = IORESOURCE_IRQ,
++ .name = "BATFULL",
++ },
++ {
++ .start = PCF50633_IRQ_CHGHALT,
++ .end = PCF50633_IRQ_CHGHALT,
++ .flags = IORESOURCE_IRQ,
++ .name = "CHGHALT",
++ },
++ {
++ .start = PCF50633_IRQ_THLIMON,
++ .end = PCF50633_IRQ_THLIMON,
++ .flags = IORESOURCE_IRQ,
++ .name = "THLIMON",
++ },
++ {
++ .start = PCF50633_IRQ_THLIMOFF,
++ .end = PCF50633_IRQ_THLIMOFF,
++ .flags = IORESOURCE_IRQ,
++ .name = "THLIMOFF",
++ },
++ {
++ .start = PCF50633_IRQ_USBLIMON,
++ .end = PCF50633_IRQ_USBLIMON,
++ .flags = IORESOURCE_IRQ,
++ .name = "USBLIMON",
++ },
++ {
++ .start = PCF50633_IRQ_USBLIMOFF,
++ .end = PCF50633_IRQ_USBLIMOFF,
++ .flags = IORESOURCE_IRQ,
++ .name = "USBLIMOFF",
++ },
++ {
++ .start = PCF50633_IRQ_LOWSYS,
++ .end = PCF50633_IRQ_LOWSYS,
++ .flags = IORESOURCE_IRQ,
++ .name = "LOWSYS",
++ },
++ {
++ .start = PCF50633_IRQ_LOWBAT,
++ .end = PCF50633_IRQ_LOWBAT,
++ .flags = IORESOURCE_IRQ,
++ .name = "LOWBAT",
++ },
++};
++
++static struct mfd_cell pcf50633_cells[] = {
++ PCF50633_CELL_RESOURCES("pcf50633-input", pcf50633_input_resources),
++ PCF50633_CELL_RESOURCES("pcf50633-rtc", pcf50633_rtc_resources),
++ PCF50633_CELL_RESOURCES("pcf50633-mbc", pcf50633_mbc_resources),
++ PCF50633_CELL_RESOURCES("pcf50633-adc", pcf50633_adc_resources),
++ PCF50633_CELL("pcf50633-backlight"),
++ PCF50633_CELL("pcf50633-gpio"),
++ PCF50633_CELL_ID("pcf50633-regltr", 0),
++ PCF50633_CELL_ID("pcf50633-regltr", 1),
++ PCF50633_CELL_ID("pcf50633-regltr", 2),
++ PCF50633_CELL_ID("pcf50633-regltr", 3),
++ PCF50633_CELL_ID("pcf50633-regltr", 4),
++ PCF50633_CELL_ID("pcf50633-regltr", 5),
++ PCF50633_CELL_ID("pcf50633-regltr", 6),
++ PCF50633_CELL_ID("pcf50633-regltr", 7),
++ PCF50633_CELL_ID("pcf50633-regltr", 8),
++ PCF50633_CELL_ID("pcf50633-regltr", 9),
++ PCF50633_CELL_ID("pcf50633-regltr", 10),
++};
++
+ static int __devinit pcf50633_probe(struct i2c_client *client,
+ const struct i2c_device_id *ids)
+ {
+ struct pcf50633 *pcf;
+ struct pcf50633_platform_data *pdata = client->dev.platform_data;
+- int i, ret;
++ int ret;
+ int version, variant;
+
+ if (!client->irq) {
+@@ -287,36 +422,15 @@ static int __devinit pcf50633_probe(struct i2c_client *client,
+ dev_info(pcf->dev, "Probed device version %d variant %d\n",
+ version, variant);
+
+- pcf50633_irq_init(pcf, client->irq);
+-
+- /* Create sub devices */
+- pcf50633_client_dev_register(pcf, "pcf50633-input",
+- &pcf->input_pdev);
+- pcf50633_client_dev_register(pcf, "pcf50633-rtc",
+- &pcf->rtc_pdev);
+- pcf50633_client_dev_register(pcf, "pcf50633-mbc",
+- &pcf->mbc_pdev);
+- pcf50633_client_dev_register(pcf, "pcf50633-adc",
+- &pcf->adc_pdev);
+- pcf50633_client_dev_register(pcf, "pcf50633-backlight",
+- &pcf->bl_pdev);
+-
+-
+- for (i = 0; i < PCF50633_NUM_REGULATORS; i++) {
+- struct platform_device *pdev;
+-
+- pdev = platform_device_alloc("pcf50633-regltr", i);
+- if (!pdev) {
+- dev_err(pcf->dev, "Cannot create regulator %d\n", i);
+- continue;
+- }
+-
+- pdev->dev.parent = pcf->dev;
+- platform_device_add_data(pdev, &pdata->reg_init_data[i],
+- sizeof(pdata->reg_init_data[i]));
+- pcf->regulator_pdev[i] = pdev;
++ ret = pcf50633_irq_init(pcf, client->irq);
++ if (ret)
++ goto err_free;
+
+- platform_device_add(pdev);
++ ret = mfd_add_devices(pcf->dev, 0, pcf50633_cells,
++ ARRAY_SIZE(pcf50633_cells), NULL, pcf->irq_base);
++ if (ret) {
++ dev_err(pcf->dev, "Failed to add mfd cells.\n");
++ goto err_irq_free;
+ }
+
+ ret = sysfs_create_group(&client->dev.kobj, &pcf_attr_group);
+@@ -328,6 +442,8 @@ static int __devinit pcf50633_probe(struct i2c_client *client,
+
+ return 0;
+
++err_irq_free:
++ pcf50633_irq_free(pcf);
+ err_free:
+ kfree(pcf);
+
+@@ -337,19 +453,12 @@ err_free:
+ static int __devexit pcf50633_remove(struct i2c_client *client)
+ {
+ struct pcf50633 *pcf = i2c_get_clientdata(client);
+- int i;
+
+ sysfs_remove_group(&client->dev.kobj, &pcf_attr_group);
+- pcf50633_irq_free(pcf);
+
+- platform_device_unregister(pcf->input_pdev);
+- platform_device_unregister(pcf->rtc_pdev);
+- platform_device_unregister(pcf->mbc_pdev);
+- platform_device_unregister(pcf->adc_pdev);
+- platform_device_unregister(pcf->bl_pdev);
++ mfd_remove_devices(pcf->dev);
+
+- for (i = 0; i < PCF50633_NUM_REGULATORS; i++)
+- platform_device_unregister(pcf->regulator_pdev[i]);
++ pcf50633_irq_free(pcf);
+
+ kfree(pcf);
+
+diff --git a/drivers/mfd/pcf50633-gpio.c b/drivers/mfd/pcf50633-gpio.c
+deleted file mode 100644
+index 9ab19a8..0000000
+--- a/drivers/mfd/pcf50633-gpio.c
++++ /dev/null
+@@ -1,121 +0,0 @@
+-/* NXP PCF50633 GPIO Driver
+- *
+- * (C) 2006-2008 by Openmoko, Inc.
+- * Author: Balaji Rao <balajirrao@openmoko.org>
+- * All rights reserved.
+- *
+- * Broken down from monstrous PCF50633 driver mainly by
+- * Harald Welte, Andy Green and Werner Almesberger
+- *
+- * This program is free software; you can redistribute it and/or modify it
+- * under the terms of the GNU General Public License as published by the
+- * Free Software Foundation; either version 2 of the License, or (at your
+- * option) any later version.
+- *
+- */
+-
+-#include <linux/kernel.h>
+-#include <linux/module.h>
+-
+-#include <linux/mfd/pcf50633/core.h>
+-#include <linux/mfd/pcf50633/gpio.h>
+-
+-enum pcf50633_regulator_id {
+- PCF50633_REGULATOR_AUTO,
+- PCF50633_REGULATOR_DOWN1,
+- PCF50633_REGULATOR_DOWN2,
+- PCF50633_REGULATOR_LDO1,
+- PCF50633_REGULATOR_LDO2,
+- PCF50633_REGULATOR_LDO3,
+- PCF50633_REGULATOR_LDO4,
+- PCF50633_REGULATOR_LDO5,
+- PCF50633_REGULATOR_LDO6,
+- PCF50633_REGULATOR_HCLDO,
+- PCF50633_REGULATOR_MEMLDO,
+-};
+-
+-#define PCF50633_REG_AUTOOUT 0x1a
+-#define PCF50633_REG_DOWN1OUT 0x1e
+-#define PCF50633_REG_DOWN2OUT 0x22
+-#define PCF50633_REG_MEMLDOOUT 0x26
+-#define PCF50633_REG_LDO1OUT 0x2d
+-#define PCF50633_REG_LDO2OUT 0x2f
+-#define PCF50633_REG_LDO3OUT 0x31
+-#define PCF50633_REG_LDO4OUT 0x33
+-#define PCF50633_REG_LDO5OUT 0x35
+-#define PCF50633_REG_LDO6OUT 0x37
+-#define PCF50633_REG_HCLDOOUT 0x39
+-
+-static const u8 pcf50633_regulator_registers[PCF50633_NUM_REGULATORS] = {
+- [PCF50633_REGULATOR_AUTO] = PCF50633_REG_AUTOOUT,
+- [PCF50633_REGULATOR_DOWN1] = PCF50633_REG_DOWN1OUT,
+- [PCF50633_REGULATOR_DOWN2] = PCF50633_REG_DOWN2OUT,
+- [PCF50633_REGULATOR_MEMLDO] = PCF50633_REG_MEMLDOOUT,
+- [PCF50633_REGULATOR_LDO1] = PCF50633_REG_LDO1OUT,
+- [PCF50633_REGULATOR_LDO2] = PCF50633_REG_LDO2OUT,
+- [PCF50633_REGULATOR_LDO3] = PCF50633_REG_LDO3OUT,
+- [PCF50633_REGULATOR_LDO4] = PCF50633_REG_LDO4OUT,
+- [PCF50633_REGULATOR_LDO5] = PCF50633_REG_LDO5OUT,
+- [PCF50633_REGULATOR_LDO6] = PCF50633_REG_LDO6OUT,
+- [PCF50633_REGULATOR_HCLDO] = PCF50633_REG_HCLDOOUT,
+-};
+-
+-int pcf50633_gpio_set(struct pcf50633 *pcf, int gpio, u8 val)
+-{
+- u8 reg;
+-
+- reg = gpio - PCF50633_GPIO1 + PCF50633_REG_GPIO1CFG;
+-
+- return pcf50633_reg_set_bit_mask(pcf, reg, 0x07, val);
+-}
+-EXPORT_SYMBOL_GPL(pcf50633_gpio_set);
+-
+-u8 pcf50633_gpio_get(struct pcf50633 *pcf, int gpio)
+-{
+- u8 reg, val;
+-
+- reg = gpio - PCF50633_GPIO1 + PCF50633_REG_GPIO1CFG;
+- val = pcf50633_reg_read(pcf, reg) & 0x07;
+-
+- return val;
+-}
+-EXPORT_SYMBOL_GPL(pcf50633_gpio_get);
+-
+-int pcf50633_gpio_invert_set(struct pcf50633 *pcf, int gpio, int invert)
+-{
+- u8 val, reg;
+-
+- reg = gpio - PCF50633_GPIO1 + PCF50633_REG_GPIO1CFG;
+- val = !!invert << 3;
+-
+- return pcf50633_reg_set_bit_mask(pcf, reg, 1 << 3, val);
+-}
+-EXPORT_SYMBOL_GPL(pcf50633_gpio_invert_set);
+-
+-int pcf50633_gpio_invert_get(struct pcf50633 *pcf, int gpio)
+-{
+- u8 reg, val;
+-
+- reg = gpio - PCF50633_GPIO1 + PCF50633_REG_GPIO1CFG;
+- val = pcf50633_reg_read(pcf, reg);
+-
+- return val & (1 << 3);
+-}
+-EXPORT_SYMBOL_GPL(pcf50633_gpio_invert_get);
+-
+-int pcf50633_gpio_power_supply_set(struct pcf50633 *pcf,
+- int gpio, int regulator, int on)
+-{
+- u8 reg, val, mask;
+-
+- /* the *ENA register is always one after the *OUT register */
+- reg = pcf50633_regulator_registers[regulator] + 1;
+-
+- val = !!on << (gpio - PCF50633_GPIO1);
+- mask = 1 << (gpio - PCF50633_GPIO1);
+-
+- return pcf50633_reg_set_bit_mask(pcf, reg, mask, val);
+-}
+-EXPORT_SYMBOL_GPL(pcf50633_gpio_power_supply_set);
+-
+-MODULE_LICENSE("GPL");
+diff --git a/drivers/mfd/pcf50633-irq.c b/drivers/mfd/pcf50633-irq.c
+index 1b0192f..4b8269c 100644
+--- a/drivers/mfd/pcf50633-irq.c
++++ b/drivers/mfd/pcf50633-irq.c
+@@ -2,7 +2,7 @@
+ *
+ * (C) 2006-2008 by Openmoko, Inc.
+ * Author: Harald Welte <laforge@openmoko.org>
+- * Balaji Rao <balajirrao@openmoko.org>
++ * Balaji Rao <balajirrao@openmoko.org>
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+@@ -12,6 +12,7 @@
+ *
+ */
+
++#include <linux/irq.h>
+ #include <linux/interrupt.h>
+ #include <linux/kernel.h>
+ #include <linux/mutex.h>
+@@ -25,92 +26,63 @@
+ #define PCF50633_MBCS1_USBPRES 0x01
+ #define PCF50633_MBCS1_ADAPTPRES 0x01
+
+-int pcf50633_register_irq(struct pcf50633 *pcf, int irq,
+- void (*handler) (int, void *), void *data)
++static void pcf50633_irq_lock(struct irq_data *data)
+ {
+- if (irq < 0 || irq >= PCF50633_NUM_IRQ || !handler)
+- return -EINVAL;
++ struct pcf50633 *pcf = irq_data_get_irq_chip_data(data);
+
+- if (WARN_ON(pcf->irq_handler[irq].handler))
+- return -EBUSY;
+-
+- mutex_lock(&pcf->lock);
+- pcf->irq_handler[irq].handler = handler;
+- pcf->irq_handler[irq].data = data;
+- mutex_unlock(&pcf->lock);
+-
+- return 0;
++ mutex_lock(&pcf->irq_lock);
+ }
+-EXPORT_SYMBOL_GPL(pcf50633_register_irq);
+
+-int pcf50633_free_irq(struct pcf50633 *pcf, int irq)
++static void pcf50633_irq_sync_unlock(struct irq_data *data)
+ {
+- if (irq < 0 || irq >= PCF50633_NUM_IRQ)
+- return -EINVAL;
++ struct pcf50633 *pcf = irq_data_get_irq_chip_data(data);
++ unsigned int i;
+
+- mutex_lock(&pcf->lock);
+- pcf->irq_handler[irq].handler = NULL;
+- mutex_unlock(&pcf->lock);
++ for (i = 0; i < ARRAY_SIZE(pcf->mask_regs); ++i) {
++ if (pcf->mask_regs[i] == pcf->mask_regs_cur[i])
++ continue;
+
+- return 0;
++ pcf->mask_regs[i] = pcf->mask_regs_cur[i];
++ pcf50633_reg_write(pcf, PCF50633_REG_INT1M + i,
++ pcf->mask_regs[i]);
++ }
++
++ mutex_unlock(&pcf->irq_lock);
+ }
+-EXPORT_SYMBOL_GPL(pcf50633_free_irq);
+
+-static int __pcf50633_irq_mask_set(struct pcf50633 *pcf, int irq, u8 mask)
++static void pcf50633_irq_mask(struct irq_data *data)
+ {
+- u8 reg, bit;
+- int ret = 0, idx;
++ struct pcf50633 *pcf = irq_data_get_irq_chip_data(data);
++ int irq = data->irq;
++ u8 bit;
++ int idx;
+
+ idx = irq >> 3;
+- reg = PCF50633_REG_INT1M + idx;
+ bit = 1 << (irq & 0x07);
+
+- pcf50633_reg_set_bit_mask(pcf, reg, bit, mask ? bit : 0);
+-
+- mutex_lock(&pcf->lock);
+-
+- if (mask)
+- pcf->mask_regs[idx] |= bit;
+- else
+- pcf->mask_regs[idx] &= ~bit;
+-
+- mutex_unlock(&pcf->lock);
+-
+- return ret;
++ pcf->mask_regs[idx] |= bit;
+ }
+
+-int pcf50633_irq_mask(struct pcf50633 *pcf, int irq)
++static void pcf50633_irq_unmask(struct irq_data *data)
+ {
+- dev_dbg(pcf->dev, "Masking IRQ %d\n", irq);
++ struct pcf50633 *pcf = irq_data_get_irq_chip_data(data);
++ int irq = data->irq;
++ u8 bit;
++ int idx;
+
+- return __pcf50633_irq_mask_set(pcf, irq, 1);
+-}
+-EXPORT_SYMBOL_GPL(pcf50633_irq_mask);
+-
+-int pcf50633_irq_unmask(struct pcf50633 *pcf, int irq)
+-{
+- dev_dbg(pcf->dev, "Unmasking IRQ %d\n", irq);
++ idx = irq >> 3;
++ bit = 1 << (irq & 0x07);
+
+- return __pcf50633_irq_mask_set(pcf, irq, 0);
++ pcf->mask_regs[idx] &= ~bit;
+ }
+-EXPORT_SYMBOL_GPL(pcf50633_irq_unmask);
+
+-int pcf50633_irq_mask_get(struct pcf50633 *pcf, int irq)
+-{
+- u8 reg, bits;
+-
+- reg = irq >> 3;
+- bits = 1 << (irq & 0x07);
+-
+- return pcf->mask_regs[reg] & bits;
+-}
+-EXPORT_SYMBOL_GPL(pcf50633_irq_mask_get);
+-
+-static void pcf50633_irq_call_handler(struct pcf50633 *pcf, int irq)
+-{
+- if (pcf->irq_handler[irq].handler)
+- pcf->irq_handler[irq].handler(irq, pcf->irq_handler[irq].data);
+-}
++static struct irq_chip pcf50633_irq_chip = {
++ .name = "pcf50633-irq",
++ .irq_mask = pcf50633_irq_mask,
++ .irq_unmask = pcf50633_irq_unmask,
++ .irq_bus_lock = pcf50633_irq_lock,
++ .irq_bus_sync_unlock = pcf50633_irq_sync_unlock,
++};
+
+ /* Maximum amount of time ONKEY is held before emergency action is taken */
+ #define PCF50633_ONKEY1S_TIMEOUT 8
+@@ -214,13 +186,16 @@ static irqreturn_t pcf50633_irq(int irq, void *data)
+ pcf_int[1] &= ~(PCF50633_INT2_ONKEYR | PCF50633_INT2_ONKEYF);
+ }
+
++ irq = pcf->irq_base;
+ for (i = 0; i < ARRAY_SIZE(pcf_int); i++) {
+ /* Unset masked interrupts */
+ pcf_int[i] &= ~pcf->mask_regs[i];
+
+- for (j = 0; j < 8 ; j++)
++ for (j = 0; j < 8 ; j++) {
+ if (pcf_int[i] & (1 << j))
+- pcf50633_irq_call_handler(pcf, (i * 8) + j);
++ handle_nested_irq(irq);
++ ++irq;
++ }
+ }
+
+ out:
+@@ -240,15 +215,6 @@ int pcf50633_irq_suspend(struct pcf50633 *pcf)
+ * henceforth */
+ disable_irq(pcf->irq);
+
+- /* Save the masks */
+- ret = pcf50633_read_block(pcf, PCF50633_REG_INT1M,
+- ARRAY_SIZE(pcf->suspend_irq_masks),
+- pcf->suspend_irq_masks);
+- if (ret < 0) {
+- dev_err(pcf->dev, "error saving irq masks\n");
+- goto out;
+- }
+-
+ /* Write wakeup irq masks */
+ for (i = 0; i < ARRAY_SIZE(res); i++)
+ res[i] = ~pcf->pdata->resumers[i];
+@@ -272,8 +238,8 @@ int pcf50633_irq_resume(struct pcf50633 *pcf)
+
+ /* Write the saved mask registers */
+ ret = pcf50633_write_block(pcf, PCF50633_REG_INT1M,
+- ARRAY_SIZE(pcf->suspend_irq_masks),
+- pcf->suspend_irq_masks);
++ ARRAY_SIZE(pcf->mask_regs),
++ pcf->mask_regs);
+ if (ret < 0)
+ dev_err(pcf->dev, "Error restoring saved suspend masks\n");
+
+@@ -286,33 +252,61 @@ int pcf50633_irq_resume(struct pcf50633 *pcf)
+
+ int pcf50633_irq_init(struct pcf50633 *pcf, int irq)
+ {
++ int irq_base;
+ int ret;
++ int i;
+
++ irq_base = irq_alloc_descs(-1, 0, PCF50633_NUM_IRQ, 0);
++ if (irq_base < 0) {
++ dev_err(pcf->dev, "Failed to allocate irq descs: %d\n", irq_base);
++ return irq_base;
++ }
++
++ mutex_init(&pcf->irq_lock);
+ pcf->irq = irq;
++ pcf->irq_base = irq_base;
++
++ /* Mask all irqs */
++ for (i = 0; i < 5; ++i)
++ pcf->mask_regs[i] = 0xff;
+
+- /* Enable all interrupts except RTC SECOND */
+- pcf->mask_regs[0] = 0x80;
+- pcf50633_reg_write(pcf, PCF50633_REG_INT1M, pcf->mask_regs[0]);
+- pcf50633_reg_write(pcf, PCF50633_REG_INT2M, 0x00);
+- pcf50633_reg_write(pcf, PCF50633_REG_INT3M, 0x00);
+- pcf50633_reg_write(pcf, PCF50633_REG_INT4M, 0x00);
+- pcf50633_reg_write(pcf, PCF50633_REG_INT5M, 0x00);
++ ret = pcf50633_write_block(pcf, PCF50633_REG_INT1M,
++ ARRAY_SIZE(pcf->mask_regs), pcf->mask_regs);
++ if (ret < 0)
++ goto err_irq_free_descs;
++
++
++ for (i = irq_base; i < irq_base + PCF50633_NUM_IRQ; ++i) {
++ irq_set_chip_data(i, pcf);
++ irq_set_nested_thread(i, 1);
++ irq_set_chip_and_handler(i, &pcf50633_irq_chip, handle_simple_irq);
++ irq_modify_status(i, IRQ_NOREQUEST, IRQ_NOPROBE);
++ }
+
+ ret = request_threaded_irq(irq, NULL, pcf50633_irq,
+ IRQF_TRIGGER_LOW | IRQF_ONESHOT,
+ "pcf50633", pcf);
+
+- if (ret)
++ if (ret) {
+ dev_err(pcf->dev, "Failed to request IRQ %d\n", ret);
++ goto err_irq_free_descs;
++ }
+
+ if (enable_irq_wake(irq) < 0)
+ dev_err(pcf->dev, "IRQ %u cannot be enabled as wake-up source"
+ "in this hardware revision", irq);
+
++
++ return 0;
++
++err_irq_free_descs:
++ irq_free_descs(pcf->irq_base, PCF50633_NUM_IRQ);
++
+ return ret;
+ }
+
+ void pcf50633_irq_free(struct pcf50633 *pcf)
+ {
+ free_irq(pcf->irq, pcf);
++ irq_free_descs(pcf->irq_base, PCF50633_NUM_IRQ);
+ }
+diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
+index 61d233a..4b530ae 100644
+--- a/drivers/mmc/card/block.c
++++ b/drivers/mmc/card/block.c
+@@ -79,6 +79,13 @@ struct mmc_blk_data {
+
+ static DEFINE_MUTEX(open_lock);
+
++enum mmc_blk_status {
++ MMC_BLK_SUCCESS = 0,
++ MMC_BLK_RETRY,
++ MMC_BLK_DATA_ERR,
++ MMC_BLK_CMD_ERR,
++};
++
+ module_param(perdev_minors, int, 0444);
+ MODULE_PARM_DESC(perdev_minors, "Minors numbers to allocate per device");
+
+@@ -165,13 +172,6 @@ static const struct block_device_operations mmc_bdops = {
+ .owner = THIS_MODULE,
+ };
+
+-struct mmc_blk_request {
+- struct mmc_request mrq;
+- struct mmc_command cmd;
+- struct mmc_command stop;
+- struct mmc_data data;
+-};
+-
+ static u32 mmc_sd_num_wr_blocks(struct mmc_card *card)
+ {
+ int err;
+@@ -331,200 +331,341 @@ out:
+ return err ? 0 : 1;
+ }
+
+-static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *req)
++static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
++ struct mmc_card *card,
++ int disable_multi,
++ struct mmc_queue *mq)
+ {
+- struct mmc_blk_data *md = mq->data;
+- struct mmc_card *card = md->queue.card;
+- struct mmc_blk_request brq;
+- int ret = 1, disable_multi = 0;
++ u32 readcmd, writecmd;
++ struct mmc_blk_request *brq = &mqrq->brq;
++ struct request *req = mqrq->req;
+
+- mmc_claim_host(card->host);
++ memset(brq, 0, sizeof(struct mmc_blk_request));
+
+- do {
+- struct mmc_command cmd;
+- u32 readcmd, writecmd, status = 0;
+-
+- memset(&brq, 0, sizeof(struct mmc_blk_request));
+- brq.mrq.cmd = &brq.cmd;
+- brq.mrq.data = &brq.data;
+-
+- brq.cmd.arg = blk_rq_pos(req);
+- if (!mmc_card_blockaddr(card))
+- brq.cmd.arg <<= 9;
+- brq.cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_ADTC;
+- brq.data.blksz = 512;
+- brq.stop.opcode = MMC_STOP_TRANSMISSION;
+- brq.stop.arg = 0;
+- brq.stop.flags = MMC_RSP_SPI_R1B | MMC_RSP_R1B | MMC_CMD_AC;
+- brq.data.blocks = blk_rq_sectors(req);
++ brq->mrq.cmd = &brq->cmd;
++ brq->mrq.data = &brq->data;
+
+- /*
+- * The block layer doesn't support all sector count
+- * restrictions, so we need to be prepared for too big
+- * requests.
+- */
+- if (brq.data.blocks > card->host->max_blk_count)
+- brq.data.blocks = card->host->max_blk_count;
++ brq->cmd.arg = blk_rq_pos(req);
++ if (!mmc_card_blockaddr(card))
++ brq->cmd.arg <<= 9;
++ brq->cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_ADTC;
++ brq->data.blksz = 512;
++ brq->stop.opcode = MMC_STOP_TRANSMISSION;
++ brq->stop.arg = 0;
++ brq->stop.flags = MMC_RSP_SPI_R1B | MMC_RSP_R1B | MMC_CMD_AC;
++ brq->data.blocks = blk_rq_sectors(req);
+
+- /*
+- * After a read error, we redo the request one sector at a time
+- * in order to accurately determine which sectors can be read
+- * successfully.
++ /*
++ * The block layer doesn't support all sector count
++ * restrictions, so we need to be prepared for too big
++ * requests.
++ */
++ if (brq->data.blocks > card->host->max_blk_count)
++ brq->data.blocks = card->host->max_blk_count;
++
++ /*
++ * After a read error, we redo the request one sector at a time
++ * in order to accurately determine which sectors can be read
++ * successfully.
++ */
++ if (disable_multi && brq->data.blocks > 1)
++ brq->data.blocks = 1;
++
++ if (brq->data.blocks > 1) {
++ /* SPI multiblock writes terminate using a special
++ * token, not a STOP_TRANSMISSION request.
+ */
+- if (disable_multi && brq.data.blocks > 1)
+- brq.data.blocks = 1;
++ if (!mmc_host_is_spi(card->host)
++ || rq_data_dir(req) == READ)
++ brq->mrq.stop = &brq->stop;
++ readcmd = MMC_READ_MULTIPLE_BLOCK;
++ writecmd = MMC_WRITE_MULTIPLE_BLOCK;
++ } else {
++ brq->mrq.stop = NULL;
++ readcmd = MMC_READ_SINGLE_BLOCK;
++ writecmd = MMC_WRITE_BLOCK;
++ }
++ if (rq_data_dir(req) == READ) {
++ brq->cmd.opcode = readcmd;
++ brq->data.flags |= MMC_DATA_READ;
++ } else {
++ brq->cmd.opcode = writecmd;
++ brq->data.flags |= MMC_DATA_WRITE;
++ }
+
+- if (brq.data.blocks > 1) {
+- /* SPI multiblock writes terminate using a special
+- * token, not a STOP_TRANSMISSION request.
+- */
+- if (!mmc_host_is_spi(card->host)
+- || rq_data_dir(req) == READ)
+- brq.mrq.stop = &brq.stop;
+- readcmd = MMC_READ_MULTIPLE_BLOCK;
+- writecmd = MMC_WRITE_MULTIPLE_BLOCK;
+- } else {
+- brq.mrq.stop = NULL;
+- readcmd = MMC_READ_SINGLE_BLOCK;
+- writecmd = MMC_WRITE_BLOCK;
++ mmc_set_data_timeout(&brq->data, card);
++
++ brq->data.sg = mqrq->sg;
++ brq->data.sg_len = mmc_queue_map_sg(mq, mqrq);
++
++ /*
++ * Adjust the sg list so it is the same size as the
++ * request.
++ */
++ if (brq->data.blocks != blk_rq_sectors(req)) {
++ int i, data_size = brq->data.blocks << 9;
++ struct scatterlist *sg;
++
++ for_each_sg(brq->data.sg, sg, brq->data.sg_len, i) {
++ data_size -= sg->length;
++ if (data_size <= 0) {
++ sg->length += data_size;
++ i++;
++ break;
++ }
+ }
+- if (rq_data_dir(req) == READ) {
+- brq.cmd.opcode = readcmd;
+- brq.data.flags |= MMC_DATA_READ;
+- } else {
+- brq.cmd.opcode = writecmd;
+- brq.data.flags |= MMC_DATA_WRITE;
++ brq->data.sg_len = i;
++ }
++
++ mmc_queue_bounce_pre(mqrq);
++}
++
++static enum mmc_blk_status mmc_blk_get_status(struct mmc_blk_request *brq,
++ struct request *req,
++ struct mmc_card *card,
++ struct mmc_blk_data *md)
++{
++ struct mmc_command cmd;
++ u32 status;
++ enum mmc_blk_status ret = MMC_BLK_SUCCESS;
++
++ /*
++ * Check for errors here, but don't jump to cmd_err
++ * until later as we need to wait for the card to leave
++ * programming mode even when things go wrong.
++ */
++ if (brq->cmd.error || brq->data.error || brq->stop.error) {
++ if (brq->data.blocks > 1 && rq_data_dir(req) == READ) {
++ /* Redo read one sector at a time */
++ printk(KERN_WARNING "%s: retrying using single "
++ "block read, brq %p\n",
++ req->rq_disk->disk_name, brq);
++ ret = MMC_BLK_RETRY;
++ goto out;
+ }
++ status = get_card_status(card, req);
++ }
+
+- mmc_set_data_timeout(&brq.data, card);
++ if (brq->cmd.error) {
++ printk(KERN_ERR "%s: error %d sending read/write "
++ "command, response %#x, card status %#x\n",
++ req->rq_disk->disk_name, brq->cmd.error,
++ brq->cmd.resp[0], status);
++ }
+
+- brq.data.sg = mq->sg;
+- brq.data.sg_len = mmc_queue_map_sg(mq);
++ if (brq->data.error) {
++ if (brq->data.error == -ETIMEDOUT && brq->mrq.stop)
++ /* 'Stop' response contains card status */
++ status = brq->mrq.stop->resp[0];
++ printk(KERN_ERR "%s: error %d transferring data,"
++ " sector %u, nr %u, card status %#x\n",
++ req->rq_disk->disk_name, brq->data.error,
++ (unsigned)blk_rq_pos(req),
++ (unsigned)blk_rq_sectors(req), status);
++ }
+
+- /*
+- * Adjust the sg list so it is the same size as the
+- * request.
+- */
+- if (brq.data.blocks != blk_rq_sectors(req)) {
+- int i, data_size = brq.data.blocks << 9;
+- struct scatterlist *sg;
+-
+- for_each_sg(brq.data.sg, sg, brq.data.sg_len, i) {
+- data_size -= sg->length;
+- if (data_size <= 0) {
+- sg->length += data_size;
+- i++;
+- break;
+- }
++ if (brq->stop.error) {
++ printk(KERN_ERR "%s: error %d sending stop command, "
++ "response %#x, card status %#x\n",
++ req->rq_disk->disk_name, brq->stop.error,
++ brq->stop.resp[0], status);
++ }
++
++ if (!mmc_host_is_spi(card->host) && rq_data_dir(req) != READ) {
++ do {
++ int err;
++
++ cmd.opcode = MMC_SEND_STATUS;
++ cmd.arg = card->rca << 16;
++ cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
++ err = mmc_wait_for_cmd(card->host, &cmd, 5);
++ if (err) {
++ printk(KERN_ERR "%s: error %d requesting status\n",
++ req->rq_disk->disk_name, err);
++ ret = MMC_BLK_CMD_ERR;
++ goto out;
+ }
+- brq.data.sg_len = i;
++ /*
++ * Some cards mishandle the status bits,
++ * so make sure to check both the busy
++ * indication and the card state.
++ */
++ } while (!(cmd.resp[0] & R1_READY_FOR_DATA) ||
++ (R1_CURRENT_STATE(cmd.resp[0]) == 7));
++
++#if 0
++ if (cmd.resp[0] & ~0x00000900)
++ printk(KERN_ERR "%s: status = %08x\n",
++ req->rq_disk->disk_name, cmd.resp[0]);
++ if (mmc_decode_status(cmd.resp)) {
++ ret = MMC_BLK_CMD_ERR;
++ goto out;
+ }
+
+- mmc_queue_bounce_pre(mq);
++#endif
++ }
+
+- mmc_wait_for_req(card->host, &brq.mrq);
++ if (brq->cmd.error || brq->stop.error || brq->data.error) {
++ if (rq_data_dir(req) == READ)
++ ret = MMC_BLK_DATA_ERR;
++ else
++ ret = MMC_BLK_CMD_ERR;
++ }
++ out:
++ return ret;
+
+- mmc_queue_bounce_post(mq);
++}
+
++static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *rqc)
++{
++ struct mmc_blk_data *md = mq->data;
++ struct mmc_card *card = md->queue.card;
++ struct mmc_blk_request *brqc = &mq->mqrq_cur->brq;
++ struct mmc_blk_request *brqp = &mq->mqrq_prev->brq;
++ struct mmc_queue_req *mqrqp = mq->mqrq_prev;
++ struct request *rqp = mqrqp->req;
++ int ret = 0;
++ int disable_multi = 0;
++ enum mmc_blk_status status;
++
++ if (!rqc && !rqp)
++ return 0;
++
++ if (rqc) {
++ /* Claim host for the first request in a serie of requests */
++ if (!rqp)
++ mmc_claim_host(card->host);
++
++ /* Prepare a new request */
++ mmc_blk_rw_rq_prep(mq->mqrq_cur, card, 0, mq);
++ mmc_pre_req(card->host, &brqc->mrq, !rqp);
++ }
++ do {
+ /*
+- * Check for errors here, but don't jump to cmd_err
+- * until later as we need to wait for the card to leave
+- * programming mode even when things go wrong.
++ * If there is an ongoing request, indicated by rqp, wait for
++ * it to finish before starting a new one.
+ */
+- if (brq.cmd.error || brq.data.error || brq.stop.error) {
+- if (brq.data.blocks > 1 && rq_data_dir(req) == READ) {
+- /* Redo read one sector at a time */
+- printk(KERN_WARNING "%s: retrying using single "
+- "block read\n", req->rq_disk->disk_name);
+- disable_multi = 1;
+- continue;
+- }
+- status = get_card_status(card, req);
++ if (rqp)
++ mmc_wait_for_req_done(&brqp->mrq);
++ else {
++ /* start a new asynchronous request */
++ mmc_start_req(card->host, &brqc->mrq);
++ goto out;
+ }
+-
+- if (brq.cmd.error) {
+- printk(KERN_ERR "%s: error %d sending read/write "
+- "command, response %#x, card status %#x\n",
+- req->rq_disk->disk_name, brq.cmd.error,
+- brq.cmd.resp[0], status);
++ status = mmc_blk_get_status(brqp, rqp, card, md);
++ if (status != MMC_BLK_SUCCESS) {
++ mmc_post_req(card->host, &brqp->mrq, -EINVAL);
++ mmc_queue_bounce_post(mqrqp);
++ if (rqc)
++ mmc_post_req(card->host, &brqc->mrq, -EINVAL);
+ }
+
+- if (brq.data.error) {
+- if (brq.data.error == -ETIMEDOUT && brq.mrq.stop)
+- /* 'Stop' response contains card status */
+- status = brq.mrq.stop->resp[0];
+- printk(KERN_ERR "%s: error %d transferring data,"
+- " sector %u, nr %u, card status %#x\n",
+- req->rq_disk->disk_name, brq.data.error,
+- (unsigned)blk_rq_pos(req),
+- (unsigned)blk_rq_sectors(req), status);
+- }
++ switch (status) {
++ case MMC_BLK_SUCCESS:
++ /*
++ * A block was successfully transferred.
++ */
+
+- if (brq.stop.error) {
+- printk(KERN_ERR "%s: error %d sending stop command, "
+- "response %#x, card status %#x\n",
+- req->rq_disk->disk_name, brq.stop.error,
+- brq.stop.resp[0], status);
+- }
++ /*
++ * All data is transferred without errors.
++ * Defer mmc post processing and _blk_end_request
++ * until after the new request is started.
++ */
++ if (blk_rq_bytes(rqp) == brqp->data.bytes_xfered)
++ break;
+
+- if (!mmc_host_is_spi(card->host) && rq_data_dir(req) != READ) {
+- do {
+- int err;
+-
+- cmd.opcode = MMC_SEND_STATUS;
+- cmd.arg = card->rca << 16;
+- cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
+- err = mmc_wait_for_cmd(card->host, &cmd, 5);
+- if (err) {
+- printk(KERN_ERR "%s: error %d requesting status\n",
+- req->rq_disk->disk_name, err);
+- goto cmd_err;
+- }
+- /*
+- * Some cards mishandle the status bits,
+- * so make sure to check both the busy
+- * indication and the card state.
+- */
+- } while (!(cmd.resp[0] & R1_READY_FOR_DATA) ||
+- (R1_CURRENT_STATE(cmd.resp[0]) == 7));
++ mmc_post_req(card->host, &brqp->mrq, 0);
++ mmc_queue_bounce_post(mqrqp);
+
+-#if 0
+- if (cmd.resp[0] & ~0x00000900)
+- printk(KERN_ERR "%s: status = %08x\n",
+- req->rq_disk->disk_name, cmd.resp[0]);
+- if (mmc_decode_status(cmd.resp))
+- goto cmd_err;
+-#endif
+- }
++ spin_lock_irq(&md->lock);
++ ret = __blk_end_request(rqp, 0,
++ brqp->data.bytes_xfered);
++ spin_unlock_irq(&md->lock);
+
+- if (brq.cmd.error || brq.stop.error || brq.data.error) {
+- if (rq_data_dir(req) == READ) {
+- /*
+- * After an error, we redo I/O one sector at a
+- * time, so we only reach here after trying to
+- * read a single sector.
+- */
+- spin_lock_irq(&md->lock);
+- ret = __blk_end_request(req, -EIO, brq.data.blksz);
+- spin_unlock_irq(&md->lock);
+- continue;
+- }
++ if (rqc)
++ mmc_post_req(card->host, &brqc->mrq, -EINVAL);
++ break;
++ case MMC_BLK_CMD_ERR:
+ goto cmd_err;
++ break;
++ case MMC_BLK_RETRY:
++ disable_multi = 1;
++ ret = 1;
++ break;
++ case MMC_BLK_DATA_ERR:
++ /*
++ * After an error, we redo I/O one sector at a
++ * time, so we only reach here after trying to
++ * read a single sector.
++ */
++ spin_lock_irq(&md->lock);
++ ret = __blk_end_request(rqp, -EIO, brqp->data.blksz);
++ spin_unlock_irq(&md->lock);
++ if (rqc && !ret)
++ mmc_pre_req(card->host, &brqc->mrq, false);
++ break;
+ }
+
+- /*
+- * A block was successfully transferred.
+- */
++ if (ret) {
++ /*
++ * In case of a none complete request
++ * prepare it again and resend.
++ */
++ mmc_blk_rw_rq_prep(mqrqp, card, disable_multi, mq);
++ mmc_pre_req(card->host, &brqp->mrq, true);
++ mmc_start_req(card->host, &brqp->mrq);
++ if (rqc)
++ mmc_pre_req(card->host, &brqc->mrq, false);
++ }
++ } while (ret);
++
++ /* Previous request is completed, start the new request if any */
++ if (rqc)
++ mmc_start_req(card->host, &brqc->mrq);
++
++ /*
++ * Post process the previous request while the new request is active.
++ * In case of error the reuqest is already ended.
++ */
++ if (status == MMC_BLK_SUCCESS) {
++ mmc_post_req(card->host, &brqp->mrq, 0);
++ mmc_queue_bounce_post(mqrqp);
++
+ spin_lock_irq(&md->lock);
+- ret = __blk_end_request(req, 0, brq.data.bytes_xfered);
++ ret = __blk_end_request(rqp, 0, brqp->data.bytes_xfered);
+ spin_unlock_irq(&md->lock);
+- } while (ret);
+
+- mmc_release_host(card->host);
++ if (ret) {
++ /* If this happen it is a bug */
++ printk(KERN_ERR "[%s] BUG: rq_bytes %d xfered %d\n",
++ __func__, blk_rq_bytes(rqp),
++ brqp->data.bytes_xfered);
++ goto cmd_err;
++ }
++ }
++
++ /* 1 indicates one request has been completed */
++ ret = 1;
++ out:
++ /*
++ * TODO: Find out if it is OK to only release host after the
++ * last request. For the last request the current request
++ * is NULL, which means no requests are pending.
++ */
++ /* Release host for the last request in a serie of requests */
++ if (!rqc)
++ mmc_release_host(card->host);
+
+- return 1;
++ /* Current request becomes previous request and vice versa. */
++ mqrqp->brq.mrq.data = NULL;
++ mqrqp->req = NULL;
++ mq->mqrq_prev = mq->mqrq_cur;
++ mq->mqrq_cur = mqrqp;
++
++ return ret;
+
+ cmd_err:
++
+ /*
+ * If this is an SD card and we're writing, we can first
+ * mark the known good sectors as ok.
+@@ -539,12 +680,12 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *req)
+ blocks = mmc_sd_num_wr_blocks(card);
+ if (blocks != (u32)-1) {
+ spin_lock_irq(&md->lock);
+- ret = __blk_end_request(req, 0, blocks << 9);
++ ret = __blk_end_request(rqp, 0, blocks << 9);
+ spin_unlock_irq(&md->lock);
+ }
+ } else {
+ spin_lock_irq(&md->lock);
+- ret = __blk_end_request(req, 0, brq.data.bytes_xfered);
++ ret = __blk_end_request(rqp, 0, brqp->data.bytes_xfered);
+ spin_unlock_irq(&md->lock);
+ }
+
+@@ -552,15 +693,27 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *req)
+
+ spin_lock_irq(&md->lock);
+ while (ret)
+- ret = __blk_end_request(req, -EIO, blk_rq_cur_bytes(req));
++ ret = __blk_end_request(rqp, -EIO, blk_rq_cur_bytes(rqp));
+ spin_unlock_irq(&md->lock);
+
++ if (rqc) {
++ mmc_claim_host(card->host);
++ mmc_pre_req(card->host, &brqc->mrq, false);
++ mmc_start_req(card->host, &brqc->mrq);
++ }
++
++ /* Current request becomes previous request and vice versa. */
++ mqrqp->brq.mrq.data = NULL;
++ mqrqp->req = NULL;
++ mq->mqrq_prev = mq->mqrq_cur;
++ mq->mqrq_cur = mqrqp;
++
+ return 0;
+ }
+
+ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
+ {
+- if (req->cmd_flags & REQ_DISCARD) {
++ if (req && req->cmd_flags & REQ_DISCARD) {
+ if (req->cmd_flags & REQ_SECURE)
+ return mmc_blk_issue_secdiscard_rq(mq, req);
+ else
+diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c
+index abc1a63..8f7ffad 100644
+--- a/drivers/mmc/card/mmc_test.c
++++ b/drivers/mmc/card/mmc_test.c
+@@ -22,6 +22,7 @@
+ #include <linux/debugfs.h>
+ #include <linux/uaccess.h>
+ #include <linux/seq_file.h>
++#include <linux/random.h>
+
+ #define RESULT_OK 0
+ #define RESULT_FAIL 1
+@@ -51,10 +52,12 @@ struct mmc_test_pages {
+ * struct mmc_test_mem - allocated memory.
+ * @arr: array of allocations
+ * @cnt: number of allocations
++ * @size_min_cmn: lowest common size in array of allocations
+ */
+ struct mmc_test_mem {
+ struct mmc_test_pages *arr;
+ unsigned int cnt;
++ unsigned int size_min_cmn;
+ };
+
+ /**
+@@ -148,6 +151,21 @@ struct mmc_test_card {
+ struct mmc_test_general_result *gr;
+ };
+
++enum mmc_test_prep_media {
++ MMC_TEST_PREP_NONE = 0,
++ MMC_TEST_PREP_WRITE_FULL = 1 << 0,
++ MMC_TEST_PREP_ERASE = 1 << 1,
++};
++
++struct mmc_test_multiple_rw {
++ unsigned int *bs;
++ unsigned int len;
++ unsigned int size;
++ bool do_write;
++ bool do_nonblock_req;
++ enum mmc_test_prep_media prepare;
++};
++
+ /*******************************************************************/
+ /* General helper functions */
+ /*******************************************************************/
+@@ -307,6 +325,7 @@ static struct mmc_test_mem *mmc_test_alloc_mem(unsigned long min_sz,
+ unsigned long max_seg_page_cnt = DIV_ROUND_UP(max_seg_sz, PAGE_SIZE);
+ unsigned long page_cnt = 0;
+ unsigned long limit = nr_free_buffer_pages() >> 4;
++ unsigned int min_cmn = 0;
+ struct mmc_test_mem *mem;
+
+ if (max_page_cnt > limit)
+@@ -350,6 +369,12 @@ static struct mmc_test_mem *mmc_test_alloc_mem(unsigned long min_sz,
+ mem->arr[mem->cnt].page = page;
+ mem->arr[mem->cnt].order = order;
+ mem->cnt += 1;
++ if (!min_cmn)
++ min_cmn = PAGE_SIZE << order;
++ else
++ min_cmn = min(min_cmn,
++ (unsigned int) (PAGE_SIZE << order));
++
+ if (max_page_cnt <= (1UL << order))
+ break;
+ max_page_cnt -= 1UL << order;
+@@ -360,6 +385,7 @@ static struct mmc_test_mem *mmc_test_alloc_mem(unsigned long min_sz,
+ break;
+ }
+ }
++ mem->size_min_cmn = min_cmn;
+
+ return mem;
+
+@@ -386,7 +412,6 @@ static int mmc_test_map_sg(struct mmc_test_mem *mem, unsigned long sz,
+ do {
+ for (i = 0; i < mem->cnt; i++) {
+ unsigned long len = PAGE_SIZE << mem->arr[i].order;
+-
+ if (len > sz)
+ len = sz;
+ if (len > max_seg_sz)
+@@ -725,6 +750,94 @@ static int mmc_test_check_broken_result(struct mmc_test_card *test,
+ }
+
+ /*
++ * Tests nonblock transfer with certain parameters
++ */
++static void mmc_test_nonblock_reset(struct mmc_request *mrq,
++ struct mmc_command *cmd,
++ struct mmc_command *stop,
++ struct mmc_data *data)
++{
++ memset(mrq, 0, sizeof(struct mmc_request));
++ memset(cmd, 0, sizeof(struct mmc_command));
++ memset(data, 0, sizeof(struct mmc_data));
++ memset(stop, 0, sizeof(struct mmc_command));
++
++ mrq->cmd = cmd;
++ mrq->data = data;
++ mrq->stop = stop;
++}
++static int mmc_test_nonblock_transfer(struct mmc_test_card *test,
++ struct scatterlist *sg, unsigned sg_len,
++ unsigned dev_addr, unsigned blocks,
++ unsigned blksz, int write, int count)
++{
++ struct mmc_request mrq1;
++ struct mmc_command cmd1;
++ struct mmc_command stop1;
++ struct mmc_data data1;
++
++ struct mmc_request mrq2;
++ struct mmc_command cmd2;
++ struct mmc_command stop2;
++ struct mmc_data data2;
++
++ struct mmc_request *cur_mrq;
++ struct mmc_request *prev_mrq;
++ int i;
++ int ret = 0;
++
++ if (!test->card->host->ops->pre_req ||
++ !test->card->host->ops->post_req)
++ return -RESULT_UNSUP_HOST;
++
++ mmc_test_nonblock_reset(&mrq1, &cmd1, &stop1, &data1);
++ mmc_test_nonblock_reset(&mrq2, &cmd2, &stop2, &data2);
++
++ cur_mrq = &mrq1;
++ prev_mrq = NULL;
++
++ for (i = 0; i < count; i++) {
++ mmc_test_prepare_mrq(test, cur_mrq, sg, sg_len, dev_addr,
++ blocks, blksz, write);
++ mmc_pre_req(test->card->host, cur_mrq, !prev_mrq);
++
++ if (prev_mrq) {
++ mmc_wait_for_req_done(prev_mrq);
++ mmc_test_wait_busy(test);
++ ret = mmc_test_check_result(test, prev_mrq);
++ if (ret)
++ goto err;
++ }
++
++ mmc_start_req(test->card->host, cur_mrq);
++
++ if (prev_mrq)
++ mmc_post_req(test->card->host, prev_mrq, 0);
++
++ prev_mrq = cur_mrq;
++ if (cur_mrq == &mrq1) {
++ mmc_test_nonblock_reset(&mrq2, &cmd2, &stop2, &data2);
++ cur_mrq = &mrq2;
++ } else {
++ mmc_test_nonblock_reset(&mrq1, &cmd1, &stop1, &data1);
++ cur_mrq = &mrq1;
++ }
++ dev_addr += blocks;
++ }
++
++ mmc_wait_for_req_done(prev_mrq);
++ mmc_test_wait_busy(test);
++ ret = mmc_test_check_result(test, prev_mrq);
++ if (ret)
++ goto err;
++ mmc_post_req(test->card->host, prev_mrq, 0);
++
++ return ret;
++err:
++ return ret;
++}
++
++/*
+ * Tests a basic transfer with certain parameters
+ */
+ static int mmc_test_simple_transfer(struct mmc_test_card *test,
+@@ -1351,14 +1464,17 @@ static int mmc_test_area_transfer(struct mmc_test_card *test,
+ }
+
+ /*
+- * Map and transfer bytes.
++ * Map and transfer bytes for multiple transfers.
+ */
+-static int mmc_test_area_io(struct mmc_test_card *test, unsigned long sz,
+- unsigned int dev_addr, int write, int max_scatter,
+- int timed)
++static int mmc_test_area_io_seq(struct mmc_test_card *test, unsigned long sz,
++ unsigned int dev_addr, int write,
++ int max_scatter, int timed, int count,
++ bool nonblock)
+ {
+ struct timespec ts1, ts2;
+- int ret;
++ int ret = 0;
++ int i;
++ struct mmc_test_area *t = &test->area;
+
+ /*
+ * In the case of a maximally scattered transfer, the maximum transfer
+@@ -1382,8 +1498,15 @@ static int mmc_test_area_io(struct mmc_test_card *test, unsigned long sz,
+
+ if (timed)
+ getnstimeofday(&ts1);
++ if (nonblock)
++ ret = mmc_test_nonblock_transfer(test, t->sg, t->sg_len,
++ dev_addr, t->blocks, 512, write, count);
++ else
++ for (i = 0; i < count && ret == 0; i++) {
++ ret = mmc_test_area_transfer(test, dev_addr, write);
++ dev_addr += sz >> 9;
++ }
+
+- ret = mmc_test_area_transfer(test, dev_addr, write);
+ if (ret)
+ return ret;
+
+@@ -1391,11 +1514,19 @@ static int mmc_test_area_io(struct mmc_test_card *test, unsigned long sz,
+ getnstimeofday(&ts2);
+
+ if (timed)
+- mmc_test_print_rate(test, sz, &ts1, &ts2);
++ mmc_test_print_avg_rate(test, sz, count, &ts1, &ts2);
+
+ return 0;
+ }
+
++static int mmc_test_area_io(struct mmc_test_card *test, unsigned long sz,
++ unsigned int dev_addr, int write, int max_scatter,
++ int timed)
++{
++ return mmc_test_area_io_seq(test, sz, dev_addr, write, max_scatter,
++ timed, 1, false);
++}
++
+ /*
+ * Write the test area entirely.
+ */
+@@ -1956,6 +2087,144 @@ static int mmc_test_large_seq_write_perf(struct mmc_test_card *test)
+ return mmc_test_large_seq_perf(test, 1);
+ }
+
++static int mmc_test_rw_multiple(struct mmc_test_card *test,
++ struct mmc_test_multiple_rw *tdata,
++ unsigned int reqsize, unsigned int size)
++{
++ unsigned int dev_addr;
++ struct mmc_test_area *t = &test->area;
++ int ret = 0;
++ int max_reqsize = max(t->mem->size_min_cmn *
++ min(t->max_segs, t->mem->cnt), t->max_tfr);
++
++ /* Set up test area */
++ if (size > mmc_test_capacity(test->card) / 2 * 512)
++ size = mmc_test_capacity(test->card) / 2 * 512;
++ if (reqsize > max_reqsize)
++ reqsize = max_reqsize;
++ dev_addr = mmc_test_capacity(test->card) / 4;
++ if ((dev_addr & 0xffff0000))
++ dev_addr &= 0xffff0000; /* Round to 64MiB boundary */
++ else
++ dev_addr &= 0xfffff800; /* Round to 1MiB boundary */
++ if (!dev_addr)
++ goto err;
++
++ /* prepare test area */
++ if (mmc_can_erase(test->card) &&
++ tdata->prepare & MMC_TEST_PREP_ERASE) {
++ ret = mmc_erase(test->card, dev_addr,
++ size / 512, MMC_SECURE_ERASE_ARG);
++ if (ret)
++ ret = mmc_erase(test->card, dev_addr,
++ size / 512, MMC_ERASE_ARG);
++ if (ret)
++ goto err;
++ }
++
++ /* Run test */
++ ret = mmc_test_area_io_seq(test, reqsize, dev_addr,
++ tdata->do_write, 0, 1, size / reqsize,
++ tdata->do_nonblock_req);
++ if (ret)
++ goto err;
++
++ return ret;
++ err:
++ printk(KERN_INFO "[%s] error\n", __func__);
++ return ret;
++}
++
++static int mmc_test_rw_multiple_size(struct mmc_test_card *test,
++ struct mmc_test_multiple_rw *rw)
++{
++ int ret = 0;
++ int i;
++
++ for (i = 0 ; i < rw->len && ret == 0; i++) {
++ ret = mmc_test_rw_multiple(test, rw, rw->bs[i], rw->size);
++ if (ret)
++ break;
++ }
++ return ret;
++}
++
++/*
++ * Multiple blocking write 4k to 4 MB chunks
++ */
++static int mmc_test_profile_mult_write_blocking_perf(struct mmc_test_card *test)
++{
++ unsigned int bs[] = {1 << 12, 1 << 13, 1 << 14, 1 << 15, 1 << 16,
++ 1 << 17, 1 << 18, 1 << 19, 1 << 20, 1 << 22};
++ struct mmc_test_multiple_rw test_data = {
++ .bs = bs,
++ .size = 128*1024*1024,
++ .len = ARRAY_SIZE(bs),
++ .do_write = true,
++ .do_nonblock_req = false,
++ .prepare = MMC_TEST_PREP_ERASE,
++ };
++
++ return mmc_test_rw_multiple_size(test, &test_data);
++};
++
++/*
++ * Multiple none blocking write 4k to 4 MB chunks
++ */
++static int mmc_test_profile_mult_write_nonblock_perf(struct mmc_test_card *test)
++{
++ unsigned int bs[] = {1 << 12, 1 << 13, 1 << 14, 1 << 15, 1 << 16,
++ 1 << 17, 1 << 18, 1 << 19, 1 << 20, 1 << 22};
++ struct mmc_test_multiple_rw test_data = {
++ .bs = bs,
++ .size = 128*1024*1024,
++ .len = ARRAY_SIZE(bs),
++ .do_write = true,
++ .do_nonblock_req = true,
++ .prepare = MMC_TEST_PREP_ERASE,
++ };
++
++ return mmc_test_rw_multiple_size(test, &test_data);
++}
++
++/*
++ * Multiple blocking read 4k to 4 MB chunks
++ */
++static int mmc_test_profile_mult_read_blocking_perf(struct mmc_test_card *test)
++{
++ unsigned int bs[] = {1 << 12, 1 << 13, 1 << 14, 1 << 15, 1 << 16,
++ 1 << 17, 1 << 18, 1 << 19, 1 << 20, 1 << 22};
++ struct mmc_test_multiple_rw test_data = {
++ .bs = bs,
++ .size = 128*1024*1024,
++ .len = ARRAY_SIZE(bs),
++ .do_write = false,
++ .do_nonblock_req = false,
++ .prepare = MMC_TEST_PREP_NONE,
++ };
++
++ return mmc_test_rw_multiple_size(test, &test_data);
++}
++
++/*
++ * Multiple none blocking read 4k to 4 MB chunks
++ */
++static int mmc_test_profile_mult_read_nonblock_perf(struct mmc_test_card *test)
++{
++ unsigned int bs[] = {1 << 12, 1 << 13, 1 << 14, 1 << 15, 1 << 16,
++ 1 << 17, 1 << 18, 1 << 19, 1 << 20, 1 << 22};
++ struct mmc_test_multiple_rw test_data = {
++ .bs = bs,
++ .size = 128*1024*1024,
++ .len = ARRAY_SIZE(bs),
++ .do_write = false,
++ .do_nonblock_req = true,
++ .prepare = MMC_TEST_PREP_NONE,
++ };
++
++ return mmc_test_rw_multiple_size(test, &test_data);
++}
++
+ static const struct mmc_test_case mmc_test_cases[] = {
+ {
+ .name = "Basic write (no data verification)",
+@@ -2223,6 +2492,33 @@ static const struct mmc_test_case mmc_test_cases[] = {
+ .cleanup = mmc_test_area_cleanup,
+ },
+
++ {
++ .name = "Write performance with blocking req 4k to 4MB",
++ .prepare = mmc_test_area_prepare,
++ .run = mmc_test_profile_mult_write_blocking_perf,
++ .cleanup = mmc_test_area_cleanup,
++ },
++
++ {
++ .name = "Write performance with none blocking req 4k to 4MB",
++ .prepare = mmc_test_area_prepare,
++ .run = mmc_test_profile_mult_write_nonblock_perf,
++ .cleanup = mmc_test_area_cleanup,
++ },
++
++ {
++ .name = "Read performance with blocking req 4k to 4MB",
++ .prepare = mmc_test_area_prepare,
++ .run = mmc_test_profile_mult_read_blocking_perf,
++ .cleanup = mmc_test_area_cleanup,
++ },
++
++ {
++ .name = "Read performance with none blocking req 4k to 4MB",
++ .prepare = mmc_test_area_prepare,
++ .run = mmc_test_profile_mult_read_nonblock_perf,
++ .cleanup = mmc_test_area_cleanup,
++ },
+ };
+
+ static DEFINE_MUTEX(mmc_test_lock);
+@@ -2447,6 +2743,32 @@ static const struct file_operations mmc_test_fops_test = {
+ .release = single_release,
+ };
+
++static int mtf_testlist_show(struct seq_file *sf, void *data)
++{
++ int i;
++
++ mutex_lock(&mmc_test_lock);
++
++ for (i = 0; i < ARRAY_SIZE(mmc_test_cases); i++)
++ seq_printf(sf, "%d:\t%s\n", i+1, mmc_test_cases[i].name);
++
++ mutex_unlock(&mmc_test_lock);
++
++ return 0;
++}
++
++static int mtf_testlist_open(struct inode *inode, struct file *file)
++{
++ return single_open(file, mtf_testlist_show, inode->i_private);
++}
++
++static const struct file_operations mmc_test_fops_testlist = {
++ .open = mtf_testlist_open,
++ .read = seq_read,
++ .llseek = seq_lseek,
++ .release = single_release,
++};
++
+ static void mmc_test_free_file_test(struct mmc_card *card)
+ {
+ struct mmc_test_dbgfs_file *df, *dfs;
+@@ -2476,6 +2798,10 @@ static int mmc_test_register_file_test(struct mmc_card *card)
+ file = debugfs_create_file("test", S_IWUSR | S_IRUGO,
+ card->debugfs_root, card, &mmc_test_fops_test);
+
++ if (card->debugfs_root)
++ file = debugfs_create_file("testlist", S_IRUGO,
++ card->debugfs_root, card, &mmc_test_fops_testlist);
++
+ if (IS_ERR_OR_NULL(file)) {
+ dev_err(&card->dev,
+ "Can't create file. Perhaps debugfs is disabled.\n");
+diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
+index 2ae7275..2b14d1c 100644
+--- a/drivers/mmc/card/queue.c
++++ b/drivers/mmc/card/queue.c
+@@ -56,9 +56,10 @@ static int mmc_queue_thread(void *d)
+ spin_lock_irq(q->queue_lock);
+ set_current_state(TASK_INTERRUPTIBLE);
+ req = blk_fetch_request(q);
+- mq->req = req;
++ mq->mqrq_cur->req = req;
+ spin_unlock_irq(q->queue_lock);
+
++ mq->issue_fn(mq, req);
+ if (!req) {
+ if (kthread_should_stop()) {
+ set_current_state(TASK_RUNNING);
+@@ -71,7 +72,6 @@ static int mmc_queue_thread(void *d)
+ }
+ set_current_state(TASK_RUNNING);
+
+- mq->issue_fn(mq, req);
+ } while (1);
+ up(&mq->thread_sem);
+
+@@ -97,10 +97,25 @@ static void mmc_request(struct request_queue *q)
+ return;
+ }
+
+- if (!mq->req)
++ if (!mq->mqrq_cur->req)
+ wake_up_process(mq->thread);
+ }
+
++struct scatterlist *mmc_alloc_sg(int sg_len, int *err)
++{
++ struct scatterlist *sg;
++
++ sg = kmalloc(sizeof(struct scatterlist)*sg_len, GFP_KERNEL);
++ if (!sg)
++ *err = -ENOMEM;
++ else {
++ *err = 0;
++ sg_init_table(sg, sg_len);
++ }
++
++ return sg;
++}
++
+ /**
+ * mmc_init_queue - initialise a queue structure.
+ * @mq: mmc queue
+@@ -114,6 +129,8 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
+ struct mmc_host *host = card->host;
+ u64 limit = BLK_BOUNCE_HIGH;
+ int ret;
++ struct mmc_queue_req *mqrq_cur = &mq->mqrq[0];
++ struct mmc_queue_req *mqrq_prev = &mq->mqrq[1];
+
+ if (mmc_dev(host)->dma_mask && *mmc_dev(host)->dma_mask)
+ limit = *mmc_dev(host)->dma_mask;
+@@ -123,8 +140,11 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
+ if (!mq->queue)
+ return -ENOMEM;
+
++ memset(&mq->mqrq_cur, 0, sizeof(mq->mqrq_cur));
++ memset(&mq->mqrq_prev, 0, sizeof(mq->mqrq_prev));
++ mq->mqrq_cur = mqrq_cur;
++ mq->mqrq_prev = mqrq_prev;
+ mq->queue->queuedata = mq;
+- mq->req = NULL;
+
+ blk_queue_prep_rq(mq->queue, mmc_prep_request);
+ queue_flag_set_unlocked(QUEUE_FLAG_NONROT, mq->queue);
+@@ -158,53 +178,64 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
+ bouncesz = host->max_blk_count * 512;
+
+ if (bouncesz > 512) {
+- mq->bounce_buf = kmalloc(bouncesz, GFP_KERNEL);
+- if (!mq->bounce_buf) {
++ mqrq_cur->bounce_buf = kmalloc(bouncesz, GFP_KERNEL);
++ if (!mqrq_cur->bounce_buf) {
++ printk(KERN_WARNING "%s: unable to "
++ "allocate bounce cur buffer\n",
++ mmc_card_name(card));
++ }
++ mqrq_prev->bounce_buf = kmalloc(bouncesz, GFP_KERNEL);
++ if (!mqrq_prev->bounce_buf) {
+ printk(KERN_WARNING "%s: unable to "
+- "allocate bounce buffer\n",
++ "allocate bounce prev buffer\n",
+ mmc_card_name(card));
++ kfree(mqrq_cur->bounce_buf);
++ mqrq_cur->bounce_buf = NULL;
+ }
+ }
+
+- if (mq->bounce_buf) {
++ if (mqrq_cur->bounce_buf && mqrq_prev->bounce_buf) {
+ blk_queue_bounce_limit(mq->queue, BLK_BOUNCE_ANY);
+ blk_queue_max_hw_sectors(mq->queue, bouncesz / 512);
+ blk_queue_max_segments(mq->queue, bouncesz / 512);
+ blk_queue_max_segment_size(mq->queue, bouncesz);
+
+- mq->sg = kmalloc(sizeof(struct scatterlist),
+- GFP_KERNEL);
+- if (!mq->sg) {
+- ret = -ENOMEM;
++ mqrq_cur->sg = mmc_alloc_sg(1, &ret);
++ if (ret)
+ goto cleanup_queue;
+- }
+- sg_init_table(mq->sg, 1);
+
+- mq->bounce_sg = kmalloc(sizeof(struct scatterlist) *
+- bouncesz / 512, GFP_KERNEL);
+- if (!mq->bounce_sg) {
+- ret = -ENOMEM;
++ mqrq_cur->bounce_sg =
++ mmc_alloc_sg(bouncesz / 512, &ret);
++ if (ret)
++ goto cleanup_queue;
++
++ mqrq_prev->sg = mmc_alloc_sg(1, &ret);
++ if (ret)
++ goto cleanup_queue;
++
++ mqrq_prev->bounce_sg =
++ mmc_alloc_sg(bouncesz / 512, &ret);
++ if (ret)
+ goto cleanup_queue;
+- }
+- sg_init_table(mq->bounce_sg, bouncesz / 512);
+ }
+ }
+ #endif
+
+- if (!mq->bounce_buf) {
++ if (!mqrq_cur->bounce_buf && !mqrq_prev->bounce_buf) {
+ blk_queue_bounce_limit(mq->queue, limit);
+ blk_queue_max_hw_sectors(mq->queue,
+ min(host->max_blk_count, host->max_req_size / 512));
+ blk_queue_max_segments(mq->queue, host->max_segs);
+ blk_queue_max_segment_size(mq->queue, host->max_seg_size);
+
+- mq->sg = kmalloc(sizeof(struct scatterlist) *
+- host->max_segs, GFP_KERNEL);
+- if (!mq->sg) {
+- ret = -ENOMEM;
++ mqrq_cur->sg = mmc_alloc_sg(host->max_segs, &ret);
++ if (ret)
++ goto cleanup_queue;
++
++
++ mqrq_prev->sg = mmc_alloc_sg(host->max_segs, &ret);
++ if (ret)
+ goto cleanup_queue;
+- }
+- sg_init_table(mq->sg, host->max_segs);
+ }
+
+ sema_init(&mq->thread_sem, 1);
+@@ -219,16 +250,22 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
+
+ return 0;
+ free_bounce_sg:
+- if (mq->bounce_sg)
+- kfree(mq->bounce_sg);
+- mq->bounce_sg = NULL;
++ kfree(mqrq_cur->bounce_sg);
++ mqrq_cur->bounce_sg = NULL;
++ kfree(mqrq_prev->bounce_sg);
++ mqrq_prev->bounce_sg = NULL;
++
+ cleanup_queue:
+- if (mq->sg)
+- kfree(mq->sg);
+- mq->sg = NULL;
+- if (mq->bounce_buf)
+- kfree(mq->bounce_buf);
+- mq->bounce_buf = NULL;
++ kfree(mqrq_cur->sg);
++ mqrq_cur->sg = NULL;
++ kfree(mqrq_cur->bounce_buf);
++ mqrq_cur->bounce_buf = NULL;
++
++ kfree(mqrq_prev->sg);
++ mqrq_prev->sg = NULL;
++ kfree(mqrq_prev->bounce_buf);
++ mqrq_prev->bounce_buf = NULL;
++
+ blk_cleanup_queue(mq->queue);
+ return ret;
+ }
+@@ -237,6 +274,8 @@ void mmc_cleanup_queue(struct mmc_queue *mq)
+ {
+ struct request_queue *q = mq->queue;
+ unsigned long flags;
++ struct mmc_queue_req *mqrq_cur = mq->mqrq_cur;
++ struct mmc_queue_req *mqrq_prev = mq->mqrq_prev;
+
+ /* Make sure the queue isn't suspended, as that will deadlock */
+ mmc_queue_resume(mq);
+@@ -250,16 +289,23 @@ void mmc_cleanup_queue(struct mmc_queue *mq)
+ blk_start_queue(q);
+ spin_unlock_irqrestore(q->queue_lock, flags);
+
+- if (mq->bounce_sg)
+- kfree(mq->bounce_sg);
+- mq->bounce_sg = NULL;
++ kfree(mqrq_cur->bounce_sg);
++ mqrq_cur->bounce_sg = NULL;
++
++ kfree(mqrq_cur->sg);
++ mqrq_cur->sg = NULL;
+
+- kfree(mq->sg);
+- mq->sg = NULL;
++ kfree(mqrq_cur->bounce_buf);
++ mqrq_cur->bounce_buf = NULL;
+
+- if (mq->bounce_buf)
+- kfree(mq->bounce_buf);
+- mq->bounce_buf = NULL;
++ kfree(mqrq_prev->bounce_sg);
++ mqrq_prev->bounce_sg = NULL;
++
++ kfree(mqrq_prev->sg);
++ mqrq_prev->sg = NULL;
++
++ kfree(mqrq_prev->bounce_buf);
++ mqrq_prev->bounce_buf = NULL;
+
+ mq->card = NULL;
+ }
+@@ -312,27 +358,27 @@ void mmc_queue_resume(struct mmc_queue *mq)
+ /*
+ * Prepare the sg list(s) to be handed of to the host driver
+ */
+-unsigned int mmc_queue_map_sg(struct mmc_queue *mq)
++unsigned int mmc_queue_map_sg(struct mmc_queue *mq, struct mmc_queue_req *mqrq)
+ {
+ unsigned int sg_len;
+ size_t buflen;
+ struct scatterlist *sg;
+ int i;
+
+- if (!mq->bounce_buf)
+- return blk_rq_map_sg(mq->queue, mq->req, mq->sg);
++ if (!mqrq->bounce_buf)
++ return blk_rq_map_sg(mq->queue, mqrq->req, mqrq->sg);
+
+- BUG_ON(!mq->bounce_sg);
++ BUG_ON(!mqrq->bounce_sg);
+
+- sg_len = blk_rq_map_sg(mq->queue, mq->req, mq->bounce_sg);
++ sg_len = blk_rq_map_sg(mq->queue, mqrq->req, mqrq->bounce_sg);
+
+- mq->bounce_sg_len = sg_len;
++ mqrq->bounce_sg_len = sg_len;
+
+ buflen = 0;
+- for_each_sg(mq->bounce_sg, sg, sg_len, i)
++ for_each_sg(mqrq->bounce_sg, sg, sg_len, i)
+ buflen += sg->length;
+
+- sg_init_one(mq->sg, mq->bounce_buf, buflen);
++ sg_init_one(mqrq->sg, mqrq->bounce_buf, buflen);
+
+ return 1;
+ }
+@@ -341,19 +387,19 @@ unsigned int mmc_queue_map_sg(struct mmc_queue *mq)
+ * If writing, bounce the data to the buffer before the request
+ * is sent to the host driver
+ */
+-void mmc_queue_bounce_pre(struct mmc_queue *mq)
++void mmc_queue_bounce_pre(struct mmc_queue_req *mqrq)
+ {
+ unsigned long flags;
+
+- if (!mq->bounce_buf)
++ if (!mqrq->bounce_buf)
+ return;
+
+- if (rq_data_dir(mq->req) != WRITE)
++ if (rq_data_dir(mqrq->req) != WRITE)
+ return;
+
+ local_irq_save(flags);
+- sg_copy_to_buffer(mq->bounce_sg, mq->bounce_sg_len,
+- mq->bounce_buf, mq->sg[0].length);
++ sg_copy_to_buffer(mqrq->bounce_sg, mqrq->bounce_sg_len,
++ mqrq->bounce_buf, mqrq->sg[0].length);
+ local_irq_restore(flags);
+ }
+
+@@ -361,19 +407,18 @@ void mmc_queue_bounce_pre(struct mmc_queue *mq)
+ * If reading, bounce the data from the buffer after the request
+ * has been handled by the host driver
+ */
+-void mmc_queue_bounce_post(struct mmc_queue *mq)
++void mmc_queue_bounce_post(struct mmc_queue_req *mqrq)
+ {
+ unsigned long flags;
+
+- if (!mq->bounce_buf)
++ if (!mqrq->bounce_buf)
+ return;
+
+- if (rq_data_dir(mq->req) != READ)
++ if (rq_data_dir(mqrq->req) != READ)
+ return;
+
+ local_irq_save(flags);
+- sg_copy_from_buffer(mq->bounce_sg, mq->bounce_sg_len,
+- mq->bounce_buf, mq->sg[0].length);
++ sg_copy_from_buffer(mqrq->bounce_sg, mqrq->bounce_sg_len,
++ mqrq->bounce_buf, mqrq->sg[0].length);
+ local_irq_restore(flags);
+ }
+-
+diff --git a/drivers/mmc/card/queue.h b/drivers/mmc/card/queue.h
+index 64e66e0..0e65807 100644
+--- a/drivers/mmc/card/queue.h
++++ b/drivers/mmc/card/queue.h
+@@ -4,19 +4,33 @@
+ struct request;
+ struct task_struct;
+
++struct mmc_blk_request {
++ struct mmc_request mrq;
++ struct mmc_command cmd;
++ struct mmc_command stop;
++ struct mmc_data data;
++};
++
++struct mmc_queue_req {
++ struct request *req;
++ struct mmc_blk_request brq;
++ struct scatterlist *sg;
++ char *bounce_buf;
++ struct scatterlist *bounce_sg;
++ unsigned int bounce_sg_len;
++};
++
+ struct mmc_queue {
+ struct mmc_card *card;
+ struct task_struct *thread;
+ struct semaphore thread_sem;
+ unsigned int flags;
+- struct request *req;
+ int (*issue_fn)(struct mmc_queue *, struct request *);
+ void *data;
+ struct request_queue *queue;
+- struct scatterlist *sg;
+- char *bounce_buf;
+- struct scatterlist *bounce_sg;
+- unsigned int bounce_sg_len;
++ struct mmc_queue_req mqrq[2];
++ struct mmc_queue_req *mqrq_cur;
++ struct mmc_queue_req *mqrq_prev;
+ };
+
+ extern int mmc_init_queue(struct mmc_queue *, struct mmc_card *, spinlock_t *);
+@@ -24,8 +38,9 @@ extern void mmc_cleanup_queue(struct mmc_queue *);
+ extern void mmc_queue_suspend(struct mmc_queue *);
+ extern void mmc_queue_resume(struct mmc_queue *);
+
+-extern unsigned int mmc_queue_map_sg(struct mmc_queue *);
+-extern void mmc_queue_bounce_pre(struct mmc_queue *);
+-extern void mmc_queue_bounce_post(struct mmc_queue *);
++extern unsigned int mmc_queue_map_sg(struct mmc_queue *,
++ struct mmc_queue_req *);
++extern void mmc_queue_bounce_pre(struct mmc_queue_req *);
++extern void mmc_queue_bounce_post(struct mmc_queue_req *);
+
+ #endif
+diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
+index 1f453ac..85296df 100644
+--- a/drivers/mmc/core/core.c
++++ b/drivers/mmc/core/core.c
+@@ -23,6 +23,8 @@
+ #include <linux/log2.h>
+ #include <linux/regulator/consumer.h>
+ #include <linux/pm_runtime.h>
++#include <linux/fault-inject.h>
++#include <linux/random.h>
+
+ #include <linux/mmc/card.h>
+ #include <linux/mmc/host.h>
+@@ -82,6 +84,56 @@ static void mmc_flush_scheduled_work(void)
+ flush_workqueue(workqueue);
+ }
+
++#ifdef CONFIG_FAIL_MMC_REQUEST
++
++static DECLARE_FAULT_ATTR(fail_mmc_request);
++
++static int __init setup_fail_mmc_request(char *str)
++{
++ return setup_fault_attr(&fail_mmc_request, str);
++}
++__setup("fail_mmc_request=", setup_fail_mmc_request);
++
++static void mmc_should_fail_request(struct mmc_host *host,
++ struct mmc_request *mrq)
++{
++ struct mmc_command *cmd = mrq->cmd;
++ struct mmc_data *data = mrq->data;
++ static const int data_errors[] = {
++ -ETIMEDOUT,
++ -EILSEQ,
++ -EIO,
++ };
++
++ if (!data)
++ return;
++
++ if (cmd->error || data->error || !host->make_it_fail ||
++ !should_fail(&fail_mmc_request, data->blksz * data->blocks))
++ return;
++
++ data->error = data_errors[random32() % ARRAY_SIZE(data_errors)];
++ data->bytes_xfered = (random32() % (data->bytes_xfered >> 9)) << 9;
++}
++
++static int __init fail_mmc_request_debugfs(void)
++{
++ return init_fault_attr_dentries(&fail_mmc_request,
++ "fail_mmc_request");
++}
++
++late_initcall(fail_mmc_request_debugfs);
++
++#else /* CONFIG_FAIL_MMC_REQUEST */
++
++static inline void mmc_should_fail_request(struct mmc_host *host,
++ struct mmc_data *data)
++{
++}
++
++#endif /* CONFIG_FAIL_MMC_REQUEST */
++
++
+ /**
+ * mmc_request_done - finish processing an MMC request
+ * @host: MMC host which completed request
+@@ -108,6 +160,8 @@ void mmc_request_done(struct mmc_host *host, struct mmc_request *mrq)
+ cmd->error = 0;
+ host->ops->request(host, mrq);
+ } else {
++ mmc_should_fail_request(host, mrq);
++
+ led_trigger_event(host->led, LED_OFF);
+
+ pr_debug("%s: req done (CMD%u): %d: %08x %08x %08x %08x\n",
+@@ -198,30 +252,88 @@ mmc_start_request(struct mmc_host *host, struct mmc_request *mrq)
+
+ static void mmc_wait_done(struct mmc_request *mrq)
+ {
+- complete(mrq->done_data);
++ complete(&mrq->completion);
+ }
+
+ /**
+- * mmc_wait_for_req - start a request and wait for completion
++ * mmc_pre_req - Prepare for a new request
++ * @host: MMC host to prepare command
++ * @mrq: MMC request to prepare for
++ * @is_first_req: true if there is no previous started request
++ * that may run in parellel to this call, otherwise false
++ *
++ * mmc_pre_req() is called in prior to mmc_start_req() to let
++ * host prepare for the new request. Preparation of a request may be
++ * performed while another request is running on the host.
++ */
++void mmc_pre_req(struct mmc_host *host, struct mmc_request *mrq,
++ bool is_first_req)
++{
++ if (host->ops->pre_req)
++ host->ops->pre_req(host, mrq, is_first_req);
++}
++EXPORT_SYMBOL(mmc_pre_req);
++
++/**
++ * mmc_post_req - Post process a completed request
++ * @host: MMC host to post process command
++ * @mrq: MMC request to post process for
++ * @err: Error, if none zero, clean up any resources made in pre_req
++ *
++ * Let the host post process a completed request. Post processing of
++ * a request may be performed while another reuqest is running.
++ */
++void mmc_post_req(struct mmc_host *host, struct mmc_request *mrq, int err)
++{
++ if (host->ops->post_req)
++ host->ops->post_req(host, mrq, err);
++}
++EXPORT_SYMBOL(mmc_post_req);
++
++/**
++ * mmc_start_req - start a request
+ * @host: MMC host to start command
+ * @mrq: MMC request to start
+ *
+- * Start a new MMC custom command request for a host, and wait
+- * for the command to complete. Does not attempt to parse the
+- * response.
++ * Start a new MMC custom command request for a host.
++ * Does not wait for the command to complete.
+ */
+-void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq)
++void mmc_start_req(struct mmc_host *host, struct mmc_request *mrq)
+ {
+- DECLARE_COMPLETION_ONSTACK(complete);
+-
+- mrq->done_data = &complete;
++ init_completion(&mrq->completion);
+ mrq->done = mmc_wait_done;
+
+ mmc_start_request(host, mrq);
++}
++EXPORT_SYMBOL(mmc_start_req);
+
+- wait_for_completion(&complete);
++/**
++ * mmc_wait_for_req_done - wait for completion of request
++ * @mrq: MMC request to wait for
++ *
++ * Wait for the command to complete. Does not attempt to parse the
++ * response.
++ */
++void mmc_wait_for_req_done(struct mmc_request *mrq)
++{
++ wait_for_completion(&mrq->completion);
+ }
++EXPORT_SYMBOL(mmc_wait_for_req_done);
+
++/**
++ * mmc_wait_for_req - start a request and wait for completion
++ * @host: MMC host to start command
++ * @mrq: MMC request to start
++ *
++ * Start a new MMC custom command request for a host, and wait
++ * for the command to complete. Does not attempt to parse the
++ * response.
++ */
++void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq)
++{
++ mmc_start_req(host, mrq);
++ mmc_wait_for_req_done(mrq);
++}
+ EXPORT_SYMBOL(mmc_wait_for_req);
+
+ /**
+diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
+index 998797e..588e76f 100644
+--- a/drivers/mmc/core/debugfs.c
++++ b/drivers/mmc/core/debugfs.c
+@@ -188,6 +188,11 @@ void mmc_add_host_debugfs(struct mmc_host *host)
+ root, &host->clk_delay))
+ goto err_node;
+ #endif
++#ifdef CONFIG_FAIL_MMC_REQUEST
++ if (!debugfs_create_u8("make-it-fail", S_IRUSR | S_IWUSR,
++ root, &host->make_it_fail))
++ goto err_node;
++#endif
+ return;
+
+ err_node:
+diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
+index 94df405..872ef4a 100644
+--- a/drivers/mmc/host/Kconfig
++++ b/drivers/mmc/host/Kconfig
+@@ -429,6 +429,17 @@ config MMC_S3C_PIODMA
+
+ endchoice
+
++config MMC_GLAMO
++ tristate "Glamo S3C SD/MMC Card Interface support"
++ depends on MFD_GLAMO && MMC && REGULATOR
++ select CRC7
++ help
++ This selects a driver for the MCI interface found in
++ the S-Media GLAMO chip, as used in Openmoko
++ neo1973 GTA-02.
++
++ If unsure, say N.
++
+ config MMC_SDRICOH_CS
+ tristate "MMC/SD driver for Ricoh Bay1Controllers (EXPERIMENTAL)"
+ depends on EXPERIMENTAL && PCI && PCMCIA
+diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile
+index 4f1df0a..7133627 100644
+--- a/drivers/mmc/host/Makefile
++++ b/drivers/mmc/host/Makefile
+@@ -27,6 +27,7 @@ ifeq ($(CONFIG_OF),y)
+ obj-$(CONFIG_MMC_SPI) += of_mmc_spi.o
+ endif
+ obj-$(CONFIG_MMC_S3C) += s3cmci.o
++obj-$(CONFIG_MMC_GLAMO) += glamo-mci.o
+ obj-$(CONFIG_MMC_SDRICOH_CS) += sdricoh_cs.o
+ obj-$(CONFIG_MMC_TMIO) += tmio_mmc.o
+ obj-$(CONFIG_MMC_TMIO_CORE) += tmio_mmc_core.o
+diff --git a/drivers/mmc/host/glamo-mci.c b/drivers/mmc/host/glamo-mci.c
+new file mode 100644
+index 0000000..02c4b69
+--- /dev/null
++++ b/drivers/mmc/host/glamo-mci.c
+@@ -0,0 +1,939 @@
++/*
++ * linux/drivers/mmc/host/glamo-mmc.c - Glamo MMC driver
++ *
++ * Copyright (C) 2007 Openmoko, Inc, Andy Green <andy@openmoko.com>
++ * Copyright (C) 2009, Lars-Peter Clausen <lars@metafoo.de>
++ * Based on S3C MMC driver that was:
++ * Copyright (C) 2004-2006 maintech GmbH, Thomas Kleffel <tk@maintech.de>
++ *
++ * 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/mmc/mmc.h>
++#include <linux/mmc/sd.h>
++#include <linux/mmc/host.h>
++#include <linux/platform_device.h>
++#include <linux/irq.h>
++#include <linux/delay.h>
++#include <linux/interrupt.h>
++#include <linux/workqueue.h>
++#include <linux/crc7.h>
++#include <linux/scatterlist.h>
++#include <linux/io.h>
++#include <linux/regulator/consumer.h>
++#include <linux/err.h>
++#include <linux/mfd/glamo.h>
++#include <linux/mfd/glamo-core.h>
++#include <linux/mfd/glamo-regs.h>
++
++struct glamo_mci_host {
++ struct glamo_mmc_platform_data *pdata;
++ struct platform_device *pdev;
++ struct glamo_core *core;
++ struct mmc_host *mmc;
++ struct resource *mmio_mem;
++ struct resource *data_mem;
++ void __iomem *mmio_base;
++ uint16_t __iomem *data_base;
++
++ unsigned int irq;
++
++ struct regulator *regulator;
++ struct mmc_request *mrq;
++
++ unsigned int clk_rate;
++
++ unsigned short vdd;
++ char power_mode;
++
++ unsigned long transfer_start;
++ unsigned long request_start;
++
++ unsigned char request_counter;
++};
++
++static void glamo_mci_send_request(struct mmc_host *mmc,
++ struct mmc_request *mrq);
++static void glamo_mci_send_command(struct glamo_mci_host *host,
++ struct mmc_command *cmd);
++
++/*
++ * Max SD clock rate
++ *
++ * held at /(3 + 1) due to concerns of 100R recommended series resistor
++ * allows 16MHz @ 4-bit --> 8MBytes/sec raw
++ *
++ * you can override this on kernel commandline using
++ *
++ * glamo_mci.sd_max_clk=10000000
++ *
++ * for example
++ */
++
++static int sd_max_clk = 17000000;
++module_param(sd_max_clk, int, 0644);
++
++/*
++ * Slow SD clock rate
++ *
++ * you can override this on kernel commandline using
++ *
++ * glamo_mci.sd_slow_ratio=8
++ *
++ * for example
++ *
++ * platform callback is used to decide effective clock rate, if not
++ * defined then max is used, if defined and returns nonzero, rate is
++ * divided by this factor
++ */
++
++static int sd_slow_ratio = 8;
++module_param(sd_slow_ratio, int, 0644);
++
++/*
++ * Post-power SD clock rate
++ *
++ * you can override this on kernel commandline using
++ *
++ * glamo_mci.sd_post_power_clock=1000000
++ *
++ * for example
++ *
++ * After changing power to card, clock is held at this rate until first bulk
++ * transfer completes
++ */
++
++static int sd_post_power_clock = 1000000;
++module_param(sd_post_power_clock, int, 0644);
++
++
++static inline void glamomci_reg_write(struct glamo_mci_host *glamo,
++ uint16_t reg, uint16_t val)
++{
++ writew(val, glamo->mmio_base + reg);
++}
++
++static inline uint16_t glamomci_reg_read(struct glamo_mci_host *glamo,
++ uint16_t reg)
++{
++ return readw(glamo->mmio_base + reg);
++}
++
++static void glamomci_reg_set_bit_mask(struct glamo_mci_host *glamo,
++ uint16_t reg, uint16_t mask, uint16_t val)
++{
++ uint16_t tmp;
++
++ val &= mask;
++
++ tmp = glamomci_reg_read(glamo, reg);
++ tmp &= ~mask;
++ tmp |= val;
++ glamomci_reg_write(glamo, reg, tmp);
++}
++
++static void glamo_mci_reset(struct glamo_mci_host *host)
++{
++ glamo_engine_reset(host->core, GLAMO_ENGINE_MMC);
++
++ glamomci_reg_write(host, GLAMO_REG_MMC_WDATADS1,
++ (uint16_t)(host->data_mem->start));
++ glamomci_reg_write(host, GLAMO_REG_MMC_WDATADS2,
++ (uint16_t)(host->data_mem->start >> 16));
++
++ glamomci_reg_write(host, GLAMO_REG_MMC_RDATADS1,
++ (uint16_t)(host->data_mem->start));
++ glamomci_reg_write(host, GLAMO_REG_MMC_RDATADS2,
++ (uint16_t)(host->data_mem->start >> 16));
++
++}
++
++static int glamo_mci_clock_disable(struct mmc_host *mmc, int lazy)
++{
++ struct glamo_mci_host *host = mmc_priv(mmc);
++ glamo_engine_suspend(host->core, GLAMO_ENGINE_MMC);
++ return 0;
++}
++
++static int glamo_mci_clock_enable(struct mmc_host *mmc)
++{
++ struct glamo_mci_host *host = mmc_priv(mmc);
++ glamo_engine_enable(host->core, GLAMO_ENGINE_MMC);
++ return 0;
++}
++
++static void __iomem *glamo_mci_get_data_addr(struct glamo_mci_host *host,
++ struct mmc_data *data)
++{
++ void __iomem *addr = host->data_base;
++
++ if (data->host_cookie & 1)
++ addr += resource_size(host->data_mem) / 2;
++
++ return addr;
++}
++
++static void do_pio_read(struct glamo_mci_host *host, struct mmc_data *data)
++{
++ void __iomem *from_ptr = glamo_mci_get_data_addr(host, data);
++ struct sg_mapping_iter miter;
++
++ dev_dbg(&host->pdev->dev, "pio_read():\n");
++
++ sg_miter_start(&miter, data->sg, data->sg_len, SG_MITER_TO_SG);
++
++ while (sg_miter_next(&miter)) {
++ memcpy(miter.addr, from_ptr, miter.length);
++ from_ptr += miter.length;
++ }
++
++ sg_miter_stop(&miter);
++
++ dev_dbg(&host->pdev->dev, "pio_read(): "
++ "complete (no more data)\n");
++}
++
++static void do_pio_write(struct glamo_mci_host *host, struct mmc_data *data)
++{
++ void __iomem *to_ptr = glamo_mci_get_data_addr(host, data);
++ struct sg_mapping_iter miter;
++
++ dev_dbg(&host->pdev->dev, "pio_write():\n");
++ sg_miter_start(&miter, data->sg, data->sg_len, SG_MITER_FROM_SG);
++
++ while (sg_miter_next(&miter)) {
++ memcpy(to_ptr, miter.addr, miter.length);
++ to_ptr += miter.length;
++
++ data->bytes_xfered += miter.length;
++ }
++ sg_miter_stop(&miter);
++
++ dev_dbg(&host->pdev->dev, "pio_write(): complete\n");
++}
++
++static int glamo_mci_set_card_clock(struct glamo_mci_host *host, int freq)
++{
++ int real_rate = 0;
++
++ if (freq)
++ real_rate = glamo_engine_reclock(host->core, GLAMO_ENGINE_MMC,
++ freq);
++
++ return real_rate;
++}
++
++static int glamo_mci_wait_idle(struct glamo_mci_host *host,
++ unsigned long timeout)
++{
++ uint16_t status;
++
++ do {
++ status = glamomci_reg_read(host, GLAMO_REG_MMC_RB_STAT1);
++ } while (!(status & GLAMO_STAT1_MMC_IDLE) &&
++ time_is_after_jiffies(timeout));
++
++ if (time_is_before_eq_jiffies(timeout)) {
++ glamo_mci_reset(host);
++ return -ETIMEDOUT;
++ }
++
++ return 0;
++}
++
++static void glamo_mci_request_done(struct glamo_mci_host *host,
++ struct mmc_request *mrq)
++{
++ mmc_request_done(host->mmc, mrq);
++}
++
++static irqreturn_t glamo_mci_irq(int irq, void *data)
++{
++ struct glamo_mci_host *host = data;
++ struct mmc_request *mrq;
++ struct mmc_command *cmd;
++ uint16_t status;
++
++ if (!host->mrq || !host->mrq->cmd)
++ return IRQ_HANDLED;
++
++ mrq = host->mrq;
++ cmd = mrq->cmd;
++
++ status = glamomci_reg_read(host, GLAMO_REG_MMC_RB_STAT1);
++ dev_dbg(&host->pdev->dev, "status = 0x%04x\n", status);
++
++ /* we ignore a data timeout report if we are also told the data came */
++ if (status & GLAMO_STAT1_MMC_RB_DRDY)
++ status &= ~GLAMO_STAT1_MMC_DTOUT;
++
++ if (status & (GLAMO_STAT1_MMC_RTOUT | GLAMO_STAT1_MMC_DTOUT))
++ cmd->error = -ETIMEDOUT;
++ else if (status & (GLAMO_STAT1_MMC_BWERR | GLAMO_STAT1_MMC_BRERR))
++ cmd->error = -EILSEQ;
++
++ if (cmd->error) {
++ dev_info(&host->pdev->dev, "Error after cmd: 0x%x\n", status);
++ goto done;
++ }
++
++ /* issue STOP if we have been given one to use */
++ if (mrq->stop)
++ glamo_mci_send_command(host, mrq->stop);
++
++ if (mrq->data && (mrq->data->flags & MMC_DATA_READ)) {
++ mrq->data->bytes_xfered = mrq->data->blocks * mrq->data->blksz;
++ if (!mrq->data->host_cookie)
++ do_pio_read(host, mrq->data);
++ }
++
++ if (mrq->stop)
++ mrq->stop->error = glamo_mci_wait_idle(host, jiffies + HZ);
++
++done:
++ host->mrq = NULL;
++ glamo_mci_request_done(host, cmd->mrq);
++
++ return IRQ_HANDLED;
++}
++
++static void glamo_mci_send_command(struct glamo_mci_host *host,
++ struct mmc_command *cmd)
++{
++ uint8_t u8a[6];
++ uint16_t fire = 0;
++ unsigned int timeout = 1000000;
++ uint16_t *reg_resp = (uint16_t *)(host->mmio_base + GLAMO_REG_MMC_CMD_RSP1);
++ uint16_t status;
++ int triggers_int = 1;
++
++ /* if we can't do it, reject as busy */
++ if (!(glamomci_reg_read(host, GLAMO_REG_MMC_RB_STAT1) &
++ GLAMO_STAT1_MMC_IDLE)) {
++ cmd->error = -EBUSY;
++ return;
++ }
++
++ /* create an array in wire order for CRC computation */
++ u8a[0] = 0x40 | (cmd->opcode & 0x3f);
++ u8a[1] = (uint8_t)(cmd->arg >> 24);
++ u8a[2] = (uint8_t)(cmd->arg >> 16);
++ u8a[3] = (uint8_t)(cmd->arg >> 8);
++ u8a[4] = (uint8_t)cmd->arg;
++ u8a[5] = (crc7(0, u8a, 5) << 1) | 0x01;
++
++ /* issue the wire-order array including CRC in register order */
++ glamomci_reg_write(host, GLAMO_REG_MMC_CMD_REG1, ((u8a[4] << 8) | u8a[5]));
++ glamomci_reg_write(host, GLAMO_REG_MMC_CMD_REG2, ((u8a[2] << 8) | u8a[3]));
++ glamomci_reg_write(host, GLAMO_REG_MMC_CMD_REG3, ((u8a[0] << 8) | u8a[1]));
++
++ /* command index toggle */
++ fire |= (host->request_counter & 1) << 12;
++
++ /* set type of command */
++ switch (mmc_cmd_type(cmd)) {
++ case MMC_CMD_BC:
++ fire |= GLAMO_FIRE_MMC_CMDT_BNR;
++ break;
++ case MMC_CMD_BCR:
++ fire |= GLAMO_FIRE_MMC_CMDT_BR;
++ break;
++ case MMC_CMD_AC:
++ fire |= GLAMO_FIRE_MMC_CMDT_AND;
++ break;
++ case MMC_CMD_ADTC:
++ fire |= GLAMO_FIRE_MMC_CMDT_AD;
++ break;
++ }
++ /*
++ * if it expects a response, set the type expected
++ *
++ * R1, Length : 48bit, Normal response
++ * R1b, Length : 48bit, same R1, but added card busy status
++ * R2, Length : 136bit (really 128 bits with CRC snipped)
++ * R3, Length : 48bit (OCR register value)
++ * R4, Length : 48bit, SDIO_OP_CONDITION, Reverse SDIO Card
++ * R5, Length : 48bit, IO_RW_DIRECTION, Reverse SDIO Card
++ * R6, Length : 48bit (RCA register)
++ * R7, Length : 48bit (interface condition, VHS(voltage supplied),
++ * check pattern, CRC7)
++ */
++ switch (mmc_resp_type(cmd)) {
++ case MMC_RSP_R1: /* same index as R6 and R7 */
++ fire |= GLAMO_FIRE_MMC_RSPT_R1;
++ break;
++ case MMC_RSP_R1B:
++ fire |= GLAMO_FIRE_MMC_RSPT_R1b;
++ break;
++ case MMC_RSP_R2:
++ fire |= GLAMO_FIRE_MMC_RSPT_R2;
++ break;
++ case MMC_RSP_R3:
++ fire |= GLAMO_FIRE_MMC_RSPT_R3;
++ break;
++ /* R4 and R5 supported by chip not defined in linux/mmc/core.h (sdio) */
++ }
++ /*
++ * From the command index, set up the command class in the host ctrllr
++ *
++ * missing guys present on chip but couldn't figure out how to use yet:
++ * 0x0 "stream read"
++ * 0x9 "cancel running command"
++ */
++ switch (cmd->opcode) {
++ case MMC_READ_SINGLE_BLOCK:
++ fire |= GLAMO_FIRE_MMC_CC_SBR; /* single block read */
++ break;
++ case MMC_SWITCH: /* 64 byte payload */
++ case SD_APP_SD_STATUS:
++ case SD_APP_SEND_SCR:
++ case MMC_READ_MULTIPLE_BLOCK:
++ /* we will get an interrupt off this */
++ if (!cmd->mrq->stop) {
++ /* multiblock no stop */
++ fire |= GLAMO_FIRE_MMC_CC_MBRNS;
++ } else {
++ /* multiblock with stop */
++ fire |= GLAMO_FIRE_MMC_CC_MBRS;
++ }
++ break;
++ case MMC_WRITE_BLOCK:
++ fire |= GLAMO_FIRE_MMC_CC_SBW; /* single block write */
++ break;
++ case MMC_WRITE_MULTIPLE_BLOCK:
++ if (cmd->mrq->stop) {
++ /* multiblock with stop */
++ fire |= GLAMO_FIRE_MMC_CC_MBWS;
++ } else {
++ /* multiblock NO stop-- 'RESERVED'? */
++ fire |= GLAMO_FIRE_MMC_CC_MBWNS;
++ }
++ break;
++ case MMC_STOP_TRANSMISSION:
++ fire |= GLAMO_FIRE_MMC_CC_STOP; /* STOP */
++ triggers_int = 0;
++ break;
++ default:
++ fire |= GLAMO_FIRE_MMC_CC_BASIC; /* "basic command" */
++ triggers_int = 0;
++ break;
++ }
++
++ if (cmd->data)
++ host->mrq = cmd->mrq;
++
++ /* always largest timeout */
++ glamomci_reg_write(host, GLAMO_REG_MMC_TIMEOUT, 0xfff);
++
++ /* Generate interrupt on txfer */
++ glamomci_reg_set_bit_mask(host, GLAMO_REG_MMC_BASIC, 0xff36,
++ 0x0800 |
++ GLAMO_BASIC_MMC_NO_CLK_RD_WAIT |
++ GLAMO_BASIC_MMC_EN_COMPL_INT |
++ GLAMO_BASIC_MMC_EN_DATA_PUPS |
++ GLAMO_BASIC_MMC_EN_CMD_PUP);
++
++ /* send the command out on the wire */
++ /* dev_info(&host->pdev->dev, "Using FIRE %04X\n", fire); */
++ glamomci_reg_write(host, GLAMO_REG_MMC_CMD_FIRE, fire);
++
++ /* we are deselecting card? because it isn't going to ack then... */
++ if ((cmd->opcode == 7) && (cmd->arg == 0))
++ return;
++
++ /*
++ * we must spin until response is ready or timed out
++ * -- we don't get interrupts unless there is a bulk rx
++ */
++ do
++ status = glamomci_reg_read(host, GLAMO_REG_MMC_RB_STAT1);
++ while (((((status >> 15) & 1) != (host->request_counter & 1)) ||
++ (!(status & (GLAMO_STAT1_MMC_RB_RRDY |
++ GLAMO_STAT1_MMC_RTOUT |
++ GLAMO_STAT1_MMC_DTOUT |
++ GLAMO_STAT1_MMC_BWERR |
++ GLAMO_STAT1_MMC_BRERR)))) && (timeout--));
++
++ if ((status & (GLAMO_STAT1_MMC_RTOUT | GLAMO_STAT1_MMC_DTOUT)) ||
++ (timeout == 0)) {
++ cmd->error = -ETIMEDOUT;
++ } else if (status & (GLAMO_STAT1_MMC_BWERR | GLAMO_STAT1_MMC_BRERR)) {
++ cmd->error = -EILSEQ;
++ }
++
++ if (cmd->flags & MMC_RSP_PRESENT) {
++ if (cmd->flags & MMC_RSP_136) {
++ cmd->resp[3] = readw(&reg_resp[0]) |
++ (readw(&reg_resp[1]) << 16);
++ cmd->resp[2] = readw(&reg_resp[2]) |
++ (readw(&reg_resp[3]) << 16);
++ cmd->resp[1] = readw(&reg_resp[4]) |
++ (readw(&reg_resp[5]) << 16);
++ cmd->resp[0] = readw(&reg_resp[6]) |
++ (readw(&reg_resp[7]) << 16);
++ } else {
++ cmd->resp[0] = (readw(&reg_resp[0]) >> 8) |
++ (readw(&reg_resp[1]) << 8) |
++ (readw(&reg_resp[2]) << 24);
++ }
++ }
++}
++
++static int glamo_mci_prepare_pio(struct glamo_mci_host *host,
++ struct mmc_data *data)
++{
++ unsigned long addr = host->data_mem->start;
++
++ if (data->host_cookie & 1)
++ addr += resource_size(host->data_mem) / 2;
++
++ /* set up the block info */
++ glamomci_reg_write(host, GLAMO_REG_MMC_DATBLKLEN, data->blksz);
++ glamomci_reg_write(host, GLAMO_REG_MMC_DATBLKCNT, data->blocks);
++
++ if (data->flags & MMC_DATA_WRITE) {
++ glamomci_reg_write(host, GLAMO_REG_MMC_WDATADS1, addr);
++ glamomci_reg_write(host, GLAMO_REG_MMC_WDATADS2, addr >> 16);
++ } else {
++ glamomci_reg_write(host, GLAMO_REG_MMC_RDATADS1, addr);
++ glamomci_reg_write(host, GLAMO_REG_MMC_RDATADS2, addr >> 16);
++ }
++
++ if ((data->flags & MMC_DATA_WRITE) && !data->host_cookie)
++ do_pio_write(host, data);
++
++ dev_dbg(&host->pdev->dev, "(blksz=%d, count=%d)\n",
++ data->blksz, data->blocks);
++ return 0;
++}
++
++static void glamo_mci_send_request(struct mmc_host *mmc,
++ struct mmc_request *mrq)
++{
++ struct glamo_mci_host *host = mmc_priv(mmc);
++ struct mmc_command *cmd = mrq->cmd;
++
++ host->request_counter++;
++ host->request_start = jiffies;
++
++ if (cmd->data) {
++ if (glamo_mci_prepare_pio(host, cmd->data)) {
++ cmd->error = -EIO;
++ cmd->data->error = -EIO;
++ goto done;
++ }
++ }
++
++ dev_dbg(&host->pdev->dev, "cmd 0x%x, "
++ "arg 0x%x data=%p mrq->stop=%p flags 0x%x\n",
++ cmd->opcode, cmd->arg, cmd->data, cmd->mrq->stop,
++ cmd->flags);
++
++ glamo_mci_send_command(host, cmd);
++
++ /*
++ * if we don't have bulk data to take care of, we're done
++ */
++ if (!cmd->data || cmd->error)
++ goto done;
++
++ /*
++ * Otherwise can can use the interrupt as async completion --
++ * if there is read data coming, or we wait for write data to complete,
++ * exit without mmc_request_done() as the payload interrupt
++ * will service it
++ */
++ dev_dbg(&host->pdev->dev, "Waiting for payload data\n");
++ return;
++done:
++ if (!cmd->error)
++ cmd->error = glamo_mci_wait_idle(host, jiffies + 2 * HZ);
++ glamo_mci_request_done(host, mrq);
++}
++
++static void glamo_mci_set_power_mode(struct glamo_mci_host *host,
++ unsigned char power_mode)
++{
++ int ret;
++
++ if (power_mode == host->power_mode)
++ return;
++
++ switch (power_mode) {
++ case MMC_POWER_UP:
++ if (host->power_mode == MMC_POWER_OFF) {
++ ret = regulator_enable(host->regulator);
++ if (ret)
++ dev_err(&host->pdev->dev,
++ "Failed to enable regulator: %d\n",
++ ret);
++ }
++ break;
++ case MMC_POWER_ON:
++ break;
++ case MMC_POWER_OFF:
++ default:
++ ret = regulator_disable(host->regulator);
++ if (ret)
++ dev_warn(&host->pdev->dev,
++ "Failed to disable regulator: %d\n",
++ ret);
++ break;
++ }
++ host->power_mode = power_mode;
++}
++
++static void glamo_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
++{
++ struct glamo_mci_host *host = mmc_priv(mmc);
++ int bus_width = 0;
++ int rate;
++ int sd_drive;
++ int ret;
++
++ mmc_host_enable(mmc);
++
++ /* Set power */
++ glamo_mci_set_power_mode(host, ios->power_mode);
++
++ if (host->vdd != ios->vdd) {
++ ret = mmc_regulator_set_ocr(mmc, host->regulator, ios->vdd);
++ if (ret)
++ dev_err(&host->pdev->dev,
++ "Failed to set regulator voltage: %d\n", ret);
++ else
++ host->vdd = ios->vdd;
++ }
++
++ rate = glamo_mci_set_card_clock(host, ios->clock);
++
++ if ((ios->power_mode == MMC_POWER_ON) ||
++ (ios->power_mode == MMC_POWER_UP)) {
++ dev_info(&host->pdev->dev,
++ "powered (vdd = %hu) clk: %dkHz div=%hu (req: %ukHz). "
++ "Bus width=%d\n", ios->vdd,
++ rate / 1000, 0,
++ ios->clock / 1000, (int)ios->bus_width);
++ } else {
++ dev_info(&host->pdev->dev, "glamo_mci_set_ios: power down.\n");
++ }
++
++ /* set bus width */
++ if (ios->bus_width == MMC_BUS_WIDTH_4)
++ bus_width = GLAMO_BASIC_MMC_EN_4BIT_DATA;
++
++ sd_drive = (rate * 4) / host->clk_rate;
++ if (sd_drive > 3)
++ sd_drive = 3;
++
++ glamomci_reg_set_bit_mask(host, GLAMO_REG_MMC_BASIC,
++ GLAMO_BASIC_MMC_EN_4BIT_DATA | 0xc0,
++ bus_width | sd_drive << 6);
++
++ if (host->power_mode == MMC_POWER_OFF)
++ mmc_host_disable(host->mmc);
++ else
++ mmc_host_lazy_disable(host->mmc);
++}
++
++static void glamo_mci_pre_request(struct mmc_host *mmc,
++ struct mmc_request *mrq, bool is_first_req)
++{
++ struct glamo_mci_host *host = mmc_priv(mmc);
++
++ mrq->data->host_cookie = (host->request_counter & 1) | 2;
++
++ /* if write, prep the write into the shared RAM before the command */
++ if (mrq->data->flags & MMC_DATA_WRITE)
++ do_pio_write(host, mrq->data);
++}
++
++static void glamo_mci_post_request(struct mmc_host *mmc,
++ struct mmc_request *mrq, int err)
++{
++ struct glamo_mci_host *host = mmc_priv(mmc);
++
++ if (!mrq->data->host_cookie)
++ return;
++
++ if (err)
++ return;
++
++ if (mrq->data->flags & MMC_DATA_READ)
++ do_pio_read(host, mrq->data);
++
++ mrq->data->host_cookie = 0;
++}
++
++static struct mmc_host_ops glamo_mci_ops = {
++ .enable = glamo_mci_clock_enable,
++ .disable = glamo_mci_clock_disable,
++ .request = glamo_mci_send_request,
++ .post_req = glamo_mci_post_request,
++ .pre_req = glamo_mci_pre_request,
++ .set_ios = glamo_mci_set_ios,
++};
++
++static int __devinit glamo_mci_probe(struct platform_device *pdev)
++{
++ struct mmc_host *mmc;
++ struct glamo_mci_host *host;
++ struct glamo_core *core = dev_get_drvdata(pdev->dev.parent);
++ int ret;
++
++ dev_info(&pdev->dev, "glamo_mci driver (C)2007 Openmoko, Inc\n");
++
++ mmc = mmc_alloc_host(sizeof(struct glamo_mci_host), &pdev->dev);
++ if (!mmc) {
++ ret = -ENOMEM;
++ goto probe_out;
++ }
++
++ host = mmc_priv(mmc);
++ host->mmc = mmc;
++ host->pdev = pdev;
++ if (core->pdata)
++ host->pdata = core->pdata->mmc_data;
++ host->power_mode = MMC_POWER_OFF;
++ host->core = core;
++
++ host->irq = platform_get_irq(pdev, 0);
++
++ host->regulator = regulator_get(pdev->dev.parent, "SD_3V3");
++ if (IS_ERR(host->regulator)) {
++ dev_err(&pdev->dev, "Cannot proceed without regulator.\n");
++ ret = PTR_ERR(host->regulator);
++ goto probe_free_host;
++ }
++
++ host->mmio_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ if (!host->mmio_mem) {
++ dev_err(&pdev->dev,
++ "failed to get io memory region resouce.\n");
++ ret = -ENOENT;
++ goto probe_regulator_put;
++ }
++
++ host->mmio_mem = request_mem_region(host->mmio_mem->start,
++ resource_size(host->mmio_mem),
++ pdev->name);
++
++ if (!host->mmio_mem) {
++ dev_err(&pdev->dev, "failed to request io memory region.\n");
++ ret = -ENOENT;
++ goto probe_regulator_put;
++ }
++
++ host->mmio_base = ioremap(host->mmio_mem->start,
++ resource_size(host->mmio_mem));
++ if (!host->mmio_base) {
++ dev_err(&pdev->dev, "failed to ioremap() io memory region.\n");
++ ret = -EINVAL;
++ goto probe_free_mem_region_mmio;
++ }
++
++
++ /* Get ahold of our data buffer we use for data in and out on MMC */
++ host->data_mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
++ if (!host->data_mem) {
++ dev_err(&pdev->dev,
++ "failed to get io memory region resource.\n");
++ ret = -ENOENT;
++ goto probe_iounmap_mmio;
++ }
++
++ host->data_mem = request_mem_region(host->data_mem->start,
++ resource_size(host->data_mem),
++ pdev->name);
++
++ if (!host->data_mem) {
++ dev_err(&pdev->dev, "failed to request io memory region.\n");
++ ret = -ENOENT;
++ goto probe_iounmap_mmio;
++ }
++ host->data_base = ioremap(host->data_mem->start,
++ resource_size(host->data_mem));
++
++ if (host->data_base == 0) {
++ dev_err(&pdev->dev, "failed to ioremap() io memory region.\n");
++ ret = -EINVAL;
++ goto probe_free_mem_region_data;
++ }
++
++ ret = request_threaded_irq(host->irq, NULL, glamo_mci_irq, IRQF_SHARED,
++ pdev->name, host);
++ if (ret) {
++ dev_err(&pdev->dev, "failed to register irq.\n");
++ goto probe_iounmap_data;
++ }
++
++
++ host->vdd = 0;
++ host->clk_rate = glamo_pll_rate(host->core, GLAMO_PLL1);
++
++ /* explain our host controller capabilities */
++ mmc->ops = &glamo_mci_ops;
++ mmc->ocr_avail = mmc_regulator_get_ocrmask(host->regulator);
++ mmc->caps = MMC_CAP_4_BIT_DATA |
++ MMC_CAP_MMC_HIGHSPEED |
++ MMC_CAP_SD_HIGHSPEED;
++
++ if (host->pdata->nonremovable)
++ mmc->caps |= MMC_CAP_NONREMOVABLE;
++
++ mmc->f_min = host->clk_rate / 256;
++ mmc->f_max = sd_max_clk;
++
++ mmc->max_blk_count = (1 << 16) - 1; /* GLAMO_REG_MMC_RB_BLKCNT */
++ mmc->max_blk_size = (1 << 12) - 1; /* GLAMO_REG_MMC_RB_BLKLEN */
++ mmc->max_req_size = resource_size(host->data_mem) / 2;
++ mmc->max_seg_size = mmc->max_req_size;
++ mmc->max_segs = 128;
++
++ if (mmc->ocr_avail < 0) {
++ dev_warn(&pdev->dev,
++ "Failed to get ocr list for regulator: %d.\n",
++ mmc->ocr_avail);
++ mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
++ }
++
++ platform_set_drvdata(pdev, mmc);
++
++ mmc->caps |= MMC_CAP_DISABLE;
++ mmc_set_disable_delay(mmc, 1000 / 16);
++
++ mmc_host_enable(mmc);
++ glamo_mci_reset(host);
++
++ ret = mmc_add_host(mmc);
++ if (ret) {
++ dev_err(&pdev->dev, "failed to add mmc host.\n");
++ goto probe_mmc_host_disable;
++ }
++
++ mmc_host_lazy_disable(mmc);
++
++ return 0;
++
++probe_mmc_host_disable:
++ mmc_host_disable(mmc);
++ free_irq(host->irq, host);
++probe_iounmap_data:
++ iounmap(host->data_base);
++probe_free_mem_region_data:
++ release_mem_region(host->data_mem->start,
++ resource_size(host->data_mem));
++probe_iounmap_mmio:
++ iounmap(host->mmio_base);
++probe_free_mem_region_mmio:
++ release_mem_region(host->mmio_mem->start,
++ resource_size(host->mmio_mem));
++probe_regulator_put:
++ regulator_put(host->regulator);
++probe_free_host:
++ mmc_free_host(mmc);
++probe_out:
++ return ret;
++}
++
++static int __devexit glamo_mci_remove(struct platform_device *pdev)
++{
++ struct mmc_host *mmc = platform_get_drvdata(pdev);
++ struct glamo_mci_host *host = mmc_priv(mmc);
++
++ mmc_host_enable(mmc);
++ mmc_remove_host(mmc);
++ mmc_host_disable(mmc);
++
++ synchronize_irq(host->irq);
++ free_irq(host->irq, host);
++
++ iounmap(host->mmio_base);
++ iounmap(host->data_base);
++ release_mem_region(host->mmio_mem->start,
++ resource_size(host->mmio_mem));
++ release_mem_region(host->data_mem->start,
++ resource_size(host->data_mem));
++
++ regulator_put(host->regulator);
++
++ mmc_free_host(mmc);
++
++ return 0;
++}
++
++
++#ifdef CONFIG_PM
++
++static int glamo_mci_suspend(struct device *dev)
++{
++ struct mmc_host *mmc = dev_get_drvdata(dev);
++ struct glamo_mci_host *host = mmc_priv(mmc);
++ int ret;
++
++ disable_irq(host->irq);
++
++ mmc_host_enable(mmc);
++ ret = mmc_suspend_host(mmc);
++ mmc_host_disable(mmc);
++
++ return ret;
++}
++
++static int glamo_mci_resume(struct device *dev)
++{
++ struct mmc_host *mmc = dev_get_drvdata(dev);
++ struct glamo_mci_host *host = mmc_priv(mmc);
++ int ret;
++
++ mmc_host_enable(mmc);
++ glamo_mci_reset(host);
++ mdelay(10);
++
++ enable_irq(host->irq);
++
++ ret = mmc_resume_host(host->mmc);
++
++ mmc_host_lazy_disable(host->mmc);
++
++ return ret;
++}
++
++static SIMPLE_DEV_PM_OPS(glamo_mci_pm_ops, glamo_mci_suspend, glamo_mci_resume);
++#define GLAMO_MCI_PM_OPS (&glamo_mci_pm_ops)
++
++#else /* CONFIG_PM */
++#define GLAMO_MCI_PM_OPS NULL
++#endif /* CONFIG_PM */
++
++
++static struct platform_driver glamo_mci_driver = {
++ .probe = glamo_mci_probe,
++ .remove = __devexit_p(glamo_mci_remove),
++ .driver = {
++ .name = "glamo-mci",
++ .owner = THIS_MODULE,
++ .pm = GLAMO_MCI_PM_OPS,
++ },
++};
++
++static int __init glamo_mci_init(void)
++{
++ platform_driver_register(&glamo_mci_driver);
++ return 0;
++}
++module_init(glamo_mci_init);
++
++static void __exit glamo_mci_exit(void)
++{
++ platform_driver_unregister(&glamo_mci_driver);
++}
++module_exit(glamo_mci_exit);
++
++MODULE_DESCRIPTION("Glamo MMC/SD Card Interface driver");
++MODULE_LICENSE("GPL");
++MODULE_AUTHOR("Andy Green <andy@openmoko.com>");
++MODULE_ALIAS("platform:glamo-mci");
+diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
+index 33d832d..cb5d2c0 100644
+--- a/drivers/mtd/nand/s3c2410.c
++++ b/drivers/mtd/nand/s3c2410.c
+@@ -813,7 +813,7 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info,
+ nmtd->mtd.owner = THIS_MODULE;
+ nmtd->set = set;
+
+- if (hardware_ecc) {
++ if (!(info->platform && info->platform->software_ecc) && hardware_ecc) {
+ chip->ecc.calculate = s3c2410_nand_calculate_ecc;
+ chip->ecc.correct = s3c2410_nand_correct_data;
+ chip->ecc.mode = NAND_ECC_HW;
+diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
+index 52a462f..985f350 100644
+--- a/drivers/power/Kconfig
++++ b/drivers/power/Kconfig
+@@ -14,6 +14,12 @@ config POWER_SUPPLY_DEBUG
+ Say Y here to enable debugging messages for power supply class
+ and drivers.
+
++config BATTERY_PLATFORM
++ tristate "Platform battery driver"
++ help
++ Say Y here to include support for battery driver that gets all
++ information from platform functions.
++
+ config PDA_POWER
+ tristate "Generic PDA/phone power driver"
+ depends on !S390
+diff --git a/drivers/power/Makefile b/drivers/power/Makefile
+index 8385bfa..59530ee 100644
+--- a/drivers/power/Makefile
++++ b/drivers/power/Makefile
+@@ -14,6 +14,7 @@ obj-$(CONFIG_WM831X_POWER) += wm831x_power.o
+ obj-$(CONFIG_WM8350_POWER) += wm8350_power.o
+ obj-$(CONFIG_TEST_POWER) += test_power.o
+
++obj-$(CONFIG_BATTERY_PLATFORM) += platform_battery.o
+ obj-$(CONFIG_BATTERY_DS2760) += ds2760_battery.o
+ obj-$(CONFIG_BATTERY_DS2782) += ds2782_battery.o
+ obj-$(CONFIG_BATTERY_PMU) += pmu_battery.o
+diff --git a/drivers/power/pcf50633-charger.c b/drivers/power/pcf50633-charger.c
+index 4fa52e1..97dbcb2 100644
+--- a/drivers/power/pcf50633-charger.c
++++ b/drivers/power/pcf50633-charger.c
+@@ -24,9 +24,27 @@
+ #include <linux/platform_device.h>
+ #include <linux/power_supply.h>
+
++#include <linux/interrupt.h>
++
+ #include <linux/mfd/pcf50633/core.h>
+ #include <linux/mfd/pcf50633/mbc.h>
+
++enum pcf50633_mbc_irqs {
++ PCF50633_MBC_IRQ_ADPINS,
++ PCF50633_MBC_IRQ_ADPREM,
++ PCF50633_MBC_IRQ_USBINS,
++ PCF50633_MBC_IRQ_USBREM,
++ PCF50633_MBC_IRQ_BATFULL,
++ PCF50633_MBC_IRQ_CHGHALT,
++ PCF50633_MBC_IRQ_THLIMON,
++ PCF50633_MBC_IRQ_THLIMOFF,
++ PCF50633_MBC_IRQ_USBLIMON,
++ PCF50633_MBC_IRQ_USBLIMOFF,
++ PCF50633_MBC_IRQ_LOWSYS,
++ PCF50633_MBC_IRQ_LOWBAT,
++ PCF50633_MBC_NUM_IRQS,
++};
++
+ struct pcf50633_mbc {
+ struct pcf50633 *pcf;
+
+@@ -36,11 +54,13 @@ struct pcf50633_mbc {
+ struct power_supply usb;
+ struct power_supply adapter;
+ struct power_supply ac;
++
++ int irqs[PCF50633_MBC_NUM_IRQS];
+ };
+
+-int pcf50633_mbc_usb_curlim_set(struct pcf50633 *pcf, int ma)
++static int __pcf50633_mbc_usb_curlim_set(struct pcf50633_mbc *mbc, int ma)
+ {
+- struct pcf50633_mbc *mbc = platform_get_drvdata(pcf->mbc_pdev);
++ struct pcf50633 *pcf = mbc->pcf;
+ int ret = 0;
+ u8 bits;
+ int charging_start = 1;
+@@ -80,14 +100,14 @@ int pcf50633_mbc_usb_curlim_set(struct pcf50633 *pcf, int ma)
+ * gets reset to the wrong thing
+ */
+
+- if (mbc->pcf->pdata->charger_reference_current_ma) {
+- mbcc5 = (ma << 8) / mbc->pcf->pdata->charger_reference_current_ma;
++ if (pcf->pdata->charger_reference_current_ma) {
++ mbcc5 = (ma << 8) / pcf->pdata->charger_reference_current_ma;
+ if (mbcc5 > 255)
+ mbcc5 = 255;
+- pcf50633_reg_write(mbc->pcf, PCF50633_REG_MBCC5, mbcc5);
++ pcf50633_reg_write(pcf, PCF50633_REG_MBCC5, mbcc5);
+ }
+
+- mbcs2 = pcf50633_reg_read(mbc->pcf, PCF50633_REG_MBCS2);
++ mbcs2 = pcf50633_reg_read(pcf, PCF50633_REG_MBCS2);
+ chgmod = (mbcs2 & PCF50633_MBCS2_MBC_MASK);
+
+ /* If chgmod == BATFULL, setting chgena has no effect.
+@@ -108,18 +128,29 @@ int pcf50633_mbc_usb_curlim_set(struct pcf50633 *pcf, int ma)
+
+ return ret;
+ }
++
++int pcf50633_mbc_usb_curlim_set(struct pcf50633 *pcf, int ma)
++{
++ struct pcf50633_mbc *mbc = pcf->mbc;
++
++ if (!mbc)
++ return -ENODEV;
++
++ return __pcf50633_mbc_usb_curlim_set(mbc, ma);
++}
+ EXPORT_SYMBOL_GPL(pcf50633_mbc_usb_curlim_set);
+
++
+ int pcf50633_mbc_get_status(struct pcf50633 *pcf)
+ {
+- struct pcf50633_mbc *mbc = platform_get_drvdata(pcf->mbc_pdev);
++ struct pcf50633_mbc *mbc = pcf->mbc;
+ int status = 0;
+ u8 chgmod;
+
+ if (!mbc)
+ return 0;
+
+- chgmod = pcf50633_reg_read(mbc->pcf, PCF50633_REG_MBCS2)
++ chgmod = pcf50633_reg_read(pcf, PCF50633_REG_MBCS2)
+ & PCF50633_MBCS2_MBC_MASK;
+
+ if (mbc->usb_online)
+@@ -143,7 +174,7 @@ EXPORT_SYMBOL_GPL(pcf50633_mbc_get_status);
+
+ int pcf50633_mbc_get_usb_online_status(struct pcf50633 *pcf)
+ {
+- struct pcf50633_mbc *mbc = platform_get_drvdata(pcf->mbc_pdev);
++ struct pcf50633_mbc *mbc = pcf->mbc;
+
+ if (!mbc)
+ return 0;
+@@ -195,7 +226,7 @@ static ssize_t set_usblim(struct device *dev,
+ if (ret)
+ return -EINVAL;
+
+- pcf50633_mbc_usb_curlim_set(mbc->pcf, ma);
++ __pcf50633_mbc_usb_curlim_set(mbc, ma);
+
+ return count;
+ }
+@@ -259,31 +290,34 @@ static struct attribute_group mbc_attr_group = {
+ .attrs = pcf50633_mbc_sysfs_entries,
+ };
+
+-static void
+-pcf50633_mbc_irq_handler(int irq, void *data)
++static irqreturn_t pcf50633_mbc_irq_handler(int irq, void *data)
+ {
+ struct pcf50633_mbc *mbc = data;
+
+ /* USB */
+- if (irq == PCF50633_IRQ_USBINS) {
++ if (irq == mbc->irqs[PCF50633_MBC_IRQ_USBINS]) {
+ mbc->usb_online = 1;
+- } else if (irq == PCF50633_IRQ_USBREM) {
++ } else if (irq == mbc->irqs[PCF50633_MBC_IRQ_USBREM]) {
+ mbc->usb_online = 0;
+- pcf50633_mbc_usb_curlim_set(mbc->pcf, 0);
++ __pcf50633_mbc_usb_curlim_set(mbc, 0);
+ }
+
+ /* Adapter */
+- if (irq == PCF50633_IRQ_ADPINS)
++ if (irq == mbc->irqs[PCF50633_MBC_IRQ_ADPINS])
+ mbc->adapter_online = 1;
+- else if (irq == PCF50633_IRQ_ADPREM)
++ else if (irq == mbc->irqs[PCF50633_MBC_IRQ_ADPREM])
+ mbc->adapter_online = 0;
+
+ power_supply_changed(&mbc->ac);
+ power_supply_changed(&mbc->usb);
+ power_supply_changed(&mbc->adapter);
+
+- if (mbc->pcf->pdata->mbc_event_callback)
++ if (mbc->pcf->pdata->mbc_event_callback) {
++ irq -= mbc->pcf->irq_base;
+ mbc->pcf->pdata->mbc_event_callback(mbc->pcf, irq);
++ }
++
++ return IRQ_HANDLED;
+ }
+
+ static int adapter_get_property(struct power_supply *psy,
+@@ -351,25 +385,27 @@ static enum power_supply_property power_props[] = {
+ POWER_SUPPLY_PROP_ONLINE,
+ };
+
+-static const u8 mbc_irq_handlers[] = {
+- PCF50633_IRQ_ADPINS,
+- PCF50633_IRQ_ADPREM,
+- PCF50633_IRQ_USBINS,
+- PCF50633_IRQ_USBREM,
+- PCF50633_IRQ_BATFULL,
+- PCF50633_IRQ_CHGHALT,
+- PCF50633_IRQ_THLIMON,
+- PCF50633_IRQ_THLIMOFF,
+- PCF50633_IRQ_USBLIMON,
+- PCF50633_IRQ_USBLIMOFF,
+- PCF50633_IRQ_LOWSYS,
+- PCF50633_IRQ_LOWBAT,
++static const char *pcf50633_mbc_irq_names[PCF50633_MBC_NUM_IRQS] = {
++ "ADPINS",
++ "ADPREM",
++ "USBINS",
++ "USBREM",
++ "BATFULL",
++ "CHGHALT",
++ "THLIMON",
++ "THLIMOFF",
++ "USBLIMON",
++ "USBLIMOFF",
++ "LOWSYS",
++ "LOWBAT",
+ };
+
+ static int __devinit pcf50633_mbc_probe(struct platform_device *pdev)
+ {
++ struct pcf50633 *pcf = dev_to_pcf50633(pdev->dev.parent);
+ struct pcf50633_mbc *mbc;
+ int ret;
++ int irq;
+ int i;
+ u8 mbcs1;
+
+@@ -377,13 +413,19 @@ static int __devinit pcf50633_mbc_probe(struct platform_device *pdev)
+ if (!mbc)
+ return -ENOMEM;
+
+- platform_set_drvdata(pdev, mbc);
+- mbc->pcf = dev_to_pcf50633(pdev->dev.parent);
++ for (i = 0; i < PCF50633_MBC_NUM_IRQS; ++i) {
++ irq = platform_get_irq_byname(pdev, pcf50633_mbc_irq_names[i]);
++ if (irq <= 0) {
++ dev_err(&pdev->dev, "Failed to get %s irq: %d\n",
++ pcf50633_mbc_irq_names[i], irq);
++ ret = irq ?: -EINVAL;
++ goto err_free;
++ }
++ mbc->irqs[i] = irq;
++ }
+
+- /* Set up IRQ handlers */
+- for (i = 0; i < ARRAY_SIZE(mbc_irq_handlers); i++)
+- pcf50633_register_irq(mbc->pcf, mbc_irq_handlers[i],
+- pcf50633_mbc_irq_handler, mbc);
++ platform_set_drvdata(pdev, mbc);
++ mbc->pcf = pcf;
+
+ /* Create power supplies */
+ mbc->adapter.name = "adapter";
+@@ -413,38 +455,63 @@ static int __devinit pcf50633_mbc_probe(struct platform_device *pdev)
+ ret = power_supply_register(&pdev->dev, &mbc->adapter);
+ if (ret) {
+ dev_err(mbc->pcf->dev, "failed to register adapter\n");
+- kfree(mbc);
+- return ret;
++ goto err_free;
+ }
+
+ ret = power_supply_register(&pdev->dev, &mbc->usb);
+ if (ret) {
+ dev_err(mbc->pcf->dev, "failed to register usb\n");
+- power_supply_unregister(&mbc->adapter);
+- kfree(mbc);
+- return ret;
++ goto err_unregister_adapter;
+ }
+
+ ret = power_supply_register(&pdev->dev, &mbc->ac);
+ if (ret) {
+ dev_err(mbc->pcf->dev, "failed to register ac\n");
+- power_supply_unregister(&mbc->adapter);
+- power_supply_unregister(&mbc->usb);
+- kfree(mbc);
+- return ret;
++ goto err_unregister_usb;
+ }
+
+ ret = sysfs_create_group(&pdev->dev.kobj, &mbc_attr_group);
+- if (ret)
++ if (ret) {
+ dev_err(mbc->pcf->dev, "failed to create sysfs entries\n");
++ goto err_unregister_ac;
++ }
++
++ /* Set up IRQ handlers */
++ for (i = 0; i < PCF50633_MBC_NUM_IRQS; ++i) {
++ ret = request_threaded_irq(mbc->irqs[i], NULL,
++ pcf50633_mbc_irq_handler, 0,
++ pcf50633_mbc_irq_names[i], mbc);
++ if (ret) {
++ dev_err(&pdev->dev, "Failed to request %s irq: %d\n",
++ pcf50633_mbc_irq_names[i], ret);
++ goto err_free_irq;
++ }
++ }
+
+ mbcs1 = pcf50633_reg_read(mbc->pcf, PCF50633_REG_MBCS1);
+ if (mbcs1 & PCF50633_MBCS1_USBPRES)
+- pcf50633_mbc_irq_handler(PCF50633_IRQ_USBINS, mbc);
++ pcf50633_mbc_irq_handler(mbc->irqs[PCF50633_MBC_IRQ_USBINS], mbc);
+ if (mbcs1 & PCF50633_MBCS1_ADAPTPRES)
+- pcf50633_mbc_irq_handler(PCF50633_IRQ_ADPINS, mbc);
++ pcf50633_mbc_irq_handler(mbc->irqs[PCF50633_MBC_IRQ_ADPINS], mbc);
++
++ pcf->mbc = mbc;
+
+ return 0;
++
++err_free_irq:
++ for (--i; i >= 0; --i)
++ free_irq(mbc->irqs[i], mbc);
++ sysfs_remove_group(&pdev->dev.kobj, &mbc_attr_group);
++err_unregister_ac:
++ power_supply_unregister(&mbc->ac);
++err_unregister_usb:
++ power_supply_unregister(&mbc->usb);
++err_unregister_adapter:
++ power_supply_unregister(&mbc->adapter);
++err_free:
++ kfree(mbc);
++
++ return ret;
+ }
+
+ static int __devexit pcf50633_mbc_remove(struct platform_device *pdev)
+@@ -452,9 +519,11 @@ static int __devexit pcf50633_mbc_remove(struct platform_device *pdev)
+ struct pcf50633_mbc *mbc = platform_get_drvdata(pdev);
+ int i;
+
++ mbc->pcf->mbc = NULL;
++
+ /* Remove IRQ handlers */
+- for (i = 0; i < ARRAY_SIZE(mbc_irq_handlers); i++)
+- pcf50633_free_irq(mbc->pcf, mbc_irq_handlers[i]);
++ for (i = PCF50633_MBC_NUM_IRQS - 1; i >= 0; --i)
++ free_irq(mbc->irqs[i], mbc);
+
+ sysfs_remove_group(&pdev->dev.kobj, &mbc_attr_group);
+ power_supply_unregister(&mbc->usb);
+diff --git a/drivers/power/platform_battery.c b/drivers/power/platform_battery.c
+new file mode 100644
+index 0000000..a5c9f35
+--- /dev/null
++++ b/drivers/power/platform_battery.c
+@@ -0,0 +1,120 @@
++/*
++ * Driver for platform battery
++ *
++ * Copyright (c) Paul Fertser <fercerpav@gmail.com>
++ * Inspired by Balaji Rao <balajirrao@openmoko.org>
++ *
++ * This driver can be used for dumb batteries when all knowledge about
++ * their state belongs to the platform that does necessary ADC readings,
++ * conversions, guessimations etc.
++ *
++ * Use consistent with the GNU GPL is permitted, provided that this
++ * copyright notice is preserved in its entirety in all copies and derived
++ * works.
++ */
++
++#include <linux/module.h>
++#include <linux/platform_device.h>
++#include <linux/power_supply.h>
++#include <linux/slab.h>
++#include <linux/workqueue.h>
++
++#include <linux/delay.h>
++#include <linux/platform_battery.h>
++
++struct platform_battery {
++ struct power_supply psy;
++ struct platform_bat_platform_data *pdata;
++};
++
++static int platform_bat_get_property(struct power_supply *psy,
++ enum power_supply_property psp,
++ union power_supply_propval *val)
++{
++ struct platform_battery *bat =
++ container_of(psy, struct platform_battery, psy);
++ size_t i;
++ int present=1;
++
++ if (bat->pdata->is_present)
++ present = bat->pdata->is_present();
++
++ if (psp != POWER_SUPPLY_PROP_PRESENT && !present)
++ return -ENODEV;
++
++ for (i = 0; i < psy->num_properties; i++)
++ if (psy->properties[i] == psp) {
++ val->intval = bat->pdata->get_property[i]();
++ return 0;
++ }
++
++ return -EINVAL;
++}
++
++static void platform_bat_ext_changed(struct power_supply *psy)
++{
++ struct platform_battery *bat =
++ container_of(psy, struct platform_battery, psy);
++ power_supply_changed(&bat->psy);
++}
++
++static int platform_battery_probe(struct platform_device *pdev)
++{
++ struct platform_battery *platform_bat;
++ struct platform_bat_platform_data *pdata =
++ (struct platform_bat_platform_data *)pdev->dev.platform_data;
++
++ platform_bat = kzalloc(sizeof(*platform_bat), GFP_KERNEL);
++ if (!platform_bat)
++ return -ENOMEM;
++
++ if (pdata->name)
++ platform_bat->psy.name = pdata->name;
++ else
++ platform_bat->psy.name = dev_name(&pdev->dev);
++ platform_bat->psy.type = POWER_SUPPLY_TYPE_BATTERY;
++ platform_bat->psy.properties = pdata->properties;
++ platform_bat->psy.num_properties = pdata->num_properties;
++ platform_bat->psy.get_property = platform_bat_get_property;
++ platform_bat->psy.external_power_changed = platform_bat_ext_changed;
++
++ platform_bat->pdata = pdata;
++ platform_set_drvdata(pdev, platform_bat);
++ power_supply_register(&pdev->dev, &platform_bat->psy);
++
++ return 0;
++}
++
++static int platform_battery_remove(struct platform_device *pdev)
++{
++ struct platform_battery *bat = platform_get_drvdata(pdev);
++
++ power_supply_unregister(&bat->psy);
++ kfree(bat);
++
++ return 0;
++}
++
++static struct platform_driver platform_battery_driver = {
++ .driver = {
++ .name = "platform_battery",
++ },
++ .probe = platform_battery_probe,
++ .remove = platform_battery_remove,
++};
++
++static int __init platform_battery_init(void)
++{
++ return platform_driver_register(&platform_battery_driver);
++}
++module_init(platform_battery_init);
++
++static void __exit platform_battery_exit(void)
++{
++ platform_driver_unregister(&platform_battery_driver);
++}
++module_exit(platform_battery_exit);
++
++MODULE_LICENSE("GPL");
++MODULE_AUTHOR("Paul Fertser <fercerpav@gmail.com>");
++MODULE_DESCRIPTION("platform battery driver");
+diff --git a/drivers/regulator/pcf50633-regulator.c b/drivers/regulator/pcf50633-regulator.c
+index 69a11d9..5e7deb5 100644
+--- a/drivers/regulator/pcf50633-regulator.c
++++ b/drivers/regulator/pcf50633-regulator.c
+@@ -316,11 +316,10 @@ static int __devinit pcf50633_regulator_probe(struct platform_device *pdev)
+ struct regulator_dev *rdev;
+ struct pcf50633 *pcf;
+
+- /* Already set by core driver */
+ pcf = dev_to_pcf50633(pdev->dev.parent);
+
+ rdev = regulator_register(&regulators[pdev->id], &pdev->dev,
+- pdev->dev.platform_data, pcf);
++ &pcf->pdata->reg_init_data[pdev->id], pcf);
+ if (IS_ERR(rdev))
+ return PTR_ERR(rdev);
+
+diff --git a/drivers/rtc/rtc-pcf50633.c b/drivers/rtc/rtc-pcf50633.c
+index f90c574..b0dc8c2 100644
+--- a/drivers/rtc/rtc-pcf50633.c
++++ b/drivers/rtc/rtc-pcf50633.c
+@@ -58,11 +58,12 @@ struct pcf50633_time {
+
+ struct pcf50633_rtc {
+ int alarm_enabled;
+- int second_enabled;
+ int alarm_pending;
+
+ struct pcf50633 *pcf;
+ struct rtc_device *rtc_dev;
++
++ int irq_alarm;
+ };
+
+ static void pcf2rtc_time(struct rtc_time *rtc, struct pcf50633_time *pcf)
+@@ -91,15 +92,11 @@ static int
+ pcf50633_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
+ {
+ struct pcf50633_rtc *rtc = dev_get_drvdata(dev);
+- int err;
+-
+- if (enabled)
+- err = pcf50633_irq_unmask(rtc->pcf, PCF50633_IRQ_ALARM);
+- else
+- err = pcf50633_irq_mask(rtc->pcf, PCF50633_IRQ_ALARM);
+
+- if (err < 0)
+- return err;
++ if (enabled && !rtc->alarm_enabled)
++ enable_irq(rtc->irq_alarm);
++ else if (!enabled && rtc->alarm_enabled)
++ disable_irq(rtc->irq_alarm);
+
+ rtc->alarm_enabled = enabled;
+
+@@ -143,7 +140,7 @@ static int pcf50633_rtc_set_time(struct device *dev, struct rtc_time *tm)
+ {
+ struct pcf50633_rtc *rtc;
+ struct pcf50633_time pcf_tm;
+- int second_masked, alarm_masked, ret = 0;
++ int ret = 0;
+
+ rtc = dev_get_drvdata(dev);
+
+@@ -162,23 +159,16 @@ static int pcf50633_rtc_set_time(struct device *dev, struct rtc_time *tm)
+ pcf_tm.time[PCF50633_TI_SEC]);
+
+
+- second_masked = pcf50633_irq_mask_get(rtc->pcf, PCF50633_IRQ_SECOND);
+- alarm_masked = pcf50633_irq_mask_get(rtc->pcf, PCF50633_IRQ_ALARM);
+-
+- if (!second_masked)
+- pcf50633_irq_mask(rtc->pcf, PCF50633_IRQ_SECOND);
+- if (!alarm_masked)
+- pcf50633_irq_mask(rtc->pcf, PCF50633_IRQ_ALARM);
++ if (rtc->alarm_enabled)
++ disable_irq(rtc->irq_alarm);
+
+ /* Returns 0 on success */
+ ret = pcf50633_write_block(rtc->pcf, PCF50633_REG_RTCSC,
+ PCF50633_TI_EXTENT,
+ &pcf_tm.time[0]);
+
+- if (!second_masked)
+- pcf50633_irq_unmask(rtc->pcf, PCF50633_IRQ_SECOND);
+- if (!alarm_masked)
+- pcf50633_irq_unmask(rtc->pcf, PCF50633_IRQ_ALARM);
++ if (rtc->alarm_enabled)
++ enable_irq(rtc->irq_alarm);
+
+ return ret;
+ }
+@@ -210,7 +200,7 @@ static int pcf50633_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
+ {
+ struct pcf50633_rtc *rtc;
+ struct pcf50633_time pcf_tm;
+- int alarm_masked, ret = 0;
++ int ret = 0;
+
+ rtc = dev_get_drvdata(dev);
+
+@@ -219,11 +209,9 @@ static int pcf50633_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
+ /* do like mktime does and ignore tm_wday */
+ pcf_tm.time[PCF50633_TI_WKDAY] = 7;
+
+- alarm_masked = pcf50633_irq_mask_get(rtc->pcf, PCF50633_IRQ_ALARM);
+-
+ /* disable alarm interrupt */
+- if (!alarm_masked)
+- pcf50633_irq_mask(rtc->pcf, PCF50633_IRQ_ALARM);
++ if (rtc->alarm_enabled)
++ disable_irq(rtc->irq_alarm);
+
+ /* Returns 0 on success */
+ ret = pcf50633_write_block(rtc->pcf, PCF50633_REG_RTCSCA,
+@@ -231,8 +219,8 @@ static int pcf50633_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
+ if (!alrm->enabled)
+ rtc->alarm_pending = 0;
+
+- if (!alarm_masked || alrm->enabled)
+- pcf50633_irq_unmask(rtc->pcf, PCF50633_IRQ_ALARM);
++ if (!rtc->alarm_enabled && alrm->enabled)
++ enable_irq(rtc->irq_alarm);
+ rtc->alarm_enabled = alrm->enabled;
+
+ return ret;
+@@ -246,24 +234,26 @@ static struct rtc_class_ops pcf50633_rtc_ops = {
+ .alarm_irq_enable = pcf50633_rtc_alarm_irq_enable,
+ };
+
+-static void pcf50633_rtc_irq(int irq, void *data)
++static irqreturn_t pcf50633_rtc_alarm_irq(int irq, void *data)
+ {
+ struct pcf50633_rtc *rtc = data;
++ rtc_update_irq(rtc->rtc_dev, 1, RTC_AF | RTC_IRQF);
++ rtc->alarm_pending = 1;
+
+- switch (irq) {
+- case PCF50633_IRQ_ALARM:
+- rtc_update_irq(rtc->rtc_dev, 1, RTC_AF | RTC_IRQF);
+- rtc->alarm_pending = 1;
+- break;
+- case PCF50633_IRQ_SECOND:
+- rtc_update_irq(rtc->rtc_dev, 1, RTC_UF | RTC_IRQF);
+- break;
+- }
++ return IRQ_HANDLED;
+ }
+
+ static int __devinit pcf50633_rtc_probe(struct platform_device *pdev)
+ {
+ struct pcf50633_rtc *rtc;
++ int irq_alarm;
++ int ret;
++
++ irq_alarm = platform_get_irq_byname(pdev, "ALARM");
++ if (irq_alarm <= 0) {
++ dev_err(&pdev->dev, "Failed to get alarm irq: %d\n", irq_alarm);
++ return irq_alarm ?: -EINVAL;
++ }
+
+ rtc = kzalloc(sizeof(*rtc), GFP_KERNEL);
+ if (!rtc)
+@@ -280,12 +270,23 @@ static int __devinit pcf50633_rtc_probe(struct platform_device *pdev)
+ return ret;
+ }
+
+- pcf50633_register_irq(rtc->pcf, PCF50633_IRQ_ALARM,
+- pcf50633_rtc_irq, rtc);
+- pcf50633_register_irq(rtc->pcf, PCF50633_IRQ_SECOND,
+- pcf50633_rtc_irq, rtc);
++ ret = request_threaded_irq(irq_alarm, NULL, pcf50633_rtc_alarm_irq, 0,
++ "pcf50633-rtc alarm", rtc);
++ if (ret) {
++ dev_err(&pdev->dev, "Failed to request alarm irq: %d\n", ret);
++ goto err_free;
++ }
++ disable_irq(irq_alarm);
++
++ rtc->irq_alarm = irq_alarm;
+
+ return 0;
++
++err_free_irq:
++ free_irq(irq_alarm, rtc);
++err_free:
++ kfree(rtc);
++ return ret;
+ }
+
+ static int __devexit pcf50633_rtc_remove(struct platform_device *pdev)
+@@ -294,8 +295,7 @@ static int __devexit pcf50633_rtc_remove(struct platform_device *pdev)
+
+ rtc = platform_get_drvdata(pdev);
+
+- pcf50633_free_irq(rtc->pcf, PCF50633_IRQ_ALARM);
+- pcf50633_free_irq(rtc->pcf, PCF50633_IRQ_SECOND);
++ free_irq(rtc->irq_alarm, rtc);
+
+ rtc_device_unregister(rtc->rtc_dev);
+ kfree(rtc);
+diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
+index 9e2fa8d..318093c 100644
+--- a/drivers/tty/serial/samsung.c
++++ b/drivers/tty/serial/samsung.c
+@@ -1268,6 +1268,13 @@ module_exit(s3c24xx_serial_modexit);
+ #ifdef CONFIG_SERIAL_SAMSUNG_CONSOLE
+
+ static struct uart_port *cons_uart;
++static int cons_silenced;
++
++void s3c24xx_serial_console_set_silence(int silenced)
++{
++ cons_silenced = silenced;
++}
++EXPORT_SYMBOL(s3c24xx_serial_console_set_silence);
+
+ static int
+ s3c24xx_serial_console_txrdy(struct uart_port *port, unsigned int ufcon)
+@@ -1292,9 +1299,21 @@ static void
+ s3c24xx_serial_console_putchar(struct uart_port *port, int ch)
+ {
+ unsigned int ufcon = rd_regl(cons_uart, S3C2410_UFCON);
++ unsigned int umcon = rd_regl(cons_uart, S3C2410_UMCON);
++
++ if (cons_silenced)
++ return;
++
++ /* If auto HW flow control enabled, temporarily turn it off */
++ if (umcon & S3C2410_UMCOM_AFC)
++ wr_regl(port, S3C2410_UMCON, (umcon & !S3C2410_UMCOM_AFC));
++
+ while (!s3c24xx_serial_console_txrdy(port, ufcon))
+ barrier();
+ wr_regb(cons_uart, S3C2410_UTXH, ch);
++
++ if (umcon & S3C2410_UMCOM_AFC)
++ wr_regl(port, S3C2410_UMCON, umcon);
+ }
+
+ static void
+diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
+index e6a8d8c..03ff799 100644
+--- a/drivers/video/Kconfig
++++ b/drivers/video/Kconfig
+@@ -2341,6 +2341,23 @@ config FB_PUV3_UNIGFX
+ Choose this option if you want to use the Unigfx device as a
+ framebuffer device. Without the support of PCI & AGP.
+
++config FB_GLAMO
++ tristate "Smedia Glamo 336x/337x framebuffer support"
++ depends on FB && MFD_GLAMO
++ select FB_CFB_FILLRECT
++ select FB_CFB_COPYAREA
++ select FB_CFB_IMAGEBLIT
++ help
++ Frame buffer driver for the LCD controller in the Smedia Glamo
++ 336x/337x.
++
++ This driver is also available as a module ( = code which can be
++ inserted and removed from the running kernel whenever you want). The
++ module will be called glamofb. If you want to compile it as a module,
++ say M here and read <file:Documentation/modules.txt>.
++
++ If unsure, say N.
++
+ source "drivers/video/omap/Kconfig"
+ source "drivers/video/omap2/Kconfig"
+
+diff --git a/drivers/video/Makefile b/drivers/video/Makefile
+index 2ea44b6..c92cacf 100644
+--- a/drivers/video/Makefile
++++ b/drivers/video/Makefile
+@@ -140,6 +140,7 @@ obj-$(CONFIG_FB_MSM) += msm/
+ obj-$(CONFIG_FB_NUC900) += nuc900fb.o
+ obj-$(CONFIG_FB_JZ4740) += jz4740_fb.o
+ obj-$(CONFIG_FB_PUV3_UNIGFX) += fb-puv3.o
++obj-$(CONFIG_FB_GLAMO) += glamo-fb.o
+
+ # Platform or fallback drivers go here
+ obj-$(CONFIG_FB_UVESA) += uvesafb.o
+diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
+index 0c9373b..664509e 100644
+--- a/drivers/video/backlight/Kconfig
++++ b/drivers/video/backlight/Kconfig
+@@ -117,6 +117,20 @@ config LCD_LD9040
+ If you have an LD9040 Panel, say Y to enable its
+ control driver.
+
++config LCD_JBT6K74
++ tristate "TPO JBT6K74-AS TFT display ASIC control interface"
++ depends on SPI_MASTER && SYSFS && LCD_CLASS_DEVICE
++ help
++ SPI driver for the control interface of TFT panels containing
++ the TPO JBT6K74-AS controller ASIC, such as the TPO TD028TTEC1
++ TFT diplay module used in the Openmoko Freerunner GSM phone.
++
++ The control interface is required for display operation, as it
++ controls power management, display timing and gamma calibration.
++
++ This driver can also be build as a module, if so it will be called
++ jbt6k74.
++
+ endif # LCD_CLASS_DEVICE
+
+ #
+diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile
+index b9ca849..fe67e97 100644
+--- a/drivers/video/backlight/Makefile
++++ b/drivers/video/backlight/Makefile
+@@ -13,6 +13,7 @@ obj-$(CONFIG_LCD_TDO24M) += tdo24m.o
+ obj-$(CONFIG_LCD_TOSA) += tosa_lcd.o
+ obj-$(CONFIG_LCD_S6E63M0) += s6e63m0.o
+ obj-$(CONFIG_LCD_LD9040) += ld9040.o
++obj-$(CONFIG_LCD_JBT6K74) += jbt6k74.o
+
+ obj-$(CONFIG_BACKLIGHT_CLASS_DEVICE) += backlight.o
+ obj-$(CONFIG_BACKLIGHT_ATMEL_PWM) += atmel-pwm-bl.o
+diff --git a/drivers/video/backlight/jbt6k74.c b/drivers/video/backlight/jbt6k74.c
+new file mode 100644
+index 0000000..d53a366
+--- /dev/null
++++ b/drivers/video/backlight/jbt6k74.c
+@@ -0,0 +1,895 @@
++/* Linux kernel driver for the tpo JBT6K74-AS LCM ASIC
++ *
++ * Copyright (C) 2006-2007 by Openmoko, Inc.
++ * Author: Harald Welte <laforge@openmoko.org>,
++ * Stefan Schmidt <stefan@openmoko.org>
++ * Copyright (C) 2008 by Harald Welte <laforge@openmoko.org>
++ * Copyright (C) 2009 by Lars-Peter Clausen <lars@metafoo.de>
++ * 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 as
++ * published by the Free Software Foundation; either version 2 of
++ * the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ *
++ */
++
++#include <linux/kernel.h>
++#include <linux/types.h>
++#include <linux/module.h>
++#include <linux/device.h>
++#include <linux/platform_device.h>
++#include <linux/delay.h>
++#include <linux/workqueue.h>
++#include <linux/jbt6k74.h>
++#include <linux/fb.h>
++#include <linux/lcd.h>
++#include <linux/time.h>
++#include <linux/regulator/consumer.h>
++#include <linux/gpio.h>
++
++enum jbt6k74_register {
++ JBT_REG_SLEEP_IN = 0x10,
++ JBT_REG_SLEEP_OUT = 0x11,
++
++ JBT_REG_DISPLAY_OFF = 0x28,
++ JBT_REG_DISPLAY_ON = 0x29,
++
++ JBT_REG_RGB_FORMAT = 0x3a,
++ JBT_REG_QUAD_RATE = 0x3b,
++
++ JBT_REG_POWER_ON_OFF = 0xb0,
++ JBT_REG_BOOSTER_OP = 0xb1,
++ JBT_REG_BOOSTER_MODE = 0xb2,
++ JBT_REG_BOOSTER_FREQ = 0xb3,
++ JBT_REG_OPAMP_SYSCLK = 0xb4,
++ JBT_REG_VSC_VOLTAGE = 0xb5,
++ JBT_REG_VCOM_VOLTAGE = 0xb6,
++ JBT_REG_EXT_DISPL = 0xb7,
++ JBT_REG_OUTPUT_CONTROL = 0xb8,
++ JBT_REG_DCCLK_DCEV = 0xb9,
++ JBT_REG_DISPLAY_MODE1 = 0xba,
++ JBT_REG_DISPLAY_MODE2 = 0xbb,
++ JBT_REG_DISPLAY_MODE = 0xbc,
++ JBT_REG_ASW_SLEW = 0xbd,
++ JBT_REG_DUMMY_DISPLAY = 0xbe,
++ JBT_REG_DRIVE_SYSTEM = 0xbf,
++
++ JBT_REG_SLEEP_OUT_FR_A = 0xc0,
++ JBT_REG_SLEEP_OUT_FR_B = 0xc1,
++ JBT_REG_SLEEP_OUT_FR_C = 0xc2,
++ JBT_REG_SLEEP_IN_LCCNT_D = 0xc3,
++ JBT_REG_SLEEP_IN_LCCNT_E = 0xc4,
++ JBT_REG_SLEEP_IN_LCCNT_F = 0xc5,
++ JBT_REG_SLEEP_IN_LCCNT_G = 0xc6,
++
++ JBT_REG_GAMMA1_FINE_1 = 0xc7,
++ JBT_REG_GAMMA1_FINE_2 = 0xc8,
++ JBT_REG_GAMMA1_INCLINATION = 0xc9,
++ JBT_REG_GAMMA1_BLUE_OFFSET = 0xca,
++
++ /* VGA */
++ JBT_REG_BLANK_CONTROL = 0xcf,
++ JBT_REG_BLANK_TH_TV = 0xd0,
++ JBT_REG_CKV_ON_OFF = 0xd1,
++ JBT_REG_CKV_1_2 = 0xd2,
++ JBT_REG_OEV_TIMING = 0xd3,
++ JBT_REG_ASW_TIMING_1 = 0xd4,
++ JBT_REG_ASW_TIMING_2 = 0xd5,
++
++ /* QVGA */
++ JBT_REG_BLANK_CONTROL_QVGA = 0xd6,
++ JBT_REG_BLANK_TH_TV_QVGA = 0xd7,
++ JBT_REG_CKV_ON_OFF_QVGA = 0xd8,
++ JBT_REG_CKV_1_2_QVGA = 0xd9,
++ JBT_REG_OEV_TIMING_QVGA = 0xde,
++ JBT_REG_ASW_TIMING_1_QVGA = 0xdf,
++ JBT_REG_ASW_TIMING_2_QVGA = 0xe0,
++
++
++ JBT_REG_HCLOCK_VGA = 0xec,
++ JBT_REG_HCLOCK_QVGA = 0xed,
++};
++
++enum jbt6k74_resolution {
++ JBT_RESOLUTION_VGA,
++ JBT_RESOLUTION_QVGA,
++};
++
++enum jbt6k74_power_mode {
++ JBT_POWER_MODE_DEEP_STANDBY,
++ JBT_POWER_MODE_SLEEP,
++ JBT_POWER_MODE_NORMAL,
++};
++
++static const char * const jbt6k74_power_mode_names[] = {
++ [JBT_POWER_MODE_DEEP_STANDBY] = "deep-standby",
++ [JBT_POWER_MODE_SLEEP] = "sleep",
++ [JBT_POWER_MODE_NORMAL] = "normal",
++};
++
++static const char * const jbt6k74_resolution_names[] = {
++ [JBT_RESOLUTION_VGA] = "vga",
++ [JBT_RESOLUTION_QVGA] = "qvga",
++};
++
++struct jbt6k74_info {
++ struct mutex lock; /* protects this structure */
++ enum jbt6k74_resolution resolution;
++ enum jbt6k74_power_mode power_mode;
++ enum jbt6k74_power_mode suspend_mode;
++ int suspended;
++
++ struct spi_device *spi;
++ struct lcd_device *lcd_dev;
++
++ unsigned long next_sleep;
++ struct delayed_work blank_work;
++ int blank_mode;
++ struct regulator_bulk_data supplies[2];
++ uint16_t tx_buf[3];
++ uint16_t reg_cache[0xEE];
++};
++
++#define JBT_COMMAND 0x000
++#define JBT_DATA 0x100
++
++static int jbt6k74_reg_write_nodata(struct jbt6k74_info *jbt, uint8_t reg)
++{
++ int ret;
++
++ jbt->tx_buf[0] = JBT_COMMAND | reg;
++ ret = spi_write(jbt->spi, (uint8_t *)jbt->tx_buf,
++ sizeof(uint16_t));
++ if (ret == 0)
++ jbt->reg_cache[reg] = 0;
++ else
++ dev_err(&jbt->spi->dev, "Write failed: %d\n", ret);
++
++ return ret;
++}
++
++
++static int jbt6k74_reg_write(struct jbt6k74_info *jbt, uint8_t reg, uint8_t data)
++{
++ int ret;
++
++ jbt->tx_buf[0] = JBT_COMMAND | reg;
++ jbt->tx_buf[1] = JBT_DATA | data;
++ ret = spi_write(jbt->spi, (uint8_t *)jbt->tx_buf,
++ 2*sizeof(uint16_t));
++ if (ret == 0)
++ jbt->reg_cache[reg] = data;
++ else
++ dev_err(&jbt->spi->dev, "Write failed: %d\n", ret);
++
++ return ret;
++}
++
++static int jbt6k74_reg_write16(struct jbt6k74_info *jbt, uint8_t reg, uint16_t data)
++{
++ int ret;
++
++ jbt->tx_buf[0] = JBT_COMMAND | reg;
++ jbt->tx_buf[1] = JBT_DATA | (data >> 8);
++ jbt->tx_buf[2] = JBT_DATA | (data & 0xff);
++
++ ret = spi_write(jbt->spi, (uint8_t *)jbt->tx_buf,
++ 3*sizeof(uint16_t));
++ if (ret == 0)
++ jbt->reg_cache[reg] = data;
++ else
++ dev_err(&jbt->spi->dev, "Write failed: %d\n", ret);
++
++ return ret;
++}
++
++static int jbt6k74_init_regs(struct jbt6k74_info *jbt)
++{
++ int ret;
++
++ dev_dbg(&jbt->spi->dev, "entering %cVGA mode\n",
++ jbt->resolution == JBT_RESOLUTION_QVGA ? 'Q' : ' ');
++
++ ret = jbt6k74_reg_write(jbt, JBT_REG_DISPLAY_MODE1, 0x01);
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_DISPLAY_MODE2, 0x00);
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_RGB_FORMAT, 0x60);
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_DRIVE_SYSTEM, 0x10);
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_BOOSTER_OP, 0x56);
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_BOOSTER_MODE, 0x33);
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_BOOSTER_FREQ, 0x11);
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_OPAMP_SYSCLK, 0x02);
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_VSC_VOLTAGE, 0x2b);
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_VCOM_VOLTAGE, 0x40);
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_EXT_DISPL, 0x03);
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_DCCLK_DCEV, 0x04);
++ /*
++ * default of 0x02 in JBT_REG_ASW_SLEW responsible for 72Hz requirement
++ * to avoid red / blue flicker
++ */
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_ASW_SLEW, 0x00 | (1 << 5));
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_DUMMY_DISPLAY, 0x00);
++
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_SLEEP_OUT_FR_A, 0x11);
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_SLEEP_OUT_FR_B, 0x11);
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_SLEEP_OUT_FR_C, 0x11);
++ ret |= jbt6k74_reg_write16(jbt, JBT_REG_SLEEP_IN_LCCNT_D, 0x2040);
++ ret |= jbt6k74_reg_write16(jbt, JBT_REG_SLEEP_IN_LCCNT_E, 0x60c0);
++ ret |= jbt6k74_reg_write16(jbt, JBT_REG_SLEEP_IN_LCCNT_F, 0x1020);
++ ret |= jbt6k74_reg_write16(jbt, JBT_REG_SLEEP_IN_LCCNT_G, 0x60c0);
++
++ ret |= jbt6k74_reg_write16(jbt, JBT_REG_GAMMA1_FINE_1, 0x5533);
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_GAMMA1_FINE_2, 0x00);
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_GAMMA1_INCLINATION, 0x00);
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_GAMMA1_BLUE_OFFSET, 0x00);
++
++ if (jbt->resolution != JBT_RESOLUTION_QVGA) {
++ ret |= jbt6k74_reg_write16(jbt, JBT_REG_HCLOCK_VGA, 0x1f0);
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_BLANK_CONTROL, 0x02);
++ ret |= jbt6k74_reg_write16(jbt, JBT_REG_BLANK_TH_TV, 0x0804);
++
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_CKV_ON_OFF, 0x01);
++ ret |= jbt6k74_reg_write16(jbt, JBT_REG_CKV_1_2, 0x0000);
++
++ ret |= jbt6k74_reg_write16(jbt, JBT_REG_OEV_TIMING, 0x0d0e);
++ ret |= jbt6k74_reg_write16(jbt, JBT_REG_ASW_TIMING_1, 0x11a4);
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_ASW_TIMING_2, 0x0e);
++ } else {
++ ret |= jbt6k74_reg_write16(jbt, JBT_REG_HCLOCK_QVGA, 0x00ff);
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_BLANK_CONTROL_QVGA, 0x02);
++ ret |= jbt6k74_reg_write16(jbt, JBT_REG_BLANK_TH_TV_QVGA, 0x0804);
++
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_CKV_ON_OFF_QVGA, 0x01);
++ ret |= jbt6k74_reg_write16(jbt, JBT_REG_CKV_1_2_QVGA, 0x0008);
++
++ ret |= jbt6k74_reg_write16(jbt, JBT_REG_OEV_TIMING_QVGA, 0x050a);
++ ret |= jbt6k74_reg_write16(jbt, JBT_REG_ASW_TIMING_1_QVGA, 0x0a19);
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_ASW_TIMING_2_QVGA, 0x0a);
++ }
++
++ return ret ? -EIO : 0;
++}
++
++static int jbt6k74_standby_to_sleep(struct jbt6k74_info *jbt)
++{
++ int ret;
++ struct jbt6k74_platform_data *pdata = jbt->spi->dev.platform_data;
++
++ ret = regulator_bulk_enable(ARRAY_SIZE(jbt->supplies), jbt->supplies);
++ if (ret)
++ return ret;
++
++ gpio_set_value_cansleep(pdata->gpio_reset, 1);
++ mdelay(100);
++
++ /* three times command zero */
++ ret |= jbt6k74_reg_write_nodata(jbt, 0x00);
++ mdelay(1);
++ ret |= jbt6k74_reg_write_nodata(jbt, 0x00);
++ mdelay(1);
++ ret |= jbt6k74_reg_write_nodata(jbt, 0x00);
++ mdelay(1);
++
++ /* deep standby out */
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_POWER_ON_OFF, 0x11);
++ mdelay(1);
++ ret = jbt6k74_reg_write(jbt, JBT_REG_DISPLAY_MODE, 0x28);
++
++ /* (re)initialize register set */
++ ret |= jbt6k74_init_regs(jbt);
++
++ return ret ? -EIO : 0;
++}
++
++static int jbt6k74_sleep_to_normal(struct jbt6k74_info *jbt)
++{
++ int ret;
++
++ /* Make sure we are 120 ms after SLEEP_OUT */
++ if (time_before(jiffies, jbt->next_sleep))
++ mdelay(jiffies_to_msecs(jbt->next_sleep - jiffies));
++
++ if (jbt->resolution == JBT_RESOLUTION_VGA) {
++ /* RGB I/F on, RAM wirte off, QVGA through, SIGCON enable */
++ ret = jbt6k74_reg_write(jbt, JBT_REG_DISPLAY_MODE, 0x80);
++
++ /* Quad mode off */
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_QUAD_RATE, 0x00);
++ } else {
++ /* RGB I/F on, RAM wirte off, QVGA through, SIGCON enable */
++ ret = jbt6k74_reg_write(jbt, JBT_REG_DISPLAY_MODE, 0x81);
++
++ /* Quad mode on */
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_QUAD_RATE, 0x22);
++ }
++
++ /* AVDD on, XVDD on */
++ ret |= jbt6k74_reg_write(jbt, JBT_REG_POWER_ON_OFF, 0x16);
++
++ /* Output control */
++ ret |= jbt6k74_reg_write16(jbt, JBT_REG_OUTPUT_CONTROL, 0xdff9);
++
++ /* Turn on display */
++ ret |= jbt6k74_reg_write_nodata(jbt, JBT_REG_DISPLAY_ON);
++
++ /* Sleep mode off */
++ ret |= jbt6k74_reg_write_nodata(jbt, JBT_REG_SLEEP_OUT);
++ jbt->next_sleep = jiffies + msecs_to_jiffies(120);
++
++ /* Allow the booster and display controller to restart stably */
++ mdelay(5);
++
++ return ret ? -EIO : 0;
++}
++
++static int jbt6k74_normal_to_sleep(struct jbt6k74_info *jbt)
++{
++ int ret;
++
++ /* Make sure we are 120 ms after SLEEP_OUT */
++ if (time_before(jiffies, jbt->next_sleep))
++ mdelay(jiffies_to_msecs(jbt->next_sleep - jiffies));
++
++ ret = jbt6k74_reg_write_nodata(jbt, JBT_REG_DISPLAY_OFF);
++ ret |= jbt6k74_reg_write16(jbt, JBT_REG_OUTPUT_CONTROL, 0x8000 | 1 << 3);
++ ret |= jbt6k74_reg_write_nodata(jbt, JBT_REG_SLEEP_IN);
++ jbt->next_sleep = jiffies + msecs_to_jiffies(120);
++
++ /* Allow the internal circuits to stop automatically */
++ mdelay(5);
++
++ return ret ? -EIO : 0;
++}
++
++static int jbt6k74_sleep_to_standby(struct jbt6k74_info *jbt)
++{
++ int ret;
++ struct jbt6k74_platform_data *pdata = jbt->spi->dev.platform_data;
++
++ ret = jbt6k74_reg_write(jbt, JBT_REG_POWER_ON_OFF, 0x00);
++
++ if (!ret) {
++ gpio_set_value_cansleep(pdata->gpio_reset, 0);
++ ret = regulator_bulk_disable(ARRAY_SIZE(jbt->supplies),
++ jbt->supplies);
++ }
++
++ return ret;
++}
++
++static int jbt6k74_enter_power_mode(struct jbt6k74_info *jbt,
++ enum jbt6k74_power_mode new_mode)
++{
++ struct jbt6k74_platform_data *pdata = jbt->spi->dev.platform_data;
++ int ret = -EINVAL;
++
++ dev_dbg(&jbt->spi->dev, "entering (old_state=%s, new_state=%s)\n",
++ jbt6k74_power_mode_names[jbt->power_mode],
++ jbt6k74_power_mode_names[new_mode]);
++
++ mutex_lock(&jbt->lock);
++
++ if (jbt->suspended) {
++ switch (new_mode) {
++ case JBT_POWER_MODE_DEEP_STANDBY:
++ case JBT_POWER_MODE_SLEEP:
++ case JBT_POWER_MODE_NORMAL:
++ ret = 0;
++ jbt->suspend_mode = new_mode;
++ break;
++ default:
++ break;
++ }
++ } else if (new_mode == JBT_POWER_MODE_NORMAL &&
++ pdata->enable_pixel_clock) {
++ pdata->enable_pixel_clock(&jbt->spi->dev, 1);
++ }
++
++ switch (jbt->power_mode) {
++ case JBT_POWER_MODE_DEEP_STANDBY:
++ switch (new_mode) {
++ case JBT_POWER_MODE_DEEP_STANDBY:
++ ret = 0;
++ break;
++ case JBT_POWER_MODE_SLEEP:
++ ret = jbt6k74_standby_to_sleep(jbt);
++ break;
++ case JBT_POWER_MODE_NORMAL:
++ /* first transition into sleep */
++ ret = jbt6k74_standby_to_sleep(jbt);
++ /* then transition into normal */
++ ret |= jbt6k74_sleep_to_normal(jbt);
++ break;
++ }
++ break;
++ case JBT_POWER_MODE_SLEEP:
++ switch (new_mode) {
++ case JBT_POWER_MODE_SLEEP:
++ ret = 0;
++ break;
++ case JBT_POWER_MODE_DEEP_STANDBY:
++ ret = jbt6k74_sleep_to_standby(jbt);
++ break;
++ case JBT_POWER_MODE_NORMAL:
++ ret = jbt6k74_sleep_to_normal(jbt);
++ break;
++ }
++ break;
++ case JBT_POWER_MODE_NORMAL:
++ switch (new_mode) {
++ case JBT_POWER_MODE_NORMAL:
++ ret = 0;
++ break;
++ case JBT_POWER_MODE_DEEP_STANDBY:
++ /* first transition into sleep */
++ ret = jbt6k74_normal_to_sleep(jbt);
++ /* then transition into deep standby */
++ ret |= jbt6k74_sleep_to_standby(jbt);
++ break;
++ case JBT_POWER_MODE_SLEEP:
++ ret = jbt6k74_normal_to_sleep(jbt);
++ break;
++ }
++ }
++
++ if (ret == 0) {
++ jbt->power_mode = new_mode;
++ if (new_mode != JBT_POWER_MODE_NORMAL &&
++ pdata->enable_pixel_clock)
++ pdata->enable_pixel_clock(&jbt->spi->dev, 0);
++ } else {
++ dev_err(&jbt->spi->dev, "Failed enter state '%s': %d\n",
++ jbt6k74_power_mode_names[new_mode], ret);
++ }
++
++ mutex_unlock(&jbt->lock);
++
++ return ret;
++}
++
++static int jbt6k74_set_resolution(struct jbt6k74_info *jbt,
++ enum jbt6k74_resolution new_resolution)
++{
++ int ret = 0;
++ enum jbt6k74_resolution old_resolution;
++
++ mutex_lock(&jbt->lock);
++
++ if (jbt->resolution == new_resolution)
++ goto out_unlock;
++
++ old_resolution = jbt->resolution;
++ jbt->resolution = new_resolution;
++
++ if (jbt->power_mode == JBT_POWER_MODE_NORMAL) {
++
++ /* first transition into sleep */
++ ret = jbt6k74_normal_to_sleep(jbt);
++ ret |= jbt6k74_sleep_to_normal(jbt);
++
++ if (ret) {
++ jbt->resolution = old_resolution;
++ dev_err(&jbt->spi->dev, "Failed to set resolution '%s')\n",
++ jbt6k74_resolution_names[new_resolution]);
++ }
++ }
++
++out_unlock:
++ mutex_unlock(&jbt->lock);
++
++ return ret;
++}
++
++static ssize_t resolution_read(struct device *dev,
++ struct device_attribute *attr, char *buf)
++{
++ struct jbt6k74_info *jbt = dev_get_drvdata(dev);
++
++ if (jbt->resolution >= ARRAY_SIZE(jbt6k74_resolution_names))
++ return -EIO;
++
++ return sprintf(buf, "%s\n", jbt6k74_resolution_names[jbt->resolution]);
++}
++
++static ssize_t resolution_write(struct device *dev,
++ struct device_attribute *attr,
++ const char *buf, size_t count)
++{
++ struct jbt6k74_info *jbt = dev_get_drvdata(dev);
++ int i, ret;
++
++ for (i = 0; i < ARRAY_SIZE(jbt6k74_resolution_names); i++) {
++ if (!strncmp(buf, jbt6k74_resolution_names[i],
++ strlen(jbt6k74_resolution_names[i]))) {
++ ret = jbt6k74_set_resolution(jbt, i);
++ if (ret)
++ return ret;
++ return count;
++ }
++ }
++
++ return -EINVAL;
++}
++
++static DEVICE_ATTR(resolution, 0644, resolution_read, resolution_write);
++
++static int reg_by_string(const char *name)
++{
++ if (!strcmp(name, "gamma_fine1"))
++ return JBT_REG_GAMMA1_FINE_1;
++ else if (!strcmp(name, "gamma_fine2"))
++ return JBT_REG_GAMMA1_FINE_2;
++ else if (!strcmp(name, "gamma_inclination"))
++ return JBT_REG_GAMMA1_INCLINATION;
++ else
++ return JBT_REG_GAMMA1_BLUE_OFFSET;
++}
++
++static ssize_t gamma_read(struct device *dev, struct device_attribute *attr,
++ char *buf)
++{
++ struct jbt6k74_info *jbt = dev_get_drvdata(dev);
++ int reg = reg_by_string(attr->attr.name);
++ uint16_t val;
++
++ mutex_lock(&jbt->lock);
++ val = jbt->reg_cache[reg];
++ mutex_unlock(&jbt->lock);
++
++ return sprintf(buf, "0x%04x\n", val);
++}
++
++static ssize_t gamma_write(struct device *dev, struct device_attribute *attr,
++ const char *buf, size_t count)
++{
++ int ret;
++ struct jbt6k74_info *jbt = dev_get_drvdata(dev);
++ int reg = reg_by_string(attr->attr.name);
++ unsigned long val;
++
++ ret = strict_strtoul(buf, 10, &val);
++ if (ret)
++ return ret;
++
++ mutex_lock(&jbt->lock);
++ jbt6k74_reg_write(jbt, reg, val & 0xff);
++ mutex_unlock(&jbt->lock);
++
++ return count;
++}
++
++static ssize_t reset_write(struct device *dev, struct device_attribute *attr,
++ const char *buf, size_t count)
++{
++ int ret;
++ struct jbt6k74_info *jbt = dev_get_drvdata(dev);
++ struct jbt6k74_platform_data *pdata = jbt->spi->dev.platform_data;
++ enum jbt6k74_power_mode old_power_mode = jbt->power_mode;
++
++ mutex_lock(&jbt->lock);
++
++ if (gpio_is_valid(pdata->gpio_reset)) {
++ /* hard reset the jbt6k74 */
++ gpio_set_value_cansleep(pdata->gpio_reset, 0);
++ mdelay(120);
++ gpio_set_value_cansleep(pdata->gpio_reset, 1);
++ mdelay(120);
++ }
++
++ ret = jbt6k74_reg_write_nodata(jbt, 0x01);
++ if (ret < 0)
++ dev_err(&jbt->spi->dev, "cannot soft reset\n");
++ mdelay(120);
++
++ mutex_unlock(&jbt->lock);
++
++ jbt->power_mode = JBT_POWER_MODE_DEEP_STANDBY;
++ jbt6k74_enter_power_mode(jbt, old_power_mode);
++
++ return count;
++}
++
++static DEVICE_ATTR(gamma_fine1, 0644, gamma_read, gamma_write);
++static DEVICE_ATTR(gamma_fine2, 0644, gamma_read, gamma_write);
++static DEVICE_ATTR(gamma_inclination, 0644, gamma_read, gamma_write);
++static DEVICE_ATTR(gamma_blue_offset, 0644, gamma_read, gamma_write);
++static DEVICE_ATTR(reset, 0600, NULL, reset_write);
++
++static struct attribute *jbt6k74_sysfs_entries[] = {
++ &dev_attr_resolution.attr,
++ &dev_attr_gamma_fine1.attr,
++ &dev_attr_gamma_fine2.attr,
++ &dev_attr_gamma_inclination.attr,
++ &dev_attr_gamma_blue_offset.attr,
++ &dev_attr_reset.attr,
++ NULL,
++};
++
++static struct attribute_group jbt6k74_attr_group = {
++ .name = NULL,
++ .attrs = jbt6k74_sysfs_entries,
++};
++
++/* FIXME: This in an ugly hack to delay display blanking.
++ When the jbt is in sleep mode it displays an all white screen and thus one
++ will a see a short flash.
++ By delaying the blanking we will give the backlight a chance to turn off and
++ thus avoid getting the flash */
++static void jbt6k74_blank_worker(struct work_struct *work)
++{
++ struct jbt6k74_info *jbt = container_of(work, struct jbt6k74_info,
++ blank_work.work);
++
++ switch (jbt->blank_mode) {
++ case FB_BLANK_NORMAL:
++ jbt6k74_enter_power_mode(jbt, JBT_POWER_MODE_SLEEP);
++ break;
++ case FB_BLANK_POWERDOWN:
++ jbt6k74_enter_power_mode(jbt, JBT_POWER_MODE_DEEP_STANDBY);
++ break;
++ default:
++ break;
++ }
++}
++
++static int jbt6k74_set_mode(struct lcd_device *ld, struct fb_videomode *m)
++{
++ int ret = -EINVAL;
++ struct jbt6k74_info *jbt = dev_get_drvdata(&ld->dev);
++
++ if (m->xres == 240 && m->yres == 320) {
++ ret = jbt6k74_set_resolution(jbt, JBT_RESOLUTION_QVGA);
++ } else if (m->xres == 480 && m->yres == 640) {
++ ret = jbt6k74_set_resolution(jbt, JBT_RESOLUTION_VGA);
++ } else {
++ dev_err(&jbt->spi->dev, "Unknown resolution.\n");
++ jbt6k74_enter_power_mode(jbt, JBT_POWER_MODE_SLEEP);
++ }
++
++ return ret;
++}
++
++static int jbt6k74_set_power(struct lcd_device *ld, int power)
++{
++ int ret = -EINVAL;
++ struct jbt6k74_info *jbt = dev_get_drvdata(&ld->dev);
++
++ jbt->blank_mode = power;
++ cancel_rearming_delayed_work(&jbt->blank_work);
++
++ switch (power) {
++ case FB_BLANK_UNBLANK:
++ dev_dbg(&jbt->spi->dev, "unblank\n");
++ mdelay(20);
++ ret = jbt6k74_enter_power_mode(jbt, JBT_POWER_MODE_NORMAL);
++ break;
++ case FB_BLANK_NORMAL:
++ dev_dbg(&jbt->spi->dev, "blank\n");
++ ret = schedule_delayed_work(&jbt->blank_work, HZ);
++ break;
++ case FB_BLANK_POWERDOWN:
++ dev_dbg(&jbt->spi->dev, "powerdown\n");
++ ret = schedule_delayed_work(&jbt->blank_work, HZ);
++ break;
++ default:
++ break;
++ }
++
++ return ret;
++}
++
++static int jbt6k74_get_power(struct lcd_device *ld)
++{
++ struct jbt6k74_info *jbt = dev_get_drvdata(&ld->dev);
++
++ switch (jbt->power_mode) {
++ case JBT_POWER_MODE_NORMAL:
++ return FB_BLANK_UNBLANK;
++ case JBT_POWER_MODE_SLEEP:
++ return FB_BLANK_NORMAL;
++ default:
++ return JBT_POWER_MODE_DEEP_STANDBY;
++ }
++}
++
++static struct lcd_ops jbt6k74_lcd_ops = {
++ .set_power = jbt6k74_set_power,
++ .get_power = jbt6k74_get_power,
++ .set_mode = jbt6k74_set_mode,
++};
++
++/* linux device model infrastructure */
++
++static int __devinit jbt6k74_probe(struct spi_device *spi)
++{
++ int ret;
++ struct jbt6k74_info *jbt;
++ struct jbt6k74_platform_data *pdata = spi->dev.platform_data;
++
++ /* the controller doesn't have a MISO pin; we can't do detection */
++
++ spi->mode = SPI_CPOL | SPI_CPHA;
++ spi->bits_per_word = 9;
++
++ ret = spi_setup(spi);
++ if (ret < 0) {
++ dev_err(&spi->dev,
++ "Failed to setup spi\n");
++ return ret;
++ }
++
++ jbt = kzalloc(sizeof(*jbt), GFP_KERNEL);
++ if (!jbt)
++ return -ENOMEM;
++
++ jbt->spi = spi;
++
++ jbt->lcd_dev = lcd_device_register("jbt6k74-lcd", &spi->dev, jbt,
++ &jbt6k74_lcd_ops);
++
++ if (IS_ERR(jbt->lcd_dev)) {
++ ret = PTR_ERR(jbt->lcd_dev);
++ goto err_free_drvdata;
++ }
++
++ INIT_DELAYED_WORK(&jbt->blank_work, jbt6k74_blank_worker);
++
++ jbt->resolution = JBT_RESOLUTION_VGA;
++ jbt->power_mode = JBT_POWER_MODE_DEEP_STANDBY;
++ jbt->next_sleep = jiffies + msecs_to_jiffies(120);
++ mutex_init(&jbt->lock);
++
++ dev_set_drvdata(&spi->dev, jbt);
++
++ jbt->supplies[0].supply = "VDC";
++ jbt->supplies[1].supply = "VDDIO";
++
++ ret = regulator_bulk_get(&spi->dev, ARRAY_SIZE(jbt->supplies),
++ jbt->supplies);
++ if (ret) {
++ dev_err(&spi->dev, "Failed to power get supplies: %d\n", ret);
++ goto err_unregister_lcd;
++ }
++
++ if (gpio_is_valid(pdata->gpio_reset)) {
++ ret = gpio_request(pdata->gpio_reset, "jbt6k74 reset");
++ if (ret) {
++ dev_err(&spi->dev, "Failed to request reset gpio: %d\n",
++ ret);
++ goto err_free_supplies;
++ }
++
++ ret = gpio_direction_output(pdata->gpio_reset, 1);
++ if (ret) {
++ dev_err(&spi->dev, "Failed to set reset gpio direction: %d\n",
++ ret);
++ goto err_gpio_free;
++ }
++ }
++
++ ret = sysfs_create_group(&spi->dev.kobj, &jbt6k74_attr_group);
++ if (ret < 0) {
++ dev_err(&spi->dev, "cannot create sysfs group\n");
++ goto err_gpio_free;
++ }
++
++ mdelay(50);
++ ret = jbt6k74_enter_power_mode(jbt, JBT_POWER_MODE_NORMAL);
++ if (ret < 0) {
++ dev_err(&spi->dev, "cannot enter NORMAL state\n");
++ goto err_sysfs_remove;
++ }
++
++ return 0;
++
++err_sysfs_remove:
++ sysfs_remove_group(&spi->dev.kobj, &jbt6k74_attr_group);
++err_gpio_free:
++ gpio_free(pdata->gpio_reset);
++err_free_supplies:
++ regulator_bulk_free(ARRAY_SIZE(jbt->supplies), jbt->supplies);
++err_unregister_lcd:
++ lcd_device_unregister(jbt->lcd_dev);
++err_free_drvdata:
++ dev_set_drvdata(&spi->dev, NULL);
++ kfree(jbt);
++
++ return ret;
++}
++
++static int __devexit jbt6k74_remove(struct spi_device *spi)
++{
++ struct jbt6k74_info *jbt = dev_get_drvdata(&spi->dev);
++ struct jbt6k74_platform_data *pdata = jbt->spi->dev.platform_data;
++
++ /* We don't want to switch off the display in case the user
++ * accidentially unloads the module (whose use count normally is 0) */
++ jbt6k74_enter_power_mode(jbt, JBT_POWER_MODE_NORMAL);
++
++ sysfs_remove_group(&spi->dev.kobj, &jbt6k74_attr_group);
++
++ if (gpio_is_valid(pdata->gpio_reset))
++ gpio_free(pdata->gpio_reset);
++
++ lcd_device_unregister(jbt->lcd_dev);
++
++ dev_set_drvdata(&spi->dev, NULL);
++
++ regulator_bulk_free(ARRAY_SIZE(jbt->supplies), jbt->supplies);
++ kfree(jbt);
++
++ return 0;
++}
++
++#ifdef CONFIG_PM
++static int jbt6k74_suspend(struct spi_device *spi, pm_message_t state)
++{
++ struct jbt6k74_info *jbt = dev_get_drvdata(&spi->dev);
++
++ jbt->suspend_mode = jbt->power_mode;
++
++ jbt6k74_enter_power_mode(jbt, JBT_POWER_MODE_DEEP_STANDBY);
++ jbt->suspended = 1;
++
++ dev_info(&spi->dev, "suspended\n");
++
++ return 0;
++}
++
++static int jbt6k74_resume(struct spi_device *spi)
++{
++ struct jbt6k74_info *jbt = dev_get_drvdata(&spi->dev);
++ dev_info(&spi->dev, "starting resume: %d\n", jbt->suspend_mode);
++
++ mdelay(20);
++
++ jbt->suspended = 0;
++ jbt6k74_enter_power_mode(jbt, jbt->suspend_mode);
++
++ dev_info(&spi->dev, "resumed: %d\n", jbt->suspend_mode);
++
++ return 0;
++}
++
++#else
++#define jbt6k74_suspend NULL
++#define jbt6k74_resume NULL
++#endif
++
++static struct spi_driver jbt6k74_driver = {
++ .driver = {
++ .name = "jbt6k74",
++ .owner = THIS_MODULE,
++ },
++
++ .probe = jbt6k74_probe,
++ .remove = __devexit_p(jbt6k74_remove),
++ .suspend = jbt6k74_suspend,
++ .resume = jbt6k74_resume,
++};
++
++static int __init jbt6k74_init(void)
++{
++ return spi_register_driver(&jbt6k74_driver);
++}
++module_init(jbt6k74_init);
++
++static void __exit jbt6k74_exit(void)
++{
++ spi_unregister_driver(&jbt6k74_driver);
++}
++module_exit(jbt6k74_exit);
++
++MODULE_DESCRIPTION("SPI driver for tpo JBT6K74-AS LCM control interface");
++MODULE_AUTHOR("Harald Welte <laforge@openmoko.org>");
++MODULE_LICENSE("GPL");
+diff --git a/drivers/video/backlight/pcf50633-backlight.c b/drivers/video/backlight/pcf50633-backlight.c
+index ef5628d..7d80574 100644
+--- a/drivers/video/backlight/pcf50633-backlight.c
++++ b/drivers/video/backlight/pcf50633-backlight.c
+@@ -44,7 +44,7 @@ struct pcf50633_bl {
+ */
+ int pcf50633_bl_set_brightness_limit(struct pcf50633 *pcf, unsigned int limit)
+ {
+- struct pcf50633_bl *pcf_bl = platform_get_drvdata(pcf->bl_pdev);
++ struct pcf50633_bl *pcf_bl = pcf->bl;
+
+ if (!pcf_bl)
+ return -ENODEV;
+@@ -102,6 +102,7 @@ static const struct backlight_ops pcf50633_bl_ops = {
+ static int __devinit pcf50633_bl_probe(struct platform_device *pdev)
+ {
+ int ret;
++ struct pcf50633 *pcf = dev_to_pcf50633(pdev->dev.parent);
+ struct pcf50633_bl *pcf_bl;
+ struct device *parent = pdev->dev.parent;
+ struct pcf50633_platform_data *pcf50633_data = parent->platform_data;
+@@ -124,7 +125,7 @@ static int __devinit pcf50633_bl_probe(struct platform_device *pdev)
+ pcf_bl->brightness_limit = 0x3f;
+ }
+
+- pcf_bl->pcf = dev_to_pcf50633(pdev->dev.parent);
++ pcf_bl->pcf = pcf;
+
+ pcf_bl->bl = backlight_device_register(pdev->name, &pdev->dev, pcf_bl,
+ &pcf50633_bl_ops, &bl_props);
+@@ -134,6 +135,7 @@ static int __devinit pcf50633_bl_probe(struct platform_device *pdev)
+ goto err_free;
+ }
+
++ pcf->bl = pcf_bl;
+ platform_set_drvdata(pdev, pcf_bl);
+
+ pcf50633_reg_write(pcf_bl->pcf, PCF50633_REG_LEDDIM, pdata->ramp_time);
+@@ -156,6 +158,8 @@ static int __devexit pcf50633_bl_remove(struct platform_device *pdev)
+ {
+ struct pcf50633_bl *pcf_bl = platform_get_drvdata(pdev);
+
++ pcf_bl->pcf->bl = NULL;
++
+ backlight_device_unregister(pcf_bl->bl);
+
+ platform_set_drvdata(pdev, NULL);
+diff --git a/drivers/video/glamo-fb.c b/drivers/video/glamo-fb.c
+new file mode 100644
+index 0000000..45f5a2b
+--- /dev/null
++++ b/drivers/video/glamo-fb.c
+@@ -0,0 +1,943 @@
++/* Smedia Glamo 336x/337x driver
++ *
++ * (C) 2007-2008 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 as
++ * published by the Free Software Foundation; either version 2 of
++ * the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ */
++
++#include <linux/module.h>
++#include <linux/kernel.h>
++#include <linux/string.h>
++#include <linux/mm.h>
++#include <linux/delay.h>
++#include <linux/fb.h>
++#include <linux/console.h>
++#include <linux/init.h>
++#include <linux/platform_device.h>
++#include <linux/spinlock.h>
++#include <linux/io.h>
++#include <linux/mfd/glamo.h>
++#include <linux/mfd/glamo-core.h>
++#include <linux/mfd/glamo-regs.h>
++
++#include <asm/div64.h>
++
++#ifdef CONFIG_PM
++#include <linux/pm.h>
++#endif
++
++#include <linux/glamofb.h>
++
++struct glamofb_handle {
++ struct glamo_core *core;
++ struct fb_info *fb;
++ struct device *dev;
++
++ struct resource *reg;
++ struct resource *fb_res;
++ void __iomem *base;
++ void __iomem *cursor_addr;
++
++ struct glamo_fb_platform_data *mach_info;
++
++ int cursor_on;
++ int blank_mode;
++ int mode_set; /* 0 if the current display mode hasn't been set on the glamo */
++ int output_enabled; /* 0 if the video output is disabled */
++
++ spinlock_t lock_cmd;
++ uint32_t pseudo_pal[16];
++};
++
++static void glamofb_program_mode(struct glamofb_handle *glamo);
++
++static void glamo_output_enable(struct glamofb_handle *gfb)
++{
++ struct glamo_core *gcore = gfb->core;
++
++ if (gfb->output_enabled)
++ return;
++
++ /* enable the pixel clock if off */
++ glamo_engine_enable(gcore, GLAMO_ENGINE_LCD);
++
++ gfb->output_enabled = 1;
++ if (!gfb->mode_set)
++ glamofb_program_mode(gfb);
++}
++
++static void glamo_output_disable(struct glamofb_handle *gfb)
++{
++ struct glamo_core *gcore = gfb->core;
++
++ if (!gfb->output_enabled)
++ return;
++
++ /* enable the pixel clock if off */
++ glamo_engine_suspend(gcore, GLAMO_ENGINE_LCD);
++
++ gfb->output_enabled = 0;
++}
++
++
++static inline int glamofb_reg_read(struct glamofb_handle *glamo, uint16_t reg)
++{
++ return readw(glamo->base + reg);
++}
++
++static inline void glamofb_reg_write(struct glamofb_handle *glamo, uint16_t reg,
++ uint16_t val)
++{
++ writew(val, glamo->base + reg);
++}
++
++static const struct glamo_script glamo_regs[] = {
++ { GLAMO_REG_LCD_MODE1, 0x0020 },
++ /* no display rotation, no hardware cursor, no dither, no gamma,
++ * no retrace flip, vsync low-active, hsync low active,
++ * no TVCLK, no partial display, hw dest color from fb,
++ * no partial display mode, LCD1, software flip, */
++ { GLAMO_REG_LCD_MODE2, 0x9020 },
++ /* video flip, no ptr, no ptr, dhclk off,
++ * normal mode, no cpuif,
++ * res, serial msb first, single fb, no fr ctrl,
++ * cpu if bits all zero, no crc
++ * 0000 0000 0010 0000 */
++ { GLAMO_REG_LCD_MODE3, 0x0b40 },
++ /* src data rgb565, res, 18bit rgb666
++ * 000 01 011 0100 0000 */
++ { GLAMO_REG_LCD_POLARITY, 0x440c },
++ /* DE high active, no cpu/lcd if, cs0 force low, a0 low active,
++ * np cpu if, 9bit serial data, sclk rising edge latch data
++ * 01 00 0 100 0 000 01 0 0 */
++ /* The following values assume 640*480@16bpp */
++ { GLAMO_REG_LCD_A_BASE1, 0x0000 }, /* display A base address 15:0 */
++ { GLAMO_REG_LCD_A_BASE2, 0x4000 }, /* display A base address 22:16 */
++ { GLAMO_REG_LCD_CURSOR_BASE1, 0xC000 }, /* cursor base address 15:0 */
++ { GLAMO_REG_LCD_CURSOR_BASE2, 0x0012 }, /* cursor base address 22:16 */
++ { GLAMO_REG_LCD_COMMAND2, 0x0000 }, /* display page A */
++};
++
++static int glamofb_run_script(struct glamofb_handle *glamo,
++ const struct glamo_script *script, size_t len)
++{
++ size_t i;
++
++ for (i = 0; i < len; i++) {
++ const struct glamo_script *line = &script[i];
++
++ if (line->reg == 0xffff)
++ return 0;
++ else if (line->reg == 0xfffe)
++ msleep(line->val);
++ else
++ glamofb_reg_write(glamo, script[i].reg, script[i].val);
++ }
++
++ return 0;
++}
++
++static int glamofb_check_var(struct fb_var_screeninfo *var,
++ struct fb_info *info)
++{
++ struct glamofb_handle *glamo = info->par;
++
++ if (var->bits_per_pixel != 16)
++ var->bits_per_pixel = 16;
++
++ var->height = glamo->mach_info->height;
++ var->width = glamo->mach_info->width;
++
++ /* FIXME: set rgb positions */
++ switch (var->bits_per_pixel) {
++ case 16:
++ switch (glamofb_reg_read(glamo, GLAMO_REG_LCD_MODE3) & 0xc000) {
++ case GLAMO_LCD_SRC_RGB565:
++ var->red.offset = 11;
++ var->green.offset = 5;
++ var->blue.offset = 0;
++ var->red.length = 5;
++ var->green.length = 6;
++ var->blue.length = 5;
++ var->transp.length = 0;
++ break;
++ case GLAMO_LCD_SRC_ARGB1555:
++ var->transp.offset = 15;
++ var->red.offset = 10;
++ var->green.offset = 5;
++ var->blue.offset = 0;
++ var->transp.length = 1;
++ var->red.length = 5;
++ var->green.length = 5;
++ var->blue.length = 5;
++ break;
++ case GLAMO_LCD_SRC_ARGB4444:
++ var->transp.offset = 12;
++ var->red.offset = 8;
++ var->green.offset = 4;
++ var->blue.offset = 0;
++ var->transp.length = 4;
++ var->red.length = 4;
++ var->green.length = 4;
++ var->blue.length = 4;
++ break;
++ }
++ break;
++ case 24:
++ case 32:
++ default:
++ /* The Smedia Glamo doesn't support anything but 16bit color */
++ return -EINVAL;
++ }
++
++ return 0;
++}
++
++static void glamofb_reg_set_bit_mask(struct glamofb_handle *glamo, uint16_t reg,
++ uint16_t mask, uint16_t val)
++{
++ uint16_t tmp;
++
++ val &= mask;
++
++ tmp = glamofb_reg_read(glamo, reg);
++ tmp &= ~mask;
++ tmp |= val;
++ glamofb_reg_write(glamo, reg, tmp);
++}
++
++#define GLAMO_LCD_WIDTH_MASK 0x03FF
++#define GLAMO_LCD_HEIGHT_MASK 0x03FF
++#define GLAMO_LCD_PITCH_MASK 0x07FE
++#define GLAMO_LCD_HV_TOTAL_MASK 0x03FF
++#define GLAMO_LCD_HV_RETR_START_MASK 0x03FF
++#define GLAMO_LCD_HV_RETR_END_MASK 0x03FF
++#define GLAMO_LCD_HV_RETR_DISP_START_MASK 0x03FF
++#define GLAMO_LCD_HV_RETR_DISP_END_MASK 0x03FF
++
++/* the caller has to ensure lock_cmd is held and we are in cmd mode */
++static void __rotate_lcd(struct glamofb_handle *glamo, uint32_t rotation)
++{
++ uint32_t glamo_rot;
++
++ switch (rotation) {
++ case FB_ROTATE_CW:
++ glamo_rot = GLAMO_LCD_ROT_MODE_90;
++ break;
++ case FB_ROTATE_UD:
++ glamo_rot = GLAMO_LCD_ROT_MODE_180;
++ break;
++ case FB_ROTATE_CCW:
++ glamo_rot = GLAMO_LCD_ROT_MODE_270;
++ break;
++ default:
++ glamo_rot = GLAMO_LCD_ROT_MODE_0;
++ break;
++ }
++
++ glamofb_reg_set_bit_mask(glamo,
++ GLAMO_REG_LCD_WIDTH,
++ GLAMO_LCD_ROT_MODE_MASK,
++ glamo_rot);
++ glamofb_reg_set_bit_mask(glamo,
++ GLAMO_REG_LCD_MODE1,
++ GLAMO_LCD_MODE1_ROTATE_EN,
++ (glamo_rot != GLAMO_LCD_ROT_MODE_0) ?
++ GLAMO_LCD_MODE1_ROTATE_EN : 0);
++}
++
++static inline int glamofb_cmdq_empty(struct glamofb_handle *gfb)
++{
++ /* DGCMdQempty -- 1 == command queue is empty */
++ return glamofb_reg_read(gfb, GLAMO_REG_LCD_STATUS1) & (1 << 15);
++}
++
++/* call holding gfb->lock_cmd when locking, until you unlock */
++static int glamofb_cmd_mode(struct glamofb_handle *gfb, int on)
++{
++ int timeout = 2000000;
++
++ dev_dbg(gfb->dev, "glamofb_cmd_mode(gfb=%p, on=%d)\n", gfb, on);
++ if (on) {
++ dev_dbg(gfb->dev, "%s: waiting for cmdq empty: ",
++ __func__);
++ while (!glamofb_cmdq_empty(gfb) && (timeout--))
++ cpu_relax();
++ if (timeout < 0) {
++ printk(KERN_ERR "glamofb cmd_queue never got empty\n");
++ return -EIO;
++ }
++ dev_dbg(gfb->dev, "empty!\n");
++
++ /* display the entire frame then switch to command */
++ glamofb_reg_write(gfb, GLAMO_REG_LCD_COMMAND1,
++ GLAMO_LCD_CMD_TYPE_DISP |
++ GLAMO_LCD_CMD_DATA_FIRE_VSYNC);
++
++ /* wait until lcd idle */
++ dev_dbg(gfb->dev, "waiting for lcd idle: ");
++ timeout = 2000000;
++ while (!(glamofb_reg_read(gfb, GLAMO_REG_LCD_STATUS2) & (1 << 12)) &&
++ (timeout--))
++ cpu_relax();
++ if (timeout < 0) {
++ printk(KERN_ERR"*************"
++ "glamofb lcd never idle"
++ "*************\n");
++ return -EIO;
++ }
++
++ mdelay(100);
++
++ dev_dbg(gfb->dev, "cmd mode entered\n");
++
++ } else {
++ /* RGB interface needs vsync/hsync */
++ if (glamofb_reg_read(gfb, GLAMO_REG_LCD_MODE3) & GLAMO_LCD_MODE3_RGB)
++ glamofb_reg_write(gfb, GLAMO_REG_LCD_COMMAND1,
++ GLAMO_LCD_CMD_TYPE_DISP |
++ GLAMO_LCD_CMD_DATA_DISP_SYNC);
++
++ glamofb_reg_write(gfb, GLAMO_REG_LCD_COMMAND1,
++ GLAMO_LCD_CMD_TYPE_DISP |
++ GLAMO_LCD_CMD_DATA_DISP_FIRE);
++ }
++
++ return 0;
++}
++
++static void glamofb_program_mode(struct glamofb_handle *gfb)
++{
++ unsigned int sync, bp, disp, fp, total;
++ unsigned long flags;
++ struct glamo_core *gcore = gfb->core;
++ struct fb_var_screeninfo *var = &gfb->fb->var;
++
++ dev_dbg(&gcore->pdev->dev,
++ "glamofb_program_mode spin_lock_irqsave\n");
++ spin_lock_irqsave(&gfb->lock_cmd, flags);
++
++ if (glamofb_cmd_mode(gfb, 1))
++ goto out_unlock;
++
++ if (var->pixclock)
++ glamo_engine_reclock(gcore, GLAMO_ENGINE_LCD,
++ (1000000000UL / gfb->fb->var.pixclock) * 1000);
++
++ glamofb_reg_set_bit_mask(gfb,
++ GLAMO_REG_LCD_WIDTH,
++ GLAMO_LCD_WIDTH_MASK,
++ var->xres);
++ glamofb_reg_set_bit_mask(gfb,
++ GLAMO_REG_LCD_HEIGHT,
++ GLAMO_LCD_HEIGHT_MASK,
++ var->yres);
++ glamofb_reg_set_bit_mask(gfb,
++ GLAMO_REG_LCD_PITCH,
++ GLAMO_LCD_PITCH_MASK,
++ gfb->fb->fix.line_length);
++
++ /* honour the rotation request */
++ __rotate_lcd(gfb, var->rotate);
++
++ /* update scannout timings */
++ sync = 0;
++ bp = sync + var->hsync_len;
++ disp = bp + var->left_margin;
++ fp = disp + var->xres;
++ total = fp + var->right_margin;
++
++ glamofb_reg_set_bit_mask(gfb, GLAMO_REG_LCD_HORIZ_TOTAL,
++ GLAMO_LCD_HV_TOTAL_MASK, total);
++ glamofb_reg_set_bit_mask(gfb, GLAMO_REG_LCD_HORIZ_RETR_START,
++ GLAMO_LCD_HV_RETR_START_MASK, sync);
++ glamofb_reg_set_bit_mask(gfb, GLAMO_REG_LCD_HORIZ_RETR_END,
++ GLAMO_LCD_HV_RETR_END_MASK, bp);
++ glamofb_reg_set_bit_mask(gfb, GLAMO_REG_LCD_HORIZ_DISP_START,
++ GLAMO_LCD_HV_RETR_DISP_START_MASK, disp);
++ glamofb_reg_set_bit_mask(gfb, GLAMO_REG_LCD_HORIZ_DISP_END,
++ GLAMO_LCD_HV_RETR_DISP_END_MASK, fp);
++
++ sync = 0;
++ bp = sync + var->vsync_len;
++ disp = bp + var->upper_margin;
++ fp = disp + var->yres;
++ total = fp + var->lower_margin;
++
++ glamofb_reg_set_bit_mask(gfb, GLAMO_REG_LCD_VERT_TOTAL,
++ GLAMO_LCD_HV_TOTAL_MASK, total);
++ glamofb_reg_set_bit_mask(gfb, GLAMO_REG_LCD_VERT_RETR_START,
++ GLAMO_LCD_HV_RETR_START_MASK, sync);
++ glamofb_reg_set_bit_mask(gfb, GLAMO_REG_LCD_VERT_RETR_END,
++ GLAMO_LCD_HV_RETR_END_MASK, bp);
++ glamofb_reg_set_bit_mask(gfb, GLAMO_REG_LCD_VERT_DISP_START,
++ GLAMO_LCD_HV_RETR_DISP_START_MASK, disp);
++ glamofb_reg_set_bit_mask(gfb, GLAMO_REG_LCD_VERT_DISP_END,
++ GLAMO_LCD_HV_RETR_DISP_END_MASK, fp);
++
++ glamofb_cmd_mode(gfb, 0);
++
++ gfb->mode_set = 1;
++
++out_unlock:
++ dev_dbg(&gcore->pdev->dev,
++ "glamofb_program_mode spin_unlock_irqrestore\n");
++ spin_unlock_irqrestore(&gfb->lock_cmd, flags);
++}
++
++static struct fb_videomode *glamofb_find_mode(struct fb_info *info,
++ struct fb_var_screeninfo *var)
++{
++ struct glamofb_handle *glamo = info->par;
++ struct glamo_fb_platform_data *pdata = glamo->mach_info;
++ struct fb_videomode *mode;
++ int i;
++
++ for (i = pdata->num_modes, mode = pdata->modes; i; --i, ++mode) {
++ if (mode->xres == var->xres &&
++ mode->yres == var->yres)
++ return mode;
++ }
++
++ return NULL;
++}
++
++static int glamofb_set_par(struct fb_info *info)
++{
++ struct glamofb_handle *glamo = info->par;
++ struct fb_var_screeninfo *var = &info->var;
++ struct fb_videomode *mode;
++
++ mode = glamofb_find_mode(info, var);
++ if (!mode)
++ return -EINVAL;
++
++ fb_videomode_to_var(var, mode);
++
++ info->mode = mode;
++
++ glamo->mode_set = 0;
++
++ switch (var->rotate) {
++ case FB_ROTATE_CW:
++ case FB_ROTATE_CCW:
++ info->fix.line_length = (var->yres * var->bits_per_pixel) / 8;
++ /* FIXME: Limit pixelclock */
++ var->pixclock *= 2;
++ break;
++ default:
++ info->fix.line_length = (var->xres * var->bits_per_pixel) / 8;
++ break;
++ }
++
++ if (glamo->output_enabled)
++ glamofb_program_mode(glamo);
++
++ return 0;
++}
++
++static int glamofb_blank(int blank_mode, struct fb_info *info)
++{
++ struct glamofb_handle *gfb = info->par;
++
++ dev_dbg(gfb->dev, "glamofb_blank(%u)\n", blank_mode);
++
++ switch (blank_mode) {
++ case FB_BLANK_VSYNC_SUSPEND:
++ case FB_BLANK_HSYNC_SUSPEND:
++ /* FIXME: add pdata hook/flag to indicate whether
++ * we should already switch off pixel clock here */
++ break;
++ case FB_BLANK_POWERDOWN:
++ /* disable the pixel clock */
++ glamo_output_disable(gfb);
++ gfb->blank_mode = blank_mode;
++ break;
++ case FB_BLANK_UNBLANK:
++ case FB_BLANK_NORMAL:
++ glamo_output_enable(gfb);
++ gfb->blank_mode = blank_mode;
++ break;
++ }
++
++ /* FIXME: once we have proper clock management in glamo-core,
++ * we can determine if other units need MCLK1 or the PLL, and
++ * disable it if not used. */
++ return 0;
++}
++
++static inline unsigned int chan_to_field(unsigned int chan,
++ struct fb_bitfield *bf)
++{
++ chan &= 0xffff;
++ chan >>= 16 - bf->length;
++ return chan << bf->offset;
++}
++
++static int glamofb_setcolreg(unsigned regno, unsigned red, unsigned green,
++ unsigned blue, unsigned transp, struct fb_info *info)
++{
++ struct glamofb_handle *glamo = info->par;
++ unsigned int val;
++
++ switch (glamo->fb->fix.visual) {
++ case FB_VISUAL_TRUECOLOR:
++ case FB_VISUAL_DIRECTCOLOR:
++ /* true-colour, use pseuo-palette */
++
++ if (regno < 16) {
++ u32 *pal = glamo->fb->pseudo_palette;
++
++ val = chan_to_field(red, &glamo->fb->var.red);
++ val |= chan_to_field(green, &glamo->fb->var.green);
++ val |= chan_to_field(blue, &glamo->fb->var.blue);
++
++ pal[regno] = val;
++ };
++ break;
++ default:
++ return 1; /* unknown type */
++ }
++
++ return 0;
++}
++
++static int glamofb_ioctl(struct fb_info *info, unsigned int cmd,
++ unsigned long arg)
++{
++ struct glamofb_handle *gfb = (struct glamofb_handle *)info->par;
++ struct glamo_core *gcore = gfb->core;
++ int retval = -ENOTTY;
++
++ switch (cmd) {
++ case GLAMOFB_ENGINE_ENABLE:
++ retval = glamo_engine_enable(gcore, arg);
++ break;
++ case GLAMOFB_ENGINE_DISABLE:
++ retval = glamo_engine_disable(gcore, arg);
++ break;
++ case GLAMOFB_ENGINE_RESET:
++ glamo_engine_reset(gcore, arg);
++ retval = 0;
++ break;
++ default:
++ break;
++ }
++
++ return retval;
++}
++
++
++#ifdef CONFIG_MFD_GLAMO_HWACCEL
++static inline void glamofb_vsync_wait(struct glamofb_handle *glamo, int line,
++ int size, int range)
++{
++ int count[2];
++
++ do {
++ count[0] = glamofb_reg_read(glamo, GLAMO_REG_LCD_STATUS2) & 0x3ff;
++ count[1] = glamofb_reg_read(glamo, GLAMO_REG_LCD_STATUS2) & 0x3ff;
++ } while (count[0] != count[1] ||
++ (line < count[0] + range &&
++ size > count[0] - range) ||
++ count[0] < range * 2);
++}
++
++/*
++ * Enable/disable the hardware cursor mode altogether
++ * (for blinking and such, use glamofb_cursor()).
++ */
++static void glamofb_cursor_onoff(struct glamofb_handle *glamo, int on)
++{
++ int y, size;
++
++ if (glamo->cursor_on) {
++ y = glamofb_reg_read(glamo, GLAMO_REG_LCD_CURSOR_Y_POS);
++ size = glamofb_reg_read(glamo, GLAMO_REG_LCD_CURSOR_Y_SIZE);
++
++ glamofb_vsync_wait(glamo, y, size, 30);
++ }
++
++ glamofb_reg_set_bit_mask(glamo, GLAMO_REG_LCD_MODE1,
++ GLAMO_LCD_MODE1_CURSOR_EN,
++ on ? GLAMO_LCD_MODE1_CURSOR_EN : 0);
++ glamo->cursor_on = on;
++
++ /* Hide the cursor by default */
++ glamofb_reg_write(glamo, GLAMO_REG_LCD_CURSOR_X_SIZE, 0);
++}
++
++static int glamofb_cursor(struct fb_info *info, struct fb_cursor *cursor)
++{
++ struct glamofb_handle *glamo = info->par;
++ unsigned long flags;
++
++ spin_lock_irqsave(&glamo->lock_cmd, flags);
++
++ glamofb_reg_write(glamo, GLAMO_REG_LCD_CURSOR_X_SIZE,
++ cursor->enable ? cursor->image.width : 0);
++
++ if (cursor->set & FB_CUR_SETPOS) {
++ glamofb_reg_write(glamo, GLAMO_REG_LCD_CURSOR_X_POS,
++ cursor->image.dx);
++ glamofb_reg_write(glamo, GLAMO_REG_LCD_CURSOR_Y_POS,
++ cursor->image.dy);
++ }
++
++ if (cursor->set & FB_CUR_SETCMAP) {
++ uint16_t fg = glamo->pseudo_pal[cursor->image.fg_color];
++ uint16_t bg = glamo->pseudo_pal[cursor->image.bg_color];
++
++ glamofb_reg_write(glamo, GLAMO_REG_LCD_CURSOR_FG_COLOR, fg);
++ glamofb_reg_write(glamo, GLAMO_REG_LCD_CURSOR_BG_COLOR, bg);
++ glamofb_reg_write(glamo, GLAMO_REG_LCD_CURSOR_DST_COLOR, fg);
++ }
++
++ if (cursor->set & FB_CUR_SETHOT)
++ glamofb_reg_write(glamo, GLAMO_REG_LCD_CURSOR_PRESET,
++ (cursor->hot.x << 8) | cursor->hot.y);
++
++ if ((cursor->set & FB_CUR_SETSIZE) ||
++ (cursor->set & (FB_CUR_SETIMAGE | FB_CUR_SETSHAPE))) {
++ int x, y, pitch, op;
++ const uint8_t *pcol = cursor->image.data;
++ const uint8_t *pmsk = cursor->mask;
++ uint8_t __iomem *dst = glamo->cursor_addr;
++ uint8_t dcol = 0;
++ uint8_t dmsk = 0;
++ uint8_t byte = 0;
++
++ if (cursor->image.depth > 1) {
++ spin_unlock_irqrestore(&glamo->lock_cmd, flags);
++ return -EINVAL;
++ }
++
++ pitch = ((cursor->image.width + 7) >> 2) & ~1;
++ glamofb_reg_write(glamo, GLAMO_REG_LCD_CURSOR_PITCH,
++ pitch);
++ glamofb_reg_write(glamo, GLAMO_REG_LCD_CURSOR_Y_SIZE,
++ cursor->image.height);
++
++ for (y = 0; y < cursor->image.height; y++) {
++ byte = 0;
++ for (x = 0; x < cursor->image.width; x++) {
++ if ((x % 8) == 0) {
++ dcol = *pcol++;
++ dmsk = *pmsk++;
++ } else {
++ dcol >>= 1;
++ dmsk >>= 1;
++ }
++
++ if (cursor->rop == ROP_COPY)
++ op = (dmsk & 1) ?
++ (dcol & 1) ? 1 : 3 : 0;
++ else
++ op = ((dmsk & 1) << 1) |
++ ((dcol & 1) << 0);
++ byte |= op << ((x & 3) << 1);
++
++ if (x % 4 == 3) {
++ writeb(byte, dst + x / 4);
++ byte = 0;
++ }
++ }
++ if (x % 4) {
++ writeb(byte, dst + x / 4);
++ byte = 0;
++ }
++
++ dst += pitch;
++ }
++ }
++
++ spin_unlock_irqrestore(&glamo->lock_cmd, flags);
++
++ return 0;
++}
++#endif
++
++static struct fb_ops glamofb_ops = {
++ .owner = THIS_MODULE,
++ .fb_check_var = glamofb_check_var,
++ .fb_set_par = glamofb_set_par,
++ .fb_blank = glamofb_blank,
++ .fb_setcolreg = glamofb_setcolreg,
++ .fb_ioctl = glamofb_ioctl,
++#ifdef CONFIG_MFD_GLAMO_HWACCEL
++ .fb_cursor = glamofb_cursor,
++#endif
++ .fb_fillrect = cfb_fillrect,
++ .fb_copyarea = cfb_copyarea,
++ .fb_imageblit = cfb_imageblit,
++};
++
++static int glamofb_init_regs(struct glamofb_handle *glamo)
++{
++ struct fb_info *info = glamo->fb;
++
++ glamofb_check_var(&info->var, info);
++ glamofb_run_script(glamo, glamo_regs, ARRAY_SIZE(glamo_regs));
++ glamofb_set_par(info);
++
++ return 0;
++}
++
++static int __devinit glamofb_probe(struct platform_device *pdev)
++{
++ int rc = -EIO;
++ struct fb_info *fbinfo;
++ struct glamofb_handle *glamofb;
++ struct glamo_core *core = dev_get_drvdata(pdev->dev.parent);
++ struct glamo_fb_platform_data *mach_info;
++
++ printk(KERN_INFO "SMEDIA Glamo frame buffer driver (C) 2007 "
++ "Openmoko, Inc.\n");
++
++ if (!core->pdata || !core->pdata->fb_data)
++ return -ENOENT;
++
++
++ fbinfo = framebuffer_alloc(sizeof(struct glamofb_handle), &pdev->dev);
++ if (!fbinfo)
++ return -ENOMEM;
++
++
++ glamofb = fbinfo->par;
++ glamofb->fb = fbinfo;
++ glamofb->dev = &pdev->dev;
++
++ glamofb->blank_mode = FB_BLANK_POWERDOWN;
++
++ strcpy(fbinfo->fix.id, "SMedia Glamo");
++
++ glamofb->reg = platform_get_resource_byname(pdev, IORESOURCE_MEM,
++ "glamo-fb-regs");
++ if (!glamofb->reg) {
++ dev_err(&pdev->dev, "platform device with no registers?\n");
++ rc = -ENOENT;
++ goto out_free;
++ }
++
++ glamofb->fb_res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
++ "glamo-fb-mem");
++ if (!glamofb->fb_res) {
++ dev_err(&pdev->dev, "platform device with no memory ?\n");
++ rc = -ENOENT;
++ goto out_free;
++ }
++
++ glamofb->reg = request_mem_region(glamofb->reg->start,
++ resource_size(glamofb->reg),
++ pdev->name);
++ if (!glamofb->reg) {
++ dev_err(&pdev->dev, "failed to request mmio region\n");
++ goto out_free;
++ }
++
++ glamofb->fb_res = request_mem_region(glamofb->fb_res->start,
++ resource_size(glamofb->fb_res),
++ pdev->name);
++ if (!glamofb->fb_res) {
++ dev_err(&pdev->dev, "failed to request vram region\n");
++ goto out_release_reg;
++ }
++
++ /* we want to remap only the registers required for this core
++ * driver. */
++ glamofb->base = ioremap_nocache(glamofb->reg->start,
++ resource_size(glamofb->reg));
++ if (!glamofb->base) {
++ dev_err(&pdev->dev, "failed to ioremap() mmio memory\n");
++ goto out_release_fb;
++ }
++
++ fbinfo->fix.smem_start = (unsigned long)glamofb->fb_res->start;
++ fbinfo->fix.smem_len = (__u32)resource_size(glamofb->fb_res);
++
++ fbinfo->screen_base = ioremap(glamofb->fb_res->start,
++ resource_size(glamofb->fb_res));
++ if (!fbinfo->screen_base) {
++ dev_err(&pdev->dev, "failed to ioremap() vram memory\n");
++ goto out_release_fb;
++ }
++ glamofb->cursor_addr = fbinfo->screen_base + 0x12C000;
++
++ platform_set_drvdata(pdev, glamofb);
++
++ mach_info = core->pdata->fb_data;
++ glamofb->core = core;
++ glamofb->mach_info = mach_info;
++
++ fbinfo->fix.visual = FB_VISUAL_TRUECOLOR;
++ fbinfo->fix.type = FB_TYPE_PACKED_PIXELS;
++ fbinfo->fix.type_aux = 0;
++ fbinfo->fix.xpanstep = 0;
++ fbinfo->fix.ypanstep = 0;
++ fbinfo->fix.ywrapstep = 0;
++ fbinfo->fix.accel = FB_ACCEL_GLAMO;
++
++
++ fbinfo->fbops = &glamofb_ops;
++ fbinfo->flags = FBINFO_FLAG_DEFAULT;
++ fbinfo->pseudo_palette = &glamofb->pseudo_pal;
++
++ fbinfo->mode = mach_info->modes;
++ fb_videomode_to_var(&fbinfo->var, fbinfo->mode);
++ fbinfo->var.bits_per_pixel = 16;
++ fbinfo->var.nonstd = 0;
++ fbinfo->var.activate = FB_ACTIVATE_NOW;
++ fbinfo->var.height = mach_info->height;
++ fbinfo->var.width = mach_info->width;
++ fbinfo->var.accel_flags = 0;
++ fbinfo->var.vmode = FB_VMODE_NONINTERLACED;
++
++ glamo_engine_enable(core, GLAMO_ENGINE_LCD);
++ glamo_engine_reset(core, GLAMO_ENGINE_LCD);
++ glamofb->output_enabled = 1;
++ glamofb->mode_set = 1;
++
++ dev_info(&pdev->dev, "spin_lock_init\n");
++ spin_lock_init(&glamofb->lock_cmd);
++ glamofb_init_regs(glamofb);
++#ifdef CONFIG_MFD_GLAMO_HWACCEL
++ glamofb_cursor_onoff(glamofb, 1);
++#endif
++
++ fb_videomode_to_modelist(mach_info->modes, mach_info->num_modes,
++ &fbinfo->modelist);
++
++ rc = register_framebuffer(fbinfo);
++ if (rc < 0) {
++ dev_err(&pdev->dev, "failed to register framebuffer\n");
++ goto out_unmap_fb;
++ }
++
++ printk(KERN_INFO "fb%d: %s frame buffer device\n",
++ fbinfo->node, fbinfo->fix.id);
++
++ return 0;
++
++out_unmap_fb:
++ iounmap(fbinfo->screen_base);
++ iounmap(glamofb->base);
++out_release_fb:
++ release_mem_region(glamofb->fb_res->start,
++ resource_size(glamofb->fb_res));
++out_release_reg:
++ release_mem_region(glamofb->reg->start,
++ resource_size(glamofb->reg));
++out_free:
++ framebuffer_release(fbinfo);
++ return rc;
++}
++
++static int __devexit glamofb_remove(struct platform_device *pdev)
++{
++ struct glamofb_handle *glamofb = platform_get_drvdata(pdev);
++
++ iounmap(glamofb->fb->screen_base);
++ iounmap(glamofb->base);
++
++ release_mem_region(glamofb->fb_res->start,
++ resource_size(glamofb->fb_res));
++ release_mem_region(glamofb->reg->start, resource_size(glamofb->reg));
++
++ platform_set_drvdata(pdev, NULL);
++ framebuffer_release(glamofb->fb);
++
++ return 0;
++}
++
++#ifdef CONFIG_PM
++
++static int glamofb_suspend(struct device *dev)
++{
++ struct glamofb_handle *gfb = dev_get_drvdata(dev);
++
++ console_lock();
++ fb_set_suspend(gfb->fb, 1);
++ console_unlock();
++
++ /* seriously -- nobody is allowed to touch glamo memory when we
++ * are suspended or we lock on nWAIT
++ */
++ /* iounmap(gfb->fb->screen_base); */
++
++ return 0;
++}
++
++static int glamofb_resume(struct device *dev)
++{
++ struct glamofb_handle *gfb = dev_get_drvdata(dev);
++
++ /* OK let's allow framebuffer ops again */
++ /* gfb->fb->screen_base = ioremap(gfb->fb_res->start,
++ resource_size(gfb->fb_res)); */
++ glamo_engine_enable(gfb->core, GLAMO_ENGINE_LCD);
++ glamo_engine_reset(gfb->core, GLAMO_ENGINE_LCD);
++
++ glamofb_init_regs(gfb);
++#ifdef CONFIG_MFD_GLAMO_HWACCEL
++ glamofb_cursor_onoff(gfb, 1);
++#endif
++
++ console_lock();
++ fb_set_suspend(gfb->fb, 0);
++ console_unlock();
++
++ return 0;
++}
++
++static const struct dev_pm_ops glamofb_pm_ops = {
++ .suspend = glamofb_suspend,
++ .resume = glamofb_resume,
++};
++
++#define GLAMOFB_PM_OPS (&glamofb_pm_ops)
++
++#else
++#define GLAMOFB_PM_OPS NULL
++#endif
++
++static struct platform_driver glamofb_driver = {
++ .probe = glamofb_probe,
++ .remove = __devexit_p(glamofb_remove),
++ .driver = {
++ .name = "glamo-fb",
++ .owner = THIS_MODULE,
++ .pm = GLAMOFB_PM_OPS
++ },
++};
++
++static int __init glamofb_init(void)
++{
++ return platform_driver_register(&glamofb_driver);
++}
++module_init(glamofb_init);
++
++static void __exit glamofb_cleanup(void)
++{
++ platform_driver_unregister(&glamofb_driver);
++}
++module_exit(glamofb_cleanup);
++
++MODULE_AUTHOR("Harald Welte <laforge@openmoko.org>");
++MODULE_DESCRIPTION("Smedia Glamo 336x/337x framebuffer driver");
++MODULE_LICENSE("GPL");
++MODULE_ALIAS("platform:glamo-fb");
+diff --git a/include/linux/fb.h b/include/linux/fb.h
+index 6a82748..6965285 100644
+--- a/include/linux/fb.h
++++ b/include/linux/fb.h
+@@ -135,6 +135,7 @@
+ #define FB_ACCEL_NEOMAGIC_NM2360 97 /* NeoMagic NM2360 */
+ #define FB_ACCEL_NEOMAGIC_NM2380 98 /* NeoMagic NM2380 */
+ #define FB_ACCEL_PXA3XX 99 /* PXA3xx */
++#define FB_ACCEL_GLAMO 100 /* Smedia Glamo 3362 */
+
+ #define FB_ACCEL_SAVAGE4 0x80 /* S3 Savage4 */
+ #define FB_ACCEL_SAVAGE3D 0x81 /* S3 Savage3D */
+diff --git a/include/linux/glamofb.h b/include/linux/glamofb.h
+new file mode 100644
+index 0000000..896579b
+--- /dev/null
++++ b/include/linux/glamofb.h
+@@ -0,0 +1,21 @@
++#ifndef _LINUX_GLAMOFB_H
++#define _LINUX_GLAMOFB_H
++
++#ifdef __KERNEL__
++
++#include <linux/fb.h>
++
++struct glamo_fb_platform_data {
++ int width, height;
++
++ int num_modes;
++ struct fb_videomode *modes;
++};
++
++#endif
++
++#define GLAMOFB_ENGINE_ENABLE _IOW('F', 0x1, __u32)
++#define GLAMOFB_ENGINE_DISABLE _IOW('F', 0x2, __u32)
++#define GLAMOFB_ENGINE_RESET _IOW('F', 0x3, __u32)
++
++#endif
+diff --git a/include/linux/jbt6k74.h b/include/linux/jbt6k74.h
+new file mode 100644
+index 0000000..3f0735d
+--- /dev/null
++++ b/include/linux/jbt6k74.h
+@@ -0,0 +1,18 @@
++#ifndef __JBT6K74_H__
++#define __JBT6K74_H__
++
++#include <linux/spi/spi.h>
++
++/*
++ * struct jbt6k74_platform_data - Platform data for jbt6k74 driver
++ * @enable_pixel_clock: Callback to enable or disable the pixelclock of the
++ * gpu.
++ * @gpio_reset: Reset gpio pin number.
++ */
++struct jbt6k74_platform_data {
++ void (*enable_pixel_clock)(struct device *dev, int enable);
++
++ int gpio_reset;
++};
++
++#endif
+diff --git a/include/linux/leds_pwm.h b/include/linux/leds_pwm.h
+index 33a0711..42d4969 100644
+--- a/include/linux/leds_pwm.h
++++ b/include/linux/leds_pwm.h
+@@ -16,6 +16,26 @@ struct led_pwm {
+ struct led_pwm_platform_data {
+ int num_leds;
+ struct led_pwm *leds;
++
++ /* @init: The init callback is called after the pwm device for a led has
++ * been successfully configured. If the return value is negative it will be
++ * seen as an error and initzalisation of the leds-pwm device will fail.
++ */
++ int (*init)(struct device *dev, struct led_pwm *led);
++
++ /* @notify: The notify callback is called whenever the brightness of a led
++ * is changed.
++ * The return value of the callback will be the brightness which is used to
++ * configure the pwm device.
++ */
++ enum led_brightness (*notify)(struct device *dev, struct led_pwm *led,
++ enum led_brightness brightness);
++
++ /* @exit: The exit callback is called, whenever a led device registered by
++ * the leds-pwm device is unregistered. It will be called prior to freeing
++ * the pwm device.
++ */
++ void (*exit)(struct device *dev, struct led_pwm *led);
+ };
+
+ #endif
+diff --git a/include/linux/mfd/glamo-core.h b/include/linux/mfd/glamo-core.h
+new file mode 100644
+index 0000000..8275a2f
+--- /dev/null
++++ b/include/linux/mfd/glamo-core.h
+@@ -0,0 +1,58 @@
++#ifndef __GLAMO_CORE_H
++#define __GLAMO_CORE_H
++
++#include <linux/mfd/glamo.h>
++
++/* for the time being, we put the on-screen framebuffer into the lowest
++ * VRAM space. This should make the code easily compatible with the various
++ * 2MB/4MB/8MB variants of the Smedia chips */
++#define GLAMO_OFFSET_VRAM 0x800000
++#define GLAMO_OFFSET_FB (GLAMO_OFFSET_VRAM)
++
++/* we only allocate the minimum possible size for the framebuffer to make
++ * sure we have sufficient memory for other functions of the chip */
++/*#define GLAMO_FB_SIZE (640*480*4) *//* == 0x12c000 */
++#define GLAMO_INTERNAL_RAM_SIZE 0x800000
++#define GLAMO_MMC_BUFFER_SIZE (64 * 1024)
++#define GLAMO_FB_SIZE (GLAMO_INTERNAL_RAM_SIZE - GLAMO_MMC_BUFFER_SIZE)
++
++enum glamo_pll {
++ GLAMO_PLL1,
++ GLAMO_PLL2,
++};
++
++enum glamo_engine_state {
++ GLAMO_ENGINE_DISABLED,
++ GLAMO_ENGINE_SUSPENDED,
++ GLAMO_ENGINE_ENABLED,
++};
++
++struct glamo_core {
++ int irq;
++ int irq_base;
++ struct resource *mem;
++ void __iomem *base;
++ struct platform_device *pdev;
++ struct glamo_platform_data *pdata;
++ enum glamo_engine_state engine_state[__NUM_GLAMO_ENGINES];
++ spinlock_t lock;
++ uint16_t saved_irq_mask;
++#ifdef CONFIG_DEBUG_FS
++ struct dentry *debugfs_dir;
++#endif
++};
++
++struct glamo_script {
++ uint16_t reg;
++ uint16_t val;
++};
++
++int glamo_pll_rate(struct glamo_core *glamo, enum glamo_pll pll);
++
++int glamo_engine_enable(struct glamo_core *glamo, enum glamo_engine engine);
++int glamo_engine_suspend(struct glamo_core *glamo, enum glamo_engine engine);
++int glamo_engine_disable(struct glamo_core *glamo, enum glamo_engine engine);
++void glamo_engine_reset(struct glamo_core *glamo, enum glamo_engine engine);
++int glamo_engine_reclock(struct glamo_core *glamo,
++ enum glamo_engine engine, int ps);
++#endif /* __GLAMO_CORE_H */
+diff --git a/include/linux/mfd/glamo-regs.h b/include/linux/mfd/glamo-regs.h
+new file mode 100644
+index 0000000..59848e1
+--- /dev/null
++++ b/include/linux/mfd/glamo-regs.h
+@@ -0,0 +1,630 @@
++#ifndef _GLAMO_REGS_H
++#define _GLAMO_REGS_H
++
++/* Smedia Glamo 336x/337x driver
++ *
++ * (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 as
++ * published by the Free Software Foundation; either version 2 of
++ * the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ */
++
++enum glamo_regster_offsets {
++ GLAMO_REGOFS_GENERIC = 0x0000,
++ GLAMO_REGOFS_HOSTBUS = 0x0200,
++ GLAMO_REGOFS_MEMORY = 0x0300,
++ GLAMO_REGOFS_VIDCAP = 0x0400,
++ GLAMO_REGOFS_ISP = 0x0500,
++ GLAMO_REGOFS_JPEG = 0x0800,
++ GLAMO_REGOFS_MPEG = 0x0c00,
++ GLAMO_REGOFS_LCD = 0x1100,
++ GLAMO_REGOFS_MMC = 0x1400,
++ GLAMO_REGOFS_MPROC0 = 0x1500,
++ GLAMO_REGOFS_MPROC1 = 0x1580,
++ GLAMO_REGOFS_CMDQUEUE = 0x1600,
++ GLAMO_REGOFS_RISC = 0x1680,
++ GLAMO_REGOFS_2D = 0x1700,
++ GLAMO_REGOFS_3D = 0x1b00,
++ GLAMO_REGOFS_END = 0x2400,
++};
++
++
++enum glamo_register_generic {
++ GLAMO_REG_GCONF1 = 0x0000,
++ GLAMO_REG_GCONF2 = 0x0002,
++#define GLAMO_REG_DEVICE_ID GLAMO_REG_GCONF2
++ GLAMO_REG_GCONF3 = 0x0004,
++#define GLAMO_REG_REVISION_ID GLAMO_REG_GCONF3
++ GLAMO_REG_IRQ_GEN1 = 0x0006,
++#define GLAMO_REG_IRQ_ENABLE GLAMO_REG_IRQ_GEN1
++ GLAMO_REG_IRQ_GEN2 = 0x0008,
++#define GLAMO_REG_IRQ_SET GLAMO_REG_IRQ_GEN2
++ GLAMO_REG_IRQ_GEN3 = 0x000a,
++#define GLAMO_REG_IRQ_CLEAR GLAMO_REG_IRQ_GEN3
++ GLAMO_REG_IRQ_GEN4 = 0x000c,
++#define GLAMO_REG_IRQ_STATUS GLAMO_REG_IRQ_GEN4
++ GLAMO_REG_CLOCK_HOST = 0x0010,
++ GLAMO_REG_CLOCK_MEMORY = 0x0012,
++ GLAMO_REG_CLOCK_LCD = 0x0014,
++ GLAMO_REG_CLOCK_MMC = 0x0016,
++ GLAMO_REG_CLOCK_ISP = 0x0018,
++ GLAMO_REG_CLOCK_JPEG = 0x001a,
++ GLAMO_REG_CLOCK_3D = 0x001c,
++ GLAMO_REG_CLOCK_2D = 0x001e,
++ GLAMO_REG_CLOCK_RISC1 = 0x0020, /* 3365 only? */
++ GLAMO_REG_CLOCK_RISC2 = 0x0022, /* 3365 only? */
++ GLAMO_REG_CLOCK_MPEG = 0x0024,
++ GLAMO_REG_CLOCK_MPROC = 0x0026,
++
++ GLAMO_REG_CLOCK_GEN5_1 = 0x0030,
++ GLAMO_REG_CLOCK_GEN5_2 = 0x0032,
++ GLAMO_REG_CLOCK_GEN6 = 0x0034,
++ GLAMO_REG_CLOCK_GEN7 = 0x0036,
++ GLAMO_REG_CLOCK_GEN8 = 0x0038,
++ GLAMO_REG_CLOCK_GEN9 = 0x003a,
++ GLAMO_REG_CLOCK_GEN10 = 0x003c,
++ GLAMO_REG_CLOCK_GEN11 = 0x003e,
++ GLAMO_REG_PLL_GEN1 = 0x0040,
++ GLAMO_REG_PLL_GEN2 = 0x0042,
++ GLAMO_REG_PLL_GEN3 = 0x0044,
++ GLAMO_REG_PLL_GEN4 = 0x0046,
++ GLAMO_REG_PLL_GEN5 = 0x0048,
++ GLAMO_REG_GPIO_GEN1 = 0x0050,
++ GLAMO_REG_GPIO_GEN2 = 0x0052,
++ GLAMO_REG_GPIO_GEN3 = 0x0054,
++ GLAMO_REG_GPIO_GEN4 = 0x0056,
++ GLAMO_REG_GPIO_GEN5 = 0x0058,
++ GLAMO_REG_GPIO_GEN6 = 0x005a,
++ GLAMO_REG_GPIO_GEN7 = 0x005c,
++ GLAMO_REG_GPIO_GEN8 = 0x005e,
++ GLAMO_REG_GPIO_GEN9 = 0x0060,
++ GLAMO_REG_GPIO_GEN10 = 0x0062,
++ GLAMO_REG_DFT_GEN1 = 0x0070,
++ GLAMO_REG_DFT_GEN2 = 0x0072,
++ GLAMO_REG_DFT_GEN3 = 0x0074,
++ GLAMO_REG_DFT_GEN4 = 0x0076,
++
++ GLAMO_REG_DFT_GEN5 = 0x01e0,
++ GLAMO_REG_DFT_GEN6 = 0x01f0,
++};
++
++#define GLAMO_REG_HOSTBUS(x) (GLAMO_REGOFS_HOSTBUS-2+(x*2))
++
++#define REG_MEM(x) (GLAMO_REGOFS_MEMORY+(x))
++#define GLAMO_REG_MEM_TIMING(x) (GLAMO_REG_MEM_TIMING1-2+(x*2))
++
++enum glamo_register_mem {
++ GLAMO_REG_MEM_TYPE = REG_MEM(0x00),
++ GLAMO_REG_MEM_GEN = REG_MEM(0x02),
++ GLAMO_REG_MEM_TIMING1 = REG_MEM(0x04),
++ GLAMO_REG_MEM_TIMING2 = REG_MEM(0x06),
++ GLAMO_REG_MEM_TIMING3 = REG_MEM(0x08),
++ GLAMO_REG_MEM_TIMING4 = REG_MEM(0x0a),
++ GLAMO_REG_MEM_TIMING5 = REG_MEM(0x0c),
++ GLAMO_REG_MEM_TIMING6 = REG_MEM(0x0e),
++ GLAMO_REG_MEM_TIMING7 = REG_MEM(0x10),
++ GLAMO_REG_MEM_TIMING8 = REG_MEM(0x12),
++ GLAMO_REG_MEM_TIMING9 = REG_MEM(0x14),
++ GLAMO_REG_MEM_TIMING10 = REG_MEM(0x16),
++ GLAMO_REG_MEM_TIMING11 = REG_MEM(0x18),
++ GLAMO_REG_MEM_POWER1 = REG_MEM(0x1a),
++ GLAMO_REG_MEM_POWER2 = REG_MEM(0x1c),
++ GLAMO_REG_MEM_LCD_BUF1 = REG_MEM(0x1e),
++ GLAMO_REG_MEM_LCD_BUF2 = REG_MEM(0x20),
++ GLAMO_REG_MEM_LCD_BUF3 = REG_MEM(0x22),
++ GLAMO_REG_MEM_LCD_BUF4 = REG_MEM(0x24),
++ GLAMO_REG_MEM_BIST1 = REG_MEM(0x26),
++ GLAMO_REG_MEM_BIST2 = REG_MEM(0x28),
++ GLAMO_REG_MEM_BIST3 = REG_MEM(0x2a),
++ GLAMO_REG_MEM_BIST4 = REG_MEM(0x2c),
++ GLAMO_REG_MEM_BIST5 = REG_MEM(0x2e),
++ GLAMO_REG_MEM_MAH1 = REG_MEM(0x30),
++ GLAMO_REG_MEM_MAH2 = REG_MEM(0x32),
++ GLAMO_REG_MEM_DRAM1 = REG_MEM(0x34),
++ GLAMO_REG_MEM_DRAM2 = REG_MEM(0x36),
++ GLAMO_REG_MEM_CRC = REG_MEM(0x38),
++};
++
++#define GLAMO_MEM_TYPE_MASK 0x03
++
++enum glamo_reg_mem_dram1 {
++ /* b0 - b10 == refresh period, 1 -> 2048 clocks */
++ GLAMO_MEM_DRAM1_EN_GATE_CLK = (1 << 11),
++ GLAMO_MEM_DRAM1_SELF_REFRESH = (1 << 12),
++ GLAMO_MEM_DRAM1_EN_GATE_CKE = (1 << 13),
++ GLAMO_MEM_DRAM1_EN_DRAM_REFRESH = (1 << 14),
++ GLAMO_MEM_DRAM1_EN_MODEREG_SET = (1 << 15),
++};
++
++enum glamo_reg_mem_dram2 {
++ GLAMO_MEM_DRAM2_DEEP_PWRDOWN = (1 << 12),
++};
++
++enum glamo_irq_index {
++ GLAMO_IRQIDX_HOSTBUS = 0,
++ GLAMO_IRQIDX_JPEG = 1,
++ GLAMO_IRQIDX_MPEG = 2,
++ GLAMO_IRQIDX_MPROC1 = 3,
++ GLAMO_IRQIDX_MPROC0 = 4,
++ GLAMO_IRQIDX_CMDQUEUE = 5,
++ GLAMO_IRQIDX_2D = 6,
++ GLAMO_IRQIDX_MMC = 7,
++ GLAMO_IRQIDX_RISC = 8,
++};
++
++enum glamo_irq {
++ GLAMO_IRQ_HOSTBUS = (1 << GLAMO_IRQIDX_HOSTBUS),
++ GLAMO_IRQ_JPEG = (1 << GLAMO_IRQIDX_JPEG),
++ GLAMO_IRQ_MPEG = (1 << GLAMO_IRQIDX_MPEG),
++ GLAMO_IRQ_MPROC1 = (1 << GLAMO_IRQIDX_MPROC1),
++ GLAMO_IRQ_MPROC0 = (1 << GLAMO_IRQIDX_MPROC0),
++ GLAMO_IRQ_CMDQUEUE = (1 << GLAMO_IRQIDX_CMDQUEUE),
++ GLAMO_IRQ_2D = (1 << GLAMO_IRQIDX_2D),
++ GLAMO_IRQ_MMC = (1 << GLAMO_IRQIDX_MMC),
++ GLAMO_IRQ_RISC = (1 << GLAMO_IRQIDX_RISC),
++};
++
++enum glamo_reg_clock_host {
++ GLAMO_CLOCK_HOST_DG_BCLK = 0x0001,
++ GLAMO_CLOCK_HOST_DG_M0CLK = 0x0004,
++ GLAMO_CLOCK_HOST_RESET = 0x1000,
++};
++
++enum glamo_reg_clock_mem {
++ GLAMO_CLOCK_MEM_DG_M1CLK = 0x0001,
++ GLAMO_CLOCK_MEM_EN_M1CLK = 0x0002,
++ GLAMO_CLOCK_MEM_DG_MOCACLK = 0x0004,
++ GLAMO_CLOCK_MEM_EN_MOCACLK = 0x0008,
++ GLAMO_CLOCK_MEM_RESET = 0x1000,
++ GLAMO_CLOCK_MOCA_RESET = 0x2000,
++};
++
++enum glamo_reg_clock_lcd {
++ GLAMO_CLOCK_LCD_DG_DCLK = 0x0001,
++ GLAMO_CLOCK_LCD_EN_DCLK = 0x0002,
++ GLAMO_CLOCK_LCD_DG_DMCLK = 0x0004,
++ GLAMO_CLOCK_LCD_EN_DMCLK = 0x0008,
++ GLAMO_CLOCK_LCD_EN_DHCLK = 0x0020,
++ GLAMO_CLOCK_LCD_DG_M5CLK = 0x0040,
++ GLAMO_CLOCK_LCD_EN_M5CLK = 0x0080,
++ GLAMO_CLOCK_LCD_RESET = 0x1000,
++};
++
++enum glamo_reg_clock_mmc {
++ GLAMO_CLOCK_MMC_DG_TCLK = 0x0001,
++ GLAMO_CLOCK_MMC_EN_TCLK = 0x0002,
++ GLAMO_CLOCK_MMC_DG_M9CLK = 0x0004,
++ GLAMO_CLOCK_MMC_EN_M9CLK = 0x0008,
++ GLAMO_CLOCK_MMC_RESET = 0x1000,
++};
++
++enum glamo_reg_basic_mmc {
++ /* set to disable CRC error rejection */
++ GLAMO_BASIC_MMC_DISABLE_CRC = 0x0001,
++ /* enable completion interrupt */
++ GLAMO_BASIC_MMC_EN_COMPL_INT = 0x0002,
++ /* stop MMC clock while enforced idle waiting for data from card */
++ GLAMO_BASIC_MMC_NO_CLK_RD_WAIT = 0x0004,
++ /* 0 = 1-bit bus to card, 1 = use 4-bit bus (has to be negotiated) */
++ GLAMO_BASIC_MMC_EN_4BIT_DATA = 0x0008,
++ /* enable 75K pullups on D3..D0 */
++ GLAMO_BASIC_MMC_EN_DATA_PUPS = 0x0010,
++ /* enable 75K pullup on CMD */
++ GLAMO_BASIC_MMC_EN_CMD_PUP = 0x0020,
++ /* IO drive strength 00=weak -> 11=strongest */
++ GLAMO_BASIC_MMC_EN_DR_STR0 = 0x0040,
++ GLAMO_BASIC_MMC_EN_DR_STR1 = 0x0080,
++ /* TCLK delay stage A, 0000 = 500ps --> 1111 = 8ns */
++ GLAMO_BASIC_MMC_EN_TCLK_DLYA0 = 0x0100,
++ GLAMO_BASIC_MMC_EN_TCLK_DLYA1 = 0x0200,
++ GLAMO_BASIC_MMC_EN_TCLK_DLYA2 = 0x0400,
++ GLAMO_BASIC_MMC_EN_TCLK_DLYA3 = 0x0800,
++ /* TCLK delay stage B (cumulative), 0000 = 500ps --> 1111 = 8ns */
++ GLAMO_BASIC_MMC_EN_TCLK_DLYB0 = 0x1000,
++ GLAMO_BASIC_MMC_EN_TCLK_DLYB1 = 0x2000,
++ GLAMO_BASIC_MMC_EN_TCLK_DLYB2 = 0x4000,
++ GLAMO_BASIC_MMC_EN_TCLK_DLYB3 = 0x8000,
++};
++
++enum glamo_reg_stat1_mmc {
++ /* command "counter" (really: toggle) */
++ GLAMO_STAT1_MMC_CMD_CTR = 0x8000,
++ /* engine is idle */
++ GLAMO_STAT1_MMC_IDLE = 0x4000,
++ /* readback response is ready */
++ GLAMO_STAT1_MMC_RB_RRDY = 0x0200,
++ /* readback data is ready */
++ GLAMO_STAT1_MMC_RB_DRDY = 0x0100,
++ /* no response timeout */
++ GLAMO_STAT1_MMC_RTOUT = 0x0020,
++ /* no data timeout */
++ GLAMO_STAT1_MMC_DTOUT = 0x0010,
++ /* CRC error on block write */
++ GLAMO_STAT1_MMC_BWERR = 0x0004,
++ /* CRC error on block read */
++ GLAMO_STAT1_MMC_BRERR = 0x0002
++};
++
++enum glamo_reg_fire_mmc {
++ /* command "counter" (really: toggle)
++ * the STAT1 register reflects this so you can ensure you don't look
++ * at status for previous command
++ */
++ GLAMO_FIRE_MMC_CMD_CTR = 0x8000,
++ /* sets kind of response expected */
++ GLAMO_FIRE_MMC_RES_MASK = 0x0700,
++ /* sets command type */
++ GLAMO_FIRE_MMC_TYP_MASK = 0x00C0,
++ /* sets command class */
++ GLAMO_FIRE_MMC_CLS_MASK = 0x000F,
++};
++
++enum glamo_fire_mmc_response_types {
++ GLAMO_FIRE_MMC_RSPT_R1 = 0x0000,
++ GLAMO_FIRE_MMC_RSPT_R1b = 0x0100,
++ GLAMO_FIRE_MMC_RSPT_R2 = 0x0200,
++ GLAMO_FIRE_MMC_RSPT_R3 = 0x0300,
++ GLAMO_FIRE_MMC_RSPT_R4 = 0x0400,
++ GLAMO_FIRE_MMC_RSPT_R5 = 0x0500,
++};
++
++enum glamo_fire_mmc_command_types {
++ /* broadcast, no response */
++ GLAMO_FIRE_MMC_CMDT_BNR = 0x0000,
++ /* broadcast, with response */
++ GLAMO_FIRE_MMC_CMDT_BR = 0x0040,
++ /* addressed, no data */
++ GLAMO_FIRE_MMC_CMDT_AND = 0x0080,
++ /* addressed, with data */
++ GLAMO_FIRE_MMC_CMDT_AD = 0x00C0,
++};
++
++enum glamo_fire_mmc_command_class {
++ /* "Stream Read" */
++ GLAMO_FIRE_MMC_CC_STRR = 0x0000,
++ /* Single Block Read */
++ GLAMO_FIRE_MMC_CC_SBR = 0x0001,
++ /* Multiple Block Read With Stop */
++ GLAMO_FIRE_MMC_CC_MBRS = 0x0002,
++ /* Multiple Block Read No Stop */
++ GLAMO_FIRE_MMC_CC_MBRNS = 0x0003,
++ /* RESERVED for "Stream Write" */
++ GLAMO_FIRE_MMC_CC_STRW = 0x0004,
++ /* "Stream Write" */
++ GLAMO_FIRE_MMC_CC_SBW = 0x0005,
++ /* RESERVED for Multiple Block Write With Stop */
++ GLAMO_FIRE_MMC_CC_MBWS = 0x0006,
++ /* Multiple Block Write No Stop */
++ GLAMO_FIRE_MMC_CC_MBWNS = 0x0007,
++ /* STOP command */
++ GLAMO_FIRE_MMC_CC_STOP = 0x0008,
++ /* Cancel on Running Command */
++ GLAMO_FIRE_MMC_CC_CANCL = 0x0009,
++ /* "Basic Command" */
++ GLAMO_FIRE_MMC_CC_BASIC = 0x000a,
++};
++
++/* these are offsets from the start of the MMC register region */
++enum glamo_register_mmc {
++ /* MMC command, b15..8 = cmd arg b7..0; b7..1 = CRC; b0 = end bit */
++ GLAMO_REG_MMC_CMD_REG1 = 0x00,
++ /* MMC command, b15..0 = cmd arg b23 .. 8 */
++ GLAMO_REG_MMC_CMD_REG2 = 0x02,
++ /* MMC command, b15=start, b14=transmission,
++ * b13..8=cmd idx, b7..0=cmd arg b31..24
++ */
++ GLAMO_REG_MMC_CMD_REG3 = 0x04,
++ GLAMO_REG_MMC_CMD_FIRE = 0x06,
++ GLAMO_REG_MMC_CMD_RSP1 = 0x10,
++ GLAMO_REG_MMC_CMD_RSP2 = 0x12,
++ GLAMO_REG_MMC_CMD_RSP3 = 0x14,
++ GLAMO_REG_MMC_CMD_RSP4 = 0x16,
++ GLAMO_REG_MMC_CMD_RSP5 = 0x18,
++ GLAMO_REG_MMC_CMD_RSP6 = 0x1a,
++ GLAMO_REG_MMC_CMD_RSP7 = 0x1c,
++ GLAMO_REG_MMC_CMD_RSP8 = 0x1e,
++ GLAMO_REG_MMC_RB_STAT1 = 0x20,
++ GLAMO_REG_MMC_RB_BLKCNT = 0x22,
++ GLAMO_REG_MMC_RB_BLKLEN = 0x24,
++ GLAMO_REG_MMC_BASIC = 0x30,
++ GLAMO_REG_MMC_RDATADS1 = 0x34,
++ GLAMO_REG_MMC_RDATADS2 = 0x36,
++ GLAMO_REG_MMC_WDATADS1 = 0x38,
++ GLAMO_REG_MMC_WDATADS2 = 0x3a,
++ GLAMO_REG_MMC_DATBLKCNT = 0x3c,
++ GLAMO_REG_MMC_DATBLKLEN = 0x3e,
++ GLAMO_REG_MMC_TIMEOUT = 0x40,
++
++};
++
++enum glamo_reg_clock_isp {
++ GLAMO_CLOCK_ISP_DG_I1CLK = 0x0001,
++ GLAMO_CLOCK_ISP_EN_I1CLK = 0x0002,
++ GLAMO_CLOCK_ISP_DG_CCLK = 0x0004,
++ GLAMO_CLOCK_ISP_EN_CCLK = 0x0008,
++ GLAMO_CLOCK_ISP_EN_SCLK = 0x0020,
++ GLAMO_CLOCK_ISP_DG_M2CLK = 0x0040,
++ GLAMO_CLOCK_ISP_EN_M2CLK = 0x0080,
++ GLAMO_CLOCK_ISP_DG_M15CLK = 0x0100,
++ GLAMO_CLOCK_ISP_EN_M15CLK = 0x0200,
++ GLAMO_CLOCK_ISP1_RESET = 0x1000,
++ GLAMO_CLOCK_ISP2_RESET = 0x2000,
++};
++
++enum glamo_reg_clock_jpeg {
++ GLAMO_CLOCK_JPEG_DG_JCLK = 0x0001,
++ GLAMO_CLOCK_JPEG_EN_JCLK = 0x0002,
++ GLAMO_CLOCK_JPEG_DG_M3CLK = 0x0004,
++ GLAMO_CLOCK_JPEG_EN_M3CLK = 0x0008,
++ GLAMO_CLOCK_JPEG_RESET = 0x1000,
++};
++
++enum glamo_reg_clock_2d {
++ GLAMO_CLOCK_2D_DG_GCLK = 0x0001,
++ GLAMO_CLOCK_2D_EN_GCLK = 0x0002,
++ GLAMO_CLOCK_2D_DG_M7CLK = 0x0004,
++ GLAMO_CLOCK_2D_EN_M7CLK = 0x0008,
++ GLAMO_CLOCK_2D_DG_M6CLK = 0x0010,
++ GLAMO_CLOCK_2D_EN_M6CLK = 0x0020,
++ GLAMO_CLOCK_2D_RESET = 0x1000,
++ GLAMO_CLOCK_2D_CQ_RESET = 0x2000,
++};
++
++enum glamo_reg_clock_3d {
++ GLAMO_CLOCK_3D_DG_ECLK = 0x0001,
++ GLAMO_CLOCK_3D_EN_ECLK = 0x0002,
++ GLAMO_CLOCK_3D_DG_RCLK = 0x0004,
++ GLAMO_CLOCK_3D_EN_RCLK = 0x0008,
++ GLAMO_CLOCK_3D_DG_M8CLK = 0x0010,
++ GLAMO_CLOCK_3D_EN_M8CLK = 0x0020,
++ GLAMO_CLOCK_3D_BACK_RESET = 0x1000,
++ GLAMO_CLOCK_3D_FRONT_RESET = 0x2000,
++};
++
++enum glamo_reg_clock_mpeg {
++ GLAMO_CLOCK_MPEG_DG_X0CLK = 0x0001,
++ GLAMO_CLOCK_MPEG_EN_X0CLK = 0x0002,
++ GLAMO_CLOCK_MPEG_DG_X1CLK = 0x0004,
++ GLAMO_CLOCK_MPEG_EN_X1CLK = 0x0008,
++ GLAMO_CLOCK_MPEG_DG_X2CLK = 0x0010,
++ GLAMO_CLOCK_MPEG_EN_X2CLK = 0x0020,
++ GLAMO_CLOCK_MPEG_DG_X3CLK = 0x0040,
++ GLAMO_CLOCK_MPEG_EN_X3CLK = 0x0080,
++ GLAMO_CLOCK_MPEG_DG_X4CLK = 0x0100,
++ GLAMO_CLOCK_MPEG_EN_X4CLK = 0x0200,
++ GLAMO_CLOCK_MPEG_DG_X6CLK = 0x0400,
++ GLAMO_CLOCK_MPEG_EN_X6CLK = 0x0800,
++ GLAMO_CLOCK_MPEG_ENC_RESET = 0x1000,
++ GLAMO_CLOCK_MPEG_DEC_RESET = 0x2000,
++};
++
++enum glamo_reg_clock51 {
++ GLAMO_CLOCK_GEN51_EN_DIV_MCLK = 0x0001,
++ GLAMO_CLOCK_GEN51_EN_DIV_SCLK = 0x0002,
++ GLAMO_CLOCK_GEN51_EN_DIV_JCLK = 0x0004,
++ GLAMO_CLOCK_GEN51_EN_DIV_DCLK = 0x0008,
++ GLAMO_CLOCK_GEN51_EN_DIV_DMCLK = 0x0010,
++ GLAMO_CLOCK_GEN51_EN_DIV_DHCLK = 0x0020,
++ GLAMO_CLOCK_GEN51_EN_DIV_GCLK = 0x0040,
++ GLAMO_CLOCK_GEN51_EN_DIV_TCLK = 0x0080,
++ /* FIXME: higher bits */
++};
++
++enum glamo_reg_hostbus2 {
++ GLAMO_HOSTBUS2_MMIO_EN_ISP = 0x0001,
++ GLAMO_HOSTBUS2_MMIO_EN_JPEG = 0x0002,
++ GLAMO_HOSTBUS2_MMIO_EN_MPEG = 0x0004,
++ GLAMO_HOSTBUS2_MMIO_EN_LCD = 0x0008,
++ GLAMO_HOSTBUS2_MMIO_EN_MMC = 0x0010,
++ GLAMO_HOSTBUS2_MMIO_EN_MICROP0 = 0x0020,
++ GLAMO_HOSTBUS2_MMIO_EN_MICROP1 = 0x0040,
++ GLAMO_HOSTBUS2_MMIO_EN_CQ = 0x0080,
++ GLAMO_HOSTBUS2_MMIO_EN_RISC = 0x0100,
++ GLAMO_HOSTBUS2_MMIO_EN_2D = 0x0200,
++ GLAMO_HOSTBUS2_MMIO_EN_3D = 0x0400,
++};
++
++/* LCD Controller */
++
++#define REG_LCD(x) (x)
++enum glamo_reg_lcd {
++ GLAMO_REG_LCD_MODE1 = REG_LCD(0x00),
++ GLAMO_REG_LCD_MODE2 = REG_LCD(0x02),
++ GLAMO_REG_LCD_MODE3 = REG_LCD(0x04),
++ GLAMO_REG_LCD_WIDTH = REG_LCD(0x06),
++ GLAMO_REG_LCD_HEIGHT = REG_LCD(0x08),
++ GLAMO_REG_LCD_POLARITY = REG_LCD(0x0a),
++ GLAMO_REG_LCD_A_BASE1 = REG_LCD(0x0c),
++ GLAMO_REG_LCD_A_BASE2 = REG_LCD(0x0e),
++ GLAMO_REG_LCD_B_BASE1 = REG_LCD(0x10),
++ GLAMO_REG_LCD_B_BASE2 = REG_LCD(0x12),
++ GLAMO_REG_LCD_C_BASE1 = REG_LCD(0x14),
++ GLAMO_REG_LCD_C_BASE2 = REG_LCD(0x16),
++ GLAMO_REG_LCD_PITCH = REG_LCD(0x18),
++ /* RES */
++ GLAMO_REG_LCD_HORIZ_TOTAL = REG_LCD(0x1c),
++ /* RES */
++ GLAMO_REG_LCD_HORIZ_RETR_START = REG_LCD(0x20),
++ /* RES */
++ GLAMO_REG_LCD_HORIZ_RETR_END = REG_LCD(0x24),
++ /* RES */
++ GLAMO_REG_LCD_HORIZ_DISP_START = REG_LCD(0x28),
++ /* RES */
++ GLAMO_REG_LCD_HORIZ_DISP_END = REG_LCD(0x2c),
++ /* RES */
++ GLAMO_REG_LCD_VERT_TOTAL = REG_LCD(0x30),
++ /* RES */
++ GLAMO_REG_LCD_VERT_RETR_START = REG_LCD(0x34),
++ /* RES */
++ GLAMO_REG_LCD_VERT_RETR_END = REG_LCD(0x38),
++ /* RES */
++ GLAMO_REG_LCD_VERT_DISP_START = REG_LCD(0x3c),
++ /* RES */
++ GLAMO_REG_LCD_VERT_DISP_END = REG_LCD(0x40),
++ /* RES */
++ GLAMO_REG_LCD_POL = REG_LCD(0x44),
++ GLAMO_REG_LCD_DATA_START = REG_LCD(0x46),
++ GLAMO_REG_LCD_FRATE_CONTRO = REG_LCD(0x48),
++ GLAMO_REG_LCD_DATA_CMD_HDR = REG_LCD(0x4a),
++ GLAMO_REG_LCD_SP_START = REG_LCD(0x4c),
++ GLAMO_REG_LCD_SP_END = REG_LCD(0x4e),
++ GLAMO_REG_LCD_CURSOR_BASE1 = REG_LCD(0x50),
++ GLAMO_REG_LCD_CURSOR_BASE2 = REG_LCD(0x52),
++ GLAMO_REG_LCD_CURSOR_PITCH = REG_LCD(0x54),
++ GLAMO_REG_LCD_CURSOR_X_SIZE = REG_LCD(0x56),
++ GLAMO_REG_LCD_CURSOR_Y_SIZE = REG_LCD(0x58),
++ GLAMO_REG_LCD_CURSOR_X_POS = REG_LCD(0x5a),
++ GLAMO_REG_LCD_CURSOR_Y_POS = REG_LCD(0x5c),
++ GLAMO_REG_LCD_CURSOR_PRESET = REG_LCD(0x5e),
++ GLAMO_REG_LCD_CURSOR_FG_COLOR = REG_LCD(0x60),
++ /* RES */
++ GLAMO_REG_LCD_CURSOR_BG_COLOR = REG_LCD(0x64),
++ /* RES */
++ GLAMO_REG_LCD_CURSOR_DST_COLOR = REG_LCD(0x68),
++ /* RES */
++ GLAMO_REG_LCD_STATUS1 = REG_LCD(0x80),
++ GLAMO_REG_LCD_STATUS2 = REG_LCD(0x82),
++ GLAMO_REG_LCD_STATUS3 = REG_LCD(0x84),
++ GLAMO_REG_LCD_STATUS4 = REG_LCD(0x86),
++ /* RES */
++ GLAMO_REG_LCD_COMMAND1 = REG_LCD(0xa0),
++ GLAMO_REG_LCD_COMMAND2 = REG_LCD(0xa2),
++ /* RES */
++ GLAMO_REG_LCD_WFORM_DELAY1 = REG_LCD(0xb0),
++ GLAMO_REG_LCD_WFORM_DELAY2 = REG_LCD(0xb2),
++ /* RES */
++ GLAMO_REG_LCD_GAMMA_CORR = REG_LCD(0x100),
++ /* RES */
++ GLAMO_REG_LCD_GAMMA_R_ENTRY01 = REG_LCD(0x110),
++ GLAMO_REG_LCD_GAMMA_R_ENTRY23 = REG_LCD(0x112),
++ GLAMO_REG_LCD_GAMMA_R_ENTRY45 = REG_LCD(0x114),
++ GLAMO_REG_LCD_GAMMA_R_ENTRY67 = REG_LCD(0x116),
++ GLAMO_REG_LCD_GAMMA_R_ENTRY8 = REG_LCD(0x118),
++ /* RES */
++ GLAMO_REG_LCD_GAMMA_G_ENTRY01 = REG_LCD(0x130),
++ GLAMO_REG_LCD_GAMMA_G_ENTRY23 = REG_LCD(0x132),
++ GLAMO_REG_LCD_GAMMA_G_ENTRY45 = REG_LCD(0x134),
++ GLAMO_REG_LCD_GAMMA_G_ENTRY67 = REG_LCD(0x136),
++ GLAMO_REG_LCD_GAMMA_G_ENTRY8 = REG_LCD(0x138),
++ /* RES */
++ GLAMO_REG_LCD_GAMMA_B_ENTRY01 = REG_LCD(0x150),
++ GLAMO_REG_LCD_GAMMA_B_ENTRY23 = REG_LCD(0x152),
++ GLAMO_REG_LCD_GAMMA_B_ENTRY45 = REG_LCD(0x154),
++ GLAMO_REG_LCD_GAMMA_B_ENTRY67 = REG_LCD(0x156),
++ GLAMO_REG_LCD_GAMMA_B_ENTRY8 = REG_LCD(0x158),
++ /* RES */
++ GLAMO_REG_LCD_SRAM_DRIVING1 = REG_LCD(0x160),
++ GLAMO_REG_LCD_SRAM_DRIVING2 = REG_LCD(0x162),
++ GLAMO_REG_LCD_SRAM_DRIVING3 = REG_LCD(0x164),
++};
++
++enum glamo_reg_lcd_mode1 {
++ GLAMO_LCD_MODE1_PWRSAVE = 0x0001,
++ GLAMO_LCD_MODE1_PARTIAL_PRT = 0x0002,
++ GLAMO_LCD_MODE1_HWFLIP = 0x0004,
++ GLAMO_LCD_MODE1_LCD2 = 0x0008,
++ /* RES */
++ GLAMO_LCD_MODE1_PARTIAL_MODE = 0x0020,
++ GLAMO_LCD_MODE1_CURSOR_DSTCOLOR = 0x0040,
++ GLAMO_LCD_MODE1_PARTIAL_ENABLE = 0x0080,
++ GLAMO_LCD_MODE1_TVCLK_IN_ENABLE = 0x0100,
++ GLAMO_LCD_MODE1_HSYNC_HIGH_ACT = 0x0200,
++ GLAMO_LCD_MODE1_VSYNC_HIGH_ACT = 0x0400,
++ GLAMO_LCD_MODE1_HSYNC_FLIP = 0x0800,
++ GLAMO_LCD_MODE1_GAMMA_COR_EN = 0x1000,
++ GLAMO_LCD_MODE1_DITHER_EN = 0x2000,
++ GLAMO_LCD_MODE1_CURSOR_EN = 0x4000,
++ GLAMO_LCD_MODE1_ROTATE_EN = 0x8000,
++};
++
++enum glamo_reg_lcd_mode2 {
++ GLAMO_LCD_MODE2_CRC_CHECK_EN = 0x0001,
++ GLAMO_LCD_MODE2_DCMD_PER_LINE = 0x0002,
++ GLAMO_LCD_MODE2_NOUSE_BDEF = 0x0004,
++ GLAMO_LCD_MODE2_OUT_POS_MODE = 0x0008,
++ GLAMO_LCD_MODE2_FRATE_CTRL_EN = 0x0010,
++ GLAMO_LCD_MODE2_SINGLE_BUFFER = 0x0020,
++ GLAMO_LCD_MODE2_SER_LSB_TO_MSB = 0x0040,
++ /* FIXME */
++};
++
++enum glamo_reg_lcd_mode3 {
++ /* LCD color source data format */
++ GLAMO_LCD_SRC_RGB565 = 0x0000,
++ GLAMO_LCD_SRC_ARGB1555 = 0x4000,
++ GLAMO_LCD_SRC_ARGB4444 = 0x8000,
++ /* interface type */
++ GLAMO_LCD_MODE3_LCD = 0x1000,
++ GLAMO_LCD_MODE3_RGB = 0x0800,
++ GLAMO_LCD_MODE3_CPU = 0x0000,
++ /* mode */
++ GLAMO_LCD_MODE3_RGB332 = 0x0000,
++ GLAMO_LCD_MODE3_RGB444 = 0x0100,
++ GLAMO_LCD_MODE3_RGB565 = 0x0200,
++ GLAMO_LCD_MODE3_RGB666 = 0x0300,
++ /* depth */
++ GLAMO_LCD_MODE3_6BITS = 0x0000,
++ GLAMO_LCD_MODE3_8BITS = 0x0010,
++ GLAMO_LCD_MODE3_9BITS = 0x0020,
++ GLAMO_LCD_MODE3_16BITS = 0x0030,
++ GLAMO_LCD_MODE3_18BITS = 0x0040,
++};
++
++enum glamo_lcd_rot_mode {
++ GLAMO_LCD_ROT_MODE_0 = 0x0000,
++ GLAMO_LCD_ROT_MODE_180 = 0x2000,
++ GLAMO_LCD_ROT_MODE_MIRROR = 0x4000,
++ GLAMO_LCD_ROT_MODE_FLIP = 0x6000,
++ GLAMO_LCD_ROT_MODE_90 = 0x8000,
++ GLAMO_LCD_ROT_MODE_270 = 0xa000,
++};
++#define GLAMO_LCD_ROT_MODE_MASK 0xe000
++
++enum glamo_lcd_cmd_type {
++ GLAMO_LCD_CMD_TYPE_DISP = 0x0000,
++ GLAMO_LCD_CMD_TYPE_PARALLEL = 0x4000,
++ GLAMO_LCD_CMD_TYPE_SERIAL = 0x8000,
++ GLAMO_LCD_CMD_TYPE_SERIAL_DIRECT = 0xc000,
++};
++#define GLAMO_LCD_CMD_TYPE_MASK 0xc000
++
++enum glamo_lcd_cmds {
++ GLAMO_LCD_CMD_DATA_DISP_FIRE = 0x00,
++ GLAMO_LCD_CMD_DATA_DISP_SYNC = 0x01, /* RGB only */
++ /* switch to command mode, no display */
++ GLAMO_LCD_CMD_DATA_FIRE_NO_DISP = 0x02,
++ /* display until VSYNC, switch to command */
++ GLAMO_LCD_CMD_DATA_FIRE_VSYNC = 0x11,
++ /* display until HSYNC, switch to command */
++ GLAMO_LCD_CMD_DATA_FIRE_HSYNC = 0x12,
++ /* display until VSYNC, 1 black frame, VSYNC, switch to command */
++ GLAMO_LCD_CMD_DATA_FIRE_VSYNC_B = 0x13,
++ /* don't care about display and switch to command */
++ GLAMO_LCD_CMD_DATA_FIRE_FREE = 0x14, /* RGB only */
++ /* don't care about display, keep data display but disable data,
++ * and switch to command */
++ GLAMO_LCD_CMD_DATA_FIRE_FREE_D = 0x15, /* RGB only */
++};
++
++enum glamo_core_revisions {
++ GLAMO_CORE_REV_A0 = 0x0000,
++ GLAMO_CORE_REV_A1 = 0x0001,
++ GLAMO_CORE_REV_A2 = 0x0002,
++ GLAMO_CORE_REV_A3 = 0x0003,
++};
++
++#endif /* _GLAMO_REGS_H */
+diff --git a/include/linux/mfd/glamo.h b/include/linux/mfd/glamo.h
+new file mode 100644
+index 0000000..b8dfaef
+--- /dev/null
++++ b/include/linux/mfd/glamo.h
+@@ -0,0 +1,53 @@
++#ifndef __GLAMO_MFD_H
++#define __GLAMO_MFD_H
++
++struct glamo_core;
++struct glamo_spigpio_platform_data;
++struct glamo_fb_platform_data;
++
++struct glamo_mmc_platform_data {
++ int (*glamo_mmc_use_slow)(void);
++
++ unsigned nonremovable:1;
++
++ struct glamo_core *core;
++};
++
++struct glamo_gpio_platform_data {
++ int base;
++};
++
++struct glamo_platform_data {
++ struct glamo_fb_platform_data *fb_data;
++ struct glamo_mmc_platform_data *mmc_data;
++ struct glamo_gpio_platform_data *gpio_data;
++
++ unsigned int osci_clock_rate;
++
++ void (*glamo_external_reset)(int);
++};
++
++enum glamo_engine {
++ GLAMO_ENGINE_CAPTURE = 0,
++ GLAMO_ENGINE_ISP = 1,
++ GLAMO_ENGINE_JPEG = 2,
++ GLAMO_ENGINE_MPEG_ENC = 3,
++ GLAMO_ENGINE_MPEG_DEC = 4,
++ GLAMO_ENGINE_LCD = 5,
++ GLAMO_ENGINE_CMDQ = 6,
++ GLAMO_ENGINE_2D = 7,
++ GLAMO_ENGINE_3D = 8,
++ GLAMO_ENGINE_MMC = 9,
++ GLAMO_ENGINE_MICROP0 = 10,
++ GLAMO_ENGINE_RISC = 11,
++ GLAMO_ENGINE_MICROP1_MPEG_ENC = 12,
++ GLAMO_ENGINE_MICROP1_MPEG_DEC = 13,
++#if 0
++ GLAMO_ENGINE_H264_DEC = 14,
++ GLAMO_ENGINE_RISC1 = 15,
++ GLAMO_ENGINE_SPI = 16,
++#endif
++ __NUM_GLAMO_ENGINES
++};
++
++#endif
+diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h
+index 50d4a04..bec3cb7 100644
+--- a/include/linux/mfd/pcf50633/core.h
++++ b/include/linux/mfd/pcf50633/core.h
+@@ -1,4 +1,5 @@
+ /*
++
+ * core.h -- Core driver for NXP PCF50633
+ *
+ * (C) 2006-2008 by Openmoko, Inc.
+@@ -14,7 +15,6 @@
+ #define __LINUX_MFD_PCF50633_CORE_H
+
+ #include <linux/i2c.h>
+-#include <linux/workqueue.h>
+ #include <linux/regulator/driver.h>
+ #include <linux/regulator/machine.h>
+ #include <linux/power_supply.h>
+@@ -46,21 +46,10 @@ struct pcf50633_platform_data {
+ u8 resumers[5];
+
+ struct pcf50633_bl_platform_data *backlight_data;
+-};
+
+-struct pcf50633_irq {
+- void (*handler) (int, void *);
+- void *data;
++ int gpio_base;
+ };
+
+-int pcf50633_register_irq(struct pcf50633 *pcf, int irq,
+- void (*handler) (int, void *), void *data);
+-int pcf50633_free_irq(struct pcf50633 *pcf, int irq);
+-
+-int pcf50633_irq_mask(struct pcf50633 *pcf, int irq);
+-int pcf50633_irq_unmask(struct pcf50633 *pcf, int irq);
+-int pcf50633_irq_mask_get(struct pcf50633 *pcf, int irq);
+-
+ int pcf50633_read_block(struct pcf50633 *, u8 reg,
+ int nr_regs, u8 *data);
+ int pcf50633_write_block(struct pcf50633 *pcf, u8 reg,
+@@ -138,12 +127,11 @@ struct pcf50633 {
+
+ struct pcf50633_platform_data *pdata;
+ int irq;
+- struct pcf50633_irq irq_handler[PCF50633_NUM_IRQ];
+- struct work_struct irq_work;
+- struct workqueue_struct *work_queue;
+ struct mutex lock;
++ struct mutex irq_lock;
+
+ u8 mask_regs[5];
++ u8 mask_regs_cur[5];
+
+ u8 suspend_irq_masks[5];
+ u8 resume_reason[5];
+@@ -151,12 +139,11 @@ struct pcf50633 {
+
+ int onkey1s_held;
+
+- struct platform_device *rtc_pdev;
+- struct platform_device *mbc_pdev;
+- struct platform_device *adc_pdev;
+- struct platform_device *input_pdev;
+- struct platform_device *bl_pdev;
+- struct platform_device *regulator_pdev[PCF50633_NUM_REGULATORS];
++ unsigned int irq_base;
++
++ struct pcf50633_mbc *mbc;
++ struct pcf50633_adc *adc;
++ struct pcf50633_bl *bl;
+ };
+
+ enum pcf50633_reg_int1 {
+diff --git a/include/linux/mfd/pcf50633/gpio.h b/include/linux/mfd/pcf50633/gpio.h
+index a42b845..af2c341 100644
+--- a/include/linux/mfd/pcf50633/gpio.h
++++ b/include/linux/mfd/pcf50633/gpio.h
+@@ -15,37 +15,40 @@
+
+ #include <linux/mfd/pcf50633/core.h>
+
+-#define PCF50633_GPIO1 1
+-#define PCF50633_GPIO2 2
+-#define PCF50633_GPIO3 3
+-#define PCF50633_GPO 4
+-
+-#define PCF50633_REG_GPIO1CFG 0x14
+-#define PCF50633_REG_GPIO2CFG 0x15
+-#define PCF50633_REG_GPIO3CFG 0x16
+-#define PCF50633_REG_GPOCFG 0x17
+-
+-#define PCF50633_GPOCFG_GPOSEL_MASK 0x07
+-
+-enum pcf50633_reg_gpocfg {
+- PCF50633_GPOCFG_GPOSEL_0 = 0x00,
+- PCF50633_GPOCFG_GPOSEL_LED_NFET = 0x01,
+- PCF50633_GPOCFG_GPOSEL_SYSxOK = 0x02,
+- PCF50633_GPOCFG_GPOSEL_CLK32K = 0x03,
+- PCF50633_GPOCFG_GPOSEL_ADAPUSB = 0x04,
+- PCF50633_GPOCFG_GPOSEL_USBxOK = 0x05,
+- PCF50633_GPOCFG_GPOSEL_ACTPH4 = 0x06,
+- PCF50633_GPOCFG_GPOSEL_1 = 0x07,
+- PCF50633_GPOCFG_GPOSEL_INVERSE = 0x08,
++#define PCF50633_GPIO1 0
++#define PCF50633_GPIO2 1
++#define PCF50633_GPIO3 2
++#define PCF50633_GPO 3
++
++#define PCF50633_REG_GPIOCFG(x) (0x14 + (x))
++
++enum pcf50633_gpio_config {
++ PCF50633_GPIO_CONFIG_OUTPUT = 0x0,
++ PCF50633_GPIO_CONFIG_SYSxOK = 0x2,
++ PCF50633_GPIO_CONFIG_CHARGING = 0x3,
++ PCF50633_GPIO_CONFIG_MOBILE_MODE = 0x4,
++ PCF50633_GPIO_CONFIG_USBxOK = 0x5,
++ PCF50633_GPIO_CONFIG_ACTPH = 0x6,
++ PCF50633_GPIO_CONFIG_INPUT = 0x7,
++
++ PCF50633_GPIO_CONFIG_INVERT = 0x8,
++
++ PCF50633_GPO_CONFIG_OUTPUT = 0x0,
++ PCF50633_GPO_CONFIG_LED_NFET = 0x1,
++ PCF50633_GPO_CONFIG_SYSxOK = 0x2,
++ PCF50633_GPO_CONFIG_CLK32K = 0x3,
++ PCF50633_GPO_CONFIG_MOBILE_MODE = 0x4,
++ PCF50633_GPO_CONFIG_USBxOK = 0x5,
++ PCF50633_GPO_CONFIG_ACTPH = 0x6,
++ PCF50633_GPO_CONFIG_INPUT = 0x7,
++
++ PCF50633_GPO_CONFIG_INVERT = 0x8,
+ };
+
+-int pcf50633_gpio_set(struct pcf50633 *pcf, int gpio, u8 val);
+-u8 pcf50633_gpio_get(struct pcf50633 *pcf, int gpio);
++int pcf50633_gpio_set_config(struct pcf50633 *pcf, unsigned gpio,
++ enum pcf50633_gpio_config config);
+
+-int pcf50633_gpio_invert_set(struct pcf50633 *, int gpio, int invert);
+-int pcf50633_gpio_invert_get(struct pcf50633 *pcf, int gpio);
+-
+-int pcf50633_gpio_power_supply_set(struct pcf50633 *,
++int pcf50633_gpio_power_supply_set(struct pcf50633 *pcf,
+ int gpio, int regulator, int on);
+ #endif /* __LINUX_MFD_PCF50633_GPIO_H */
+
+diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
+index 07f27af..5bbfb71 100644
+--- a/include/linux/mmc/core.h
++++ b/include/linux/mmc/core.h
+@@ -117,6 +117,7 @@ struct mmc_data {
+
+ unsigned int sg_len; /* size of scatter list */
+ struct scatterlist *sg; /* I/O scatter list */
++ s32 host_cookie; /* host private data */
+ };
+
+ struct mmc_request {
+@@ -124,13 +125,19 @@ struct mmc_request {
+ struct mmc_data *data;
+ struct mmc_command *stop;
+
+- void *done_data; /* completion data */
++ struct completion completion;
+ void (*done)(struct mmc_request *);/* completion function */
+ };
+
+ struct mmc_host;
+ struct mmc_card;
+
++extern void mmc_pre_req(struct mmc_host *host, struct mmc_request *mrq,
++ bool is_first_req);
++extern void mmc_post_req(struct mmc_host *host, struct mmc_request *mrq,
++ int err);
++extern void mmc_start_req(struct mmc_host *host, struct mmc_request *mrq);
++extern void mmc_wait_for_req_done(struct mmc_request *mrq);
+ extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *);
+ extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);
+ extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *,
+diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
+index bcb793e..8b2b44b 100644
+--- a/include/linux/mmc/host.h
++++ b/include/linux/mmc/host.h
+@@ -88,6 +88,15 @@ struct mmc_host_ops {
+ */
+ int (*enable)(struct mmc_host *host);
+ int (*disable)(struct mmc_host *host, int lazy);
++ /*
++ * It is optional for the host to implement pre_req and post_req in
++ * order to support double buffering of requests (prepare one
++ * request while another request is active).
++ */
++ void (*post_req)(struct mmc_host *host, struct mmc_request *req,
++ int err);
++ void (*pre_req)(struct mmc_host *host, struct mmc_request *req,
++ bool is_first_req);
+ void (*request)(struct mmc_host *host, struct mmc_request *req);
+ /*
+ * Avoid calling these three functions too often or in a "fast path",
+@@ -242,7 +251,9 @@ struct mmc_host {
+ #endif
+
+ struct dentry *debugfs_root;
+-
++#ifdef CONFIG_FAIL_MMC_REQUEST
++ u8 make_it_fail;
++#endif
+ unsigned long private[0] ____cacheline_aligned;
+ };
+
+diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h
+index a36ab3b..c2bb43b 100644
+--- a/include/linux/mmc/sdio_ids.h
++++ b/include/linux/mmc/sdio_ids.h
+@@ -44,4 +44,9 @@
+ #define SDIO_DEVICE_ID_SIANO_NOVA_A0 0x1100
+ #define SDIO_DEVICE_ID_SIANO_STELLAR 0x5347
+
++#define SDIO_DEVICE_ID_MARVELL_88W8688 0x9104
++#define SDIO_VENDOR_ID_ATHEROS 0x0271
++#define SDIO_DEVICE_ID_ATHEROS_AR6001 0x0100
++#define SDIO_DEVICE_ID_ATHEROS_AR6002 0x0200
++
+ #endif
+diff --git a/include/linux/platform_battery.h b/include/linux/platform_battery.h
+new file mode 100644
+index 0000000..00f7651
+--- /dev/null
++++ b/include/linux/platform_battery.h
+@@ -0,0 +1,12 @@
++#ifndef __PLATFORM_BATTERY_H__
++#define __PLATFORM_BATTERY_H__
++
++struct platform_bat_platform_data {
++ const char *name;
++ int (**get_property)(void);
++ int (*is_present)(void);
++ enum power_supply_property *properties;
++ size_t num_properties;
++};
++
++#endif
+diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
+index c768bcd..330fc70 100644
+--- a/lib/Kconfig.debug
++++ b/lib/Kconfig.debug
+@@ -1057,6 +1057,17 @@ config FAIL_IO_TIMEOUT
+ Only works with drivers that use the generic timeout handling,
+ for others it wont do anything.
+
++config FAIL_MMC_REQUEST
++ bool "Fault-injection capability for MMC IO"
++ select DEBUG_FS
++ depends on FAULT_INJECTION
++ help
++ Provide fault-injection capability for MMC IO.
++ This will make the mmc core return data errors. This is
++ useful for testing the error handling in the mmc block device
++ and how the mmc host driver handle retries from
++ the block device.
++
+ config FAULT_INJECTION_DEBUG_FS
+ bool "Debugfs entries for fault-injection capabilities"
+ depends on FAULT_INJECTION && SYSFS && DEBUG_FS
+diff --git a/sound/soc/samsung/neo1973_wm8753.c b/sound/soc/samsung/neo1973_wm8753.c
+index 4522309..4f845fe 100644
+--- a/sound/soc/samsung/neo1973_wm8753.c
++++ b/sound/soc/samsung/neo1973_wm8753.c
+@@ -27,6 +27,9 @@
+ #include "../codecs/wm8753.h"
+ #include "s3c24xx-i2s.h"
+
++/* HACK */
++#define machine_is_neo1973_gta01() (0)
++
+ static int neo1973_hifi_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params)
+ {
diff --git a/recipes/linux/linux-2.6.39/poodle/defconfig b/recipes/linux/linux-2.6.39/poodle/defconfig
new file mode 100644
index 0000000000..94c8702fcb
--- /dev/null
+++ b/recipes/linux/linux-2.6.39/poodle/defconfig
@@ -0,0 +1,380 @@
+CONFIG_EXPERIMENTAL=y
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SYSVIPC=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
+CONFIG_IKCONFIG=m
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_RD_BZIP2=y
+CONFIG_RD_LZMA=y
+CONFIG_RD_LZO=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_EMBEDDED=y
+CONFIG_SLOB=y
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=m
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+# CONFIG_LBDAF is not set
+CONFIG_IOSCHED_DEADLINE=m
+CONFIG_IOSCHED_CFQ=m
+CONFIG_ARCH_PXA=y
+CONFIG_PXA_SHARPSL=y
+CONFIG_PXA_SHARPSL_DETECT_MACH_ID=y
+CONFIG_MACH_POODLE=y
+CONFIG_PCCARD=y
+CONFIG_PCMCIA_PXA2XX=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="console=ttyS0,115200n8 console=tty1 fbcon=rotate:1 quiet"
+CONFIG_KEXEC=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_BINFMT_AOUT=m
+CONFIG_BINFMT_MISC=m
+CONFIG_PM_RUNTIME=y
+CONFIG_APM_EMULATION=y
+CONFIG_NET=y
+CONFIG_PACKET=m
+CONFIG_UNIX=y
+CONFIG_XFRM_USER=m
+CONFIG_INET=y
+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_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+CONFIG_IPV6_TUNNEL=m
+CONFIG_NETFILTER=y
+CONFIG_NF_CONNTRACK=m
+CONFIG_NF_CONNTRACK_FTP=m
+CONFIG_NF_CONNTRACK_H323=m
+CONFIG_NF_CONNTRACK_IRC=m
+CONFIG_NF_CONNTRACK_SIP=m
+CONFIG_NF_CONNTRACK_IPV4=m
+CONFIG_IP_NF_IPTABLES=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_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+CONFIG_IRDA=m
+CONFIG_IRLAN=m
+CONFIG_IRNET=m
+CONFIG_IRCOMM=m
+CONFIG_PXA_FICP=m
+CONFIG_BT=m
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=m
+CONFIG_BT_HCIBTUSB=m
+CONFIG_BT_HCIBTSDIO=m
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIUART_ATH3K=y
+CONFIG_BT_HCIUART_LL=y
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBPA10X=m
+CONFIG_BT_HCIBFUSB=m
+CONFIG_BT_HCIDTL1=m
+CONFIG_BT_HCIBT3C=m
+CONFIG_BT_HCIBLUECARD=m
+CONFIG_BT_HCIBTUART=m
+CONFIG_BT_HCIVHCI=m
+CONFIG_BT_MRVL=m
+CONFIG_BT_MRVL_SDIO=m
+CONFIG_BT_ATH3K=m
+CONFIG_CFG80211=m
+# CONFIG_CFG80211_DEFAULT_PS is not set
+CONFIG_MAC80211=m
+# CONFIG_MAC80211_RC_MINSTREL is not set
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_MTD=y
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_ROM=y
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_VERIFY_WRITE=y
+CONFIG_MTD_NAND_SHARPSL=y
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_GLUEBI=m
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_MISC_DEVICES=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_BLK_DEV_SR=m
+CONFIG_CHR_DEV_SG=m
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_ATA=y
+CONFIG_PATA_PXA=y
+CONFIG_PATA_PCMCIA=y
+CONFIG_NETDEVICES=y
+CONFIG_TUN=m
+CONFIG_NET_ETHERNET=y
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+CONFIG_AIRO_CS=m
+CONFIG_HOSTAP=m
+CONFIG_HOSTAP_FIRMWARE=y
+CONFIG_HOSTAP_CS=m
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_NET_DM9601=m
+# CONFIG_USB_NET_CDC_SUBSET is not set
+CONFIG_USB_SIERRA_NET=m
+CONFIG_NET_PCMCIA=y
+CONFIG_PCMCIA_PCNET=m
+CONFIG_PPP=m
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=240
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=320
+CONFIG_INPUT_EVDEV=y
+CONFIG_INPUT_APMPOWER=y
+# CONFIG_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_LOCOMO=y
+# CONFIG_INPUT_MOUSE is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_ADS7846=y
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_UINPUT=m
+# CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_SERIAL_8250=m
+CONFIG_SERIAL_8250_CS=m
+CONFIG_SERIAL_PXA=y
+CONFIG_SERIAL_PXA_CONSOLE=y
+CONFIG_RAMOOPS=y
+CONFIG_I2C=y
+CONFIG_I2C_PXA=y
+CONFIG_SPI=y
+CONFIG_SPI_PXA2XX=y
+CONFIG_GPIO_SYSFS=y
+CONFIG_POWER_SUPPLY=y
+CONFIG_POWER_SUPPLY_DEBUG=y
+CONFIG_PDA_POWER=y
+CONFIG_APM_POWER=y
+CONFIG_SENSORS_MAX1111=y
+CONFIG_FB=y
+CONFIG_FB_PXA=y
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+# CONFIG_BACKLIGHT_GENERIC is not set
+CONFIG_DISPLAY_SUPPORT=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+CONFIG_FONTS=y
+CONFIG_FONT_8x8=y
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_SOUND=m
+CONFIG_SND=m
+CONFIG_SND_SEQUENCER=m
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_PXA2XX_AC97=m
+CONFIG_SND_USB_AUDIO=m
+CONFIG_SND_SOC=m
+CONFIG_SND_PXA2XX_SOC=m
+CONFIG_SND_PXA2XX_SOC_POODLE=m
+CONFIG_HID=m
+CONFIG_USB_KBD=m
+CONFIG_USB_MOUSE=m
+CONFIG_USB=m
+CONFIG_USB_DEBUG=y
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_OTG_WHITELIST=y
+CONFIG_USB_MON=m
+CONFIG_USB_SL811_HCD=m
+CONFIG_USB_SL811_CS=m
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+CONFIG_USB_STORAGE=m
+CONFIG_USB_MDC800=m
+CONFIG_USB_MICROTEK=m
+CONFIG_USB_SERIAL=m
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_BELKIN=m
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+CONFIG_USB_SERIAL_CYPRESS_M8=m
+CONFIG_USB_SERIAL_EMPEG=m
+CONFIG_USB_SERIAL_FTDI_SIO=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_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_PL2303=m
+CONFIG_USB_SERIAL_SAFE=m
+CONFIG_USB_SERIAL_TI=m
+CONFIG_USB_SERIAL_CYBERJACK=m
+CONFIG_USB_SERIAL_XIRCOM=m
+CONFIG_USB_SERIAL_OMNINET=m
+CONFIG_USB_EMI62=m
+CONFIG_USB_EMI26=m
+CONFIG_USB_RIO500=m
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+CONFIG_USB_LED=m
+CONFIG_USB_CYTHERM=m
+CONFIG_USB_IDMOUSE=m
+CONFIG_USB_GADGET=m
+CONFIG_USB_GADGET_DEBUG_FILES=y
+CONFIG_USB_GADGET_DEBUG_FS=y
+CONFIG_USB_ZERO=m
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_EEM=y
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+CONFIG_USB_MASS_STORAGE=m
+CONFIG_USB_G_SERIAL=m
+CONFIG_USB_CDC_COMPOSITE=m
+CONFIG_USB_G_MULTI=m
+CONFIG_USB_G_MULTI_CDC=y
+CONFIG_USB_GPIO_VBUS=m
+CONFIG_USB_ULPI=y
+CONFIG_NOP_USB_XCEIV=m
+CONFIG_MMC=y
+CONFIG_MMC_UNSAFE_RESUME=y
+CONFIG_MMC_PXA=y
+CONFIG_MMC_SPI=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_LOCOMO=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_RTC_CLASS=m
+CONFIG_RTC_DRV_SA1100=m
+CONFIG_RTC_DRV_PXA=m
+CONFIG_EXT2_FS=y
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+# CONFIG_EXT3_FS_XATTR is not set
+CONFIG_EXT4_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_SUMMARY=y
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RUBIN=y
+CONFIG_UBIFS_FS=y
+CONFIG_UBIFS_FS_ADVANCED_COMPR=y
+CONFIG_CRAMFS=m
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+CONFIG_NFS_V4=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V4=y
+CONFIG_CIFS=m
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_NLS_DEFAULT="cp437"
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=y
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_FS=y
+CONFIG_SYSCTL_SYSCALL_CHECK=y
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_TEST=m
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_TWOFISH=m
+# CONFIG_CRYPTO_HW is not set
+CONFIG_CRC_CCITT=y
+CONFIG_LIBCRC32C=m
diff --git a/recipes/linux/linux-2.6.39/shr.patch b/recipes/linux/linux-2.6.39/shr.patch
new file mode 100644
index 0000000000..330cbf7eb9
--- /dev/null
+++ b/recipes/linux/linux-2.6.39/shr.patch
@@ -0,0 +1,2021 @@
+All patches from shr kernel repository
+rebased on top of openmoko kernel repository
+
+https://gitorious.org/shr/linux/commits/shr-2.6.39-nodrm
+
+efd94d3 nand/s3c2410: add mising badblocksbits value
+56885e2 glamo-mci: revert changes for Per's patchset
+6ab40bf Revert "mmc: add none blocking mmc request function"
+7937634 Revert "mmc: mmc_test: add debugfs file to list all tests"
+cf10e4d Revert "mmc: mmc_test: add test for none blocking transfers"
+29cd7b4 Revert "mmc: add member in mmc queue struct to hold request data"
+8f94eec Revert "mmc: add a block request prepare function"
+eae71b0 Revert "mmc: move error code in mmc_block_issue_rw_rq to a separate function."
+1062d7c Revert "mmc: add a second mmc queue request member"
+e0b2a74 Revert "mmc: add handling for two parallel block requests in issue_rw_rq"
+b59a013 Revert "mmc: test: add random fault injection in core.c"
+
+diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
+index 4b530ae..61d233a 100644
+--- a/drivers/mmc/card/block.c
++++ b/drivers/mmc/card/block.c
+@@ -79,13 +79,6 @@ struct mmc_blk_data {
+
+ static DEFINE_MUTEX(open_lock);
+
+-enum mmc_blk_status {
+- MMC_BLK_SUCCESS = 0,
+- MMC_BLK_RETRY,
+- MMC_BLK_DATA_ERR,
+- MMC_BLK_CMD_ERR,
+-};
+-
+ module_param(perdev_minors, int, 0444);
+ MODULE_PARM_DESC(perdev_minors, "Minors numbers to allocate per device");
+
+@@ -172,6 +165,13 @@ static const struct block_device_operations mmc_bdops = {
+ .owner = THIS_MODULE,
+ };
+
++struct mmc_blk_request {
++ struct mmc_request mrq;
++ struct mmc_command cmd;
++ struct mmc_command stop;
++ struct mmc_data data;
++};
++
+ static u32 mmc_sd_num_wr_blocks(struct mmc_card *card)
+ {
+ int err;
+@@ -331,341 +331,200 @@ out:
+ return err ? 0 : 1;
+ }
+
+-static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
+- struct mmc_card *card,
+- int disable_multi,
+- struct mmc_queue *mq)
++static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *req)
+ {
+- u32 readcmd, writecmd;
+- struct mmc_blk_request *brq = &mqrq->brq;
+- struct request *req = mqrq->req;
+-
+- memset(brq, 0, sizeof(struct mmc_blk_request));
+-
+- brq->mrq.cmd = &brq->cmd;
+- brq->mrq.data = &brq->data;
+-
+- brq->cmd.arg = blk_rq_pos(req);
+- if (!mmc_card_blockaddr(card))
+- brq->cmd.arg <<= 9;
+- brq->cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_ADTC;
+- brq->data.blksz = 512;
+- brq->stop.opcode = MMC_STOP_TRANSMISSION;
+- brq->stop.arg = 0;
+- brq->stop.flags = MMC_RSP_SPI_R1B | MMC_RSP_R1B | MMC_CMD_AC;
+- brq->data.blocks = blk_rq_sectors(req);
++ struct mmc_blk_data *md = mq->data;
++ struct mmc_card *card = md->queue.card;
++ struct mmc_blk_request brq;
++ int ret = 1, disable_multi = 0;
+
+- /*
+- * The block layer doesn't support all sector count
+- * restrictions, so we need to be prepared for too big
+- * requests.
+- */
+- if (brq->data.blocks > card->host->max_blk_count)
+- brq->data.blocks = card->host->max_blk_count;
++ mmc_claim_host(card->host);
+
+- /*
+- * After a read error, we redo the request one sector at a time
+- * in order to accurately determine which sectors can be read
+- * successfully.
+- */
+- if (disable_multi && brq->data.blocks > 1)
+- brq->data.blocks = 1;
++ do {
++ struct mmc_command cmd;
++ u32 readcmd, writecmd, status = 0;
++
++ memset(&brq, 0, sizeof(struct mmc_blk_request));
++ brq.mrq.cmd = &brq.cmd;
++ brq.mrq.data = &brq.data;
++
++ brq.cmd.arg = blk_rq_pos(req);
++ if (!mmc_card_blockaddr(card))
++ brq.cmd.arg <<= 9;
++ brq.cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_ADTC;
++ brq.data.blksz = 512;
++ brq.stop.opcode = MMC_STOP_TRANSMISSION;
++ brq.stop.arg = 0;
++ brq.stop.flags = MMC_RSP_SPI_R1B | MMC_RSP_R1B | MMC_CMD_AC;
++ brq.data.blocks = blk_rq_sectors(req);
+
+- if (brq->data.blocks > 1) {
+- /* SPI multiblock writes terminate using a special
+- * token, not a STOP_TRANSMISSION request.
++ /*
++ * The block layer doesn't support all sector count
++ * restrictions, so we need to be prepared for too big
++ * requests.
+ */
+- if (!mmc_host_is_spi(card->host)
+- || rq_data_dir(req) == READ)
+- brq->mrq.stop = &brq->stop;
+- readcmd = MMC_READ_MULTIPLE_BLOCK;
+- writecmd = MMC_WRITE_MULTIPLE_BLOCK;
+- } else {
+- brq->mrq.stop = NULL;
+- readcmd = MMC_READ_SINGLE_BLOCK;
+- writecmd = MMC_WRITE_BLOCK;
+- }
+- if (rq_data_dir(req) == READ) {
+- brq->cmd.opcode = readcmd;
+- brq->data.flags |= MMC_DATA_READ;
+- } else {
+- brq->cmd.opcode = writecmd;
+- brq->data.flags |= MMC_DATA_WRITE;
+- }
+-
+- mmc_set_data_timeout(&brq->data, card);
++ if (brq.data.blocks > card->host->max_blk_count)
++ brq.data.blocks = card->host->max_blk_count;
+
+- brq->data.sg = mqrq->sg;
+- brq->data.sg_len = mmc_queue_map_sg(mq, mqrq);
++ /*
++ * After a read error, we redo the request one sector at a time
++ * in order to accurately determine which sectors can be read
++ * successfully.
++ */
++ if (disable_multi && brq.data.blocks > 1)
++ brq.data.blocks = 1;
+
+- /*
+- * Adjust the sg list so it is the same size as the
+- * request.
+- */
+- if (brq->data.blocks != blk_rq_sectors(req)) {
+- int i, data_size = brq->data.blocks << 9;
+- struct scatterlist *sg;
+-
+- for_each_sg(brq->data.sg, sg, brq->data.sg_len, i) {
+- data_size -= sg->length;
+- if (data_size <= 0) {
+- sg->length += data_size;
+- i++;
+- break;
+- }
++ if (brq.data.blocks > 1) {
++ /* SPI multiblock writes terminate using a special
++ * token, not a STOP_TRANSMISSION request.
++ */
++ if (!mmc_host_is_spi(card->host)
++ || rq_data_dir(req) == READ)
++ brq.mrq.stop = &brq.stop;
++ readcmd = MMC_READ_MULTIPLE_BLOCK;
++ writecmd = MMC_WRITE_MULTIPLE_BLOCK;
++ } else {
++ brq.mrq.stop = NULL;
++ readcmd = MMC_READ_SINGLE_BLOCK;
++ writecmd = MMC_WRITE_BLOCK;
+ }
+- brq->data.sg_len = i;
+- }
+-
+- mmc_queue_bounce_pre(mqrq);
+-}
+-
+-static enum mmc_blk_status mmc_blk_get_status(struct mmc_blk_request *brq,
+- struct request *req,
+- struct mmc_card *card,
+- struct mmc_blk_data *md)
+-{
+- struct mmc_command cmd;
+- u32 status;
+- enum mmc_blk_status ret = MMC_BLK_SUCCESS;
+-
+- /*
+- * Check for errors here, but don't jump to cmd_err
+- * until later as we need to wait for the card to leave
+- * programming mode even when things go wrong.
+- */
+- if (brq->cmd.error || brq->data.error || brq->stop.error) {
+- if (brq->data.blocks > 1 && rq_data_dir(req) == READ) {
+- /* Redo read one sector at a time */
+- printk(KERN_WARNING "%s: retrying using single "
+- "block read, brq %p\n",
+- req->rq_disk->disk_name, brq);
+- ret = MMC_BLK_RETRY;
+- goto out;
++ if (rq_data_dir(req) == READ) {
++ brq.cmd.opcode = readcmd;
++ brq.data.flags |= MMC_DATA_READ;
++ } else {
++ brq.cmd.opcode = writecmd;
++ brq.data.flags |= MMC_DATA_WRITE;
+ }
+- status = get_card_status(card, req);
+- }
+
+- if (brq->cmd.error) {
+- printk(KERN_ERR "%s: error %d sending read/write "
+- "command, response %#x, card status %#x\n",
+- req->rq_disk->disk_name, brq->cmd.error,
+- brq->cmd.resp[0], status);
+- }
+-
+- if (brq->data.error) {
+- if (brq->data.error == -ETIMEDOUT && brq->mrq.stop)
+- /* 'Stop' response contains card status */
+- status = brq->mrq.stop->resp[0];
+- printk(KERN_ERR "%s: error %d transferring data,"
+- " sector %u, nr %u, card status %#x\n",
+- req->rq_disk->disk_name, brq->data.error,
+- (unsigned)blk_rq_pos(req),
+- (unsigned)blk_rq_sectors(req), status);
+- }
++ mmc_set_data_timeout(&brq.data, card);
+
+- if (brq->stop.error) {
+- printk(KERN_ERR "%s: error %d sending stop command, "
+- "response %#x, card status %#x\n",
+- req->rq_disk->disk_name, brq->stop.error,
+- brq->stop.resp[0], status);
+- }
++ brq.data.sg = mq->sg;
++ brq.data.sg_len = mmc_queue_map_sg(mq);
+
+- if (!mmc_host_is_spi(card->host) && rq_data_dir(req) != READ) {
+- do {
+- int err;
+-
+- cmd.opcode = MMC_SEND_STATUS;
+- cmd.arg = card->rca << 16;
+- cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
+- err = mmc_wait_for_cmd(card->host, &cmd, 5);
+- if (err) {
+- printk(KERN_ERR "%s: error %d requesting status\n",
+- req->rq_disk->disk_name, err);
+- ret = MMC_BLK_CMD_ERR;
+- goto out;
++ /*
++ * Adjust the sg list so it is the same size as the
++ * request.
++ */
++ if (brq.data.blocks != blk_rq_sectors(req)) {
++ int i, data_size = brq.data.blocks << 9;
++ struct scatterlist *sg;
++
++ for_each_sg(brq.data.sg, sg, brq.data.sg_len, i) {
++ data_size -= sg->length;
++ if (data_size <= 0) {
++ sg->length += data_size;
++ i++;
++ break;
++ }
+ }
+- /*
+- * Some cards mishandle the status bits,
+- * so make sure to check both the busy
+- * indication and the card state.
+- */
+- } while (!(cmd.resp[0] & R1_READY_FOR_DATA) ||
+- (R1_CURRENT_STATE(cmd.resp[0]) == 7));
+-
+-#if 0
+- if (cmd.resp[0] & ~0x00000900)
+- printk(KERN_ERR "%s: status = %08x\n",
+- req->rq_disk->disk_name, cmd.resp[0]);
+- if (mmc_decode_status(cmd.resp)) {
+- ret = MMC_BLK_CMD_ERR;
+- goto out;
++ brq.data.sg_len = i;
+ }
+
+-#endif
+- }
++ mmc_queue_bounce_pre(mq);
+
+- if (brq->cmd.error || brq->stop.error || brq->data.error) {
+- if (rq_data_dir(req) == READ)
+- ret = MMC_BLK_DATA_ERR;
+- else
+- ret = MMC_BLK_CMD_ERR;
+- }
+- out:
+- return ret;
++ mmc_wait_for_req(card->host, &brq.mrq);
+
+-}
++ mmc_queue_bounce_post(mq);
+
+-static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *rqc)
+-{
+- struct mmc_blk_data *md = mq->data;
+- struct mmc_card *card = md->queue.card;
+- struct mmc_blk_request *brqc = &mq->mqrq_cur->brq;
+- struct mmc_blk_request *brqp = &mq->mqrq_prev->brq;
+- struct mmc_queue_req *mqrqp = mq->mqrq_prev;
+- struct request *rqp = mqrqp->req;
+- int ret = 0;
+- int disable_multi = 0;
+- enum mmc_blk_status status;
+-
+- if (!rqc && !rqp)
+- return 0;
+-
+- if (rqc) {
+- /* Claim host for the first request in a serie of requests */
+- if (!rqp)
+- mmc_claim_host(card->host);
+-
+- /* Prepare a new request */
+- mmc_blk_rw_rq_prep(mq->mqrq_cur, card, 0, mq);
+- mmc_pre_req(card->host, &brqc->mrq, !rqp);
+- }
+- do {
+ /*
+- * If there is an ongoing request, indicated by rqp, wait for
+- * it to finish before starting a new one.
++ * Check for errors here, but don't jump to cmd_err
++ * until later as we need to wait for the card to leave
++ * programming mode even when things go wrong.
+ */
+- if (rqp)
+- mmc_wait_for_req_done(&brqp->mrq);
+- else {
+- /* start a new asynchronous request */
+- mmc_start_req(card->host, &brqc->mrq);
+- goto out;
+- }
+- status = mmc_blk_get_status(brqp, rqp, card, md);
+- if (status != MMC_BLK_SUCCESS) {
+- mmc_post_req(card->host, &brqp->mrq, -EINVAL);
+- mmc_queue_bounce_post(mqrqp);
+- if (rqc)
+- mmc_post_req(card->host, &brqc->mrq, -EINVAL);
++ if (brq.cmd.error || brq.data.error || brq.stop.error) {
++ if (brq.data.blocks > 1 && rq_data_dir(req) == READ) {
++ /* Redo read one sector at a time */
++ printk(KERN_WARNING "%s: retrying using single "
++ "block read\n", req->rq_disk->disk_name);
++ disable_multi = 1;
++ continue;
++ }
++ status = get_card_status(card, req);
+ }
+
+- switch (status) {
+- case MMC_BLK_SUCCESS:
+- /*
+- * A block was successfully transferred.
+- */
+-
+- /*
+- * All data is transferred without errors.
+- * Defer mmc post processing and _blk_end_request
+- * until after the new request is started.
+- */
+- if (blk_rq_bytes(rqp) == brqp->data.bytes_xfered)
+- break;
+-
+- mmc_post_req(card->host, &brqp->mrq, 0);
+- mmc_queue_bounce_post(mqrqp);
+-
+- spin_lock_irq(&md->lock);
+- ret = __blk_end_request(rqp, 0,
+- brqp->data.bytes_xfered);
+- spin_unlock_irq(&md->lock);
+-
+- if (rqc)
+- mmc_post_req(card->host, &brqc->mrq, -EINVAL);
+- break;
+- case MMC_BLK_CMD_ERR:
+- goto cmd_err;
+- break;
+- case MMC_BLK_RETRY:
+- disable_multi = 1;
+- ret = 1;
+- break;
+- case MMC_BLK_DATA_ERR:
+- /*
+- * After an error, we redo I/O one sector at a
+- * time, so we only reach here after trying to
+- * read a single sector.
+- */
+- spin_lock_irq(&md->lock);
+- ret = __blk_end_request(rqp, -EIO, brqp->data.blksz);
+- spin_unlock_irq(&md->lock);
+- if (rqc && !ret)
+- mmc_pre_req(card->host, &brqc->mrq, false);
+- break;
++ if (brq.cmd.error) {
++ printk(KERN_ERR "%s: error %d sending read/write "
++ "command, response %#x, card status %#x\n",
++ req->rq_disk->disk_name, brq.cmd.error,
++ brq.cmd.resp[0], status);
+ }
+
+- if (ret) {
+- /*
+- * In case of a none complete request
+- * prepare it again and resend.
+- */
+- mmc_blk_rw_rq_prep(mqrqp, card, disable_multi, mq);
+- mmc_pre_req(card->host, &brqp->mrq, true);
+- mmc_start_req(card->host, &brqp->mrq);
+- if (rqc)
+- mmc_pre_req(card->host, &brqc->mrq, false);
++ if (brq.data.error) {
++ if (brq.data.error == -ETIMEDOUT && brq.mrq.stop)
++ /* 'Stop' response contains card status */
++ status = brq.mrq.stop->resp[0];
++ printk(KERN_ERR "%s: error %d transferring data,"
++ " sector %u, nr %u, card status %#x\n",
++ req->rq_disk->disk_name, brq.data.error,
++ (unsigned)blk_rq_pos(req),
++ (unsigned)blk_rq_sectors(req), status);
+ }
+- } while (ret);
+
+- /* Previous request is completed, start the new request if any */
+- if (rqc)
+- mmc_start_req(card->host, &brqc->mrq);
++ if (brq.stop.error) {
++ printk(KERN_ERR "%s: error %d sending stop command, "
++ "response %#x, card status %#x\n",
++ req->rq_disk->disk_name, brq.stop.error,
++ brq.stop.resp[0], status);
++ }
+
+- /*
+- * Post process the previous request while the new request is active.
+- * In case of error the reuqest is already ended.
+- */
+- if (status == MMC_BLK_SUCCESS) {
+- mmc_post_req(card->host, &brqp->mrq, 0);
+- mmc_queue_bounce_post(mqrqp);
++ if (!mmc_host_is_spi(card->host) && rq_data_dir(req) != READ) {
++ do {
++ int err;
++
++ cmd.opcode = MMC_SEND_STATUS;
++ cmd.arg = card->rca << 16;
++ cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
++ err = mmc_wait_for_cmd(card->host, &cmd, 5);
++ if (err) {
++ printk(KERN_ERR "%s: error %d requesting status\n",
++ req->rq_disk->disk_name, err);
++ goto cmd_err;
++ }
++ /*
++ * Some cards mishandle the status bits,
++ * so make sure to check both the busy
++ * indication and the card state.
++ */
++ } while (!(cmd.resp[0] & R1_READY_FOR_DATA) ||
++ (R1_CURRENT_STATE(cmd.resp[0]) == 7));
+
+- spin_lock_irq(&md->lock);
+- ret = __blk_end_request(rqp, 0, brqp->data.bytes_xfered);
+- spin_unlock_irq(&md->lock);
++#if 0
++ if (cmd.resp[0] & ~0x00000900)
++ printk(KERN_ERR "%s: status = %08x\n",
++ req->rq_disk->disk_name, cmd.resp[0]);
++ if (mmc_decode_status(cmd.resp))
++ goto cmd_err;
++#endif
++ }
+
+- if (ret) {
+- /* If this happen it is a bug */
+- printk(KERN_ERR "[%s] BUG: rq_bytes %d xfered %d\n",
+- __func__, blk_rq_bytes(rqp),
+- brqp->data.bytes_xfered);
++ if (brq.cmd.error || brq.stop.error || brq.data.error) {
++ if (rq_data_dir(req) == READ) {
++ /*
++ * After an error, we redo I/O one sector at a
++ * time, so we only reach here after trying to
++ * read a single sector.
++ */
++ spin_lock_irq(&md->lock);
++ ret = __blk_end_request(req, -EIO, brq.data.blksz);
++ spin_unlock_irq(&md->lock);
++ continue;
++ }
+ goto cmd_err;
+ }
+- }
+
+- /* 1 indicates one request has been completed */
+- ret = 1;
+- out:
+- /*
+- * TODO: Find out if it is OK to only release host after the
+- * last request. For the last request the current request
+- * is NULL, which means no requests are pending.
+- */
+- /* Release host for the last request in a serie of requests */
+- if (!rqc)
+- mmc_release_host(card->host);
++ /*
++ * A block was successfully transferred.
++ */
++ spin_lock_irq(&md->lock);
++ ret = __blk_end_request(req, 0, brq.data.bytes_xfered);
++ spin_unlock_irq(&md->lock);
++ } while (ret);
+
+- /* Current request becomes previous request and vice versa. */
+- mqrqp->brq.mrq.data = NULL;
+- mqrqp->req = NULL;
+- mq->mqrq_prev = mq->mqrq_cur;
+- mq->mqrq_cur = mqrqp;
++ mmc_release_host(card->host);
+
+- return ret;
++ return 1;
+
+ cmd_err:
+-
+ /*
+ * If this is an SD card and we're writing, we can first
+ * mark the known good sectors as ok.
+@@ -680,12 +539,12 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *rqc)
+ blocks = mmc_sd_num_wr_blocks(card);
+ if (blocks != (u32)-1) {
+ spin_lock_irq(&md->lock);
+- ret = __blk_end_request(rqp, 0, blocks << 9);
++ ret = __blk_end_request(req, 0, blocks << 9);
+ spin_unlock_irq(&md->lock);
+ }
+ } else {
+ spin_lock_irq(&md->lock);
+- ret = __blk_end_request(rqp, 0, brqp->data.bytes_xfered);
++ ret = __blk_end_request(req, 0, brq.data.bytes_xfered);
+ spin_unlock_irq(&md->lock);
+ }
+
+@@ -693,27 +552,15 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *rqc)
+
+ spin_lock_irq(&md->lock);
+ while (ret)
+- ret = __blk_end_request(rqp, -EIO, blk_rq_cur_bytes(rqp));
++ ret = __blk_end_request(req, -EIO, blk_rq_cur_bytes(req));
+ spin_unlock_irq(&md->lock);
+
+- if (rqc) {
+- mmc_claim_host(card->host);
+- mmc_pre_req(card->host, &brqc->mrq, false);
+- mmc_start_req(card->host, &brqc->mrq);
+- }
+-
+- /* Current request becomes previous request and vice versa. */
+- mqrqp->brq.mrq.data = NULL;
+- mqrqp->req = NULL;
+- mq->mqrq_prev = mq->mqrq_cur;
+- mq->mqrq_cur = mqrqp;
+-
+ return 0;
+ }
+
+ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
+ {
+- if (req && req->cmd_flags & REQ_DISCARD) {
++ if (req->cmd_flags & REQ_DISCARD) {
+ if (req->cmd_flags & REQ_SECURE)
+ return mmc_blk_issue_secdiscard_rq(mq, req);
+ else
+diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c
+index 8f7ffad..abc1a63 100644
+--- a/drivers/mmc/card/mmc_test.c
++++ b/drivers/mmc/card/mmc_test.c
+@@ -22,7 +22,6 @@
+ #include <linux/debugfs.h>
+ #include <linux/uaccess.h>
+ #include <linux/seq_file.h>
+-#include <linux/random.h>
+
+ #define RESULT_OK 0
+ #define RESULT_FAIL 1
+@@ -52,12 +51,10 @@ struct mmc_test_pages {
+ * struct mmc_test_mem - allocated memory.
+ * @arr: array of allocations
+ * @cnt: number of allocations
+- * @size_min_cmn: lowest common size in array of allocations
+ */
+ struct mmc_test_mem {
+ struct mmc_test_pages *arr;
+ unsigned int cnt;
+- unsigned int size_min_cmn;
+ };
+
+ /**
+@@ -151,21 +148,6 @@ struct mmc_test_card {
+ struct mmc_test_general_result *gr;
+ };
+
+-enum mmc_test_prep_media {
+- MMC_TEST_PREP_NONE = 0,
+- MMC_TEST_PREP_WRITE_FULL = 1 << 0,
+- MMC_TEST_PREP_ERASE = 1 << 1,
+-};
+-
+-struct mmc_test_multiple_rw {
+- unsigned int *bs;
+- unsigned int len;
+- unsigned int size;
+- bool do_write;
+- bool do_nonblock_req;
+- enum mmc_test_prep_media prepare;
+-};
+-
+ /*******************************************************************/
+ /* General helper functions */
+ /*******************************************************************/
+@@ -325,7 +307,6 @@ static struct mmc_test_mem *mmc_test_alloc_mem(unsigned long min_sz,
+ unsigned long max_seg_page_cnt = DIV_ROUND_UP(max_seg_sz, PAGE_SIZE);
+ unsigned long page_cnt = 0;
+ unsigned long limit = nr_free_buffer_pages() >> 4;
+- unsigned int min_cmn = 0;
+ struct mmc_test_mem *mem;
+
+ if (max_page_cnt > limit)
+@@ -369,12 +350,6 @@ static struct mmc_test_mem *mmc_test_alloc_mem(unsigned long min_sz,
+ mem->arr[mem->cnt].page = page;
+ mem->arr[mem->cnt].order = order;
+ mem->cnt += 1;
+- if (!min_cmn)
+- min_cmn = PAGE_SIZE << order;
+- else
+- min_cmn = min(min_cmn,
+- (unsigned int) (PAGE_SIZE << order));
+-
+ if (max_page_cnt <= (1UL << order))
+ break;
+ max_page_cnt -= 1UL << order;
+@@ -385,7 +360,6 @@ static struct mmc_test_mem *mmc_test_alloc_mem(unsigned long min_sz,
+ break;
+ }
+ }
+- mem->size_min_cmn = min_cmn;
+
+ return mem;
+
+@@ -412,6 +386,7 @@ static int mmc_test_map_sg(struct mmc_test_mem *mem, unsigned long sz,
+ do {
+ for (i = 0; i < mem->cnt; i++) {
+ unsigned long len = PAGE_SIZE << mem->arr[i].order;
++
+ if (len > sz)
+ len = sz;
+ if (len > max_seg_sz)
+@@ -750,94 +725,6 @@ static int mmc_test_check_broken_result(struct mmc_test_card *test,
+ }
+
+ /*
+- * Tests nonblock transfer with certain parameters
+- */
+-static void mmc_test_nonblock_reset(struct mmc_request *mrq,
+- struct mmc_command *cmd,
+- struct mmc_command *stop,
+- struct mmc_data *data)
+-{
+- memset(mrq, 0, sizeof(struct mmc_request));
+- memset(cmd, 0, sizeof(struct mmc_command));
+- memset(data, 0, sizeof(struct mmc_data));
+- memset(stop, 0, sizeof(struct mmc_command));
+-
+- mrq->cmd = cmd;
+- mrq->data = data;
+- mrq->stop = stop;
+-}
+-static int mmc_test_nonblock_transfer(struct mmc_test_card *test,
+- struct scatterlist *sg, unsigned sg_len,
+- unsigned dev_addr, unsigned blocks,
+- unsigned blksz, int write, int count)
+-{
+- struct mmc_request mrq1;
+- struct mmc_command cmd1;
+- struct mmc_command stop1;
+- struct mmc_data data1;
+-
+- struct mmc_request mrq2;
+- struct mmc_command cmd2;
+- struct mmc_command stop2;
+- struct mmc_data data2;
+-
+- struct mmc_request *cur_mrq;
+- struct mmc_request *prev_mrq;
+- int i;
+- int ret = 0;
+-
+- if (!test->card->host->ops->pre_req ||
+- !test->card->host->ops->post_req)
+- return -RESULT_UNSUP_HOST;
+-
+- mmc_test_nonblock_reset(&mrq1, &cmd1, &stop1, &data1);
+- mmc_test_nonblock_reset(&mrq2, &cmd2, &stop2, &data2);
+-
+- cur_mrq = &mrq1;
+- prev_mrq = NULL;
+-
+- for (i = 0; i < count; i++) {
+- mmc_test_prepare_mrq(test, cur_mrq, sg, sg_len, dev_addr,
+- blocks, blksz, write);
+- mmc_pre_req(test->card->host, cur_mrq, !prev_mrq);
+-
+- if (prev_mrq) {
+- mmc_wait_for_req_done(prev_mrq);
+- mmc_test_wait_busy(test);
+- ret = mmc_test_check_result(test, prev_mrq);
+- if (ret)
+- goto err;
+- }
+-
+- mmc_start_req(test->card->host, cur_mrq);
+-
+- if (prev_mrq)
+- mmc_post_req(test->card->host, prev_mrq, 0);
+-
+- prev_mrq = cur_mrq;
+- if (cur_mrq == &mrq1) {
+- mmc_test_nonblock_reset(&mrq2, &cmd2, &stop2, &data2);
+- cur_mrq = &mrq2;
+- } else {
+- mmc_test_nonblock_reset(&mrq1, &cmd1, &stop1, &data1);
+- cur_mrq = &mrq1;
+- }
+- dev_addr += blocks;
+- }
+-
+- mmc_wait_for_req_done(prev_mrq);
+- mmc_test_wait_busy(test);
+- ret = mmc_test_check_result(test, prev_mrq);
+- if (ret)
+- goto err;
+- mmc_post_req(test->card->host, prev_mrq, 0);
+-
+- return ret;
+-err:
+- return ret;
+-}
+-
+-/*
+ * Tests a basic transfer with certain parameters
+ */
+ static int mmc_test_simple_transfer(struct mmc_test_card *test,
+@@ -1464,17 +1351,14 @@ static int mmc_test_area_transfer(struct mmc_test_card *test,
+ }
+
+ /*
+- * Map and transfer bytes for multiple transfers.
++ * Map and transfer bytes.
+ */
+-static int mmc_test_area_io_seq(struct mmc_test_card *test, unsigned long sz,
+- unsigned int dev_addr, int write,
+- int max_scatter, int timed, int count,
+- bool nonblock)
++static int mmc_test_area_io(struct mmc_test_card *test, unsigned long sz,
++ unsigned int dev_addr, int write, int max_scatter,
++ int timed)
+ {
+ struct timespec ts1, ts2;
+- int ret = 0;
+- int i;
+- struct mmc_test_area *t = &test->area;
++ int ret;
+
+ /*
+ * In the case of a maximally scattered transfer, the maximum transfer
+@@ -1498,15 +1382,8 @@ static int mmc_test_area_io_seq(struct mmc_test_card *test, unsigned long sz,
+
+ if (timed)
+ getnstimeofday(&ts1);
+- if (nonblock)
+- ret = mmc_test_nonblock_transfer(test, t->sg, t->sg_len,
+- dev_addr, t->blocks, 512, write, count);
+- else
+- for (i = 0; i < count && ret == 0; i++) {
+- ret = mmc_test_area_transfer(test, dev_addr, write);
+- dev_addr += sz >> 9;
+- }
+
++ ret = mmc_test_area_transfer(test, dev_addr, write);
+ if (ret)
+ return ret;
+
+@@ -1514,19 +1391,11 @@ static int mmc_test_area_io_seq(struct mmc_test_card *test, unsigned long sz,
+ getnstimeofday(&ts2);
+
+ if (timed)
+- mmc_test_print_avg_rate(test, sz, count, &ts1, &ts2);
++ mmc_test_print_rate(test, sz, &ts1, &ts2);
+
+ return 0;
+ }
+
+-static int mmc_test_area_io(struct mmc_test_card *test, unsigned long sz,
+- unsigned int dev_addr, int write, int max_scatter,
+- int timed)
+-{
+- return mmc_test_area_io_seq(test, sz, dev_addr, write, max_scatter,
+- timed, 1, false);
+-}
+-
+ /*
+ * Write the test area entirely.
+ */
+@@ -2087,144 +1956,6 @@ static int mmc_test_large_seq_write_perf(struct mmc_test_card *test)
+ return mmc_test_large_seq_perf(test, 1);
+ }
+
+-static int mmc_test_rw_multiple(struct mmc_test_card *test,
+- struct mmc_test_multiple_rw *tdata,
+- unsigned int reqsize, unsigned int size)
+-{
+- unsigned int dev_addr;
+- struct mmc_test_area *t = &test->area;
+- int ret = 0;
+- int max_reqsize = max(t->mem->size_min_cmn *
+- min(t->max_segs, t->mem->cnt), t->max_tfr);
+-
+- /* Set up test area */
+- if (size > mmc_test_capacity(test->card) / 2 * 512)
+- size = mmc_test_capacity(test->card) / 2 * 512;
+- if (reqsize > max_reqsize)
+- reqsize = max_reqsize;
+- dev_addr = mmc_test_capacity(test->card) / 4;
+- if ((dev_addr & 0xffff0000))
+- dev_addr &= 0xffff0000; /* Round to 64MiB boundary */
+- else
+- dev_addr &= 0xfffff800; /* Round to 1MiB boundary */
+- if (!dev_addr)
+- goto err;
+-
+- /* prepare test area */
+- if (mmc_can_erase(test->card) &&
+- tdata->prepare & MMC_TEST_PREP_ERASE) {
+- ret = mmc_erase(test->card, dev_addr,
+- size / 512, MMC_SECURE_ERASE_ARG);
+- if (ret)
+- ret = mmc_erase(test->card, dev_addr,
+- size / 512, MMC_ERASE_ARG);
+- if (ret)
+- goto err;
+- }
+-
+- /* Run test */
+- ret = mmc_test_area_io_seq(test, reqsize, dev_addr,
+- tdata->do_write, 0, 1, size / reqsize,
+- tdata->do_nonblock_req);
+- if (ret)
+- goto err;
+-
+- return ret;
+- err:
+- printk(KERN_INFO "[%s] error\n", __func__);
+- return ret;
+-}
+-
+-static int mmc_test_rw_multiple_size(struct mmc_test_card *test,
+- struct mmc_test_multiple_rw *rw)
+-{
+- int ret = 0;
+- int i;
+-
+- for (i = 0 ; i < rw->len && ret == 0; i++) {
+- ret = mmc_test_rw_multiple(test, rw, rw->bs[i], rw->size);
+- if (ret)
+- break;
+- }
+- return ret;
+-}
+-
+-/*
+- * Multiple blocking write 4k to 4 MB chunks
+- */
+-static int mmc_test_profile_mult_write_blocking_perf(struct mmc_test_card *test)
+-{
+- unsigned int bs[] = {1 << 12, 1 << 13, 1 << 14, 1 << 15, 1 << 16,
+- 1 << 17, 1 << 18, 1 << 19, 1 << 20, 1 << 22};
+- struct mmc_test_multiple_rw test_data = {
+- .bs = bs,
+- .size = 128*1024*1024,
+- .len = ARRAY_SIZE(bs),
+- .do_write = true,
+- .do_nonblock_req = false,
+- .prepare = MMC_TEST_PREP_ERASE,
+- };
+-
+- return mmc_test_rw_multiple_size(test, &test_data);
+-};
+-
+-/*
+- * Multiple none blocking write 4k to 4 MB chunks
+- */
+-static int mmc_test_profile_mult_write_nonblock_perf(struct mmc_test_card *test)
+-{
+- unsigned int bs[] = {1 << 12, 1 << 13, 1 << 14, 1 << 15, 1 << 16,
+- 1 << 17, 1 << 18, 1 << 19, 1 << 20, 1 << 22};
+- struct mmc_test_multiple_rw test_data = {
+- .bs = bs,
+- .size = 128*1024*1024,
+- .len = ARRAY_SIZE(bs),
+- .do_write = true,
+- .do_nonblock_req = true,
+- .prepare = MMC_TEST_PREP_ERASE,
+- };
+-
+- return mmc_test_rw_multiple_size(test, &test_data);
+-}
+-
+-/*
+- * Multiple blocking read 4k to 4 MB chunks
+- */
+-static int mmc_test_profile_mult_read_blocking_perf(struct mmc_test_card *test)
+-{
+- unsigned int bs[] = {1 << 12, 1 << 13, 1 << 14, 1 << 15, 1 << 16,
+- 1 << 17, 1 << 18, 1 << 19, 1 << 20, 1 << 22};
+- struct mmc_test_multiple_rw test_data = {
+- .bs = bs,
+- .size = 128*1024*1024,
+- .len = ARRAY_SIZE(bs),
+- .do_write = false,
+- .do_nonblock_req = false,
+- .prepare = MMC_TEST_PREP_NONE,
+- };
+-
+- return mmc_test_rw_multiple_size(test, &test_data);
+-}
+-
+-/*
+- * Multiple none blocking read 4k to 4 MB chunks
+- */
+-static int mmc_test_profile_mult_read_nonblock_perf(struct mmc_test_card *test)
+-{
+- unsigned int bs[] = {1 << 12, 1 << 13, 1 << 14, 1 << 15, 1 << 16,
+- 1 << 17, 1 << 18, 1 << 19, 1 << 20, 1 << 22};
+- struct mmc_test_multiple_rw test_data = {
+- .bs = bs,
+- .size = 128*1024*1024,
+- .len = ARRAY_SIZE(bs),
+- .do_write = false,
+- .do_nonblock_req = true,
+- .prepare = MMC_TEST_PREP_NONE,
+- };
+-
+- return mmc_test_rw_multiple_size(test, &test_data);
+-}
+-
+ static const struct mmc_test_case mmc_test_cases[] = {
+ {
+ .name = "Basic write (no data verification)",
+@@ -2492,33 +2223,6 @@ static const struct mmc_test_case mmc_test_cases[] = {
+ .cleanup = mmc_test_area_cleanup,
+ },
+
+- {
+- .name = "Write performance with blocking req 4k to 4MB",
+- .prepare = mmc_test_area_prepare,
+- .run = mmc_test_profile_mult_write_blocking_perf,
+- .cleanup = mmc_test_area_cleanup,
+- },
+-
+- {
+- .name = "Write performance with none blocking req 4k to 4MB",
+- .prepare = mmc_test_area_prepare,
+- .run = mmc_test_profile_mult_write_nonblock_perf,
+- .cleanup = mmc_test_area_cleanup,
+- },
+-
+- {
+- .name = "Read performance with blocking req 4k to 4MB",
+- .prepare = mmc_test_area_prepare,
+- .run = mmc_test_profile_mult_read_blocking_perf,
+- .cleanup = mmc_test_area_cleanup,
+- },
+-
+- {
+- .name = "Read performance with none blocking req 4k to 4MB",
+- .prepare = mmc_test_area_prepare,
+- .run = mmc_test_profile_mult_read_nonblock_perf,
+- .cleanup = mmc_test_area_cleanup,
+- },
+ };
+
+ static DEFINE_MUTEX(mmc_test_lock);
+@@ -2743,32 +2447,6 @@ static const struct file_operations mmc_test_fops_test = {
+ .release = single_release,
+ };
+
+-static int mtf_testlist_show(struct seq_file *sf, void *data)
+-{
+- int i;
+-
+- mutex_lock(&mmc_test_lock);
+-
+- for (i = 0; i < ARRAY_SIZE(mmc_test_cases); i++)
+- seq_printf(sf, "%d:\t%s\n", i+1, mmc_test_cases[i].name);
+-
+- mutex_unlock(&mmc_test_lock);
+-
+- return 0;
+-}
+-
+-static int mtf_testlist_open(struct inode *inode, struct file *file)
+-{
+- return single_open(file, mtf_testlist_show, inode->i_private);
+-}
+-
+-static const struct file_operations mmc_test_fops_testlist = {
+- .open = mtf_testlist_open,
+- .read = seq_read,
+- .llseek = seq_lseek,
+- .release = single_release,
+-};
+-
+ static void mmc_test_free_file_test(struct mmc_card *card)
+ {
+ struct mmc_test_dbgfs_file *df, *dfs;
+@@ -2798,10 +2476,6 @@ static int mmc_test_register_file_test(struct mmc_card *card)
+ file = debugfs_create_file("test", S_IWUSR | S_IRUGO,
+ card->debugfs_root, card, &mmc_test_fops_test);
+
+- if (card->debugfs_root)
+- file = debugfs_create_file("testlist", S_IRUGO,
+- card->debugfs_root, card, &mmc_test_fops_testlist);
+-
+ if (IS_ERR_OR_NULL(file)) {
+ dev_err(&card->dev,
+ "Can't create file. Perhaps debugfs is disabled.\n");
+diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
+index 2b14d1c..2ae7275 100644
+--- a/drivers/mmc/card/queue.c
++++ b/drivers/mmc/card/queue.c
+@@ -56,10 +56,9 @@ static int mmc_queue_thread(void *d)
+ spin_lock_irq(q->queue_lock);
+ set_current_state(TASK_INTERRUPTIBLE);
+ req = blk_fetch_request(q);
+- mq->mqrq_cur->req = req;
++ mq->req = req;
+ spin_unlock_irq(q->queue_lock);
+
+- mq->issue_fn(mq, req);
+ if (!req) {
+ if (kthread_should_stop()) {
+ set_current_state(TASK_RUNNING);
+@@ -72,6 +71,7 @@ static int mmc_queue_thread(void *d)
+ }
+ set_current_state(TASK_RUNNING);
+
++ mq->issue_fn(mq, req);
+ } while (1);
+ up(&mq->thread_sem);
+
+@@ -97,25 +97,10 @@ static void mmc_request(struct request_queue *q)
+ return;
+ }
+
+- if (!mq->mqrq_cur->req)
++ if (!mq->req)
+ wake_up_process(mq->thread);
+ }
+
+-struct scatterlist *mmc_alloc_sg(int sg_len, int *err)
+-{
+- struct scatterlist *sg;
+-
+- sg = kmalloc(sizeof(struct scatterlist)*sg_len, GFP_KERNEL);
+- if (!sg)
+- *err = -ENOMEM;
+- else {
+- *err = 0;
+- sg_init_table(sg, sg_len);
+- }
+-
+- return sg;
+-}
+-
+ /**
+ * mmc_init_queue - initialise a queue structure.
+ * @mq: mmc queue
+@@ -129,8 +114,6 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
+ struct mmc_host *host = card->host;
+ u64 limit = BLK_BOUNCE_HIGH;
+ int ret;
+- struct mmc_queue_req *mqrq_cur = &mq->mqrq[0];
+- struct mmc_queue_req *mqrq_prev = &mq->mqrq[1];
+
+ if (mmc_dev(host)->dma_mask && *mmc_dev(host)->dma_mask)
+ limit = *mmc_dev(host)->dma_mask;
+@@ -140,11 +123,8 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
+ if (!mq->queue)
+ return -ENOMEM;
+
+- memset(&mq->mqrq_cur, 0, sizeof(mq->mqrq_cur));
+- memset(&mq->mqrq_prev, 0, sizeof(mq->mqrq_prev));
+- mq->mqrq_cur = mqrq_cur;
+- mq->mqrq_prev = mqrq_prev;
+ mq->queue->queuedata = mq;
++ mq->req = NULL;
+
+ blk_queue_prep_rq(mq->queue, mmc_prep_request);
+ queue_flag_set_unlocked(QUEUE_FLAG_NONROT, mq->queue);
+@@ -178,64 +158,53 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
+ bouncesz = host->max_blk_count * 512;
+
+ if (bouncesz > 512) {
+- mqrq_cur->bounce_buf = kmalloc(bouncesz, GFP_KERNEL);
+- if (!mqrq_cur->bounce_buf) {
+- printk(KERN_WARNING "%s: unable to "
+- "allocate bounce cur buffer\n",
+- mmc_card_name(card));
+- }
+- mqrq_prev->bounce_buf = kmalloc(bouncesz, GFP_KERNEL);
+- if (!mqrq_prev->bounce_buf) {
++ mq->bounce_buf = kmalloc(bouncesz, GFP_KERNEL);
++ if (!mq->bounce_buf) {
+ printk(KERN_WARNING "%s: unable to "
+- "allocate bounce prev buffer\n",
++ "allocate bounce buffer\n",
+ mmc_card_name(card));
+- kfree(mqrq_cur->bounce_buf);
+- mqrq_cur->bounce_buf = NULL;
+ }
+ }
+
+- if (mqrq_cur->bounce_buf && mqrq_prev->bounce_buf) {
++ if (mq->bounce_buf) {
+ blk_queue_bounce_limit(mq->queue, BLK_BOUNCE_ANY);
+ blk_queue_max_hw_sectors(mq->queue, bouncesz / 512);
+ blk_queue_max_segments(mq->queue, bouncesz / 512);
+ blk_queue_max_segment_size(mq->queue, bouncesz);
+
+- mqrq_cur->sg = mmc_alloc_sg(1, &ret);
+- if (ret)
+- goto cleanup_queue;
+-
+- mqrq_cur->bounce_sg =
+- mmc_alloc_sg(bouncesz / 512, &ret);
+- if (ret)
+- goto cleanup_queue;
+-
+- mqrq_prev->sg = mmc_alloc_sg(1, &ret);
+- if (ret)
++ mq->sg = kmalloc(sizeof(struct scatterlist),
++ GFP_KERNEL);
++ if (!mq->sg) {
++ ret = -ENOMEM;
+ goto cleanup_queue;
++ }
++ sg_init_table(mq->sg, 1);
+
+- mqrq_prev->bounce_sg =
+- mmc_alloc_sg(bouncesz / 512, &ret);
+- if (ret)
++ mq->bounce_sg = kmalloc(sizeof(struct scatterlist) *
++ bouncesz / 512, GFP_KERNEL);
++ if (!mq->bounce_sg) {
++ ret = -ENOMEM;
+ goto cleanup_queue;
++ }
++ sg_init_table(mq->bounce_sg, bouncesz / 512);
+ }
+ }
+ #endif
+
+- if (!mqrq_cur->bounce_buf && !mqrq_prev->bounce_buf) {
++ if (!mq->bounce_buf) {
+ blk_queue_bounce_limit(mq->queue, limit);
+ blk_queue_max_hw_sectors(mq->queue,
+ min(host->max_blk_count, host->max_req_size / 512));
+ blk_queue_max_segments(mq->queue, host->max_segs);
+ blk_queue_max_segment_size(mq->queue, host->max_seg_size);
+
+- mqrq_cur->sg = mmc_alloc_sg(host->max_segs, &ret);
+- if (ret)
+- goto cleanup_queue;
+-
+-
+- mqrq_prev->sg = mmc_alloc_sg(host->max_segs, &ret);
+- if (ret)
++ mq->sg = kmalloc(sizeof(struct scatterlist) *
++ host->max_segs, GFP_KERNEL);
++ if (!mq->sg) {
++ ret = -ENOMEM;
+ goto cleanup_queue;
++ }
++ sg_init_table(mq->sg, host->max_segs);
+ }
+
+ sema_init(&mq->thread_sem, 1);
+@@ -250,22 +219,16 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
+
+ return 0;
+ free_bounce_sg:
+- kfree(mqrq_cur->bounce_sg);
+- mqrq_cur->bounce_sg = NULL;
+- kfree(mqrq_prev->bounce_sg);
+- mqrq_prev->bounce_sg = NULL;
+-
++ if (mq->bounce_sg)
++ kfree(mq->bounce_sg);
++ mq->bounce_sg = NULL;
+ cleanup_queue:
+- kfree(mqrq_cur->sg);
+- mqrq_cur->sg = NULL;
+- kfree(mqrq_cur->bounce_buf);
+- mqrq_cur->bounce_buf = NULL;
+-
+- kfree(mqrq_prev->sg);
+- mqrq_prev->sg = NULL;
+- kfree(mqrq_prev->bounce_buf);
+- mqrq_prev->bounce_buf = NULL;
+-
++ if (mq->sg)
++ kfree(mq->sg);
++ mq->sg = NULL;
++ if (mq->bounce_buf)
++ kfree(mq->bounce_buf);
++ mq->bounce_buf = NULL;
+ blk_cleanup_queue(mq->queue);
+ return ret;
+ }
+@@ -274,8 +237,6 @@ void mmc_cleanup_queue(struct mmc_queue *mq)
+ {
+ struct request_queue *q = mq->queue;
+ unsigned long flags;
+- struct mmc_queue_req *mqrq_cur = mq->mqrq_cur;
+- struct mmc_queue_req *mqrq_prev = mq->mqrq_prev;
+
+ /* Make sure the queue isn't suspended, as that will deadlock */
+ mmc_queue_resume(mq);
+@@ -289,23 +250,16 @@ void mmc_cleanup_queue(struct mmc_queue *mq)
+ blk_start_queue(q);
+ spin_unlock_irqrestore(q->queue_lock, flags);
+
+- kfree(mqrq_cur->bounce_sg);
+- mqrq_cur->bounce_sg = NULL;
+-
+- kfree(mqrq_cur->sg);
+- mqrq_cur->sg = NULL;
++ if (mq->bounce_sg)
++ kfree(mq->bounce_sg);
++ mq->bounce_sg = NULL;
+
+- kfree(mqrq_cur->bounce_buf);
+- mqrq_cur->bounce_buf = NULL;
++ kfree(mq->sg);
++ mq->sg = NULL;
+
+- kfree(mqrq_prev->bounce_sg);
+- mqrq_prev->bounce_sg = NULL;
+-
+- kfree(mqrq_prev->sg);
+- mqrq_prev->sg = NULL;
+-
+- kfree(mqrq_prev->bounce_buf);
+- mqrq_prev->bounce_buf = NULL;
++ if (mq->bounce_buf)
++ kfree(mq->bounce_buf);
++ mq->bounce_buf = NULL;
+
+ mq->card = NULL;
+ }
+@@ -358,27 +312,27 @@ void mmc_queue_resume(struct mmc_queue *mq)
+ /*
+ * Prepare the sg list(s) to be handed of to the host driver
+ */
+-unsigned int mmc_queue_map_sg(struct mmc_queue *mq, struct mmc_queue_req *mqrq)
++unsigned int mmc_queue_map_sg(struct mmc_queue *mq)
+ {
+ unsigned int sg_len;
+ size_t buflen;
+ struct scatterlist *sg;
+ int i;
+
+- if (!mqrq->bounce_buf)
+- return blk_rq_map_sg(mq->queue, mqrq->req, mqrq->sg);
++ if (!mq->bounce_buf)
++ return blk_rq_map_sg(mq->queue, mq->req, mq->sg);
+
+- BUG_ON(!mqrq->bounce_sg);
++ BUG_ON(!mq->bounce_sg);
+
+- sg_len = blk_rq_map_sg(mq->queue, mqrq->req, mqrq->bounce_sg);
++ sg_len = blk_rq_map_sg(mq->queue, mq->req, mq->bounce_sg);
+
+- mqrq->bounce_sg_len = sg_len;
++ mq->bounce_sg_len = sg_len;
+
+ buflen = 0;
+- for_each_sg(mqrq->bounce_sg, sg, sg_len, i)
++ for_each_sg(mq->bounce_sg, sg, sg_len, i)
+ buflen += sg->length;
+
+- sg_init_one(mqrq->sg, mqrq->bounce_buf, buflen);
++ sg_init_one(mq->sg, mq->bounce_buf, buflen);
+
+ return 1;
+ }
+@@ -387,19 +341,19 @@ unsigned int mmc_queue_map_sg(struct mmc_queue *mq, struct mmc_queue_req *mqrq)
+ * If writing, bounce the data to the buffer before the request
+ * is sent to the host driver
+ */
+-void mmc_queue_bounce_pre(struct mmc_queue_req *mqrq)
++void mmc_queue_bounce_pre(struct mmc_queue *mq)
+ {
+ unsigned long flags;
+
+- if (!mqrq->bounce_buf)
++ if (!mq->bounce_buf)
+ return;
+
+- if (rq_data_dir(mqrq->req) != WRITE)
++ if (rq_data_dir(mq->req) != WRITE)
+ return;
+
+ local_irq_save(flags);
+- sg_copy_to_buffer(mqrq->bounce_sg, mqrq->bounce_sg_len,
+- mqrq->bounce_buf, mqrq->sg[0].length);
++ sg_copy_to_buffer(mq->bounce_sg, mq->bounce_sg_len,
++ mq->bounce_buf, mq->sg[0].length);
+ local_irq_restore(flags);
+ }
+
+@@ -407,18 +361,19 @@ void mmc_queue_bounce_pre(struct mmc_queue_req *mqrq)
+ * If reading, bounce the data from the buffer after the request
+ * has been handled by the host driver
+ */
+-void mmc_queue_bounce_post(struct mmc_queue_req *mqrq)
++void mmc_queue_bounce_post(struct mmc_queue *mq)
+ {
+ unsigned long flags;
+
+- if (!mqrq->bounce_buf)
++ if (!mq->bounce_buf)
+ return;
+
+- if (rq_data_dir(mqrq->req) != READ)
++ if (rq_data_dir(mq->req) != READ)
+ return;
+
+ local_irq_save(flags);
+- sg_copy_from_buffer(mqrq->bounce_sg, mqrq->bounce_sg_len,
+- mqrq->bounce_buf, mqrq->sg[0].length);
++ sg_copy_from_buffer(mq->bounce_sg, mq->bounce_sg_len,
++ mq->bounce_buf, mq->sg[0].length);
+ local_irq_restore(flags);
+ }
++
+diff --git a/drivers/mmc/card/queue.h b/drivers/mmc/card/queue.h
+index 0e65807..64e66e0 100644
+--- a/drivers/mmc/card/queue.h
++++ b/drivers/mmc/card/queue.h
+@@ -4,33 +4,19 @@
+ struct request;
+ struct task_struct;
+
+-struct mmc_blk_request {
+- struct mmc_request mrq;
+- struct mmc_command cmd;
+- struct mmc_command stop;
+- struct mmc_data data;
+-};
+-
+-struct mmc_queue_req {
+- struct request *req;
+- struct mmc_blk_request brq;
+- struct scatterlist *sg;
+- char *bounce_buf;
+- struct scatterlist *bounce_sg;
+- unsigned int bounce_sg_len;
+-};
+-
+ struct mmc_queue {
+ struct mmc_card *card;
+ struct task_struct *thread;
+ struct semaphore thread_sem;
+ unsigned int flags;
++ struct request *req;
+ int (*issue_fn)(struct mmc_queue *, struct request *);
+ void *data;
+ struct request_queue *queue;
+- struct mmc_queue_req mqrq[2];
+- struct mmc_queue_req *mqrq_cur;
+- struct mmc_queue_req *mqrq_prev;
++ struct scatterlist *sg;
++ char *bounce_buf;
++ struct scatterlist *bounce_sg;
++ unsigned int bounce_sg_len;
+ };
+
+ extern int mmc_init_queue(struct mmc_queue *, struct mmc_card *, spinlock_t *);
+@@ -38,9 +24,8 @@ extern void mmc_cleanup_queue(struct mmc_queue *);
+ extern void mmc_queue_suspend(struct mmc_queue *);
+ extern void mmc_queue_resume(struct mmc_queue *);
+
+-extern unsigned int mmc_queue_map_sg(struct mmc_queue *,
+- struct mmc_queue_req *);
+-extern void mmc_queue_bounce_pre(struct mmc_queue_req *);
+-extern void mmc_queue_bounce_post(struct mmc_queue_req *);
++extern unsigned int mmc_queue_map_sg(struct mmc_queue *);
++extern void mmc_queue_bounce_pre(struct mmc_queue *);
++extern void mmc_queue_bounce_post(struct mmc_queue *);
+
+ #endif
+diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
+index 85296df..1f453ac 100644
+--- a/drivers/mmc/core/core.c
++++ b/drivers/mmc/core/core.c
+@@ -23,8 +23,6 @@
+ #include <linux/log2.h>
+ #include <linux/regulator/consumer.h>
+ #include <linux/pm_runtime.h>
+-#include <linux/fault-inject.h>
+-#include <linux/random.h>
+
+ #include <linux/mmc/card.h>
+ #include <linux/mmc/host.h>
+@@ -84,56 +82,6 @@ static void mmc_flush_scheduled_work(void)
+ flush_workqueue(workqueue);
+ }
+
+-#ifdef CONFIG_FAIL_MMC_REQUEST
+-
+-static DECLARE_FAULT_ATTR(fail_mmc_request);
+-
+-static int __init setup_fail_mmc_request(char *str)
+-{
+- return setup_fault_attr(&fail_mmc_request, str);
+-}
+-__setup("fail_mmc_request=", setup_fail_mmc_request);
+-
+-static void mmc_should_fail_request(struct mmc_host *host,
+- struct mmc_request *mrq)
+-{
+- struct mmc_command *cmd = mrq->cmd;
+- struct mmc_data *data = mrq->data;
+- static const int data_errors[] = {
+- -ETIMEDOUT,
+- -EILSEQ,
+- -EIO,
+- };
+-
+- if (!data)
+- return;
+-
+- if (cmd->error || data->error || !host->make_it_fail ||
+- !should_fail(&fail_mmc_request, data->blksz * data->blocks))
+- return;
+-
+- data->error = data_errors[random32() % ARRAY_SIZE(data_errors)];
+- data->bytes_xfered = (random32() % (data->bytes_xfered >> 9)) << 9;
+-}
+-
+-static int __init fail_mmc_request_debugfs(void)
+-{
+- return init_fault_attr_dentries(&fail_mmc_request,
+- "fail_mmc_request");
+-}
+-
+-late_initcall(fail_mmc_request_debugfs);
+-
+-#else /* CONFIG_FAIL_MMC_REQUEST */
+-
+-static inline void mmc_should_fail_request(struct mmc_host *host,
+- struct mmc_data *data)
+-{
+-}
+-
+-#endif /* CONFIG_FAIL_MMC_REQUEST */
+-
+-
+ /**
+ * mmc_request_done - finish processing an MMC request
+ * @host: MMC host which completed request
+@@ -160,8 +108,6 @@ void mmc_request_done(struct mmc_host *host, struct mmc_request *mrq)
+ cmd->error = 0;
+ host->ops->request(host, mrq);
+ } else {
+- mmc_should_fail_request(host, mrq);
+-
+ led_trigger_event(host->led, LED_OFF);
+
+ pr_debug("%s: req done (CMD%u): %d: %08x %08x %08x %08x\n",
+@@ -252,73 +198,8 @@ mmc_start_request(struct mmc_host *host, struct mmc_request *mrq)
+
+ static void mmc_wait_done(struct mmc_request *mrq)
+ {
+- complete(&mrq->completion);
+-}
+-
+-/**
+- * mmc_pre_req - Prepare for a new request
+- * @host: MMC host to prepare command
+- * @mrq: MMC request to prepare for
+- * @is_first_req: true if there is no previous started request
+- * that may run in parellel to this call, otherwise false
+- *
+- * mmc_pre_req() is called in prior to mmc_start_req() to let
+- * host prepare for the new request. Preparation of a request may be
+- * performed while another request is running on the host.
+- */
+-void mmc_pre_req(struct mmc_host *host, struct mmc_request *mrq,
+- bool is_first_req)
+-{
+- if (host->ops->pre_req)
+- host->ops->pre_req(host, mrq, is_first_req);
++ complete(mrq->done_data);
+ }
+-EXPORT_SYMBOL(mmc_pre_req);
+-
+-/**
+- * mmc_post_req - Post process a completed request
+- * @host: MMC host to post process command
+- * @mrq: MMC request to post process for
+- * @err: Error, if none zero, clean up any resources made in pre_req
+- *
+- * Let the host post process a completed request. Post processing of
+- * a request may be performed while another reuqest is running.
+- */
+-void mmc_post_req(struct mmc_host *host, struct mmc_request *mrq, int err)
+-{
+- if (host->ops->post_req)
+- host->ops->post_req(host, mrq, err);
+-}
+-EXPORT_SYMBOL(mmc_post_req);
+-
+-/**
+- * mmc_start_req - start a request
+- * @host: MMC host to start command
+- * @mrq: MMC request to start
+- *
+- * Start a new MMC custom command request for a host.
+- * Does not wait for the command to complete.
+- */
+-void mmc_start_req(struct mmc_host *host, struct mmc_request *mrq)
+-{
+- init_completion(&mrq->completion);
+- mrq->done = mmc_wait_done;
+-
+- mmc_start_request(host, mrq);
+-}
+-EXPORT_SYMBOL(mmc_start_req);
+-
+-/**
+- * mmc_wait_for_req_done - wait for completion of request
+- * @mrq: MMC request to wait for
+- *
+- * Wait for the command to complete. Does not attempt to parse the
+- * response.
+- */
+-void mmc_wait_for_req_done(struct mmc_request *mrq)
+-{
+- wait_for_completion(&mrq->completion);
+-}
+-EXPORT_SYMBOL(mmc_wait_for_req_done);
+
+ /**
+ * mmc_wait_for_req - start a request and wait for completion
+@@ -331,9 +212,16 @@ EXPORT_SYMBOL(mmc_wait_for_req_done);
+ */
+ void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq)
+ {
+- mmc_start_req(host, mrq);
+- mmc_wait_for_req_done(mrq);
++ DECLARE_COMPLETION_ONSTACK(complete);
++
++ mrq->done_data = &complete;
++ mrq->done = mmc_wait_done;
++
++ mmc_start_request(host, mrq);
++
++ wait_for_completion(&complete);
+ }
++
+ EXPORT_SYMBOL(mmc_wait_for_req);
+
+ /**
+diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
+index 588e76f..998797e 100644
+--- a/drivers/mmc/core/debugfs.c
++++ b/drivers/mmc/core/debugfs.c
+@@ -188,11 +188,6 @@ void mmc_add_host_debugfs(struct mmc_host *host)
+ root, &host->clk_delay))
+ goto err_node;
+ #endif
+-#ifdef CONFIG_FAIL_MMC_REQUEST
+- if (!debugfs_create_u8("make-it-fail", S_IRUSR | S_IWUSR,
+- root, &host->make_it_fail))
+- goto err_node;
+-#endif
+ return;
+
+ err_node:
+diff --git a/drivers/mmc/host/glamo-mci.c b/drivers/mmc/host/glamo-mci.c
+index 02c4b69..f298658 100644
+--- a/drivers/mmc/host/glamo-mci.c
++++ b/drivers/mmc/host/glamo-mci.c
+@@ -49,10 +49,10 @@ struct glamo_mci_host {
+ unsigned short vdd;
+ char power_mode;
+
+- unsigned long transfer_start;
+- unsigned long request_start;
+-
+ unsigned char request_counter;
++
++ struct workqueue_struct *workqueue;
++ struct work_struct read_work;
+ };
+
+ static void glamo_mci_send_request(struct mmc_host *mmc,
+@@ -165,21 +165,12 @@ static int glamo_mci_clock_enable(struct mmc_host *mmc)
+ return 0;
+ }
+
+-static void __iomem *glamo_mci_get_data_addr(struct glamo_mci_host *host,
+- struct mmc_data *data)
+-{
+- void __iomem *addr = host->data_base;
+-
+- if (data->host_cookie & 1)
+- addr += resource_size(host->data_mem) / 2;
+-
+- return addr;
+-}
+
++#ifndef GLAMO_MCI_WORKER
+ static void do_pio_read(struct glamo_mci_host *host, struct mmc_data *data)
+ {
+- void __iomem *from_ptr = glamo_mci_get_data_addr(host, data);
+ struct sg_mapping_iter miter;
++ uint16_t __iomem *from_ptr = host->data_base;
+
+ dev_dbg(&host->pdev->dev, "pio_read():\n");
+
+@@ -187,7 +178,9 @@ static void do_pio_read(struct glamo_mci_host *host, struct mmc_data *data)
+
+ while (sg_miter_next(&miter)) {
+ memcpy(miter.addr, from_ptr, miter.length);
+- from_ptr += miter.length;
++ from_ptr += miter.length >> 1;
++
++ data->bytes_xfered += miter.length;
+ }
+
+ sg_miter_stop(&miter);
+@@ -195,18 +188,19 @@ static void do_pio_read(struct glamo_mci_host *host, struct mmc_data *data)
+ dev_dbg(&host->pdev->dev, "pio_read(): "
+ "complete (no more data)\n");
+ }
++#endif
+
+ static void do_pio_write(struct glamo_mci_host *host, struct mmc_data *data)
+ {
+- void __iomem *to_ptr = glamo_mci_get_data_addr(host, data);
+ struct sg_mapping_iter miter;
++ uint16_t __iomem *to_ptr = host->data_base;
+
+ dev_dbg(&host->pdev->dev, "pio_write():\n");
+ sg_miter_start(&miter, data->sg, data->sg_len, SG_MITER_FROM_SG);
+
+ while (sg_miter_next(&miter)) {
+ memcpy(to_ptr, miter.addr, miter.length);
+- to_ptr += miter.length;
++ to_ptr += miter.length >> 1;
+
+ data->bytes_xfered += miter.length;
+ }
+@@ -284,11 +278,12 @@ static irqreturn_t glamo_mci_irq(int irq, void *data)
+ if (mrq->stop)
+ glamo_mci_send_command(host, mrq->stop);
+
+- if (mrq->data && (mrq->data->flags & MMC_DATA_READ)) {
+- mrq->data->bytes_xfered = mrq->data->blocks * mrq->data->blksz;
+- if (!mrq->data->host_cookie)
+- do_pio_read(host, mrq->data);
+- }
++ if (cmd->data->flags & MMC_DATA_READ)
++#ifndef GLAMO_MCI_WORKER
++ do_pio_read(host, cmd->data);
++#else
++ flush_workqueue(host->workqueue);
++#endif
+
+ if (mrq->stop)
+ mrq->stop->error = glamo_mci_wait_idle(host, jiffies + HZ);
+@@ -300,6 +295,64 @@ done:
+ return IRQ_HANDLED;
+ }
+
++#ifdef GLAMO_MCI_WORKER
++static void glamo_mci_read_worker(struct work_struct *work)
++{
++ struct glamo_mci_host *host = container_of(work, struct glamo_mci_host,
++ read_work);
++ struct mmc_command *cmd;
++ uint16_t status;
++ uint16_t blocks_ready;
++ size_t data_read = 0;
++ size_t data_ready;
++ struct scatterlist *sg;
++ uint16_t __iomem *from_ptr = host->data_base;
++ void *sg_pointer;
++
++
++ cmd = host->mrq->cmd;
++ sg = cmd->data->sg;
++ do {
++ /*
++ * TODO: How to get rid of that?
++ * Maybe just drop it... In fact, it is already handled in
++ * the IRQ handler, maybe we should only check cmd->error.
++ * But the question is: what happens between the moment
++ * the error occurs, and the moment the IRQ handler handles it?
++ */
++ status = glamomci_reg_read(host, GLAMO_REG_MMC_RB_STAT1);
++
++ if (status & (GLAMO_STAT1_MMC_RTOUT | GLAMO_STAT1_MMC_DTOUT))
++ cmd->error = -ETIMEDOUT;
++ if (status & (GLAMO_STAT1_MMC_BWERR | GLAMO_STAT1_MMC_BRERR))
++ cmd->error = -EILSEQ;
++ if (cmd->error) {
++ dev_info(&host->pdev->dev, "Error after cmd: 0x%x\n",
++ status);
++ return;
++ }
++
++ blocks_ready = glamomci_reg_read(host, GLAMO_REG_MMC_RB_BLKCNT);
++ data_ready = blocks_ready * cmd->data->blksz;
++
++ if (data_ready == data_read)
++ yield();
++
++ while (sg && data_read + sg->length <= data_ready) {
++ sg_pointer = page_address(sg_page(sg)) + sg->offset;
++ memcpy(sg_pointer, from_ptr, sg->length);
++ from_ptr += sg->length >> 1;
++
++ data_read += sg->length;
++
++ sg = sg_next(sg);
++ }
++
++ } while (sg);
++ cmd->data->bytes_xfered = data_read;
++}
++#endif
++
+ static void glamo_mci_send_command(struct glamo_mci_host *host,
+ struct mmc_command *cmd)
+ {
+@@ -480,29 +533,28 @@ static void glamo_mci_send_command(struct glamo_mci_host *host,
+ (readw(&reg_resp[2]) << 24);
+ }
+ }
++
++#ifdef GLAMO_MCI_WORKER
++ /* We'll only get an interrupt when all data has been transfered.
++ By starting to copy data when it's avaiable we can increase
++ throughput by up to 30%. */
++ if (cmd->data && (cmd->data->flags & MMC_DATA_READ))
++ queue_work(host->workqueue, &host->read_work);
++#endif
++
+ }
+
+ static int glamo_mci_prepare_pio(struct glamo_mci_host *host,
+ struct mmc_data *data)
+ {
+- unsigned long addr = host->data_mem->start;
+-
+- if (data->host_cookie & 1)
+- addr += resource_size(host->data_mem) / 2;
+-
+ /* set up the block info */
+ glamomci_reg_write(host, GLAMO_REG_MMC_DATBLKLEN, data->blksz);
+ glamomci_reg_write(host, GLAMO_REG_MMC_DATBLKCNT, data->blocks);
+
+- if (data->flags & MMC_DATA_WRITE) {
+- glamomci_reg_write(host, GLAMO_REG_MMC_WDATADS1, addr);
+- glamomci_reg_write(host, GLAMO_REG_MMC_WDATADS2, addr >> 16);
+- } else {
+- glamomci_reg_write(host, GLAMO_REG_MMC_RDATADS1, addr);
+- glamomci_reg_write(host, GLAMO_REG_MMC_RDATADS2, addr >> 16);
+- }
++ data->bytes_xfered = 0;
+
+- if ((data->flags & MMC_DATA_WRITE) && !data->host_cookie)
++ /* if write, prep the write into the shared RAM before the command */
++ if (data->flags & MMC_DATA_WRITE)
+ do_pio_write(host, data);
+
+ dev_dbg(&host->pdev->dev, "(blksz=%d, count=%d)\n",
+@@ -517,8 +569,6 @@ static void glamo_mci_send_request(struct mmc_host *mmc,
+ struct mmc_command *cmd = mrq->cmd;
+
+ host->request_counter++;
+- host->request_start = jiffies;
+-
+ if (cmd->data) {
+ if (glamo_mci_prepare_pio(host, cmd->data)) {
+ cmd->error = -EIO;
+@@ -639,42 +689,21 @@ static void glamo_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
+ mmc_host_lazy_disable(host->mmc);
+ }
+
+-static void glamo_mci_pre_request(struct mmc_host *mmc,
+- struct mmc_request *mrq, bool is_first_req)
+-{
+- struct glamo_mci_host *host = mmc_priv(mmc);
+-
+- mrq->data->host_cookie = (host->request_counter & 1) | 2;
+-
+- /* if write, prep the write into the shared RAM before the command */
+- if (mrq->data->flags & MMC_DATA_WRITE)
+- do_pio_write(host, mrq->data);
+-}
+
+-static void glamo_mci_post_request(struct mmc_host *mmc,
+- struct mmc_request *mrq, int err)
++/*
++ * no physical write protect supported by us
++ */
++static int glamo_mci_get_ro(struct mmc_host *mmc)
+ {
+- struct glamo_mci_host *host = mmc_priv(mmc);
+-
+- if (!mrq->data->host_cookie)
+- return;
+-
+- if (err)
+- return;
+-
+- if (mrq->data->flags & MMC_DATA_READ)
+- do_pio_read(host, mrq->data);
+-
+- mrq->data->host_cookie = 0;
++ return 0;
+ }
+
+ static struct mmc_host_ops glamo_mci_ops = {
+ .enable = glamo_mci_clock_enable,
+ .disable = glamo_mci_clock_disable,
+ .request = glamo_mci_send_request,
+- .post_req = glamo_mci_post_request,
+- .pre_req = glamo_mci_pre_request,
+ .set_ios = glamo_mci_set_ios,
++ .get_ro = glamo_mci_get_ro,
+ };
+
+ static int __devinit glamo_mci_probe(struct platform_device *pdev)
+@@ -702,6 +731,11 @@ static int __devinit glamo_mci_probe(struct platform_device *pdev)
+
+ host->irq = platform_get_irq(pdev, 0);
+
++#ifdef GLAMO_MCI_WORKER
++ INIT_WORK(&host->read_work, glamo_mci_read_worker);
++ host->workqueue = create_singlethread_workqueue("glamo-mci-read");
++#endif
++
+ host->regulator = regulator_get(pdev->dev.parent, "SD_3V3");
+ if (IS_ERR(host->regulator)) {
+ dev_err(&pdev->dev, "Cannot proceed without regulator.\n");
+@@ -789,7 +823,7 @@ static int __devinit glamo_mci_probe(struct platform_device *pdev)
+
+ mmc->max_blk_count = (1 << 16) - 1; /* GLAMO_REG_MMC_RB_BLKCNT */
+ mmc->max_blk_size = (1 << 12) - 1; /* GLAMO_REG_MMC_RB_BLKLEN */
+- mmc->max_req_size = resource_size(host->data_mem) / 2;
++ mmc->max_req_size = resource_size(host->data_mem);
+ mmc->max_seg_size = mmc->max_req_size;
+ mmc->max_segs = 128;
+
+@@ -834,6 +868,9 @@ probe_free_mem_region_mmio:
+ probe_regulator_put:
+ regulator_put(host->regulator);
+ probe_free_host:
++#ifdef GLAMO_MCI_WORKER
++ destroy_workqueue(host->workqueue);
++#endif
+ mmc_free_host(mmc);
+ probe_out:
+ return ret;
+@@ -844,6 +881,11 @@ static int __devexit glamo_mci_remove(struct platform_device *pdev)
+ struct mmc_host *mmc = platform_get_drvdata(pdev);
+ struct glamo_mci_host *host = mmc_priv(mmc);
+
++#ifdef GLAMO_MCI_WORKER
++ flush_workqueue(host->workqueue);
++ destroy_workqueue(host->workqueue);
++#endif
++
+ mmc_host_enable(mmc);
+ mmc_remove_host(mmc);
+ mmc_host_disable(mmc);
+diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
+index cb5d2c0..66b75c6 100644
+--- a/drivers/mtd/nand/s3c2410.c
++++ b/drivers/mtd/nand/s3c2410.c
+@@ -773,6 +773,7 @@ static void s3c2410_nand_init_chip(struct s3c2410_nand_info *info,
+ chip->priv = nmtd;
+ chip->options = set->options;
+ chip->controller = &info->controller;
++ chip->badblockbits = 8;
+
+ switch (info->cpu_type) {
+ case TYPE_S3C2410:
+diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
+index 5bbfb71..07f27af 100644
+--- a/include/linux/mmc/core.h
++++ b/include/linux/mmc/core.h
+@@ -117,7 +117,6 @@ struct mmc_data {
+
+ unsigned int sg_len; /* size of scatter list */
+ struct scatterlist *sg; /* I/O scatter list */
+- s32 host_cookie; /* host private data */
+ };
+
+ struct mmc_request {
+@@ -125,19 +124,13 @@ struct mmc_request {
+ struct mmc_data *data;
+ struct mmc_command *stop;
+
+- struct completion completion;
++ void *done_data; /* completion data */
+ void (*done)(struct mmc_request *);/* completion function */
+ };
+
+ struct mmc_host;
+ struct mmc_card;
+
+-extern void mmc_pre_req(struct mmc_host *host, struct mmc_request *mrq,
+- bool is_first_req);
+-extern void mmc_post_req(struct mmc_host *host, struct mmc_request *mrq,
+- int err);
+-extern void mmc_start_req(struct mmc_host *host, struct mmc_request *mrq);
+-extern void mmc_wait_for_req_done(struct mmc_request *mrq);
+ extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *);
+ extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);
+ extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *,
+diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
+index 8b2b44b..bcb793e 100644
+--- a/include/linux/mmc/host.h
++++ b/include/linux/mmc/host.h
+@@ -88,15 +88,6 @@ struct mmc_host_ops {
+ */
+ int (*enable)(struct mmc_host *host);
+ int (*disable)(struct mmc_host *host, int lazy);
+- /*
+- * It is optional for the host to implement pre_req and post_req in
+- * order to support double buffering of requests (prepare one
+- * request while another request is active).
+- */
+- void (*post_req)(struct mmc_host *host, struct mmc_request *req,
+- int err);
+- void (*pre_req)(struct mmc_host *host, struct mmc_request *req,
+- bool is_first_req);
+ void (*request)(struct mmc_host *host, struct mmc_request *req);
+ /*
+ * Avoid calling these three functions too often or in a "fast path",
+@@ -251,9 +242,7 @@ struct mmc_host {
+ #endif
+
+ struct dentry *debugfs_root;
+-#ifdef CONFIG_FAIL_MMC_REQUEST
+- u8 make_it_fail;
+-#endif
++
+ unsigned long private[0] ____cacheline_aligned;
+ };
+
+diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
+index 330fc70..c768bcd 100644
+--- a/lib/Kconfig.debug
++++ b/lib/Kconfig.debug
+@@ -1057,17 +1057,6 @@ config FAIL_IO_TIMEOUT
+ Only works with drivers that use the generic timeout handling,
+ for others it wont do anything.
+
+-config FAIL_MMC_REQUEST
+- bool "Fault-injection capability for MMC IO"
+- select DEBUG_FS
+- depends on FAULT_INJECTION
+- help
+- Provide fault-injection capability for MMC IO.
+- This will make the mmc core return data errors. This is
+- useful for testing the error handling in the mmc block device
+- and how the mmc host driver handle retries from
+- the block device.
+-
+ config FAULT_INJECTION_DEBUG_FS
+ bool "Debugfs entries for fault-injection capabilities"
+ depends on FAULT_INJECTION && SYSFS && DEBUG_FS
diff --git a/recipes/linux/linux-2.6.39/spitz/defconfig b/recipes/linux/linux-2.6.39/spitz/defconfig
new file mode 100644
index 0000000000..43b22dc597
--- /dev/null
+++ b/recipes/linux/linux-2.6.39/spitz/defconfig
@@ -0,0 +1,381 @@
+CONFIG_EXPERIMENTAL=y
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SYSVIPC=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
+CONFIG_IKCONFIG=m
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_RD_BZIP2=y
+CONFIG_RD_LZMA=y
+CONFIG_RD_LZO=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_EMBEDDED=y
+CONFIG_SLOB=y
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=m
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+# CONFIG_LBDAF is not set
+CONFIG_IOSCHED_DEADLINE=m
+CONFIG_IOSCHED_CFQ=m
+CONFIG_ARCH_PXA=y
+CONFIG_PXA_SHARPSL=y
+CONFIG_MACH_AKITA=y
+CONFIG_MACH_BORZOI=y
+CONFIG_PCCARD=y
+CONFIG_PCMCIA_PXA2XX=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="console=ttyS0,115200n8 console=tty1 fbcon=rotate:1 quiet"
+CONFIG_KEXEC=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_BINFMT_AOUT=m
+CONFIG_BINFMT_MISC=m
+CONFIG_PM_RUNTIME=y
+CONFIG_NET=y
+CONFIG_PACKET=m
+CONFIG_UNIX=y
+CONFIG_XFRM_USER=m
+CONFIG_INET=y
+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_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+CONFIG_IPV6_TUNNEL=m
+CONFIG_NETFILTER=y
+CONFIG_NF_CONNTRACK=m
+CONFIG_NF_CONNTRACK_FTP=m
+CONFIG_NF_CONNTRACK_H323=m
+CONFIG_NF_CONNTRACK_IRC=m
+CONFIG_NF_CONNTRACK_SIP=m
+CONFIG_NF_CONNTRACK_IPV4=m
+CONFIG_IP_NF_IPTABLES=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_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+CONFIG_IRDA=m
+CONFIG_IRLAN=m
+CONFIG_IRNET=m
+CONFIG_IRCOMM=m
+CONFIG_PXA_FICP=m
+CONFIG_BT=m
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=m
+CONFIG_BT_HCIBTUSB=m
+CONFIG_BT_HCIBTSDIO=m
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIUART_ATH3K=y
+CONFIG_BT_HCIUART_LL=y
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBPA10X=m
+CONFIG_BT_HCIBFUSB=m
+CONFIG_BT_HCIDTL1=m
+CONFIG_BT_HCIBT3C=m
+CONFIG_BT_HCIBLUECARD=m
+CONFIG_BT_HCIBTUART=m
+CONFIG_BT_HCIVHCI=m
+CONFIG_BT_MRVL=m
+CONFIG_BT_MRVL_SDIO=m
+CONFIG_BT_ATH3K=m
+CONFIG_CFG80211=m
+# CONFIG_CFG80211_DEFAULT_PS is not set
+CONFIG_MAC80211=m
+# CONFIG_MAC80211_RC_MINSTREL is not set
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_MTD=y
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_ROM=y
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_VERIFY_WRITE=y
+CONFIG_MTD_NAND_SHARPSL=y
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_GLUEBI=m
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_MISC_DEVICES=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_BLK_DEV_SR=m
+CONFIG_CHR_DEV_SG=m
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_ATA=y
+CONFIG_PATA_PXA=y
+CONFIG_PATA_PCMCIA=y
+CONFIG_NETDEVICES=y
+CONFIG_TUN=m
+CONFIG_NET_ETHERNET=y
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+CONFIG_AIRO_CS=m
+CONFIG_HOSTAP=m
+CONFIG_HOSTAP_FIRMWARE=y
+CONFIG_HOSTAP_CS=m
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_NET_DM9601=m
+# CONFIG_USB_NET_CDC_SUBSET is not set
+CONFIG_USB_SIERRA_NET=m
+CONFIG_NET_PCMCIA=y
+CONFIG_PCMCIA_PCNET=m
+CONFIG_PPP=m
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=640
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=480
+CONFIG_INPUT_EVDEV=y
+CONFIG_INPUT_APMPOWER=y
+# CONFIG_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_MATRIX=y
+# CONFIG_INPUT_MOUSE is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_ADS7846=y
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_UINPUT=m
+# CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_SERIAL_8250=m
+CONFIG_SERIAL_8250_CS=m
+CONFIG_SERIAL_PXA=y
+CONFIG_SERIAL_PXA_CONSOLE=y
+CONFIG_RAMOOPS=y
+CONFIG_SPI=y
+CONFIG_SPI_PXA2XX=y
+CONFIG_GPIO_SYSFS=y
+CONFIG_POWER_SUPPLY=y
+CONFIG_POWER_SUPPLY_DEBUG=y
+CONFIG_PDA_POWER=y
+CONFIG_APM_POWER=y
+CONFIG_FB=y
+CONFIG_FB_PXA=y
+CONFIG_FB_PXA_OVERLAY=y
+CONFIG_FB_PXA_SMARTPANEL=y
+CONFIG_FB_PXA_PARAMETERS=y
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=y
+CONFIG_LCD_CORGI=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+CONFIG_DISPLAY_SUPPORT=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+CONFIG_FONTS=y
+CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_SOUND=m
+CONFIG_SND=m
+CONFIG_SND_SEQUENCER=m
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_PXA2XX_AC97=m
+CONFIG_SND_USB_AUDIO=m
+CONFIG_SND_SOC=m
+CONFIG_SND_PXA2XX_SOC=m
+CONFIG_SND_PXA2XX_SOC_SPITZ=m
+CONFIG_HID=m
+CONFIG_USB_KBD=m
+CONFIG_USB_MOUSE=m
+CONFIG_USB=m
+CONFIG_USB_DEBUG=y
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_OTG_WHITELIST=y
+CONFIG_USB_MON=m
+CONFIG_USB_OHCI_HCD=m
+CONFIG_USB_SL811_HCD=m
+CONFIG_USB_SL811_CS=m
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+CONFIG_USB_STORAGE=m
+CONFIG_USB_MDC800=m
+CONFIG_USB_MICROTEK=m
+CONFIG_USB_SERIAL=m
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_BELKIN=m
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+CONFIG_USB_SERIAL_CYPRESS_M8=m
+CONFIG_USB_SERIAL_EMPEG=m
+CONFIG_USB_SERIAL_FTDI_SIO=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_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_PL2303=m
+CONFIG_USB_SERIAL_SAFE=m
+CONFIG_USB_SERIAL_TI=m
+CONFIG_USB_SERIAL_CYBERJACK=m
+CONFIG_USB_SERIAL_XIRCOM=m
+CONFIG_USB_SERIAL_OMNINET=m
+CONFIG_USB_EMI62=m
+CONFIG_USB_EMI26=m
+CONFIG_USB_RIO500=m
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+CONFIG_USB_LED=m
+CONFIG_USB_CYTHERM=m
+CONFIG_USB_IDMOUSE=m
+CONFIG_USB_GADGET=m
+CONFIG_USB_GADGET_DEBUG_FILES=y
+CONFIG_USB_GADGET_DEBUG_FS=y
+CONFIG_USB_GADGET_PXA27X=y
+CONFIG_USB_ZERO=m
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_EEM=y
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+CONFIG_USB_MASS_STORAGE=m
+CONFIG_USB_G_SERIAL=m
+CONFIG_USB_CDC_COMPOSITE=m
+CONFIG_USB_G_MULTI=m
+CONFIG_USB_G_MULTI_CDC=y
+CONFIG_USB_GPIO_VBUS=m
+CONFIG_USB_ULPI=y
+CONFIG_NOP_USB_XCEIV=m
+CONFIG_MMC=y
+CONFIG_MMC_UNSAFE_RESUME=y
+CONFIG_MMC_PXA=y
+CONFIG_MMC_SPI=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_RTC_CLASS=m
+CONFIG_RTC_DRV_SA1100=m
+CONFIG_RTC_DRV_PXA=m
+CONFIG_EXT2_FS=y
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+# CONFIG_EXT3_FS_XATTR is not set
+CONFIG_EXT4_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_SUMMARY=y
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RUBIN=y
+CONFIG_UBIFS_FS=y
+CONFIG_UBIFS_FS_ADVANCED_COMPR=y
+CONFIG_CRAMFS=m
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+CONFIG_NFS_V4=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V4=y
+CONFIG_CIFS=m
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_NLS_DEFAULT="cp437"
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=y
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_FS=y
+CONFIG_SYSCTL_SYSCALL_CHECK=y
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_TEST=m
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_TWOFISH=m
+# CONFIG_CRYPTO_HW is not set
+CONFIG_CRC_CCITT=y
+CONFIG_LIBCRC32C=m
diff --git a/recipes/linux/linux-2.6.39/tosa/defconfig b/recipes/linux/linux-2.6.39/tosa/defconfig
new file mode 100644
index 0000000000..4b72d03f85
--- /dev/null
+++ b/recipes/linux/linux-2.6.39/tosa/defconfig
@@ -0,0 +1,381 @@
+CONFIG_EXPERIMENTAL=y
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SYSVIPC=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
+CONFIG_IKCONFIG=m
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_RD_BZIP2=y
+CONFIG_RD_LZMA=y
+CONFIG_RD_LZO=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_EMBEDDED=y
+CONFIG_SLOB=y
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=m
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+# CONFIG_LBDAF is not set
+CONFIG_IOSCHED_DEADLINE=m
+CONFIG_IOSCHED_CFQ=m
+CONFIG_ARCH_PXA=y
+CONFIG_PXA_SHARPSL=y
+CONFIG_MACH_TOSA=y
+CONFIG_TOSA_BT=m
+CONFIG_PCCARD=y
+CONFIG_PCMCIA_PXA2XX=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="console=ttyS0,115200n8 console=tty1 quiet"
+CONFIG_KEXEC=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_BINFMT_AOUT=m
+CONFIG_BINFMT_MISC=m
+CONFIG_PM_RUNTIME=y
+CONFIG_APM_EMULATION=y
+CONFIG_NET=y
+CONFIG_PACKET=m
+CONFIG_UNIX=y
+CONFIG_XFRM_USER=m
+CONFIG_INET=y
+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_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+CONFIG_IPV6_TUNNEL=m
+CONFIG_NETFILTER=y
+CONFIG_NF_CONNTRACK=m
+CONFIG_NF_CONNTRACK_FTP=m
+CONFIG_NF_CONNTRACK_H323=m
+CONFIG_NF_CONNTRACK_IRC=m
+CONFIG_NF_CONNTRACK_SIP=m
+CONFIG_NF_CONNTRACK_IPV4=m
+CONFIG_IP_NF_IPTABLES=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_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+CONFIG_IRDA=m
+CONFIG_IRLAN=m
+CONFIG_IRNET=m
+CONFIG_IRCOMM=m
+CONFIG_PXA_FICP=m
+CONFIG_BT=m
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=m
+CONFIG_BT_HCIBTUSB=m
+CONFIG_BT_HCIBTSDIO=m
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIUART_ATH3K=y
+CONFIG_BT_HCIUART_LL=y
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBPA10X=m
+CONFIG_BT_HCIBFUSB=m
+CONFIG_BT_HCIDTL1=m
+CONFIG_BT_HCIBT3C=m
+CONFIG_BT_HCIBLUECARD=m
+CONFIG_BT_HCIBTUART=m
+CONFIG_BT_HCIVHCI=m
+CONFIG_BT_MRVL=m
+CONFIG_BT_MRVL_SDIO=m
+CONFIG_BT_ATH3K=m
+CONFIG_CFG80211=m
+# CONFIG_CFG80211_DEFAULT_PS is not set
+CONFIG_MAC80211=m
+# CONFIG_MAC80211_RC_MINSTREL is not set
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_MTD=y
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_ROM=y
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_VERIFY_WRITE=y
+CONFIG_MTD_NAND_TMIO=y
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_GLUEBI=m
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_MISC_DEVICES=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_BLK_DEV_SR=m
+CONFIG_CHR_DEV_SG=m
+CONFIG_SCSI_MULTI_LUN=y
+CONFIG_ATA=y
+# CONFIG_SATA_PMP is not set
+CONFIG_PATA_PXA=y
+CONFIG_PATA_PCMCIA=y
+CONFIG_NETDEVICES=y
+CONFIG_TUN=m
+CONFIG_NET_ETHERNET=y
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+CONFIG_AIRO_CS=m
+CONFIG_HOSTAP=m
+CONFIG_HOSTAP_FIRMWARE=y
+CONFIG_HOSTAP_CS=m
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_NET_DM9601=m
+# CONFIG_USB_NET_CDC_SUBSET is not set
+CONFIG_USB_SIERRA_NET=m
+CONFIG_NET_PCMCIA=y
+CONFIG_PCMCIA_PCNET=m
+CONFIG_PPP=m
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=480
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=640
+CONFIG_INPUT_EVDEV=y
+CONFIG_INPUT_APMPOWER=y
+# CONFIG_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_MATRIX=y
+# CONFIG_INPUT_MOUSE is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_UINPUT=m
+# CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_SERIAL_8250=m
+CONFIG_SERIAL_8250_CS=m
+CONFIG_SERIAL_PXA=y
+CONFIG_SERIAL_PXA_CONSOLE=y
+CONFIG_RAMOOPS=y
+CONFIG_I2C=y
+CONFIG_I2C_PXA=y
+CONFIG_SPI=y
+CONFIG_SPI_PXA2XX=y
+CONFIG_GPIO_SYSFS=y
+CONFIG_POWER_SUPPLY=y
+CONFIG_POWER_SUPPLY_DEBUG=y
+CONFIG_PDA_POWER=y
+CONFIG_APM_POWER=y
+CONFIG_SENSORS_MAX1111=y
+CONFIG_MFD_TC6393XB=y
+CONFIG_FB=y
+CONFIG_FB_TMIO=y
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CLASS_DEVICE=y
+CONFIG_LCD_TOSA=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+CONFIG_BACKLIGHT_TOSA=y
+CONFIG_DISPLAY_SUPPORT=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FONTS=y
+CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_SOUND=m
+CONFIG_SND=m
+CONFIG_SND_SEQUENCER=m
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_PXA2XX_AC97=m
+CONFIG_SND_USB_AUDIO=m
+CONFIG_SND_SOC=m
+CONFIG_SND_PXA2XX_SOC=m
+CONFIG_SND_PXA2XX_SOC_TOSA=m
+CONFIG_HID=m
+CONFIG_USB_KBD=m
+CONFIG_USB_MOUSE=m
+CONFIG_USB=m
+CONFIG_USB_DEBUG=y
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_OTG_WHITELIST=y
+CONFIG_USB_MON=m
+CONFIG_USB_SL811_HCD=m
+CONFIG_USB_SL811_CS=m
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+CONFIG_USB_STORAGE=m
+CONFIG_USB_MDC800=m
+CONFIG_USB_MICROTEK=m
+CONFIG_USB_SERIAL=m
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_BELKIN=m
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+CONFIG_USB_SERIAL_CYPRESS_M8=m
+CONFIG_USB_SERIAL_EMPEG=m
+CONFIG_USB_SERIAL_FTDI_SIO=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_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_PL2303=m
+CONFIG_USB_SERIAL_SAFE=m
+CONFIG_USB_SERIAL_TI=m
+CONFIG_USB_SERIAL_CYBERJACK=m
+CONFIG_USB_SERIAL_XIRCOM=m
+CONFIG_USB_SERIAL_OMNINET=m
+CONFIG_USB_EMI62=m
+CONFIG_USB_EMI26=m
+CONFIG_USB_RIO500=m
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+CONFIG_USB_LED=m
+CONFIG_USB_CYTHERM=m
+CONFIG_USB_IDMOUSE=m
+CONFIG_USB_GADGET=m
+CONFIG_USB_GADGET_DEBUG_FILES=y
+CONFIG_USB_GADGET_DEBUG_FS=y
+CONFIG_USB_ZERO=m
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_EEM=y
+CONFIG_USB_GADGETFS=m
+CONFIG_USB_FILE_STORAGE=m
+CONFIG_USB_MASS_STORAGE=m
+CONFIG_USB_G_SERIAL=m
+CONFIG_USB_CDC_COMPOSITE=m
+CONFIG_USB_G_MULTI=m
+CONFIG_USB_G_MULTI_CDC=y
+CONFIG_USB_GPIO_VBUS=m
+CONFIG_USB_ULPI=y
+CONFIG_NOP_USB_XCEIV=m
+CONFIG_MMC=y
+CONFIG_MMC_UNSAFE_RESUME=y
+CONFIG_MMC_PXA=y
+CONFIG_MMC_SPI=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_RTC_CLASS=m
+CONFIG_RTC_DRV_SA1100=m
+CONFIG_RTC_DRV_PXA=m
+CONFIG_EXT2_FS=y
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+# CONFIG_EXT3_FS_XATTR is not set
+CONFIG_EXT4_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_SUMMARY=y
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RUBIN=y
+CONFIG_UBIFS_FS=y
+CONFIG_UBIFS_FS_ADVANCED_COMPR=y
+CONFIG_CRAMFS=m
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+CONFIG_NFS_V4=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V4=y
+CONFIG_CIFS=m
+CONFIG_PARTITION_ADVANCED=y
+CONFIG_NLS_DEFAULT="cp437"
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=y
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_FS=y
+CONFIG_SYSCTL_SYSCALL_CHECK=y
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_TEST=m
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_TWOFISH=m
+# CONFIG_CRYPTO_HW is not set
+CONFIG_CRC_CCITT=y
+CONFIG_LIBCRC32C=m
diff --git a/recipes/linux/linux-bug20-linaro_2.6.35.bb b/recipes/linux/linux-bug20-linaro_2.6.35.bb
index 6f1bafe5d8..8b8a6ef4c6 100644
--- a/recipes/linux/linux-bug20-linaro_2.6.35.bb
+++ b/recipes/linux/linux-bug20-linaro_2.6.35.bb
@@ -5,9 +5,9 @@ KERNEL_IMAGETYPE = "uImage"
COMPATIBLE_MACHINE = "bug20"
-PR = "r0"
+PR = "r1"
-SRCREV = "be4f840306ef858cffc182cde38714f9423bdeb3"
+SRCREV = "42f43f4bd4a0b612b7bcad3414e42a507282fe8b"
SRC_URI = "git://github.com/buglabs/bug20-2.6.35-linaro.git;branch=master;protocol=git"
diff --git a/recipes/linux/linux-imx-git/mx28evk/defconfig b/recipes/linux/linux-imx-git/mx28evk/defconfig
new file mode 100644
index 0000000000..0d01c03b73
--- /dev/null
+++ b/recipes/linux/linux-imx-git/mx28evk/defconfig
@@ -0,0 +1,2132 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.35.3
+# Mon Dec 6 17:17:47 2010
+#
+CONFIG_ARM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_GENERIC_GPIO=y
+CONFIG_GENERIC_TIME=y
+# CONFIG_ARCH_USES_GETTIMEOFFSET is not set
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_HAVE_PROC_CPU=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_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ZONE_DMA=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
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_LOCK_KERNEL=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_CROSS_COMPILE=""
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_HAVE_KERNEL_GZIP=y
+CONFIG_HAVE_KERNEL_LZMA=y
+CONFIG_HAVE_KERNEL_LZO=y
+CONFIG_KERNEL_GZIP=y
+# CONFIG_KERNEL_BZIP2 is not set
+# 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=y
+CONFIG_POSIX_MQUEUE_SYSCTL=y
+CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+# CONFIG_TASKSTATS is not set
+CONFIG_AUDIT=y
+
+#
+# RCU Subsystem
+#
+CONFIG_TREE_RCU=y
+# CONFIG_TREE_PREEMPT_RCU is not set
+# CONFIG_TINY_RCU is not set
+# CONFIG_RCU_TRACE is not set
+CONFIG_RCU_FANOUT=32
+# CONFIG_RCU_FANOUT_EXACT is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=17
+# CONFIG_CGROUPS is not set
+# CONFIG_SYSFS_DEPRECATED_V2 is not set
+# CONFIG_RELAY 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_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=y
+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=y
+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_ASHMEM is not set
+CONFIG_AIO=y
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_PERF_USE_VMALLOC=y
+
+#
+# Kernel Performance Events And Counters
+#
+CONFIG_PERF_EVENTS=y
+# CONFIG_PERF_COUNTERS is not set
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLUB_DEBUG=y
+CONFIG_COMPAT_BRK=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# CONFIG_SLOB is not set
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=m
+CONFIG_HAVE_OPROFILE=y
+CONFIG_KPROBES=y
+CONFIG_KRETPROBES=y
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_CLK=y
+
+#
+# GCOV-based kernel profiling
+#
+# CONFIG_GCOV_KERNEL is not set
+# CONFIG_SLOW_WORK 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 is not set
+CONFIG_MODVERSIONS=y
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_BLOCK=y
+CONFIG_LBDAF=y
+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=y
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+# 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 is not set
+# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
+# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
+# 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 is not set
+# CONFIG_INLINE_READ_UNLOCK_BH is not set
+# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
+# 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 is not set
+# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
+# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
+# 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_MXS=y
+# 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_L7200 is not set
+# CONFIG_ARCH_DOVE is not set
+# CONFIG_ARCH_KIRKWOOD is not set
+# CONFIG_ARCH_LOKI 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_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 is not set
+# CONFIG_ARCH_S3C64XX is not set
+# CONFIG_ARCH_S5P6440 is not set
+# CONFIG_ARCH_S5P6442 is not set
+# CONFIG_ARCH_S5PC100 is not set
+# CONFIG_ARCH_S5PV210 is not set
+# CONFIG_ARCH_SHARK 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_IRAM_ALLOC=y
+CONFIG_DMA_ZONE_SIZE=16
+
+#
+# Freescale i.MXS implementations
+#
+CONFIG_ARCH_MX28=y
+# CONFIG_ARCH_MX23 is not set
+CONFIG_MACH_MX28EVK=y
+CONFIG_VECTORS_PHY_ADDR=0
+CONFIG_MXS_TIMER_WITH_MACH=y
+# CONFIG_MEM_mDDR is not set
+CONFIG_MXS_ICOLL=y
+CONFIG_MXS_EARLY_CONSOLE=y
+CONFIG_MXS_DMA_ENGINE=y
+CONFIG_MXS_LRADC=y
+CONFIG_MXS_PWM_CHANNELS=8
+
+#
+# Freescale Application UART:
+#
+CONFIG_MXS_AUART_DMA_SUPPORT=y
+CONFIG_MXS_AUART_PORTS=5
+CONFIG_MXS_AUART0_DEVICE_ENABLE=y
+# CONFIG_MXS_AUART0_DMA_ENABLE is not set
+CONFIG_MXS_AUART1_DEVICE_ENABLE=y
+# CONFIG_MXS_AUART1_DMA_ENABLE is not set
+CONFIG_MXS_AUART2_DEVICE_ENABLE=y
+# CONFIG_MXS_AUART2_DMA_ENABLE is not set
+CONFIG_MXS_AUART3_DEVICE_ENABLE=y
+# CONFIG_MXS_AUART3_DMA_ENABLE is not set
+CONFIG_MXS_AUART4_DEVICE_ENABLE=y
+# CONFIG_MXS_AUART4_DMA_ENABLE is not set
+CONFIG_MXS_RAM_FREQ_SCALING=y
+# CONFIG_MXS_RAM_MDDR is not set
+# CONFIG_MXS_RAM_DDR is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_ARM926T=y
+CONFIG_CPU_32v5=y
+CONFIG_CPU_ABRT_EV5TJ=y
+CONFIG_CPU_PABRT_LEGACY=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_CPU_CACHE_ROUND_ROBIN is not set
+CONFIG_ARM_L1_CACHE_SHIFT=5
+CONFIG_COMMON_CLKDEV=y
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+# CONFIG_PREEMPT_NONE is not set
+# CONFIG_PREEMPT_VOLUNTARY is not set
+CONFIG_PREEMPT=y
+CONFIG_HZ=100
+CONFIG_AEABI=y
+CONFIG_OABI_COMPAT=y
+# 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_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=999999
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+# CONFIG_KSM is not set
+CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
+CONFIG_ALIGNMENT_TRAP=y
+# CONFIG_UACCESS_WITH_MEMCPY is not set
+
+#
+# Boot options
+#
+CONFIG_ZBOOT_ROM_TEXT=0
+CONFIG_ZBOOT_ROM_BSS=0
+CONFIG_CMDLINE=""
+# CONFIG_XIP_KERNEL is not set
+# CONFIG_KEXEC is not set
+
+#
+# CPU Power Management
+#
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=y
+# CONFIG_CPU_FREQ_DEBUG is not set
+CONFIG_CPU_FREQ_STAT=y
+# CONFIG_CPU_FREQ_STAT_DETAILS is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=y
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+# CONFIG_CPU_FREQ_GOV_ONDEMAND is not set
+# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
+# CONFIG_CPU_IDLE is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+# CONFIG_FPE_NWFPE is not set
+# CONFIG_FPE_FASTFPE is not set
+# CONFIG_VFP is not set
+
+#
+# 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=y
+
+#
+# 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=y
+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 is not set
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# 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=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_NETLABEL is not set
+CONFIG_NETWORK_SECMARK=y
+# 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_BRIDGE is not set
+# CONFIG_NET_DSA is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_PHONET is not set
+# CONFIG_IEEE802154 is not set
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_NET_TCPPROBE is not set
+# CONFIG_HAMRADIO is not set
+CONFIG_CAN=y
+CONFIG_CAN_RAW=y
+# CONFIG_CAN_BCM is not set
+
+#
+# CAN Device Drivers
+#
+# CONFIG_CAN_VCAN is not set
+# CONFIG_CAN_DEV is not set
+# CONFIG_CAN_DEBUG_DEVICES is not set
+CONFIG_CAN_FLEXCAN=m
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+CONFIG_WIRELESS=y
+CONFIG_WIRELESS_EXT=y
+CONFIG_WEXT_CORE=y
+CONFIG_WEXT_PROC=y
+CONFIG_WEXT_SPY=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_INPUT=y
+# CONFIG_NET_9P is not set
+# CONFIG_CAIF 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=y
+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 is not set
+# CONFIG_MTD_JEDECPROBE 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_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_DATAFLASH is not set
+# CONFIG_MTD_MXC_DATAFLASH is not set
+CONFIG_MTD_M25P80=m
+CONFIG_M25PXX_USE_FAST_READ=y
+# 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 is not set
+# CONFIG_MTD_SM_COMMON is not set
+# CONFIG_MTD_NAND_MUSEUM_IDS is not set
+CONFIG_MTD_NAND_DENALI_SCRATCH_REG_ADDR=0xFF108018
+# CONFIG_MTD_NAND_GPIO is not set
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+CONFIG_MTD_NAND_GPMI_NFC=y
+# 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
+
+#
+# UBI - Unsorted block images
+#
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
+CONFIG_MTD_UBI_BEB_RESERVE=1
+# CONFIG_MTD_UBI_GLUEBI is not set
+
+#
+# UBI debugging options
+#
+# CONFIG_MTD_UBI_DEBUG is not set
+CONFIG_MTD_UBI_BLOCK=y
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP 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=4
+CONFIG_BLK_DEV_RAM_SIZE=16384
+# 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_MISC_DEVICES=y
+# CONFIG_AD525X_DPOT is not set
+# CONFIG_ICS932S401 is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_ISL29003 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_DS1682 is not set
+# CONFIG_TI_DAC7512 is not set
+CONFIG_MXS_PERSISTENT=y
+# CONFIG_ANDROID_PMEM is not set
+# CONFIG_UID_STAT 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
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+CONFIG_SCSI_MOD=y
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+# CONFIG_SCSI_TGT is not set
+CONFIG_SCSI_NETLINK=y
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+# 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 is not set
+CONFIG_SCSI_WAIT_SCAN=m
+
+#
+# SCSI Transports
+#
+CONFIG_SCSI_SPI_ATTRS=m
+CONFIG_SCSI_FC_ATTRS=m
+CONFIG_SCSI_ISCSI_ATTRS=m
+# 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_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 is not set
+# CONFIG_VETH is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_MICREL_PHY is not set
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_AX88796 is not set
+# CONFIG_SMC91X is not set
+# CONFIG_DM9000 is not set
+# CONFIG_ENC28J60 is not set
+# CONFIG_ETHOC is not set
+# CONFIG_SMC911X is not set
+# CONFIG_SMSC911X is not set
+# CONFIG_DNET is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+# CONFIG_B44 is not set
+# CONFIG_KS8842 is not set
+# CONFIG_KS8851 is not set
+# CONFIG_KS8851_MLL is not set
+CONFIG_FEC=y
+# CONFIG_FEC_1588 is not set
+# CONFIG_FEC2 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
+CONFIG_ATH6K_LEGACY=m
+CONFIG_AR600x_SD31_XXX=y
+# CONFIG_AR600x_WB31_XXX is not set
+# CONFIG_AR600x_SD32_XXX is not set
+# CONFIG_AR600x_CUSTOM_XXX is not set
+# CONFIG_ATH6KL_ENABLE_COEXISTENCE is not set
+# CONFIG_ATH6KL_HCI_BRIDGE is not set
+# CONFIG_ATH6KL_CFG80211 is not set
+# CONFIG_ATH6KL_HTC_RAW_INTERFACE is not set
+# CONFIG_ATH6KL_VIRTUAL_SCATTER_GATHER is not set
+# CONFIG_ATH6KL_DEBUG 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_HSO is not set
+# CONFIG_USB_IPHETH is not set
+# CONFIG_WAN is not set
+# 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=y
+# 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=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=y
+# CONFIG_KEYBOARD_QT2160 is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_GPIO 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_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_KEYBOARD_MXS=y
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
+# CONFIG_MOUSE_PS2_SENTELIC is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+CONFIG_MOUSE_SERIAL=m
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_BCM5974 is not set
+CONFIG_MOUSE_VSXXXAA=m
+# CONFIG_MOUSE_GPIO is not set
+# CONFIG_MOUSE_SYNAPTICS_I2C is not set
+CONFIG_INPUT_JOYSTICK=y
+# CONFIG_JOYSTICK_ANALOG is not set
+# CONFIG_JOYSTICK_A3D is not set
+# CONFIG_JOYSTICK_ADI is not set
+# CONFIG_JOYSTICK_COBRA is not set
+# CONFIG_JOYSTICK_GF2K is not set
+# CONFIG_JOYSTICK_GRIP is not set
+# CONFIG_JOYSTICK_GRIP_MP is not set
+# CONFIG_JOYSTICK_GUILLEMOT is not set
+# CONFIG_JOYSTICK_INTERACT is not set
+# CONFIG_JOYSTICK_SIDEWINDER is not set
+# CONFIG_JOYSTICK_TMDC is not set
+# CONFIG_JOYSTICK_IFORCE is not set
+# CONFIG_JOYSTICK_WARRIOR is not set
+# CONFIG_JOYSTICK_MAGELLAN is not set
+# CONFIG_JOYSTICK_SPACEORB is not set
+# CONFIG_JOYSTICK_SPACEBALL is not set
+# CONFIG_JOYSTICK_STINGER is not set
+# CONFIG_JOYSTICK_TWIDJOY is not set
+# CONFIG_JOYSTICK_ZHENHUA is not set
+# CONFIG_JOYSTICK_JOYDUMP is not set
+# CONFIG_JOYSTICK_XPAD 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_I2C is not set
+# CONFIG_TOUCHSCREEN_AD7879_SPI is not set
+# CONFIG_TOUCHSCREEN_AD7879 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_GUNZE=m
+# 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_MXS=y
+# CONFIG_TOUCHSCREEN_PENMOUNT 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_PCF8574 is not set
+# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_SERIO_ALTERA_PS2 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 is not set
+CONFIG_DEVKMEM=y
+CONFIG_SERIAL_NONSTANDARD=y
+# CONFIG_N_HDLC is not set
+# CONFIG_N_GSM is not set
+# CONFIG_RISCOM8 is not set
+# CONFIG_SPECIALIX is not set
+CONFIG_STALDRV=y
+CONFIG_MXS_VIIM=y
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_MXS_DUART=y
+CONFIG_SERIAL_MXS_AUART=y
+# CONFIG_SERIAL_MXS_AUART_CONSOLE is not set
+CONFIG_SERIAL_MXS_DUART_CONSOLE=y
+# CONFIG_SERIAL_MAX3100 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=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_FSL_OTP is not set
+CONFIG_IPMI_HANDLER=m
+# CONFIG_IPMI_PANIC_EVENT is not set
+CONFIG_IPMI_DEVICE_INTERFACE=m
+CONFIG_IPMI_SI=m
+CONFIG_IPMI_WATCHDOG=m
+CONFIG_IPMI_POWEROFF=m
+CONFIG_HW_RANDOM=m
+# CONFIG_HW_RANDOM_TIMERIOMEM is not set
+# CONFIG_R3964 is not set
+CONFIG_RAW_DRIVER=y
+CONFIG_MAX_RAW_DEVS=8192
+# 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 is not set
+CONFIG_I2C_HELPER_AUTO=y
+
+#
+# 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_MXS=y
+CONFIG_I2C_MXS_SELECT0=y
+# CONFIG_I2C_MXS_SELECT0_PIOQUEUE_MODE is not set
+# CONFIG_I2C_MXS_SELECT1 is not set
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_PCA_PLATFORM is not set
+# 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 is not set
+# CONFIG_SPI_GPIO is not set
+# CONFIG_SPI_XILINX is not set
+CONFIG_SPI_MXS=y
+# 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 is not set
+
+#
+# Memory mapped GPIO expanders:
+#
+# CONFIG_GPIO_IT8761E 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_ADP5588 is not set
+
+#
+# PCI GPIO expanders:
+#
+
+#
+# SPI GPIO expanders:
+#
+# CONFIG_GPIO_MAX7301 is not set
+# CONFIG_GPIO_MCP23S08 is not set
+# CONFIG_GPIO_MC33880 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_DS2760 is not set
+# CONFIG_BATTERY_DS2782 is not set
+# CONFIG_BATTERY_BQ27x00 is not set
+# CONFIG_BATTERY_MAX17040 is not set
+CONFIG_BATTERY_MXS=y
+# CONFIG_MXS_VBUS_CURRENT_DRAW is not set
+# CONFIG_BATTERY_DS2438 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_MXS_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=m
+CONFIG_SSB_SDIOHOST_POSSIBLE=y
+# CONFIG_SSB_SDIOHOST is not set
+# CONFIG_SSB_DEBUG is not set
+CONFIG_MFD_SUPPORT=y
+# CONFIG_MFD_CORE is not set
+# 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_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_WM8400 is not set
+# CONFIG_MFD_WM831X is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_WM8994 is not set
+# CONFIG_MFD_LTC3589_I2C is not set
+# CONFIG_MFD_PCF50633 is not set
+# CONFIG_MFD_MC13783 is not set
+# CONFIG_ABX500_CORE is not set
+# CONFIG_EZX_PCAP is not set
+# CONFIG_AB8500_CORE is not set
+# CONFIG_MFD_MAX17135 is not set
+CONFIG_REGULATOR=y
+# CONFIG_REGULATOR_DEBUG is not set
+# CONFIG_REGULATOR_DUMMY is not set
+# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
+# 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_LP3971 is not set
+# CONFIG_REGULATOR_TPS65023 is not set
+# CONFIG_REGULATOR_TPS6507X is not set
+CONFIG_REGULATOR_MXS=y
+CONFIG_MEDIA_SUPPORT=y
+
+#
+# Multimedia core support
+#
+CONFIG_VIDEO_DEV=y
+CONFIG_VIDEO_V4L2_COMMON=y
+# CONFIG_VIDEO_ALLOW_V4L1 is not set
+CONFIG_VIDEO_V4L1_COMPAT=y
+# CONFIG_DVB_CORE is not set
+CONFIG_VIDEO_MEDIA=y
+
+#
+# Multimedia drivers
+#
+CONFIG_IR_CORE=y
+CONFIG_VIDEO_IR=y
+CONFIG_RC_MAP=y
+CONFIG_IR_NEC_DECODER=y
+CONFIG_IR_RC5_DECODER=y
+CONFIG_IR_RC6_DECODER=y
+CONFIG_IR_JVC_DECODER=y
+CONFIG_IR_SONY_DECODER=y
+# CONFIG_IR_IMON is not set
+# CONFIG_MEDIA_ATTACH is not set
+CONFIG_MEDIA_TUNER=y
+# CONFIG_MEDIA_TUNER_CUSTOMISE is not set
+CONFIG_MEDIA_TUNER_SIMPLE=y
+CONFIG_MEDIA_TUNER_TDA8290=y
+CONFIG_MEDIA_TUNER_TDA9887=y
+CONFIG_MEDIA_TUNER_TEA5761=y
+CONFIG_MEDIA_TUNER_TEA5767=y
+CONFIG_MEDIA_TUNER_MT20XX=y
+CONFIG_MEDIA_TUNER_XC2028=y
+CONFIG_MEDIA_TUNER_XC5000=y
+CONFIG_MEDIA_TUNER_MC44S803=y
+CONFIG_VIDEO_V4L2=y
+CONFIG_VIDEOBUF_GEN=y
+CONFIG_VIDEOBUF_DMA_CONTIG=y
+CONFIG_VIDEO_CAPTURE_DRIVERS=y
+# CONFIG_VIDEO_ADV_DEBUG is not set
+# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
+# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set
+CONFIG_VIDEO_IR_I2C=y
+
+#
+# Encoders/decoders and other helper chips
+#
+
+#
+# Audio decoders
+#
+# CONFIG_VIDEO_TVAUDIO is not set
+# CONFIG_VIDEO_TDA7432 is not set
+# CONFIG_VIDEO_TDA9840 is not set
+# CONFIG_VIDEO_TDA9875 is not set
+# CONFIG_VIDEO_TEA6415C is not set
+# CONFIG_VIDEO_TEA6420 is not set
+# CONFIG_VIDEO_MSP3400 is not set
+# CONFIG_VIDEO_CS5345 is not set
+# CONFIG_VIDEO_CS53L32A is not set
+# CONFIG_VIDEO_M52790 is not set
+# CONFIG_VIDEO_TLV320AIC23B is not set
+# CONFIG_VIDEO_WM8775 is not set
+# CONFIG_VIDEO_WM8739 is not set
+# CONFIG_VIDEO_VP27SMPX is not set
+
+#
+# RDS decoders
+#
+# CONFIG_VIDEO_SAA6588 is not set
+
+#
+# Video decoders
+#
+# CONFIG_VIDEO_ADV7180 is not set
+# CONFIG_VIDEO_BT819 is not set
+# CONFIG_VIDEO_BT856 is not set
+# CONFIG_VIDEO_BT866 is not set
+# CONFIG_VIDEO_KS0127 is not set
+# CONFIG_VIDEO_OV7670 is not set
+# CONFIG_VIDEO_MT9V011 is not set
+# CONFIG_VIDEO_TCM825X is not set
+# CONFIG_VIDEO_SAA7110 is not set
+# CONFIG_VIDEO_SAA711X is not set
+# CONFIG_VIDEO_SAA717X is not set
+# CONFIG_VIDEO_SAA7191 is not set
+# CONFIG_VIDEO_TVP514X is not set
+# CONFIG_VIDEO_TVP5150 is not set
+# CONFIG_VIDEO_TVP7002 is not set
+# CONFIG_VIDEO_VPX3220 is not set
+
+#
+# Video and audio decoders
+#
+# CONFIG_VIDEO_CX25840 is not set
+
+#
+# MPEG video encoders
+#
+# CONFIG_VIDEO_CX2341X is not set
+
+#
+# Video encoders
+#
+# CONFIG_VIDEO_SAA7127 is not set
+# CONFIG_VIDEO_SAA7185 is not set
+# CONFIG_VIDEO_ADV7170 is not set
+# CONFIG_VIDEO_ADV7175 is not set
+# CONFIG_VIDEO_THS7303 is not set
+# CONFIG_VIDEO_ADV7343 is not set
+# CONFIG_VIDEO_AK881X is not set
+
+#
+# Video improvement chips
+#
+# CONFIG_VIDEO_UPD64031A is not set
+# CONFIG_VIDEO_UPD64083 is not set
+CONFIG_VIDEO_MXS_PXP=y
+# CONFIG_VIDEO_SAA5246A is not set
+# CONFIG_VIDEO_SAA5249 is not set
+# CONFIG_SOC_CAMERA is not set
+# CONFIG_V4L_USB_DRIVERS is not set
+# CONFIG_V4L_MEM2MEM_DRIVERS is not set
+# CONFIG_RADIO_ADAPTERS is not set
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# 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_MXS=y
+CONFIG_FB_MXS_LCD_43WVF1G=y
+# CONFIG_FB_MXS_LCD_LMS430 is not set
+# CONFIG_FB_MXS_TVENC is not set
+# CONFIG_FB_S1D13XXX 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_BACKLIGHT_LCD_SUPPORT=y
+# CONFIG_LCD_CLASS_DEVICE is not set
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+# CONFIG_BACKLIGHT_GENERIC is not set
+# CONFIG_BACKLIGHT_ADP8860 is not set
+CONFIG_BACKLIGHT_MXS=y
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+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=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_LOGO_LINUX_CLUT224=y
+CONFIG_SOUND=y
+# CONFIG_SOUND_OSS_CORE is not set
+CONFIG_SND=y
+CONFIG_SND_TIMER=y
+CONFIG_SND_PCM=y
+CONFIG_SND_JACK=y
+# CONFIG_SND_SEQUENCER is not set
+# CONFIG_SND_MIXER_OSS is not set
+# CONFIG_SND_PCM_OSS is not set
+# CONFIG_SND_HRTIMER is not set
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+CONFIG_SND_VERBOSE_PROCFS=y
+# 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=y
+# CONFIG_SND_USB is not set
+CONFIG_SND_SOC=y
+CONFIG_SND_MXS_SOC=y
+CONFIG_SND_MXS_SOC_SPDIF_DAI=y
+CONFIG_SND_MXS_SOC_EVK_DEVB=y
+CONFIG_SND_MXS_SOC_DAI=y
+CONFIG_SND_MXS_SOC_EVK_DEVB_SPDIF=y
+CONFIG_SND_SOC_I2C_AND_SPI=y
+# CONFIG_SND_SOC_ALL_CODECS is not set
+CONFIG_SND_SOC_SGTL5000=y
+CONFIG_SND_SOC_MXS_SPDIF=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=y
+
+#
+# Special HID drivers
+#
+# CONFIG_HID_3M_PCT is not set
+CONFIG_HID_A4TECH=y
+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_EZKEY=y
+CONFIG_HID_KYE=y
+CONFIG_HID_GYRATION=y
+# CONFIG_HID_TWINHAN is not set
+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_HID_MICROSOFT=y
+# CONFIG_HID_MOSART is not set
+CONFIG_HID_MONTEREY=y
+CONFIG_HID_NTRIG=y
+# CONFIG_HID_ORTEK is not set
+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_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_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 is not set
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
+
+#
+# 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_SUSPEND=y
+CONFIG_USB_OTG=y
+# 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_EHCI_HCD=y
+CONFIG_USB_EHCI_ARC=y
+CONFIG_USB_EHCI_ARC_H1=y
+CONFIG_USB_EHCI_ARC_OTG=y
+# CONFIG_USB_STATIC_IRAM is not set
+# CONFIG_USB_EHCI_FSL_MC13783 is not set
+# CONFIG_USB_EHCI_FSL_1301 is not set
+# CONFIG_USB_EHCI_FSL_1504 is not set
+CONFIG_USB_EHCI_FSL_UTMI=y
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+# CONFIG_USB_EHCI_TT_NEWSCHED 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_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
+# CONFIG_USB_GADGET_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_STORAGE=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_ONETOUCH is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_STORAGE_CYPRESS_ATACB 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 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_SISUSBVGA 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_GADGET=y
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+# CONFIG_USB_GADGET_DEBUG_FS is not set
+CONFIG_USB_GADGET_VBUS_DRAW=2
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_AT91 is not set
+# CONFIG_USB_GADGET_ATMEL_USBA is not set
+# CONFIG_USB_GADGET_FSL_USB2 is not set
+# CONFIG_USB_GADGET_LH7A40X is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_PXA25X is not set
+# CONFIG_USB_GADGET_R8A66597 is not set
+# CONFIG_USB_GADGET_PXA27X is not set
+# CONFIG_USB_GADGET_S3C_HSOTG is not set
+# CONFIG_USB_GADGET_IMX is not set
+# CONFIG_USB_GADGET_S3C2410 is not set
+# CONFIG_USB_GADGET_M66592 is not set
+# CONFIG_USB_GADGET_AMD5536UDC is not set
+# CONFIG_USB_GADGET_FSL_QE is not set
+# CONFIG_USB_GADGET_CI13XXX is not set
+# CONFIG_USB_GADGET_NET2280 is not set
+# CONFIG_USB_GADGET_GOKU is not set
+CONFIG_USB_GADGET_ARC=y
+CONFIG_USB_ARC=y
+CONFIG_WORKAROUND_ARCUSB_REG_RW=y
+# CONFIG_USB_GADGET_LANGWELL is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+# 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 is not set
+# CONFIG_USB_FUNCTIONFS is not set
+CONFIG_USB_FILE_STORAGE=m
+# CONFIG_FSL_UTP is not set
+# CONFIG_USB_FILE_STORAGE_TEST is not set
+# CONFIG_USB_MASS_STORAGE is not set
+CONFIG_USB_G_SERIAL=m
+# CONFIG_USB_MIDI_GADGET is not set
+# CONFIG_USB_G_PRINTER is not set
+# CONFIG_USB_CDC_COMPOSITE is not set
+# CONFIG_USB_G_NOKIA is not set
+# CONFIG_USB_G_MULTI is not set
+# CONFIG_USB_G_HID is not set
+# CONFIG_USB_G_WEBCAM is not set
+
+#
+# OTG and related infrastructure
+#
+CONFIG_USB_OTG_UTILS=y
+# CONFIG_USB_GPIO_VBUS is not set
+# CONFIG_USB_ULPI is not set
+# CONFIG_NOP_USB_XCEIV is not set
+CONFIG_MXC_OTG=y
+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_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_IMX_ESDHCI_PIO_MODE is not set
+CONFIG_MMC_MXS=y
+# CONFIG_MEMSTICK is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+CONFIG_LEDS_MXS=y
+# CONFIG_LEDS_PCA9532 is not set
+# CONFIG_LEDS_GPIO is not set
+# CONFIG_LEDS_LP3944 is not set
+# CONFIG_LEDS_PCA955X is not set
+# CONFIG_LEDS_DAC124S085 is not set
+# CONFIG_LEDS_REGULATOR is not set
+# CONFIG_LEDS_BD2802 is not set
+# CONFIG_LEDS_LT3593 is not set
+# CONFIG_LEDS_TRIGGERS is not set
+# 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_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 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
+
+#
+# on-CPU RTC drivers
+#
+CONFIG_RTC_DRV_MXS=y
+CONFIG_DMADEVICES=y
+# CONFIG_DMADEVICES_DEBUG is not set
+
+#
+# DMA Devices
+#
+# CONFIG_MXC_PXP is not set
+# CONFIG_TIMB_DMA is not set
+# CONFIG_AUXDISPLAY is not set
+# CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_DEFAULTS_TO_ORDERED=y
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+# CONFIG_EXT4_FS is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+# 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=y
+# CONFIG_INOTIFY is not set
+CONFIG_INOTIFY_USER=y
+CONFIG_QUOTA=y
+# CONFIG_QUOTA_NETLINK_INTERFACE is not set
+CONFIG_PRINT_QUOTA_WARNING=y
+# CONFIG_QUOTA_DEBUG is not set
+CONFIG_QUOTA_TREE=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTACTL=y
+# CONFIG_AUTOFS_FS is not set
+CONFIG_AUTOFS4_FS=m
+# CONFIG_FUSE_FS is not set
+
+#
+# Caches
+#
+# CONFIG_FSCACHE is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
+# 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_ECRYPT_FS is not set
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+# 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 is not set
+# 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_UBIFS_FS=y
+# CONFIG_UBIFS_FS_XATTR is not set
+# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
+CONFIG_UBIFS_FS_LZO=y
+CONFIG_UBIFS_FS_ZLIB=y
+# CONFIG_UBIFS_FS_DEBUG is not set
+# CONFIG_LOGFS is not set
+CONFIG_CRAMFS=m
+# CONFIG_SQUASHFS is not set
+CONFIG_VXFS_FS=m
+# 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=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+# CONFIG_NFS_V4 is not set
+CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CEPH_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+CONFIG_OSF_PARTITION=y
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+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 is not set
+CONFIG_SGI_PARTITION=y
+# CONFIG_ULTRIX_PARTITION is not set
+CONFIG_SUN_PARTITION=y
+# CONFIG_KARMA_PARTITION is not set
+CONFIG_EFI_PARTITION=y
+# CONFIG_SYSV68_PARTITION is not set
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="utf8"
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=y
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=m
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+# 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 is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_SLUB_DEBUG_ON is not set
+# CONFIG_SLUB_STATS is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+CONFIG_DEBUG_MEMORY_INIT=y
+CONFIG_FRAME_POINTER=y
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_LKDTM is not set
+# CONFIG_LATENCYTOP is not set
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_RING_BUFFER=y
+CONFIG_RING_BUFFER_ALLOW_SWAP=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_ARM_UNWIND is not set
+# CONFIG_DEBUG_USER is not set
+# CONFIG_OC_ETM is not set
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+CONFIG_KEYS_DEBUG_PROC_KEYS=y
+CONFIG_SECURITY=y
+# CONFIG_SECURITYFS is not set
+CONFIG_SECURITY_NETWORK=y
+# CONFIG_SECURITY_NETWORK_XFRM is not set
+# CONFIG_SECURITY_PATH is not set
+CONFIG_LSM_MMAP_MIN_ADDR=65536
+CONFIG_SECURITY_SELINUX=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM=y
+CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1
+CONFIG_SECURITY_SELINUX_DISABLE=y
+CONFIG_SECURITY_SELINUX_DEVELOP=y
+CONFIG_SECURITY_SELINUX_AVC_STATS=y
+CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
+# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set
+# CONFIG_SECURITY_TOMOYO is not set
+# CONFIG_IMA is not set
+CONFIG_DEFAULT_SECURITY_SELINUX=y
+# CONFIG_DEFAULT_SECURITY_SMACK is not set
+# CONFIG_DEFAULT_SECURITY_TOMOYO is not set
+# CONFIG_DEFAULT_SECURITY_DAC is not set
+CONFIG_DEFAULT_SECURITY="selinux"
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_PCOMP=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_MANAGER_TESTS=y
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_NULL is not set
+CONFIG_CRYPTO_WORKQUEUE=y
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+CONFIG_CRYPTO_TEST=m
+CONFIG_CRYPTO_CRYPTODEV=y
+
+#
+# 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=y
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+CONFIG_CRYPTO_ECB=y
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+CONFIG_CRYPTO_HMAC=y
+# CONFIG_CRYPTO_XCBC is not set
+# CONFIG_CRYPTO_VMAC is not set
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=m
+# 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=m
+CONFIG_CRYPTO_SHA256=m
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+CONFIG_CRYPTO_AES=y
+# 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=y
+# 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=y
+# CONFIG_CRYPTO_ZLIB is not set
+CONFIG_CRYPTO_LZO=y
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_CRYPTO_HW=y
+CONFIG_CRYPTO_DEV_DCP=y
+# CONFIG_BINARY_PRINTF is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_LAST_BIT=y
+CONFIG_CRC_CCITT=m
+CONFIG_CRC16=y
+# CONFIG_CRC_T10DIF is not set
+CONFIG_CRC_ITU_T=m
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+CONFIG_LIBCRC32C=m
+CONFIG_AUDIT_GENERIC=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_GENERIC_ALLOCATOR=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
+CONFIG_NLATTR=y
+CONFIG_GENERIC_ATOMIC64=y
diff --git a/recipes/linux/linux-imx_git.bb b/recipes/linux/linux-imx_git.bb
index 6bd7664491..5d4d484fa1 100644
--- a/recipes/linux/linux-imx_git.bb
+++ b/recipes/linux/linux-imx_git.bb
@@ -2,20 +2,43 @@ require linux.inc
FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/linux-imx-git/${MACHINE}"
-SRCREV = "eee5a08306df7d9b1f23f463c9e9439e04293b57"
-
-PV = "2.6.28"
-PR = "r0"
-
-SRC_URI = "git://opensource.freescale.com/pub/scm/imx/linux-2.6-imx.git;protocol=http;branch=imx_2.6.28 \
- file://defconfig \
-"
-
-SRC_URI_append_chumby-falconwing = "http://files.chumby.com/source/falconwing/build2913/oe-patch-freescale-kernel.patch;name=patch"
-
-COMPATIBLE_MACHINE = "chumby-falconwing"
+PR = "r1"
+
+COMPATIBLE_MACHINE = "(chumby-falconwing|mx28evk)"
+
+SRC_URI_chumby-falconwing = "git://opensource.freescale.com/pub/scm/imx/linux-2.6-imx.git;protocol=http;branch=imx_2.6.28 \
+ http://files.chumby.com/source/falconwing/build2913/oe-patch-freescale-kernel.patch;name=patch \
+ file://defconfig"
+SRCREV_chumby-falconwing = "eee5a08306df7d9b1f23f463c9e9439e04293b57"
+PV_chumby-falconwing = "2.6.28"
+SRC_URI_chumby-falconwing[patch.md5sum] = "47fd149d78839e0d54239a3f5934eed1"
+SRC_URI_chumby-falconwing[patch.sha256sum] = "4bf5efedef5ab6be0ce29b21b7d06bfe0cec2c33c5e3dea831b6b66e08a371ad"
+
+
+SRC_URI_mx28evk = "git://opensource.freescale.com/pub/scm/imx/linux-2.6-imx.git;protocol=http;branch=imx_2.6.35_10.12.01 \
+ http://foss.doredevelopment.dk/mirrors/imx/imx-bootlets-src-${PV_imx_bootlets}.tar.gz;name=imx-bootlets \
+ file://defconfig \
+ file://${LOGO_SIZE}/logo_linux_clut224.ppm.bz2"
+SRCREV_mx28evk = "cca29a03fc83751ed319df4b3c38ce2f4216ee0a"
+SRC_URI[imx-bootlets.md5sum] = "cf0ab3822dca694b930a051501c1d0e4"
+SRC_URI[imx-bootlets.sha256sum] = "63f6068ae36884adef4259bbb1fe2591755718f22c46d0a59d854883dfab1ffc"
+PV_mx28evk = "2.6.35"
+PV_imx_bootlets = "10.12.01"
+DEPENDS_append_mx28 = " elftosb-native"
+
+do_compile_prepend_mx28() {
+ # We just build the bootlets here
+ oe_runmake -C ${WORKDIR}/imx-bootlets-src-${PV_imx_bootlets} -e MAKEFLAGS= linux_prep boot_prep power_prep CC="${CC}" CFLAGS="${CFLAGS}" AR="${AR}" BOARD=iMX28_EVK ARCH=mx28
+}
+
+do_deploy_append_mx28 () {
+ cd ${WORKDIR}/imx-bootlets-src-${PV_imx_bootlets}
+ sed -i 's,[^ *]zImage.*;,\tzImage="'${S}/arch/arm/boot/zImage'";,' linux.bd
+ sed -i 's,[^ *]zImage.*;,\tzImage="'${S}/arch/arm/boot/zImage'";,' linux_ivt.bd
+ elftosb -z -c linux.bd -o imx28_linux.sb
+ elftosb -z -f imx28 -c ./linux_ivt.bd -o imx28_ivt_linux.sb
+ install -d ${DEPLOY_DIR_IMAGE}
+ install -m 0644 ${WORKDIR}/imx-bootlets-src-${PV_imx_bootlets}/imx28*linux.sb ${DEPLOY_DIR_IMAGE}/
+}
S = "${WORKDIR}/git"
-
-SRC_URI[patch.md5sum] = "47fd149d78839e0d54239a3f5934eed1"
-SRC_URI[patch.sha256sum] = "4bf5efedef5ab6be0ce29b21b7d06bfe0cec2c33c5e3dea831b6b66e08a371ad"
diff --git a/recipes/linux/linux-kexecboot-2.6.39/akita/defconfig b/recipes/linux/linux-kexecboot-2.6.39/akita/defconfig
new file mode 100644
index 0000000000..75c23b3ce1
--- /dev/null
+++ b/recipes/linux/linux-kexecboot-2.6.39/akita/defconfig
@@ -0,0 +1,133 @@
+CONFIG_EXPERIMENTAL=y
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_KERNEL_LZMA=y
+# CONFIG_SWAP is not set
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE="initramfs.cpio.lzma"
+CONFIG_RD_LZMA=y
+CONFIG_INITRAMFS_COMPRESSION_LZMA=y
+# CONFIG_UID16 is not set
+# CONFIG_SYSCTL_SYSCALL is not set
+# CONFIG_KALLSYMS is not set
+# CONFIG_PRINTK is not set
+# CONFIG_BUG is not set
+# CONFIG_ELF_CORE is not set
+# CONFIG_BASE_FULL is not set
+CONFIG_EMBEDDED=y
+# CONFIG_VM_EVENT_COUNTERS is not set
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLOB=y
+# CONFIG_LBDAF is not set
+# CONFIG_IOSCHED_CFQ is not set
+CONFIG_ARCH_PXA=y
+CONFIG_PXA_SHARPSL=y
+CONFIG_PXA_SHARPSL_DETECT_MACH_ID=y
+CONFIG_MACH_AKITA=y
+CONFIG_MACH_BORZOI=y
+CONFIG_PCCARD=y
+# CONFIG_PCMCIA_LOAD_CIS is not set
+CONFIG_PCMCIA_PXA2XX=y
+CONFIG_NO_HZ=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="console=tty1 console=ttyS0,115200n8 fbcon=rotate:1 loglevel=3"
+CONFIG_KEXEC=y
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_MTD=y
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_ROM=y
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_VERIFY_WRITE=y
+CONFIG_MTD_NAND_SHARPSL=y
+CONFIG_MTD_UBI=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_ATA=y
+# CONFIG_ATA_VERBOSE_ERROR is not set
+# CONFIG_SATA_PMP is not set
+CONFIG_PATA_PXA=y
+CONFIG_PATA_PCMCIA=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=640
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=480
+CONFIG_INPUT_EVDEV=y
+CONFIG_INPUT_APMPOWER=y
+# CONFIG_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_MATRIX=y
+# CONFIG_INPUT_MOUSE is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_ADS7846=y
+# CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_DEVKMEM is not set
+CONFIG_SERIAL_PXA=y
+CONFIG_SERIAL_PXA_CONSOLE=y
+# CONFIG_HW_RANDOM is not set
+# CONFIG_I2C_COMPAT is not set
+CONFIG_SPI=y
+CONFIG_SPI_PXA2XX=y
+CONFIG_POWER_SUPPLY=y
+CONFIG_PDA_POWER=y
+CONFIG_APM_POWER=y
+# CONFIG_MFD_SUPPORT is not set
+CONFIG_FB=y
+CONFIG_FB_PXA=y
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CORGI=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+CONFIG_FONTS=y
+CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+# CONFIG_HID_SUPPORT is not set
+# CONFIG_USB_SUPPORT is not set
+CONFIG_MMC=y
+CONFIG_MMC_PXA=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_PXA=y
+CONFIG_EXT2_FS=y
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+# CONFIG_EXT3_FS_XATTR is not set
+CONFIG_EXT4_FS=y
+# CONFIG_EXT4_FS_XATTR is not set
+# CONFIG_FILE_LOCKING is not set
+# CONFIG_DNOTIFY is not set
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+# CONFIG_PROC_PAGE_MONITOR is not set
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_SUMMARY=y
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RUBIN=y
+CONFIG_UBIFS_FS=y
+CONFIG_UBIFS_FS_ADVANCED_COMPR=y
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=2048
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_ARM_UNWIND is not set
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_HW is not set
diff --git a/recipes/linux/linux-kexecboot-2.6.39/c7x0/defconfig b/recipes/linux/linux-kexecboot-2.6.39/c7x0/defconfig
new file mode 100644
index 0000000000..1d544cbaf0
--- /dev/null
+++ b/recipes/linux/linux-kexecboot-2.6.39/c7x0/defconfig
@@ -0,0 +1,135 @@
+CONFIG_EXPERIMENTAL=y
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_KERNEL_LZMA=y
+# CONFIG_SWAP is not set
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE="initramfs.cpio.lzma"
+CONFIG_RD_LZMA=y
+CONFIG_INITRAMFS_COMPRESSION_LZMA=y
+# CONFIG_UID16 is not set
+# CONFIG_SYSCTL_SYSCALL is not set
+# CONFIG_KALLSYMS is not set
+# CONFIG_PRINTK is not set
+# CONFIG_BUG is not set
+# CONFIG_ELF_CORE is not set
+# CONFIG_BASE_FULL is not set
+CONFIG_EMBEDDED=y
+# CONFIG_VM_EVENT_COUNTERS is not set
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLOB=y
+# CONFIG_LBDAF is not set
+# CONFIG_IOSCHED_CFQ is not set
+CONFIG_ARCH_PXA=y
+CONFIG_PXA_SHARPSL=y
+CONFIG_PXA_SHARPSL_DETECT_MACH_ID=y
+CONFIG_MACH_CORGI=y
+CONFIG_MACH_SHEPHERD=y
+CONFIG_MACH_HUSKY=y
+CONFIG_PCCARD=y
+# CONFIG_PCMCIA_LOAD_CIS is not set
+CONFIG_PCMCIA_PXA2XX=y
+CONFIG_NO_HZ=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="console=tty1 console=ttyS0,115200n8 loglevel=3"
+CONFIG_KEXEC=y
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_MTD=y
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_ROM=y
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_VERIFY_WRITE=y
+CONFIG_MTD_NAND_SHARPSL=y
+CONFIG_MTD_UBI=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_ATA=y
+# CONFIG_ATA_VERBOSE_ERROR is not set
+# CONFIG_SATA_PMP is not set
+CONFIG_PATA_PXA=y
+CONFIG_PATA_PCMCIA=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=640
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=480
+CONFIG_INPUT_EVDEV=y
+CONFIG_INPUT_APMPOWER=y
+# CONFIG_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_MATRIX=y
+# CONFIG_INPUT_MOUSE is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_ADS7846=y
+# CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_DEVKMEM is not set
+CONFIG_SERIAL_PXA=y
+CONFIG_SERIAL_PXA_CONSOLE=y
+# CONFIG_HW_RANDOM is not set
+CONFIG_I2C=y
+# CONFIG_I2C_COMPAT is not set
+CONFIG_I2C_PXA=y
+CONFIG_SPI=y
+CONFIG_SPI_PXA2XX=y
+CONFIG_POWER_SUPPLY=y
+CONFIG_PDA_POWER=y
+CONFIG_APM_POWER=y
+# CONFIG_MFD_SUPPORT is not set
+CONFIG_FB=y
+CONFIG_FB_W100=y
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CORGI=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FONTS=y
+CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+# CONFIG_HID_SUPPORT is not set
+# CONFIG_USB_SUPPORT is not set
+CONFIG_MMC=y
+CONFIG_MMC_PXA=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_SA1100=y
+CONFIG_EXT2_FS=y
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+# CONFIG_EXT3_FS_XATTR is not set
+CONFIG_EXT4_FS=y
+# CONFIG_EXT4_FS_XATTR is not set
+# CONFIG_FILE_LOCKING is not set
+# CONFIG_DNOTIFY is not set
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+# CONFIG_PROC_PAGE_MONITOR is not set
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_SUMMARY=y
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RUBIN=y
+CONFIG_UBIFS_FS=y
+CONFIG_UBIFS_FS_ADVANCED_COMPR=y
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=2048
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_ARM_UNWIND is not set
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_HW is not set
diff --git a/recipes/linux/linux-kexecboot-2.6.39/collie/defconfig b/recipes/linux/linux-kexecboot-2.6.39/collie/defconfig
new file mode 100644
index 0000000000..0b5b2fe26c
--- /dev/null
+++ b/recipes/linux/linux-kexecboot-2.6.39/collie/defconfig
@@ -0,0 +1,145 @@
+CONFIG_EXPERIMENTAL=y
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_KERNEL_LZMA=y
+# CONFIG_SWAP is not set
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE="initramfs.cpio.lzma"
+CONFIG_RD_LZMA=y
+CONFIG_INITRAMFS_COMPRESSION_LZMA=y
+# CONFIG_UID16 is not set
+# CONFIG_SYSCTL_SYSCALL is not set
+# CONFIG_KALLSYMS is not set
+# CONFIG_PRINTK is not set
+# CONFIG_BUG is not set
+# CONFIG_ELF_CORE is not set
+# CONFIG_BASE_FULL is not set
+CONFIG_EMBEDDED=y
+# CONFIG_VM_EVENT_COUNTERS is not set
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLOB=y
+# CONFIG_LBDAF is not set
+# CONFIG_IOSCHED_CFQ is not set
+CONFIG_ARCH_SA1100=y
+CONFIG_SA1100_COLLIE=y
+CONFIG_PCCARD=y
+# CONFIG_PCMCIA_LOAD_CIS is not set
+CONFIG_PCMCIA_SA1100=y
+CONFIG_NO_HZ=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="console=tty1 console=ttySA0,115200n8 fbcon=rotate:1 mem=64M loglevel=3"
+CONFIG_KEXEC=y
+CONFIG_APM_EMULATION=y
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_MTD=y
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_CFI=y
+CONFIG_MTD_JEDECPROBE=y
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+CONFIG_MTD_CFI_GEOMETRY=y
+# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_2 is not set
+# CONFIG_MTD_CFI_I1 is not set
+# CONFIG_MTD_CFI_I2 is not set
+CONFIG_MTD_CFI_I4=y
+CONFIG_MTD_CFI_INTELEXT=y
+CONFIG_MTD_ROM=y
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_SA1100=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_VERIFY_WRITE=y
+CONFIG_MTD_UBI=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_ATA=y
+# CONFIG_ATA_VERBOSE_ERROR is not set
+# CONFIG_SATA_PMP is not set
+CONFIG_PATA_PCMCIA=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=240
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=320
+CONFIG_INPUT_EVDEV=y
+CONFIG_INPUT_APMPOWER=y
+# CONFIG_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_LOCOMO=y
+# CONFIG_INPUT_MOUSE is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+# CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_DEVKMEM is not set
+CONFIG_SERIAL_SA1100=y
+CONFIG_SERIAL_SA1100_CONSOLE=y
+# CONFIG_HW_RANDOM is not set
+CONFIG_I2C=y
+# CONFIG_I2C_COMPAT is not set
+CONFIG_SPI=y
+CONFIG_SPI_GPIO=y
+CONFIG_POWER_SUPPLY=y
+CONFIG_PDA_POWER=y
+CONFIG_APM_POWER=y
+CONFIG_BATTERY_COLLIE=y
+# CONFIG_HWMON is not set
+# CONFIG_MFD_SUPPORT is not set
+CONFIG_MCP_SA11X0=y
+CONFIG_MCP_UCB1200=y
+CONFIG_MCP_UCB1200_TS=y
+CONFIG_FB=y
+CONFIG_FB_SA1100=y
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+# CONFIG_BACKLIGHT_GENERIC is not set
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+CONFIG_FONTS=y
+CONFIG_FONT_8x8=y
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+# CONFIG_HID_SUPPORT is not set
+# CONFIG_USB_SUPPORT is not set
+CONFIG_MMC=y
+CONFIG_MMC_SPI=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_LOCOMO=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_SA1100=y
+CONFIG_EXT2_FS=y
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+# CONFIG_EXT3_FS_XATTR is not set
+CONFIG_EXT4_FS=y
+# CONFIG_EXT4_FS_XATTR is not set
+# CONFIG_FILE_LOCKING is not set
+# CONFIG_DNOTIFY is not set
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+# CONFIG_PROC_PAGE_MONITOR is not set
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_SUMMARY=y
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RUBIN=y
+CONFIG_UBIFS_FS=y
+CONFIG_UBIFS_FS_ADVANCED_COMPR=y
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=2048
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_ARM_UNWIND is not set
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_HW is not set
diff --git a/recipes/linux/linux-kexecboot-2.6.39/poodle/defconfig b/recipes/linux/linux-kexecboot-2.6.39/poodle/defconfig
new file mode 100644
index 0000000000..c714c219be
--- /dev/null
+++ b/recipes/linux/linux-kexecboot-2.6.39/poodle/defconfig
@@ -0,0 +1,137 @@
+CONFIG_EXPERIMENTAL=y
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_KERNEL_LZMA=y
+# CONFIG_SWAP is not set
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE="initramfs.cpio.lzma"
+CONFIG_RD_LZMA=y
+CONFIG_INITRAMFS_COMPRESSION_LZMA=y
+# CONFIG_UID16 is not set
+# CONFIG_SYSCTL_SYSCALL is not set
+# CONFIG_KALLSYMS is not set
+# CONFIG_PRINTK is not set
+# CONFIG_BUG is not set
+# CONFIG_ELF_CORE is not set
+# CONFIG_BASE_FULL is not set
+CONFIG_EMBEDDED=y
+# CONFIG_VM_EVENT_COUNTERS is not set
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLOB=y
+# CONFIG_LBDAF is not set
+# CONFIG_IOSCHED_CFQ is not set
+CONFIG_ARCH_PXA=y
+CONFIG_PXA_SHARPSL=y
+CONFIG_PXA_SHARPSL_DETECT_MACH_ID=y
+CONFIG_MACH_POODLE=y
+CONFIG_PCCARD=y
+# CONFIG_PCMCIA_LOAD_CIS is not set
+CONFIG_PCMCIA_PXA2XX=y
+CONFIG_NO_HZ=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="console=tty1 console=ttyS0,115200n8 fbcon=rotate:1 loglevel=3"
+CONFIG_KEXEC=y
+CONFIG_APM_EMULATION=y
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_MTD=y
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_ROM=y
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_VERIFY_WRITE=y
+CONFIG_MTD_NAND_SHARPSL=y
+CONFIG_MTD_UBI=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_ATA=y
+# CONFIG_ATA_VERBOSE_ERROR is not set
+# CONFIG_SATA_PMP is not set
+CONFIG_PATA_PXA=y
+CONFIG_PATA_PCMCIA=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=240
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=320
+CONFIG_INPUT_EVDEV=y
+CONFIG_INPUT_APMPOWER=y
+# CONFIG_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_LOCOMO=y
+# CONFIG_INPUT_MOUSE is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_ADS7846=y
+# CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_DEVKMEM is not set
+CONFIG_SERIAL_PXA=y
+CONFIG_SERIAL_PXA_CONSOLE=y
+# CONFIG_HW_RANDOM is not set
+CONFIG_I2C=y
+# CONFIG_I2C_COMPAT is not set
+CONFIG_I2C_PXA=y
+CONFIG_SPI=y
+CONFIG_SPI_PXA2XX=y
+CONFIG_POWER_SUPPLY=y
+CONFIG_PDA_POWER=y
+CONFIG_APM_POWER=y
+# CONFIG_HWMON is not set
+# CONFIG_MFD_SUPPORT is not set
+CONFIG_FB=y
+CONFIG_FB_PXA=y
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+# CONFIG_BACKLIGHT_GENERIC is not set
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+CONFIG_FONTS=y
+CONFIG_FONT_8x8=y
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+# CONFIG_HID_SUPPORT is not set
+# CONFIG_USB_SUPPORT is not set
+CONFIG_MMC=y
+CONFIG_MMC_PXA=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_LOCOMO=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_SA1100=y
+CONFIG_EXT2_FS=y
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+# CONFIG_EXT3_FS_XATTR is not set
+CONFIG_EXT4_FS=y
+# CONFIG_EXT4_FS_XATTR is not set
+# CONFIG_FILE_LOCKING is not set
+# CONFIG_DNOTIFY is not set
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+# CONFIG_PROC_PAGE_MONITOR is not set
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_SUMMARY=y
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RUBIN=y
+CONFIG_UBIFS_FS=y
+CONFIG_UBIFS_FS_ADVANCED_COMPR=y
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=2048
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_ARM_UNWIND is not set
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_HW is not set
diff --git a/recipes/linux/linux-kexecboot-2.6.39/spitz/defconfig b/recipes/linux/linux-kexecboot-2.6.39/spitz/defconfig
new file mode 100644
index 0000000000..75c23b3ce1
--- /dev/null
+++ b/recipes/linux/linux-kexecboot-2.6.39/spitz/defconfig
@@ -0,0 +1,133 @@
+CONFIG_EXPERIMENTAL=y
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_KERNEL_LZMA=y
+# CONFIG_SWAP is not set
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE="initramfs.cpio.lzma"
+CONFIG_RD_LZMA=y
+CONFIG_INITRAMFS_COMPRESSION_LZMA=y
+# CONFIG_UID16 is not set
+# CONFIG_SYSCTL_SYSCALL is not set
+# CONFIG_KALLSYMS is not set
+# CONFIG_PRINTK is not set
+# CONFIG_BUG is not set
+# CONFIG_ELF_CORE is not set
+# CONFIG_BASE_FULL is not set
+CONFIG_EMBEDDED=y
+# CONFIG_VM_EVENT_COUNTERS is not set
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLOB=y
+# CONFIG_LBDAF is not set
+# CONFIG_IOSCHED_CFQ is not set
+CONFIG_ARCH_PXA=y
+CONFIG_PXA_SHARPSL=y
+CONFIG_PXA_SHARPSL_DETECT_MACH_ID=y
+CONFIG_MACH_AKITA=y
+CONFIG_MACH_BORZOI=y
+CONFIG_PCCARD=y
+# CONFIG_PCMCIA_LOAD_CIS is not set
+CONFIG_PCMCIA_PXA2XX=y
+CONFIG_NO_HZ=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="console=tty1 console=ttyS0,115200n8 fbcon=rotate:1 loglevel=3"
+CONFIG_KEXEC=y
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_MTD=y
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_ROM=y
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_VERIFY_WRITE=y
+CONFIG_MTD_NAND_SHARPSL=y
+CONFIG_MTD_UBI=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_ATA=y
+# CONFIG_ATA_VERBOSE_ERROR is not set
+# CONFIG_SATA_PMP is not set
+CONFIG_PATA_PXA=y
+CONFIG_PATA_PCMCIA=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=640
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=480
+CONFIG_INPUT_EVDEV=y
+CONFIG_INPUT_APMPOWER=y
+# CONFIG_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_MATRIX=y
+# CONFIG_INPUT_MOUSE is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_ADS7846=y
+# CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_DEVKMEM is not set
+CONFIG_SERIAL_PXA=y
+CONFIG_SERIAL_PXA_CONSOLE=y
+# CONFIG_HW_RANDOM is not set
+# CONFIG_I2C_COMPAT is not set
+CONFIG_SPI=y
+CONFIG_SPI_PXA2XX=y
+CONFIG_POWER_SUPPLY=y
+CONFIG_PDA_POWER=y
+CONFIG_APM_POWER=y
+# CONFIG_MFD_SUPPORT is not set
+CONFIG_FB=y
+CONFIG_FB_PXA=y
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_CORGI=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+CONFIG_FONTS=y
+CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+# CONFIG_HID_SUPPORT is not set
+# CONFIG_USB_SUPPORT is not set
+CONFIG_MMC=y
+CONFIG_MMC_PXA=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_PXA=y
+CONFIG_EXT2_FS=y
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+# CONFIG_EXT3_FS_XATTR is not set
+CONFIG_EXT4_FS=y
+# CONFIG_EXT4_FS_XATTR is not set
+# CONFIG_FILE_LOCKING is not set
+# CONFIG_DNOTIFY is not set
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+# CONFIG_PROC_PAGE_MONITOR is not set
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_SUMMARY=y
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RUBIN=y
+CONFIG_UBIFS_FS=y
+CONFIG_UBIFS_FS_ADVANCED_COMPR=y
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=2048
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_ARM_UNWIND is not set
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_HW is not set
diff --git a/recipes/linux/linux-kexecboot-2.6.39/tosa/defconfig b/recipes/linux/linux-kexecboot-2.6.39/tosa/defconfig
new file mode 100644
index 0000000000..f843ecb17c
--- /dev/null
+++ b/recipes/linux/linux-kexecboot-2.6.39/tosa/defconfig
@@ -0,0 +1,135 @@
+CONFIG_EXPERIMENTAL=y
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_KERNEL_LZMA=y
+# CONFIG_SWAP is not set
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE="initramfs.cpio.lzma"
+CONFIG_RD_LZMA=y
+CONFIG_INITRAMFS_COMPRESSION_LZMA=y
+# CONFIG_UID16 is not set
+# CONFIG_SYSCTL_SYSCALL is not set
+# CONFIG_KALLSYMS is not set
+# CONFIG_PRINTK is not set
+# CONFIG_BUG is not set
+# CONFIG_ELF_CORE is not set
+# CONFIG_BASE_FULL is not set
+CONFIG_EMBEDDED=y
+# CONFIG_VM_EVENT_COUNTERS is not set
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLOB=y
+# CONFIG_LBDAF is not set
+# CONFIG_IOSCHED_CFQ is not set
+CONFIG_ARCH_PXA=y
+CONFIG_PXA_SHARPSL=y
+CONFIG_PXA_SHARPSL_DETECT_MACH_ID=y
+CONFIG_MACH_TOSA=y
+CONFIG_PCCARD=y
+# CONFIG_PCMCIA_LOAD_CIS is not set
+CONFIG_PCMCIA_PXA2XX=y
+CONFIG_NO_HZ=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE="console=tty1 console=ttyS0,115200n8 loglevel=3"
+CONFIG_KEXEC=y
+CONFIG_APM_EMULATION=y
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_MTD=y
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_ROM=y
+CONFIG_MTD_COMPLEX_MAPPINGS=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_VERIFY_WRITE=y
+CONFIG_MTD_NAND_TMIO=y
+CONFIG_MTD_UBI=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_ATA=y
+# CONFIG_ATA_VERBOSE_ERROR is not set
+# CONFIG_SATA_PMP is not set
+CONFIG_PATA_PXA=y
+CONFIG_PATA_PCMCIA=y
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=480
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=640
+CONFIG_INPUT_EVDEV=y
+CONFIG_INPUT_APMPOWER=y
+# CONFIG_KEYBOARD_ATKBD is not set
+CONFIG_KEYBOARD_GPIO=y
+CONFIG_KEYBOARD_MATRIX=y
+# CONFIG_INPUT_MOUSE is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+# CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_DEVKMEM is not set
+CONFIG_SERIAL_PXA=y
+CONFIG_SERIAL_PXA_CONSOLE=y
+# CONFIG_HW_RANDOM is not set
+CONFIG_I2C=y
+# CONFIG_I2C_COMPAT is not set
+CONFIG_I2C_PXA=y
+CONFIG_SPI=y
+CONFIG_SPI_PXA2XX=y
+CONFIG_POWER_SUPPLY=y
+CONFIG_PDA_POWER=y
+CONFIG_APM_POWER=y
+# CONFIG_HWMON is not set
+CONFIG_MFD_TC6393XB=y
+CONFIG_FB=y
+CONFIG_FB_TMIO=y
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_LCD_TOSA=y
+CONFIG_BACKLIGHT_TOSA=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FONTS=y
+CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+# CONFIG_HID_SUPPORT is not set
+# CONFIG_USB_SUPPORT is not set
+CONFIG_MMC=y
+CONFIG_MMC_PXA=y
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_GPIO=y
+CONFIG_LEDS_TRIGGERS=y
+CONFIG_LEDS_TRIGGER_TIMER=y
+CONFIG_LEDS_TRIGGER_HEARTBEAT=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_SA1100=y
+CONFIG_EXT2_FS=y
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+# CONFIG_EXT3_FS_XATTR is not set
+CONFIG_EXT4_FS=y
+# CONFIG_EXT4_FS_XATTR is not set
+# CONFIG_FILE_LOCKING is not set
+# CONFIG_DNOTIFY is not set
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+# CONFIG_PROC_PAGE_MONITOR is not set
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_SUMMARY=y
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RUBIN=y
+CONFIG_UBIFS_FS=y
+CONFIG_UBIFS_FS_ADVANCED_COMPR=y
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=2048
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_ARM_UNWIND is not set
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_HW is not set
diff --git a/recipes/linux/linux-kexecboot/akita/defconfig b/recipes/linux/linux-kexecboot/akita/defconfig
index b1eced3d52..75c23b3ce1 100644
--- a/recipes/linux/linux-kexecboot/akita/defconfig
+++ b/recipes/linux/linux-kexecboot/akita/defconfig
@@ -7,7 +7,6 @@ CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE="initramfs.cpio.lzma"
CONFIG_RD_LZMA=y
CONFIG_INITRAMFS_COMPRESSION_LZMA=y
-CONFIG_EMBEDDED=y
# CONFIG_UID16 is not set
# CONFIG_SYSCTL_SYSCALL is not set
# CONFIG_KALLSYMS is not set
@@ -15,6 +14,7 @@ CONFIG_EMBEDDED=y
# CONFIG_BUG is not set
# CONFIG_ELF_CORE is not set
# CONFIG_BASE_FULL is not set
+CONFIG_EMBEDDED=y
# CONFIG_VM_EVENT_COUNTERS is not set
# CONFIG_COMPAT_BRK is not set
CONFIG_SLOB=y
diff --git a/recipes/linux/linux-kexecboot/c7x0/defconfig b/recipes/linux/linux-kexecboot/c7x0/defconfig
index c8a2a7b461..1d544cbaf0 100644
--- a/recipes/linux/linux-kexecboot/c7x0/defconfig
+++ b/recipes/linux/linux-kexecboot/c7x0/defconfig
@@ -7,7 +7,6 @@ CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE="initramfs.cpio.lzma"
CONFIG_RD_LZMA=y
CONFIG_INITRAMFS_COMPRESSION_LZMA=y
-CONFIG_EMBEDDED=y
# CONFIG_UID16 is not set
# CONFIG_SYSCTL_SYSCALL is not set
# CONFIG_KALLSYMS is not set
@@ -15,6 +14,7 @@ CONFIG_EMBEDDED=y
# CONFIG_BUG is not set
# CONFIG_ELF_CORE is not set
# CONFIG_BASE_FULL is not set
+CONFIG_EMBEDDED=y
# CONFIG_VM_EVENT_COUNTERS is not set
# CONFIG_COMPAT_BRK is not set
CONFIG_SLOB=y
diff --git a/recipes/linux/linux-kexecboot/collie/defconfig b/recipes/linux/linux-kexecboot/collie/defconfig
index ffc89eda1c..0b5b2fe26c 100644
--- a/recipes/linux/linux-kexecboot/collie/defconfig
+++ b/recipes/linux/linux-kexecboot/collie/defconfig
@@ -7,7 +7,6 @@ CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE="initramfs.cpio.lzma"
CONFIG_RD_LZMA=y
CONFIG_INITRAMFS_COMPRESSION_LZMA=y
-CONFIG_EMBEDDED=y
# CONFIG_UID16 is not set
# CONFIG_SYSCTL_SYSCALL is not set
# CONFIG_KALLSYMS is not set
@@ -15,6 +14,7 @@ CONFIG_EMBEDDED=y
# CONFIG_BUG is not set
# CONFIG_ELF_CORE is not set
# CONFIG_BASE_FULL is not set
+CONFIG_EMBEDDED=y
# CONFIG_VM_EVENT_COUNTERS is not set
# CONFIG_COMPAT_BRK is not set
CONFIG_SLOB=y
diff --git a/recipes/linux/linux-kexecboot/poodle/defconfig b/recipes/linux/linux-kexecboot/poodle/defconfig
index f25435b8e7..c714c219be 100644
--- a/recipes/linux/linux-kexecboot/poodle/defconfig
+++ b/recipes/linux/linux-kexecboot/poodle/defconfig
@@ -7,7 +7,6 @@ CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE="initramfs.cpio.lzma"
CONFIG_RD_LZMA=y
CONFIG_INITRAMFS_COMPRESSION_LZMA=y
-CONFIG_EMBEDDED=y
# CONFIG_UID16 is not set
# CONFIG_SYSCTL_SYSCALL is not set
# CONFIG_KALLSYMS is not set
@@ -15,6 +14,7 @@ CONFIG_EMBEDDED=y
# CONFIG_BUG is not set
# CONFIG_ELF_CORE is not set
# CONFIG_BASE_FULL is not set
+CONFIG_EMBEDDED=y
# CONFIG_VM_EVENT_COUNTERS is not set
# CONFIG_COMPAT_BRK is not set
CONFIG_SLOB=y
diff --git a/recipes/linux/linux-kexecboot/spitz/defconfig b/recipes/linux/linux-kexecboot/spitz/defconfig
index b1eced3d52..75c23b3ce1 100644
--- a/recipes/linux/linux-kexecboot/spitz/defconfig
+++ b/recipes/linux/linux-kexecboot/spitz/defconfig
@@ -7,7 +7,6 @@ CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE="initramfs.cpio.lzma"
CONFIG_RD_LZMA=y
CONFIG_INITRAMFS_COMPRESSION_LZMA=y
-CONFIG_EMBEDDED=y
# CONFIG_UID16 is not set
# CONFIG_SYSCTL_SYSCALL is not set
# CONFIG_KALLSYMS is not set
@@ -15,6 +14,7 @@ CONFIG_EMBEDDED=y
# CONFIG_BUG is not set
# CONFIG_ELF_CORE is not set
# CONFIG_BASE_FULL is not set
+CONFIG_EMBEDDED=y
# CONFIG_VM_EVENT_COUNTERS is not set
# CONFIG_COMPAT_BRK is not set
CONFIG_SLOB=y
diff --git a/recipes/linux/linux-kexecboot/tosa/defconfig b/recipes/linux/linux-kexecboot/tosa/defconfig
index d0bcf1860a..f843ecb17c 100644
--- a/recipes/linux/linux-kexecboot/tosa/defconfig
+++ b/recipes/linux/linux-kexecboot/tosa/defconfig
@@ -7,7 +7,6 @@ CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE="initramfs.cpio.lzma"
CONFIG_RD_LZMA=y
CONFIG_INITRAMFS_COMPRESSION_LZMA=y
-CONFIG_EMBEDDED=y
# CONFIG_UID16 is not set
# CONFIG_SYSCTL_SYSCALL is not set
# CONFIG_KALLSYMS is not set
@@ -15,6 +14,7 @@ CONFIG_EMBEDDED=y
# CONFIG_BUG is not set
# CONFIG_ELF_CORE is not set
# CONFIG_BASE_FULL is not set
+CONFIG_EMBEDDED=y
# CONFIG_VM_EVENT_COUNTERS is not set
# CONFIG_COMPAT_BRK is not set
CONFIG_SLOB=y
diff --git a/recipes/linux/linux-kexecboot_2.6.39.bb b/recipes/linux/linux-kexecboot_2.6.39.bb
new file mode 100644
index 0000000000..422a4b98d7
--- /dev/null
+++ b/recipes/linux/linux-kexecboot_2.6.39.bb
@@ -0,0 +1,21 @@
+require linux-kexecboot.inc
+
+PR = "${INC_PR}.0"
+
+S = "${WORKDIR}/linux-${PV}"
+
+# Mark archs/machines that this kernel supports
+DEFAULT_PREFERENCE = "-1"
+
+DEFAULT_PREFERENCE_akita = "1"
+DEFAULT_PREFERENCE_c7x0 = "1"
+DEFAULT_PREFERENCE_collie = "1"
+DEFAULT_PREFERENCE_poodle = "1"
+DEFAULT_PREFERENCE_spitz = "1"
+DEFAULT_PREFERENCE_tosa = "1"
+
+SRC_URI += "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-${PV}.tar.bz2;name=kernel \
+ file://defconfig"
+
+SRC_URI[kernel.md5sum] = "1aab7a741abe08d42e8eccf20de61e05"
+SRC_URI[kernel.sha256sum] = "584d17f2a3ee18a9501d7ff36907639e538cfdba4529978b8550c461d45c61f6"
diff --git a/recipes/linux/linux-nokia900-meego/defconfig b/recipes/linux/linux-nokia900-meego/defconfig
index 1015bbd830..913b3adfef 100644
--- a/recipes/linux/linux-nokia900-meego/defconfig
+++ b/recipes/linux/linux-nokia900-meego/defconfig
@@ -1,312 +1,34 @@
-#
-# Automatically generated make config: don't edit
-# Linux/arm 2.6.37 Kernel Configuration
-# Fri May 6 10:23:30 2011
-#
-CONFIG_ARM=y
-CONFIG_SYS_SUPPORTS_APM_EMULATION=y
-CONFIG_GENERIC_GPIO=y
-# CONFIG_ARCH_USES_GETTIMEOFFSET is not set
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_HAVE_PROC_CPU=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_GENERIC_HARDIRQS_NO__DO_IRQ=y
-CONFIG_ARM_L1_CACHE_SHIFT_6=y
-CONFIG_VECTORS_BASE=0xffff0000
-CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
-CONFIG_CONSTRUCTORS=y
-CONFIG_HAVE_IRQ_WORK=y
-CONFIG_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 is not set
CONFIG_KERNEL_LZMA=y
-# CONFIG_KERNEL_LZO is not set
-CONFIG_SWAP=y
CONFIG_SYSVIPC=y
-CONFIG_SYSVIPC_SYSCTL=y
CONFIG_POSIX_MQUEUE=y
-CONFIG_POSIX_MQUEUE_SYSCTL=y
CONFIG_BSD_PROCESS_ACCT=y
-# CONFIG_BSD_PROCESS_ACCT_V3 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_TREE_PREEMPT_RCU=y
-# CONFIG_TINY_RCU is not set
-# CONFIG_TINY_PREEMPT_RCU is not set
-CONFIG_PREEMPT_RCU=y
-# CONFIG_RCU_TRACE is not set
-CONFIG_RCU_FANOUT=32
-# CONFIG_RCU_FANOUT_EXACT is not set
-# CONFIG_TREE_RCU_TRACE is not set
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_LOG_BUF_SHIFT=16
CONFIG_CGROUPS=y
-# CONFIG_CGROUP_DEBUG is not set
CONFIG_CGROUP_NS=y
CONFIG_CGROUP_FREEZER=y
-# CONFIG_CGROUP_DEVICE is not set
-# CONFIG_CPUSETS is not set
-# CONFIG_CGROUP_CPUACCT is not set
CONFIG_RESOURCE_COUNTERS=y
CONFIG_CGROUP_MEM_RES_CTLR=y
CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y
-CONFIG_CGROUP_MEM_RES_CTLR_SWAP_ENABLED=y
-# CONFIG_CGROUP_SCHED is not set
-# CONFIG_BLK_CGROUP is not set
-CONFIG_NAMESPACES=y
-CONFIG_UTS_NS=y
-CONFIG_IPC_NS=y
-CONFIG_USER_NS=y
-CONFIG_PID_NS=y
-CONFIG_NET_NS=y
-CONFIG_MM_OWNER=y
-# 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=y
-CONFIG_SYSCTL=y
-CONFIG_ANON_INODES=y
-# CONFIG_EMBEDDED is not set
-CONFIG_UID16=y
-CONFIG_SYSCTL_SYSCALL=y
-CONFIG_KALLSYMS=y
-CONFIG_KALLSYMS_ALL=y
CONFIG_KALLSYMS_EXTRA_PASS=y
-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=y
-# CONFIG_PERF_COUNTERS is not set
-# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
-CONFIG_VM_EVENT_COUNTERS=y
# CONFIG_COMPAT_BRK is not set
CONFIG_SLAB=y
-# CONFIG_SLUB is not set
CONFIG_PROFILING=y
-CONFIG_TRACEPOINTS=y
CONFIG_OPROFILE=m
-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
-CONFIG_HAVE_HW_BREAKPOINT=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 is not set
-# CONFIG_MODVERSIONS is not set
-# CONFIG_MODULE_SRCVERSION_ALL is not set
-CONFIG_BLOCK=y
-CONFIG_LBDAF=y
-CONFIG_BLK_DEV_BSG=y
-# CONFIG_BLK_DEV_INTEGRITY is not set
-
-#
-# IO Schedulers
-#
-CONFIG_IOSCHED_NOOP=y
# CONFIG_IOSCHED_DEADLINE is not set
-CONFIG_IOSCHED_CFQ=y
-CONFIG_DEFAULT_CFQ=y
-# CONFIG_DEFAULT_NOOP is not set
-CONFIG_DEFAULT_IOSCHED="cfq"
-# 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 is not set
-# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
-# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
-# 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 is not set
-# CONFIG_INLINE_READ_UNLOCK_BH is not set
-# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
-# 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 is not set
-# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
-# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
-# 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 is not set
-# 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=y
-# CONFIG_PLAT_SPEAR is not set
-
-#
-# TI OMAP Common Features
-#
-CONFIG_ARCH_OMAP_OTG=y
-# CONFIG_ARCH_OMAP1 is not set
-CONFIG_ARCH_OMAP2PLUS=y
-
-#
-# OMAP Feature Selections
-#
-# CONFIG_OMAP_SMARTREFLEX is not set
CONFIG_OMAP_RESET_CLOCKS=y
-CONFIG_OMAP_MUX=y
-# CONFIG_OMAP_MUX_DEBUG is not set
-CONFIG_OMAP_MUX_WARNINGS=y
-CONFIG_OMAP_MCBSP=y
-CONFIG_OMAP_MBOX_FWK=m
-CONFIG_OMAP_MBOX_KFIFO_SIZE=256
-CONFIG_OMAP_IOMMU=y
-# CONFIG_OMAP_IOMMU_DEBUG is not set
-# CONFIG_OMAP_MPU_TIMER is not set
-CONFIG_OMAP_32K_TIMER=y
CONFIG_OMAP3_L2_AUX_SECURE_SAVE_RESTORE=y
-CONFIG_OMAP3_L2_AUX_SECURE_SERVICE_SET_ID=43
-CONFIG_OMAP_32K_TIMER_HZ=128
CONFIG_OMAP_DM_TIMER=y
-# CONFIG_OMAP_PM_NONE is not set
-CONFIG_OMAP_PM_NOOP=y
-
-#
-# TI OMAP2/3/4 Specific Features
-#
# CONFIG_ARCH_OMAP2PLUS_TYPICAL is not set
# CONFIG_ARCH_OMAP2 is not set
-CONFIG_ARCH_OMAP3=y
# CONFIG_ARCH_OMAP4 is not set
-CONFIG_ARCH_OMAP3430=y
-CONFIG_OMAP_PACKAGE_CBB=y
-
-#
-# OMAP Board Type
-#
# CONFIG_MACH_OMAP3_BEAGLE is not set
# CONFIG_MACH_DEVKIT8000 is not set
# CONFIG_MACH_OMAP_LDP is not set
@@ -318,7 +40,6 @@ CONFIG_OMAP_PACKAGE_CBB=y
# CONFIG_MACH_OMAP3_PANDORA is not set
# CONFIG_MACH_OMAP3_TOUCHBOOK is not set
# CONFIG_MACH_OMAP_3430SDP is not set
-CONFIG_MACH_NOKIA_RX51=y
# CONFIG_MACH_OMAP_ZOOM2 is not set
# CONFIG_MACH_OMAP_ZOOM3 is not set
# CONFIG_MACH_CM_T35 is not set
@@ -327,284 +48,48 @@ CONFIG_MACH_NOKIA_RX51=y
# CONFIG_MACH_IGEP0030 is not set
# CONFIG_MACH_SBC3530 is not set
# CONFIG_MACH_OMAP_3630SDP is not set
-# CONFIG_OMAP3_EMU is not set
-# CONFIG_OMAP3_SDRC_AC_TIMING is not set
-
-#
-# Processor Type
-#
-CONFIG_CPU_32v6K=y
-CONFIG_CPU_V7=y
-CONFIG_CPU_32v7=y
-CONFIG_CPU_ABRT_EV7=y
-CONFIG_CPU_PABRT_V7=y
-CONFIG_CPU_CACHE_V7=y
-CONFIG_CPU_CACHE_VIPT=y
-CONFIG_CPU_COPY_V6=y
-CONFIG_CPU_TLB_V7=y
-CONFIG_CPU_HAS_ASID=y
-CONFIG_CPU_CP15=y
-CONFIG_CPU_CP15_MMU=y
-
-#
-# Processor Features
-#
-CONFIG_ARM_THUMB=y
CONFIG_ARM_THUMBEE=y
-# CONFIG_CPU_ICACHE_DISABLE is not set
-# CONFIG_CPU_DCACHE_DISABLE is not set
-# CONFIG_CPU_BPREDICT_DISABLE is not set
-CONFIG_ARM_L1_CACHE_SHIFT=6
-CONFIG_ARM_DMA_MEM_BUFFERABLE=y
-# CONFIG_ARM_ERRATA_430973 is not set
-# CONFIG_ARM_ERRATA_458693 is not set
-# CONFIG_ARM_ERRATA_460075 is not set
-# CONFIG_ARM_ERRATA_743622 is not set
-CONFIG_COMMON_CLKDEV=y
-
-#
-# Bus support
-#
-# CONFIG_PCI_SYSCALL is not set
-# CONFIG_ARCH_SUPPORTS_MSI is not set
-# CONFIG_PCCARD is not set
-
-#
-# Kernel Features
-#
-CONFIG_TICK_ONESHOT=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
-CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
-CONFIG_VMSPLIT_3G=y
-# CONFIG_VMSPLIT_2G is not set
-# CONFIG_VMSPLIT_1G is not set
-CONFIG_PAGE_OFFSET=0xC0000000
-# CONFIG_PREEMPT_NONE is not set
-# CONFIG_PREEMPT_VOLUNTARY is not set
CONFIG_PREEMPT=y
-CONFIG_HZ=128
-# CONFIG_THUMB2_KERNEL is not set
CONFIG_AEABI=y
# CONFIG_OABI_COMPAT is not set
-CONFIG_ARCH_HAS_HOLES_MEMORYMODEL=y
-# 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=4
-# 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_LEDS is not set
-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="root=/dev/mmcblk0p1 rootwait rw console=ttyO2,115200n8 console=tty0 omapfb.vram=0:2M,1:2M,2:2M mtdoops.mtddev=2 quiet"
-# CONFIG_CMDLINE_FORCE is not set
-# CONFIG_XIP_KERNEL is not set
CONFIG_KEXEC=y
-CONFIG_ATAGS_PROC=y
-# CONFIG_AUTO_ZRELADDR is not set
-
-#
-# CPU Power Management
-#
CONFIG_CPU_FREQ=y
-CONFIG_CPU_FREQ_TABLE=y
-# CONFIG_CPU_FREQ_DEBUG is not set
-CONFIG_CPU_FREQ_STAT=y
-# CONFIG_CPU_FREQ_STAT_DETAILS is not set
-# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
-# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
-# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
-CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=m
-# CONFIG_CPU_FREQ_GOV_USERSPACE is not set
-CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+CONFIG_CPU_FREQ_GOV_USERSPACE=m
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
CONFIG_CPU_IDLE=y
-CONFIG_CPU_IDLE_GOV_LADDER=y
-CONFIG_CPU_IDLE_GOV_MENU=y
-
-#
-# Floating point emulation
-#
-
-#
-# At least one emulation must be selected
-#
CONFIG_VFP=y
-CONFIG_VFPv3=y
CONFIG_NEON=y
-
-#
-# Userspace binary formats
-#
-CONFIG_BINFMT_ELF=y
-CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
-CONFIG_HAVE_AOUT=y
-# CONFIG_BINFMT_AOUT is not set
CONFIG_BINFMT_MISC=m
-
-#
-# Power management options
-#
CONFIG_PM=y
CONFIG_PM_DEBUG=y
CONFIG_PM_ADVANCED_DEBUG=y
-# CONFIG_PM_VERBOSE is not set
-CONFIG_CAN_PM_TRACE=y
-CONFIG_PM_SLEEP=y
-# CONFIG_PM_SLEEP_ADVANCED_DEBUG is not set
-CONFIG_SUSPEND_NVS=y
-CONFIG_SUSPEND=y
-# CONFIG_PM_TEST_SUSPEND is not set
-CONFIG_SUSPEND_FREEZER=y
-# CONFIG_APM_EMULATION is not set
CONFIG_PM_RUNTIME=y
-CONFIG_PM_OPS=y
-CONFIG_ARCH_HAS_OPP=y
-CONFIG_PM_OPP=y
-CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_NET=y
-
-#
-# Networking options
-#
-CONFIG_PACKET=y
+CONFIG_PACKET=m
CONFIG_UNIX=y
-CONFIG_XFRM=y
-CONFIG_XFRM_USER=y
-# CONFIG_XFRM_SUB_POLICY is not set
-CONFIG_XFRM_MIGRATE=y
-# CONFIG_XFRM_STATISTICS is not set
-CONFIG_NET_KEY=y
+CONFIG_XFRM_USER=m
+CONFIG_NET_KEY=m
CONFIG_NET_KEY_MIGRATE=y
CONFIG_INET=y
CONFIG_IP_MULTICAST=y
-# CONFIG_IP_ADVANCED_ROUTER is not set
-CONFIG_IP_FIB_HASH=y
CONFIG_IP_PNP=y
CONFIG_IP_PNP_DHCP=y
CONFIG_IP_PNP_BOOTP=y
CONFIG_IP_PNP_RARP=y
-# CONFIG_NET_IPIP is not set
-# CONFIG_NET_IPGRE_DEMUX is not set
-# CONFIG_IP_MROUTE is not set
-# CONFIG_ARPD is not set
-# CONFIG_SYN_COOKIES is not set
-# 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=m
-CONFIG_INET_XFRM_MODE_TRANSPORT=y
-CONFIG_INET_XFRM_MODE_TUNNEL=y
-CONFIG_INET_XFRM_MODE_BEET=y
+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=y
-CONFIG_INET_TCP_DIAG=y
-# CONFIG_TCP_CONG_ADVANCED is not set
-CONFIG_TCP_CONG_CUBIC=y
-CONFIG_DEFAULT_TCP_CONG="cubic"
-# CONFIG_TCP_MD5SIG is not set
-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 is not set
-# CONFIG_INET6_ESP is not set
-# CONFIG_INET6_IPCOMP is not set
-# CONFIG_IPV6_MIP6 is not set
-# CONFIG_INET6_XFRM_TUNNEL is not set
-# CONFIG_INET6_TUNNEL is not set
-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 is not set
-# 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_INET_DIAG=m
CONFIG_NETFILTER=y
-# CONFIG_NETFILTER_DEBUG is not set
-CONFIG_NETFILTER_ADVANCED=y
-
-#
-# Core Netfilter Configuration
-#
-# CONFIG_NETFILTER_NETLINK_QUEUE is not set
-# CONFIG_NETFILTER_NETLINK_LOG is not set
-# CONFIG_NF_CONNTRACK is not set
-# CONFIG_NETFILTER_XTABLES is not set
-# CONFIG_IP_VS is not set
-
-#
-# IP: Netfilter Configuration
-#
-# CONFIG_NF_DEFRAG_IPV4 is not set
-# CONFIG_IP_NF_QUEUE is not set
-# CONFIG_IP_NF_IPTABLES is not set
-# CONFIG_IP_NF_ARPTABLES is not set
-
-#
-# IPv6: Netfilter Configuration
-#
-# CONFIG_NF_DEFRAG_IPV6 is not set
-# CONFIG_IP6_NF_QUEUE is not set
-# CONFIG_IP6_NF_IPTABLES 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_BRIDGE is not set
-# CONFIG_NET_DSA is not set
-# CONFIG_VLAN_8021Q is not set
-# CONFIG_DECNET is not set
-# CONFIG_LLC2 is not set
-# CONFIG_LAPB is not set
-# CONFIG_ECONET is not set
-# CONFIG_WAN_ROUTER is not set
CONFIG_PHONET=m
-# CONFIG_PHONET_PIPECTRLR is not set
-# CONFIG_IEEE802154 is not set
-# CONFIG_NET_SCHED is not set
-# CONFIG_DCB is not set
-CONFIG_DNS_RESOLVER=y
-
-#
-# Network testing
-#
-# CONFIG_NET_PKTGEN is not set
-# CONFIG_NET_DROP_MONITOR 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
@@ -613,792 +98,93 @@ CONFIG_BT_RFCOMM_TTY=y
CONFIG_BT_BNEP=m
CONFIG_BT_BNEP_MC_FILTER=y
CONFIG_BT_BNEP_PROTO_FILTER=y
-
-#
-# Bluetooth device drivers
-#
-# CONFIG_BT_HCIBTUSB is not set
-# 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_HCIH4P=m
-# CONFIG_AF_RXRPC is not set
-CONFIG_WIRELESS=y
-CONFIG_WEXT_CORE=y
-CONFIG_WEXT_PROC=y
CONFIG_CFG80211=m
-# CONFIG_NL80211_TESTMODE is not set
-# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
-# CONFIG_CFG80211_REG_DEBUG is not set
-CONFIG_CFG80211_DEFAULT_PS=y
-# CONFIG_CFG80211_DEBUGFS is not set
-# CONFIG_CFG80211_INTERNAL_REGDB is not set
-CONFIG_CFG80211_WEXT=y
-CONFIG_WIRELESS_EXT_SYSFS=y
CONFIG_LIB80211=m
-# CONFIG_LIB80211_DEBUG is not set
CONFIG_MAC80211=m
-CONFIG_MAC80211_HAS_RC=y
-CONFIG_MAC80211_RC_MINSTREL=y
-CONFIG_MAC80211_RC_MINSTREL_HT=y
-CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
-CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"
-# CONFIG_MAC80211_MESH is not set
-# CONFIG_MAC80211_LEDS is not set
-# CONFIG_MAC80211_DEBUGFS is not set
-# CONFIG_MAC80211_DEBUG_MENU is not set
-# CONFIG_WIMAX is not set
CONFIG_RFKILL=m
-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=y
-CONFIG_EXTRA_FIRMWARE=""
-# CONFIG_DEBUG_DRIVER is not set
-# CONFIG_DEBUG_DEVRES is not set
-# CONFIG_SYS_HYPERVISOR is not set
CONFIG_CONNECTOR=y
-CONFIG_PROC_EVENTS=y
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=y
-
-#
-# RAM/ROM/Flash chip drivers
-#
CONFIG_MTD_CFI=m
-# CONFIG_MTD_JEDECPROBE is not set
-CONFIG_MTD_GEN_PROBE=m
-# 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 is not set
-# CONFIG_MTD_CFI_AMDSTD is not set
-# CONFIG_MTD_CFI_STAA is not set
-CONFIG_MTD_CFI_UTIL=m
-# CONFIG_MTD_RAM is not set
-# CONFIG_MTD_ROM is not set
-# CONFIG_MTD_ABSENT is not set
-
-#
-# Mapping drivers for chip access
-#
-# CONFIG_MTD_COMPLEX_MAPPINGS is not set
-# CONFIG_MTD_PHYSMAP 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 is not set
-# 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_OMAP2 is not set
-CONFIG_MTD_NAND_IDS=y
-# 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=y
CONFIG_MTD_ONENAND_VERIFY_WRITE=y
-# CONFIG_MTD_ONENAND_GENERIC is not set
CONFIG_MTD_ONENAND_OMAP2=y
-# CONFIG_MTD_ONENAND_OTP is not set
-# CONFIG_MTD_ONENAND_2X_PROGRAM is not set
-# CONFIG_MTD_ONENAND_SIM 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 is not set
-
-#
-# 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 is not set
CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=16384
-# 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
CONFIG_CMT=m
-
-#
-# 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=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=m
-CONFIG_PHYLIB=m
-
-#
-# MII PHY device drivers
-#
-# CONFIG_MARVELL_PHY is not set
-# CONFIG_DAVICOM_PHY is not set
-# CONFIG_QSEMI_PHY is not set
-# CONFIG_LXT_PHY is not set
-# CONFIG_CICADA_PHY is not set
-# CONFIG_VITESSE_PHY is not set
-CONFIG_SMSC_PHY=m
-# CONFIG_BROADCOM_PHY is not set
-# CONFIG_BCM63XX_PHY is not set
-# CONFIG_ICPLUS_PHY is not set
-# CONFIG_REALTEK_PHY is not set
-# CONFIG_NATIONAL_PHY is not set
-# CONFIG_STE10XP is not set
-# CONFIG_LSI_ET1011C_PHY is not set
-# CONFIG_MICREL_PHY is not set
-# CONFIG_MDIO_BITBANG is not set
-CONFIG_NET_ETHERNET=y
-# CONFIG_AX88796 is not set
-CONFIG_SMC91X=m
-# CONFIG_TI_DAVINCI_EMAC is not set
-# CONFIG_TI_DAVINCI_MDIO is not set
-# CONFIG_TI_DAVINCI_CPDMA is not set
-# CONFIG_DM9000 is not set
-# CONFIG_ENC28J60 is not set
-# CONFIG_ETHOC is not set
-# CONFIG_SMC911X is not set
-# CONFIG_SMSC911X is not set
-# CONFIG_DNET is not set
-# CONFIG_IBM_NEW_EMAC_ZMII is not set
-# CONFIG_IBM_NEW_EMAC_RGMII is not set
-# CONFIG_IBM_NEW_EMAC_TAH is not set
-# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
-# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
-# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
-# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
-# CONFIG_B44 is not set
-# CONFIG_KS8851 is not set
-# CONFIG_KS8851_MLL is not set
# CONFIG_NETDEV_1000 is not set
# CONFIG_NETDEV_10000 is not set
-CONFIG_WLAN=y
-# CONFIG_LIBERTAS_THINFIRM is not set
-# CONFIG_AT76C50X_USB is not set
-# CONFIG_USB_ZD1201 is not set
-# CONFIG_USB_NET_RNDIS_WLAN is not set
-# CONFIG_RTL8187 is not set
-# CONFIG_MAC80211_HWSIM is not set
-# CONFIG_ATH_COMMON is not set
-# CONFIG_B43 is not set
-# CONFIG_B43LEGACY is not set
-# CONFIG_HOSTAP is not set
-# CONFIG_IWM is not set
-# CONFIG_LIBERTAS is not set
-# CONFIG_P54_COMMON is not set
-# CONFIG_RT2X00 is not set
CONFIG_WL1251=m
CONFIG_WL1251_SPI=m
-# CONFIG_WL1251_SDIO is not set
-# CONFIG_WL12XX is not set
-# CONFIG_ZD1211RW 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_HSO is not set
-# CONFIG_USB_CDC_PHONET 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=m
-CONFIG_INPUT_POLLDEV=m
-# CONFIG_INPUT_SPARSEKMAP is not set
-
-#
-# Userland interfaces
-#
-CONFIG_INPUT_MOUSEDEV=y
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
-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_TWL4030=y
-# 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_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_TSC2005=y
-# 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_TWL4030_PWRBUTTON=y
CONFIG_INPUT_TWL4030_VIBRA=m
-# CONFIG_INPUT_UINPUT is not set
-# CONFIG_INPUT_PCF8574 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=y
-# 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=y
-# CONFIG_SERIAL_NONSTANDARD is not set
-# CONFIG_N_GSM is not set
-
-#
-# Serial drivers
-#
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_NR_UARTS=32
-CONFIG_SERIAL_8250_RUNTIME_UARTS=4
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_MANY_PORTS=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_8250_DETECT_IRQ=y
CONFIG_SERIAL_8250_RSA=y
-
-#
-# Non-8250 serial port support
-#
-# CONFIG_SERIAL_MAX3100 is not set
-# CONFIG_SERIAL_MAX3107 is not set
-CONFIG_SERIAL_CORE=y
-CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_SERIAL_OMAP=y
CONFIG_SERIAL_OMAP_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=y
-# CONFIG_HW_RANDOM_TIMERIOMEM 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=y
-
-#
-# 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_OMAP=y
-# CONFIG_I2C_PCA_PLATFORM is not set
-# 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_DEBUG is not set
-CONFIG_SPI_MASTER=y
-
-#
-# SPI Master Controller Drivers
-#
-# CONFIG_SPI_BITBANG is not set
-# CONFIG_SPI_GPIO is not set
CONFIG_SPI_OMAP24XX=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
CONFIG_HSI=y
-
-#
-# HSI controllers
-#
CONFIG_OMAP_SSI=m
-CONFIG_OMAP_SSI_CONFIG=y
-
-#
-# HSI clients
-#
CONFIG_SSI_PROTOCOL=m
CONFIG_HSI_CHAR=m
CONFIG_HSI_CMT_SPEECH=m
-
-#
-# PPS support
-#
-# CONFIG_PPS is not set
-CONFIG_ARCH_REQUIRE_GPIOLIB=y
-CONFIG_GPIOLIB=y
-CONFIG_DEBUG_GPIO=y
CONFIG_GPIO_SYSFS=y
-
-#
-# Memory mapped GPIO expanders:
-#
-# CONFIG_GPIO_BASIC_MMIO is not set
-# 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_TWL4030=y
-# CONFIG_GPIO_ADP5588 is not set
-
-#
-# 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=m
-# 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=m
-CONFIG_BATTERY_BQ27X00_I2C=y
# CONFIG_BATTERY_BQ27X00_PLATFORM is not set
-# CONFIG_BATTERY_MAX17040 is not set
-# CONFIG_BATTERY_MAX17042 is not set
CONFIG_CHARGER_ISP1704=m
-# CONFIG_CHARGER_TWL4030 is not set
-# CONFIG_CHARGER_GPIO is not set
-CONFIG_HWMON=y
-# CONFIG_HWMON_VID is not set
-# CONFIG_HWMON_DEBUG_CHIP is not set
-
-#
-# Native drivers
-#
-# CONFIG_SENSORS_AD7414 is not set
-# CONFIG_SENSORS_AD7418 is not set
-# CONFIG_SENSORS_ADCXX is not set
-# CONFIG_SENSORS_ADM1021 is not set
-# CONFIG_SENSORS_ADM1025 is not set
-# CONFIG_SENSORS_ADM1026 is not set
-# CONFIG_SENSORS_ADM1029 is not set
-# CONFIG_SENSORS_ADM1031 is not set
-# CONFIG_SENSORS_ADM9240 is not set
-# CONFIG_SENSORS_ADT7411 is not set
-# CONFIG_SENSORS_ADT7462 is not set
-# CONFIG_SENSORS_ADT7470 is not set
-# CONFIG_SENSORS_ADT7475 is not set
-# CONFIG_SENSORS_ASC7621 is not set
-# CONFIG_SENSORS_ATXP1 is not set
-# CONFIG_SENSORS_DS1621 is not set
-# CONFIG_SENSORS_F71805F is not set
-# CONFIG_SENSORS_F71882FG is not set
-# CONFIG_SENSORS_F75375S is not set
-# CONFIG_SENSORS_G760A is not set
-# CONFIG_SENSORS_GL518SM is not set
-# CONFIG_SENSORS_GL520SM is not set
-# CONFIG_SENSORS_GPIO_FAN is not set
-# CONFIG_SENSORS_IT87 is not set
-# CONFIG_SENSORS_JC42 is not set
-# CONFIG_SENSORS_LM63 is not set
-# CONFIG_SENSORS_LM70 is not set
-# CONFIG_SENSORS_LM73 is not set
-# CONFIG_SENSORS_LM75 is not set
-# CONFIG_SENSORS_LM77 is not set
-# CONFIG_SENSORS_LM78 is not set
-# CONFIG_SENSORS_LM80 is not set
-# CONFIG_SENSORS_LM83 is not set
-# CONFIG_SENSORS_LM85 is not set
-# CONFIG_SENSORS_LM87 is not set
-# CONFIG_SENSORS_LM90 is not set
-# CONFIG_SENSORS_LM92 is not set
-# CONFIG_SENSORS_LM93 is not set
-# CONFIG_SENSORS_LTC4215 is not set
-# CONFIG_SENSORS_LTC4245 is not set
-# CONFIG_SENSORS_LTC4261 is not set
-# CONFIG_SENSORS_LM95241 is not set
-# CONFIG_SENSORS_MAX1111 is not set
-# CONFIG_SENSORS_MAX1619 is not set
-# CONFIG_SENSORS_MAX6650 is not set
-# CONFIG_SENSORS_PC87360 is not set
-# CONFIG_SENSORS_PC87427 is not set
-# CONFIG_SENSORS_PCF8591 is not set
-# CONFIG_SENSORS_SHT15 is not set
-# CONFIG_SENSORS_SMM665 is not set
-# CONFIG_SENSORS_DME1737 is not set
-# CONFIG_SENSORS_EMC1403 is not set
-# CONFIG_SENSORS_EMC2103 is not set
-# CONFIG_SENSORS_SMSC47M1 is not set
-# CONFIG_SENSORS_SMSC47M192 is not set
-# CONFIG_SENSORS_SMSC47B397 is not set
-# CONFIG_SENSORS_ADS7828 is not set
-# CONFIG_SENSORS_ADS7871 is not set
-# CONFIG_SENSORS_AMC6821 is not set
-# CONFIG_SENSORS_THMC50 is not set
-# CONFIG_SENSORS_TMP102 is not set
-# CONFIG_SENSORS_TMP401 is not set
-# CONFIG_SENSORS_TMP421 is not set
-# CONFIG_SENSORS_VT1211 is not set
-# CONFIG_SENSORS_W83781D is not set
-# CONFIG_SENSORS_W83791D is not set
-# CONFIG_SENSORS_W83792D is not set
-# CONFIG_SENSORS_W83793 is not set
-# CONFIG_SENSORS_W83795 is not set
-# CONFIG_SENSORS_W83L785TS is not set
-# CONFIG_SENSORS_W83L786NG is not set
-# CONFIG_SENSORS_W83627HF is not set
-# CONFIG_SENSORS_W83627EHF is not set
-# CONFIG_SENSORS_LIS3_SPI is not set
+CONFIG_HWMON=m
CONFIG_SENSORS_LIS3_I2C=m
-# CONFIG_THERMAL is not set
CONFIG_WATCHDOG=y
-# CONFIG_WATCHDOG_NOWAYOUT is not set
-
-#
-# Watchdog Device Drivers
-#
-# CONFIG_SOFT_WATCHDOG is not set
CONFIG_OMAP_WATCHDOG=y
CONFIG_TWL4030_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=y
CONFIG_TWL4030_POWER=y
-CONFIG_TWL4030_CODEC=y
-# CONFIG_TWL6030_PWM is not set
-# CONFIG_MFD_STMPE is not set
-# CONFIG_MFD_TC35892 is not set
CONFIG_TWL4030_MADC=y
-# 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 is not set
-# CONFIG_MFD_MC13XXX is not set
-# CONFIG_ABX500_CORE is not set
-# CONFIG_EZX_PCAP is not set
-# 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 is not set
-# 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_TWL4030=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=m
-
-#
-# Multimedia core support
-#
CONFIG_MEDIA_CONTROLLER=y
CONFIG_VIDEO_DEV=m
-CONFIG_VIDEO_V4L2_COMMON=m
# CONFIG_VIDEO_ALLOW_V4L1 is not set
# CONFIG_VIDEO_V4L1_COMPAT is not set
CONFIG_VIDEO_V4L2_SUBDEV_API=y
-# CONFIG_DVB_CORE is not set
-CONFIG_VIDEO_MEDIA=m
-
-#
-# Multimedia drivers
-#
-CONFIG_IR_CORE=m
-CONFIG_VIDEO_IR=m
-CONFIG_LIRC=m
# CONFIG_RC_MAP is not set
# CONFIG_IR_NEC_DECODER is not set
# CONFIG_IR_RC5_DECODER is not set
@@ -1407,1034 +193,188 @@ CONFIG_LIRC=m
# CONFIG_IR_SONY_DECODER is not set
# CONFIG_IR_RC5_SZ_DECODER is not set
# CONFIG_IR_LIRC_CODEC is not set
-# CONFIG_IR_IMON is not set
-# CONFIG_IR_MCEUSB is not set
-# CONFIG_IR_STREAMZAP is not set
-# CONFIG_MEDIA_ATTACH is not set
-CONFIG_MEDIA_TUNER=m
-# CONFIG_MEDIA_TUNER_CUSTOMISE is not set
-CONFIG_MEDIA_TUNER_SIMPLE=m
-CONFIG_MEDIA_TUNER_TDA8290=m
-CONFIG_MEDIA_TUNER_TDA827X=m
-CONFIG_MEDIA_TUNER_TDA18271=m
-CONFIG_MEDIA_TUNER_TDA9887=m
-CONFIG_MEDIA_TUNER_TEA5761=m
-CONFIG_MEDIA_TUNER_TEA5767=m
-CONFIG_MEDIA_TUNER_MT20XX=m
-CONFIG_MEDIA_TUNER_XC2028=m
-CONFIG_MEDIA_TUNER_XC5000=m
-CONFIG_MEDIA_TUNER_MC44S803=m
-CONFIG_VIDEO_V4L2=m
-CONFIG_VIDEOBUF_GEN=m
-CONFIG_VIDEOBUF_DMA_CONTIG=m
-CONFIG_VIDEO_CAPTURE_DRIVERS=y
-# CONFIG_VIDEO_ADV_DEBUG is not set
-# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set
# CONFIG_VIDEO_IR_I2C is not set
-
-#
-# Encoders/decoders and other helper chips
-#
-
-#
-# Audio decoders
-#
-# CONFIG_VIDEO_TVAUDIO is not set
-# CONFIG_VIDEO_TDA7432 is not set
-# CONFIG_VIDEO_TDA9840 is not set
-# CONFIG_VIDEO_TDA9875 is not set
-# CONFIG_VIDEO_TEA6415C is not set
-# CONFIG_VIDEO_TEA6420 is not set
-# CONFIG_VIDEO_MSP3400 is not set
-# CONFIG_VIDEO_CS5345 is not set
-# CONFIG_VIDEO_CS53L32A is not set
-# CONFIG_VIDEO_M52790 is not set
-# CONFIG_VIDEO_TLV320AIC23B is not set
-# CONFIG_VIDEO_WM8775 is not set
-# CONFIG_VIDEO_WM8739 is not set
-# CONFIG_VIDEO_VP27SMPX is not set
-
-#
-# RDS decoders
-#
-# CONFIG_VIDEO_SAA6588 is not set
-
-#
-# Video decoders
-#
-# CONFIG_VIDEO_ADV7180 is not set
-# CONFIG_VIDEO_BT819 is not set
-# CONFIG_VIDEO_BT856 is not set
-# CONFIG_VIDEO_BT866 is not set
-# CONFIG_VIDEO_KS0127 is not set
-# CONFIG_VIDEO_OV7670 is not set
-# CONFIG_VIDEO_MT9V011 is not set
-# CONFIG_VIDEO_TCM825X is not set
CONFIG_VIDEO_ET8EK8=m
CONFIG_VIDEO_AD5820=m
CONFIG_VIDEO_ADP1653=m
-# CONFIG_VIDEO_SAA7110 is not set
-# CONFIG_VIDEO_SAA711X is not set
-# CONFIG_VIDEO_SAA717X is not set
-# CONFIG_VIDEO_SAA7191 is not set
-# CONFIG_VIDEO_TVP514X is not set
-# CONFIG_VIDEO_TVP5150 is not set
-# CONFIG_VIDEO_TVP7002 is not set
-# CONFIG_VIDEO_VPX3220 is not set
CONFIG_VIDEO_SMIA_SENSOR=m
-
-#
-# Video and audio decoders
-#
-# CONFIG_VIDEO_CX25840 is not set
-
-#
-# MPEG video encoders
-#
-# CONFIG_VIDEO_CX2341X is not set
-
-#
-# Video encoders
-#
-# CONFIG_VIDEO_SAA7127 is not set
-# CONFIG_VIDEO_SAA7185 is not set
-# CONFIG_VIDEO_ADV7170 is not set
-# CONFIG_VIDEO_ADV7175 is not set
-# CONFIG_VIDEO_THS7303 is not set
-# CONFIG_VIDEO_ADV7343 is not set
-# CONFIG_VIDEO_AK881X is not set
-
-#
-# Video improvement chips
-#
-# CONFIG_VIDEO_UPD64031A is not set
-# CONFIG_VIDEO_UPD64083 is not set
-# CONFIG_VIDEO_VIVI is not set
-# CONFIG_VIDEO_VPFE_CAPTURE is not set
CONFIG_VIDEO_OMAP2_VOUT=m
-# CONFIG_VIDEO_CPIA2 is not set
-# CONFIG_VIDEO_SR030PC30 is not set
CONFIG_VIDEO_OMAP3=m
-# CONFIG_VIDEO_OMAP3_DEBUG is not set
-CONFIG_VIDEO_SMIAREGS=m
-# CONFIG_SOC_CAMERA is not set
# CONFIG_V4L_USB_DRIVERS is not set
-# CONFIG_V4L_MEM2MEM_DRIVERS is not set
-CONFIG_RADIO_ADAPTERS=y
-CONFIG_I2C_SI4713=m
CONFIG_RADIO_SI4713=m
-# CONFIG_USB_DSBR is not set
-# CONFIG_RADIO_SI470X is not set
-# CONFIG_USB_MR800 is not set
-# CONFIG_RADIO_TEA5764 is not set
-# CONFIG_RADIO_SAA7706H is not set
-# CONFIG_RADIO_TEF6862 is not set
-# CONFIG_DAB is not set
-
-#
-# Graphics support
-#
-# CONFIG_DRM is not set
-# CONFIG_PVR 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_UVESA is not set
-# CONFIG_FB_S1D13XXX is not set
-# CONFIG_FB_TMIO 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_OMAP_BOOTLOADER_INIT is not set
-CONFIG_OMAP2_VRAM=y
-CONFIG_OMAP2_VRFB=y
CONFIG_OMAP2_DSS=y
CONFIG_OMAP2_VRAM_SIZE=6
# CONFIG_OMAP2_DSS_DEBUG_SUPPORT is not set
# CONFIG_OMAP2_DSS_DPI is not set
-# CONFIG_OMAP2_DSS_RFBI is not set
-CONFIG_OMAP2_DSS_VENC=y
CONFIG_OMAP2_DSS_SDI=y
-# CONFIG_OMAP2_DSS_DSI is not set
-# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set
-CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=0
CONFIG_FB_OMAP2=y
# CONFIG_FB_OMAP2_DEBUG_SUPPORT is not set
-CONFIG_FB_OMAP2_NUM_FBS=3
-
-#
-# OMAP2/3 Display Device Drivers
-#
-# CONFIG_PANEL_GENERIC is not set
-# CONFIG_PANEL_SHARP_LS037V7DW01 is not set
-# CONFIG_PANEL_SHARP_LQ043T1DG01 is not set
-# CONFIG_PANEL_TOPPOLY_TDO35S is not set
-# CONFIG_PANEL_TPO_TD043MTEA1 is not set
CONFIG_PANEL_ACX565AKM=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=y
-# CONFIG_LCD_S6E63M0 is not set
-CONFIG_BACKLIGHT_CLASS_DEVICE=y
-CONFIG_BACKLIGHT_GENERIC=y
-# CONFIG_BACKLIGHT_ADP8860 is not set
-
-#
-# Display device support
-#
CONFIG_DISPLAY_SUPPORT=y
-
-#
-# Display hardware drivers
-#
-
-#
-# 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=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 is not set
-CONFIG_SND_OSSEMUL=y
-CONFIG_SND_MIXER_OSS=m
-CONFIG_SND_PCM_OSS=m
-CONFIG_SND_PCM_OSS_PLUGINS=y
-# CONFIG_SND_HRTIMER is not set
-# CONFIG_SND_DYNAMIC_MINORS is not set
-CONFIG_SND_SUPPORT_OLD_API=y
-CONFIG_SND_VERBOSE_PROCFS=y
-# 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_SOUND=m
+CONFIG_SND=m
+CONFIG_SND_HRTIMER=m
+# CONFIG_SND_SUPPORT_OLD_API is not set
# CONFIG_SND_DRIVERS is not set
# CONFIG_SND_ARM is not set
# CONFIG_SND_SPI is not set
-CONFIG_SND_USB=y
-# CONFIG_SND_USB_AUDIO is not set
-# CONFIG_SND_USB_UA101 is not set
-# CONFIG_SND_USB_CAIAQ is not set
-CONFIG_SND_SOC=y
-CONFIG_SND_OMAP_SOC=y
-CONFIG_SND_OMAP_SOC_MCBSP=y
-CONFIG_SND_OMAP_SOC_RX51=y
-CONFIG_SND_SOC_I2C_AND_SPI=y
-# CONFIG_SND_SOC_ALL_CODECS is not set
-CONFIG_SND_SOC_TLV320AIC3X=y
-CONFIG_SND_SOC_TPA6130A2=y
-# CONFIG_SOUND_PRIME is not set
+CONFIG_SND_SOC=m
+CONFIG_SND_OMAP_SOC=m
+CONFIG_SND_OMAP_SOC_RX51=m
# CONFIG_HID_SUPPORT is not set
-CONFIG_USB_SUPPORT=y
-CONFIG_USB_ARCH_HAS_HCD=y
-CONFIG_USB_ARCH_HAS_OHCI=y
-CONFIG_USB_ARCH_HAS_EHCI=y
-CONFIG_USB=y
-# CONFIG_USB_DEBUG is not set
-# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
-
-#
-# Miscellaneous USB options
-#
-# CONFIG_USB_DEVICEFS is not set
+CONFIG_USB=m
# CONFIG_USB_DEVICE_CLASS is not set
-# CONFIG_USB_DYNAMIC_MINORS is not set
-# CONFIG_USB_SUSPEND 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_EHCI_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 is not set
-# 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=y
-CONFIG_USB_MUSB_SOC=y
-
-#
-# OMAP 343x high speed USB support
-#
-# CONFIG_USB_MUSB_AM35X is not set
-# CONFIG_USB_MUSB_HOST is not set
+CONFIG_USB_MUSB_HDRC=m
CONFIG_USB_MUSB_PERIPHERAL=y
-# CONFIG_USB_MUSB_OTG is not set
CONFIG_USB_GADGET_MUSB_HDRC=y
-# CONFIG_MUSB_PIO_ONLY is not set
-CONFIG_USB_INVENTRA_DMA=y
-# CONFIG_USB_TI_CPPI_DMA is not set
-# CONFIG_USB_MUSB_DEBUG 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_SISUSBVGA 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 is not set
-# CONFIG_USB_GADGET_DEBUG_FILES is not set
-# CONFIG_USB_GADGET_DEBUG_FS is not set
-CONFIG_USB_GADGET_VBUS_DRAW=2
-CONFIG_USB_GADGET_SELECTED=y
-# CONFIG_USB_GADGET_OMAP is not set
-# CONFIG_USB_GADGET_R8A66597 is not set
-# CONFIG_USB_GADGET_M66592 is not set
-# CONFIG_USB_GADGET_DUMMY_HCD is not set
-CONFIG_USB_GADGET_DUALSPEED=y
-# CONFIG_USB_ZERO is not set
-# CONFIG_USB_AUDIO is not set
+CONFIG_USB_AUDIO=m
CONFIG_USB_ETH=m
# CONFIG_USB_ETH_RNDIS is not set
-# CONFIG_USB_ETH_EEM is not set
CONFIG_USB_GADGETFS=m
CONFIG_USB_FUNCTIONFS=m
-# CONFIG_USB_FUNCTIONFS_ETH is not set
-# CONFIG_USB_FUNCTIONFS_RNDIS is not set
-CONFIG_USB_FUNCTIONFS_GENERIC=y
CONFIG_USB_FILE_STORAGE=m
-# CONFIG_USB_FILE_STORAGE_TEST is not set
CONFIG_USB_MASS_STORAGE=m
-# 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_SERIAL=m
+CONFIG_USB_MIDI_GADGET=m
CONFIG_USB_G_NOKIA=m
-# CONFIG_USB_G_NOKIA_EEM is not set
-# CONFIG_USB_G_MULTI is not set
-# CONFIG_USB_G_HID is not set
-# CONFIG_USB_G_DBGP is not set
-# CONFIG_USB_G_WEBCAM is not set
-
-#
-# OTG and related infrastructure
-#
-CONFIG_USB_OTG_UTILS=y
-# CONFIG_USB_GPIO_VBUS is not set
-# CONFIG_ISP1301_OMAP is not set
-# CONFIG_USB_ULPI is not set
-CONFIG_TWL4030_USB=y
-# CONFIG_NOP_USB_XCEIV is not set
+CONFIG_TWL4030_USB=m
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_OMAP is not set
CONFIG_MMC_OMAP_HS=y
-# CONFIG_MMC_SPI is not set
-# CONFIG_MMC_USHC is not set
-# CONFIG_MEMSTICK is not set
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
-
-#
-# LED drivers
-#
-# CONFIG_LEDS_PCA9532 is not set
-# CONFIG_LEDS_GPIO is not set
-# CONFIG_LEDS_LP3944 is not set
-# CONFIG_LEDS_LP5521 is not set
CONFIG_LEDS_LP5523=m
-# CONFIG_LEDS_PCA955X is not set
-# CONFIG_LEDS_DAC124S085 is not set
-# 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=m
-# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
-# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
+CONFIG_LEDS_TRIGGER_HEARTBEAT=m
+CONFIG_LEDS_TRIGGER_BACKLIGHT=m
CONFIG_LEDS_TRIGGER_GPIO=m
-# 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_LEDS_TRIGGER_DEFAULT_ON=m
+CONFIG_RTC_CLASS=m
CONFIG_RTC_DRV_TWL4030=m
-# 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
-
-#
-# on-CPU RTC drivers
-#
-# 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_VIDEO_TM6000 is not set
-# CONFIG_W35UND is not set
-# CONFIG_PRISM2_USB 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_LINE6_USB is not set
-# CONFIG_VT6656 is not set
-# CONFIG_FB_UDL is not set
CONFIG_IIO=m
-# CONFIG_IIO_RING_BUFFER is not set
-# CONFIG_IIO_TRIGGER is not set
-
-#
-# Accelerometers
-#
-# CONFIG_ADIS16209 is not set
-# CONFIG_ADIS16220 is not set
-# CONFIG_ADIS16240 is not set
-# CONFIG_KXSD9 is not set
-# CONFIG_LIS3L02DQ is not set
-
-#
-# Analog to digital convertors
-#
-# CONFIG_MAX1363 is not set
-# CONFIG_AD799X is not set
-# CONFIG_AD7476 is not set
-
-#
-# Digital gyroscope sensors
-#
-# CONFIG_ADIS16260 is not set
-
-#
-# Inertial measurement units
-#
-# CONFIG_ADIS16300 is not set
-# CONFIG_ADIS16350 is not set
-# CONFIG_ADIS16400 is not set
-
-#
-# Light sensors
-#
CONFIG_SENSORS_TSL2563=m
-# CONFIG_SENSORS_ISL29018 is not set
-
-#
-# Magnetometer sensors
-#
-# CONFIG_SENSORS_AK8975 is not set
-# CONFIG_SENSORS_HMC5843 is not set
-
-#
-# Triggers - standalone
-#
-# CONFIG_ZRAM is not set
-# CONFIG_BATMAN_ADV is not set
-# CONFIG_FB_SM7XX is not set
-
-#
-# Texas Instruments shared transport line discipline
-#
-# CONFIG_ST_BT is not set
-# CONFIG_ADIS16255 is not set
-# CONFIG_LIRC_STAGING is not set
CONFIG_TIDSPBRIDGE=m
-CONFIG_TIDSPBRIDGE_MEMPOOL_SIZE=0x600000
-# CONFIG_TIDSPBRIDGE_DEBUG is not set
-CONFIG_TIDSPBRIDGE_RECOVERY=y
-# CONFIG_TIDSPBRIDGE_CACHE_LINE_CHECK is not set
-# CONFIG_TIDSPBRIDGE_WDT3 is not set
-# CONFIG_TIDSPBRIDGE_NTFY_PWRERR is not set
-# CONFIG_TIDSPBRIDGE_BACKTRACE is not set
-# CONFIG_WESTBRIDGE is not set
-CONFIG_WESTBRIDGE_HAL_SELECTED=y
-CONFIG_MACH_OMAP3_WESTBRIDGE_AST_PNAND_HAL=y
-# CONFIG_MACH_NO_WESTBRIDGE is not set
-# 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
-
-#
-# File systems
-#
-# CONFIG_EXT2_FS is not set
-# CONFIG_EXT3_FS is not set
CONFIG_EXT4_FS=y
-CONFIG_EXT4_USE_FOR_EXT23=y
-CONFIG_EXT4_FS_XATTR=y
CONFIG_EXT4_FS_POSIX_ACL=y
-# CONFIG_EXT4_FS_SECURITY is not set
-# CONFIG_EXT4_DEBUG is not set
-CONFIG_JBD2=y
-# CONFIG_JBD2_DEBUG is not set
-CONFIG_FS_MBCACHE=y
-# CONFIG_REISERFS_FS is not set
-# CONFIG_JFS_FS is not set
-CONFIG_FS_POSIX_ACL=y
-# CONFIG_XFS_FS is not set
-# CONFIG_GFS2_FS is not set
-# CONFIG_OCFS2_FS is not set
CONFIG_BTRFS_FS=y
CONFIG_BTRFS_FS_POSIX_ACL=y
-# CONFIG_NILFS2_FS is not set
-CONFIG_FILE_LOCKING=y
-CONFIG_FSNOTIFY=y
-CONFIG_DNOTIFY=y
-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=m
-# CONFIG_CUSE is not set
-CONFIG_GENERIC_ACL=y
-
-#
-# Caches
-#
-# CONFIG_FSCACHE is not set
-
-#
-# CD-ROM/DVD Filesystems
-#
-# CONFIG_ISO9660_FS is not set
-
-#
-# DOS/FAT/NT Filesystems
-#
-CONFIG_FAT_FS=m
CONFIG_MSDOS_FS=m
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 is not set
-CONFIG_MISC_FILESYSTEMS=y
-# 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 is not set
CONFIG_UBIFS_FS=m
-# CONFIG_UBIFS_FS_XATTR is not set
-# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
-CONFIG_UBIFS_FS_LZO=y
-CONFIG_UBIFS_FS_ZLIB=y
-# CONFIG_UBIFS_FS_DEBUG is not set
-# CONFIG_LOGFS is not set
CONFIG_CRAMFS=y
-# CONFIG_SQUASHFS is not set
-# CONFIG_VXFS_FS is not set
-# CONFIG_MINIX_FS is not set
-# CONFIG_OMFS_FS is not set
-# CONFIG_QNX4FS_FS is not set
-# CONFIG_ROMFS_FS is not set
-# CONFIG_SYSV_FS is not set
-CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
-# CONFIG_NFS_V4_1 is not set
+CONFIG_NFS_V4_1=y
CONFIG_ROOT_NFS=y
-# CONFIG_NFS_USE_LEGACY_DNS is not set
-CONFIG_NFS_USE_KERNEL_DNS=y
-# CONFIG_NFS_USE_NEW_IDMAPPER is not set
-# CONFIG_NFSD is not set
-CONFIG_LOCKD=y
-CONFIG_LOCKD_V4=y
-CONFIG_NFS_ACL_SUPPORT=y
-CONFIG_NFS_COMMON=y
-CONFIG_SUNRPC=y
-CONFIG_SUNRPC_GSS=y
-CONFIG_RPCSEC_GSS_KRB5=y
-# CONFIG_CEPH_FS is not set
-# CONFIG_CIFS is not set
-# CONFIG_NCP_FS is not set
-# CONFIG_CODA_FS is not set
-# CONFIG_AFS_FS is not set
-
-#
-# Partition Types
-#
+CONFIG_CIFS=m
+CONFIG_CIFS_STATS=y
+CONFIG_CIFS_STATS2=y
+CONFIG_CIFS_WEAK_PW_HASH=y
+CONFIG_CIFS_UPCALL=y
+CONFIG_CIFS_XATTR=y
+CONFIG_CIFS_POSIX=y
+CONFIG_CIFS_DEBUG2=y
+CONFIG_CIFS_DFS_UPCALL=y
+CONFIG_CIFS_ACL=y
+CONFIG_CIFS_EXPERIMENTAL=y
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 is not set
-# 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 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=y
-# 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=y
-# CONFIG_DLM is not set
-
-#
-# Kernel hacking
-#
+CONFIG_NLS_CODEPAGE_437=m
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=y
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+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=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=m
CONFIG_PRINTK_TIME=y
-CONFIG_ENABLE_WARN_DEPRECATED=y
-CONFIG_ENABLE_MUST_CHECK=y
-CONFIG_FRAME_WARN=1024
CONFIG_MAGIC_SYSRQ=y
-# CONFIG_STRIP_ASM_SYMS is not set
-# CONFIG_UNUSED_SYMBOLS is not set
CONFIG_DEBUG_FS=y
-# CONFIG_HEADERS_CHECK is not set
-CONFIG_DEBUG_KERNEL=y
-# CONFIG_DEBUG_SHIRQ is not set
-# CONFIG_LOCKUP_DETECTOR is not set
-# CONFIG_HARDLOCKUP_DETECTOR is not set
-# CONFIG_DETECT_HUNG_TASK is not set
-# CONFIG_SCHED_DEBUG is not set
-CONFIG_SCHEDSTATS=y
-CONFIG_TIMER_STATS=y
-# CONFIG_DEBUG_OBJECTS is not set
-# CONFIG_DEBUG_SLAB is not set
-# CONFIG_DEBUG_KMEMLEAK is not set
-# CONFIG_DEBUG_PREEMPT is not set
-# CONFIG_DEBUG_RT_MUTEXES is not set
-# CONFIG_RT_MUTEX_TESTER is not set
-# CONFIG_DEBUG_SPINLOCK is not set
-# CONFIG_DEBUG_MUTEXES is not set
# CONFIG_BKL is not set
-# CONFIG_DEBUG_LOCK_ALLOC is not set
-# CONFIG_PROVE_LOCKING is not set
-# CONFIG_SPARSE_RCU_POINTER is not set
-# CONFIG_LOCK_STAT is not set
-# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
-# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
-CONFIG_STACKTRACE=y
-# CONFIG_DEBUG_KOBJECT is not set
-CONFIG_DEBUG_BUGVERBOSE=y
-# CONFIG_DEBUG_INFO is not set
-# CONFIG_DEBUG_VM is not set
-# CONFIG_DEBUG_WRITECOUNT is not set
-CONFIG_DEBUG_MEMORY_INIT=y
-# CONFIG_DEBUG_LIST is not set
-# CONFIG_TEST_LIST_SORT is not set
-# CONFIG_DEBUG_SG is not set
-# CONFIG_DEBUG_NOTIFIERS is not set
-# CONFIG_DEBUG_CREDENTIALS is not set
-# CONFIG_BOOT_PRINTK_DELAY is not set
-# CONFIG_RCU_TORTURE_TEST is not set
# CONFIG_RCU_CPU_STALL_DETECTOR is not set
-# CONFIG_BACKTRACE_SELF_TEST is not set
-# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
-# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
-# CONFIG_LKDTM is not set
-# CONFIG_FAULT_INJECTION is not set
-# CONFIG_LATENCYTOP is not set
-# CONFIG_SYSCTL_SYSCALL_CHECK is not set
-# CONFIG_PAGE_POISONING is not set
-CONFIG_NOP_TRACER=y
-CONFIG_HAVE_FUNCTION_TRACER=y
-CONFIG_HAVE_DYNAMIC_FTRACE=y
-CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
-CONFIG_RING_BUFFER=y
-CONFIG_EVENT_TRACING=y
-CONFIG_CONTEXT_SWITCH_TRACER=y
-CONFIG_RING_BUFFER_ALLOW_SWAP=y
-CONFIG_TRACING=y
-CONFIG_GENERIC_TRACER=y
-CONFIG_TRACING_SUPPORT=y
-CONFIG_FTRACE=y
-CONFIG_FUNCTION_TRACER=y
-# CONFIG_IRQSOFF_TRACER is not set
-# CONFIG_PREEMPT_TRACER is not set
-# CONFIG_SCHED_TRACER is not set
-CONFIG_BRANCH_PROFILE_NONE=y
-# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
-# CONFIG_PROFILE_ALL_BRANCHES is not set
-# CONFIG_STACK_TRACER is not set
-# CONFIG_BLK_DEV_IO_TRACE is not set
-CONFIG_DYNAMIC_FTRACE=y
-CONFIG_FUNCTION_PROFILER=y
-CONFIG_FTRACE_MCOUNT_RECORD=y
-# CONFIG_FTRACE_STARTUP_TEST is not set
-# CONFIG_RING_BUFFER_BENCHMARK is not set
CONFIG_DYNAMIC_DEBUG=y
-# CONFIG_ATOMIC64_SELFTEST is not set
-# CONFIG_SAMPLES is not set
-CONFIG_HAVE_ARCH_KGDB=y
-# CONFIG_KGDB is not set
-# CONFIG_STRICT_DEVMEM is not set
-CONFIG_ARM_UNWIND=y
CONFIG_DEBUG_USER=y
-CONFIG_DEBUG_ERRORS=y
-# CONFIG_DEBUG_STACK_USAGE is not set
-# CONFIG_DEBUG_LL is not set
-# CONFIG_OC_ETM is not set
-
-#
-# 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_AEAD2=y
-CONFIG_CRYPTO_BLKCIPHER=y
-CONFIG_CRYPTO_BLKCIPHER2=y
-CONFIG_CRYPTO_HASH=y
-CONFIG_CRYPTO_HASH2=y
-CONFIG_CRYPTO_RNG2=y
-CONFIG_CRYPTO_PCOMP2=y
-CONFIG_CRYPTO_MANAGER=y
-CONFIG_CRYPTO_MANAGER2=y
-CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
-# CONFIG_CRYPTO_GF128MUL is not set
-# CONFIG_CRYPTO_NULL is not set
-CONFIG_CRYPTO_WORKQUEUE=y
-# 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=y
-# CONFIG_CRYPTO_CTR is not set
-# CONFIG_CRYPTO_CTS is not set
-CONFIG_CRYPTO_ECB=m
-# 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=y
-# CONFIG_CRYPTO_GHASH is not set
-# CONFIG_CRYPTO_MD4 is not set
-CONFIG_CRYPTO_MD5=y
-CONFIG_CRYPTO_MICHAEL_MIC=y
-# 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=m
-# CONFIG_CRYPTO_ANUBIS is not set
-CONFIG_CRYPTO_ARC4=m
-# 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=y
-# 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=y
-# CONFIG_CRYPTO_ZLIB is not set
-CONFIG_CRYPTO_LZO=y
-
-#
-# Random Number Generation
-#
+CONFIG_CRYPTO_CRYPTD=m
+CONFIG_CRYPTO_AUTHENC=m
+CONFIG_CRYPTO_CCM=m
+CONFIG_CRYPTO_GCM=m
+CONFIG_CRYPTO_CTS=m
+CONFIG_CRYPTO_LRW=m
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_XTS=m
+CONFIG_CRYPTO_XCBC=m
+CONFIG_CRYPTO_VMAC=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_RMD128=m
+CONFIG_CRYPTO_RMD160=m
+CONFIG_CRYPTO_RMD256=m
+CONFIG_CRYPTO_RMD320=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_WP512=m
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_FCRYPT=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_SALSA20=m
+CONFIG_CRYPTO_SEED=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_ZLIB=m
# CONFIG_CRYPTO_ANSI_CPRNG is not set
-CONFIG_CRYPTO_HW=y
-# CONFIG_CRYPTO_DEV_OMAP_SHAM is not set
-# CONFIG_CRYPTO_DEV_OMAP_AES is not set
-CONFIG_BINARY_PRINTF=y
-
-#
-# 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_HAS_IOMEM=y
-CONFIG_HAS_IOPORT=y
-CONFIG_HAS_DMA=y
-CONFIG_NLATTR=y
+CONFIG_CRYPTO_DEV_OMAP_SHAM=m
+CONFIG_CRYPTO_DEV_OMAP_AES=m
+CONFIG_CRC_CCITT=m
+CONFIG_CRC_T10DIF=m
+CONFIG_CRC_ITU_T=m
diff --git a/recipes/linux/linux-omap-2.6.39/beagle/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch b/recipes/linux/linux-omap-2.6.39/beagle/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch
new file mode 100644
index 0000000000..2bd76c3cec
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/beagle/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch
@@ -0,0 +1,117 @@
+From 812ef26f4be80d12facd62adce971ec9fe64a144 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Fri, 20 May 2011 12:48:37 +0200
+Subject: [PATCH 1/5] OMAP3: beagle: add support for beagleboard xM revision C
+
+The USB enable GPIO has been inverted and the USER button moved.
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/board-omap3beagle.c | 34 +++++++++++++++++++++++-------
+ 1 files changed, 26 insertions(+), 8 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index 2de4b02..77bafa8 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -62,7 +62,9 @@
+ * AXBX = GPIO173, GPIO172, GPIO171: 1 1 1
+ * C1_3 = GPIO173, GPIO172, GPIO171: 1 1 0
+ * C4 = GPIO173, GPIO172, GPIO171: 1 0 1
+- * XM = GPIO173, GPIO172, GPIO171: 0 0 0
++ * XMA = GPIO173, GPIO172, GPIO171: 0 0 0
++ * XMB = GPIO173, GPIO172, GPIO171: 0 0 1
++ * XMC = GPIO173, GPIO172, GPIO171: 0 1 0
+ */
+ enum {
+ OMAP3BEAGLE_BOARD_UNKN = 0,
+@@ -70,6 +72,7 @@ enum {
+ OMAP3BEAGLE_BOARD_C1_3,
+ OMAP3BEAGLE_BOARD_C4,
+ OMAP3BEAGLE_BOARD_XM,
++ OMAP3BEAGLE_BOARD_XMC,
+ };
+
+ static u8 omap3_beagle_version;
+@@ -124,9 +127,18 @@ static void __init omap3_beagle_init_rev(void)
+ printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
+ omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
+ break;
++ case 1:
++ printk(KERN_INFO "OMAP3 Beagle Rev: xM B\n");
++ omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
++ break;
++ case 2:
++ printk(KERN_INFO "OMAP3 Beagle Rev: xM C\n");
++ omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
++ break;
+ default:
+- printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev);
+- omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
++ printk(KERN_INFO
++ "OMAP3 Beagle Rev: unknown %hd, assuming xM C or newer\n", beagle_rev);
++ omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
+ }
+
+ return;
+@@ -278,7 +290,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
+ {
+ int r;
+
+- if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
++ if (cpu_is_omap3630()) {
+ mmc[0].gpio_wp = -EINVAL;
+ } else if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) ||
+ (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C4)) {
+@@ -298,7 +310,8 @@ static int beagle_twl_gpio_setup(struct device *dev,
+ /* REVISIT: need ehci-omap hooks for external VBUS
+ * power switch and overcurrent detect
+ */
+- if (omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XM) {
++ if (omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XM
++ && omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XMC) {
+ r = gpio_request(gpio + 1, "EHCI_nOC");
+ if (!r) {
+ r = gpio_direction_input(gpio + 1);
+@@ -320,7 +333,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
+ gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0);
+
+ /* DVI reset GPIO is different between beagle revisions */
+- if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM)
++ if (cpu_is_omap3630())
+ beagle_dvi_device.reset_gpio = 129;
+ else
+ beagle_dvi_device.reset_gpio = 170;
+@@ -334,7 +347,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
+ * P7/P8 revisions(prototype): Camera EN
+ * A2+ revisions (production): LDO (supplies DVI, serial, led blocks)
+ */
+- if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
++ if (cpu_is_omap3630()) {
+ r = gpio_request(gpio + 1, "nDVI_PWR_EN");
+ if (!r) {
+ r = gpio_direction_output(gpio + 1, 0);
+@@ -625,7 +638,7 @@ static void __init beagle_opp_init(void)
+ }
+
+ /* Custom OPP enabled for XM */
+- if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
++ if (cpu_is_omap3630()) {
+ struct omap_hwmod *mh = omap_hwmod_lookup("mpu");
+ struct omap_hwmod *dh = omap_hwmod_lookup("iva");
+ struct device *dev;
+@@ -665,6 +678,11 @@ static void __init omap3_beagle_init(void)
+ omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
+ omap3_beagle_init_rev();
+ omap3_beagle_i2c_init();
++
++ if (cpu_is_omap3630()) {
++ gpio_buttons[0].gpio = 4;
++ }
++
+ platform_add_devices(omap3_beagle_devices,
+ ARRAY_SIZE(omap3_beagle_devices));
+ omap_display_init(&beagle_dss_data);
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/beagle/0002-OMAP3-beagle-add-support-for-expansionboards.patch b/recipes/linux/linux-omap-2.6.39/beagle/0002-OMAP3-beagle-add-support-for-expansionboards.patch
new file mode 100644
index 0000000000..ab63acf561
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/beagle/0002-OMAP3-beagle-add-support-for-expansionboards.patch
@@ -0,0 +1,359 @@
+From e87dd8c997e212b8c14468c869c83d6953da3c34 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Fri, 20 May 2011 13:06:24 +0200
+Subject: [PATCH 2/5] OMAP3: beagle: add support for expansionboards
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/board-omap3beagle.c | 272 ++++++++++++++++++++++++++++++-
+ 1 files changed, 269 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index 77bafa8..db285e1 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -21,6 +21,7 @@
+ #include <linux/io.h>
+ #include <linux/leds.h>
+ #include <linux/gpio.h>
++#include <linux/irq.h>
+ #include <linux/input.h>
+ #include <linux/gpio_keys.h>
+ #include <linux/opp.h>
+@@ -154,6 +155,167 @@ fail0:
+ return;
+ }
+
++char expansionboard_name[16];
++
++#if defined(CONFIG_WL12XX) || defined(CONFIG_WL12XX_MODULE)
++#include <linux/regulator/fixed.h>
++#include <linux/wl12xx.h>
++
++#define OMAP_BEAGLE_WLAN_EN_GPIO (139)
++#define OMAP_BEAGLE_BT_EN_GPIO (138)
++#define OMAP_BEAGLE_WLAN_IRQ_GPIO (137)
++#define OMAP_BEAGLE_FM_EN_BT_WU (136)
++
++struct wl12xx_platform_data omap_beagle_wlan_data __initdata = {
++ .irq = OMAP_GPIO_IRQ(OMAP_BEAGLE_WLAN_IRQ_GPIO),
++ .board_ref_clock = 2, /* 38.4 MHz */
++};
++
++static int gpios[] = {OMAP_BEAGLE_BT_EN_GPIO, OMAP_BEAGLE_FM_EN_BT_WU, -1};
++static struct platform_device wl12xx_device = {
++ .name = "kim",
++ .id = -1,
++ .dev.platform_data = &gpios,
++};
++
++static struct omap2_hsmmc_info mmcbbt[] = {
++ {
++ .mmc = 1,
++ .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
++ .gpio_wp = 29,
++ },
++ {
++ .name = "wl1271",
++ .mmc = 2,
++ .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD,
++ .gpio_wp = -EINVAL,
++ .gpio_cd = -EINVAL,
++ .ocr_mask = MMC_VDD_165_195,
++ .nonremovable = true,
++ },
++ {} /* Terminator */
++ };
++
++static struct regulator_consumer_supply beagle_vmmc2_supply =
++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1");
++
++static struct regulator_init_data beagle_vmmc2 = {
++ .constraints = {
++ .min_uV = 1850000,
++ .max_uV = 1850000,
++ .apply_uV = true,
++ .valid_modes_mask = REGULATOR_MODE_NORMAL
++ | REGULATOR_MODE_STANDBY,
++ .valid_ops_mask = REGULATOR_CHANGE_MODE
++ | REGULATOR_CHANGE_STATUS,
++ },
++ .num_consumer_supplies = 1,
++ .consumer_supplies = &beagle_vmmc2_supply,
++};
++
++static struct fixed_voltage_config beagle_vwlan = {
++ .supply_name = "vwl1271",
++ .microvolts = 1800000, /* 1.8V */
++ .gpio = OMAP_BEAGLE_WLAN_EN_GPIO,
++ .startup_delay = 70000, /* 70ms */
++ .enable_high = 1,
++ .enabled_at_boot = 0,
++ .init_data = &beagle_vmmc2,
++};
++
++static struct platform_device omap_vwlan_device = {
++ .name = "reg-fixed-voltage",
++ .id = 1,
++ .dev = {
++ .platform_data = &beagle_vwlan,
++ },
++};
++#endif
++
++#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
++
++#include <plat/mcspi.h>
++#include <linux/spi/spi.h>
++
++#define OMAP3BEAGLE_GPIO_ENC28J60_IRQ 157
++
++static struct omap2_mcspi_device_config enc28j60_spi_chip_info = {
++ .turbo_mode = 0,
++ .single_channel = 1, /* 0: slave, 1: master */
++};
++
++static struct spi_board_info omap3beagle_zippy_spi_board_info[] __initdata = {
++ {
++ .modalias = "enc28j60",
++ .bus_num = 4,
++ .chip_select = 0,
++ .max_speed_hz = 20000000,
++ .controller_data = &enc28j60_spi_chip_info,
++ },
++};
++
++static void __init omap3beagle_enc28j60_init(void)
++{
++ if ((gpio_request(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, "ENC28J60_IRQ") == 0) &&
++ (gpio_direction_input(OMAP3BEAGLE_GPIO_ENC28J60_IRQ) == 0)) {
++ gpio_export(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, 0);
++ omap3beagle_zippy_spi_board_info[0].irq = OMAP_GPIO_IRQ(OMAP3BEAGLE_GPIO_ENC28J60_IRQ);
++ irq_set_irq_type(omap3beagle_zippy_spi_board_info[0].irq, IRQ_TYPE_EDGE_FALLING);
++ } else {
++ printk(KERN_ERR "could not obtain gpio for ENC28J60_IRQ\n");
++ return;
++ }
++
++ spi_register_board_info(omap3beagle_zippy_spi_board_info,
++ ARRAY_SIZE(omap3beagle_zippy_spi_board_info));
++}
++
++#else
++static inline void __init omap3beagle_enc28j60_init(void) { return; }
++#endif
++
++#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
++
++#include <plat/mcspi.h>
++#include <linux/spi/spi.h>
++
++#define OMAP3BEAGLE_GPIO_KS8851_IRQ 157
++
++static struct omap2_mcspi_device_config ks8851_spi_chip_info = {
++ .turbo_mode = 0,
++ .single_channel = 1, /* 0: slave, 1: master */
++};
++
++static struct spi_board_info omap3beagle_zippy2_spi_board_info[] __initdata = {
++ {
++ .modalias = "ks8851",
++ .bus_num = 4,
++ .chip_select = 0,
++ .max_speed_hz = 36000000,
++ .controller_data = &ks8851_spi_chip_info,
++ },
++};
++
++static void __init omap3beagle_ks8851_init(void)
++{
++ if ((gpio_request(OMAP3BEAGLE_GPIO_KS8851_IRQ, "KS8851_IRQ") == 0) &&
++ (gpio_direction_input(OMAP3BEAGLE_GPIO_KS8851_IRQ) == 0)) {
++ gpio_export(OMAP3BEAGLE_GPIO_KS8851_IRQ, 0);
++ omap3beagle_zippy2_spi_board_info[0].irq = OMAP_GPIO_IRQ(OMAP3BEAGLE_GPIO_KS8851_IRQ);
++ irq_set_irq_type(omap3beagle_zippy2_spi_board_info[0].irq, IRQ_TYPE_EDGE_FALLING);
++ } else {
++ printk(KERN_ERR "could not obtain gpio for KS8851_IRQ\n");
++ return;
++ }
++
++ spi_register_board_info(omap3beagle_zippy2_spi_board_info,
++ ARRAY_SIZE(omap3beagle_zippy2_spi_board_info));
++}
++
++#else
++static inline void __init omap3beagle_ks8851_init(void) { return; }
++#endif
++
+ static struct mtd_partition omap3beagle_nand_partitions[] = {
+ /* All the partition sizes are listed in terms of NAND block size */
+ {
+@@ -272,6 +434,12 @@ static struct omap2_hsmmc_info mmc[] = {
+ .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
+ .gpio_wp = 29,
+ },
++ {
++ .mmc = 2,
++ .caps = MMC_CAP_4_BIT_DATA,
++ .transceiver = true,
++ .ocr_mask = 0x00100000, /* 3.3V */
++ },
+ {} /* Terminator */
+ };
+
+@@ -301,11 +469,25 @@ static int beagle_twl_gpio_setup(struct device *dev,
+ }
+ /* gpio + 0 is "mmc0_cd" (input/IRQ) */
+ mmc[0].gpio_cd = gpio + 0;
++#if defined(CONFIG_WL12XX) || defined(CONFIG_WL12XX_MODULE)
++ if(!strcmp(expansionboard_name, "bbtoys-wifi")) {
++ omap2_hsmmc_init(mmcbbt);
++ /* link regulators to MMC adapters */
++ beagle_vmmc1_supply.dev = mmcbbt[0].dev;
++ beagle_vsim_supply.dev = mmcbbt[0].dev;
++ } else {
++ omap2_hsmmc_init(mmc);
++ /* link regulators to MMC adapters */
++ beagle_vmmc1_supply.dev = mmc[0].dev;
++ beagle_vsim_supply.dev = mmc[0].dev;
++ }
++#else
+ omap2_hsmmc_init(mmc);
+
+ /* link regulators to MMC adapters */
+ beagle_vmmc1_supply.dev = mmc[0].dev;
+ beagle_vsim_supply.dev = mmc[0].dev;
++#endif
+
+ /* REVISIT: need ehci-omap hooks for external VBUS
+ * power switch and overcurrent detect
+@@ -466,7 +648,7 @@ static struct twl4030_platform_data beagle_twldata = {
+ .vpll2 = &beagle_vpll2,
+ };
+
+-static struct i2c_board_info __initdata beagle_i2c_boardinfo[] = {
++static struct i2c_board_info __initdata beagle_i2c1_boardinfo[] = {
+ {
+ I2C_BOARD_INFO("twl4030", 0x48),
+ .flags = I2C_CLIENT_WAKE,
+@@ -481,10 +663,24 @@ static struct i2c_board_info __initdata beagle_i2c_eeprom[] = {
+ },
+ };
+
++#if defined(CONFIG_RTC_DRV_DS1307) || \
++ defined(CONFIG_RTC_DRV_DS1307_MODULE)
++
++static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {
++ {
++ I2C_BOARD_INFO("ds1307", 0x68),
++ },
++};
++#else
++static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {};
++#endif
++
+ static int __init omap3_beagle_i2c_init(void)
+ {
+- omap_register_i2c_bus(1, 2600, beagle_i2c_boardinfo,
+- ARRAY_SIZE(beagle_i2c_boardinfo));
++ omap_register_i2c_bus(1, 2600, beagle_i2c1_boardinfo,
++ ARRAY_SIZE(beagle_i2c1_boardinfo));
++ omap_register_i2c_bus(2, 400, beagle_i2c2_boardinfo,
++ ARRAY_SIZE(beagle_i2c2_boardinfo));
+ /* Bus 3 is attached to the DVI port where devices like the pico DLP
+ * projector don't work reliably with 400kHz */
+ omap_register_i2c_bus(3, 100, beagle_i2c_eeprom, ARRAY_SIZE(beagle_i2c_eeprom));
+@@ -627,6 +823,15 @@ static struct omap_musb_board_data musb_board_data = {
+ .power = 100,
+ };
+
++static int __init expansionboard_setup(char *str)
++{
++ if (!str)
++ return -EINVAL;
++ strncpy(expansionboard_name, str, 16);
++ printk(KERN_INFO "Beagle expansionboard: %s\n", expansionboard_name);
++ return 0;
++}
++
+ static void __init beagle_opp_init(void)
+ {
+ int r = 0;
+@@ -693,6 +898,65 @@ static void __init omap3_beagle_init(void)
+ /* REVISIT leave DVI powered down until it's needed ... */
+ gpio_direction_output(170, true);
+
++ if(!strcmp(expansionboard_name, "zippy"))
++ {
++ printk(KERN_INFO "Beagle expansionboard: initializing enc28j60\n");
++ omap3beagle_enc28j60_init();
++ printk(KERN_INFO "Beagle expansionboard: assigning GPIO 141 and 162 to MMC1\n");
++ mmc[1].gpio_wp = 141;
++ mmc[1].gpio_cd = 162;
++ }
++
++ if(!strcmp(expansionboard_name, "zippy2"))
++ {
++ printk(KERN_INFO "Beagle expansionboard: initializing ks_8851\n");
++ omap3beagle_ks8851_init();
++ printk(KERN_INFO "Beagle expansionboard: assigning GPIO 141 and 162 to MMC1\n");
++ mmc[1].gpio_wp = 141;
++ mmc[1].gpio_cd = 162;
++ }
++
++ if(!strcmp(expansionboard_name, "trainer"))
++ {
++ printk(KERN_INFO "Beagle expansionboard: exporting GPIOs 130-141,162 to userspace\n");
++ gpio_request(130, "sysfs");
++ gpio_export(130, 1);
++ gpio_request(131, "sysfs");
++ gpio_export(131, 1);
++ gpio_request(132, "sysfs");
++ gpio_export(132, 1);
++ gpio_request(133, "sysfs");
++ gpio_export(133, 1);
++ gpio_request(134, "sysfs");
++ gpio_export(134, 1);
++ gpio_request(135, "sysfs");
++ gpio_export(135, 1);
++ gpio_request(136, "sysfs");
++ gpio_export(136, 1);
++ gpio_request(137, "sysfs");
++ gpio_export(137, 1);
++ gpio_request(138, "sysfs");
++ gpio_export(138, 1);
++ gpio_request(139, "sysfs");
++ gpio_export(139, 1);
++ gpio_request(140, "sysfs");
++ gpio_export(140, 1);
++ gpio_request(141, "sysfs");
++ gpio_export(141, 1);
++ gpio_request(162, "sysfs");
++ gpio_export(162, 1);
++ }
++
++ if(!strcmp(expansionboard_name, "bbtoys-wifi"))
++ {
++ if (wl12xx_set_platform_data(&omap_beagle_wlan_data))
++ pr_err("error setting wl12xx data\n");
++ printk(KERN_INFO "Beagle expansionboard: registering wl12xx bt platform device\n");
++ platform_device_register(&wl12xx_device);
++ printk(KERN_INFO "Beagle expansionboard: registering wl12xx wifi platform device\n");
++ platform_device_register(&omap_vwlan_device);
++ }
++
+ usb_musb_init(&musb_board_data);
+ usbhs_init(&usbhs_bdata);
+ omap3beagle_flash_init();
+@@ -705,6 +969,8 @@ static void __init omap3_beagle_init(void)
+ beagle_opp_init();
+ }
+
++early_param("buddy", expansionboard_setup);
++
+ MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
+ /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */
+ .boot_params = 0x80000100,
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/beagle/0003-OMAP3-beagle-add-MADC-support.patch b/recipes/linux/linux-omap-2.6.39/beagle/0003-OMAP3-beagle-add-MADC-support.patch
new file mode 100644
index 0000000000..7984a30ece
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/beagle/0003-OMAP3-beagle-add-MADC-support.patch
@@ -0,0 +1,36 @@
+From 140a5cddce807e20e32a5ddcf7c00a758ff5016d Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Sat, 21 May 2011 16:18:30 +0200
+Subject: [PATCH 3/5] OMAP3: beagle: add MADC support
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/board-omap3beagle.c | 5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index db285e1..da4ba50 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -634,6 +634,10 @@ static struct twl4030_codec_data beagle_codec_data = {
+ .audio = &beagle_audio_data,
+ };
+
++static struct twl4030_madc_platform_data beagle_madc_data = {
++ .irq_line = 1,
++};
++
+ static struct twl4030_platform_data beagle_twldata = {
+ .irq_base = TWL4030_IRQ_BASE,
+ .irq_end = TWL4030_IRQ_END,
+@@ -642,6 +646,7 @@ static struct twl4030_platform_data beagle_twldata = {
+ .usb = &beagle_usb_data,
+ .gpio = &beagle_gpio_data,
+ .codec = &beagle_codec_data,
++ .madc = &beagle_madc_data,
+ .vmmc1 = &beagle_vmmc1,
+ .vsim = &beagle_vsim,
+ .vdac = &beagle_vdac,
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/beagle/0004-OMAP3-beagle-add-regulators-for-camera-interface.patch b/recipes/linux/linux-omap-2.6.39/beagle/0004-OMAP3-beagle-add-regulators-for-camera-interface.patch
new file mode 100644
index 0000000000..29ebb401cf
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/beagle/0004-OMAP3-beagle-add-regulators-for-camera-interface.patch
@@ -0,0 +1,88 @@
+From 482c65c01edad75e2b8a3fa07f0fc914e3c9b9d9 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Wed, 25 May 2011 08:56:06 +0200
+Subject: [PATCH 4/5] OMAP3: beagle: add regulators for camera interface
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/board-omap3beagle.c | 50 +++++++++++++++++++++++++++++++
+ 1 files changed, 50 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index da4ba50..211cbdf 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -453,6 +453,44 @@ static struct regulator_consumer_supply beagle_vsim_supply = {
+
+ static struct gpio_led gpio_leds[];
+
++static struct regulator_consumer_supply beagle_vaux3_supply = {
++ .supply = "cam_1v8",
++};
++
++static struct regulator_consumer_supply beagle_vaux4_supply = {
++ .supply = "cam_2v8",
++};
++
++/* VAUX3 for CAM_1V8 */
++static struct regulator_init_data beagle_vaux3 = {
++ .constraints = {
++ .min_uV = 1800000,
++ .max_uV = 1800000,
++ .apply_uV = true,
++ .valid_modes_mask = REGULATOR_MODE_NORMAL
++ | REGULATOR_MODE_STANDBY,
++ .valid_ops_mask = REGULATOR_CHANGE_MODE
++ | REGULATOR_CHANGE_STATUS,
++ },
++ .num_consumer_supplies = 1,
++ .consumer_supplies = &beagle_vaux3_supply,
++};
++
++/* VAUX4 for CAM_2V8 */
++static struct regulator_init_data beagle_vaux4 = {
++ .constraints = {
++ .min_uV = 1800000,
++ .max_uV = 1800000,
++ .apply_uV = true,
++ .valid_modes_mask = REGULATOR_MODE_NORMAL
++ | REGULATOR_MODE_STANDBY,
++ .valid_ops_mask = REGULATOR_CHANGE_MODE
++ | REGULATOR_CHANGE_STATUS,
++ },
++ .num_consumer_supplies = 1,
++ .consumer_supplies = &beagle_vaux4_supply,
++};
++
+ static int beagle_twl_gpio_setup(struct device *dev,
+ unsigned gpio, unsigned ngpio)
+ {
+@@ -504,6 +542,16 @@ static int beagle_twl_gpio_setup(struct device *dev,
+ pr_err("%s: unable to configure EHCI_nOC\n", __func__);
+ }
+
++ if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
++ /*
++ * Power on camera interface - only on pre-production, not
++ * needed on production boards
++ */
++ gpio_request(gpio + 2, "CAM_EN");
++ gpio_direction_output(gpio + 2, 1);
++ }
++
++
+ /*
+ * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active
+ * high / others active low)
+@@ -651,6 +699,8 @@ static struct twl4030_platform_data beagle_twldata = {
+ .vsim = &beagle_vsim,
+ .vdac = &beagle_vdac,
+ .vpll2 = &beagle_vpll2,
++ .vaux3 = &beagle_vaux3,
++ .vaux4 = &beagle_vaux4,
+ };
+
+ static struct i2c_board_info __initdata beagle_i2c1_boardinfo[] = {
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/beagle/0005-OMAP3-beagle-HACK-add-in-1GHz-OPP.patch b/recipes/linux/linux-omap-2.6.39/beagle/0005-OMAP3-beagle-HACK-add-in-1GHz-OPP.patch
new file mode 100644
index 0000000000..c0e31042ae
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/beagle/0005-OMAP3-beagle-HACK-add-in-1GHz-OPP.patch
@@ -0,0 +1,31 @@
+From 6654672586808d22510d06d54464f4fe32ae6e80 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Wed, 25 May 2011 08:57:40 +0200
+Subject: [PATCH 5/5] OMAP3: beagle: HACK! add in 1GHz OPP
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/board-omap3beagle.c | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index 211cbdf..221bfda 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -911,11 +911,13 @@ static void __init beagle_opp_init(void)
+ /* Enable MPU 1GHz and lower opps */
+ dev = &mh->od->pdev.dev;
+ r = opp_enable(dev, 800000000);
++ r |= opp_enable(dev, 1000000000);
+ /* TODO: MPU 1GHz needs SR and ABB */
+
+ /* Enable IVA 800MHz and lower opps */
+ dev = &dh->od->pdev.dev;
+ r |= opp_enable(dev, 660000000);
++ r |= opp_enable(dev, 800000000);
+ /* TODO: DSP 800MHz needs SR and ABB */
+ if (r) {
+ pr_err("%s: failed to enable higher opp %d\n",
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/beagleboard/configs/stock b/recipes/linux/linux-omap-2.6.39/beagleboard/configs/stock
new file mode 100644
index 0000000000..dd288e24d7
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/beagleboard/configs/stock
@@ -0,0 +1,3490 @@
+#
+# Automatically generated make config: don't edit
+# Linux/arm 2.6.39 Kernel Configuration
+# Fri May 20 13:11:13 2011
+#
+CONFIG_ARM=y
+CONFIG_HAVE_PWM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_HAVE_SCHED_CLOCK=y
+CONFIG_GENERIC_GPIO=y
+# CONFIG_ARCH_USES_GETTIMEOFFSET is not set
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_KTIME_SCALAR=y
+CONFIG_HAVE_PROC_CPU=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_VECTORS_BASE=0xffff0000
+# CONFIG_ARM_PATCH_PHYS_VIRT is not set
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_CONSTRUCTORS=y
+CONFIG_HAVE_IRQ_WORK=y
+CONFIG_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=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+CONFIG_FHANDLE=y
+CONFIG_TASKSTATS=y
+CONFIG_TASK_DELAY_ACCT=y
+CONFIG_TASK_XACCT=y
+CONFIG_TASK_IO_ACCOUNTING=y
+# CONFIG_AUDIT is not set
+CONFIG_HAVE_GENERIC_HARDIRQS=y
+
+#
+# IRQ subsystem
+#
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_HAVE_SPARSE_IRQ=y
+CONFIG_GENERIC_IRQ_SHOW=y
+# CONFIG_SPARSE_IRQ is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_TREE_PREEMPT_RCU=y
+# CONFIG_TINY_RCU is not set
+# CONFIG_TINY_PREEMPT_RCU is not set
+CONFIG_PREEMPT_RCU=y
+# CONFIG_RCU_TRACE is not set
+CONFIG_RCU_FANOUT=32
+# CONFIG_RCU_FANOUT_EXACT is not set
+# CONFIG_TREE_RCU_TRACE is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=16
+CONFIG_CGROUPS=y
+# CONFIG_CGROUP_DEBUG is not set
+CONFIG_CGROUP_NS=y
+CONFIG_CGROUP_FREEZER=y
+CONFIG_CGROUP_DEVICE=y
+CONFIG_CPUSETS=y
+CONFIG_PROC_PID_CPUSET=y
+CONFIG_CGROUP_CPUACCT=y
+CONFIG_RESOURCE_COUNTERS=y
+CONFIG_CGROUP_MEM_RES_CTLR=y
+CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y
+CONFIG_CGROUP_MEM_RES_CTLR_SWAP_ENABLED=y
+CONFIG_CGROUP_PERF=y
+CONFIG_CGROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_RT_GROUP_SCHED=y
+# CONFIG_BLK_CGROUP is not set
+# CONFIG_NAMESPACES is not set
+CONFIG_SCHED_AUTOGROUP=y
+CONFIG_MM_OWNER=y
+# 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 is not set
+# CONFIG_RD_LZMA is not set
+CONFIG_RD_XZ=y
+CONFIG_RD_LZO=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_EXPERT=y
+CONFIG_UID16=y
+# CONFIG_SYSCTL_SYSCALL is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# 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_EMBEDDED=y
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_PERF_USE_VMALLOC=y
+
+#
+# Kernel Performance Events And Counters
+#
+CONFIG_PERF_EVENTS=y
+# CONFIG_PERF_COUNTERS is not set
+# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
+CONFIG_VM_EVENT_COUNTERS=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=y
+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
+CONFIG_HAVE_DMA_API_DEBUG=y
+CONFIG_HAVE_HW_BREAKPOINT=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=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+CONFIG_MODULE_SRCVERSION_ALL=y
+CONFIG_BLOCK=y
+CONFIG_LBDAF=y
+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=y
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+# 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 is not set
+# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
+# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
+# 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 is not set
+# CONFIG_INLINE_READ_UNLOCK_BH is not set
+# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
+# 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 is not set
+# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
+# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
+# 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_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_MXS 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 is not set
+# 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_EXYNOS4 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_TCC_926 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=y
+# CONFIG_PLAT_SPEAR is not set
+# CONFIG_ARCH_VT8500 is not set
+# CONFIG_GPIO_PCA953X is not set
+# CONFIG_KEYBOARD_GPIO_POLLED is not set
+
+#
+# TI OMAP Common Features
+#
+CONFIG_ARCH_OMAP_OTG=y
+# CONFIG_ARCH_OMAP1 is not set
+CONFIG_ARCH_OMAP2PLUS=y
+
+#
+# OMAP Feature Selections
+#
+CONFIG_OMAP_SMARTREFLEX=y
+CONFIG_OMAP_SMARTREFLEX_CLASS3=y
+CONFIG_OMAP_RESET_CLOCKS=y
+# CONFIG_OMAP_MUX is not set
+CONFIG_OMAP_MCBSP=y
+CONFIG_OMAP_MBOX_FWK=m
+CONFIG_OMAP_MBOX_KFIFO_SIZE=256
+CONFIG_OMAP_IOMMU=y
+CONFIG_OMAP_IOMMU_DEBUG=m
+CONFIG_OMAP_32K_TIMER=y
+# CONFIG_OMAP3_L2_AUX_SECURE_SAVE_RESTORE is not set
+CONFIG_OMAP_32K_TIMER_HZ=128
+CONFIG_OMAP_DM_TIMER=y
+# CONFIG_OMAP_PM_NONE is not set
+CONFIG_OMAP_PM_NOOP=y
+
+#
+# TI OMAP2/3/4 Specific Features
+#
+CONFIG_ARCH_OMAP2PLUS_TYPICAL=y
+# CONFIG_ARCH_OMAP2 is not set
+CONFIG_ARCH_OMAP3=y
+# CONFIG_ARCH_OMAP4 is not set
+CONFIG_SOC_OMAP3430=y
+# CONFIG_SOC_OMAPTI816X is not set
+CONFIG_OMAP_PACKAGE_CBB=y
+
+#
+# OMAP Board Type
+#
+CONFIG_MACH_OMAP3_BEAGLE=y
+# CONFIG_MACH_DEVKIT8000 is not set
+# CONFIG_MACH_OMAP_LDP is not set
+# CONFIG_MACH_OMAP3530_LV_SOM is not set
+# CONFIG_MACH_OMAP3_TORPEDO is not set
+CONFIG_MACH_OVERO=y
+CONFIG_MACH_OMAP3EVM=y
+# CONFIG_MACH_OMAP3517EVM is not set
+# CONFIG_MACH_CRANEBOARD is not set
+# CONFIG_MACH_OMAP3_PANDORA is not set
+CONFIG_MACH_OMAP3_TOUCHBOOK=y
+# CONFIG_MACH_OMAP_3430SDP is not set
+# CONFIG_MACH_NOKIA_RM680 is not set
+# CONFIG_MACH_NOKIA_RX51 is not set
+CONFIG_MACH_OMAP_ZOOM2=y
+# CONFIG_MACH_OMAP_ZOOM3 is not set
+# CONFIG_MACH_CM_T35 is not set
+# CONFIG_MACH_CM_T3517 is not set
+# CONFIG_MACH_IGEP0020 is not set
+# CONFIG_MACH_IGEP0030 is not set
+# CONFIG_MACH_SBC3530 is not set
+# CONFIG_MACH_OMAP_3630SDP is not set
+# CONFIG_OMAP3_EMU is not set
+# CONFIG_OMAP3_SDRC_AC_TIMING is not set
+
+#
+# System MMU
+#
+
+#
+# Processor Type
+#
+CONFIG_CPU_V7=y
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV7=y
+CONFIG_CPU_PABRT_V7=y
+CONFIG_CPU_CACHE_V7=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_TLB_V7=y
+CONFIG_CPU_HAS_ASID=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+CONFIG_ARM_THUMBEE=y
+# CONFIG_SWP_EMULATE is not set
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+CONFIG_ARM_L1_CACHE_SHIFT_6=y
+CONFIG_ARM_L1_CACHE_SHIFT=6
+CONFIG_ARM_DMA_MEM_BUFFERABLE=y
+CONFIG_ARM_ERRATA_430973=y
+# CONFIG_ARM_ERRATA_458693 is not set
+# CONFIG_ARM_ERRATA_460075 is not set
+# CONFIG_ARM_ERRATA_743622 is not set
+# CONFIG_ARM_ERRATA_754322 is not set
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+# CONFIG_PREEMPT_NONE is not set
+# CONFIG_PREEMPT_VOLUNTARY is not set
+CONFIG_PREEMPT=y
+CONFIG_HZ=128
+# CONFIG_THUMB2_KERNEL is not set
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ARCH_HAS_HOLES_MEMORYMODEL=y
+# 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=4
+CONFIG_COMPACTION=y
+CONFIG_MIGRATION=y
+# 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_LEDS=y
+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=" debug "
+# CONFIG_CMDLINE_FORCE is not set
+# CONFIG_XIP_KERNEL is not set
+CONFIG_KEXEC=y
+CONFIG_ATAGS_PROC=y
+# CONFIG_CRASH_DUMP is not set
+# CONFIG_AUTO_ZRELADDR is not set
+
+#
+# CPU Power Management
+#
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=y
+CONFIG_CPU_FREQ_DEBUG=y
+CONFIG_CPU_FREQ_STAT=y
+CONFIG_CPU_FREQ_STAT_DETAILS=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=y
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
+CONFIG_CPU_IDLE=y
+CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_IDLE_GOV_MENU=y
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_VFP=y
+CONFIG_VFPv3=y
+CONFIG_NEON=y
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
+CONFIG_BINFMT_AOUT=m
+CONFIG_BINFMT_MISC=y
+
+#
+# Power management options
+#
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+CONFIG_PM_SLEEP=y
+CONFIG_PM_RUNTIME=y
+CONFIG_PM=y
+CONFIG_PM_DEBUG=y
+# CONFIG_PM_VERBOSE is not set
+# CONFIG_PM_ADVANCED_DEBUG is not set
+# CONFIG_PM_TEST_SUSPEND is not set
+CONFIG_CAN_PM_TRACE=y
+# CONFIG_APM_EMULATION is not set
+CONFIG_ARCH_HAS_OPP=y
+CONFIG_PM_OPP=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
+CONFIG_XFRM_IPCOMP=m
+CONFIG_NET_KEY=y
+# CONFIG_NET_KEY_MIGRATE is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_ROUTE_CLASSID=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_RARP=y
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE_DEMUX=m
+CONFIG_NET_IPGRE=m
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+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=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+CONFIG_INET_LRO=y
+CONFIG_INET_DIAG=m
+CONFIG_INET_TCP_DIAG=m
+CONFIG_TCP_CONG_ADVANCED=y
+CONFIG_TCP_CONG_BIC=m
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+CONFIG_TCP_CONG_HSTCP=m
+CONFIG_TCP_CONG_HYBLA=m
+CONFIG_TCP_CONG_VEGAS=m
+CONFIG_TCP_CONG_SCALABLE=m
+CONFIG_TCP_CONG_LP=m
+CONFIG_TCP_CONG_VENO=m
+CONFIG_TCP_CONG_YEAH=m
+CONFIG_TCP_CONG_ILLINOIS=m
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+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=m
+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=m
+CONFIG_IPV6_SIT=m
+# CONFIG_IPV6_SIT_6RD is not set
+CONFIG_IPV6_NDISC_NODETYPE=y
+CONFIG_IPV6_TUNNEL=m
+CONFIG_IPV6_MULTIPLE_TABLES=y
+CONFIG_IPV6_SUBTREES=y
+CONFIG_IPV6_MROUTE=y
+CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
+# CONFIG_IPV6_PIMSM_V2 is not set
+# CONFIG_NETWORK_SECMARK is not set
+CONFIG_NETWORK_PHY_TIMESTAMPING=y
+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_ZONES=y
+CONFIG_NF_CONNTRACK_EVENTS=y
+CONFIG_NF_CONNTRACK_TIMESTAMP=y
+CONFIG_NF_CT_PROTO_DCCP=m
+CONFIG_NF_CT_PROTO_GRE=m
+CONFIG_NF_CT_PROTO_SCTP=m
+CONFIG_NF_CT_PROTO_UDPLITE=m
+CONFIG_NF_CONNTRACK_AMANDA=m
+CONFIG_NF_CONNTRACK_FTP=m
+CONFIG_NF_CONNTRACK_H323=m
+CONFIG_NF_CONNTRACK_IRC=m
+CONFIG_NF_CONNTRACK_BROADCAST=m
+CONFIG_NF_CONNTRACK_NETBIOS_NS=m
+CONFIG_NF_CONNTRACK_SNMP=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
+CONFIG_NETFILTER_XT_SET=m
+
+#
+# Xtables targets
+#
+CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
+CONFIG_NETFILTER_XT_TARGET_CT=m
+# CONFIG_NETFILTER_XT_TARGET_DSCP is not set
+CONFIG_NETFILTER_XT_TARGET_HL=m
+CONFIG_NETFILTER_XT_TARGET_IDLETIMER=m
+# 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 is not set
+CONFIG_NETFILTER_XT_TARGET_RATEEST=m
+CONFIG_NETFILTER_XT_TARGET_TEE=m
+# 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_ADDRTYPE=m
+# CONFIG_NETFILTER_XT_MATCH_CLUSTER is not set
+CONFIG_NETFILTER_XT_MATCH_COMMENT=m
+CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
+CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
+CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
+CONFIG_NETFILTER_XT_MATCH_CPU=m
+CONFIG_NETFILTER_XT_MATCH_DCCP=m
+CONFIG_NETFILTER_XT_MATCH_DEVGROUP=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_IPVS=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=m
+CONFIG_NETFILTER_XT_MATCH_POLICY=m
+# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+CONFIG_NETFILTER_XT_MATCH_QUOTA=m
+CONFIG_NETFILTER_XT_MATCH_RATEEST=m
+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=m
+CONFIG_IP_SET=m
+CONFIG_IP_SET_MAX=256
+# CONFIG_IP_SET_BITMAP_IP is not set
+# CONFIG_IP_SET_BITMAP_IPMAC is not set
+# CONFIG_IP_SET_BITMAP_PORT is not set
+# CONFIG_IP_SET_HASH_IP is not set
+# CONFIG_IP_SET_HASH_IPPORT is not set
+# CONFIG_IP_SET_HASH_IPPORTIP is not set
+# CONFIG_IP_SET_HASH_IPPORTNET is not set
+# CONFIG_IP_SET_HASH_NET is not set
+# CONFIG_IP_SET_HASH_NETPORT is not set
+# CONFIG_IP_SET_LIST_SET is not set
+CONFIG_IP_VS=m
+CONFIG_IP_VS_IPV6=y
+CONFIG_IP_VS_DEBUG=y
+CONFIG_IP_VS_TAB_BITS=12
+
+#
+# IPVS transport protocol load balancing support
+#
+CONFIG_IP_VS_PROTO_TCP=y
+CONFIG_IP_VS_PROTO_UDP=y
+CONFIG_IP_VS_PROTO_AH_ESP=y
+CONFIG_IP_VS_PROTO_ESP=y
+CONFIG_IP_VS_PROTO_AH=y
+# CONFIG_IP_VS_PROTO_SCTP is not set
+
+#
+# IPVS scheduler
+#
+CONFIG_IP_VS_RR=m
+CONFIG_IP_VS_WRR=m
+CONFIG_IP_VS_LC=m
+CONFIG_IP_VS_WLC=m
+CONFIG_IP_VS_LBLC=m
+CONFIG_IP_VS_LBLCR=m
+CONFIG_IP_VS_DH=m
+CONFIG_IP_VS_SH=m
+CONFIG_IP_VS_SED=m
+CONFIG_IP_VS_NQ=m
+
+#
+# IPVS application helper
+#
+CONFIG_IP_VS_FTP=m
+CONFIG_IP_VS_NFCT=y
+CONFIG_IP_VS_PE_SIP=m
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_NF_DEFRAG_IPV4=m
+CONFIG_NF_CONNTRACK_IPV4=m
+CONFIG_NF_CONNTRACK_PROC_COMPAT=y
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=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_DCCP=m
+CONFIG_NF_NAT_PROTO_GRE=m
+CONFIG_NF_NAT_PROTO_UDPLITE=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=m
+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=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+
+#
+# IPv6: Netfilter Configuration
+#
+CONFIG_NF_DEFRAG_IPV6=m
+CONFIG_NF_CONNTRACK_IPV6=m
+CONFIG_IP6_NF_QUEUE=m
+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=m
+# CONFIG_BRIDGE_NF_EBTABLES is not set
+CONFIG_IP_DCCP=m
+CONFIG_INET_DCCP_DIAG=m
+
+#
+# DCCP CCIDs Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP_CCID2_DEBUG is not set
+CONFIG_IP_DCCP_CCID3=y
+# CONFIG_IP_DCCP_CCID3_DEBUG is not set
+CONFIG_IP_DCCP_TFRC_LIB=y
+
+#
+# DCCP Kernel Hacking
+#
+# CONFIG_IP_DCCP_DEBUG is not set
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+# CONFIG_SCTP_HMAC_SHA1 is not set
+CONFIG_SCTP_HMAC_MD5=y
+# CONFIG_RDS is not set
+CONFIG_TIPC=m
+# CONFIG_TIPC_ADVANCED is not set
+# CONFIG_TIPC_DEBUG is not set
+CONFIG_ATM=m
+CONFIG_ATM_CLIP=m
+# CONFIG_ATM_CLIP_NO_ICMP is not set
+CONFIG_ATM_LANE=m
+CONFIG_ATM_MPOA=m
+CONFIG_ATM_BR2684=m
+# CONFIG_ATM_BR2684_IPFILTER is not set
+CONFIG_L2TP=m
+CONFIG_L2TP_DEBUGFS=m
+CONFIG_L2TP_V3=y
+CONFIG_L2TP_IP=m
+CONFIG_L2TP_ETH=m
+CONFIG_STP=m
+CONFIG_GARP=m
+CONFIG_BRIDGE=m
+CONFIG_BRIDGE_IGMP_SNOOPING=y
+# CONFIG_NET_DSA is not set
+CONFIG_VLAN_8021Q=m
+CONFIG_VLAN_8021Q_GVRP=y
+# 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=m
+# 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_ATM=m
+CONFIG_NET_SCH_PRIO=m
+CONFIG_NET_SCH_MULTIQ=m
+CONFIG_NET_SCH_RED=m
+# CONFIG_NET_SCH_SFB is not set
+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=m
+CONFIG_NET_SCH_MQPRIO=m
+CONFIG_NET_SCH_CHOKE=m
+
+#
+# Classification
+#
+CONFIG_NET_CLS=y
+CONFIG_NET_CLS_BASIC=m
+CONFIG_NET_CLS_TCINDEX=m
+CONFIG_NET_CLS_ROUTE4=m
+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=m
+CONFIG_NET_CLS_CGROUP=m
+# CONFIG_NET_EMATCH is not set
+# CONFIG_NET_CLS_ACT is not set
+CONFIG_NET_CLS_IND=y
+CONFIG_NET_SCH_FIFO=y
+# CONFIG_DCB is not set
+CONFIG_DNS_RESOLVER=y
+# CONFIG_BATMAN_ADV is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+CONFIG_CAN=m
+CONFIG_CAN_RAW=m
+CONFIG_CAN_BCM=m
+
+#
+# CAN Device Drivers
+#
+CONFIG_CAN_VCAN=m
+CONFIG_CAN_SLCAN=m
+# CONFIG_CAN_DEV is not set
+# CONFIG_CAN_DEBUG_DEVICES is not set
+CONFIG_IRDA=m
+
+#
+# IrDA protocols
+#
+CONFIG_IRLAN=m
+CONFIG_IRNET=m
+CONFIG_IRCOMM=m
+CONFIG_IRDA_ULTRA=y
+
+#
+# IrDA options
+#
+CONFIG_IRDA_CACHE_LAST_LSAP=y
+CONFIG_IRDA_FAST_RR=y
+CONFIG_IRDA_DEBUG=y
+
+#
+# Infrared-port device drivers
+#
+
+#
+# SIR device drivers
+#
+CONFIG_IRTTY_SIR=m
+
+#
+# Dongle support
+#
+CONFIG_DONGLE=y
+CONFIG_ESI_DONGLE=m
+CONFIG_ACTISYS_DONGLE=m
+CONFIG_TEKRAM_DONGLE=m
+CONFIG_TOIM3232_DONGLE=m
+CONFIG_LITELINK_DONGLE=m
+CONFIG_MA600_DONGLE=m
+CONFIG_GIRBIL_DONGLE=m
+CONFIG_MCP2120_DONGLE=m
+CONFIG_OLD_BELKIN_DONGLE=m
+# CONFIG_ACT200L_DONGLE is not set
+CONFIG_KINGSUN_DONGLE=m
+CONFIG_KSDAZZLE_DONGLE=m
+CONFIG_KS959_DONGLE=m
+
+#
+# FIR device drivers
+#
+CONFIG_USB_IRDA=m
+CONFIG_SIGMATEL_FIR=m
+CONFIG_MCS_FIR=m
+CONFIG_BT=m
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=m
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIBTUSB=m
+CONFIG_BT_HCIBTSDIO=m
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIUART_ATH3K=y
+CONFIG_BT_HCIUART_LL=y
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBPA10X=m
+CONFIG_BT_HCIBFUSB=m
+# CONFIG_BT_HCIVHCI is not set
+# CONFIG_BT_MRVL is not set
+CONFIG_BT_ATH3K=m
+CONFIG_BT_WILINK=m
+CONFIG_AF_RXRPC=m
+# CONFIG_AF_RXRPC_DEBUG is not set
+# CONFIG_RXKAD is not set
+CONFIG_FIB_RULES=y
+CONFIG_WIRELESS=y
+CONFIG_WIRELESS_EXT=y
+CONFIG_WEXT_CORE=y
+CONFIG_WEXT_PROC=y
+CONFIG_WEXT_SPY=y
+CONFIG_WEXT_PRIV=y
+CONFIG_CFG80211=m
+CONFIG_NL80211_TESTMODE=y
+# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
+# CONFIG_CFG80211_REG_DEBUG is not set
+CONFIG_CFG80211_DEFAULT_PS=y
+# CONFIG_CFG80211_DEBUGFS is not set
+# CONFIG_CFG80211_INTERNAL_REGDB is not set
+CONFIG_CFG80211_WEXT=y
+CONFIG_WIRELESS_EXT_SYSFS=y
+CONFIG_LIB80211=y
+CONFIG_LIB80211_CRYPT_WEP=m
+CONFIG_LIB80211_CRYPT_CCMP=m
+CONFIG_LIB80211_CRYPT_TKIP=m
+# CONFIG_LIB80211_DEBUG is not set
+CONFIG_MAC80211=m
+CONFIG_MAC80211_HAS_RC=y
+CONFIG_MAC80211_RC_PID=y
+# CONFIG_MAC80211_RC_MINSTREL is not set
+CONFIG_MAC80211_RC_DEFAULT_PID=y
+CONFIG_MAC80211_RC_DEFAULT="pid"
+# CONFIG_MAC80211_MESH is not set
+CONFIG_MAC80211_LEDS=y
+# CONFIG_MAC80211_DEBUGFS is not set
+# CONFIG_MAC80211_DEBUG_MENU is not set
+CONFIG_WIMAX=m
+CONFIG_WIMAX_DEBUG_LEVEL=8
+CONFIG_RFKILL=m
+CONFIG_RFKILL_LEDS=y
+CONFIG_RFKILL_INPUT=y
+CONFIG_NET_9P=m
+# CONFIG_NET_9P_DEBUG is not set
+# CONFIG_CAIF is not set
+CONFIG_CEPH_LIB=m
+# CONFIG_CEPH_LIB_PRETTYDEBUG 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=y
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# 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_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+# 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=m
+# CONFIG_MTD_OOPS is not set
+CONFIG_MTD_SWAP=m
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE 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_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS 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 is not set
+# CONFIG_MTD_NAND_ECC_BCH is not set
+# 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_OMAP2=y
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+CONFIG_MTD_NAND_PLATFORM=y
+# 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 is not set
+# 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=y
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+
+#
+# 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=16384
+# CONFIG_BLK_DEV_XIP is not set
+CONFIG_CDROM_PKTCDVD=m
+CONFIG_CDROM_PKTCDVD_BUFFERS=8
+# CONFIG_CDROM_PKTCDVD_WCACHE is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_MG_DISK is not set
+# CONFIG_BLK_DEV_RBD is not set
+# CONFIG_SENSORS_LIS3LV02D 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=m
+# CONFIG_SENSORS_BH1770 is not set
+# CONFIG_SENSORS_APDS990X is not set
+CONFIG_HMC6352=m
+# CONFIG_DS1682 is not set
+# CONFIG_TI_DAC7512 is not set
+CONFIG_BMP085=m
+# CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+CONFIG_EEPROM_AT24=m
+# CONFIG_EEPROM_AT25 is not set
+# CONFIG_EEPROM_LEGACY is not set
+# CONFIG_EEPROM_MAX6875 is not set
+CONFIG_EEPROM_93CX6=y
+CONFIG_IWMC3200TOP=m
+# CONFIG_IWMC3200TOP_DEBUG is not set
+# CONFIG_IWMC3200TOP_DEBUGFS is not set
+
+#
+# Texas Instruments shared transport line discipline
+#
+CONFIG_TI_ST=m
+# CONFIG_SENSORS_LIS3_SPI is not set
+# CONFIG_SENSORS_LIS3_I2C is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+CONFIG_SCSI_MOD=y
+CONFIG_RAID_ATTRS=m
+CONFIG_SCSI=y
+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=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+CONFIG_BLK_DEV_SR=y
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=y
+CONFIG_CHR_DEV_SCH=m
+CONFIG_SCSI_MULTI_LUN=y
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+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=m
+# 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=m
+CONFIG_ISCSI_BOOT_SYSFS=m
+# 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=y
+CONFIG_BLK_DEV_MD=m
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID10=m
+CONFIG_MD_RAID456=m
+CONFIG_MD_MULTIPATH=m
+CONFIG_MD_FAULTY=m
+CONFIG_BLK_DEV_DM=m
+# CONFIG_DM_DEBUG is not set
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_RAID=m
+# CONFIG_DM_LOG_USERSPACE is not set
+CONFIG_DM_ZERO=m
+CONFIG_DM_MULTIPATH=m
+# CONFIG_DM_MULTIPATH_QL is not set
+# CONFIG_DM_MULTIPATH_ST is not set
+CONFIG_DM_DELAY=m
+# CONFIG_DM_UEVENT is not set
+CONFIG_DM_FLAKEY=m
+CONFIG_TARGET_CORE=m
+CONFIG_TCM_IBLOCK=m
+CONFIG_TCM_FILEIO=m
+CONFIG_TCM_PSCSI=m
+CONFIG_LOOPBACK_TARGET=m
+# CONFIG_LOOPBACK_TARGET_CDB_DEBUG is not set
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+CONFIG_MACVLAN=m
+CONFIG_MACVTAP=m
+CONFIG_EQUALIZER=m
+CONFIG_TUN=m
+CONFIG_VETH=m
+CONFIG_MII=y
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+CONFIG_BCM63XX_PHY=m
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+CONFIG_MICREL_PHY=m
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
+CONFIG_NET_ETHERNET=y
+# CONFIG_AX88796 is not set
+CONFIG_SMC91X=y
+# CONFIG_TI_DAVINCI_EMAC is not set
+CONFIG_TI_DAVINCI_MDIO=m
+CONFIG_TI_DAVINCI_CPDMA=m
+# CONFIG_DM9000 is not set
+CONFIG_ENC28J60=y
+# CONFIG_ENC28J60_WRITEVERIFY is not set
+# CONFIG_ETHOC is not set
+CONFIG_SMC911X=y
+CONFIG_SMSC911X=y
+# CONFIG_SMSC911X_ARCH_HOOKS is not set
+# CONFIG_DNET is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+# CONFIG_B44 is not set
+CONFIG_KS8842=m
+CONFIG_KS8851=y
+# CONFIG_KS8851_MLL is not set
+# CONFIG_FTMAC100 is not set
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+CONFIG_WLAN=y
+# CONFIG_LIBERTAS_THINFIRM is not set
+CONFIG_AT76C50X_USB=m
+CONFIG_USB_ZD1201=m
+CONFIG_USB_NET_RNDIS_WLAN=m
+CONFIG_RTL8187=m
+CONFIG_RTL8187_LEDS=y
+# CONFIG_MAC80211_HWSIM is not set
+# CONFIG_ATH_COMMON is not set
+CONFIG_B43=m
+# CONFIG_B43_SDIO is not set
+CONFIG_B43_PIO=y
+CONFIG_B43_PHY_N=y
+CONFIG_B43_PHY_LP=y
+CONFIG_B43_LEDS=y
+CONFIG_B43_HWRNG=y
+# CONFIG_B43_DEBUG is not set
+# CONFIG_B43LEGACY is not set
+CONFIG_HOSTAP=m
+CONFIG_HOSTAP_FIRMWARE=y
+CONFIG_HOSTAP_FIRMWARE_NVRAM=y
+# CONFIG_IWM is not set
+CONFIG_LIBERTAS=m
+CONFIG_LIBERTAS_USB=m
+# CONFIG_LIBERTAS_SDIO is not set
+# CONFIG_LIBERTAS_SPI is not set
+# CONFIG_LIBERTAS_DEBUG is not set
+# CONFIG_LIBERTAS_MESH is not set
+CONFIG_P54_COMMON=m
+CONFIG_P54_USB=m
+# CONFIG_P54_SPI is not set
+CONFIG_P54_LEDS=y
+CONFIG_RT2X00=m
+CONFIG_RT2500USB=m
+CONFIG_RT73USB=m
+# CONFIG_RT2800USB is not set
+CONFIG_RT2X00_LIB_USB=m
+CONFIG_RT2X00_LIB=m
+CONFIG_RT2X00_LIB_FIRMWARE=y
+CONFIG_RT2X00_LIB_CRYPTO=y
+CONFIG_RT2X00_LIB_LEDS=y
+# CONFIG_RT2X00_DEBUG is not set
+CONFIG_RTL8192CU=m
+CONFIG_RTLWIFI=m
+CONFIG_RTL8192C_COMMON=m
+CONFIG_WL1251=m
+CONFIG_WL1251_SPI=m
+CONFIG_WL1251_SDIO=m
+CONFIG_WL12XX_MENU=m
+CONFIG_WL12XX=m
+CONFIG_WL12XX_HT=y
+CONFIG_WL12XX_SPI=m
+CONFIG_WL12XX_SDIO=m
+# CONFIG_WL12XX_SDIO_TEST is not set
+CONFIG_WL12XX_PLATFORM_DATA=y
+CONFIG_ZD1211RW=m
+# CONFIG_ZD1211RW_DEBUG is not set
+
+#
+# WiMAX Wireless Broadband devices
+#
+CONFIG_WIMAX_I2400M=m
+CONFIG_WIMAX_I2400M_USB=m
+CONFIG_WIMAX_I2400M_SDIO=m
+CONFIG_WIMAX_IWMC3200_SDIO=y
+CONFIG_WIMAX_I2400M_DEBUG_LEVEL=8
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_CATC=y
+CONFIG_USB_KAWETH=y
+CONFIG_USB_PEGASUS=y
+CONFIG_USB_RTL8150=y
+CONFIG_USB_USBNET=y
+CONFIG_USB_NET_AX8817X=y
+CONFIG_USB_NET_CDCETHER=y
+# CONFIG_USB_NET_CDC_EEM is not set
+CONFIG_USB_NET_CDC_NCM=m
+CONFIG_USB_NET_DM9601=y
+CONFIG_USB_NET_SMSC75XX=m
+CONFIG_USB_NET_SMSC95XX=y
+CONFIG_USB_NET_GL620A=y
+CONFIG_USB_NET_NET1080=y
+CONFIG_USB_NET_PLUSB=y
+CONFIG_USB_NET_MCS7830=y
+CONFIG_USB_NET_RNDIS_HOST=y
+CONFIG_USB_NET_CDC_SUBSET=y
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_KC2190=y
+CONFIG_USB_NET_ZAURUS=y
+CONFIG_USB_NET_CX82310_ETH=m
+CONFIG_USB_HSO=m
+CONFIG_USB_NET_INT51X1=m
+CONFIG_USB_IPHETH=m
+CONFIG_USB_SIERRA_NET=m
+CONFIG_USB_VL600=m
+# CONFIG_WAN is not set
+CONFIG_ATM_DRIVERS=y
+# CONFIG_ATM_DUMMY is not set
+# CONFIG_ATM_TCP 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=m
+CONFIG_PPTP=m
+# CONFIG_PPPOATM is not set
+CONFIG_PPPOL2TP=m
+# CONFIG_SLIP is not set
+CONFIG_SLHC=m
+CONFIG_NETCONSOLE=m
+CONFIG_NETCONSOLE_DYNAMIC=y
+CONFIG_NETPOLL=y
+CONFIG_NETPOLL_TRAP=y
+CONFIG_NET_POLL_CONTROLLER=y
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+CONFIG_INPUT_FF_MEMLESS=y
+CONFIG_INPUT_POLLDEV=y
+# 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_QT1070=m
+CONFIG_KEYBOARD_QT2160=m
+# CONFIG_KEYBOARD_LKKBD is not set
+CONFIG_KEYBOARD_GPIO=y
+# 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=m
+# 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_TWL4030 is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
+# CONFIG_MOUSE_PS2_SENTELIC is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_BCM5974 is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_MOUSE_GPIO is not set
+# CONFIG_MOUSE_SYNAPTICS_I2C is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_AD714X=m
+CONFIG_INPUT_AD714X_I2C=m
+CONFIG_INPUT_AD714X_SPI=m
+# 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_TWL4030_PWRBUTTON=y
+CONFIG_INPUT_TWL4030_VIBRA=m
+CONFIG_INPUT_UINPUT=y
+CONFIG_INPUT_PCF8574=m
+CONFIG_INPUT_PWM_BEEPER=m
+# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
+CONFIG_INPUT_ADXL34X=m
+CONFIG_INPUT_ADXL34X_I2C=m
+CONFIG_INPUT_ADXL34X_SPI=m
+CONFIG_INPUT_CMA3000=m
+CONFIG_INPUT_CMA3000_I2C=m
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+CONFIG_SERIO_LIBPS2=y
+# 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_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+CONFIG_N_GSM=m
+CONFIG_DEVKMEM=y
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=32
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_8250_DETECT_IRQ=y
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_MAX3100 is not set
+# CONFIG_SERIAL_MAX3107 is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_OMAP=y
+CONFIG_SERIAL_OMAP_CONSOLE=y
+# CONFIG_SERIAL_TIMBERDALE is not set
+# CONFIG_SERIAL_ALTERA_JTAGUART is not set
+# CONFIG_SERIAL_ALTERA_UART is not set
+CONFIG_SERIAL_IFX6X60=m
+CONFIG_TTY_PRINTK=y
+# CONFIG_HVC_DCC is not set
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_HW_RANDOM_TIMERIOMEM 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=m
+
+#
+# Multiplexer I2C Chip support
+#
+CONFIG_I2C_MUX_GPIO=m
+# CONFIG_I2C_MUX_PCA9541 is not set
+# CONFIG_I2C_MUX_PCA954x is not set
+CONFIG_I2C_HELPER_AUTO=y
+CONFIG_I2C_ALGOBIT=m
+
+#
+# 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_OMAP=y
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_PXA_PCI is not set
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_XILINX is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+CONFIG_I2C_DIOLAN_U2C=m
+# 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_DEBUG is not set
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+# CONFIG_SPI_ALTERA is not set
+# CONFIG_SPI_BITBANG is not set
+# CONFIG_SPI_GPIO is not set
+# CONFIG_SPI_OC_TINY is not set
+CONFIG_SPI_OMAP24XX=y
+# CONFIG_SPI_PXA2XX_PCI is not set
+# CONFIG_SPI_XILINX is not set
+# CONFIG_SPI_DESIGNWARE is not set
+
+#
+# SPI Protocol Masters
+#
+CONFIG_SPI_SPIDEV=y
+# CONFIG_SPI_TLE62X0 is not set
+
+#
+# PPS support
+#
+# CONFIG_PPS is not set
+
+#
+# PPS generators support
+#
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_GPIOLIB=y
+# CONFIG_DEBUG_GPIO is not set
+CONFIG_GPIO_SYSFS=y
+CONFIG_GPIO_MAX730X=m
+
+#
+# Memory mapped GPIO expanders:
+#
+# CONFIG_GPIO_BASIC_MMIO is not set
+# CONFIG_GPIO_IT8761E is not set
+
+#
+# I2C GPIO expanders:
+#
+CONFIG_GPIO_MAX7300=m
+# CONFIG_GPIO_MAX732X is not set
+# CONFIG_GPIO_PCF857X is not set
+# CONFIG_GPIO_SX150X is not set
+CONFIG_GPIO_TWL4030=y
+CONFIG_GPIO_ADP5588=m
+
+#
+# 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=m
+# CONFIG_POWER_SUPPLY_DEBUG is not set
+# CONFIG_PDA_POWER is not set
+CONFIG_TEST_POWER=m
+# CONFIG_BATTERY_DS2782 is not set
+# CONFIG_BATTERY_BQ20Z75 is not set
+# CONFIG_BATTERY_BQ27x00 is not set
+# CONFIG_BATTERY_MAX17040 is not set
+CONFIG_BATTERY_MAX17042=m
+CONFIG_CHARGER_ISP1704=m
+CONFIG_CHARGER_TWL4030=m
+CONFIG_CHARGER_GPIO=m
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Native drivers
+#
+# CONFIG_SENSORS_AD7414 is not set
+# CONFIG_SENSORS_AD7418 is not set
+# CONFIG_SENSORS_ADCXX is not set
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1029 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ADM9240 is not set
+CONFIG_SENSORS_ADT7411=m
+# CONFIG_SENSORS_ADT7462 is not set
+# CONFIG_SENSORS_ADT7470 is not set
+# CONFIG_SENSORS_ADT7475 is not set
+CONFIG_SENSORS_ASC7621=m
+# CONFIG_SENSORS_ATXP1 is not set
+CONFIG_SENSORS_DS620=m
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_F75375S is not set
+# CONFIG_SENSORS_G760A is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+CONFIG_SENSORS_GPIO_FAN=m
+# CONFIG_SENSORS_IT87 is not set
+CONFIG_SENSORS_JC42=m
+# CONFIG_SENSORS_LINEAGE is not set
+# CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM70 is not set
+# CONFIG_SENSORS_LM73 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_LM93 is not set
+# CONFIG_SENSORS_LTC4151 is not set
+# CONFIG_SENSORS_LTC4215 is not set
+# CONFIG_SENSORS_LTC4245 is not set
+# CONFIG_SENSORS_LTC4261 is not set
+# CONFIG_SENSORS_LM95241 is not set
+# CONFIG_SENSORS_MAX1111 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_MAX6639 is not set
+# CONFIG_SENSORS_MAX6650 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_PMBUS is not set
+# CONFIG_SENSORS_SHT15 is not set
+# CONFIG_SENSORS_SHT21 is not set
+CONFIG_SENSORS_SMM665=m
+# CONFIG_SENSORS_DME1737 is not set
+CONFIG_SENSORS_EMC1403=m
+CONFIG_SENSORS_EMC2103=m
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47M192 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_SCH5627 is not set
+# CONFIG_SENSORS_ADS1015 is not set
+# CONFIG_SENSORS_ADS7828 is not set
+CONFIG_SENSORS_ADS7871=m
+CONFIG_SENSORS_AMC6821=m
+# CONFIG_SENSORS_THMC50 is not set
+CONFIG_SENSORS_TMP102=m
+# CONFIG_SENSORS_TMP401 is not set
+# CONFIG_SENSORS_TMP421 is not set
+CONFIG_SENSORS_TWL4030_MADC=m
+# CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83791D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83793 is not set
+# CONFIG_SENSORS_W83795 is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83L786NG is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+CONFIG_THERMAL=y
+CONFIG_THERMAL_HWMON=y
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_OMAP_WATCHDOG=y
+# CONFIG_TWL4030_WATCHDOG is not set
+# CONFIG_MAX63XX_WATCHDOG is not set
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB=y
+CONFIG_SSB_BLOCKIO=y
+CONFIG_SSB_SDIOHOST_POSSIBLE=y
+# CONFIG_SSB_SDIOHOST is not set
+# CONFIG_SSB_SILENT is not set
+# CONFIG_SSB_DEBUG 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_TPS6105X=m
+# CONFIG_TPS65010 is not set
+CONFIG_TPS6507X=m
+CONFIG_TWL4030_CORE=y
+CONFIG_TWL4030_MADC=m
+CONFIG_TWL4030_POWER=y
+CONFIG_TWL4030_CODEC=y
+CONFIG_TWL4030_POWEROFF=y
+CONFIG_TWL6030_PWM=m
+# CONFIG_MFD_STMPE is not set
+# CONFIG_MFD_TC3589X 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_MAX8997 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 is not set
+# CONFIG_MFD_MC13XXX is not set
+# CONFIG_ABX500_CORE is not set
+# CONFIG_EZX_PCAP is not set
+CONFIG_MFD_TPS6586X=y
+CONFIG_MFD_WL1273_CORE=m
+CONFIG_MFD_OMAP_USB_HOST=y
+CONFIG_REGULATOR=y
+# CONFIG_REGULATOR_DEBUG is not set
+CONFIG_REGULATOR_DUMMY=y
+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_TWL4030=y
+# CONFIG_REGULATOR_LP3971 is not set
+# CONFIG_REGULATOR_LP3972 is not set
+CONFIG_REGULATOR_TPS6105X=m
+# 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_REGULATOR_TPS6586X=m
+CONFIG_REGULATOR_TPS6524X=m
+CONFIG_MEDIA_SUPPORT=y
+
+#
+# Multimedia core support
+#
+CONFIG_MEDIA_CONTROLLER=y
+CONFIG_VIDEO_DEV=y
+CONFIG_VIDEO_V4L2_COMMON=y
+CONFIG_VIDEO_V4L2_SUBDEV_API=y
+CONFIG_DVB_CORE=m
+CONFIG_VIDEO_MEDIA=m
+
+#
+# Multimedia drivers
+#
+CONFIG_RC_CORE=m
+CONFIG_LIRC=m
+CONFIG_RC_MAP=m
+CONFIG_IR_NEC_DECODER=m
+CONFIG_IR_RC5_DECODER=m
+CONFIG_IR_RC6_DECODER=m
+CONFIG_IR_JVC_DECODER=m
+CONFIG_IR_SONY_DECODER=m
+CONFIG_IR_RC5_SZ_DECODER=m
+CONFIG_IR_LIRC_CODEC=m
+# CONFIG_IR_IMON is not set
+# CONFIG_IR_MCEUSB is not set
+# CONFIG_IR_STREAMZAP is not set
+CONFIG_RC_LOOPBACK=m
+CONFIG_MEDIA_ATTACH=y
+CONFIG_MEDIA_TUNER=m
+CONFIG_MEDIA_TUNER_CUSTOMISE=y
+
+#
+# Customize TV tuners
+#
+CONFIG_MEDIA_TUNER_SIMPLE=m
+CONFIG_MEDIA_TUNER_TDA8290=m
+CONFIG_MEDIA_TUNER_TDA827X=m
+CONFIG_MEDIA_TUNER_TDA18271=m
+CONFIG_MEDIA_TUNER_TDA9887=m
+CONFIG_MEDIA_TUNER_TEA5761=m
+CONFIG_MEDIA_TUNER_TEA5767=m
+CONFIG_MEDIA_TUNER_MT20XX=m
+CONFIG_MEDIA_TUNER_MT2060=m
+CONFIG_MEDIA_TUNER_MT2266=m
+CONFIG_MEDIA_TUNER_MT2131=m
+CONFIG_MEDIA_TUNER_QT1010=m
+CONFIG_MEDIA_TUNER_XC2028=m
+CONFIG_MEDIA_TUNER_XC5000=m
+CONFIG_MEDIA_TUNER_MXL5005S=m
+CONFIG_MEDIA_TUNER_MXL5007T=m
+CONFIG_MEDIA_TUNER_MC44S803=m
+CONFIG_MEDIA_TUNER_MAX2165=m
+CONFIG_MEDIA_TUNER_TDA18218=m
+CONFIG_VIDEO_V4L2=y
+CONFIG_VIDEOBUF_GEN=y
+CONFIG_VIDEOBUF_VMALLOC=m
+CONFIG_VIDEOBUF_DMA_CONTIG=y
+CONFIG_VIDEOBUF_DVB=m
+CONFIG_VIDEO_TVEEPROM=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_V4L2_MEM2MEM_DEV=m
+CONFIG_VIDEOBUF2_CORE=m
+CONFIG_VIDEOBUF2_MEMOPS=m
+CONFIG_VIDEOBUF2_VMALLOC=m
+CONFIG_VIDEO_CAPTURE_DRIVERS=y
+# CONFIG_VIDEO_ADV_DEBUG is not set
+# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
+# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set
+CONFIG_VIDEO_IR_I2C=m
+
+#
+# Encoders/decoders and other helper chips
+#
+
+#
+# Audio decoders
+#
+# CONFIG_VIDEO_TVAUDIO is not set
+# CONFIG_VIDEO_TDA7432 is not set
+# CONFIG_VIDEO_TDA9840 is not set
+# CONFIG_VIDEO_TEA6415C is not set
+# CONFIG_VIDEO_TEA6420 is not set
+CONFIG_VIDEO_MSP3400=m
+# CONFIG_VIDEO_CS5345 is not set
+CONFIG_VIDEO_CS53L32A=m
+# CONFIG_VIDEO_M52790 is not set
+# CONFIG_VIDEO_TLV320AIC23B is not set
+CONFIG_VIDEO_WM8775=m
+# CONFIG_VIDEO_WM8739 is not set
+# CONFIG_VIDEO_VP27SMPX is not set
+
+#
+# RDS decoders
+#
+# CONFIG_VIDEO_SAA6588 is not set
+
+#
+# Video decoders
+#
+CONFIG_VIDEO_ADV7180=m
+# CONFIG_VIDEO_BT819 is not set
+# CONFIG_VIDEO_BT856 is not set
+# CONFIG_VIDEO_BT866 is not set
+# CONFIG_VIDEO_KS0127 is not set
+# CONFIG_VIDEO_OV7670 is not set
+CONFIG_VIDEO_MT9V011=m
+# CONFIG_VIDEO_TCM825X is not set
+# CONFIG_VIDEO_SAA7110 is not set
+CONFIG_VIDEO_SAA711X=m
+# CONFIG_VIDEO_SAA717X is not set
+# CONFIG_VIDEO_SAA7191 is not set
+# CONFIG_VIDEO_TVP514X is not set
+# CONFIG_VIDEO_TVP5150 is not set
+# CONFIG_VIDEO_TVP7002 is not set
+# CONFIG_VIDEO_VPX3220 is not set
+
+#
+# Video and audio decoders
+#
+CONFIG_VIDEO_CX25840=m
+
+#
+# MPEG video encoders
+#
+CONFIG_VIDEO_CX2341X=m
+
+#
+# Video encoders
+#
+# CONFIG_VIDEO_SAA7127 is not set
+# CONFIG_VIDEO_SAA7185 is not set
+# CONFIG_VIDEO_ADV7170 is not set
+# CONFIG_VIDEO_ADV7175 is not set
+# CONFIG_VIDEO_THS7303 is not set
+# CONFIG_VIDEO_ADV7343 is not set
+# CONFIG_VIDEO_AK881X is not set
+
+#
+# Video improvement chips
+#
+# CONFIG_VIDEO_UPD64031A is not set
+# CONFIG_VIDEO_UPD64083 is not set
+CONFIG_VIDEO_VIVI=m
+CONFIG_VIDEO_VPFE_CAPTURE=y
+# CONFIG_VIDEO_DM6446_CCDC is not set
+CONFIG_VIDEO_OMAP2_VOUT=y
+# CONFIG_VIDEO_CPIA2 is not set
+CONFIG_VIDEO_TIMBERDALE=m
+# CONFIG_VIDEO_AU0828 is not set
+CONFIG_VIDEO_SR030PC30=m
+CONFIG_VIDEO_NOON010PC30=m
+CONFIG_VIDEO_OMAP3=y
+# CONFIG_VIDEO_OMAP3_DEBUG is not set
+# CONFIG_SOC_CAMERA is not set
+CONFIG_V4L_USB_DRIVERS=y
+CONFIG_USB_VIDEO_CLASS=m
+CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
+CONFIG_USB_GSPCA=m
+CONFIG_USB_M5602=m
+CONFIG_USB_STV06XX=m
+# CONFIG_USB_GL860 is not set
+CONFIG_USB_GSPCA_BENQ=m
+CONFIG_USB_GSPCA_CONEX=m
+CONFIG_USB_GSPCA_CPIA1=m
+CONFIG_USB_GSPCA_ETOMS=m
+CONFIG_USB_GSPCA_FINEPIX=m
+# CONFIG_USB_GSPCA_JEILINJ is not set
+CONFIG_USB_GSPCA_KONICA=m
+CONFIG_USB_GSPCA_MARS=m
+# CONFIG_USB_GSPCA_MR97310A is not set
+CONFIG_USB_GSPCA_NW80X=m
+CONFIG_USB_GSPCA_OV519=m
+CONFIG_USB_GSPCA_OV534=m
+CONFIG_USB_GSPCA_OV534_9=m
+CONFIG_USB_GSPCA_PAC207=m
+# CONFIG_USB_GSPCA_PAC7302 is not set
+CONFIG_USB_GSPCA_PAC7311=m
+CONFIG_USB_GSPCA_SN9C2028=m
+# CONFIG_USB_GSPCA_SN9C20X is not set
+CONFIG_USB_GSPCA_SONIXB=m
+CONFIG_USB_GSPCA_SONIXJ=m
+CONFIG_USB_GSPCA_SPCA500=m
+CONFIG_USB_GSPCA_SPCA501=m
+CONFIG_USB_GSPCA_SPCA505=m
+CONFIG_USB_GSPCA_SPCA506=m
+CONFIG_USB_GSPCA_SPCA508=m
+CONFIG_USB_GSPCA_SPCA561=m
+CONFIG_USB_GSPCA_SPCA1528=m
+# CONFIG_USB_GSPCA_SQ905 is not set
+# CONFIG_USB_GSPCA_SQ905C is not set
+CONFIG_USB_GSPCA_SQ930X=m
+CONFIG_USB_GSPCA_STK014=m
+# CONFIG_USB_GSPCA_STV0680 is not set
+CONFIG_USB_GSPCA_SUNPLUS=m
+CONFIG_USB_GSPCA_T613=m
+CONFIG_USB_GSPCA_TV8532=m
+CONFIG_USB_GSPCA_VC032X=m
+CONFIG_USB_GSPCA_VICAM=m
+CONFIG_USB_GSPCA_XIRLINK_CIT=m
+CONFIG_USB_GSPCA_ZC3XX=m
+CONFIG_VIDEO_PVRUSB2=m
+CONFIG_VIDEO_PVRUSB2_SYSFS=y
+CONFIG_VIDEO_PVRUSB2_DVB=y
+# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set
+CONFIG_VIDEO_HDPVR=m
+CONFIG_VIDEO_EM28XX=m
+CONFIG_VIDEO_EM28XX_ALSA=m
+CONFIG_VIDEO_EM28XX_DVB=m
+CONFIG_VIDEO_TLG2300=m
+CONFIG_VIDEO_CX231XX=m
+CONFIG_VIDEO_CX231XX_RC=y
+# CONFIG_VIDEO_CX231XX_ALSA is not set
+CONFIG_VIDEO_CX231XX_DVB=m
+CONFIG_VIDEO_USBVISION=m
+CONFIG_USB_ET61X251=m
+CONFIG_USB_SN9C102=m
+CONFIG_USB_PWC=m
+# CONFIG_USB_PWC_DEBUG is not set
+CONFIG_USB_PWC_INPUT_EVDEV=y
+CONFIG_USB_ZR364XX=m
+CONFIG_USB_STKWEBCAM=m
+CONFIG_USB_S2255=m
+CONFIG_V4L_MEM2MEM_DRIVERS=y
+CONFIG_VIDEO_MEM2MEM_TESTDEV=m
+CONFIG_RADIO_ADAPTERS=y
+# CONFIG_I2C_SI4713 is not set
+# CONFIG_RADIO_SI4713 is not set
+# CONFIG_USB_DSBR is not set
+# CONFIG_RADIO_SI470X is not set
+# CONFIG_USB_MR800 is not set
+# CONFIG_RADIO_TEA5764 is not set
+CONFIG_RADIO_SAA7706H=m
+# CONFIG_RADIO_TEF6862 is not set
+CONFIG_RADIO_WL1273=m
+
+#
+# Texas Instruments WL128x FM driver (ST based)
+#
+CONFIG_RADIO_WL128X=m
+CONFIG_DVB_MAX_ADAPTERS=8
+CONFIG_DVB_DYNAMIC_MINORS=y
+CONFIG_DVB_CAPTURE_DRIVERS=y
+# CONFIG_TTPCI_EEPROM is not set
+
+#
+# Supported USB Adapters
+#
+CONFIG_DVB_USB=m
+# CONFIG_DVB_USB_DEBUG is not set
+CONFIG_DVB_USB_A800=m
+CONFIG_DVB_USB_DIBUSB_MB=m
+# CONFIG_DVB_USB_DIBUSB_MB_FAULTY is not set
+CONFIG_DVB_USB_DIBUSB_MC=m
+CONFIG_DVB_USB_DIB0700=m
+CONFIG_DVB_USB_UMT_010=m
+CONFIG_DVB_USB_CXUSB=m
+CONFIG_DVB_USB_M920X=m
+CONFIG_DVB_USB_GL861=m
+CONFIG_DVB_USB_AU6610=m
+CONFIG_DVB_USB_DIGITV=m
+CONFIG_DVB_USB_VP7045=m
+CONFIG_DVB_USB_VP702X=m
+CONFIG_DVB_USB_GP8PSK=m
+CONFIG_DVB_USB_NOVA_T_USB2=m
+CONFIG_DVB_USB_TTUSB2=m
+CONFIG_DVB_USB_DTT200U=m
+CONFIG_DVB_USB_OPERA1=m
+CONFIG_DVB_USB_AF9005=m
+CONFIG_DVB_USB_AF9005_REMOTE=m
+CONFIG_DVB_USB_DW2102=m
+CONFIG_DVB_USB_CINERGY_T2=m
+CONFIG_DVB_USB_ANYSEE=m
+CONFIG_DVB_USB_DTV5100=m
+CONFIG_DVB_USB_AF9015=m
+# CONFIG_DVB_USB_CE6230 is not set
+# CONFIG_DVB_USB_FRIIO is not set
+# CONFIG_DVB_USB_EC168 is not set
+CONFIG_DVB_USB_AZ6027=m
+CONFIG_DVB_USB_LME2510=m
+CONFIG_DVB_USB_TECHNISAT_USB2=m
+# CONFIG_SMS_SIANO_MDTV is not set
+
+#
+# Supported FlexCopII (B2C2) Adapters
+#
+CONFIG_DVB_B2C2_FLEXCOP=m
+CONFIG_DVB_B2C2_FLEXCOP_USB=m
+# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set
+
+#
+# Supported DVB Frontends
+#
+# CONFIG_DVB_FE_CUSTOMISE is not set
+
+#
+# Multistandard (satellite) frontends
+#
+CONFIG_DVB_STB0899=m
+CONFIG_DVB_STB6100=m
+CONFIG_DVB_STV090x=m
+CONFIG_DVB_STV6110x=m
+
+#
+# DVB-S (satellite) frontends
+#
+CONFIG_DVB_CX24123=m
+CONFIG_DVB_MT312=m
+CONFIG_DVB_ZL10039=m
+CONFIG_DVB_S5H1420=m
+CONFIG_DVB_STV0288=m
+CONFIG_DVB_STB6000=m
+CONFIG_DVB_STV0299=m
+CONFIG_DVB_STV6110=m
+CONFIG_DVB_STV0900=m
+CONFIG_DVB_TDA10086=m
+CONFIG_DVB_TUNER_ITD1000=m
+CONFIG_DVB_TUNER_CX24113=m
+CONFIG_DVB_TDA826X=m
+CONFIG_DVB_CX24116=m
+CONFIG_DVB_SI21XX=m
+CONFIG_DVB_DS3000=m
+
+#
+# DVB-T (terrestrial) frontends
+#
+CONFIG_DVB_CX22702=m
+CONFIG_DVB_TDA1004X=m
+CONFIG_DVB_NXT6000=m
+CONFIG_DVB_MT352=m
+CONFIG_DVB_ZL10353=m
+CONFIG_DVB_DIB3000MB=m
+CONFIG_DVB_DIB3000MC=m
+CONFIG_DVB_DIB7000M=m
+CONFIG_DVB_DIB7000P=m
+CONFIG_DVB_TDA10048=m
+CONFIG_DVB_AF9013=m
+
+#
+# DVB-C (cable) frontends
+#
+CONFIG_DVB_TDA10023=m
+CONFIG_DVB_STV0297=m
+
+#
+# ATSC (North American/Korean Terrestrial/Cable DTV) frontends
+#
+CONFIG_DVB_NXT200X=m
+CONFIG_DVB_BCM3510=m
+CONFIG_DVB_LGDT330X=m
+CONFIG_DVB_LGDT3305=m
+CONFIG_DVB_S5H1409=m
+CONFIG_DVB_S5H1411=m
+
+#
+# ISDB-T (terrestrial) frontends
+#
+CONFIG_DVB_S921=m
+CONFIG_DVB_DIB8000=m
+CONFIG_DVB_MB86A20S=m
+
+#
+# Digital terrestrial only tuners/PLL
+#
+CONFIG_DVB_PLL=m
+CONFIG_DVB_TUNER_DIB0070=m
+CONFIG_DVB_TUNER_DIB0090=m
+
+#
+# SEC control devices for DVB-S
+#
+CONFIG_DVB_LNBP21=m
+CONFIG_DVB_ISL6421=m
+CONFIG_DVB_LGS8GXX=m
+CONFIG_DVB_ATBM8830=m
+CONFIG_DVB_IX2505V=m
+
+#
+# Tools to develop new frontends
+#
+# CONFIG_DVB_DUMMY_FE is not set
+
+#
+# Graphics support
+#
+CONFIG_DRM=m
+# 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=m
+CONFIG_FB_SYS_COPYAREA=m
+CONFIG_FB_SYS_IMAGEBLIT=m
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+CONFIG_FB_SYS_FOPS=m
+# CONFIG_FB_WMT_GE_ROPS is not set
+CONFIG_FB_DEFERRED_IO=y
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+CONFIG_FB_MODE_HELPERS=y
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_TMIO is not set
+CONFIG_FB_UDL=m
+# 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_OMAP_BOOTLOADER_INIT is not set
+CONFIG_OMAP2_VRAM=y
+CONFIG_OMAP2_VRFB=y
+CONFIG_OMAP2_DSS=y
+CONFIG_OMAP2_VRAM_SIZE=14
+CONFIG_OMAP2_DSS_DEBUG_SUPPORT=y
+# CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS is not set
+CONFIG_OMAP2_DSS_DPI=y
+# CONFIG_OMAP2_DSS_RFBI is not set
+CONFIG_OMAP2_DSS_VENC=y
+# CONFIG_OMAP2_DSS_SDI is not set
+CONFIG_OMAP2_DSS_DSI=y
+CONFIG_OMAP2_DSS_USE_DSI_PLL=y
+# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set
+CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=0
+CONFIG_FB_OMAP2=y
+CONFIG_FB_OMAP2_DEBUG_SUPPORT=y
+CONFIG_FB_OMAP2_NUM_FBS=2
+
+#
+# OMAP2/3 Display Device Drivers
+#
+CONFIG_PANEL_GENERIC_DPI=y
+# CONFIG_PANEL_LGPHILIPS_LB035Q02 is not set
+CONFIG_PANEL_SHARP_LS037V7DW01=y
+CONFIG_PANEL_NEC_NL8048HL11_01B=y
+# CONFIG_PANEL_TAAL is not set
+CONFIG_PANEL_TPO_TD043MTEA1=m
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+
+#
+# Display device support
+#
+CONFIG_DISPLAY_SUPPORT=y
+
+#
+# Display hardware drivers
+#
+
+#
+# Console display driver support
+#
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_LOGO_LINUX_CLUT224=y
+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_HWDEP=y
+CONFIG_SND_RAWMIDI=y
+CONFIG_SND_JACK=y
+CONFIG_SND_SEQUENCER=m
+# CONFIG_SND_SEQ_DUMMY is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=y
+CONFIG_SND_PCM_OSS=y
+CONFIG_SND_PCM_OSS_PLUGINS=y
+CONFIG_SND_SEQUENCER_OSS=y
+CONFIG_SND_HRTIMER=m
+CONFIG_SND_SEQ_HRTIMER_DEFAULT=y
+CONFIG_SND_DYNAMIC_MINORS=y
+CONFIG_SND_SUPPORT_OLD_API=y
+CONFIG_SND_VERBOSE_PROCFS=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+CONFIG_SND_RAWMIDI_SEQ=m
+# 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=y
+# CONFIG_SND_DUMMY is not set
+CONFIG_SND_ALOOP=m
+# CONFIG_SND_VIRMIDI is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+# CONFIG_SND_ARM is not set
+CONFIG_SND_SPI=y
+CONFIG_SND_USB=y
+CONFIG_SND_USB_AUDIO=y
+CONFIG_SND_USB_UA101=m
+CONFIG_SND_USB_CAIAQ=m
+CONFIG_SND_USB_CAIAQ_INPUT=y
+CONFIG_SND_USB_6FIRE=m
+CONFIG_SND_SOC=y
+CONFIG_SND_SOC_CACHE_LZO=y
+CONFIG_SND_OMAP_SOC=y
+CONFIG_SND_OMAP_SOC_MCBSP=y
+CONFIG_SND_OMAP_SOC_OVERO=y
+CONFIG_SND_OMAP_SOC_OMAP3EVM=y
+CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE=y
+CONFIG_SND_OMAP_SOC_ZOOM2=y
+CONFIG_SND_SOC_I2C_AND_SPI=y
+# CONFIG_SND_SOC_ALL_CODECS is not set
+CONFIG_SND_SOC_TWL4030=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=m
+# 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 is not set
+CONFIG_HID_EMS_FF=m
+# CONFIG_HID_ELECOM is not set
+CONFIG_HID_EZKEY=y
+CONFIG_HID_KEYTOUCH=m
+# CONFIG_HID_KYE is not set
+CONFIG_HID_UCLOGIC=m
+CONFIG_HID_WALTOP=m
+CONFIG_HID_GYRATION=y
+# CONFIG_HID_TWINHAN is not set
+# CONFIG_HID_KENSINGTON is not set
+CONFIG_HID_LCPOWER=m
+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=m
+CONFIG_HID_MICROSOFT=y
+# CONFIG_HID_MOSART is not set
+CONFIG_HID_MONTEREY=y
+CONFIG_HID_MULTITOUCH=m
+CONFIG_HID_NTRIG=y
+# CONFIG_HID_ORTEK is not set
+CONFIG_HID_PANTHERLORD=y
+# CONFIG_PANTHERLORD_FF is not set
+CONFIG_HID_PETALYNX=y
+CONFIG_HID_PICOLCD=m
+CONFIG_HID_PICOLCD_FB=y
+CONFIG_HID_PICOLCD_BACKLIGHT=y
+CONFIG_HID_PICOLCD_LEDS=y
+CONFIG_HID_QUANTA=m
+CONFIG_HID_ROCCAT=m
+CONFIG_HID_ROCCAT_COMMON=m
+CONFIG_HID_ROCCAT_ARVO=m
+CONFIG_HID_ROCCAT_KONE=m
+CONFIG_HID_ROCCAT_KONEPLUS=m
+CONFIG_HID_ROCCAT_KOVAPLUS=m
+# CONFIG_HID_ROCCAT_PYRA is not set
+CONFIG_HID_SAMSUNG=y
+CONFIG_HID_SONY=y
+CONFIG_HID_STANTUM=m
+CONFIG_HID_SUNPLUS=y
+# CONFIG_HID_GREENASIA is not set
+# CONFIG_HID_SMARTJOYPLUS is not set
+CONFIG_HID_TOPSEED=y
+# CONFIG_HID_THRUSTMASTER is not set
+# CONFIG_HID_WACOM is not set
+# CONFIG_HID_ZEROPLUS 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=y
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_DEVICE_CLASS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+CONFIG_USB_SUSPEND=y
+CONFIG_USB_OTG=y
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+CONFIG_USB_MON=y
+# 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_EHCI_HCD=y
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+CONFIG_USB_EHCI_TT_NEWSCHED=y
+CONFIG_USB_EHCI_HCD_OMAP=y
+# 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 is not set
+# CONFIG_USB_U132_HCD is not set
+# 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=y
+# CONFIG_USB_MUSB_TUSB6010 is not set
+CONFIG_USB_MUSB_OMAP2PLUS=y
+# CONFIG_USB_MUSB_AM35X is not set
+# CONFIG_USB_MUSB_HOST is not set
+# CONFIG_USB_MUSB_PERIPHERAL is not set
+CONFIG_USB_MUSB_OTG=y
+CONFIG_USB_GADGET_MUSB_HDRC=y
+CONFIG_USB_MUSB_HDRC_HCD=y
+# CONFIG_MUSB_PIO_ONLY is not set
+CONFIG_USB_INVENTRA_DMA=y
+# CONFIG_USB_TI_CPPI_DMA is not set
+# CONFIG_USB_MUSB_DEBUG is not set
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+CONFIG_USB_WDM=m
+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=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+CONFIG_USB_STORAGE_REALTEK=m
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_ONETOUCH is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
+CONFIG_USB_STORAGE_ENE_UB6250=m
+CONFIG_USB_UAS=m
+# 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=m
+CONFIG_USB_SERIAL_WHITEHEAT=n
+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=m
+CONFIG_USB_SERIAL_KEYSPAN_PDA=m
+CONFIG_USB_SERIAL_KEYSPAN=m
+CONFIG_USB_SERIAL_KEYSPAN_MPR=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19=y
+CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
+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=m
+CONFIG_USB_SERIAL_NAVMAN=m
+CONFIG_USB_SERIAL_PL2303=m
+CONFIG_USB_SERIAL_OTI6858=m
+CONFIG_USB_SERIAL_QCAUX=m
+# CONFIG_USB_SERIAL_QUALCOMM is not set
+CONFIG_USB_SERIAL_SPCP8X5=m
+CONFIG_USB_SERIAL_HP4X=m
+CONFIG_USB_SERIAL_SAFE=m
+# CONFIG_USB_SERIAL_SAFE_PADDED is not set
+CONFIG_USB_SERIAL_SAMBA=m
+CONFIG_USB_SERIAL_SIEMENS_MPI=m
+CONFIG_USB_SERIAL_SIERRAWIRELESS=m
+# CONFIG_USB_SERIAL_SYMBOL is not set
+CONFIG_USB_SERIAL_TI=n
+CONFIG_USB_SERIAL_CYBERJACK=m
+CONFIG_USB_SERIAL_XIRCOM=n
+# CONFIG_USB_SERIAL_OPTION is not set
+CONFIG_USB_SERIAL_OMNINET=m
+CONFIG_USB_SERIAL_OPTICON=m
+CONFIG_USB_SERIAL_VIVOPAY_SERIAL=m
+CONFIG_USB_SERIAL_ZIO=m
+CONFIG_USB_SERIAL_SSU100=m
+CONFIG_USB_SERIAL_DEBUG=m
+
+#
+# USB Miscellaneous drivers
+#
+CONFIG_USB_EMI62=m
+CONFIG_USB_EMI26=m
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_SEVSEG is not set
+# CONFIG_USB_RIO500 is not set
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+CONFIG_USB_LED=m
+CONFIG_USB_CYPRESS_CY7C63=m
+CONFIG_USB_CYTHERM=m
+CONFIG_USB_IDMOUSE=m
+CONFIG_USB_FTDI_ELAN=m
+# CONFIG_USB_APPLEDISPLAY is not set
+CONFIG_USB_SISUSBVGA=m
+CONFIG_USB_SISUSBVGA_CON=y
+CONFIG_USB_LD=m
+CONFIG_USB_TRANCEVIBRATOR=m
+# CONFIG_USB_IOWARRIOR is not set
+CONFIG_USB_TEST=m
+# CONFIG_USB_ISIGHTFW is not set
+CONFIG_USB_YUREX=m
+CONFIG_USB_ATM=m
+CONFIG_USB_SPEEDTOUCH=m
+CONFIG_USB_CXACRU=m
+CONFIG_USB_UEAGLEATM=m
+CONFIG_USB_XUSBATM=m
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG is not set
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_DEBUG_FS=y
+CONFIG_USB_GADGET_VBUS_DRAW=480
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_FUSB300 is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_R8A66597 is not set
+# CONFIG_USB_GADGET_PXA_U2O is not set
+# CONFIG_USB_GADGET_M66592 is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+# 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_G_NCM=m
+# CONFIG_USB_GADGETFS is not set
+CONFIG_USB_FUNCTIONFS=m
+# CONFIG_USB_FUNCTIONFS_ETH is not set
+CONFIG_USB_FUNCTIONFS_RNDIS=y
+# CONFIG_USB_FUNCTIONFS_GENERIC 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=m
+CONFIG_USB_G_DBGP=m
+# CONFIG_USB_G_DBGP_PRINTK is not set
+CONFIG_USB_G_DBGP_SERIAL=y
+CONFIG_USB_G_WEBCAM=m
+
+#
+# OTG and related infrastructure
+#
+CONFIG_USB_OTG_UTILS=y
+CONFIG_USB_GPIO_VBUS=y
+# CONFIG_ISP1301_OMAP is not set
+# CONFIG_USB_ULPI is not set
+CONFIG_TWL4030_USB=y
+CONFIG_TWL6030_USB=m
+CONFIG_NOP_USB_XCEIV=y
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+CONFIG_MMC_UNSAFE_RESUME=y
+# CONFIG_MMC_CLKGATE is not set
+
+#
+# MMC/SD/SDIO Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_MINORS=8
+CONFIG_MMC_BLOCK_BOUNCE=y
+CONFIG_SDIO_UART=y
+# CONFIG_MMC_TEST is not set
+
+#
+# MMC/SD/SDIO Host Controller Drivers
+#
+# CONFIG_MMC_SDHCI is not set
+# CONFIG_MMC_OMAP is not set
+CONFIG_MMC_OMAP_HS=y
+CONFIG_MMC_SPI=m
+# CONFIG_MMC_DW is not set
+CONFIG_MMC_USHC=m
+# CONFIG_MEMSTICK is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+# CONFIG_LEDS_LM3530 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=m
+CONFIG_LEDS_LP5523=m
+# 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=y
+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_NFC_DEVICES=y
+CONFIG_PN544_NFC=m
+# 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=y
+# 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=m
+CONFIG_RTC_DRV_TWL4030=m
+# 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
+
+#
+# on-CPU RTC drivers
+#
+# CONFIG_DMADEVICES is not set
+CONFIG_TIMB_DMA=m
+CONFIG_DMA_ENGINE=y
+# CONFIG_AUXDISPLAY is not set
+CONFIG_UIO=m
+CONFIG_UIO_PDRV=m
+CONFIG_UIO_PDRV_GENIRQ=m
+CONFIG_STAGING=y
+# CONFIG_STAGING_EXCLUDE_BUILD is not set
+# CONFIG_VIDEO_TM6000 is not set
+# CONFIG_USB_IP_COMMON is not set
+CONFIG_W35UND=m
+CONFIG_PRISM2_USB=m
+CONFIG_ECHO=m
+CONFIG_BRCM80211=m
+CONFIG_BRCMFMAC=y
+# CONFIG_BRCMDBG is not set
+CONFIG_RT2870=m
+# CONFIG_COMEDI is not set
+# CONFIG_ASUS_OLED is not set
+CONFIG_R8712U=m
+CONFIG_R8712_AP=y
+# CONFIG_TRANZPORT is not set
+# CONFIG_POHMELFS is not set
+# CONFIG_LINE6_USB is not set
+# CONFIG_USB_SERIAL_QUATECH2 is not set
+# CONFIG_USB_SERIAL_QUATECH_USB2 is not set
+# CONFIG_VT6656 is not set
+# CONFIG_IIO is not set
+CONFIG_XVMALLOC=y
+CONFIG_ZRAM=m
+# CONFIG_ZRAM_DEBUG is not set
+# CONFIG_FB_SM7XX is not set
+# CONFIG_LIRC_STAGING is not set
+# CONFIG_EASYCAP is not set
+# CONFIG_TIDSPBRIDGE is not set
+# CONFIG_MACH_OMAP3_WESTBRIDGE_AST_PNAND_HAL is not set
+CONFIG_MACH_NO_WESTBRIDGE=y
+# CONFIG_ATH6K_LEGACY is not set
+CONFIG_USB_ENESTORAGE=m
+CONFIG_BCM_WIMAX=m
+CONFIG_FT1000=m
+CONFIG_FT1000_USB=m
+
+#
+# Speakup console speech
+#
+# CONFIG_SPEAKUP is not set
+CONFIG_TOUCHSCREEN_CLEARPAD_TM1217=m
+CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4=m
+
+#
+# Altera FPGA firmware download module
+#
+# CONFIG_ALTERA_STAPL is not set
+CONFIG_CLKDEV_LOOKUP=y
+
+#
+# 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=y
+CONFIG_EXT4_FS_XATTR=y
+# CONFIG_EXT4_FS_POSIX_ACL is not set
+# CONFIG_EXT4_FS_SECURITY is not set
+# CONFIG_EXT4_DEBUG is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_JBD2=y
+# CONFIG_JBD2_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+CONFIG_REISERFS_PROC_INFO=y
+CONFIG_REISERFS_FS_XATTR=y
+# CONFIG_REISERFS_FS_POSIX_ACL is not set
+# CONFIG_REISERFS_FS_SECURITY is not set
+CONFIG_JFS_FS=m
+# CONFIG_JFS_POSIX_ACL is not set
+# CONFIG_JFS_SECURITY is not set
+# CONFIG_JFS_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+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_GFS2_FS=m
+# CONFIG_GFS2_FS_LOCKING_DLM is not set
+CONFIG_OCFS2_FS=m
+CONFIG_OCFS2_FS_O2CB=m
+CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m
+CONFIG_OCFS2_FS_STATS=y
+CONFIG_OCFS2_DEBUG_MASKLOG=y
+# CONFIG_OCFS2_DEBUG_FS is not set
+CONFIG_BTRFS_FS=m
+# CONFIG_BTRFS_FS_POSIX_ACL is not set
+# CONFIG_NILFS2_FS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_EXPORTFS=y
+CONFIG_FILE_LOCKING=y
+CONFIG_FSNOTIFY=y
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY_USER=y
+CONFIG_FANOTIFY=y
+CONFIG_QUOTA=y
+# CONFIG_QUOTA_NETLINK_INTERFACE is not set
+CONFIG_PRINT_QUOTA_WARNING=y
+# CONFIG_QUOTA_DEBUG is not set
+CONFIG_QUOTA_TREE=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTACTL=y
+CONFIG_AUTOFS4_FS=m
+CONFIG_FUSE_FS=m
+# CONFIG_CUSE is not set
+CONFIG_GENERIC_ACL=y
+
+#
+# Caches
+#
+# CONFIG_FSCACHE is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_NTFS_FS=m
+# CONFIG_NTFS_DEBUG is not set
+CONFIG_NTFS_RW=y
+
+#
+# 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=m
+# CONFIG_ADFS_FS_RW is not set
+CONFIG_AFFS_FS=m
+# CONFIG_ECRYPT_FS is not set
+CONFIG_UNION_FS=m
+CONFIG_UNION_FS_XATTR=y
+# CONFIG_UNION_FS_DEBUG is not set
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+CONFIG_BEFS_FS=m
+# CONFIG_BEFS_DEBUG is not set
+CONFIG_BFS_FS=m
+CONFIG_EFS_FS=m
+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=y
+CONFIG_JFFS2_FS_POSIX_ACL=y
+CONFIG_JFFS2_FS_SECURITY=y
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RTIME=y
+CONFIG_JFFS2_RUBIN=y
+# CONFIG_JFFS2_CMODE_NONE is not set
+# CONFIG_JFFS2_CMODE_PRIORITY is not set
+# CONFIG_JFFS2_CMODE_SIZE is not set
+CONFIG_JFFS2_CMODE_FAVOURLZO=y
+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=m
+CONFIG_CRAMFS=m
+CONFIG_SQUASHFS=y
+# CONFIG_SQUASHFS_XATTR is not set
+CONFIG_SQUASHFS_LZO=y
+CONFIG_SQUASHFS_XZ=y
+# CONFIG_SQUASHFS_EMBEDDED is not set
+CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
+CONFIG_VXFS_FS=m
+CONFIG_MINIX_FS=m
+CONFIG_OMFS_FS=m
+CONFIG_HPFS_FS=m
+CONFIG_QNX4FS_FS=m
+CONFIG_ROMFS_FS=m
+CONFIG_ROMFS_BACKED_BY_BLOCK=y
+# CONFIG_ROMFS_BACKED_BY_MTD is not set
+# CONFIG_ROMFS_BACKED_BY_BOTH is not set
+CONFIG_ROMFS_ON_BLOCK=y
+CONFIG_PSTORE=y
+CONFIG_SYSV_FS=m
+CONFIG_UFS_FS=m
+# CONFIG_UFS_FS_WRITE is not set
+# CONFIG_UFS_DEBUG is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+CONFIG_NFS_V4=y
+# CONFIG_NFS_V4_1 is not set
+CONFIG_ROOT_NFS=y
+# 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=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_ACL_SUPPORT=m
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_RPCSEC_GSS_KRB5=m
+CONFIG_CEPH_FS=m
+CONFIG_CIFS=m
+CONFIG_CIFS_STATS=y
+CONFIG_CIFS_STATS2=y
+# 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=y
+CONFIG_NCP_FS=m
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_NCPFS_EXTRAS is not set
+CONFIG_CODA_FS=m
+CONFIG_AFS_FS=m
+# CONFIG_AFS_DEBUG is not set
+CONFIG_9P_FS=m
+# CONFIG_9P_FS_POSIX_ACL 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=y
+CONFIG_MSDOS_PARTITION=y
+CONFIG_BSD_DISKLABEL=y
+CONFIG_MINIX_SUBPARTITION=y
+CONFIG_SOLARIS_X86_PARTITION=y
+# CONFIG_UNIXWARE_DISKLABEL is not set
+CONFIG_LDM_PARTITION=y
+CONFIG_LDM_DEBUG=y
+# 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=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=y
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=y
+CONFIG_DLM=m
+# CONFIG_DLM_DEBUG is not set
+
+#
+# Kernel hacking
+#
+CONFIG_PRINTK_TIME=y
+CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_STRIP_ASM_SYMS is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_SECTION_MISMATCH is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+# CONFIG_LOCKUP_DETECTOR is not set
+# CONFIG_HARDLOCKUP_DETECTOR is not set
+CONFIG_DETECT_HUNG_TASK=y
+# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
+CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
+CONFIG_SCHED_DEBUG=y
+CONFIG_SCHEDSTATS=y
+CONFIG_TIMER_STATS=y
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_KMEMLEAK is not set
+CONFIG_DEBUG_PREEMPT=y
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+CONFIG_DEBUG_MUTEXES=y
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_SPARSE_RCU_POINTER is not set
+# CONFIG_LOCK_STAT is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_TEST_LIST_SORT is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+# CONFIG_DEBUG_CREDENTIALS is not set
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
+# CONFIG_LKDTM is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_LATENCYTOP is not set
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+# CONFIG_DEBUG_PAGEALLOC is not set
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_RING_BUFFER=y
+CONFIG_RING_BUFFER_ALLOW_SWAP=y
+CONFIG_TRACING_SUPPORT=y
+CONFIG_FTRACE=y
+# CONFIG_FUNCTION_TRACER is not set
+# CONFIG_IRQSOFF_TRACER is not set
+# CONFIG_PREEMPT_TRACER is not set
+# CONFIG_SCHED_TRACER is not set
+# CONFIG_ENABLE_DEFAULT_TRACERS is not set
+CONFIG_BRANCH_PROFILE_NONE=y
+# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
+# CONFIG_PROFILE_ALL_BRANCHES is not set
+# CONFIG_STACK_TRACER is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_RING_BUFFER_BENCHMARK is not set
+# CONFIG_DYNAMIC_DEBUG is not set
+# CONFIG_DMA_API_DEBUG is not set
+# CONFIG_ATOMIC64_SELFTEST is not set
+# CONFIG_ASYNC_RAID6_TEST is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+# CONFIG_TEST_KSTRTOX is not set
+# CONFIG_STRICT_DEVMEM is not set
+CONFIG_ARM_UNWIND=y
+# CONFIG_DEBUG_USER is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_LL is not set
+# CONFIG_OC_ETM is not set
+
+#
+# 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_XOR_BLOCKS=m
+CONFIG_ASYNC_CORE=m
+CONFIG_ASYNC_MEMCPY=m
+CONFIG_ASYNC_XOR=m
+CONFIG_ASYNC_PQ=m
+CONFIG_ASYNC_RAID6_RECOV=m
+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=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG=m
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_PCOMP2=y
+CONFIG_CRYPTO_MANAGER=y
+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=m
+CONFIG_CRYPTO_AUTHENC=m
+CONFIG_CRYPTO_TEST=m
+
+#
+# Authenticated Encryption with Associated Data
+#
+CONFIG_CRYPTO_CCM=m
+CONFIG_CRYPTO_GCM=m
+CONFIG_CRYPTO_SEQIV=m
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+CONFIG_CRYPTO_CTR=m
+CONFIG_CRYPTO_CTS=m
+CONFIG_CRYPTO_ECB=y
+CONFIG_CRYPTO_LRW=m
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_XTS=m
+
+#
+# Hash modes
+#
+CONFIG_CRYPTO_HMAC=m
+CONFIG_CRYPTO_XCBC=m
+# CONFIG_CRYPTO_VMAC is not set
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=y
+CONFIG_CRYPTO_GHASH=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_MICHAEL_MIC=y
+CONFIG_CRYPTO_RMD128=m
+CONFIG_CRYPTO_RMD160=m
+CONFIG_CRYPTO_RMD256=m
+CONFIG_CRYPTO_RMD320=m
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_WP512=m
+
+#
+# Ciphers
+#
+CONFIG_CRYPTO_AES=y
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_ARC4=y
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_DES=y
+CONFIG_CRYPTO_FCRYPT=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_SALSA20=m
+CONFIG_CRYPTO_SEED=m
+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 is not set
+CONFIG_CRYPTO_LZO=y
+
+#
+# Random Number Generation
+#
+CONFIG_CRYPTO_ANSI_CPRNG=m
+CONFIG_CRYPTO_USER_API=m
+CONFIG_CRYPTO_USER_API_HASH=m
+CONFIG_CRYPTO_USER_API_SKCIPHER=m
+CONFIG_CRYPTO_HW=y
+CONFIG_CRYPTO_DEV_OMAP_SHAM=m
+CONFIG_CRYPTO_DEV_OMAP_AES=m
+# CONFIG_BINARY_PRINTF is not set
+
+#
+# Library routines
+#
+CONFIG_RAID6_PQ=m
+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_XZ_DEC=y
+CONFIG_XZ_DEC_X86=y
+CONFIG_XZ_DEC_POWERPC=y
+CONFIG_XZ_DEC_IA64=y
+CONFIG_XZ_DEC_ARM=y
+CONFIG_XZ_DEC_ARMTHUMB=y
+CONFIG_XZ_DEC_SPARC=y
+CONFIG_XZ_DEC_BCJ=y
+CONFIG_XZ_DEC_TEST=m
+CONFIG_DECOMPRESS_GZIP=y
+CONFIG_DECOMPRESS_XZ=y
+CONFIG_DECOMPRESS_LZO=y
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_TEXTSEARCH_BM=m
+CONFIG_TEXTSEARCH_FSM=m
+CONFIG_BTREE=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
+CONFIG_NLATTR=y
+CONFIG_AVERAGE=y
diff --git a/recipes/linux/linux-omap-2.6.39/beagleboard/defconfig b/recipes/linux/linux-omap-2.6.39/beagleboard/defconfig
new file mode 100644
index 0000000000..21d9f85587
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/beagleboard/defconfig
@@ -0,0 +1,3516 @@
+#
+# Automatically generated make config: don't edit
+# Linux/arm 2.6.39 Kernel Configuration
+# Mon May 30 11:05:51 2011
+#
+CONFIG_ARM=y
+CONFIG_HAVE_PWM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_HAVE_SCHED_CLOCK=y
+CONFIG_GENERIC_GPIO=y
+# CONFIG_ARCH_USES_GETTIMEOFFSET is not set
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_KTIME_SCALAR=y
+CONFIG_HAVE_PROC_CPU=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_VECTORS_BASE=0xffff0000
+# CONFIG_ARM_PATCH_PHYS_VIRT is not set
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_CONSTRUCTORS=y
+CONFIG_HAVE_IRQ_WORK=y
+CONFIG_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=y
+CONFIG_POSIX_MQUEUE_SYSCTL=y
+CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+CONFIG_FHANDLE=y
+CONFIG_TASKSTATS=y
+CONFIG_TASK_DELAY_ACCT=y
+CONFIG_TASK_XACCT=y
+CONFIG_TASK_IO_ACCOUNTING=y
+# CONFIG_AUDIT is not set
+CONFIG_HAVE_GENERIC_HARDIRQS=y
+
+#
+# IRQ subsystem
+#
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_HAVE_SPARSE_IRQ=y
+CONFIG_GENERIC_IRQ_SHOW=y
+# CONFIG_SPARSE_IRQ is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_TINY_RCU=y
+# CONFIG_PREEMPT_RCU is not set
+# CONFIG_RCU_TRACE is not set
+# CONFIG_TREE_RCU_TRACE is not set
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=16
+CONFIG_CGROUPS=y
+# CONFIG_CGROUP_DEBUG is not set
+CONFIG_CGROUP_NS=y
+CONFIG_CGROUP_FREEZER=y
+CONFIG_CGROUP_DEVICE=y
+CONFIG_CPUSETS=y
+CONFIG_PROC_PID_CPUSET=y
+CONFIG_CGROUP_CPUACCT=y
+CONFIG_RESOURCE_COUNTERS=y
+CONFIG_CGROUP_MEM_RES_CTLR=y
+CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y
+CONFIG_CGROUP_MEM_RES_CTLR_SWAP_ENABLED=y
+CONFIG_CGROUP_PERF=y
+CONFIG_CGROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_RT_GROUP_SCHED=y
+CONFIG_BLK_CGROUP=y
+# CONFIG_DEBUG_BLK_CGROUP is not set
+CONFIG_NAMESPACES=y
+CONFIG_UTS_NS=y
+CONFIG_IPC_NS=y
+CONFIG_USER_NS=y
+CONFIG_PID_NS=y
+CONFIG_NET_NS=y
+CONFIG_SCHED_AUTOGROUP=y
+CONFIG_MM_OWNER=y
+# CONFIG_SYSFS_DEPRECATED is not set
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_RD_GZIP=y
+CONFIG_RD_BZIP2=y
+CONFIG_RD_LZMA=y
+CONFIG_RD_XZ=y
+CONFIG_RD_LZO=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_EXPERT=y
+CONFIG_UID16=y
+# CONFIG_SYSCTL_SYSCALL is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# 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_EMBEDDED=y
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_PERF_USE_VMALLOC=y
+
+#
+# Kernel Performance Events And Counters
+#
+CONFIG_PERF_EVENTS=y
+# CONFIG_PERF_COUNTERS is not set
+# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
+CONFIG_VM_EVENT_COUNTERS=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+CONFIG_PROFILING=y
+CONFIG_OPROFILE=y
+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
+CONFIG_HAVE_DMA_API_DEBUG=y
+CONFIG_HAVE_HW_BREAKPOINT=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=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+CONFIG_MODULE_SRCVERSION_ALL=y
+CONFIG_BLOCK=y
+CONFIG_LBDAF=y
+CONFIG_BLK_DEV_BSG=y
+CONFIG_BLK_DEV_INTEGRITY=y
+CONFIG_BLK_DEV_THROTTLING=y
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_CFQ_GROUP_IOSCHED=y
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+# 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_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_MXS 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 is not set
+# 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_EXYNOS4 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_TCC_926 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=y
+# CONFIG_PLAT_SPEAR is not set
+# CONFIG_ARCH_VT8500 is not set
+# CONFIG_GPIO_PCA953X is not set
+# CONFIG_KEYBOARD_GPIO_POLLED is not set
+
+#
+# TI OMAP Common Features
+#
+CONFIG_ARCH_OMAP_OTG=y
+# CONFIG_ARCH_OMAP1 is not set
+CONFIG_ARCH_OMAP2PLUS=y
+
+#
+# OMAP Feature Selections
+#
+CONFIG_OMAP_SMARTREFLEX=y
+CONFIG_OMAP_SMARTREFLEX_CLASS3=y
+CONFIG_OMAP_RESET_CLOCKS=y
+# CONFIG_OMAP_MUX is not set
+CONFIG_OMAP_MCBSP=y
+CONFIG_OMAP_MBOX_FWK=m
+CONFIG_OMAP_MBOX_KFIFO_SIZE=256
+CONFIG_OMAP_IOMMU=y
+CONFIG_OMAP_IOMMU_DEBUG=m
+CONFIG_OMAP_32K_TIMER=y
+# CONFIG_OMAP3_L2_AUX_SECURE_SAVE_RESTORE is not set
+CONFIG_OMAP_32K_TIMER_HZ=128
+CONFIG_OMAP_DM_TIMER=y
+# CONFIG_OMAP_PM_NONE is not set
+CONFIG_OMAP_PM_NOOP=y
+
+#
+# TI OMAP2/3/4 Specific Features
+#
+CONFIG_ARCH_OMAP2PLUS_TYPICAL=y
+# CONFIG_ARCH_OMAP2 is not set
+CONFIG_ARCH_OMAP3=y
+# CONFIG_ARCH_OMAP4 is not set
+CONFIG_SOC_OMAP3430=y
+# CONFIG_SOC_OMAPTI816X is not set
+CONFIG_OMAP_PACKAGE_CBB=y
+
+#
+# OMAP Board Type
+#
+CONFIG_MACH_OMAP3_BEAGLE=y
+# CONFIG_MACH_DEVKIT8000 is not set
+# CONFIG_MACH_OMAP_LDP is not set
+# CONFIG_MACH_OMAP3530_LV_SOM is not set
+# CONFIG_MACH_OMAP3_TORPEDO is not set
+CONFIG_MACH_OVERO=y
+CONFIG_MACH_OMAP3EVM=y
+# CONFIG_MACH_OMAP3517EVM is not set
+# CONFIG_MACH_CRANEBOARD is not set
+# CONFIG_MACH_OMAP3_PANDORA is not set
+CONFIG_MACH_OMAP3_TOUCHBOOK=y
+# CONFIG_MACH_OMAP_3430SDP is not set
+# CONFIG_MACH_NOKIA_RM680 is not set
+# CONFIG_MACH_NOKIA_RX51 is not set
+CONFIG_MACH_OMAP_ZOOM2=y
+# CONFIG_MACH_OMAP_ZOOM3 is not set
+# CONFIG_MACH_CM_T35 is not set
+# CONFIG_MACH_CM_T3517 is not set
+# CONFIG_MACH_IGEP0020 is not set
+# CONFIG_MACH_IGEP0030 is not set
+# CONFIG_MACH_SBC3530 is not set
+# CONFIG_MACH_OMAP_3630SDP is not set
+# CONFIG_OMAP3_EMU is not set
+# CONFIG_OMAP3_SDRC_AC_TIMING is not set
+
+#
+# System MMU
+#
+
+#
+# Processor Type
+#
+CONFIG_CPU_V7=y
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV7=y
+CONFIG_CPU_PABRT_V7=y
+CONFIG_CPU_CACHE_V7=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_TLB_V7=y
+CONFIG_CPU_HAS_ASID=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+CONFIG_ARM_THUMBEE=y
+# CONFIG_SWP_EMULATE is not set
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+CONFIG_ARM_L1_CACHE_SHIFT_6=y
+CONFIG_ARM_L1_CACHE_SHIFT=6
+CONFIG_ARM_DMA_MEM_BUFFERABLE=y
+CONFIG_ARM_ERRATA_430973=y
+# CONFIG_ARM_ERRATA_458693 is not set
+# CONFIG_ARM_ERRATA_460075 is not set
+# CONFIG_ARM_ERRATA_743622 is not set
+# CONFIG_ARM_ERRATA_754322 is not set
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+# CONFIG_PREEMPT_NONE is not set
+CONFIG_PREEMPT_VOLUNTARY=y
+# CONFIG_PREEMPT is not set
+CONFIG_HZ=128
+# CONFIG_THUMB2_KERNEL is not set
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+CONFIG_ARCH_HAS_HOLES_MEMORYMODEL=y
+# 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=4
+CONFIG_COMPACTION=y
+CONFIG_MIGRATION=y
+# 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_LEDS=y
+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=" debug "
+# CONFIG_CMDLINE_FORCE is not set
+# CONFIG_XIP_KERNEL is not set
+CONFIG_KEXEC=y
+CONFIG_ATAGS_PROC=y
+# CONFIG_CRASH_DUMP is not set
+CONFIG_AUTO_ZRELADDR=y
+
+#
+# CPU Power Management
+#
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=y
+# CONFIG_CPU_FREQ_DEBUG is not set
+CONFIG_CPU_FREQ_STAT=y
+CONFIG_CPU_FREQ_STAT_DETAILS=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_HOTPLUG is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=y
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
+CONFIG_CPU_IDLE=y
+CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_IDLE_GOV_MENU=y
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_VFP=y
+CONFIG_VFPv3=y
+CONFIG_NEON=y
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_HAVE_AOUT=y
+CONFIG_BINFMT_AOUT=m
+CONFIG_BINFMT_MISC=y
+
+#
+# Power management options
+#
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+CONFIG_PM_SLEEP=y
+CONFIG_PM_RUNTIME=y
+CONFIG_PM=y
+CONFIG_PM_DEBUG=y
+# CONFIG_PM_VERBOSE is not set
+# CONFIG_PM_ADVANCED_DEBUG is not set
+# CONFIG_PM_TEST_SUSPEND is not set
+CONFIG_CAN_PM_TRACE=y
+# CONFIG_APM_EMULATION is not set
+CONFIG_ARCH_HAS_OPP=y
+CONFIG_PM_OPP=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
+CONFIG_XFRM_IPCOMP=m
+CONFIG_NET_KEY=y
+# CONFIG_NET_KEY_MIGRATE is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_ROUTE_CLASSID=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_RARP=y
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE_DEMUX=m
+CONFIG_NET_IPGRE=m
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+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=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+CONFIG_INET_LRO=y
+CONFIG_INET_DIAG=m
+CONFIG_INET_TCP_DIAG=m
+CONFIG_TCP_CONG_ADVANCED=y
+CONFIG_TCP_CONG_BIC=m
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+CONFIG_TCP_CONG_HSTCP=m
+CONFIG_TCP_CONG_HYBLA=m
+CONFIG_TCP_CONG_VEGAS=m
+CONFIG_TCP_CONG_SCALABLE=m
+CONFIG_TCP_CONG_LP=m
+CONFIG_TCP_CONG_VENO=m
+CONFIG_TCP_CONG_YEAH=m
+CONFIG_TCP_CONG_ILLINOIS=m
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+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=m
+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=m
+CONFIG_IPV6_SIT=m
+# CONFIG_IPV6_SIT_6RD is not set
+CONFIG_IPV6_NDISC_NODETYPE=y
+CONFIG_IPV6_TUNNEL=m
+CONFIG_IPV6_MULTIPLE_TABLES=y
+CONFIG_IPV6_SUBTREES=y
+CONFIG_IPV6_MROUTE=y
+CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y
+# CONFIG_IPV6_PIMSM_V2 is not set
+# CONFIG_NETWORK_SECMARK is not set
+CONFIG_NETWORK_PHY_TIMESTAMPING=y
+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_ZONES=y
+CONFIG_NF_CONNTRACK_EVENTS=y
+CONFIG_NF_CONNTRACK_TIMESTAMP=y
+CONFIG_NF_CT_PROTO_DCCP=m
+CONFIG_NF_CT_PROTO_GRE=m
+CONFIG_NF_CT_PROTO_SCTP=m
+CONFIG_NF_CT_PROTO_UDPLITE=m
+CONFIG_NF_CONNTRACK_AMANDA=m
+CONFIG_NF_CONNTRACK_FTP=m
+CONFIG_NF_CONNTRACK_H323=m
+CONFIG_NF_CONNTRACK_IRC=m
+CONFIG_NF_CONNTRACK_BROADCAST=m
+CONFIG_NF_CONNTRACK_NETBIOS_NS=m
+CONFIG_NF_CONNTRACK_SNMP=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
+CONFIG_NETFILTER_XT_SET=m
+
+#
+# Xtables targets
+#
+CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
+CONFIG_NETFILTER_XT_TARGET_CT=m
+# CONFIG_NETFILTER_XT_TARGET_DSCP is not set
+CONFIG_NETFILTER_XT_TARGET_HL=m
+CONFIG_NETFILTER_XT_TARGET_IDLETIMER=m
+# 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 is not set
+CONFIG_NETFILTER_XT_TARGET_RATEEST=m
+CONFIG_NETFILTER_XT_TARGET_TEE=m
+# 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_ADDRTYPE=m
+# CONFIG_NETFILTER_XT_MATCH_CLUSTER is not set
+CONFIG_NETFILTER_XT_MATCH_COMMENT=m
+CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
+CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
+CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
+CONFIG_NETFILTER_XT_MATCH_CPU=m
+CONFIG_NETFILTER_XT_MATCH_DCCP=m
+CONFIG_NETFILTER_XT_MATCH_DEVGROUP=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_IPVS=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=m
+CONFIG_NETFILTER_XT_MATCH_POLICY=m
+# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+CONFIG_NETFILTER_XT_MATCH_QUOTA=m
+CONFIG_NETFILTER_XT_MATCH_RATEEST=m
+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=m
+CONFIG_IP_SET=m
+CONFIG_IP_SET_MAX=256
+# CONFIG_IP_SET_BITMAP_IP is not set
+# CONFIG_IP_SET_BITMAP_IPMAC is not set
+# CONFIG_IP_SET_BITMAP_PORT is not set
+# CONFIG_IP_SET_HASH_IP is not set
+# CONFIG_IP_SET_HASH_IPPORT is not set
+# CONFIG_IP_SET_HASH_IPPORTIP is not set
+# CONFIG_IP_SET_HASH_IPPORTNET is not set
+# CONFIG_IP_SET_HASH_NET is not set
+# CONFIG_IP_SET_HASH_NETPORT is not set
+# CONFIG_IP_SET_LIST_SET is not set
+CONFIG_IP_VS=m
+CONFIG_IP_VS_IPV6=y
+CONFIG_IP_VS_DEBUG=y
+CONFIG_IP_VS_TAB_BITS=12
+
+#
+# IPVS transport protocol load balancing support
+#
+CONFIG_IP_VS_PROTO_TCP=y
+CONFIG_IP_VS_PROTO_UDP=y
+CONFIG_IP_VS_PROTO_AH_ESP=y
+CONFIG_IP_VS_PROTO_ESP=y
+CONFIG_IP_VS_PROTO_AH=y
+# CONFIG_IP_VS_PROTO_SCTP is not set
+
+#
+# IPVS scheduler
+#
+CONFIG_IP_VS_RR=m
+CONFIG_IP_VS_WRR=m
+CONFIG_IP_VS_LC=m
+CONFIG_IP_VS_WLC=m
+CONFIG_IP_VS_LBLC=m
+CONFIG_IP_VS_LBLCR=m
+CONFIG_IP_VS_DH=m
+CONFIG_IP_VS_SH=m
+CONFIG_IP_VS_SED=m
+CONFIG_IP_VS_NQ=m
+
+#
+# IPVS application helper
+#
+CONFIG_IP_VS_FTP=m
+CONFIG_IP_VS_NFCT=y
+CONFIG_IP_VS_PE_SIP=m
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_NF_DEFRAG_IPV4=m
+CONFIG_NF_CONNTRACK_IPV4=m
+CONFIG_NF_CONNTRACK_PROC_COMPAT=y
+CONFIG_IP_NF_QUEUE=m
+CONFIG_IP_NF_IPTABLES=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_DCCP=m
+CONFIG_NF_NAT_PROTO_GRE=m
+CONFIG_NF_NAT_PROTO_UDPLITE=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=m
+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=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+
+#
+# IPv6: Netfilter Configuration
+#
+CONFIG_NF_DEFRAG_IPV6=m
+CONFIG_NF_CONNTRACK_IPV6=m
+CONFIG_IP6_NF_QUEUE=m
+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=m
+# CONFIG_BRIDGE_NF_EBTABLES is not set
+CONFIG_IP_DCCP=m
+CONFIG_INET_DCCP_DIAG=m
+
+#
+# DCCP CCIDs Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP_CCID2_DEBUG is not set
+CONFIG_IP_DCCP_CCID3=y
+# CONFIG_IP_DCCP_CCID3_DEBUG is not set
+CONFIG_IP_DCCP_TFRC_LIB=y
+
+#
+# DCCP Kernel Hacking
+#
+# CONFIG_IP_DCCP_DEBUG is not set
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+# CONFIG_SCTP_HMAC_SHA1 is not set
+CONFIG_SCTP_HMAC_MD5=y
+# CONFIG_RDS is not set
+CONFIG_TIPC=m
+# CONFIG_TIPC_ADVANCED is not set
+# CONFIG_TIPC_DEBUG is not set
+CONFIG_ATM=m
+CONFIG_ATM_CLIP=m
+# CONFIG_ATM_CLIP_NO_ICMP is not set
+CONFIG_ATM_LANE=m
+CONFIG_ATM_MPOA=m
+CONFIG_ATM_BR2684=m
+# CONFIG_ATM_BR2684_IPFILTER is not set
+CONFIG_L2TP=m
+CONFIG_L2TP_DEBUGFS=m
+CONFIG_L2TP_V3=y
+CONFIG_L2TP_IP=m
+CONFIG_L2TP_ETH=m
+CONFIG_STP=m
+CONFIG_GARP=m
+CONFIG_BRIDGE=m
+CONFIG_BRIDGE_IGMP_SNOOPING=y
+# CONFIG_NET_DSA is not set
+CONFIG_VLAN_8021Q=m
+CONFIG_VLAN_8021Q_GVRP=y
+# 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=m
+# 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_ATM=m
+CONFIG_NET_SCH_PRIO=m
+CONFIG_NET_SCH_MULTIQ=m
+CONFIG_NET_SCH_RED=m
+# CONFIG_NET_SCH_SFB is not set
+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=m
+CONFIG_NET_SCH_MQPRIO=m
+CONFIG_NET_SCH_CHOKE=m
+
+#
+# Classification
+#
+CONFIG_NET_CLS=y
+CONFIG_NET_CLS_BASIC=m
+CONFIG_NET_CLS_TCINDEX=m
+CONFIG_NET_CLS_ROUTE4=m
+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=m
+CONFIG_NET_CLS_CGROUP=m
+# CONFIG_NET_EMATCH is not set
+# CONFIG_NET_CLS_ACT is not set
+CONFIG_NET_CLS_IND=y
+CONFIG_NET_SCH_FIFO=y
+# CONFIG_DCB is not set
+CONFIG_DNS_RESOLVER=y
+# CONFIG_BATMAN_ADV is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+CONFIG_CAN=m
+CONFIG_CAN_RAW=m
+CONFIG_CAN_BCM=m
+
+#
+# CAN Device Drivers
+#
+CONFIG_CAN_VCAN=m
+CONFIG_CAN_SLCAN=m
+# CONFIG_CAN_DEV is not set
+# CONFIG_CAN_DEBUG_DEVICES is not set
+CONFIG_IRDA=m
+
+#
+# IrDA protocols
+#
+CONFIG_IRLAN=m
+CONFIG_IRNET=m
+CONFIG_IRCOMM=m
+CONFIG_IRDA_ULTRA=y
+
+#
+# IrDA options
+#
+CONFIG_IRDA_CACHE_LAST_LSAP=y
+CONFIG_IRDA_FAST_RR=y
+CONFIG_IRDA_DEBUG=y
+
+#
+# Infrared-port device drivers
+#
+
+#
+# SIR device drivers
+#
+CONFIG_IRTTY_SIR=m
+
+#
+# Dongle support
+#
+CONFIG_DONGLE=y
+CONFIG_ESI_DONGLE=m
+CONFIG_ACTISYS_DONGLE=m
+CONFIG_TEKRAM_DONGLE=m
+CONFIG_TOIM3232_DONGLE=m
+CONFIG_LITELINK_DONGLE=m
+CONFIG_MA600_DONGLE=m
+CONFIG_GIRBIL_DONGLE=m
+CONFIG_MCP2120_DONGLE=m
+CONFIG_OLD_BELKIN_DONGLE=m
+# CONFIG_ACT200L_DONGLE is not set
+CONFIG_KINGSUN_DONGLE=m
+CONFIG_KSDAZZLE_DONGLE=m
+CONFIG_KS959_DONGLE=m
+
+#
+# FIR device drivers
+#
+CONFIG_USB_IRDA=m
+CONFIG_SIGMATEL_FIR=m
+CONFIG_MCS_FIR=m
+CONFIG_BT=y
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=m
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIBTUSB=y
+CONFIG_BT_HCIBTSDIO=m
+CONFIG_BT_HCIUART=y
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIUART_ATH3K=y
+CONFIG_BT_HCIUART_LL=y
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBPA10X=m
+CONFIG_BT_HCIBFUSB=m
+# CONFIG_BT_HCIVHCI is not set
+CONFIG_BT_MRVL=m
+# CONFIG_BT_MRVL_SDIO is not set
+CONFIG_BT_ATH3K=m
+CONFIG_BT_WILINK=m
+CONFIG_AF_RXRPC=m
+# CONFIG_AF_RXRPC_DEBUG is not set
+# CONFIG_RXKAD is not set
+CONFIG_FIB_RULES=y
+CONFIG_WIRELESS=y
+CONFIG_WIRELESS_EXT=y
+CONFIG_WEXT_CORE=y
+CONFIG_WEXT_PROC=y
+CONFIG_WEXT_SPY=y
+CONFIG_WEXT_PRIV=y
+CONFIG_CFG80211=m
+CONFIG_NL80211_TESTMODE=y
+# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
+# CONFIG_CFG80211_REG_DEBUG is not set
+CONFIG_CFG80211_DEFAULT_PS=y
+# CONFIG_CFG80211_DEBUGFS is not set
+# CONFIG_CFG80211_INTERNAL_REGDB is not set
+CONFIG_CFG80211_WEXT=y
+CONFIG_WIRELESS_EXT_SYSFS=y
+CONFIG_LIB80211=y
+CONFIG_LIB80211_CRYPT_WEP=m
+CONFIG_LIB80211_CRYPT_CCMP=m
+CONFIG_LIB80211_CRYPT_TKIP=m
+# CONFIG_LIB80211_DEBUG is not set
+CONFIG_MAC80211=m
+CONFIG_MAC80211_HAS_RC=y
+CONFIG_MAC80211_RC_PID=y
+# CONFIG_MAC80211_RC_MINSTREL is not set
+CONFIG_MAC80211_RC_DEFAULT_PID=y
+CONFIG_MAC80211_RC_DEFAULT="pid"
+# CONFIG_MAC80211_MESH is not set
+CONFIG_MAC80211_LEDS=y
+# CONFIG_MAC80211_DEBUGFS is not set
+# CONFIG_MAC80211_DEBUG_MENU is not set
+CONFIG_WIMAX=m
+CONFIG_WIMAX_DEBUG_LEVEL=8
+CONFIG_RFKILL=y
+CONFIG_RFKILL_LEDS=y
+CONFIG_RFKILL_INPUT=y
+CONFIG_NET_9P=m
+# CONFIG_NET_9P_DEBUG is not set
+# CONFIG_CAIF is not set
+CONFIG_CEPH_LIB=m
+# CONFIG_CEPH_LIB_PRETTYDEBUG 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=y
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# 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_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+# 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=m
+# CONFIG_MTD_OOPS is not set
+CONFIG_MTD_SWAP=m
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE 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_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS 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 is not set
+# CONFIG_MTD_NAND_ECC_BCH is not set
+# 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_OMAP2=y
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+CONFIG_MTD_NAND_PLATFORM=y
+# 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 is not set
+# 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=y
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+
+#
+# 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=16384
+# CONFIG_BLK_DEV_XIP is not set
+CONFIG_CDROM_PKTCDVD=m
+CONFIG_CDROM_PKTCDVD_BUFFERS=8
+# CONFIG_CDROM_PKTCDVD_WCACHE is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_MG_DISK is not set
+# CONFIG_BLK_DEV_RBD is not set
+# CONFIG_SENSORS_LIS3LV02D 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=m
+# CONFIG_SENSORS_BH1770 is not set
+# CONFIG_SENSORS_APDS990X is not set
+CONFIG_HMC6352=m
+# CONFIG_DS1682 is not set
+# CONFIG_TI_DAC7512 is not set
+CONFIG_BMP085=m
+# CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+CONFIG_EEPROM_AT24=m
+# CONFIG_EEPROM_AT25 is not set
+# CONFIG_EEPROM_LEGACY is not set
+# CONFIG_EEPROM_MAX6875 is not set
+CONFIG_EEPROM_93CX6=y
+CONFIG_IWMC3200TOP=m
+# CONFIG_IWMC3200TOP_DEBUG is not set
+# CONFIG_IWMC3200TOP_DEBUGFS is not set
+
+#
+# Texas Instruments shared transport line discipline
+#
+CONFIG_TI_ST=m
+# CONFIG_SENSORS_LIS3_SPI is not set
+# CONFIG_SENSORS_LIS3_I2C is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+CONFIG_SCSI_MOD=y
+CONFIG_RAID_ATTRS=m
+CONFIG_SCSI=y
+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=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+CONFIG_BLK_DEV_SR=y
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=y
+CONFIG_CHR_DEV_SCH=m
+CONFIG_SCSI_MULTI_LUN=y
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+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=m
+# 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=m
+CONFIG_ISCSI_BOOT_SYSFS=m
+# 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=y
+CONFIG_BLK_DEV_MD=m
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID10=m
+CONFIG_MD_RAID456=m
+CONFIG_MD_MULTIPATH=m
+CONFIG_MD_FAULTY=m
+CONFIG_BLK_DEV_DM=m
+# CONFIG_DM_DEBUG is not set
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_RAID=m
+# CONFIG_DM_LOG_USERSPACE is not set
+CONFIG_DM_ZERO=m
+CONFIG_DM_MULTIPATH=m
+# CONFIG_DM_MULTIPATH_QL is not set
+# CONFIG_DM_MULTIPATH_ST is not set
+CONFIG_DM_DELAY=m
+# CONFIG_DM_UEVENT is not set
+CONFIG_DM_FLAKEY=m
+CONFIG_TARGET_CORE=m
+CONFIG_TCM_IBLOCK=m
+CONFIG_TCM_FILEIO=m
+CONFIG_TCM_PSCSI=m
+CONFIG_LOOPBACK_TARGET=m
+# CONFIG_LOOPBACK_TARGET_CDB_DEBUG is not set
+CONFIG_NETDEVICES=y
+CONFIG_DUMMY=m
+CONFIG_BONDING=m
+CONFIG_MACVLAN=m
+CONFIG_MACVTAP=m
+CONFIG_EQUALIZER=m
+CONFIG_TUN=m
+CONFIG_VETH=m
+CONFIG_MII=y
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+CONFIG_BCM63XX_PHY=m
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+CONFIG_MICREL_PHY=m
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
+CONFIG_NET_ETHERNET=y
+# CONFIG_AX88796 is not set
+CONFIG_SMC91X=y
+# CONFIG_TI_DAVINCI_EMAC is not set
+CONFIG_TI_DAVINCI_MDIO=m
+CONFIG_TI_DAVINCI_CPDMA=m
+# CONFIG_DM9000 is not set
+CONFIG_ENC28J60=y
+# CONFIG_ENC28J60_WRITEVERIFY is not set
+# CONFIG_ETHOC is not set
+CONFIG_SMC911X=y
+CONFIG_SMSC911X=y
+# CONFIG_SMSC911X_ARCH_HOOKS is not set
+# CONFIG_DNET is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+# CONFIG_B44 is not set
+CONFIG_KS8842=m
+CONFIG_KS8851=y
+# CONFIG_KS8851_MLL is not set
+# CONFIG_FTMAC100 is not set
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+CONFIG_WLAN=y
+# CONFIG_LIBERTAS_THINFIRM is not set
+CONFIG_AT76C50X_USB=m
+CONFIG_USB_ZD1201=m
+CONFIG_USB_NET_RNDIS_WLAN=m
+CONFIG_RTL8187=m
+CONFIG_RTL8187_LEDS=y
+# CONFIG_MAC80211_HWSIM is not set
+# CONFIG_ATH_COMMON is not set
+CONFIG_B43=m
+# CONFIG_B43_SDIO is not set
+CONFIG_B43_PIO=y
+CONFIG_B43_PHY_N=y
+CONFIG_B43_PHY_LP=y
+CONFIG_B43_LEDS=y
+CONFIG_B43_HWRNG=y
+# CONFIG_B43_DEBUG is not set
+# CONFIG_B43LEGACY is not set
+CONFIG_HOSTAP=m
+CONFIG_HOSTAP_FIRMWARE=y
+CONFIG_HOSTAP_FIRMWARE_NVRAM=y
+# CONFIG_IWM is not set
+CONFIG_LIBERTAS=m
+CONFIG_LIBERTAS_USB=m
+# CONFIG_LIBERTAS_SDIO is not set
+# CONFIG_LIBERTAS_SPI is not set
+# CONFIG_LIBERTAS_DEBUG is not set
+# CONFIG_LIBERTAS_MESH is not set
+CONFIG_P54_COMMON=m
+CONFIG_P54_USB=m
+# CONFIG_P54_SPI is not set
+CONFIG_P54_LEDS=y
+CONFIG_RT2X00=m
+CONFIG_RT2500USB=m
+CONFIG_RT73USB=m
+# CONFIG_RT2800USB is not set
+CONFIG_RT2X00_LIB_USB=m
+CONFIG_RT2X00_LIB=m
+CONFIG_RT2X00_LIB_FIRMWARE=y
+CONFIG_RT2X00_LIB_CRYPTO=y
+CONFIG_RT2X00_LIB_LEDS=y
+# CONFIG_RT2X00_DEBUG is not set
+CONFIG_RTL8192CU=m
+CONFIG_RTLWIFI=m
+CONFIG_RTL8192C_COMMON=m
+CONFIG_WL1251=m
+CONFIG_WL1251_SPI=m
+CONFIG_WL1251_SDIO=m
+CONFIG_WL12XX_MENU=m
+CONFIG_WL12XX=m
+CONFIG_WL12XX_HT=y
+CONFIG_WL12XX_SPI=m
+CONFIG_WL12XX_SDIO=m
+# CONFIG_WL12XX_SDIO_TEST is not set
+CONFIG_WL12XX_PLATFORM_DATA=y
+CONFIG_ZD1211RW=m
+# CONFIG_ZD1211RW_DEBUG is not set
+
+#
+# WiMAX Wireless Broadband devices
+#
+CONFIG_WIMAX_I2400M=m
+CONFIG_WIMAX_I2400M_USB=m
+CONFIG_WIMAX_I2400M_SDIO=m
+CONFIG_WIMAX_IWMC3200_SDIO=y
+CONFIG_WIMAX_I2400M_DEBUG_LEVEL=8
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_CATC=y
+CONFIG_USB_KAWETH=y
+CONFIG_USB_PEGASUS=y
+CONFIG_USB_RTL8150=y
+CONFIG_USB_USBNET=y
+CONFIG_USB_NET_AX8817X=y
+CONFIG_USB_NET_CDCETHER=y
+# CONFIG_USB_NET_CDC_EEM is not set
+CONFIG_USB_NET_CDC_NCM=m
+CONFIG_USB_NET_DM9601=y
+CONFIG_USB_NET_SMSC75XX=m
+CONFIG_USB_NET_SMSC95XX=y
+CONFIG_USB_NET_GL620A=y
+CONFIG_USB_NET_NET1080=y
+CONFIG_USB_NET_PLUSB=y
+CONFIG_USB_NET_MCS7830=y
+CONFIG_USB_NET_RNDIS_HOST=y
+CONFIG_USB_NET_CDC_SUBSET=y
+CONFIG_USB_ALI_M5632=y
+CONFIG_USB_AN2720=y
+CONFIG_USB_BELKIN=y
+CONFIG_USB_ARMLINUX=y
+CONFIG_USB_EPSON2888=y
+CONFIG_USB_KC2190=y
+CONFIG_USB_NET_ZAURUS=y
+CONFIG_USB_NET_CX82310_ETH=m
+CONFIG_USB_HSO=m
+CONFIG_USB_NET_INT51X1=m
+CONFIG_USB_IPHETH=m
+CONFIG_USB_SIERRA_NET=m
+CONFIG_USB_VL600=m
+# CONFIG_WAN is not set
+CONFIG_ATM_DRIVERS=y
+# CONFIG_ATM_DUMMY is not set
+# CONFIG_ATM_TCP 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=m
+CONFIG_PPTP=m
+# CONFIG_PPPOATM is not set
+CONFIG_PPPOL2TP=m
+# CONFIG_SLIP is not set
+CONFIG_SLHC=m
+CONFIG_NETCONSOLE=m
+CONFIG_NETCONSOLE_DYNAMIC=y
+CONFIG_NETPOLL=y
+CONFIG_NETPOLL_TRAP=y
+CONFIG_NET_POLL_CONTROLLER=y
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+CONFIG_INPUT_FF_MEMLESS=y
+CONFIG_INPUT_POLLDEV=y
+# 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_QT1070=m
+CONFIG_KEYBOARD_QT2160=m
+# CONFIG_KEYBOARD_LKKBD is not set
+CONFIG_KEYBOARD_GPIO=y
+# 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=m
+# 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_TWL4030 is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
+# CONFIG_MOUSE_PS2_SENTELIC is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_BCM5974 is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_MOUSE_GPIO is not set
+# CONFIG_MOUSE_SYNAPTICS_I2C is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_AD714X=m
+CONFIG_INPUT_AD714X_I2C=m
+CONFIG_INPUT_AD714X_SPI=m
+# 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_TWL4030_PWRBUTTON=y
+CONFIG_INPUT_TWL4030_VIBRA=m
+CONFIG_INPUT_UINPUT=y
+CONFIG_INPUT_PCF8574=m
+CONFIG_INPUT_PWM_BEEPER=m
+# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
+CONFIG_INPUT_ADXL34X=m
+CONFIG_INPUT_ADXL34X_I2C=m
+CONFIG_INPUT_ADXL34X_SPI=m
+CONFIG_INPUT_CMA3000=m
+CONFIG_INPUT_CMA3000_I2C=m
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+CONFIG_SERIO_LIBPS2=y
+# 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_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+CONFIG_N_GSM=m
+CONFIG_DEVKMEM=y
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=32
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_8250_DETECT_IRQ=y
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_MAX3100 is not set
+# CONFIG_SERIAL_MAX3107 is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_OMAP=y
+CONFIG_SERIAL_OMAP_CONSOLE=y
+# CONFIG_SERIAL_TIMBERDALE is not set
+# CONFIG_SERIAL_ALTERA_JTAGUART is not set
+# CONFIG_SERIAL_ALTERA_UART is not set
+CONFIG_SERIAL_IFX6X60=m
+CONFIG_TTY_PRINTK=y
+# CONFIG_HVC_DCC is not set
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_HW_RANDOM_TIMERIOMEM 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=m
+
+#
+# Multiplexer I2C Chip support
+#
+CONFIG_I2C_MUX_GPIO=m
+# CONFIG_I2C_MUX_PCA9541 is not set
+# CONFIG_I2C_MUX_PCA954x is not set
+CONFIG_I2C_HELPER_AUTO=y
+CONFIG_I2C_ALGOBIT=m
+
+#
+# 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_OMAP=y
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_PXA_PCI is not set
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_XILINX is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+CONFIG_I2C_DIOLAN_U2C=m
+# 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_DEBUG is not set
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+# CONFIG_SPI_ALTERA is not set
+# CONFIG_SPI_BITBANG is not set
+# CONFIG_SPI_GPIO is not set
+# CONFIG_SPI_OC_TINY is not set
+CONFIG_SPI_OMAP24XX=y
+# CONFIG_SPI_PXA2XX_PCI is not set
+# CONFIG_SPI_XILINX is not set
+# CONFIG_SPI_DESIGNWARE is not set
+
+#
+# SPI Protocol Masters
+#
+CONFIG_SPI_SPIDEV=y
+# CONFIG_SPI_TLE62X0 is not set
+
+#
+# PPS support
+#
+# CONFIG_PPS is not set
+
+#
+# PPS generators support
+#
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_GPIOLIB=y
+# CONFIG_DEBUG_GPIO is not set
+CONFIG_GPIO_SYSFS=y
+CONFIG_GPIO_MAX730X=m
+
+#
+# Memory mapped GPIO expanders:
+#
+# CONFIG_GPIO_BASIC_MMIO is not set
+# CONFIG_GPIO_IT8761E is not set
+
+#
+# I2C GPIO expanders:
+#
+CONFIG_GPIO_MAX7300=m
+# CONFIG_GPIO_MAX732X is not set
+# CONFIG_GPIO_PCF857X is not set
+# CONFIG_GPIO_SX150X is not set
+CONFIG_GPIO_TWL4030=y
+CONFIG_GPIO_ADP5588=m
+
+#
+# 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=m
+# CONFIG_POWER_SUPPLY_DEBUG is not set
+# CONFIG_PDA_POWER is not set
+CONFIG_TEST_POWER=m
+# CONFIG_BATTERY_DS2782 is not set
+# CONFIG_BATTERY_BQ20Z75 is not set
+# CONFIG_BATTERY_BQ27x00 is not set
+# CONFIG_BATTERY_MAX17040 is not set
+CONFIG_BATTERY_MAX17042=m
+CONFIG_CHARGER_ISP1704=m
+CONFIG_CHARGER_TWL4030=m
+CONFIG_CHARGER_GPIO=m
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Native drivers
+#
+# CONFIG_SENSORS_AD7414 is not set
+# CONFIG_SENSORS_AD7418 is not set
+# CONFIG_SENSORS_ADCXX is not set
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1029 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ADM9240 is not set
+CONFIG_SENSORS_ADT7411=m
+# CONFIG_SENSORS_ADT7462 is not set
+# CONFIG_SENSORS_ADT7470 is not set
+# CONFIG_SENSORS_ADT7475 is not set
+CONFIG_SENSORS_ASC7621=m
+# CONFIG_SENSORS_ATXP1 is not set
+CONFIG_SENSORS_DS620=m
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_F75375S is not set
+# CONFIG_SENSORS_G760A is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+CONFIG_SENSORS_GPIO_FAN=m
+# CONFIG_SENSORS_IT87 is not set
+CONFIG_SENSORS_JC42=m
+# CONFIG_SENSORS_LINEAGE is not set
+# CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM70 is not set
+# CONFIG_SENSORS_LM73 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_LM93 is not set
+# CONFIG_SENSORS_LTC4151 is not set
+# CONFIG_SENSORS_LTC4215 is not set
+# CONFIG_SENSORS_LTC4245 is not set
+# CONFIG_SENSORS_LTC4261 is not set
+# CONFIG_SENSORS_LM95241 is not set
+# CONFIG_SENSORS_MAX1111 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_MAX6639 is not set
+# CONFIG_SENSORS_MAX6650 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_PMBUS is not set
+# CONFIG_SENSORS_SHT15 is not set
+# CONFIG_SENSORS_SHT21 is not set
+CONFIG_SENSORS_SMM665=m
+# CONFIG_SENSORS_DME1737 is not set
+CONFIG_SENSORS_EMC1403=m
+CONFIG_SENSORS_EMC2103=m
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47M192 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_SCH5627 is not set
+# CONFIG_SENSORS_ADS1015 is not set
+# CONFIG_SENSORS_ADS7828 is not set
+CONFIG_SENSORS_ADS7871=m
+CONFIG_SENSORS_AMC6821=m
+# CONFIG_SENSORS_THMC50 is not set
+CONFIG_SENSORS_TMP102=m
+# CONFIG_SENSORS_TMP401 is not set
+# CONFIG_SENSORS_TMP421 is not set
+CONFIG_SENSORS_TWL4030_MADC=m
+# CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83791D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83793 is not set
+# CONFIG_SENSORS_W83795 is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83L786NG is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+CONFIG_THERMAL=y
+CONFIG_THERMAL_HWMON=y
+CONFIG_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+CONFIG_OMAP_WATCHDOG=y
+# CONFIG_TWL4030_WATCHDOG is not set
+# CONFIG_MAX63XX_WATCHDOG is not set
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB=y
+CONFIG_SSB_BLOCKIO=y
+CONFIG_SSB_SDIOHOST_POSSIBLE=y
+# CONFIG_SSB_SDIOHOST is not set
+# CONFIG_SSB_SILENT is not set
+# CONFIG_SSB_DEBUG 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_TPS6105X=m
+# CONFIG_TPS65010 is not set
+CONFIG_TPS6507X=m
+CONFIG_TWL4030_CORE=y
+CONFIG_TWL4030_MADC=m
+CONFIG_TWL4030_POWER=y
+CONFIG_TWL4030_CODEC=y
+CONFIG_TWL4030_POWEROFF=y
+CONFIG_TWL6030_PWM=m
+# CONFIG_MFD_STMPE is not set
+# CONFIG_MFD_TC3589X 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_MAX8997 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 is not set
+# CONFIG_MFD_MC13XXX is not set
+# CONFIG_ABX500_CORE is not set
+# CONFIG_EZX_PCAP is not set
+CONFIG_MFD_TPS6586X=y
+CONFIG_MFD_WL1273_CORE=m
+CONFIG_MFD_OMAP_USB_HOST=y
+CONFIG_REGULATOR=y
+# CONFIG_REGULATOR_DEBUG is not set
+CONFIG_REGULATOR_DUMMY=y
+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_TWL4030=y
+# CONFIG_REGULATOR_LP3971 is not set
+# CONFIG_REGULATOR_LP3972 is not set
+CONFIG_REGULATOR_TPS6105X=m
+# 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_REGULATOR_TPS6586X=m
+CONFIG_REGULATOR_TPS6524X=m
+CONFIG_MEDIA_SUPPORT=y
+
+#
+# Multimedia core support
+#
+CONFIG_MEDIA_CONTROLLER=y
+CONFIG_VIDEO_DEV=y
+CONFIG_VIDEO_V4L2_COMMON=y
+CONFIG_VIDEO_V4L2_SUBDEV_API=y
+CONFIG_DVB_CORE=m
+CONFIG_VIDEO_MEDIA=m
+
+#
+# Multimedia drivers
+#
+CONFIG_RC_CORE=m
+CONFIG_LIRC=m
+CONFIG_RC_MAP=m
+CONFIG_IR_NEC_DECODER=m
+CONFIG_IR_RC5_DECODER=m
+CONFIG_IR_RC6_DECODER=m
+CONFIG_IR_JVC_DECODER=m
+CONFIG_IR_SONY_DECODER=m
+CONFIG_IR_RC5_SZ_DECODER=m
+CONFIG_IR_LIRC_CODEC=m
+# CONFIG_IR_IMON is not set
+# CONFIG_IR_MCEUSB is not set
+# CONFIG_IR_STREAMZAP is not set
+CONFIG_RC_LOOPBACK=m
+CONFIG_MEDIA_ATTACH=y
+CONFIG_MEDIA_TUNER=m
+CONFIG_MEDIA_TUNER_CUSTOMISE=y
+
+#
+# Customize TV tuners
+#
+CONFIG_MEDIA_TUNER_SIMPLE=m
+CONFIG_MEDIA_TUNER_TDA8290=m
+CONFIG_MEDIA_TUNER_TDA827X=m
+CONFIG_MEDIA_TUNER_TDA18271=m
+CONFIG_MEDIA_TUNER_TDA9887=m
+CONFIG_MEDIA_TUNER_TEA5761=m
+CONFIG_MEDIA_TUNER_TEA5767=m
+CONFIG_MEDIA_TUNER_MT20XX=m
+CONFIG_MEDIA_TUNER_MT2060=m
+CONFIG_MEDIA_TUNER_MT2266=m
+CONFIG_MEDIA_TUNER_MT2131=m
+CONFIG_MEDIA_TUNER_QT1010=m
+CONFIG_MEDIA_TUNER_XC2028=m
+CONFIG_MEDIA_TUNER_XC5000=m
+CONFIG_MEDIA_TUNER_MXL5005S=m
+CONFIG_MEDIA_TUNER_MXL5007T=m
+CONFIG_MEDIA_TUNER_MC44S803=m
+CONFIG_MEDIA_TUNER_MAX2165=m
+CONFIG_MEDIA_TUNER_TDA18218=m
+CONFIG_VIDEO_V4L2=y
+CONFIG_VIDEOBUF_GEN=y
+CONFIG_VIDEOBUF_VMALLOC=m
+CONFIG_VIDEOBUF_DMA_CONTIG=y
+CONFIG_VIDEOBUF_DVB=m
+CONFIG_VIDEO_TVEEPROM=m
+CONFIG_VIDEO_TUNER=m
+CONFIG_V4L2_MEM2MEM_DEV=m
+CONFIG_VIDEOBUF2_CORE=m
+CONFIG_VIDEOBUF2_MEMOPS=m
+CONFIG_VIDEOBUF2_VMALLOC=m
+CONFIG_VIDEO_CAPTURE_DRIVERS=y
+# CONFIG_VIDEO_ADV_DEBUG is not set
+# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
+# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set
+CONFIG_VIDEO_IR_I2C=m
+
+#
+# Encoders/decoders and other helper chips
+#
+
+#
+# Audio decoders
+#
+# CONFIG_VIDEO_TVAUDIO is not set
+# CONFIG_VIDEO_TDA7432 is not set
+# CONFIG_VIDEO_TDA9840 is not set
+# CONFIG_VIDEO_TEA6415C is not set
+# CONFIG_VIDEO_TEA6420 is not set
+CONFIG_VIDEO_MSP3400=m
+# CONFIG_VIDEO_CS5345 is not set
+CONFIG_VIDEO_CS53L32A=m
+# CONFIG_VIDEO_M52790 is not set
+# CONFIG_VIDEO_TLV320AIC23B is not set
+CONFIG_VIDEO_WM8775=m
+# CONFIG_VIDEO_WM8739 is not set
+# CONFIG_VIDEO_VP27SMPX is not set
+
+#
+# RDS decoders
+#
+# CONFIG_VIDEO_SAA6588 is not set
+
+#
+# Video decoders
+#
+CONFIG_VIDEO_ADV7180=m
+# CONFIG_VIDEO_BT819 is not set
+# CONFIG_VIDEO_BT856 is not set
+# CONFIG_VIDEO_BT866 is not set
+# CONFIG_VIDEO_KS0127 is not set
+CONFIG_VIDEO_OV7670=m
+CONFIG_VIDEO_MT9P031=y
+CONFIG_VIDEO_MT9V011=m
+CONFIG_VIDEO_MT9V032=y
+# CONFIG_VIDEO_TCM825X is not set
+# CONFIG_VIDEO_SAA7110 is not set
+CONFIG_VIDEO_SAA711X=m
+# CONFIG_VIDEO_SAA717X is not set
+# CONFIG_VIDEO_SAA7191 is not set
+CONFIG_VIDEO_TVP514X=m
+CONFIG_VIDEO_TVP5150=m
+CONFIG_VIDEO_TVP7002=m
+# CONFIG_VIDEO_VPX3220 is not set
+
+#
+# Video and audio decoders
+#
+CONFIG_VIDEO_CX25840=m
+
+#
+# MPEG video encoders
+#
+CONFIG_VIDEO_CX2341X=m
+
+#
+# Video encoders
+#
+# CONFIG_VIDEO_SAA7127 is not set
+# CONFIG_VIDEO_SAA7185 is not set
+# CONFIG_VIDEO_ADV7170 is not set
+# CONFIG_VIDEO_ADV7175 is not set
+# CONFIG_VIDEO_THS7303 is not set
+# CONFIG_VIDEO_ADV7343 is not set
+# CONFIG_VIDEO_AK881X is not set
+
+#
+# Video improvement chips
+#
+# CONFIG_VIDEO_UPD64031A is not set
+# CONFIG_VIDEO_UPD64083 is not set
+CONFIG_VIDEO_VIVI=m
+CONFIG_VIDEO_VPSS_SYSTEM=m
+CONFIG_VIDEO_VPFE_CAPTURE=y
+CONFIG_VIDEO_DM6446_CCDC=m
+CONFIG_VIDEO_OMAP2_VOUT=y
+# CONFIG_VIDEO_CPIA2 is not set
+CONFIG_VIDEO_TIMBERDALE=m
+# CONFIG_VIDEO_AU0828 is not set
+CONFIG_VIDEO_SR030PC30=m
+CONFIG_VIDEO_NOON010PC30=m
+CONFIG_VIDEO_OMAP3=y
+CONFIG_VIDEO_OMAP3_DEBUG=y
+# CONFIG_SOC_CAMERA is not set
+CONFIG_V4L_USB_DRIVERS=y
+CONFIG_USB_VIDEO_CLASS=m
+CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
+CONFIG_USB_GSPCA=m
+CONFIG_USB_M5602=m
+CONFIG_USB_STV06XX=m
+# CONFIG_USB_GL860 is not set
+CONFIG_USB_GSPCA_BENQ=m
+CONFIG_USB_GSPCA_CONEX=m
+CONFIG_USB_GSPCA_CPIA1=m
+CONFIG_USB_GSPCA_ETOMS=m
+CONFIG_USB_GSPCA_FINEPIX=m
+# CONFIG_USB_GSPCA_JEILINJ is not set
+CONFIG_USB_GSPCA_KONICA=m
+CONFIG_USB_GSPCA_MARS=m
+# CONFIG_USB_GSPCA_MR97310A is not set
+CONFIG_USB_GSPCA_NW80X=m
+CONFIG_USB_GSPCA_OV519=m
+CONFIG_USB_GSPCA_OV534=m
+CONFIG_USB_GSPCA_OV534_9=m
+CONFIG_USB_GSPCA_PAC207=m
+# CONFIG_USB_GSPCA_PAC7302 is not set
+CONFIG_USB_GSPCA_PAC7311=m
+CONFIG_USB_GSPCA_SN9C2028=m
+# CONFIG_USB_GSPCA_SN9C20X is not set
+CONFIG_USB_GSPCA_SONIXB=m
+CONFIG_USB_GSPCA_SONIXJ=m
+CONFIG_USB_GSPCA_SPCA500=m
+CONFIG_USB_GSPCA_SPCA501=m
+CONFIG_USB_GSPCA_SPCA505=m
+CONFIG_USB_GSPCA_SPCA506=m
+CONFIG_USB_GSPCA_SPCA508=m
+CONFIG_USB_GSPCA_SPCA561=m
+CONFIG_USB_GSPCA_SPCA1528=m
+# CONFIG_USB_GSPCA_SQ905 is not set
+# CONFIG_USB_GSPCA_SQ905C is not set
+CONFIG_USB_GSPCA_SQ930X=m
+CONFIG_USB_GSPCA_STK014=m
+# CONFIG_USB_GSPCA_STV0680 is not set
+CONFIG_USB_GSPCA_SUNPLUS=m
+CONFIG_USB_GSPCA_T613=m
+CONFIG_USB_GSPCA_TV8532=m
+CONFIG_USB_GSPCA_VC032X=m
+CONFIG_USB_GSPCA_VICAM=m
+CONFIG_USB_GSPCA_XIRLINK_CIT=m
+CONFIG_USB_GSPCA_ZC3XX=m
+CONFIG_VIDEO_PVRUSB2=m
+CONFIG_VIDEO_PVRUSB2_SYSFS=y
+CONFIG_VIDEO_PVRUSB2_DVB=y
+# CONFIG_VIDEO_PVRUSB2_DEBUGIFC is not set
+CONFIG_VIDEO_HDPVR=m
+CONFIG_VIDEO_EM28XX=m
+CONFIG_VIDEO_EM28XX_ALSA=m
+CONFIG_VIDEO_EM28XX_DVB=m
+CONFIG_VIDEO_TLG2300=m
+CONFIG_VIDEO_CX231XX=m
+CONFIG_VIDEO_CX231XX_RC=y
+# CONFIG_VIDEO_CX231XX_ALSA is not set
+CONFIG_VIDEO_CX231XX_DVB=m
+CONFIG_VIDEO_USBVISION=m
+CONFIG_USB_ET61X251=m
+CONFIG_USB_SN9C102=m
+CONFIG_USB_PWC=m
+# CONFIG_USB_PWC_DEBUG is not set
+CONFIG_USB_PWC_INPUT_EVDEV=y
+CONFIG_USB_ZR364XX=m
+CONFIG_USB_STKWEBCAM=m
+CONFIG_USB_S2255=m
+CONFIG_V4L_MEM2MEM_DRIVERS=y
+CONFIG_VIDEO_MEM2MEM_TESTDEV=m
+CONFIG_RADIO_ADAPTERS=y
+# CONFIG_I2C_SI4713 is not set
+# CONFIG_RADIO_SI4713 is not set
+# CONFIG_USB_DSBR is not set
+# CONFIG_RADIO_SI470X is not set
+# CONFIG_USB_MR800 is not set
+# CONFIG_RADIO_TEA5764 is not set
+CONFIG_RADIO_SAA7706H=m
+# CONFIG_RADIO_TEF6862 is not set
+CONFIG_RADIO_WL1273=m
+
+#
+# Texas Instruments WL128x FM driver (ST based)
+#
+CONFIG_RADIO_WL128X=m
+CONFIG_DVB_MAX_ADAPTERS=8
+CONFIG_DVB_DYNAMIC_MINORS=y
+CONFIG_DVB_CAPTURE_DRIVERS=y
+# CONFIG_TTPCI_EEPROM is not set
+
+#
+# Supported USB Adapters
+#
+CONFIG_DVB_USB=m
+# CONFIG_DVB_USB_DEBUG is not set
+CONFIG_DVB_USB_A800=m
+CONFIG_DVB_USB_DIBUSB_MB=m
+# CONFIG_DVB_USB_DIBUSB_MB_FAULTY is not set
+CONFIG_DVB_USB_DIBUSB_MC=m
+CONFIG_DVB_USB_DIB0700=m
+CONFIG_DVB_USB_UMT_010=m
+CONFIG_DVB_USB_CXUSB=m
+CONFIG_DVB_USB_M920X=m
+CONFIG_DVB_USB_GL861=m
+CONFIG_DVB_USB_AU6610=m
+CONFIG_DVB_USB_DIGITV=m
+CONFIG_DVB_USB_VP7045=m
+CONFIG_DVB_USB_VP702X=m
+CONFIG_DVB_USB_GP8PSK=m
+CONFIG_DVB_USB_NOVA_T_USB2=m
+CONFIG_DVB_USB_TTUSB2=m
+CONFIG_DVB_USB_DTT200U=m
+CONFIG_DVB_USB_OPERA1=m
+CONFIG_DVB_USB_AF9005=m
+CONFIG_DVB_USB_AF9005_REMOTE=m
+CONFIG_DVB_USB_DW2102=m
+CONFIG_DVB_USB_CINERGY_T2=m
+CONFIG_DVB_USB_ANYSEE=m
+CONFIG_DVB_USB_DTV5100=m
+CONFIG_DVB_USB_AF9015=m
+# CONFIG_DVB_USB_CE6230 is not set
+# CONFIG_DVB_USB_FRIIO is not set
+# CONFIG_DVB_USB_EC168 is not set
+CONFIG_DVB_USB_AZ6027=m
+CONFIG_DVB_USB_LME2510=m
+CONFIG_DVB_USB_TECHNISAT_USB2=m
+# CONFIG_SMS_SIANO_MDTV is not set
+
+#
+# Supported FlexCopII (B2C2) Adapters
+#
+CONFIG_DVB_B2C2_FLEXCOP=m
+CONFIG_DVB_B2C2_FLEXCOP_USB=m
+# CONFIG_DVB_B2C2_FLEXCOP_DEBUG is not set
+
+#
+# Supported DVB Frontends
+#
+# CONFIG_DVB_FE_CUSTOMISE is not set
+
+#
+# Multistandard (satellite) frontends
+#
+CONFIG_DVB_STB0899=m
+CONFIG_DVB_STB6100=m
+CONFIG_DVB_STV090x=m
+CONFIG_DVB_STV6110x=m
+
+#
+# DVB-S (satellite) frontends
+#
+CONFIG_DVB_CX24123=m
+CONFIG_DVB_MT312=m
+CONFIG_DVB_ZL10039=m
+CONFIG_DVB_S5H1420=m
+CONFIG_DVB_STV0288=m
+CONFIG_DVB_STB6000=m
+CONFIG_DVB_STV0299=m
+CONFIG_DVB_STV6110=m
+CONFIG_DVB_STV0900=m
+CONFIG_DVB_TDA10086=m
+CONFIG_DVB_TUNER_ITD1000=m
+CONFIG_DVB_TUNER_CX24113=m
+CONFIG_DVB_TDA826X=m
+CONFIG_DVB_CX24116=m
+CONFIG_DVB_SI21XX=m
+CONFIG_DVB_DS3000=m
+
+#
+# DVB-T (terrestrial) frontends
+#
+CONFIG_DVB_CX22702=m
+CONFIG_DVB_TDA1004X=m
+CONFIG_DVB_NXT6000=m
+CONFIG_DVB_MT352=m
+CONFIG_DVB_ZL10353=m
+CONFIG_DVB_DIB3000MB=m
+CONFIG_DVB_DIB3000MC=m
+CONFIG_DVB_DIB7000M=m
+CONFIG_DVB_DIB7000P=m
+CONFIG_DVB_TDA10048=m
+CONFIG_DVB_AF9013=m
+
+#
+# DVB-C (cable) frontends
+#
+CONFIG_DVB_TDA10023=m
+CONFIG_DVB_STV0297=m
+
+#
+# ATSC (North American/Korean Terrestrial/Cable DTV) frontends
+#
+CONFIG_DVB_NXT200X=m
+CONFIG_DVB_BCM3510=m
+CONFIG_DVB_LGDT330X=m
+CONFIG_DVB_LGDT3305=m
+CONFIG_DVB_S5H1409=m
+CONFIG_DVB_S5H1411=m
+
+#
+# ISDB-T (terrestrial) frontends
+#
+CONFIG_DVB_S921=m
+CONFIG_DVB_DIB8000=m
+CONFIG_DVB_MB86A20S=m
+
+#
+# Digital terrestrial only tuners/PLL
+#
+CONFIG_DVB_PLL=m
+CONFIG_DVB_TUNER_DIB0070=m
+CONFIG_DVB_TUNER_DIB0090=m
+
+#
+# SEC control devices for DVB-S
+#
+CONFIG_DVB_LNBP21=m
+CONFIG_DVB_ISL6421=m
+CONFIG_DVB_LGS8GXX=m
+CONFIG_DVB_ATBM8830=m
+CONFIG_DVB_IX2505V=m
+
+#
+# Tools to develop new frontends
+#
+# CONFIG_DVB_DUMMY_FE is not set
+
+#
+# Graphics support
+#
+CONFIG_DRM=m
+# 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=m
+CONFIG_FB_SYS_COPYAREA=m
+CONFIG_FB_SYS_IMAGEBLIT=m
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+CONFIG_FB_SYS_FOPS=m
+# CONFIG_FB_WMT_GE_ROPS is not set
+CONFIG_FB_DEFERRED_IO=y
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+CONFIG_FB_MODE_HELPERS=y
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_TMIO is not set
+CONFIG_FB_UDL=m
+# 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_OMAP_BOOTLOADER_INIT is not set
+CONFIG_OMAP2_VRAM=y
+CONFIG_OMAP2_VRFB=y
+CONFIG_OMAP2_DSS=y
+CONFIG_OMAP2_VRAM_SIZE=14
+CONFIG_OMAP2_DSS_DEBUG_SUPPORT=y
+# CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS is not set
+CONFIG_OMAP2_DSS_DPI=y
+# CONFIG_OMAP2_DSS_RFBI is not set
+CONFIG_OMAP2_DSS_VENC=y
+# CONFIG_OMAP2_DSS_SDI is not set
+CONFIG_OMAP2_DSS_DSI=y
+CONFIG_OMAP2_DSS_USE_DSI_PLL=y
+# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set
+CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=0
+CONFIG_FB_OMAP2=y
+CONFIG_FB_OMAP2_DEBUG_SUPPORT=y
+CONFIG_FB_OMAP2_NUM_FBS=2
+
+#
+# OMAP2/3 Display Device Drivers
+#
+CONFIG_PANEL_GENERIC_DPI=y
+# CONFIG_PANEL_LGPHILIPS_LB035Q02 is not set
+CONFIG_PANEL_SHARP_LS037V7DW01=y
+CONFIG_PANEL_NEC_NL8048HL11_01B=y
+# CONFIG_PANEL_TAAL is not set
+CONFIG_PANEL_TPO_TD043MTEA1=m
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+
+#
+# Display device support
+#
+CONFIG_DISPLAY_SUPPORT=y
+
+#
+# Display hardware drivers
+#
+
+#
+# Console display driver support
+#
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_LOGO_LINUX_CLUT224=y
+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_HWDEP=y
+CONFIG_SND_RAWMIDI=y
+CONFIG_SND_JACK=y
+CONFIG_SND_SEQUENCER=m
+# CONFIG_SND_SEQ_DUMMY is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=y
+CONFIG_SND_PCM_OSS=y
+CONFIG_SND_PCM_OSS_PLUGINS=y
+CONFIG_SND_SEQUENCER_OSS=y
+CONFIG_SND_HRTIMER=m
+CONFIG_SND_SEQ_HRTIMER_DEFAULT=y
+CONFIG_SND_DYNAMIC_MINORS=y
+CONFIG_SND_SUPPORT_OLD_API=y
+CONFIG_SND_VERBOSE_PROCFS=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+CONFIG_SND_RAWMIDI_SEQ=m
+# 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=y
+# CONFIG_SND_DUMMY is not set
+CONFIG_SND_ALOOP=m
+# CONFIG_SND_VIRMIDI is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+# CONFIG_SND_ARM is not set
+CONFIG_SND_SPI=y
+CONFIG_SND_USB=y
+CONFIG_SND_USB_AUDIO=y
+CONFIG_SND_USB_UA101=m
+CONFIG_SND_USB_CAIAQ=m
+CONFIG_SND_USB_CAIAQ_INPUT=y
+CONFIG_SND_USB_6FIRE=m
+CONFIG_SND_SOC=y
+CONFIG_SND_SOC_CACHE_LZO=y
+CONFIG_SND_OMAP_SOC=y
+CONFIG_SND_OMAP_SOC_MCBSP=y
+CONFIG_SND_OMAP_SOC_OVERO=y
+CONFIG_SND_OMAP_SOC_OMAP3EVM=y
+CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE=y
+CONFIG_SND_OMAP_SOC_ZOOM2=y
+CONFIG_SND_SOC_I2C_AND_SPI=y
+# CONFIG_SND_SOC_ALL_CODECS is not set
+CONFIG_SND_SOC_TWL4030=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=m
+# 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 is not set
+CONFIG_HID_EMS_FF=m
+# CONFIG_HID_ELECOM is not set
+CONFIG_HID_EZKEY=y
+CONFIG_HID_KEYTOUCH=m
+# CONFIG_HID_KYE is not set
+CONFIG_HID_UCLOGIC=m
+CONFIG_HID_WALTOP=m
+CONFIG_HID_GYRATION=y
+# CONFIG_HID_TWINHAN is not set
+# CONFIG_HID_KENSINGTON is not set
+CONFIG_HID_LCPOWER=m
+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=m
+CONFIG_HID_MICROSOFT=y
+# CONFIG_HID_MOSART is not set
+CONFIG_HID_MONTEREY=y
+CONFIG_HID_MULTITOUCH=m
+CONFIG_HID_NTRIG=y
+# CONFIG_HID_ORTEK is not set
+CONFIG_HID_PANTHERLORD=y
+# CONFIG_PANTHERLORD_FF is not set
+CONFIG_HID_PETALYNX=y
+CONFIG_HID_PICOLCD=m
+CONFIG_HID_PICOLCD_FB=y
+CONFIG_HID_PICOLCD_BACKLIGHT=y
+CONFIG_HID_PICOLCD_LEDS=y
+CONFIG_HID_QUANTA=m
+CONFIG_HID_ROCCAT=m
+CONFIG_HID_ROCCAT_COMMON=m
+CONFIG_HID_ROCCAT_ARVO=m
+CONFIG_HID_ROCCAT_KONE=m
+CONFIG_HID_ROCCAT_KONEPLUS=m
+CONFIG_HID_ROCCAT_KOVAPLUS=m
+# CONFIG_HID_ROCCAT_PYRA is not set
+CONFIG_HID_SAMSUNG=y
+CONFIG_HID_SONY=y
+CONFIG_HID_STANTUM=m
+CONFIG_HID_SUNPLUS=y
+# CONFIG_HID_GREENASIA is not set
+# CONFIG_HID_SMARTJOYPLUS is not set
+CONFIG_HID_TOPSEED=y
+# CONFIG_HID_THRUSTMASTER is not set
+# CONFIG_HID_WACOM is not set
+# CONFIG_HID_ZEROPLUS 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=y
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_DEVICE_CLASS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+CONFIG_USB_SUSPEND=y
+CONFIG_USB_OTG=y
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+CONFIG_USB_MON=y
+# 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_EHCI_HCD=y
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+CONFIG_USB_EHCI_TT_NEWSCHED=y
+CONFIG_USB_EHCI_HCD_OMAP=y
+# 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 is not set
+# CONFIG_USB_U132_HCD is not set
+# 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=y
+# CONFIG_USB_MUSB_TUSB6010 is not set
+CONFIG_USB_MUSB_OMAP2PLUS=y
+# CONFIG_USB_MUSB_AM35X is not set
+# CONFIG_USB_MUSB_HOST is not set
+# CONFIG_USB_MUSB_PERIPHERAL is not set
+CONFIG_USB_MUSB_OTG=y
+CONFIG_USB_GADGET_MUSB_HDRC=y
+CONFIG_USB_MUSB_HDRC_HCD=y
+# CONFIG_MUSB_PIO_ONLY is not set
+CONFIG_USB_INVENTRA_DMA=y
+# CONFIG_USB_TI_CPPI_DMA is not set
+# CONFIG_USB_MUSB_DEBUG is not set
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+CONFIG_USB_WDM=m
+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=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+CONFIG_USB_STORAGE_REALTEK=m
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_ONETOUCH is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
+CONFIG_USB_STORAGE_ENE_UB6250=m
+CONFIG_USB_UAS=m
+# 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=m
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+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=m
+CONFIG_USB_SERIAL_KEYSPAN_PDA=m
+CONFIG_USB_SERIAL_KEYSPAN=m
+CONFIG_USB_SERIAL_KEYSPAN_MPR=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
+CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19=y
+CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
+CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
+CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y
+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=m
+CONFIG_USB_SERIAL_NAVMAN=m
+CONFIG_USB_SERIAL_PL2303=m
+CONFIG_USB_SERIAL_OTI6858=m
+CONFIG_USB_SERIAL_QCAUX=m
+# CONFIG_USB_SERIAL_QUALCOMM is not set
+CONFIG_USB_SERIAL_SPCP8X5=m
+CONFIG_USB_SERIAL_HP4X=m
+CONFIG_USB_SERIAL_SAFE=m
+# CONFIG_USB_SERIAL_SAFE_PADDED is not set
+CONFIG_USB_SERIAL_SAMBA=m
+CONFIG_USB_SERIAL_SIEMENS_MPI=m
+CONFIG_USB_SERIAL_SIERRAWIRELESS=m
+# CONFIG_USB_SERIAL_SYMBOL is not set
+# CONFIG_USB_SERIAL_TI is not set
+CONFIG_USB_SERIAL_CYBERJACK=m
+# CONFIG_USB_SERIAL_XIRCOM is not set
+# CONFIG_USB_SERIAL_OPTION is not set
+CONFIG_USB_SERIAL_OMNINET=m
+CONFIG_USB_SERIAL_OPTICON=m
+CONFIG_USB_SERIAL_VIVOPAY_SERIAL=m
+CONFIG_USB_SERIAL_ZIO=m
+CONFIG_USB_SERIAL_SSU100=m
+CONFIG_USB_SERIAL_DEBUG=m
+
+#
+# USB Miscellaneous drivers
+#
+CONFIG_USB_EMI62=m
+CONFIG_USB_EMI26=m
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_SEVSEG is not set
+# CONFIG_USB_RIO500 is not set
+CONFIG_USB_LEGOTOWER=m
+CONFIG_USB_LCD=m
+CONFIG_USB_LED=m
+CONFIG_USB_CYPRESS_CY7C63=m
+CONFIG_USB_CYTHERM=m
+CONFIG_USB_IDMOUSE=m
+CONFIG_USB_FTDI_ELAN=m
+# CONFIG_USB_APPLEDISPLAY is not set
+CONFIG_USB_SISUSBVGA=m
+CONFIG_USB_SISUSBVGA_CON=y
+CONFIG_USB_LD=m
+CONFIG_USB_TRANCEVIBRATOR=m
+# CONFIG_USB_IOWARRIOR is not set
+CONFIG_USB_TEST=m
+# CONFIG_USB_ISIGHTFW is not set
+CONFIG_USB_YUREX=m
+CONFIG_USB_ATM=m
+CONFIG_USB_SPEEDTOUCH=m
+CONFIG_USB_CXACRU=m
+CONFIG_USB_UEAGLEATM=m
+CONFIG_USB_XUSBATM=m
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG is not set
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_DEBUG_FS=y
+CONFIG_USB_GADGET_VBUS_DRAW=480
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_FUSB300 is not set
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_USB_GADGET_R8A66597 is not set
+# CONFIG_USB_GADGET_PXA_U2O is not set
+# CONFIG_USB_GADGET_M66592 is not set
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+# 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_G_NCM=m
+# CONFIG_USB_GADGETFS is not set
+CONFIG_USB_FUNCTIONFS=m
+# CONFIG_USB_FUNCTIONFS_ETH is not set
+CONFIG_USB_FUNCTIONFS_RNDIS=y
+# CONFIG_USB_FUNCTIONFS_GENERIC 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=m
+CONFIG_USB_G_DBGP=m
+# CONFIG_USB_G_DBGP_PRINTK is not set
+CONFIG_USB_G_DBGP_SERIAL=y
+CONFIG_USB_G_WEBCAM=m
+
+#
+# OTG and related infrastructure
+#
+CONFIG_USB_OTG_UTILS=y
+CONFIG_USB_GPIO_VBUS=y
+# CONFIG_ISP1301_OMAP is not set
+# CONFIG_USB_ULPI is not set
+CONFIG_TWL4030_USB=y
+CONFIG_TWL6030_USB=m
+CONFIG_NOP_USB_XCEIV=y
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+CONFIG_MMC_UNSAFE_RESUME=y
+# CONFIG_MMC_CLKGATE is not set
+
+#
+# MMC/SD/SDIO Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_MINORS=8
+CONFIG_MMC_BLOCK_BOUNCE=y
+CONFIG_SDIO_UART=y
+# CONFIG_MMC_TEST is not set
+
+#
+# MMC/SD/SDIO Host Controller Drivers
+#
+# CONFIG_MMC_SDHCI is not set
+# CONFIG_MMC_OMAP is not set
+CONFIG_MMC_OMAP_HS=y
+CONFIG_MMC_SPI=m
+# CONFIG_MMC_DW is not set
+CONFIG_MMC_USHC=m
+# CONFIG_MEMSTICK is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=y
+
+#
+# LED drivers
+#
+# CONFIG_LEDS_LM3530 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=m
+CONFIG_LEDS_LP5523=m
+# 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=y
+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_NFC_DEVICES=y
+CONFIG_PN544_NFC=m
+# 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=y
+# 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=m
+CONFIG_RTC_DRV_TWL4030=m
+# 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
+
+#
+# on-CPU RTC drivers
+#
+# CONFIG_DMADEVICES is not set
+CONFIG_TIMB_DMA=m
+CONFIG_DMA_ENGINE=y
+# CONFIG_AUXDISPLAY is not set
+CONFIG_UIO=m
+CONFIG_UIO_PDRV=m
+CONFIG_UIO_PDRV_GENIRQ=m
+CONFIG_STAGING=y
+# CONFIG_STAGING_EXCLUDE_BUILD is not set
+# CONFIG_VIDEO_TM6000 is not set
+# CONFIG_USB_IP_COMMON is not set
+CONFIG_W35UND=m
+CONFIG_PRISM2_USB=m
+CONFIG_ECHO=m
+CONFIG_BRCM80211=m
+CONFIG_BRCMFMAC=y
+# CONFIG_BRCMDBG is not set
+CONFIG_RT2870=m
+# CONFIG_COMEDI is not set
+# CONFIG_ASUS_OLED is not set
+CONFIG_R8712U=m
+CONFIG_R8712_AP=y
+# CONFIG_TRANZPORT is not set
+# CONFIG_POHMELFS is not set
+# CONFIG_LINE6_USB is not set
+# CONFIG_USB_SERIAL_QUATECH2 is not set
+# CONFIG_USB_SERIAL_QUATECH_USB2 is not set
+# CONFIG_VT6656 is not set
+# CONFIG_IIO is not set
+CONFIG_XVMALLOC=y
+CONFIG_ZRAM=m
+# CONFIG_ZRAM_DEBUG is not set
+# CONFIG_FB_SM7XX is not set
+# CONFIG_LIRC_STAGING is not set
+# CONFIG_EASYCAP is not set
+# CONFIG_TIDSPBRIDGE is not set
+# CONFIG_MACH_OMAP3_WESTBRIDGE_AST_PNAND_HAL is not set
+CONFIG_MACH_NO_WESTBRIDGE=y
+# CONFIG_ATH6K_LEGACY is not set
+CONFIG_USB_ENESTORAGE=m
+CONFIG_BCM_WIMAX=m
+CONFIG_FT1000=m
+CONFIG_FT1000_USB=m
+
+#
+# Speakup console speech
+#
+# CONFIG_SPEAKUP is not set
+CONFIG_TOUCHSCREEN_CLEARPAD_TM1217=m
+CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4=m
+
+#
+# Altera FPGA firmware download module
+#
+# CONFIG_ALTERA_STAPL is not set
+CONFIG_CLKDEV_LOOKUP=y
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+# CONFIG_EXT3_FS_SECURITY is not set
+CONFIG_EXT4_FS=y
+CONFIG_EXT4_FS_XATTR=y
+CONFIG_EXT4_FS_POSIX_ACL=y
+CONFIG_EXT4_FS_SECURITY=y
+# CONFIG_EXT4_DEBUG is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_JBD2=y
+# CONFIG_JBD2_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+CONFIG_REISERFS_PROC_INFO=y
+CONFIG_REISERFS_FS_XATTR=y
+# CONFIG_REISERFS_FS_POSIX_ACL is not set
+# CONFIG_REISERFS_FS_SECURITY is not set
+CONFIG_JFS_FS=m
+CONFIG_JFS_POSIX_ACL=y
+# CONFIG_JFS_SECURITY is not set
+# CONFIG_JFS_DEBUG is not set
+CONFIG_JFS_STATISTICS=y
+CONFIG_XFS_FS=m
+CONFIG_XFS_QUOTA=y
+CONFIG_XFS_POSIX_ACL=y
+CONFIG_XFS_RT=y
+# CONFIG_XFS_DEBUG is not set
+CONFIG_GFS2_FS=m
+CONFIG_GFS2_FS_LOCKING_DLM=y
+CONFIG_OCFS2_FS=m
+CONFIG_OCFS2_FS_O2CB=m
+CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m
+CONFIG_OCFS2_FS_STATS=y
+CONFIG_OCFS2_DEBUG_MASKLOG=y
+# CONFIG_OCFS2_DEBUG_FS is not set
+CONFIG_BTRFS_FS=m
+CONFIG_BTRFS_FS_POSIX_ACL=y
+CONFIG_NILFS2_FS=m
+CONFIG_FS_POSIX_ACL=y
+CONFIG_EXPORTFS=y
+CONFIG_FILE_LOCKING=y
+CONFIG_FSNOTIFY=y
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY_USER=y
+CONFIG_FANOTIFY=y
+CONFIG_QUOTA=y
+# CONFIG_QUOTA_NETLINK_INTERFACE is not set
+CONFIG_PRINT_QUOTA_WARNING=y
+# CONFIG_QUOTA_DEBUG is not set
+CONFIG_QUOTA_TREE=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTACTL=y
+CONFIG_AUTOFS4_FS=y
+CONFIG_FUSE_FS=m
+CONFIG_CUSE=m
+CONFIG_GENERIC_ACL=y
+
+#
+# Caches
+#
+CONFIG_FSCACHE=m
+CONFIG_FSCACHE_STATS=y
+CONFIG_FSCACHE_HISTOGRAM=y
+# CONFIG_FSCACHE_DEBUG is not set
+# CONFIG_FSCACHE_OBJECT_LIST is not set
+CONFIG_CACHEFILES=m
+# CONFIG_CACHEFILES_DEBUG is not set
+CONFIG_CACHEFILES_HISTOGRAM=y
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_NTFS_FS=m
+# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW 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=m
+# CONFIG_ADFS_FS_RW is not set
+CONFIG_AFFS_FS=m
+# CONFIG_ECRYPT_FS is not set
+CONFIG_UNION_FS=m
+CONFIG_UNION_FS_XATTR=y
+# CONFIG_UNION_FS_DEBUG is not set
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
+CONFIG_BEFS_FS=m
+# CONFIG_BEFS_DEBUG is not set
+CONFIG_BFS_FS=m
+CONFIG_EFS_FS=m
+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=y
+CONFIG_JFFS2_FS_POSIX_ACL=y
+CONFIG_JFFS2_FS_SECURITY=y
+CONFIG_JFFS2_COMPRESSION_OPTIONS=y
+CONFIG_JFFS2_ZLIB=y
+CONFIG_JFFS2_LZO=y
+CONFIG_JFFS2_RTIME=y
+CONFIG_JFFS2_RUBIN=y
+# CONFIG_JFFS2_CMODE_NONE is not set
+# CONFIG_JFFS2_CMODE_PRIORITY is not set
+# CONFIG_JFFS2_CMODE_SIZE is not set
+CONFIG_JFFS2_CMODE_FAVOURLZO=y
+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=m
+CONFIG_CRAMFS=m
+CONFIG_SQUASHFS=y
+# CONFIG_SQUASHFS_XATTR is not set
+CONFIG_SQUASHFS_LZO=y
+CONFIG_SQUASHFS_XZ=y
+# CONFIG_SQUASHFS_EMBEDDED is not set
+CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
+CONFIG_VXFS_FS=m
+CONFIG_MINIX_FS=m
+CONFIG_OMFS_FS=m
+CONFIG_HPFS_FS=m
+CONFIG_QNX4FS_FS=m
+CONFIG_ROMFS_FS=m
+CONFIG_ROMFS_BACKED_BY_BLOCK=y
+# CONFIG_ROMFS_BACKED_BY_MTD is not set
+# CONFIG_ROMFS_BACKED_BY_BOTH is not set
+CONFIG_ROMFS_ON_BLOCK=y
+CONFIG_PSTORE=y
+CONFIG_SYSV_FS=m
+CONFIG_UFS_FS=m
+# CONFIG_UFS_FS_WRITE is not set
+# CONFIG_UFS_DEBUG is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_NFS_V4_1=y
+CONFIG_PNFS_FILE_LAYOUT=y
+CONFIG_ROOT_NFS=y
+# 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=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_ACL_SUPPORT=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+CONFIG_RPCSEC_GSS_KRB5=m
+CONFIG_CEPH_FS=m
+CONFIG_CIFS=m
+CONFIG_CIFS_STATS=y
+CONFIG_CIFS_STATS2=y
+# CONFIG_CIFS_WEAK_PW_HASH is not set
+# CONFIG_CIFS_UPCALL is not set
+CONFIG_CIFS_XATTR=y
+CONFIG_CIFS_POSIX=y
+# CONFIG_CIFS_DEBUG2 is not set
+CONFIG_CIFS_DFS_UPCALL=y
+CONFIG_CIFS_FSCACHE=y
+CONFIG_CIFS_ACL=y
+CONFIG_CIFS_EXPERIMENTAL=y
+CONFIG_NCP_FS=m
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_NCPFS_EXTRAS is not set
+CONFIG_CODA_FS=m
+CONFIG_AFS_FS=m
+# CONFIG_AFS_DEBUG is not set
+# CONFIG_AFS_FSCACHE is not set
+CONFIG_9P_FS=m
+CONFIG_9P_FSCACHE=y
+CONFIG_9P_FS_POSIX_ACL=y
+
+#
+# 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=y
+CONFIG_MSDOS_PARTITION=y
+CONFIG_BSD_DISKLABEL=y
+CONFIG_MINIX_SUBPARTITION=y
+CONFIG_SOLARIS_X86_PARTITION=y
+# CONFIG_UNIXWARE_DISKLABEL is not set
+CONFIG_LDM_PARTITION=y
+CONFIG_LDM_DEBUG=y
+# 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=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=m
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=m
+CONFIG_NLS_ISO8859_1=y
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+CONFIG_NLS_UTF8=y
+CONFIG_DLM=m
+# CONFIG_DLM_DEBUG is not set
+
+#
+# Kernel hacking
+#
+CONFIG_PRINTK_TIME=y
+CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_STRIP_ASM_SYMS is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_SECTION_MISMATCH is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+# CONFIG_LOCKUP_DETECTOR is not set
+# CONFIG_HARDLOCKUP_DETECTOR is not set
+CONFIG_DETECT_HUNG_TASK=y
+# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
+CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
+CONFIG_SCHED_DEBUG=y
+CONFIG_SCHEDSTATS=y
+CONFIG_TIMER_STATS=y
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_KMEMLEAK is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+CONFIG_DEBUG_MUTEXES=y
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_SPARSE_RCU_POINTER is not set
+# CONFIG_LOCK_STAT is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_TEST_LIST_SORT is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+# CONFIG_DEBUG_CREDENTIALS is not set
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
+# CONFIG_LKDTM is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_LATENCYTOP is not set
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+# CONFIG_DEBUG_PAGEALLOC is not set
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_RING_BUFFER=y
+CONFIG_RING_BUFFER_ALLOW_SWAP=y
+CONFIG_TRACING_SUPPORT=y
+CONFIG_FTRACE=y
+# CONFIG_FUNCTION_TRACER is not set
+# CONFIG_IRQSOFF_TRACER is not set
+# CONFIG_SCHED_TRACER is not set
+# CONFIG_ENABLE_DEFAULT_TRACERS is not set
+CONFIG_BRANCH_PROFILE_NONE=y
+# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set
+# CONFIG_PROFILE_ALL_BRANCHES is not set
+# CONFIG_STACK_TRACER is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_RING_BUFFER_BENCHMARK is not set
+# CONFIG_DYNAMIC_DEBUG is not set
+# CONFIG_DMA_API_DEBUG is not set
+# CONFIG_ATOMIC64_SELFTEST is not set
+# CONFIG_ASYNC_RAID6_TEST is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+# CONFIG_TEST_KSTRTOX is not set
+# CONFIG_STRICT_DEVMEM is not set
+CONFIG_ARM_UNWIND=y
+# CONFIG_DEBUG_USER is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_LL is not set
+# CONFIG_OC_ETM is not set
+
+#
+# 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_XOR_BLOCKS=m
+CONFIG_ASYNC_CORE=m
+CONFIG_ASYNC_MEMCPY=m
+CONFIG_ASYNC_XOR=m
+CONFIG_ASYNC_PQ=m
+CONFIG_ASYNC_RAID6_RECOV=m
+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=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG=m
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_PCOMP2=y
+CONFIG_CRYPTO_MANAGER=y
+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=m
+CONFIG_CRYPTO_AUTHENC=m
+CONFIG_CRYPTO_TEST=m
+
+#
+# Authenticated Encryption with Associated Data
+#
+CONFIG_CRYPTO_CCM=m
+CONFIG_CRYPTO_GCM=m
+CONFIG_CRYPTO_SEQIV=m
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+CONFIG_CRYPTO_CTR=m
+CONFIG_CRYPTO_CTS=m
+CONFIG_CRYPTO_ECB=y
+CONFIG_CRYPTO_LRW=m
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_XTS=m
+
+#
+# Hash modes
+#
+CONFIG_CRYPTO_HMAC=m
+CONFIG_CRYPTO_XCBC=m
+# CONFIG_CRYPTO_VMAC is not set
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=y
+CONFIG_CRYPTO_GHASH=m
+CONFIG_CRYPTO_MD4=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_MICHAEL_MIC=y
+CONFIG_CRYPTO_RMD128=m
+CONFIG_CRYPTO_RMD160=m
+CONFIG_CRYPTO_RMD256=m
+CONFIG_CRYPTO_RMD320=m
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+CONFIG_CRYPTO_TGR192=m
+CONFIG_CRYPTO_WP512=m
+
+#
+# Ciphers
+#
+CONFIG_CRYPTO_AES=y
+CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_ARC4=y
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_CAMELLIA=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_DES=y
+CONFIG_CRYPTO_FCRYPT=m
+CONFIG_CRYPTO_KHAZAD=m
+CONFIG_CRYPTO_SALSA20=m
+CONFIG_CRYPTO_SEED=m
+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 is not set
+CONFIG_CRYPTO_LZO=y
+
+#
+# Random Number Generation
+#
+CONFIG_CRYPTO_ANSI_CPRNG=m
+CONFIG_CRYPTO_USER_API=m
+CONFIG_CRYPTO_USER_API_HASH=m
+CONFIG_CRYPTO_USER_API_SKCIPHER=m
+CONFIG_CRYPTO_HW=y
+CONFIG_CRYPTO_DEV_OMAP_SHAM=m
+CONFIG_CRYPTO_DEV_OMAP_AES=m
+# CONFIG_BINARY_PRINTF is not set
+
+#
+# Library routines
+#
+CONFIG_RAID6_PQ=m
+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_XZ_DEC=y
+CONFIG_XZ_DEC_X86=y
+CONFIG_XZ_DEC_POWERPC=y
+CONFIG_XZ_DEC_IA64=y
+CONFIG_XZ_DEC_ARM=y
+CONFIG_XZ_DEC_ARMTHUMB=y
+CONFIG_XZ_DEC_SPARC=y
+CONFIG_XZ_DEC_BCJ=y
+CONFIG_XZ_DEC_TEST=m
+CONFIG_DECOMPRESS_GZIP=y
+CONFIG_DECOMPRESS_BZIP2=y
+CONFIG_DECOMPRESS_LZMA=y
+CONFIG_DECOMPRESS_XZ=y
+CONFIG_DECOMPRESS_LZO=y
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_TEXTSEARCH_BM=m
+CONFIG_TEXTSEARCH_FSM=m
+CONFIG_BTREE=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
+CONFIG_NLATTR=y
+CONFIG_AVERAGE=y
diff --git a/recipes/linux/linux-omap-2.6.39/camera/0001-Add-support-for-mt9p031-Aptina-Micron-sensor.patch b/recipes/linux/linux-omap-2.6.39/camera/0001-Add-support-for-mt9p031-Aptina-Micron-sensor.patch
new file mode 100644
index 0000000000..7f68de4048
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/camera/0001-Add-support-for-mt9p031-Aptina-Micron-sensor.patch
@@ -0,0 +1,773 @@
+From 244f96b15afbd73942762e2c07523d6c5cf68a7e Mon Sep 17 00:00:00 2001
+From: Javier Martin <javier.martin@vista-silicon.com>
+Date: Tue, 31 May 2011 11:46:49 +0200
+Subject: [PATCH 1/3] Add support for mt9p031 Aptina (Micron) sensor.
+
+This patch adds basic support (no controls) for
+mt9p031 sensor. It applies on kernel 2.6.39.
+
+Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
+---
+ drivers/media/video/Kconfig | 7 +
+ drivers/media/video/Makefile | 1 +
+ drivers/media/video/mt9p031.c | 699 +++++++++++++++++++++++++++++++++++++++++
+ include/media/mt9p031.h | 11 +
+ 4 files changed, 718 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/media/video/mt9p031.c
+ create mode 100644 include/media/mt9p031.h
+
+diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
+index 00f51dd..cb87e35 100644
+--- a/drivers/media/video/Kconfig
++++ b/drivers/media/video/Kconfig
+@@ -329,6 +329,13 @@ config VIDEO_OV7670
+ OV7670 VGA camera. It currently only works with the M88ALP01
+ controller.
+
++config VIDEO_MT9P031
++ tristate "Aptina MT9P031 support"
++ depends on I2C && VIDEO_V4L2
++ ---help---
++ This is a Video4Linux2 sensor-level driver for the Aptina
++ (Micron) mt9p031 5 Mpixel camera.
++
+ config VIDEO_MT9V011
+ tristate "Micron mt9v011 sensor support"
+ depends on I2C && VIDEO_V4L2
+diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
+index ace5d8b..912b29b 100644
+--- a/drivers/media/video/Makefile
++++ b/drivers/media/video/Makefile
+@@ -65,6 +65,7 @@ obj-$(CONFIG_VIDEO_UPD64083) += upd64083.o
+ obj-$(CONFIG_VIDEO_OV7670) += ov7670.o
+ obj-$(CONFIG_VIDEO_TCM825X) += tcm825x.o
+ obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o
++obj-$(CONFIG_VIDEO_MT9P031) += mt9p031.o
+ obj-$(CONFIG_VIDEO_MT9V011) += mt9v011.o
+ obj-$(CONFIG_VIDEO_SR030PC30) += sr030pc30.o
+ obj-$(CONFIG_VIDEO_NOON010PC30) += noon010pc30.o
+diff --git a/drivers/media/video/mt9p031.c b/drivers/media/video/mt9p031.c
+new file mode 100644
+index 0000000..61b46a0
+--- /dev/null
++++ b/drivers/media/video/mt9p031.c
+@@ -0,0 +1,699 @@
++/*
++ * Driver for MT9P031 CMOS Image Sensor from Aptina
++ *
++ * Copyright (C) 2011, Javier Martin <javier.martin@vista-silicon.com>
++ *
++ * Copyright (C) 2011, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
++ *
++ * Based on the MT9V032 driver and Bastian Hecht's code.
++ *
++ * 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/delay.h>
++#include <linux/device.h>
++#include <linux/i2c.h>
++#include <linux/log2.h>
++#include <linux/pm.h>
++#include <linux/slab.h>
++#include <media/v4l2-subdev.h>
++#include <linux/videodev2.h>
++
++#include <media/mt9p031.h>
++#include <media/v4l2-chip-ident.h>
++#include <media/v4l2-subdev.h>
++#include <media/v4l2-device.h>
++
++#define MT9P031_PIXCLK_FREQ 54000000
++
++#define MT9P031_CHIP_VERSION 0x00
++#define MT9P031_CHIP_VERSION_VALUE 0x1801
++#define MT9P031_ROW_START 0x01
++#define MT9P031_ROW_START_MIN 1
++#define MT9P031_ROW_START_MAX 2004
++#define MT9P031_ROW_START_DEF 54
++#define MT9P031_COLUMN_START 0x02
++#define MT9P031_COLUMN_START_MIN 1
++#define MT9P031_COLUMN_START_MAX 2750
++#define MT9P031_COLUMN_START_DEF 16
++#define MT9P031_WINDOW_HEIGHT 0x03
++#define MT9P031_WINDOW_HEIGHT_MIN 2
++#define MT9P031_WINDOW_HEIGHT_MAX 2003
++#define MT9P031_WINDOW_HEIGHT_DEF 2003
++#define MT9P031_WINDOW_WIDTH 0x04
++#define MT9P031_WINDOW_WIDTH_MIN 18
++#define MT9P031_WINDOW_WIDTH_MAX 2751
++#define MT9P031_WINDOW_WIDTH_DEF 2751
++#define MT9P031_H_BLANKING 0x05
++#define MT9P031_H_BLANKING_VALUE 0
++#define MT9P031_V_BLANKING 0x06
++#define MT9P031_V_BLANKING_VALUE 25
++#define MT9P031_OUTPUT_CONTROL 0x07
++#define MT9P031_OUTPUT_CONTROL_CEN 2
++#define MT9P031_OUTPUT_CONTROL_SYN 1
++#define MT9P031_SHUTTER_WIDTH_UPPER 0x08
++#define MT9P031_SHUTTER_WIDTH 0x09
++#define MT9P031_PIXEL_CLOCK_CONTROL 0x0a
++#define MT9P031_FRAME_RESTART 0x0b
++#define MT9P031_SHUTTER_DELAY 0x0c
++#define MT9P031_RST 0x0d
++#define MT9P031_RST_ENABLE 1
++#define MT9P031_RST_DISABLE 0
++#define MT9P031_READ_MODE_1 0x1e
++#define MT9P031_READ_MODE_2 0x20
++#define MT9P031_READ_MODE_2_ROW_MIR 0x8000
++#define MT9P031_READ_MODE_2_COL_MIR 0x4000
++#define MT9P031_ROW_ADDRESS_MODE 0x22
++#define MT9P031_COLUMN_ADDRESS_MODE 0x23
++#define MT9P031_GLOBAL_GAIN 0x35
++
++
++
++
++struct mt9p031 {
++ struct v4l2_subdev subdev;
++ struct media_pad pad;
++ struct v4l2_rect rect; /* Sensor window */
++ struct v4l2_mbus_framefmt format;
++ struct mt9p031_platform_data *pdata;
++ struct mutex power_lock; /* lock to protect power_count */
++ int power_count;
++ u16 xskip;
++ u16 yskip;
++ /* cache register values */
++ u16 output_control;
++};
++
++static struct mt9p031 *to_mt9p031(const struct i2c_client *client)
++{
++ return container_of(i2c_get_clientdata(client), struct mt9p031, subdev);
++}
++
++static int reg_read(struct i2c_client *client, const u8 reg)
++{
++ s32 data = i2c_smbus_read_word_data(client, reg);
++ return data < 0 ? data : swab16(data);
++}
++
++static int reg_write(struct i2c_client *client, const u8 reg,
++ const u16 data)
++{
++ return i2c_smbus_write_word_data(client, reg, swab16(data));
++}
++
++static int mt9p031_set_output_control(struct mt9p031 *mt9p031, u16 clear,
++ u16 set)
++{
++ struct i2c_client *client = v4l2_get_subdevdata(&mt9p031->subdev);
++ u16 value = (mt9p031->output_control & ~clear) | set;
++ int ret;
++
++ ret = reg_write(client, MT9P031_OUTPUT_CONTROL, value);
++ if (ret < 0)
++ return ret;
++ mt9p031->output_control = value;
++ return 0;
++}
++
++static int mt9p031_reset(struct i2c_client *client)
++{
++ struct mt9p031 *mt9p031 = to_mt9p031(client);
++ int ret;
++
++ /* Disable chip output, synchronous option update */
++ ret = reg_write(client, MT9P031_RST, MT9P031_RST_ENABLE);
++ if (ret < 0)
++ return ret;
++ ret = reg_write(client, MT9P031_RST, MT9P031_RST_DISABLE);
++ if (ret < 0)
++ return ret;
++ return mt9p031_set_output_control(mt9p031,
++ MT9P031_OUTPUT_CONTROL_CEN, 0);
++}
++
++static int mt9p031_power_on(struct mt9p031 *mt9p031)
++{
++ struct i2c_client *client = v4l2_get_subdevdata(&mt9p031->subdev);
++ int ret;
++
++ /* Ensure RESET_BAR is low */
++ if (mt9p031->pdata->reset) {
++ mt9p031->pdata->reset(&mt9p031->subdev, 1);
++ msleep(1);
++ }
++ /* Emable clock */
++ if (mt9p031->pdata->set_xclk)
++ mt9p031->pdata->set_xclk(&mt9p031->subdev, MT9P031_PIXCLK_FREQ);
++ /* Now RESET_BAR must be high */
++ if (mt9p031->pdata->reset) {
++ mt9p031->pdata->reset(&mt9p031->subdev, 0);
++ msleep(1);
++ }
++ /* soft reset */
++ ret = mt9p031_reset(client);
++ if (ret < 0) {
++ dev_err(&client->dev, "Failed to reset the camera\n");
++ return ret;
++ }
++ return 0;
++}
++
++static void mt9p031_power_off(struct mt9p031 *mt9p031)
++{
++ if (mt9p031->pdata->reset) {
++ mt9p031->pdata->reset(&mt9p031->subdev, 1);
++ msleep(1);
++ }
++ if (mt9p031->pdata->set_xclk)
++ mt9p031->pdata->set_xclk(&mt9p031->subdev, 0);
++}
++
++static int mt9p031_enum_mbus_code(struct v4l2_subdev *sd,
++ struct v4l2_subdev_fh *fh,
++ struct v4l2_subdev_mbus_code_enum *code)
++{
++ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
++
++ if (code->pad || code->index)
++ return -EINVAL;
++
++ code->code = mt9p031->format.code;
++ return 0;
++}
++
++static struct v4l2_mbus_framefmt *mt9p031_get_pad_format(
++ struct mt9p031 *mt9p031,
++ struct v4l2_subdev_fh *fh,
++ unsigned int pad, u32 which)
++{
++ switch (which) {
++ case V4L2_SUBDEV_FORMAT_TRY:
++ return v4l2_subdev_get_try_format(fh, pad);
++ case V4L2_SUBDEV_FORMAT_ACTIVE:
++ return &mt9p031->format;
++ default:
++ return NULL;
++ }
++}
++
++static struct v4l2_rect *mt9p031_get_pad_crop(struct mt9p031 *mt9p031,
++ struct v4l2_subdev_fh *fh, unsigned int pad, u32 which)
++{
++ switch (which) {
++ case V4L2_SUBDEV_FORMAT_TRY:
++ return v4l2_subdev_get_try_crop(fh, pad);
++ case V4L2_SUBDEV_FORMAT_ACTIVE:
++ return &mt9p031->rect;
++ default:
++ return NULL;
++ }
++}
++
++static int mt9p031_get_crop(struct v4l2_subdev *sd,
++ struct v4l2_subdev_fh *fh,
++ struct v4l2_subdev_crop *crop)
++{
++ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
++ struct v4l2_rect *rect = mt9p031_get_pad_crop(mt9p031, fh, crop->pad,
++ crop->which);
++ if (!rect)
++ return -EINVAL;
++
++ crop->rect = *rect;
++
++ return 0;
++}
++
++static u16 mt9p031_skip_for_crop(s32 source, s32 *target, s32 max_skip)
++{
++ unsigned int skip;
++
++ if (source - source / 4 < *target) {
++ *target = source;
++ return 1;
++ }
++
++ skip = DIV_ROUND_CLOSEST(source, *target);
++ if (skip > max_skip)
++ skip = max_skip;
++ *target = 2 * DIV_ROUND_UP(source, 2 * skip);
++
++ return skip;
++}
++
++static int mt9p031_set_params(struct i2c_client *client,
++ struct v4l2_rect *rect, u16 xskip, u16 yskip)
++{
++ struct mt9p031 *mt9p031 = to_mt9p031(client);
++ int ret;
++ u16 xbin, ybin;
++ const u16 hblank = MT9P031_H_BLANKING_VALUE,
++ vblank = MT9P031_V_BLANKING_VALUE;
++ __s32 left;
++
++ /*
++ * TODO: Attention! When implementing horizontal flipping, adjust
++ * alignment according to R2 "Column Start" description in the datasheet
++ */
++ if (xskip & 1) {
++ xbin = 1;
++ left = rect->left & (~3);
++ } else if (xskip & 2) {
++ xbin = 2;
++ left = rect->left & (~7);
++ } else {
++ xbin = 4;
++ left = rect->left & (~15);
++ }
++ ybin = min(yskip, (u16)4);
++
++ /* Disable register update, reconfigure atomically */
++ ret = mt9p031_set_output_control(mt9p031, 0,
++ MT9P031_OUTPUT_CONTROL_SYN);
++ if (ret < 0)
++ return ret;
++
++ dev_dbg(&client->dev, "skip %u:%u, rect %ux%u@%u:%u\n",
++ xskip, yskip, rect->width, rect->height, rect->left, rect->top);
++
++ /* Blanking and start values - default... */
++ ret = reg_write(client, MT9P031_H_BLANKING, hblank);
++ if (ret < 0)
++ return ret;
++ ret = reg_write(client, MT9P031_V_BLANKING, vblank);
++ if (ret < 0)
++ return ret;
++
++ ret = reg_write(client, MT9P031_COLUMN_ADDRESS_MODE,
++ ((xbin - 1) << 4) | (xskip - 1));
++ if (ret < 0)
++ return ret;
++ ret = reg_write(client, MT9P031_ROW_ADDRESS_MODE,
++ ((ybin - 1) << 4) | (yskip - 1));
++ if (ret < 0)
++ return ret;
++
++ dev_dbg(&client->dev, "new physical left %u, top %u\n",
++ rect->left, rect->top);
++
++ ret = reg_write(client, MT9P031_COLUMN_START,
++ rect->left);
++ if (ret < 0)
++ return ret;
++ ret = reg_write(client, MT9P031_ROW_START,
++ rect->top);
++ if (ret < 0)
++ return ret;
++
++ ret = reg_write(client, MT9P031_WINDOW_WIDTH,
++ rect->width - 1);
++ if (ret < 0)
++ return ret;
++ ret = reg_write(client, MT9P031_WINDOW_HEIGHT,
++ rect->height - 1);
++ if (ret < 0)
++ return ret;
++
++ /* Re-enable register update, commit all changes */
++ ret = mt9p031_set_output_control(mt9p031,
++ MT9P031_OUTPUT_CONTROL_SYN, 0);
++ if (ret < 0)
++ return ret;
++
++ mt9p031->xskip = xskip;
++ mt9p031->yskip = yskip;
++ return ret;
++}
++
++static int mt9p031_set_crop(struct v4l2_subdev *sd,
++ struct v4l2_subdev_fh *fh,
++ struct v4l2_subdev_crop *crop)
++{
++ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
++ struct v4l2_mbus_framefmt *f;
++ struct v4l2_rect *c;
++ struct v4l2_rect rect;
++ u16 xskip, yskip;
++ s32 width, height;
++
++ dev_dbg(mt9p031->subdev.v4l2_dev->dev, "%s(%ux%u@%u:%u : %u)\n",
++ __func__, crop->rect.width, crop->rect.height,
++ crop->rect.left, crop->rect.top, crop->which);
++
++ /*
++ * Clamp the crop rectangle boundaries and align them to a multiple of 2
++ * pixels.
++ */
++ rect.width = ALIGN(clamp(crop->rect.width,
++ MT9P031_WINDOW_WIDTH_MIN,
++ MT9P031_WINDOW_WIDTH_MAX), 2);
++ rect.height = ALIGN(clamp(crop->rect.height,
++ MT9P031_WINDOW_HEIGHT_MIN,
++ MT9P031_WINDOW_HEIGHT_MAX), 2);
++ rect.left = ALIGN(clamp(crop->rect.left,
++ MT9P031_COLUMN_START_MIN,
++ MT9P031_COLUMN_START_MAX), 2);
++ rect.top = ALIGN(clamp(crop->rect.top,
++ MT9P031_ROW_START_MIN,
++ MT9P031_ROW_START_MAX), 2);
++
++ c = mt9p031_get_pad_crop(mt9p031, fh, crop->pad, crop->which);
++
++ if (rect.width != c->width || rect.height != c->height) {
++ /*
++ * Reset the output image size if the crop rectangle size has
++ * been modified.
++ */
++ f = mt9p031_get_pad_format(mt9p031, fh, crop->pad,
++ crop->which);
++ width = f->width;
++ height = f->height;
++
++ xskip = mt9p031_skip_for_crop(rect.width, &width, 7);
++ yskip = mt9p031_skip_for_crop(rect.height, &height, 8);
++ } else {
++ xskip = mt9p031->xskip;
++ yskip = mt9p031->yskip;
++ f = NULL;
++ }
++ if (f) {
++ f->width = width;
++ f->height = height;
++ }
++
++ *c = rect;
++ crop->rect = rect;
++
++ mt9p031->xskip = xskip;
++ mt9p031->yskip = yskip;
++ mt9p031->rect = *c;
++ return 0;
++}
++
++static int mt9p031_get_format(struct v4l2_subdev *sd,
++ struct v4l2_subdev_fh *fh,
++ struct v4l2_subdev_format *fmt)
++{
++ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
++
++ fmt->format =
++ *mt9p031_get_pad_format(mt9p031, fh, fmt->pad, fmt->which);
++ return 0;
++}
++
++static u16 mt9p031_skip_for_scale(s32 *source, s32 target,
++ s32 max_skip, s32 max)
++{
++ unsigned int skip;
++
++ if (*source - *source / 4 < target) {
++ *source = target;
++ return 1;
++ }
++
++ skip = min(max, *source + target / 2) / target;
++ if (skip > max_skip)
++ skip = max_skip;
++ *source = target * skip;
++
++ return skip;
++}
++
++static int mt9p031_set_format(struct v4l2_subdev *sd,
++ struct v4l2_subdev_fh *fh,
++ struct v4l2_subdev_format *format)
++{
++ struct v4l2_mbus_framefmt *__format;
++ struct v4l2_rect *__crop, rect;
++ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
++ unsigned int width;
++ unsigned int height;
++ u16 xskip, yskip;
++
++ __crop = mt9p031_get_pad_crop(mt9p031, fh, format->pad, format->which);
++
++ width = clamp_t(int, ALIGN(format->format.width, 2), 2,
++ MT9P031_WINDOW_WIDTH_MAX);
++ height = clamp_t(int, ALIGN(format->format.height, 2), 2,
++ MT9P031_WINDOW_HEIGHT_MAX);
++
++ rect.width = __crop->width;
++ rect.height = __crop->height;
++
++ xskip = mt9p031_skip_for_scale(&rect.width, width, 7,
++ MT9P031_WINDOW_WIDTH_MAX);
++ if (rect.width + __crop->left > MT9P031_WINDOW_WIDTH_MAX)
++ rect.left = (MT9P031_WINDOW_WIDTH_MAX - rect.width) / 2;
++ else
++ rect.left = __crop->left;
++ yskip = mt9p031_skip_for_scale(&rect.height, height, 8,
++ MT9P031_WINDOW_HEIGHT_MAX);
++ if (rect.height + __crop->top > MT9P031_WINDOW_HEIGHT_MAX)
++ rect.top = (MT9P031_WINDOW_HEIGHT_MAX - rect.height) / 2;
++ else
++ rect.top = __crop->top;
++
++ dev_dbg(mt9p031->subdev.v4l2_dev->dev, "%s(%ux%u : %u)\n", __func__,
++ width, height, format->which);
++ if (__crop)
++ *__crop = rect;
++
++ __format = mt9p031_get_pad_format(mt9p031, fh, format->pad,
++ format->which);
++ __format->width = width;
++ __format->height = height;
++ format->format = *__format;
++
++ mt9p031->xskip = xskip;
++ mt9p031->yskip = yskip;
++ mt9p031->rect = *__crop;
++ return 0;
++}
++
++static int mt9p031_s_stream(struct v4l2_subdev *sd, int enable)
++{
++ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
++ struct i2c_client *client = v4l2_get_subdevdata(&mt9p031->subdev);
++ struct v4l2_rect rect = mt9p031->rect;
++ u16 xskip = mt9p031->xskip;
++ u16 yskip = mt9p031->yskip;
++ int ret;
++
++ if (enable) {
++ ret = mt9p031_set_params(client, &rect, xskip, yskip);
++ if (ret < 0)
++ return ret;
++ /* Switch to master "normal" mode */
++ ret = mt9p031_set_output_control(mt9p031, 0,
++ MT9P031_OUTPUT_CONTROL_CEN);
++ } else {
++ /* Stop sensor readout */
++ ret = mt9p031_set_output_control(mt9p031,
++ MT9P031_OUTPUT_CONTROL_CEN, 0);
++ }
++ return ret;
++}
++
++static int mt9p031_video_probe(struct i2c_client *client)
++{
++ s32 data;
++
++ /* Read out the chip version register */
++ data = reg_read(client, MT9P031_CHIP_VERSION);
++ if (data != MT9P031_CHIP_VERSION_VALUE) {
++ dev_err(&client->dev,
++ "No MT9P031 chip detected, register read %x\n", data);
++ return -ENODEV;
++ }
++
++ dev_info(&client->dev, "Detected a MT9P031 chip ID %x\n", data);
++
++ return 0;
++}
++
++static int mt9p031_set_power(struct v4l2_subdev *sd, int on)
++{
++ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
++ int ret = 0;
++
++ mutex_lock(&mt9p031->power_lock);
++
++ /*
++ * If the power count is modified from 0 to != 0 or from != 0 to 0,
++ * update the power state.
++ */
++ if (mt9p031->power_count == !on) {
++ if (on) {
++ ret = mt9p031_power_on(mt9p031);
++ if (ret) {
++ dev_err(mt9p031->subdev.v4l2_dev->dev,
++ "Failed to power on: %d\n", ret);
++ goto out;
++ }
++ } else {
++ mt9p031_power_off(mt9p031);
++ }
++ }
++
++ /* Update the power count. */
++ mt9p031->power_count += on ? 1 : -1;
++ WARN_ON(mt9p031->power_count < 0);
++
++out:
++ mutex_unlock(&mt9p031->power_lock);
++ return ret;
++}
++
++static int mt9p031_registered(struct v4l2_subdev *sd)
++{
++ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
++ struct i2c_client *client = v4l2_get_subdevdata(&mt9p031->subdev);
++ int ret;
++
++ ret = mt9p031_set_power(&mt9p031->subdev, 1);
++ if (ret) {
++ dev_err(&client->dev,
++ "Failed to power on device: %d\n", ret);
++ return ret;
++ }
++
++ ret = mt9p031_video_probe(client);
++
++ mt9p031_set_power(&mt9p031->subdev, 0);
++
++ return ret;
++}
++
++static int mt9p031_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
++{
++ struct mt9p031 *mt9p031;
++ mt9p031 = container_of(sd, struct mt9p031, subdev);
++
++ mt9p031->rect.width = MT9P031_WINDOW_WIDTH_DEF;
++ mt9p031->rect.height = MT9P031_WINDOW_HEIGHT_DEF;
++ mt9p031->rect.left = MT9P031_COLUMN_START_DEF;
++ mt9p031->rect.top = MT9P031_ROW_START_DEF;
++
++ mt9p031->format.code = V4L2_MBUS_FMT_SGRBG12_1X12;
++ mt9p031->format.width = MT9P031_WINDOW_WIDTH_DEF;
++ mt9p031->format.height = MT9P031_WINDOW_HEIGHT_DEF;
++ mt9p031->format.field = V4L2_FIELD_NONE;
++ mt9p031->format.colorspace = V4L2_COLORSPACE_SRGB;
++
++ mt9p031->xskip = 1;
++ mt9p031->yskip = 1;
++ return mt9p031_set_power(sd, 1);
++}
++
++static int mt9p031_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
++{
++ return mt9p031_set_power(sd, 0);
++}
++
++static struct v4l2_subdev_core_ops mt9p031_subdev_core_ops = {
++ .s_power = mt9p031_set_power,
++};
++
++static struct v4l2_subdev_video_ops mt9p031_subdev_video_ops = {
++ .s_stream = mt9p031_s_stream,
++};
++
++static struct v4l2_subdev_pad_ops mt9p031_subdev_pad_ops = {
++ .enum_mbus_code = mt9p031_enum_mbus_code,
++ .get_fmt = mt9p031_get_format,
++ .set_fmt = mt9p031_set_format,
++ .get_crop = mt9p031_get_crop,
++ .set_crop = mt9p031_set_crop,
++};
++
++static struct v4l2_subdev_ops mt9p031_subdev_ops = {
++ .core = &mt9p031_subdev_core_ops,
++ .video = &mt9p031_subdev_video_ops,
++ .pad = &mt9p031_subdev_pad_ops,
++};
++
++static const struct v4l2_subdev_internal_ops mt9p031_subdev_internal_ops = {
++ .registered = mt9p031_registered,
++ .open = mt9p031_open,
++ .close = mt9p031_close,
++};
++
++static int mt9p031_probe(struct i2c_client *client,
++ const struct i2c_device_id *did)
++{
++ int ret;
++ struct mt9p031 *mt9p031;
++ struct mt9p031_platform_data *pdata = client->dev.platform_data;
++ struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
++
++ if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA)) {
++ dev_warn(&adapter->dev,
++ "I2C-Adapter doesn't support I2C_FUNC_SMBUS_WORD\n");
++ return -EIO;
++ }
++
++ mt9p031 = kzalloc(sizeof(struct mt9p031), GFP_KERNEL);
++ if (!mt9p031)
++ return -ENOMEM;
++
++ mutex_init(&mt9p031->power_lock);
++ v4l2_i2c_subdev_init(&mt9p031->subdev, client, &mt9p031_subdev_ops);
++ mt9p031->subdev.internal_ops = &mt9p031_subdev_internal_ops;
++
++ mt9p031->pdata = pdata;
++
++ mt9p031->pad.flags = MEDIA_PAD_FL_SOURCE;
++ ret = media_entity_init(&mt9p031->subdev.entity, 1, &mt9p031->pad, 0);
++ if (ret)
++ return ret;
++
++ mt9p031->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
++
++ return 0;
++}
++
++static int mt9p031_remove(struct i2c_client *client)
++{
++ struct v4l2_subdev *sd = i2c_get_clientdata(client);
++ struct mt9p031 *mt9p031 = container_of(sd, struct mt9p031, subdev);
++
++ v4l2_device_unregister_subdev(sd);
++ media_entity_cleanup(&sd->entity);
++ kfree(mt9p031);
++
++ return 0;
++}
++
++static const struct i2c_device_id mt9p031_id[] = {
++ { "mt9p031", 0 },
++ { }
++};
++MODULE_DEVICE_TABLE(i2c, mt9p031_id);
++
++static struct i2c_driver mt9p031_i2c_driver = {
++ .driver = {
++ .name = "mt9p031",
++ },
++ .probe = mt9p031_probe,
++ .remove = mt9p031_remove,
++ .id_table = mt9p031_id,
++};
++
++static int __init mt9p031_mod_init(void)
++{
++ return i2c_add_driver(&mt9p031_i2c_driver);
++}
++
++static void __exit mt9p031_mod_exit(void)
++{
++ i2c_del_driver(&mt9p031_i2c_driver);
++}
++
++module_init(mt9p031_mod_init);
++module_exit(mt9p031_mod_exit);
++
++MODULE_DESCRIPTION("Aptina MT9P031 Camera driver");
++MODULE_AUTHOR("Bastian Hecht <hechtb@gmail.com>");
++MODULE_LICENSE("GPL v2");
+diff --git a/include/media/mt9p031.h b/include/media/mt9p031.h
+new file mode 100644
+index 0000000..ad37eb3
+--- /dev/null
++++ b/include/media/mt9p031.h
+@@ -0,0 +1,11 @@
++#ifndef MT9P031_H
++#define MT9P031_H
++
++struct v4l2_subdev;
++
++struct mt9p031_platform_data {
++ int (*set_xclk)(struct v4l2_subdev *subdev, int hz);
++ int (*reset)(struct v4l2_subdev *subdev, int active);
++};
++
++#endif
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/camera/0002-v4l-Add-mt9v032-sensor-driver.patch b/recipes/linux/linux-omap-2.6.39/camera/0002-v4l-Add-mt9v032-sensor-driver.patch
new file mode 100644
index 0000000000..2b7e9557f2
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/camera/0002-v4l-Add-mt9v032-sensor-driver.patch
@@ -0,0 +1,853 @@
+From 78fdfee2f749cdcdfa69a008b70c4e5629b9c9df Mon Sep 17 00:00:00 2001
+From: Detlev Casanova <detlev.casanova@gmail.com>
+Date: Sun, 28 Nov 2010 19:07:20 +0100
+Subject: [PATCH 2/3] v4l: Add mt9v032 sensor driver
+
+The MT9V032 is a parallel wide VGA sensor from Aptina (formerly Micron)
+controlled through I2C.
+
+The driver creates a V4L2 subdevice. It currently supports binning and
+cropping, and the gain, auto gain, exposure, auto exposure and test
+pattern controls.
+
+Signed-off-by: Detlev Casanova <detlev.casanova@gmail.com>
+Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+---
+ drivers/media/video/Kconfig | 7 +
+ drivers/media/video/Makefile | 1 +
+ drivers/media/video/mt9v032.c | 773 +++++++++++++++++++++++++++++++++++++++++
+ include/media/mt9v032.h | 12 +
+ 4 files changed, 793 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/media/video/mt9v032.c
+ create mode 100644 include/media/mt9v032.h
+
+diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
+index cb87e35..3a5bc57 100644
+--- a/drivers/media/video/Kconfig
++++ b/drivers/media/video/Kconfig
+@@ -344,6 +344,13 @@ config VIDEO_MT9V011
+ mt0v011 1.3 Mpixel camera. It currently only works with the
+ em28xx driver.
+
++config VIDEO_MT9V032
++ tristate "Micron MT9V032 sensor support"
++ depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
++ ---help---
++ This is a Video4Linux2 sensor-level driver for the Micron
++ MT9V032 752x480 CMOS sensor.
++
+ config VIDEO_TCM825X
+ tristate "TCM825x camera sensor support"
+ depends on I2C && VIDEO_V4L2
+diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
+index 912b29b..6679c6a 100644
+--- a/drivers/media/video/Makefile
++++ b/drivers/media/video/Makefile
+@@ -67,6 +67,7 @@ obj-$(CONFIG_VIDEO_TCM825X) += tcm825x.o
+ obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o
+ obj-$(CONFIG_VIDEO_MT9P031) += mt9p031.o
+ obj-$(CONFIG_VIDEO_MT9V011) += mt9v011.o
++obj-$(CONFIG_VIDEO_MT9V032) += mt9v032.o
+ obj-$(CONFIG_VIDEO_SR030PC30) += sr030pc30.o
+ obj-$(CONFIG_VIDEO_NOON010PC30) += noon010pc30.o
+
+diff --git a/drivers/media/video/mt9v032.c b/drivers/media/video/mt9v032.c
+new file mode 100644
+index 0000000..c64e1dc
+--- /dev/null
++++ b/drivers/media/video/mt9v032.c
+@@ -0,0 +1,773 @@
++/*
++ * Driver for MT9V032 CMOS Image Sensor from Micron
++ *
++ * Copyright (C) 2010, Laurent Pinchart <laurent.pinchart@ideasonboard.com>
++ *
++ * Based on the MT9M001 driver,
++ *
++ * Copyright (C) 2008, Guennadi Liakhovetski <kernel@pengutronix.de>
++ *
++ * 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/delay.h>
++#include <linux/i2c.h>
++#include <linux/log2.h>
++#include <linux/mutex.h>
++#include <linux/slab.h>
++#include <linux/videodev2.h>
++#include <linux/v4l2-mediabus.h>
++
++#include <media/mt9v032.h>
++#include <media/v4l2-ctrls.h>
++#include <media/v4l2-device.h>
++#include <media/v4l2-subdev.h>
++
++#define MT9V032_PIXEL_ARRAY_HEIGHT 492
++#define MT9V032_PIXEL_ARRAY_WIDTH 782
++
++#define MT9V032_CHIP_VERSION 0x00
++#define MT9V032_CHIP_ID_REV1 0x1311
++#define MT9V032_CHIP_ID_REV3 0x1313
++#define MT9V032_COLUMN_START 0x01
++#define MT9V032_COLUMN_START_MIN 1
++#define MT9V032_COLUMN_START_DEF 1
++#define MT9V032_COLUMN_START_MAX 752
++#define MT9V032_ROW_START 0x02
++#define MT9V032_ROW_START_MIN 4
++#define MT9V032_ROW_START_DEF 5
++#define MT9V032_ROW_START_MAX 482
++#define MT9V032_WINDOW_HEIGHT 0x03
++#define MT9V032_WINDOW_HEIGHT_MIN 1
++#define MT9V032_WINDOW_HEIGHT_DEF 480
++#define MT9V032_WINDOW_HEIGHT_MAX 480
++#define MT9V032_WINDOW_WIDTH 0x04
++#define MT9V032_WINDOW_WIDTH_MIN 1
++#define MT9V032_WINDOW_WIDTH_DEF 752
++#define MT9V032_WINDOW_WIDTH_MAX 752
++#define MT9V032_HORIZONTAL_BLANKING 0x05
++#define MT9V032_HORIZONTAL_BLANKING_MIN 43
++#define MT9V032_HORIZONTAL_BLANKING_MAX 1023
++#define MT9V032_VERTICAL_BLANKING 0x06
++#define MT9V032_VERTICAL_BLANKING_MIN 4
++#define MT9V032_VERTICAL_BLANKING_MAX 3000
++#define MT9V032_CHIP_CONTROL 0x07
++#define MT9V032_CHIP_CONTROL_MASTER_MODE (1 << 3)
++#define MT9V032_CHIP_CONTROL_DOUT_ENABLE (1 << 7)
++#define MT9V032_CHIP_CONTROL_SEQUENTIAL (1 << 8)
++#define MT9V032_SHUTTER_WIDTH1 0x08
++#define MT9V032_SHUTTER_WIDTH2 0x09
++#define MT9V032_SHUTTER_WIDTH_CONTROL 0x0a
++#define MT9V032_TOTAL_SHUTTER_WIDTH 0x0b
++#define MT9V032_TOTAL_SHUTTER_WIDTH_MIN 1
++#define MT9V032_TOTAL_SHUTTER_WIDTH_DEF 480
++#define MT9V032_TOTAL_SHUTTER_WIDTH_MAX 32767
++#define MT9V032_RESET 0x0c
++#define MT9V032_READ_MODE 0x0d
++#define MT9V032_READ_MODE_ROW_BIN_MASK (3 << 0)
++#define MT9V032_READ_MODE_ROW_BIN_SHIFT 0
++#define MT9V032_READ_MODE_COLUMN_BIN_MASK (3 << 2)
++#define MT9V032_READ_MODE_COLUMN_BIN_SHIFT 2
++#define MT9V032_READ_MODE_ROW_FLIP (1 << 4)
++#define MT9V032_READ_MODE_COLUMN_FLIP (1 << 5)
++#define MT9V032_READ_MODE_DARK_COLUMNS (1 << 6)
++#define MT9V032_READ_MODE_DARK_ROWS (1 << 7)
++#define MT9V032_PIXEL_OPERATION_MODE 0x0f
++#define MT9V032_PIXEL_OPERATION_MODE_COLOR (1 << 2)
++#define MT9V032_PIXEL_OPERATION_MODE_HDR (1 << 6)
++#define MT9V032_ANALOG_GAIN 0x35
++#define MT9V032_ANALOG_GAIN_MIN 16
++#define MT9V032_ANALOG_GAIN_DEF 16
++#define MT9V032_ANALOG_GAIN_MAX 64
++#define MT9V032_MAX_ANALOG_GAIN 0x36
++#define MT9V032_MAX_ANALOG_GAIN_MAX 127
++#define MT9V032_FRAME_DARK_AVERAGE 0x42
++#define MT9V032_DARK_AVG_THRESH 0x46
++#define MT9V032_DARK_AVG_LOW_THRESH_MASK (255 << 0)
++#define MT9V032_DARK_AVG_LOW_THRESH_SHIFT 0
++#define MT9V032_DARK_AVG_HIGH_THRESH_MASK (255 << 8)
++#define MT9V032_DARK_AVG_HIGH_THRESH_SHIFT 8
++#define MT9V032_ROW_NOISE_CORR_CONTROL 0x70
++#define MT9V032_ROW_NOISE_CORR_ENABLE (1 << 5)
++#define MT9V032_ROW_NOISE_CORR_USE_BLK_AVG (1 << 7)
++#define MT9V032_PIXEL_CLOCK 0x74
++#define MT9V032_PIXEL_CLOCK_INV_LINE (1 << 0)
++#define MT9V032_PIXEL_CLOCK_INV_FRAME (1 << 1)
++#define MT9V032_PIXEL_CLOCK_XOR_LINE (1 << 2)
++#define MT9V032_PIXEL_CLOCK_CONT_LINE (1 << 3)
++#define MT9V032_PIXEL_CLOCK_INV_PXL_CLK (1 << 4)
++#define MT9V032_TEST_PATTERN 0x7f
++#define MT9V032_TEST_PATTERN_DATA_MASK (1023 << 0)
++#define MT9V032_TEST_PATTERN_DATA_SHIFT 0
++#define MT9V032_TEST_PATTERN_USE_DATA (1 << 10)
++#define MT9V032_TEST_PATTERN_GRAY_MASK (3 << 11)
++#define MT9V032_TEST_PATTERN_GRAY_NONE (0 << 11)
++#define MT9V032_TEST_PATTERN_GRAY_VERTICAL (1 << 11)
++#define MT9V032_TEST_PATTERN_GRAY_HORIZONTAL (2 << 11)
++#define MT9V032_TEST_PATTERN_GRAY_DIAGONAL (3 << 11)
++#define MT9V032_TEST_PATTERN_ENABLE (1 << 13)
++#define MT9V032_TEST_PATTERN_FLIP (1 << 14)
++#define MT9V032_AEC_AGC_ENABLE 0xaf
++#define MT9V032_AEC_ENABLE (1 << 0)
++#define MT9V032_AGC_ENABLE (1 << 1)
++#define MT9V032_THERMAL_INFO 0xc1
++
++struct mt9v032 {
++ struct v4l2_subdev subdev;
++ struct media_pad pad;
++
++ struct v4l2_mbus_framefmt format;
++ struct v4l2_rect crop;
++
++ struct v4l2_ctrl_handler ctrls;
++
++ struct mutex power_lock;
++ int power_count;
++
++ struct mt9v032_platform_data *pdata;
++ u16 chip_control;
++ u16 aec_agc;
++};
++
++static struct mt9v032 *to_mt9v032(struct v4l2_subdev *sd)
++{
++ return container_of(sd, struct mt9v032, subdev);
++}
++
++static int mt9v032_read(struct i2c_client *client, const u8 reg)
++{
++ s32 data = i2c_smbus_read_word_data(client, reg);
++ dev_dbg(&client->dev, "%s: read 0x%04x from 0x%02x\n", __func__,
++ swab16(data), reg);
++ return data < 0 ? data : swab16(data);
++}
++
++static int mt9v032_write(struct i2c_client *client, const u8 reg,
++ const u16 data)
++{
++ dev_dbg(&client->dev, "%s: writing 0x%04x to 0x%02x\n", __func__,
++ data, reg);
++ return i2c_smbus_write_word_data(client, reg, swab16(data));
++}
++
++static int mt9v032_set_chip_control(struct mt9v032 *mt9v032, u16 clear, u16 set)
++{
++ struct i2c_client *client = v4l2_get_subdevdata(&mt9v032->subdev);
++ u16 value = (mt9v032->chip_control & ~clear) | set;
++ int ret;
++
++ ret = mt9v032_write(client, MT9V032_CHIP_CONTROL, value);
++ if (ret < 0)
++ return ret;
++
++ mt9v032->chip_control = value;
++ return 0;
++}
++
++static int
++mt9v032_update_aec_agc(struct mt9v032 *mt9v032, u16 which, int enable)
++{
++ struct i2c_client *client = v4l2_get_subdevdata(&mt9v032->subdev);
++ u16 value = mt9v032->aec_agc;
++ int ret;
++
++ if (enable)
++ value |= which;
++ else
++ value &= ~which;
++
++ ret = mt9v032_write(client, MT9V032_AEC_AGC_ENABLE, value);
++ if (ret < 0)
++ return ret;
++
++ mt9v032->aec_agc = value;
++ return 0;
++}
++
++static int mt9v032_power_on(struct mt9v032 *mt9v032)
++{
++ struct i2c_client *client = v4l2_get_subdevdata(&mt9v032->subdev);
++ int ret;
++
++ if (mt9v032->pdata->set_clock) {
++ mt9v032->pdata->set_clock(&mt9v032->subdev, 25000000);
++ udelay(1);
++ }
++
++ /* Reset the chip and stop data read out */
++ ret = mt9v032_write(client, MT9V032_RESET, 1);
++ if (ret < 0)
++ return ret;
++
++ ret = mt9v032_write(client, MT9V032_RESET, 0);
++ if (ret < 0)
++ return ret;
++
++ return mt9v032_write(client, MT9V032_CHIP_CONTROL, 0);
++}
++
++static void mt9v032_power_off(struct mt9v032 *mt9v032)
++{
++ if (mt9v032->pdata->set_clock)
++ mt9v032->pdata->set_clock(&mt9v032->subdev, 0);
++}
++
++static int __mt9v032_set_power(struct mt9v032 *mt9v032, bool on)
++{
++ struct i2c_client *client = v4l2_get_subdevdata(&mt9v032->subdev);
++ int ret;
++
++ if (!on) {
++ mt9v032_power_off(mt9v032);
++ return 0;
++ }
++
++ ret = mt9v032_power_on(mt9v032);
++ if (ret < 0)
++ return ret;
++
++ /* Configure the pixel clock polarity */
++ if (mt9v032->pdata && mt9v032->pdata->clk_pol) {
++ ret = mt9v032_write(client, MT9V032_PIXEL_CLOCK,
++ MT9V032_PIXEL_CLOCK_INV_PXL_CLK);
++ if (ret < 0)
++ return ret;
++ }
++
++ /* Disable the noise correction algorithm and restore the controls. */
++ ret = mt9v032_write(client, MT9V032_ROW_NOISE_CORR_CONTROL, 0);
++ if (ret < 0)
++ return ret;
++
++ return v4l2_ctrl_handler_setup(&mt9v032->ctrls);
++}
++
++/* -----------------------------------------------------------------------------
++ * V4L2 subdev video operations
++ */
++
++static struct v4l2_mbus_framefmt *
++__mt9v032_get_pad_format(struct mt9v032 *mt9v032, struct v4l2_subdev_fh *fh,
++ unsigned int pad, enum v4l2_subdev_format_whence which)
++{
++ switch (which) {
++ case V4L2_SUBDEV_FORMAT_TRY:
++ return v4l2_subdev_get_try_format(fh, pad);
++ case V4L2_SUBDEV_FORMAT_ACTIVE:
++ return &mt9v032->format;
++ default:
++ return NULL;
++ }
++}
++
++static struct v4l2_rect *
++__mt9v032_get_pad_crop(struct mt9v032 *mt9v032, struct v4l2_subdev_fh *fh,
++ unsigned int pad, enum v4l2_subdev_format_whence which)
++{
++ switch (which) {
++ case V4L2_SUBDEV_FORMAT_TRY:
++ return v4l2_subdev_get_try_crop(fh, pad);
++ case V4L2_SUBDEV_FORMAT_ACTIVE:
++ return &mt9v032->crop;
++ default:
++ return NULL;
++ }
++}
++
++static int mt9v032_s_stream(struct v4l2_subdev *subdev, int enable)
++{
++ const u16 mode = MT9V032_CHIP_CONTROL_MASTER_MODE
++ | MT9V032_CHIP_CONTROL_DOUT_ENABLE
++ | MT9V032_CHIP_CONTROL_SEQUENTIAL;
++ struct i2c_client *client = v4l2_get_subdevdata(subdev);
++ struct mt9v032 *mt9v032 = to_mt9v032(subdev);
++ struct v4l2_mbus_framefmt *format = &mt9v032->format;
++ struct v4l2_rect *crop = &mt9v032->crop;
++ unsigned int hratio;
++ unsigned int vratio;
++ int ret;
++
++ if (!enable)
++ return mt9v032_set_chip_control(mt9v032, mode, 0);
++
++ /* Configure the window size and row/column bin */
++ hratio = DIV_ROUND_CLOSEST(crop->width, format->width);
++ vratio = DIV_ROUND_CLOSEST(crop->height, format->height);
++
++ ret = mt9v032_write(client, MT9V032_READ_MODE,
++ (hratio - 1) << MT9V032_READ_MODE_ROW_BIN_SHIFT |
++ (vratio - 1) << MT9V032_READ_MODE_COLUMN_BIN_SHIFT);
++ if (ret < 0)
++ return ret;
++
++ ret = mt9v032_write(client, MT9V032_COLUMN_START, crop->left);
++ if (ret < 0)
++ return ret;
++
++ ret = mt9v032_write(client, MT9V032_ROW_START, crop->top);
++ if (ret < 0)
++ return ret;
++
++ ret = mt9v032_write(client, MT9V032_WINDOW_WIDTH, crop->width);
++ if (ret < 0)
++ return ret;
++
++ ret = mt9v032_write(client, MT9V032_WINDOW_HEIGHT, crop->height);
++ if (ret < 0)
++ return ret;
++
++ ret = mt9v032_write(client, MT9V032_HORIZONTAL_BLANKING,
++ max(43, 660 - crop->width));
++ if (ret < 0)
++ return ret;
++
++ /* Switch to master "normal" mode */
++ return mt9v032_set_chip_control(mt9v032, 0, mode);
++}
++
++static int mt9v032_enum_mbus_code(struct v4l2_subdev *subdev,
++ struct v4l2_subdev_fh *fh,
++ struct v4l2_subdev_mbus_code_enum *code)
++{
++ if (code->index > 0)
++ return -EINVAL;
++
++ code->code = V4L2_MBUS_FMT_SGRBG10_1X10;
++ return 0;
++}
++
++static int mt9v032_enum_frame_size(struct v4l2_subdev *subdev,
++ struct v4l2_subdev_fh *fh,
++ struct v4l2_subdev_frame_size_enum *fse)
++{
++ if (fse->index >= 8 || fse->code != V4L2_MBUS_FMT_SGRBG10_1X10)
++ return -EINVAL;
++
++ fse->min_width = MT9V032_WINDOW_WIDTH_DEF / fse->index;
++ fse->max_width = fse->min_width;
++ fse->min_height = MT9V032_WINDOW_HEIGHT_DEF / fse->index;
++ fse->max_height = fse->min_height;
++
++ return 0;
++}
++
++static int mt9v032_get_format(struct v4l2_subdev *subdev,
++ struct v4l2_subdev_fh *fh,
++ struct v4l2_subdev_format *format)
++{
++ struct mt9v032 *mt9v032 = to_mt9v032(subdev);
++
++ format->format = *__mt9v032_get_pad_format(mt9v032, fh, format->pad,
++ format->which);
++ return 0;
++}
++
++static int mt9v032_set_format(struct v4l2_subdev *subdev,
++ struct v4l2_subdev_fh *fh,
++ struct v4l2_subdev_format *format)
++{
++ struct mt9v032 *mt9v032 = to_mt9v032(subdev);
++ struct v4l2_mbus_framefmt *__format;
++ struct v4l2_rect *__crop;
++ unsigned int width;
++ unsigned int height;
++ unsigned int hratio;
++ unsigned int vratio;
++
++ __crop = __mt9v032_get_pad_crop(mt9v032, fh, format->pad,
++ format->which);
++
++ /* Clamp the width and height to avoid dividing by zero. */
++ width = clamp_t(unsigned int, ALIGN(format->format.width, 2),
++ max(__crop->width / 8, MT9V032_WINDOW_WIDTH_MIN),
++ __crop->width);
++ height = clamp_t(unsigned int, ALIGN(format->format.height, 2),
++ max(__crop->height / 8, MT9V032_WINDOW_HEIGHT_MIN),
++ __crop->height);
++
++ hratio = DIV_ROUND_CLOSEST(__crop->width, width);
++ vratio = DIV_ROUND_CLOSEST(__crop->height, height);
++
++ __format = __mt9v032_get_pad_format(mt9v032, fh, format->pad,
++ format->which);
++ __format->width = __crop->width / hratio;
++ __format->height = __crop->height / vratio;
++
++ format->format = *__format;
++
++ return 0;
++}
++
++static int mt9v032_get_crop(struct v4l2_subdev *subdev,
++ struct v4l2_subdev_fh *fh,
++ struct v4l2_subdev_crop *crop)
++{
++ struct mt9v032 *mt9v032 = to_mt9v032(subdev);
++
++ crop->rect = *__mt9v032_get_pad_crop(mt9v032, fh, crop->pad,
++ crop->which);
++ return 0;
++}
++
++static int mt9v032_set_crop(struct v4l2_subdev *subdev,
++ struct v4l2_subdev_fh *fh,
++ struct v4l2_subdev_crop *crop)
++{
++ struct mt9v032 *mt9v032 = to_mt9v032(subdev);
++ struct v4l2_mbus_framefmt *__format;
++ struct v4l2_rect *__crop;
++ struct v4l2_rect rect;
++
++ /* Clamp the crop rectangle boundaries and align them to a non multiple
++ * of 2 pixels to ensure a GRBG Bayer pattern.
++ */
++ rect.left = clamp(ALIGN(crop->rect.left + 1, 2) - 1,
++ MT9V032_COLUMN_START_MIN,
++ MT9V032_COLUMN_START_MAX);
++ rect.top = clamp(ALIGN(crop->rect.top + 1, 2) - 1,
++ MT9V032_ROW_START_MIN,
++ MT9V032_ROW_START_MAX);
++ rect.width = clamp(ALIGN(crop->rect.width, 2),
++ MT9V032_WINDOW_WIDTH_MIN,
++ MT9V032_WINDOW_WIDTH_MAX);
++ rect.height = clamp(ALIGN(crop->rect.height, 2),
++ MT9V032_WINDOW_HEIGHT_MIN,
++ MT9V032_WINDOW_HEIGHT_MAX);
++
++ rect.width = min(rect.width, MT9V032_PIXEL_ARRAY_WIDTH - rect.left);
++ rect.height = min(rect.height, MT9V032_PIXEL_ARRAY_HEIGHT - rect.top);
++
++ __crop = __mt9v032_get_pad_crop(mt9v032, fh, crop->pad, crop->which);
++
++ if (rect.width != __crop->width || rect.height != __crop->height) {
++ /* Reset the output image size if the crop rectangle size has
++ * been modified.
++ */
++ __format = __mt9v032_get_pad_format(mt9v032, fh, crop->pad,
++ crop->which);
++ __format->width = rect.width;
++ __format->height = rect.height;
++ }
++
++ *__crop = rect;
++ crop->rect = rect;
++
++ return 0;
++}
++
++/* -----------------------------------------------------------------------------
++ * V4L2 subdev control operations
++ */
++
++#define V4L2_CID_TEST_PATTERN (V4L2_CID_USER_BASE | 0x1001)
++
++static int mt9v032_s_ctrl(struct v4l2_ctrl *ctrl)
++{
++ struct mt9v032 *mt9v032 =
++ container_of(ctrl->handler, struct mt9v032, ctrls);
++ struct i2c_client *client = v4l2_get_subdevdata(&mt9v032->subdev);
++ u16 data;
++
++ switch (ctrl->id) {
++ case V4L2_CID_AUTOGAIN:
++ return mt9v032_update_aec_agc(mt9v032, MT9V032_AGC_ENABLE,
++ ctrl->val);
++
++ case V4L2_CID_GAIN:
++ return mt9v032_write(client, MT9V032_ANALOG_GAIN, ctrl->val);
++
++ case V4L2_CID_EXPOSURE_AUTO:
++ return mt9v032_update_aec_agc(mt9v032, MT9V032_AEC_ENABLE,
++ ctrl->val);
++
++ case V4L2_CID_EXPOSURE:
++ return mt9v032_write(client, MT9V032_TOTAL_SHUTTER_WIDTH,
++ ctrl->val);
++
++ case V4L2_CID_TEST_PATTERN:
++ switch (ctrl->val) {
++ case 0:
++ data = 0;
++ break;
++ case 1:
++ data = MT9V032_TEST_PATTERN_GRAY_VERTICAL
++ | MT9V032_TEST_PATTERN_ENABLE;
++ break;
++ case 2:
++ data = MT9V032_TEST_PATTERN_GRAY_HORIZONTAL
++ | MT9V032_TEST_PATTERN_ENABLE;
++ break;
++ case 3:
++ data = MT9V032_TEST_PATTERN_GRAY_DIAGONAL
++ | MT9V032_TEST_PATTERN_ENABLE;
++ break;
++ default:
++ data = (ctrl->val << MT9V032_TEST_PATTERN_DATA_SHIFT)
++ | MT9V032_TEST_PATTERN_USE_DATA
++ | MT9V032_TEST_PATTERN_ENABLE
++ | MT9V032_TEST_PATTERN_FLIP;
++ break;
++ }
++
++ return mt9v032_write(client, MT9V032_TEST_PATTERN, data);
++ }
++
++ return 0;
++}
++
++static struct v4l2_ctrl_ops mt9v032_ctrl_ops = {
++ .s_ctrl = mt9v032_s_ctrl,
++};
++
++static const struct v4l2_ctrl_config mt9v032_ctrls[] = {
++ {
++ .ops = &mt9v032_ctrl_ops,
++ .id = V4L2_CID_TEST_PATTERN,
++ .type = V4L2_CTRL_TYPE_INTEGER,
++ .name = "Test pattern",
++ .min = 0,
++ .max = 1023,
++ .step = 1,
++ .def = 0,
++ .flags = 0,
++ }
++};
++
++/* -----------------------------------------------------------------------------
++ * V4L2 subdev core operations
++ */
++
++static int mt9v032_set_power(struct v4l2_subdev *subdev, int on)
++{
++ struct mt9v032 *mt9v032 = to_mt9v032(subdev);
++ int ret = 0;
++
++ mutex_lock(&mt9v032->power_lock);
++
++ /* If the power count is modified from 0 to != 0 or from != 0 to 0,
++ * update the power state.
++ */
++ if (mt9v032->power_count == !on) {
++ ret = __mt9v032_set_power(mt9v032, !!on);
++ if (ret < 0)
++ goto done;
++ }
++
++ /* Update the power count. */
++ mt9v032->power_count += on ? 1 : -1;
++ WARN_ON(mt9v032->power_count < 0);
++
++done:
++ mutex_unlock(&mt9v032->power_lock);
++ return ret;
++}
++
++/* -----------------------------------------------------------------------------
++ * V4L2 subdev internal operations
++ */
++
++static int mt9v032_registered(struct v4l2_subdev *subdev)
++{
++ struct i2c_client *client = v4l2_get_subdevdata(subdev);
++ struct mt9v032 *mt9v032 = to_mt9v032(subdev);
++ s32 data;
++ int ret;
++
++ dev_info(&client->dev, "Probing MT9V032 at address 0x%02x\n",
++ client->addr);
++
++ ret = mt9v032_power_on(mt9v032);
++ if (ret < 0) {
++ dev_err(&client->dev, "MT9V032 power up failed\n");
++ return ret;
++ }
++
++ /* Read and check the sensor version */
++ data = mt9v032_read(client, MT9V032_CHIP_VERSION);
++ if (data != MT9V032_CHIP_ID_REV1 && data != MT9V032_CHIP_ID_REV3) {
++ dev_err(&client->dev, "MT9V032 not detected, wrong version "
++ "0x%04x\n", data);
++ return -ENODEV;
++ }
++
++ mt9v032_power_off(mt9v032);
++
++ dev_info(&client->dev, "MT9V032 detected at address 0x%02x\n",
++ client->addr);
++
++ return ret;
++}
++
++static int mt9v032_open(struct v4l2_subdev *subdev, struct v4l2_subdev_fh *fh)
++{
++ struct v4l2_mbus_framefmt *format;
++ struct v4l2_rect *crop;
++
++ crop = v4l2_subdev_get_try_crop(fh, 0);
++ crop->left = MT9V032_COLUMN_START_DEF;
++ crop->top = MT9V032_ROW_START_DEF;
++ crop->width = MT9V032_WINDOW_WIDTH_DEF;
++ crop->height = MT9V032_WINDOW_HEIGHT_DEF;
++
++ format = v4l2_subdev_get_try_format(fh, 0);
++ format->code = V4L2_MBUS_FMT_SGRBG10_1X10;
++ format->width = MT9V032_WINDOW_WIDTH_DEF;
++ format->height = MT9V032_WINDOW_HEIGHT_DEF;
++ format->field = V4L2_FIELD_NONE;
++ format->colorspace = V4L2_COLORSPACE_SRGB;
++
++ return mt9v032_set_power(subdev, 1);
++}
++
++static int mt9v032_close(struct v4l2_subdev *subdev, struct v4l2_subdev_fh *fh)
++{
++ return mt9v032_set_power(subdev, 0);
++}
++
++static struct v4l2_subdev_core_ops mt9v032_subdev_core_ops = {
++ .s_power = mt9v032_set_power,
++};
++
++static struct v4l2_subdev_video_ops mt9v032_subdev_video_ops = {
++ .s_stream = mt9v032_s_stream,
++};
++
++static struct v4l2_subdev_pad_ops mt9v032_subdev_pad_ops = {
++ .enum_mbus_code = mt9v032_enum_mbus_code,
++ .enum_frame_size = mt9v032_enum_frame_size,
++ .get_fmt = mt9v032_get_format,
++ .set_fmt = mt9v032_set_format,
++ .get_crop = mt9v032_get_crop,
++ .set_crop = mt9v032_set_crop,
++};
++
++static struct v4l2_subdev_ops mt9v032_subdev_ops = {
++ .core = &mt9v032_subdev_core_ops,
++ .video = &mt9v032_subdev_video_ops,
++ .pad = &mt9v032_subdev_pad_ops,
++};
++
++static const struct v4l2_subdev_internal_ops mt9v032_subdev_internal_ops = {
++ .registered = mt9v032_registered,
++ .open = mt9v032_open,
++ .close = mt9v032_close,
++};
++
++/* -----------------------------------------------------------------------------
++ * Driver initialization and probing
++ */
++
++static int mt9v032_probe(struct i2c_client *client,
++ const struct i2c_device_id *did)
++{
++ struct mt9v032 *mt9v032;
++ unsigned int i;
++ int ret;
++
++ if (!i2c_check_functionality(client->adapter,
++ I2C_FUNC_SMBUS_WORD_DATA)) {
++ dev_warn(&client->adapter->dev,
++ "I2C-Adapter doesn't support I2C_FUNC_SMBUS_WORD\n");
++ return -EIO;
++ }
++
++ mt9v032 = kzalloc(sizeof(*mt9v032), GFP_KERNEL);
++ if (!mt9v032)
++ return -ENOMEM;
++
++ mutex_init(&mt9v032->power_lock);
++ mt9v032->pdata = client->dev.platform_data;
++
++ v4l2_ctrl_handler_init(&mt9v032->ctrls, ARRAY_SIZE(mt9v032_ctrls) + 4);
++
++ v4l2_ctrl_new_std(&mt9v032->ctrls, &mt9v032_ctrl_ops,
++ V4L2_CID_AUTOGAIN, 0, 1, 1, 1);
++ v4l2_ctrl_new_std(&mt9v032->ctrls, &mt9v032_ctrl_ops,
++ V4L2_CID_GAIN, MT9V032_ANALOG_GAIN_MIN,
++ MT9V032_ANALOG_GAIN_MAX, 1, MT9V032_ANALOG_GAIN_DEF);
++ v4l2_ctrl_new_std_menu(&mt9v032->ctrls, &mt9v032_ctrl_ops,
++ V4L2_CID_EXPOSURE_AUTO, V4L2_EXPOSURE_MANUAL, 0,
++ V4L2_EXPOSURE_AUTO);
++ v4l2_ctrl_new_std(&mt9v032->ctrls, &mt9v032_ctrl_ops,
++ V4L2_CID_EXPOSURE, MT9V032_TOTAL_SHUTTER_WIDTH_MIN,
++ MT9V032_TOTAL_SHUTTER_WIDTH_MAX, 1,
++ MT9V032_TOTAL_SHUTTER_WIDTH_DEF);
++
++ for (i = 0; i < ARRAY_SIZE(mt9v032_ctrls); ++i)
++ v4l2_ctrl_new_custom(&mt9v032->ctrls, &mt9v032_ctrls[i], NULL);
++
++ mt9v032->subdev.ctrl_handler = &mt9v032->ctrls;
++
++ if (mt9v032->ctrls.error)
++ printk(KERN_INFO "%s: control initialization error %d\n",
++ __func__, mt9v032->ctrls.error);
++
++ mt9v032->crop.left = MT9V032_COLUMN_START_DEF;
++ mt9v032->crop.top = MT9V032_ROW_START_DEF;
++ mt9v032->crop.width = MT9V032_WINDOW_WIDTH_DEF;
++ mt9v032->crop.height = MT9V032_WINDOW_HEIGHT_DEF;
++
++ mt9v032->format.code = V4L2_MBUS_FMT_SGRBG10_1X10;
++ mt9v032->format.width = MT9V032_WINDOW_WIDTH_DEF;
++ mt9v032->format.height = MT9V032_WINDOW_HEIGHT_DEF;
++ mt9v032->format.field = V4L2_FIELD_NONE;
++ mt9v032->format.colorspace = V4L2_COLORSPACE_SRGB;
++
++ mt9v032->aec_agc = MT9V032_AEC_ENABLE | MT9V032_AGC_ENABLE;
++
++ v4l2_i2c_subdev_init(&mt9v032->subdev, client, &mt9v032_subdev_ops);
++ mt9v032->subdev.internal_ops = &mt9v032_subdev_internal_ops;
++ mt9v032->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
++
++ mt9v032->pad.flags = MEDIA_PAD_FL_SOURCE;
++ ret = media_entity_init(&mt9v032->subdev.entity, 1, &mt9v032->pad, 0);
++ if (ret < 0)
++ kfree(mt9v032);
++
++ return ret;
++}
++
++static int mt9v032_remove(struct i2c_client *client)
++{
++ struct v4l2_subdev *subdev = i2c_get_clientdata(client);
++ struct mt9v032 *mt9v032 = to_mt9v032(subdev);
++
++ v4l2_device_unregister_subdev(subdev);
++ media_entity_cleanup(&subdev->entity);
++ kfree(mt9v032);
++ return 0;
++}
++
++static const struct i2c_device_id mt9v032_id[] = {
++ { "mt9v032", 0 },
++ { }
++};
++MODULE_DEVICE_TABLE(i2c, mt9v032_id);
++
++static struct i2c_driver mt9v032_driver = {
++ .driver = {
++ .name = "mt9v032",
++ },
++ .probe = mt9v032_probe,
++ .remove = mt9v032_remove,
++ .id_table = mt9v032_id,
++};
++
++static int __init mt9v032_init(void)
++{
++ return i2c_add_driver(&mt9v032_driver);
++}
++
++static void __exit mt9v032_exit(void)
++{
++ i2c_del_driver(&mt9v032_driver);
++}
++
++module_init(mt9v032_init);
++module_exit(mt9v032_exit);
++
++MODULE_DESCRIPTION("Aptina MT9V032 Camera driver");
++MODULE_AUTHOR("Laurent Pinchart <laurent.pinchart@ideasonboard.com>");
++MODULE_LICENSE("GPL");
+diff --git a/include/media/mt9v032.h b/include/media/mt9v032.h
+new file mode 100644
+index 0000000..5e27f9b
+--- /dev/null
++++ b/include/media/mt9v032.h
+@@ -0,0 +1,12 @@
++#ifndef _MEDIA_MT9V032_H
++#define _MEDIA_MT9V032_H
++
++struct v4l2_subdev;
++
++struct mt9v032_platform_data {
++ unsigned int clk_pol:1;
++
++ void (*set_clock)(struct v4l2_subdev *subdev, unsigned int rate);
++};
++
++#endif
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/camera/0003-Add-support-for-mt9p031-LI-5M03-module-in-Beagleboar.patch b/recipes/linux/linux-omap-2.6.39/camera/0003-Add-support-for-mt9p031-LI-5M03-module-in-Beagleboar.patch
new file mode 100644
index 0000000000..9f7fb006e2
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/camera/0003-Add-support-for-mt9p031-LI-5M03-module-in-Beagleboar.patch
@@ -0,0 +1,158 @@
+From 6cce194e3d1fbc5d746b192b4d1ff78aef6099cf Mon Sep 17 00:00:00 2001
+From: Javier Martin <javier.martin@vista-silicon.com>
+Date: Mon, 30 May 2011 10:37:17 +0200
+Subject: [PATCH 3/3] Add support for mt9p031 (LI-5M03 module) in Beagleboard xM.
+
+Since isp clocks have not been exposed yet, this patch
+includes a temporal solution for testing mt9p031 driver
+in Beagleboard xM.
+
+Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
+---
+ arch/arm/mach-omap2/Makefile | 1 +
+ arch/arm/mach-omap2/board-omap3beagle-camera.c | 91 ++++++++++++++++++++++++
+ arch/arm/mach-omap2/board-omap3beagle.c | 5 ++
+ 3 files changed, 97 insertions(+), 0 deletions(-)
+ create mode 100644 arch/arm/mach-omap2/board-omap3beagle-camera.c
+
+diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
+index 512b152..05cd983 100644
+--- a/arch/arm/mach-omap2/Makefile
++++ b/arch/arm/mach-omap2/Makefile
+@@ -179,6 +179,7 @@ obj-$(CONFIG_MACH_OMAP_2430SDP) += board-2430sdp.o \
+ hsmmc.o
+ obj-$(CONFIG_MACH_OMAP_APOLLON) += board-apollon.o
+ obj-$(CONFIG_MACH_OMAP3_BEAGLE) += board-omap3beagle.o \
++ board-omap3beagle-camera.o \
+ hsmmc.o
+ obj-$(CONFIG_MACH_DEVKIT8000) += board-devkit8000.o \
+ hsmmc.o
+diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c
+new file mode 100644
+index 0000000..8387951
+--- /dev/null
++++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c
+@@ -0,0 +1,91 @@
++#include <linux/gpio.h>
++#include <linux/regulator/machine.h>
++
++#include <plat/i2c.h>
++
++#include <media/mt9p031.h>
++
++#include "devices.h"
++#include "../../../drivers/media/video/omap3isp/isp.h"
++
++#define MT9P031_RESET_GPIO 98
++#define MT9P031_XCLK ISP_XCLK_A
++
++static struct regulator *reg_1v8, *reg_2v8;
++
++static int beagle_cam_set_xclk(struct v4l2_subdev *subdev, int hz)
++{
++ struct isp_device *isp = v4l2_dev_to_isp_device(subdev->v4l2_dev);
++ int ret;
++
++ ret = isp->platform_cb.set_xclk(isp, hz, MT9P031_XCLK);
++ return 0;
++}
++
++static int beagle_cam_reset(struct v4l2_subdev *subdev, int active)
++{
++ /* Set RESET_BAR to !active */
++ gpio_set_value(MT9P031_RESET_GPIO, !active);
++
++ return 0;
++}
++
++static struct mt9p031_platform_data beagle_mt9p031_platform_data = {
++ .set_xclk = beagle_cam_set_xclk,
++ .reset = beagle_cam_reset,
++};
++
++static struct i2c_board_info mt9p031_camera_i2c_device = {
++ I2C_BOARD_INFO("mt9p031", 0x48),
++ .platform_data = &beagle_mt9p031_platform_data,
++};
++
++static struct isp_subdev_i2c_board_info mt9p031_camera_subdevs[] = {
++ {
++ .board_info = &mt9p031_camera_i2c_device,
++ .i2c_adapter_id = 2,
++ },
++ { NULL, 0, },
++};
++
++static struct isp_v4l2_subdevs_group beagle_camera_subdevs[] = {
++ {
++ .subdevs = mt9p031_camera_subdevs,
++ .interface = ISP_INTERFACE_PARALLEL,
++ .bus = {
++ .parallel = {
++ .data_lane_shift = 0,
++ .clk_pol = 1,
++ .bridge = ISPCTRL_PAR_BRIDGE_DISABLE,
++ }
++ },
++ },
++ { },
++};
++
++static struct isp_platform_data beagle_isp_platform_data = {
++ .subdevs = beagle_camera_subdevs,
++};
++
++static int __init beagle_camera_init(void) {
++ if(cpu_is_omap3630()){
++ reg_1v8 = regulator_get(NULL, "cam_1v8");
++ if (IS_ERR(reg_1v8))
++ pr_err("%s: cannot get cam_1v8 regulator\n", __func__);
++ else
++ regulator_enable(reg_1v8);
++
++ reg_2v8 = regulator_get(NULL, "cam_2v8");
++ if (IS_ERR(reg_2v8))
++ pr_err("%s: cannot get cam_2v8 regulator\n", __func__);
++ else
++ regulator_enable(reg_2v8);
++
++ omap_register_i2c_bus(2, 100, NULL, 0);
++ gpio_request(MT9P031_RESET_GPIO, "cam_rst");
++ gpio_direction_output(MT9P031_RESET_GPIO, 0);
++ omap3_init_camera(&beagle_isp_platform_data);
++ }
++ return 0;
++}
++late_initcall(beagle_camera_init);
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index 221bfda..dd6e31f 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -25,12 +25,16 @@
+ #include <linux/input.h>
+ #include <linux/gpio_keys.h>
+ #include <linux/opp.h>
++#include <linux/i2c.h>
++#include <linux/mm.h>
++#include <linux/videodev2.h>
+
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/partitions.h>
+ #include <linux/mtd/nand.h>
+ #include <linux/mmc/host.h>
+
++#include <linux/gpio.h>
+ #include <linux/regulator/machine.h>
+ #include <linux/i2c/twl.h>
+
+@@ -48,6 +52,7 @@
+ #include <plat/nand.h>
+ #include <plat/usb.h>
+ #include <plat/omap_device.h>
++#include <plat/i2c.h>
+
+ #include "mux.h"
+ #include "hsmmc.h"
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0001-OMAP2-cpufreq-free-up-table-on-exit.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0001-OMAP2-cpufreq-free-up-table-on-exit.patch
new file mode 100644
index 0000000000..86eafe37e8
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0001-OMAP2-cpufreq-free-up-table-on-exit.patch
@@ -0,0 +1,38 @@
+From 8812fba541092702d6a40ea23ff60bcb504365fd Mon Sep 17 00:00:00 2001
+From: Nishanth Menon <nm@ti.com>
+Date: Thu, 12 May 2011 07:59:52 -0500
+Subject: [PATCH 1/6] OMAP2+: cpufreq: free up table on exit
+
+freq_table allocated by opp_init_cpufreq_table in omap_cpu_init
+needs to be freed in omap_cpu_exit.
+
+Signed-off-by: Nishanth Menon <nm@ti.com>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/omap2plus-cpufreq.c | 3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/omap2plus-cpufreq.c b/arch/arm/mach-omap2/omap2plus-cpufreq.c
+index d53ce23..e38ebb8 100644
+--- a/arch/arm/mach-omap2/omap2plus-cpufreq.c
++++ b/arch/arm/mach-omap2/omap2plus-cpufreq.c
+@@ -26,6 +26,7 @@
+ #include <linux/clk.h>
+ #include <linux/io.h>
+ #include <linux/opp.h>
++#include <linux/slab.h>
+ #include <linux/cpu.h>
+
+ #include <asm/system.h>
+@@ -216,6 +217,8 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
+ static int omap_cpu_exit(struct cpufreq_policy *policy)
+ {
+ clk_exit_cpufreq_table(&freq_table);
++ kfree(freq_table);
++ freq_table = NULL;
+ clk_put(mpu_clk);
+ return 0;
+ }
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0002-OMAP2-cpufreq-handle-invalid-cpufreq-table.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0002-OMAP2-cpufreq-handle-invalid-cpufreq-table.patch
new file mode 100644
index 0000000000..ee27578d04
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0002-OMAP2-cpufreq-handle-invalid-cpufreq-table.patch
@@ -0,0 +1,44 @@
+From 1dce7658788943a8085323ef87111cdcdb335d1d Mon Sep 17 00:00:00 2001
+From: Nishanth Menon <nm@ti.com>
+Date: Thu, 12 May 2011 08:14:41 -0500
+Subject: [PATCH 2/6] OMAP2+: cpufreq: handle invalid cpufreq table
+
+Handle the case when cpufreq_frequency_table_cpuinfo fails. freq_table
+that we passed failed the internal test of cpufreq generic driver,
+so we should'nt be using the freq_table as such. Instead, warn and
+fallback to clock functions for validation and operation.
+
+Signed-off-by: Nishanth Menon <nm@ti.com>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/omap2plus-cpufreq.c | 12 ++++++++++--
+ 1 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/omap2plus-cpufreq.c b/arch/arm/mach-omap2/omap2plus-cpufreq.c
+index e38ebb8..6e3666a 100644
+--- a/arch/arm/mach-omap2/omap2plus-cpufreq.c
++++ b/arch/arm/mach-omap2/omap2plus-cpufreq.c
+@@ -182,10 +182,18 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
+
+ if (freq_table) {
+ result = cpufreq_frequency_table_cpuinfo(policy, freq_table);
+- if (!result)
++ if (!result) {
+ cpufreq_frequency_table_get_attr(freq_table,
+ policy->cpu);
+- } else {
++ } else {
++ WARN(true, "%s: fallback to clk_round(freq_table=%d)\n",
++ __func__, result);
++ kfree(freq_table);
++ freq_table = NULL;
++ }
++ }
++
++ if (!freq_table) {
+ policy->cpuinfo.min_freq = clk_round_rate(mpu_clk, 0) / 1000;
+ policy->cpuinfo.max_freq = clk_round_rate(mpu_clk,
+ VERY_HI_RATE) / 1000;
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0003-OMAP2-cpufreq-minor-comment-cleanup.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0003-OMAP2-cpufreq-minor-comment-cleanup.patch
new file mode 100644
index 0000000000..3064d5044d
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0003-OMAP2-cpufreq-minor-comment-cleanup.patch
@@ -0,0 +1,33 @@
+From 61c5ce4da03eda42e69cf225fddac9c910506db5 Mon Sep 17 00:00:00 2001
+From: Nishanth Menon <nm@ti.com>
+Date: Thu, 12 May 2011 16:27:45 -0700
+Subject: [PATCH 3/6] OMAP2+: cpufreq: minor comment cleanup
+
+this should probably get squashed in..
+
+Signed-off-by: Nishanth Menon <nm@ti.com>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/omap2plus-cpufreq.c | 6 ++++--
+ 1 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/omap2plus-cpufreq.c b/arch/arm/mach-omap2/omap2plus-cpufreq.c
+index 6e3666a..45f1e9e 100644
+--- a/arch/arm/mach-omap2/omap2plus-cpufreq.c
++++ b/arch/arm/mach-omap2/omap2plus-cpufreq.c
+@@ -84,8 +84,10 @@ static int omap_target(struct cpufreq_policy *policy,
+ if (is_smp() && (num_online_cpus() < NR_CPUS))
+ return ret;
+
+- /* Ensure desired rate is within allowed range. Some govenors
+- * (ondemand) will just pass target_freq=0 to get the minimum. */
++ /*
++ * Ensure desired rate is within allowed range. Some govenors
++ * (ondemand) will just pass target_freq=0 to get the minimum.
++ */
+ if (target_freq < policy->min)
+ target_freq = policy->min;
+ if (target_freq > policy->max)
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0004-OMAP2-cpufreq-use-clk_init_cpufreq_table-if-OPPs-not.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0004-OMAP2-cpufreq-use-clk_init_cpufreq_table-if-OPPs-not.patch
new file mode 100644
index 0000000000..24a721a011
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0004-OMAP2-cpufreq-use-clk_init_cpufreq_table-if-OPPs-not.patch
@@ -0,0 +1,48 @@
+From 4910bff43db304f58fef625d54e573d554066a78 Mon Sep 17 00:00:00 2001
+From: Nishanth Menon <nm@ti.com>
+Date: Fri, 13 May 2011 05:34:35 -0700
+Subject: [PATCH 4/6] OMAP2: cpufreq: use clk_init_cpufreq_table if OPPs not available
+
+OMAP2 does not use OPP tables at the moment for DVFS. Currently,
+we depend on opp table initialization to give us the freq_table,
+which makes sense for OMAP3+. for OMAP2, we should be using
+clk_init_cpufreq_table - so if the opp based frequency table
+initilization fails, fall back to clk_init_cpufreq_table to give
+us the table.
+
+Signed-off-by: Nishanth Menon <nm@ti.com>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/omap2plus-cpufreq.c | 9 ++++++++-
+ 1 files changed, 8 insertions(+), 1 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/omap2plus-cpufreq.c b/arch/arm/mach-omap2/omap2plus-cpufreq.c
+index 45f1e9e..854f4b3 100644
+--- a/arch/arm/mach-omap2/omap2plus-cpufreq.c
++++ b/arch/arm/mach-omap2/omap2plus-cpufreq.c
+@@ -180,7 +180,13 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
+ pr_warning("%s: unable to get the mpu device\n", __func__);
+ return -EINVAL;
+ }
+- opp_init_cpufreq_table(mpu_dev, &freq_table);
++
++ /*
++ * if we dont get cpufreq table using opp, use traditional omap2 lookup
++ * as a fallback
++ */
++ if (opp_init_cpufreq_table(mpu_dev, &freq_table))
++ clk_init_cpufreq_table(&freq_table);
+
+ if (freq_table) {
+ result = cpufreq_frequency_table_cpuinfo(policy, freq_table);
+@@ -188,6 +194,7 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
+ cpufreq_frequency_table_get_attr(freq_table,
+ policy->cpu);
+ } else {
++ clk_exit_cpufreq_table(&freq_table);
+ WARN(true, "%s: fallback to clk_round(freq_table=%d)\n",
+ __func__, result);
+ kfree(freq_table);
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0005-OMAP2-cpufreq-use-cpufreq_frequency_table_target.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0005-OMAP2-cpufreq-use-cpufreq_frequency_table_target.patch
new file mode 100644
index 0000000000..f5493b3bf9
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0005-OMAP2-cpufreq-use-cpufreq_frequency_table_target.patch
@@ -0,0 +1,78 @@
+From e8d1f8ed3f2ed7c2e9ee51adfd322868d4195ecf Mon Sep 17 00:00:00 2001
+From: Nishanth Menon <nm@ti.com>
+Date: Fri, 13 May 2011 05:43:49 -0700
+Subject: [PATCH 5/6] OMAP2+: cpufreq: use cpufreq_frequency_table_target
+
+Use cpufreq_frequency_table_target for finding the proper target
+instead of seeing if the frequency requested is divisible alone.
+if we have a frequency table, we should restrict ourselves to
+selecting the "approved" frequencies alone and only in the case
+where the frequency table is not available should we attempt at
+closest roundable clock frequency.
+
+Signed-off-by: Nishanth Menon <nm@ti.com>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/omap2plus-cpufreq.c | 38 ++++++++++++++++++++++--------
+ 1 files changed, 28 insertions(+), 10 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/omap2plus-cpufreq.c b/arch/arm/mach-omap2/omap2plus-cpufreq.c
+index 854f4b3..d0b4f97 100644
+--- a/arch/arm/mach-omap2/omap2plus-cpufreq.c
++++ b/arch/arm/mach-omap2/omap2plus-cpufreq.c
+@@ -77,24 +77,42 @@ static int omap_target(struct cpufreq_policy *policy,
+ unsigned int target_freq,
+ unsigned int relation)
+ {
+- int i, ret = 0;
++ unsigned int i;
++ int ret = 0;
+ struct cpufreq_freqs freqs;
+
+ /* Changes not allowed until all CPUs are online */
+ if (is_smp() && (num_online_cpus() < NR_CPUS))
+ return ret;
+
+- /*
+- * Ensure desired rate is within allowed range. Some govenors
+- * (ondemand) will just pass target_freq=0 to get the minimum.
+- */
+- if (target_freq < policy->min)
+- target_freq = policy->min;
+- if (target_freq > policy->max)
+- target_freq = policy->max;
++ if (freq_table) {
++ ret = cpufreq_frequency_table_target(policy, freq_table,
++ target_freq, relation, &i);
++ if (ret) {
++ pr_debug("%s: cpu%d: no freq match for %d(ret=%d)\n",
++ __func__, policy->cpu, target_freq, ret);
++ return ret;
++ }
++ freqs.new = freq_table[i].frequency;
++ } else {
++ /*
++ * Ensure desired rate is within allowed range. Some govenors
++ * (ondemand) will just pass target_freq=0 to get the minimum.
++ */
++ if (target_freq < policy->min)
++ target_freq = policy->min;
++ if (target_freq > policy->max)
++ target_freq = policy->max;
++
++ freqs.new = clk_round_rate(mpu_clk, target_freq * 1000) / 1000;
++ }
++ if (!freqs.new) {
++ pr_err("%s: cpu%d: no match for freq %d\n", __func__,
++ policy->cpu, target_freq);
++ return -EINVAL;
++ }
+
+ freqs.old = omap_getspeed(policy->cpu);
+- freqs.new = clk_round_rate(mpu_clk, target_freq * 1000) / 1000;
+ freqs.cpu = policy->cpu;
+
+ if (freqs.old == freqs.new)
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0006-OMAP2-cpufreq-fix-freq_table-leak.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0006-OMAP2-cpufreq-fix-freq_table-leak.patch
new file mode 100644
index 0000000000..0727ebcdee
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0006-OMAP2-cpufreq-fix-freq_table-leak.patch
@@ -0,0 +1,100 @@
+From 9303bae0e4acf8a8b3b0c682d6655a656fc776bf Mon Sep 17 00:00:00 2001
+From: Nishanth Menon <nm@ti.com>
+Date: Wed, 18 May 2011 01:48:23 -0500
+Subject: [PATCH 6/6] OMAP2+: cpufreq: fix freq_table leak
+
+Since we have two cpus the cpuinit call for cpu1 causes
+freq_table of cpu0 to be overwritten. instead, we maintain
+a counter to keep track of cpus who use the cpufreq table
+allocate it once(one freq table for all CPUs) and free them
+once the last user is done with it.
+
+Signed-off-by: Nishanth Menon <nm@ti.com>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/omap2plus-cpufreq.c | 33 ++++++++++++++++++++++++------
+ 1 files changed, 26 insertions(+), 7 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/omap2plus-cpufreq.c b/arch/arm/mach-omap2/omap2plus-cpufreq.c
+index d0b4f97..fc3d0fb 100644
+--- a/arch/arm/mach-omap2/omap2plus-cpufreq.c
++++ b/arch/arm/mach-omap2/omap2plus-cpufreq.c
+@@ -42,6 +42,9 @@
+ #define VERY_HI_RATE 900000000
+
+ static struct cpufreq_frequency_table *freq_table;
++static int freq_table_users;
++static DEFINE_MUTEX(freq_table_lock);
++
+ static struct clk *mpu_clk;
+
+ static int omap_verify_speed(struct cpufreq_policy *policy)
+@@ -172,6 +175,18 @@ skip_lpj:
+ return ret;
+ }
+
++static void freq_table_free(void)
++{
++ if (!freq_table_users)
++ return;
++ freq_table_users--;
++ if (freq_table_users)
++ return;
++ clk_exit_cpufreq_table(&freq_table);
++ kfree(freq_table);
++ freq_table = NULL;
++}
++
+ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
+ {
+ int result = 0;
+@@ -199,14 +214,18 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
+ return -EINVAL;
+ }
+
++ mutex_lock(&freq_table_lock);
+ /*
+ * if we dont get cpufreq table using opp, use traditional omap2 lookup
+ * as a fallback
+ */
+- if (opp_init_cpufreq_table(mpu_dev, &freq_table))
+- clk_init_cpufreq_table(&freq_table);
++ if (!freq_table) {
++ if (opp_init_cpufreq_table(mpu_dev, &freq_table))
++ clk_init_cpufreq_table(&freq_table);
++ }
+
+ if (freq_table) {
++ freq_table_users++;
+ result = cpufreq_frequency_table_cpuinfo(policy, freq_table);
+ if (!result) {
+ cpufreq_frequency_table_get_attr(freq_table,
+@@ -215,10 +234,10 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
+ clk_exit_cpufreq_table(&freq_table);
+ WARN(true, "%s: fallback to clk_round(freq_table=%d)\n",
+ __func__, result);
+- kfree(freq_table);
+- freq_table = NULL;
++ freq_table_free();
+ }
+ }
++ mutex_unlock(&freq_table_lock);
+
+ if (!freq_table) {
+ policy->cpuinfo.min_freq = clk_round_rate(mpu_clk, 0) / 1000;
+@@ -251,9 +270,9 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
+
+ static int omap_cpu_exit(struct cpufreq_policy *policy)
+ {
+- clk_exit_cpufreq_table(&freq_table);
+- kfree(freq_table);
+- freq_table = NULL;
++ mutex_lock(&freq_table_lock);
++ freq_table_free();
++ mutex_unlock(&freq_table_lock);
+ clk_put(mpu_clk);
+ return 0;
+ }
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-hotplug/0001-cpufreq-helpers-for-walking-the-frequency-table.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-hotplug/0001-cpufreq-helpers-for-walking-the-frequency-table.patch
new file mode 100644
index 0000000000..03385720a0
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-hotplug/0001-cpufreq-helpers-for-walking-the-frequency-table.patch
@@ -0,0 +1,134 @@
+From 078a7006a32248c98d40ef79bbeb85a0879de734 Mon Sep 17 00:00:00 2001
+From: Mike Turquette <mturquette@ti.com>
+Date: Tue, 17 May 2011 09:35:54 -0500
+Subject: [PATCH 1/2] cpufreq: helpers for walking the frequency table
+
+Two new functions for getting the next higher and next lower frequencies
+in the cpufreq table, based upon a frequency supplied in kHz.
+
+This is useful for cpufreq governors that do not target frequencies
+based upon a percentage or a pre-determined value, but instead access
+the cpufreq table directly.
+
+Signed-off-by: Mike Turquette <mturquette@ti.com>
+Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ drivers/cpufreq/freq_table.c | 73 ++++++++++++++++++++++++++++++++++++++++++
+ include/linux/cpufreq.h | 9 +++++
+ 2 files changed, 82 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/cpufreq/freq_table.c b/drivers/cpufreq/freq_table.c
+index 0543221..11a307b 100644
+--- a/drivers/cpufreq/freq_table.c
++++ b/drivers/cpufreq/freq_table.c
+@@ -13,6 +13,7 @@
+ #include <linux/module.h>
+ #include <linux/init.h>
+ #include <linux/cpufreq.h>
++#include <linux/err.h>
+
+ #define dprintk(msg...) \
+ cpufreq_debug_printk(CPUFREQ_DEBUG_CORE, "freq-table", msg)
+@@ -174,6 +175,78 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
+ }
+ EXPORT_SYMBOL_GPL(cpufreq_frequency_table_target);
+
++int cpufreq_frequency_table_next_lowest(struct cpufreq_policy *policy,
++ struct cpufreq_frequency_table *table, int *index)
++{
++ unsigned int cur_freq;
++ unsigned int next_lowest_freq;
++ int optimal_index = -1;
++ int i = 0;
++
++ if (!policy || IS_ERR(policy) || !table || IS_ERR(table) ||
++ !index || IS_ERR(index))
++ return -ENOMEM;
++
++ cur_freq = policy->cur;
++ next_lowest_freq = policy->min;
++
++ /* we're at the lowest frequency in the table already, bail out */
++ if (cur_freq == policy->min)
++ return -EINVAL;
++
++ /* walk the list, find closest freq to cur_freq that is below it */
++ while(table[i].frequency != CPUFREQ_TABLE_END) {
++ if (table[i].frequency < cur_freq &&
++ table[i].frequency >= next_lowest_freq) {
++ next_lowest_freq = table[i].frequency;
++ optimal_index = table[i].index;
++ }
++
++ i++;
++ }
++
++ *index = optimal_index;
++
++ return 0;
++}
++EXPORT_SYMBOL_GPL(cpufreq_frequency_table_next_lowest);
++
++int cpufreq_frequency_table_next_highest(struct cpufreq_policy *policy,
++ struct cpufreq_frequency_table *table, int *index)
++{
++ unsigned int cur_freq;
++ unsigned int next_higher_freq;
++ int optimal_index = -1;
++ int i = 0;
++
++ if (!policy || IS_ERR(policy) || !table || IS_ERR(table) ||
++ !index || IS_ERR(index))
++ return -ENOMEM;
++
++ cur_freq = policy->cur;
++ next_higher_freq = policy->max;
++
++ /* we're at the highest frequency in the table already, bail out */
++ if (cur_freq == policy->max)
++ return -EINVAL;
++
++ /* walk the list, find closest freq to cur_freq that is above it */
++ while(table[i].frequency != CPUFREQ_TABLE_END) {
++ if (table[i].frequency > cur_freq &&
++ table[i].frequency <= next_higher_freq) {
++ next_higher_freq = table[i].frequency;
++ optimal_index = table[i].index;
++ }
++
++ i++;
++ }
++
++ *index = optimal_index;
++
++ return 0;
++}
++EXPORT_SYMBOL_GPL(cpufreq_frequency_table_next_highest);
++
+ static DEFINE_PER_CPU(struct cpufreq_frequency_table *, cpufreq_show_table);
+ /**
+ * show_available_freqs - show available frequencies for the specified CPU
+diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
+index 9343dd3..a38fca8 100644
+--- a/include/linux/cpufreq.h
++++ b/include/linux/cpufreq.h
+@@ -396,6 +396,15 @@ void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table,
+
+ void cpufreq_frequency_table_put_attr(unsigned int cpu);
+
++/* the following are for use in governors, or anywhere else */
++extern int cpufreq_frequency_table_next_lowest(struct cpufreq_policy *policy,
++ struct cpufreq_frequency_table *table,
++ int *index);
++
++extern int cpufreq_frequency_table_next_highest(struct cpufreq_policy *policy,
++ struct cpufreq_frequency_table *table,
++ int *index);
++
+
+ /*********************************************************************
+ * UNIFIED DEBUG HELPERS *
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-hotplug/0002-cpufreq-introduce-hotplug-governor.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-hotplug/0002-cpufreq-introduce-hotplug-governor.patch
new file mode 100644
index 0000000000..70fa625e43
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-hotplug/0002-cpufreq-introduce-hotplug-governor.patch
@@ -0,0 +1,879 @@
+From f31dabf5b6158584da56e7186ada6d2a80d5654e Mon Sep 17 00:00:00 2001
+From: Mike Turquette <mturquette@ti.com>
+Date: Tue, 17 May 2011 09:43:09 -0500
+Subject: [PATCH 2/2] cpufreq: introduce hotplug governor
+
+The "hotplug" governor scales CPU frequency based on load, similar to
+"ondemand". It scales up to the highest frequency when "up_threshold"
+is crossed and scales down one frequency at a time when "down_threshold"
+is crossed. Unlike those governors, target frequencies are determined
+by directly accessing the CPUfreq frequency table, instead of taking
+some percentage of maximum available frequency.
+
+The key difference in the "hotplug" governor is that it will disable
+auxillary CPUs when the system is very idle, and enable them again once
+the system becomes busy. This is achieved by averaging load over
+multiple sampling periods; if CPUs were online or offlined based on a
+single sampling period then thrashing will occur.
+
+Sysfs entries exist for "hotplug_in_sampling_periods" and for
+"hotplug_out_sampling_periods" which determine how many consecutive
+periods get averaged to determine if auxillery CPUs should be onlined or
+offlined. Defaults are 5 periods and 20 periods respectively.
+Otherwise the standard sysfs entries you might find for "ondemand" and
+"conservative" governors are there.
+
+To use this governor it is assumed that your CPUfreq driver has
+populated the CPUfreq table, CONFIG_NO_HZ is enabled and
+CONFIG_HOTPLUG_CPU is enabled.
+
+Changes in V2:
+ Corrected default sampling periods
+ Optimized load history array resizing
+ Maintain load history when resizing array
+ Add locking to dbs_check_cpu
+ Switch from enable_nonboot_cpus to cpu_up
+ Switch from disable_nonboot_cpus to down_cpu
+ Fix some printks
+ Coding style around for-loops
+
+Signed-off-by: Mike Turquette <mturquette@ti.com>
+Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ Documentation/cpu-freq/governors.txt | 28 ++
+ drivers/cpufreq/Kconfig | 33 ++
+ drivers/cpufreq/Makefile | 1 +
+ drivers/cpufreq/cpufreq_hotplug.c | 705 ++++++++++++++++++++++++++++++++++
+ include/linux/cpufreq.h | 3 +
+ 5 files changed, 770 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/cpufreq/cpufreq_hotplug.c
+
+diff --git a/Documentation/cpu-freq/governors.txt b/Documentation/cpu-freq/governors.txt
+index e74d0a2..c2e3d3d 100644
+--- a/Documentation/cpu-freq/governors.txt
++++ b/Documentation/cpu-freq/governors.txt
+@@ -193,6 +193,34 @@ governor but for the opposite direction. For example when set to its
+ default value of '20' it means that if the CPU usage needs to be below
+ 20% between samples to have the frequency decreased.
+
++
++2.6 Hotplug
++-----------
++
++The CPUfreq governor "hotplug" operates similary to "ondemand" and
++"conservative". It's decisions are based primarily on CPU load. Like
++"ondemand" the "hotplug" governor will ramp up to the highest frequency
++once the run-time tunable "up_threshold" parameter is crossed. Like
++"conservative", the "hotplug" governor exports a "down_threshold"
++parameter that is also tunable at run-time. When the "down_threshold"
++is crossed the CPU transitions to the next lowest frequency in the
++CPUfreq frequency table instead of decrementing the frequency based on a
++percentage of maximum load.
++
++The main reason "hotplug" governor exists is for architectures requiring
++that only the master CPU be online in order to hit low-power states
++(C-states). OMAP4 is one such example of this. The "hotplug" governor
++is also helpful in reducing thermal output in devices with tight thermal
++constraints.
++
++Auxillary CPUs are onlined/offline based on CPU load, but the decision
++to do so is made after averaging several sampling windows. This is to
++reduce CPU hotplug "thrashing", which can be caused by normal system
++entropy and leads to lots of spurious plug-in and plug-out transitions.
++The number of sampling periods averaged together is tunable via the
++"hotplug_in_sampling_periods" and "hotplug_out_sampling_periods"
++run-time tunable parameters.
++
+ 3. The Governor Interface in the CPUfreq Core
+ =============================================
+
+diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
+index ca8ee80..c716a0e 100644
+--- a/drivers/cpufreq/Kconfig
++++ b/drivers/cpufreq/Kconfig
+@@ -110,6 +110,19 @@ config CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
+ Be aware that not all cpufreq drivers support the conservative
+ governor. If unsure have a look at the help section of the
+ driver. Fallback governor will be the performance governor.
++
++config CPU_FREQ_DEFAULT_GOV_HOTPLUG
++ bool "hotplug"
++ select CPU_FREQ_GOV_HOTPLUG
++ select CPU_FREQ_GOV_PERFORMANCE
++ help
++ Use the CPUFreq governor 'hotplug' as default. This allows you
++ to get a full dynamic frequency capable system with CPU
++ hotplug support by simply loading your cpufreq low-level
++ hardware driver. Be aware that not all cpufreq drivers
++ support the hotplug governor. If unsure have a look at
++ the help section of the driver. Fallback governor will be the
++ performance governor.
+ endchoice
+
+ config CPU_FREQ_GOV_PERFORMANCE
+@@ -190,4 +203,24 @@ config CPU_FREQ_GOV_CONSERVATIVE
+
+ If in doubt, say N.
+
++config CPU_FREQ_GOV_HOTPLUG
++ tristate "'hotplug' cpufreq governor"
++ depends on CPU_FREQ && NO_HZ && HOTPLUG_CPU
++ help
++ 'hotplug' - this driver mimics the frequency scaling behavior
++ in 'ondemand', but with several key differences. First is
++ that frequency transitions use the CPUFreq table directly,
++ instead of incrementing in a percentage of the maximum
++ available frequency. Second 'hotplug' will offline auxillary
++ CPUs when the system is idle, and online those CPUs once the
++ system becomes busy again. This last feature is needed for
++ architectures which transition to low power states when only
++ the "master" CPU is online, or for thermally constrained
++ devices.
++
++ If you don't have one of these architectures or devices, use
++ 'ondemand' instead.
++
++ If in doubt, say N.
++
+ endif # CPU_FREQ
+diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile
+index 71fc3b4..05d564c 100644
+--- a/drivers/cpufreq/Makefile
++++ b/drivers/cpufreq/Makefile
+@@ -9,6 +9,7 @@ obj-$(CONFIG_CPU_FREQ_GOV_POWERSAVE) += cpufreq_powersave.o
+ obj-$(CONFIG_CPU_FREQ_GOV_USERSPACE) += cpufreq_userspace.o
+ obj-$(CONFIG_CPU_FREQ_GOV_ONDEMAND) += cpufreq_ondemand.o
+ obj-$(CONFIG_CPU_FREQ_GOV_CONSERVATIVE) += cpufreq_conservative.o
++obj-$(CONFIG_CPU_FREQ_GOV_HOTPLUG) += cpufreq_hotplug.o
+
+ # CPUfreq cross-arch helpers
+ obj-$(CONFIG_CPU_FREQ_TABLE) += freq_table.o
+diff --git a/drivers/cpufreq/cpufreq_hotplug.c b/drivers/cpufreq/cpufreq_hotplug.c
+new file mode 100644
+index 0000000..85aa6d2
+--- /dev/null
++++ b/drivers/cpufreq/cpufreq_hotplug.c
+@@ -0,0 +1,705 @@
++/*
++ * CPUFreq hotplug governor
++ *
++ * Copyright (C) 2010 Texas Instruments, Inc.
++ * Mike Turquette <mturquette@ti.com>
++ * Santosh Shilimkar <santosh.shilimkar@ti.com>
++ *
++ * Based on ondemand governor
++ * Copyright (C) 2001 Russell King
++ * (C) 2003 Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>,
++ * Jun Nakajima <jun.nakajima@intel.com>
++ *
++ * 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/module.h>
++#include <linux/init.h>
++#include <linux/cpufreq.h>
++#include <linux/cpu.h>
++#include <linux/jiffies.h>
++#include <linux/kernel_stat.h>
++#include <linux/mutex.h>
++#include <linux/hrtimer.h>
++#include <linux/tick.h>
++#include <linux/ktime.h>
++#include <linux/sched.h>
++#include <linux/err.h>
++#include <linux/slab.h>
++
++/* greater than 80% avg load across online CPUs increases frequency */
++#define DEFAULT_UP_FREQ_MIN_LOAD (80)
++
++/* less than 20% avg load across online CPUs decreases frequency */
++#define DEFAULT_DOWN_FREQ_MAX_LOAD (20)
++
++/* default sampling period (uSec) is bogus; 10x ondemand's default for x86 */
++#define DEFAULT_SAMPLING_PERIOD (100000)
++
++/* default number of sampling periods to average before hotplug-in decision */
++#define DEFAULT_HOTPLUG_IN_SAMPLING_PERIODS (5)
++
++/* default number of sampling periods to average before hotplug-out decision */
++#define DEFAULT_HOTPLUG_OUT_SAMPLING_PERIODS (20)
++
++static void do_dbs_timer(struct work_struct *work);
++static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
++ unsigned int event);
++
++#ifndef CONFIG_CPU_FREQ_DEFAULT_GOV_HOTPLUG
++static
++#endif
++struct cpufreq_governor cpufreq_gov_hotplug = {
++ .name = "hotplug",
++ .governor = cpufreq_governor_dbs,
++ .owner = THIS_MODULE,
++};
++
++struct cpu_dbs_info_s {
++ cputime64_t prev_cpu_idle;
++ cputime64_t prev_cpu_wall;
++ cputime64_t prev_cpu_nice;
++ struct cpufreq_policy *cur_policy;
++ struct delayed_work work;
++ struct cpufreq_frequency_table *freq_table;
++ int cpu;
++ /*
++ * percpu mutex that serializes governor limit change with
++ * do_dbs_timer invocation. We do not want do_dbs_timer to run
++ * when user is changing the governor or limits.
++ */
++ struct mutex timer_mutex;
++};
++static DEFINE_PER_CPU(struct cpu_dbs_info_s, hp_cpu_dbs_info);
++
++static unsigned int dbs_enable; /* number of CPUs using this policy */
++
++/*
++ * dbs_mutex protects data in dbs_tuners_ins from concurrent changes on
++ * different CPUs. It protects dbs_enable in governor start/stop.
++ */
++static DEFINE_MUTEX(dbs_mutex);
++
++static struct workqueue_struct *khotplug_wq;
++
++static struct dbs_tuners {
++ unsigned int sampling_rate;
++ unsigned int up_threshold;
++ unsigned int down_threshold;
++ unsigned int hotplug_in_sampling_periods;
++ unsigned int hotplug_out_sampling_periods;
++ unsigned int hotplug_load_index;
++ unsigned int *hotplug_load_history;
++ unsigned int ignore_nice;
++ unsigned int io_is_busy;
++} dbs_tuners_ins = {
++ .sampling_rate = DEFAULT_SAMPLING_PERIOD,
++ .up_threshold = DEFAULT_UP_FREQ_MIN_LOAD,
++ .down_threshold = DEFAULT_DOWN_FREQ_MAX_LOAD,
++ .hotplug_in_sampling_periods = DEFAULT_HOTPLUG_IN_SAMPLING_PERIODS,
++ .hotplug_out_sampling_periods = DEFAULT_HOTPLUG_OUT_SAMPLING_PERIODS,
++ .hotplug_load_index = 0,
++ .ignore_nice = 0,
++ .io_is_busy = 0,
++};
++
++/*
++ * A corner case exists when switching io_is_busy at run-time: comparing idle
++ * times from a non-io_is_busy period to an io_is_busy period (or vice-versa)
++ * will misrepresent the actual change in system idleness. We ignore this
++ * corner case: enabling io_is_busy might cause freq increase and disabling
++ * might cause freq decrease, which probably matches the original intent.
++ */
++static inline cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall)
++{
++ u64 idle_time;
++ u64 iowait_time;
++
++ /* cpufreq-hotplug always assumes CONFIG_NO_HZ */
++ idle_time = get_cpu_idle_time_us(cpu, wall);
++
++ /* add time spent doing I/O to idle time */
++ if (dbs_tuners_ins.io_is_busy) {
++ iowait_time = get_cpu_iowait_time_us(cpu, wall);
++ /* cpufreq-hotplug always assumes CONFIG_NO_HZ */
++ if (iowait_time != -1ULL && idle_time >= iowait_time)
++ idle_time -= iowait_time;
++ }
++
++ return idle_time;
++}
++
++/************************** sysfs interface ************************/
++
++/* XXX look at global sysfs macros in cpufreq.h, can those be used here? */
++
++/* cpufreq_hotplug Governor Tunables */
++#define show_one(file_name, object) \
++static ssize_t show_##file_name \
++(struct kobject *kobj, struct attribute *attr, char *buf) \
++{ \
++ return sprintf(buf, "%u\n", dbs_tuners_ins.object); \
++}
++show_one(sampling_rate, sampling_rate);
++show_one(up_threshold, up_threshold);
++show_one(down_threshold, down_threshold);
++show_one(hotplug_in_sampling_periods, hotplug_in_sampling_periods);
++show_one(hotplug_out_sampling_periods, hotplug_out_sampling_periods);
++show_one(ignore_nice_load, ignore_nice);
++show_one(io_is_busy, io_is_busy);
++
++static ssize_t store_sampling_rate(struct kobject *a, struct attribute *b,
++ const char *buf, size_t count)
++{
++ unsigned int input;
++ int ret;
++ ret = sscanf(buf, "%u", &input);
++ if (ret != 1)
++ return -EINVAL;
++
++ mutex_lock(&dbs_mutex);
++ dbs_tuners_ins.sampling_rate = input;
++ mutex_unlock(&dbs_mutex);
++
++ return count;
++}
++
++static ssize_t store_up_threshold(struct kobject *a, struct attribute *b,
++ const char *buf, size_t count)
++{
++ unsigned int input;
++ int ret;
++ ret = sscanf(buf, "%u", &input);
++
++ if (ret != 1 || input <= dbs_tuners_ins.down_threshold) {
++ return -EINVAL;
++ }
++
++ mutex_lock(&dbs_mutex);
++ dbs_tuners_ins.up_threshold = input;
++ mutex_unlock(&dbs_mutex);
++
++ return count;
++}
++
++static ssize_t store_down_threshold(struct kobject *a, struct attribute *b,
++ const char *buf, size_t count)
++{
++ unsigned int input;
++ int ret;
++ ret = sscanf(buf, "%u", &input);
++
++ if (ret != 1 || input >= dbs_tuners_ins.up_threshold) {
++ return -EINVAL;
++ }
++
++ mutex_lock(&dbs_mutex);
++ dbs_tuners_ins.down_threshold = input;
++ mutex_unlock(&dbs_mutex);
++
++ return count;
++}
++
++static ssize_t store_hotplug_in_sampling_periods(struct kobject *a,
++ struct attribute *b, const char *buf, size_t count)
++{
++ unsigned int input;
++ unsigned int *temp;
++ unsigned int max_windows;
++ int ret;
++ ret = sscanf(buf, "%u", &input);
++
++ if (ret != 1)
++ return -EINVAL;
++
++ /* already using this value, bail out */
++ if (input == dbs_tuners_ins.hotplug_in_sampling_periods)
++ return count;
++
++ mutex_lock(&dbs_mutex);
++ ret = count;
++ max_windows = max(dbs_tuners_ins.hotplug_in_sampling_periods,
++ dbs_tuners_ins.hotplug_out_sampling_periods);
++
++ /* no need to resize array */
++ if (input <= max_windows) {
++ dbs_tuners_ins.hotplug_in_sampling_periods = input;
++ goto out;
++ }
++
++ /* resize array */
++ temp = kmalloc((sizeof(unsigned int) * input), GFP_KERNEL);
++
++ if (!temp || IS_ERR(temp)) {
++ ret = -ENOMEM;
++ goto out;
++ }
++
++ memcpy(temp, dbs_tuners_ins.hotplug_load_history,
++ (max_windows * sizeof(unsigned int)));
++ kfree(dbs_tuners_ins.hotplug_load_history);
++
++ /* replace old buffer, old number of sampling periods & old index */
++ dbs_tuners_ins.hotplug_load_history = temp;
++ dbs_tuners_ins.hotplug_in_sampling_periods = input;
++ dbs_tuners_ins.hotplug_load_index = max_windows;
++out:
++ mutex_unlock(&dbs_mutex);
++
++ return ret;
++}
++
++static ssize_t store_hotplug_out_sampling_periods(struct kobject *a,
++ struct attribute *b, const char *buf, size_t count)
++{
++ unsigned int input;
++ unsigned int *temp;
++ unsigned int max_windows;
++ int ret;
++ ret = sscanf(buf, "%u", &input);
++
++ if (ret != 1)
++ return -EINVAL;
++
++ /* already using this value, bail out */
++ if (input == dbs_tuners_ins.hotplug_out_sampling_periods)
++ return count;
++
++ mutex_lock(&dbs_mutex);
++ ret = count;
++ max_windows = max(dbs_tuners_ins.hotplug_in_sampling_periods,
++ dbs_tuners_ins.hotplug_out_sampling_periods);
++
++ /* no need to resize array */
++ if (input <= max_windows) {
++ dbs_tuners_ins.hotplug_out_sampling_periods = input;
++ goto out;
++ }
++
++ /* resize array */
++ temp = kmalloc((sizeof(unsigned int) * input), GFP_KERNEL);
++
++ if (!temp || IS_ERR(temp)) {
++ ret = -ENOMEM;
++ goto out;
++ }
++
++ memcpy(temp, dbs_tuners_ins.hotplug_load_history,
++ (max_windows * sizeof(unsigned int)));
++ kfree(dbs_tuners_ins.hotplug_load_history);
++
++ /* replace old buffer, old number of sampling periods & old index */
++ dbs_tuners_ins.hotplug_load_history = temp;
++ dbs_tuners_ins.hotplug_out_sampling_periods = input;
++ dbs_tuners_ins.hotplug_load_index = max_windows;
++out:
++ mutex_unlock(&dbs_mutex);
++
++ return ret;
++}
++
++static ssize_t store_ignore_nice_load(struct kobject *a, struct attribute *b,
++ const char *buf, size_t count)
++{
++ unsigned int input;
++ int ret;
++
++ unsigned int j;
++
++ ret = sscanf(buf, "%u", &input);
++ if (ret != 1)
++ return -EINVAL;
++
++ if (input > 1)
++ input = 1;
++
++ mutex_lock(&dbs_mutex);
++ if (input == dbs_tuners_ins.ignore_nice) { /* nothing to do */
++ mutex_unlock(&dbs_mutex);
++ return count;
++ }
++ dbs_tuners_ins.ignore_nice = input;
++
++ /* we need to re-evaluate prev_cpu_idle */
++ for_each_online_cpu(j) {
++ struct cpu_dbs_info_s *dbs_info;
++ dbs_info = &per_cpu(hp_cpu_dbs_info, j);
++ dbs_info->prev_cpu_idle = get_cpu_idle_time(j,
++ &dbs_info->prev_cpu_wall);
++ if (dbs_tuners_ins.ignore_nice)
++ dbs_info->prev_cpu_nice = kstat_cpu(j).cpustat.nice;
++
++ }
++ mutex_unlock(&dbs_mutex);
++
++ return count;
++}
++
++static ssize_t store_io_is_busy(struct kobject *a, struct attribute *b,
++ const char *buf, size_t count)
++{
++ unsigned int input;
++ int ret;
++
++ ret = sscanf(buf, "%u", &input);
++ if (ret != 1)
++ return -EINVAL;
++
++ mutex_lock(&dbs_mutex);
++ dbs_tuners_ins.io_is_busy = !!input;
++ mutex_unlock(&dbs_mutex);
++
++ return count;
++}
++
++define_one_global_rw(sampling_rate);
++define_one_global_rw(up_threshold);
++define_one_global_rw(down_threshold);
++define_one_global_rw(hotplug_in_sampling_periods);
++define_one_global_rw(hotplug_out_sampling_periods);
++define_one_global_rw(ignore_nice_load);
++define_one_global_rw(io_is_busy);
++
++static struct attribute *dbs_attributes[] = {
++ &sampling_rate.attr,
++ &up_threshold.attr,
++ &down_threshold.attr,
++ &hotplug_in_sampling_periods.attr,
++ &hotplug_out_sampling_periods.attr,
++ &ignore_nice_load.attr,
++ &io_is_busy.attr,
++ NULL
++};
++
++static struct attribute_group dbs_attr_group = {
++ .attrs = dbs_attributes,
++ .name = "hotplug",
++};
++
++/************************** sysfs end ************************/
++
++static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info)
++{
++ /* combined load of all enabled CPUs */
++ unsigned int total_load = 0;
++ /* single largest CPU load */
++ unsigned int max_load = 0;
++ /* average load across all enabled CPUs */
++ unsigned int avg_load = 0;
++ /* average load across multiple sampling periods for hotplug events */
++ unsigned int hotplug_in_avg_load = 0;
++ unsigned int hotplug_out_avg_load = 0;
++ /* number of sampling periods averaged for hotplug decisions */
++ unsigned int periods;
++
++ struct cpufreq_policy *policy;
++ unsigned int index = 0;
++ unsigned int i, j;
++
++ policy = this_dbs_info->cur_policy;
++
++ /*
++ * cpu load accounting
++ * get highest load, total load and average load across all CPUs
++ */
++ for_each_cpu(j, policy->cpus) {
++ unsigned int load;
++ unsigned int idle_time, wall_time;
++ cputime64_t cur_wall_time, cur_idle_time;
++ struct cpu_dbs_info_s *j_dbs_info;
++
++ j_dbs_info = &per_cpu(hp_cpu_dbs_info, j);
++
++ /* update both cur_idle_time and cur_wall_time */
++ cur_idle_time = get_cpu_idle_time(j, &cur_wall_time);
++
++ /* how much wall time has passed since last iteration? */
++ wall_time = (unsigned int) cputime64_sub(cur_wall_time,
++ j_dbs_info->prev_cpu_wall);
++ j_dbs_info->prev_cpu_wall = cur_wall_time;
++
++ /* how much idle time has passed since last iteration? */
++ idle_time = (unsigned int) cputime64_sub(cur_idle_time,
++ j_dbs_info->prev_cpu_idle);
++ j_dbs_info->prev_cpu_idle = cur_idle_time;
++
++ if (unlikely(!wall_time || wall_time < idle_time))
++ continue;
++
++ /* load is the percentage of time not spent in idle */
++ load = 100 * (wall_time - idle_time) / wall_time;
++
++ /* keep track of combined load across all CPUs */
++ total_load += load;
++
++ /* keep track of highest single load across all CPUs */
++ if (load > max_load)
++ max_load = load;
++ }
++
++ /* calculate the average load across all related CPUs */
++ avg_load = total_load / num_online_cpus();
++
++
++ /*
++ * hotplug load accounting
++ * average load over multiple sampling periods
++ */
++
++ /* how many sampling periods do we use for hotplug decisions? */
++ periods = max(dbs_tuners_ins.hotplug_in_sampling_periods,
++ dbs_tuners_ins.hotplug_out_sampling_periods);
++
++ /* store avg_load in the circular buffer */
++ dbs_tuners_ins.hotplug_load_history[dbs_tuners_ins.hotplug_load_index]
++ = avg_load;
++
++ /* compute average load across in & out sampling periods */
++ for (i = 0, j = dbs_tuners_ins.hotplug_load_index;
++ i < periods; i++, j--) {
++ if (i < dbs_tuners_ins.hotplug_in_sampling_periods)
++ hotplug_in_avg_load +=
++ dbs_tuners_ins.hotplug_load_history[j];
++ if (i < dbs_tuners_ins.hotplug_out_sampling_periods)
++ hotplug_out_avg_load +=
++ dbs_tuners_ins.hotplug_load_history[j];
++
++ if (j == 0)
++ j = periods;
++ }
++
++ hotplug_in_avg_load = hotplug_in_avg_load /
++ dbs_tuners_ins.hotplug_in_sampling_periods;
++
++ hotplug_out_avg_load = hotplug_out_avg_load /
++ dbs_tuners_ins.hotplug_out_sampling_periods;
++
++ /* return to first element if we're at the circular buffer's end */
++ if (++dbs_tuners_ins.hotplug_load_index == periods)
++ dbs_tuners_ins.hotplug_load_index = 0;
++
++ /* check for frequency increase */
++ if (avg_load > dbs_tuners_ins.up_threshold) {
++ /* should we enable auxillary CPUs? */
++ if (num_online_cpus() < 2 && hotplug_in_avg_load >
++ dbs_tuners_ins.up_threshold) {
++ /* hotplug with cpufreq is nasty
++ * a call to cpufreq_governor_dbs may cause a lockup.
++ * wq is not running here so its safe.
++ */
++ mutex_unlock(&this_dbs_info->timer_mutex);
++ cpu_up(1);
++ mutex_lock(&this_dbs_info->timer_mutex);
++ goto out;
++ }
++
++ /* increase to highest frequency supported */
++ if (policy->cur < policy->max)
++ __cpufreq_driver_target(policy, policy->max,
++ CPUFREQ_RELATION_H);
++
++ goto out;
++ }
++
++ /* check for frequency decrease */
++ if (avg_load < dbs_tuners_ins.down_threshold) {
++ /* are we at the minimum frequency already? */
++ if (policy->cur == policy->min) {
++ /* should we disable auxillary CPUs? */
++ if (num_online_cpus() > 1 && hotplug_out_avg_load <
++ dbs_tuners_ins.down_threshold) {
++ mutex_unlock(&this_dbs_info->timer_mutex);
++ cpu_down(1);
++ mutex_lock(&this_dbs_info->timer_mutex);
++ }
++ goto out;
++ }
++
++ /* bump down to the next lowest frequency in the table */
++ if (cpufreq_frequency_table_next_lowest(policy,
++ this_dbs_info->freq_table, &index)) {
++ pr_err("%s: failed to get next lowest frequency\n",
++ __func__);
++ goto out;
++ }
++
++ __cpufreq_driver_target(policy,
++ this_dbs_info->freq_table[index].frequency,
++ CPUFREQ_RELATION_L);
++ }
++out:
++ return;
++}
++
++static void do_dbs_timer(struct work_struct *work)
++{
++ struct cpu_dbs_info_s *dbs_info =
++ container_of(work, struct cpu_dbs_info_s, work.work);
++ unsigned int cpu = dbs_info->cpu;
++
++ /* We want all related CPUs to do sampling nearly on same jiffy */
++ int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate);
++
++ mutex_lock(&dbs_info->timer_mutex);
++ dbs_check_cpu(dbs_info);
++ queue_delayed_work_on(cpu, khotplug_wq, &dbs_info->work, delay);
++ mutex_unlock(&dbs_info->timer_mutex);
++}
++
++static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info)
++{
++ /* We want all related CPUs to do sampling nearly on same jiffy */
++ int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate);
++ delay -= jiffies % delay;
++
++ INIT_DELAYED_WORK_DEFERRABLE(&dbs_info->work, do_dbs_timer);
++ queue_delayed_work_on(dbs_info->cpu, khotplug_wq, &dbs_info->work,
++ delay);
++}
++
++static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info)
++{
++ cancel_delayed_work_sync(&dbs_info->work);
++}
++
++static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
++ unsigned int event)
++{
++ unsigned int cpu = policy->cpu;
++ struct cpu_dbs_info_s *this_dbs_info;
++ unsigned int i, j, max_periods;
++ int rc;
++
++ this_dbs_info = &per_cpu(hp_cpu_dbs_info, cpu);
++
++ switch (event) {
++ case CPUFREQ_GOV_START:
++ if ((!cpu_online(cpu)) || (!policy->cur))
++ return -EINVAL;
++
++ mutex_lock(&dbs_mutex);
++ dbs_enable++;
++ for_each_cpu(j, policy->cpus) {
++ struct cpu_dbs_info_s *j_dbs_info;
++ j_dbs_info = &per_cpu(hp_cpu_dbs_info, j);
++ j_dbs_info->cur_policy = policy;
++
++ j_dbs_info->prev_cpu_idle = get_cpu_idle_time(j,
++ &j_dbs_info->prev_cpu_wall);
++ if (dbs_tuners_ins.ignore_nice) {
++ j_dbs_info->prev_cpu_nice =
++ kstat_cpu(j).cpustat.nice;
++ }
++
++ max_periods = max(DEFAULT_HOTPLUG_IN_SAMPLING_PERIODS,
++ DEFAULT_HOTPLUG_OUT_SAMPLING_PERIODS);
++ dbs_tuners_ins.hotplug_load_history = kmalloc(
++ (sizeof(unsigned int) * max_periods),
++ GFP_KERNEL);
++ if (!dbs_tuners_ins.hotplug_load_history) {
++ WARN_ON(1);
++ return -ENOMEM;
++ }
++ for (i = 0; i < max_periods; i++)
++ dbs_tuners_ins.hotplug_load_history[i] = 50;
++ }
++ this_dbs_info->cpu = cpu;
++ this_dbs_info->freq_table = cpufreq_frequency_get_table(cpu);
++ /*
++ * Start the timerschedule work, when this governor
++ * is used for first time
++ */
++ if (dbs_enable == 1) {
++ rc = sysfs_create_group(cpufreq_global_kobject,
++ &dbs_attr_group);
++ if (rc) {
++ mutex_unlock(&dbs_mutex);
++ return rc;
++ }
++ }
++ mutex_unlock(&dbs_mutex);
++
++ mutex_init(&this_dbs_info->timer_mutex);
++ dbs_timer_init(this_dbs_info);
++ break;
++
++ case CPUFREQ_GOV_STOP:
++ dbs_timer_exit(this_dbs_info);
++
++ mutex_lock(&dbs_mutex);
++ mutex_destroy(&this_dbs_info->timer_mutex);
++ dbs_enable--;
++ mutex_unlock(&dbs_mutex);
++ if (!dbs_enable)
++ sysfs_remove_group(cpufreq_global_kobject,
++ &dbs_attr_group);
++ kfree(dbs_tuners_ins.hotplug_load_history);
++ /*
++ * XXX BIG CAVEAT: Stopping the governor with CPU1 offline
++ * will result in it remaining offline until the user onlines
++ * it again. It is up to the user to do this (for now).
++ */
++ break;
++
++ case CPUFREQ_GOV_LIMITS:
++ mutex_lock(&this_dbs_info->timer_mutex);
++ if (policy->max < this_dbs_info->cur_policy->cur)
++ __cpufreq_driver_target(this_dbs_info->cur_policy,
++ policy->max, CPUFREQ_RELATION_H);
++ else if (policy->min > this_dbs_info->cur_policy->cur)
++ __cpufreq_driver_target(this_dbs_info->cur_policy,
++ policy->min, CPUFREQ_RELATION_L);
++ mutex_unlock(&this_dbs_info->timer_mutex);
++ break;
++ }
++ return 0;
++}
++
++static int __init cpufreq_gov_dbs_init(void)
++{
++ int err;
++ cputime64_t wall;
++ u64 idle_time;
++ int cpu = get_cpu();
++
++ idle_time = get_cpu_idle_time_us(cpu, &wall);
++ put_cpu();
++ if (idle_time != -1ULL) {
++ dbs_tuners_ins.up_threshold = DEFAULT_UP_FREQ_MIN_LOAD;
++ } else {
++ pr_err("cpufreq-hotplug: %s: assumes CONFIG_NO_HZ\n",
++ __func__);
++ return -EINVAL;
++ }
++
++ khotplug_wq = create_workqueue("khotplug");
++ if (!khotplug_wq) {
++ pr_err("Creation of khotplug failed\n");
++ return -EFAULT;
++ }
++ err = cpufreq_register_governor(&cpufreq_gov_hotplug);
++ if (err)
++ destroy_workqueue(khotplug_wq);
++
++ return err;
++}
++
++static void __exit cpufreq_gov_dbs_exit(void)
++{
++ cpufreq_unregister_governor(&cpufreq_gov_hotplug);
++ destroy_workqueue(khotplug_wq);
++}
++
++MODULE_AUTHOR("Mike Turquette <mturquette@ti.com>");
++MODULE_DESCRIPTION("'cpufreq_hotplug' - cpufreq governor for dynamic frequency scaling and CPU hotplugging");
++MODULE_LICENSE("GPL");
++
++#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_HOTPLUG
++fs_initcall(cpufreq_gov_dbs_init);
++#else
++module_init(cpufreq_gov_dbs_init);
++#endif
++module_exit(cpufreq_gov_dbs_exit);
+diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
+index a38fca8..6cbc3df 100644
+--- a/include/linux/cpufreq.h
++++ b/include/linux/cpufreq.h
+@@ -355,6 +355,9 @@ extern struct cpufreq_governor cpufreq_gov_ondemand;
+ #elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE)
+ extern struct cpufreq_governor cpufreq_gov_conservative;
+ #define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_conservative)
++#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_HOTPLUG)
++extern struct cpufreq_governor cpufreq_gov_hotplug;
++#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_hotplug)
+ #endif
+
+
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0001-OMAP-CPUfreq-ensure-driver-initializes-after-cpufreq.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0001-OMAP-CPUfreq-ensure-driver-initializes-after-cpufreq.patch
new file mode 100644
index 0000000000..5093df3d26
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0001-OMAP-CPUfreq-ensure-driver-initializes-after-cpufreq.patch
@@ -0,0 +1,27 @@
+From 2a72620933492b6be114a287e7188c47ee1f6844 Mon Sep 17 00:00:00 2001
+From: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
+Date: Wed, 11 Aug 2010 17:02:43 -0700
+Subject: [PATCH 1/8] OMAP: CPUfreq: ensure driver initializes after cpufreq framework and governors
+
+Signed-off-by: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
+Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
+---
+ arch/arm/plat-omap/cpu-omap.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
+index da4f68d..cd09d4b 100644
+--- a/arch/arm/plat-omap/cpu-omap.c
++++ b/arch/arm/plat-omap/cpu-omap.c
+@@ -160,7 +160,7 @@ static int __init omap_cpufreq_init(void)
+ return cpufreq_register_driver(&omap_driver);
+ }
+
+-arch_initcall(omap_cpufreq_init);
++late_initcall(omap_cpufreq_init);
+
+ /*
+ * if ever we want to remove this, upon cleanup call:
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0002-OMAP-CPUfreq-ensure-policy-is-fully-initialized.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0002-OMAP-CPUfreq-ensure-policy-is-fully-initialized.patch
new file mode 100644
index 0000000000..5ef85b55b1
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0002-OMAP-CPUfreq-ensure-policy-is-fully-initialized.patch
@@ -0,0 +1,31 @@
+From ec7b7d1f27887ec5d76a2d4175e54cedcfa379da Mon Sep 17 00:00:00 2001
+From: Kevin Hilman <khilman@deeprootsystems.com>
+Date: Wed, 11 Aug 2010 17:05:38 -0700
+Subject: [PATCH 2/8] OMAP: CPUfreq: ensure policy is fully initialized
+
+Ensure policy min/max/cur values are initialized when OMAP
+CPUfreq driver starts.
+
+Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
+---
+ arch/arm/plat-omap/cpu-omap.c | 4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
+index cd09d4b..1b36664 100644
+--- a/arch/arm/plat-omap/cpu-omap.c
++++ b/arch/arm/plat-omap/cpu-omap.c
+@@ -126,6 +126,10 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
+ VERY_HI_RATE) / 1000;
+ }
+
++ policy->min = policy->cpuinfo.min_freq;
++ policy->max = policy->cpuinfo.max_freq;
++ policy->cur = omap_getspeed(0);
++
+ /* FIXME: what's the actual transition time? */
+ policy->cpuinfo.transition_latency = 300 * 1000;
+
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0003-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0003-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch
new file mode 100644
index 0000000000..8593ee4de1
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0003-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch
@@ -0,0 +1,263 @@
+From 5f6e9a6011a5eedc51fc8157fffcae5b7fdf87e7 Mon Sep 17 00:00:00 2001
+From: Rajendra Nayak <rnayak@ti.com>
+Date: Mon, 10 Nov 2008 17:00:25 +0530
+Subject: [PATCH 3/8] OMAP3 PM: CPUFreq driver for OMAP3
+
+CPUFreq driver for OMAP3
+
+With additional fixes and cleanups from Tero Kristo:
+- Fix rate calculation bug in omap3_select_table_rate
+- Refreshed DVFS VDD1 control against latest clock fw
+
+Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
+Signed-off-by: Rajendra Nayak <rnayak@ti.com>
+
+OMAP3: PM: CPUFreq: Fix omap_getspeed.
+
+Signed-off-by: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
+
+Make sure omap cpufreq driver initializes after cpufreq framework and governors
+
+Signed-off-by: Peter 'p2' De Schrijver <peter.de-schrijver@nokia.com>
+
+merge: CPUFreq: remove obsolete funcs
+
+OMAP3 clock: Update cpufreq driver
+
+This patch removes all refrences to virtual clock
+nodes in CPUFreq driver.
+
+Signed-off-by: Rajendra Nayak <rnayak@ti.com>
+Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
+Signed-off-by: Jean Pihet <jpihet@mvista.com>
+
+PM: Prevent direct cpufreq scaling during initialization
+
+It is seen that the OMAP specific cpufreq initialization code tries to
+scale the MPU frequency to the highest possible without taking care of
+the voltage level. On power on reset the power IC does not provide the
+necessary voltage for the highest available MPU frequency (that would
+satisfy all Si families). This potentially is an window of opportunity
+for things to go wrong.
+
+Signed-off-by: Romit Dasgupta <romit@ti.com>
+Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
+
+OMAP3: PM: enable 600MHz (overdrive) OPP
+
+Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
+
+omap3: introduce cpufreq
+
+OMAP OPP layer functions now have dependencies of CONFIG_CPU_FREQ only.
+
+With this patch, omap opp layer now has its compilation flags
+bound to CONFIG_CPU_FREQ. Also its code has been removed from pm34xx.c.
+
+A new file has been created to contain cpu freq code related to
+OMAP3: cpufreq34xx.c
+
+OMAP34xx and OMAP36xx family OPPs are made available
+
+Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
+Signed-off-by: Paul Walmsley <paul@pwsan.com>
+Signed-off-by: Nishanth Menon <nm@ti.com>
+Signed-off-by: Vishwanath BS <vishwanath.bs@ti.com>
+Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
+Signed-off-by: Romit Dasgupta <romit@ti.com>
+Signed-off-by: Rajendra Nayak <rnayak@ti.com>
+
+omap3: cpufreq: allow default opp table init
+
+For board files which choose to override the defaults, the existing
+mechanism will work, for boards that would like to work with defaults,
+allow init_common_hw to call init_opp_table to initialize if not
+already initialized. this will allow all omap boards which have opp
+tables predefined for a silicon to use the same.
+
+Originally reported for overo:
+http://marc.info/?t=127265269400004&r=1&w=2
+
+Signed-off-by: Nishanth Menon <nm@ti.com>
+Reported-by: Peter Tseng <tsenpet09@gmail.com>
+Cc: Cliff Brake <cliff.brake@gmail.com>
+Cc: Kevin Hilman <khilman@deeprootsystems.com>
+
+OMAP2: update OPP data to be device based
+
+Cc: Nishanth Menon <nm@ti.com>
+Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
+
+OMAP3: CPUfreq: update to device-based OPP API
+
+Update usage of OPP API to use new device-based API. This requires
+getting the 'struct device' for the MPU and using that with the OPP
+API.
+
+Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
+
+omap3: opp: make independent of cpufreq
+
+Make opp3xx data which is registered with the opp layer
+dependent purely on CONFIG_PM as opp layer and pm.c users
+are CONFIG_PM dependent not cpufreq dependent.
+so we rename the data definition to opp3xxx_data.c (inline with what
+we have for omap2), also move the build definition to be under
+the existing CONFIG_PM build instead of CPUFREQ.
+
+Cc: Eduardo Valentin <eduardo.valentin@nokia.com>
+Cc: Kevin Hilman <khilman@deeprootsystems.com>
+Cc: Paul Walmsley <paul@pwsan.com>
+Cc: Rajendra Nayak <rnayak@ti.com>
+Cc: Sanjeev Premi <premi@ti.com>
+Cc: Thara Gopinath <thara@ti.com>
+Cc: Tony Lindgren <tony@atomide.com>
+
+Signed-off-by: Nishanth Menon <nm@ti.com>
+---
+ arch/arm/mach-omap2/clock.h | 14 +++++++++++++-
+ arch/arm/mach-omap2/clock34xx.c | 2 ++
+ arch/arm/plat-omap/cpu-omap.c | 34 +++++++++++++++++++++++++++++++---
+ 3 files changed, 46 insertions(+), 4 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
+index e10ff2b..0a07e50 100644
+--- a/arch/arm/mach-omap2/clock.h
++++ b/arch/arm/mach-omap2/clock.h
+@@ -141,7 +141,9 @@ extern const struct clksel_rate gpt_sys_rates[];
+ extern const struct clksel_rate gfx_l3_rates[];
+ extern const struct clksel_rate dsp_ick_rates[];
+
+-#if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_CPU_FREQ)
++#ifdef CONFIG_CPU_FREQ
++
++#ifdef CONFIG_ARCH_OMAP2
+ extern void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table);
+ extern void omap2_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table);
+ #else
+@@ -149,6 +151,16 @@ extern void omap2_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table)
+ #define omap2_clk_exit_cpufreq_table 0
+ #endif
+
++#ifdef CONFIG_ARCH_OMAP3
++extern void omap3_clk_init_cpufreq_table(struct cpufreq_frequency_table **table);
++extern void omap3_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table);
++#else
++#define omap3_clk_init_cpufreq_table 0
++#define omap3_clk_exit_cpufreq_table 0
++#endif
++
++#endif /* CONFIG_CPU_FREQ */
++
+ extern const struct clkops clkops_omap2_iclk_dflt_wait;
+ extern const struct clkops clkops_omap2_iclk_dflt;
+ extern const struct clkops clkops_omap2_iclk_idle_only;
+diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
+index 1fc96b9..119e135 100644
+--- a/arch/arm/mach-omap2/clock34xx.c
++++ b/arch/arm/mach-omap2/clock34xx.c
+@@ -20,6 +20,8 @@
+ #include <linux/kernel.h>
+ #include <linux/clk.h>
+ #include <linux/io.h>
++#include <linux/err.h>
++#include <linux/cpufreq.h>
+
+ #include <plat/clock.h>
+
+diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
+index 1b36664..f0f9430 100644
+--- a/arch/arm/plat-omap/cpu-omap.c
++++ b/arch/arm/plat-omap/cpu-omap.c
+@@ -8,6 +8,10 @@
+ *
+ * Based on cpu-sa1110.c, Copyright (C) 2001 Russell King
+ *
++ * Copyright (C) 2007-2008 Texas Instruments, Inc.
++ * Updated to support OMAP3
++ * Rajendra Nayak <rnayak@ti.com>
++ *
+ * 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.
+@@ -26,12 +30,19 @@
+ #include <plat/clock.h>
+ #include <asm/system.h>
+
++#if defined(CONFIG_ARCH_OMAP3) && !defined(CONFIG_OMAP_PM_NONE)
++#include <plat/omap-pm.h>
++#include <plat/opp.h>
++#endif
++
+ #define VERY_HI_RATE 900000000
+
+ static struct cpufreq_frequency_table *freq_table;
+
+ #ifdef CONFIG_ARCH_OMAP1
+ #define MPU_CLK "mpu"
++#elif CONFIG_ARCH_OMAP3
++#define MPU_CLK "arm_fck"
+ #else
+ #define MPU_CLK "virt_prcm_set"
+ #endif
+@@ -73,7 +84,13 @@ static int omap_target(struct cpufreq_policy *policy,
+ unsigned int target_freq,
+ unsigned int relation)
+ {
++#ifdef CONFIG_ARCH_OMAP1
+ struct cpufreq_freqs freqs;
++#endif
++#if defined(CONFIG_ARCH_OMAP3) && !defined(CONFIG_OMAP_PM_NONE)
++ unsigned long freq;
++ struct device *mpu_dev = omap2_get_mpuss_device();
++#endif
+ int ret = 0;
+
+ /* Ensure desired rate is within allowed range. Some govenors
+@@ -83,13 +100,13 @@ static int omap_target(struct cpufreq_policy *policy,
+ if (target_freq > policy->max)
+ target_freq = policy->max;
+
++#ifdef CONFIG_ARCH_OMAP1
+ freqs.old = omap_getspeed(0);
+ freqs.new = clk_round_rate(mpu_clk, target_freq * 1000) / 1000;
+ freqs.cpu = 0;
+
+ if (freqs.old == freqs.new)
+ return ret;
+-
+ cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+ #ifdef CONFIG_CPU_FREQ_DEBUG
+ printk(KERN_DEBUG "cpufreq-omap: transition: %u --> %u\n",
+@@ -97,7 +114,11 @@ static int omap_target(struct cpufreq_policy *policy,
+ #endif
+ ret = clk_set_rate(mpu_clk, freqs.new * 1000);
+ cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
+-
++#elif defined(CONFIG_ARCH_OMAP3) && !defined(CONFIG_OMAP_PM_NONE)
++ freq = target_freq * 1000;
++ if (opp_find_freq_ceil(mpu_dev, &freq))
++ omap_pm_cpu_set_freq(freq);
++#endif
+ return ret;
+ }
+
+@@ -114,7 +135,14 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
+
+ policy->cur = policy->min = policy->max = omap_getspeed(0);
+
+- clk_init_cpufreq_table(&freq_table);
++ if (!cpu_is_omap34xx()) {
++ clk_init_cpufreq_table(&freq_table);
++ } else {
++ struct device *mpu_dev = omap2_get_mpuss_device();
++
++ opp_init_cpufreq_table(mpu_dev, &freq_table);
++ }
++
+ if (freq_table) {
+ result = cpufreq_frequency_table_cpuinfo(policy, freq_table);
+ if (!result)
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0004-OMAP-PM-CPUFREQ-Fix-conditional-compilation.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0004-OMAP-PM-CPUFREQ-Fix-conditional-compilation.patch
new file mode 100644
index 0000000000..aa9cd48515
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0004-OMAP-PM-CPUFREQ-Fix-conditional-compilation.patch
@@ -0,0 +1,32 @@
+From 1f013ab3b839edb583a276b5591a744dc4308bf8 Mon Sep 17 00:00:00 2001
+From: Silesh C V <silesh@ti.com>
+Date: Wed, 29 Sep 2010 14:52:54 +0530
+Subject: [PATCH 4/8] OMAP: PM: CPUFREQ: Fix conditional compilation
+
+Fix conditional compilation. A conditional expresiion
+should follow "#elif", in this case #elif clause should
+check whether CONFIG_ARCH_OMAP3 is defined or not
+(ie. defined(CONFIG_ARCH_OMAP3)) rather than checking for
+the value of the macro.
+
+Signed-off-by: Silesh C V <silesh@ti.com>
+---
+ arch/arm/plat-omap/cpu-omap.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
+index f0f9430..c3ac065 100644
+--- a/arch/arm/plat-omap/cpu-omap.c
++++ b/arch/arm/plat-omap/cpu-omap.c
+@@ -41,7 +41,7 @@ static struct cpufreq_frequency_table *freq_table;
+
+ #ifdef CONFIG_ARCH_OMAP1
+ #define MPU_CLK "mpu"
+-#elif CONFIG_ARCH_OMAP3
++#elif defined(CONFIG_ARCH_OMAP3)
+ #define MPU_CLK "arm_fck"
+ #else
+ #define MPU_CLK "virt_prcm_set"
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0005-cpufreq-fixup-after-new-OPP-layer-merged.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0005-cpufreq-fixup-after-new-OPP-layer-merged.patch
new file mode 100644
index 0000000000..f3432a2c33
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0005-cpufreq-fixup-after-new-OPP-layer-merged.patch
@@ -0,0 +1,33 @@
+From 43e22afa61f3624628c8344bcae9e95f0cc8525a Mon Sep 17 00:00:00 2001
+From: Kevin Hilman <khilman@deeprootsystems.com>
+Date: Tue, 16 Nov 2010 11:48:41 -0800
+Subject: [PATCH 5/8] cpufreq: fixup after new OPP layer merged
+
+---
+ arch/arm/plat-omap/cpu-omap.c | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
+index c3ac065..9cd2709 100644
+--- a/arch/arm/plat-omap/cpu-omap.c
++++ b/arch/arm/plat-omap/cpu-omap.c
+@@ -25,6 +25,7 @@
+ #include <linux/err.h>
+ #include <linux/clk.h>
+ #include <linux/io.h>
++#include <linux/opp.h>
+
+ #include <mach/hardware.h>
+ #include <plat/clock.h>
+@@ -32,7 +33,7 @@
+
+ #if defined(CONFIG_ARCH_OMAP3) && !defined(CONFIG_OMAP_PM_NONE)
+ #include <plat/omap-pm.h>
+-#include <plat/opp.h>
++#include <plat/common.h>
+ #endif
+
+ #define VERY_HI_RATE 900000000
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0006-OMAP-cpufreq-Split-OMAP1-and-OMAP2PLUS-CPUfreq-drive.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0006-OMAP-cpufreq-Split-OMAP1-and-OMAP2PLUS-CPUfreq-drive.patch
new file mode 100644
index 0000000000..cf80cb7928
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0006-OMAP-cpufreq-Split-OMAP1-and-OMAP2PLUS-CPUfreq-drive.patch
@@ -0,0 +1,669 @@
+From 2a3ca1bc3f842bab22873e2d9d002e0a736d0f19 Mon Sep 17 00:00:00 2001
+From: Santosh Shilimkar <santosh.shilimkar@ti.com>
+Date: Mon, 14 Mar 2011 17:08:48 +0530
+Subject: [PATCH 6/8] OMAP: cpufreq: Split OMAP1 and OMAP2PLUS CPUfreq drivers.
+
+This patch is an attempt to cleanup the #ifdeferry in the
+omap CPUfreq drivers.
+
+The split betwenn OMAP1 and OMAP2PLUS is logical because
+ - OMAP1 doesn't support opp layer.
+ - OMAP1 build is seperate from omap2plus.
+
+Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
+Cc: Kevin Hilman <khilman@ti.com>
+Cc: Vishwanath BS <vishwanath.bs@ti.com>
+---
+ arch/arm/mach-omap1/Makefile | 3 +
+ arch/arm/mach-omap1/omap1-cpufreq.c | 176 ++++++++++++++++++++++++++
+ arch/arm/mach-omap2/Makefile | 3 +
+ arch/arm/mach-omap2/omap2plus-cpufreq.c | 201 ++++++++++++++++++++++++++++++
+ arch/arm/plat-omap/Makefile | 1 -
+ arch/arm/plat-omap/cpu-omap.c | 204 -------------------------------
+ 6 files changed, 383 insertions(+), 205 deletions(-)
+ create mode 100644 arch/arm/mach-omap1/omap1-cpufreq.c
+ create mode 100644 arch/arm/mach-omap2/omap2plus-cpufreq.c
+ delete mode 100644 arch/arm/plat-omap/cpu-omap.c
+
+diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile
+index af98117..e5082b0 100644
+--- a/arch/arm/mach-omap1/Makefile
++++ b/arch/arm/mach-omap1/Makefile
+@@ -10,6 +10,9 @@ obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
+
+ obj-$(CONFIG_OMAP_32K_TIMER) += timer32k.o
+
++# CPUFREQ driver
++obj-$(CONFIG_CPU_FREQ) += omap1-cpufreq.o
++
+ # Power Management
+ obj-$(CONFIG_PM) += pm.o sleep.o pm_bus.o
+
+diff --git a/arch/arm/mach-omap1/omap1-cpufreq.c b/arch/arm/mach-omap1/omap1-cpufreq.c
+new file mode 100644
+index 0000000..682cdc8
+--- /dev/null
++++ b/arch/arm/mach-omap1/omap1-cpufreq.c
+@@ -0,0 +1,176 @@
++/*
++ * OMAP1 cpufreq driver
++ *
++ * CPU frequency scaling for OMAP
++ *
++ * Copyright (C) 2005 Nokia Corporation
++ * Written by Tony Lindgren <tony@atomide.com>
++ *
++ * Based on cpu-sa1110.c, Copyright (C) 2001 Russell King
++ *
++ * Copyright (C) 2007-2008 Texas Instruments, Inc.
++ * Updated to support OMAP3
++ * Rajendra Nayak <rnayak@ti.com>
++ *
++ * 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/types.h>
++#include <linux/kernel.h>
++#include <linux/sched.h>
++#include <linux/cpufreq.h>
++#include <linux/delay.h>
++#include <linux/init.h>
++#include <linux/err.h>
++#include <linux/clk.h>
++#include <linux/io.h>
++#include <linux/opp.h>
++
++#include <asm/system.h>
++
++#include <plat/clock.h>
++#include <plat/omap-pm.h>
++
++#include <mach/hardware.h>
++
++#define VERY_HI_RATE 900000000
++
++static struct cpufreq_frequency_table *freq_table;
++static struct clk *mpu_clk;
++
++static int omap_verify_speed(struct cpufreq_policy *policy)
++{
++ if (freq_table)
++ return cpufreq_frequency_table_verify(policy, freq_table);
++
++ if (policy->cpu)
++ return -EINVAL;
++
++ cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
++ policy->cpuinfo.max_freq);
++
++ policy->min = clk_round_rate(mpu_clk, policy->min * 1000) / 1000;
++ policy->max = clk_round_rate(mpu_clk, policy->max * 1000) / 1000;
++ cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
++ policy->cpuinfo.max_freq);
++ return 0;
++}
++
++static unsigned int omap_getspeed(unsigned int cpu)
++{
++ unsigned long rate;
++
++ if (cpu)
++ return 0;
++
++ rate = clk_get_rate(mpu_clk) / 1000;
++ return rate;
++}
++
++static int omap_target(struct cpufreq_policy *policy,
++ unsigned int target_freq,
++ unsigned int relation)
++{
++ struct cpufreq_freqs freqs;
++ int ret = 0;
++
++ /* Ensure desired rate is within allowed range. Some govenors
++ * (ondemand) will just pass target_freq=0 to get the minimum. */
++ if (target_freq < policy->min)
++ target_freq = policy->min;
++ if (target_freq > policy->max)
++ target_freq = policy->max;
++
++ freqs.old = omap_getspeed(0);
++ freqs.new = clk_round_rate(mpu_clk, target_freq * 1000) / 1000;
++ freqs.cpu = 0;
++
++ if (freqs.old == freqs.new)
++ return ret;
++
++ cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
++
++#ifdef CONFIG_CPU_FREQ_DEBUG
++ pr_info("cpufreq-omap: transition: %u --> %u\n", freqs.old, freqs.new);
++#endif
++ ret = clk_set_rate(mpu_clk, freqs.new * 1000);
++
++ cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
++
++ return ret;
++}
++
++static int __init omap_cpu_init(struct cpufreq_policy *policy)
++{
++ int result = 0;
++
++ mpu_clk = clk_get(NULL, "mpu");
++ if (IS_ERR(mpu_clk))
++ return PTR_ERR(mpu_clk);
++
++ if (policy->cpu != 0)
++ return -EINVAL;
++
++ policy->cur = policy->min = policy->max = omap_getspeed(0);
++
++ clk_init_cpufreq_table(&freq_table);
++
++ if (freq_table) {
++ result = cpufreq_frequency_table_cpuinfo(policy, freq_table);
++ if (!result)
++ cpufreq_frequency_table_get_attr(freq_table,
++ policy->cpu);
++ } else {
++ policy->cpuinfo.min_freq = clk_round_rate(mpu_clk, 0) / 1000;
++ policy->cpuinfo.max_freq = clk_round_rate(mpu_clk,
++ VERY_HI_RATE) / 1000;
++ }
++
++ policy->min = policy->cpuinfo.min_freq;
++ policy->max = policy->cpuinfo.max_freq;
++ policy->cur = omap_getspeed(0);
++
++ /* FIXME: what's the actual transition time? */
++ policy->cpuinfo.transition_latency = 300 * 1000;
++
++ return 0;
++}
++
++static int omap_cpu_exit(struct cpufreq_policy *policy)
++{
++ clk_exit_cpufreq_table(&freq_table);
++ clk_put(mpu_clk);
++ return 0;
++}
++
++static struct freq_attr *omap_cpufreq_attr[] = {
++ &cpufreq_freq_attr_scaling_available_freqs,
++ NULL,
++};
++
++static struct cpufreq_driver omap_driver = {
++ .flags = CPUFREQ_STICKY,
++ .verify = omap_verify_speed,
++ .target = omap_target,
++ .get = omap_getspeed,
++ .init = omap_cpu_init,
++ .exit = omap_cpu_exit,
++ .name = "omap1",
++ .attr = omap_cpufreq_attr,
++};
++
++static int __init omap_cpufreq_init(void)
++{
++ return cpufreq_register_driver(&omap_driver);
++}
++
++static void __exit omap_cpufreq_exit(void)
++{
++ cpufreq_unregister_driver(&omap_driver);
++}
++
++MODULE_DESCRIPTION("cpufreq driver for OMAP1 SOCs");
++MODULE_LICENSE("GPL");
++module_init(omap_cpufreq_init);
++module_exit(omap_cpufreq_exit);
+diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
+index 512b152..42924f3 100644
+--- a/arch/arm/mach-omap2/Makefile
++++ b/arch/arm/mach-omap2/Makefile
+@@ -56,6 +56,9 @@ obj-$(CONFIG_ARCH_OMAP3) += opp3xxx_data.o
+ obj-$(CONFIG_ARCH_OMAP4) += opp4xxx_data.o
+ endif
+
++# CPUFREQ driver
++obj-$(CONFIG_CPU_FREQ) += omap2plus-cpufreq.o
++
+ # Power Management
+ ifeq ($(CONFIG_PM),y)
+ obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o
+diff --git a/arch/arm/mach-omap2/omap2plus-cpufreq.c b/arch/arm/mach-omap2/omap2plus-cpufreq.c
+new file mode 100644
+index 0000000..14f84cc
+--- /dev/null
++++ b/arch/arm/mach-omap2/omap2plus-cpufreq.c
+@@ -0,0 +1,201 @@
++/*
++ * OMAP2PLUS cpufreq driver
++ *
++ * CPU frequency scaling for OMAP
++ *
++ * Copyright (C) 2005 Nokia Corporation
++ * Written by Tony Lindgren <tony@atomide.com>
++ *
++ * Based on cpu-sa1110.c, Copyright (C) 2001 Russell King
++ *
++ * Copyright (C) 2007-2008 Texas Instruments, Inc.
++ * Updated to support OMAP3
++ * Rajendra Nayak <rnayak@ti.com>
++ *
++ * 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/types.h>
++#include <linux/kernel.h>
++#include <linux/sched.h>
++#include <linux/cpufreq.h>
++#include <linux/delay.h>
++#include <linux/init.h>
++#include <linux/err.h>
++#include <linux/clk.h>
++#include <linux/io.h>
++#include <linux/opp.h>
++
++#include <asm/system.h>
++#include <asm/smp_plat.h>
++
++#include <plat/clock.h>
++#include <plat/omap-pm.h>
++#include <plat/common.h>
++
++#include <mach/hardware.h>
++
++#define VERY_HI_RATE 900000000
++
++static struct cpufreq_frequency_table *freq_table;
++static struct clk *mpu_clk;
++
++static int omap_verify_speed(struct cpufreq_policy *policy)
++{
++ if (freq_table)
++ return cpufreq_frequency_table_verify(policy, freq_table);
++
++ if (policy->cpu)
++ return -EINVAL;
++
++ cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
++ policy->cpuinfo.max_freq);
++
++ policy->min = clk_round_rate(mpu_clk, policy->min * 1000) / 1000;
++ policy->max = clk_round_rate(mpu_clk, policy->max * 1000) / 1000;
++ cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
++ policy->cpuinfo.max_freq);
++ return 0;
++}
++
++static unsigned int omap_getspeed(unsigned int cpu)
++{
++ unsigned long rate;
++
++ if (cpu)
++ return 0;
++
++ rate = clk_get_rate(mpu_clk) / 1000;
++ return rate;
++}
++
++static int omap_target(struct cpufreq_policy *policy,
++ unsigned int target_freq,
++ unsigned int relation)
++{
++ int ret = 0;
++ struct cpufreq_freqs freqs;
++
++ /* Ensure desired rate is within allowed range. Some govenors
++ * (ondemand) will just pass target_freq=0 to get the minimum. */
++ if (target_freq < policy->min)
++ target_freq = policy->min;
++ if (target_freq > policy->max)
++ target_freq = policy->max;
++
++ freqs.old = omap_getspeed(0);
++ freqs.new = clk_round_rate(mpu_clk, target_freq * 1000) / 1000;
++ freqs.cpu = 0;
++
++ if (freqs.old == freqs.new)
++ return ret;
++
++ cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
++
++#ifdef CONFIG_CPU_FREQ_DEBUG
++ pr_info("cpufreq-omap: transition: %u --> %u\n", freqs.old, freqs.new);
++#endif
++
++ ret = clk_set_rate(mpu_clk, freqs.new * 1000);
++
++ /*
++ * Generic CPUFREQ driver jiffy update is under !SMP. So jiffies
++ * won't get updated when UP machine cpufreq build with
++ * CONFIG_SMP enabled. Below code is added only to manage that
++ * scenario
++ */
++ if (!is_smp())
++ loops_per_jiffy =
++ cpufreq_scale(loops_per_jiffy, freqs.old, freqs.new);
++
++ cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
++
++ return ret;
++}
++
++static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
++{
++ int result = 0;
++ struct device *mpu_dev;
++
++ if (cpu_is_omap24xx())
++ mpu_clk = clk_get(NULL, "virt_prcm_set");
++ else if (cpu_is_omap34xx())
++ mpu_clk = clk_get(NULL, "dpll1_ck");
++ else if (cpu_is_omap34xx())
++ mpu_clk = clk_get(NULL, "dpll_mpu_ck");
++
++ if (IS_ERR(mpu_clk))
++ return PTR_ERR(mpu_clk);
++
++ if (policy->cpu != 0)
++ return -EINVAL;
++
++ policy->cur = policy->min = policy->max = omap_getspeed(0);
++
++ mpu_dev = omap2_get_mpuss_device();
++ if (!mpu_dev) {
++ pr_warning("%s: unable to get the mpu device\n", __func__);
++ return -EINVAL;
++ }
++ opp_init_cpufreq_table(mpu_dev, &freq_table);
++
++ if (freq_table) {
++ result = cpufreq_frequency_table_cpuinfo(policy, freq_table);
++ if (!result)
++ cpufreq_frequency_table_get_attr(freq_table,
++ policy->cpu);
++ } else {
++ policy->cpuinfo.min_freq = clk_round_rate(mpu_clk, 0) / 1000;
++ policy->cpuinfo.max_freq = clk_round_rate(mpu_clk,
++ VERY_HI_RATE) / 1000;
++ }
++
++ policy->min = policy->cpuinfo.min_freq;
++ policy->max = policy->cpuinfo.max_freq;
++ policy->cur = omap_getspeed(0);
++
++ /* FIXME: what's the actual transition time? */
++ policy->cpuinfo.transition_latency = 300 * 1000;
++
++ return 0;
++}
++
++static int omap_cpu_exit(struct cpufreq_policy *policy)
++{
++ clk_exit_cpufreq_table(&freq_table);
++ clk_put(mpu_clk);
++ return 0;
++}
++
++static struct freq_attr *omap_cpufreq_attr[] = {
++ &cpufreq_freq_attr_scaling_available_freqs,
++ NULL,
++};
++
++static struct cpufreq_driver omap_driver = {
++ .flags = CPUFREQ_STICKY,
++ .verify = omap_verify_speed,
++ .target = omap_target,
++ .get = omap_getspeed,
++ .init = omap_cpu_init,
++ .exit = omap_cpu_exit,
++ .name = "omap2plus",
++ .attr = omap_cpufreq_attr,
++};
++
++static int __init omap_cpufreq_init(void)
++{
++ return cpufreq_register_driver(&omap_driver);
++}
++
++static void __exit omap_cpufreq_exit(void)
++{
++ cpufreq_unregister_driver(&omap_driver);
++}
++
++MODULE_DESCRIPTION("cpufreq driver for OMAP2PLUS SOCs");
++MODULE_LICENSE("GPL");
++module_init(omap_cpufreq_init);
++module_exit(omap_cpufreq_exit);
+diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile
+index a4a1285..ec7862e 100644
+--- a/arch/arm/plat-omap/Makefile
++++ b/arch/arm/plat-omap/Makefile
+@@ -21,7 +21,6 @@ obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
+ obj-$(CONFIG_OMAP_IOMMU) += iommu.o iovmm.o
+ obj-$(CONFIG_OMAP_IOMMU_DEBUG) += iommu-debug.o
+
+-obj-$(CONFIG_CPU_FREQ) += cpu-omap.o
+ obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o
+ obj-$(CONFIG_OMAP_DEBUG_DEVICES) += debug-devices.o
+ obj-$(CONFIG_OMAP_DEBUG_LEDS) += debug-leds.o
+diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
+deleted file mode 100644
+index 9cd2709..0000000
+--- a/arch/arm/plat-omap/cpu-omap.c
++++ /dev/null
+@@ -1,204 +0,0 @@
+-/*
+- * linux/arch/arm/plat-omap/cpu-omap.c
+- *
+- * CPU frequency scaling for OMAP
+- *
+- * Copyright (C) 2005 Nokia Corporation
+- * Written by Tony Lindgren <tony@atomide.com>
+- *
+- * Based on cpu-sa1110.c, Copyright (C) 2001 Russell King
+- *
+- * Copyright (C) 2007-2008 Texas Instruments, Inc.
+- * Updated to support OMAP3
+- * Rajendra Nayak <rnayak@ti.com>
+- *
+- * 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/types.h>
+-#include <linux/kernel.h>
+-#include <linux/sched.h>
+-#include <linux/cpufreq.h>
+-#include <linux/delay.h>
+-#include <linux/init.h>
+-#include <linux/err.h>
+-#include <linux/clk.h>
+-#include <linux/io.h>
+-#include <linux/opp.h>
+-
+-#include <mach/hardware.h>
+-#include <plat/clock.h>
+-#include <asm/system.h>
+-
+-#if defined(CONFIG_ARCH_OMAP3) && !defined(CONFIG_OMAP_PM_NONE)
+-#include <plat/omap-pm.h>
+-#include <plat/common.h>
+-#endif
+-
+-#define VERY_HI_RATE 900000000
+-
+-static struct cpufreq_frequency_table *freq_table;
+-
+-#ifdef CONFIG_ARCH_OMAP1
+-#define MPU_CLK "mpu"
+-#elif defined(CONFIG_ARCH_OMAP3)
+-#define MPU_CLK "arm_fck"
+-#else
+-#define MPU_CLK "virt_prcm_set"
+-#endif
+-
+-static struct clk *mpu_clk;
+-
+-/* TODO: Add support for SDRAM timing changes */
+-
+-static int omap_verify_speed(struct cpufreq_policy *policy)
+-{
+- if (freq_table)
+- return cpufreq_frequency_table_verify(policy, freq_table);
+-
+- if (policy->cpu)
+- return -EINVAL;
+-
+- cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
+- policy->cpuinfo.max_freq);
+-
+- policy->min = clk_round_rate(mpu_clk, policy->min * 1000) / 1000;
+- policy->max = clk_round_rate(mpu_clk, policy->max * 1000) / 1000;
+- cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
+- policy->cpuinfo.max_freq);
+- return 0;
+-}
+-
+-static unsigned int omap_getspeed(unsigned int cpu)
+-{
+- unsigned long rate;
+-
+- if (cpu)
+- return 0;
+-
+- rate = clk_get_rate(mpu_clk) / 1000;
+- return rate;
+-}
+-
+-static int omap_target(struct cpufreq_policy *policy,
+- unsigned int target_freq,
+- unsigned int relation)
+-{
+-#ifdef CONFIG_ARCH_OMAP1
+- struct cpufreq_freqs freqs;
+-#endif
+-#if defined(CONFIG_ARCH_OMAP3) && !defined(CONFIG_OMAP_PM_NONE)
+- unsigned long freq;
+- struct device *mpu_dev = omap2_get_mpuss_device();
+-#endif
+- int ret = 0;
+-
+- /* Ensure desired rate is within allowed range. Some govenors
+- * (ondemand) will just pass target_freq=0 to get the minimum. */
+- if (target_freq < policy->min)
+- target_freq = policy->min;
+- if (target_freq > policy->max)
+- target_freq = policy->max;
+-
+-#ifdef CONFIG_ARCH_OMAP1
+- freqs.old = omap_getspeed(0);
+- freqs.new = clk_round_rate(mpu_clk, target_freq * 1000) / 1000;
+- freqs.cpu = 0;
+-
+- if (freqs.old == freqs.new)
+- return ret;
+- cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+-#ifdef CONFIG_CPU_FREQ_DEBUG
+- printk(KERN_DEBUG "cpufreq-omap: transition: %u --> %u\n",
+- freqs.old, freqs.new);
+-#endif
+- ret = clk_set_rate(mpu_clk, freqs.new * 1000);
+- cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
+-#elif defined(CONFIG_ARCH_OMAP3) && !defined(CONFIG_OMAP_PM_NONE)
+- freq = target_freq * 1000;
+- if (opp_find_freq_ceil(mpu_dev, &freq))
+- omap_pm_cpu_set_freq(freq);
+-#endif
+- return ret;
+-}
+-
+-static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
+-{
+- int result = 0;
+-
+- mpu_clk = clk_get(NULL, MPU_CLK);
+- if (IS_ERR(mpu_clk))
+- return PTR_ERR(mpu_clk);
+-
+- if (policy->cpu != 0)
+- return -EINVAL;
+-
+- policy->cur = policy->min = policy->max = omap_getspeed(0);
+-
+- if (!cpu_is_omap34xx()) {
+- clk_init_cpufreq_table(&freq_table);
+- } else {
+- struct device *mpu_dev = omap2_get_mpuss_device();
+-
+- opp_init_cpufreq_table(mpu_dev, &freq_table);
+- }
+-
+- if (freq_table) {
+- result = cpufreq_frequency_table_cpuinfo(policy, freq_table);
+- if (!result)
+- cpufreq_frequency_table_get_attr(freq_table,
+- policy->cpu);
+- } else {
+- policy->cpuinfo.min_freq = clk_round_rate(mpu_clk, 0) / 1000;
+- policy->cpuinfo.max_freq = clk_round_rate(mpu_clk,
+- VERY_HI_RATE) / 1000;
+- }
+-
+- policy->min = policy->cpuinfo.min_freq;
+- policy->max = policy->cpuinfo.max_freq;
+- policy->cur = omap_getspeed(0);
+-
+- /* FIXME: what's the actual transition time? */
+- policy->cpuinfo.transition_latency = 300 * 1000;
+-
+- return 0;
+-}
+-
+-static int omap_cpu_exit(struct cpufreq_policy *policy)
+-{
+- clk_exit_cpufreq_table(&freq_table);
+- clk_put(mpu_clk);
+- return 0;
+-}
+-
+-static struct freq_attr *omap_cpufreq_attr[] = {
+- &cpufreq_freq_attr_scaling_available_freqs,
+- NULL,
+-};
+-
+-static struct cpufreq_driver omap_driver = {
+- .flags = CPUFREQ_STICKY,
+- .verify = omap_verify_speed,
+- .target = omap_target,
+- .get = omap_getspeed,
+- .init = omap_cpu_init,
+- .exit = omap_cpu_exit,
+- .name = "omap",
+- .attr = omap_cpufreq_attr,
+-};
+-
+-static int __init omap_cpufreq_init(void)
+-{
+- return cpufreq_register_driver(&omap_driver);
+-}
+-
+-late_initcall(omap_cpufreq_init);
+-
+-/*
+- * if ever we want to remove this, upon cleanup call:
+- *
+- * cpufreq_unregister_driver()
+- * cpufreq_frequency_table_put_attr()
+- */
+-
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0007-OMAP2PLUS-cpufreq-Add-SMP-support-to-cater-OMAP4430.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0007-OMAP2PLUS-cpufreq-Add-SMP-support-to-cater-OMAP4430.patch
new file mode 100644
index 0000000000..51c1b3ea20
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0007-OMAP2PLUS-cpufreq-Add-SMP-support-to-cater-OMAP4430.patch
@@ -0,0 +1,170 @@
+From 7e421930c287f42bed624ad65250c16deaeae50f Mon Sep 17 00:00:00 2001
+From: Santosh Shilimkar <santosh.shilimkar@ti.com>
+Date: Mon, 14 Mar 2011 17:08:49 +0530
+Subject: [PATCH 7/8] OMAP2PLUS: cpufreq: Add SMP support to cater OMAP4430
+
+On OMAP SMP configuartion, both processors share the voltage
+and clock. So both CPUs needs to be scaled together and hence
+needs software co-ordination.
+
+Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
+Cc: Kevin Hilman <khilman@ti.com>
+cc: Vishwanath BS <vishwanath.bs@ti.com>
+---
+ arch/arm/mach-omap2/omap2plus-cpufreq.c | 73 ++++++++++++++++++++++++++-----
+ 1 files changed, 62 insertions(+), 11 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/omap2plus-cpufreq.c b/arch/arm/mach-omap2/omap2plus-cpufreq.c
+index 14f84cc..8d472f6 100644
+--- a/arch/arm/mach-omap2/omap2plus-cpufreq.c
++++ b/arch/arm/mach-omap2/omap2plus-cpufreq.c
+@@ -26,9 +26,11 @@
+ #include <linux/clk.h>
+ #include <linux/io.h>
+ #include <linux/opp.h>
++#include <linux/cpu.h>
+
+ #include <asm/system.h>
+ #include <asm/smp_plat.h>
++#include <asm/cpu.h>
+
+ #include <plat/clock.h>
+ #include <plat/omap-pm.h>
+@@ -63,7 +65,7 @@ static unsigned int omap_getspeed(unsigned int cpu)
+ {
+ unsigned long rate;
+
+- if (cpu)
++ if (cpu >= NR_CPUS)
+ return 0;
+
+ rate = clk_get_rate(mpu_clk) / 1000;
+@@ -74,9 +76,13 @@ static int omap_target(struct cpufreq_policy *policy,
+ unsigned int target_freq,
+ unsigned int relation)
+ {
+- int ret = 0;
++ int i, ret = 0;
+ struct cpufreq_freqs freqs;
+
++ /* Changes not allowed until all CPUs are online */
++ if (is_smp() && (num_online_cpus() < NR_CPUS))
++ return ret;
++
+ /* Ensure desired rate is within allowed range. Some govenors
+ * (ondemand) will just pass target_freq=0 to get the minimum. */
+ if (target_freq < policy->min)
+@@ -84,15 +90,25 @@ static int omap_target(struct cpufreq_policy *policy,
+ if (target_freq > policy->max)
+ target_freq = policy->max;
+
+- freqs.old = omap_getspeed(0);
++ freqs.old = omap_getspeed(policy->cpu);
+ freqs.new = clk_round_rate(mpu_clk, target_freq * 1000) / 1000;
+- freqs.cpu = 0;
++ freqs.cpu = policy->cpu;
+
+ if (freqs.old == freqs.new)
+ return ret;
+
+- cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
++ if (!is_smp()) {
++ cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
++ goto set_freq;
++ }
++
++ /* notifiers */
++ for_each_cpu(i, policy->cpus) {
++ freqs.cpu = i;
++ cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
++ }
+
++set_freq:
+ #ifdef CONFIG_CPU_FREQ_DEBUG
+ pr_info("cpufreq-omap: transition: %u --> %u\n", freqs.old, freqs.new);
+ #endif
+@@ -105,12 +121,33 @@ static int omap_target(struct cpufreq_policy *policy,
+ * CONFIG_SMP enabled. Below code is added only to manage that
+ * scenario
+ */
+- if (!is_smp())
++ freqs.new = omap_getspeed(policy->cpu);
++ if (!is_smp()) {
+ loops_per_jiffy =
+ cpufreq_scale(loops_per_jiffy, freqs.old, freqs.new);
++ cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
++ goto skip_lpj;
++ }
+
+- cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
++#ifdef CONFIG_SMP
++ /*
++ * Note that loops_per_jiffy is not updated on SMP systems in
++ * cpufreq driver. So, update the per-CPU loops_per_jiffy value
++ * on frequency transition. We need to update all dependent CPUs.
++ */
++ for_each_cpu(i, policy->cpus)
++ per_cpu(cpu_data, i).loops_per_jiffy =
++ cpufreq_scale(per_cpu(cpu_data, i).loops_per_jiffy,
++ freqs.old, freqs.new);
++#endif
+
++ /* notifiers */
++ for_each_cpu(i, policy->cpus) {
++ freqs.cpu = i;
++ cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
++ }
++
++skip_lpj:
+ return ret;
+ }
+
+@@ -118,6 +155,7 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
+ {
+ int result = 0;
+ struct device *mpu_dev;
++ static cpumask_var_t cpumask;
+
+ if (cpu_is_omap24xx())
+ mpu_clk = clk_get(NULL, "virt_prcm_set");
+@@ -129,12 +167,12 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
+ if (IS_ERR(mpu_clk))
+ return PTR_ERR(mpu_clk);
+
+- if (policy->cpu != 0)
++ if (policy->cpu >= NR_CPUS)
+ return -EINVAL;
+
+- policy->cur = policy->min = policy->max = omap_getspeed(0);
+-
++ policy->cur = policy->min = policy->max = omap_getspeed(policy->cpu);
+ mpu_dev = omap2_get_mpuss_device();
++
+ if (!mpu_dev) {
+ pr_warning("%s: unable to get the mpu device\n", __func__);
+ return -EINVAL;
+@@ -154,7 +192,20 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
+
+ policy->min = policy->cpuinfo.min_freq;
+ policy->max = policy->cpuinfo.max_freq;
+- policy->cur = omap_getspeed(0);
++ policy->cur = omap_getspeed(policy->cpu);
++
++ /*
++ * On OMAP SMP configuartion, both processors share the voltage
++ * and clock. So both CPUs needs to be scaled together and hence
++ * needs software co-ordination. Use cpufreq affected_cpus
++ * interface to handle this scenario. Additional is_smp() check
++ * is to keep SMP_ON_UP build working.
++ */
++ if (is_smp()) {
++ policy->shared_type = CPUFREQ_SHARED_TYPE_ANY;
++ cpumask_or(cpumask, cpumask_of(policy->cpu), cpumask);
++ cpumask_copy(policy->cpus, cpumask);
++ }
+
+ /* FIXME: what's the actual transition time? */
+ policy->cpuinfo.transition_latency = 300 * 1000;
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0008-OMAP2PLUS-cpufreq-Fix-typo-when-attempting-to-set-mp.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0008-OMAP2PLUS-cpufreq-Fix-typo-when-attempting-to-set-mp.patch
new file mode 100644
index 0000000000..a2480818b3
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0008-OMAP2PLUS-cpufreq-Fix-typo-when-attempting-to-set-mp.patch
@@ -0,0 +1,29 @@
+From 92c6a90a264c5803fc239a7304e073cd1517658b Mon Sep 17 00:00:00 2001
+From: Jarkko Nikula <jhnikula@gmail.com>
+Date: Thu, 14 Apr 2011 16:21:58 +0300
+Subject: [PATCH 8/8] OMAP2PLUS: cpufreq: Fix typo when attempting to set mpu_clk for OMAP4
+
+Fix this typo as there is no dpll_mpu_ck for OMAP3 and code flow is clearly
+trying to set mpu_clk for OMAP4 for which this dpll_mpu_ck is available.
+
+Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
+---
+ arch/arm/mach-omap2/omap2plus-cpufreq.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/omap2plus-cpufreq.c b/arch/arm/mach-omap2/omap2plus-cpufreq.c
+index 8d472f6..d53ce23 100644
+--- a/arch/arm/mach-omap2/omap2plus-cpufreq.c
++++ b/arch/arm/mach-omap2/omap2plus-cpufreq.c
+@@ -161,7 +161,7 @@ static int __cpuinit omap_cpu_init(struct cpufreq_policy *policy)
+ mpu_clk = clk_get(NULL, "virt_prcm_set");
+ else if (cpu_is_omap34xx())
+ mpu_clk = clk_get(NULL, "dpll1_ck");
+- else if (cpu_is_omap34xx())
++ else if (cpu_is_omap44xx())
+ mpu_clk = clk_get(NULL, "dpll_mpu_ck");
+
+ if (IS_ERR(mpu_clk))
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0001-OMAP2-clockdomain-Add-an-api-to-read-idle-mode.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0001-OMAP2-clockdomain-Add-an-api-to-read-idle-mode.patch
new file mode 100644
index 0000000000..76ac4aba18
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0001-OMAP2-clockdomain-Add-an-api-to-read-idle-mode.patch
@@ -0,0 +1,77 @@
+From ec3154869b4d2fb10e3d455ec8af1e248d9c972b Mon Sep 17 00:00:00 2001
+From: Rajendra Nayak <rnayak@ti.com>
+Date: Tue, 5 Apr 2011 15:22:31 +0530
+Subject: [PATCH 1/6] OMAP2+: clockdomain: Add an api to read idle mode
+
+Add a clockdomain api to check if hardware supervised
+idle transitions are enabled on a clockdomain.
+
+Signed-off-by: Rajendra Nayak <rnayak@ti.com>
+---
+ arch/arm/mach-omap2/clockdomain.c | 21 +++++++++++++++++++++
+ arch/arm/mach-omap2/clockdomain.h | 3 +++
+ 2 files changed, 24 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c
+index 6cb6c03..2ab3686 100644
+--- a/arch/arm/mach-omap2/clockdomain.c
++++ b/arch/arm/mach-omap2/clockdomain.c
+@@ -795,6 +795,27 @@ void clkdm_deny_idle(struct clockdomain *clkdm)
+ arch_clkdm->clkdm_deny_idle(clkdm);
+ }
+
++/**
++ * clkdm_is_idle - Check if the clkdm hwsup/autoidle is enabled
++ * @clkdm: struct clockdomain *
++ *
++ * Returns true if the clockdomain is in hardware-supervised
++ * idle mode, or 0 otherwise.
++ *
++ */
++int clkdm_is_idle(struct clockdomain *clkdm)
++{
++ if (!clkdm)
++ return -EINVAL;
++
++ if (!arch_clkdm || !arch_clkdm->clkdm_is_idle)
++ return -EINVAL;
++
++ pr_debug("clockdomain: reading idle state for %s\n", clkdm->name);
++
++ return arch_clkdm->clkdm_is_idle(clkdm);
++}
++
+
+ /* Clockdomain-to-clock framework interface code */
+
+diff --git a/arch/arm/mach-omap2/clockdomain.h b/arch/arm/mach-omap2/clockdomain.h
+index 5823584..085ed82 100644
+--- a/arch/arm/mach-omap2/clockdomain.h
++++ b/arch/arm/mach-omap2/clockdomain.h
+@@ -138,6 +138,7 @@ struct clockdomain {
+ * @clkdm_wakeup: Force a clockdomain to wakeup
+ * @clkdm_allow_idle: Enable hw supervised idle transitions for clock domain
+ * @clkdm_deny_idle: Disable hw supervised idle transitions for clock domain
++ * @clkdm_is_idle: Check if hw supervised idle transitions are enabled
+ * @clkdm_clk_enable: Put the clkdm in right state for a clock enable
+ * @clkdm_clk_disable: Put the clkdm in right state for a clock disable
+ */
+@@ -154,6 +155,7 @@ struct clkdm_ops {
+ int (*clkdm_wakeup)(struct clockdomain *clkdm);
+ void (*clkdm_allow_idle)(struct clockdomain *clkdm);
+ void (*clkdm_deny_idle)(struct clockdomain *clkdm);
++ int (*clkdm_is_idle)(struct clockdomain *clkdm);
+ int (*clkdm_clk_enable)(struct clockdomain *clkdm);
+ int (*clkdm_clk_disable)(struct clockdomain *clkdm);
+ };
+@@ -177,6 +179,7 @@ int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm);
+
+ void clkdm_allow_idle(struct clockdomain *clkdm);
+ void clkdm_deny_idle(struct clockdomain *clkdm);
++int clkdm_is_idle(struct clockdomain *clkdm);
+
+ int clkdm_wakeup(struct clockdomain *clkdm);
+ int clkdm_sleep(struct clockdomain *clkdm);
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0002-OMAP2-clockdomain-Add-SoC-support-for-clkdm_is_idle.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0002-OMAP2-clockdomain-Add-SoC-support-for-clkdm_is_idle.patch
new file mode 100644
index 0000000000..a0471ef991
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0002-OMAP2-clockdomain-Add-SoC-support-for-clkdm_is_idle.patch
@@ -0,0 +1,86 @@
+From 85b9e8fe08a8c85096be91cb8eb60d5450dac71d Mon Sep 17 00:00:00 2001
+From: Rajendra Nayak <rnayak@ti.com>
+Date: Tue, 5 Apr 2011 15:22:36 +0530
+Subject: [PATCH 2/6] OMAP2+: clockdomain: Add SoC support for clkdm_is_idle
+
+Add the SoC specific implemenation for clkdm_is_idle
+for OMAP2/3 and OMAP4.
+
+Signed-off-by: Rajendra Nayak <rnayak@ti.com>
+---
+ arch/arm/mach-omap2/clockdomain2xxx_3xxx.c | 12 ++++++++++++
+ arch/arm/mach-omap2/clockdomain44xx.c | 7 +++++++
+ 2 files changed, 19 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
+index 48d0db7..db49baa 100644
+--- a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
++++ b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
+@@ -13,6 +13,7 @@
+ */
+
+ #include <linux/types.h>
++#include <linux/errno.h>
+ #include <plat/prcm.h>
+ #include "prm.h"
+ #include "prm2xxx_3xxx.h"
+@@ -146,6 +147,15 @@ static void omap2_clkdm_deny_idle(struct clockdomain *clkdm)
+ _clkdm_del_autodeps(clkdm);
+ }
+
++static int omap2_clkdm_is_idle(struct clockdomain *clkdm)
++{
++ if (!clkdm->clktrctrl_mask)
++ return -1;
++
++ return omap2_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
++ clkdm->clktrctrl_mask);
++}
++
+ static void _enable_hwsup(struct clockdomain *clkdm)
+ {
+ if (cpu_is_omap24xx())
+@@ -252,6 +262,7 @@ struct clkdm_ops omap2_clkdm_operations = {
+ .clkdm_wakeup = omap2_clkdm_wakeup,
+ .clkdm_allow_idle = omap2_clkdm_allow_idle,
+ .clkdm_deny_idle = omap2_clkdm_deny_idle,
++ .clkdm_is_idle = omap2_clkdm_is_idle,
+ .clkdm_clk_enable = omap2_clkdm_clk_enable,
+ .clkdm_clk_disable = omap2_clkdm_clk_disable,
+ };
+@@ -269,6 +280,7 @@ struct clkdm_ops omap3_clkdm_operations = {
+ .clkdm_wakeup = omap3_clkdm_wakeup,
+ .clkdm_allow_idle = omap3_clkdm_allow_idle,
+ .clkdm_deny_idle = omap3_clkdm_deny_idle,
++ .clkdm_is_idle = omap2_clkdm_is_idle,
+ .clkdm_clk_enable = omap2_clkdm_clk_enable,
+ .clkdm_clk_disable = omap2_clkdm_clk_disable,
+ };
+diff --git a/arch/arm/mach-omap2/clockdomain44xx.c b/arch/arm/mach-omap2/clockdomain44xx.c
+index a1a4ecd..4b10727 100644
+--- a/arch/arm/mach-omap2/clockdomain44xx.c
++++ b/arch/arm/mach-omap2/clockdomain44xx.c
+@@ -93,6 +93,12 @@ static void omap4_clkdm_deny_idle(struct clockdomain *clkdm)
+ clkdm->cm_inst, clkdm->clkdm_offs);
+ }
+
++static int omap4_clkdm_is_idle(struct clockdomain *clkdm)
++{
++ return omap4_cminst_is_clkdm_in_hwsup(clkdm->prcm_partition,
++ clkdm->cm_inst, clkdm->clkdm_offs);
++}
++
+ static int omap4_clkdm_clk_enable(struct clockdomain *clkdm)
+ {
+ bool hwsup = false;
+@@ -132,6 +138,7 @@ struct clkdm_ops omap4_clkdm_operations = {
+ .clkdm_wakeup = omap4_clkdm_wakeup,
+ .clkdm_allow_idle = omap4_clkdm_allow_idle,
+ .clkdm_deny_idle = omap4_clkdm_deny_idle,
++ .clkdm_is_idle = omap4_clkdm_is_idle,
+ .clkdm_clk_enable = omap4_clkdm_clk_enable,
+ .clkdm_clk_disable = omap4_clkdm_clk_disable,
+ };
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0003-OMAP2-PM-Initialise-sleep_switch-to-a-non-valid-valu.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0003-OMAP2-PM-Initialise-sleep_switch-to-a-non-valid-valu.patch
new file mode 100644
index 0000000000..99c0b746f4
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0003-OMAP2-PM-Initialise-sleep_switch-to-a-non-valid-valu.patch
@@ -0,0 +1,35 @@
+From 6dc3e54ade4c042c6e798fb6f17ff65b9357bc89 Mon Sep 17 00:00:00 2001
+From: Rajendra Nayak <rnayak@ti.com>
+Date: Tue, 5 Apr 2011 15:22:41 +0530
+Subject: [PATCH 3/6] OMAP2+: PM: Initialise sleep_switch to a non-valid value
+
+sleep_switch which is initialised to 0 in omap_set_pwrdm_state
+happens to be a valid sleep_switch type (FORCEWAKEUP_SWITCH)
+which are defined as
+#define FORCEWAKEUP_SWITCH 0
+#define LOWPOWERSTATE_SWITCH 1
+
+This causes the function to wrongly program some clock domains
+even when the Powerdomain is in ON state.
+
+Signed-off-by: Rajendra Nayak <rnayak@ti.com>
+---
+ arch/arm/mach-omap2/pm.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
+index 49486f5..d48813f 100644
+--- a/arch/arm/mach-omap2/pm.c
++++ b/arch/arm/mach-omap2/pm.c
+@@ -106,7 +106,7 @@ static void omap2_init_processor_devices(void)
+ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
+ {
+ u32 cur_state;
+- int sleep_switch = 0;
++ int sleep_switch = -1;
+ int ret = 0;
+
+ if (pwrdm == NULL || IS_ERR(pwrdm))
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0004-OMAP2-PM-idle-clkdms-only-if-already-in-idle.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0004-OMAP2-PM-idle-clkdms-only-if-already-in-idle.patch
new file mode 100644
index 0000000000..fe8a4966ee
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0004-OMAP2-PM-idle-clkdms-only-if-already-in-idle.patch
@@ -0,0 +1,50 @@
+From 828597d32fc3926e2c9e6c57adcc50c7eac824de Mon Sep 17 00:00:00 2001
+From: Rajendra Nayak <rnayak@ti.com>
+Date: Tue, 5 Apr 2011 15:22:48 +0530
+Subject: [PATCH 4/6] OMAP2+: PM: idle clkdms only if already in idle
+
+The omap_set_pwrdm_state function forces clockdomains
+to idle, without checking the existing idle state
+programmed, instead based solely on the HW capability
+of the clockdomain to support idle.
+This is wrong and the clockdomains should be idled
+post a state_switch *only* if idle transitions on the
+clockdomain were already enabled.
+
+Signed-off-by: Rajendra Nayak <rnayak@ti.com>
+---
+ arch/arm/mach-omap2/pm.c | 4 +++-
+ 1 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
+index d48813f..840b0e1 100644
+--- a/arch/arm/mach-omap2/pm.c
++++ b/arch/arm/mach-omap2/pm.c
+@@ -108,6 +108,7 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
+ u32 cur_state;
+ int sleep_switch = -1;
+ int ret = 0;
++ int hwsup = 0;
+
+ if (pwrdm == NULL || IS_ERR(pwrdm))
+ return -EINVAL;
+@@ -127,6 +128,7 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
+ (pwrdm->flags & PWRDM_HAS_LOWPOWERSTATECHANGE)) {
+ sleep_switch = LOWPOWERSTATE_SWITCH;
+ } else {
++ hwsup = clkdm_is_idle(pwrdm->pwrdm_clkdms[0]);
+ clkdm_wakeup(pwrdm->pwrdm_clkdms[0]);
+ pwrdm_wait_transition(pwrdm);
+ sleep_switch = FORCEWAKEUP_SWITCH;
+@@ -142,7 +144,7 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
+
+ switch (sleep_switch) {
+ case FORCEWAKEUP_SWITCH:
+- if (pwrdm->pwrdm_clkdms[0]->flags & CLKDM_CAN_ENABLE_AUTO)
++ if (hwsup)
+ clkdm_allow_idle(pwrdm->pwrdm_clkdms[0]);
+ else
+ clkdm_sleep(pwrdm->pwrdm_clkdms[0]);
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0005-OMAP2-hwmod-Follow-the-recomended-PRCM-sequence.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0005-OMAP2-hwmod-Follow-the-recomended-PRCM-sequence.patch
new file mode 100644
index 0000000000..aeeda5977f
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0005-OMAP2-hwmod-Follow-the-recomended-PRCM-sequence.patch
@@ -0,0 +1,46 @@
+From 6ecf0ebe9d520748b217a016ef8a0b239805a42c Mon Sep 17 00:00:00 2001
+From: Rajendra Nayak <rnayak@ti.com>
+Date: Tue, 29 Mar 2011 22:37:43 +0530
+Subject: [PATCH 5/6] OMAP2+: hwmod: Follow the recomended PRCM sequence
+
+Follow the recomended PRCM sequence.
+This still does not take care of Optional clocks.
+
+Signed-off-by: Rajendra Nayak <rnayak@ti.com>
+---
+ arch/arm/mach-omap2/omap_hwmod.c | 9 ++++++++-
+ 1 files changed, 8 insertions(+), 1 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
+index e034294..fc0db0c 100644
+--- a/arch/arm/mach-omap2/omap_hwmod.c
++++ b/arch/arm/mach-omap2/omap_hwmod.c
+@@ -1223,6 +1223,7 @@ static int _reset(struct omap_hwmod *oh)
+ static int _enable(struct omap_hwmod *oh)
+ {
+ int r;
++ int hwsup = 0;
+
+ if (oh->_state != _HWMOD_STATE_INITIALIZED &&
+ oh->_state != _HWMOD_STATE_IDLE &&
+@@ -1250,10 +1251,16 @@ static int _enable(struct omap_hwmod *oh)
+ omap_hwmod_mux(oh->mux, _HWMOD_STATE_ENABLED);
+
+ _add_initiator_dep(oh, mpu_oh);
++ if (oh->_clk && oh->_clk->clkdm) {
++ hwsup = clkdm_is_idle(oh->_clk->clkdm);
++ clkdm_wakeup(oh->_clk->clkdm);
++ }
+ _enable_clocks(oh);
+-
+ r = _wait_target_ready(oh);
+ if (!r) {
++ if (oh->_clk && oh->_clk->clkdm && hwsup)
++ clkdm_allow_idle(oh->_clk->clkdm);
++
+ oh->_state = _HWMOD_STATE_ENABLED;
+
+ /* Access the sysconfig only if the target is ready */
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0006-OMAP-Serial-Check-wk_st-only-if-present.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0006-OMAP-Serial-Check-wk_st-only-if-present.patch
new file mode 100644
index 0000000000..e95c9f8308
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0006-OMAP-Serial-Check-wk_st-only-if-present.patch
@@ -0,0 +1,33 @@
+From 0af36cc0dcf5a6654e25eb33509fe0bc44a1dd81 Mon Sep 17 00:00:00 2001
+From: Rajendra Nayak <rnayak@ti.com>
+Date: Tue, 2 Mar 2010 17:25:30 +0530
+Subject: [PATCH 6/6] OMAP: Serial: Check wk_st only if present
+
+Uart on the resume path tries to read wk_st registers, even
+on architectures were its not present/populated.
+This patch fixes the issue.
+
+Signed-off-by: Rajendra Nayak <rnayak@ti.com>
+---
+ arch/arm/mach-omap2/serial.c | 5 +++--
+ 1 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
+index 1ac361b..a0046ce 100644
+--- a/arch/arm/mach-omap2/serial.c
++++ b/arch/arm/mach-omap2/serial.c
+@@ -418,8 +418,9 @@ void omap_uart_resume_idle(int num)
+ }
+
+ /* Check for normal UART wakeup */
+- if (__raw_readl(uart->wk_st) & uart->wk_mask)
+- omap_uart_block_sleep(uart);
++ if (uart->wk_st && uart->wk_mask)
++ if (__raw_readl(uart->wk_st) & uart->wk_mask)
++ omap_uart_block_sleep(uart);
+ return;
+ }
+ }
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0001-OMAP3-voltage-remove-spurious-pr_notice-for-debugfs.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0001-OMAP3-voltage-remove-spurious-pr_notice-for-debugfs.patch
new file mode 100644
index 0000000000..f80c07ec39
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0001-OMAP3-voltage-remove-spurious-pr_notice-for-debugfs.patch
@@ -0,0 +1,30 @@
+From f505147f6352faaf3d70b00a757279d56e2ef78b Mon Sep 17 00:00:00 2001
+From: Nishanth Menon <nm@ti.com>
+Date: Sat, 12 Feb 2011 17:27:14 +0530
+Subject: [PATCH 01/12] OMAP3+: voltage: remove spurious pr_notice for debugfs
+
+cat of debugfs entry for vp_volt provides voltage. The additional pr_notice
+is just spam on console and provides no additional information.
+
+Signed-off-by: Nishanth Menon <nm@ti.com>
+Signed-off-by: Kevin Hilman <khilman@ti.com>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/voltage.c | 1 -
+ 1 files changed, 0 insertions(+), 1 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c
+index 0c1552d..9ef3789 100644
+--- a/arch/arm/mach-omap2/voltage.c
++++ b/arch/arm/mach-omap2/voltage.c
+@@ -148,7 +148,6 @@ static int vp_volt_debug_get(void *data, u64 *val)
+ }
+
+ vsel = vdd->read_reg(prm_mod_offs, vdd->vp_data->voltage);
+- pr_notice("curr_vsel = %x\n", vsel);
+
+ if (!vdd->pmic_info->vsel_to_uv) {
+ pr_warning("PMIC function to convert vsel to voltage"
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0002-OMAP4-PM-remove-redundant-ifdef-CONFIG_PM.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0002-OMAP4-PM-remove-redundant-ifdef-CONFIG_PM.patch
new file mode 100644
index 0000000000..dc800647e4
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0002-OMAP4-PM-remove-redundant-ifdef-CONFIG_PM.patch
@@ -0,0 +1,41 @@
+From 79f5f1bb1c1a0f004e41660742a0bf736744ad0e Mon Sep 17 00:00:00 2001
+From: Nishanth Menon <nm@ti.com>
+Date: Sun, 13 Mar 2011 09:07:23 +0530
+Subject: [PATCH 02/12] OMAP4: PM: remove redundant #ifdef CONFIG_PM
+
+pm44xx.c is built only when CONFIG_PM is setup,
+remove redundant CONFIG_PM check.
+
+This also fixes:
+https://bugzilla.kernel.org/show_bug.cgi?id=25022
+
+Reported-by: Martin Etti <ettl.martin@gmx.de>
+
+Signed-off-by: Nishanth Menon <nm@ti.com>
+Signed-off-by: Kevin Hilman <khilman@ti.com>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/pm44xx.c | 2 --
+ 1 files changed, 0 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c
+index 76cfff2..59a870b 100644
+--- a/arch/arm/mach-omap2/pm44xx.c
++++ b/arch/arm/mach-omap2/pm44xx.c
+@@ -105,13 +105,11 @@ static int __init omap4_pm_init(void)
+
+ pr_err("Power Management for TI OMAP4.\n");
+
+-#ifdef CONFIG_PM
+ ret = pwrdm_for_each(pwrdms_setup, NULL);
+ if (ret) {
+ pr_err("Failed to setup powerdomains\n");
+ goto err2;
+ }
+-#endif
+
+ #ifdef CONFIG_SUSPEND
+ suspend_set_ops(&omap_pm_ops);
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0003-OMAP3-smartreflex-fix-sr_late_init-error-path-in-pro.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0003-OMAP3-smartreflex-fix-sr_late_init-error-path-in-pro.patch
new file mode 100644
index 0000000000..a17d2bb5a4
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0003-OMAP3-smartreflex-fix-sr_late_init-error-path-in-pro.patch
@@ -0,0 +1,30 @@
+From b0ed051910c29c99e604ad4eb06d480199fcbd34 Mon Sep 17 00:00:00 2001
+From: Aaro Koskinen <aaro.koskinen@nokia.com>
+Date: Thu, 24 Mar 2011 18:35:31 +0200
+Subject: [PATCH 03/12] OMAP3+: smartreflex: fix sr_late_init() error path in probe
+
+sr_late_init() will take care of freeing the resources.
+
+Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
+Signed-off-by: Kevin Hilman <khilman@ti.com>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/smartreflex.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
+index 13e24f9..dbc4b6f 100644
+--- a/arch/arm/mach-omap2/smartreflex.c
++++ b/arch/arm/mach-omap2/smartreflex.c
+@@ -883,7 +883,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
+ ret = sr_late_init(sr_info);
+ if (ret) {
+ pr_warning("%s: Error in SR late init\n", __func__);
+- goto err_release_region;
++ return ret;
+ }
+ }
+
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0004-OMAP3-smartreflex-request-the-memory-region.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0004-OMAP3-smartreflex-request-the-memory-region.patch
new file mode 100644
index 0000000000..5ca9678ff0
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0004-OMAP3-smartreflex-request-the-memory-region.patch
@@ -0,0 +1,36 @@
+From d494d209b9b3c1cb13981a9756818f2822379a13 Mon Sep 17 00:00:00 2001
+From: Aaro Koskinen <aaro.koskinen@nokia.com>
+Date: Thu, 24 Mar 2011 18:35:32 +0200
+Subject: [PATCH 04/12] OMAP3+: smartreflex: request the memory region
+
+We are releasing the memory region, but never actually request it.
+
+Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
+Signed-off-by: Kevin Hilman <khilman@ti.com>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/smartreflex.c | 8 ++++++++
+ 1 files changed, 8 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
+index dbc4b6f..703143a 100644
+--- a/arch/arm/mach-omap2/smartreflex.c
++++ b/arch/arm/mach-omap2/smartreflex.c
+@@ -847,6 +847,14 @@ static int __init omap_sr_probe(struct platform_device *pdev)
+ goto err_free_devinfo;
+ }
+
++ mem = request_mem_region(mem->start, resource_size(mem),
++ dev_name(&pdev->dev));
++ if (!mem) {
++ dev_err(&pdev->dev, "%s: no mem region\n", __func__);
++ ret = -EBUSY;
++ goto err_free_devinfo;
++ }
++
+ irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+
+ pm_runtime_enable(&pdev->dev);
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0005-OMAP3-smartreflex-fix-ioremap-leak-on-probe-error.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0005-OMAP3-smartreflex-fix-ioremap-leak-on-probe-error.patch
new file mode 100644
index 0000000000..a9da969957
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0005-OMAP3-smartreflex-fix-ioremap-leak-on-probe-error.patch
@@ -0,0 +1,66 @@
+From 7553d0119d9f62a809d21993deaac2a745251c3b Mon Sep 17 00:00:00 2001
+From: Aaro Koskinen <aaro.koskinen@nokia.com>
+Date: Thu, 24 Mar 2011 18:35:33 +0200
+Subject: [PATCH 05/12] OMAP3+: smartreflex: fix ioremap leak on probe error
+
+Add missing iounmap() to error paths.
+
+Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
+Signed-off-by: Kevin Hilman <khilman@ti.com>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/smartreflex.c | 10 ++++++----
+ 1 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
+index 703143a..156807e 100644
+--- a/arch/arm/mach-omap2/smartreflex.c
++++ b/arch/arm/mach-omap2/smartreflex.c
+@@ -904,7 +904,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
+ vdd_dbg_dir = omap_voltage_get_dbgdir(sr_info->voltdm);
+ if (!vdd_dbg_dir) {
+ ret = -EINVAL;
+- goto err_release_region;
++ goto err_iounmap;
+ }
+
+ sr_info->dbg_dir = debugfs_create_dir("smartreflex", vdd_dbg_dir);
+@@ -912,7 +912,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
+ dev_err(&pdev->dev, "%s: Unable to create debugfs directory\n",
+ __func__);
+ ret = PTR_ERR(sr_info->dbg_dir);
+- goto err_release_region;
++ goto err_iounmap;
+ }
+
+ (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR,
+@@ -929,7 +929,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
+ dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
+ "for n-values\n", __func__);
+ ret = PTR_ERR(nvalue_dir);
+- goto err_release_region;
++ goto err_iounmap;
+ }
+
+ omap_voltage_get_volttable(sr_info->voltdm, &volt_data);
+@@ -939,7 +939,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
+ "entries for n-values\n",
+ __func__, sr_info->voltdm->name);
+ ret = -ENODATA;
+- goto err_release_region;
++ goto err_iounmap;
+ }
+
+ for (i = 0; i < sr_info->nvalue_count; i++) {
+@@ -953,6 +953,8 @@ static int __init omap_sr_probe(struct platform_device *pdev)
+
+ return ret;
+
++err_iounmap:
++ iounmap(sr_info->base);
+ err_release_region:
+ release_mem_region(mem->start, resource_size(mem));
+ err_free_devinfo:
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0006-OMAP3-smartreflex-delete-instance-from-sr_list-on-pr.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0006-OMAP3-smartreflex-delete-instance-from-sr_list-on-pr.patch
new file mode 100644
index 0000000000..8f76fc376b
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0006-OMAP3-smartreflex-delete-instance-from-sr_list-on-pr.patch
@@ -0,0 +1,29 @@
+From cdb1237e4829a7912fe4e78e73f20bda9ea22d6d Mon Sep 17 00:00:00 2001
+From: Aaro Koskinen <aaro.koskinen@nokia.com>
+Date: Thu, 24 Mar 2011 18:35:34 +0200
+Subject: [PATCH 06/12] OMAP3+: smartreflex: delete instance from sr_list on probe error
+
+If the probe fails, the node should be deleted from sr_list.
+
+Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
+Signed-off-by: Kevin Hilman <khilman@ti.com>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/smartreflex.c | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
+index 156807e..f0a488a 100644
+--- a/arch/arm/mach-omap2/smartreflex.c
++++ b/arch/arm/mach-omap2/smartreflex.c
+@@ -954,6 +954,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
+ return ret;
+
+ err_iounmap:
++ list_del(&sr_info->node);
+ iounmap(sr_info->base);
+ err_release_region:
+ release_mem_region(mem->start, resource_size(mem));
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0007-OMAP3-smartreflex-delete-debugfs-entries-on-probe-er.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0007-OMAP3-smartreflex-delete-debugfs-entries-on-probe-er.patch
new file mode 100644
index 0000000000..897ddb0dac
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0007-OMAP3-smartreflex-delete-debugfs-entries-on-probe-er.patch
@@ -0,0 +1,48 @@
+From abfa4bd473f227d2d0b42367c5aeaf6e16214a95 Mon Sep 17 00:00:00 2001
+From: Aaro Koskinen <aaro.koskinen@nokia.com>
+Date: Thu, 24 Mar 2011 18:35:35 +0200
+Subject: [PATCH 07/12] OMAP3+: smartreflex: delete debugfs entries on probe error
+
+Delete created debugfs entries if probe fails.
+
+Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
+Signed-off-by: Kevin Hilman <khilman@ti.com>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/smartreflex.c | 6 ++++--
+ 1 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
+index f0a488a..fb7dc52 100644
+--- a/arch/arm/mach-omap2/smartreflex.c
++++ b/arch/arm/mach-omap2/smartreflex.c
+@@ -929,7 +929,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
+ dev_err(&pdev->dev, "%s: Unable to create debugfs directory"
+ "for n-values\n", __func__);
+ ret = PTR_ERR(nvalue_dir);
+- goto err_iounmap;
++ goto err_debugfs;
+ }
+
+ omap_voltage_get_volttable(sr_info->voltdm, &volt_data);
+@@ -939,7 +939,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)
+ "entries for n-values\n",
+ __func__, sr_info->voltdm->name);
+ ret = -ENODATA;
+- goto err_iounmap;
++ goto err_debugfs;
+ }
+
+ for (i = 0; i < sr_info->nvalue_count; i++) {
+@@ -953,6 +953,8 @@ static int __init omap_sr_probe(struct platform_device *pdev)
+
+ return ret;
+
++err_debugfs:
++ debugfs_remove_recursive(sr_info->dbg_dir);
+ err_iounmap:
+ list_del(&sr_info->node);
+ iounmap(sr_info->base);
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0008-OMAP3-cpuidle-remove-useless-SDP-specific-timings.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0008-OMAP3-cpuidle-remove-useless-SDP-specific-timings.patch
new file mode 100644
index 0000000000..72183c44f8
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0008-OMAP3-cpuidle-remove-useless-SDP-specific-timings.patch
@@ -0,0 +1,57 @@
+From f8a6387ba73da6c8fe4281449b85f1825f2403bb Mon Sep 17 00:00:00 2001
+From: Jean Pihet <j-pihet@ti.com>
+Date: Fri, 29 Apr 2011 11:26:22 +0200
+Subject: [PATCH 08/12] OMAP3 cpuidle: remove useless SDP specific timings
+
+The cpuidle states settings can be overriden by some board-
+specific settings, by calling omap3_pm_init_cpuidle.
+Remove the 3430SDP specific states settings registration
+since the figures are identical to the default ones (in cpuidle34xx.c).
+
+Signed-off-by: Jean Pihet <j-pihet@ti.com>
+Signed-off-by: Kevin Hilman <khilman@ti.com>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/board-3430sdp.c | 19 -------------------
+ 1 files changed, 0 insertions(+), 19 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
+index 9afd087..7ffad7b 100644
+--- a/arch/arm/mach-omap2/board-3430sdp.c
++++ b/arch/arm/mach-omap2/board-3430sdp.c
+@@ -59,24 +59,6 @@
+
+ #define TWL4030_MSECURE_GPIO 22
+
+-/* FIXME: These values need to be updated based on more profiling on 3430sdp*/
+-static struct cpuidle_params omap3_cpuidle_params_table[] = {
+- /* C1 */
+- {1, 2, 2, 5},
+- /* C2 */
+- {1, 10, 10, 30},
+- /* C3 */
+- {1, 50, 50, 300},
+- /* C4 */
+- {1, 1500, 1800, 4000},
+- /* C5 */
+- {1, 2500, 7500, 12000},
+- /* C6 */
+- {1, 3000, 8500, 15000},
+- /* C7 */
+- {1, 10000, 30000, 300000},
+-};
+-
+ static uint32_t board_keymap[] = {
+ KEY(0, 0, KEY_LEFT),
+ KEY(0, 1, KEY_RIGHT),
+@@ -883,7 +865,6 @@ static void __init omap_3430sdp_init(void)
+ omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
+ omap_board_config = sdp3430_config;
+ omap_board_config_size = ARRAY_SIZE(sdp3430_config);
+- omap3_pm_init_cpuidle(omap3_cpuidle_params_table);
+ omap3430_i2c_init();
+ omap_display_init(&sdp3430_dss_data);
+ if (omap_rev() > OMAP3430_REV_ES1_0)
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0009-OMAP3-SR-make-notify-independent-of-class.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0009-OMAP3-SR-make-notify-independent-of-class.patch
new file mode 100644
index 0000000000..2e5414c76a
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0009-OMAP3-SR-make-notify-independent-of-class.patch
@@ -0,0 +1,48 @@
+From d7992ea7da87a0802fa2b65819bf0e3adc5ba502 Mon Sep 17 00:00:00 2001
+From: Nishanth Menon <nm@ti.com>
+Date: Mon, 14 Feb 2011 12:16:36 +0530
+Subject: [PATCH 09/12] OMAP3+: SR: make notify independent of class
+
+Interrupt notification mechanism of SmartReflex can be used by the
+choice of implementation of the class driver. For example, Class 2 and
+Class 1.5 of SmartReflex can both use the interrupt notification to
+identify the transition of voltage or other events.
+
+Hence, the actual class does not matter for notifier. Let the class
+driver's handling decide how it should be used. SmartReflex driver
+should provide just the primitives.
+
+Signed-off-by: Nishanth Menon <nm@ti.com>
+Signed-off-by: Kevin Hilman <khilman@ti.com>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/smartreflex.c | 6 ++----
+ 1 files changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
+index fb7dc52..3ee7261 100644
+--- a/arch/arm/mach-omap2/smartreflex.c
++++ b/arch/arm/mach-omap2/smartreflex.c
+@@ -143,7 +143,7 @@ static irqreturn_t sr_interrupt(int irq, void *data)
+ sr_write_reg(sr_info, IRQSTATUS, status);
+ }
+
+- if (sr_class->class_type == SR_CLASS2 && sr_class->notify)
++ if (sr_class->notify)
+ sr_class->notify(sr_info->voltdm, status);
+
+ return IRQ_HANDLED;
+@@ -258,9 +258,7 @@ static int sr_late_init(struct omap_sr *sr_info)
+ struct resource *mem;
+ int ret = 0;
+
+- if (sr_class->class_type == SR_CLASS2 &&
+- sr_class->notify_flags && sr_info->irq) {
+-
++ if (sr_class->notify && sr_class->notify_flags && sr_info->irq) {
+ name = kasprintf(GFP_KERNEL, "sr_%s", sr_info->voltdm->name);
+ if (name == NULL) {
+ ret = -ENOMEM;
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0010-OMAP3-SR-disable-interrupt-by-default.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0010-OMAP3-SR-disable-interrupt-by-default.patch
new file mode 100644
index 0000000000..10ada9159a
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0010-OMAP3-SR-disable-interrupt-by-default.patch
@@ -0,0 +1,37 @@
+From 1f8185e181d5b9c1f47ce5f858dad3bba2be240d Mon Sep 17 00:00:00 2001
+From: Nishanth Menon <nm@ti.com>
+Date: Mon, 14 Feb 2011 12:41:10 +0530
+Subject: [PATCH 10/12] OMAP3+: SR: disable interrupt by default
+
+We will enable and disable interrupt on a need basis in the class
+driver. We need to keep the IRQ disabled by default else the
+forceupdate or vcbypass events could trigger events that we don't
+need/expect to handle.
+
+This is a preparation for SmartReflex AVS class drivers such as
+class 2 and class 1.5 which would need to use interrupts. Existing
+SmartReflex AVS class 3 driver does not require to use interrupts
+and is not impacted by this change.
+
+Signed-off-by: Nishanth Menon <nm@ti.com>
+Signed-off-by: Kevin Hilman <khilman@ti.com>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/smartreflex.c | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
+index 3ee7261..616ef62 100644
+--- a/arch/arm/mach-omap2/smartreflex.c
++++ b/arch/arm/mach-omap2/smartreflex.c
+@@ -268,6 +268,7 @@ static int sr_late_init(struct omap_sr *sr_info)
+ 0, name, (void *)sr_info);
+ if (ret)
+ goto error;
++ disable_irq(sr_info->irq);
+ }
+
+ if (pdata && pdata->enable_on_init)
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0011-OMAP3-SR-enable-disable-SR-only-on-need.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0011-OMAP3-SR-enable-disable-SR-only-on-need.patch
new file mode 100644
index 0000000000..99176652dd
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0011-OMAP3-SR-enable-disable-SR-only-on-need.patch
@@ -0,0 +1,41 @@
+From 488e6ec1262fd56c62b09874fcf8557709f30ef2 Mon Sep 17 00:00:00 2001
+From: Nishanth Menon <nm@ti.com>
+Date: Mon, 14 Feb 2011 21:14:17 +0530
+Subject: [PATCH 11/12] OMAP3+: SR: enable/disable SR only on need
+
+Since we already know the state of the autocomp enablement, we can
+see if the requested state is different from the current state and
+enable/disable SR only on the need basis.
+
+Signed-off-by: Nishanth Menon <nm@ti.com>
+Signed-off-by: Kevin Hilman <khilman@ti.com>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/smartreflex.c | 11 +++++++----
+ 1 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
+index 616ef62..3bd9fac 100644
+--- a/arch/arm/mach-omap2/smartreflex.c
++++ b/arch/arm/mach-omap2/smartreflex.c
+@@ -807,10 +807,13 @@ static int omap_sr_autocomp_store(void *data, u64 val)
+ return -EINVAL;
+ }
+
+- if (!val)
+- sr_stop_vddautocomp(sr_info);
+- else
+- sr_start_vddautocomp(sr_info);
++ /* control enable/disable only if there is a delta in value */
++ if (sr_info->autocomp_active != val) {
++ if (!val)
++ sr_stop_vddautocomp(sr_info);
++ else
++ sr_start_vddautocomp(sr_info);
++ }
+
+ return 0;
+ }
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0012-OMAP3-SR-fix-cosmetic-indentation.patch b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0012-OMAP3-SR-fix-cosmetic-indentation.patch
new file mode 100644
index 0000000000..e8dddc1c60
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/pm/linux-omap-2.6.39-ti-pm/0012-OMAP3-SR-fix-cosmetic-indentation.patch
@@ -0,0 +1,49 @@
+From 5e50b744aeca31be1c93790e048fc69c2f77c6c9 Mon Sep 17 00:00:00 2001
+From: Nishanth Menon <nm@ti.com>
+Date: Mon, 14 Feb 2011 12:33:13 +0530
+Subject: [PATCH 12/12] OMAP3+: SR: fix cosmetic indentation
+
+Error label case seems to have a 2 tab indentation when just 1 is
+necessary.
+
+Signed-off-by: Nishanth Menon <nm@ti.com>
+Signed-off-by: Kevin Hilman <khilman@ti.com>
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/smartreflex.c | 20 ++++++++++----------
+ 1 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
+index 3bd9fac..2ce2fb7 100644
+--- a/arch/arm/mach-omap2/smartreflex.c
++++ b/arch/arm/mach-omap2/smartreflex.c
+@@ -277,16 +277,16 @@ static int sr_late_init(struct omap_sr *sr_info)
+ return ret;
+
+ error:
+- iounmap(sr_info->base);
+- mem = platform_get_resource(sr_info->pdev, IORESOURCE_MEM, 0);
+- release_mem_region(mem->start, resource_size(mem));
+- list_del(&sr_info->node);
+- dev_err(&sr_info->pdev->dev, "%s: ERROR in registering"
+- "interrupt handler. Smartreflex will"
+- "not function as desired\n", __func__);
+- kfree(name);
+- kfree(sr_info);
+- return ret;
++ iounmap(sr_info->base);
++ mem = platform_get_resource(sr_info->pdev, IORESOURCE_MEM, 0);
++ release_mem_region(mem->start, resource_size(mem));
++ list_del(&sr_info->node);
++ dev_err(&sr_info->pdev->dev, "%s: ERROR in registering"
++ "interrupt handler. Smartreflex will"
++ "not function as desired\n", __func__);
++ kfree(name);
++ kfree(sr_info);
++ return ret;
+ }
+
+ static void sr_v1_disable(struct omap_sr *sr)
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0001-OMAP-DSS2-DSI-fix-use_sys_clk-highfreq.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0001-OMAP-DSS2-DSI-fix-use_sys_clk-highfreq.patch
new file mode 100644
index 0000000000..24700eede9
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0001-OMAP-DSS2-DSI-fix-use_sys_clk-highfreq.patch
@@ -0,0 +1,33 @@
+From 19d9727973e7b0c5f8983a1a5ae3b0a02e062bab Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@ti.com>
+Date: Thu, 7 Apr 2011 15:28:47 +0300
+Subject: [PATCH 01/31] OMAP: DSS2: DSI: fix use_sys_clk & highfreq
+
+use_sys_clk and highfreq fields in dsi.current_cinfo were never set.
+Luckily they weren't used anywhere so it didn't cause any problems.
+
+This patch fixes those fields and they are now set at the same time as
+the rest of the fields.
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
+---
+ drivers/video/omap2/dss/dsi.c | 3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index 0a7f1a4..8604153 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -1276,6 +1276,9 @@ int dsi_pll_set_clock_div(struct dsi_clock_info *cinfo)
+
+ DSSDBGF();
+
++ dsi.current_cinfo.use_sys_clk = cinfo->use_sys_clk;
++ dsi.current_cinfo.highfreq = cinfo->highfreq;
++
+ dsi.current_cinfo.fint = cinfo->fint;
+ dsi.current_cinfo.clkin4ddr = cinfo->clkin4ddr;
+ dsi.current_cinfo.dsi_pll_hsdiv_dispc_clk =
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0002-OMAP-DSS2-DSI-fix-dsi_dump_clocks.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0002-OMAP-DSS2-DSI-fix-dsi_dump_clocks.patch
new file mode 100644
index 0000000000..7ab7f4d778
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0002-OMAP-DSS2-DSI-fix-dsi_dump_clocks.patch
@@ -0,0 +1,49 @@
+From 2bc828d1b81d857238dc8b1f29e38e466469e352 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@ti.com>
+Date: Mon, 4 Apr 2011 10:02:53 +0300
+Subject: [PATCH 02/31] OMAP: DSS2: DSI: fix dsi_dump_clocks()
+
+On OMAP4, reading DSI_PLL_CONFIGURATION2 register requires the L3 clock
+(CIO_CLK_ICG) to PLL. Currently dsi_dump_clocks() tries to read that
+register without enabling the L3 clock, leading to crash if DSI is not
+in use.
+
+The status of the bit being read from DSI_PLL_CONFIGURATION2 is
+available from dsi_clock_info->use_sys_clk, so we can avoid the whole
+problem by just using that.
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
+---
+ drivers/video/omap2/dss/dsi.c | 6 +-----
+ 1 files changed, 1 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index 8604153..1464ac4 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -1491,7 +1491,6 @@ void dsi_pll_uninit(void)
+
+ void dsi_dump_clocks(struct seq_file *s)
+ {
+- int clksel;
+ struct dsi_clock_info *cinfo = &dsi.current_cinfo;
+ enum dss_clk_source dispc_clk_src, dsi_clk_src;
+
+@@ -1500,13 +1499,10 @@ void dsi_dump_clocks(struct seq_file *s)
+
+ enable_clocks(1);
+
+- clksel = REG_GET(DSI_PLL_CONFIGURATION2, 11, 11);
+-
+ seq_printf(s, "- DSI PLL -\n");
+
+ seq_printf(s, "dsi pll source = %s\n",
+- clksel == 0 ?
+- "dss_sys_clk" : "pclkfree");
++ cinfo->use_sys_clk ? "dss_sys_clk" : "pclkfree");
+
+ seq_printf(s, "Fint\t\t%-16luregn %u\n", cinfo->fint, cinfo->regn);
+
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0003-OMAP2PLUS-DSS2-Fix-Return-correct-lcd-clock-source-f.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0003-OMAP2PLUS-DSS2-Fix-Return-correct-lcd-clock-source-f.patch
new file mode 100644
index 0000000000..0bef2d2f66
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0003-OMAP2PLUS-DSS2-Fix-Return-correct-lcd-clock-source-f.patch
@@ -0,0 +1,43 @@
+From 29d6de29d3d0d2ac9fe0572cd4e0485757eca550 Mon Sep 17 00:00:00 2001
+From: Archit Taneja <archit@ti.com>
+Date: Thu, 31 Mar 2011 13:23:35 +0530
+Subject: [PATCH 03/31] OMAP2PLUS: DSS2: Fix: Return correct lcd clock source for OMAP2/3
+
+dss.lcd_clk_source is set to the default value DSS_CLK_SRC_FCK at dss_init.
+For OMAP2 and OMAP3, the dss.lcd_clk_source should always be the same as
+dss.dispc_clk_source. The function dss_get_lcd_clk_source() always returns the
+default value DSS_CLK_SRC_FCK for OMAP2/3. This leads to wrong clock dumps when
+dispc_clk_source is not DSS_CLK_SRC_FCK.
+
+Correct this function to always return dss.dispc_clk_source for OMAP2/3.
+
+Signed-off-by: Archit Taneja <archit@ti.com>
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
+---
+ drivers/video/omap2/dss/dss.c | 10 ++++++++--
+ 1 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
+index 3f1fee6..c3b48a0 100644
+--- a/drivers/video/omap2/dss/dss.c
++++ b/drivers/video/omap2/dss/dss.c
+@@ -385,8 +385,14 @@ enum dss_clk_source dss_get_dsi_clk_source(void)
+
+ enum dss_clk_source dss_get_lcd_clk_source(enum omap_channel channel)
+ {
+- int ix = channel == OMAP_DSS_CHANNEL_LCD ? 0 : 1;
+- return dss.lcd_clk_source[ix];
++ if (dss_has_feature(FEAT_LCD_CLK_SRC)) {
++ int ix = channel == OMAP_DSS_CHANNEL_LCD ? 0 : 1;
++ return dss.lcd_clk_source[ix];
++ } else {
++ /* LCD_CLK source is the same as DISPC_FCLK source for
++ * OMAP2 and OMAP3 */
++ return dss.dispc_clk_source;
++ }
+ }
+
+ /* calculate clock rates using dividers in cinfo */
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0004-OMAP-DSS-DSI-Fix-DSI-PLL-power-bug.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0004-OMAP-DSS-DSI-Fix-DSI-PLL-power-bug.patch
new file mode 100644
index 0000000000..f204b87e42
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0004-OMAP-DSS-DSI-Fix-DSI-PLL-power-bug.patch
@@ -0,0 +1,64 @@
+From e7665ffb72cbc890b8494c687b335e3e242231d9 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@ti.com>
+Date: Fri, 15 Apr 2011 10:42:59 +0300
+Subject: [PATCH 04/31] OMAP: DSS: DSI: Fix DSI PLL power bug
+
+OMAP3630 has a HW bug causing DSI PLL power command POWER_ON_DIV (0x3)
+to not work properly. The bug prevents us from enabling DSI PLL power
+only to HS divider block.
+
+This patch adds a dss feature for the bug and converts POWER_ON_DIV
+requests to POWER_ON_ALL (0x2).
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
+---
+ drivers/video/omap2/dss/dsi.c | 5 +++++
+ drivers/video/omap2/dss/dss_features.c | 2 +-
+ drivers/video/omap2/dss/dss_features.h | 2 ++
+ 3 files changed, 8 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
+index 1464ac4..cbd9ca4 100644
+--- a/drivers/video/omap2/dss/dsi.c
++++ b/drivers/video/omap2/dss/dsi.c
+@@ -1059,6 +1059,11 @@ static int dsi_pll_power(enum dsi_pll_power_state state)
+ {
+ int t = 0;
+
++ /* DSI-PLL power command 0x3 is not working */
++ if (dss_has_feature(FEAT_DSI_PLL_PWR_BUG) &&
++ state == DSI_PLL_POWER_ON_DIV)
++ state = DSI_PLL_POWER_ON_ALL;
++
+ REG_FLD_MOD(DSI_CLK_CTRL, state, 31, 30); /* PLL_PWR_CMD */
+
+ /* PLL_PWR_STATUS */
+diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
+index aa16222..8c50e18 100644
+--- a/drivers/video/omap2/dss/dss_features.c
++++ b/drivers/video/omap2/dss/dss_features.c
+@@ -271,7 +271,7 @@ static struct omap_dss_features omap3630_dss_features = {
+ FEAT_LCDENABLESIGNAL | FEAT_PCKFREEENABLE |
+ FEAT_PRE_MULT_ALPHA | FEAT_FUNCGATED |
+ FEAT_ROWREPEATENABLE | FEAT_LINEBUFFERSPLIT |
+- FEAT_RESIZECONF,
++ FEAT_RESIZECONF | FEAT_DSI_PLL_PWR_BUG,
+
+ .num_mgrs = 2,
+ .num_ovls = 3,
+diff --git a/drivers/video/omap2/dss/dss_features.h b/drivers/video/omap2/dss/dss_features.h
+index 12e9c4e..37922ce 100644
+--- a/drivers/video/omap2/dss/dss_features.h
++++ b/drivers/video/omap2/dss/dss_features.h
+@@ -40,6 +40,8 @@ enum dss_feat_id {
+ /* Independent core clk divider */
+ FEAT_CORE_CLK_DIV = 1 << 11,
+ FEAT_LCD_CLK_SRC = 1 << 12,
++ /* DSI-PLL power command 0x3 is not working */
++ FEAT_DSI_PLL_PWR_BUG = 1 << 13,
+ };
+
+ /* DSS register field id */
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0005-OMAP-DSS2-fix-panel-Kconfig-dependencies.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0005-OMAP-DSS2-fix-panel-Kconfig-dependencies.patch
new file mode 100644
index 0000000000..8d4b175bcc
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0005-OMAP-DSS2-fix-panel-Kconfig-dependencies.patch
@@ -0,0 +1,61 @@
+From c84fbf480062086f93f99c27817e4d2d91593511 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@ti.com>
+Date: Fri, 8 Apr 2011 09:30:27 +0300
+Subject: [PATCH 05/31] OMAP: DSS2: fix panel Kconfig dependencies
+
+All DPI panels were missing dependency to OMAP2_DSS_DPI. Add the
+dependency.
+
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
+---
+ drivers/video/omap2/displays/Kconfig | 9 +++++----
+ 1 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/video/omap2/displays/Kconfig b/drivers/video/omap2/displays/Kconfig
+index d18ad6b..609a280 100644
+--- a/drivers/video/omap2/displays/Kconfig
++++ b/drivers/video/omap2/displays/Kconfig
+@@ -3,6 +3,7 @@ menu "OMAP2/3 Display Device Drivers"
+
+ config PANEL_GENERIC_DPI
+ tristate "Generic DPI Panel"
++ depends on OMAP2_DSS_DPI
+ help
+ Generic DPI panel driver.
+ Supports DVI output for Beagle and OMAP3 SDP.
+@@ -11,20 +12,20 @@ config PANEL_GENERIC_DPI
+
+ config PANEL_LGPHILIPS_LB035Q02
+ tristate "LG.Philips LB035Q02 LCD Panel"
+- depends on OMAP2_DSS && SPI
++ depends on OMAP2_DSS_DPI && SPI
+ help
+ LCD Panel used on the Gumstix Overo Palo35
+
+ config PANEL_SHARP_LS037V7DW01
+ tristate "Sharp LS037V7DW01 LCD Panel"
+- depends on OMAP2_DSS
++ depends on OMAP2_DSS_DPI
+ select BACKLIGHT_CLASS_DEVICE
+ help
+ LCD Panel used in TI's SDP3430 and EVM boards
+
+ config PANEL_NEC_NL8048HL11_01B
+ tristate "NEC NL8048HL11-01B Panel"
+- depends on OMAP2_DSS
++ depends on OMAP2_DSS_DPI
+ help
+ This NEC NL8048HL11-01B panel is TFT LCD
+ used in the Zoom2/3/3630 sdp boards.
+@@ -37,7 +38,7 @@ config PANEL_TAAL
+
+ config PANEL_TPO_TD043MTEA1
+ tristate "TPO TD043MTEA1 LCD Panel"
+- depends on OMAP2_DSS && SPI
++ depends on OMAP2_DSS_DPI && SPI
+ help
+ LCD Panel used in OMAP3 Pandora
+
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0006-OMAP-DSS2-add-bootarg-for-selecting-svideo-or-compos.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0006-OMAP-DSS2-add-bootarg-for-selecting-svideo-or-compos.patch
new file mode 100644
index 0000000000..e7751c58dc
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0006-OMAP-DSS2-add-bootarg-for-selecting-svideo-or-compos.patch
@@ -0,0 +1,75 @@
+From 756700075d8ebd5979f3ea2d20f44356c417dfe4 Mon Sep 17 00:00:00 2001
+From: Steve Sakoman <steve@sakoman.com>
+Date: Tue, 19 Jan 2010 21:19:15 -0800
+Subject: [PATCH 06/31] OMAP: DSS2: add bootarg for selecting svideo or composite for tv output
+
+also add pal-16 and ntsc-16 omapfb.mode settings for 16bpp
+---
+ drivers/video/omap2/dss/venc.c | 22 ++++++++++++++++++++++
+ drivers/video/omap2/omapfb/omapfb-main.c | 10 +++++++++-
+ 2 files changed, 31 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
+index 8e35a5b..827723f 100644
+--- a/drivers/video/omap2/dss/venc.c
++++ b/drivers/video/omap2/dss/venc.c
+@@ -85,6 +85,11 @@
+ #define VENC_OUTPUT_TEST 0xC8
+ #define VENC_DAC_B__DAC_C 0xC8
+
++static char *tv_connection;
++
++module_param_named(tvcable, tv_connection, charp, 0);
++MODULE_PARM_DESC(tvcable, "TV connection type (svideo, composite)");
++
+ struct venc_config {
+ u32 f_control;
+ u32 vidout_ctrl;
+@@ -458,6 +463,23 @@ static int venc_panel_probe(struct omap_dss_device *dssdev)
+ {
+ dssdev->panel.timings = omap_dss_pal_timings;
+
++ /* Allow the TV output to be overriden */
++ if (tv_connection) {
++ if (strcmp(tv_connection, "svideo") == 0) {
++ printk(KERN_INFO
++ "omapdss: tv output is svideo.\n");
++ dssdev->phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO;
++ } else if (strcmp(tv_connection, "composite") == 0) {
++ printk(KERN_INFO
++ "omapdss: tv output is composite.\n");
++ dssdev->phy.venc.type = OMAP_DSS_VENC_TYPE_COMPOSITE;
++ } else {
++ printk(KERN_INFO
++ "omapdss: unsupported output type'%s'.\n",
++ tv_connection);
++ }
++ }
++
+ return 0;
+ }
+
+diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
+index 505ec66..eaeded5 100644
+--- a/drivers/video/omap2/omapfb/omapfb-main.c
++++ b/drivers/video/omap2/omapfb/omapfb-main.c
+@@ -2036,7 +2036,15 @@ static int omapfb_mode_to_timings(const char *mode_str,
+ int r;
+
+ #ifdef CONFIG_OMAP2_DSS_VENC
+- if (strcmp(mode_str, "pal") == 0) {
++ if (strcmp(mode_str, "pal-16") == 0) {
++ *timings = omap_dss_pal_timings;
++ *bpp = 16;
++ return 0;
++ } else if (strcmp(mode_str, "ntsc-16") == 0) {
++ *timings = omap_dss_ntsc_timings;
++ *bpp = 16;
++ return 0;
++ } else if (strcmp(mode_str, "pal") == 0) {
+ *timings = omap_dss_pal_timings;
+ *bpp = 24;
+ return 0;
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0007-video-add-timings-for-hd720.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0007-video-add-timings-for-hd720.patch
new file mode 100644
index 0000000000..3cd3ff98fc
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0007-video-add-timings-for-hd720.patch
@@ -0,0 +1,27 @@
+From bbfdb465c2970b1cd18fd0ae5adf99e61cfd530e Mon Sep 17 00:00:00 2001
+From: Steve Sakoman <steve@sakoman.com>
+Date: Sat, 19 Dec 2009 06:52:43 -0800
+Subject: [PATCH 07/31] video: add timings for hd720
+
+---
+ drivers/video/modedb.c | 4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c
+index 48c3ea8..b320a30 100644
+--- a/drivers/video/modedb.c
++++ b/drivers/video/modedb.c
+@@ -103,6 +103,10 @@ static const struct fb_videomode modedb[] = {
+ { NULL, 70, 1024, 768, 13333, 144, 24, 29, 3, 136, 6, 0,
+ FB_VMODE_NONINTERLACED },
+
++ /* 1280x720 @ 60 Hz, 45 kHz hsync, CEA 681-E Format 4 */
++ { "hd720", 60, 1280, 720, 13468, 220, 110, 20, 5, 40, 5, 0,
++ FB_VMODE_NONINTERLACED },
++
+ /* 1280x1024 @ 87 Hz interlaced, 51 kHz hsync */
+ { NULL, 87, 1280, 1024, 12500, 56, 16, 128, 1, 216, 12, 0,
+ FB_VMODE_INTERLACED },
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0008-drivers-net-smsc911x-return-ENODEV-if-device-is-not-.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0008-drivers-net-smsc911x-return-ENODEV-if-device-is-not-.patch
new file mode 100644
index 0000000000..b798199c7d
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0008-drivers-net-smsc911x-return-ENODEV-if-device-is-not-.patch
@@ -0,0 +1,29 @@
+From 45b1b2aefac18adf9246b56f82355597b26e997b Mon Sep 17 00:00:00 2001
+From: Steve Sakoman <sakoman@gmail.com>
+Date: Tue, 15 Dec 2009 15:17:44 -0800
+Subject: [PATCH 08/31] drivers: net: smsc911x: return ENODEV if device is not found
+
+Signed-off-by: Steve Sakoman <sakoman@gmail.com>
+---
+ drivers/net/smsc911x.c | 4 +++-
+ 1 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
+index 4b42ecc..5c1202b 100644
+--- a/drivers/net/smsc911x.c
++++ b/drivers/net/smsc911x.c
+@@ -2028,8 +2028,10 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
+ }
+
+ retval = smsc911x_init(dev);
+- if (retval < 0)
++ if (retval < 0) {
++ retval = -ENODEV;
+ goto out_unmap_io_3;
++ }
+
+ /* configure irq polarity and type before connecting isr */
+ if (pdata->config.irq_polarity == SMSC911X_IRQ_POLARITY_ACTIVE_HIGH)
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0009-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0009-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch
new file mode 100644
index 0000000000..80b09dd535
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0009-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch
@@ -0,0 +1,47 @@
+From fda068cf87fc12f12aeaea2e428d78afac43c19b Mon Sep 17 00:00:00 2001
+From: Steve Sakoman <sakoman@gmail.com>
+Date: Tue, 15 Dec 2009 15:24:10 -0800
+Subject: [PATCH 09/31] drivers: input: touchscreen: ads7846: return ENODEV if device is not found
+
+Signed-off-by: Steve Sakoman <sakoman@gmail.com>
+---
+ drivers/input/touchscreen/ads7846.c | 13 ++++++++++---
+ 1 files changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
+index 1de1c19..097db10 100644
+--- a/drivers/input/touchscreen/ads7846.c
++++ b/drivers/input/touchscreen/ads7846.c
+@@ -1338,11 +1338,18 @@ static int __devinit ads7846_probe(struct spi_device *spi)
+ * the touchscreen, in case it's not connected.
+ */
+ if (ts->model == 7845)
+- ads7845_read12_ser(&spi->dev, PWRDOWN);
++ err = ads7845_read12_ser(&spi->dev, PWRDOWN);
+ else
+- (void) ads7846_read12_ser(&spi->dev,
++ err = ads7846_read12_ser(&spi->dev,
+ READ_12BIT_SER(vaux) | ADS_PD10_ALL_ON);
+
++ /* if sample is all 0's or all 1's then there is no device on spi */
++ if ( (err == 0x000) || (err == 0xfff)) {
++ dev_info(&spi->dev, "no device detected, test read result was 0x%08X\n", err);
++ err = -ENODEV;
++ goto err_free_irq;
++ }
++
+ err = sysfs_create_group(&spi->dev.kobj, &ads784x_attr_group);
+ if (err)
+ goto err_remove_hwmon;
+@@ -1366,7 +1373,7 @@ static int __devinit ads7846_probe(struct spi_device *spi)
+ err_put_regulator:
+ regulator_put(ts->reg);
+ err_free_gpio:
+- if (!ts->get_pendown_state)
++ if (!ts->get_pendown_state && ts->gpio_pendown != -1)
+ gpio_free(ts->gpio_pendown);
+ err_cleanup_filter:
+ if (ts->filter_cleanup)
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0010-Revert-omap2_mcspi-Flush-posted-writes.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0010-Revert-omap2_mcspi-Flush-posted-writes.patch
new file mode 100644
index 0000000000..ef74568fa4
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0010-Revert-omap2_mcspi-Flush-posted-writes.patch
@@ -0,0 +1,25 @@
+From 44940d48b3d535072e6a4d225173c3115bacc75b Mon Sep 17 00:00:00 2001
+From: Steve Sakoman <steve@sakoman.com>
+Date: Thu, 3 Mar 2011 13:29:30 -0800
+Subject: [PATCH 10/31] Revert "omap2_mcspi: Flush posted writes"
+
+This reverts commit a330ce2001b290c59fe98c37e981683ef0a75fdf.
+---
+ drivers/spi/omap2_mcspi.c | 1 -
+ 1 files changed, 0 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
+index 6f86ba0..6094be7 100644
+--- a/drivers/spi/omap2_mcspi.c
++++ b/drivers/spi/omap2_mcspi.c
+@@ -195,7 +195,6 @@ static inline void mcspi_write_chconf0(const struct spi_device *spi, u32 val)
+
+ cs->chconf0 = val;
+ mcspi_write_cs_reg(spi, OMAP2_MCSPI_CHCONF0, val);
+- mcspi_read_cs_reg(spi, OMAP2_MCSPI_CHCONF0);
+ }
+
+ static void omap2_mcspi_set_dma_req(const struct spi_device *spi,
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0011-Revert-omap_hsmmc-improve-interrupt-synchronisation.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0011-Revert-omap_hsmmc-improve-interrupt-synchronisation.patch
new file mode 100644
index 0000000000..0f39a8a7e0
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0011-Revert-omap_hsmmc-improve-interrupt-synchronisation.patch
@@ -0,0 +1,482 @@
+From b4a56c6ec6df1af55b75608ff7c7cbf91660eb91 Mon Sep 17 00:00:00 2001
+From: Steve Sakoman <steve@sakoman.com>
+Date: Fri, 19 Nov 2010 15:11:19 -0800
+Subject: [PATCH 11/31] Revert "omap_hsmmc: improve interrupt synchronisation"
+
+This reverts commit b417577d3b9bbb06a4ddc9aa955af9bd503f7242.
+
+Conflicts:
+
+ drivers/mmc/host/omap_hsmmc.c
+---
+ drivers/mmc/host/omap_hsmmc.c | 267 ++++++++++++++++++++---------------------
+ 1 files changed, 128 insertions(+), 139 deletions(-)
+
+diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
+index 259ece0..15a023b 100644
+--- a/drivers/mmc/host/omap_hsmmc.c
++++ b/drivers/mmc/host/omap_hsmmc.c
+@@ -159,10 +159,12 @@ struct omap_hsmmc_host {
+ */
+ struct regulator *vcc;
+ struct regulator *vcc_aux;
++ struct semaphore sem;
+ struct work_struct mmc_carddetect_work;
+ void __iomem *base;
+ resource_size_t mapbase;
+ spinlock_t irq_lock; /* Prevent races with irq handler */
++ unsigned long flags;
+ unsigned int id;
+ unsigned int dma_len;
+ unsigned int dma_sg_idx;
+@@ -183,7 +185,6 @@ struct omap_hsmmc_host {
+ int protect_card;
+ int reqs_blocked;
+ int use_reg;
+- int req_in_progress;
+
+ struct omap_mmc_platform_data *pdata;
+ };
+@@ -556,32 +557,6 @@ static void omap_hsmmc_stop_clock(struct omap_hsmmc_host *host)
+ dev_dbg(mmc_dev(host->mmc), "MMC Clock is not stoped\n");
+ }
+
+-static void omap_hsmmc_enable_irq(struct omap_hsmmc_host *host,
+- struct mmc_command *cmd)
+-{
+- unsigned int irq_mask;
+-
+- if (host->use_dma)
+- irq_mask = INT_EN_MASK & ~(BRR_ENABLE | BWR_ENABLE);
+- else
+- irq_mask = INT_EN_MASK;
+-
+- /* Disable timeout for erases */
+- if (cmd->opcode == MMC_ERASE)
+- irq_mask &= ~DTO_ENABLE;
+-
+- OMAP_HSMMC_WRITE(host->base, STAT, STAT_CLEAR);
+- OMAP_HSMMC_WRITE(host->base, ISE, irq_mask);
+- OMAP_HSMMC_WRITE(host->base, IE, irq_mask);
+-}
+-
+-static void omap_hsmmc_disable_irq(struct omap_hsmmc_host *host)
+-{
+- OMAP_HSMMC_WRITE(host->base, ISE, 0);
+- OMAP_HSMMC_WRITE(host->base, IE, 0);
+- OMAP_HSMMC_WRITE(host->base, STAT, STAT_CLEAR);
+-}
+-
+ #ifdef CONFIG_PM
+
+ /*
+@@ -650,7 +625,9 @@ static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host)
+ && time_before(jiffies, timeout))
+ ;
+
+- omap_hsmmc_disable_irq(host);
++ OMAP_HSMMC_WRITE(host->base, STAT, STAT_CLEAR);
++ OMAP_HSMMC_WRITE(host->base, ISE, INT_EN_MASK);
++ OMAP_HSMMC_WRITE(host->base, IE, INT_EN_MASK);
+
+ /* Do not initialize card-specific things if the power is off */
+ if (host->power_mode == MMC_POWER_OFF)
+@@ -753,8 +730,6 @@ static void send_init_stream(struct omap_hsmmc_host *host)
+ return;
+
+ disable_irq(host->irq);
+-
+- OMAP_HSMMC_WRITE(host->base, IE, INT_EN_MASK);
+ OMAP_HSMMC_WRITE(host->base, CON,
+ OMAP_HSMMC_READ(host->base, CON) | INIT_STREAM);
+ OMAP_HSMMC_WRITE(host->base, CMD, INIT_STREAM_CMD);
+@@ -820,7 +795,17 @@ omap_hsmmc_start_command(struct omap_hsmmc_host *host, struct mmc_command *cmd,
+ mmc_hostname(host->mmc), cmd->opcode, cmd->arg);
+ host->cmd = cmd;
+
+- omap_hsmmc_enable_irq(host, cmd);
++ /*
++ * Clear status bits and enable interrupts
++ */
++ OMAP_HSMMC_WRITE(host->base, STAT, STAT_CLEAR);
++ OMAP_HSMMC_WRITE(host->base, ISE, INT_EN_MASK);
++
++ if (host->use_dma)
++ OMAP_HSMMC_WRITE(host->base, IE,
++ INT_EN_MASK & ~(BRR_ENABLE | BWR_ENABLE));
++ else
++ OMAP_HSMMC_WRITE(host->base, IE, INT_EN_MASK);
+
+ host->response_busy = 0;
+ if (cmd->flags & MMC_RSP_PRESENT) {
+@@ -854,7 +839,13 @@ omap_hsmmc_start_command(struct omap_hsmmc_host *host, struct mmc_command *cmd,
+ if (host->use_dma)
+ cmdreg |= DMA_EN;
+
+- host->req_in_progress = 1;
++ /*
++ * In an interrupt context (i.e. STOP command), the spinlock is unlocked
++ * by the interrupt handler, otherwise (i.e. for a new request) it is
++ * unlocked here.
++ */
++ if (!in_interrupt())
++ spin_unlock_irqrestore(&host->irq_lock, host->flags);
+
+ OMAP_HSMMC_WRITE(host->base, ARG, cmd->arg);
+ OMAP_HSMMC_WRITE(host->base, CMD, cmdreg);
+@@ -869,23 +860,6 @@ omap_hsmmc_get_dma_dir(struct omap_hsmmc_host *host, struct mmc_data *data)
+ return DMA_FROM_DEVICE;
+ }
+
+-static void omap_hsmmc_request_done(struct omap_hsmmc_host *host, struct mmc_request *mrq)
+-{
+- int dma_ch;
+-
+- spin_lock(&host->irq_lock);
+- host->req_in_progress = 0;
+- dma_ch = host->dma_ch;
+- spin_unlock(&host->irq_lock);
+-
+- omap_hsmmc_disable_irq(host);
+- /* Do not complete the request if DMA is still in progress */
+- if (mrq->data && host->use_dma && dma_ch != -1)
+- return;
+- host->mrq = NULL;
+- mmc_request_done(host->mmc, mrq);
+-}
+-
+ /*
+ * Notify the transfer complete to MMC core
+ */
+@@ -902,19 +876,25 @@ omap_hsmmc_xfer_done(struct omap_hsmmc_host *host, struct mmc_data *data)
+ return;
+ }
+
+- omap_hsmmc_request_done(host, mrq);
++ host->mrq = NULL;
++ mmc_request_done(host->mmc, mrq);
+ return;
+ }
+
+ host->data = NULL;
+
++ if (host->use_dma && host->dma_ch != -1)
++ dma_unmap_sg(mmc_dev(host->mmc), data->sg, host->dma_len,
++ omap_hsmmc_get_dma_dir(host, data));
++
+ if (!data->error)
+ data->bytes_xfered += data->blocks * (data->blksz);
+ else
+ data->bytes_xfered = 0;
+
+ if (!data->stop) {
+- omap_hsmmc_request_done(host, data->mrq);
++ host->mrq = NULL;
++ mmc_request_done(host->mmc, data->mrq);
+ return;
+ }
+ omap_hsmmc_start_command(host, data->stop, NULL);
+@@ -940,8 +920,10 @@ omap_hsmmc_cmd_done(struct omap_hsmmc_host *host, struct mmc_command *cmd)
+ cmd->resp[0] = OMAP_HSMMC_READ(host->base, RSP10);
+ }
+ }
+- if ((host->data == NULL && !host->response_busy) || cmd->error)
+- omap_hsmmc_request_done(host, cmd->mrq);
++ if ((host->data == NULL && !host->response_busy) || cmd->error) {
++ host->mrq = NULL;
++ mmc_request_done(host->mmc, cmd->mrq);
++ }
+ }
+
+ /*
+@@ -949,19 +931,14 @@ omap_hsmmc_cmd_done(struct omap_hsmmc_host *host, struct mmc_command *cmd)
+ */
+ static void omap_hsmmc_dma_cleanup(struct omap_hsmmc_host *host, int errno)
+ {
+- int dma_ch;
+-
+ host->data->error = errno;
+
+- spin_lock(&host->irq_lock);
+- dma_ch = host->dma_ch;
+- host->dma_ch = -1;
+- spin_unlock(&host->irq_lock);
+-
+- if (host->use_dma && dma_ch != -1) {
++ if (host->use_dma && host->dma_ch != -1) {
+ dma_unmap_sg(mmc_dev(host->mmc), host->data->sg, host->dma_len,
+ omap_hsmmc_get_dma_dir(host, host->data));
+- omap_free_dma(dma_ch);
++ omap_free_dma(host->dma_ch);
++ host->dma_ch = -1;
++ up(&host->sem);
+ }
+ host->data = NULL;
+ }
+@@ -1034,21 +1011,28 @@ static inline void omap_hsmmc_reset_controller_fsm(struct omap_hsmmc_host *host,
+ __func__);
+ }
+
+-static void omap_hsmmc_do_irq(struct omap_hsmmc_host *host, int status)
++/*
++ * MMC controller IRQ handler
++ */
++static irqreturn_t omap_hsmmc_irq(int irq, void *dev_id)
+ {
++ struct omap_hsmmc_host *host = dev_id;
+ struct mmc_data *data;
+- int end_cmd = 0, end_trans = 0;
+-
+- if (!host->req_in_progress) {
+- do {
+- OMAP_HSMMC_WRITE(host->base, STAT, status);
+- /* Flush posted write */
+- status = OMAP_HSMMC_READ(host->base, STAT);
+- } while (status & INT_EN_MASK);
+- return;
++ int end_cmd = 0, end_trans = 0, status;
++
++ spin_lock(&host->irq_lock);
++
++ if (host->mrq == NULL) {
++ OMAP_HSMMC_WRITE(host->base, STAT,
++ OMAP_HSMMC_READ(host->base, STAT));
++ /* Flush posted write */
++ OMAP_HSMMC_READ(host->base, STAT);
++ spin_unlock(&host->irq_lock);
++ return IRQ_HANDLED;
+ }
+
+ data = host->data;
++ status = OMAP_HSMMC_READ(host->base, STAT);
+ dev_dbg(mmc_dev(host->mmc), "IRQ Status is %x\n", status);
+
+ if (status & ERR) {
+@@ -1101,27 +1085,15 @@ static void omap_hsmmc_do_irq(struct omap_hsmmc_host *host, int status)
+ }
+
+ OMAP_HSMMC_WRITE(host->base, STAT, status);
++ /* Flush posted write */
++ OMAP_HSMMC_READ(host->base, STAT);
+
+ if (end_cmd || ((status & CC) && host->cmd))
+ omap_hsmmc_cmd_done(host, host->cmd);
+ if ((end_trans || (status & TC)) && host->mrq)
+ omap_hsmmc_xfer_done(host, data);
+-}
+-
+-/*
+- * MMC controller IRQ handler
+- */
+-static irqreturn_t omap_hsmmc_irq(int irq, void *dev_id)
+-{
+- struct omap_hsmmc_host *host = dev_id;
+- int status;
+
+- status = OMAP_HSMMC_READ(host->base, STAT);
+- do {
+- omap_hsmmc_do_irq(host, status);
+- /* Flush posted write */
+- status = OMAP_HSMMC_READ(host->base, STAT);
+- } while (status & INT_EN_MASK);
++ spin_unlock(&host->irq_lock);
+
+ return IRQ_HANDLED;
+ }
+@@ -1316,11 +1288,9 @@ static void omap_hsmmc_config_dma_params(struct omap_hsmmc_host *host,
+ /*
+ * DMA call back function
+ */
+-static void omap_hsmmc_dma_cb(int lch, u16 ch_status, void *cb_data)
++static void omap_hsmmc_dma_cb(int lch, u16 ch_status, void *data)
+ {
+- struct omap_hsmmc_host *host = cb_data;
+- struct mmc_data *data = host->mrq->data;
+- int dma_ch, req_in_progress;
++ struct omap_hsmmc_host *host = data;
+
+ if (!(ch_status & OMAP_DMA_BLOCK_IRQ)) {
+ dev_warn(mmc_dev(host->mmc), "unexpected dma status %x\n",
+@@ -1328,38 +1298,24 @@ static void omap_hsmmc_dma_cb(int lch, u16 ch_status, void *cb_data)
+ return;
+ }
+
+- spin_lock(&host->irq_lock);
+- if (host->dma_ch < 0) {
+- spin_unlock(&host->irq_lock);
++ if (host->dma_ch < 0)
+ return;
+- }
+
+ host->dma_sg_idx++;
+ if (host->dma_sg_idx < host->dma_len) {
+ /* Fire up the next transfer. */
+- omap_hsmmc_config_dma_params(host, data,
+- data->sg + host->dma_sg_idx);
+- spin_unlock(&host->irq_lock);
++ omap_hsmmc_config_dma_params(host, host->data,
++ host->data->sg + host->dma_sg_idx);
+ return;
+ }
+
+- dma_unmap_sg(mmc_dev(host->mmc), data->sg, host->dma_len,
+- omap_hsmmc_get_dma_dir(host, data));
+-
+- req_in_progress = host->req_in_progress;
+- dma_ch = host->dma_ch;
++ omap_free_dma(host->dma_ch);
+ host->dma_ch = -1;
+- spin_unlock(&host->irq_lock);
+-
+- omap_free_dma(dma_ch);
+-
+- /* If DMA has finished after TC, complete the request */
+- if (!req_in_progress) {
+- struct mmc_request *mrq = host->mrq;
+-
+- host->mrq = NULL;
+- mmc_request_done(host->mmc, mrq);
+- }
++ /*
++ * DMA Callback: run in interrupt context.
++ * mutex_unlock will throw a kernel warning if used.
++ */
++ up(&host->sem);
+ }
+
+ /*
+@@ -1368,7 +1324,7 @@ static void omap_hsmmc_dma_cb(int lch, u16 ch_status, void *cb_data)
+ static int omap_hsmmc_start_dma_transfer(struct omap_hsmmc_host *host,
+ struct mmc_request *req)
+ {
+- int dma_ch = 0, ret = 0, i;
++ int dma_ch = 0, ret = 0, err = 1, i;
+ struct mmc_data *data = req->data;
+
+ /* Sanity check: all the SG entries must be aligned by block size. */
+@@ -1385,7 +1341,23 @@ static int omap_hsmmc_start_dma_transfer(struct omap_hsmmc_host *host,
+ */
+ return -EINVAL;
+
+- BUG_ON(host->dma_ch != -1);
++ /*
++ * If for some reason the DMA transfer is still active,
++ * we wait for timeout period and free the dma
++ */
++ if (host->dma_ch != -1) {
++ set_current_state(TASK_UNINTERRUPTIBLE);
++ schedule_timeout(100);
++ if (down_trylock(&host->sem)) {
++ omap_free_dma(host->dma_ch);
++ host->dma_ch = -1;
++ up(&host->sem);
++ return err;
++ }
++ } else {
++ if (down_trylock(&host->sem))
++ return err;
++ }
+
+ ret = omap_request_dma(omap_hsmmc_get_dma_sync_dev(host, data),
+ "MMC/SD", omap_hsmmc_dma_cb, host, &dma_ch);
+@@ -1485,27 +1457,37 @@ static void omap_hsmmc_request(struct mmc_host *mmc, struct mmc_request *req)
+ struct omap_hsmmc_host *host = mmc_priv(mmc);
+ int err;
+
+- BUG_ON(host->req_in_progress);
+- BUG_ON(host->dma_ch != -1);
+- if (host->protect_card) {
+- if (host->reqs_blocked < 3) {
+- /*
+- * Ensure the controller is left in a consistent
+- * state by resetting the command and data state
+- * machines.
+- */
+- omap_hsmmc_reset_controller_fsm(host, SRD);
+- omap_hsmmc_reset_controller_fsm(host, SRC);
+- host->reqs_blocked += 1;
+- }
+- req->cmd->error = -EBADF;
+- if (req->data)
+- req->data->error = -EBADF;
+- req->cmd->retries = 0;
+- mmc_request_done(mmc, req);
+- return;
+- } else if (host->reqs_blocked)
+- host->reqs_blocked = 0;
++ /*
++ * Prevent races with the interrupt handler because of unexpected
++ * interrupts, but not if we are already in interrupt context i.e.
++ * retries.
++ */
++ if (!in_interrupt()) {
++ spin_lock_irqsave(&host->irq_lock, host->flags);
++ /*
++ * Protect the card from I/O if there is a possibility
++ * it can be removed.
++ */
++ if (host->protect_card) {
++ if (host->reqs_blocked < 3) {
++ /*
++ * Ensure the controller is left in a consistent
++ * state by resetting the command and data state
++ * machines.
++ */
++ omap_hsmmc_reset_controller_fsm(host, SRD);
++ omap_hsmmc_reset_controller_fsm(host, SRC);
++ host->reqs_blocked += 1;
++ }
++ req->cmd->error = -EBADF;
++ if (req->data)
++ req->data->error = -EBADF;
++ spin_unlock_irqrestore(&host->irq_lock, host->flags);
++ mmc_request_done(mmc, req);
++ return;
++ } else if (host->reqs_blocked)
++ host->reqs_blocked = 0;
++ }
+ WARN_ON(host->mrq != NULL);
+ host->mrq = req;
+ err = omap_hsmmc_prepare_data(host, req);
+@@ -1514,6 +1496,8 @@ static void omap_hsmmc_request(struct mmc_host *mmc, struct mmc_request *req)
+ if (req->data)
+ req->data->error = err;
+ host->mrq = NULL;
++ if (!in_interrupt())
++ spin_unlock_irqrestore(&host->irq_lock, host->flags);
+ mmc_request_done(mmc, req);
+ return;
+ }
+@@ -2093,6 +2077,7 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
+ mmc->f_min = 400000;
+ mmc->f_max = 52000000;
+
++ sema_init(&host->sem, 1);
+ spin_lock_init(&host->irq_lock);
+
+ host->iclk = clk_get(&pdev->dev, "ick");
+@@ -2235,7 +2220,8 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
+ pdata->resume = omap_hsmmc_resume_cdirq;
+ }
+
+- omap_hsmmc_disable_irq(host);
++ OMAP_HSMMC_WRITE(host->base, ISE, INT_EN_MASK);
++ OMAP_HSMMC_WRITE(host->base, IE, INT_EN_MASK);
+
+ mmc_host_lazy_disable(host->mmc);
+
+@@ -2356,7 +2342,10 @@ static int omap_hsmmc_suspend(struct device *dev)
+ ret = mmc_suspend_host(host->mmc);
+ mmc_host_enable(host->mmc);
+ if (ret == 0) {
+- omap_hsmmc_disable_irq(host);
++ OMAP_HSMMC_WRITE(host->base, ISE, 0);
++ OMAP_HSMMC_WRITE(host->base, IE, 0);
++
++
+ OMAP_HSMMC_WRITE(host->base, HCTL,
+ OMAP_HSMMC_READ(host->base, HCTL) & ~SDBP);
+ mmc_host_disable(host->mmc);
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0012-Don-t-turn-SDIO-cards-off-to-save-power.-Doing-so-wi.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0012-Don-t-turn-SDIO-cards-off-to-save-power.-Doing-so-wi.patch
new file mode 100644
index 0000000000..4c06145525
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0012-Don-t-turn-SDIO-cards-off-to-save-power.-Doing-so-wi.patch
@@ -0,0 +1,51 @@
+From 796b0fc090132a5ea3849bd3177cb88c64ad2160 Mon Sep 17 00:00:00 2001
+From: David Vrabel <david.vrabel@csr.com>
+Date: Fri, 2 Apr 2010 08:41:47 -0700
+Subject: [PATCH 12/31] Don't turn SDIO cards off to save power. Doing so will lose all internal state in the card.
+
+Signed-off-by: David Vrabel <david.vrabel@csr.com>
+---
+ drivers/mmc/host/omap_hsmmc.c | 12 ++++++++----
+ 1 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
+index 15a023b..83f93ab 100644
+--- a/drivers/mmc/host/omap_hsmmc.c
++++ b/drivers/mmc/host/omap_hsmmc.c
+@@ -29,6 +29,7 @@
+ #include <linux/mmc/host.h>
+ #include <linux/mmc/core.h>
+ #include <linux/mmc/mmc.h>
++#include <linux/mmc/card.h>
+ #include <linux/io.h>
+ #include <linux/semaphore.h>
+ #include <linux/gpio.h>
+@@ -1760,8 +1761,12 @@ static int omap_hsmmc_sleep_to_off(struct omap_hsmmc_host *host)
+ mmc_slot(host).card_detect ||
+ (mmc_slot(host).get_cover_state &&
+ mmc_slot(host).get_cover_state(host->dev, host->slot_id)))) {
+- mmc_release_host(host->mmc);
+- return 0;
++ goto out;
++ }
++
++ /* Don't turn SDIO cards off. */
++ if (host->mmc->card && mmc_card_sdio(host->mmc->card)) {
++ goto out;
+ }
+
+ mmc_slot(host).set_power(host->dev, host->slot_id, 0, 0);
+@@ -1772,9 +1777,8 @@ static int omap_hsmmc_sleep_to_off(struct omap_hsmmc_host *host)
+ host->dpm_state == CARDSLEEP ? "CARDSLEEP" : "REGSLEEP");
+
+ host->dpm_state = OFF;
+-
++out:
+ mmc_release_host(host->mmc);
+-
+ return 0;
+ }
+
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0013-Enable-the-use-of-SDIO-card-interrupts.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0013-Enable-the-use-of-SDIO-card-interrupts.patch
new file mode 100644
index 0000000000..29f5e17227
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0013-Enable-the-use-of-SDIO-card-interrupts.patch
@@ -0,0 +1,288 @@
+From 9231d1d9fac779c95809dedf95fde64738b4186f Mon Sep 17 00:00:00 2001
+From: David Vrabel <david.vrabel@csr.com>
+Date: Fri, 2 Apr 2010 08:42:22 -0700
+Subject: [PATCH 13/31] Enable the use of SDIO card interrupts.
+
+FCLK must be enabled while SDIO interrupts are enabled or the MMC
+module won't wake-up (even though ENAWAKEUP in SYSCONFIG and IWE in
+HTCL have been set). Enabling the MMC module to wake-up would require
+configuring the MMC module (and the mmci_dat[1] GPIO when the CORE
+power domain is OFF) as wake-up sources in the PRCM.
+
+The writes to STAT and ISE when starting a command are unnecessary and
+have been removed.
+
+Signed-off-by: David Vrabel <david.vrabel@csr.com>
+---
+ drivers/mmc/host/omap_hsmmc.c | 118 +++++++++++++++++++++++++++++------------
+ 1 files changed, 83 insertions(+), 35 deletions(-)
+
+diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
+index 83f93ab..d57686c 100644
+--- a/drivers/mmc/host/omap_hsmmc.c
++++ b/drivers/mmc/host/omap_hsmmc.c
+@@ -67,6 +67,7 @@
+ #define SDVS_MASK 0x00000E00
+ #define SDVSCLR 0xFFFFF1FF
+ #define SDVSDET 0x00000400
++#define ENAWAKEUP (1 << 2)
+ #define AUTOIDLE 0x1
+ #define SDBP (1 << 8)
+ #define DTO 0xe
+@@ -77,10 +78,13 @@
+ #define CLKD_SHIFT 6
+ #define DTO_MASK 0x000F0000
+ #define DTO_SHIFT 16
++#define CIRQ_ENABLE (1 << 8)
+ #define INT_EN_MASK 0x307F0033
+ #define BWR_ENABLE (1 << 4)
+ #define BRR_ENABLE (1 << 5)
+ #define DTO_ENABLE (1 << 20)
++#define CTPL (1 << 11)
++#define CLKEXTFREE (1 << 16)
+ #define INIT_STREAM (1 << 1)
+ #define DP_SELECT (1 << 21)
+ #define DDIR (1 << 4)
+@@ -88,10 +92,12 @@
+ #define MSBS (1 << 5)
+ #define BCE (1 << 1)
+ #define FOUR_BIT (1 << 1)
++#define IWE (1 << 24)
+ #define DW8 (1 << 5)
+ #define CC 0x1
+ #define TC 0x02
+ #define OD 0x1
++#define CIRQ (1 << 8)
+ #define ERR (1 << 15)
+ #define CMD_TIMEOUT (1 << 16)
+ #define DATA_TIMEOUT (1 << 20)
+@@ -186,6 +192,7 @@ struct omap_hsmmc_host {
+ int protect_card;
+ int reqs_blocked;
+ int use_reg;
++ int sdio_int;
+
+ struct omap_mmc_platform_data *pdata;
+ };
+@@ -598,7 +605,7 @@ static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host)
+ ;
+
+ OMAP_HSMMC_WRITE(host->base, SYSCONFIG,
+- OMAP_HSMMC_READ(host->base, SYSCONFIG) | AUTOIDLE);
++ OMAP_HSMMC_READ(host->base, SYSCONFIG) | AUTOIDLE | ENAWAKEUP);
+
+ if (host->id == OMAP_MMC1_DEVID) {
+ if (host->power_mode != MMC_POWER_OFF &&
+@@ -613,7 +620,7 @@ static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host)
+ }
+
+ OMAP_HSMMC_WRITE(host->base, HCTL,
+- OMAP_HSMMC_READ(host->base, HCTL) | hctl);
++ OMAP_HSMMC_READ(host->base, HCTL) | hctl | IWE);
+
+ OMAP_HSMMC_WRITE(host->base, CAPA,
+ OMAP_HSMMC_READ(host->base, CAPA) | capa);
+@@ -627,7 +634,7 @@ static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host)
+ ;
+
+ OMAP_HSMMC_WRITE(host->base, STAT, STAT_CLEAR);
+- OMAP_HSMMC_WRITE(host->base, ISE, INT_EN_MASK);
++ OMAP_HSMMC_WRITE(host->base, ISE, INT_EN_MASK | CIRQ);
+ OMAP_HSMMC_WRITE(host->base, IE, INT_EN_MASK);
+
+ /* Do not initialize card-specific things if the power is off */
+@@ -791,22 +798,19 @@ omap_hsmmc_start_command(struct omap_hsmmc_host *host, struct mmc_command *cmd,
+ struct mmc_data *data)
+ {
+ int cmdreg = 0, resptype = 0, cmdtype = 0;
++ int int_en_mask = INT_EN_MASK;
+
+ dev_dbg(mmc_dev(host->mmc), "%s: CMD%d, argument 0x%08x\n",
+ mmc_hostname(host->mmc), cmd->opcode, cmd->arg);
+ host->cmd = cmd;
+
+- /*
+- * Clear status bits and enable interrupts
+- */
+- OMAP_HSMMC_WRITE(host->base, STAT, STAT_CLEAR);
+- OMAP_HSMMC_WRITE(host->base, ISE, INT_EN_MASK);
+-
+ if (host->use_dma)
+- OMAP_HSMMC_WRITE(host->base, IE,
+- INT_EN_MASK & ~(BRR_ENABLE | BWR_ENABLE));
+- else
+- OMAP_HSMMC_WRITE(host->base, IE, INT_EN_MASK);
++ int_en_mask &= ~(BRR_ENABLE | BWR_ENABLE);
++
++ if (host->sdio_int)
++ int_en_mask |= CIRQ;
++
++ OMAP_HSMMC_WRITE(host->base, IE, int_en_mask);
+
+ host->response_busy = 0;
+ if (cmd->flags & MMC_RSP_PRESENT) {
+@@ -1019,23 +1023,26 @@ static irqreturn_t omap_hsmmc_irq(int irq, void *dev_id)
+ {
+ struct omap_hsmmc_host *host = dev_id;
+ struct mmc_data *data;
+- int end_cmd = 0, end_trans = 0, status;
++ u32 status;
++ int end_cmd = 0, end_trans = 0;
++ bool card_irq = false;
+
+ spin_lock(&host->irq_lock);
+
+- if (host->mrq == NULL) {
+- OMAP_HSMMC_WRITE(host->base, STAT,
+- OMAP_HSMMC_READ(host->base, STAT));
+- /* Flush posted write */
+- OMAP_HSMMC_READ(host->base, STAT);
+- spin_unlock(&host->irq_lock);
+- return IRQ_HANDLED;
+- }
+-
+- data = host->data;
+ status = OMAP_HSMMC_READ(host->base, STAT);
++ OMAP_HSMMC_WRITE(host->base, STAT, status);
++ OMAP_HSMMC_READ(host->base, STAT); /* Flush posted write. */
++
+ dev_dbg(mmc_dev(host->mmc), "IRQ Status is %x\n", status);
+
++ if (status & CIRQ)
++ card_irq = true;
++
++ if (host->mrq == NULL)
++ goto out;
++
++ data = host->data;
++
+ if (status & ERR) {
+ #ifdef CONFIG_MMC_DEBUG
+ omap_hsmmc_report_irq(host, status);
+@@ -1085,17 +1092,16 @@ static irqreturn_t omap_hsmmc_irq(int irq, void *dev_id)
+ }
+ }
+
+- OMAP_HSMMC_WRITE(host->base, STAT, status);
+- /* Flush posted write */
+- OMAP_HSMMC_READ(host->base, STAT);
+-
+ if (end_cmd || ((status & CC) && host->cmd))
+ omap_hsmmc_cmd_done(host, host->cmd);
+ if ((end_trans || (status & TC)) && host->mrq)
+ omap_hsmmc_xfer_done(host, data);
+-
++out:
+ spin_unlock(&host->irq_lock);
+
++ if (card_irq)
++ mmc_signal_sdio_irq(host->mmc);
++
+ return IRQ_HANDLED;
+ }
+
+@@ -1643,6 +1649,47 @@ static void omap_hsmmc_init_card(struct mmc_host *mmc, struct mmc_card *card)
+ mmc_slot(host).init_card(card);
+ }
+
++static void omap_hsmmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
++{
++ struct omap_hsmmc_host *host = mmc_priv(mmc);
++ u32 ie, con;
++ unsigned long flags;
++
++ spin_lock_irqsave(&host->irq_lock, flags);
++
++ /*
++ * When interrupts are enabled, CTPL must be set to enable
++ * DAT1 input buffer (or the card interrupt is always
++ * asserted) and FCLK must be enabled as wake-up does not
++ * work. Take care to disable FCLK after all the register
++ * accesses as they might not complete if FCLK is off.
++ *
++ * FIXME: if the MMC module (and the mmci_dat[1] GPIO when the
++ * CORE power domain is OFF) are configured as a wake-up
++ * sources in the PRCM, then FCLK could be switched off. This
++ * might add too much latency.
++ */
++ con = OMAP_HSMMC_READ(host->base, CON);
++ ie = OMAP_HSMMC_READ(host->base, IE);
++ if (enable) {
++ clk_enable(host->fclk);
++ ie |= CIRQ_ENABLE;
++ con |= CTPL | CLKEXTFREE;
++ host->sdio_int = 1;
++ } else {
++ ie &= ~CIRQ_ENABLE;
++ con &= ~(CTPL | CLKEXTFREE);
++ host->sdio_int = 0;
++ }
++ OMAP_HSMMC_WRITE(host->base, CON, con);
++ OMAP_HSMMC_WRITE(host->base, IE, ie);
++ OMAP_HSMMC_READ(host->base, IE); /* flush posted write */
++ if (!enable)
++ clk_disable(host->fclk);
++
++ spin_unlock_irqrestore(&host->irq_lock, flags);
++}
++
+ static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host)
+ {
+ u32 hctl, capa, value;
+@@ -1657,14 +1704,14 @@ static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host)
+ }
+
+ value = OMAP_HSMMC_READ(host->base, HCTL) & ~SDVS_MASK;
+- OMAP_HSMMC_WRITE(host->base, HCTL, value | hctl);
++ OMAP_HSMMC_WRITE(host->base, HCTL, value | hctl | IWE);
+
+ value = OMAP_HSMMC_READ(host->base, CAPA);
+ OMAP_HSMMC_WRITE(host->base, CAPA, value | capa);
+
+ /* Set the controller to AUTO IDLE mode */
+ value = OMAP_HSMMC_READ(host->base, SYSCONFIG);
+- OMAP_HSMMC_WRITE(host->base, SYSCONFIG, value | AUTOIDLE);
++ OMAP_HSMMC_WRITE(host->base, SYSCONFIG, value | AUTOIDLE | ENAWAKEUP);
+
+ /* Set SD bus power bit */
+ set_sd_bus_power(host);
+@@ -1918,7 +1965,7 @@ static const struct mmc_host_ops omap_hsmmc_ops = {
+ .get_cd = omap_hsmmc_get_cd,
+ .get_ro = omap_hsmmc_get_ro,
+ .init_card = omap_hsmmc_init_card,
+- /* NYET -- enable_sdio_irq */
++ .enable_sdio_irq = omap_hsmmc_enable_sdio_irq,
+ };
+
+ static const struct mmc_host_ops omap_hsmmc_ps_ops = {
+@@ -1929,7 +1976,7 @@ static const struct mmc_host_ops omap_hsmmc_ps_ops = {
+ .get_cd = omap_hsmmc_get_cd,
+ .get_ro = omap_hsmmc_get_ro,
+ .init_card = omap_hsmmc_init_card,
+- /* NYET -- enable_sdio_irq */
++ .enable_sdio_irq = omap_hsmmc_enable_sdio_irq,
+ };
+
+ #ifdef CONFIG_DEBUG_FS
+@@ -2145,7 +2192,8 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
+ mmc->max_seg_size = mmc->max_req_size;
+
+ mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
+- MMC_CAP_WAIT_WHILE_BUSY | MMC_CAP_ERASE;
++ MMC_CAP_WAIT_WHILE_BUSY | MMC_CAP_ERASE |
++ MMC_CAP_SDIO_IRQ;
+
+ mmc->caps |= mmc_slot(host).caps;
+ if (mmc->caps & MMC_CAP_8_BIT_DATA)
+@@ -2224,7 +2272,7 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
+ pdata->resume = omap_hsmmc_resume_cdirq;
+ }
+
+- OMAP_HSMMC_WRITE(host->base, ISE, INT_EN_MASK);
++ OMAP_HSMMC_WRITE(host->base, ISE, INT_EN_MASK | CIRQ);
+ OMAP_HSMMC_WRITE(host->base, IE, INT_EN_MASK);
+
+ mmc_host_lazy_disable(host->mmc);
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0014-soc-codecs-Enable-audio-capture-by-default-for-twl40.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0014-soc-codecs-Enable-audio-capture-by-default-for-twl40.patch
new file mode 100644
index 0000000000..962e664b80
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0014-soc-codecs-Enable-audio-capture-by-default-for-twl40.patch
@@ -0,0 +1,27 @@
+From e94f62ff96d19547c5a0d9e99691f19fe91c451a Mon Sep 17 00:00:00 2001
+From: Steve Sakoman <steve@sakoman.com>
+Date: Thu, 17 Dec 2009 12:45:20 -0800
+Subject: [PATCH 14/31] soc: codecs: Enable audio capture by default for twl4030
+
+---
+ sound/soc/codecs/twl4030.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
+index 575238d..bd51f72 100644
+--- a/sound/soc/codecs/twl4030.c
++++ b/sound/soc/codecs/twl4030.c
+@@ -56,8 +56,8 @@ static const u8 twl4030_reg[TWL4030_CACHEREGNUM] = {
+ 0x00, /* REG_OPTION (0x2) */
+ 0x00, /* REG_UNKNOWN (0x3) */
+ 0x00, /* REG_MICBIAS_CTL (0x4) */
+- 0x00, /* REG_ANAMICL (0x5) */
+- 0x00, /* REG_ANAMICR (0x6) */
++ 0x34, /* REG_ANAMICL (0x5) */
++ 0x14, /* REG_ANAMICR (0x6) */
+ 0x00, /* REG_AVADC_CTL (0x7) */
+ 0x00, /* REG_ADCMICSEL (0x8) */
+ 0x00, /* REG_DIGMIXING (0x9) */
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0015-soc-codecs-twl4030-Turn-on-mic-bias-by-default.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0015-soc-codecs-twl4030-Turn-on-mic-bias-by-default.patch
new file mode 100644
index 0000000000..60bf6e2efa
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0015-soc-codecs-twl4030-Turn-on-mic-bias-by-default.patch
@@ -0,0 +1,25 @@
+From fadce249fe7562795ce9f8fc92f8aa7a586725dc Mon Sep 17 00:00:00 2001
+From: Steve Sakoman <steve@sakoman.com>
+Date: Wed, 29 Dec 2010 11:39:16 -0800
+Subject: [PATCH 15/31] soc: codecs: twl4030: Turn on mic bias by default
+
+---
+ sound/soc/codecs/twl4030.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
+index bd51f72..8949773 100644
+--- a/sound/soc/codecs/twl4030.c
++++ b/sound/soc/codecs/twl4030.c
+@@ -55,7 +55,7 @@ static const u8 twl4030_reg[TWL4030_CACHEREGNUM] = {
+ 0x00, /* REG_CODEC_MODE (0x1) */
+ 0x00, /* REG_OPTION (0x2) */
+ 0x00, /* REG_UNKNOWN (0x3) */
+- 0x00, /* REG_MICBIAS_CTL (0x4) */
++ 0x03, /* REG_MICBIAS_CTL (0x4) */
+ 0x34, /* REG_ANAMICL (0x5) */
+ 0x14, /* REG_ANAMICR (0x6) */
+ 0x00, /* REG_AVADC_CTL (0x7) */
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0016-RTC-add-support-for-backup-battery-recharge.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0016-RTC-add-support-for-backup-battery-recharge.patch
new file mode 100644
index 0000000000..23447476d2
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0016-RTC-add-support-for-backup-battery-recharge.patch
@@ -0,0 +1,55 @@
+From a49740bb7066dbbf1b7f6bda73cdc45169202ebf Mon Sep 17 00:00:00 2001
+From: Steve Sakoman <steve@sakoman.com>
+Date: Thu, 4 Feb 2010 12:26:22 -0800
+Subject: [PATCH 16/31] RTC: add support for backup battery recharge
+
+---
+ drivers/rtc/rtc-twl.c | 25 +++++++++++++++++++++++++
+ 1 files changed, 25 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c
+index f9a2799..713b8ea 100644
+--- a/drivers/rtc/rtc-twl.c
++++ b/drivers/rtc/rtc-twl.c
+@@ -30,6 +30,23 @@
+
+ #include <linux/i2c/twl.h>
+
++/*
++ * PM_RECEIVER block register offsets (use TWL4030_MODULE_PM_RECEIVER)
++ */
++#define REG_BB_CFG 0x12
++
++/* PM_RECEIVER BB_CFG bitfields */
++#define BIT_PM_RECEIVER_BB_CFG_BBCHEN 0x10
++#define BIT_PM_RECEIVER_BB_CFG_BBSEL 0x0C
++#define BIT_PM_RECEIVER_BB_CFG_BBSEL_2V5 0x00
++#define BIT_PM_RECEIVER_BB_CFG_BBSEL_3V0 0x04
++#define BIT_PM_RECEIVER_BB_CFG_BBSEL_3V1 0x08
++#define BIT_PM_RECEIVER_BB_CFG_BBSEL_3v2 0x0c
++#define BIT_PM_RECEIVER_BB_CFG_BBISEL 0x03
++#define BIT_PM_RECEIVER_BB_CFG_BBISEL_25UA 0x00
++#define BIT_PM_RECEIVER_BB_CFG_BBISEL_150UA 0x01
++#define BIT_PM_RECEIVER_BB_CFG_BBISEL_500UA 0x02
++#define BIT_PM_RECEIVER_BB_CFG_BBISEL_1MA 0x03
+
+ /*
+ * RTC block register offsets (use TWL_MODULE_RTC)
+@@ -495,6 +512,14 @@ static int __devinit twl_rtc_probe(struct platform_device *pdev)
+ if (ret < 0)
+ goto out2;
+
++ /* enable backup battery charging */
++ /* use a conservative 25uA @ 3.1V */
++ ret = twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
++ BIT_PM_RECEIVER_BB_CFG_BBCHEN |
++ BIT_PM_RECEIVER_BB_CFG_BBSEL_3V1 |
++ BIT_PM_RECEIVER_BB_CFG_BBISEL_25UA,
++ REG_BB_CFG);
++
+ return ret;
+
+ out2:
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0017-ARM-OMAP2-mmc-twl4030-move-clock-input-selection-pri.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0017-ARM-OMAP2-mmc-twl4030-move-clock-input-selection-pri.patch
new file mode 100644
index 0000000000..a95b313259
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0017-ARM-OMAP2-mmc-twl4030-move-clock-input-selection-pri.patch
@@ -0,0 +1,39 @@
+From e4e17b2fa3aa84e14303d2270a49f1ac9bf25b5c Mon Sep 17 00:00:00 2001
+From: Steve Sakoman <steve@sakoman.com>
+Date: Sun, 24 Jan 2010 09:33:56 -0800
+Subject: [PATCH 17/31] ARM: OMAP2: mmc-twl4030: move clock input selection prior to vcc test
+
+otherwise it is not executed on systems that use non-twl regulators
+---
+ arch/arm/mach-omap2/hsmmc.c | 14 ++++++--------
+ 1 files changed, 6 insertions(+), 8 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c
+index b2f30be..84d5ef6 100644
+--- a/arch/arm/mach-omap2/hsmmc.c
++++ b/arch/arm/mach-omap2/hsmmc.c
+@@ -185,15 +185,13 @@ static void hsmmc23_before_set_reg(struct device *dev, int slot,
+ if (mmc->slots[0].remux)
+ mmc->slots[0].remux(dev, slot, power_on);
+
+- if (power_on) {
+- /* Only MMC2 supports a CLKIN */
+- if (mmc->slots[0].internal_clock) {
+- u32 reg;
++ /* Only MMC2 supports a CLKIN */
++ if (mmc->slots[0].internal_clock) {
++ u32 reg;
+
+- reg = omap_ctrl_readl(control_devconf1_offset);
+- reg |= OMAP2_MMCSDIO2ADPCLKISEL;
+- omap_ctrl_writel(reg, control_devconf1_offset);
+- }
++ reg = omap_ctrl_readl(control_devconf1_offset);
++ reg |= OMAP2_MMCSDIO2ADPCLKISEL;
++ omap_ctrl_writel(reg, control_devconf1_offset);
+ }
+ }
+
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0018-Add-power-off-support-for-the-TWL4030-companion.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0018-Add-power-off-support-for-the-TWL4030-companion.patch
new file mode 100644
index 0000000000..0083bde1f2
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0018-Add-power-off-support-for-the-TWL4030-companion.patch
@@ -0,0 +1,103 @@
+From 80c2126f5bf63ea2d033310e030cac5229865a9a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bernhard=20W=C3=B6rndl-Aichriedler?= <bwa@xdevelop.at>
+Date: Sat, 15 May 2010 16:34:05 +0200
+Subject: [PATCH 18/31] Add power-off support for the TWL4030 companion
+
+This patch adds support for the power-off on shutdown feature of the TWL4030
+---
+ drivers/mfd/Kconfig | 6 ++++++
+ drivers/mfd/twl-core.c | 40 ++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 46 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
+index 3ed3ff0..fe2370a 100644
+--- a/drivers/mfd/Kconfig
++++ b/drivers/mfd/Kconfig
+@@ -210,6 +210,12 @@ config TWL4030_CODEC
+ select MFD_CORE
+ default n
+
++config TWL4030_POWEROFF
++ bool "TWL4030 Allow power-off on shutdown"
++ depends on TWL4030_CORE
++ help
++ Enables the CPU to power-off the system on shutdown
++
+ config TWL6030_PWM
+ tristate "TWL6030 PWM (Pulse Width Modulator) Support"
+ depends on TWL4030_CORE
+diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
+index 960b5be..8804550 100644
+--- a/drivers/mfd/twl-core.c
++++ b/drivers/mfd/twl-core.c
+@@ -122,6 +122,12 @@
+ #define twl_has_bci() false
+ #endif
+
++#if defined (CONFIG_TWL4030_POWEROFF)
++#define twl_has_poweroff() true
++#else
++#define twl_has_poweroff() false
++#endif
++
+ /* Triton Core internal information (BEGIN) */
+
+ /* Last - for index max*/
+@@ -224,6 +230,10 @@
+ #define TWL5031 BIT(2) /* twl5031 has different registers */
+ #define TWL6030_CLASS BIT(3) /* TWL6030 class */
+
++/* for pm_power_off */
++#define PWR_P1_SW_EVENTS 0x10
++#define PWR_DEVOFF (1 << 0)
++
+ /*----------------------------------------------------------------------*/
+
+ /* is driver active, bound to a chip? */
+@@ -1006,6 +1016,30 @@ static int twl_remove(struct i2c_client *client)
+ return 0;
+ }
+
++static void twl_poweroff(void)
++{
++ int err;
++ u8 val;
++
++ err = twl_i2c_read_u8(TWL4030_MODULE_PM_MASTER, &val,
++ PWR_P1_SW_EVENTS);
++ if (err) {
++ pr_err("%s: i2c error %d while reading TWL4030"
++ "PM_MASTER P1_SW_EVENTS\n",
++ DRIVER_NAME, err);
++ return;
++ }
++
++ val |= PWR_DEVOFF;
++
++ err = twl_i2c_write_u8(TWL4030_MODULE_PM_MASTER, val,
++ PWR_P1_SW_EVENTS);
++ if (err)
++ pr_err("%s: i2c error %d while writing TWL4030"
++ "PM_MASTER P1_SW_EVENTS\n",
++ DRIVER_NAME, err);
++}
++
+ /* NOTE: this driver only handles a single twl4030/tps659x0 chip */
+ static int __devinit
+ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
+@@ -1093,6 +1127,12 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
+ twl_i2c_write_u8(TWL4030_MODULE_INTBR, temp, REG_GPPUPDCTR1);
+ }
+
++ if(twl_has_poweroff())
++ {
++ /* initialize pm_power_off routine */
++ pm_power_off = twl_poweroff;
++ }
++
+ status = add_children(pdata, id->driver_data);
+ fail:
+ if (status < 0)
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0019-ARM-OMAP-Add-twl4030-madc-support-to-Overo.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0019-ARM-OMAP-Add-twl4030-madc-support-to-Overo.patch
new file mode 100644
index 0000000000..6643475947
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0019-ARM-OMAP-Add-twl4030-madc-support-to-Overo.patch
@@ -0,0 +1,33 @@
+From d4f736154c4a873a12408d0d094e2152a4c4dc96 Mon Sep 17 00:00:00 2001
+From: Steve Sakoman <steve@sakoman.com>
+Date: Thu, 17 Dec 2009 14:27:15 -0800
+Subject: [PATCH 19/31] ARM: OMAP: Add twl4030 madc support to Overo
+
+Signed-off-by: Steve Sakoman <steve@sakoman.com>
+---
+ arch/arm/mach-omap2/board-overo.c | 5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
+index 59ca333..86f76e9 100644
+--- a/arch/arm/mach-omap2/board-overo.c
++++ b/arch/arm/mach-omap2/board-overo.c
+@@ -637,10 +637,15 @@ static struct twl4030_codec_data overo_codec_data = {
+ .audio = &overo_audio_data,
+ };
+
++static struct twl4030_madc_platform_data overo_madc_data = {
++ .irq_line = 1,
++};
++
+ static struct twl4030_platform_data overo_twldata = {
+ .irq_base = TWL4030_IRQ_BASE,
+ .irq_end = TWL4030_IRQ_END,
+ .gpio = &overo_gpio_data,
++ .madc = &overo_madc_data,
+ .usb = &overo_usb_data,
+ .codec = &overo_codec_data,
+ .vmmc1 = &overo_vmmc1,
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0020-Enabling-Hwmon-driver-for-twl4030-madc.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0020-Enabling-Hwmon-driver-for-twl4030-madc.patch
new file mode 100644
index 0000000000..7532150366
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0020-Enabling-Hwmon-driver-for-twl4030-madc.patch
@@ -0,0 +1,46 @@
+From 4f5e04f8fcc6e6835aad7dde949c1cb82b5eaa45 Mon Sep 17 00:00:00 2001
+From: Keerthy <j-keerthy@ti.com>
+Date: Wed, 4 May 2011 01:14:50 +0530
+Subject: [PATCH 20/31] Enabling Hwmon driver for twl4030-madc
+
+Signed-off-by: Keerthy <j-keerthy@ti.com>
+---
+ drivers/mfd/twl-core.c | 15 +++++++++++++++
+ 1 files changed, 15 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
+index 8804550..d9435e4 100644
+--- a/drivers/mfd/twl-core.c
++++ b/drivers/mfd/twl-core.c
+@@ -83,6 +83,13 @@
+ #define twl_has_madc() false
+ #endif
+
++#if defined(CONFIG_SENSORS_TWL4030_MADC) ||\
++ defined(CONFIG_SENSORS_TWL4030_MADC_MODULE)
++#define twl_has_madc_hwmon() true
++#else
++#define twl_has_madc_hwmon() false
++#endif
++
+ #ifdef CONFIG_TWL4030_POWER
+ #define twl_has_power() true
+ #else
+@@ -619,6 +626,14 @@ add_children(struct twl4030_platform_data *pdata, unsigned long features)
+ return PTR_ERR(child);
+ }
+
++if (twl_has_madc_hwmon()) {
++ child = add_child(2, "twl4030_madc_hwmon",
++ NULL, 0,
++ true, pdata->irq_base + MADC_INTR_OFFSET, 0);
++ if (IS_ERR(child))
++ return PTR_ERR(child);
++ }
++
+ if (twl_has_rtc()) {
+ /*
+ * REVISIT platform_data here currently might expose the
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0021-mfd-twl-core-enable-madc-clock.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0021-mfd-twl-core-enable-madc-clock.patch
new file mode 100644
index 0000000000..65c2630802
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0021-mfd-twl-core-enable-madc-clock.patch
@@ -0,0 +1,54 @@
+From faa15ccdcc5690ba83d4d09049222df35f40719d Mon Sep 17 00:00:00 2001
+From: Steve Sakoman <steve@sakoman.com>
+Date: Sat, 23 Jan 2010 06:26:54 -0800
+Subject: [PATCH 21/31] mfd: twl-core: enable madc clock
+
+Now that the madc driver has been merged it is also necessary to enable the clock to the madc block
+
+Signed-off-by: Steve Sakoman <steve@sakoman.com>
+---
+ drivers/mfd/twl-core.c | 8 ++++++++
+ include/linux/i2c/twl.h | 1 +
+ 2 files changed, 9 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
+index d9435e4..9096d7d 100644
+--- a/drivers/mfd/twl-core.c
++++ b/drivers/mfd/twl-core.c
+@@ -222,6 +222,11 @@
+
+ /* Few power values */
+ #define R_CFG_BOOT 0x05
++#define R_GPBR1 0x0C
++
++/* MADC clock values for R_GPBR1 */
++#define MADC_HFCLK_EN 0x80
++#define DEFAULT_MADC_CLK_EN 0x10
+
+ /* some fields in R_CFG_BOOT */
+ #define HFCLK_FREQ_19p2_MHZ (1 << 0)
+@@ -992,6 +997,9 @@ static void clocks_init(struct device *dev,
+
+ e |= unprotect_pm_master();
+ /* effect->MADC+USB ck en */
++ if (twl_has_madc())
++ e |= twl_i2c_write_u8(TWL_MODULE_INTBR,
++ MADC_HFCLK_EN | DEFAULT_MADC_CLK_EN, R_GPBR1);
+ e |= twl_i2c_write_u8(TWL_MODULE_PM_MASTER, ctrl, R_CFG_BOOT);
+ e |= protect_pm_master();
+
+diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
+index 0c0d1ae..cbbf3b3 100644
+--- a/include/linux/i2c/twl.h
++++ b/include/linux/i2c/twl.h
+@@ -74,6 +74,7 @@
+
+ #define TWL_MODULE_USB TWL4030_MODULE_USB
+ #define TWL_MODULE_AUDIO_VOICE TWL4030_MODULE_AUDIO_VOICE
++#define TWL_MODULE_INTBR TWL4030_MODULE_INTBR
+ #define TWL_MODULE_PIH TWL4030_MODULE_PIH
+ #define TWL_MODULE_MADC TWL4030_MODULE_MADC
+ #define TWL_MODULE_MAIN_CHARGE TWL4030_MODULE_MAIN_CHARGE
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0022-rtc-twl-Switch-to-using-threaded-irq.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0022-rtc-twl-Switch-to-using-threaded-irq.patch
new file mode 100644
index 0000000000..780012a13b
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0022-rtc-twl-Switch-to-using-threaded-irq.patch
@@ -0,0 +1,25 @@
+From b94621613e7ece11e6408efe33ceb724892645d1 Mon Sep 17 00:00:00 2001
+From: Ilkka Koskinen <ilkka.koskinen@nokia.com>
+Date: Wed, 16 Mar 2011 16:07:14 +0000
+Subject: [PATCH 22/31] rtc-twl: Switch to using threaded irq
+
+---
+ drivers/rtc/rtc-twl.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/rtc/rtc-twl.c b/drivers/rtc/rtc-twl.c
+index 713b8ea..1fe1bc9 100644
+--- a/drivers/rtc/rtc-twl.c
++++ b/drivers/rtc/rtc-twl.c
+@@ -479,7 +479,7 @@ static int __devinit twl_rtc_probe(struct platform_device *pdev)
+ if (ret < 0)
+ goto out1;
+
+- ret = request_irq(irq, twl_rtc_interrupt,
++ ret = request_threaded_irq(irq, NULL, twl_rtc_interrupt,
+ IRQF_TRIGGER_RISING,
+ dev_name(&rtc->dev), rtc);
+ if (ret < 0) {
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0023-ARM-OMAP-automatically-set-musb-mode-in-platform-dat.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0023-ARM-OMAP-automatically-set-musb-mode-in-platform-dat.patch
new file mode 100644
index 0000000000..bb9408a842
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0023-ARM-OMAP-automatically-set-musb-mode-in-platform-dat.patch
@@ -0,0 +1,49 @@
+From 9a400cd7d8af58a7ba9dadaf6208c3f6ec9bb8a5 Mon Sep 17 00:00:00 2001
+From: Steve Sakoman <steve@sakoman.com>
+Date: Wed, 24 Feb 2010 10:37:22 -0800
+Subject: [PATCH 23/31] ARM: OMAP: automatically set musb mode in platform data based on CONFIG options
+
+---
+ arch/arm/mach-omap2/board-omap3beagle.c | 6 ++++++
+ arch/arm/mach-omap2/board-overo.c | 6 ++++++
+ 2 files changed, 12 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
+index 33007fd..2de4b02 100644
+--- a/arch/arm/mach-omap2/board-omap3beagle.c
++++ b/arch/arm/mach-omap2/board-omap3beagle.c
+@@ -604,7 +604,13 @@ static struct omap_board_mux board_mux[] __initdata = {
+
+ static struct omap_musb_board_data musb_board_data = {
+ .interface_type = MUSB_INTERFACE_ULPI,
++#if defined(CONFIG_USB_MUSB_OTG)
+ .mode = MUSB_OTG,
++#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
++ .mode = MUSB_PERIPHERAL,
++#else
++ .mode = MUSB_HOST,
++#endif
+ .power = 100,
+ };
+
+diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
+index 86f76e9..61c59fc 100644
+--- a/arch/arm/mach-omap2/board-overo.c
++++ b/arch/arm/mach-omap2/board-overo.c
+@@ -729,7 +729,13 @@ static struct omap_board_mux board_mux[] __initdata = {
+
+ static struct omap_musb_board_data musb_board_data = {
+ .interface_type = MUSB_INTERFACE_ULPI,
++#if defined(CONFIG_USB_MUSB_OTG)
+ .mode = MUSB_OTG,
++#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
++ .mode = MUSB_PERIPHERAL,
++#else
++ .mode = MUSB_HOST,
++#endif
+ .power = 100,
+ };
+
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0024-omap-mmc-Adjust-dto-to-eliminate-timeout-errors.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0024-omap-mmc-Adjust-dto-to-eliminate-timeout-errors.patch
new file mode 100644
index 0000000000..ce27c93840
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0024-omap-mmc-Adjust-dto-to-eliminate-timeout-errors.patch
@@ -0,0 +1,28 @@
+From 26a79f408bd41ad7b4a47f2683909d3fc1575eab Mon Sep 17 00:00:00 2001
+From: Steve Sakoman <steve@sakoman.com>
+Date: Wed, 12 Jan 2011 05:54:55 -0800
+Subject: [PATCH 24/31] omap: mmc: Adjust dto to eliminate timeout errors
+
+A number of SD card types were experiencing timeout errors. This
+could also lead to data corruption in some cases.
+
+This fix proposed by Sukumar Ghoral of TI.
+---
+ drivers/mmc/host/omap_hsmmc.c | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
+index d57686c..7fb03e8 100644
+--- a/drivers/mmc/host/omap_hsmmc.c
++++ b/drivers/mmc/host/omap_hsmmc.c
+@@ -1400,6 +1400,7 @@ static void set_data_timeout(struct omap_hsmmc_host *host,
+ cycle_ns = 1000000000 / (clk_get_rate(host->fclk) / clkd);
+ timeout = timeout_ns / cycle_ns;
+ timeout += timeout_clks;
++ timeout *= 2;
+ if (timeout) {
+ while ((timeout & 0x80000000) == 0) {
+ dto += 1;
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0025-omap-Fix-mtd-subpage-read-alignment.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0025-omap-Fix-mtd-subpage-read-alignment.patch
new file mode 100644
index 0000000000..f16ee2f152
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0025-omap-Fix-mtd-subpage-read-alignment.patch
@@ -0,0 +1,95 @@
+From a13b58ba9d6e0aa0fe0d2dc5b51de545cea2ee9e Mon Sep 17 00:00:00 2001
+From: Charles Manning <cdhmanning@gmail.com>
+Date: Tue, 18 Jan 2011 11:25:25 +1300
+Subject: [PATCH 25/31] omap: Fix mtd subpage read alignment
+
+This allows the omap2 prefetch engine to work properly for subpage
+reads. Without this ECC errors will stop UBIFS from working.
+
+Signed-off-by: Charles Manning <cdhmanning@gmail.com>
+---
+ drivers/mtd/nand/nand_base.c | 19 +++++++++++++++++++
+ drivers/mtd/nand/omap2.c | 1 +
+ include/linux/mtd/nand.h | 3 +++
+ 3 files changed, 23 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
+index c54a4cb..6ca7098 100644
+--- a/drivers/mtd/nand/nand_base.c
++++ b/drivers/mtd/nand/nand_base.c
+@@ -1157,6 +1157,22 @@ static int nand_read_page_swecc(struct mtd_info *mtd, struct nand_chip *chip,
+ }
+
+ /**
++ * nand_align_subpage32 - function to align subpage read to 32-bits
++ * @mtd: mtd info structure
++ * @buf: pointer to offset that needs to be aligned
++ * @len: pointer to length that needs to be aligned.
++ */
++
++void nand_align_subpage32(int *offs, int *len)
++{
++ int diff = *offs & 3;
++
++ *offs = *offs - diff;
++ *len = (*len + diff + 3) & ~3;
++}
++EXPORT_SYMBOL(nand_align_subpage32);
++
++/**
+ * nand_read_subpage - [REPLACABLE] software ecc based sub-page read function
+ * @mtd: mtd info structure
+ * @chip: nand chip info structure
+@@ -1221,6 +1237,9 @@ static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip,
+ if (eccpos[index + (num_steps * chip->ecc.bytes)] & (busw - 1))
+ aligned_len++;
+
++ if(chip->align_subpage)
++ chip->align_subpage(&aligned_pos, &aligned_len);
++
+ chip->cmdfunc(mtd, NAND_CMD_RNDOUT,
+ mtd->writesize + aligned_pos, -1);
+ chip->read_buf(mtd, &chip->oob_poi[aligned_pos], aligned_len);
+diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
+index da9a351..bb89c65 100644
+--- a/drivers/mtd/nand/omap2.c
++++ b/drivers/mtd/nand/omap2.c
+@@ -1069,6 +1069,7 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
+ info->nand.ecc.correct = omap_correct_data;
+ info->nand.ecc.mode = NAND_ECC_HW;
+ }
++ info->nand.align_subpage = nand_align_subpage32;
+
+ /* DIP switches on some boards change between 8 and 16 bit
+ * bus widths for flash. Try the other width if the first try fails.
+diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
+index d441927..311f211 100644
+--- a/include/linux/mtd/nand.h
++++ b/include/linux/mtd/nand.h
+@@ -479,6 +479,7 @@ struct nand_buffers {
+ * additional error status checks (determine if errors are
+ * correctable).
+ * @write_page: [REPLACEABLE] High-level page write function
++ * @align_subpage: [OPTIONAL] Aligns subpage read buffer.
+ */
+
+ struct nand_chip {
+@@ -507,6 +508,7 @@ struct nand_chip {
+ int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip,
+ const uint8_t *buf, int page, int cached, int raw);
+
++ void (*align_subpage)(int *offs, int *len);
+ int chip_delay;
+ unsigned int options;
+
+@@ -602,6 +604,7 @@ extern int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
+ int allowbbt);
+ extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len,
+ size_t *retlen, uint8_t *buf);
++extern void nand_align_subpage32(int *offs, int *len);
+
+ /**
+ * struct platform_nand_chip - chip level device structure
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0026-mtd-nand-omap2-Force-all-buffer-reads-to-u32-alignme.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0026-mtd-nand-omap2-Force-all-buffer-reads-to-u32-alignme.patch
new file mode 100644
index 0000000000..4a424c9b8a
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0026-mtd-nand-omap2-Force-all-buffer-reads-to-u32-alignme.patch
@@ -0,0 +1,35 @@
+From e0756b50ed72ebe28c768c9e17ee7811cc3cc53c Mon Sep 17 00:00:00 2001
+From: Charles Manning <manningc2@actrix.gen.nz>
+Date: Thu, 16 Dec 2010 20:35:56 -0800
+Subject: [PATCH 26/31] mtd: nand: omap2: Force all buffer reads to u32 alignment
+
+---
+ drivers/mtd/nand/omap2.c | 12 ++++++++++++
+ 1 files changed, 12 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
+index bb89c65..832f111 100644
+--- a/drivers/mtd/nand/omap2.c
++++ b/drivers/mtd/nand/omap2.c
+@@ -247,6 +247,18 @@ static void omap_read_buf_pref(struct mtd_info *mtd, u_char *buf, int len)
+ int ret = 0;
+ u32 *p = (u32 *)buf;
+
++ /* u32 align the buffer and read */
++ /* NB: This assumes the buf ptr can be aligned *down* which is a valid.
++ * Assumption when dealing with ecc buffers etc.
++ */
++ u32 addr = (u32)p;
++
++ int diff = addr & 3;
++ addr -= diff;
++ len += diff;
++ len = (len + 3) & ~3;
++ p = (u32 *)addr;
++
+ /* take care of subpage reads */
+ if (len % 4) {
+ if (info->nand.options & NAND_BUSWIDTH_16)
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0027-omap-nand-fix-subpage-ecc-issue-with-prefetch.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0027-omap-nand-fix-subpage-ecc-issue-with-prefetch.patch
new file mode 100644
index 0000000000..2427df5f72
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0027-omap-nand-fix-subpage-ecc-issue-with-prefetch.patch
@@ -0,0 +1,63 @@
+From 263890438c545107c50be16e628926531949c1fa Mon Sep 17 00:00:00 2001
+From: kishore kadiyala <kishore.kadiyala@ti.com>
+Date: Mon, 2 May 2011 11:10:38 +0000
+Subject: [PATCH 27/31] omap : nand : fix subpage ecc issue with prefetch
+
+For prefetch engine, read and write got broken in commit '2c01946c'.
+We never hit a scenario of not getting 'gpmc_prefetch_enable'
+call success.
+When reading/writing a subpage with a non divisible by 4 ecc number
+of bytes, the mis-aligned bytes gets handled first before enabling
+the Prefetch engine, then it reads/writes rest of the bytes.
+
+Signed-off-by: Kishore Kadiyala <kishore.kadiyala@ti.com>
+Signed-off-by: Vimal Singh <vimal.newwork@gmail.com>
+Reported-by: Bryan DE FARIA <bdefaria@adeneo-embedded.com>
+---
+ drivers/mtd/nand/omap2.c | 12 +++++-------
+ 1 files changed, 5 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
+index 832f111..471a39b 100644
+--- a/drivers/mtd/nand/omap2.c
++++ b/drivers/mtd/nand/omap2.c
+@@ -275,11 +275,10 @@ static void omap_read_buf_pref(struct mtd_info *mtd, u_char *buf, int len)
+ if (ret) {
+ /* PFPW engine is busy, use cpu copy method */
+ if (info->nand.options & NAND_BUSWIDTH_16)
+- omap_read_buf16(mtd, buf, len);
++ omap_read_buf16(mtd, (u_char *)p, len);
+ else
+- omap_read_buf8(mtd, buf, len);
++ omap_read_buf8(mtd, (u_char *)p, len);
+ } else {
+- p = (u32 *) buf;
+ do {
+ r_count = gpmc_read_status(GPMC_PREFETCH_FIFO_CNT);
+ r_count = r_count >> 2;
+@@ -305,7 +304,7 @@ static void omap_write_buf_pref(struct mtd_info *mtd,
+ struct omap_nand_info, mtd);
+ uint32_t w_count = 0;
+ int i = 0, ret = 0;
+- u16 *p;
++ u16 *p = (u16 *)buf;
+ unsigned long tim, limit;
+
+ /* take care of subpage writes */
+@@ -321,11 +320,10 @@ static void omap_write_buf_pref(struct mtd_info *mtd,
+ if (ret) {
+ /* PFPW engine is busy, use cpu copy method */
+ if (info->nand.options & NAND_BUSWIDTH_16)
+- omap_write_buf16(mtd, buf, len);
++ omap_write_buf16(mtd, (u_char *)p, len);
+ else
+- omap_write_buf8(mtd, buf, len);
++ omap_write_buf8(mtd, (u_char *)p, len);
+ } else {
+- p = (u16 *) buf;
+ while (len) {
+ w_count = gpmc_read_status(GPMC_PREFETCH_FIFO_CNT);
+ w_count = w_count >> 1;
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0028-OMAP-Overo-Add-support-for-spidev.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0028-OMAP-Overo-Add-support-for-spidev.patch
new file mode 100644
index 0000000000..bdbe1feaaa
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0028-OMAP-Overo-Add-support-for-spidev.patch
@@ -0,0 +1,46 @@
+From d83a600cbe0cfca8c8fd9f5566dd45166cc9e142 Mon Sep 17 00:00:00 2001
+From: Scott Ellis <scottellis.developer@gmail.com>
+Date: Sun, 23 Jan 2011 20:39:35 -0800
+Subject: [PATCH 28/31] OMAP: Overo: Add support for spidev
+
+---
+ arch/arm/mach-omap2/board-overo.c | 16 ++++++++++++++++
+ 1 files changed, 16 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
+index 61c59fc..05dd3eb 100644
+--- a/arch/arm/mach-omap2/board-overo.c
++++ b/arch/arm/mach-omap2/board-overo.c
+@@ -683,6 +683,14 @@ static struct spi_board_info overo_spi_board_info[] __initdata = {
+ .irq = OMAP_GPIO_IRQ(OVERO_GPIO_PENDOWN),
+ .platform_data = &ads7846_config,
+ },
++#elif defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
++ {
++ .modalias = "spidev",
++ .bus_num = 1,
++ .chip_select = 0,
++ .max_speed_hz = 48000000,
++ .mode = SPI_MODE_0,
++ },
+ #endif
+ #if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \
+ defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE)
+@@ -693,6 +701,14 @@ static struct spi_board_info overo_spi_board_info[] __initdata = {
+ .max_speed_hz = 500000,
+ .mode = SPI_MODE_3,
+ },
++#elif defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
++ {
++ .modalias = "spidev",
++ .bus_num = 1,
++ .chip_select = 1,
++ .max_speed_hz = 48000000,
++ .mode = SPI_MODE_0,
++ },
+ #endif
+ };
+
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0029-unionfs-Add-support-for-unionfs-2.5.9.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0029-unionfs-Add-support-for-unionfs-2.5.9.patch
new file mode 100644
index 0000000000..236865dbec
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0029-unionfs-Add-support-for-unionfs-2.5.9.patch
@@ -0,0 +1,11494 @@
+From 083250cd6541b75535707c1d416cfa3a45ad19a9 Mon Sep 17 00:00:00 2001
+From: Steve Sakoman <steve@sakoman.com>
+Date: Mon, 2 May 2011 16:14:34 -0700
+Subject: [PATCH 29/31] unionfs: Add support for unionfs 2.5.9
+
+---
+ Documentation/filesystems/00-INDEX | 2 +
+ Documentation/filesystems/unionfs/00-INDEX | 10 +
+ Documentation/filesystems/unionfs/concepts.txt | 287 ++++++
+ Documentation/filesystems/unionfs/issues.txt | 28 +
+ Documentation/filesystems/unionfs/rename.txt | 31 +
+ Documentation/filesystems/unionfs/usage.txt | 134 +++
+ MAINTAINERS | 8 +
+ fs/Kconfig | 1 +
+ fs/Makefile | 1 +
+ fs/namei.c | 38 +
+ fs/splice.c | 22 +-
+ fs/stack.c | 14 +-
+ fs/unionfs/Kconfig | 24 +
+ fs/unionfs/Makefile | 17 +
+ fs/unionfs/commonfops.c | 898 +++++++++++++++++++
+ fs/unionfs/copyup.c | 896 +++++++++++++++++++
+ fs/unionfs/debug.c | 548 ++++++++++++
+ fs/unionfs/dentry.c | 406 +++++++++
+ fs/unionfs/dirfops.c | 302 +++++++
+ fs/unionfs/dirhelper.c | 158 ++++
+ fs/unionfs/fanout.h | 407 +++++++++
+ fs/unionfs/file.c | 382 ++++++++
+ fs/unionfs/inode.c | 1099 ++++++++++++++++++++++++
+ fs/unionfs/lookup.c | 569 ++++++++++++
+ fs/unionfs/main.c | 763 ++++++++++++++++
+ fs/unionfs/mmap.c | 89 ++
+ fs/unionfs/rdstate.c | 285 ++++++
+ fs/unionfs/rename.c | 522 +++++++++++
+ fs/unionfs/sioq.c | 101 +++
+ fs/unionfs/sioq.h | 91 ++
+ fs/unionfs/subr.c | 95 ++
+ fs/unionfs/super.c | 1030 ++++++++++++++++++++++
+ fs/unionfs/union.h | 679 +++++++++++++++
+ fs/unionfs/unlink.c | 278 ++++++
+ fs/unionfs/whiteout.c | 601 +++++++++++++
+ fs/unionfs/xattr.c | 173 ++++
+ include/linux/fs_stack.h | 14 +-
+ include/linux/magic.h | 2 +
+ include/linux/namei.h | 3 +
+ include/linux/splice.h | 5 +
+ include/linux/union_fs.h | 22 +
+ security/security.c | 1 +
+ 42 files changed, 11024 insertions(+), 12 deletions(-)
+ create mode 100644 Documentation/filesystems/unionfs/00-INDEX
+ create mode 100644 Documentation/filesystems/unionfs/concepts.txt
+ create mode 100644 Documentation/filesystems/unionfs/issues.txt
+ create mode 100644 Documentation/filesystems/unionfs/rename.txt
+ create mode 100644 Documentation/filesystems/unionfs/usage.txt
+ create mode 100644 fs/unionfs/Kconfig
+ create mode 100644 fs/unionfs/Makefile
+ create mode 100644 fs/unionfs/commonfops.c
+ create mode 100644 fs/unionfs/copyup.c
+ create mode 100644 fs/unionfs/debug.c
+ create mode 100644 fs/unionfs/dentry.c
+ create mode 100644 fs/unionfs/dirfops.c
+ create mode 100644 fs/unionfs/dirhelper.c
+ create mode 100644 fs/unionfs/fanout.h
+ create mode 100644 fs/unionfs/file.c
+ create mode 100644 fs/unionfs/inode.c
+ create mode 100644 fs/unionfs/lookup.c
+ create mode 100644 fs/unionfs/main.c
+ create mode 100644 fs/unionfs/mmap.c
+ create mode 100644 fs/unionfs/rdstate.c
+ create mode 100644 fs/unionfs/rename.c
+ create mode 100644 fs/unionfs/sioq.c
+ create mode 100644 fs/unionfs/sioq.h
+ create mode 100644 fs/unionfs/subr.c
+ create mode 100644 fs/unionfs/super.c
+ create mode 100644 fs/unionfs/union.h
+ create mode 100644 fs/unionfs/unlink.c
+ create mode 100644 fs/unionfs/whiteout.c
+ create mode 100644 fs/unionfs/xattr.c
+ create mode 100644 include/linux/union_fs.h
+
+diff --git a/Documentation/filesystems/00-INDEX b/Documentation/filesystems/00-INDEX
+index 8c624a1..4aa288b 100644
+--- a/Documentation/filesystems/00-INDEX
++++ b/Documentation/filesystems/00-INDEX
+@@ -110,6 +110,8 @@ udf.txt
+ - info and mount options for the UDF filesystem.
+ ufs.txt
+ - info on the ufs filesystem.
++unionfs/
++ - info on the unionfs filesystem
+ vfat.txt
+ - info on using the VFAT filesystem used in Windows NT and Windows 95
+ vfs.txt
+diff --git a/Documentation/filesystems/unionfs/00-INDEX b/Documentation/filesystems/unionfs/00-INDEX
+new file mode 100644
+index 0000000..96fdf67
+--- /dev/null
++++ b/Documentation/filesystems/unionfs/00-INDEX
+@@ -0,0 +1,10 @@
++00-INDEX
++ - this file.
++concepts.txt
++ - A brief introduction of concepts.
++issues.txt
++ - A summary of known issues with unionfs.
++rename.txt
++ - Information regarding rename operations.
++usage.txt
++ - Usage information and examples.
+diff --git a/Documentation/filesystems/unionfs/concepts.txt b/Documentation/filesystems/unionfs/concepts.txt
+new file mode 100644
+index 0000000..b853788
+--- /dev/null
++++ b/Documentation/filesystems/unionfs/concepts.txt
+@@ -0,0 +1,287 @@
++Unionfs 2.x CONCEPTS:
++=====================
++
++This file describes the concepts needed by a namespace unification file
++system.
++
++
++Branch Priority:
++================
++
++Each branch is assigned a unique priority - starting from 0 (highest
++priority). No two branches can have the same priority.
++
++
++Branch Mode:
++============
++
++Each branch is assigned a mode - read-write or read-only. This allows
++directories on media mounted read-write to be used in a read-only manner.
++
++
++Whiteouts:
++==========
++
++A whiteout removes a file name from the namespace. Whiteouts are needed when
++one attempts to remove a file on a read-only branch.
++
++Suppose we have a two-branch union, where branch 0 is read-write and branch
++1 is read-only. And a file 'foo' on branch 1:
++
++./b0/
++./b1/
++./b1/foo
++
++The unified view would simply be:
++
++./union/
++./union/foo
++
++Since 'foo' is stored on a read-only branch, it cannot be removed. A
++whiteout is used to remove the name 'foo' from the unified namespace. Again,
++since branch 1 is read-only, the whiteout cannot be created there. So, we
++try on a higher priority (lower numerically) branch and create the whiteout
++there.
++
++./b0/
++./b0/.wh.foo
++./b1/
++./b1/foo
++
++Later, when Unionfs traverses branches (due to lookup or readdir), it
++eliminate 'foo' from the namespace (as well as the whiteout itself.)
++
++
++Opaque Directories:
++===================
++
++Assume we have a unionfs mount comprising of two branches. Branch 0 is
++empty; branch 1 has the directory /a and file /a/f. Let's say we mount a
++union of branch 0 as read-write and branch 1 as read-only. Now, let's say
++we try to perform the following operation in the union:
++
++ rm -fr a
++
++Because branch 1 is not writable, we cannot physically remove the file /a/f
++or the directory /a. So instead, we will create a whiteout in branch 0
++named /.wh.a, masking out the name "a" from branch 1. Next, let's say we
++try to create a directory named "a" as follows:
++
++ mkdir a
++
++Because we have a whiteout for "a" already, Unionfs behaves as if "a"
++doesn't exist, and thus will delete the whiteout and replace it with an
++actual directory named "a".
++
++The problem now is that if you try to "ls" in the union, Unionfs will
++perform is normal directory name unification, for *all* directories named
++"a" in all branches. This will cause the file /a/f from branch 1 to
++re-appear in the union's namespace, which violates Unix semantics.
++
++To avoid this problem, we have a different form of whiteouts for
++directories, called "opaque directories" (same as BSD Union Mount does).
++Whenever we replace a whiteout with a directory, that directory is marked as
++opaque. In Unionfs 2.x, it means that we create a file named
++/a/.wh.__dir_opaque in branch 0, after having created directory /a there.
++When unionfs notices that a directory is opaque, it stops all namespace
++operations (including merging readdir contents) at that opaque directory.
++This prevents re-exposing names from masked out directories.
++
++
++Duplicate Elimination:
++======================
++
++It is possible for files on different branches to have the same name.
++Unionfs then has to select which instance of the file to show to the user.
++Given the fact that each branch has a priority associated with it, the
++simplest solution is to take the instance from the highest priority
++(numerically lowest value) and "hide" the others.
++
++
++Unlinking:
++=========
++
++Unlink operation on non-directory instances is optimized to remove the
++maximum possible objects in case multiple underlying branches have the same
++file name. The unlink operation will first try to delete file instances
++from highest priority branch and then move further to delete from remaining
++branches in order of their decreasing priority. Consider a case (F..D..F),
++where F is a file and D is a directory of the same name; here, some
++intermediate branch could have an empty directory instance with the same
++name, so this operation also tries to delete this directory instance and
++proceed further to delete from next possible lower priority branch. The
++unionfs unlink operation will smoothly delete the files with same name from
++all possible underlying branches. In case if some error occurs, it creates
++whiteout in highest priority branch that will hide file instance in rest of
++the branches. An error could occur either if an unlink operations in any of
++the underlying branch failed or if a branch has no write permission.
++
++This unlinking policy is known as "delete all" and it has the benefit of
++overall reducing the number of inodes used by duplicate files, and further
++reducing the total number of inodes consumed by whiteouts. The cost is of
++extra processing, but testing shows this extra processing is well worth the
++savings.
++
++
++Copyup:
++=======
++
++When a change is made to the contents of a file's data or meta-data, they
++have to be stored somewhere. The best way is to create a copy of the
++original file on a branch that is writable, and then redirect the write
++though to this copy. The copy must be made on a higher priority branch so
++that lookup and readdir return this newer "version" of the file rather than
++the original (see duplicate elimination).
++
++An entire unionfs mount can be read-only or read-write. If it's read-only,
++then none of the branches will be written to, even if some of the branches
++are physically writeable. If the unionfs mount is read-write, then the
++leftmost (highest priority) branch must be writeable (for copyup to take
++place); the remaining branches can be any mix of read-write and read-only.
++
++In a writeable mount, unionfs will create new files/dir in the leftmost
++branch. If one tries to modify a file in a read-only branch/media, unionfs
++will copyup the file to the leftmost branch and modify it there. If you try
++to modify a file from a writeable branch which is not the leftmost branch,
++then unionfs will modify it in that branch; this is useful if you, say,
++unify differnet packages (e.g., apache, sendmail, ftpd, etc.) and you want
++changes to specific package files to remain logically in the directory where
++they came from.
++
++Cache Coherency:
++================
++
++Unionfs users often want to be able to modify files and directories directly
++on the lower branches, and have those changes be visible at the Unionfs
++level. This means that data (e.g., pages) and meta-data (dentries, inodes,
++open files, etc.) have to be synchronized between the upper and lower
++layers. In other words, the newest changes from a layer below have to be
++propagated to the Unionfs layer above. If the two layers are not in sync, a
++cache incoherency ensues, which could lead to application failures and even
++oopses. The Linux kernel, however, has a rather limited set of mechanisms
++to ensure this inter-layer cache coherency---so Unionfs has to do most of
++the hard work on its own.
++
++Maintaining Invariants:
++
++The way Unionfs ensures cache coherency is as follows. At each entry point
++to a Unionfs file system method, we call a utility function to validate the
++primary objects of this method. Generally, we call unionfs_file_revalidate
++on open files, and __unionfs_d_revalidate_chain on dentries (which also
++validates inodes). These utility functions check to see whether the upper
++Unionfs object is in sync with any of the lower objects that it represents.
++The checks we perform include whether the Unionfs superblock has a newer
++generation number, or if any of the lower objects mtime's or ctime's are
++newer. (Note: generation numbers change when branch-management commands are
++issued, so in a way, maintaining cache coherency is also very important for
++branch-management.) If indeed we determine that any Unionfs object is no
++longer in sync with its lower counterparts, then we rebuild that object
++similarly to how we do so for branch-management.
++
++While rebuilding Unionfs's objects, we also purge any page mappings and
++truncate inode pages (see fs/unionfs/dentry.c:purge_inode_data). This is to
++ensure that Unionfs will re-get the newer data from the lower branches. We
++perform this purging only if the Unionfs operation in question is a reading
++operation; if Unionfs is performing a data writing operation (e.g., ->write,
++->commit_write, etc.) then we do NOT flush the lower mappings/pages: this is
++because (1) a self-deadlock could occur and (2) the upper Unionfs pages are
++considered more authoritative anyway, as they are newer and will overwrite
++any lower pages.
++
++Unionfs maintains the following important invariant regarding mtime's,
++ctime's, and atime's: the upper inode object's times are the max() of all of
++the lower ones. For non-directory objects, there's only one object below,
++so the mapping is simple; for directory objects, there could me multiple
++lower objects and we have to sync up with the newest one of all the lower
++ones. This invariant is important to maintain, especially for directories
++(besides, we need this to be POSIX compliant). A union could comprise
++multiple writable branches, each of which could change. If we don't reflect
++the newest possible mtime/ctime, some applications could fail. For example,
++NFSv2/v3 exports check for newer directory mtimes on the server to determine
++if the client-side attribute cache should be purged.
++
++To maintain these important invariants, of course, Unionfs carefully
++synchronizes upper and lower times in various places. For example, if we
++copy-up a file to a top-level branch, the parent directory where the file
++was copied up to will now have a new mtime: so after a successful copy-up,
++we sync up with the new top-level branch's parent directory mtime.
++
++Implementation:
++
++This cache-coherency implementation is efficient because it defers any
++synchronizing between the upper and lower layers until absolutely needed.
++Consider the example a common situation where users perform a lot of lower
++changes, such as untarring a whole package. While these take place,
++typically the user doesn't access the files via Unionfs; only after the
++lower changes are done, does the user try to access the lower files. With
++our cache-coherency implementation, the entirety of the changes to the lower
++branches will not result in a single CPU cycle spent at the Unionfs level
++until the user invokes a system call that goes through Unionfs.
++
++We have considered two alternate cache-coherency designs. (1) Using the
++dentry/inode notify functionality to register interest in finding out about
++any lower changes. This is a somewhat limited and also a heavy-handed
++approach which could result in many notifications to the Unionfs layer upon
++each small change at the lower layer (imagine a file being modified multiple
++times in rapid succession). (2) Rewriting the VFS to support explicit
++callbacks from lower objects to upper objects. We began exploring such an
++implementation, but found it to be very complicated--it would have resulted
++in massive VFS/MM changes which are unlikely to be accepted by the LKML
++community. We therefore believe that our current cache-coherency design and
++implementation represent the best approach at this time.
++
++Limitations:
++
++Our implementation works in that as long as a user process will have caused
++Unionfs to be called, directly or indirectly, even to just do
++->d_revalidate; then we will have purged the current Unionfs data and the
++process will see the new data. For example, a process that continually
++re-reads the same file's data will see the NEW data as soon as the lower
++file had changed, upon the next read(2) syscall (even if the file is still
++open!) However, this doesn't work when the process re-reads the open file's
++data via mmap(2) (unless the user unmaps/closes the file and remaps/reopens
++it). Once we respond to ->readpage(s), then the kernel maps the page into
++the process's address space and there doesn't appear to be a way to force
++the kernel to invalidate those pages/mappings, and force the process to
++re-issue ->readpage. If there's a way to invalidate active mappings and
++force a ->readpage, let us know please (invalidate_inode_pages2 doesn't do
++the trick).
++
++Our current Unionfs code has to perform many file-revalidation calls. It
++would be really nice if the VFS would export an optional file system hook
++->file_revalidate (similarly to dentry->d_revalidate) that will be called
++before each VFS op that has a "struct file" in it.
++
++Certain file systems have micro-second granularity (or better) for inode
++times, and asynchronous actions could cause those times to change with some
++small delay. In such cases, Unionfs may see a changed inode time that only
++differs by a tiny fraction of a second: such a change may be a false
++positive indication that the lower object has changed, whereas if unionfs
++waits a little longer, that false indication will not be seen. (These false
++positives are harmless, because they would at most cause unionfs to
++re-validate an object that may need no revalidation, and print a debugging
++message that clutters the console/logs.) Therefore, to minimize the chances
++of these situations, we delay the detection of changed times by a small
++factor of a few seconds, called UNIONFS_MIN_CC_TIME (which defaults to 3
++seconds, as does NFS). This means that we will detect the change, only a
++couple of seconds later, if indeed the time change persists in the lower
++file object. This delayed detection has an added performance benefit: we
++reduce the number of times that unionfs has to revalidate objects, in case
++there's a lot of concurrent activity on both the upper and lower objects,
++for the same file(s). Lastly, this delayed time attribute detection is
++similar to how NFS clients operate (e.g., acregmin).
++
++Finally, there is no way currently in Linux to prevent lower directories
++from being moved around (i.e., topology changes); there's no way to prevent
++modifications to directory sub-trees of whole file systems which are mounted
++read-write. It is therefore possible for in-flight operations in unionfs to
++take place, while a lower directory is being moved around. Therefore, if
++you try to, say, create a new file in a directory through unionfs, while the
++directory is being moved around directly, then the new file may get created
++in the new location where that directory was moved to. This is a somewhat
++similar behaviour in NFS: an NFS client could be creating a new file while
++th NFS server is moving th directory around; the file will get successfully
++created in the new location. (The one exception in unionfs is that if the
++branch is marked read-only by unionfs, then a copyup will take place.)
++
++For more information, see <http://unionfs.filesystems.org/>.
+diff --git a/Documentation/filesystems/unionfs/issues.txt b/Documentation/filesystems/unionfs/issues.txt
+new file mode 100644
+index 0000000..f4b7e7e
+--- /dev/null
++++ b/Documentation/filesystems/unionfs/issues.txt
+@@ -0,0 +1,28 @@
++KNOWN Unionfs 2.x ISSUES:
++=========================
++
++1. Unionfs should not use lookup_one_len() on the underlying f/s as it
++ confuses NFSv4. Currently, unionfs_lookup() passes lookup intents to the
++ lower file-system, this eliminates part of the problem. The remaining
++ calls to lookup_one_len may need to be changed to pass an intent. We are
++ currently introducing VFS changes to fs/namei.c's do_path_lookup() to
++ allow proper file lookup and opening in stackable file systems.
++
++2. Lockdep (a debugging feature) isn't aware of stacking, and so it
++ incorrectly complains about locking problems. The problem boils down to
++ this: Lockdep considers all objects of a certain type to be in the same
++ class, for example, all inodes. Lockdep doesn't like to see a lock held
++ on two inodes within the same task, and warns that it could lead to a
++ deadlock. However, stackable file systems do precisely that: they lock
++ an upper object, and then a lower object, in a strict order to avoid
++ locking problems; in addition, Unionfs, as a fan-out file system, may
++ have to lock several lower inodes. We are currently looking into Lockdep
++ to see how to make it aware of stackable file systems. For now, we
++ temporarily disable lockdep when calling vfs methods on lower objects,
++ but only for those places where lockdep complained. While this solution
++ may seem unclean, it is not without precedent: other places in the kernel
++ also do similar temporary disabling, of course after carefully having
++ checked that it is the right thing to do. Anyway, you get any warnings
++ from Lockdep, please report them to the Unionfs maintainers.
++
++For more information, see <http://unionfs.filesystems.org/>.
+diff --git a/Documentation/filesystems/unionfs/rename.txt b/Documentation/filesystems/unionfs/rename.txt
+new file mode 100644
+index 0000000..e20bb82
+--- /dev/null
++++ b/Documentation/filesystems/unionfs/rename.txt
+@@ -0,0 +1,31 @@
++Rename is a complex beast. The following table shows which rename(2) operations
++should succeed and which should fail.
++
++o: success
++E: error (either unionfs or vfs)
++X: EXDEV
++
++none = file does not exist
++file = file is a file
++dir = file is a empty directory
++child= file is a non-empty directory
++wh = file is a directory containing only whiteouts; this makes it logically
++ empty
++
++ none file dir child wh
++file o o E E E
++dir o E o E o
++child X E X E X
++wh o E o E o
++
++
++Renaming directories:
++=====================
++
++Whenever a empty (either physically or logically) directory is being renamed,
++the following sequence of events should take place:
++
++1) Remove whiteouts from both source and destination directory
++2) Rename source to destination
++3) Make destination opaque to prevent anything under it from showing up
++
+diff --git a/Documentation/filesystems/unionfs/usage.txt b/Documentation/filesystems/unionfs/usage.txt
+new file mode 100644
+index 0000000..1adde69
+--- /dev/null
++++ b/Documentation/filesystems/unionfs/usage.txt
+@@ -0,0 +1,134 @@
++Unionfs is a stackable unification file system, which can appear to merge
++the contents of several directories (branches), while keeping their physical
++content separate. Unionfs is useful for unified source tree management,
++merged contents of split CD-ROM, merged separate software package
++directories, data grids, and more. Unionfs allows any mix of read-only and
++read-write branches, as well as insertion and deletion of branches anywhere
++in the fan-out. To maintain Unix semantics, Unionfs handles elimination of
++duplicates, partial-error conditions, and more.
++
++GENERAL SYNTAX
++==============
++
++# mount -t unionfs -o <OPTIONS>,<BRANCH-OPTIONS> none MOUNTPOINT
++
++OPTIONS can be any legal combination of:
++
++- ro # mount file system read-only
++- rw # mount file system read-write
++- remount # remount the file system (see Branch Management below)
++- incgen # increment generation no. (see Cache Consistency below)
++
++BRANCH-OPTIONS can be either (1) a list of branches given to the "dirs="
++option, or (2) a list of individual branch manipulation commands, combined
++with the "remount" option, and is further described in the "Branch
++Management" section below.
++
++The syntax for the "dirs=" mount option is:
++
++ dirs=branch[=ro|=rw][:...]
++
++The "dirs=" option takes a colon-delimited list of directories to compose
++the union, with an optional branch mode for each of those directories.
++Directories that come earlier (specified first, on the left) in the list
++have a higher precedence than those which come later. Additionally,
++read-only or read-write permissions of the branch can be specified by
++appending =ro or =rw (default) to each directory. See the Copyup section in
++concepts.txt, for a description of Unionfs's behavior when mixing read-only
++and read-write branches and mounts.
++
++Syntax:
++
++ dirs=/branch1[=ro|=rw]:/branch2[=ro|=rw]:...:/branchN[=ro|=rw]
++
++Example:
++
++ dirs=/writable_branch=rw:/read-only_branch=ro
++
++
++BRANCH MANAGEMENT
++=================
++
++Once you mount your union for the first time, using the "dirs=" option, you
++can then change the union's overall mode or reconfigure the branches, using
++the remount option, as follows.
++
++To downgrade a union from read-write to read-only:
++
++# mount -t unionfs -o remount,ro none MOUNTPOINT
++
++To upgrade a union from read-only to read-write:
++
++# mount -t unionfs -o remount,rw none MOUNTPOINT
++
++To delete a branch /foo, regardless where it is in the current union:
++
++# mount -t unionfs -o remount,del=/foo none MOUNTPOINT
++
++To insert (add) a branch /foo before /bar:
++
++# mount -t unionfs -o remount,add=/bar:/foo none MOUNTPOINT
++
++To insert (add) a branch /foo (with the "rw" mode flag) before /bar:
++
++# mount -t unionfs -o remount,add=/bar:/foo=rw none MOUNTPOINT
++
++To insert (add) a branch /foo (in "rw" mode) at the very beginning (i.e., a
++new highest-priority branch), you can use the above syntax, or use a short
++hand version as follows:
++
++# mount -t unionfs -o remount,add=/foo none MOUNTPOINT
++
++To append a branch to the very end (new lowest-priority branch):
++
++# mount -t unionfs -o remount,add=:/foo none MOUNTPOINT
++
++To append a branch to the very end (new lowest-priority branch), in
++read-only mode:
++
++# mount -t unionfs -o remount,add=:/foo=ro none MOUNTPOINT
++
++Finally, to change the mode of one existing branch, say /foo, from read-only
++to read-write, and change /bar from read-write to read-only:
++
++# mount -t unionfs -o remount,mode=/foo=rw,mode=/bar=ro none MOUNTPOINT
++
++Note: in Unionfs 2.x, you cannot set the leftmost branch to readonly because
++then Unionfs won't have any writable place for copyups to take place.
++Moreover, the VFS can get confused when it tries to modify something in a
++file system mounted read-write, but isn't permitted to write to it.
++Instead, you should set the whole union as readonly, as described above.
++If, however, you must set the leftmost branch as readonly, perhaps so you
++can get a snapshot of it at a point in time, then you should insert a new
++writable top-level branch, and mark the one you want as readonly. This can
++be accomplished as follows, assuming that /foo is your current leftmost
++branch:
++
++# mount -t tmpfs -o size=NNN /new
++# mount -t unionfs -o remount,add=/new,mode=/foo=ro none MOUNTPOINT
++<do what you want safely in /foo>
++# mount -t unionfs -o remount,del=/new,mode=/foo=rw none MOUNTPOINT
++<check if there's anything in /new you want to preserve>
++# umount /new
++
++CACHE CONSISTENCY
++=================
++
++If you modify any file on any of the lower branches directly, while there is
++a Unionfs 2.x mounted above any of those branches, you should tell Unionfs
++to purge its caches and re-get the objects. To do that, you have to
++increment the generation number of the superblock using the following
++command:
++
++# mount -t unionfs -o remount,incgen none MOUNTPOINT
++
++Note that the older way of incrementing the generation number using an
++ioctl, is no longer supported in Unionfs 2.0 and newer. Ioctls in general
++are not encouraged. Plus, an ioctl is per-file concept, whereas the
++generation number is a per-file-system concept. Worse, such an ioctl
++requires an open file, which then has to be invalidated by the very nature
++of the generation number increase (read: the old generation increase ioctl
++was pretty racy).
++
++
++For more information, see <http://unionfs.filesystems.org/>.
+diff --git a/MAINTAINERS b/MAINTAINERS
+index 69f19f1..fd88a30 100644
+--- a/MAINTAINERS
++++ b/MAINTAINERS
+@@ -6319,6 +6319,14 @@ F: Documentation/cdrom/
+ F: drivers/cdrom/cdrom.c
+ F: include/linux/cdrom.h
+
++UNIONFS
++P: Erez Zadok
++M: ezk@cs.sunysb.edu
++L: unionfs@filesystems.org
++W: http://unionfs.filesystems.org/
++T: git git.kernel.org/pub/scm/linux/kernel/git/ezk/unionfs.git
++S: Maintained
++
+ UNSORTED BLOCK IMAGES (UBI)
+ M: Artem Bityutskiy <dedekind1@gmail.com>
+ W: http://www.linux-mtd.infradead.org/
+diff --git a/fs/Kconfig b/fs/Kconfig
+index f3aa9b0..0e6182c 100644
+--- a/fs/Kconfig
++++ b/fs/Kconfig
+@@ -170,6 +170,7 @@ if MISC_FILESYSTEMS
+ source "fs/adfs/Kconfig"
+ source "fs/affs/Kconfig"
+ source "fs/ecryptfs/Kconfig"
++source "fs/unionfs/Kconfig"
+ source "fs/hfs/Kconfig"
+ source "fs/hfsplus/Kconfig"
+ source "fs/befs/Kconfig"
+diff --git a/fs/Makefile b/fs/Makefile
+index fb68c2b..8ca9290 100644
+--- a/fs/Makefile
++++ b/fs/Makefile
+@@ -83,6 +83,7 @@ obj-$(CONFIG_ISO9660_FS) += isofs/
+ obj-$(CONFIG_HFSPLUS_FS) += hfsplus/ # Before hfs to find wrapped HFS+
+ obj-$(CONFIG_HFS_FS) += hfs/
+ obj-$(CONFIG_ECRYPT_FS) += ecryptfs/
++obj-$(CONFIG_UNION_FS) += unionfs/
+ obj-$(CONFIG_VXFS_FS) += freevxfs/
+ obj-$(CONFIG_NFS_FS) += nfs/
+ obj-$(CONFIG_EXPORTFS) += exportfs/
+diff --git a/fs/namei.c b/fs/namei.c
+index e3c4f11..d9f99a4 100644
+--- a/fs/namei.c
++++ b/fs/namei.c
+@@ -578,6 +578,7 @@ void release_open_intent(struct nameidata *nd)
+ fput(file);
+ }
+ }
++EXPORT_SYMBOL_GPL(release_open_intent);
+
+ static inline int d_revalidate(struct dentry *dentry, struct nameidata *nd)
+ {
+@@ -1819,6 +1820,42 @@ struct dentry *lookup_one_len(const char *name, struct dentry *base, int len)
+ return __lookup_hash(&this, base, NULL);
+ }
+
++/* pass nameidata from caller (useful for NFS) */
++struct dentry *lookup_one_len_nd(const char *name, struct dentry *base,
++ int len, struct nameidata *nd)
++{
++ struct qstr this;
++ unsigned long hash;
++ unsigned int c;
++
++ WARN_ON_ONCE(!mutex_is_locked(&base->d_inode->i_mutex));
++
++ this.name = name;
++ this.len = len;
++ if (!len)
++ return ERR_PTR(-EACCES);
++
++ hash = init_name_hash();
++ while (len--) {
++ c = *(const unsigned char *)name++;
++ if (c == '/' || c == '\0')
++ return ERR_PTR(-EACCES);
++ hash = partial_name_hash(c, hash);
++ }
++ this.hash = end_name_hash(hash);
++ /*
++ * See if the low-level filesystem might want
++ * to use its own hash..
++ */
++ if (base->d_flags & DCACHE_OP_HASH) {
++ int err = base->d_op->d_hash(base, base->d_inode, &this);
++ if (err < 0)
++ return ERR_PTR(err);
++ }
++
++ return __lookup_hash(&this, base, nd);
++}
++
+ int user_path_at(int dfd, const char __user *name, unsigned flags,
+ struct path *path)
+ {
+@@ -3422,6 +3459,7 @@ EXPORT_SYMBOL(get_write_access); /* binfmt_aout */
+ EXPORT_SYMBOL(getname);
+ EXPORT_SYMBOL(lock_rename);
+ EXPORT_SYMBOL(lookup_one_len);
++EXPORT_SYMBOL(lookup_one_len_nd);
+ EXPORT_SYMBOL(page_follow_link_light);
+ EXPORT_SYMBOL(page_put_link);
+ EXPORT_SYMBOL(page_readlink);
+diff --git a/fs/splice.c b/fs/splice.c
+index 50a5d97..a3af841 100644
+--- a/fs/splice.c
++++ b/fs/splice.c
+@@ -1081,8 +1081,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
+ /*
+ * Attempt to initiate a splice from pipe to file.
+ */
+-static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
+- loff_t *ppos, size_t len, unsigned int flags)
++long vfs_splice_from(struct pipe_inode_info *pipe, struct file *out,
++ loff_t *ppos, size_t len, unsigned int flags)
+ {
+ ssize_t (*splice_write)(struct pipe_inode_info *, struct file *,
+ loff_t *, size_t, unsigned int);
+@@ -1105,13 +1105,14 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
+
+ return splice_write(pipe, out, ppos, len, flags);
+ }
++EXPORT_SYMBOL_GPL(vfs_splice_from);
+
+ /*
+ * Attempt to initiate a splice from a file to a pipe.
+ */
+-static long do_splice_to(struct file *in, loff_t *ppos,
+- struct pipe_inode_info *pipe, size_t len,
+- unsigned int flags)
++long vfs_splice_to(struct file *in, loff_t *ppos,
++ struct pipe_inode_info *pipe, size_t len,
++ unsigned int flags)
+ {
+ ssize_t (*splice_read)(struct file *, loff_t *,
+ struct pipe_inode_info *, size_t, unsigned int);
+@@ -1131,6 +1132,7 @@ static long do_splice_to(struct file *in, loff_t *ppos,
+
+ return splice_read(in, ppos, pipe, len, flags);
+ }
++EXPORT_SYMBOL_GPL(vfs_splice_to);
+
+ /**
+ * splice_direct_to_actor - splices data directly between two non-pipes
+@@ -1200,7 +1202,7 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
+ size_t read_len;
+ loff_t pos = sd->pos, prev_pos = pos;
+
+- ret = do_splice_to(in, &pos, pipe, len, flags);
++ ret = vfs_splice_to(in, &pos, pipe, len, flags);
+ if (unlikely(ret <= 0))
+ goto out_release;
+
+@@ -1259,8 +1261,8 @@ static int direct_splice_actor(struct pipe_inode_info *pipe,
+ {
+ struct file *file = sd->u.file;
+
+- return do_splice_from(pipe, file, &file->f_pos, sd->total_len,
+- sd->flags);
++ return vfs_splice_from(pipe, file, &file->f_pos, sd->total_len,
++ sd->flags);
+ }
+
+ /**
+@@ -1345,7 +1347,7 @@ static long do_splice(struct file *in, loff_t __user *off_in,
+ } else
+ off = &out->f_pos;
+
+- ret = do_splice_from(ipipe, out, off, len, flags);
++ ret = vfs_splice_from(ipipe, out, off, len, flags);
+
+ if (off_out && copy_to_user(off_out, off, sizeof(loff_t)))
+ ret = -EFAULT;
+@@ -1365,7 +1367,7 @@ static long do_splice(struct file *in, loff_t __user *off_in,
+ } else
+ off = &in->f_pos;
+
+- ret = do_splice_to(in, off, opipe, len, flags);
++ ret = vfs_splice_to(in, off, opipe, len, flags);
+
+ if (off_in && copy_to_user(off_in, off, sizeof(loff_t)))
+ ret = -EFAULT;
+diff --git a/fs/stack.c b/fs/stack.c
+index 4a6f7f4..7eeef12 100644
+--- a/fs/stack.c
++++ b/fs/stack.c
+@@ -1,8 +1,20 @@
++/*
++ * Copyright (c) 2006-2009 Erez Zadok
++ * Copyright (c) 2006-2007 Josef 'Jeff' Sipek
++ * Copyright (c) 2006-2009 Stony Brook University
++ * Copyright (c) 2006-2009 The Research Foundation of SUNY
++ *
++ * 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/fs.h>
+ #include <linux/fs_stack.h>
+
+-/* does _NOT_ require i_mutex to be held.
++/*
++ * does _NOT_ require i_mutex to be held.
+ *
+ * This function cannot be inlined since i_size_{read,write} is rather
+ * heavy-weight on 32-bit systems
+diff --git a/fs/unionfs/Kconfig b/fs/unionfs/Kconfig
+new file mode 100644
+index 0000000..f3c1ac4
+--- /dev/null
++++ b/fs/unionfs/Kconfig
+@@ -0,0 +1,24 @@
++config UNION_FS
++ tristate "Union file system (EXPERIMENTAL)"
++ depends on EXPERIMENTAL
++ help
++ Unionfs is a stackable unification file system, which appears to
++ merge the contents of several directories (branches), while keeping
++ their physical content separate.
++
++ See <http://unionfs.filesystems.org> for details
++
++config UNION_FS_XATTR
++ bool "Unionfs extended attributes"
++ depends on UNION_FS
++ help
++ Extended attributes are name:value pairs associated with inodes by
++ the kernel or by users (see the attr(5) manual page).
++
++ If unsure, say N.
++
++config UNION_FS_DEBUG
++ bool "Debug Unionfs"
++ depends on UNION_FS
++ help
++ If you say Y here, you can turn on debugging output from Unionfs.
+diff --git a/fs/unionfs/Makefile b/fs/unionfs/Makefile
+new file mode 100644
+index 0000000..3e31847
+--- /dev/null
++++ b/fs/unionfs/Makefile
+@@ -0,0 +1,17 @@
++UNIONFS_VERSION="2.5.9 (for 2.6.39-rc5)"
++
++EXTRA_CFLAGS += -DUNIONFS_VERSION=\"$(UNIONFS_VERSION)\"
++
++obj-$(CONFIG_UNION_FS) += unionfs.o
++
++unionfs-y := subr.o dentry.o file.o inode.o main.o super.o \
++ rdstate.o copyup.o dirhelper.o rename.o unlink.o \
++ lookup.o commonfops.o dirfops.o sioq.o mmap.o whiteout.o
++
++unionfs-$(CONFIG_UNION_FS_XATTR) += xattr.o
++
++unionfs-$(CONFIG_UNION_FS_DEBUG) += debug.o
++
++ifeq ($(CONFIG_UNION_FS_DEBUG),y)
++EXTRA_CFLAGS += -DDEBUG
++endif
+diff --git a/fs/unionfs/commonfops.c b/fs/unionfs/commonfops.c
+new file mode 100644
+index 0000000..9f63b1c
+--- /dev/null
++++ b/fs/unionfs/commonfops.c
+@@ -0,0 +1,898 @@
++/*
++ * Copyright (c) 2003-2011 Erez Zadok
++ * Copyright (c) 2003-2006 Charles P. Wright
++ * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
++ * Copyright (c) 2005-2006 Junjiro Okajima
++ * Copyright (c) 2005 Arun M. Krishnakumar
++ * Copyright (c) 2004-2006 David P. Quigley
++ * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
++ * Copyright (c) 2003 Puja Gupta
++ * Copyright (c) 2003 Harikesavan Krishnan
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
++ *
++ * 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 "union.h"
++
++/*
++ * 1) Copyup the file
++ * 2) Rename the file to '.unionfs<original inode#><counter>' - obviously
++ * stolen from NFS's silly rename
++ */
++static int copyup_deleted_file(struct file *file, struct dentry *dentry,
++ struct dentry *parent, int bstart, int bindex)
++{
++ static unsigned int counter;
++ const int i_inosize = sizeof(dentry->d_inode->i_ino) * 2;
++ const int countersize = sizeof(counter) * 2;
++ const int nlen = sizeof(".unionfs") + i_inosize + countersize - 1;
++ char name[nlen + 1];
++ int err;
++ struct dentry *tmp_dentry = NULL;
++ struct dentry *lower_dentry;
++ struct dentry *lower_dir_dentry = NULL;
++
++ lower_dentry = unionfs_lower_dentry_idx(dentry, bstart);
++
++ sprintf(name, ".unionfs%*.*lx",
++ i_inosize, i_inosize, lower_dentry->d_inode->i_ino);
++
++ /*
++ * Loop, looking for an unused temp name to copyup to.
++ *
++ * It's somewhat silly that we look for a free temp tmp name in the
++ * source branch (bstart) instead of the dest branch (bindex), where
++ * the final name will be created. We _will_ catch it if somehow
++ * the name exists in the dest branch, but it'd be nice to catch it
++ * sooner than later.
++ */
++retry:
++ tmp_dentry = NULL;
++ do {
++ char *suffix = name + nlen - countersize;
++
++ dput(tmp_dentry);
++ counter++;
++ sprintf(suffix, "%*.*x", countersize, countersize, counter);
++
++ pr_debug("unionfs: trying to rename %s to %s\n",
++ dentry->d_name.name, name);
++
++ tmp_dentry = lookup_lck_len(name, lower_dentry->d_parent,
++ nlen);
++ if (IS_ERR(tmp_dentry)) {
++ err = PTR_ERR(tmp_dentry);
++ goto out;
++ }
++ } while (tmp_dentry->d_inode != NULL); /* need negative dentry */
++ dput(tmp_dentry);
++
++ err = copyup_named_file(parent->d_inode, file, name, bstart, bindex,
++ i_size_read(file->f_path.dentry->d_inode));
++ if (err) {
++ if (unlikely(err == -EEXIST))
++ goto retry;
++ goto out;
++ }
++
++ /* bring it to the same state as an unlinked file */
++ lower_dentry = unionfs_lower_dentry_idx(dentry, dbstart(dentry));
++ if (!unionfs_lower_inode_idx(dentry->d_inode, bindex)) {
++ atomic_inc(&lower_dentry->d_inode->i_count);
++ unionfs_set_lower_inode_idx(dentry->d_inode, bindex,
++ lower_dentry->d_inode);
++ }
++ lower_dir_dentry = lock_parent(lower_dentry);
++ err = vfs_unlink(lower_dir_dentry->d_inode, lower_dentry);
++ unlock_dir(lower_dir_dentry);
++
++out:
++ if (!err)
++ unionfs_check_dentry(dentry);
++ return err;
++}
++
++/*
++ * put all references held by upper struct file and free lower file pointer
++ * array
++ */
++static void cleanup_file(struct file *file)
++{
++ int bindex, bstart, bend;
++ struct file **lower_files;
++ struct file *lower_file;
++ struct super_block *sb = file->f_path.dentry->d_sb;
++
++ lower_files = UNIONFS_F(file)->lower_files;
++ bstart = fbstart(file);
++ bend = fbend(file);
++
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ int i; /* holds (possibly) updated branch index */
++ int old_bid;
++
++ lower_file = unionfs_lower_file_idx(file, bindex);
++ if (!lower_file)
++ continue;
++
++ /*
++ * Find new index of matching branch with an open
++ * file, since branches could have been added or
++ * deleted causing the one with open files to shift.
++ */
++ old_bid = UNIONFS_F(file)->saved_branch_ids[bindex];
++ i = branch_id_to_idx(sb, old_bid);
++ if (unlikely(i < 0)) {
++ printk(KERN_ERR "unionfs: no superblock for "
++ "file %p\n", file);
++ continue;
++ }
++
++ /* decrement count of open files */
++ branchput(sb, i);
++ /*
++ * fput will perform an mntput for us on the correct branch.
++ * Although we're using the file's old branch configuration,
++ * bindex, which is the old index, correctly points to the
++ * right branch in the file's branch list. In other words,
++ * we're going to mntput the correct branch even if branches
++ * have been added/removed.
++ */
++ fput(lower_file);
++ UNIONFS_F(file)->lower_files[bindex] = NULL;
++ UNIONFS_F(file)->saved_branch_ids[bindex] = -1;
++ }
++
++ UNIONFS_F(file)->lower_files = NULL;
++ kfree(lower_files);
++ kfree(UNIONFS_F(file)->saved_branch_ids);
++ /* set to NULL because caller needs to know if to kfree on error */
++ UNIONFS_F(file)->saved_branch_ids = NULL;
++}
++
++/* open all lower files for a given file */
++static int open_all_files(struct file *file)
++{
++ int bindex, bstart, bend, err = 0;
++ struct file *lower_file;
++ struct dentry *lower_dentry;
++ struct dentry *dentry = file->f_path.dentry;
++ struct super_block *sb = dentry->d_sb;
++
++ bstart = dbstart(dentry);
++ bend = dbend(dentry);
++
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
++ if (!lower_dentry)
++ continue;
++
++ dget(lower_dentry);
++ unionfs_mntget(dentry, bindex);
++ branchget(sb, bindex);
++
++ lower_file =
++ dentry_open(lower_dentry,
++ unionfs_lower_mnt_idx(dentry, bindex),
++ file->f_flags, current_cred());
++ if (IS_ERR(lower_file)) {
++ branchput(sb, bindex);
++ err = PTR_ERR(lower_file);
++ goto out;
++ } else {
++ unionfs_set_lower_file_idx(file, bindex, lower_file);
++ }
++ }
++out:
++ return err;
++}
++
++/* open the highest priority file for a given upper file */
++static int open_highest_file(struct file *file, bool willwrite)
++{
++ int bindex, bstart, bend, err = 0;
++ struct file *lower_file;
++ struct dentry *lower_dentry;
++ struct dentry *dentry = file->f_path.dentry;
++ struct dentry *parent = dget_parent(dentry);
++ struct inode *parent_inode = parent->d_inode;
++ struct super_block *sb = dentry->d_sb;
++
++ bstart = dbstart(dentry);
++ bend = dbend(dentry);
++
++ lower_dentry = unionfs_lower_dentry(dentry);
++ if (willwrite && IS_WRITE_FLAG(file->f_flags) && is_robranch(dentry)) {
++ for (bindex = bstart - 1; bindex >= 0; bindex--) {
++ err = copyup_file(parent_inode, file, bstart, bindex,
++ i_size_read(dentry->d_inode));
++ if (!err)
++ break;
++ }
++ atomic_set(&UNIONFS_F(file)->generation,
++ atomic_read(&UNIONFS_I(dentry->d_inode)->
++ generation));
++ goto out;
++ }
++
++ dget(lower_dentry);
++ unionfs_mntget(dentry, bstart);
++ lower_file = dentry_open(lower_dentry,
++ unionfs_lower_mnt_idx(dentry, bstart),
++ file->f_flags, current_cred());
++ if (IS_ERR(lower_file)) {
++ err = PTR_ERR(lower_file);
++ goto out;
++ }
++ branchget(sb, bstart);
++ unionfs_set_lower_file(file, lower_file);
++ /* Fix up the position. */
++ lower_file->f_pos = file->f_pos;
++
++ memcpy(&lower_file->f_ra, &file->f_ra, sizeof(struct file_ra_state));
++out:
++ dput(parent);
++ return err;
++}
++
++/* perform a delayed copyup of a read-write file on a read-only branch */
++static int do_delayed_copyup(struct file *file, struct dentry *parent)
++{
++ int bindex, bstart, bend, err = 0;
++ struct dentry *dentry = file->f_path.dentry;
++ struct inode *parent_inode = parent->d_inode;
++
++ bstart = fbstart(file);
++ bend = fbend(file);
++
++ BUG_ON(!S_ISREG(dentry->d_inode->i_mode));
++
++ unionfs_check_file(file);
++ for (bindex = bstart - 1; bindex >= 0; bindex--) {
++ if (!d_deleted(dentry))
++ err = copyup_file(parent_inode, file, bstart,
++ bindex,
++ i_size_read(dentry->d_inode));
++ else
++ err = copyup_deleted_file(file, dentry, parent,
++ bstart, bindex);
++ /* if succeeded, set lower open-file flags and break */
++ if (!err) {
++ struct file *lower_file;
++ lower_file = unionfs_lower_file_idx(file, bindex);
++ lower_file->f_flags = file->f_flags;
++ break;
++ }
++ }
++ if (err || (bstart <= fbstart(file)))
++ goto out;
++ bend = fbend(file);
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ if (unionfs_lower_file_idx(file, bindex)) {
++ branchput(dentry->d_sb, bindex);
++ fput(unionfs_lower_file_idx(file, bindex));
++ unionfs_set_lower_file_idx(file, bindex, NULL);
++ }
++ }
++ path_put_lowers(dentry, bstart, bend, false);
++ iput_lowers(dentry->d_inode, bstart, bend, false);
++ /* for reg file, we only open it "once" */
++ fbend(file) = fbstart(file);
++ dbend(dentry) = dbstart(dentry);
++ ibend(dentry->d_inode) = ibstart(dentry->d_inode);
++
++out:
++ unionfs_check_file(file);
++ return err;
++}
++
++/*
++ * Helper function for unionfs_file_revalidate/locked.
++ * Expects dentry/parent to be locked already, and revalidated.
++ */
++static int __unionfs_file_revalidate(struct file *file, struct dentry *dentry,
++ struct dentry *parent,
++ struct super_block *sb, int sbgen,
++ int dgen, bool willwrite)
++{
++ int fgen;
++ int bstart, bend, orig_brid;
++ int size;
++ int err = 0;
++
++ fgen = atomic_read(&UNIONFS_F(file)->generation);
++
++ /*
++ * There are two cases we are interested in. The first is if the
++ * generation is lower than the super-block. The second is if
++ * someone has copied up this file from underneath us, we also need
++ * to refresh things.
++ */
++ if ((d_deleted(dentry) && dbstart(dentry) >= fbstart(file)) ||
++ (sbgen <= fgen &&
++ dbstart(dentry) == fbstart(file) &&
++ unionfs_lower_file(file)))
++ goto out_may_copyup;
++
++ /* save orig branch ID */
++ orig_brid = UNIONFS_F(file)->saved_branch_ids[fbstart(file)];
++
++ /* First we throw out the existing files. */
++ cleanup_file(file);
++
++ /* Now we reopen the file(s) as in unionfs_open. */
++ bstart = fbstart(file) = dbstart(dentry);
++ bend = fbend(file) = dbend(dentry);
++
++ size = sizeof(struct file *) * sbmax(sb);
++ UNIONFS_F(file)->lower_files = kzalloc(size, GFP_KERNEL);
++ if (unlikely(!UNIONFS_F(file)->lower_files)) {
++ err = -ENOMEM;
++ goto out;
++ }
++ size = sizeof(int) * sbmax(sb);
++ UNIONFS_F(file)->saved_branch_ids = kzalloc(size, GFP_KERNEL);
++ if (unlikely(!UNIONFS_F(file)->saved_branch_ids)) {
++ err = -ENOMEM;
++ goto out;
++ }
++
++ if (S_ISDIR(dentry->d_inode->i_mode)) {
++ /* We need to open all the files. */
++ err = open_all_files(file);
++ if (err)
++ goto out;
++ } else {
++ int new_brid;
++ /* We only open the highest priority branch. */
++ err = open_highest_file(file, willwrite);
++ if (err)
++ goto out;
++ new_brid = UNIONFS_F(file)->saved_branch_ids[fbstart(file)];
++ if (unlikely(new_brid != orig_brid && sbgen > fgen)) {
++ /*
++ * If we re-opened the file on a different branch
++ * than the original one, and this was due to a new
++ * branch inserted, then update the mnt counts of
++ * the old and new branches accordingly.
++ */
++ unionfs_mntget(dentry, bstart);
++ unionfs_mntput(sb->s_root,
++ branch_id_to_idx(sb, orig_brid));
++ }
++ /* regular files have only one open lower file */
++ fbend(file) = fbstart(file);
++ }
++ atomic_set(&UNIONFS_F(file)->generation,
++ atomic_read(&UNIONFS_I(dentry->d_inode)->generation));
++
++out_may_copyup:
++ /* Copyup on the first write to a file on a readonly branch. */
++ if (willwrite && IS_WRITE_FLAG(file->f_flags) &&
++ !IS_WRITE_FLAG(unionfs_lower_file(file)->f_flags) &&
++ is_robranch(dentry)) {
++ pr_debug("unionfs: do delay copyup of \"%s\"\n",
++ dentry->d_name.name);
++ err = do_delayed_copyup(file, parent);
++ /* regular files have only one open lower file */
++ if (!err && !S_ISDIR(dentry->d_inode->i_mode))
++ fbend(file) = fbstart(file);
++ }
++
++out:
++ if (err) {
++ kfree(UNIONFS_F(file)->lower_files);
++ kfree(UNIONFS_F(file)->saved_branch_ids);
++ }
++ return err;
++}
++
++/*
++ * Revalidate the struct file
++ * @file: file to revalidate
++ * @parent: parent dentry (locked by caller)
++ * @willwrite: true if caller may cause changes to the file; false otherwise.
++ * Caller must lock/unlock dentry's branch configuration.
++ */
++int unionfs_file_revalidate(struct file *file, struct dentry *parent,
++ bool willwrite)
++{
++ struct super_block *sb;
++ struct dentry *dentry;
++ int sbgen, dgen;
++ int err = 0;
++
++ dentry = file->f_path.dentry;
++ sb = dentry->d_sb;
++ verify_locked(dentry);
++ verify_locked(parent);
++
++ /*
++ * First revalidate the dentry inside struct file,
++ * but not unhashed dentries.
++ */
++ if (!d_deleted(dentry) &&
++ !__unionfs_d_revalidate(dentry, parent, willwrite)) {
++ err = -ESTALE;
++ goto out;
++ }
++
++ sbgen = atomic_read(&UNIONFS_SB(sb)->generation);
++ dgen = atomic_read(&UNIONFS_D(dentry)->generation);
++
++ if (unlikely(sbgen > dgen)) { /* XXX: should never happen */
++ pr_debug("unionfs: failed to revalidate dentry (%s)\n",
++ dentry->d_name.name);
++ err = -ESTALE;
++ goto out;
++ }
++
++ err = __unionfs_file_revalidate(file, dentry, parent, sb,
++ sbgen, dgen, willwrite);
++out:
++ return err;
++}
++
++/* unionfs_open helper function: open a directory */
++static int __open_dir(struct inode *inode, struct file *file)
++{
++ struct dentry *lower_dentry;
++ struct file *lower_file;
++ int bindex, bstart, bend;
++ struct vfsmount *mnt;
++
++ bstart = fbstart(file) = dbstart(file->f_path.dentry);
++ bend = fbend(file) = dbend(file->f_path.dentry);
++
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ lower_dentry =
++ unionfs_lower_dentry_idx(file->f_path.dentry, bindex);
++ if (!lower_dentry)
++ continue;
++
++ dget(lower_dentry);
++ unionfs_mntget(file->f_path.dentry, bindex);
++ mnt = unionfs_lower_mnt_idx(file->f_path.dentry, bindex);
++ lower_file = dentry_open(lower_dentry, mnt, file->f_flags,
++ current_cred());
++ if (IS_ERR(lower_file))
++ return PTR_ERR(lower_file);
++
++ unionfs_set_lower_file_idx(file, bindex, lower_file);
++
++ /*
++ * The branchget goes after the open, because otherwise
++ * we would miss the reference on release.
++ */
++ branchget(inode->i_sb, bindex);
++ }
++
++ return 0;
++}
++
++/* unionfs_open helper function: open a file */
++static int __open_file(struct inode *inode, struct file *file,
++ struct dentry *parent)
++{
++ struct dentry *lower_dentry;
++ struct file *lower_file;
++ int lower_flags;
++ int bindex, bstart, bend;
++
++ lower_dentry = unionfs_lower_dentry(file->f_path.dentry);
++ lower_flags = file->f_flags;
++
++ bstart = fbstart(file) = dbstart(file->f_path.dentry);
++ bend = fbend(file) = dbend(file->f_path.dentry);
++
++ /*
++ * check for the permission for lower file. If the error is
++ * COPYUP_ERR, copyup the file.
++ */
++ if (lower_dentry->d_inode && is_robranch(file->f_path.dentry)) {
++ /*
++ * if the open will change the file, copy it up otherwise
++ * defer it.
++ */
++ if (lower_flags & O_TRUNC) {
++ int size = 0;
++ int err = -EROFS;
++
++ /* copyup the file */
++ for (bindex = bstart - 1; bindex >= 0; bindex--) {
++ err = copyup_file(parent->d_inode, file,
++ bstart, bindex, size);
++ if (!err) {
++ /* only one regular file open */
++ fbend(file) = fbstart(file);
++ break;
++ }
++ }
++ return err;
++ } else {
++ /*
++ * turn off writeable flags, to force delayed copyup
++ * by caller.
++ */
++ lower_flags &= ~(OPEN_WRITE_FLAGS);
++ }
++ }
++
++ dget(lower_dentry);
++
++ /*
++ * dentry_open will decrement mnt refcnt if err.
++ * otherwise fput() will do an mntput() for us upon file close.
++ */
++ unionfs_mntget(file->f_path.dentry, bstart);
++ lower_file =
++ dentry_open(lower_dentry,
++ unionfs_lower_mnt_idx(file->f_path.dentry, bstart),
++ lower_flags, current_cred());
++ if (IS_ERR(lower_file))
++ return PTR_ERR(lower_file);
++
++ unionfs_set_lower_file(file, lower_file);
++ branchget(inode->i_sb, bstart);
++
++ return 0;
++}
++
++int unionfs_open(struct inode *inode, struct file *file)
++{
++ int err = 0;
++ struct file *lower_file = NULL;
++ struct dentry *dentry = file->f_path.dentry;
++ struct dentry *parent;
++ int bindex = 0, bstart = 0, bend = 0;
++ int size;
++ int valid = 0;
++
++ unionfs_read_lock(inode->i_sb, UNIONFS_SMUTEX_PARENT);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ /* don't open unhashed/deleted files */
++ if (d_deleted(dentry)) {
++ err = -ENOENT;
++ goto out_nofree;
++ }
++
++ /* XXX: should I change 'false' below to the 'willwrite' flag? */
++ valid = __unionfs_d_revalidate(dentry, parent, false);
++ if (unlikely(!valid)) {
++ err = -ESTALE;
++ goto out_nofree;
++ }
++
++ file->private_data =
++ kzalloc(sizeof(struct unionfs_file_info), GFP_KERNEL);
++ if (unlikely(!UNIONFS_F(file))) {
++ err = -ENOMEM;
++ goto out_nofree;
++ }
++ fbstart(file) = -1;
++ fbend(file) = -1;
++ atomic_set(&UNIONFS_F(file)->generation,
++ atomic_read(&UNIONFS_I(inode)->generation));
++
++ size = sizeof(struct file *) * sbmax(inode->i_sb);
++ UNIONFS_F(file)->lower_files = kzalloc(size, GFP_KERNEL);
++ if (unlikely(!UNIONFS_F(file)->lower_files)) {
++ err = -ENOMEM;
++ goto out;
++ }
++ size = sizeof(int) * sbmax(inode->i_sb);
++ UNIONFS_F(file)->saved_branch_ids = kzalloc(size, GFP_KERNEL);
++ if (unlikely(!UNIONFS_F(file)->saved_branch_ids)) {
++ err = -ENOMEM;
++ goto out;
++ }
++
++ bstart = fbstart(file) = dbstart(dentry);
++ bend = fbend(file) = dbend(dentry);
++
++ /*
++ * open all directories and make the unionfs file struct point to
++ * these lower file structs
++ */
++ if (S_ISDIR(inode->i_mode))
++ err = __open_dir(inode, file); /* open a dir */
++ else
++ err = __open_file(inode, file, parent); /* open a file */
++
++ /* freeing the allocated resources, and fput the opened files */
++ if (err) {
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ lower_file = unionfs_lower_file_idx(file, bindex);
++ if (!lower_file)
++ continue;
++
++ branchput(dentry->d_sb, bindex);
++ /* fput calls dput for lower_dentry */
++ fput(lower_file);
++ }
++ }
++
++out:
++ if (err) {
++ kfree(UNIONFS_F(file)->lower_files);
++ kfree(UNIONFS_F(file)->saved_branch_ids);
++ kfree(UNIONFS_F(file));
++ }
++out_nofree:
++ if (!err) {
++ unionfs_postcopyup_setmnt(dentry);
++ unionfs_copy_attr_times(inode);
++ unionfs_check_file(file);
++ unionfs_check_inode(inode);
++ }
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(inode->i_sb);
++ return err;
++}
++
++/*
++ * release all lower object references & free the file info structure
++ *
++ * No need to grab sb info's rwsem.
++ */
++int unionfs_file_release(struct inode *inode, struct file *file)
++{
++ struct file *lower_file = NULL;
++ struct unionfs_file_info *fileinfo;
++ struct unionfs_inode_info *inodeinfo;
++ struct super_block *sb = inode->i_sb;
++ struct dentry *dentry = file->f_path.dentry;
++ struct dentry *parent;
++ int bindex, bstart, bend;
++ int err = 0;
++
++ /*
++ * Since mm/memory.c:might_fault() (under PROVE_LOCKING) was
++ * modified in 2.6.29-rc1 to call might_lock_read on mmap_sem, this
++ * has been causing false positives in file system stacking layers.
++ * In particular, our ->mmap is called after sys_mmap2 already holds
++ * mmap_sem, then we lock our own mutexes; but earlier, it's
++ * possible for lockdep to have locked our mutexes first, and then
++ * we call a lower ->readdir which could call might_fault. The
++ * different ordering of the locks is what lockdep complains about
++ * -- unnecessarily. Therefore, we have no choice but to tell
++ * lockdep to temporarily turn off lockdep here. Note: the comments
++ * inside might_sleep also suggest that it would have been
++ * nicer to only annotate paths that needs that might_lock_read.
++ */
++ lockdep_off();
++ unionfs_read_lock(sb, UNIONFS_SMUTEX_PARENT);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ /*
++ * We try to revalidate, but the VFS ignores return return values
++ * from file->release, so we must always try to succeed here,
++ * including to do the kfree and dput below. So if revalidation
++ * failed, all we can do is print some message and keep going.
++ */
++ err = unionfs_file_revalidate(file, parent,
++ UNIONFS_F(file)->wrote_to_file);
++ if (!err)
++ unionfs_check_file(file);
++ fileinfo = UNIONFS_F(file);
++ BUG_ON(file->f_path.dentry->d_inode != inode);
++ inodeinfo = UNIONFS_I(inode);
++
++ /* fput all the lower files */
++ bstart = fbstart(file);
++ bend = fbend(file);
++
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ lower_file = unionfs_lower_file_idx(file, bindex);
++
++ if (lower_file) {
++ unionfs_set_lower_file_idx(file, bindex, NULL);
++ fput(lower_file);
++ branchput(sb, bindex);
++ }
++
++ /* if there are no more refs to the dentry, dput it */
++ if (d_deleted(dentry)) {
++ dput(unionfs_lower_dentry_idx(dentry, bindex));
++ unionfs_set_lower_dentry_idx(dentry, bindex, NULL);
++ }
++ }
++
++ kfree(fileinfo->lower_files);
++ kfree(fileinfo->saved_branch_ids);
++
++ if (fileinfo->rdstate) {
++ fileinfo->rdstate->access = jiffies;
++ spin_lock(&inodeinfo->rdlock);
++ inodeinfo->rdcount++;
++ list_add_tail(&fileinfo->rdstate->cache,
++ &inodeinfo->readdircache);
++ mark_inode_dirty(inode);
++ spin_unlock(&inodeinfo->rdlock);
++ fileinfo->rdstate = NULL;
++ }
++ kfree(fileinfo);
++
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(sb);
++ lockdep_on();
++ return err;
++}
++
++/* pass the ioctl to the lower fs */
++static long do_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
++{
++ struct file *lower_file;
++ int err;
++
++ lower_file = unionfs_lower_file(file);
++
++ err = -ENOTTY;
++ if (!lower_file || !lower_file->f_op)
++ goto out;
++ if (lower_file->f_op->unlocked_ioctl) {
++ err = lower_file->f_op->unlocked_ioctl(lower_file, cmd, arg);
++#ifdef CONFIG_COMPAT
++ } else if (lower_file->f_op->ioctl) {
++ err = lower_file->f_op->compat_ioctl(
++ lower_file->f_path.dentry->d_inode,
++ lower_file, cmd, arg);
++#endif
++ }
++
++out:
++ return err;
++}
++
++/*
++ * return to user-space the branch indices containing the file in question
++ *
++ * We use fd_set and therefore we are limited to the number of the branches
++ * to FD_SETSIZE, which is currently 1024 - plenty for most people
++ */
++static int unionfs_ioctl_queryfile(struct file *file, struct dentry *parent,
++ unsigned int cmd, unsigned long arg)
++{
++ int err = 0;
++ fd_set branchlist;
++ int bstart = 0, bend = 0, bindex = 0;
++ int orig_bstart, orig_bend;
++ struct dentry *dentry, *lower_dentry;
++ struct vfsmount *mnt;
++
++ dentry = file->f_path.dentry;
++ orig_bstart = dbstart(dentry);
++ orig_bend = dbend(dentry);
++ err = unionfs_partial_lookup(dentry, parent);
++ if (err)
++ goto out;
++ bstart = dbstart(dentry);
++ bend = dbend(dentry);
++
++ FD_ZERO(&branchlist);
++
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
++ if (!lower_dentry)
++ continue;
++ if (likely(lower_dentry->d_inode))
++ FD_SET(bindex, &branchlist);
++ /* purge any lower objects after partial_lookup */
++ if (bindex < orig_bstart || bindex > orig_bend) {
++ dput(lower_dentry);
++ unionfs_set_lower_dentry_idx(dentry, bindex, NULL);
++ iput(unionfs_lower_inode_idx(dentry->d_inode, bindex));
++ unionfs_set_lower_inode_idx(dentry->d_inode, bindex,
++ NULL);
++ mnt = unionfs_lower_mnt_idx(dentry, bindex);
++ if (!mnt)
++ continue;
++ unionfs_mntput(dentry, bindex);
++ unionfs_set_lower_mnt_idx(dentry, bindex, NULL);
++ }
++ }
++ /* restore original dentry's offsets */
++ dbstart(dentry) = orig_bstart;
++ dbend(dentry) = orig_bend;
++ ibstart(dentry->d_inode) = orig_bstart;
++ ibend(dentry->d_inode) = orig_bend;
++
++ err = copy_to_user((void __user *)arg, &branchlist, sizeof(fd_set));
++ if (unlikely(err))
++ err = -EFAULT;
++
++out:
++ return err < 0 ? err : bend;
++}
++
++long unionfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
++{
++ long err;
++ struct dentry *dentry = file->f_path.dentry;
++ struct dentry *parent;
++
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_PARENT);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ err = unionfs_file_revalidate(file, parent, true);
++ if (unlikely(err))
++ goto out;
++
++ /* check if asked for local commands */
++ switch (cmd) {
++ case UNIONFS_IOCTL_INCGEN:
++ /* Increment the superblock generation count */
++ pr_info("unionfs: incgen ioctl deprecated; "
++ "use \"-o remount,incgen\"\n");
++ err = -ENOSYS;
++ break;
++
++ case UNIONFS_IOCTL_QUERYFILE:
++ /* Return list of branches containing the given file */
++ err = unionfs_ioctl_queryfile(file, parent, cmd, arg);
++ break;
++
++ default:
++ /* pass the ioctl down */
++ err = do_ioctl(file, cmd, arg);
++ break;
++ }
++
++out:
++ unionfs_check_file(file);
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++ return err;
++}
++
++int unionfs_flush(struct file *file, fl_owner_t id)
++{
++ int err = 0;
++ struct file *lower_file = NULL;
++ struct dentry *dentry = file->f_path.dentry;
++ struct dentry *parent;
++ int bindex, bstart, bend;
++
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_PARENT);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ err = unionfs_file_revalidate(file, parent,
++ UNIONFS_F(file)->wrote_to_file);
++ if (unlikely(err))
++ goto out;
++ unionfs_check_file(file);
++
++ bstart = fbstart(file);
++ bend = fbend(file);
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ lower_file = unionfs_lower_file_idx(file, bindex);
++
++ if (lower_file && lower_file->f_op &&
++ lower_file->f_op->flush) {
++ err = lower_file->f_op->flush(lower_file, id);
++ if (err)
++ goto out;
++ }
++
++ }
++
++out:
++ if (!err)
++ unionfs_check_file(file);
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++ return err;
++}
+diff --git a/fs/unionfs/copyup.c b/fs/unionfs/copyup.c
+new file mode 100644
+index 0000000..37c2654
+--- /dev/null
++++ b/fs/unionfs/copyup.c
+@@ -0,0 +1,896 @@
++/*
++ * Copyright (c) 2003-2011 Erez Zadok
++ * Copyright (c) 2003-2006 Charles P. Wright
++ * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
++ * Copyright (c) 2005-2006 Junjiro Okajima
++ * Copyright (c) 2005 Arun M. Krishnakumar
++ * Copyright (c) 2004-2006 David P. Quigley
++ * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
++ * Copyright (c) 2003 Puja Gupta
++ * Copyright (c) 2003 Harikesavan Krishnan
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
++ *
++ * 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 "union.h"
++
++/*
++ * For detailed explanation of copyup see:
++ * Documentation/filesystems/unionfs/concepts.txt
++ */
++
++#ifdef CONFIG_UNION_FS_XATTR
++/* copyup all extended attrs for a given dentry */
++static int copyup_xattrs(struct dentry *old_lower_dentry,
++ struct dentry *new_lower_dentry)
++{
++ int err = 0;
++ ssize_t list_size = -1;
++ char *name_list = NULL;
++ char *attr_value = NULL;
++ char *name_list_buf = NULL;
++
++ /* query the actual size of the xattr list */
++ list_size = vfs_listxattr(old_lower_dentry, NULL, 0);
++ if (list_size <= 0) {
++ err = list_size;
++ goto out;
++ }
++
++ /* allocate space for the actual list */
++ name_list = unionfs_xattr_alloc(list_size + 1, XATTR_LIST_MAX);
++ if (unlikely(!name_list || IS_ERR(name_list))) {
++ err = PTR_ERR(name_list);
++ goto out;
++ }
++
++ name_list_buf = name_list; /* save for kfree at end */
++
++ /* now get the actual xattr list of the source file */
++ list_size = vfs_listxattr(old_lower_dentry, name_list, list_size);
++ if (list_size <= 0) {
++ err = list_size;
++ goto out;
++ }
++
++ /* allocate space to hold each xattr's value */
++ attr_value = unionfs_xattr_alloc(XATTR_SIZE_MAX, XATTR_SIZE_MAX);
++ if (unlikely(!attr_value || IS_ERR(attr_value))) {
++ err = PTR_ERR(name_list);
++ goto out;
++ }
++
++ /* in a loop, get and set each xattr from src to dst file */
++ while (*name_list) {
++ ssize_t size;
++
++ /* Lock here since vfs_getxattr doesn't lock for us */
++ mutex_lock(&old_lower_dentry->d_inode->i_mutex);
++ size = vfs_getxattr(old_lower_dentry, name_list,
++ attr_value, XATTR_SIZE_MAX);
++ mutex_unlock(&old_lower_dentry->d_inode->i_mutex);
++ if (size < 0) {
++ err = size;
++ goto out;
++ }
++ if (size > XATTR_SIZE_MAX) {
++ err = -E2BIG;
++ goto out;
++ }
++ /* Don't lock here since vfs_setxattr does it for us. */
++ err = vfs_setxattr(new_lower_dentry, name_list, attr_value,
++ size, 0);
++ /*
++ * Selinux depends on "security.*" xattrs, so to maintain
++ * the security of copied-up files, if Selinux is active,
++ * then we must copy these xattrs as well. So we need to
++ * temporarily get FOWNER privileges.
++ * XXX: move entire copyup code to SIOQ.
++ */
++ if (err == -EPERM && !capable(CAP_FOWNER)) {
++ const struct cred *old_creds;
++ struct cred *new_creds;
++
++ new_creds = prepare_creds();
++ if (unlikely(!new_creds)) {
++ err = -ENOMEM;
++ goto out;
++ }
++ cap_raise(new_creds->cap_effective, CAP_FOWNER);
++ old_creds = override_creds(new_creds);
++ err = vfs_setxattr(new_lower_dentry, name_list,
++ attr_value, size, 0);
++ revert_creds(old_creds);
++ }
++ if (err < 0)
++ goto out;
++ name_list += strlen(name_list) + 1;
++ }
++out:
++ unionfs_xattr_kfree(name_list_buf);
++ unionfs_xattr_kfree(attr_value);
++ /* Ignore if xattr isn't supported */
++ if (err == -ENOTSUPP || err == -EOPNOTSUPP)
++ err = 0;
++ return err;
++}
++#endif /* CONFIG_UNION_FS_XATTR */
++
++/*
++ * Determine the mode based on the copyup flags, and the existing dentry.
++ *
++ * Handle file systems which may not support certain options. For example
++ * jffs2 doesn't allow one to chmod a symlink. So we ignore such harmless
++ * errors, rather than propagating them up, which results in copyup errors
++ * and errors returned back to users.
++ */
++static int copyup_permissions(struct super_block *sb,
++ struct dentry *old_lower_dentry,
++ struct dentry *new_lower_dentry)
++{
++ struct inode *i = old_lower_dentry->d_inode;
++ struct iattr newattrs;
++ int err;
++
++ newattrs.ia_atime = i->i_atime;
++ newattrs.ia_mtime = i->i_mtime;
++ newattrs.ia_ctime = i->i_ctime;
++ newattrs.ia_gid = i->i_gid;
++ newattrs.ia_uid = i->i_uid;
++ newattrs.ia_valid = ATTR_CTIME | ATTR_ATIME | ATTR_MTIME |
++ ATTR_ATIME_SET | ATTR_MTIME_SET | ATTR_FORCE |
++ ATTR_GID | ATTR_UID;
++ mutex_lock(&new_lower_dentry->d_inode->i_mutex);
++ err = notify_change(new_lower_dentry, &newattrs);
++ if (err)
++ goto out;
++
++ /* now try to change the mode and ignore EOPNOTSUPP on symlinks */
++ newattrs.ia_mode = i->i_mode;
++ newattrs.ia_valid = ATTR_MODE | ATTR_FORCE;
++ err = notify_change(new_lower_dentry, &newattrs);
++ if (err == -EOPNOTSUPP &&
++ S_ISLNK(new_lower_dentry->d_inode->i_mode)) {
++ printk(KERN_WARNING
++ "unionfs: changing \"%s\" symlink mode unsupported\n",
++ new_lower_dentry->d_name.name);
++ err = 0;
++ }
++
++out:
++ mutex_unlock(&new_lower_dentry->d_inode->i_mutex);
++ return err;
++}
++
++/*
++ * create the new device/file/directory - use copyup_permission to copyup
++ * times, and mode
++ *
++ * if the object being copied up is a regular file, the file is only created,
++ * the contents have to be copied up separately
++ */
++static int __copyup_ndentry(struct dentry *old_lower_dentry,
++ struct dentry *new_lower_dentry,
++ struct dentry *new_lower_parent_dentry,
++ char *symbuf)
++{
++ int err = 0;
++ umode_t old_mode = old_lower_dentry->d_inode->i_mode;
++ struct sioq_args args;
++
++ if (S_ISDIR(old_mode)) {
++ args.mkdir.parent = new_lower_parent_dentry->d_inode;
++ args.mkdir.dentry = new_lower_dentry;
++ args.mkdir.mode = old_mode;
++
++ run_sioq(__unionfs_mkdir, &args);
++ err = args.err;
++ } else if (S_ISLNK(old_mode)) {
++ args.symlink.parent = new_lower_parent_dentry->d_inode;
++ args.symlink.dentry = new_lower_dentry;
++ args.symlink.symbuf = symbuf;
++
++ run_sioq(__unionfs_symlink, &args);
++ err = args.err;
++ } else if (S_ISBLK(old_mode) || S_ISCHR(old_mode) ||
++ S_ISFIFO(old_mode) || S_ISSOCK(old_mode)) {
++ args.mknod.parent = new_lower_parent_dentry->d_inode;
++ args.mknod.dentry = new_lower_dentry;
++ args.mknod.mode = old_mode;
++ args.mknod.dev = old_lower_dentry->d_inode->i_rdev;
++
++ run_sioq(__unionfs_mknod, &args);
++ err = args.err;
++ } else if (S_ISREG(old_mode)) {
++ struct nameidata nd;
++ err = init_lower_nd(&nd, LOOKUP_CREATE);
++ if (unlikely(err < 0))
++ goto out;
++ args.create.nd = &nd;
++ args.create.parent = new_lower_parent_dentry->d_inode;
++ args.create.dentry = new_lower_dentry;
++ args.create.mode = old_mode;
++
++ run_sioq(__unionfs_create, &args);
++ err = args.err;
++ release_lower_nd(&nd, err);
++ } else {
++ printk(KERN_CRIT "unionfs: unknown inode type %d\n",
++ old_mode);
++ BUG();
++ }
++
++out:
++ return err;
++}
++
++static int __copyup_reg_data(struct dentry *dentry,
++ struct dentry *new_lower_dentry, int new_bindex,
++ struct dentry *old_lower_dentry, int old_bindex,
++ struct file **copyup_file, loff_t len)
++{
++ struct super_block *sb = dentry->d_sb;
++ struct file *input_file;
++ struct file *output_file;
++ struct vfsmount *output_mnt;
++ mm_segment_t old_fs;
++ char *buf = NULL;
++ ssize_t read_bytes, write_bytes;
++ loff_t size;
++ int err = 0;
++
++ /* open old file */
++ unionfs_mntget(dentry, old_bindex);
++ branchget(sb, old_bindex);
++ /* dentry_open calls dput and mntput if it returns an error */
++ input_file = dentry_open(old_lower_dentry,
++ unionfs_lower_mnt_idx(dentry, old_bindex),
++ O_RDONLY | O_LARGEFILE, current_cred());
++ if (IS_ERR(input_file)) {
++ dput(old_lower_dentry);
++ err = PTR_ERR(input_file);
++ goto out;
++ }
++ if (unlikely(!input_file->f_op || !input_file->f_op->read)) {
++ err = -EINVAL;
++ goto out_close_in;
++ }
++
++ /* open new file */
++ dget(new_lower_dentry);
++ output_mnt = unionfs_mntget(sb->s_root, new_bindex);
++ branchget(sb, new_bindex);
++ output_file = dentry_open(new_lower_dentry, output_mnt,
++ O_RDWR | O_LARGEFILE, current_cred());
++ if (IS_ERR(output_file)) {
++ err = PTR_ERR(output_file);
++ goto out_close_in2;
++ }
++ if (unlikely(!output_file->f_op || !output_file->f_op->write)) {
++ err = -EINVAL;
++ goto out_close_out;
++ }
++
++ /* allocating a buffer */
++ buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
++ if (unlikely(!buf)) {
++ err = -ENOMEM;
++ goto out_close_out;
++ }
++
++ input_file->f_pos = 0;
++ output_file->f_pos = 0;
++
++ old_fs = get_fs();
++ set_fs(KERNEL_DS);
++
++ size = len;
++ err = 0;
++ do {
++ if (len >= PAGE_SIZE)
++ size = PAGE_SIZE;
++ else if ((len < PAGE_SIZE) && (len > 0))
++ size = len;
++
++ len -= PAGE_SIZE;
++
++ read_bytes =
++ input_file->f_op->read(input_file,
++ (char __user *)buf, size,
++ &input_file->f_pos);
++ if (read_bytes <= 0) {
++ err = read_bytes;
++ break;
++ }
++
++ /* see Documentation/filesystems/unionfs/issues.txt */
++ lockdep_off();
++ write_bytes =
++ output_file->f_op->write(output_file,
++ (char __user *)buf,
++ read_bytes,
++ &output_file->f_pos);
++ lockdep_on();
++ if ((write_bytes < 0) || (write_bytes < read_bytes)) {
++ err = write_bytes;
++ break;
++ }
++ } while ((read_bytes > 0) && (len > 0));
++
++ set_fs(old_fs);
++
++ kfree(buf);
++
++ if (!err)
++ err = output_file->f_op->fsync(output_file, 0);
++
++ if (err)
++ goto out_close_out;
++
++ if (copyup_file) {
++ *copyup_file = output_file;
++ goto out_close_in;
++ }
++
++out_close_out:
++ fput(output_file);
++
++out_close_in2:
++ branchput(sb, new_bindex);
++
++out_close_in:
++ fput(input_file);
++
++out:
++ branchput(sb, old_bindex);
++
++ return err;
++}
++
++/*
++ * dput the lower references for old and new dentry & clear a lower dentry
++ * pointer
++ */
++static void __clear(struct dentry *dentry, struct dentry *old_lower_dentry,
++ int old_bstart, int old_bend,
++ struct dentry *new_lower_dentry, int new_bindex)
++{
++ /* get rid of the lower dentry and all its traces */
++ unionfs_set_lower_dentry_idx(dentry, new_bindex, NULL);
++ dbstart(dentry) = old_bstart;
++ dbend(dentry) = old_bend;
++
++ dput(new_lower_dentry);
++ dput(old_lower_dentry);
++}
++
++/*
++ * Copy up a dentry to a file of specified name.
++ *
++ * @dir: used to pull the ->i_sb to access other branches
++ * @dentry: the non-negative dentry whose lower_inode we should copy
++ * @bstart: the branch of the lower_inode to copy from
++ * @new_bindex: the branch to create the new file in
++ * @name: the name of the file to create
++ * @namelen: length of @name
++ * @copyup_file: the "struct file" to return (optional)
++ * @len: how many bytes to copy-up?
++ */
++int copyup_dentry(struct inode *dir, struct dentry *dentry, int bstart,
++ int new_bindex, const char *name, int namelen,
++ struct file **copyup_file, loff_t len)
++{
++ struct dentry *new_lower_dentry;
++ struct dentry *old_lower_dentry = NULL;
++ struct super_block *sb;
++ int err = 0;
++ int old_bindex;
++ int old_bstart;
++ int old_bend;
++ struct dentry *new_lower_parent_dentry = NULL;
++ mm_segment_t oldfs;
++ char *symbuf = NULL;
++
++ verify_locked(dentry);
++
++ old_bindex = bstart;
++ old_bstart = dbstart(dentry);
++ old_bend = dbend(dentry);
++
++ BUG_ON(new_bindex < 0);
++ BUG_ON(new_bindex >= old_bindex);
++
++ sb = dir->i_sb;
++
++ err = is_robranch_super(sb, new_bindex);
++ if (err)
++ goto out;
++
++ /* Create the directory structure above this dentry. */
++ new_lower_dentry = create_parents(dir, dentry, name, new_bindex);
++ if (IS_ERR(new_lower_dentry)) {
++ err = PTR_ERR(new_lower_dentry);
++ goto out;
++ }
++
++ old_lower_dentry = unionfs_lower_dentry_idx(dentry, old_bindex);
++ /* we conditionally dput this old_lower_dentry at end of function */
++ dget(old_lower_dentry);
++
++ /* For symlinks, we must read the link before we lock the directory. */
++ if (S_ISLNK(old_lower_dentry->d_inode->i_mode)) {
++
++ symbuf = kmalloc(PATH_MAX, GFP_KERNEL);
++ if (unlikely(!symbuf)) {
++ __clear(dentry, old_lower_dentry,
++ old_bstart, old_bend,
++ new_lower_dentry, new_bindex);
++ err = -ENOMEM;
++ goto out_free;
++ }
++
++ oldfs = get_fs();
++ set_fs(KERNEL_DS);
++ err = old_lower_dentry->d_inode->i_op->readlink(
++ old_lower_dentry,
++ (char __user *)symbuf,
++ PATH_MAX);
++ set_fs(oldfs);
++ if (err < 0) {
++ __clear(dentry, old_lower_dentry,
++ old_bstart, old_bend,
++ new_lower_dentry, new_bindex);
++ goto out_free;
++ }
++ symbuf[err] = '\0';
++ }
++
++ /* Now we lock the parent, and create the object in the new branch. */
++ new_lower_parent_dentry = lock_parent(new_lower_dentry);
++
++ /* create the new inode */
++ err = __copyup_ndentry(old_lower_dentry, new_lower_dentry,
++ new_lower_parent_dentry, symbuf);
++
++ if (err) {
++ __clear(dentry, old_lower_dentry,
++ old_bstart, old_bend,
++ new_lower_dentry, new_bindex);
++ goto out_unlock;
++ }
++
++ /* We actually copyup the file here. */
++ if (S_ISREG(old_lower_dentry->d_inode->i_mode))
++ err = __copyup_reg_data(dentry, new_lower_dentry, new_bindex,
++ old_lower_dentry, old_bindex,
++ copyup_file, len);
++ if (err)
++ goto out_unlink;
++
++ /* Set permissions. */
++ err = copyup_permissions(sb, old_lower_dentry, new_lower_dentry);
++ if (err)
++ goto out_unlink;
++
++#ifdef CONFIG_UNION_FS_XATTR
++ /* Selinux uses extended attributes for permissions. */
++ err = copyup_xattrs(old_lower_dentry, new_lower_dentry);
++ if (err)
++ goto out_unlink;
++#endif /* CONFIG_UNION_FS_XATTR */
++
++ /* do not allow files getting deleted to be re-interposed */
++ if (!d_deleted(dentry))
++ unionfs_reinterpose(dentry);
++
++ goto out_unlock;
++
++out_unlink:
++ /*
++ * copyup failed, because we possibly ran out of space or
++ * quota, or something else happened so let's unlink; we don't
++ * really care about the return value of vfs_unlink
++ */
++ vfs_unlink(new_lower_parent_dentry->d_inode, new_lower_dentry);
++
++ if (copyup_file) {
++ /* need to close the file */
++
++ fput(*copyup_file);
++ branchput(sb, new_bindex);
++ }
++
++ /*
++ * TODO: should we reset the error to something like -EIO?
++ *
++ * If we don't reset, the user may get some nonsensical errors, but
++ * on the other hand, if we reset to EIO, we guarantee that the user
++ * will get a "confusing" error message.
++ */
++
++out_unlock:
++ unlock_dir(new_lower_parent_dentry);
++
++out_free:
++ /*
++ * If old_lower_dentry was not a file, then we need to dput it. If
++ * it was a file, then it was already dput indirectly by other
++ * functions we call above which operate on regular files.
++ */
++ if (old_lower_dentry && old_lower_dentry->d_inode &&
++ !S_ISREG(old_lower_dentry->d_inode->i_mode))
++ dput(old_lower_dentry);
++ kfree(symbuf);
++
++ if (err) {
++ /*
++ * if directory creation succeeded, but inode copyup failed,
++ * then purge new dentries.
++ */
++ if (dbstart(dentry) < old_bstart &&
++ ibstart(dentry->d_inode) > dbstart(dentry))
++ __clear(dentry, NULL, old_bstart, old_bend,
++ unionfs_lower_dentry(dentry), dbstart(dentry));
++ goto out;
++ }
++ if (!S_ISDIR(dentry->d_inode->i_mode)) {
++ unionfs_postcopyup_release(dentry);
++ if (!unionfs_lower_inode(dentry->d_inode)) {
++ /*
++ * If we got here, then we copied up to an
++ * unlinked-open file, whose name is .unionfsXXXXX.
++ */
++ struct inode *inode = new_lower_dentry->d_inode;
++ atomic_inc(&inode->i_count);
++ unionfs_set_lower_inode_idx(dentry->d_inode,
++ ibstart(dentry->d_inode),
++ inode);
++ }
++ }
++ unionfs_postcopyup_setmnt(dentry);
++ /* sync inode times from copied-up inode to our inode */
++ unionfs_copy_attr_times(dentry->d_inode);
++ unionfs_check_inode(dir);
++ unionfs_check_dentry(dentry);
++out:
++ return err;
++}
++
++/*
++ * This function creates a copy of a file represented by 'file' which
++ * currently resides in branch 'bstart' to branch 'new_bindex.' The copy
++ * will be named "name".
++ */
++int copyup_named_file(struct inode *dir, struct file *file, char *name,
++ int bstart, int new_bindex, loff_t len)
++{
++ int err = 0;
++ struct file *output_file = NULL;
++
++ err = copyup_dentry(dir, file->f_path.dentry, bstart, new_bindex,
++ name, strlen(name), &output_file, len);
++ if (!err) {
++ fbstart(file) = new_bindex;
++ unionfs_set_lower_file_idx(file, new_bindex, output_file);
++ }
++
++ return err;
++}
++
++/*
++ * This function creates a copy of a file represented by 'file' which
++ * currently resides in branch 'bstart' to branch 'new_bindex'.
++ */
++int copyup_file(struct inode *dir, struct file *file, int bstart,
++ int new_bindex, loff_t len)
++{
++ int err = 0;
++ struct file *output_file = NULL;
++ struct dentry *dentry = file->f_path.dentry;
++
++ err = copyup_dentry(dir, dentry, bstart, new_bindex,
++ dentry->d_name.name, dentry->d_name.len,
++ &output_file, len);
++ if (!err) {
++ fbstart(file) = new_bindex;
++ unionfs_set_lower_file_idx(file, new_bindex, output_file);
++ }
++
++ return err;
++}
++
++/* purge a dentry's lower-branch states (dput/mntput, etc.) */
++static void __cleanup_dentry(struct dentry *dentry, int bindex,
++ int old_bstart, int old_bend)
++{
++ int loop_start;
++ int loop_end;
++ int new_bstart = -1;
++ int new_bend = -1;
++ int i;
++
++ loop_start = min(old_bstart, bindex);
++ loop_end = max(old_bend, bindex);
++
++ /*
++ * This loop sets the bstart and bend for the new dentry by
++ * traversing from left to right. It also dputs all negative
++ * dentries except bindex
++ */
++ for (i = loop_start; i <= loop_end; i++) {
++ if (!unionfs_lower_dentry_idx(dentry, i))
++ continue;
++
++ if (i == bindex) {
++ new_bend = i;
++ if (new_bstart < 0)
++ new_bstart = i;
++ continue;
++ }
++
++ if (!unionfs_lower_dentry_idx(dentry, i)->d_inode) {
++ dput(unionfs_lower_dentry_idx(dentry, i));
++ unionfs_set_lower_dentry_idx(dentry, i, NULL);
++
++ unionfs_mntput(dentry, i);
++ unionfs_set_lower_mnt_idx(dentry, i, NULL);
++ } else {
++ if (new_bstart < 0)
++ new_bstart = i;
++ new_bend = i;
++ }
++ }
++
++ if (new_bstart < 0)
++ new_bstart = bindex;
++ if (new_bend < 0)
++ new_bend = bindex;
++ dbstart(dentry) = new_bstart;
++ dbend(dentry) = new_bend;
++
++}
++
++/* set lower inode ptr and update bstart & bend if necessary */
++static void __set_inode(struct dentry *upper, struct dentry *lower,
++ int bindex)
++{
++ unionfs_set_lower_inode_idx(upper->d_inode, bindex,
++ igrab(lower->d_inode));
++ if (likely(ibstart(upper->d_inode) > bindex))
++ ibstart(upper->d_inode) = bindex;
++ if (likely(ibend(upper->d_inode) < bindex))
++ ibend(upper->d_inode) = bindex;
++
++}
++
++/* set lower dentry ptr and update bstart & bend if necessary */
++static void __set_dentry(struct dentry *upper, struct dentry *lower,
++ int bindex)
++{
++ unionfs_set_lower_dentry_idx(upper, bindex, lower);
++ if (likely(dbstart(upper) > bindex))
++ dbstart(upper) = bindex;
++ if (likely(dbend(upper) < bindex))
++ dbend(upper) = bindex;
++}
++
++/*
++ * This function replicates the directory structure up-to given dentry
++ * in the bindex branch.
++ */
++struct dentry *create_parents(struct inode *dir, struct dentry *dentry,
++ const char *name, int bindex)
++{
++ int err;
++ struct dentry *child_dentry;
++ struct dentry *parent_dentry;
++ struct dentry *lower_parent_dentry = NULL;
++ struct dentry *lower_dentry = NULL;
++ const char *childname;
++ unsigned int childnamelen;
++ int nr_dentry;
++ int count = 0;
++ int old_bstart;
++ int old_bend;
++ struct dentry **path = NULL;
++ struct super_block *sb;
++
++ verify_locked(dentry);
++
++ err = is_robranch_super(dir->i_sb, bindex);
++ if (err) {
++ lower_dentry = ERR_PTR(err);
++ goto out;
++ }
++
++ old_bstart = dbstart(dentry);
++ old_bend = dbend(dentry);
++
++ lower_dentry = ERR_PTR(-ENOMEM);
++
++ /* There is no sense allocating any less than the minimum. */
++ nr_dentry = 1;
++ path = kmalloc(nr_dentry * sizeof(struct dentry *), GFP_KERNEL);
++ if (unlikely(!path))
++ goto out;
++
++ /* assume the negative dentry of unionfs as the parent dentry */
++ parent_dentry = dentry;
++
++ /*
++ * This loop finds the first parent that exists in the given branch.
++ * We start building the directory structure from there. At the end
++ * of the loop, the following should hold:
++ * - child_dentry is the first nonexistent child
++ * - parent_dentry is the first existent parent
++ * - path[0] is the = deepest child
++ * - path[count] is the first child to create
++ */
++ do {
++ child_dentry = parent_dentry;
++
++ /* find the parent directory dentry in unionfs */
++ parent_dentry = dget_parent(child_dentry);
++
++ /* find out the lower_parent_dentry in the given branch */
++ lower_parent_dentry =
++ unionfs_lower_dentry_idx(parent_dentry, bindex);
++
++ /* grow path table */
++ if (count == nr_dentry) {
++ void *p;
++
++ nr_dentry *= 2;
++ p = krealloc(path, nr_dentry * sizeof(struct dentry *),
++ GFP_KERNEL);
++ if (unlikely(!p)) {
++ lower_dentry = ERR_PTR(-ENOMEM);
++ goto out;
++ }
++ path = p;
++ }
++
++ /* store the child dentry */
++ path[count++] = child_dentry;
++ } while (!lower_parent_dentry);
++ count--;
++
++ sb = dentry->d_sb;
++
++ /*
++ * This code goes between the begin/end labels and basically
++ * emulates a while(child_dentry != dentry), only cleaner and
++ * shorter than what would be a much longer while loop.
++ */
++begin:
++ /* get lower parent dir in the current branch */
++ lower_parent_dentry = unionfs_lower_dentry_idx(parent_dentry, bindex);
++ dput(parent_dentry);
++
++ /* init the values to lookup */
++ childname = child_dentry->d_name.name;
++ childnamelen = child_dentry->d_name.len;
++
++ if (child_dentry != dentry) {
++ /* lookup child in the underlying file system */
++ lower_dentry = lookup_lck_len(childname, lower_parent_dentry,
++ childnamelen);
++ if (IS_ERR(lower_dentry))
++ goto out;
++ } else {
++ /*
++ * Is the name a whiteout of the child name ? lookup the
++ * whiteout child in the underlying file system
++ */
++ lower_dentry = lookup_lck_len(name, lower_parent_dentry,
++ strlen(name));
++ if (IS_ERR(lower_dentry))
++ goto out;
++
++ /* Replace the current dentry (if any) with the new one */
++ dput(unionfs_lower_dentry_idx(dentry, bindex));
++ unionfs_set_lower_dentry_idx(dentry, bindex,
++ lower_dentry);
++
++ __cleanup_dentry(dentry, bindex, old_bstart, old_bend);
++ goto out;
++ }
++
++ if (lower_dentry->d_inode) {
++ /*
++ * since this already exists we dput to avoid
++ * multiple references on the same dentry
++ */
++ dput(lower_dentry);
++ } else {
++ struct sioq_args args;
++
++ /* it's a negative dentry, create a new dir */
++ lower_parent_dentry = lock_parent(lower_dentry);
++
++ args.mkdir.parent = lower_parent_dentry->d_inode;
++ args.mkdir.dentry = lower_dentry;
++ args.mkdir.mode = child_dentry->d_inode->i_mode;
++
++ run_sioq(__unionfs_mkdir, &args);
++ err = args.err;
++
++ if (!err)
++ err = copyup_permissions(dir->i_sb, child_dentry,
++ lower_dentry);
++ unlock_dir(lower_parent_dentry);
++ if (err) {
++ dput(lower_dentry);
++ lower_dentry = ERR_PTR(err);
++ goto out;
++ }
++
++ }
++
++ __set_inode(child_dentry, lower_dentry, bindex);
++ __set_dentry(child_dentry, lower_dentry, bindex);
++ /*
++ * update times of this dentry, but also the parent, because if
++ * we changed, the parent may have changed too.
++ */
++ fsstack_copy_attr_times(parent_dentry->d_inode,
++ lower_parent_dentry->d_inode);
++ unionfs_copy_attr_times(child_dentry->d_inode);
++
++ parent_dentry = child_dentry;
++ child_dentry = path[--count];
++ goto begin;
++out:
++ /* cleanup any leftover locks from the do/while loop above */
++ if (IS_ERR(lower_dentry))
++ while (count)
++ dput(path[count--]);
++ kfree(path);
++ return lower_dentry;
++}
++
++/*
++ * Post-copyup helper to ensure we have valid mnts: set lower mnt of
++ * dentry+parents to the first parent node that has an mnt.
++ */
++void unionfs_postcopyup_setmnt(struct dentry *dentry)
++{
++ struct dentry *parent, *hasone;
++ int bindex = dbstart(dentry);
++
++ if (unionfs_lower_mnt_idx(dentry, bindex))
++ return;
++ hasone = dentry->d_parent;
++ /* this loop should stop at root dentry */
++ while (!unionfs_lower_mnt_idx(hasone, bindex))
++ hasone = hasone->d_parent;
++ parent = dentry;
++ while (!unionfs_lower_mnt_idx(parent, bindex)) {
++ unionfs_set_lower_mnt_idx(parent, bindex,
++ unionfs_mntget(hasone, bindex));
++ parent = parent->d_parent;
++ }
++}
++
++/*
++ * Post-copyup helper to release all non-directory source objects of a
++ * copied-up file. Regular files should have only one lower object.
++ */
++void unionfs_postcopyup_release(struct dentry *dentry)
++{
++ int bstart, bend;
++
++ BUG_ON(S_ISDIR(dentry->d_inode->i_mode));
++ bstart = dbstart(dentry);
++ bend = dbend(dentry);
++
++ path_put_lowers(dentry, bstart + 1, bend, false);
++ iput_lowers(dentry->d_inode, bstart + 1, bend, false);
++
++ dbend(dentry) = bstart;
++ ibend(dentry->d_inode) = ibstart(dentry->d_inode) = bstart;
++}
+diff --git a/fs/unionfs/debug.c b/fs/unionfs/debug.c
+new file mode 100644
+index 0000000..6092e69
+--- /dev/null
++++ b/fs/unionfs/debug.c
+@@ -0,0 +1,548 @@
++/*
++ * Copyright (c) 2003-2011 Erez Zadok
++ * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
++ *
++ * 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 "union.h"
++
++/*
++ * Helper debugging functions for maintainers (and for users to report back
++ * useful information back to maintainers)
++ */
++
++/* it's always useful to know what part of the code called us */
++#define PRINT_CALLER(fname, fxn, line) \
++ do { \
++ if (!printed_caller) { \
++ pr_debug("PC:%s:%s:%d\n", (fname), (fxn), (line)); \
++ printed_caller = 1; \
++ } \
++ } while (0)
++
++/*
++ * __unionfs_check_{inode,dentry,file} perform exhaustive sanity checking on
++ * the fan-out of various Unionfs objects. We check that no lower objects
++ * exist outside the start/end branch range; that all objects within are
++ * non-NULL (with some allowed exceptions); that for every lower file
++ * there's a lower dentry+inode; that the start/end ranges match for all
++ * corresponding lower objects; that open files/symlinks have only one lower
++ * objects, but directories can have several; and more.
++ */
++void __unionfs_check_inode(const struct inode *inode,
++ const char *fname, const char *fxn, int line)
++{
++ int bindex;
++ int istart, iend;
++ struct inode *lower_inode;
++ struct super_block *sb;
++ int printed_caller = 0;
++ void *poison_ptr;
++
++ /* for inodes now */
++ BUG_ON(!inode);
++ sb = inode->i_sb;
++ istart = ibstart(inode);
++ iend = ibend(inode);
++ /* don't check inode if no lower branches */
++ if (istart < 0 && iend < 0)
++ return;
++ if (unlikely(istart > iend)) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" Ci0: inode=%p istart/end=%d:%d\n",
++ inode, istart, iend);
++ }
++ if (unlikely((istart == -1 && iend != -1) ||
++ (istart != -1 && iend == -1))) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" Ci1: inode=%p istart/end=%d:%d\n",
++ inode, istart, iend);
++ }
++ if (!S_ISDIR(inode->i_mode)) {
++ if (unlikely(iend != istart)) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" Ci2: inode=%p istart=%d iend=%d\n",
++ inode, istart, iend);
++ }
++ }
++
++ for (bindex = sbstart(sb); bindex < sbmax(sb); bindex++) {
++ if (unlikely(!UNIONFS_I(inode))) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" Ci3: no inode_info %p\n", inode);
++ return;
++ }
++ if (unlikely(!UNIONFS_I(inode)->lower_inodes)) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" Ci4: no lower_inodes %p\n", inode);
++ return;
++ }
++ lower_inode = unionfs_lower_inode_idx(inode, bindex);
++ if (lower_inode) {
++ memset(&poison_ptr, POISON_INUSE, sizeof(void *));
++ if (unlikely(bindex < istart || bindex > iend)) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" Ci5: inode/linode=%p:%p bindex=%d "
++ "istart/end=%d:%d\n", inode,
++ lower_inode, bindex, istart, iend);
++ } else if (unlikely(lower_inode == poison_ptr)) {
++ /* freed inode! */
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" Ci6: inode/linode=%p:%p bindex=%d "
++ "istart/end=%d:%d\n", inode,
++ lower_inode, bindex, istart, iend);
++ }
++ continue;
++ }
++ /* if we get here, then lower_inode == NULL */
++ if (bindex < istart || bindex > iend)
++ continue;
++ /*
++ * directories can have NULL lower inodes in b/t start/end,
++ * but NOT if at the start/end range.
++ */
++ if (unlikely(S_ISDIR(inode->i_mode) &&
++ bindex > istart && bindex < iend))
++ continue;
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" Ci7: inode/linode=%p:%p "
++ "bindex=%d istart/end=%d:%d\n",
++ inode, lower_inode, bindex, istart, iend);
++ }
++}
++
++void __unionfs_check_dentry(const struct dentry *dentry,
++ const char *fname, const char *fxn, int line)
++{
++ int bindex;
++ int dstart, dend, istart, iend;
++ struct dentry *lower_dentry;
++ struct inode *inode, *lower_inode;
++ struct super_block *sb;
++ struct vfsmount *lower_mnt;
++ int printed_caller = 0;
++ void *poison_ptr;
++
++ BUG_ON(!dentry);
++ sb = dentry->d_sb;
++ inode = dentry->d_inode;
++ dstart = dbstart(dentry);
++ dend = dbend(dentry);
++ /* don't check dentry/mnt if no lower branches */
++ if (dstart < 0 && dend < 0)
++ goto check_inode;
++ BUG_ON(dstart > dend);
++
++ if (unlikely((dstart == -1 && dend != -1) ||
++ (dstart != -1 && dend == -1))) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" CD0: dentry=%p dstart/end=%d:%d\n",
++ dentry, dstart, dend);
++ }
++ /*
++ * check for NULL dentries inside the start/end range, or
++ * non-NULL dentries outside the start/end range.
++ */
++ for (bindex = sbstart(sb); bindex < sbmax(sb); bindex++) {
++ lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
++ if (lower_dentry) {
++ if (unlikely(bindex < dstart || bindex > dend)) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" CD1: dentry/lower=%p:%p(%p) "
++ "bindex=%d dstart/end=%d:%d\n",
++ dentry, lower_dentry,
++ (lower_dentry ? lower_dentry->d_inode :
++ (void *) -1L),
++ bindex, dstart, dend);
++ }
++ } else { /* lower_dentry == NULL */
++ if (bindex < dstart || bindex > dend)
++ continue;
++ /*
++ * Directories can have NULL lower inodes in b/t
++ * start/end, but NOT if at the start/end range.
++ * Ignore this rule, however, if this is a NULL
++ * dentry or a deleted dentry.
++ */
++ if (unlikely(!d_deleted((struct dentry *) dentry) &&
++ inode &&
++ !(inode && S_ISDIR(inode->i_mode) &&
++ bindex > dstart && bindex < dend))) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" CD2: dentry/lower=%p:%p(%p) "
++ "bindex=%d dstart/end=%d:%d\n",
++ dentry, lower_dentry,
++ (lower_dentry ?
++ lower_dentry->d_inode :
++ (void *) -1L),
++ bindex, dstart, dend);
++ }
++ }
++ }
++
++ /* check for vfsmounts same as for dentries */
++ for (bindex = sbstart(sb); bindex < sbmax(sb); bindex++) {
++ lower_mnt = unionfs_lower_mnt_idx(dentry, bindex);
++ if (lower_mnt) {
++ if (unlikely(bindex < dstart || bindex > dend)) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" CM0: dentry/lmnt=%p:%p bindex=%d "
++ "dstart/end=%d:%d\n", dentry,
++ lower_mnt, bindex, dstart, dend);
++ }
++ } else { /* lower_mnt == NULL */
++ if (bindex < dstart || bindex > dend)
++ continue;
++ /*
++ * Directories can have NULL lower inodes in b/t
++ * start/end, but NOT if at the start/end range.
++ * Ignore this rule, however, if this is a NULL
++ * dentry.
++ */
++ if (unlikely(inode &&
++ !(inode && S_ISDIR(inode->i_mode) &&
++ bindex > dstart && bindex < dend))) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" CM1: dentry/lmnt=%p:%p "
++ "bindex=%d dstart/end=%d:%d\n",
++ dentry, lower_mnt, bindex,
++ dstart, dend);
++ }
++ }
++ }
++
++check_inode:
++ /* for inodes now */
++ if (!inode)
++ return;
++ istart = ibstart(inode);
++ iend = ibend(inode);
++ /* don't check inode if no lower branches */
++ if (istart < 0 && iend < 0)
++ return;
++ BUG_ON(istart > iend);
++ if (unlikely((istart == -1 && iend != -1) ||
++ (istart != -1 && iend == -1))) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" CI0: dentry/inode=%p:%p istart/end=%d:%d\n",
++ dentry, inode, istart, iend);
++ }
++ if (unlikely(istart != dstart)) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" CI1: dentry/inode=%p:%p istart=%d dstart=%d\n",
++ dentry, inode, istart, dstart);
++ }
++ if (unlikely(iend != dend)) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" CI2: dentry/inode=%p:%p iend=%d dend=%d\n",
++ dentry, inode, iend, dend);
++ }
++
++ if (!S_ISDIR(inode->i_mode)) {
++ if (unlikely(dend != dstart)) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" CI3: dentry/inode=%p:%p dstart=%d dend=%d\n",
++ dentry, inode, dstart, dend);
++ }
++ if (unlikely(iend != istart)) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" CI4: dentry/inode=%p:%p istart=%d iend=%d\n",
++ dentry, inode, istart, iend);
++ }
++ }
++
++ for (bindex = sbstart(sb); bindex < sbmax(sb); bindex++) {
++ lower_inode = unionfs_lower_inode_idx(inode, bindex);
++ if (lower_inode) {
++ memset(&poison_ptr, POISON_INUSE, sizeof(void *));
++ if (unlikely(bindex < istart || bindex > iend)) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" CI5: dentry/linode=%p:%p bindex=%d "
++ "istart/end=%d:%d\n", dentry,
++ lower_inode, bindex, istart, iend);
++ } else if (unlikely(lower_inode == poison_ptr)) {
++ /* freed inode! */
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" CI6: dentry/linode=%p:%p bindex=%d "
++ "istart/end=%d:%d\n", dentry,
++ lower_inode, bindex, istart, iend);
++ }
++ continue;
++ }
++ /* if we get here, then lower_inode == NULL */
++ if (bindex < istart || bindex > iend)
++ continue;
++ /*
++ * directories can have NULL lower inodes in b/t start/end,
++ * but NOT if at the start/end range.
++ */
++ if (unlikely(S_ISDIR(inode->i_mode) &&
++ bindex > istart && bindex < iend))
++ continue;
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" CI7: dentry/linode=%p:%p "
++ "bindex=%d istart/end=%d:%d\n",
++ dentry, lower_inode, bindex, istart, iend);
++ }
++
++ /*
++ * If it's a directory, then intermediate objects b/t start/end can
++ * be NULL. But, check that all three are NULL: lower dentry, mnt,
++ * and inode.
++ */
++ if (dstart >= 0 && dend >= 0 && S_ISDIR(inode->i_mode))
++ for (bindex = dstart+1; bindex < dend; bindex++) {
++ lower_inode = unionfs_lower_inode_idx(inode, bindex);
++ lower_dentry = unionfs_lower_dentry_idx(dentry,
++ bindex);
++ lower_mnt = unionfs_lower_mnt_idx(dentry, bindex);
++ if (unlikely(!((lower_inode && lower_dentry &&
++ lower_mnt) ||
++ (!lower_inode &&
++ !lower_dentry && !lower_mnt)))) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" Cx: lmnt/ldentry/linode=%p:%p:%p "
++ "bindex=%d dstart/end=%d:%d\n",
++ lower_mnt, lower_dentry, lower_inode,
++ bindex, dstart, dend);
++ }
++ }
++ /* check if lower inode is newer than upper one (it shouldn't) */
++ if (unlikely(is_newer_lower(dentry) && !is_negative_lower(dentry))) {
++ PRINT_CALLER(fname, fxn, line);
++ for (bindex = ibstart(inode); bindex <= ibend(inode);
++ bindex++) {
++ lower_inode = unionfs_lower_inode_idx(inode, bindex);
++ if (unlikely(!lower_inode))
++ continue;
++ pr_debug(" CI8: bindex=%d mtime/lmtime=%lu.%lu/%lu.%lu "
++ "ctime/lctime=%lu.%lu/%lu.%lu\n",
++ bindex,
++ inode->i_mtime.tv_sec,
++ inode->i_mtime.tv_nsec,
++ lower_inode->i_mtime.tv_sec,
++ lower_inode->i_mtime.tv_nsec,
++ inode->i_ctime.tv_sec,
++ inode->i_ctime.tv_nsec,
++ lower_inode->i_ctime.tv_sec,
++ lower_inode->i_ctime.tv_nsec);
++ }
++ }
++}
++
++void __unionfs_check_file(const struct file *file,
++ const char *fname, const char *fxn, int line)
++{
++ int bindex;
++ int dstart, dend, fstart, fend;
++ struct dentry *dentry;
++ struct file *lower_file;
++ struct inode *inode;
++ struct super_block *sb;
++ int printed_caller = 0;
++
++ BUG_ON(!file);
++ dentry = file->f_path.dentry;
++ sb = dentry->d_sb;
++ dstart = dbstart(dentry);
++ dend = dbend(dentry);
++ BUG_ON(dstart > dend);
++ fstart = fbstart(file);
++ fend = fbend(file);
++ BUG_ON(fstart > fend);
++
++ if (unlikely((fstart == -1 && fend != -1) ||
++ (fstart != -1 && fend == -1))) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" CF0: file/dentry=%p:%p fstart/end=%d:%d\n",
++ file, dentry, fstart, fend);
++ }
++ if (unlikely(fstart != dstart)) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" CF1: file/dentry=%p:%p fstart=%d dstart=%d\n",
++ file, dentry, fstart, dstart);
++ }
++ if (unlikely(fend != dend)) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" CF2: file/dentry=%p:%p fend=%d dend=%d\n",
++ file, dentry, fend, dend);
++ }
++ inode = dentry->d_inode;
++ if (!S_ISDIR(inode->i_mode)) {
++ if (unlikely(fend != fstart)) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" CF3: file/inode=%p:%p fstart=%d fend=%d\n",
++ file, inode, fstart, fend);
++ }
++ if (unlikely(dend != dstart)) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" CF4: file/dentry=%p:%p dstart=%d dend=%d\n",
++ file, dentry, dstart, dend);
++ }
++ }
++
++ /*
++ * check for NULL dentries inside the start/end range, or
++ * non-NULL dentries outside the start/end range.
++ */
++ for (bindex = sbstart(sb); bindex < sbmax(sb); bindex++) {
++ lower_file = unionfs_lower_file_idx(file, bindex);
++ if (lower_file) {
++ if (unlikely(bindex < fstart || bindex > fend)) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" CF5: file/lower=%p:%p bindex=%d "
++ "fstart/end=%d:%d\n", file,
++ lower_file, bindex, fstart, fend);
++ }
++ } else { /* lower_file == NULL */
++ if (bindex >= fstart && bindex <= fend) {
++ /*
++ * directories can have NULL lower inodes in
++ * b/t start/end, but NOT if at the
++ * start/end range.
++ */
++ if (unlikely(!(S_ISDIR(inode->i_mode) &&
++ bindex > fstart &&
++ bindex < fend))) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" CF6: file/lower=%p:%p "
++ "bindex=%d fstart/end=%d:%d\n",
++ file, lower_file, bindex,
++ fstart, fend);
++ }
++ }
++ }
++ }
++
++ __unionfs_check_dentry(dentry, fname, fxn, line);
++}
++
++void __unionfs_check_nd(const struct nameidata *nd,
++ const char *fname, const char *fxn, int line)
++{
++ struct file *file;
++ int printed_caller = 0;
++
++ if (unlikely(!nd))
++ return;
++ if (nd->flags & LOOKUP_OPEN) {
++ file = nd->intent.open.file;
++ if (unlikely(file->f_path.dentry &&
++ strcmp(file->f_path.dentry->d_sb->s_type->name,
++ UNIONFS_NAME))) {
++ PRINT_CALLER(fname, fxn, line);
++ pr_debug(" CND1: lower_file of type %s\n",
++ file->f_path.dentry->d_sb->s_type->name);
++ }
++ }
++}
++
++static unsigned int __mnt_get_count(struct vfsmount *mnt)
++{
++#ifdef CONFIG_SMP
++ unsigned int count = 0;
++ int cpu;
++
++ for_each_possible_cpu(cpu) {
++ count += per_cpu_ptr(mnt->mnt_pcp, cpu)->mnt_count;
++ }
++
++ return count;
++#else
++ return mnt->mnt_count;
++#endif
++}
++
++/* useful to track vfsmount leaks that could cause EBUSY on unmount */
++void __show_branch_counts(const struct super_block *sb,
++ const char *file, const char *fxn, int line)
++{
++ int i;
++ struct vfsmount *mnt;
++
++ pr_debug("BC:");
++ for (i = 0; i < sbmax(sb); i++) {
++ if (likely(sb->s_root))
++ mnt = UNIONFS_D(sb->s_root)->lower_paths[i].mnt;
++ else
++ mnt = NULL;
++ printk(KERN_CONT "%d:",
++ (mnt ? __mnt_get_count(mnt) : -99));
++ }
++ printk(KERN_CONT "%s:%s:%d\n", file, fxn, line);
++}
++
++void __show_inode_times(const struct inode *inode,
++ const char *file, const char *fxn, int line)
++{
++ struct inode *lower_inode;
++ int bindex;
++
++ for (bindex = ibstart(inode); bindex <= ibend(inode); bindex++) {
++ lower_inode = unionfs_lower_inode_idx(inode, bindex);
++ if (unlikely(!lower_inode))
++ continue;
++ pr_debug("IT(%lu:%d): %s:%s:%d "
++ "um=%lu/%lu lm=%lu/%lu uc=%lu/%lu lc=%lu/%lu\n",
++ inode->i_ino, bindex,
++ file, fxn, line,
++ inode->i_mtime.tv_sec, inode->i_mtime.tv_nsec,
++ lower_inode->i_mtime.tv_sec,
++ lower_inode->i_mtime.tv_nsec,
++ inode->i_ctime.tv_sec, inode->i_ctime.tv_nsec,
++ lower_inode->i_ctime.tv_sec,
++ lower_inode->i_ctime.tv_nsec);
++ }
++}
++
++void __show_dinode_times(const struct dentry *dentry,
++ const char *file, const char *fxn, int line)
++{
++ struct inode *inode = dentry->d_inode;
++ struct inode *lower_inode;
++ int bindex;
++
++ for (bindex = ibstart(inode); bindex <= ibend(inode); bindex++) {
++ lower_inode = unionfs_lower_inode_idx(inode, bindex);
++ if (!lower_inode)
++ continue;
++ pr_debug("DT(%s:%lu:%d): %s:%s:%d "
++ "um=%lu/%lu lm=%lu/%lu uc=%lu/%lu lc=%lu/%lu\n",
++ dentry->d_name.name, inode->i_ino, bindex,
++ file, fxn, line,
++ inode->i_mtime.tv_sec, inode->i_mtime.tv_nsec,
++ lower_inode->i_mtime.tv_sec,
++ lower_inode->i_mtime.tv_nsec,
++ inode->i_ctime.tv_sec, inode->i_ctime.tv_nsec,
++ lower_inode->i_ctime.tv_sec,
++ lower_inode->i_ctime.tv_nsec);
++ }
++}
++
++void __show_inode_counts(const struct inode *inode,
++ const char *file, const char *fxn, int line)
++{
++ struct inode *lower_inode;
++ int bindex;
++
++ if (unlikely(!inode)) {
++ pr_debug("SiC: Null inode\n");
++ return;
++ }
++ for (bindex = sbstart(inode->i_sb); bindex <= sbend(inode->i_sb);
++ bindex++) {
++ lower_inode = unionfs_lower_inode_idx(inode, bindex);
++ if (unlikely(!lower_inode))
++ continue;
++ pr_debug("SIC(%lu:%d:%d): lc=%d %s:%s:%d\n",
++ inode->i_ino, bindex,
++ atomic_read(&(inode)->i_count),
++ atomic_read(&(lower_inode)->i_count),
++ file, fxn, line);
++ }
++}
+diff --git a/fs/unionfs/dentry.c b/fs/unionfs/dentry.c
+new file mode 100644
+index 0000000..c0205a4
+--- /dev/null
++++ b/fs/unionfs/dentry.c
+@@ -0,0 +1,406 @@
++/*
++ * Copyright (c) 2003-2011 Erez Zadok
++ * Copyright (c) 2003-2006 Charles P. Wright
++ * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
++ * Copyright (c) 2005-2006 Junjiro Okajima
++ * Copyright (c) 2005 Arun M. Krishnakumar
++ * Copyright (c) 2004-2006 David P. Quigley
++ * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
++ * Copyright (c) 2003 Puja Gupta
++ * Copyright (c) 2003 Harikesavan Krishnan
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
++ *
++ * 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 "union.h"
++
++bool is_negative_lower(const struct dentry *dentry)
++{
++ int bindex;
++ struct dentry *lower_dentry;
++
++ BUG_ON(!dentry);
++ /* cache coherency: check if file was deleted on lower branch */
++ if (dbstart(dentry) < 0)
++ return true;
++ for (bindex = dbstart(dentry); bindex <= dbend(dentry); bindex++) {
++ lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
++ /* unhashed (i.e., unlinked) lower dentries don't count */
++ if (lower_dentry && lower_dentry->d_inode &&
++ !d_deleted(lower_dentry) &&
++ !(lower_dentry->d_flags & DCACHE_NFSFS_RENAMED))
++ return false;
++ }
++ return true;
++}
++
++static inline void __dput_lowers(struct dentry *dentry, int start, int end)
++{
++ struct dentry *lower_dentry;
++ int bindex;
++
++ if (start < 0)
++ return;
++ for (bindex = start; bindex <= end; bindex++) {
++ lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
++ if (!lower_dentry)
++ continue;
++ unionfs_set_lower_dentry_idx(dentry, bindex, NULL);
++ dput(lower_dentry);
++ }
++}
++
++/*
++ * Purge and invalidate as many data pages of a unionfs inode. This is
++ * called when the lower inode has changed, and we want to force processes
++ * to re-get the new data.
++ */
++static inline void purge_inode_data(struct inode *inode)
++{
++ /* remove all non-private mappings */
++ unmap_mapping_range(inode->i_mapping, 0, 0, 0);
++ /* invalidate as many pages as possible */
++ invalidate_mapping_pages(inode->i_mapping, 0, -1);
++ /*
++ * Don't try to truncate_inode_pages here, because this could lead
++ * to a deadlock between some of address_space ops and dentry
++ * revalidation: the address space op is invoked with a lock on our
++ * own page, and truncate_inode_pages will block on locked pages.
++ */
++}
++
++/*
++ * Revalidate a single file/symlink/special dentry. Assume that info nodes
++ * of the @dentry and its @parent are locked. Assume parent is valid,
++ * otherwise return false (and let's hope the VFS will try to re-lookup this
++ * dentry). Returns true if valid, false otherwise.
++ */
++bool __unionfs_d_revalidate(struct dentry *dentry, struct dentry *parent,
++ bool willwrite)
++{
++ bool valid = true; /* default is valid */
++ struct dentry *lower_dentry;
++ struct dentry *result;
++ int bindex, bstart, bend;
++ int sbgen, dgen, pdgen;
++ int positive = 0;
++ int interpose_flag;
++
++ verify_locked(dentry);
++ verify_locked(parent);
++
++ /* if the dentry is unhashed, do NOT revalidate */
++ if (d_deleted(dentry))
++ goto out;
++
++ dgen = atomic_read(&UNIONFS_D(dentry)->generation);
++
++ if (is_newer_lower(dentry)) {
++ /* root dentry is always valid */
++ if (IS_ROOT(dentry)) {
++ unionfs_copy_attr_times(dentry->d_inode);
++ } else {
++ /*
++ * reset generation number to zero, guaranteed to be
++ * "old"
++ */
++ dgen = 0;
++ atomic_set(&UNIONFS_D(dentry)->generation, dgen);
++ }
++ if (!willwrite)
++ purge_inode_data(dentry->d_inode);
++ }
++
++ sbgen = atomic_read(&UNIONFS_SB(dentry->d_sb)->generation);
++
++ BUG_ON(dbstart(dentry) == -1);
++ if (dentry->d_inode)
++ positive = 1;
++
++ /* if our dentry is valid, then validate all lower ones */
++ if (sbgen == dgen)
++ goto validate_lowers;
++
++ /* The root entry should always be valid */
++ BUG_ON(IS_ROOT(dentry));
++
++ /* We can't work correctly if our parent isn't valid. */
++ pdgen = atomic_read(&UNIONFS_D(parent)->generation);
++
++ /* Free the pointers for our inodes and this dentry. */
++ path_put_lowers_all(dentry, false);
++
++ interpose_flag = INTERPOSE_REVAL_NEG;
++ if (positive) {
++ interpose_flag = INTERPOSE_REVAL;
++ iput_lowers_all(dentry->d_inode, true);
++ }
++
++ if (realloc_dentry_private_data(dentry) != 0) {
++ valid = false;
++ goto out;
++ }
++
++ result = unionfs_lookup_full(dentry, parent, interpose_flag);
++ if (result) {
++ if (IS_ERR(result)) {
++ valid = false;
++ goto out;
++ }
++ /*
++ * current unionfs_lookup_backend() doesn't return
++ * a valid dentry
++ */
++ dput(dentry);
++ dentry = result;
++ }
++
++ if (unlikely(positive && is_negative_lower(dentry))) {
++ /* call make_bad_inode here ? */
++ d_drop(dentry);
++ valid = false;
++ goto out;
++ }
++
++ /*
++ * if we got here then we have revalidated our dentry and all lower
++ * ones, so we can return safely.
++ */
++ if (!valid) /* lower dentry revalidation failed */
++ goto out;
++
++ /*
++ * If the parent's gen no. matches the superblock's gen no., then
++ * we can update our denty's gen no. If they didn't match, then it
++ * was OK to revalidate this dentry with a stale parent, but we'll
++ * purposely not update our dentry's gen no. (so it can be redone);
++ * and, we'll mark our parent dentry as invalid so it'll force it
++ * (and our dentry) to be revalidated.
++ */
++ if (pdgen == sbgen)
++ atomic_set(&UNIONFS_D(dentry)->generation, sbgen);
++ goto out;
++
++validate_lowers:
++
++ /* The revalidation must occur across all branches */
++ bstart = dbstart(dentry);
++ bend = dbend(dentry);
++ BUG_ON(bstart == -1);
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ int err;
++ struct nameidata lower_nd;
++
++ lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
++ if (!lower_dentry || !lower_dentry->d_op
++ || !lower_dentry->d_op->d_revalidate)
++ continue;
++ /*
++ * Don't pass nameidata to lower file system, because we
++ * don't want an arbitrary lower file being opened or
++ * returned to us: it may be useless to us because of the
++ * fanout nature of unionfs (cf. file/directory open-file
++ * invariants). We will open lower files as and when needed
++ * later on.
++ */
++ err = init_lower_nd(&lower_nd, LOOKUP_OPEN);
++ if (unlikely(err < 0)) {
++ valid = false;
++ break;
++ }
++ if (!lower_dentry->d_op->d_revalidate(lower_dentry, &lower_nd))
++ valid = false;
++ release_lower_nd(&lower_nd, err);
++ }
++
++ if (!dentry->d_inode ||
++ ibstart(dentry->d_inode) < 0 ||
++ ibend(dentry->d_inode) < 0) {
++ valid = false;
++ goto out;
++ }
++
++ if (valid) {
++ /*
++ * If we get here, and we copy the meta-data from the lower
++ * inode to our inode, then it is vital that we have already
++ * purged all unionfs-level file data. We do that in the
++ * caller (__unionfs_d_revalidate) by calling
++ * purge_inode_data.
++ */
++ unionfs_copy_attr_all(dentry->d_inode,
++ unionfs_lower_inode(dentry->d_inode));
++ fsstack_copy_inode_size(dentry->d_inode,
++ unionfs_lower_inode(dentry->d_inode));
++ }
++
++out:
++ return valid;
++}
++
++/*
++ * Determine if the lower inode objects have changed from below the unionfs
++ * inode. Return true if changed, false otherwise.
++ *
++ * We check if the mtime or ctime have changed. However, the inode times
++ * can be changed by anyone without much protection, including
++ * asynchronously. This can sometimes cause unionfs to find that the lower
++ * file system doesn't change its inode times quick enough, resulting in a
++ * false positive indication (which is harmless, it just makes unionfs do
++ * extra work in re-validating the objects). To minimize the chances of
++ * these situations, we still consider such small time changes valid, but we
++ * don't print debugging messages unless the time changes are greater than
++ * UNIONFS_MIN_CC_TIME (which defaults to 3 seconds, as with NFS's acregmin)
++ * because significant changes are more likely due to users manually
++ * touching lower files.
++ */
++bool is_newer_lower(const struct dentry *dentry)
++{
++ int bindex;
++ struct inode *inode;
++ struct inode *lower_inode;
++
++ /* ignore if we're called on semi-initialized dentries/inodes */
++ if (!dentry || !UNIONFS_D(dentry))
++ return false;
++ inode = dentry->d_inode;
++ if (!inode || !UNIONFS_I(inode)->lower_inodes ||
++ ibstart(inode) < 0 || ibend(inode) < 0)
++ return false;
++
++ for (bindex = ibstart(inode); bindex <= ibend(inode); bindex++) {
++ lower_inode = unionfs_lower_inode_idx(inode, bindex);
++ if (!lower_inode)
++ continue;
++
++ /* check if mtime/ctime have changed */
++ if (unlikely(timespec_compare(&inode->i_mtime,
++ &lower_inode->i_mtime) < 0)) {
++ if ((lower_inode->i_mtime.tv_sec -
++ inode->i_mtime.tv_sec) > UNIONFS_MIN_CC_TIME) {
++ pr_info("unionfs: new lower inode mtime "
++ "(bindex=%d, name=%s)\n", bindex,
++ dentry->d_name.name);
++ show_dinode_times(dentry);
++ }
++ return true;
++ }
++ if (unlikely(timespec_compare(&inode->i_ctime,
++ &lower_inode->i_ctime) < 0)) {
++ if ((lower_inode->i_ctime.tv_sec -
++ inode->i_ctime.tv_sec) > UNIONFS_MIN_CC_TIME) {
++ pr_info("unionfs: new lower inode ctime "
++ "(bindex=%d, name=%s)\n", bindex,
++ dentry->d_name.name);
++ show_dinode_times(dentry);
++ }
++ return true;
++ }
++ }
++
++ /*
++ * Last check: if this is a positive dentry, but somehow all lower
++ * dentries are negative or unhashed, then this dentry needs to be
++ * revalidated, because someone probably deleted the objects from
++ * the lower branches directly.
++ */
++ if (is_negative_lower(dentry))
++ return true;
++
++ return false; /* default: lower is not newer */
++}
++
++static int unionfs_d_revalidate(struct dentry *dentry,
++ struct nameidata *nd_unused)
++{
++ bool valid = true;
++ int err = 1; /* 1 means valid for the VFS */
++ struct dentry *parent;
++
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_CHILD);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ valid = __unionfs_d_revalidate(dentry, parent, false);
++ if (valid) {
++ unionfs_postcopyup_setmnt(dentry);
++ unionfs_check_dentry(dentry);
++ } else {
++ d_drop(dentry);
++ err = valid;
++ }
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++
++ return err;
++}
++
++static void unionfs_d_release(struct dentry *dentry)
++{
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_CHILD);
++ if (unlikely(!UNIONFS_D(dentry)))
++ goto out; /* skip if no lower branches */
++ /* must lock our branch configuration here */
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ unionfs_check_dentry(dentry);
++ /* this could be a negative dentry, so check first */
++ if (dbstart(dentry) < 0) {
++ unionfs_unlock_dentry(dentry);
++ goto out; /* due to a (normal) failed lookup */
++ }
++
++ /* Release all the lower dentries */
++ path_put_lowers_all(dentry, true);
++
++ unionfs_unlock_dentry(dentry);
++
++out:
++ free_dentry_private_data(dentry);
++ unionfs_read_unlock(dentry->d_sb);
++ return;
++}
++
++/*
++ * Called when we're removing the last reference to our dentry. So we
++ * should drop all lower references too.
++ */
++static void unionfs_d_iput(struct dentry *dentry, struct inode *inode)
++{
++ int rc;
++
++ BUG_ON(!dentry);
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_CHILD);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ if (!UNIONFS_D(dentry) || dbstart(dentry) < 0)
++ goto drop_lower_inodes;
++ path_put_lowers_all(dentry, false);
++
++drop_lower_inodes:
++ rc = atomic_read(&inode->i_count);
++ if (rc == 1 && inode->i_nlink == 1 && ibstart(inode) >= 0) {
++ /* see Documentation/filesystems/unionfs/issues.txt */
++ lockdep_off();
++ iput(unionfs_lower_inode(inode));
++ lockdep_on();
++ unionfs_set_lower_inode(inode, NULL);
++ /* XXX: may need to set start/end to -1? */
++ }
++
++ iput(inode);
++
++ unionfs_unlock_dentry(dentry);
++ unionfs_read_unlock(dentry->d_sb);
++}
++
++struct dentry_operations unionfs_dops = {
++ .d_revalidate = unionfs_d_revalidate,
++ .d_release = unionfs_d_release,
++ .d_iput = unionfs_d_iput,
++};
+diff --git a/fs/unionfs/dirfops.c b/fs/unionfs/dirfops.c
+new file mode 100644
+index 0000000..72a9c1a
+--- /dev/null
++++ b/fs/unionfs/dirfops.c
+@@ -0,0 +1,302 @@
++/*
++ * Copyright (c) 2003-2011 Erez Zadok
++ * Copyright (c) 2003-2006 Charles P. Wright
++ * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
++ * Copyright (c) 2005-2006 Junjiro Okajima
++ * Copyright (c) 2005 Arun M. Krishnakumar
++ * Copyright (c) 2004-2006 David P. Quigley
++ * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
++ * Copyright (c) 2003 Puja Gupta
++ * Copyright (c) 2003 Harikesavan Krishnan
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
++ *
++ * 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 "union.h"
++
++/* Make sure our rdstate is playing by the rules. */
++static void verify_rdstate_offset(struct unionfs_dir_state *rdstate)
++{
++ BUG_ON(rdstate->offset >= DIREOF);
++ BUG_ON(rdstate->cookie >= MAXRDCOOKIE);
++}
++
++struct unionfs_getdents_callback {
++ struct unionfs_dir_state *rdstate;
++ void *dirent;
++ int entries_written;
++ int filldir_called;
++ int filldir_error;
++ filldir_t filldir;
++ struct super_block *sb;
++};
++
++/* based on generic filldir in fs/readir.c */
++static int unionfs_filldir(void *dirent, const char *oname, int namelen,
++ loff_t offset, u64 ino, unsigned int d_type)
++{
++ struct unionfs_getdents_callback *buf = dirent;
++ struct filldir_node *found = NULL;
++ int err = 0;
++ int is_whiteout;
++ char *name = (char *) oname;
++
++ buf->filldir_called++;
++
++ is_whiteout = is_whiteout_name(&name, &namelen);
++
++ found = find_filldir_node(buf->rdstate, name, namelen, is_whiteout);
++
++ if (found) {
++ /*
++ * If we had non-whiteout entry in dir cache, then mark it
++ * as a whiteout and but leave it in the dir cache.
++ */
++ if (is_whiteout && !found->whiteout)
++ found->whiteout = is_whiteout;
++ goto out;
++ }
++
++ /* if 'name' isn't a whiteout, filldir it. */
++ if (!is_whiteout) {
++ off_t pos = rdstate2offset(buf->rdstate);
++ u64 unionfs_ino = ino;
++
++ err = buf->filldir(buf->dirent, name, namelen, pos,
++ unionfs_ino, d_type);
++ buf->rdstate->offset++;
++ verify_rdstate_offset(buf->rdstate);
++ }
++ /*
++ * If we did fill it, stuff it in our hash, otherwise return an
++ * error.
++ */
++ if (err) {
++ buf->filldir_error = err;
++ goto out;
++ }
++ buf->entries_written++;
++ err = add_filldir_node(buf->rdstate, name, namelen,
++ buf->rdstate->bindex, is_whiteout);
++ if (err)
++ buf->filldir_error = err;
++
++out:
++ return err;
++}
++
++static int unionfs_readdir(struct file *file, void *dirent, filldir_t filldir)
++{
++ int err = 0;
++ struct file *lower_file = NULL;
++ struct dentry *dentry = file->f_path.dentry;
++ struct dentry *parent;
++ struct inode *inode = NULL;
++ struct unionfs_getdents_callback buf;
++ struct unionfs_dir_state *uds;
++ int bend;
++ loff_t offset;
++
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_PARENT);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ err = unionfs_file_revalidate(file, parent, false);
++ if (unlikely(err))
++ goto out;
++
++ inode = dentry->d_inode;
++
++ uds = UNIONFS_F(file)->rdstate;
++ if (!uds) {
++ if (file->f_pos == DIREOF) {
++ goto out;
++ } else if (file->f_pos > 0) {
++ uds = find_rdstate(inode, file->f_pos);
++ if (unlikely(!uds)) {
++ err = -ESTALE;
++ goto out;
++ }
++ UNIONFS_F(file)->rdstate = uds;
++ } else {
++ init_rdstate(file);
++ uds = UNIONFS_F(file)->rdstate;
++ }
++ }
++ bend = fbend(file);
++
++ while (uds->bindex <= bend) {
++ lower_file = unionfs_lower_file_idx(file, uds->bindex);
++ if (!lower_file) {
++ uds->bindex++;
++ uds->dirpos = 0;
++ continue;
++ }
++
++ /* prepare callback buffer */
++ buf.filldir_called = 0;
++ buf.filldir_error = 0;
++ buf.entries_written = 0;
++ buf.dirent = dirent;
++ buf.filldir = filldir;
++ buf.rdstate = uds;
++ buf.sb = inode->i_sb;
++
++ /* Read starting from where we last left off. */
++ offset = vfs_llseek(lower_file, uds->dirpos, SEEK_SET);
++ if (offset < 0) {
++ err = offset;
++ goto out;
++ }
++ err = vfs_readdir(lower_file, unionfs_filldir, &buf);
++
++ /* Save the position for when we continue. */
++ offset = vfs_llseek(lower_file, 0, SEEK_CUR);
++ if (offset < 0) {
++ err = offset;
++ goto out;
++ }
++ uds->dirpos = offset;
++
++ /* Copy the atime. */
++ fsstack_copy_attr_atime(inode,
++ lower_file->f_path.dentry->d_inode);
++
++ if (err < 0)
++ goto out;
++
++ if (buf.filldir_error)
++ break;
++
++ if (!buf.entries_written) {
++ uds->bindex++;
++ uds->dirpos = 0;
++ }
++ }
++
++ if (!buf.filldir_error && uds->bindex >= bend) {
++ /* Save the number of hash entries for next time. */
++ UNIONFS_I(inode)->hashsize = uds->hashentries;
++ free_rdstate(uds);
++ UNIONFS_F(file)->rdstate = NULL;
++ file->f_pos = DIREOF;
++ } else {
++ file->f_pos = rdstate2offset(uds);
++ }
++
++out:
++ if (!err)
++ unionfs_check_file(file);
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++ return err;
++}
++
++/*
++ * This is not meant to be a generic repositioning function. If you do
++ * things that aren't supported, then we return EINVAL.
++ *
++ * What is allowed:
++ * (1) seeking to the same position that you are currently at
++ * This really has no effect, but returns where you are.
++ * (2) seeking to the beginning of the file
++ * This throws out all state, and lets you begin again.
++ */
++static loff_t unionfs_dir_llseek(struct file *file, loff_t offset, int origin)
++{
++ struct unionfs_dir_state *rdstate;
++ struct dentry *dentry = file->f_path.dentry;
++ struct dentry *parent;
++ loff_t err;
++
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_PARENT);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ err = unionfs_file_revalidate(file, parent, false);
++ if (unlikely(err))
++ goto out;
++
++ rdstate = UNIONFS_F(file)->rdstate;
++
++ /*
++ * we let users seek to their current position, but not anywhere
++ * else.
++ */
++ if (!offset) {
++ switch (origin) {
++ case SEEK_SET:
++ if (rdstate) {
++ free_rdstate(rdstate);
++ UNIONFS_F(file)->rdstate = NULL;
++ }
++ init_rdstate(file);
++ err = 0;
++ break;
++ case SEEK_CUR:
++ err = file->f_pos;
++ break;
++ case SEEK_END:
++ /* Unsupported, because we would break everything. */
++ err = -EINVAL;
++ break;
++ }
++ } else {
++ switch (origin) {
++ case SEEK_SET:
++ if (rdstate) {
++ if (offset == rdstate2offset(rdstate))
++ err = offset;
++ else if (file->f_pos == DIREOF)
++ err = DIREOF;
++ else
++ err = -EINVAL;
++ } else {
++ struct inode *inode;
++ inode = dentry->d_inode;
++ rdstate = find_rdstate(inode, offset);
++ if (rdstate) {
++ UNIONFS_F(file)->rdstate = rdstate;
++ err = rdstate->offset;
++ } else {
++ err = -EINVAL;
++ }
++ }
++ break;
++ case SEEK_CUR:
++ case SEEK_END:
++ /* Unsupported, because we would break everything. */
++ err = -EINVAL;
++ break;
++ }
++ }
++
++out:
++ if (!err)
++ unionfs_check_file(file);
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++ return err;
++}
++
++/*
++ * Trimmed directory options, we shouldn't pass everything down since
++ * we don't want to operate on partial directories.
++ */
++struct file_operations unionfs_dir_fops = {
++ .llseek = unionfs_dir_llseek,
++ .read = generic_read_dir,
++ .readdir = unionfs_readdir,
++ .unlocked_ioctl = unionfs_ioctl,
++ .open = unionfs_open,
++ .release = unionfs_file_release,
++ .flush = unionfs_flush,
++ .fsync = unionfs_fsync,
++ .fasync = unionfs_fasync,
++};
+diff --git a/fs/unionfs/dirhelper.c b/fs/unionfs/dirhelper.c
+new file mode 100644
+index 0000000..62ec9af
+--- /dev/null
++++ b/fs/unionfs/dirhelper.c
+@@ -0,0 +1,158 @@
++/*
++ * Copyright (c) 2003-2011 Erez Zadok
++ * Copyright (c) 2003-2006 Charles P. Wright
++ * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
++ * Copyright (c) 2005-2006 Junjiro Okajima
++ * Copyright (c) 2005 Arun M. Krishnakumar
++ * Copyright (c) 2004-2006 David P. Quigley
++ * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
++ * Copyright (c) 2003 Puja Gupta
++ * Copyright (c) 2003 Harikesavan Krishnan
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
++ *
++ * 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 "union.h"
++
++#define RD_NONE 0
++#define RD_CHECK_EMPTY 1
++/* The callback structure for check_empty. */
++struct unionfs_rdutil_callback {
++ int err;
++ int filldir_called;
++ struct unionfs_dir_state *rdstate;
++ int mode;
++};
++
++/* This filldir function makes sure only whiteouts exist within a directory. */
++static int readdir_util_callback(void *dirent, const char *oname, int namelen,
++ loff_t offset, u64 ino, unsigned int d_type)
++{
++ int err = 0;
++ struct unionfs_rdutil_callback *buf = dirent;
++ int is_whiteout;
++ struct filldir_node *found;
++ char *name = (char *) oname;
++
++ buf->filldir_called = 1;
++
++ if (name[0] == '.' && (namelen == 1 ||
++ (name[1] == '.' && namelen == 2)))
++ goto out;
++
++ is_whiteout = is_whiteout_name(&name, &namelen);
++
++ found = find_filldir_node(buf->rdstate, name, namelen, is_whiteout);
++ /* If it was found in the table there was a previous whiteout. */
++ if (found)
++ goto out;
++
++ /*
++ * if it wasn't found and isn't a whiteout, the directory isn't
++ * empty.
++ */
++ err = -ENOTEMPTY;
++ if ((buf->mode == RD_CHECK_EMPTY) && !is_whiteout)
++ goto out;
++
++ err = add_filldir_node(buf->rdstate, name, namelen,
++ buf->rdstate->bindex, is_whiteout);
++
++out:
++ buf->err = err;
++ return err;
++}
++
++/* Is a directory logically empty? */
++int check_empty(struct dentry *dentry, struct dentry *parent,
++ struct unionfs_dir_state **namelist)
++{
++ int err = 0;
++ struct dentry *lower_dentry = NULL;
++ struct vfsmount *mnt;
++ struct super_block *sb;
++ struct file *lower_file;
++ struct unionfs_rdutil_callback *buf = NULL;
++ int bindex, bstart, bend, bopaque;
++
++ sb = dentry->d_sb;
++
++
++ BUG_ON(!S_ISDIR(dentry->d_inode->i_mode));
++
++ err = unionfs_partial_lookup(dentry, parent);
++ if (err)
++ goto out;
++
++ bstart = dbstart(dentry);
++ bend = dbend(dentry);
++ bopaque = dbopaque(dentry);
++ if (0 <= bopaque && bopaque < bend)
++ bend = bopaque;
++
++ buf = kmalloc(sizeof(struct unionfs_rdutil_callback), GFP_KERNEL);
++ if (unlikely(!buf)) {
++ err = -ENOMEM;
++ goto out;
++ }
++ buf->err = 0;
++ buf->mode = RD_CHECK_EMPTY;
++ buf->rdstate = alloc_rdstate(dentry->d_inode, bstart);
++ if (unlikely(!buf->rdstate)) {
++ err = -ENOMEM;
++ goto out;
++ }
++
++ /* Process the lower directories with rdutil_callback as a filldir. */
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
++ if (!lower_dentry)
++ continue;
++ if (!lower_dentry->d_inode)
++ continue;
++ if (!S_ISDIR(lower_dentry->d_inode->i_mode))
++ continue;
++
++ dget(lower_dentry);
++ mnt = unionfs_mntget(dentry, bindex);
++ branchget(sb, bindex);
++ lower_file = dentry_open(lower_dentry, mnt, O_RDONLY, current_cred());
++ if (IS_ERR(lower_file)) {
++ err = PTR_ERR(lower_file);
++ branchput(sb, bindex);
++ goto out;
++ }
++
++ do {
++ buf->filldir_called = 0;
++ buf->rdstate->bindex = bindex;
++ err = vfs_readdir(lower_file,
++ readdir_util_callback, buf);
++ if (buf->err)
++ err = buf->err;
++ } while ((err >= 0) && buf->filldir_called);
++
++ /* fput calls dput for lower_dentry */
++ fput(lower_file);
++ branchput(sb, bindex);
++
++ if (err < 0)
++ goto out;
++ }
++
++out:
++ if (buf) {
++ if (namelist && !err)
++ *namelist = buf->rdstate;
++ else if (buf->rdstate)
++ free_rdstate(buf->rdstate);
++ kfree(buf);
++ }
++
++
++ return err;
++}
+diff --git a/fs/unionfs/fanout.h b/fs/unionfs/fanout.h
+new file mode 100644
+index 0000000..ae1b86a
+--- /dev/null
++++ b/fs/unionfs/fanout.h
+@@ -0,0 +1,407 @@
++/*
++ * Copyright (c) 2003-2011 Erez Zadok
++ * Copyright (c) 2003-2006 Charles P. Wright
++ * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
++ * Copyright (c) 2005 Arun M. Krishnakumar
++ * Copyright (c) 2004-2006 David P. Quigley
++ * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
++ * Copyright (c) 2003 Puja Gupta
++ * Copyright (c) 2003 Harikesavan Krishnan
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
++ *
++ * 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.
++ */
++
++#ifndef _FANOUT_H_
++#define _FANOUT_H_
++
++/*
++ * Inode to private data
++ *
++ * Since we use containers and the struct inode is _inside_ the
++ * unionfs_inode_info structure, UNIONFS_I will always (given a non-NULL
++ * inode pointer), return a valid non-NULL pointer.
++ */
++static inline struct unionfs_inode_info *UNIONFS_I(const struct inode *inode)
++{
++ return container_of(inode, struct unionfs_inode_info, vfs_inode);
++}
++
++#define ibstart(ino) (UNIONFS_I(ino)->bstart)
++#define ibend(ino) (UNIONFS_I(ino)->bend)
++
++/* Dentry to private data */
++#define UNIONFS_D(dent) ((struct unionfs_dentry_info *)(dent)->d_fsdata)
++#define dbstart(dent) (UNIONFS_D(dent)->bstart)
++#define dbend(dent) (UNIONFS_D(dent)->bend)
++#define dbopaque(dent) (UNIONFS_D(dent)->bopaque)
++
++/* Superblock to private data */
++#define UNIONFS_SB(super) ((struct unionfs_sb_info *)(super)->s_fs_info)
++#define sbstart(sb) 0
++#define sbend(sb) (UNIONFS_SB(sb)->bend)
++#define sbmax(sb) (UNIONFS_SB(sb)->bend + 1)
++#define sbhbid(sb) (UNIONFS_SB(sb)->high_branch_id)
++
++/* File to private Data */
++#define UNIONFS_F(file) ((struct unionfs_file_info *)((file)->private_data))
++#define fbstart(file) (UNIONFS_F(file)->bstart)
++#define fbend(file) (UNIONFS_F(file)->bend)
++
++/* macros to manipulate branch IDs in stored in our superblock */
++static inline int branch_id(struct super_block *sb, int index)
++{
++ BUG_ON(!sb || index < 0);
++ return UNIONFS_SB(sb)->data[index].branch_id;
++}
++
++static inline void set_branch_id(struct super_block *sb, int index, int val)
++{
++ BUG_ON(!sb || index < 0);
++ UNIONFS_SB(sb)->data[index].branch_id = val;
++}
++
++static inline void new_branch_id(struct super_block *sb, int index)
++{
++ BUG_ON(!sb || index < 0);
++ set_branch_id(sb, index, ++UNIONFS_SB(sb)->high_branch_id);
++}
++
++/*
++ * Find new index of matching branch with an existing superblock of a known
++ * (possibly old) id. This is needed because branches could have been
++ * added/deleted causing the branches of any open files to shift.
++ *
++ * @sb: the new superblock which may have new/different branch IDs
++ * @id: the old/existing id we're looking for
++ * Returns index of newly found branch (0 or greater), -1 otherwise.
++ */
++static inline int branch_id_to_idx(struct super_block *sb, int id)
++{
++ int i;
++ for (i = 0; i < sbmax(sb); i++) {
++ if (branch_id(sb, i) == id)
++ return i;
++ }
++ /* in the non-ODF code, this should really never happen */
++ printk(KERN_WARNING "unionfs: cannot find branch with id %d\n", id);
++ return -1;
++}
++
++/* File to lower file. */
++static inline struct file *unionfs_lower_file(const struct file *f)
++{
++ BUG_ON(!f);
++ return UNIONFS_F(f)->lower_files[fbstart(f)];
++}
++
++static inline struct file *unionfs_lower_file_idx(const struct file *f,
++ int index)
++{
++ BUG_ON(!f || index < 0);
++ return UNIONFS_F(f)->lower_files[index];
++}
++
++static inline void unionfs_set_lower_file_idx(struct file *f, int index,
++ struct file *val)
++{
++ BUG_ON(!f || index < 0);
++ UNIONFS_F(f)->lower_files[index] = val;
++ /* save branch ID (may be redundant?) */
++ UNIONFS_F(f)->saved_branch_ids[index] =
++ branch_id((f)->f_path.dentry->d_sb, index);
++}
++
++static inline void unionfs_set_lower_file(struct file *f, struct file *val)
++{
++ BUG_ON(!f);
++ unionfs_set_lower_file_idx((f), fbstart(f), (val));
++}
++
++/* Inode to lower inode. */
++static inline struct inode *unionfs_lower_inode(const struct inode *i)
++{
++ BUG_ON(!i);
++ return UNIONFS_I(i)->lower_inodes[ibstart(i)];
++}
++
++static inline struct inode *unionfs_lower_inode_idx(const struct inode *i,
++ int index)
++{
++ BUG_ON(!i || index < 0);
++ return UNIONFS_I(i)->lower_inodes[index];
++}
++
++static inline void unionfs_set_lower_inode_idx(struct inode *i, int index,
++ struct inode *val)
++{
++ BUG_ON(!i || index < 0);
++ UNIONFS_I(i)->lower_inodes[index] = val;
++}
++
++static inline void unionfs_set_lower_inode(struct inode *i, struct inode *val)
++{
++ BUG_ON(!i);
++ UNIONFS_I(i)->lower_inodes[ibstart(i)] = val;
++}
++
++/* Superblock to lower superblock. */
++static inline struct super_block *unionfs_lower_super(
++ const struct super_block *sb)
++{
++ BUG_ON(!sb);
++ return UNIONFS_SB(sb)->data[sbstart(sb)].sb;
++}
++
++static inline struct super_block *unionfs_lower_super_idx(
++ const struct super_block *sb,
++ int index)
++{
++ BUG_ON(!sb || index < 0);
++ return UNIONFS_SB(sb)->data[index].sb;
++}
++
++static inline void unionfs_set_lower_super_idx(struct super_block *sb,
++ int index,
++ struct super_block *val)
++{
++ BUG_ON(!sb || index < 0);
++ UNIONFS_SB(sb)->data[index].sb = val;
++}
++
++static inline void unionfs_set_lower_super(struct super_block *sb,
++ struct super_block *val)
++{
++ BUG_ON(!sb);
++ UNIONFS_SB(sb)->data[sbstart(sb)].sb = val;
++}
++
++/* Branch count macros. */
++static inline int branch_count(const struct super_block *sb, int index)
++{
++ BUG_ON(!sb || index < 0);
++ return atomic_read(&UNIONFS_SB(sb)->data[index].open_files);
++}
++
++static inline void set_branch_count(struct super_block *sb, int index, int val)
++{
++ BUG_ON(!sb || index < 0);
++ atomic_set(&UNIONFS_SB(sb)->data[index].open_files, val);
++}
++
++static inline void branchget(struct super_block *sb, int index)
++{
++ BUG_ON(!sb || index < 0);
++ atomic_inc(&UNIONFS_SB(sb)->data[index].open_files);
++}
++
++static inline void branchput(struct super_block *sb, int index)
++{
++ BUG_ON(!sb || index < 0);
++ atomic_dec(&UNIONFS_SB(sb)->data[index].open_files);
++}
++
++/* Dentry macros */
++static inline void unionfs_set_lower_dentry_idx(struct dentry *dent, int index,
++ struct dentry *val)
++{
++ BUG_ON(!dent || index < 0);
++ UNIONFS_D(dent)->lower_paths[index].dentry = val;
++}
++
++static inline struct dentry *unionfs_lower_dentry_idx(
++ const struct dentry *dent,
++ int index)
++{
++ BUG_ON(!dent || index < 0);
++ return UNIONFS_D(dent)->lower_paths[index].dentry;
++}
++
++static inline struct dentry *unionfs_lower_dentry(const struct dentry *dent)
++{
++ BUG_ON(!dent);
++ return unionfs_lower_dentry_idx(dent, dbstart(dent));
++}
++
++static inline void unionfs_set_lower_mnt_idx(struct dentry *dent, int index,
++ struct vfsmount *mnt)
++{
++ BUG_ON(!dent || index < 0);
++ UNIONFS_D(dent)->lower_paths[index].mnt = mnt;
++}
++
++static inline struct vfsmount *unionfs_lower_mnt_idx(
++ const struct dentry *dent,
++ int index)
++{
++ BUG_ON(!dent || index < 0);
++ return UNIONFS_D(dent)->lower_paths[index].mnt;
++}
++
++static inline struct vfsmount *unionfs_lower_mnt(const struct dentry *dent)
++{
++ BUG_ON(!dent);
++ return unionfs_lower_mnt_idx(dent, dbstart(dent));
++}
++
++/* Macros for locking a dentry. */
++enum unionfs_dentry_lock_class {
++ UNIONFS_DMUTEX_NORMAL,
++ UNIONFS_DMUTEX_ROOT,
++ UNIONFS_DMUTEX_PARENT,
++ UNIONFS_DMUTEX_CHILD,
++ UNIONFS_DMUTEX_WHITEOUT,
++ UNIONFS_DMUTEX_REVAL_PARENT, /* for file/dentry revalidate */
++ UNIONFS_DMUTEX_REVAL_CHILD, /* for file/dentry revalidate */
++};
++
++static inline void unionfs_lock_dentry(struct dentry *d,
++ unsigned int subclass)
++{
++ BUG_ON(!d);
++ mutex_lock_nested(&UNIONFS_D(d)->lock, subclass);
++}
++
++static inline void unionfs_unlock_dentry(struct dentry *d)
++{
++ BUG_ON(!d);
++ mutex_unlock(&UNIONFS_D(d)->lock);
++}
++
++static inline struct dentry *unionfs_lock_parent(struct dentry *d,
++ unsigned int subclass)
++{
++ struct dentry *p;
++
++ BUG_ON(!d);
++ p = dget_parent(d);
++ if (p != d)
++ mutex_lock_nested(&UNIONFS_D(p)->lock, subclass);
++ return p;
++}
++
++static inline void unionfs_unlock_parent(struct dentry *d, struct dentry *p)
++{
++ BUG_ON(!d);
++ BUG_ON(!p);
++ if (p != d) {
++ BUG_ON(!mutex_is_locked(&UNIONFS_D(p)->lock));
++ mutex_unlock(&UNIONFS_D(p)->lock);
++ }
++ dput(p);
++}
++
++static inline void verify_locked(struct dentry *d)
++{
++ BUG_ON(!d);
++ BUG_ON(!mutex_is_locked(&UNIONFS_D(d)->lock));
++}
++
++/* macros to put lower objects */
++
++/*
++ * iput lower inodes of an unionfs dentry, from bstart to bend. If
++ * @free_lower is true, then also kfree the memory used to hold the lower
++ * object pointers.
++ */
++static inline void iput_lowers(struct inode *inode,
++ int bstart, int bend, bool free_lower)
++{
++ struct inode *lower_inode;
++ int bindex;
++
++ BUG_ON(!inode);
++ BUG_ON(!UNIONFS_I(inode));
++ BUG_ON(bstart < 0);
++
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ lower_inode = unionfs_lower_inode_idx(inode, bindex);
++ if (lower_inode) {
++ unionfs_set_lower_inode_idx(inode, bindex, NULL);
++ /* see Documentation/filesystems/unionfs/issues.txt */
++ lockdep_off();
++ iput(lower_inode);
++ lockdep_on();
++ }
++ }
++
++ if (free_lower) {
++ kfree(UNIONFS_I(inode)->lower_inodes);
++ UNIONFS_I(inode)->lower_inodes = NULL;
++ }
++}
++
++/* iput all lower inodes, and reset start/end branch indices to -1 */
++static inline void iput_lowers_all(struct inode *inode, bool free_lower)
++{
++ int bstart, bend;
++
++ BUG_ON(!inode);
++ BUG_ON(!UNIONFS_I(inode));
++ bstart = ibstart(inode);
++ bend = ibend(inode);
++ BUG_ON(bstart < 0);
++
++ iput_lowers(inode, bstart, bend, free_lower);
++ ibstart(inode) = ibend(inode) = -1;
++}
++
++/*
++ * dput/mntput all lower dentries and vfsmounts of an unionfs dentry, from
++ * bstart to bend. If @free_lower is true, then also kfree the memory used
++ * to hold the lower object pointers.
++ *
++ * XXX: implement using path_put VFS macros
++ */
++static inline void path_put_lowers(struct dentry *dentry,
++ int bstart, int bend, bool free_lower)
++{
++ struct dentry *lower_dentry;
++ struct vfsmount *lower_mnt;
++ int bindex;
++
++ BUG_ON(!dentry);
++ BUG_ON(!UNIONFS_D(dentry));
++ BUG_ON(bstart < 0);
++
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
++ if (lower_dentry) {
++ unionfs_set_lower_dentry_idx(dentry, bindex, NULL);
++ dput(lower_dentry);
++ }
++ lower_mnt = unionfs_lower_mnt_idx(dentry, bindex);
++ if (lower_mnt) {
++ unionfs_set_lower_mnt_idx(dentry, bindex, NULL);
++ mntput(lower_mnt);
++ }
++ }
++
++ if (free_lower) {
++ kfree(UNIONFS_D(dentry)->lower_paths);
++ UNIONFS_D(dentry)->lower_paths = NULL;
++ }
++}
++
++/*
++ * dput/mntput all lower dentries and vfsmounts, and reset start/end branch
++ * indices to -1.
++ */
++static inline void path_put_lowers_all(struct dentry *dentry, bool free_lower)
++{
++ int bstart, bend;
++
++ BUG_ON(!dentry);
++ BUG_ON(!UNIONFS_D(dentry));
++ bstart = dbstart(dentry);
++ bend = dbend(dentry);
++ BUG_ON(bstart < 0);
++
++ path_put_lowers(dentry, bstart, bend, free_lower);
++ dbstart(dentry) = dbend(dentry) = -1;
++}
++
++#endif /* not _FANOUT_H */
+diff --git a/fs/unionfs/file.c b/fs/unionfs/file.c
+new file mode 100644
+index 0000000..416c52f
+--- /dev/null
++++ b/fs/unionfs/file.c
+@@ -0,0 +1,382 @@
++/*
++ * Copyright (c) 2003-2011 Erez Zadok
++ * Copyright (c) 2003-2006 Charles P. Wright
++ * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
++ * Copyright (c) 2005-2006 Junjiro Okajima
++ * Copyright (c) 2005 Arun M. Krishnakumar
++ * Copyright (c) 2004-2006 David P. Quigley
++ * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
++ * Copyright (c) 2003 Puja Gupta
++ * Copyright (c) 2003 Harikesavan Krishnan
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
++ *
++ * 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 "union.h"
++
++static ssize_t unionfs_read(struct file *file, char __user *buf,
++ size_t count, loff_t *ppos)
++{
++ int err;
++ struct file *lower_file;
++ struct dentry *dentry = file->f_path.dentry;
++ struct dentry *parent;
++
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_PARENT);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ err = unionfs_file_revalidate(file, parent, false);
++ if (unlikely(err))
++ goto out;
++
++ lower_file = unionfs_lower_file(file);
++ err = vfs_read(lower_file, buf, count, ppos);
++ /* update our inode atime upon a successful lower read */
++ if (err >= 0) {
++ fsstack_copy_attr_atime(dentry->d_inode,
++ lower_file->f_path.dentry->d_inode);
++ unionfs_check_file(file);
++ }
++
++out:
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++ return err;
++}
++
++static ssize_t unionfs_write(struct file *file, const char __user *buf,
++ size_t count, loff_t *ppos)
++{
++ int err = 0;
++ struct file *lower_file;
++ struct dentry *dentry = file->f_path.dentry;
++ struct dentry *parent;
++
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_PARENT);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ err = unionfs_file_revalidate(file, parent, true);
++ if (unlikely(err))
++ goto out;
++
++ lower_file = unionfs_lower_file(file);
++ err = vfs_write(lower_file, buf, count, ppos);
++ /* update our inode times+sizes upon a successful lower write */
++ if (err >= 0) {
++ fsstack_copy_inode_size(dentry->d_inode,
++ lower_file->f_path.dentry->d_inode);
++ fsstack_copy_attr_times(dentry->d_inode,
++ lower_file->f_path.dentry->d_inode);
++ UNIONFS_F(file)->wrote_to_file = true; /* for delayed copyup */
++ unionfs_check_file(file);
++ }
++
++out:
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++ return err;
++}
++
++static int unionfs_file_readdir(struct file *file, void *dirent,
++ filldir_t filldir)
++{
++ return -ENOTDIR;
++}
++
++static int unionfs_mmap(struct file *file, struct vm_area_struct *vma)
++{
++ int err = 0;
++ bool willwrite;
++ struct file *lower_file;
++ struct dentry *dentry = file->f_path.dentry;
++ struct dentry *parent;
++ const struct vm_operations_struct *saved_vm_ops = NULL;
++
++ /*
++ * Since mm/memory.c:might_fault() (under PROVE_LOCKING) was
++ * modified in 2.6.29-rc1 to call might_lock_read on mmap_sem, this
++ * has been causing false positives in file system stacking layers.
++ * In particular, our ->mmap is called after sys_mmap2 already holds
++ * mmap_sem, then we lock our own mutexes; but earlier, it's
++ * possible for lockdep to have locked our mutexes first, and then
++ * we call a lower ->readdir which could call might_fault. The
++ * different ordering of the locks is what lockdep complains about
++ * -- unnecessarily. Therefore, we have no choice but to tell
++ * lockdep to temporarily turn off lockdep here. Note: the comments
++ * inside might_sleep also suggest that it would have been
++ * nicer to only annotate paths that needs that might_lock_read.
++ */
++ lockdep_off();
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_PARENT);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ /* This might be deferred to mmap's writepage */
++ willwrite = ((vma->vm_flags | VM_SHARED | VM_WRITE) == vma->vm_flags);
++ err = unionfs_file_revalidate(file, parent, willwrite);
++ if (unlikely(err))
++ goto out;
++ unionfs_check_file(file);
++
++ /*
++ * File systems which do not implement ->writepage may use
++ * generic_file_readonly_mmap as their ->mmap op. If you call
++ * generic_file_readonly_mmap with VM_WRITE, you'd get an -EINVAL.
++ * But we cannot call the lower ->mmap op, so we can't tell that
++ * writeable mappings won't work. Therefore, our only choice is to
++ * check if the lower file system supports the ->writepage, and if
++ * not, return EINVAL (the same error that
++ * generic_file_readonly_mmap returns in that case).
++ */
++ lower_file = unionfs_lower_file(file);
++ if (willwrite && !lower_file->f_mapping->a_ops->writepage) {
++ err = -EINVAL;
++ printk(KERN_ERR "unionfs: branch %d file system does not "
++ "support writeable mmap\n", fbstart(file));
++ goto out;
++ }
++
++ /*
++ * find and save lower vm_ops.
++ *
++ * XXX: the VFS should have a cleaner way of finding the lower vm_ops
++ */
++ if (!UNIONFS_F(file)->lower_vm_ops) {
++ err = lower_file->f_op->mmap(lower_file, vma);
++ if (err) {
++ printk(KERN_ERR "unionfs: lower mmap failed %d\n", err);
++ goto out;
++ }
++ saved_vm_ops = vma->vm_ops;
++ err = do_munmap(current->mm, vma->vm_start,
++ vma->vm_end - vma->vm_start);
++ if (err) {
++ printk(KERN_ERR "unionfs: do_munmap failed %d\n", err);
++ goto out;
++ }
++ }
++
++ file->f_mapping->a_ops = &unionfs_dummy_aops;
++ err = generic_file_mmap(file, vma);
++ file->f_mapping->a_ops = &unionfs_aops;
++ if (err) {
++ printk(KERN_ERR "unionfs: generic_file_mmap failed %d\n", err);
++ goto out;
++ }
++ vma->vm_ops = &unionfs_vm_ops;
++ if (!UNIONFS_F(file)->lower_vm_ops)
++ UNIONFS_F(file)->lower_vm_ops = saved_vm_ops;
++
++out:
++ if (!err) {
++ /* copyup could cause parent dir times to change */
++ unionfs_copy_attr_times(parent->d_inode);
++ unionfs_check_file(file);
++ }
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++ lockdep_on();
++ return err;
++}
++
++int unionfs_fsync(struct file *file, int datasync)
++{
++ int bindex, bstart, bend;
++ struct file *lower_file;
++ struct dentry *dentry = file->f_path.dentry;
++ struct dentry *lower_dentry;
++ struct dentry *parent;
++ struct inode *lower_inode, *inode;
++ int err = -EINVAL;
++
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_PARENT);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ err = unionfs_file_revalidate(file, parent, true);
++ if (unlikely(err))
++ goto out;
++ unionfs_check_file(file);
++
++ bstart = fbstart(file);
++ bend = fbend(file);
++ if (bstart < 0 || bend < 0)
++ goto out;
++
++ inode = dentry->d_inode;
++ if (unlikely(!inode)) {
++ printk(KERN_ERR
++ "unionfs: null lower inode in unionfs_fsync\n");
++ goto out;
++ }
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ lower_inode = unionfs_lower_inode_idx(inode, bindex);
++ if (!lower_inode || !lower_inode->i_fop->fsync)
++ continue;
++ lower_file = unionfs_lower_file_idx(file, bindex);
++ lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
++ mutex_lock(&lower_inode->i_mutex);
++ err = lower_inode->i_fop->fsync(lower_file, datasync);
++ if (!err && bindex == bstart)
++ fsstack_copy_attr_times(inode, lower_inode);
++ mutex_unlock(&lower_inode->i_mutex);
++ if (err)
++ goto out;
++ }
++
++out:
++ if (!err)
++ unionfs_check_file(file);
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++ return err;
++}
++
++int unionfs_fasync(int fd, struct file *file, int flag)
++{
++ int bindex, bstart, bend;
++ struct file *lower_file;
++ struct dentry *dentry = file->f_path.dentry;
++ struct dentry *parent;
++ struct inode *lower_inode, *inode;
++ int err = 0;
++
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_PARENT);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ err = unionfs_file_revalidate(file, parent, true);
++ if (unlikely(err))
++ goto out;
++ unionfs_check_file(file);
++
++ bstart = fbstart(file);
++ bend = fbend(file);
++ if (bstart < 0 || bend < 0)
++ goto out;
++
++ inode = dentry->d_inode;
++ if (unlikely(!inode)) {
++ printk(KERN_ERR
++ "unionfs: null lower inode in unionfs_fasync\n");
++ goto out;
++ }
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ lower_inode = unionfs_lower_inode_idx(inode, bindex);
++ if (!lower_inode || !lower_inode->i_fop->fasync)
++ continue;
++ lower_file = unionfs_lower_file_idx(file, bindex);
++ mutex_lock(&lower_inode->i_mutex);
++ err = lower_inode->i_fop->fasync(fd, lower_file, flag);
++ if (!err && bindex == bstart)
++ fsstack_copy_attr_times(inode, lower_inode);
++ mutex_unlock(&lower_inode->i_mutex);
++ if (err)
++ goto out;
++ }
++
++out:
++ if (!err)
++ unionfs_check_file(file);
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++ return err;
++}
++
++static ssize_t unionfs_splice_read(struct file *file, loff_t *ppos,
++ struct pipe_inode_info *pipe, size_t len,
++ unsigned int flags)
++{
++ ssize_t err;
++ struct file *lower_file;
++ struct dentry *dentry = file->f_path.dentry;
++ struct dentry *parent;
++
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_PARENT);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ err = unionfs_file_revalidate(file, parent, false);
++ if (unlikely(err))
++ goto out;
++
++ lower_file = unionfs_lower_file(file);
++ err = vfs_splice_to(lower_file, ppos, pipe, len, flags);
++ /* update our inode atime upon a successful lower splice-read */
++ if (err >= 0) {
++ fsstack_copy_attr_atime(dentry->d_inode,
++ lower_file->f_path.dentry->d_inode);
++ unionfs_check_file(file);
++ }
++
++out:
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++ return err;
++}
++
++static ssize_t unionfs_splice_write(struct pipe_inode_info *pipe,
++ struct file *file, loff_t *ppos,
++ size_t len, unsigned int flags)
++{
++ ssize_t err = 0;
++ struct file *lower_file;
++ struct dentry *dentry = file->f_path.dentry;
++ struct dentry *parent;
++
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_PARENT);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ err = unionfs_file_revalidate(file, parent, true);
++ if (unlikely(err))
++ goto out;
++
++ lower_file = unionfs_lower_file(file);
++ err = vfs_splice_from(pipe, lower_file, ppos, len, flags);
++ /* update our inode times+sizes upon a successful lower write */
++ if (err >= 0) {
++ fsstack_copy_inode_size(dentry->d_inode,
++ lower_file->f_path.dentry->d_inode);
++ fsstack_copy_attr_times(dentry->d_inode,
++ lower_file->f_path.dentry->d_inode);
++ unionfs_check_file(file);
++ }
++
++out:
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++ return err;
++}
++
++struct file_operations unionfs_main_fops = {
++ .llseek = generic_file_llseek,
++ .read = unionfs_read,
++ .write = unionfs_write,
++ .readdir = unionfs_file_readdir,
++ .unlocked_ioctl = unionfs_ioctl,
++#ifdef CONFIG_COMPAT
++ .compat_ioctl = unionfs_ioctl,
++#endif
++ .mmap = unionfs_mmap,
++ .open = unionfs_open,
++ .flush = unionfs_flush,
++ .release = unionfs_file_release,
++ .fsync = unionfs_fsync,
++ .fasync = unionfs_fasync,
++ .splice_read = unionfs_splice_read,
++ .splice_write = unionfs_splice_write,
++};
+diff --git a/fs/unionfs/inode.c b/fs/unionfs/inode.c
+new file mode 100644
+index 0000000..b207c13
+--- /dev/null
++++ b/fs/unionfs/inode.c
+@@ -0,0 +1,1099 @@
++/*
++ * Copyright (c) 2003-2011 Erez Zadok
++ * Copyright (c) 2003-2006 Charles P. Wright
++ * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
++ * Copyright (c) 2005-2006 Junjiro Okajima
++ * Copyright (c) 2005 Arun M. Krishnakumar
++ * Copyright (c) 2004-2006 David P. Quigley
++ * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
++ * Copyright (c) 2003 Puja Gupta
++ * Copyright (c) 2003 Harikesavan Krishnan
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
++ *
++ * 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 "union.h"
++
++/*
++ * Find a writeable branch to create new object in. Checks all writeble
++ * branches of the parent inode, from istart to iend order; if none are
++ * suitable, also tries branch 0 (which may require a copyup).
++ *
++ * Return a lower_dentry we can use to create object in, or ERR_PTR.
++ */
++static struct dentry *find_writeable_branch(struct inode *parent,
++ struct dentry *dentry)
++{
++ int err = -EINVAL;
++ int bindex, istart, iend;
++ struct dentry *lower_dentry = NULL;
++
++ istart = ibstart(parent);
++ iend = ibend(parent);
++ if (istart < 0)
++ goto out;
++
++begin:
++ for (bindex = istart; bindex <= iend; bindex++) {
++ /* skip non-writeable branches */
++ err = is_robranch_super(dentry->d_sb, bindex);
++ if (err) {
++ err = -EROFS;
++ continue;
++ }
++ lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
++ if (!lower_dentry)
++ continue;
++ /*
++ * check for whiteouts in writeable branch, and remove them
++ * if necessary.
++ */
++ err = check_unlink_whiteout(dentry, lower_dentry, bindex);
++ if (err > 0) /* ignore if whiteout found and removed */
++ err = 0;
++ if (err)
++ continue;
++ /* if get here, we can write to the branch */
++ break;
++ }
++ /*
++ * If istart wasn't already branch 0, and we got any error, then try
++ * branch 0 (which may require copyup)
++ */
++ if (err && istart > 0) {
++ istart = iend = 0;
++ goto begin;
++ }
++
++ /*
++ * If we tried even branch 0, and still got an error, abort. But if
++ * the error was an EROFS, then we should try to copyup.
++ */
++ if (err && err != -EROFS)
++ goto out;
++
++ /*
++ * If we get here, then check if copyup needed. If lower_dentry is
++ * NULL, create the entire dentry directory structure in branch 0.
++ */
++ if (!lower_dentry) {
++ bindex = 0;
++ lower_dentry = create_parents(parent, dentry,
++ dentry->d_name.name, bindex);
++ if (IS_ERR(lower_dentry)) {
++ err = PTR_ERR(lower_dentry);
++ goto out;
++ }
++ }
++ err = 0; /* all's well */
++out:
++ if (err)
++ return ERR_PTR(err);
++ return lower_dentry;
++}
++
++static int unionfs_create(struct inode *dir, struct dentry *dentry,
++ int mode, struct nameidata *nd_unused)
++{
++ int err = 0;
++ struct dentry *lower_dentry = NULL;
++ struct dentry *lower_parent_dentry = NULL;
++ struct dentry *parent;
++ int valid = 0;
++ struct nameidata lower_nd;
++
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_CHILD);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ valid = __unionfs_d_revalidate(dentry, parent, false);
++ if (unlikely(!valid)) {
++ err = -ESTALE; /* same as what real_lookup does */
++ goto out;
++ }
++
++ lower_dentry = find_writeable_branch(dir, dentry);
++ if (IS_ERR(lower_dentry)) {
++ err = PTR_ERR(lower_dentry);
++ goto out;
++ }
++
++ lower_parent_dentry = lock_parent(lower_dentry);
++ if (IS_ERR(lower_parent_dentry)) {
++ err = PTR_ERR(lower_parent_dentry);
++ goto out_unlock;
++ }
++
++ err = init_lower_nd(&lower_nd, LOOKUP_CREATE);
++ if (unlikely(err < 0))
++ goto out_unlock;
++ err = vfs_create(lower_parent_dentry->d_inode, lower_dentry, mode,
++ &lower_nd);
++ release_lower_nd(&lower_nd, err);
++
++ if (!err) {
++ err = PTR_ERR(unionfs_interpose(dentry, dir->i_sb, 0));
++ if (!err) {
++ unionfs_copy_attr_times(dir);
++ fsstack_copy_inode_size(dir,
++ lower_parent_dentry->d_inode);
++ /* update no. of links on parent directory */
++ dir->i_nlink = unionfs_get_nlinks(dir);
++ }
++ }
++
++out_unlock:
++ unlock_dir(lower_parent_dentry);
++out:
++ if (!err) {
++ unionfs_postcopyup_setmnt(dentry);
++ unionfs_check_inode(dir);
++ unionfs_check_dentry(dentry);
++ }
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++ return err;
++}
++
++/*
++ * unionfs_lookup is the only special function which takes a dentry, yet we
++ * do NOT want to call __unionfs_d_revalidate_chain because by definition,
++ * we don't have a valid dentry here yet.
++ */
++static struct dentry *unionfs_lookup(struct inode *dir,
++ struct dentry *dentry,
++ struct nameidata *nd_unused)
++{
++ struct dentry *ret, *parent;
++ int err = 0;
++
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_CHILD);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++
++ /*
++ * As long as we lock/dget the parent, then can skip validating the
++ * parent now; we may have to rebuild this dentry on the next
++ * ->d_revalidate, however.
++ */
++
++ /* allocate dentry private data. We free it in ->d_release */
++ err = new_dentry_private_data(dentry, UNIONFS_DMUTEX_CHILD);
++ if (unlikely(err)) {
++ ret = ERR_PTR(err);
++ goto out;
++ }
++
++ ret = unionfs_lookup_full(dentry, parent, INTERPOSE_LOOKUP);
++
++ if (!IS_ERR(ret)) {
++ if (ret)
++ dentry = ret;
++ /* lookup_full can return multiple positive dentries */
++ if (dentry->d_inode && !S_ISDIR(dentry->d_inode->i_mode)) {
++ BUG_ON(dbstart(dentry) < 0);
++ unionfs_postcopyup_release(dentry);
++ }
++ unionfs_copy_attr_times(dentry->d_inode);
++ }
++
++ unionfs_check_inode(dir);
++ if (!IS_ERR(ret))
++ unionfs_check_dentry(dentry);
++ unionfs_check_dentry(parent);
++ unionfs_unlock_dentry(dentry); /* locked in new_dentry_private data */
++
++out:
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++
++ return ret;
++}
++
++static int unionfs_link(struct dentry *old_dentry, struct inode *dir,
++ struct dentry *new_dentry)
++{
++ int err = 0;
++ struct dentry *lower_old_dentry = NULL;
++ struct dentry *lower_new_dentry = NULL;
++ struct dentry *lower_dir_dentry = NULL;
++ struct dentry *old_parent, *new_parent;
++ char *name = NULL;
++ bool valid;
++
++ unionfs_read_lock(old_dentry->d_sb, UNIONFS_SMUTEX_CHILD);
++ old_parent = dget_parent(old_dentry);
++ new_parent = dget_parent(new_dentry);
++ unionfs_double_lock_parents(old_parent, new_parent);
++ unionfs_double_lock_dentry(old_dentry, new_dentry);
++
++ valid = __unionfs_d_revalidate(old_dentry, old_parent, false);
++ if (unlikely(!valid)) {
++ err = -ESTALE;
++ goto out;
++ }
++ if (new_dentry->d_inode) {
++ valid = __unionfs_d_revalidate(new_dentry, new_parent, false);
++ if (unlikely(!valid)) {
++ err = -ESTALE;
++ goto out;
++ }
++ }
++
++ lower_new_dentry = unionfs_lower_dentry(new_dentry);
++
++ /* check for a whiteout in new dentry branch, and delete it */
++ err = check_unlink_whiteout(new_dentry, lower_new_dentry,
++ dbstart(new_dentry));
++ if (err > 0) { /* whiteout found and removed successfully */
++ lower_dir_dentry = dget_parent(lower_new_dentry);
++ fsstack_copy_attr_times(dir, lower_dir_dentry->d_inode);
++ dput(lower_dir_dentry);
++ dir->i_nlink = unionfs_get_nlinks(dir);
++ err = 0;
++ }
++ if (err)
++ goto out;
++
++ /* check if parent hierachy is needed, then link in same branch */
++ if (dbstart(old_dentry) != dbstart(new_dentry)) {
++ lower_new_dentry = create_parents(dir, new_dentry,
++ new_dentry->d_name.name,
++ dbstart(old_dentry));
++ err = PTR_ERR(lower_new_dentry);
++ if (IS_COPYUP_ERR(err))
++ goto docopyup;
++ if (!lower_new_dentry || IS_ERR(lower_new_dentry))
++ goto out;
++ }
++ lower_new_dentry = unionfs_lower_dentry(new_dentry);
++ lower_old_dentry = unionfs_lower_dentry(old_dentry);
++
++ BUG_ON(dbstart(old_dentry) != dbstart(new_dentry));
++ lower_dir_dentry = lock_parent(lower_new_dentry);
++ err = is_robranch(old_dentry);
++ if (!err) {
++ /* see Documentation/filesystems/unionfs/issues.txt */
++ lockdep_off();
++ err = vfs_link(lower_old_dentry, lower_dir_dentry->d_inode,
++ lower_new_dentry);
++ lockdep_on();
++ }
++ unlock_dir(lower_dir_dentry);
++
++docopyup:
++ if (IS_COPYUP_ERR(err)) {
++ int old_bstart = dbstart(old_dentry);
++ int bindex;
++
++ for (bindex = old_bstart - 1; bindex >= 0; bindex--) {
++ err = copyup_dentry(old_parent->d_inode,
++ old_dentry, old_bstart,
++ bindex, old_dentry->d_name.name,
++ old_dentry->d_name.len, NULL,
++ i_size_read(old_dentry->d_inode));
++ if (err)
++ continue;
++ lower_new_dentry =
++ create_parents(dir, new_dentry,
++ new_dentry->d_name.name,
++ bindex);
++ lower_old_dentry = unionfs_lower_dentry(old_dentry);
++ lower_dir_dentry = lock_parent(lower_new_dentry);
++ /* see Documentation/filesystems/unionfs/issues.txt */
++ lockdep_off();
++ /* do vfs_link */
++ err = vfs_link(lower_old_dentry,
++ lower_dir_dentry->d_inode,
++ lower_new_dentry);
++ lockdep_on();
++ unlock_dir(lower_dir_dentry);
++ goto check_link;
++ }
++ goto out;
++ }
++
++check_link:
++ if (err || !lower_new_dentry->d_inode)
++ goto out;
++
++ /* Its a hard link, so use the same inode */
++ new_dentry->d_inode = igrab(old_dentry->d_inode);
++ d_add(new_dentry, new_dentry->d_inode);
++ unionfs_copy_attr_all(dir, lower_new_dentry->d_parent->d_inode);
++ fsstack_copy_inode_size(dir, lower_new_dentry->d_parent->d_inode);
++
++ /* propagate number of hard-links */
++ old_dentry->d_inode->i_nlink = unionfs_get_nlinks(old_dentry->d_inode);
++ /* new dentry's ctime may have changed due to hard-link counts */
++ unionfs_copy_attr_times(new_dentry->d_inode);
++
++out:
++ if (!new_dentry->d_inode)
++ d_drop(new_dentry);
++
++ kfree(name);
++ if (!err)
++ unionfs_postcopyup_setmnt(new_dentry);
++
++ unionfs_check_inode(dir);
++ unionfs_check_dentry(new_dentry);
++ unionfs_check_dentry(old_dentry);
++
++ unionfs_double_unlock_dentry(old_dentry, new_dentry);
++ unionfs_double_unlock_parents(old_parent, new_parent);
++ dput(new_parent);
++ dput(old_parent);
++ unionfs_read_unlock(old_dentry->d_sb);
++
++ return err;
++}
++
++static int unionfs_symlink(struct inode *dir, struct dentry *dentry,
++ const char *symname)
++{
++ int err = 0;
++ struct dentry *lower_dentry = NULL;
++ struct dentry *wh_dentry = NULL;
++ struct dentry *lower_parent_dentry = NULL;
++ struct dentry *parent;
++ char *name = NULL;
++ int valid = 0;
++ umode_t mode;
++
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_CHILD);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ valid = __unionfs_d_revalidate(dentry, parent, false);
++ if (unlikely(!valid)) {
++ err = -ESTALE;
++ goto out;
++ }
++
++ /*
++ * It's only a bug if this dentry was not negative and couldn't be
++ * revalidated (shouldn't happen).
++ */
++ BUG_ON(!valid && dentry->d_inode);
++
++ lower_dentry = find_writeable_branch(dir, dentry);
++ if (IS_ERR(lower_dentry)) {
++ err = PTR_ERR(lower_dentry);
++ goto out;
++ }
++
++ lower_parent_dentry = lock_parent(lower_dentry);
++ if (IS_ERR(lower_parent_dentry)) {
++ err = PTR_ERR(lower_parent_dentry);
++ goto out_unlock;
++ }
++
++ mode = S_IALLUGO;
++ err = vfs_symlink(lower_parent_dentry->d_inode, lower_dentry, symname);
++ if (!err) {
++ err = PTR_ERR(unionfs_interpose(dentry, dir->i_sb, 0));
++ if (!err) {
++ unionfs_copy_attr_times(dir);
++ fsstack_copy_inode_size(dir,
++ lower_parent_dentry->d_inode);
++ /* update no. of links on parent directory */
++ dir->i_nlink = unionfs_get_nlinks(dir);
++ }
++ }
++
++out_unlock:
++ unlock_dir(lower_parent_dentry);
++out:
++ dput(wh_dentry);
++ kfree(name);
++
++ if (!err) {
++ unionfs_postcopyup_setmnt(dentry);
++ unionfs_check_inode(dir);
++ unionfs_check_dentry(dentry);
++ }
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++ return err;
++}
++
++static int unionfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
++{
++ int err = 0;
++ struct dentry *lower_dentry = NULL;
++ struct dentry *lower_parent_dentry = NULL;
++ struct dentry *parent;
++ int bindex = 0, bstart;
++ char *name = NULL;
++ int valid;
++
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_CHILD);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ valid = __unionfs_d_revalidate(dentry, parent, false);
++ if (unlikely(!valid)) {
++ err = -ESTALE; /* same as what real_lookup does */
++ goto out;
++ }
++
++ bstart = dbstart(dentry);
++
++ lower_dentry = unionfs_lower_dentry(dentry);
++
++ /* check for a whiteout in new dentry branch, and delete it */
++ err = check_unlink_whiteout(dentry, lower_dentry, bstart);
++ if (err > 0) /* whiteout found and removed successfully */
++ err = 0;
++ if (err) {
++ /* exit if the error returned was NOT -EROFS */
++ if (!IS_COPYUP_ERR(err))
++ goto out;
++ bstart--;
++ }
++
++ /* check if copyup's needed, and mkdir */
++ for (bindex = bstart; bindex >= 0; bindex--) {
++ int i;
++ int bend = dbend(dentry);
++
++ if (is_robranch_super(dentry->d_sb, bindex))
++ continue;
++
++ lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
++ if (!lower_dentry) {
++ lower_dentry = create_parents(dir, dentry,
++ dentry->d_name.name,
++ bindex);
++ if (!lower_dentry || IS_ERR(lower_dentry)) {
++ printk(KERN_ERR "unionfs: lower dentry "
++ " NULL for bindex = %d\n", bindex);
++ continue;
++ }
++ }
++
++ lower_parent_dentry = lock_parent(lower_dentry);
++
++ if (IS_ERR(lower_parent_dentry)) {
++ err = PTR_ERR(lower_parent_dentry);
++ goto out;
++ }
++
++ err = vfs_mkdir(lower_parent_dentry->d_inode, lower_dentry,
++ mode);
++
++ unlock_dir(lower_parent_dentry);
++
++ /* did the mkdir succeed? */
++ if (err)
++ break;
++
++ for (i = bindex + 1; i <= bend; i++) {
++ /* XXX: use path_put_lowers? */
++ if (unionfs_lower_dentry_idx(dentry, i)) {
++ dput(unionfs_lower_dentry_idx(dentry, i));
++ unionfs_set_lower_dentry_idx(dentry, i, NULL);
++ }
++ }
++ dbend(dentry) = bindex;
++
++ /*
++ * Only INTERPOSE_LOOKUP can return a value other than 0 on
++ * err.
++ */
++ err = PTR_ERR(unionfs_interpose(dentry, dir->i_sb, 0));
++ if (!err) {
++ unionfs_copy_attr_times(dir);
++ fsstack_copy_inode_size(dir,
++ lower_parent_dentry->d_inode);
++
++ /* update number of links on parent directory */
++ dir->i_nlink = unionfs_get_nlinks(dir);
++ }
++
++ err = make_dir_opaque(dentry, dbstart(dentry));
++ if (err) {
++ printk(KERN_ERR "unionfs: mkdir: error creating "
++ ".wh.__dir_opaque: %d\n", err);
++ goto out;
++ }
++
++ /* we are done! */
++ break;
++ }
++
++out:
++ if (!dentry->d_inode)
++ d_drop(dentry);
++
++ kfree(name);
++
++ if (!err) {
++ unionfs_copy_attr_times(dentry->d_inode);
++ unionfs_postcopyup_setmnt(dentry);
++ }
++ unionfs_check_inode(dir);
++ unionfs_check_dentry(dentry);
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++
++ return err;
++}
++
++static int unionfs_mknod(struct inode *dir, struct dentry *dentry, int mode,
++ dev_t dev)
++{
++ int err = 0;
++ struct dentry *lower_dentry = NULL;
++ struct dentry *wh_dentry = NULL;
++ struct dentry *lower_parent_dentry = NULL;
++ struct dentry *parent;
++ char *name = NULL;
++ int valid = 0;
++
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_CHILD);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ valid = __unionfs_d_revalidate(dentry, parent, false);
++ if (unlikely(!valid)) {
++ err = -ESTALE;
++ goto out;
++ }
++
++ /*
++ * It's only a bug if this dentry was not negative and couldn't be
++ * revalidated (shouldn't happen).
++ */
++ BUG_ON(!valid && dentry->d_inode);
++
++ lower_dentry = find_writeable_branch(dir, dentry);
++ if (IS_ERR(lower_dentry)) {
++ err = PTR_ERR(lower_dentry);
++ goto out;
++ }
++
++ lower_parent_dentry = lock_parent(lower_dentry);
++ if (IS_ERR(lower_parent_dentry)) {
++ err = PTR_ERR(lower_parent_dentry);
++ goto out_unlock;
++ }
++
++ err = vfs_mknod(lower_parent_dentry->d_inode, lower_dentry, mode, dev);
++ if (!err) {
++ err = PTR_ERR(unionfs_interpose(dentry, dir->i_sb, 0));
++ if (!err) {
++ unionfs_copy_attr_times(dir);
++ fsstack_copy_inode_size(dir,
++ lower_parent_dentry->d_inode);
++ /* update no. of links on parent directory */
++ dir->i_nlink = unionfs_get_nlinks(dir);
++ }
++ }
++
++out_unlock:
++ unlock_dir(lower_parent_dentry);
++out:
++ dput(wh_dentry);
++ kfree(name);
++
++ if (!err) {
++ unionfs_postcopyup_setmnt(dentry);
++ unionfs_check_inode(dir);
++ unionfs_check_dentry(dentry);
++ }
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++ return err;
++}
++
++/* requires sb, dentry, and parent to already be locked */
++static int __unionfs_readlink(struct dentry *dentry, char __user *buf,
++ int bufsiz)
++{
++ int err;
++ struct dentry *lower_dentry;
++
++ lower_dentry = unionfs_lower_dentry(dentry);
++
++ if (!lower_dentry->d_inode->i_op ||
++ !lower_dentry->d_inode->i_op->readlink) {
++ err = -EINVAL;
++ goto out;
++ }
++
++ err = lower_dentry->d_inode->i_op->readlink(lower_dentry,
++ buf, bufsiz);
++ if (err >= 0)
++ fsstack_copy_attr_atime(dentry->d_inode,
++ lower_dentry->d_inode);
++
++out:
++ return err;
++}
++
++static int unionfs_readlink(struct dentry *dentry, char __user *buf,
++ int bufsiz)
++{
++ int err;
++ struct dentry *parent;
++
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_CHILD);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ if (unlikely(!__unionfs_d_revalidate(dentry, parent, false))) {
++ err = -ESTALE;
++ goto out;
++ }
++
++ err = __unionfs_readlink(dentry, buf, bufsiz);
++
++out:
++ unionfs_check_dentry(dentry);
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++
++ return err;
++}
++
++static void *unionfs_follow_link(struct dentry *dentry, struct nameidata *nd)
++{
++ char *buf;
++ int len = PAGE_SIZE, err;
++ mm_segment_t old_fs;
++ struct dentry *parent;
++
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_CHILD);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ /* This is freed by the put_link method assuming a successful call. */
++ buf = kmalloc(len, GFP_KERNEL);
++ if (unlikely(!buf)) {
++ err = -ENOMEM;
++ goto out;
++ }
++
++ /* read the symlink, and then we will follow it */
++ old_fs = get_fs();
++ set_fs(KERNEL_DS);
++ err = __unionfs_readlink(dentry, buf, len);
++ set_fs(old_fs);
++ if (err < 0) {
++ kfree(buf);
++ buf = NULL;
++ goto out;
++ }
++ buf[err] = 0;
++ nd_set_link(nd, buf);
++ err = 0;
++
++out:
++ if (err >= 0) {
++ unionfs_check_nd(nd);
++ unionfs_check_dentry(dentry);
++ }
++
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++
++ return ERR_PTR(err);
++}
++
++/* this @nd *IS* still used */
++static void unionfs_put_link(struct dentry *dentry, struct nameidata *nd,
++ void *cookie)
++{
++ struct dentry *parent;
++ char *buf;
++
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_CHILD);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ if (unlikely(!__unionfs_d_revalidate(dentry, parent, false)))
++ printk(KERN_ERR
++ "unionfs: put_link failed to revalidate dentry\n");
++
++ unionfs_check_dentry(dentry);
++#if 0
++ /* XXX: can't run this check b/c this fxn can receive a poisoned 'nd' PTR */
++ unionfs_check_nd(nd);
++#endif
++ buf = nd_get_link(nd);
++ if (!IS_ERR(buf))
++ kfree(buf);
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++}
++
++/*
++ * This is a variant of fs/namei.c:permission() or inode_permission() which
++ * skips over EROFS tests (because we perform copyup on EROFS).
++ */
++static int __inode_permission(struct inode *inode, int mask, unsigned int flags)
++{
++ int retval;
++
++ /* nobody gets write access to an immutable file */
++ if ((mask & MAY_WRITE) && IS_IMMUTABLE(inode))
++ return -EACCES;
++
++ /* Ordinary permission routines do not understand MAY_APPEND. */
++ if (inode->i_op && inode->i_op->permission) {
++ retval = inode->i_op->permission(inode, mask, flags);
++ if (!retval) {
++ /*
++ * Exec permission on a regular file is denied if none
++ * of the execute bits are set.
++ *
++ * This check should be done by the ->permission()
++ * method.
++ */
++ if ((mask & MAY_EXEC) && S_ISREG(inode->i_mode) &&
++ !(inode->i_mode & S_IXUGO))
++ return -EACCES;
++ }
++ } else {
++ retval = generic_permission(inode, mask, flags, NULL);
++ }
++ if (retval)
++ return retval;
++
++ return security_inode_permission(inode,
++ mask & (MAY_READ|MAY_WRITE|MAY_EXEC|MAY_APPEND));
++}
++
++/*
++ * Don't grab the superblock read-lock in unionfs_permission, which prevents
++ * a deadlock with the branch-management "add branch" code (which grabbed
++ * the write lock). It is safe to not grab the read lock here, because even
++ * with branch management taking place, there is no chance that
++ * unionfs_permission, or anything it calls, will use stale branch
++ * information.
++ */
++static int unionfs_permission(struct inode *inode, int mask, unsigned int flags)
++{
++ struct inode *lower_inode = NULL;
++ int err = 0;
++ int bindex, bstart, bend;
++ int is_file;
++ const int write_mask = (mask & MAY_WRITE) && !(mask & MAY_READ);
++ struct inode *inode_grabbed;
++ struct dentry *dentry;
++
++ if (flags & IPERM_FLAG_RCU) {
++ err = -ECHILD;
++ goto out_nograb;
++ }
++
++ dentry = d_find_alias(inode);
++ if (dentry)
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ inode_grabbed = igrab(inode);
++ is_file = !S_ISDIR(inode->i_mode);
++
++ if (!UNIONFS_I(inode)->lower_inodes) {
++ if (is_file) /* dirs can be unlinked but chdir'ed to */
++ err = -ESTALE; /* force revalidate */
++ goto out;
++ }
++ bstart = ibstart(inode);
++ bend = ibend(inode);
++ if (unlikely(bstart < 0 || bend < 0)) {
++ /*
++ * With branch-management, we can get a stale inode here.
++ * If so, we return ESTALE back to link_path_walk, which
++ * would discard the dcache entry and re-lookup the
++ * dentry+inode. This should be equivalent to issuing
++ * __unionfs_d_revalidate_chain on nd.dentry here.
++ */
++ if (is_file) /* dirs can be unlinked but chdir'ed to */
++ err = -ESTALE; /* force revalidate */
++ goto out;
++ }
++
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ lower_inode = unionfs_lower_inode_idx(inode, bindex);
++ if (!lower_inode)
++ continue;
++
++ /*
++ * check the condition for D-F-D underlying files/directories,
++ * we don't have to check for files, if we are checking for
++ * directories.
++ */
++ if (!is_file && !S_ISDIR(lower_inode->i_mode))
++ continue;
++
++ /*
++ * We check basic permissions, but we ignore any conditions
++ * such as readonly file systems or branches marked as
++ * readonly, because those conditions should lead to a
++ * copyup taking place later on. However, if user never had
++ * access to the file, then no copyup could ever take place.
++ */
++ err = __inode_permission(lower_inode, mask, flags);
++ if (err && err != -EACCES && err != EPERM && bindex > 0) {
++ umode_t mode = lower_inode->i_mode;
++ if ((is_robranch_super(inode->i_sb, bindex) ||
++ __is_rdonly(lower_inode)) &&
++ (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)))
++ err = 0;
++ if (IS_COPYUP_ERR(err))
++ err = 0;
++ }
++
++ /*
++ * NFS HACK: NFSv2/3 return EACCES on readonly-exported,
++ * locally readonly-mounted file systems, instead of EROFS
++ * like other file systems do. So we have no choice here
++ * but to intercept this and ignore it for NFS branches
++ * marked readonly. Specifically, we avoid using NFS's own
++ * "broken" ->permission method, and rely on
++ * generic_permission() to do basic checking for us.
++ */
++ if (err && err == -EACCES &&
++ is_robranch_super(inode->i_sb, bindex) &&
++ lower_inode->i_sb->s_magic == NFS_SUPER_MAGIC)
++ err = generic_permission(lower_inode, mask, flags, NULL);
++
++ /*
++ * The permissions are an intersection of the overall directory
++ * permissions, so we fail if one fails.
++ */
++ if (err)
++ goto out;
++
++ /* only the leftmost file matters. */
++ if (is_file || write_mask) {
++ if (is_file && write_mask) {
++ err = get_write_access(lower_inode);
++ if (!err)
++ put_write_access(lower_inode);
++ }
++ break;
++ }
++ }
++ /* sync times which may have changed (asynchronously) below */
++ unionfs_copy_attr_times(inode);
++
++out:
++ unionfs_check_inode(inode);
++ if (dentry) {
++ unionfs_unlock_dentry(dentry);
++ dput(dentry);
++ }
++ iput(inode_grabbed);
++out_nograb:
++ return err;
++}
++
++static int unionfs_setattr(struct dentry *dentry, struct iattr *ia)
++{
++ int err = 0;
++ struct dentry *lower_dentry;
++ struct dentry *parent;
++ struct inode *inode;
++ struct inode *lower_inode;
++ int bstart, bend, bindex;
++ loff_t size;
++ struct iattr lower_ia;
++
++ /* check if user has permission to change inode */
++ err = inode_change_ok(dentry->d_inode, ia);
++ if (err)
++ goto out_err;
++
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_CHILD);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ if (unlikely(!__unionfs_d_revalidate(dentry, parent, false))) {
++ err = -ESTALE;
++ goto out;
++ }
++
++ bstart = dbstart(dentry);
++ bend = dbend(dentry);
++ inode = dentry->d_inode;
++
++ /*
++ * mode change is for clearing setuid/setgid. Allow lower filesystem
++ * to reinterpret it in its own way.
++ */
++ if (ia->ia_valid & (ATTR_KILL_SUID | ATTR_KILL_SGID))
++ ia->ia_valid &= ~ATTR_MODE;
++
++ lower_dentry = unionfs_lower_dentry(dentry);
++ if (!lower_dentry) { /* should never happen after above revalidate */
++ err = -EINVAL;
++ goto out;
++ }
++
++ /*
++ * Get the lower inode directly from lower dentry, in case ibstart
++ * is -1 (which happens when the file is open but unlinked.
++ */
++ lower_inode = lower_dentry->d_inode;
++
++ /* check if user has permission to change lower inode */
++ err = inode_change_ok(lower_inode, ia);
++ if (err)
++ goto out;
++
++ /* copyup if the file is on a read only branch */
++ if (is_robranch_super(dentry->d_sb, bstart)
++ || __is_rdonly(lower_inode)) {
++ /* check if we have a branch to copy up to */
++ if (bstart <= 0) {
++ err = -EACCES;
++ goto out;
++ }
++
++ if (ia->ia_valid & ATTR_SIZE)
++ size = ia->ia_size;
++ else
++ size = i_size_read(inode);
++ /* copyup to next available branch */
++ for (bindex = bstart - 1; bindex >= 0; bindex--) {
++ err = copyup_dentry(parent->d_inode,
++ dentry, bstart, bindex,
++ dentry->d_name.name,
++ dentry->d_name.len,
++ NULL, size);
++ if (!err)
++ break;
++ }
++ if (err)
++ goto out;
++ /* get updated lower_dentry/inode after copyup */
++ lower_dentry = unionfs_lower_dentry(dentry);
++ lower_inode = unionfs_lower_inode(inode);
++ /*
++ * check for whiteouts in writeable branch, and remove them
++ * if necessary.
++ */
++ if (lower_dentry) {
++ err = check_unlink_whiteout(dentry, lower_dentry,
++ bindex);
++ if (err > 0) /* ignore if whiteout found and removed */
++ err = 0;
++ }
++ }
++
++ /*
++ * If shrinking, first truncate upper level to cancel writing dirty
++ * pages beyond the new eof; and also if its' maxbytes is more
++ * limiting (fail with -EFBIG before making any change to the lower
++ * level). There is no need to vmtruncate the upper level
++ * afterwards in the other cases: we fsstack_copy_inode_size from
++ * the lower level.
++ */
++ if (ia->ia_valid & ATTR_SIZE) {
++ size = i_size_read(inode);
++ if (ia->ia_size < size || (ia->ia_size > size &&
++ inode->i_sb->s_maxbytes < lower_inode->i_sb->s_maxbytes)) {
++ err = vmtruncate(inode, ia->ia_size);
++ if (err)
++ goto out;
++ }
++ }
++
++ /* notify the (possibly copied-up) lower inode */
++ /*
++ * Note: we use lower_dentry->d_inode, because lower_inode may be
++ * unlinked (no inode->i_sb and i_ino==0. This happens if someone
++ * tries to open(), unlink(), then ftruncate() a file.
++ */
++ /* prepare our own lower struct iattr (with our own lower file) */
++ memcpy(&lower_ia, ia, sizeof(lower_ia));
++ if (ia->ia_valid & ATTR_FILE) {
++ lower_ia.ia_file = unionfs_lower_file(ia->ia_file);
++ BUG_ON(!lower_ia.ia_file); // XXX?
++ }
++
++ mutex_lock(&lower_dentry->d_inode->i_mutex);
++ err = notify_change(lower_dentry, &lower_ia);
++ mutex_unlock(&lower_dentry->d_inode->i_mutex);
++ if (err)
++ goto out;
++
++ /* get attributes from the first lower inode */
++ if (ibstart(inode) >= 0)
++ unionfs_copy_attr_all(inode, lower_inode);
++ /*
++ * unionfs_copy_attr_all will copy the lower times to our inode if
++ * the lower ones are newer (useful for cache coherency). However,
++ * ->setattr is the only place in which we may have to copy the
++ * lower inode times absolutely, to support utimes(2).
++ */
++ if (ia->ia_valid & ATTR_MTIME_SET)
++ inode->i_mtime = lower_inode->i_mtime;
++ if (ia->ia_valid & ATTR_CTIME)
++ inode->i_ctime = lower_inode->i_ctime;
++ if (ia->ia_valid & ATTR_ATIME_SET)
++ inode->i_atime = lower_inode->i_atime;
++ fsstack_copy_inode_size(inode, lower_inode);
++
++out:
++ if (!err)
++ unionfs_check_dentry(dentry);
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++out_err:
++ return err;
++}
++
++struct inode_operations unionfs_symlink_iops = {
++ .readlink = unionfs_readlink,
++ .permission = unionfs_permission,
++ .follow_link = unionfs_follow_link,
++ .setattr = unionfs_setattr,
++ .put_link = unionfs_put_link,
++};
++
++struct inode_operations unionfs_dir_iops = {
++ .create = unionfs_create,
++ .lookup = unionfs_lookup,
++ .link = unionfs_link,
++ .unlink = unionfs_unlink,
++ .symlink = unionfs_symlink,
++ .mkdir = unionfs_mkdir,
++ .rmdir = unionfs_rmdir,
++ .mknod = unionfs_mknod,
++ .rename = unionfs_rename,
++ .permission = unionfs_permission,
++ .setattr = unionfs_setattr,
++#ifdef CONFIG_UNION_FS_XATTR
++ .setxattr = unionfs_setxattr,
++ .getxattr = unionfs_getxattr,
++ .removexattr = unionfs_removexattr,
++ .listxattr = unionfs_listxattr,
++#endif /* CONFIG_UNION_FS_XATTR */
++};
++
++struct inode_operations unionfs_main_iops = {
++ .permission = unionfs_permission,
++ .setattr = unionfs_setattr,
++#ifdef CONFIG_UNION_FS_XATTR
++ .setxattr = unionfs_setxattr,
++ .getxattr = unionfs_getxattr,
++ .removexattr = unionfs_removexattr,
++ .listxattr = unionfs_listxattr,
++#endif /* CONFIG_UNION_FS_XATTR */
++};
+diff --git a/fs/unionfs/lookup.c b/fs/unionfs/lookup.c
+new file mode 100644
+index 0000000..3cbde56
+--- /dev/null
++++ b/fs/unionfs/lookup.c
+@@ -0,0 +1,569 @@
++/*
++ * Copyright (c) 2003-2011 Erez Zadok
++ * Copyright (c) 2003-2006 Charles P. Wright
++ * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
++ * Copyright (c) 2005-2006 Junjiro Okajima
++ * Copyright (c) 2005 Arun M. Krishnakumar
++ * Copyright (c) 2004-2006 David P. Quigley
++ * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
++ * Copyright (c) 2003 Puja Gupta
++ * Copyright (c) 2003 Harikesavan Krishnan
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
++ *
++ * 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 "union.h"
++
++/*
++ * Lookup one path component @name relative to a <base,mnt> path pair.
++ * Behaves nearly the same as lookup_one_len (i.e., return negative dentry
++ * on ENOENT), but uses the @mnt passed, so it can cross bind mounts and
++ * other lower mounts properly. If @new_mnt is non-null, will fill in the
++ * new mnt there. Caller is responsible to dput/mntput/path_put returned
++ * @dentry and @new_mnt.
++ */
++struct dentry *__lookup_one(struct dentry *base, struct vfsmount *mnt,
++ const char *name, struct vfsmount **new_mnt)
++{
++ struct dentry *dentry = NULL;
++ struct nameidata lower_nd;
++ int err;
++
++ /* we use flags=0 to get basic lookup */
++ err = vfs_path_lookup(base, mnt, name, 0, &lower_nd);
++
++ switch (err) {
++ case 0: /* no error */
++ dentry = lower_nd.path.dentry;
++ if (new_mnt)
++ *new_mnt = lower_nd.path.mnt; /* rc already inc'ed */
++ break;
++ case -ENOENT:
++ /*
++ * We don't consider ENOENT an error, and we want to return
++ * a negative dentry (ala lookup_one_len). As we know
++ * there was no inode for this name before (-ENOENT), then
++ * it's safe to call lookup_one_len (which doesn't take a
++ * vfsmount).
++ */
++ dentry = lookup_lck_len(name, base, strlen(name));
++ if (new_mnt)
++ *new_mnt = mntget(lower_nd.path.mnt);
++ break;
++ default: /* all other real errors */
++ dentry = ERR_PTR(err);
++ break;
++ }
++
++ return dentry;
++}
++
++/*
++ * This is a utility function that fills in a unionfs dentry.
++ * Caller must lock this dentry with unionfs_lock_dentry.
++ *
++ * Returns: 0 (ok), or -ERRNO if an error occurred.
++ * XXX: get rid of _partial_lookup and make callers call _lookup_full directly
++ */
++int unionfs_partial_lookup(struct dentry *dentry, struct dentry *parent)
++{
++ struct dentry *tmp;
++ int err = -ENOSYS;
++
++ tmp = unionfs_lookup_full(dentry, parent, INTERPOSE_PARTIAL);
++
++ if (!tmp) {
++ err = 0;
++ goto out;
++ }
++ if (IS_ERR(tmp)) {
++ err = PTR_ERR(tmp);
++ goto out;
++ }
++ /* XXX: need to change the interface */
++ BUG_ON(tmp != dentry);
++out:
++ return err;
++}
++
++/* The dentry cache is just so we have properly sized dentries. */
++static struct kmem_cache *unionfs_dentry_cachep;
++int unionfs_init_dentry_cache(void)
++{
++ unionfs_dentry_cachep =
++ kmem_cache_create("unionfs_dentry",
++ sizeof(struct unionfs_dentry_info),
++ 0, SLAB_RECLAIM_ACCOUNT, NULL);
++
++ return (unionfs_dentry_cachep ? 0 : -ENOMEM);
++}
++
++void unionfs_destroy_dentry_cache(void)
++{
++ if (unionfs_dentry_cachep)
++ kmem_cache_destroy(unionfs_dentry_cachep);
++}
++
++void free_dentry_private_data(struct dentry *dentry)
++{
++ if (!dentry || !dentry->d_fsdata)
++ return;
++ kfree(UNIONFS_D(dentry)->lower_paths);
++ UNIONFS_D(dentry)->lower_paths = NULL;
++ kmem_cache_free(unionfs_dentry_cachep, dentry->d_fsdata);
++ dentry->d_fsdata = NULL;
++}
++
++static inline int __realloc_dentry_private_data(struct dentry *dentry)
++{
++ struct unionfs_dentry_info *info = UNIONFS_D(dentry);
++ void *p;
++ int size;
++
++ BUG_ON(!info);
++
++ size = sizeof(struct path) * sbmax(dentry->d_sb);
++ p = krealloc(info->lower_paths, size, GFP_ATOMIC);
++ if (unlikely(!p))
++ return -ENOMEM;
++
++ info->lower_paths = p;
++
++ info->bstart = -1;
++ info->bend = -1;
++ info->bopaque = -1;
++ info->bcount = sbmax(dentry->d_sb);
++ atomic_set(&info->generation,
++ atomic_read(&UNIONFS_SB(dentry->d_sb)->generation));
++
++ memset(info->lower_paths, 0, size);
++
++ return 0;
++}
++
++/* UNIONFS_D(dentry)->lock must be locked */
++int realloc_dentry_private_data(struct dentry *dentry)
++{
++ if (!__realloc_dentry_private_data(dentry))
++ return 0;
++
++ kfree(UNIONFS_D(dentry)->lower_paths);
++ free_dentry_private_data(dentry);
++ return -ENOMEM;
++}
++
++/* allocate new dentry private data */
++int new_dentry_private_data(struct dentry *dentry, int subclass)
++{
++ struct unionfs_dentry_info *info = UNIONFS_D(dentry);
++
++ BUG_ON(info);
++
++ info = kmem_cache_alloc(unionfs_dentry_cachep, GFP_ATOMIC);
++ if (unlikely(!info))
++ return -ENOMEM;
++
++ mutex_init(&info->lock);
++ mutex_lock_nested(&info->lock, subclass);
++
++ info->lower_paths = NULL;
++
++ dentry->d_fsdata = info;
++
++ if (!__realloc_dentry_private_data(dentry))
++ return 0;
++
++ mutex_unlock(&info->lock);
++ free_dentry_private_data(dentry);
++ return -ENOMEM;
++}
++
++/*
++ * scan through the lower dentry objects, and set bstart to reflect the
++ * starting branch
++ */
++void update_bstart(struct dentry *dentry)
++{
++ int bindex;
++ int bstart = dbstart(dentry);
++ int bend = dbend(dentry);
++ struct dentry *lower_dentry;
++
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
++ if (!lower_dentry)
++ continue;
++ if (lower_dentry->d_inode) {
++ dbstart(dentry) = bindex;
++ break;
++ }
++ dput(lower_dentry);
++ unionfs_set_lower_dentry_idx(dentry, bindex, NULL);
++ }
++}
++
++
++/*
++ * Initialize a nameidata structure (the intent part) we can pass to a lower
++ * file system. Returns 0 on success or -error (only -ENOMEM possible).
++ * Inside that nd structure, this function may also return an allocated
++ * struct file (for open intents). The caller, when done with this nd, must
++ * kfree the intent file (using release_lower_nd).
++ *
++ * XXX: this code, and the callers of this code, should be redone using
++ * vfs_path_lookup() when (1) the nameidata structure is refactored into a
++ * separate intent-structure, and (2) open_namei() is broken into a VFS-only
++ * function and a method that other file systems can call.
++ */
++int init_lower_nd(struct nameidata *nd, unsigned int flags)
++{
++ int err = 0;
++#ifdef ALLOC_LOWER_ND_FILE
++ /*
++ * XXX: one day we may need to have the lower return an open file
++ * for us. It is not needed in 2.6.23-rc1 for nfs2/nfs3, but may
++ * very well be needed for nfs4.
++ */
++ struct file *file;
++#endif /* ALLOC_LOWER_ND_FILE */
++
++ memset(nd, 0, sizeof(struct nameidata));
++ if (!flags)
++ return err;
++
++ switch (flags) {
++ case LOOKUP_CREATE:
++ nd->intent.open.flags |= O_CREAT;
++ /* fall through: shared code for create/open cases */
++ case LOOKUP_OPEN:
++ nd->flags = flags;
++ nd->intent.open.flags |= (FMODE_READ | FMODE_WRITE);
++#ifdef ALLOC_LOWER_ND_FILE
++ file = kzalloc(sizeof(struct file), GFP_KERNEL);
++ if (unlikely(!file)) {
++ err = -ENOMEM;
++ break; /* exit switch statement and thus return */
++ }
++ nd->intent.open.file = file;
++#endif /* ALLOC_LOWER_ND_FILE */
++ break;
++ default:
++ /*
++ * We should never get here, for now.
++ * We can add new cases here later on.
++ */
++ pr_debug("unionfs: unknown nameidata flag 0x%x\n", flags);
++ BUG();
++ break;
++ }
++
++ return err;
++}
++
++void release_lower_nd(struct nameidata *nd, int err)
++{
++ if (!nd->intent.open.file)
++ return;
++ else if (!err)
++ release_open_intent(nd);
++#ifdef ALLOC_LOWER_ND_FILE
++ kfree(nd->intent.open.file);
++#endif /* ALLOC_LOWER_ND_FILE */
++}
++
++/*
++ * Main (and complex) driver function for Unionfs's lookup
++ *
++ * Returns: NULL (ok), ERR_PTR if an error occurred, or a non-null non-error
++ * PTR if d_splice returned a different dentry.
++ *
++ * If lookupmode is INTERPOSE_PARTIAL/REVAL/REVAL_NEG, the passed dentry's
++ * inode info must be locked. If lookupmode is INTERPOSE_LOOKUP (i.e., a
++ * newly looked-up dentry), then unionfs_lookup_backend will return a locked
++ * dentry's info, which the caller must unlock.
++ */
++struct dentry *unionfs_lookup_full(struct dentry *dentry,
++ struct dentry *parent, int lookupmode)
++{
++ int err = 0;
++ struct dentry *lower_dentry = NULL;
++ struct vfsmount *lower_mnt;
++ struct vfsmount *lower_dir_mnt;
++ struct dentry *wh_lower_dentry = NULL;
++ struct dentry *lower_dir_dentry = NULL;
++ struct dentry *d_interposed = NULL;
++ int bindex, bstart, bend, bopaque;
++ int opaque, num_positive = 0;
++ const char *name;
++ int namelen;
++ int pos_start, pos_end;
++
++ /*
++ * We should already have a lock on this dentry in the case of a
++ * partial lookup, or a revalidation. Otherwise it is returned from
++ * new_dentry_private_data already locked.
++ */
++ verify_locked(dentry);
++ verify_locked(parent);
++
++ /* must initialize dentry operations */
++ dentry->d_op = &unionfs_dops;
++
++ /* We never partial lookup the root directory. */
++ if (IS_ROOT(dentry))
++ goto out;
++
++ name = dentry->d_name.name;
++ namelen = dentry->d_name.len;
++
++ /* No dentries should get created for possible whiteout names. */
++ if (!is_validname(name)) {
++ err = -EPERM;
++ goto out_free;
++ }
++
++ /* Now start the actual lookup procedure. */
++ bstart = dbstart(parent);
++ bend = dbend(parent);
++ bopaque = dbopaque(parent);
++ BUG_ON(bstart < 0);
++
++ /* adjust bend to bopaque if needed */
++ if ((bopaque >= 0) && (bopaque < bend))
++ bend = bopaque;
++
++ /* lookup all possible dentries */
++ for (bindex = bstart; bindex <= bend; bindex++) {
++
++ lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
++ lower_mnt = unionfs_lower_mnt_idx(dentry, bindex);
++
++ /* skip if we already have a positive lower dentry */
++ if (lower_dentry) {
++ if (dbstart(dentry) < 0)
++ dbstart(dentry) = bindex;
++ if (bindex > dbend(dentry))
++ dbend(dentry) = bindex;
++ if (lower_dentry->d_inode)
++ num_positive++;
++ continue;
++ }
++
++ lower_dir_dentry =
++ unionfs_lower_dentry_idx(parent, bindex);
++ /* if the lower dentry's parent does not exist, skip this */
++ if (!lower_dir_dentry || !lower_dir_dentry->d_inode)
++ continue;
++
++ /* also skip it if the parent isn't a directory. */
++ if (!S_ISDIR(lower_dir_dentry->d_inode->i_mode))
++ continue; /* XXX: should be BUG_ON */
++
++ /* check for whiteouts: stop lookup if found */
++ wh_lower_dentry = lookup_whiteout(name, lower_dir_dentry);
++ if (IS_ERR(wh_lower_dentry)) {
++ err = PTR_ERR(wh_lower_dentry);
++ goto out_free;
++ }
++ if (wh_lower_dentry->d_inode) {
++ dbend(dentry) = dbopaque(dentry) = bindex;
++ if (dbstart(dentry) < 0)
++ dbstart(dentry) = bindex;
++ dput(wh_lower_dentry);
++ break;
++ }
++ dput(wh_lower_dentry);
++
++ /* Now do regular lookup; lookup @name */
++ lower_dir_mnt = unionfs_lower_mnt_idx(parent, bindex);
++ lower_mnt = NULL; /* XXX: needed? */
++
++ lower_dentry = __lookup_one(lower_dir_dentry, lower_dir_mnt,
++ name, &lower_mnt);
++
++ if (IS_ERR(lower_dentry)) {
++ err = PTR_ERR(lower_dentry);
++ goto out_free;
++ }
++ unionfs_set_lower_dentry_idx(dentry, bindex, lower_dentry);
++ if (!lower_mnt)
++ lower_mnt = unionfs_mntget(dentry->d_sb->s_root,
++ bindex);
++ unionfs_set_lower_mnt_idx(dentry, bindex, lower_mnt);
++
++ /* adjust dbstart/end */
++ if (dbstart(dentry) < 0)
++ dbstart(dentry) = bindex;
++ if (bindex > dbend(dentry))
++ dbend(dentry) = bindex;
++ /*
++ * We always store the lower dentries above, and update
++ * dbstart/dbend, even if the whole unionfs dentry is
++ * negative (i.e., no lower inodes).
++ */
++ if (!lower_dentry->d_inode)
++ continue;
++ num_positive++;
++
++ /*
++ * check if we just found an opaque directory, if so, stop
++ * lookups here.
++ */
++ if (!S_ISDIR(lower_dentry->d_inode->i_mode))
++ continue;
++ opaque = is_opaque_dir(dentry, bindex);
++ if (opaque < 0) {
++ err = opaque;
++ goto out_free;
++ } else if (opaque) {
++ dbend(dentry) = dbopaque(dentry) = bindex;
++ break;
++ }
++ dbend(dentry) = bindex;
++
++ /* update parent directory's atime with the bindex */
++ fsstack_copy_attr_atime(parent->d_inode,
++ lower_dir_dentry->d_inode);
++ }
++
++ /* sanity checks, then decide if to process a negative dentry */
++ BUG_ON(dbstart(dentry) < 0 && dbend(dentry) >= 0);
++ BUG_ON(dbstart(dentry) >= 0 && dbend(dentry) < 0);
++
++ if (num_positive > 0)
++ goto out_positive;
++
++ /*** handle NEGATIVE dentries ***/
++
++ /*
++ * If negative, keep only first lower negative dentry, to save on
++ * memory.
++ */
++ if (dbstart(dentry) < dbend(dentry)) {
++ path_put_lowers(dentry, dbstart(dentry) + 1,
++ dbend(dentry), false);
++ dbend(dentry) = dbstart(dentry);
++ }
++ if (lookupmode == INTERPOSE_PARTIAL)
++ goto out;
++ if (lookupmode == INTERPOSE_LOOKUP) {
++ /*
++ * If all we found was a whiteout in the first available
++ * branch, then create a negative dentry for a possibly new
++ * file to be created.
++ */
++ if (dbopaque(dentry) < 0)
++ goto out;
++ /* XXX: need to get mnt here */
++ bindex = dbstart(dentry);
++ if (unionfs_lower_dentry_idx(dentry, bindex))
++ goto out;
++ lower_dir_dentry =
++ unionfs_lower_dentry_idx(parent, bindex);
++ if (!lower_dir_dentry || !lower_dir_dentry->d_inode)
++ goto out;
++ if (!S_ISDIR(lower_dir_dentry->d_inode->i_mode))
++ goto out; /* XXX: should be BUG_ON */
++ /* XXX: do we need to cross bind mounts here? */
++ lower_dentry = lookup_lck_len(name, lower_dir_dentry, namelen);
++ if (IS_ERR(lower_dentry)) {
++ err = PTR_ERR(lower_dentry);
++ goto out;
++ }
++ /* XXX: need to mntget/mntput as needed too! */
++ unionfs_set_lower_dentry_idx(dentry, bindex, lower_dentry);
++ /* XXX: wrong mnt for crossing bind mounts! */
++ lower_mnt = unionfs_mntget(dentry->d_sb->s_root, bindex);
++ unionfs_set_lower_mnt_idx(dentry, bindex, lower_mnt);
++
++ goto out;
++ }
++
++ /* if we're revalidating a positive dentry, don't make it negative */
++ if (lookupmode != INTERPOSE_REVAL)
++ d_add(dentry, NULL);
++
++ goto out;
++
++out_positive:
++ /*** handle POSITIVE dentries ***/
++
++ /*
++ * This unionfs dentry is positive (at least one lower inode
++ * exists), so scan entire dentry from beginning to end, and remove
++ * any negative lower dentries, if any. Then, update dbstart/dbend
++ * to reflect the start/end of positive dentries.
++ */
++ pos_start = pos_end = -1;
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ lower_dentry = unionfs_lower_dentry_idx(dentry,
++ bindex);
++ if (lower_dentry && lower_dentry->d_inode) {
++ if (pos_start < 0)
++ pos_start = bindex;
++ if (bindex > pos_end)
++ pos_end = bindex;
++ continue;
++ }
++ path_put_lowers(dentry, bindex, bindex, false);
++ }
++ if (pos_start >= 0)
++ dbstart(dentry) = pos_start;
++ if (pos_end >= 0)
++ dbend(dentry) = pos_end;
++
++ /* Partial lookups need to re-interpose, or throw away older negs. */
++ if (lookupmode == INTERPOSE_PARTIAL) {
++ if (dentry->d_inode) {
++ unionfs_reinterpose(dentry);
++ goto out;
++ }
++
++ /*
++ * This dentry was positive, so it is as if we had a
++ * negative revalidation.
++ */
++ lookupmode = INTERPOSE_REVAL_NEG;
++ update_bstart(dentry);
++ }
++
++ /*
++ * Interpose can return a dentry if d_splice returned a different
++ * dentry.
++ */
++ d_interposed = unionfs_interpose(dentry, dentry->d_sb, lookupmode);
++ if (IS_ERR(d_interposed))
++ err = PTR_ERR(d_interposed);
++ else if (d_interposed)
++ dentry = d_interposed;
++
++ if (!err)
++ goto out;
++ d_drop(dentry);
++
++out_free:
++ /* should dput/mntput all the underlying dentries on error condition */
++ if (dbstart(dentry) >= 0)
++ path_put_lowers_all(dentry, false);
++ /* free lower_paths unconditionally */
++ kfree(UNIONFS_D(dentry)->lower_paths);
++ UNIONFS_D(dentry)->lower_paths = NULL;
++
++out:
++ if (dentry && UNIONFS_D(dentry)) {
++ BUG_ON(dbstart(dentry) < 0 && dbend(dentry) >= 0);
++ BUG_ON(dbstart(dentry) >= 0 && dbend(dentry) < 0);
++ }
++ if (d_interposed && UNIONFS_D(d_interposed)) {
++ BUG_ON(dbstart(d_interposed) < 0 && dbend(d_interposed) >= 0);
++ BUG_ON(dbstart(d_interposed) >= 0 && dbend(d_interposed) < 0);
++ }
++
++ if (!err && d_interposed)
++ return d_interposed;
++ return ERR_PTR(err);
++}
+diff --git a/fs/unionfs/main.c b/fs/unionfs/main.c
+new file mode 100644
+index 0000000..fa52f61
+--- /dev/null
++++ b/fs/unionfs/main.c
+@@ -0,0 +1,763 @@
++/*
++ * Copyright (c) 2003-2011 Erez Zadok
++ * Copyright (c) 2003-2006 Charles P. Wright
++ * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
++ * Copyright (c) 2005-2006 Junjiro Okajima
++ * Copyright (c) 2005 Arun M. Krishnakumar
++ * Copyright (c) 2004-2006 David P. Quigley
++ * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
++ * Copyright (c) 2003 Puja Gupta
++ * Copyright (c) 2003 Harikesavan Krishnan
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
++ *
++ * 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 "union.h"
++#include <linux/module.h>
++#include <linux/moduleparam.h>
++
++static void unionfs_fill_inode(struct dentry *dentry,
++ struct inode *inode)
++{
++ struct inode *lower_inode;
++ struct dentry *lower_dentry;
++ int bindex, bstart, bend;
++
++ bstart = dbstart(dentry);
++ bend = dbend(dentry);
++
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
++ if (!lower_dentry) {
++ unionfs_set_lower_inode_idx(inode, bindex, NULL);
++ continue;
++ }
++
++ /* Initialize the lower inode to the new lower inode. */
++ if (!lower_dentry->d_inode)
++ continue;
++
++ unionfs_set_lower_inode_idx(inode, bindex,
++ igrab(lower_dentry->d_inode));
++ }
++
++ ibstart(inode) = dbstart(dentry);
++ ibend(inode) = dbend(dentry);
++
++ /* Use attributes from the first branch. */
++ lower_inode = unionfs_lower_inode(inode);
++
++ /* Use different set of inode ops for symlinks & directories */
++ if (S_ISLNK(lower_inode->i_mode))
++ inode->i_op = &unionfs_symlink_iops;
++ else if (S_ISDIR(lower_inode->i_mode))
++ inode->i_op = &unionfs_dir_iops;
++
++ /* Use different set of file ops for directories */
++ if (S_ISDIR(lower_inode->i_mode))
++ inode->i_fop = &unionfs_dir_fops;
++
++ /* properly initialize special inodes */
++ if (S_ISBLK(lower_inode->i_mode) || S_ISCHR(lower_inode->i_mode) ||
++ S_ISFIFO(lower_inode->i_mode) || S_ISSOCK(lower_inode->i_mode))
++ init_special_inode(inode, lower_inode->i_mode,
++ lower_inode->i_rdev);
++
++ /* all well, copy inode attributes */
++ unionfs_copy_attr_all(inode, lower_inode);
++ fsstack_copy_inode_size(inode, lower_inode);
++}
++
++/*
++ * Connect a unionfs inode dentry/inode with several lower ones. This is
++ * the classic stackable file system "vnode interposition" action.
++ *
++ * @sb: unionfs's super_block
++ */
++struct dentry *unionfs_interpose(struct dentry *dentry, struct super_block *sb,
++ int flag)
++{
++ int err = 0;
++ struct inode *inode;
++ int need_fill_inode = 1;
++ struct dentry *spliced = NULL;
++
++ verify_locked(dentry);
++
++ /*
++ * We allocate our new inode below by calling unionfs_iget,
++ * which will initialize some of the new inode's fields
++ */
++
++ /*
++ * On revalidate we've already got our own inode and just need
++ * to fix it up.
++ */
++ if (flag == INTERPOSE_REVAL) {
++ inode = dentry->d_inode;
++ UNIONFS_I(inode)->bstart = -1;
++ UNIONFS_I(inode)->bend = -1;
++ atomic_set(&UNIONFS_I(inode)->generation,
++ atomic_read(&UNIONFS_SB(sb)->generation));
++
++ UNIONFS_I(inode)->lower_inodes =
++ kcalloc(sbmax(sb), sizeof(struct inode *), GFP_KERNEL);
++ if (unlikely(!UNIONFS_I(inode)->lower_inodes)) {
++ err = -ENOMEM;
++ goto out;
++ }
++ } else {
++ /* get unique inode number for unionfs */
++ inode = unionfs_iget(sb, iunique(sb, UNIONFS_ROOT_INO));
++ if (IS_ERR(inode)) {
++ err = PTR_ERR(inode);
++ goto out;
++ }
++ if (atomic_read(&inode->i_count) > 1)
++ goto skip;
++ }
++
++ need_fill_inode = 0;
++ unionfs_fill_inode(dentry, inode);
++
++skip:
++ /* only (our) lookup wants to do a d_add */
++ switch (flag) {
++ case INTERPOSE_DEFAULT:
++ /* for operations which create new inodes */
++ d_add(dentry, inode);
++ break;
++ case INTERPOSE_REVAL_NEG:
++ d_instantiate(dentry, inode);
++ break;
++ case INTERPOSE_LOOKUP:
++ spliced = d_splice_alias(inode, dentry);
++ if (spliced && spliced != dentry) {
++ /*
++ * d_splice can return a dentry if it was
++ * disconnected and had to be moved. We must ensure
++ * that the private data of the new dentry is
++ * correct and that the inode info was filled
++ * properly. Finally we must return this new
++ * dentry.
++ */
++ spliced->d_op = &unionfs_dops;
++ spliced->d_fsdata = dentry->d_fsdata;
++ dentry->d_fsdata = NULL;
++ dentry = spliced;
++ if (need_fill_inode) {
++ need_fill_inode = 0;
++ unionfs_fill_inode(dentry, inode);
++ }
++ goto out_spliced;
++ } else if (!spliced) {
++ if (need_fill_inode) {
++ need_fill_inode = 0;
++ unionfs_fill_inode(dentry, inode);
++ goto out_spliced;
++ }
++ }
++ break;
++ case INTERPOSE_REVAL:
++ /* Do nothing. */
++ break;
++ default:
++ printk(KERN_CRIT "unionfs: invalid interpose flag passed!\n");
++ BUG();
++ }
++ goto out;
++
++out_spliced:
++ if (!err)
++ return spliced;
++out:
++ return ERR_PTR(err);
++}
++
++/* like interpose above, but for an already existing dentry */
++void unionfs_reinterpose(struct dentry *dentry)
++{
++ struct dentry *lower_dentry;
++ struct inode *inode;
++ int bindex, bstart, bend;
++
++ verify_locked(dentry);
++
++ /* This is pre-allocated inode */
++ inode = dentry->d_inode;
++
++ bstart = dbstart(dentry);
++ bend = dbend(dentry);
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
++ if (!lower_dentry)
++ continue;
++
++ if (!lower_dentry->d_inode)
++ continue;
++ if (unionfs_lower_inode_idx(inode, bindex))
++ continue;
++ unionfs_set_lower_inode_idx(inode, bindex,
++ igrab(lower_dentry->d_inode));
++ }
++ ibstart(inode) = dbstart(dentry);
++ ibend(inode) = dbend(dentry);
++}
++
++/*
++ * make sure the branch we just looked up (nd) makes sense:
++ *
++ * 1) we're not trying to stack unionfs on top of unionfs
++ * 2) it exists
++ * 3) is a directory
++ */
++int check_branch(const struct path *path)
++{
++ /* XXX: remove in ODF code -- stacking unions allowed there */
++ if (!strcmp(path->dentry->d_sb->s_type->name, UNIONFS_NAME))
++ return -EINVAL;
++ if (!path->dentry->d_inode)
++ return -ENOENT;
++ if (!S_ISDIR(path->dentry->d_inode->i_mode))
++ return -ENOTDIR;
++ return 0;
++}
++
++/* checks if two lower_dentries have overlapping branches */
++static int is_branch_overlap(struct dentry *dent1, struct dentry *dent2)
++{
++ struct dentry *dent = NULL;
++
++ dent = dent1;
++ while ((dent != dent2) && (dent->d_parent != dent))
++ dent = dent->d_parent;
++
++ if (dent == dent2)
++ return 1;
++
++ dent = dent2;
++ while ((dent != dent1) && (dent->d_parent != dent))
++ dent = dent->d_parent;
++
++ return (dent == dent1);
++}
++
++/*
++ * Parse "ro" or "rw" options, but default to "rw" if no mode options was
++ * specified. Fill the mode bits in @perms. If encounter an unknown
++ * string, return -EINVAL. Otherwise return 0.
++ */
++int parse_branch_mode(const char *name, int *perms)
++{
++ if (!name || !strcmp(name, "rw")) {
++ *perms = MAY_READ | MAY_WRITE;
++ return 0;
++ }
++ if (!strcmp(name, "ro")) {
++ *perms = MAY_READ;
++ return 0;
++ }
++ return -EINVAL;
++}
++
++/*
++ * parse the dirs= mount argument
++ *
++ * We don't need to lock the superblock private data's rwsem, as we get
++ * called only by unionfs_read_super - it is still a long time before anyone
++ * can even get a reference to us.
++ */
++static int parse_dirs_option(struct super_block *sb, struct unionfs_dentry_info
++ *lower_root_info, char *options)
++{
++ struct path path;
++ char *name;
++ int err = 0;
++ int branches = 1;
++ int bindex = 0;
++ int i = 0;
++ int j = 0;
++ struct dentry *dent1;
++ struct dentry *dent2;
++
++ if (options[0] == '\0') {
++ printk(KERN_ERR "unionfs: no branches specified\n");
++ err = -EINVAL;
++ goto out_return;
++ }
++
++ /*
++ * Each colon means we have a separator, this is really just a rough
++ * guess, since strsep will handle empty fields for us.
++ */
++ for (i = 0; options[i]; i++)
++ if (options[i] == ':')
++ branches++;
++
++ /* allocate space for underlying pointers to lower dentry */
++ UNIONFS_SB(sb)->data =
++ kcalloc(branches, sizeof(struct unionfs_data), GFP_KERNEL);
++ if (unlikely(!UNIONFS_SB(sb)->data)) {
++ err = -ENOMEM;
++ goto out_return;
++ }
++
++ lower_root_info->lower_paths =
++ kcalloc(branches, sizeof(struct path), GFP_KERNEL);
++ if (unlikely(!lower_root_info->lower_paths)) {
++ err = -ENOMEM;
++ /* free the underlying pointer array */
++ kfree(UNIONFS_SB(sb)->data);
++ UNIONFS_SB(sb)->data = NULL;
++ goto out_return;
++ }
++
++ /* now parsing a string such as "b1:b2=rw:b3=ro:b4" */
++ branches = 0;
++ while ((name = strsep(&options, ":")) != NULL) {
++ int perms;
++ char *mode = strchr(name, '=');
++
++ if (!name)
++ continue;
++ if (!*name) { /* bad use of ':' (extra colons) */
++ err = -EINVAL;
++ goto out;
++ }
++
++ branches++;
++
++ /* strip off '=' if any */
++ if (mode)
++ *mode++ = '\0';
++
++ err = parse_branch_mode(mode, &perms);
++ if (err) {
++ printk(KERN_ERR "unionfs: invalid mode \"%s\" for "
++ "branch %d\n", mode, bindex);
++ goto out;
++ }
++ /* ensure that leftmost branch is writeable */
++ if (!bindex && !(perms & MAY_WRITE)) {
++ printk(KERN_ERR "unionfs: leftmost branch cannot be "
++ "read-only (use \"-o ro\" to create a "
++ "read-only union)\n");
++ err = -EINVAL;
++ goto out;
++ }
++
++ err = kern_path(name, LOOKUP_FOLLOW, &path);
++ if (err) {
++ printk(KERN_ERR "unionfs: error accessing "
++ "lower directory '%s' (error %d)\n",
++ name, err);
++ goto out;
++ }
++
++ err = check_branch(&path);
++ if (err) {
++ printk(KERN_ERR "unionfs: lower directory "
++ "'%s' is not a valid branch\n", name);
++ path_put(&path);
++ goto out;
++ }
++
++ lower_root_info->lower_paths[bindex].dentry = path.dentry;
++ lower_root_info->lower_paths[bindex].mnt = path.mnt;
++
++ set_branchperms(sb, bindex, perms);
++ set_branch_count(sb, bindex, 0);
++ new_branch_id(sb, bindex);
++
++ if (lower_root_info->bstart < 0)
++ lower_root_info->bstart = bindex;
++ lower_root_info->bend = bindex;
++ bindex++;
++ }
++
++ if (branches == 0) {
++ printk(KERN_ERR "unionfs: no branches specified\n");
++ err = -EINVAL;
++ goto out;
++ }
++
++ BUG_ON(branches != (lower_root_info->bend + 1));
++
++ /*
++ * Ensure that no overlaps exist in the branches.
++ *
++ * This test is required because the Linux kernel has no support
++ * currently for ensuring coherency between stackable layers and
++ * branches. If we were to allow overlapping branches, it would be
++ * possible, for example, to delete a file via one branch, which
++ * would not be reflected in another branch. Such incoherency could
++ * lead to inconsistencies and even kernel oopses. Rather than
++ * implement hacks to work around some of these cache-coherency
++ * problems, we prevent branch overlapping, for now. A complete
++ * solution will involve proper kernel/VFS support for cache
++ * coherency, at which time we could safely remove this
++ * branch-overlapping test.
++ */
++ for (i = 0; i < branches; i++) {
++ dent1 = lower_root_info->lower_paths[i].dentry;
++ for (j = i + 1; j < branches; j++) {
++ dent2 = lower_root_info->lower_paths[j].dentry;
++ if (is_branch_overlap(dent1, dent2)) {
++ printk(KERN_ERR "unionfs: branches %d and "
++ "%d overlap\n", i, j);
++ err = -EINVAL;
++ goto out;
++ }
++ }
++ }
++
++out:
++ if (err) {
++ for (i = 0; i < branches; i++)
++ path_put(&lower_root_info->lower_paths[i]);
++
++ kfree(lower_root_info->lower_paths);
++ kfree(UNIONFS_SB(sb)->data);
++
++ /*
++ * MUST clear the pointers to prevent potential double free if
++ * the caller dies later on
++ */
++ lower_root_info->lower_paths = NULL;
++ UNIONFS_SB(sb)->data = NULL;
++ }
++out_return:
++ return err;
++}
++
++/*
++ * Parse mount options. See the manual page for usage instructions.
++ *
++ * Returns the dentry object of the lower-level (lower) directory;
++ * We want to mount our stackable file system on top of that lower directory.
++ */
++static struct unionfs_dentry_info *unionfs_parse_options(
++ struct super_block *sb,
++ char *options)
++{
++ struct unionfs_dentry_info *lower_root_info;
++ char *optname;
++ int err = 0;
++ int bindex;
++ int dirsfound = 0;
++
++ /* allocate private data area */
++ err = -ENOMEM;
++ lower_root_info =
++ kzalloc(sizeof(struct unionfs_dentry_info), GFP_KERNEL);
++ if (unlikely(!lower_root_info))
++ goto out_error;
++ lower_root_info->bstart = -1;
++ lower_root_info->bend = -1;
++ lower_root_info->bopaque = -1;
++
++ while ((optname = strsep(&options, ",")) != NULL) {
++ char *optarg;
++
++ if (!optname || !*optname)
++ continue;
++
++ optarg = strchr(optname, '=');
++ if (optarg)
++ *optarg++ = '\0';
++
++ /*
++ * All of our options take an argument now. Insert ones that
++ * don't, above this check.
++ */
++ if (!optarg) {
++ printk(KERN_ERR "unionfs: %s requires an argument\n",
++ optname);
++ err = -EINVAL;
++ goto out_error;
++ }
++
++ if (!strcmp("dirs", optname)) {
++ if (++dirsfound > 1) {
++ printk(KERN_ERR
++ "unionfs: multiple dirs specified\n");
++ err = -EINVAL;
++ goto out_error;
++ }
++ err = parse_dirs_option(sb, lower_root_info, optarg);
++ if (err)
++ goto out_error;
++ continue;
++ }
++
++ err = -EINVAL;
++ printk(KERN_ERR
++ "unionfs: unrecognized option '%s'\n", optname);
++ goto out_error;
++ }
++ if (dirsfound != 1) {
++ printk(KERN_ERR "unionfs: dirs option required\n");
++ err = -EINVAL;
++ goto out_error;
++ }
++ goto out;
++
++out_error:
++ if (lower_root_info && lower_root_info->lower_paths) {
++ for (bindex = lower_root_info->bstart;
++ bindex >= 0 && bindex <= lower_root_info->bend;
++ bindex++)
++ path_put(&lower_root_info->lower_paths[bindex]);
++ }
++
++ kfree(lower_root_info->lower_paths);
++ kfree(lower_root_info);
++
++ kfree(UNIONFS_SB(sb)->data);
++ UNIONFS_SB(sb)->data = NULL;
++
++ lower_root_info = ERR_PTR(err);
++out:
++ return lower_root_info;
++}
++
++/*
++ * our custom d_alloc_root work-alike
++ *
++ * we can't use d_alloc_root if we want to use our own interpose function
++ * unchanged, so we simply call our own "fake" d_alloc_root
++ */
++static struct dentry *unionfs_d_alloc_root(struct super_block *sb)
++{
++ struct dentry *ret = NULL;
++
++ if (sb) {
++ static const struct qstr name = {
++ .name = "/",
++ .len = 1
++ };
++
++ ret = d_alloc(NULL, &name);
++ if (likely(ret)) {
++ ret->d_op = &unionfs_dops;
++ ret->d_sb = sb;
++ ret->d_parent = ret;
++ }
++ }
++ return ret;
++}
++
++/*
++ * There is no need to lock the unionfs_super_info's rwsem as there is no
++ * way anyone can have a reference to the superblock at this point in time.
++ */
++static int unionfs_read_super(struct super_block *sb, void *raw_data,
++ int silent)
++{
++ int err = 0;
++ struct unionfs_dentry_info *lower_root_info = NULL;
++ int bindex, bstart, bend;
++
++ if (!raw_data) {
++ printk(KERN_ERR
++ "unionfs: read_super: missing data argument\n");
++ err = -EINVAL;
++ goto out;
++ }
++
++ /* Allocate superblock private data */
++ sb->s_fs_info = kzalloc(sizeof(struct unionfs_sb_info), GFP_KERNEL);
++ if (unlikely(!UNIONFS_SB(sb))) {
++ printk(KERN_CRIT "unionfs: read_super: out of memory\n");
++ err = -ENOMEM;
++ goto out;
++ }
++
++ UNIONFS_SB(sb)->bend = -1;
++ atomic_set(&UNIONFS_SB(sb)->generation, 1);
++ init_rwsem(&UNIONFS_SB(sb)->rwsem);
++ UNIONFS_SB(sb)->high_branch_id = -1; /* -1 == invalid branch ID */
++
++ lower_root_info = unionfs_parse_options(sb, raw_data);
++ if (IS_ERR(lower_root_info)) {
++ printk(KERN_ERR
++ "unionfs: read_super: error while parsing options "
++ "(err = %ld)\n", PTR_ERR(lower_root_info));
++ err = PTR_ERR(lower_root_info);
++ lower_root_info = NULL;
++ goto out_free;
++ }
++ if (lower_root_info->bstart == -1) {
++ err = -ENOENT;
++ goto out_free;
++ }
++
++ /* set the lower superblock field of upper superblock */
++ bstart = lower_root_info->bstart;
++ BUG_ON(bstart != 0);
++ sbend(sb) = bend = lower_root_info->bend;
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ struct dentry *d = lower_root_info->lower_paths[bindex].dentry;
++ atomic_inc(&d->d_sb->s_active);
++ unionfs_set_lower_super_idx(sb, bindex, d->d_sb);
++ }
++
++ /* max Bytes is the maximum bytes from highest priority branch */
++ sb->s_maxbytes = unionfs_lower_super_idx(sb, 0)->s_maxbytes;
++
++ /*
++ * Our c/m/atime granularity is 1 ns because we may stack on file
++ * systems whose granularity is as good. This is important for our
++ * time-based cache coherency.
++ */
++ sb->s_time_gran = 1;
++
++ sb->s_op = &unionfs_sops;
++
++ /* See comment next to the definition of unionfs_d_alloc_root */
++ sb->s_root = unionfs_d_alloc_root(sb);
++ if (unlikely(!sb->s_root)) {
++ err = -ENOMEM;
++ goto out_dput;
++ }
++
++ /* link the upper and lower dentries */
++ sb->s_root->d_fsdata = NULL;
++ err = new_dentry_private_data(sb->s_root, UNIONFS_DMUTEX_ROOT);
++ if (unlikely(err))
++ goto out_freedpd;
++
++ /* Set the lower dentries for s_root */
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ struct dentry *d;
++ struct vfsmount *m;
++
++ d = lower_root_info->lower_paths[bindex].dentry;
++ m = lower_root_info->lower_paths[bindex].mnt;
++
++ unionfs_set_lower_dentry_idx(sb->s_root, bindex, d);
++ unionfs_set_lower_mnt_idx(sb->s_root, bindex, m);
++ }
++ dbstart(sb->s_root) = bstart;
++ dbend(sb->s_root) = bend;
++
++ /* Set the generation number to one, since this is for the mount. */
++ atomic_set(&UNIONFS_D(sb->s_root)->generation, 1);
++
++ /*
++ * Call interpose to create the upper level inode. Only
++ * INTERPOSE_LOOKUP can return a value other than 0 on err.
++ */
++ err = PTR_ERR(unionfs_interpose(sb->s_root, sb, 0));
++ unionfs_unlock_dentry(sb->s_root);
++ if (!err)
++ goto out;
++ /* else fall through */
++
++out_freedpd:
++ if (UNIONFS_D(sb->s_root)) {
++ kfree(UNIONFS_D(sb->s_root)->lower_paths);
++ free_dentry_private_data(sb->s_root);
++ }
++ dput(sb->s_root);
++
++out_dput:
++ if (lower_root_info && !IS_ERR(lower_root_info)) {
++ for (bindex = lower_root_info->bstart;
++ bindex <= lower_root_info->bend; bindex++) {
++ struct dentry *d;
++ d = lower_root_info->lower_paths[bindex].dentry;
++ /* drop refs we took earlier */
++ atomic_dec(&d->d_sb->s_active);
++ path_put(&lower_root_info->lower_paths[bindex]);
++ }
++ kfree(lower_root_info->lower_paths);
++ kfree(lower_root_info);
++ lower_root_info = NULL;
++ }
++
++out_free:
++ kfree(UNIONFS_SB(sb)->data);
++ kfree(UNIONFS_SB(sb));
++ sb->s_fs_info = NULL;
++
++out:
++ if (lower_root_info && !IS_ERR(lower_root_info)) {
++ kfree(lower_root_info->lower_paths);
++ kfree(lower_root_info);
++ }
++ return err;
++}
++
++static struct dentry *unionfs_mount(struct file_system_type *fs_type,
++ int flags, const char *dev_name,
++ void *raw_data)
++{
++ struct dentry *dentry;
++
++ dentry = mount_nodev(fs_type, flags, raw_data, unionfs_read_super);
++ if (!PTR_ERR(dentry))
++ UNIONFS_SB(dentry->d_sb)->dev_name =
++ kstrdup(dev_name, GFP_KERNEL);
++ return dentry;
++}
++
++static struct file_system_type unionfs_fs_type = {
++ .owner = THIS_MODULE,
++ .name = UNIONFS_NAME,
++ .mount = unionfs_mount,
++ .kill_sb = generic_shutdown_super,
++ .fs_flags = FS_REVAL_DOT,
++};
++
++static int __init init_unionfs_fs(void)
++{
++ int err;
++
++ pr_info("Registering unionfs " UNIONFS_VERSION "\n");
++
++ err = unionfs_init_filldir_cache();
++ if (unlikely(err))
++ goto out;
++ err = unionfs_init_inode_cache();
++ if (unlikely(err))
++ goto out;
++ err = unionfs_init_dentry_cache();
++ if (unlikely(err))
++ goto out;
++ err = init_sioq();
++ if (unlikely(err))
++ goto out;
++ err = register_filesystem(&unionfs_fs_type);
++out:
++ if (unlikely(err)) {
++ stop_sioq();
++ unionfs_destroy_filldir_cache();
++ unionfs_destroy_inode_cache();
++ unionfs_destroy_dentry_cache();
++ }
++ return err;
++}
++
++static void __exit exit_unionfs_fs(void)
++{
++ stop_sioq();
++ unionfs_destroy_filldir_cache();
++ unionfs_destroy_inode_cache();
++ unionfs_destroy_dentry_cache();
++ unregister_filesystem(&unionfs_fs_type);
++ pr_info("Completed unionfs module unload\n");
++}
++
++MODULE_AUTHOR("Erez Zadok, Filesystems and Storage Lab, Stony Brook University"
++ " (http://www.fsl.cs.sunysb.edu)");
++MODULE_DESCRIPTION("Unionfs " UNIONFS_VERSION
++ " (http://unionfs.filesystems.org)");
++MODULE_LICENSE("GPL");
++
++module_init(init_unionfs_fs);
++module_exit(exit_unionfs_fs);
+diff --git a/fs/unionfs/mmap.c b/fs/unionfs/mmap.c
+new file mode 100644
+index 0000000..bcc5652
+--- /dev/null
++++ b/fs/unionfs/mmap.c
+@@ -0,0 +1,89 @@
++/*
++ * Copyright (c) 2003-2011 Erez Zadok
++ * Copyright (c) 2003-2006 Charles P. Wright
++ * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
++ * Copyright (c) 2005-2006 Junjiro Okajima
++ * Copyright (c) 2006 Shaya Potter
++ * Copyright (c) 2005 Arun M. Krishnakumar
++ * Copyright (c) 2004-2006 David P. Quigley
++ * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
++ * Copyright (c) 2003 Puja Gupta
++ * Copyright (c) 2003 Harikesavan Krishnan
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
++ *
++ * 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 "union.h"
++
++
++/*
++ * XXX: we need a dummy readpage handler because generic_file_mmap (which we
++ * use in unionfs_mmap) checks for the existence of
++ * mapping->a_ops->readpage, else it returns -ENOEXEC. The VFS will need to
++ * be fixed to allow a file system to define vm_ops->fault without any
++ * address_space_ops whatsoever.
++ *
++ * Otherwise, we don't want to use our readpage method at all.
++ */
++static int unionfs_readpage(struct file *file, struct page *page)
++{
++ BUG();
++ return -EINVAL;
++}
++
++static int unionfs_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
++{
++ int err;
++ struct file *file, *lower_file;
++ const struct vm_operations_struct *lower_vm_ops;
++ struct vm_area_struct lower_vma;
++
++ BUG_ON(!vma);
++ memcpy(&lower_vma, vma, sizeof(struct vm_area_struct));
++ file = lower_vma.vm_file;
++ lower_vm_ops = UNIONFS_F(file)->lower_vm_ops;
++ BUG_ON(!lower_vm_ops);
++
++ lower_file = unionfs_lower_file(file);
++ BUG_ON(!lower_file);
++ /*
++ * XXX: vm_ops->fault may be called in parallel. Because we have to
++ * resort to temporarily changing the vma->vm_file to point to the
++ * lower file, a concurrent invocation of unionfs_fault could see a
++ * different value. In this workaround, we keep a different copy of
++ * the vma structure in our stack, so we never expose a different
++ * value of the vma->vm_file called to us, even temporarily. A
++ * better fix would be to change the calling semantics of ->fault to
++ * take an explicit file pointer.
++ */
++ lower_vma.vm_file = lower_file;
++ err = lower_vm_ops->fault(&lower_vma, vmf);
++ return err;
++}
++
++/*
++ * XXX: the default address_space_ops for unionfs is empty. We cannot set
++ * our inode->i_mapping->a_ops to NULL because too many code paths expect
++ * the a_ops vector to be non-NULL.
++ */
++struct address_space_operations unionfs_aops = {
++ /* empty on purpose */
++};
++
++/*
++ * XXX: we need a second, dummy address_space_ops vector, to be used
++ * temporarily during unionfs_mmap, because the latter calls
++ * generic_file_mmap, which checks if ->readpage exists, else returns
++ * -ENOEXEC.
++ */
++struct address_space_operations unionfs_dummy_aops = {
++ .readpage = unionfs_readpage,
++};
++
++struct vm_operations_struct unionfs_vm_ops = {
++ .fault = unionfs_fault,
++};
+diff --git a/fs/unionfs/rdstate.c b/fs/unionfs/rdstate.c
+new file mode 100644
+index 0000000..59b7333
+--- /dev/null
++++ b/fs/unionfs/rdstate.c
+@@ -0,0 +1,285 @@
++/*
++ * Copyright (c) 2003-2011 Erez Zadok
++ * Copyright (c) 2003-2006 Charles P. Wright
++ * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
++ * Copyright (c) 2005-2006 Junjiro Okajima
++ * Copyright (c) 2005 Arun M. Krishnakumar
++ * Copyright (c) 2004-2006 David P. Quigley
++ * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
++ * Copyright (c) 2003 Puja Gupta
++ * Copyright (c) 2003 Harikesavan Krishnan
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
++ *
++ * 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 "union.h"
++
++/* This file contains the routines for maintaining readdir state. */
++
++/*
++ * There are two structures here, rdstate which is a hash table
++ * of the second structure which is a filldir_node.
++ */
++
++/*
++ * This is a struct kmem_cache for filldir nodes, because we allocate a lot
++ * of them and they shouldn't waste memory. If the node has a small name
++ * (as defined by the dentry structure), then we use an inline name to
++ * preserve kmalloc space.
++ */
++static struct kmem_cache *unionfs_filldir_cachep;
++
++int unionfs_init_filldir_cache(void)
++{
++ unionfs_filldir_cachep =
++ kmem_cache_create("unionfs_filldir",
++ sizeof(struct filldir_node), 0,
++ SLAB_RECLAIM_ACCOUNT, NULL);
++
++ return (unionfs_filldir_cachep ? 0 : -ENOMEM);
++}
++
++void unionfs_destroy_filldir_cache(void)
++{
++ if (unionfs_filldir_cachep)
++ kmem_cache_destroy(unionfs_filldir_cachep);
++}
++
++/*
++ * This is a tuning parameter that tells us roughly how big to make the
++ * hash table in directory entries per page. This isn't perfect, but
++ * at least we get a hash table size that shouldn't be too overloaded.
++ * The following averages are based on my home directory.
++ * 14.44693 Overall
++ * 12.29 Single Page Directories
++ * 117.93 Multi-page directories
++ */
++#define DENTPAGE 4096
++#define DENTPERONEPAGE 12
++#define DENTPERPAGE 118
++#define MINHASHSIZE 1
++static int guesstimate_hash_size(struct inode *inode)
++{
++ struct inode *lower_inode;
++ int bindex;
++ int hashsize = MINHASHSIZE;
++
++ if (UNIONFS_I(inode)->hashsize > 0)
++ return UNIONFS_I(inode)->hashsize;
++
++ for (bindex = ibstart(inode); bindex <= ibend(inode); bindex++) {
++ lower_inode = unionfs_lower_inode_idx(inode, bindex);
++ if (!lower_inode)
++ continue;
++
++ if (i_size_read(lower_inode) == DENTPAGE)
++ hashsize += DENTPERONEPAGE;
++ else
++ hashsize += (i_size_read(lower_inode) / DENTPAGE) *
++ DENTPERPAGE;
++ }
++
++ return hashsize;
++}
++
++int init_rdstate(struct file *file)
++{
++ BUG_ON(sizeof(loff_t) !=
++ (sizeof(unsigned int) + sizeof(unsigned int)));
++ BUG_ON(UNIONFS_F(file)->rdstate != NULL);
++
++ UNIONFS_F(file)->rdstate = alloc_rdstate(file->f_path.dentry->d_inode,
++ fbstart(file));
++
++ return (UNIONFS_F(file)->rdstate ? 0 : -ENOMEM);
++}
++
++struct unionfs_dir_state *find_rdstate(struct inode *inode, loff_t fpos)
++{
++ struct unionfs_dir_state *rdstate = NULL;
++ struct list_head *pos;
++
++ spin_lock(&UNIONFS_I(inode)->rdlock);
++ list_for_each(pos, &UNIONFS_I(inode)->readdircache) {
++ struct unionfs_dir_state *r =
++ list_entry(pos, struct unionfs_dir_state, cache);
++ if (fpos == rdstate2offset(r)) {
++ UNIONFS_I(inode)->rdcount--;
++ list_del(&r->cache);
++ rdstate = r;
++ break;
++ }
++ }
++ spin_unlock(&UNIONFS_I(inode)->rdlock);
++ return rdstate;
++}
++
++struct unionfs_dir_state *alloc_rdstate(struct inode *inode, int bindex)
++{
++ int i = 0;
++ int hashsize;
++ unsigned long mallocsize = sizeof(struct unionfs_dir_state);
++ struct unionfs_dir_state *rdstate;
++
++ hashsize = guesstimate_hash_size(inode);
++ mallocsize += hashsize * sizeof(struct list_head);
++ mallocsize = __roundup_pow_of_two(mallocsize);
++
++ /* This should give us about 500 entries anyway. */
++ if (mallocsize > PAGE_SIZE)
++ mallocsize = PAGE_SIZE;
++
++ hashsize = (mallocsize - sizeof(struct unionfs_dir_state)) /
++ sizeof(struct list_head);
++
++ rdstate = kmalloc(mallocsize, GFP_KERNEL);
++ if (unlikely(!rdstate))
++ return NULL;
++
++ spin_lock(&UNIONFS_I(inode)->rdlock);
++ if (UNIONFS_I(inode)->cookie >= (MAXRDCOOKIE - 1))
++ UNIONFS_I(inode)->cookie = 1;
++ else
++ UNIONFS_I(inode)->cookie++;
++
++ rdstate->cookie = UNIONFS_I(inode)->cookie;
++ spin_unlock(&UNIONFS_I(inode)->rdlock);
++ rdstate->offset = 1;
++ rdstate->access = jiffies;
++ rdstate->bindex = bindex;
++ rdstate->dirpos = 0;
++ rdstate->hashentries = 0;
++ rdstate->size = hashsize;
++ for (i = 0; i < rdstate->size; i++)
++ INIT_LIST_HEAD(&rdstate->list[i]);
++
++ return rdstate;
++}
++
++static void free_filldir_node(struct filldir_node *node)
++{
++ if (node->namelen >= DNAME_INLINE_LEN)
++ kfree(node->name);
++ kmem_cache_free(unionfs_filldir_cachep, node);
++}
++
++void free_rdstate(struct unionfs_dir_state *state)
++{
++ struct filldir_node *tmp;
++ int i;
++
++ for (i = 0; i < state->size; i++) {
++ struct list_head *head = &(state->list[i]);
++ struct list_head *pos, *n;
++
++ /* traverse the list and deallocate space */
++ list_for_each_safe(pos, n, head) {
++ tmp = list_entry(pos, struct filldir_node, file_list);
++ list_del(&tmp->file_list);
++ free_filldir_node(tmp);
++ }
++ }
++
++ kfree(state);
++}
++
++struct filldir_node *find_filldir_node(struct unionfs_dir_state *rdstate,
++ const char *name, int namelen,
++ int is_whiteout)
++{
++ int index;
++ unsigned int hash;
++ struct list_head *head;
++ struct list_head *pos;
++ struct filldir_node *cursor = NULL;
++ int found = 0;
++
++ BUG_ON(namelen <= 0);
++
++ hash = full_name_hash(name, namelen);
++ index = hash % rdstate->size;
++
++ head = &(rdstate->list[index]);
++ list_for_each(pos, head) {
++ cursor = list_entry(pos, struct filldir_node, file_list);
++
++ if (cursor->namelen == namelen && cursor->hash == hash &&
++ !strncmp(cursor->name, name, namelen)) {
++ /*
++ * a duplicate exists, and hence no need to create
++ * entry to the list
++ */
++ found = 1;
++
++ /*
++ * if a duplicate is found in this branch, and is
++ * not due to the caller looking for an entry to
++ * whiteout, then the file system may be corrupted.
++ */
++ if (unlikely(!is_whiteout &&
++ cursor->bindex == rdstate->bindex))
++ printk(KERN_ERR "unionfs: filldir: possible "
++ "I/O error: a file is duplicated "
++ "in the same branch %d: %s\n",
++ rdstate->bindex, cursor->name);
++ break;
++ }
++ }
++
++ if (!found)
++ cursor = NULL;
++
++ return cursor;
++}
++
++int add_filldir_node(struct unionfs_dir_state *rdstate, const char *name,
++ int namelen, int bindex, int whiteout)
++{
++ struct filldir_node *new;
++ unsigned int hash;
++ int index;
++ int err = 0;
++ struct list_head *head;
++
++ BUG_ON(namelen <= 0);
++
++ hash = full_name_hash(name, namelen);
++ index = hash % rdstate->size;
++ head = &(rdstate->list[index]);
++
++ new = kmem_cache_alloc(unionfs_filldir_cachep, GFP_KERNEL);
++ if (unlikely(!new)) {
++ err = -ENOMEM;
++ goto out;
++ }
++
++ INIT_LIST_HEAD(&new->file_list);
++ new->namelen = namelen;
++ new->hash = hash;
++ new->bindex = bindex;
++ new->whiteout = whiteout;
++
++ if (namelen < DNAME_INLINE_LEN) {
++ new->name = new->iname;
++ } else {
++ new->name = kmalloc(namelen + 1, GFP_KERNEL);
++ if (unlikely(!new->name)) {
++ kmem_cache_free(unionfs_filldir_cachep, new);
++ new = NULL;
++ goto out;
++ }
++ }
++
++ memcpy(new->name, name, namelen);
++ new->name[namelen] = '\0';
++
++ rdstate->hashentries++;
++
++ list_add(&(new->file_list), head);
++out:
++ return err;
++}
+diff --git a/fs/unionfs/rename.c b/fs/unionfs/rename.c
+new file mode 100644
+index 0000000..c8ab910
+--- /dev/null
++++ b/fs/unionfs/rename.c
+@@ -0,0 +1,522 @@
++/*
++ * Copyright (c) 2003-2011 Erez Zadok
++ * Copyright (c) 2003-2006 Charles P. Wright
++ * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
++ * Copyright (c) 2005-2006 Junjiro Okajima
++ * Copyright (c) 2005 Arun M. Krishnakumar
++ * Copyright (c) 2004-2006 David P. Quigley
++ * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
++ * Copyright (c) 2003 Puja Gupta
++ * Copyright (c) 2003 Harikesavan Krishnan
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
++ *
++ * 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 "union.h"
++
++/*
++ * This is a helper function for rename, used when rename ends up with hosed
++ * over dentries and we need to revert.
++ */
++static int unionfs_refresh_lower_dentry(struct dentry *dentry,
++ struct dentry *parent, int bindex)
++{
++ struct dentry *lower_dentry;
++ struct dentry *lower_parent;
++ int err = 0;
++ struct nameidata lower_nd;
++
++ verify_locked(dentry);
++
++ lower_parent = unionfs_lower_dentry_idx(parent, bindex);
++
++ BUG_ON(!S_ISDIR(lower_parent->d_inode->i_mode));
++
++ err = init_lower_nd(&lower_nd, LOOKUP_OPEN);
++ if (unlikely(err < 0))
++ goto out;
++ lower_dentry = lookup_one_len_nd(dentry->d_name.name, lower_parent,
++ dentry->d_name.len, &lower_nd);
++ release_lower_nd(&lower_nd, err);
++ if (IS_ERR(lower_dentry)) {
++ err = PTR_ERR(lower_dentry);
++ goto out;
++ }
++
++ dput(unionfs_lower_dentry_idx(dentry, bindex));
++ iput(unionfs_lower_inode_idx(dentry->d_inode, bindex));
++ unionfs_set_lower_inode_idx(dentry->d_inode, bindex, NULL);
++
++ if (!lower_dentry->d_inode) {
++ dput(lower_dentry);
++ unionfs_set_lower_dentry_idx(dentry, bindex, NULL);
++ } else {
++ unionfs_set_lower_dentry_idx(dentry, bindex, lower_dentry);
++ unionfs_set_lower_inode_idx(dentry->d_inode, bindex,
++ igrab(lower_dentry->d_inode));
++ }
++
++out:
++ return err;
++}
++
++static int __unionfs_rename(struct inode *old_dir, struct dentry *old_dentry,
++ struct dentry *old_parent,
++ struct inode *new_dir, struct dentry *new_dentry,
++ struct dentry *new_parent,
++ int bindex)
++{
++ int err = 0;
++ struct dentry *lower_old_dentry;
++ struct dentry *lower_new_dentry;
++ struct dentry *lower_old_dir_dentry;
++ struct dentry *lower_new_dir_dentry;
++ struct dentry *trap;
++
++ lower_new_dentry = unionfs_lower_dentry_idx(new_dentry, bindex);
++ lower_old_dentry = unionfs_lower_dentry_idx(old_dentry, bindex);
++
++ if (!lower_new_dentry) {
++ lower_new_dentry =
++ create_parents(new_parent->d_inode,
++ new_dentry, new_dentry->d_name.name,
++ bindex);
++ if (IS_ERR(lower_new_dentry)) {
++ err = PTR_ERR(lower_new_dentry);
++ if (IS_COPYUP_ERR(err))
++ goto out;
++ printk(KERN_ERR "unionfs: error creating directory "
++ "tree for rename, bindex=%d err=%d\n",
++ bindex, err);
++ goto out;
++ }
++ }
++
++ /* check for and remove whiteout, if any */
++ err = check_unlink_whiteout(new_dentry, lower_new_dentry, bindex);
++ if (err > 0) /* ignore if whiteout found and successfully removed */
++ err = 0;
++ if (err)
++ goto out;
++
++ /* check of old_dentry branch is writable */
++ err = is_robranch_super(old_dentry->d_sb, bindex);
++ if (err)
++ goto out;
++
++ dget(lower_old_dentry);
++ dget(lower_new_dentry);
++ lower_old_dir_dentry = dget_parent(lower_old_dentry);
++ lower_new_dir_dentry = dget_parent(lower_new_dentry);
++
++ trap = lock_rename(lower_old_dir_dentry, lower_new_dir_dentry);
++ /* source should not be ancenstor of target */
++ if (trap == lower_old_dentry) {
++ err = -EINVAL;
++ goto out_err_unlock;
++ }
++ /* target should not be ancenstor of source */
++ if (trap == lower_new_dentry) {
++ err = -ENOTEMPTY;
++ goto out_err_unlock;
++ }
++ err = vfs_rename(lower_old_dir_dentry->d_inode, lower_old_dentry,
++ lower_new_dir_dentry->d_inode, lower_new_dentry);
++out_err_unlock:
++ if (!err) {
++ /* update parent dir times */
++ fsstack_copy_attr_times(old_dir, lower_old_dir_dentry->d_inode);
++ fsstack_copy_attr_times(new_dir, lower_new_dir_dentry->d_inode);
++ }
++ unlock_rename(lower_old_dir_dentry, lower_new_dir_dentry);
++
++ dput(lower_old_dir_dentry);
++ dput(lower_new_dir_dentry);
++ dput(lower_old_dentry);
++ dput(lower_new_dentry);
++
++out:
++ if (!err) {
++ /* Fixup the new_dentry. */
++ if (bindex < dbstart(new_dentry))
++ dbstart(new_dentry) = bindex;
++ else if (bindex > dbend(new_dentry))
++ dbend(new_dentry) = bindex;
++ }
++
++ return err;
++}
++
++/*
++ * Main rename code. This is sufficiently complex, that it's documented in
++ * Documentation/filesystems/unionfs/rename.txt. This routine calls
++ * __unionfs_rename() above to perform some of the work.
++ */
++static int do_unionfs_rename(struct inode *old_dir,
++ struct dentry *old_dentry,
++ struct dentry *old_parent,
++ struct inode *new_dir,
++ struct dentry *new_dentry,
++ struct dentry *new_parent)
++{
++ int err = 0;
++ int bindex;
++ int old_bstart, old_bend;
++ int new_bstart, new_bend;
++ int do_copyup = -1;
++ int local_err = 0;
++ int eio = 0;
++ int revert = 0;
++
++ old_bstart = dbstart(old_dentry);
++ old_bend = dbend(old_dentry);
++
++ new_bstart = dbstart(new_dentry);
++ new_bend = dbend(new_dentry);
++
++ /* Rename source to destination. */
++ err = __unionfs_rename(old_dir, old_dentry, old_parent,
++ new_dir, new_dentry, new_parent,
++ old_bstart);
++ if (err) {
++ if (!IS_COPYUP_ERR(err))
++ goto out;
++ do_copyup = old_bstart - 1;
++ } else {
++ revert = 1;
++ }
++
++ /*
++ * Unlink all instances of destination that exist to the left of
++ * bstart of source. On error, revert back, goto out.
++ */
++ for (bindex = old_bstart - 1; bindex >= new_bstart; bindex--) {
++ struct dentry *unlink_dentry;
++ struct dentry *unlink_dir_dentry;
++
++ BUG_ON(bindex < 0);
++ unlink_dentry = unionfs_lower_dentry_idx(new_dentry, bindex);
++ if (!unlink_dentry)
++ continue;
++
++ unlink_dir_dentry = lock_parent(unlink_dentry);
++ err = is_robranch_super(old_dir->i_sb, bindex);
++ if (!err)
++ err = vfs_unlink(unlink_dir_dentry->d_inode,
++ unlink_dentry);
++
++ fsstack_copy_attr_times(new_parent->d_inode,
++ unlink_dir_dentry->d_inode);
++ /* propagate number of hard-links */
++ new_parent->d_inode->i_nlink =
++ unionfs_get_nlinks(new_parent->d_inode);
++
++ unlock_dir(unlink_dir_dentry);
++ if (!err) {
++ if (bindex != new_bstart) {
++ dput(unlink_dentry);
++ unionfs_set_lower_dentry_idx(new_dentry,
++ bindex, NULL);
++ }
++ } else if (IS_COPYUP_ERR(err)) {
++ do_copyup = bindex - 1;
++ } else if (revert) {
++ goto revert;
++ }
++ }
++
++ if (do_copyup != -1) {
++ for (bindex = do_copyup; bindex >= 0; bindex--) {
++ /*
++ * copyup the file into some left directory, so that
++ * you can rename it
++ */
++ err = copyup_dentry(old_parent->d_inode,
++ old_dentry, old_bstart, bindex,
++ old_dentry->d_name.name,
++ old_dentry->d_name.len, NULL,
++ i_size_read(old_dentry->d_inode));
++ /* if copyup failed, try next branch to the left */
++ if (err)
++ continue;
++ /*
++ * create whiteout before calling __unionfs_rename
++ * because the latter will change the old_dentry's
++ * lower name and parent dir, resulting in the
++ * whiteout getting created in the wrong dir.
++ */
++ err = create_whiteout(old_dentry, bindex);
++ if (err) {
++ printk(KERN_ERR "unionfs: can't create a "
++ "whiteout for %s in rename (err=%d)\n",
++ old_dentry->d_name.name, err);
++ continue;
++ }
++ err = __unionfs_rename(old_dir, old_dentry, old_parent,
++ new_dir, new_dentry, new_parent,
++ bindex);
++ break;
++ }
++ }
++
++ /* make it opaque */
++ if (S_ISDIR(old_dentry->d_inode->i_mode)) {
++ err = make_dir_opaque(old_dentry, dbstart(old_dentry));
++ if (err)
++ goto revert;
++ }
++
++ /*
++ * Create whiteout for source, only if:
++ * (1) There is more than one underlying instance of source.
++ * (We did a copy_up is taken care of above).
++ */
++ if ((old_bstart != old_bend) && (do_copyup == -1)) {
++ err = create_whiteout(old_dentry, old_bstart);
++ if (err) {
++ /* can't fix anything now, so we exit with -EIO */
++ printk(KERN_ERR "unionfs: can't create a whiteout for "
++ "%s in rename!\n", old_dentry->d_name.name);
++ err = -EIO;
++ }
++ }
++
++out:
++ return err;
++
++revert:
++ /* Do revert here. */
++ local_err = unionfs_refresh_lower_dentry(new_dentry, new_parent,
++ old_bstart);
++ if (local_err) {
++ printk(KERN_ERR "unionfs: revert failed in rename: "
++ "the new refresh failed\n");
++ eio = -EIO;
++ }
++
++ local_err = unionfs_refresh_lower_dentry(old_dentry, old_parent,
++ old_bstart);
++ if (local_err) {
++ printk(KERN_ERR "unionfs: revert failed in rename: "
++ "the old refresh failed\n");
++ eio = -EIO;
++ goto revert_out;
++ }
++
++ if (!unionfs_lower_dentry_idx(new_dentry, bindex) ||
++ !unionfs_lower_dentry_idx(new_dentry, bindex)->d_inode) {
++ printk(KERN_ERR "unionfs: revert failed in rename: "
++ "the object disappeared from under us!\n");
++ eio = -EIO;
++ goto revert_out;
++ }
++
++ if (unionfs_lower_dentry_idx(old_dentry, bindex) &&
++ unionfs_lower_dentry_idx(old_dentry, bindex)->d_inode) {
++ printk(KERN_ERR "unionfs: revert failed in rename: "
++ "the object was created underneath us!\n");
++ eio = -EIO;
++ goto revert_out;
++ }
++
++ local_err = __unionfs_rename(new_dir, new_dentry, new_parent,
++ old_dir, old_dentry, old_parent,
++ old_bstart);
++
++ /* If we can't fix it, then we cop-out with -EIO. */
++ if (local_err) {
++ printk(KERN_ERR "unionfs: revert failed in rename!\n");
++ eio = -EIO;
++ }
++
++ local_err = unionfs_refresh_lower_dentry(new_dentry, new_parent,
++ bindex);
++ if (local_err)
++ eio = -EIO;
++ local_err = unionfs_refresh_lower_dentry(old_dentry, old_parent,
++ bindex);
++ if (local_err)
++ eio = -EIO;
++
++revert_out:
++ if (eio)
++ err = eio;
++ return err;
++}
++
++/*
++ * We can't copyup a directory, because it may involve huge numbers of
++ * children, etc. Doing that in the kernel would be bad, so instead we
++ * return EXDEV to the user-space utility that caused this, and let the
++ * user-space recurse and ask us to copy up each file separately.
++ */
++static int may_rename_dir(struct dentry *dentry, struct dentry *parent)
++{
++ int err, bstart;
++
++ err = check_empty(dentry, parent, NULL);
++ if (err == -ENOTEMPTY) {
++ if (is_robranch(dentry))
++ return -EXDEV;
++ } else if (err) {
++ return err;
++ }
++
++ bstart = dbstart(dentry);
++ if (dbend(dentry) == bstart || dbopaque(dentry) == bstart)
++ return 0;
++
++ dbstart(dentry) = bstart + 1;
++ err = check_empty(dentry, parent, NULL);
++ dbstart(dentry) = bstart;
++ if (err == -ENOTEMPTY)
++ err = -EXDEV;
++ return err;
++}
++
++/*
++ * The locking rules in unionfs_rename are complex. We could use a simpler
++ * superblock-level name-space lock for renames and copy-ups.
++ */
++int unionfs_rename(struct inode *old_dir, struct dentry *old_dentry,
++ struct inode *new_dir, struct dentry *new_dentry)
++{
++ int err = 0;
++ struct dentry *wh_dentry;
++ struct dentry *old_parent, *new_parent;
++ int valid = true;
++
++ unionfs_read_lock(old_dentry->d_sb, UNIONFS_SMUTEX_CHILD);
++ old_parent = dget_parent(old_dentry);
++ new_parent = dget_parent(new_dentry);
++ /* un/lock parent dentries only if they differ from old/new_dentry */
++ if (old_parent != old_dentry &&
++ old_parent != new_dentry)
++ unionfs_lock_dentry(old_parent, UNIONFS_DMUTEX_REVAL_PARENT);
++ if (new_parent != old_dentry &&
++ new_parent != new_dentry &&
++ new_parent != old_parent)
++ unionfs_lock_dentry(new_parent, UNIONFS_DMUTEX_REVAL_CHILD);
++ unionfs_double_lock_dentry(old_dentry, new_dentry);
++
++ valid = __unionfs_d_revalidate(old_dentry, old_parent, false);
++ if (!valid) {
++ err = -ESTALE;
++ goto out;
++ }
++ if (!d_deleted(new_dentry) && new_dentry->d_inode) {
++ valid = __unionfs_d_revalidate(new_dentry, new_parent, false);
++ if (!valid) {
++ err = -ESTALE;
++ goto out;
++ }
++ }
++
++ if (!S_ISDIR(old_dentry->d_inode->i_mode))
++ err = unionfs_partial_lookup(old_dentry, old_parent);
++ else
++ err = may_rename_dir(old_dentry, old_parent);
++
++ if (err)
++ goto out;
++
++ err = unionfs_partial_lookup(new_dentry, new_parent);
++ if (err)
++ goto out;
++
++ /*
++ * if new_dentry is already lower because of whiteout,
++ * simply override it even if the whited-out dir is not empty.
++ */
++ wh_dentry = find_first_whiteout(new_dentry);
++ if (!IS_ERR(wh_dentry)) {
++ dput(wh_dentry);
++ } else if (new_dentry->d_inode) {
++ if (S_ISDIR(old_dentry->d_inode->i_mode) !=
++ S_ISDIR(new_dentry->d_inode->i_mode)) {
++ err = S_ISDIR(old_dentry->d_inode->i_mode) ?
++ -ENOTDIR : -EISDIR;
++ goto out;
++ }
++
++ if (S_ISDIR(new_dentry->d_inode->i_mode)) {
++ struct unionfs_dir_state *namelist = NULL;
++ /* check if this unionfs directory is empty or not */
++ err = check_empty(new_dentry, new_parent, &namelist);
++ if (err)
++ goto out;
++
++ if (!is_robranch(new_dentry))
++ err = delete_whiteouts(new_dentry,
++ dbstart(new_dentry),
++ namelist);
++
++ free_rdstate(namelist);
++
++ if (err)
++ goto out;
++ }
++ }
++
++ err = do_unionfs_rename(old_dir, old_dentry, old_parent,
++ new_dir, new_dentry, new_parent);
++ if (err)
++ goto out;
++
++ /*
++ * force re-lookup since the dir on ro branch is not renamed, and
++ * lower dentries still indicate the un-renamed ones.
++ */
++ if (S_ISDIR(old_dentry->d_inode->i_mode))
++ atomic_dec(&UNIONFS_D(old_dentry)->generation);
++ else
++ unionfs_postcopyup_release(old_dentry);
++ if (new_dentry->d_inode && !S_ISDIR(new_dentry->d_inode->i_mode)) {
++ unionfs_postcopyup_release(new_dentry);
++ unionfs_postcopyup_setmnt(new_dentry);
++ if (!unionfs_lower_inode(new_dentry->d_inode)) {
++ /*
++ * If we get here, it means that no copyup was
++ * needed, and that a file by the old name already
++ * existing on the destination branch; that file got
++ * renamed earlier in this function, so all we need
++ * to do here is set the lower inode.
++ */
++ struct inode *inode;
++ inode = unionfs_lower_inode(old_dentry->d_inode);
++ igrab(inode);
++ unionfs_set_lower_inode_idx(new_dentry->d_inode,
++ dbstart(new_dentry),
++ inode);
++ }
++ }
++ /* if all of this renaming succeeded, update our times */
++ unionfs_copy_attr_times(old_dentry->d_inode);
++ unionfs_copy_attr_times(new_dentry->d_inode);
++ unionfs_check_inode(old_dir);
++ unionfs_check_inode(new_dir);
++ unionfs_check_dentry(old_dentry);
++ unionfs_check_dentry(new_dentry);
++
++out:
++ if (err) /* clear the new_dentry stuff created */
++ d_drop(new_dentry);
++
++ unionfs_double_unlock_dentry(old_dentry, new_dentry);
++ if (new_parent != old_dentry &&
++ new_parent != new_dentry &&
++ new_parent != old_parent)
++ unionfs_unlock_dentry(new_parent);
++ if (old_parent != old_dentry &&
++ old_parent != new_dentry)
++ unionfs_unlock_dentry(old_parent);
++ dput(new_parent);
++ dput(old_parent);
++ unionfs_read_unlock(old_dentry->d_sb);
++
++ return err;
++}
+diff --git a/fs/unionfs/sioq.c b/fs/unionfs/sioq.c
+new file mode 100644
+index 0000000..b923742
+--- /dev/null
++++ b/fs/unionfs/sioq.c
+@@ -0,0 +1,101 @@
++/*
++ * Copyright (c) 2006-2011 Erez Zadok
++ * Copyright (c) 2006 Charles P. Wright
++ * Copyright (c) 2006-2007 Josef 'Jeff' Sipek
++ * Copyright (c) 2006 Junjiro Okajima
++ * Copyright (c) 2006 David P. Quigley
++ * Copyright (c) 2006-2011 Stony Brook University
++ * Copyright (c) 2006-2011 The Research Foundation of SUNY
++ *
++ * 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 "union.h"
++
++/*
++ * Super-user IO work Queue - sometimes we need to perform actions which
++ * would fail due to the unix permissions on the parent directory (e.g.,
++ * rmdir a directory which appears empty, but in reality contains
++ * whiteouts).
++ */
++
++static struct workqueue_struct *superio_workqueue;
++
++int __init init_sioq(void)
++{
++ int err;
++
++ superio_workqueue = create_workqueue("unionfs_siod");
++ if (!IS_ERR(superio_workqueue))
++ return 0;
++
++ err = PTR_ERR(superio_workqueue);
++ printk(KERN_ERR "unionfs: create_workqueue failed %d\n", err);
++ superio_workqueue = NULL;
++ return err;
++}
++
++void stop_sioq(void)
++{
++ if (superio_workqueue)
++ destroy_workqueue(superio_workqueue);
++}
++
++void run_sioq(work_func_t func, struct sioq_args *args)
++{
++ INIT_WORK(&args->work, func);
++
++ init_completion(&args->comp);
++ while (!queue_work(superio_workqueue, &args->work)) {
++ /* TODO: do accounting if needed */
++ schedule();
++ }
++ wait_for_completion(&args->comp);
++}
++
++void __unionfs_create(struct work_struct *work)
++{
++ struct sioq_args *args = container_of(work, struct sioq_args, work);
++ struct create_args *c = &args->create;
++
++ args->err = vfs_create(c->parent, c->dentry, c->mode, c->nd);
++ complete(&args->comp);
++}
++
++void __unionfs_mkdir(struct work_struct *work)
++{
++ struct sioq_args *args = container_of(work, struct sioq_args, work);
++ struct mkdir_args *m = &args->mkdir;
++
++ args->err = vfs_mkdir(m->parent, m->dentry, m->mode);
++ complete(&args->comp);
++}
++
++void __unionfs_mknod(struct work_struct *work)
++{
++ struct sioq_args *args = container_of(work, struct sioq_args, work);
++ struct mknod_args *m = &args->mknod;
++
++ args->err = vfs_mknod(m->parent, m->dentry, m->mode, m->dev);
++ complete(&args->comp);
++}
++
++void __unionfs_symlink(struct work_struct *work)
++{
++ struct sioq_args *args = container_of(work, struct sioq_args, work);
++ struct symlink_args *s = &args->symlink;
++
++ args->err = vfs_symlink(s->parent, s->dentry, s->symbuf);
++ complete(&args->comp);
++}
++
++void __unionfs_unlink(struct work_struct *work)
++{
++ struct sioq_args *args = container_of(work, struct sioq_args, work);
++ struct unlink_args *u = &args->unlink;
++
++ args->err = vfs_unlink(u->parent, u->dentry);
++ complete(&args->comp);
++}
+diff --git a/fs/unionfs/sioq.h b/fs/unionfs/sioq.h
+new file mode 100644
+index 0000000..c2dfb94
+--- /dev/null
++++ b/fs/unionfs/sioq.h
+@@ -0,0 +1,91 @@
++/*
++ * Copyright (c) 2006-2011 Erez Zadok
++ * Copyright (c) 2006 Charles P. Wright
++ * Copyright (c) 2006-2007 Josef 'Jeff' Sipek
++ * Copyright (c) 2006 Junjiro Okajima
++ * Copyright (c) 2006 David P. Quigley
++ * Copyright (c) 2006-2011 Stony Brook University
++ * Copyright (c) 2006-2011 The Research Foundation of SUNY
++ *
++ * 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.
++ */
++
++#ifndef _SIOQ_H
++#define _SIOQ_H
++
++struct deletewh_args {
++ struct unionfs_dir_state *namelist;
++ struct dentry *dentry;
++ int bindex;
++};
++
++struct is_opaque_args {
++ struct dentry *dentry;
++};
++
++struct create_args {
++ struct inode *parent;
++ struct dentry *dentry;
++ umode_t mode;
++ struct nameidata *nd;
++};
++
++struct mkdir_args {
++ struct inode *parent;
++ struct dentry *dentry;
++ umode_t mode;
++};
++
++struct mknod_args {
++ struct inode *parent;
++ struct dentry *dentry;
++ umode_t mode;
++ dev_t dev;
++};
++
++struct symlink_args {
++ struct inode *parent;
++ struct dentry *dentry;
++ char *symbuf;
++};
++
++struct unlink_args {
++ struct inode *parent;
++ struct dentry *dentry;
++};
++
++
++struct sioq_args {
++ struct completion comp;
++ struct work_struct work;
++ int err;
++ void *ret;
++
++ union {
++ struct deletewh_args deletewh;
++ struct is_opaque_args is_opaque;
++ struct create_args create;
++ struct mkdir_args mkdir;
++ struct mknod_args mknod;
++ struct symlink_args symlink;
++ struct unlink_args unlink;
++ };
++};
++
++/* Extern definitions for SIOQ functions */
++extern int __init init_sioq(void);
++extern void stop_sioq(void);
++extern void run_sioq(work_func_t func, struct sioq_args *args);
++
++/* Extern definitions for our privilege escalation helpers */
++extern void __unionfs_create(struct work_struct *work);
++extern void __unionfs_mkdir(struct work_struct *work);
++extern void __unionfs_mknod(struct work_struct *work);
++extern void __unionfs_symlink(struct work_struct *work);
++extern void __unionfs_unlink(struct work_struct *work);
++extern void __delete_whiteouts(struct work_struct *work);
++extern void __is_opaque_dir(struct work_struct *work);
++
++#endif /* not _SIOQ_H */
+diff --git a/fs/unionfs/subr.c b/fs/unionfs/subr.c
+new file mode 100644
+index 0000000..bdca2f7
+--- /dev/null
++++ b/fs/unionfs/subr.c
+@@ -0,0 +1,95 @@
++/*
++ * Copyright (c) 2003-2011 Erez Zadok
++ * Copyright (c) 2003-2006 Charles P. Wright
++ * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
++ * Copyright (c) 2005-2006 Junjiro Okajima
++ * Copyright (c) 2005 Arun M. Krishnakumar
++ * Copyright (c) 2004-2006 David P. Quigley
++ * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
++ * Copyright (c) 2003 Puja Gupta
++ * Copyright (c) 2003 Harikesavan Krishnan
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
++ *
++ * 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 "union.h"
++
++/*
++ * returns the right n_link value based on the inode type
++ */
++int unionfs_get_nlinks(const struct inode *inode)
++{
++ /* don't bother to do all the work since we're unlinked */
++ if (inode->i_nlink == 0)
++ return 0;
++
++ if (!S_ISDIR(inode->i_mode))
++ return unionfs_lower_inode(inode)->i_nlink;
++
++ /*
++ * For directories, we return 1. The only place that could cares
++ * about links is readdir, and there's d_type there so even that
++ * doesn't matter.
++ */
++ return 1;
++}
++
++/* copy a/m/ctime from the lower branch with the newest times */
++void unionfs_copy_attr_times(struct inode *upper)
++{
++ int bindex;
++ struct inode *lower;
++
++ if (!upper)
++ return;
++ if (ibstart(upper) < 0) {
++#ifdef CONFIG_UNION_FS_DEBUG
++ WARN_ON(ibstart(upper) < 0);
++#endif /* CONFIG_UNION_FS_DEBUG */
++ return;
++ }
++ for (bindex = ibstart(upper); bindex <= ibend(upper); bindex++) {
++ lower = unionfs_lower_inode_idx(upper, bindex);
++ if (!lower)
++ continue; /* not all lower dir objects may exist */
++ if (unlikely(timespec_compare(&upper->i_mtime,
++ &lower->i_mtime) < 0))
++ upper->i_mtime = lower->i_mtime;
++ if (unlikely(timespec_compare(&upper->i_ctime,
++ &lower->i_ctime) < 0))
++ upper->i_ctime = lower->i_ctime;
++ if (unlikely(timespec_compare(&upper->i_atime,
++ &lower->i_atime) < 0))
++ upper->i_atime = lower->i_atime;
++ }
++}
++
++/*
++ * A unionfs/fanout version of fsstack_copy_attr_all. Uses a
++ * unionfs_get_nlinks to properly calcluate the number of links to a file.
++ * Also, copies the max() of all a/m/ctimes for all lower inodes (which is
++ * important if the lower inode is a directory type)
++ */
++void unionfs_copy_attr_all(struct inode *dest,
++ const struct inode *src)
++{
++ dest->i_mode = src->i_mode;
++ dest->i_uid = src->i_uid;
++ dest->i_gid = src->i_gid;
++ dest->i_rdev = src->i_rdev;
++
++ unionfs_copy_attr_times(dest);
++
++ dest->i_blkbits = src->i_blkbits;
++ dest->i_flags = src->i_flags;
++
++ /*
++ * Update the nlinks AFTER updating the above fields, because the
++ * get_links callback may depend on them.
++ */
++ dest->i_nlink = unionfs_get_nlinks(dest);
++}
+diff --git a/fs/unionfs/super.c b/fs/unionfs/super.c
+new file mode 100644
+index 0000000..c3ac814
+--- /dev/null
++++ b/fs/unionfs/super.c
+@@ -0,0 +1,1030 @@
++/*
++ * Copyright (c) 2003-2011 Erez Zadok
++ * Copyright (c) 2003-2006 Charles P. Wright
++ * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
++ * Copyright (c) 2005-2006 Junjiro Okajima
++ * Copyright (c) 2005 Arun M. Krishnakumar
++ * Copyright (c) 2004-2006 David P. Quigley
++ * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
++ * Copyright (c) 2003 Puja Gupta
++ * Copyright (c) 2003 Harikesavan Krishnan
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
++ *
++ * 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 "union.h"
++
++/*
++ * The inode cache is used with alloc_inode for both our inode info and the
++ * vfs inode.
++ */
++static struct kmem_cache *unionfs_inode_cachep;
++
++struct inode *unionfs_iget(struct super_block *sb, unsigned long ino)
++{
++ int size;
++ struct unionfs_inode_info *info;
++ struct inode *inode;
++
++ inode = iget_locked(sb, ino);
++ if (!inode)
++ return ERR_PTR(-ENOMEM);
++ if (!(inode->i_state & I_NEW))
++ return inode;
++
++ info = UNIONFS_I(inode);
++ memset(info, 0, offsetof(struct unionfs_inode_info, vfs_inode));
++ info->bstart = -1;
++ info->bend = -1;
++ atomic_set(&info->generation,
++ atomic_read(&UNIONFS_SB(inode->i_sb)->generation));
++ spin_lock_init(&info->rdlock);
++ info->rdcount = 1;
++ info->hashsize = -1;
++ INIT_LIST_HEAD(&info->readdircache);
++
++ size = sbmax(inode->i_sb) * sizeof(struct inode *);
++ info->lower_inodes = kzalloc(size, GFP_KERNEL);
++ if (unlikely(!info->lower_inodes)) {
++ printk(KERN_CRIT "unionfs: no kernel memory when allocating "
++ "lower-pointer array!\n");
++ iget_failed(inode);
++ return ERR_PTR(-ENOMEM);
++ }
++
++ inode->i_version++;
++ inode->i_op = &unionfs_main_iops;
++ inode->i_fop = &unionfs_main_fops;
++
++ inode->i_mapping->a_ops = &unionfs_aops;
++
++ /*
++ * reset times so unionfs_copy_attr_all can keep out time invariants
++ * right (upper inode time being the max of all lower ones).
++ */
++ inode->i_atime.tv_sec = inode->i_atime.tv_nsec = 0;
++ inode->i_mtime.tv_sec = inode->i_mtime.tv_nsec = 0;
++ inode->i_ctime.tv_sec = inode->i_ctime.tv_nsec = 0;
++ unlock_new_inode(inode);
++ return inode;
++}
++
++/*
++ * final actions when unmounting a file system
++ *
++ * No need to lock rwsem.
++ */
++static void unionfs_put_super(struct super_block *sb)
++{
++ int bindex, bstart, bend;
++ struct unionfs_sb_info *spd;
++ int leaks = 0;
++
++ spd = UNIONFS_SB(sb);
++ if (!spd)
++ return;
++
++ bstart = sbstart(sb);
++ bend = sbend(sb);
++
++ /* Make sure we have no leaks of branchget/branchput. */
++ for (bindex = bstart; bindex <= bend; bindex++)
++ if (unlikely(branch_count(sb, bindex) != 0)) {
++ printk(KERN_CRIT
++ "unionfs: branch %d has %d references left!\n",
++ bindex, branch_count(sb, bindex));
++ leaks = 1;
++ }
++ WARN_ON(leaks != 0);
++
++ /* decrement lower super references */
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ struct super_block *s;
++ s = unionfs_lower_super_idx(sb, bindex);
++ unionfs_set_lower_super_idx(sb, bindex, NULL);
++ atomic_dec(&s->s_active);
++ }
++
++ kfree(spd->dev_name);
++ kfree(spd->data);
++ kfree(spd);
++ sb->s_fs_info = NULL;
++}
++
++/*
++ * Since people use this to answer the "How big of a file can I write?"
++ * question, we report the size of the highest priority branch as the size of
++ * the union.
++ */
++static int unionfs_statfs(struct dentry *dentry, struct kstatfs *buf)
++{
++ int err = 0;
++ struct super_block *sb;
++ struct dentry *lower_dentry;
++ struct dentry *parent;
++ struct path lower_path;
++ bool valid;
++
++ sb = dentry->d_sb;
++
++ unionfs_read_lock(sb, UNIONFS_SMUTEX_CHILD);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ valid = __unionfs_d_revalidate(dentry, parent, false);
++ if (unlikely(!valid)) {
++ err = -ESTALE;
++ goto out;
++ }
++ unionfs_check_dentry(dentry);
++
++ lower_dentry = unionfs_lower_dentry(sb->s_root);
++ lower_path.dentry = lower_dentry;
++ lower_path.mnt = unionfs_mntget(sb->s_root, 0);
++ err = vfs_statfs(&lower_path, buf);
++ mntput(lower_path.mnt);
++
++ /* set return buf to our f/s to avoid confusing user-level utils */
++ buf->f_type = UNIONFS_SUPER_MAGIC;
++ /*
++ * Our maximum file name can is shorter by a few bytes because every
++ * file name could potentially be whited-out.
++ *
++ * XXX: this restriction goes away with ODF.
++ */
++ unionfs_set_max_namelen(&buf->f_namelen);
++
++ /*
++ * reset two fields to avoid confusing user-land.
++ * XXX: is this still necessary?
++ */
++ memset(&buf->f_fsid, 0, sizeof(__kernel_fsid_t));
++ memset(&buf->f_spare, 0, sizeof(buf->f_spare));
++
++out:
++ unionfs_check_dentry(dentry);
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(sb);
++ return err;
++}
++
++/* handle mode changing during remount */
++static noinline_for_stack int do_remount_mode_option(
++ char *optarg,
++ int cur_branches,
++ struct unionfs_data *new_data,
++ struct path *new_lower_paths)
++{
++ int err = -EINVAL;
++ int perms, idx;
++ char *modename = strchr(optarg, '=');
++ struct path path;
++
++ /* by now, optarg contains the branch name */
++ if (!*optarg) {
++ printk(KERN_ERR
++ "unionfs: no branch specified for mode change\n");
++ goto out;
++ }
++ if (!modename) {
++ printk(KERN_ERR "unionfs: branch \"%s\" requires a mode\n",
++ optarg);
++ goto out;
++ }
++ *modename++ = '\0';
++ err = parse_branch_mode(modename, &perms);
++ if (err) {
++ printk(KERN_ERR "unionfs: invalid mode \"%s\" for \"%s\"\n",
++ modename, optarg);
++ goto out;
++ }
++
++ /*
++ * Find matching branch index. For now, this assumes that nothing
++ * has been mounted on top of this Unionfs stack. Once we have /odf
++ * and cache-coherency resolved, we'll address the branch-path
++ * uniqueness.
++ */
++ err = kern_path(optarg, LOOKUP_FOLLOW, &path);
++ if (err) {
++ printk(KERN_ERR "unionfs: error accessing "
++ "lower directory \"%s\" (error %d)\n",
++ optarg, err);
++ goto out;
++ }
++ for (idx = 0; idx < cur_branches; idx++)
++ if (path.mnt == new_lower_paths[idx].mnt &&
++ path.dentry == new_lower_paths[idx].dentry)
++ break;
++ path_put(&path); /* no longer needed */
++ if (idx == cur_branches) {
++ err = -ENOENT; /* err may have been reset above */
++ printk(KERN_ERR "unionfs: branch \"%s\" "
++ "not found\n", optarg);
++ goto out;
++ }
++ /* check/change mode for existing branch */
++ /* we don't warn if perms==branchperms */
++ new_data[idx].branchperms = perms;
++ err = 0;
++out:
++ return err;
++}
++
++/* handle branch deletion during remount */
++static noinline_for_stack int do_remount_del_option(
++ char *optarg, int cur_branches,
++ struct unionfs_data *new_data,
++ struct path *new_lower_paths)
++{
++ int err = -EINVAL;
++ int idx;
++ struct path path;
++
++ /* optarg contains the branch name to delete */
++
++ /*
++ * Find matching branch index. For now, this assumes that nothing
++ * has been mounted on top of this Unionfs stack. Once we have /odf
++ * and cache-coherency resolved, we'll address the branch-path
++ * uniqueness.
++ */
++ err = kern_path(optarg, LOOKUP_FOLLOW, &path);
++ if (err) {
++ printk(KERN_ERR "unionfs: error accessing "
++ "lower directory \"%s\" (error %d)\n",
++ optarg, err);
++ goto out;
++ }
++ for (idx = 0; idx < cur_branches; idx++)
++ if (path.mnt == new_lower_paths[idx].mnt &&
++ path.dentry == new_lower_paths[idx].dentry)
++ break;
++ path_put(&path); /* no longer needed */
++ if (idx == cur_branches) {
++ printk(KERN_ERR "unionfs: branch \"%s\" "
++ "not found\n", optarg);
++ err = -ENOENT;
++ goto out;
++ }
++ /* check if there are any open files on the branch to be deleted */
++ if (atomic_read(&new_data[idx].open_files) > 0) {
++ err = -EBUSY;
++ goto out;
++ }
++
++ /*
++ * Now we have to delete the branch. First, release any handles it
++ * has. Then, move the remaining array indexes past "idx" in
++ * new_data and new_lower_paths one to the left. Finally, adjust
++ * cur_branches.
++ */
++ path_put(&new_lower_paths[idx]);
++
++ if (idx < cur_branches - 1) {
++ /* if idx==cur_branches-1, we delete last branch: easy */
++ memmove(&new_data[idx], &new_data[idx+1],
++ (cur_branches - 1 - idx) *
++ sizeof(struct unionfs_data));
++ memmove(&new_lower_paths[idx], &new_lower_paths[idx+1],
++ (cur_branches - 1 - idx) * sizeof(struct path));
++ }
++
++ err = 0;
++out:
++ return err;
++}
++
++/* handle branch insertion during remount */
++static noinline_for_stack int do_remount_add_option(
++ char *optarg, int cur_branches,
++ struct unionfs_data *new_data,
++ struct path *new_lower_paths,
++ int *high_branch_id)
++{
++ int err = -EINVAL;
++ int perms;
++ int idx = 0; /* default: insert at beginning */
++ char *new_branch , *modename = NULL;
++ struct path path;
++
++ /*
++ * optarg can be of several forms:
++ *
++ * /bar:/foo insert /foo before /bar
++ * /bar:/foo=ro insert /foo in ro mode before /bar
++ * /foo insert /foo in the beginning (prepend)
++ * :/foo insert /foo at the end (append)
++ */
++ if (*optarg == ':') { /* append? */
++ new_branch = optarg + 1; /* skip ':' */
++ idx = cur_branches;
++ goto found_insertion_point;
++ }
++ new_branch = strchr(optarg, ':');
++ if (!new_branch) { /* prepend? */
++ new_branch = optarg;
++ goto found_insertion_point;
++ }
++ *new_branch++ = '\0'; /* holds path+mode of new branch */
++
++ /*
++ * Find matching branch index. For now, this assumes that nothing
++ * has been mounted on top of this Unionfs stack. Once we have /odf
++ * and cache-coherency resolved, we'll address the branch-path
++ * uniqueness.
++ */
++ err = kern_path(optarg, LOOKUP_FOLLOW, &path);
++ if (err) {
++ printk(KERN_ERR "unionfs: error accessing "
++ "lower directory \"%s\" (error %d)\n",
++ optarg, err);
++ goto out;
++ }
++ for (idx = 0; idx < cur_branches; idx++)
++ if (path.mnt == new_lower_paths[idx].mnt &&
++ path.dentry == new_lower_paths[idx].dentry)
++ break;
++ path_put(&path); /* no longer needed */
++ if (idx == cur_branches) {
++ printk(KERN_ERR "unionfs: branch \"%s\" "
++ "not found\n", optarg);
++ err = -ENOENT;
++ goto out;
++ }
++
++ /*
++ * At this point idx will hold the index where the new branch should
++ * be inserted before.
++ */
++found_insertion_point:
++ /* find the mode for the new branch */
++ if (new_branch)
++ modename = strchr(new_branch, '=');
++ if (modename)
++ *modename++ = '\0';
++ if (!new_branch || !*new_branch) {
++ printk(KERN_ERR "unionfs: null new branch\n");
++ err = -EINVAL;
++ goto out;
++ }
++ err = parse_branch_mode(modename, &perms);
++ if (err) {
++ printk(KERN_ERR "unionfs: invalid mode \"%s\" for "
++ "branch \"%s\"\n", modename, new_branch);
++ goto out;
++ }
++ err = kern_path(new_branch, LOOKUP_FOLLOW, &path);
++ if (err) {
++ printk(KERN_ERR "unionfs: error accessing "
++ "lower directory \"%s\" (error %d)\n",
++ new_branch, err);
++ goto out;
++ }
++ /*
++ * It's probably safe to check_mode the new branch to insert. Note:
++ * we don't allow inserting branches which are unionfs's by
++ * themselves (check_branch returns EINVAL in that case). This is
++ * because this code base doesn't support stacking unionfs: the ODF
++ * code base supports that correctly.
++ */
++ err = check_branch(&path);
++ if (err) {
++ printk(KERN_ERR "unionfs: lower directory "
++ "\"%s\" is not a valid branch\n", optarg);
++ path_put(&path);
++ goto out;
++ }
++
++ /*
++ * Now we have to insert the new branch. But first, move the bits
++ * to make space for the new branch, if needed. Finally, adjust
++ * cur_branches.
++ * We don't release nd here; it's kept until umount/remount.
++ */
++ if (idx < cur_branches) {
++ /* if idx==cur_branches, we append: easy */
++ memmove(&new_data[idx+1], &new_data[idx],
++ (cur_branches - idx) * sizeof(struct unionfs_data));
++ memmove(&new_lower_paths[idx+1], &new_lower_paths[idx],
++ (cur_branches - idx) * sizeof(struct path));
++ }
++ new_lower_paths[idx].dentry = path.dentry;
++ new_lower_paths[idx].mnt = path.mnt;
++
++ new_data[idx].sb = path.dentry->d_sb;
++ atomic_set(&new_data[idx].open_files, 0);
++ new_data[idx].branchperms = perms;
++ new_data[idx].branch_id = ++*high_branch_id; /* assign new branch ID */
++
++ err = 0;
++out:
++ return err;
++}
++
++
++/*
++ * Support branch management options on remount.
++ *
++ * See Documentation/filesystems/unionfs/ for details.
++ *
++ * @flags: numeric mount options
++ * @options: mount options string
++ *
++ * This function can rearrange a mounted union dynamically, adding and
++ * removing branches, including changing branch modes. Clearly this has to
++ * be done safely and atomically. Luckily, the VFS already calls this
++ * function with lock_super(sb) and lock_kernel() held, preventing
++ * concurrent mixing of new mounts, remounts, and unmounts. Moreover,
++ * do_remount_sb(), our caller function, already called shrink_dcache_sb(sb)
++ * to purge dentries/inodes from our superblock, and also called
++ * fsync_super(sb) to purge any dirty pages. So we're good.
++ *
++ * XXX: however, our remount code may also need to invalidate mapped pages
++ * so as to force them to be re-gotten from the (newly reconfigured) lower
++ * branches. This has to wait for proper mmap and cache coherency support
++ * in the VFS.
++ *
++ */
++static int unionfs_remount_fs(struct super_block *sb, int *flags,
++ char *options)
++{
++ int err = 0;
++ int i;
++ char *optionstmp, *tmp_to_free; /* kstrdup'ed of "options" */
++ char *optname;
++ int cur_branches = 0; /* no. of current branches */
++ int new_branches = 0; /* no. of branches actually left in the end */
++ int add_branches; /* est. no. of branches to add */
++ int del_branches; /* est. no. of branches to del */
++ int max_branches; /* max possible no. of branches */
++ struct unionfs_data *new_data = NULL, *tmp_data = NULL;
++ struct path *new_lower_paths = NULL, *tmp_lower_paths = NULL;
++ struct inode **new_lower_inodes = NULL;
++ int new_high_branch_id; /* new high branch ID */
++ int size; /* memory allocation size, temp var */
++ int old_ibstart, old_ibend;
++
++ unionfs_write_lock(sb);
++
++ /*
++ * The VFS will take care of "ro" and "rw" flags, and we can safely
++ * ignore MS_SILENT, but anything else left over is an error. So we
++ * need to check if any other flags may have been passed (none are
++ * allowed/supported as of now).
++ */
++ if ((*flags & ~(MS_RDONLY | MS_SILENT)) != 0) {
++ printk(KERN_ERR
++ "unionfs: remount flags 0x%x unsupported\n", *flags);
++ err = -EINVAL;
++ goto out_error;
++ }
++
++ /*
++ * If 'options' is NULL, it's probably because the user just changed
++ * the union to a "ro" or "rw" and the VFS took care of it. So
++ * nothing to do and we're done.
++ */
++ if (!options || options[0] == '\0')
++ goto out_error;
++
++ /*
++ * Find out how many branches we will have in the end, counting
++ * "add" and "del" commands. Copy the "options" string because
++ * strsep modifies the string and we need it later.
++ */
++ tmp_to_free = kstrdup(options, GFP_KERNEL);
++ optionstmp = tmp_to_free;
++ if (unlikely(!optionstmp)) {
++ err = -ENOMEM;
++ goto out_free;
++ }
++ cur_branches = sbmax(sb); /* current no. branches */
++ new_branches = sbmax(sb);
++ del_branches = 0;
++ add_branches = 0;
++ new_high_branch_id = sbhbid(sb); /* save current high_branch_id */
++ while ((optname = strsep(&optionstmp, ",")) != NULL) {
++ char *optarg;
++
++ if (!optname || !*optname)
++ continue;
++
++ optarg = strchr(optname, '=');
++ if (optarg)
++ *optarg++ = '\0';
++
++ if (!strcmp("add", optname))
++ add_branches++;
++ else if (!strcmp("del", optname))
++ del_branches++;
++ }
++ kfree(tmp_to_free);
++ /* after all changes, will we have at least one branch left? */
++ if ((new_branches + add_branches - del_branches) < 1) {
++ printk(KERN_ERR
++ "unionfs: no branches left after remount\n");
++ err = -EINVAL;
++ goto out_free;
++ }
++
++ /*
++ * Since we haven't actually parsed all the add/del options, nor
++ * have we checked them for errors, we don't know for sure how many
++ * branches we will have after all changes have taken place. In
++ * fact, the total number of branches left could be less than what
++ * we have now. So we need to allocate space for a temporary
++ * placeholder that is at least as large as the maximum number of
++ * branches we *could* have, which is the current number plus all
++ * the additions. Once we're done with these temp placeholders, we
++ * may have to re-allocate the final size, copy over from the temp,
++ * and then free the temps (done near the end of this function).
++ */
++ max_branches = cur_branches + add_branches;
++ /* allocate space for new pointers to lower dentry */
++ tmp_data = kcalloc(max_branches,
++ sizeof(struct unionfs_data), GFP_KERNEL);
++ if (unlikely(!tmp_data)) {
++ err = -ENOMEM;
++ goto out_free;
++ }
++ /* allocate space for new pointers to lower paths */
++ tmp_lower_paths = kcalloc(max_branches,
++ sizeof(struct path), GFP_KERNEL);
++ if (unlikely(!tmp_lower_paths)) {
++ err = -ENOMEM;
++ goto out_free;
++ }
++ /* copy current info into new placeholders, incrementing refcnts */
++ memcpy(tmp_data, UNIONFS_SB(sb)->data,
++ cur_branches * sizeof(struct unionfs_data));
++ memcpy(tmp_lower_paths, UNIONFS_D(sb->s_root)->lower_paths,
++ cur_branches * sizeof(struct path));
++ for (i = 0; i < cur_branches; i++)
++ path_get(&tmp_lower_paths[i]); /* drop refs at end of fxn */
++
++ /*******************************************************************
++ * For each branch command, do kern_path on the requested branch,
++ * and apply the change to a temp branch list. To handle errors, we
++ * already dup'ed the old arrays (above), and increased the refcnts
++ * on various f/s objects. So now we can do all the kern_path'ss
++ * and branch-management commands on the new arrays. If it fail mid
++ * way, we free the tmp arrays and *put all objects. If we succeed,
++ * then we free old arrays and *put its objects, and then replace
++ * the arrays with the new tmp list (we may have to re-allocate the
++ * memory because the temp lists could have been larger than what we
++ * actually needed).
++ *******************************************************************/
++
++ while ((optname = strsep(&options, ",")) != NULL) {
++ char *optarg;
++
++ if (!optname || !*optname)
++ continue;
++ /*
++ * At this stage optname holds a comma-delimited option, but
++ * without the commas. Next, we need to break the string on
++ * the '=' symbol to separate CMD=ARG, where ARG itself can
++ * be KEY=VAL. For example, in mode=/foo=rw, CMD is "mode",
++ * KEY is "/foo", and VAL is "rw".
++ */
++ optarg = strchr(optname, '=');
++ if (optarg)
++ *optarg++ = '\0';
++ /* incgen remount option (instead of old ioctl) */
++ if (!strcmp("incgen", optname)) {
++ err = 0;
++ goto out_no_change;
++ }
++
++ /*
++ * All of our options take an argument now. (Insert ones
++ * that don't above this check.) So at this stage optname
++ * contains the CMD part and optarg contains the ARG part.
++ */
++ if (!optarg || !*optarg) {
++ printk(KERN_ERR "unionfs: all remount options require "
++ "an argument (%s)\n", optname);
++ err = -EINVAL;
++ goto out_release;
++ }
++
++ if (!strcmp("add", optname)) {
++ err = do_remount_add_option(optarg, new_branches,
++ tmp_data,
++ tmp_lower_paths,
++ &new_high_branch_id);
++ if (err)
++ goto out_release;
++ new_branches++;
++ if (new_branches > UNIONFS_MAX_BRANCHES) {
++ printk(KERN_ERR "unionfs: command exceeds "
++ "%d branches\n", UNIONFS_MAX_BRANCHES);
++ err = -E2BIG;
++ goto out_release;
++ }
++ continue;
++ }
++ if (!strcmp("del", optname)) {
++ err = do_remount_del_option(optarg, new_branches,
++ tmp_data,
++ tmp_lower_paths);
++ if (err)
++ goto out_release;
++ new_branches--;
++ continue;
++ }
++ if (!strcmp("mode", optname)) {
++ err = do_remount_mode_option(optarg, new_branches,
++ tmp_data,
++ tmp_lower_paths);
++ if (err)
++ goto out_release;
++ continue;
++ }
++
++ /*
++ * When you use "mount -o remount,ro", mount(8) will
++ * reportedly pass the original dirs= string from
++ * /proc/mounts. So for now, we have to ignore dirs= and
++ * not consider it an error, unless we want to allow users
++ * to pass dirs= in remount. Note that to allow the VFS to
++ * actually process the ro/rw remount options, we have to
++ * return 0 from this function.
++ */
++ if (!strcmp("dirs", optname)) {
++ printk(KERN_WARNING
++ "unionfs: remount ignoring option \"%s\"\n",
++ optname);
++ continue;
++ }
++
++ err = -EINVAL;
++ printk(KERN_ERR
++ "unionfs: unrecognized option \"%s\"\n", optname);
++ goto out_release;
++ }
++
++out_no_change:
++
++ /******************************************************************
++ * WE'RE ALMOST DONE: check if leftmost branch might be read-only,
++ * see if we need to allocate a small-sized new vector, copy the
++ * vectors to their correct place, release the refcnt of the older
++ * ones, and return. Also handle invalidating any pages that will
++ * have to be re-read.
++ *******************************************************************/
++
++ if (!(tmp_data[0].branchperms & MAY_WRITE)) {
++ printk(KERN_ERR "unionfs: leftmost branch cannot be read-only "
++ "(use \"remount,ro\" to create a read-only union)\n");
++ err = -EINVAL;
++ goto out_release;
++ }
++
++ /* (re)allocate space for new pointers to lower dentry */
++ size = new_branches * sizeof(struct unionfs_data);
++ new_data = krealloc(tmp_data, size, GFP_KERNEL);
++ if (unlikely(!new_data)) {
++ err = -ENOMEM;
++ goto out_release;
++ }
++
++ /* allocate space for new pointers to lower paths */
++ size = new_branches * sizeof(struct path);
++ new_lower_paths = krealloc(tmp_lower_paths, size, GFP_KERNEL);
++ if (unlikely(!new_lower_paths)) {
++ err = -ENOMEM;
++ goto out_release;
++ }
++
++ /* allocate space for new pointers to lower inodes */
++ new_lower_inodes = kcalloc(new_branches,
++ sizeof(struct inode *), GFP_KERNEL);
++ if (unlikely(!new_lower_inodes)) {
++ err = -ENOMEM;
++ goto out_release;
++ }
++
++ /*
++ * OK, just before we actually put the new set of branches in place,
++ * we need to ensure that our own f/s has no dirty objects left.
++ * Luckily, do_remount_sb() already calls shrink_dcache_sb(sb) and
++ * fsync_super(sb), taking care of dentries, inodes, and dirty
++ * pages. So all that's left is for us to invalidate any leftover
++ * (non-dirty) pages to ensure that they will be re-read from the
++ * new lower branches (and to support mmap).
++ */
++
++ /*
++ * Once we finish the remounting successfully, our superblock
++ * generation number will have increased. This will be detected by
++ * our dentry-revalidation code upon subsequent f/s operations
++ * through unionfs. The revalidation code will rebuild the union of
++ * lower inodes for a given unionfs inode and invalidate any pages
++ * of such "stale" inodes (by calling our purge_inode_data
++ * function). This revalidation will happen lazily and
++ * incrementally, as users perform operations on cached inodes. We
++ * would like to encourage this revalidation to happen sooner if
++ * possible, so we like to try to invalidate as many other pages in
++ * our superblock as we can. We used to call drop_pagecache_sb() or
++ * a variant thereof, but either method was racy (drop_caches alone
++ * is known to be racy). So now we let the revalidation happen on a
++ * per file basis in ->d_revalidate.
++ */
++
++ /* grab new lower super references; release old ones */
++ for (i = 0; i < new_branches; i++)
++ atomic_inc(&new_data[i].sb->s_active);
++ for (i = 0; i < sbmax(sb); i++)
++ atomic_dec(&UNIONFS_SB(sb)->data[i].sb->s_active);
++
++ /* copy new vectors into their correct place */
++ tmp_data = UNIONFS_SB(sb)->data;
++ UNIONFS_SB(sb)->data = new_data;
++ new_data = NULL; /* so don't free good pointers below */
++ tmp_lower_paths = UNIONFS_D(sb->s_root)->lower_paths;
++ UNIONFS_D(sb->s_root)->lower_paths = new_lower_paths;
++ new_lower_paths = NULL; /* so don't free good pointers below */
++
++ /* update our unionfs_sb_info and root dentry index of last branch */
++ i = sbmax(sb); /* save no. of branches to release at end */
++ sbend(sb) = new_branches - 1;
++ dbend(sb->s_root) = new_branches - 1;
++ old_ibstart = ibstart(sb->s_root->d_inode);
++ old_ibend = ibend(sb->s_root->d_inode);
++ ibend(sb->s_root->d_inode) = new_branches - 1;
++ UNIONFS_D(sb->s_root)->bcount = new_branches;
++ new_branches = i; /* no. of branches to release below */
++
++ /*
++ * Update lower inodes: 3 steps
++ * 1. grab ref on all new lower inodes
++ */
++ for (i = dbstart(sb->s_root); i <= dbend(sb->s_root); i++) {
++ struct dentry *lower_dentry =
++ unionfs_lower_dentry_idx(sb->s_root, i);
++ igrab(lower_dentry->d_inode);
++ new_lower_inodes[i] = lower_dentry->d_inode;
++ }
++ /* 2. release reference on all older lower inodes */
++ iput_lowers(sb->s_root->d_inode, old_ibstart, old_ibend, true);
++ /* 3. update root dentry's inode to new lower_inodes array */
++ UNIONFS_I(sb->s_root->d_inode)->lower_inodes = new_lower_inodes;
++ new_lower_inodes = NULL;
++
++ /* maxbytes may have changed */
++ sb->s_maxbytes = unionfs_lower_super_idx(sb, 0)->s_maxbytes;
++ /* update high branch ID */
++ sbhbid(sb) = new_high_branch_id;
++
++ /* update our sb->generation for revalidating objects */
++ i = atomic_inc_return(&UNIONFS_SB(sb)->generation);
++ atomic_set(&UNIONFS_D(sb->s_root)->generation, i);
++ atomic_set(&UNIONFS_I(sb->s_root->d_inode)->generation, i);
++ if (!(*flags & MS_SILENT))
++ pr_info("unionfs: %s: new generation number %d\n",
++ UNIONFS_SB(sb)->dev_name, i);
++ /* finally, update the root dentry's times */
++ unionfs_copy_attr_times(sb->s_root->d_inode);
++ err = 0; /* reset to success */
++
++ /*
++ * The code above falls through to the next label, and releases the
++ * refcnts of the older ones (stored in tmp_*): if we fell through
++ * here, it means success. However, if we jump directly to this
++ * label from any error above, then an error occurred after we
++ * grabbed various refcnts, and so we have to release the
++ * temporarily constructed structures.
++ */
++out_release:
++ /* no need to cleanup/release anything in tmp_data */
++ if (tmp_lower_paths)
++ for (i = 0; i < new_branches; i++)
++ path_put(&tmp_lower_paths[i]);
++out_free:
++ kfree(tmp_lower_paths);
++ kfree(tmp_data);
++ kfree(new_lower_paths);
++ kfree(new_data);
++ kfree(new_lower_inodes);
++out_error:
++ unionfs_check_dentry(sb->s_root);
++ unionfs_write_unlock(sb);
++ return err;
++}
++
++/*
++ * Called by iput() when the inode reference count reached zero
++ * and the inode is not hashed anywhere. Used to clear anything
++ * that needs to be, before the inode is completely destroyed and put
++ * on the inode free list.
++ *
++ * No need to lock sb info's rwsem.
++ */
++static void unionfs_evict_inode(struct inode *inode)
++{
++ int bindex, bstart, bend;
++ struct inode *lower_inode;
++ struct list_head *pos, *n;
++ struct unionfs_dir_state *rdstate;
++
++ truncate_inode_pages(&inode->i_data, 0);
++ end_writeback(inode);
++
++ list_for_each_safe(pos, n, &UNIONFS_I(inode)->readdircache) {
++ rdstate = list_entry(pos, struct unionfs_dir_state, cache);
++ list_del(&rdstate->cache);
++ free_rdstate(rdstate);
++ }
++
++ /*
++ * Decrement a reference to a lower_inode, which was incremented
++ * by our read_inode when it was created initially.
++ */
++ bstart = ibstart(inode);
++ bend = ibend(inode);
++ if (bstart >= 0) {
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ lower_inode = unionfs_lower_inode_idx(inode, bindex);
++ if (!lower_inode)
++ continue;
++ unionfs_set_lower_inode_idx(inode, bindex, NULL);
++ /* see Documentation/filesystems/unionfs/issues.txt */
++ lockdep_off();
++ iput(lower_inode);
++ lockdep_on();
++ }
++ }
++
++ kfree(UNIONFS_I(inode)->lower_inodes);
++ UNIONFS_I(inode)->lower_inodes = NULL;
++}
++
++static struct inode *unionfs_alloc_inode(struct super_block *sb)
++{
++ struct unionfs_inode_info *i;
++
++ i = kmem_cache_alloc(unionfs_inode_cachep, GFP_KERNEL);
++ if (unlikely(!i))
++ return NULL;
++
++ /* memset everything up to the inode to 0 */
++ memset(i, 0, offsetof(struct unionfs_inode_info, vfs_inode));
++
++ i->vfs_inode.i_version = 1;
++ return &i->vfs_inode;
++}
++
++static void unionfs_destroy_inode(struct inode *inode)
++{
++ kmem_cache_free(unionfs_inode_cachep, UNIONFS_I(inode));
++}
++
++/* unionfs inode cache constructor */
++static void init_once(void *obj)
++{
++ struct unionfs_inode_info *i = obj;
++
++ inode_init_once(&i->vfs_inode);
++}
++
++int unionfs_init_inode_cache(void)
++{
++ int err = 0;
++
++ unionfs_inode_cachep =
++ kmem_cache_create("unionfs_inode_cache",
++ sizeof(struct unionfs_inode_info), 0,
++ SLAB_RECLAIM_ACCOUNT, init_once);
++ if (unlikely(!unionfs_inode_cachep))
++ err = -ENOMEM;
++ return err;
++}
++
++/* unionfs inode cache destructor */
++void unionfs_destroy_inode_cache(void)
++{
++ if (unionfs_inode_cachep)
++ kmem_cache_destroy(unionfs_inode_cachep);
++}
++
++/*
++ * Called when we have a dirty inode, right here we only throw out
++ * parts of our readdir list that are too old.
++ *
++ * No need to grab sb info's rwsem.
++ */
++static int unionfs_write_inode(struct inode *inode,
++ struct writeback_control *wbc)
++{
++ struct list_head *pos, *n;
++ struct unionfs_dir_state *rdstate;
++
++ spin_lock(&UNIONFS_I(inode)->rdlock);
++ list_for_each_safe(pos, n, &UNIONFS_I(inode)->readdircache) {
++ rdstate = list_entry(pos, struct unionfs_dir_state, cache);
++ /* We keep this list in LRU order. */
++ if ((rdstate->access + RDCACHE_JIFFIES) > jiffies)
++ break;
++ UNIONFS_I(inode)->rdcount--;
++ list_del(&rdstate->cache);
++ free_rdstate(rdstate);
++ }
++ spin_unlock(&UNIONFS_I(inode)->rdlock);
++
++ return 0;
++}
++
++/*
++ * Used only in nfs, to kill any pending RPC tasks, so that subsequent
++ * code can actually succeed and won't leave tasks that need handling.
++ */
++static void unionfs_umount_begin(struct super_block *sb)
++{
++ struct super_block *lower_sb;
++ int bindex, bstart, bend;
++
++ unionfs_read_lock(sb, UNIONFS_SMUTEX_CHILD);
++
++ bstart = sbstart(sb);
++ bend = sbend(sb);
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ lower_sb = unionfs_lower_super_idx(sb, bindex);
++
++ if (lower_sb && lower_sb->s_op &&
++ lower_sb->s_op->umount_begin)
++ lower_sb->s_op->umount_begin(lower_sb);
++ }
++
++ unionfs_read_unlock(sb);
++}
++
++static int unionfs_show_options(struct seq_file *m, struct vfsmount *mnt)
++{
++ struct super_block *sb = mnt->mnt_sb;
++ int ret = 0;
++ char *tmp_page;
++ char *path;
++ int bindex, bstart, bend;
++ int perms;
++
++ /* to prevent a silly lockdep warning with namespace_sem */
++ lockdep_off();
++ unionfs_read_lock(sb, UNIONFS_SMUTEX_CHILD);
++ unionfs_lock_dentry(sb->s_root, UNIONFS_DMUTEX_CHILD);
++
++ tmp_page = (char *) __get_free_page(GFP_KERNEL);
++ if (unlikely(!tmp_page)) {
++ ret = -ENOMEM;
++ goto out;
++ }
++
++ bstart = sbstart(sb);
++ bend = sbend(sb);
++
++ seq_printf(m, ",dirs=");
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ struct path p;
++ p.dentry = unionfs_lower_dentry_idx(sb->s_root, bindex);
++ p.mnt = unionfs_lower_mnt_idx(sb->s_root, bindex);
++ path = d_path(&p, tmp_page, PAGE_SIZE);
++ if (IS_ERR(path)) {
++ ret = PTR_ERR(path);
++ goto out;
++ }
++
++ perms = branchperms(sb, bindex);
++
++ seq_printf(m, "%s=%s", path,
++ perms & MAY_WRITE ? "rw" : "ro");
++ if (bindex != bend)
++ seq_printf(m, ":");
++ }
++
++out:
++ free_page((unsigned long) tmp_page);
++
++ unionfs_unlock_dentry(sb->s_root);
++ unionfs_read_unlock(sb);
++ lockdep_on();
++
++ return ret;
++}
++
++struct super_operations unionfs_sops = {
++ .put_super = unionfs_put_super,
++ .statfs = unionfs_statfs,
++ .remount_fs = unionfs_remount_fs,
++ .evict_inode = unionfs_evict_inode,
++ .umount_begin = unionfs_umount_begin,
++ .show_options = unionfs_show_options,
++ .write_inode = unionfs_write_inode,
++ .alloc_inode = unionfs_alloc_inode,
++ .destroy_inode = unionfs_destroy_inode,
++};
+diff --git a/fs/unionfs/union.h b/fs/unionfs/union.h
+new file mode 100644
+index 0000000..1821705
+--- /dev/null
++++ b/fs/unionfs/union.h
+@@ -0,0 +1,679 @@
++/*
++ * Copyright (c) 2003-2011 Erez Zadok
++ * Copyright (c) 2003-2006 Charles P. Wright
++ * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
++ * Copyright (c) 2005 Arun M. Krishnakumar
++ * Copyright (c) 2004-2006 David P. Quigley
++ * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
++ * Copyright (c) 2003 Puja Gupta
++ * Copyright (c) 2003 Harikesavan Krishnan
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
++ *
++ * 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.
++ */
++
++#ifndef _UNION_H_
++#define _UNION_H_
++
++#include <linux/dcache.h>
++#include <linux/file.h>
++#include <linux/list.h>
++#include <linux/fs.h>
++#include <linux/mm.h>
++#include <linux/module.h>
++#include <linux/mount.h>
++#include <linux/namei.h>
++#include <linux/page-flags.h>
++#include <linux/pagemap.h>
++#include <linux/poll.h>
++#include <linux/security.h>
++#include <linux/seq_file.h>
++#include <linux/slab.h>
++#include <linux/spinlock.h>
++#include <linux/statfs.h>
++#include <linux/string.h>
++#include <linux/vmalloc.h>
++#include <linux/writeback.h>
++#include <linux/buffer_head.h>
++#include <linux/xattr.h>
++#include <linux/fs_stack.h>
++#include <linux/magic.h>
++#include <linux/log2.h>
++#include <linux/poison.h>
++#include <linux/mman.h>
++#include <linux/backing-dev.h>
++#include <linux/splice.h>
++#include <linux/sched.h>
++
++#include <asm/system.h>
++
++#include <linux/union_fs.h>
++
++/* the file system name */
++#define UNIONFS_NAME "unionfs"
++
++/* unionfs root inode number */
++#define UNIONFS_ROOT_INO 1
++
++/* number of times we try to get a unique temporary file name */
++#define GET_TMPNAM_MAX_RETRY 5
++
++/* maximum number of branches we support, to avoid memory blowup */
++#define UNIONFS_MAX_BRANCHES 128
++
++/* minimum time (seconds) required for time-based cache-coherency */
++#define UNIONFS_MIN_CC_TIME 3
++
++/* Operations vectors defined in specific files. */
++extern struct file_operations unionfs_main_fops;
++extern struct file_operations unionfs_dir_fops;
++extern struct inode_operations unionfs_main_iops;
++extern struct inode_operations unionfs_dir_iops;
++extern struct inode_operations unionfs_symlink_iops;
++extern struct super_operations unionfs_sops;
++extern struct dentry_operations unionfs_dops;
++extern struct address_space_operations unionfs_aops, unionfs_dummy_aops;
++extern struct vm_operations_struct unionfs_vm_ops;
++
++/* How long should an entry be allowed to persist */
++#define RDCACHE_JIFFIES (5*HZ)
++
++/* compatibility with Real-Time patches */
++#ifdef CONFIG_PREEMPT_RT
++# define unionfs_rw_semaphore compat_rw_semaphore
++#else /* not CONFIG_PREEMPT_RT */
++# define unionfs_rw_semaphore rw_semaphore
++#endif /* not CONFIG_PREEMPT_RT */
++
++/* file private data. */
++struct unionfs_file_info {
++ int bstart;
++ int bend;
++ atomic_t generation;
++
++ struct unionfs_dir_state *rdstate;
++ struct file **lower_files;
++ int *saved_branch_ids; /* IDs of branches when file was opened */
++ const struct vm_operations_struct *lower_vm_ops;
++ bool wrote_to_file; /* for delayed copyup */
++};
++
++/* unionfs inode data in memory */
++struct unionfs_inode_info {
++ int bstart;
++ int bend;
++ atomic_t generation;
++ /* Stuff for readdir over NFS. */
++ spinlock_t rdlock;
++ struct list_head readdircache;
++ int rdcount;
++ int hashsize;
++ int cookie;
++
++ /* The lower inodes */
++ struct inode **lower_inodes;
++
++ struct inode vfs_inode;
++};
++
++/* unionfs dentry data in memory */
++struct unionfs_dentry_info {
++ /*
++ * The semaphore is used to lock the dentry as soon as we get into a
++ * unionfs function from the VFS. Our lock ordering is that children
++ * go before their parents.
++ */
++ struct mutex lock;
++ int bstart;
++ int bend;
++ int bopaque;
++ int bcount;
++ atomic_t generation;
++ struct path *lower_paths;
++};
++
++/* These are the pointers to our various objects. */
++struct unionfs_data {
++ struct super_block *sb; /* lower super_block */
++ atomic_t open_files; /* number of open files on branch */
++ int branchperms;
++ int branch_id; /* unique branch ID at re/mount time */
++};
++
++/* unionfs super-block data in memory */
++struct unionfs_sb_info {
++ int bend;
++
++ atomic_t generation;
++
++ /*
++ * This rwsem is used to make sure that a branch management
++ * operation...
++ * 1) will not begin before all currently in-flight operations
++ * complete.
++ * 2) any new operations do not execute until the currently
++ * running branch management operation completes.
++ *
++ * The write_lock_owner records the PID of the task which grabbed
++ * the rw_sem for writing. If the same task also tries to grab the
++ * read lock, we allow it. This prevents a self-deadlock when
++ * branch-management is used on a pivot_root'ed union, because we
++ * have to ->lookup paths which belong to the same union.
++ */
++ struct unionfs_rw_semaphore rwsem;
++ pid_t write_lock_owner; /* PID of rw_sem owner (write lock) */
++ int high_branch_id; /* last unique branch ID given */
++ char *dev_name; /* to identify different unions in pr_debug */
++ struct unionfs_data *data;
++};
++
++/*
++ * structure for making the linked list of entries by readdir on left branch
++ * to compare with entries on right branch
++ */
++struct filldir_node {
++ struct list_head file_list; /* list for directory entries */
++ char *name; /* name entry */
++ int hash; /* name hash */
++ int namelen; /* name len since name is not 0 terminated */
++
++ /*
++ * we can check for duplicate whiteouts and files in the same branch
++ * in order to return -EIO.
++ */
++ int bindex;
++
++ /* is this a whiteout entry? */
++ int whiteout;
++
++ /* Inline name, so we don't need to separately kmalloc small ones */
++ char iname[DNAME_INLINE_LEN];
++};
++
++/* Directory hash table. */
++struct unionfs_dir_state {
++ unsigned int cookie; /* the cookie, based off of rdversion */
++ unsigned int offset; /* The entry we have returned. */
++ int bindex;
++ loff_t dirpos; /* offset within the lower level directory */
++ int size; /* How big is the hash table? */
++ int hashentries; /* How many entries have been inserted? */
++ unsigned long access;
++
++ /* This cache list is used when the inode keeps us around. */
++ struct list_head cache;
++ struct list_head list[0];
++};
++
++/* externs needed for fanout.h or sioq.h */
++extern int unionfs_get_nlinks(const struct inode *inode);
++extern void unionfs_copy_attr_times(struct inode *upper);
++extern void unionfs_copy_attr_all(struct inode *dest, const struct inode *src);
++
++/* include miscellaneous macros */
++#include "fanout.h"
++#include "sioq.h"
++
++/* externs for cache creation/deletion routines */
++extern void unionfs_destroy_filldir_cache(void);
++extern int unionfs_init_filldir_cache(void);
++extern int unionfs_init_inode_cache(void);
++extern void unionfs_destroy_inode_cache(void);
++extern int unionfs_init_dentry_cache(void);
++extern void unionfs_destroy_dentry_cache(void);
++
++/* Initialize and free readdir-specific state. */
++extern int init_rdstate(struct file *file);
++extern struct unionfs_dir_state *alloc_rdstate(struct inode *inode,
++ int bindex);
++extern struct unionfs_dir_state *find_rdstate(struct inode *inode,
++ loff_t fpos);
++extern void free_rdstate(struct unionfs_dir_state *state);
++extern int add_filldir_node(struct unionfs_dir_state *rdstate,
++ const char *name, int namelen, int bindex,
++ int whiteout);
++extern struct filldir_node *find_filldir_node(struct unionfs_dir_state *rdstate,
++ const char *name, int namelen,
++ int is_whiteout);
++
++extern struct dentry **alloc_new_dentries(int objs);
++extern struct unionfs_data *alloc_new_data(int objs);
++
++/* We can only use 32-bits of offset for rdstate --- blech! */
++#define DIREOF (0xfffff)
++#define RDOFFBITS 20 /* This is the number of bits in DIREOF. */
++#define MAXRDCOOKIE (0xfff)
++/* Turn an rdstate into an offset. */
++static inline off_t rdstate2offset(struct unionfs_dir_state *buf)
++{
++ off_t tmp;
++
++ tmp = ((buf->cookie & MAXRDCOOKIE) << RDOFFBITS)
++ | (buf->offset & DIREOF);
++ return tmp;
++}
++
++/* Macros for locking a super_block. */
++enum unionfs_super_lock_class {
++ UNIONFS_SMUTEX_NORMAL,
++ UNIONFS_SMUTEX_PARENT, /* when locking on behalf of file */
++ UNIONFS_SMUTEX_CHILD, /* when locking on behalf of dentry */
++};
++static inline void unionfs_read_lock(struct super_block *sb, int subclass)
++{
++ if (UNIONFS_SB(sb)->write_lock_owner &&
++ UNIONFS_SB(sb)->write_lock_owner == current->pid)
++ return;
++ down_read_nested(&UNIONFS_SB(sb)->rwsem, subclass);
++}
++static inline void unionfs_read_unlock(struct super_block *sb)
++{
++ if (UNIONFS_SB(sb)->write_lock_owner &&
++ UNIONFS_SB(sb)->write_lock_owner == current->pid)
++ return;
++ up_read(&UNIONFS_SB(sb)->rwsem);
++}
++static inline void unionfs_write_lock(struct super_block *sb)
++{
++ down_write(&UNIONFS_SB(sb)->rwsem);
++ UNIONFS_SB(sb)->write_lock_owner = current->pid;
++}
++static inline void unionfs_write_unlock(struct super_block *sb)
++{
++ up_write(&UNIONFS_SB(sb)->rwsem);
++ UNIONFS_SB(sb)->write_lock_owner = 0;
++}
++
++static inline void unionfs_double_lock_dentry(struct dentry *d1,
++ struct dentry *d2)
++{
++ BUG_ON(d1 == d2);
++ if (d1 < d2) {
++ unionfs_lock_dentry(d1, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(d2, UNIONFS_DMUTEX_CHILD);
++ } else {
++ unionfs_lock_dentry(d2, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(d1, UNIONFS_DMUTEX_CHILD);
++ }
++}
++
++static inline void unionfs_double_unlock_dentry(struct dentry *d1,
++ struct dentry *d2)
++{
++ BUG_ON(d1 == d2);
++ if (d1 < d2) { /* unlock in reverse order than double_lock_dentry */
++ unionfs_unlock_dentry(d1);
++ unionfs_unlock_dentry(d2);
++ } else {
++ unionfs_unlock_dentry(d2);
++ unionfs_unlock_dentry(d1);
++ }
++}
++
++static inline void unionfs_double_lock_parents(struct dentry *p1,
++ struct dentry *p2)
++{
++ if (p1 == p2) {
++ unionfs_lock_dentry(p1, UNIONFS_DMUTEX_REVAL_PARENT);
++ return;
++ }
++ if (p1 < p2) {
++ unionfs_lock_dentry(p1, UNIONFS_DMUTEX_REVAL_PARENT);
++ unionfs_lock_dentry(p2, UNIONFS_DMUTEX_REVAL_CHILD);
++ } else {
++ unionfs_lock_dentry(p2, UNIONFS_DMUTEX_REVAL_PARENT);
++ unionfs_lock_dentry(p1, UNIONFS_DMUTEX_REVAL_CHILD);
++ }
++}
++
++static inline void unionfs_double_unlock_parents(struct dentry *p1,
++ struct dentry *p2)
++{
++ if (p1 == p2) {
++ unionfs_unlock_dentry(p1);
++ return;
++ }
++ if (p1 < p2) { /* unlock in reverse order of double_lock_parents */
++ unionfs_unlock_dentry(p1);
++ unionfs_unlock_dentry(p2);
++ } else {
++ unionfs_unlock_dentry(p2);
++ unionfs_unlock_dentry(p1);
++ }
++}
++
++extern int new_dentry_private_data(struct dentry *dentry, int subclass);
++extern int realloc_dentry_private_data(struct dentry *dentry);
++extern void free_dentry_private_data(struct dentry *dentry);
++extern void update_bstart(struct dentry *dentry);
++extern int init_lower_nd(struct nameidata *nd, unsigned int flags);
++extern void release_lower_nd(struct nameidata *nd, int err);
++
++/*
++ * EXTERNALS:
++ */
++
++/* replicates the directory structure up to given dentry in given branch */
++extern struct dentry *create_parents(struct inode *dir, struct dentry *dentry,
++ const char *name, int bindex);
++
++/* partial lookup */
++extern int unionfs_partial_lookup(struct dentry *dentry,
++ struct dentry *parent);
++extern struct dentry *unionfs_lookup_full(struct dentry *dentry,
++ struct dentry *parent,
++ int lookupmode);
++
++/* copies a file from dbstart to newbindex branch */
++extern int copyup_file(struct inode *dir, struct file *file, int bstart,
++ int newbindex, loff_t size);
++extern int copyup_named_file(struct inode *dir, struct file *file,
++ char *name, int bstart, int new_bindex,
++ loff_t len);
++/* copies a dentry from dbstart to newbindex branch */
++extern int copyup_dentry(struct inode *dir, struct dentry *dentry,
++ int bstart, int new_bindex, const char *name,
++ int namelen, struct file **copyup_file, loff_t len);
++/* helper functions for post-copyup actions */
++extern void unionfs_postcopyup_setmnt(struct dentry *dentry);
++extern void unionfs_postcopyup_release(struct dentry *dentry);
++
++/* Is this directory empty: 0 if it is empty, -ENOTEMPTY if not. */
++extern int check_empty(struct dentry *dentry, struct dentry *parent,
++ struct unionfs_dir_state **namelist);
++/* whiteout and opaque directory helpers */
++extern char *alloc_whname(const char *name, int len);
++extern bool is_whiteout_name(char **namep, int *namelenp);
++extern bool is_validname(const char *name);
++extern struct dentry *lookup_whiteout(const char *name,
++ struct dentry *lower_parent);
++extern struct dentry *find_first_whiteout(struct dentry *dentry);
++extern int unlink_whiteout(struct dentry *wh_dentry);
++extern int check_unlink_whiteout(struct dentry *dentry,
++ struct dentry *lower_dentry, int bindex);
++extern int create_whiteout(struct dentry *dentry, int start);
++extern int delete_whiteouts(struct dentry *dentry, int bindex,
++ struct unionfs_dir_state *namelist);
++extern int is_opaque_dir(struct dentry *dentry, int bindex);
++extern int make_dir_opaque(struct dentry *dir, int bindex);
++extern void unionfs_set_max_namelen(long *namelen);
++
++extern void unionfs_reinterpose(struct dentry *this_dentry);
++extern struct super_block *unionfs_duplicate_super(struct super_block *sb);
++
++/* Locking functions. */
++extern int unionfs_setlk(struct file *file, int cmd, struct file_lock *fl);
++extern int unionfs_getlk(struct file *file, struct file_lock *fl);
++
++/* Common file operations. */
++extern int unionfs_file_revalidate(struct file *file, struct dentry *parent,
++ bool willwrite);
++extern int unionfs_open(struct inode *inode, struct file *file);
++extern int unionfs_file_release(struct inode *inode, struct file *file);
++extern int unionfs_flush(struct file *file, fl_owner_t id);
++extern long unionfs_ioctl(struct file *file, unsigned int cmd,
++ unsigned long arg);
++extern int unionfs_fsync(struct file *file, int datasync);
++extern int unionfs_fasync(int fd, struct file *file, int flag);
++
++/* Inode operations */
++extern struct inode *unionfs_iget(struct super_block *sb, unsigned long ino);
++extern int unionfs_rename(struct inode *old_dir, struct dentry *old_dentry,
++ struct inode *new_dir, struct dentry *new_dentry);
++extern int unionfs_unlink(struct inode *dir, struct dentry *dentry);
++extern int unionfs_rmdir(struct inode *dir, struct dentry *dentry);
++
++extern bool __unionfs_d_revalidate(struct dentry *dentry,
++ struct dentry *parent, bool willwrite);
++extern bool is_negative_lower(const struct dentry *dentry);
++extern bool is_newer_lower(const struct dentry *dentry);
++extern void purge_sb_data(struct super_block *sb);
++
++/* The values for unionfs_interpose's flag. */
++#define INTERPOSE_DEFAULT 0
++#define INTERPOSE_LOOKUP 1
++#define INTERPOSE_REVAL 2
++#define INTERPOSE_REVAL_NEG 3
++#define INTERPOSE_PARTIAL 4
++
++extern struct dentry *unionfs_interpose(struct dentry *this_dentry,
++ struct super_block *sb, int flag);
++
++#ifdef CONFIG_UNION_FS_XATTR
++/* Extended attribute functions. */
++extern void *unionfs_xattr_alloc(size_t size, size_t limit);
++static inline void unionfs_xattr_kfree(const void *p)
++{
++ kfree(p);
++}
++extern ssize_t unionfs_getxattr(struct dentry *dentry, const char *name,
++ void *value, size_t size);
++extern int unionfs_removexattr(struct dentry *dentry, const char *name);
++extern ssize_t unionfs_listxattr(struct dentry *dentry, char *list,
++ size_t size);
++extern int unionfs_setxattr(struct dentry *dentry, const char *name,
++ const void *value, size_t size, int flags);
++#endif /* CONFIG_UNION_FS_XATTR */
++
++/* The root directory is unhashed, but isn't deleted. */
++static inline int d_deleted(struct dentry *d)
++{
++ return d_unhashed(d) && (d != d->d_sb->s_root);
++}
++
++/* unionfs_permission, check if we should bypass error to facilitate copyup */
++#define IS_COPYUP_ERR(err) ((err) == -EROFS)
++
++/* unionfs_open, check if we need to copyup the file */
++#define OPEN_WRITE_FLAGS (O_WRONLY | O_RDWR | O_APPEND)
++#define IS_WRITE_FLAG(flag) ((flag) & OPEN_WRITE_FLAGS)
++
++static inline int branchperms(const struct super_block *sb, int index)
++{
++ BUG_ON(index < 0);
++ return UNIONFS_SB(sb)->data[index].branchperms;
++}
++
++static inline int set_branchperms(struct super_block *sb, int index, int perms)
++{
++ BUG_ON(index < 0);
++ UNIONFS_SB(sb)->data[index].branchperms = perms;
++ return perms;
++}
++
++/* check if readonly lower inode, but possibly unlinked (no inode->i_sb) */
++static inline int __is_rdonly(const struct inode *inode)
++{
++ /* if unlinked, can't be readonly (?) */
++ if (!inode->i_sb)
++ return 0;
++ return IS_RDONLY(inode);
++
++}
++/* Is this file on a read-only branch? */
++static inline int is_robranch_super(const struct super_block *sb, int index)
++{
++ int ret;
++
++ ret = (!(branchperms(sb, index) & MAY_WRITE)) ? -EROFS : 0;
++ return ret;
++}
++
++/* Is this file on a read-only branch? */
++static inline int is_robranch_idx(const struct dentry *dentry, int index)
++{
++ struct super_block *lower_sb;
++
++ BUG_ON(index < 0);
++
++ if (!(branchperms(dentry->d_sb, index) & MAY_WRITE))
++ return -EROFS;
++
++ lower_sb = unionfs_lower_super_idx(dentry->d_sb, index);
++ BUG_ON(lower_sb == NULL);
++ /*
++ * test sb flags directly, not IS_RDONLY(lower_inode) because the
++ * lower_dentry could be a negative.
++ */
++ if (lower_sb->s_flags & MS_RDONLY)
++ return -EROFS;
++
++ return 0;
++}
++
++static inline int is_robranch(const struct dentry *dentry)
++{
++ int index;
++
++ index = UNIONFS_D(dentry)->bstart;
++ BUG_ON(index < 0);
++
++ return is_robranch_idx(dentry, index);
++}
++
++/*
++ * EXTERNALS:
++ */
++extern int check_branch(const struct path *path);
++extern int parse_branch_mode(const char *name, int *perms);
++
++/* locking helpers */
++static inline struct dentry *lock_parent(struct dentry *dentry)
++{
++ struct dentry *dir = dget_parent(dentry);
++ mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
++ return dir;
++}
++static inline struct dentry *lock_parent_wh(struct dentry *dentry)
++{
++ struct dentry *dir = dget_parent(dentry);
++
++ mutex_lock_nested(&dir->d_inode->i_mutex, UNIONFS_DMUTEX_WHITEOUT);
++ return dir;
++}
++
++static inline void unlock_dir(struct dentry *dir)
++{
++ mutex_unlock(&dir->d_inode->i_mutex);
++ dput(dir);
++}
++
++/* lock base inode mutex before calling lookup_one_len */
++static inline struct dentry *lookup_lck_len(const char *name,
++ struct dentry *base, int len)
++{
++ struct dentry *d;
++ struct nameidata lower_nd;
++ int err;
++
++ err = init_lower_nd(&lower_nd, LOOKUP_OPEN);
++ if (unlikely(err < 0)) {
++ d = ERR_PTR(err);
++ goto out;
++ }
++ mutex_lock(&base->d_inode->i_mutex);
++ d = lookup_one_len_nd(name, base, len, &lower_nd);
++ release_lower_nd(&lower_nd, err);
++ mutex_unlock(&base->d_inode->i_mutex);
++out:
++ return d;
++}
++
++static inline struct vfsmount *unionfs_mntget(struct dentry *dentry,
++ int bindex)
++{
++ struct vfsmount *mnt;
++
++ BUG_ON(!dentry || bindex < 0);
++
++ mnt = mntget(unionfs_lower_mnt_idx(dentry, bindex));
++#ifdef CONFIG_UNION_FS_DEBUG
++ if (!mnt)
++ pr_debug("unionfs: mntget: mnt=%p bindex=%d\n",
++ mnt, bindex);
++#endif /* CONFIG_UNION_FS_DEBUG */
++
++ return mnt;
++}
++
++static inline void unionfs_mntput(struct dentry *dentry, int bindex)
++{
++ struct vfsmount *mnt;
++
++ if (!dentry && bindex < 0)
++ return;
++ BUG_ON(!dentry || bindex < 0);
++
++ mnt = unionfs_lower_mnt_idx(dentry, bindex);
++#ifdef CONFIG_UNION_FS_DEBUG
++ /*
++ * Directories can have NULL lower objects in between start/end, but
++ * NOT if at the start/end range. We cannot verify that this dentry
++ * is a type=DIR, because it may already be a negative dentry. But
++ * if dbstart is greater than dbend, we know that this couldn't have
++ * been a regular file: it had to have been a directory.
++ */
++ if (!mnt && !(bindex > dbstart(dentry) && bindex < dbend(dentry)))
++ pr_debug("unionfs: mntput: mnt=%p bindex=%d\n", mnt, bindex);
++#endif /* CONFIG_UNION_FS_DEBUG */
++ mntput(mnt);
++}
++
++#ifdef CONFIG_UNION_FS_DEBUG
++
++/* useful for tracking code reachability */
++#define UDBG pr_debug("DBG:%s:%s:%d\n", __FILE__, __func__, __LINE__)
++
++#define unionfs_check_inode(i) __unionfs_check_inode((i), \
++ __FILE__, __func__, __LINE__)
++#define unionfs_check_dentry(d) __unionfs_check_dentry((d), \
++ __FILE__, __func__, __LINE__)
++#define unionfs_check_file(f) __unionfs_check_file((f), \
++ __FILE__, __func__, __LINE__)
++#define unionfs_check_nd(n) __unionfs_check_nd((n), \
++ __FILE__, __func__, __LINE__)
++#define show_branch_counts(sb) __show_branch_counts((sb), \
++ __FILE__, __func__, __LINE__)
++#define show_inode_times(i) __show_inode_times((i), \
++ __FILE__, __func__, __LINE__)
++#define show_dinode_times(d) __show_dinode_times((d), \
++ __FILE__, __func__, __LINE__)
++#define show_inode_counts(i) __show_inode_counts((i), \
++ __FILE__, __func__, __LINE__)
++
++extern void __unionfs_check_inode(const struct inode *inode, const char *fname,
++ const char *fxn, int line);
++extern void __unionfs_check_dentry(const struct dentry *dentry,
++ const char *fname, const char *fxn,
++ int line);
++extern void __unionfs_check_file(const struct file *file,
++ const char *fname, const char *fxn, int line);
++extern void __unionfs_check_nd(const struct nameidata *nd,
++ const char *fname, const char *fxn, int line);
++extern void __show_branch_counts(const struct super_block *sb,
++ const char *file, const char *fxn, int line);
++extern void __show_inode_times(const struct inode *inode,
++ const char *file, const char *fxn, int line);
++extern void __show_dinode_times(const struct dentry *dentry,
++ const char *file, const char *fxn, int line);
++extern void __show_inode_counts(const struct inode *inode,
++ const char *file, const char *fxn, int line);
++
++#else /* not CONFIG_UNION_FS_DEBUG */
++
++/* we leave useful hooks for these check functions throughout the code */
++#define unionfs_check_inode(i) do { } while (0)
++#define unionfs_check_dentry(d) do { } while (0)
++#define unionfs_check_file(f) do { } while (0)
++#define unionfs_check_nd(n) do { } while (0)
++#define show_branch_counts(sb) do { } while (0)
++#define show_inode_times(i) do { } while (0)
++#define show_dinode_times(d) do { } while (0)
++#define show_inode_counts(i) do { } while (0)
++
++#endif /* not CONFIG_UNION_FS_DEBUG */
++
++#endif /* not _UNION_H_ */
+diff --git a/fs/unionfs/unlink.c b/fs/unionfs/unlink.c
+new file mode 100644
+index 0000000..bf447bb
+--- /dev/null
++++ b/fs/unionfs/unlink.c
+@@ -0,0 +1,278 @@
++/*
++ * Copyright (c) 2003-2011 Erez Zadok
++ * Copyright (c) 2003-2006 Charles P. Wright
++ * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
++ * Copyright (c) 2005-2006 Junjiro Okajima
++ * Copyright (c) 2005 Arun M. Krishnakumar
++ * Copyright (c) 2004-2006 David P. Quigley
++ * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
++ * Copyright (c) 2003 Puja Gupta
++ * Copyright (c) 2003 Harikesavan Krishnan
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
++ *
++ * 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 "union.h"
++
++/*
++ * Helper function for Unionfs's unlink operation.
++ *
++ * The main goal of this function is to optimize the unlinking of non-dir
++ * objects in unionfs by deleting all possible lower inode objects from the
++ * underlying branches having same dentry name as the non-dir dentry on
++ * which this unlink operation is called. This way we delete as many lower
++ * inodes as possible, and save space. Whiteouts need to be created in
++ * branch0 only if unlinking fails on any of the lower branch other than
++ * branch0, or if a lower branch is marked read-only.
++ *
++ * Also, while unlinking a file, if we encounter any dir type entry in any
++ * intermediate branch, then we remove the directory by calling vfs_rmdir.
++ * The following special cases are also handled:
++
++ * (1) If an error occurs in branch0 during vfs_unlink, then we return
++ * appropriate error.
++ *
++ * (2) If we get an error during unlink in any of other lower branch other
++ * than branch0, then we create a whiteout in branch0.
++ *
++ * (3) If a whiteout already exists in any intermediate branch, we delete
++ * all possible inodes only up to that branch (this is an "opaqueness"
++ * as as per Documentation/filesystems/unionfs/concepts.txt).
++ *
++ */
++static int unionfs_unlink_whiteout(struct inode *dir, struct dentry *dentry,
++ struct dentry *parent)
++{
++ struct dentry *lower_dentry;
++ struct dentry *lower_dir_dentry;
++ int bindex;
++ int err = 0;
++
++ err = unionfs_partial_lookup(dentry, parent);
++ if (err)
++ goto out;
++
++ /* trying to unlink all possible valid instances */
++ for (bindex = dbstart(dentry); bindex <= dbend(dentry); bindex++) {
++ lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
++ if (!lower_dentry || !lower_dentry->d_inode)
++ continue;
++
++ lower_dir_dentry = lock_parent(lower_dentry);
++
++ /* avoid destroying the lower inode if the object is in use */
++ dget(lower_dentry);
++ err = is_robranch_super(dentry->d_sb, bindex);
++ if (!err) {
++ /* see Documentation/filesystems/unionfs/issues.txt */
++ lockdep_off();
++ if (!S_ISDIR(lower_dentry->d_inode->i_mode))
++ err = vfs_unlink(lower_dir_dentry->d_inode,
++ lower_dentry);
++ else
++ err = vfs_rmdir(lower_dir_dentry->d_inode,
++ lower_dentry);
++ lockdep_on();
++ }
++
++ /* if lower object deletion succeeds, update inode's times */
++ if (!err)
++ unionfs_copy_attr_times(dentry->d_inode);
++ dput(lower_dentry);
++ fsstack_copy_attr_times(dir, lower_dir_dentry->d_inode);
++ unlock_dir(lower_dir_dentry);
++
++ if (err)
++ break;
++ }
++
++ /*
++ * Create the whiteout in branch 0 (highest priority) only if (a)
++ * there was an error in any intermediate branch other than branch 0
++ * due to failure of vfs_unlink/vfs_rmdir or (b) a branch marked or
++ * mounted read-only.
++ */
++ if (err) {
++ if ((bindex == 0) ||
++ ((bindex == dbstart(dentry)) &&
++ (!IS_COPYUP_ERR(err))))
++ goto out;
++ else {
++ if (!IS_COPYUP_ERR(err))
++ pr_debug("unionfs: lower object deletion "
++ "failed in branch:%d\n", bindex);
++ err = create_whiteout(dentry, sbstart(dentry->d_sb));
++ }
++ }
++
++out:
++ if (!err)
++ inode_dec_link_count(dentry->d_inode);
++
++ /* We don't want to leave negative leftover dentries for revalidate. */
++ if (!err && (dbopaque(dentry) != -1))
++ update_bstart(dentry);
++
++ return err;
++}
++
++int unionfs_unlink(struct inode *dir, struct dentry *dentry)
++{
++ int err = 0;
++ struct inode *inode = dentry->d_inode;
++ struct dentry *parent;
++ int valid;
++
++ BUG_ON(S_ISDIR(inode->i_mode));
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_CHILD);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ valid = __unionfs_d_revalidate(dentry, parent, false);
++ if (unlikely(!valid)) {
++ err = -ESTALE;
++ goto out;
++ }
++ unionfs_check_dentry(dentry);
++
++ err = unionfs_unlink_whiteout(dir, dentry, parent);
++ /* call d_drop so the system "forgets" about us */
++ if (!err) {
++ unionfs_postcopyup_release(dentry);
++ unionfs_postcopyup_setmnt(parent);
++ if (inode->i_nlink == 0) /* drop lower inodes */
++ iput_lowers_all(inode, false);
++ d_drop(dentry);
++ /*
++ * if unlink/whiteout succeeded, parent dir mtime has
++ * changed
++ */
++ unionfs_copy_attr_times(dir);
++ }
++
++out:
++ if (!err) {
++ unionfs_check_dentry(dentry);
++ unionfs_check_inode(dir);
++ }
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++ return err;
++}
++
++static int unionfs_rmdir_first(struct inode *dir, struct dentry *dentry,
++ struct unionfs_dir_state *namelist)
++{
++ int err;
++ struct dentry *lower_dentry;
++ struct dentry *lower_dir_dentry = NULL;
++
++ /* Here we need to remove whiteout entries. */
++ err = delete_whiteouts(dentry, dbstart(dentry), namelist);
++ if (err)
++ goto out;
++
++ lower_dentry = unionfs_lower_dentry(dentry);
++
++ lower_dir_dentry = lock_parent(lower_dentry);
++
++ /* avoid destroying the lower inode if the file is in use */
++ dget(lower_dentry);
++ err = is_robranch(dentry);
++ if (!err)
++ err = vfs_rmdir(lower_dir_dentry->d_inode, lower_dentry);
++ dput(lower_dentry);
++
++ fsstack_copy_attr_times(dir, lower_dir_dentry->d_inode);
++ /* propagate number of hard-links */
++ dentry->d_inode->i_nlink = unionfs_get_nlinks(dentry->d_inode);
++
++out:
++ if (lower_dir_dentry)
++ unlock_dir(lower_dir_dentry);
++ return err;
++}
++
++int unionfs_rmdir(struct inode *dir, struct dentry *dentry)
++{
++ int err = 0;
++ struct unionfs_dir_state *namelist = NULL;
++ struct dentry *parent;
++ int dstart, dend;
++ bool valid;
++
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_CHILD);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ valid = __unionfs_d_revalidate(dentry, parent, false);
++ if (unlikely(!valid)) {
++ err = -ESTALE;
++ goto out;
++ }
++ unionfs_check_dentry(dentry);
++
++ /* check if this unionfs directory is empty or not */
++ err = check_empty(dentry, parent, &namelist);
++ if (err)
++ goto out;
++
++ err = unionfs_rmdir_first(dir, dentry, namelist);
++ dstart = dbstart(dentry);
++ dend = dbend(dentry);
++ /*
++ * We create a whiteout for the directory if there was an error to
++ * rmdir the first directory entry in the union. Otherwise, we
++ * create a whiteout only if there is no chance that a lower
++ * priority branch might also have the same named directory. IOW,
++ * if there is not another same-named directory at a lower priority
++ * branch, then we don't need to create a whiteout for it.
++ */
++ if (!err) {
++ if (dstart < dend)
++ err = create_whiteout(dentry, dstart);
++ } else {
++ int new_err;
++
++ if (dstart == 0)
++ goto out;
++
++ /* exit if the error returned was NOT -EROFS */
++ if (!IS_COPYUP_ERR(err))
++ goto out;
++
++ new_err = create_whiteout(dentry, dstart - 1);
++ if (new_err != -EEXIST)
++ err = new_err;
++ }
++
++out:
++ /*
++ * Drop references to lower dentry/inode so storage space for them
++ * can be reclaimed. Then, call d_drop so the system "forgets"
++ * about us.
++ */
++ if (!err) {
++ iput_lowers_all(dentry->d_inode, false);
++ dput(unionfs_lower_dentry_idx(dentry, dstart));
++ unionfs_set_lower_dentry_idx(dentry, dstart, NULL);
++ d_drop(dentry);
++ /* update our lower vfsmnts, in case a copyup took place */
++ unionfs_postcopyup_setmnt(dentry);
++ unionfs_check_dentry(dentry);
++ unionfs_check_inode(dir);
++ }
++
++ if (namelist)
++ free_rdstate(namelist);
++
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++ return err;
++}
+diff --git a/fs/unionfs/whiteout.c b/fs/unionfs/whiteout.c
+new file mode 100644
+index 0000000..582cef2
+--- /dev/null
++++ b/fs/unionfs/whiteout.c
+@@ -0,0 +1,601 @@
++/*
++ * Copyright (c) 2003-2011 Erez Zadok
++ * Copyright (c) 2003-2006 Charles P. Wright
++ * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
++ * Copyright (c) 2005-2006 Junjiro Okajima
++ * Copyright (c) 2005 Arun M. Krishnakumar
++ * Copyright (c) 2004-2006 David P. Quigley
++ * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
++ * Copyright (c) 2003 Puja Gupta
++ * Copyright (c) 2003 Harikesavan Krishnan
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
++ *
++ * 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 "union.h"
++
++/*
++ * whiteout and opaque directory helpers
++ */
++
++/* What do we use for whiteouts. */
++#define UNIONFS_WHPFX ".wh."
++#define UNIONFS_WHLEN 4
++/*
++ * If a directory contains this file, then it is opaque. We start with the
++ * .wh. flag so that it is blocked by lookup.
++ */
++#define UNIONFS_DIR_OPAQUE_NAME "__dir_opaque"
++#define UNIONFS_DIR_OPAQUE UNIONFS_WHPFX UNIONFS_DIR_OPAQUE_NAME
++
++/* construct whiteout filename */
++char *alloc_whname(const char *name, int len)
++{
++ char *buf;
++
++ buf = kmalloc(len + UNIONFS_WHLEN + 1, GFP_KERNEL);
++ if (unlikely(!buf))
++ return ERR_PTR(-ENOMEM);
++
++ strcpy(buf, UNIONFS_WHPFX);
++ strlcat(buf, name, len + UNIONFS_WHLEN + 1);
++
++ return buf;
++}
++
++/*
++ * XXX: this can be inline or CPP macro, but is here to keep all whiteout
++ * code in one place.
++ */
++void unionfs_set_max_namelen(long *namelen)
++{
++ *namelen -= UNIONFS_WHLEN;
++}
++
++/* check if @namep is a whiteout, update @namep and @namelenp accordingly */
++bool is_whiteout_name(char **namep, int *namelenp)
++{
++ if (*namelenp > UNIONFS_WHLEN &&
++ !strncmp(*namep, UNIONFS_WHPFX, UNIONFS_WHLEN)) {
++ *namep += UNIONFS_WHLEN;
++ *namelenp -= UNIONFS_WHLEN;
++ return true;
++ }
++ return false;
++}
++
++/* is the filename valid == !(whiteout for a file or opaque dir marker) */
++bool is_validname(const char *name)
++{
++ if (!strncmp(name, UNIONFS_WHPFX, UNIONFS_WHLEN))
++ return false;
++ if (!strncmp(name, UNIONFS_DIR_OPAQUE_NAME,
++ sizeof(UNIONFS_DIR_OPAQUE_NAME) - 1))
++ return false;
++ return true;
++}
++
++/*
++ * Look for a whiteout @name in @lower_parent directory. If error, return
++ * ERR_PTR. Caller must dput() the returned dentry if not an error.
++ *
++ * XXX: some callers can reuse the whname allocated buffer to avoid repeated
++ * free then re-malloc calls. Need to provide a different API for those
++ * callers.
++ */
++struct dentry *lookup_whiteout(const char *name, struct dentry *lower_parent)
++{
++ char *whname = NULL;
++ int err = 0, namelen;
++ struct dentry *wh_dentry = NULL;
++
++ namelen = strlen(name);
++ whname = alloc_whname(name, namelen);
++ if (unlikely(IS_ERR(whname))) {
++ err = PTR_ERR(whname);
++ goto out;
++ }
++
++ /* check if whiteout exists in this branch: lookup .wh.foo */
++ wh_dentry = lookup_lck_len(whname, lower_parent, strlen(whname));
++ if (IS_ERR(wh_dentry)) {
++ err = PTR_ERR(wh_dentry);
++ goto out;
++ }
++
++ /* check if negative dentry (ENOENT) */
++ if (!wh_dentry->d_inode)
++ goto out;
++
++ /* whiteout found: check if valid type */
++ if (!S_ISREG(wh_dentry->d_inode->i_mode)) {
++ printk(KERN_ERR "unionfs: invalid whiteout %s entry type %d\n",
++ whname, wh_dentry->d_inode->i_mode);
++ dput(wh_dentry);
++ err = -EIO;
++ goto out;
++ }
++
++out:
++ kfree(whname);
++ if (err)
++ wh_dentry = ERR_PTR(err);
++ return wh_dentry;
++}
++
++/* find and return first whiteout in parent directory, else ENOENT */
++struct dentry *find_first_whiteout(struct dentry *dentry)
++{
++ int bindex, bstart, bend;
++ struct dentry *parent, *lower_parent, *wh_dentry;
++
++ parent = dget_parent(dentry);
++
++ bstart = dbstart(parent);
++ bend = dbend(parent);
++ wh_dentry = ERR_PTR(-ENOENT);
++
++ for (bindex = bstart; bindex <= bend; bindex++) {
++ lower_parent = unionfs_lower_dentry_idx(parent, bindex);
++ if (!lower_parent)
++ continue;
++ wh_dentry = lookup_whiteout(dentry->d_name.name, lower_parent);
++ if (IS_ERR(wh_dentry))
++ continue;
++ if (wh_dentry->d_inode)
++ break;
++ dput(wh_dentry);
++ wh_dentry = ERR_PTR(-ENOENT);
++ }
++
++ dput(parent);
++
++ return wh_dentry;
++}
++
++/*
++ * Unlink a whiteout dentry. Returns 0 or -errno. Caller must hold and
++ * release dentry reference.
++ */
++int unlink_whiteout(struct dentry *wh_dentry)
++{
++ int err;
++ struct dentry *lower_dir_dentry;
++
++ /* dget and lock parent dentry */
++ lower_dir_dentry = lock_parent_wh(wh_dentry);
++
++ /* see Documentation/filesystems/unionfs/issues.txt */
++ lockdep_off();
++ err = vfs_unlink(lower_dir_dentry->d_inode, wh_dentry);
++ lockdep_on();
++ unlock_dir(lower_dir_dentry);
++
++ /*
++ * Whiteouts are special files and should be deleted no matter what
++ * (as if they never existed), in order to allow this create
++ * operation to succeed. This is especially important in sticky
++ * directories: a whiteout may have been created by one user, but
++ * the newly created file may be created by another user.
++ * Therefore, in order to maintain Unix semantics, if the vfs_unlink
++ * above failed, then we have to try to directly unlink the
++ * whiteout. Note: in the ODF version of unionfs, whiteout are
++ * handled much more cleanly.
++ */
++ if (err == -EPERM) {
++ struct inode *inode = lower_dir_dentry->d_inode;
++ err = inode->i_op->unlink(inode, wh_dentry);
++ }
++ if (err)
++ printk(KERN_ERR "unionfs: could not unlink whiteout %s, "
++ "err = %d\n", wh_dentry->d_name.name, err);
++
++ return err;
++
++}
++
++/*
++ * Helper function when creating new objects (create, symlink, mknod, etc.).
++ * Checks to see if there's a whiteout in @lower_dentry's parent directory,
++ * whose name is taken from @dentry. Then tries to remove that whiteout, if
++ * found. If <dentry,bindex> is a branch marked readonly, return -EROFS.
++ * If it finds both a regular file and a whiteout, delete whiteout (this
++ * should never happen).
++ *
++ * Return 0 if no whiteout was found. Return 1 if one was found and
++ * successfully removed. Therefore a value >= 0 tells the caller that
++ * @lower_dentry belongs to a good branch to create the new object in).
++ * Return -ERRNO if an error occurred during whiteout lookup or in trying to
++ * unlink the whiteout.
++ */
++int check_unlink_whiteout(struct dentry *dentry, struct dentry *lower_dentry,
++ int bindex)
++{
++ int err;
++ struct dentry *wh_dentry = NULL;
++ struct dentry *lower_dir_dentry = NULL;
++
++ /* look for whiteout dentry first */
++ lower_dir_dentry = dget_parent(lower_dentry);
++ wh_dentry = lookup_whiteout(dentry->d_name.name, lower_dir_dentry);
++ dput(lower_dir_dentry);
++ if (IS_ERR(wh_dentry)) {
++ err = PTR_ERR(wh_dentry);
++ goto out;
++ }
++
++ if (!wh_dentry->d_inode) { /* no whiteout exists*/
++ err = 0;
++ goto out_dput;
++ }
++
++ /* check if regular file and whiteout were both found */
++ if (unlikely(lower_dentry->d_inode))
++ printk(KERN_WARNING "unionfs: removing whiteout; regular "
++ "file exists in directory %s (branch %d)\n",
++ lower_dir_dentry->d_name.name, bindex);
++
++ /* check if branch is writeable */
++ err = is_robranch_super(dentry->d_sb, bindex);
++ if (err)
++ goto out_dput;
++
++ /* .wh.foo has been found, so let's unlink it */
++ err = unlink_whiteout(wh_dentry);
++ if (!err)
++ err = 1; /* a whiteout was found and successfully removed */
++out_dput:
++ dput(wh_dentry);
++out:
++ return err;
++}
++
++/*
++ * Pass an unionfs dentry and an index. It will try to create a whiteout
++ * for the filename in dentry, and will try in branch 'index'. On error,
++ * it will proceed to a branch to the left.
++ */
++int create_whiteout(struct dentry *dentry, int start)
++{
++ int bstart, bend, bindex;
++ struct dentry *lower_dir_dentry;
++ struct dentry *lower_dentry;
++ struct dentry *lower_wh_dentry;
++ struct nameidata nd;
++ char *name = NULL;
++ int err = -EINVAL;
++
++ verify_locked(dentry);
++
++ bstart = dbstart(dentry);
++ bend = dbend(dentry);
++
++ /* create dentry's whiteout equivalent */
++ name = alloc_whname(dentry->d_name.name, dentry->d_name.len);
++ if (unlikely(IS_ERR(name))) {
++ err = PTR_ERR(name);
++ goto out;
++ }
++
++ for (bindex = start; bindex >= 0; bindex--) {
++ lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
++
++ if (!lower_dentry) {
++ /*
++ * if lower dentry is not present, create the
++ * entire lower dentry directory structure and go
++ * ahead. Since we want to just create whiteout, we
++ * only want the parent dentry, and hence get rid of
++ * this dentry.
++ */
++ lower_dentry = create_parents(dentry->d_inode,
++ dentry,
++ dentry->d_name.name,
++ bindex);
++ if (!lower_dentry || IS_ERR(lower_dentry)) {
++ int ret = PTR_ERR(lower_dentry);
++ if (!IS_COPYUP_ERR(ret))
++ printk(KERN_ERR
++ "unionfs: create_parents for "
++ "whiteout failed: bindex=%d "
++ "err=%d\n", bindex, ret);
++ continue;
++ }
++ }
++
++ lower_wh_dentry =
++ lookup_lck_len(name, lower_dentry->d_parent,
++ dentry->d_name.len + UNIONFS_WHLEN);
++ if (IS_ERR(lower_wh_dentry))
++ continue;
++
++ /*
++ * The whiteout already exists. This used to be impossible,
++ * but now is possible because of opaqueness.
++ */
++ if (lower_wh_dentry->d_inode) {
++ dput(lower_wh_dentry);
++ err = 0;
++ goto out;
++ }
++
++ err = init_lower_nd(&nd, LOOKUP_CREATE);
++ if (unlikely(err < 0))
++ goto out;
++ lower_dir_dentry = lock_parent_wh(lower_wh_dentry);
++ err = is_robranch_super(dentry->d_sb, bindex);
++ if (!err)
++ err = vfs_create(lower_dir_dentry->d_inode,
++ lower_wh_dentry,
++ current_umask() & S_IRUGO,
++ &nd);
++ unlock_dir(lower_dir_dentry);
++ dput(lower_wh_dentry);
++ release_lower_nd(&nd, err);
++
++ if (!err || !IS_COPYUP_ERR(err))
++ break;
++ }
++
++ /* set dbopaque so that lookup will not proceed after this branch */
++ if (!err)
++ dbopaque(dentry) = bindex;
++
++out:
++ kfree(name);
++ return err;
++}
++
++/*
++ * Delete all of the whiteouts in a given directory for rmdir.
++ *
++ * lower directory inode should be locked
++ */
++static int do_delete_whiteouts(struct dentry *dentry, int bindex,
++ struct unionfs_dir_state *namelist)
++{
++ int err = 0;
++ struct dentry *lower_dir_dentry = NULL;
++ struct dentry *lower_dentry;
++ char *name = NULL, *p;
++ struct inode *lower_dir;
++ int i;
++ struct list_head *pos;
++ struct filldir_node *cursor;
++
++ /* Find out lower parent dentry */
++ lower_dir_dentry = unionfs_lower_dentry_idx(dentry, bindex);
++ BUG_ON(!S_ISDIR(lower_dir_dentry->d_inode->i_mode));
++ lower_dir = lower_dir_dentry->d_inode;
++ BUG_ON(!S_ISDIR(lower_dir->i_mode));
++
++ err = -ENOMEM;
++ name = __getname();
++ if (unlikely(!name))
++ goto out;
++ strcpy(name, UNIONFS_WHPFX);
++ p = name + UNIONFS_WHLEN;
++
++ err = 0;
++ for (i = 0; !err && i < namelist->size; i++) {
++ list_for_each(pos, &namelist->list[i]) {
++ cursor =
++ list_entry(pos, struct filldir_node,
++ file_list);
++ /* Only operate on whiteouts in this branch. */
++ if (cursor->bindex != bindex)
++ continue;
++ if (!cursor->whiteout)
++ continue;
++
++ strlcpy(p, cursor->name, PATH_MAX - UNIONFS_WHLEN);
++ lower_dentry =
++ lookup_lck_len(name, lower_dir_dentry,
++ cursor->namelen +
++ UNIONFS_WHLEN);
++ if (IS_ERR(lower_dentry)) {
++ err = PTR_ERR(lower_dentry);
++ break;
++ }
++ if (lower_dentry->d_inode)
++ err = vfs_unlink(lower_dir, lower_dentry);
++ dput(lower_dentry);
++ if (err)
++ break;
++ }
++ }
++
++ __putname(name);
++
++ /* After all of the removals, we should copy the attributes once. */
++ fsstack_copy_attr_times(dentry->d_inode, lower_dir_dentry->d_inode);
++
++out:
++ return err;
++}
++
++
++void __delete_whiteouts(struct work_struct *work)
++{
++ struct sioq_args *args = container_of(work, struct sioq_args, work);
++ struct deletewh_args *d = &args->deletewh;
++
++ args->err = do_delete_whiteouts(d->dentry, d->bindex, d->namelist);
++ complete(&args->comp);
++}
++
++/* delete whiteouts in a dir (for rmdir operation) using sioq if necessary */
++int delete_whiteouts(struct dentry *dentry, int bindex,
++ struct unionfs_dir_state *namelist)
++{
++ int err;
++ struct super_block *sb;
++ struct dentry *lower_dir_dentry;
++ struct inode *lower_dir;
++ struct sioq_args args;
++
++ sb = dentry->d_sb;
++
++ BUG_ON(!S_ISDIR(dentry->d_inode->i_mode));
++ BUG_ON(bindex < dbstart(dentry));
++ BUG_ON(bindex > dbend(dentry));
++ err = is_robranch_super(sb, bindex);
++ if (err)
++ goto out;
++
++ lower_dir_dentry = unionfs_lower_dentry_idx(dentry, bindex);
++ BUG_ON(!S_ISDIR(lower_dir_dentry->d_inode->i_mode));
++ lower_dir = lower_dir_dentry->d_inode;
++ BUG_ON(!S_ISDIR(lower_dir->i_mode));
++
++ if (!inode_permission(lower_dir, MAY_WRITE | MAY_EXEC)) {
++ err = do_delete_whiteouts(dentry, bindex, namelist);
++ } else {
++ args.deletewh.namelist = namelist;
++ args.deletewh.dentry = dentry;
++ args.deletewh.bindex = bindex;
++ run_sioq(__delete_whiteouts, &args);
++ err = args.err;
++ }
++
++out:
++ return err;
++}
++
++/****************************************************************************
++ * Opaque directory helpers *
++ ****************************************************************************/
++
++/*
++ * is_opaque_dir: returns 0 if it is NOT an opaque dir, 1 if it is, and
++ * -errno if an error occurred trying to figure this out.
++ */
++int is_opaque_dir(struct dentry *dentry, int bindex)
++{
++ int err = 0;
++ struct dentry *lower_dentry;
++ struct dentry *wh_lower_dentry;
++ struct inode *lower_inode;
++ struct sioq_args args;
++ struct nameidata lower_nd;
++
++ lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
++ lower_inode = lower_dentry->d_inode;
++
++ BUG_ON(!S_ISDIR(lower_inode->i_mode));
++
++ mutex_lock(&lower_inode->i_mutex);
++
++ if (!inode_permission(lower_inode, MAY_EXEC)) {
++ err = init_lower_nd(&lower_nd, LOOKUP_OPEN);
++ if (unlikely(err < 0)) {
++ mutex_unlock(&lower_inode->i_mutex);
++ goto out;
++ }
++ wh_lower_dentry =
++ lookup_one_len_nd(UNIONFS_DIR_OPAQUE, lower_dentry,
++ sizeof(UNIONFS_DIR_OPAQUE) - 1,
++ &lower_nd);
++ release_lower_nd(&lower_nd, err);
++ } else {
++ args.is_opaque.dentry = lower_dentry;
++ run_sioq(__is_opaque_dir, &args);
++ wh_lower_dentry = args.ret;
++ }
++
++ mutex_unlock(&lower_inode->i_mutex);
++
++ if (IS_ERR(wh_lower_dentry)) {
++ err = PTR_ERR(wh_lower_dentry);
++ goto out;
++ }
++
++ /* This is an opaque dir iff wh_lower_dentry is positive */
++ err = !!wh_lower_dentry->d_inode;
++
++ dput(wh_lower_dentry);
++out:
++ return err;
++}
++
++void __is_opaque_dir(struct work_struct *work)
++{
++ struct sioq_args *args = container_of(work, struct sioq_args, work);
++ struct nameidata lower_nd;
++ int err;
++
++ err = init_lower_nd(&lower_nd, LOOKUP_OPEN);
++ if (unlikely(err < 0))
++ return;
++ args->ret = lookup_one_len_nd(UNIONFS_DIR_OPAQUE,
++ args->is_opaque.dentry,
++ sizeof(UNIONFS_DIR_OPAQUE) - 1,
++ &lower_nd);
++ release_lower_nd(&lower_nd, err);
++ complete(&args->comp);
++}
++
++int make_dir_opaque(struct dentry *dentry, int bindex)
++{
++ int err = 0;
++ struct dentry *lower_dentry, *diropq;
++ struct inode *lower_dir;
++ struct nameidata nd;
++ const struct cred *old_creds;
++ struct cred *new_creds;
++
++ /*
++ * Opaque directory whiteout markers are special files (like regular
++ * whiteouts), and should appear to the users as if they don't
++ * exist. They should be created/deleted regardless of directory
++ * search/create permissions, but only for the duration of this
++ * creation of the .wh.__dir_opaque: file. Note, this does not
++ * circumvent normal ->permission).
++ */
++ new_creds = prepare_creds();
++ if (unlikely(!new_creds)) {
++ err = -ENOMEM;
++ goto out_err;
++ }
++ cap_raise(new_creds->cap_effective, CAP_DAC_READ_SEARCH);
++ cap_raise(new_creds->cap_effective, CAP_DAC_OVERRIDE);
++ old_creds = override_creds(new_creds);
++
++ lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
++ lower_dir = lower_dentry->d_inode;
++ BUG_ON(!S_ISDIR(dentry->d_inode->i_mode) ||
++ !S_ISDIR(lower_dir->i_mode));
++
++ mutex_lock(&lower_dir->i_mutex);
++ err = init_lower_nd(&nd, LOOKUP_OPEN);
++ if (unlikely(err < 0))
++ goto out;
++ diropq = lookup_one_len_nd(UNIONFS_DIR_OPAQUE, lower_dentry,
++ sizeof(UNIONFS_DIR_OPAQUE) - 1, &nd);
++ release_lower_nd(&nd, err);
++ if (IS_ERR(diropq)) {
++ err = PTR_ERR(diropq);
++ goto out;
++ }
++
++ err = init_lower_nd(&nd, LOOKUP_CREATE);
++ if (unlikely(err < 0))
++ goto out;
++ if (!diropq->d_inode)
++ err = vfs_create(lower_dir, diropq, S_IRUGO, &nd);
++ if (!err)
++ dbopaque(dentry) = bindex;
++ release_lower_nd(&nd, err);
++
++ dput(diropq);
++
++out:
++ mutex_unlock(&lower_dir->i_mutex);
++ revert_creds(old_creds);
++out_err:
++ return err;
++}
+diff --git a/fs/unionfs/xattr.c b/fs/unionfs/xattr.c
+new file mode 100644
+index 0000000..a93d803
+--- /dev/null
++++ b/fs/unionfs/xattr.c
+@@ -0,0 +1,173 @@
++/*
++ * Copyright (c) 2003-2011 Erez Zadok
++ * Copyright (c) 2003-2006 Charles P. Wright
++ * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
++ * Copyright (c) 2005-2006 Junjiro Okajima
++ * Copyright (c) 2005 Arun M. Krishnakumar
++ * Copyright (c) 2004-2006 David P. Quigley
++ * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
++ * Copyright (c) 2003 Puja Gupta
++ * Copyright (c) 2003 Harikesavan Krishnan
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
++ *
++ * 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 "union.h"
++
++/* This is lifted from fs/xattr.c */
++void *unionfs_xattr_alloc(size_t size, size_t limit)
++{
++ void *ptr;
++
++ if (size > limit)
++ return ERR_PTR(-E2BIG);
++
++ if (!size) /* size request, no buffer is needed */
++ return NULL;
++
++ ptr = kmalloc(size, GFP_KERNEL);
++ if (unlikely(!ptr))
++ return ERR_PTR(-ENOMEM);
++ return ptr;
++}
++
++/*
++ * BKL held by caller.
++ * dentry->d_inode->i_mutex locked
++ */
++ssize_t unionfs_getxattr(struct dentry *dentry, const char *name, void *value,
++ size_t size)
++{
++ struct dentry *lower_dentry = NULL;
++ struct dentry *parent;
++ int err = -EOPNOTSUPP;
++ bool valid;
++
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_CHILD);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ valid = __unionfs_d_revalidate(dentry, parent, false);
++ if (unlikely(!valid)) {
++ err = -ESTALE;
++ goto out;
++ }
++
++ lower_dentry = unionfs_lower_dentry(dentry);
++
++ err = vfs_getxattr(lower_dentry, (char *) name, value, size);
++
++out:
++ unionfs_check_dentry(dentry);
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++ return err;
++}
++
++/*
++ * BKL held by caller.
++ * dentry->d_inode->i_mutex locked
++ */
++int unionfs_setxattr(struct dentry *dentry, const char *name,
++ const void *value, size_t size, int flags)
++{
++ struct dentry *lower_dentry = NULL;
++ struct dentry *parent;
++ int err = -EOPNOTSUPP;
++ bool valid;
++
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_CHILD);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ valid = __unionfs_d_revalidate(dentry, parent, false);
++ if (unlikely(!valid)) {
++ err = -ESTALE;
++ goto out;
++ }
++
++ lower_dentry = unionfs_lower_dentry(dentry);
++
++ err = vfs_setxattr(lower_dentry, (char *) name, (void *) value,
++ size, flags);
++
++out:
++ unionfs_check_dentry(dentry);
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++ return err;
++}
++
++/*
++ * BKL held by caller.
++ * dentry->d_inode->i_mutex locked
++ */
++int unionfs_removexattr(struct dentry *dentry, const char *name)
++{
++ struct dentry *lower_dentry = NULL;
++ struct dentry *parent;
++ int err = -EOPNOTSUPP;
++ bool valid;
++
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_CHILD);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ valid = __unionfs_d_revalidate(dentry, parent, false);
++ if (unlikely(!valid)) {
++ err = -ESTALE;
++ goto out;
++ }
++
++ lower_dentry = unionfs_lower_dentry(dentry);
++
++ err = vfs_removexattr(lower_dentry, (char *) name);
++
++out:
++ unionfs_check_dentry(dentry);
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++ return err;
++}
++
++/*
++ * BKL held by caller.
++ * dentry->d_inode->i_mutex locked
++ */
++ssize_t unionfs_listxattr(struct dentry *dentry, char *list, size_t size)
++{
++ struct dentry *lower_dentry = NULL;
++ struct dentry *parent;
++ int err = -EOPNOTSUPP;
++ char *encoded_list = NULL;
++ bool valid;
++
++ unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_CHILD);
++ parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
++ unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
++
++ valid = __unionfs_d_revalidate(dentry, parent, false);
++ if (unlikely(!valid)) {
++ err = -ESTALE;
++ goto out;
++ }
++
++ lower_dentry = unionfs_lower_dentry(dentry);
++
++ encoded_list = list;
++ err = vfs_listxattr(lower_dentry, encoded_list, size);
++
++out:
++ unionfs_check_dentry(dentry);
++ unionfs_unlock_dentry(dentry);
++ unionfs_unlock_parent(dentry, parent);
++ unionfs_read_unlock(dentry->d_sb);
++ return err;
++}
+diff --git a/include/linux/fs_stack.h b/include/linux/fs_stack.h
+index da317c7..64f1ced 100644
+--- a/include/linux/fs_stack.h
++++ b/include/linux/fs_stack.h
+@@ -1,7 +1,19 @@
++/*
++ * Copyright (c) 2006-2009 Erez Zadok
++ * Copyright (c) 2006-2007 Josef 'Jeff' Sipek
++ * Copyright (c) 2006-2009 Stony Brook University
++ * Copyright (c) 2006-2009 The Research Foundation of SUNY
++ *
++ * 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.
++ */
++
+ #ifndef _LINUX_FS_STACK_H
+ #define _LINUX_FS_STACK_H
+
+-/* This file defines generic functions used primarily by stackable
++/*
++ * This file defines generic functions used primarily by stackable
+ * filesystems; none of these functions require i_mutex to be held.
+ */
+
+diff --git a/include/linux/magic.h b/include/linux/magic.h
+index 1e5df2a..01ee54d 100644
+--- a/include/linux/magic.h
++++ b/include/linux/magic.h
+@@ -50,6 +50,8 @@
+ #define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs"
+ #define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs"
+
++#define UNIONFS_SUPER_MAGIC 0xf15f083d
++
+ #define SMB_SUPER_MAGIC 0x517B
+ #define USBDEVICE_SUPER_MAGIC 0x9fa2
+ #define CGROUP_SUPER_MAGIC 0x27e0eb
+diff --git a/include/linux/namei.h b/include/linux/namei.h
+index eba45ea..8e19e9c 100644
+--- a/include/linux/namei.h
++++ b/include/linux/namei.h
+@@ -81,8 +81,11 @@ extern int vfs_path_lookup(struct dentry *, struct vfsmount *,
+
+ extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry,
+ int (*open)(struct inode *, struct file *));
++extern void release_open_intent(struct nameidata *);
+
+ extern struct dentry *lookup_one_len(const char *, struct dentry *, int);
++extern struct dentry *lookup_one_len_nd(const char *, struct dentry *, int,
++ struct nameidata *nd);
+
+ extern int follow_down_one(struct path *);
+ extern int follow_down(struct path *);
+diff --git a/include/linux/splice.h b/include/linux/splice.h
+index 997c3b4..54f5501 100644
+--- a/include/linux/splice.h
++++ b/include/linux/splice.h
+@@ -81,6 +81,11 @@ extern ssize_t splice_to_pipe(struct pipe_inode_info *,
+ struct splice_pipe_desc *);
+ extern ssize_t splice_direct_to_actor(struct file *, struct splice_desc *,
+ splice_direct_actor *);
++extern long vfs_splice_from(struct pipe_inode_info *pipe, struct file *out,
++ loff_t *ppos, size_t len, unsigned int flags);
++extern long vfs_splice_to(struct file *in, loff_t *ppos,
++ struct pipe_inode_info *pipe, size_t len,
++ unsigned int flags);
+
+ /*
+ * for dynamic pipe sizing
+diff --git a/include/linux/union_fs.h b/include/linux/union_fs.h
+new file mode 100644
+index 0000000..c84d97e
+--- /dev/null
++++ b/include/linux/union_fs.h
+@@ -0,0 +1,22 @@
++/*
++ * Copyright (c) 2003-2009 Erez Zadok
++ * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
++ * Copyright (c) 2003-2009 Stony Brook University
++ * Copyright (c) 2003-2009 The Research Foundation of SUNY
++ *
++ * 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.
++ */
++
++#ifndef _LINUX_UNION_FS_H
++#define _LINUX_UNION_FS_H
++
++/*
++ * DEFINITIONS FOR USER AND KERNEL CODE:
++ */
++# define UNIONFS_IOCTL_INCGEN _IOR(0x15, 11, int)
++# define UNIONFS_IOCTL_QUERYFILE _IOR(0x15, 15, int)
++
++#endif /* _LINUX_UNIONFS_H */
++
+diff --git a/security/security.c b/security/security.c
+index 4ba6d4c..093d8b4 100644
+--- a/security/security.c
++++ b/security/security.c
+@@ -520,6 +520,7 @@ int security_inode_permission(struct inode *inode, int mask)
+ return 0;
+ return security_ops->inode_permission(inode, mask, 0);
+ }
++EXPORT_SYMBOL(security_inode_permission);
+
+ int security_inode_exec_permission(struct inode *inode, unsigned int flags)
+ {
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0030-omap-Change-omap_device-activate-latency-messages-fr.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0030-omap-Change-omap_device-activate-latency-messages-fr.patch
new file mode 100644
index 0000000000..30010faa0c
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0030-omap-Change-omap_device-activate-latency-messages-fr.patch
@@ -0,0 +1,34 @@
+From ab3ce8260342b568029c051c5e526526696a27f6 Mon Sep 17 00:00:00 2001
+From: Steve Sakoman <steve@sakoman.com>
+Date: Mon, 23 May 2011 12:16:50 -0700
+Subject: [PATCH 30/31] omap: Change omap_device activate latency messages from pr_warning to pr_debug
+
+Messages can be safely ignored, so reduce console noise
+
+Signed-off-by: Steve Sakoman <steve@sakoman.com>
+---
+ arch/arm/plat-omap/omap_device.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
+index 9bbda9a..ca8a479 100644
+--- a/arch/arm/plat-omap/omap_device.c
++++ b/arch/arm/plat-omap/omap_device.c
+@@ -145,12 +145,12 @@ static int _omap_device_activate(struct omap_device *od, u8 ignore_lat)
+ odpl->activate_lat_worst = act_lat;
+ if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) {
+ odpl->activate_lat = act_lat;
+- pr_warning("omap_device: %s.%d: new worst case "
++ pr_debug("omap_device: %s.%d: new worst case "
+ "activate latency %d: %llu\n",
+ od->pdev.name, od->pdev.id,
+ od->pm_lat_level, act_lat);
+ } else
+- pr_warning("omap_device: %s.%d: activate "
++ pr_debug("omap_device: %s.%d: activate "
+ "latency %d higher than exptected. "
+ "(%llu > %d)\n",
+ od->pdev.name, od->pdev.id,
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-2.6.39/sakoman/0031-omap-overo-Add-opp-init.patch b/recipes/linux/linux-omap-2.6.39/sakoman/0031-omap-overo-Add-opp-init.patch
new file mode 100644
index 0000000000..c50db1b33f
--- /dev/null
+++ b/recipes/linux/linux-omap-2.6.39/sakoman/0031-omap-overo-Add-opp-init.patch
@@ -0,0 +1,105 @@
+From c79191ab97d2b006c59c7dce4bfcdce48d66ec03 Mon Sep 17 00:00:00 2001
+From: Steve Sakoman <steve@sakoman.com>
+Date: Tue, 24 May 2011 20:36:07 -0700
+Subject: [PATCH 31/31] omap: overo: Add opp init
+
+omap: overo: Add opp init
+
+Work in progress
+
+Signed-off-by: Steve Sakoman <steve@sakoman.com>
+---
+ arch/arm/mach-omap2/board-overo.c | 49 +++++++++++++++++++++++++++++++++++++
+ 1 files changed, 49 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
+index 05dd3eb..8c2d21f 100644
+--- a/arch/arm/mach-omap2/board-overo.c
++++ b/arch/arm/mach-omap2/board-overo.c
+@@ -25,6 +25,7 @@
+ #include <linux/init.h>
+ #include <linux/io.h>
+ #include <linux/kernel.h>
++#include <linux/opp.h>
+ #include <linux/platform_device.h>
+ #include <linux/i2c/twl.h>
+ #include <linux/regulator/machine.h>
+@@ -43,6 +44,7 @@
+
+ #include <plat/board.h>
+ #include <plat/common.h>
++#include <plat/omap_device.h>
+ #include <plat/display.h>
+ #include <plat/panel-generic-dpi.h>
+ #include <mach/gpio.h>
+@@ -54,6 +56,7 @@
+ #include <plat/usb.h>
+
+ #include "mux.h"
++#include "pm.h"
+ #include "sdram-micron-mt46h32m32lf-6.h"
+ #include "hsmmc.h"
+
+@@ -755,6 +758,51 @@ static struct omap_musb_board_data musb_board_data = {
+ .power = 100,
+ };
+
++static void __init overo_opp_init(void)
++{
++ int r = 0;
++
++ /* Initialize the omap3 opp table */
++ if (omap3_opp_init()) {
++ pr_err("%s: opp default init failed\n", __func__);
++ return;
++ }
++
++ /* Custom OPP enabled for 36/3730 */
++ if (cpu_is_omap3630()) {
++ struct omap_hwmod *mh = omap_hwmod_lookup("mpu");
++ struct omap_hwmod *dh = omap_hwmod_lookup("iva");
++ struct device *dev;
++
++ if (!mh || !dh) {
++ pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n",
++ __func__, mh, dh);
++ return;
++ }
++ /* Enable MPU 1GHz and lower opps */
++ dev = &mh->od->pdev.dev;
++ r = opp_enable(dev, 1000000000);
++
++ /* Enable IVA 800MHz and lower opps */
++ dev = &dh->od->pdev.dev;
++ r |= opp_enable(dev, 800000000);
++
++ if (r) {
++ pr_err("%s: failed to enable higher opp %d\n",
++ __func__, r);
++ /*
++ * Cleanup - disable the higher freqs - we dont care
++ * about the results
++ */
++ dev = &mh->od->pdev.dev;
++ opp_disable(dev, 1000000000);
++ dev = &dh->od->pdev.dev;
++ opp_disable(dev, 800000000);
++ }
++ }
++ return;
++}
++
+ static void __init overo_init(void)
+ {
+ omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
+@@ -770,6 +818,7 @@ static void __init overo_init(void)
+ overo_display_init();
+ overo_init_led();
+ overo_init_keys();
++ overo_opp_init();
+
+ /* Ensure SDRC pins are mux'd for self-refresh */
+ omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-hah_2.6.31.bb b/recipes/linux/linux-omap-hah_2.6.31.bb
index 31478b52be..8a45607a96 100644
--- a/recipes/linux/linux-omap-hah_2.6.31.bb
+++ b/recipes/linux/linux-omap-hah_2.6.31.bb
@@ -5,9 +5,9 @@ KERNEL_IMAGETYPE = "uImage"
COMPATIBLE_MACHINE = "bug20"
-MACHINE_KERNEL_PR = "r95"
+MACHINE_KERNEL_PR = "r96"
-SRCREV = "37974263d42fe943dd347d27f4ed711a61a560da"
+SRCREV = "b8231a0d64e371aca70e69a702dbb57f5d69f376"
SRC_URI = "git://github.com/buglabs/bug20-2.6.31-omap.git;branch=master;protocol=git"
diff --git a/recipes/linux/linux-omap-psp-2.6.32/0003-Makefile-change-to-revert-am3517-evm-support-and-to-.patch b/recipes/linux/linux-omap-psp-2.6.32/0003-Makefile-change-to-revert-am3517-evm-support-and-to-.patch
new file mode 100644
index 0000000000..38d52f529c
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.32/0003-Makefile-change-to-revert-am3517-evm-support-and-to-.patch
@@ -0,0 +1,36 @@
+From bf6347d8f42e053b187a499e5ed1fdf4f0992969 Mon Sep 17 00:00:00 2001
+From: Anil Kumar <anilm@mistralsolutions.com>
+Date: Thu, 5 May 2011 15:21:34 +0530
+Subject: [PATCH] Makefile change to revert am3517-evm support and to add am3517-crane board support
+
+Signed-off-by: Anil Kumar <anilm@mistralsolutions.com>
+---
+ drivers/usb/musb/Makefile | 11 +++++++----
+ 1 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile
+index daf3415..8941549 100644
+--- a/drivers/usb/musb/Makefile
++++ b/drivers/usb/musb/Makefile
+@@ -19,11 +19,14 @@ ifeq ($(CONFIG_ARCH_OMAP2430),y)
+ endif
+
+ ifeq ($(CONFIG_ARCH_OMAP3430),y)
+-
+- ifeq ($(CONFIG_MACH_CRANEBOARD),y)
+- musb_hdrc-objs += am3517.o
++ ifeq ($(CONFIG_MACH_OMAP3517EVM),y)
++ musb_hdrc-objs += am3517.o
+ else
+- musb_hdrc-objs += omap2430.o
++ ifeq ($(CONFIG_MACH_CRANEBOARD),y)
++ musb_hdrc-objs += am3517.o
++ else
++ musb_hdrc-objs += omap2430.o
++ endif
+ endif
+ endif
+
+--
+1.7.0.4
+
diff --git a/recipes/linux/linux-omap-psp_2.6.32.bb b/recipes/linux/linux-omap-psp_2.6.32.bb
index cabe703a5a..da2e9430dd 100644
--- a/recipes/linux/linux-omap-psp_2.6.32.bb
+++ b/recipes/linux/linux-omap-psp_2.6.32.bb
@@ -139,6 +139,7 @@ SRC_URI = "git://arago-project.org/git/projects/linux-omap3.git;protocol=http;br
file://porches.patch \
file://0001-OMAP3-craneboard-print-expansionboard-name-detected-.patch \
file://0002-OMAP3-craneboard-add-support-for-TinCanTools-Trainer.patch \
+ file://0003-Makefile-change-to-revert-am3517-evm-support-and-to-.patch \
file://0001-ARM-6329-1-wire-up-sys_accept4-on-ARM.patch \
file://defconfig"
diff --git a/recipes/linux/linux-omap_2.6.39.bb b/recipes/linux/linux-omap_2.6.39.bb
new file mode 100644
index 0000000000..8c9461ea17
--- /dev/null
+++ b/recipes/linux/linux-omap_2.6.39.bb
@@ -0,0 +1,104 @@
+require multi-kernel.inc
+
+DESCRIPTION = "Linux kernel for OMAP processors"
+KERNEL_IMAGETYPE = "uImage"
+
+COMPATIBLE_MACHINE = "(beagleboard)"
+
+# The main PR is now using MACHINE_KERNEL_PR, for omap3 see conf/machine/include/omap3.inc
+SRCREV_pn-${PN} = "v2.6.39"
+MACHINE_KERNEL_PR_append = "g"
+
+FILESPATHPKG_prepend = "linux-omap-2.6.39:"
+
+SRC_URI += "git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git;protocol=git \
+ file://defconfig"
+
+SRC_URI_append = " \
+ file://sakoman/0001-OMAP-DSS2-DSI-fix-use_sys_clk-highfreq.patch \
+ file://sakoman/0002-OMAP-DSS2-DSI-fix-dsi_dump_clocks.patch \
+ file://sakoman/0003-OMAP2PLUS-DSS2-Fix-Return-correct-lcd-clock-source-f.patch \
+ file://sakoman/0004-OMAP-DSS-DSI-Fix-DSI-PLL-power-bug.patch \
+ file://sakoman/0005-OMAP-DSS2-fix-panel-Kconfig-dependencies.patch \
+ file://sakoman/0006-OMAP-DSS2-add-bootarg-for-selecting-svideo-or-compos.patch \
+ file://sakoman/0007-video-add-timings-for-hd720.patch \
+ file://sakoman/0008-drivers-net-smsc911x-return-ENODEV-if-device-is-not-.patch \
+ file://sakoman/0009-drivers-input-touchscreen-ads7846-return-ENODEV-if-d.patch \
+ file://sakoman/0010-Revert-omap2_mcspi-Flush-posted-writes.patch \
+ file://sakoman/0011-Revert-omap_hsmmc-improve-interrupt-synchronisation.patch \
+ file://sakoman/0012-Don-t-turn-SDIO-cards-off-to-save-power.-Doing-so-wi.patch \
+ file://sakoman/0013-Enable-the-use-of-SDIO-card-interrupts.patch \
+ file://sakoman/0014-soc-codecs-Enable-audio-capture-by-default-for-twl40.patch \
+ file://sakoman/0015-soc-codecs-twl4030-Turn-on-mic-bias-by-default.patch \
+ file://sakoman/0016-RTC-add-support-for-backup-battery-recharge.patch \
+ file://sakoman/0017-ARM-OMAP2-mmc-twl4030-move-clock-input-selection-pri.patch \
+ file://sakoman/0018-Add-power-off-support-for-the-TWL4030-companion.patch \
+ file://sakoman/0019-ARM-OMAP-Add-twl4030-madc-support-to-Overo.patch \
+ file://sakoman/0020-Enabling-Hwmon-driver-for-twl4030-madc.patch \
+ file://sakoman/0021-mfd-twl-core-enable-madc-clock.patch \
+ file://sakoman/0022-rtc-twl-Switch-to-using-threaded-irq.patch \
+ file://sakoman/0023-ARM-OMAP-automatically-set-musb-mode-in-platform-dat.patch \
+ file://sakoman/0024-omap-mmc-Adjust-dto-to-eliminate-timeout-errors.patch \
+ file://sakoman/0025-omap-Fix-mtd-subpage-read-alignment.patch \
+ file://sakoman/0026-mtd-nand-omap2-Force-all-buffer-reads-to-u32-alignme.patch \
+ file://sakoman/0027-omap-nand-fix-subpage-ecc-issue-with-prefetch.patch \
+ file://sakoman/0028-OMAP-Overo-Add-support-for-spidev.patch \
+ file://sakoman/0029-unionfs-Add-support-for-unionfs-2.5.9.patch \
+ file://sakoman/0030-omap-Change-omap_device-activate-latency-messages-fr.patch \
+ file://sakoman/0031-omap-overo-Add-opp-init.patch \
+ \
+ file://beagle/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch \
+ file://beagle/0002-OMAP3-beagle-add-support-for-expansionboards.patch \
+ file://beagle/0003-OMAP3-beagle-add-MADC-support.patch \
+ file://beagle/0004-OMAP3-beagle-add-regulators-for-camera-interface.patch \
+ file://beagle/0005-OMAP3-beagle-HACK-add-in-1GHz-OPP.patch \
+ \
+ file://camera/0001-Add-support-for-mt9p031-Aptina-Micron-sensor.patch \
+ file://camera/0002-v4l-Add-mt9v032-sensor-driver.patch \
+ file://camera/0003-Add-support-for-mt9p031-LI-5M03-module-in-Beagleboar.patch \
+ \
+ file://pm/linux-omap-2.6.39-ti-pm/0001-OMAP3-voltage-remove-spurious-pr_notice-for-debugfs.patch \
+ file://pm/linux-omap-2.6.39-ti-pm/0002-OMAP4-PM-remove-redundant-ifdef-CONFIG_PM.patch \
+ file://pm/linux-omap-2.6.39-ti-pm/0003-OMAP3-smartreflex-fix-sr_late_init-error-path-in-pro.patch \
+ file://pm/linux-omap-2.6.39-ti-pm/0004-OMAP3-smartreflex-request-the-memory-region.patch \
+ file://pm/linux-omap-2.6.39-ti-pm/0005-OMAP3-smartreflex-fix-ioremap-leak-on-probe-error.patch \
+ file://pm/linux-omap-2.6.39-ti-pm/0006-OMAP3-smartreflex-delete-instance-from-sr_list-on-pr.patch \
+ file://pm/linux-omap-2.6.39-ti-pm/0007-OMAP3-smartreflex-delete-debugfs-entries-on-probe-er.patch \
+ file://pm/linux-omap-2.6.39-ti-pm/0008-OMAP3-cpuidle-remove-useless-SDP-specific-timings.patch \
+ file://pm/linux-omap-2.6.39-ti-pm/0009-OMAP3-SR-make-notify-independent-of-class.patch \
+ file://pm/linux-omap-2.6.39-ti-pm/0010-OMAP3-SR-disable-interrupt-by-default.patch \
+ file://pm/linux-omap-2.6.39-ti-pm/0011-OMAP3-SR-enable-disable-SR-only-on-need.patch \
+ file://pm/linux-omap-2.6.39-ti-pm/0012-OMAP3-SR-fix-cosmetic-indentation.patch \
+ \
+ file://pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0001-OMAP-CPUfreq-ensure-driver-initializes-after-cpufreq.patch \
+ file://pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0002-OMAP-CPUfreq-ensure-policy-is-fully-initialized.patch \
+ file://pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0003-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch \
+ file://pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0004-OMAP-PM-CPUFREQ-Fix-conditional-compilation.patch \
+ file://pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0005-cpufreq-fixup-after-new-OPP-layer-merged.patch \
+ file://pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0006-OMAP-cpufreq-Split-OMAP1-and-OMAP2PLUS-CPUfreq-drive.patch \
+ file://pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0007-OMAP2PLUS-cpufreq-Add-SMP-support-to-cater-OMAP4430.patch \
+ file://pm/linux-omap-2.6.39-ti-pm-wip-cpufreq/0008-OMAP2PLUS-cpufreq-Fix-typo-when-attempting-to-set-mp.patch \
+ \
+ file://pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-hotplug/0001-cpufreq-helpers-for-walking-the-frequency-table.patch \
+ file://pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-hotplug/0002-cpufreq-introduce-hotplug-governor.patch \
+ \
+ file://pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0001-OMAP2-cpufreq-free-up-table-on-exit.patch \
+ file://pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0002-OMAP2-cpufreq-handle-invalid-cpufreq-table.patch \
+ file://pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0003-OMAP2-cpufreq-minor-comment-cleanup.patch \
+ file://pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0004-OMAP2-cpufreq-use-clk_init_cpufreq_table-if-OPPs-not.patch \
+ file://pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0005-OMAP2-cpufreq-use-cpufreq_frequency_table_target.patch \
+ file://pm/linux-omap-2.6.39-ti-pm-wip-cpufreq-fixes/0006-OMAP2-cpufreq-fix-freq_table-leak.patch \
+ \
+ file://pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0001-OMAP2-clockdomain-Add-an-api-to-read-idle-mode.patch \
+ file://pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0002-OMAP2-clockdomain-Add-SoC-support-for-clkdm_is_idle.patch \
+ file://pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0003-OMAP2-PM-Initialise-sleep_switch-to-a-non-valid-valu.patch \
+ file://pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0004-OMAP2-PM-idle-clkdms-only-if-already-in-idle.patch \
+ file://pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0005-OMAP2-hwmod-Follow-the-recomended-PRCM-sequence.patch \
+ file://pm/linux-omap-2.6.39-ti-pm-wip-cpuidle/0006-OMAP-Serial-Check-wk_st-only-if-present.patch \
+ "
+
+SRC_URI_append_beagleboard = " file://logo_linux_clut224.ppm \
+"
+
+S = "${WORKDIR}/git"
+
diff --git a/recipes/linux/linux-openmoko.inc b/recipes/linux/linux-openmoko.inc
index 652f442d34..dedd27df3d 100644
--- a/recipes/linux/linux-openmoko.inc
+++ b/recipes/linux/linux-openmoko.inc
@@ -81,8 +81,8 @@ elif test "empty$has_mtdblock" != "empty" -o "empty$has_ubi" != "empty"; then
exit 1
fi
- ${bindir}/flash_eraseall $MTD_KERNEL_PARTITION
- ${bindir}/nandwrite -p $MTD_KERNEL_PARTITION /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}
+ ${sbindir}/flash_eraseall $MTD_KERNEL_PARTITION
+ ${sbindir}/nandwrite -p $MTD_KERNEL_PARTITION /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}
else
touch ${sysconfdir}/default/flashkernel
fi
diff --git a/recipes/linux/linux-openmoko_2.6.34.bb b/recipes/linux/linux-openmoko_2.6.34.bb
index 9da7bf8500..a83ee175ef 100644
--- a/recipes/linux/linux-openmoko_2.6.34.bb
+++ b/recipes/linux/linux-openmoko_2.6.34.bb
@@ -2,5 +2,5 @@ require linux_${PV}.bb
require linux-openmoko.inc
# just for upgrade path in 2.6.34
KERNEL_RELEASE = "2.6.34.8"
-OM-PR = "17"
+OM-PR = "18"
PKGV = "${KERNEL_RELEASE}-oe${OM-PR}"
diff --git a/recipes/linux/linux-openmoko_2.6.37.bb b/recipes/linux/linux-openmoko_2.6.37.bb
index 633349ecc1..24ba7df25b 100644
--- a/recipes/linux/linux-openmoko_2.6.37.bb
+++ b/recipes/linux/linux-openmoko_2.6.37.bb
@@ -1,3 +1,3 @@
require linux_${PV}.bb
require linux-openmoko.inc
-OM-PR = "1"
+OM-PR = "4"
diff --git a/recipes/linux/linux-openmoko_2.6.39.bb b/recipes/linux/linux-openmoko_2.6.39.bb
new file mode 100644
index 0000000000..69e1d6a9d6
--- /dev/null
+++ b/recipes/linux/linux-openmoko_2.6.39.bb
@@ -0,0 +1,3 @@
+require linux_${PV}.bb
+require linux-openmoko.inc
+OM-PR = "3"
diff --git a/recipes/linux/linux.inc b/recipes/linux/linux.inc
index 24e3406e96..beecf5c11d 100644
--- a/recipes/linux/linux.inc
+++ b/recipes/linux/linux.inc
@@ -254,6 +254,12 @@ do_devicetree_image() {
addtask devicetree_image after do_install before do_package do_deploy
+do_savedefconfig() {
+ oe_runmake savedefconfig
+}
+
+addtask savedefconfig after do_configure
+
pkg_postinst_kernel-devicetree () {
cd /${KERNEL_IMAGEDEST}; update-alternatives --install /${KERNEL_IMAGEDEST}/devicetree devicetree devicetree-${KERNEL_VERSION} ${KERNEL_PRIORITY} || true
}
diff --git a/recipes/linux/linux/akita/defconfig b/recipes/linux/linux/akita/defconfig
index e6a38adda7..43b22dc597 100644
--- a/recipes/linux/linux/akita/defconfig
+++ b/recipes/linux/linux/akita/defconfig
@@ -85,9 +85,21 @@ CONFIG_IRNET=m
CONFIG_IRCOMM=m
CONFIG_PXA_FICP=m
CONFIG_BT=m
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=m
+CONFIG_BT_HCIBTUSB=m
+CONFIG_BT_HCIBTSDIO=m
CONFIG_BT_HCIUART=m
CONFIG_BT_HCIUART_H4=y
CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIUART_ATH3K=y
+CONFIG_BT_HCIUART_LL=y
CONFIG_BT_HCIBCM203X=m
CONFIG_BT_HCIBPA10X=m
CONFIG_BT_HCIBFUSB=m
@@ -96,6 +108,9 @@ CONFIG_BT_HCIBT3C=m
CONFIG_BT_HCIBLUECARD=m
CONFIG_BT_HCIBTUART=m
CONFIG_BT_HCIVHCI=m
+CONFIG_BT_MRVL=m
+CONFIG_BT_MRVL_SDIO=m
+CONFIG_BT_ATH3K=m
CONFIG_CFG80211=m
# CONFIG_CFG80211_DEFAULT_PS is not set
CONFIG_MAC80211=m
@@ -159,7 +174,7 @@ CONFIG_KEYBOARD_MATRIX=y
CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_ADS7846=y
CONFIG_INPUT_MISC=y
-CONFIG_INPUT_UINPUT=y
+CONFIG_INPUT_UINPUT=m
# CONFIG_SERIO is not set
# CONFIG_LEGACY_PTYS is not set
CONFIG_SERIAL_8250=m
@@ -188,6 +203,9 @@ CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
CONFIG_FONTS=y
CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
CONFIG_SOUND=m
CONFIG_SND=m
CONFIG_SND_SEQUENCER=m
diff --git a/recipes/linux/linux/c7x0/defconfig b/recipes/linux/linux/c7x0/defconfig
index 54e773e52c..4e00cd764c 100644
--- a/recipes/linux/linux/c7x0/defconfig
+++ b/recipes/linux/linux/c7x0/defconfig
@@ -86,9 +86,21 @@ CONFIG_IRNET=m
CONFIG_IRCOMM=m
CONFIG_PXA_FICP=m
CONFIG_BT=m
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=m
+CONFIG_BT_HCIBTUSB=m
+CONFIG_BT_HCIBTSDIO=m
CONFIG_BT_HCIUART=m
CONFIG_BT_HCIUART_H4=y
CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIUART_ATH3K=y
+CONFIG_BT_HCIUART_LL=y
CONFIG_BT_HCIBCM203X=m
CONFIG_BT_HCIBPA10X=m
CONFIG_BT_HCIBFUSB=m
@@ -97,6 +109,9 @@ CONFIG_BT_HCIBT3C=m
CONFIG_BT_HCIBLUECARD=m
CONFIG_BT_HCIBTUART=m
CONFIG_BT_HCIVHCI=m
+CONFIG_BT_MRVL=m
+CONFIG_BT_MRVL_SDIO=m
+CONFIG_BT_ATH3K=m
CONFIG_CFG80211=m
# CONFIG_CFG80211_DEFAULT_PS is not set
CONFIG_MAC80211=m
@@ -160,7 +175,7 @@ CONFIG_KEYBOARD_MATRIX=y
CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_ADS7846=y
CONFIG_INPUT_MISC=y
-CONFIG_INPUT_UINPUT=y
+CONFIG_INPUT_UINPUT=m
# CONFIG_SERIO is not set
# CONFIG_LEGACY_PTYS is not set
CONFIG_SERIAL_8250=m
@@ -187,6 +202,9 @@ CONFIG_DISPLAY_SUPPORT=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FONTS=y
CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
CONFIG_SOUND=m
CONFIG_SND=m
CONFIG_SND_SEQUENCER=m
diff --git a/recipes/linux/linux/collie/defconfig b/recipes/linux/linux/collie/defconfig
index f7569d04c6..4711f095ae 100644
--- a/recipes/linux/linux/collie/defconfig
+++ b/recipes/linux/linux/collie/defconfig
@@ -84,14 +84,27 @@ CONFIG_IRLAN=m
CONFIG_IRNET=m
CONFIG_IRCOMM=m
CONFIG_BT=m
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=m
+CONFIG_BT_HCIBTSDIO=m
CONFIG_BT_HCIUART=m
CONFIG_BT_HCIUART_H4=y
CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIUART_ATH3K=y
+CONFIG_BT_HCIUART_LL=y
CONFIG_BT_HCIDTL1=m
CONFIG_BT_HCIBT3C=m
CONFIG_BT_HCIBLUECARD=m
CONFIG_BT_HCIBTUART=m
CONFIG_BT_HCIVHCI=m
+CONFIG_BT_MRVL=m
+CONFIG_BT_MRVL_SDIO=m
CONFIG_CFG80211=m
# CONFIG_CFG80211_DEFAULT_PS is not set
CONFIG_MAC80211=m
@@ -157,7 +170,7 @@ CONFIG_KEYBOARD_LOCOMO=y
CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_ADS7846=y
CONFIG_INPUT_MISC=y
-CONFIG_INPUT_UINPUT=y
+CONFIG_INPUT_UINPUT=m
# CONFIG_SERIO is not set
# CONFIG_LEGACY_PTYS is not set
CONFIG_SERIAL_8250=m
@@ -187,6 +200,9 @@ CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
CONFIG_FONTS=y
CONFIG_FONT_8x8=y
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
CONFIG_SOUND=m
CONFIG_SND=m
CONFIG_SND_SEQUENCER=m
diff --git a/recipes/linux/linux/poodle/defconfig b/recipes/linux/linux/poodle/defconfig
index fd992f2b21..94c8702fcb 100644
--- a/recipes/linux/linux/poodle/defconfig
+++ b/recipes/linux/linux/poodle/defconfig
@@ -86,9 +86,21 @@ CONFIG_IRNET=m
CONFIG_IRCOMM=m
CONFIG_PXA_FICP=m
CONFIG_BT=m
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=m
+CONFIG_BT_HCIBTUSB=m
+CONFIG_BT_HCIBTSDIO=m
CONFIG_BT_HCIUART=m
CONFIG_BT_HCIUART_H4=y
CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIUART_ATH3K=y
+CONFIG_BT_HCIUART_LL=y
CONFIG_BT_HCIBCM203X=m
CONFIG_BT_HCIBPA10X=m
CONFIG_BT_HCIBFUSB=m
@@ -97,6 +109,9 @@ CONFIG_BT_HCIBT3C=m
CONFIG_BT_HCIBLUECARD=m
CONFIG_BT_HCIBTUART=m
CONFIG_BT_HCIVHCI=m
+CONFIG_BT_MRVL=m
+CONFIG_BT_MRVL_SDIO=m
+CONFIG_BT_ATH3K=m
CONFIG_CFG80211=m
# CONFIG_CFG80211_DEFAULT_PS is not set
CONFIG_MAC80211=m
@@ -160,7 +175,7 @@ CONFIG_KEYBOARD_LOCOMO=y
CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_ADS7846=y
CONFIG_INPUT_MISC=y
-CONFIG_INPUT_UINPUT=y
+CONFIG_INPUT_UINPUT=m
# CONFIG_SERIO is not set
# CONFIG_LEGACY_PTYS is not set
CONFIG_SERIAL_8250=m
@@ -189,6 +204,9 @@ CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
CONFIG_FONTS=y
CONFIG_FONT_8x8=y
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
CONFIG_SOUND=m
CONFIG_SND=m
CONFIG_SND_SEQUENCER=m
diff --git a/recipes/linux/linux/spitz/defconfig b/recipes/linux/linux/spitz/defconfig
index e6a38adda7..43b22dc597 100644
--- a/recipes/linux/linux/spitz/defconfig
+++ b/recipes/linux/linux/spitz/defconfig
@@ -85,9 +85,21 @@ CONFIG_IRNET=m
CONFIG_IRCOMM=m
CONFIG_PXA_FICP=m
CONFIG_BT=m
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=m
+CONFIG_BT_HCIBTUSB=m
+CONFIG_BT_HCIBTSDIO=m
CONFIG_BT_HCIUART=m
CONFIG_BT_HCIUART_H4=y
CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIUART_ATH3K=y
+CONFIG_BT_HCIUART_LL=y
CONFIG_BT_HCIBCM203X=m
CONFIG_BT_HCIBPA10X=m
CONFIG_BT_HCIBFUSB=m
@@ -96,6 +108,9 @@ CONFIG_BT_HCIBT3C=m
CONFIG_BT_HCIBLUECARD=m
CONFIG_BT_HCIBTUART=m
CONFIG_BT_HCIVHCI=m
+CONFIG_BT_MRVL=m
+CONFIG_BT_MRVL_SDIO=m
+CONFIG_BT_ATH3K=m
CONFIG_CFG80211=m
# CONFIG_CFG80211_DEFAULT_PS is not set
CONFIG_MAC80211=m
@@ -159,7 +174,7 @@ CONFIG_KEYBOARD_MATRIX=y
CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_TOUCHSCREEN_ADS7846=y
CONFIG_INPUT_MISC=y
-CONFIG_INPUT_UINPUT=y
+CONFIG_INPUT_UINPUT=m
# CONFIG_SERIO is not set
# CONFIG_LEGACY_PTYS is not set
CONFIG_SERIAL_8250=m
@@ -188,6 +203,9 @@ CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
CONFIG_FONTS=y
CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
CONFIG_SOUND=m
CONFIG_SND=m
CONFIG_SND_SEQUENCER=m
diff --git a/recipes/linux/linux/tosa/defconfig b/recipes/linux/linux/tosa/defconfig
index a7ecfc15cf..4b72d03f85 100644
--- a/recipes/linux/linux/tosa/defconfig
+++ b/recipes/linux/linux/tosa/defconfig
@@ -86,9 +86,21 @@ CONFIG_IRNET=m
CONFIG_IRCOMM=m
CONFIG_PXA_FICP=m
CONFIG_BT=m
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=m
+CONFIG_BT_HCIBTUSB=m
+CONFIG_BT_HCIBTSDIO=m
CONFIG_BT_HCIUART=m
CONFIG_BT_HCIUART_H4=y
CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIUART_ATH3K=y
+CONFIG_BT_HCIUART_LL=y
CONFIG_BT_HCIBCM203X=m
CONFIG_BT_HCIBPA10X=m
CONFIG_BT_HCIBFUSB=m
@@ -97,6 +109,9 @@ CONFIG_BT_HCIBT3C=m
CONFIG_BT_HCIBLUECARD=m
CONFIG_BT_HCIBTUART=m
CONFIG_BT_HCIVHCI=m
+CONFIG_BT_MRVL=m
+CONFIG_BT_MRVL_SDIO=m
+CONFIG_BT_ATH3K=m
CONFIG_CFG80211=m
# CONFIG_CFG80211_DEFAULT_PS is not set
CONFIG_MAC80211=m
@@ -160,7 +175,7 @@ CONFIG_KEYBOARD_MATRIX=y
# CONFIG_INPUT_MOUSE is not set
CONFIG_INPUT_TOUCHSCREEN=y
CONFIG_INPUT_MISC=y
-CONFIG_INPUT_UINPUT=y
+CONFIG_INPUT_UINPUT=m
# CONFIG_SERIO is not set
# CONFIG_LEGACY_PTYS is not set
CONFIG_SERIAL_8250=m
@@ -190,6 +205,9 @@ CONFIG_DISPLAY_SUPPORT=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FONTS=y
CONFIG_FONT_8x16=y
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
CONFIG_SOUND=m
CONFIG_SND=m
CONFIG_SND_SEQUENCER=m
diff --git a/recipes/linux/linux_2.6.30.bb b/recipes/linux/linux_2.6.30.bb
index 432542b723..a49246cc99 100644
--- a/recipes/linux/linux_2.6.30.bb
+++ b/recipes/linux/linux_2.6.30.bb
@@ -1,7 +1,7 @@
require linux.inc
-PR = "r6"
-
+PR = "r7"
+AT91_EXPERIMENTAL = "4"
S = "${WORKDIR}/linux-${PV}"
# Mark archs/machines that this kernel supports
@@ -26,7 +26,16 @@ SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-${PV}.tar.bz2;name=ke
file://aufs2-30.patch \
file://defconfig"
-SRC_URI_at91 = " \
+AT91_EXPERIMENTAL_4 = " \
+ ${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-${PV}.tar.bz2;name=kernel \
+ http://maxim.org.za/AT91RM9200/2.6/${PV}-at91.patch.gz;apply=no;name=at91patch \
+ ftp://www.at91.com/pub/linux/${PV}-at91/${PV}-at91-exp.${AT91_EXPERIMENTAL}.tar.gz;apply=no;name=at91exp${AT91_EXPERIMENTAL} \
+ file://at91/exp.4/0001-Configurable-partition-size.patch;apply=yes \
+ file://at91/exp.4/0002-mach-at91-KConfig-cleanup.patch;apply=yes \
+ http://linux.hd-wireless.se/pub/Linux/BuildSAM9M10EKES/2.6.30-at91-sdio-irq-support-both-slots.patch;apply=yes;name=owlwifi \
+ file://defconfig"
+
+AT91_EXPERIMENTAL_2 = " \
${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-${PV}.tar.bz2;name=kernel \
http://maxim.org.za/AT91RM9200/2.6/2.6.30-at91.patch.gz;apply=yes;name=at91patch \
ftp://www.at91.com/pub/buildroot/2.6.30-exp.2.patch.bz2;apply=yes;name=at91exp2 \
@@ -35,6 +44,41 @@ SRC_URI_at91 = " \
file://at91/linux-2.6.30-003-sam9m10g45ek.patch \
file://defconfig"
+at91sam_patch = " \
+ "
+
+SRC_URI_at91sam9m10ekes = "${AT91_EXPERIMENTAL_4}"
+SRC_URI_at91cap9stk = "${AT91_EXPERIMENTAL_4}"
+SRC_URI_at91 = "${AT91_EXPERIMENTAL_2}"
+
+SRC_URI_append_at91sam9260ek = ${at91sam_patch}
+SRC_URI_append_at91sam9261ek = ${at91sam_patch}
+SRC_URI_append_at91sam9263ek = ${at91sam_patch}
+SRC_URI_append_at91sam9g10ek = ${at91sam_patch}
+SRC_URI_append_at91sam9g20ek = ${at91sam_patch}
+SRC_URI_append_at91sam9g20ek_2mmc = ${at91sam_patch}
+SRC_URI_append_at91sam9g45ekes = ${at91sam_patch}
+SRC_URI_append_at91sam9m10ekes = ${at91sam_patch}
+SRC_URI_append_at91sam9m10g45ek = ${at91sam_patch}
+SRC_URI_append_at91sam9rlek = ${at91sam_patch}
+SRC_URI_append_at91sam9xeek = ${at91sam_patch}
+
+#do_patch_prepend_at91sam9m10ekes() {
+# bb.build.exec_func('do_apply_at91_exp_patch', d)
+#}
+
+addtask do_apply_at91_exp_patch before do_patch after do_unpack
+
+do_apply_at91_exp_patch () {
+ cd ${WORKDIR}
+ cd ${S}
+ cat ../${PV}-at91.patch | patch -p1
+ for f in `ls ../${PV}-at91-exp.${AT91_EXPERIMENTAL}/*.patch` ; do
+ cat $f | patch -p1
+ done
+}
+
+
SRC_URI_ronetix-pm9g45 = " \
${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-${PV}.tar.bz2;name=kernel \
${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/patch-${PV}.10.bz2;apply=yes;name=stablepatch \
@@ -69,5 +113,10 @@ SRC_URI[at91patch.md5sum] = "f13ab353b11329ce3d605b6f40e77fa6"
SRC_URI[at91patch.sha256sum] = "41991e8aa2e5fe8e5dfd47b1e5c446fa03c3ee96a5eae54fd6ec15d1d9afef30"
SRC_URI[at91exp2.md5sum] = "770c7a2bfb925111a8c0e0d4c8c4764e"
SRC_URI[at91exp2.sha256sum] = "58894965b253eae0c4caacedc3463cf186c18431ca0d71b767a3b36aa40ec388"
+SRC_URI[at91exp4.md5sum] = "9ca9901af101d9966a3acf80193bfd7d"
+SRC_URI[at91exp4.sha256sum] = "b948199be87cf9ba280ea649aa1b477b36344a44aae52fdc3bb56344adf73f76"
+
+SRC_URI[owlwifi.md5sum] = "5ead573ee187ebd723569ec54186e99a"
+SRC_URI[owlwifi.sha256sum] = "8ee739bf171e878bbd9a02113f3a6a5287a3653dec71e4c11515c2c890f31c62"
diff --git a/recipes/linux/linux_2.6.36.bb b/recipes/linux/linux_2.6.36.bb
index aea17dd18e..0e2f31a59e 100644
--- a/recipes/linux/linux_2.6.36.bb
+++ b/recipes/linux/linux_2.6.36.bb
@@ -1,10 +1,11 @@
require linux.inc
-PR = "r2"
+PR = "r4"
# Mark archs/machines that this kernel supports
DEFAULT_PREFERENCE = "-1"
DEFAULT_PREFERENCE_mx31ads = "1"
+DEFAULT_PREFERENCE_warpcomm = "1"
SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/${P}.tar.bz2;name=kernel \
${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/patch-${PV}.1.bz2;apply=yes;name=stablepatch \
@@ -12,7 +13,11 @@ SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/${P}.tar.bz2;name=kernel \
SRC_URI_append_mx31ads = "file://0001-add-missing-include.patch"
+SRC_URI_append_warpcomm = "http://www.warpcomm.org/downloads/tk71/20101028/linux-2.6.36-tk71.diff;apply=yes;name=warpcommpatch"
+
SRC_URI[kernel.md5sum] = "61f3739a73afb6914cb007f37fb09b62"
SRC_URI[kernel.sha256sum] = "15a076d1a435a6bf8e92834eba4b390b4ec094ce06d47f89d071ca9e5788ce04"
SRC_URI[stablepatch.md5sum] = "dd38a6caf08df2822f93541ee95aed7d"
SRC_URI[stablepatch.sha256sum] = "0312883792d9b6312684800c7e9c108571a0da39fbb0a4fb9beb1362b7446c98"
+SRC_URI[warpcommpatch.md5sum] = "d8970406654afbeab4c1e4fd648b499c"
+SRC_URI[warpcommpatch.sha256sum] = "7ec088d01b7d96b712e1477630bdb5f67b146bf298d9f80f375b1fa6aea7902d"
diff --git a/recipes/linux/linux_2.6.37.bb b/recipes/linux/linux_2.6.37.bb
index e3d6c4ec28..4e5d8d5f87 100644
--- a/recipes/linux/linux_2.6.37.bb
+++ b/recipes/linux/linux_2.6.37.bb
@@ -16,13 +16,11 @@ DEFAULT_PREFERENCE_qemumipsel = "1"
DEFAULT_PREFERENCE_qemumips64 = "1"
DEFAULT_PREFERENCE_visstrim_m10 = "1"
DEFAULT_PREFERENCE_ben-nanonote = "1"
-
-# needs more testing before making it new default
-# DEFAULT_PREFERENCE_om-gta02 = "1"
-# DEFAULT_PREFERENCE_om-gta01 = "1"
+DEFAULT_PREFERENCE_om-gta02 = "1"
+DEFAULT_PREFERENCE_om-gta01 = "1"
SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-${PV}.tar.bz2;name=kernel \
- ${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/patch-${PV}.3.bz2;apply=yes;name=stablepatch \
+ ${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/patch-${PV}.6.bz2;apply=yes;name=stablepatch \
file://defconfig "
SRC_URI_append_ben-nanonote = " \
@@ -42,5 +40,5 @@ SRC_URI_append_om-gta01 = " \
SRC_URI[kernel.md5sum] = "c8ee37b4fdccdb651e0603d35350b434"
SRC_URI[kernel.sha256sum] = "edbf091805414739cf57a3bbfeba9e87f5e74f97e38f04d12060e9e0c71e383a"
-SRC_URI[stablepatch.md5sum] = "c0a38dd3b5bad43d5f5d07ed0fcf3692"
-SRC_URI[stablepatch.sha256sum] = "af6ccb6c85db09e78a85657b1013b2aa1399ef252ce552aafcf25684e6e5ad98"
+SRC_URI[stablepatch.md5sum] = "7bfe7642816c4e506eeb62b73f66c6f0"
+SRC_URI[stablepatch.sha256sum] = "33ca5cd06c715672969c459c21f441d7d6c74cba3304f981a40216e8094337bb"
diff --git a/recipes/linux/linux_2.6.38.bb b/recipes/linux/linux_2.6.38.bb
index 186f987022..825ccacb0a 100644
--- a/recipes/linux/linux_2.6.38.bb
+++ b/recipes/linux/linux_2.6.38.bb
@@ -1,6 +1,6 @@
require linux.inc
-PR = "r3"
+PR = "r4"
# Mark archs/machines that this kernel supports
DEFAULT_PREFERENCE = "-1"
@@ -14,7 +14,7 @@ DEFAULT_PREFERENCE_tosa = "1"
DEFAULT_PREFERENCE_ts72xx = "1"
SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-${PV}.tar.bz2;name=kernel \
- ${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/patch-${PV}.4.bz2;apply=yes;name=stablepatch \
+ ${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/patch-${PV}.5.bz2;apply=yes;name=stablepatch \
file://defconfig "
SRC_URI_append_akita = " file://${LOGO_SIZE}/logo_linux_clut224.ppm.bz2 "
@@ -51,5 +51,5 @@ SRC_URI_append_ts72xx = " \
SRC_URI[kernel.md5sum] = "7d471477bfa67546f902da62227fa976"
SRC_URI[kernel.sha256sum] = "72f0cfaefb8dc86b219d5a742dd0375332627641ecbdf5badd3158e2127b9304"
-SRC_URI[stablepatch.md5sum] = "6ef1279c7bd0078fc0fd50aa83e86203"
-SRC_URI[stablepatch.sha256sum] = "64abfd999ac9416db143293528f73a0b88ac287bf4d075556dc7859017d97687"
+SRC_URI[stablepatch.md5sum] = "c8f233d1d31030eb019ab391071e65c2"
+SRC_URI[stablepatch.sha256sum] = "46213fd83da87a066f4b6462c043149638bcaca423d6a932d8434e9d27c7140b"
diff --git a/recipes/linux/linux_2.6.39.bb b/recipes/linux/linux_2.6.39.bb
new file mode 100644
index 0000000000..8b450516dc
--- /dev/null
+++ b/recipes/linux/linux_2.6.39.bb
@@ -0,0 +1,34 @@
+require linux.inc
+
+# Mark archs/machines that this kernel supports
+DEFAULT_PREFERENCE = "-1"
+DEFAULT_PREFERENCE_akita = "1"
+DEFAULT_PREFERENCE_c7x0 = "1"
+DEFAULT_PREFERENCE_collie = "1"
+DEFAULT_PREFERENCE_poodle = "1"
+DEFAULT_PREFERENCE_spitz = "1"
+DEFAULT_PREFERENCE_tosa = "1"
+#DEFAULT_PREFERENCE_om-gta01 = "1"
+#DEFAULT_PREFERENCE_om-gta02 = "1"
+
+SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-${PV}.tar.bz2;name=kernel \
+ file://defconfig "
+
+SRC_URI_append_om-gta01 = " \
+ file://openmoko.patch \
+ file://shr.patch \
+ "
+SRC_URI_append_om-gta02 = " \
+ file://openmoko.patch \
+ file://shr.patch \
+ "
+
+SRC_URI_append_akita = " file://${LOGO_SIZE}/logo_linux_clut224.ppm.bz2 "
+SRC_URI_append_c7x0 = " file://${LOGO_SIZE}/logo_linux_clut224.ppm.bz2 "
+SRC_URI_append_collie = " file://${LOGO_SIZE}/logo_linux_clut224.ppm.bz2 "
+SRC_URI_append_poodle = " file://${LOGO_SIZE}/logo_linux_clut224.ppm.bz2 "
+SRC_URI_append_tosa = " file://${LOGO_SIZE}/logo_linux_clut224.ppm.bz2 "
+SRC_URI_append_spitz = " file://${LOGO_SIZE}/logo_linux_clut224.ppm.bz2 "
+
+SRC_URI[kernel.md5sum] = "1aab7a741abe08d42e8eccf20de61e05"
+SRC_URI[kernel.sha256sum] = "584d17f2a3ee18a9501d7ff36907639e538cfdba4529978b8550c461d45c61f6"
diff --git a/recipes/llvm/llvm2.7/include-fixes.patch b/recipes/llvm/llvm2.7/include-fixes.patch
new file mode 100644
index 0000000000..2783f4d5b6
--- /dev/null
+++ b/recipes/llvm/llvm2.7/include-fixes.patch
@@ -0,0 +1,55 @@
+Fixes stricter includes which result in failures like this:
+error: 'ptrdiff_t' does not name a type
+
+Upstream-Status: Unknown, not submitted as 2.7 is very old
+
+Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
+
+Index: llvm-2.7/include/llvm/ADT/SmallVector.h
+===================================================================
+--- llvm-2.7.orig/include/llvm/ADT/SmallVector.h 2011-05-08 17:07:09.000000000 +0200
++++ llvm-2.7/include/llvm/ADT/SmallVector.h 2011-05-08 17:07:25.000000000 +0200
+@@ -19,6 +19,7 @@
+ #include <cassert>
+ #include <cstring>
+ #include <memory>
++#include <cstddef>
+
+ #ifdef _MSC_VER
+ namespace std {
+Index: llvm-2.7/include/llvm/ADT/ilist.h
+===================================================================
+--- llvm-2.7.orig/include/llvm/ADT/ilist.h 2011-05-08 20:24:57.000000000 +0200
++++ llvm-2.7/include/llvm/ADT/ilist.h 2011-05-08 20:25:12.000000000 +0200
+@@ -40,6 +40,7 @@
+
+ #include <cassert>
+ #include <iterator>
++#include <cstddef>
+
+ namespace llvm {
+
+Index: llvm-2.7/include/llvm/Use.h
+===================================================================
+--- llvm-2.7.orig/include/llvm/Use.h 2011-05-08 20:28:21.000000000 +0200
++++ llvm-2.7/include/llvm/Use.h 2011-05-08 20:28:37.000000000 +0200
+@@ -28,6 +28,7 @@
+ #include "llvm/Support/Casting.h"
+ #include "llvm/ADT/PointerIntPair.h"
+ #include <iterator>
++#include <cstddef>
+
+ namespace llvm {
+
+Index: llvm-2.7/include/llvm/ADT/DenseMap.h
+===================================================================
+--- llvm-2.7.orig/include/llvm/ADT/DenseMap.h 2011-05-08 20:32:11.000000000 +0200
++++ llvm-2.7/include/llvm/ADT/DenseMap.h 2011-05-08 20:32:21.000000000 +0200
+@@ -23,6 +23,7 @@
+ #include <utility>
+ #include <cassert>
+ #include <cstring>
++#include <cstddef>
+
+ namespace llvm {
+
diff --git a/recipes/llvm/llvm2.7_2.7.bb b/recipes/llvm/llvm2.7_2.7.bb
index 4353622323..7d56e7dd3a 100644
--- a/recipes/llvm/llvm2.7_2.7.bb
+++ b/recipes/llvm/llvm2.7_2.7.bb
@@ -1,6 +1,6 @@
require llvm.inc
-PR = "r9"
+PR = "r11"
DEPENDS = "llvm-common llvm2.7-native"
@@ -15,6 +15,7 @@ SRC_URI += "\
file://r104652-VFPLoadStoreMultiple.patch \
file://r104653-BFC-BFI.patch \
file://rawMOVLRPC.patch \
+ file://include-fixes.patch \
"
LLVM_RELEASE = "2.7"
diff --git a/recipes/lm_sensors/lmsensors-apps_3.2.0.bb b/recipes/lm_sensors/lmsensors-apps_3.2.0.bb
index ea2ea8a175..ea75b35be9 100644
--- a/recipes/lm_sensors/lmsensors-apps_3.2.0.bb
+++ b/recipes/lm_sensors/lmsensors-apps_3.2.0.bb
@@ -2,23 +2,26 @@ DESCRIPTION = "Hardware health monitoring applications"
HOMEPAGE = "http://www.lm-sensors.org/"
DEPENDS = "sysfsutils virtual/libiconv"
LICENSE = "GPL"
+PR = "r1"
+DEPENDS = "bison-native flex-native"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
-SRC_URI = "http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-${PV}.tar.bz2 \
-"
+SRC_URI = "http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-${PV}.tar.bz2"
SRC_URI[md5sum] = "829d88fb09d67723fbf42853eb84d1fd"
SRC_URI[sha256sum] = "bde7e1d8b473bca6528694b696668c4cd0a28515aef36b961e4f7d8a6b47e581"
S = "${WORKDIR}/lm_sensors-${PV}"
-export PREFIX="${prefix}"
+EXTRA_OEMAKE = 'LINUX=${STAGING_KERNEL_DIR} EXLDFLAGS="${LDFLAGS}" \
+ MACHINE=${TARGET_ARCH} PREFIX=${prefix} CC="${CC}" AR="${AR}"'
do_compile() {
- oe_runmake user LINUX=${STAGING_KERNEL_DIR} EXLDFLAGS="${LDFLAGS}" PROG_EXTRA=sensors MACHINE=${TARGET_ARCH}
+ oe_runmake user PROG_EXTRA=sensors
}
do_install() {
- oe_runmake user_install EXLDFLAGS="${LDFLAGS}" DESTDIR=${D}
+ oe_runmake user_install DESTDIR=${D}
# move manuals into proper place
install -d ${D}${mandir}
@@ -40,4 +43,3 @@ FILES_libsensors = "${libdir}/libsensors.so.*"
FILES_libsensors-dbg += "${libdir}/.debug"
FILES_libsensors-dev = "${libdir}/libsensors.so ${libdir}/libsensors.a ${includedir}"
FILES_libsensors-doc = "${mandir}/man3"
-
diff --git a/recipes/lmbench/lmbench-3.0-a9/obey-ranlib.patch b/recipes/lmbench/lmbench-3.0-a9/obey-ranlib.patch
new file mode 100644
index 0000000000..5ce6e15a63
--- /dev/null
+++ b/recipes/lmbench/lmbench-3.0-a9/obey-ranlib.patch
@@ -0,0 +1,25 @@
+---
+ src/Makefile | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+Index: lmbench-3.0-a9/src/Makefile
+===================================================================
+--- lmbench-3.0-a9.orig/src/Makefile
++++ lmbench-3.0-a9/src/Makefile
+@@ -38,6 +38,7 @@ CC=`../scripts/compiler`
+ MAKE=`../scripts/make`
+ AR=ar
+ ARCREATE=cr
++RANLIB=ranlib
+
+ # base of installation location
+ BASE=/usr/local
+@@ -217,7 +218,7 @@ $O/lmbench : ../scripts/lmbench version.
+ $O/lmbench.a: $(LIBOBJS)
+ /bin/rm -f $O/lmbench.a
+ $(AR) $(ARCREATE) $O/lmbench.a $(LIBOBJS)
+- -ranlib $O/lmbench.a
++ -$(RANLIB) $O/lmbench.a
+
+ $O/lib_timing.o : lib_timing.c $(INCS)
+ $(COMPILE) -c lib_timing.c -o $O/lib_timing.o
diff --git a/recipes/lmbench/lmbench_3.0-a9.bb b/recipes/lmbench/lmbench_3.0-a9.bb
index ce6d1a80c0..a430a59b6b 100644
--- a/recipes/lmbench/lmbench_3.0-a9.bb
+++ b/recipes/lmbench/lmbench_3.0-a9.bb
@@ -3,20 +3,21 @@ DESCRIPTION = "Tools for performance analysis."
LICENSE = "GPL"
RDEPENDS_${PN} = "debianutils"
-PR = "r4"
+PR = "r6"
inherit autotools
SRC_URI = "${SOURCEFORGE_MIRROR}/lmbench/lmbench-${PV}.tgz \
file://lmbench-run \
file://rename-line-binary.patch \
- file://update-results-script.patch"
+ file://update-results-script.patch \
+ file://obey-ranlib.patch"
SRC_URI[md5sum] = "b3351a3294db66a72e2864a199d37cbf"
SRC_URI[sha256sum] = "cbd5777d15f44eab7666dcac418054c3c09df99826961a397d9acf43d8a2a551"
S = "${WORKDIR}/lmbench-${PV}"
-EXTRA_OEMAKE = 'CC="${CC}" AR="${AR}" CFLAGS="${CFLAGS}" \
+EXTRA_OEMAKE = 'CC="${CC}" AR="${AR}" RANLIB="${RANLIB}" CFLAGS="${CFLAGS}" \
LDFLAGS="${LDFLAGS}" LD="${LD}" OS="${TARGET_SYS}" \
TARGET="${TARGET_OS}" BASE="${prefix}"'
diff --git a/recipes/lttng/userspace-rcu_0.5.4.bb b/recipes/lttng/userspace-rcu_0.5.4.bb
new file mode 100644
index 0000000000..e0d98e522c
--- /dev/null
+++ b/recipes/lttng/userspace-rcu_0.5.4.bb
@@ -0,0 +1,3 @@
+require ${PN}.inc
+SRC_URI[md5sum] = "04147d24749be75200173859839207f7"
+SRC_URI[sha256sum] = "02aedbb16c16bd034e246d5c9637a9232be559c66fc2fe4eb28948e234bd89f1"
diff --git a/recipes/lttng/ust_0.12.bb b/recipes/lttng/ust_0.12.bb
new file mode 100644
index 0000000000..1efb8537dd
--- /dev/null
+++ b/recipes/lttng/ust_0.12.bb
@@ -0,0 +1,4 @@
+require ${PN}.inc
+
+SRC_URI[md5sum] = "fae6e324a56016658c5b83ec14ba0043"
+SRC_URI[sha256sum] = "215b05f47d0c9e3a2934926a7d14fa9c67025db917c3a1f641df40b08314ab0c"
diff --git a/recipes/lynx/files/locale-charset.patch b/recipes/lynx/files/locale-charset.patch
new file mode 100644
index 0000000000..7f1ffeeb2f
--- /dev/null
+++ b/recipes/lynx/files/locale-charset.patch
@@ -0,0 +1,13 @@
+Index: lynx2-8-7/lynx.cfg
+===================================================================
+--- lynx2-8-7.orig/lynx.cfg
++++ lynx2-8-7/lynx.cfg
+@@ -453,7 +453,7 @@ DEFAULT_INDEX_FILE:http://lynx.isc.org/
+ # happens to give useful values, but other implementations are not guaranteed
+ # to do this.
+ #LOCALE_CHARSET:FALSE
+-
++LOCALE_CHARSET:TRUE
+
+ .h2 ASSUME_CHARSET
+ # ASSUME_CHARSET changes the handling of documents which do not
diff --git a/recipes/lynx/lynx_2.8.7.bb b/recipes/lynx/lynx_2.8.7.bb
new file mode 100644
index 0000000000..f59dc9aa6f
--- /dev/null
+++ b/recipes/lynx/lynx_2.8.7.bb
@@ -0,0 +1,43 @@
+DESCRIPTION = "text web browser"
+SECTION = "console/network"
+DEPENDS = "ncurses openssl"
+LICENSE = "GPLv2"
+HOMEPAGE = "http://lynx.isc.org/"
+PR = "r0"
+S = "${WORKDIR}/${PN}${@bb.data.getVar('PV',d,1).replace('.', '-')}"
+
+# This URL should point to the latest tarball, but apparently does not:
+# http://lynx.isc.org/${PN}${PV}/${PN}${PV}.tar.bz2
+SRC_URI = "http://lynx.isc.org/current/${PN}${PV}rel.2.tar.bz2 \
+ file://locale-charset.patch"
+
+inherit autotools gettext
+
+EXTRA_OECONF += "--with-ssl=${STAGING_DIR_HOST}${layout_exec_prefix} --with-curses-dir=${STAGING_DIR_HOST}${layout_exec_prefix} --enable-nls --with-screen=ncursesw --enable-locale-charset --enable-ipv6 --enable-persistent-cookies"
+
+do_configure() {
+ # prevent import of ncursesw6-config from host system
+ # only ncurses-config (version 5) is available in the tree
+ sed -i 's/}6/}6-does-not-exist-in-oe/g' aclocal.m4 configure
+ # configure.in cannot be easily rebuilt
+ oe_runconf\
+ ac_cv_path_TELNET=${bindir}/telnet\
+ ac_cv_path_TN3270=no\
+ ac_cv_path_RLOGIN=${bindir}/rlogin\
+ ac_cv_path_MV=/bin/mv\
+ ac_cv_path_GZIP=/bin/gzip\
+ ac_cv_path_UNCOMPRESS=/bin/gunzip\
+ ac_cv_path_UNZIP=${bindir}/unzip\
+ ac_cv_path_BZIP2=${bindir}/bzip2\
+ ac_cv_path_TAR=/bin/tar\
+ ac_cv_path_COMPRESS=no\
+ ac_cv_path_RM=/bin/rm\
+ ac_cv_path_UUDECODE=${bindir}/uudecode\
+ ac_cv_path_UUDECODE=${bindir}/uudecode\
+ ac_cv_path_ZCAT=/bin/zcat\
+ ac_cv_path_ZIP=${bindir}/zip\
+ ac_cv_path_INSTALL=${bindir}/install
+}
+
+SRC_URI[md5sum] = "cb936aef812e4e463ab86cbbe14d4db9"
+SRC_URI[sha256sum] = "301bda96ad3cd5032805e8d5315a42061a11e472e3d3a7baee3a2879517ef627"
diff --git a/recipes/manufacturers/manufacturers_20031209.bb b/recipes/manufacturers/manufacturers_20031209.bb
index d2ec063584..e7dd48e74f 100644
--- a/recipes/manufacturers/manufacturers_20031209.bb
+++ b/recipes/manufacturers/manufacturers_20031209.bb
@@ -2,8 +2,9 @@ SECTION = "base"
DESCRIPTION = "Ethernet manufacturer database"
LICENSE = "PD"
SRCDATE = "${PV}"
+SRCREV = "ff794de4991efa6403b2368edba6eb4e63d8d449"
-PR = "r1"
+PR = "r2"
SRC_URI = "${OPIE_GIT};protocol=git;subpath=etc"
S = "${WORKDIR}/etc"
diff --git a/recipes/mozilla/firefox_3.6.8.bb b/recipes/mozilla/firefox_3.6.8.bb
index 348c8c0a4a..7fdda992d6 100644
--- a/recipes/mozilla/firefox_3.6.8.bb
+++ b/recipes/mozilla/firefox_3.6.8.bb
@@ -1,5 +1,7 @@
DEPENDS += "cairo sqlite3 libnotify"
-PR = "r3"
+DEPENDS_append_libc-uclibc = " virtual/libintl-native"
+
+PR = "r4"
# The .pc files below have "3.6" hardcoded, fix that before using them in a newer FF version!
SRC_URI = "ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${PV}/source/firefox-${PV}.source.tar.bz2;name=archive \
diff --git a/recipes/mtkbabel/files/fast-logging.patch b/recipes/mtkbabel/files/fast-logging.patch
deleted file mode 100644
index bc03732ec7..0000000000
--- a/recipes/mtkbabel/files/fast-logging.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-Many MTK devices allow to set distances from 0.1 m and time 0.1 km/h.
-Modify limits accordingly.
-FIXME: Entering non-integer values should be possible.
-Index: mtkbabel-0.8/mtkbabel
-===================================================================
---- mtkbabel-0.8.orig/mtkbabel 2009-01-20 21:27:52.000000000 +0000
-+++ mtkbabel-0.8/mtkbabel 2009-04-28 21:16:41.000000000 +0000
-@@ -241,7 +241,7 @@
- -p port Communication port, default: $port
- -R Recover from disabled log: erase data and reset recording criteria
- -r time:distance:speed Set logging criteria (zero to disable):
-- every 1-999 seconds, every 10-9999 meters, over 10-999 km/h
-+ every 1-999 seconds, every 1-9999 meters, over 1-999 km/h
- -s speed Serial port speed, default $baudrate baud
- -t Create a gpx file with tracks
- -v Print MTKBabel version and exit
-@@ -376,11 +376,11 @@
- packet_send(sprintf('PMTK182,1,3,%u', $time * 10));
- packet_wait('PMTK001,182,1,3');
- }
-- if (defined($distance) and (($distance >= 10 and $distance <= 9999) or ($distance == 0))) {
-+ if (defined($distance) and (($distance >= 1 and $distance <= 9999) or ($distance == 0))) {
- packet_send(sprintf('PMTK182,1,4,%u', $distance * 10));
- packet_wait('PMTK001,182,1,3');
- }
-- if (defined($speed) and (($speed >= 10 and $speed <= 999) or ($speed == 0))) {
-+ if (defined($speed) and (($speed >= 1 and $speed <= 999) or ($speed == 0))) {
- packet_send(sprintf('PMTK182,1,5,%u', $speed * 10));
- packet_wait('PMTK001,182,1,3');
- }
-Index: mtkbabel-0.8/mtkbabel.1
-===================================================================
---- mtkbabel-0.8.orig/mtkbabel.1 2009-01-20 21:27:52.000000000 +0000
-+++ mtkbabel-0.8/mtkbabel.1 2009-04-28 21:17:29.000000000 +0000
-@@ -124,8 +124,8 @@
- Recover from disabled log: erase data and reset recording criteria.
- .TP
- .BR "\-r" " time:distance:speed"
--Set logging criteria (zero to disable): every 1-999 seconds, every 10-9999
--meters, over 10-999 km/h.
-+Set logging criteria (zero to disable): every 1-999 seconds, every 1-9999
-+meters, over 1-999 km/h.
- .TP
- .BR "\-s" " speed"
- Serial port speed, default
diff --git a/recipes/mtkbabel/mtkbabel_0.8.bb b/recipes/mtkbabel/mtkbabel_0.8.2.bb
index f9029c560c..422cf8f497 100644
--- a/recipes/mtkbabel/mtkbabel_0.8.bb
+++ b/recipes/mtkbabel/mtkbabel_0.8.2.bb
@@ -3,12 +3,11 @@ DESCRIPTION = "Control program for GPS units using the MediaTek (MTK) chipset"
HOMEPAGE = "http://www.rigacci.org/wiki/doku.php/doc/appunti/hardware/gps_logger_i_blue_747"
LICENSE = "GPL"
PACKAGE_ARCH = "all"
-PR = "r2"
+PR = "r0"
RDEPENDS_${PN} = "libdevice-serialport-perl libtimedate-perl perl-module-file-basename perl-module-getopt-std"
-SRC_URI = "${SOURCEFORGE_MIRROR}/sourceforge/${PN}/${P}.tar.gz \
- file://fast-logging.patch"
+SRC_URI = "${SOURCEFORGE_MIRROR}/sourceforge/${PN}/${P}.tar.gz"
do_install() {
install -d ${D}${bindir}
@@ -17,5 +16,5 @@ do_install() {
install -m 0644 mtkbabel.1 ${D}${mandir}/man1/
}
-SRC_URI[md5sum] = "d5518b678bffb58ceeae898d950ee27e"
-SRC_URI[sha256sum] = "591597c0787822c9fd56c7a3da214e81edd3c98f32d16858221e02dfc0f63779"
+SRC_URI[md5sum] = "2c33519ac28afce2ba9da2db6fb83e47"
+SRC_URI[sha256sum] = "3c7b7959b7d0394a99fc95fd524b9a698c19bfe0b59188bd3cf7bb15f81ed6df"
diff --git a/recipes/mumpot/mumpot_0.4.bb b/recipes/mumpot/mumpot_0.6.bb
index 256229e8cc..c3de842d2b 100644
--- a/recipes/mumpot/mumpot_0.4.bb
+++ b/recipes/mumpot/mumpot_0.6.bb
@@ -3,7 +3,7 @@ HOMEPAGE = "http://www.mumpot.org/"
AUTHOR = "Andreas Kemnade"
SECTION = "x11/applications"
LICENSE = "GPLv3"
-DEPENDS = "gtk+ bluez-libs bzip2 libxml2 libpng jpeg"
+DEPENDS = "curl gtk+ bluez-libs bzip2 libxml2 libpng jpeg"
SRC_URI = "http://www.mumpot.org/download/mumpot-${PV}.tar.gz \
file://mumpot-tah.desktop \
@@ -19,5 +19,5 @@ do_install_append() {
install -m 0644 ${WORKDIR}/mumpot-cyclemap.desktop ${D}${datadir}/applications/mumpot-cyclemap.desktop
}
-SRC_URI[md5sum] = "52d1e64c63d70604f13985f1f326a802"
-SRC_URI[sha256sum] = "302bea9f0903fecf13ee0e9c24ed090203f2c77f7164a2a0f68c35fc8e1b9f10"
+SRC_URI[md5sum] = "9a0409c39e49c45cea3160c7ec7fe976"
+SRC_URI[sha256sum] = "aa921664bcb15115796607cc34f83caaaf2280685be512bd8a9250a44ae83bd4"
diff --git a/recipes/mypaint/files/scons-adapt.patch b/recipes/mypaint/files/scons-adapt.patch
new file mode 100644
index 0000000000..8152c34b87
--- /dev/null
+++ b/recipes/mypaint/files/scons-adapt.patch
@@ -0,0 +1,50 @@
+Author: Christian Charreyre <christian.charreyre@cioinfoindus.fr>
+
+Adapt scons to OE
+Index: mypaint-0.9.1/lib/SConscript
+===================================================================
+--- mypaint-0.9.1.orig/lib/SConscript 2011-04-21 11:31:29.000000000 +0200
++++ mypaint-0.9.1/lib/SConscript 2011-04-21 11:35:30.000000000 +0200
+@@ -1,5 +1,11 @@
+ Import('env')
+-import sys
++import sys, os
++env.Replace(SHCXX = os.environ['CXX'])
++env.Replace(SHLINK = os.environ['CXX'])
++env.Replace(LDMODULEFLAGS = os.environ['TARGET_LDFLAGS'])
++env.Append(LDMODULEFLAGS = ['-Wl,--hash-style=gnu'])
++env.Append(LDMODULEFLAGS = ['-shared'])
++env.Replace(PATH = os.environ['PATH'])
+
+ # For the record: I know that scons supports swig. But it doesn't scan for #include in the generated code.
+ #
+Index: mypaint-0.9.1/SConstruct
+===================================================================
+--- mypaint-0.9.1.orig/SConstruct 2011-03-04 15:44:59.000000000 +0100
++++ mypaint-0.9.1/SConstruct 2011-05-02 17:21:17.000000000 +0200
+@@ -11,13 +11,6 @@
+ if sys.platform == "win32":
+ python = 'python' # usually no versioned binaries on Windows
+
+-try:
+- import numpy
+-except ImportError:
+- print 'You need to have numpy installed.'
+- print
+- raise
+-
+ SConsignFile() # no .scsonsign into $PREFIX please
+
+ if sys.platform == "darwin":
+@@ -40,8 +33,9 @@
+
+ env.Append(CXXFLAGS=' -Wall -Wno-sign-compare -Wno-write-strings')
+
+-# Get the numpy include path (for numpy/arrayobject.h).
+-numpy_path = numpy.get_include()
++# Defines the numpy include path (for numpy/arrayobject.h).
++# This is specefic to OE, to avoid to build python-numpy-native
++numpy_path = os.environ['STAGING_DIR_TARGET']+os.environ['PYTHON_SITEPACKAGES_DIR']+'/numpy/core/include'
+ env.Append(CPPPATH=numpy_path)
+
+
diff --git a/recipes/mypaint/mypaint_0.9.1.bb b/recipes/mypaint/mypaint_0.9.1.bb
new file mode 100644
index 0000000000..378083763b
--- /dev/null
+++ b/recipes/mypaint/mypaint_0.9.1.bb
@@ -0,0 +1,37 @@
+DESCRIPTION = "drawing program with dynamic brushes for graphic tablets"
+HOMEPAGE = "http://mypaint.info/"
+SECTION = "x11/applications"
+PRIORITY = "optional"
+LICENSE = "GPLv2 GPLv2+ LGPLv2+"
+
+DEPENDS = "glib-2.0 libpng python-numpy swig-native"
+RDEPENDS_${PN} = "python-image python-json"
+
+SRC_URI = "http://download.gna.org/mypaint/${PN}-${PV}.tar.bz2 \
+ file://scons-adapt.patch \
+"
+
+SRC_URI[md5sum] = "6249a16359a438d6dc658f5765b35515"
+SRC_URI[sha256sum] = "407b599f62fb0d6e711fee57d22e64d3aec88825364fb5f7f73b9f0940aa7aed"
+
+inherit distutils scons
+
+do_compile() {
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_LIBDIR=${STAGING_LIBDIR} \
+ STAGING_DIR_TARGET=${STAGING_DIR_TARGET} \
+ PYTHON_SITEPACKAGES_DIR=${PYTHON_SITEPACKAGES_DIR} \
+ BUILD_SYS=${BUILD_SYS} \
+ HOST_SYS=${HOST_SYS} \
+ PATH=${PATH} scons_do_compile
+}
+
+do_install() {
+ STAGING_DIR_TARGET=${STAGING_DIR_TARGET} \
+ PYTHON_SITEPACKAGES_DIR=${PYTHON_SITEPACKAGES_DIR} \
+ BUILD_SYS=${BUILD_SYS} \
+ HOST_SYS=${HOST_SYS} \
+ scons_do_install
+}
+
+FILES_${PN} += "${datadir}"
diff --git a/recipes/navit/navit_svn.bb b/recipes/navit/navit_svn.bb
index 52c48dfd62..b0bf2d4e2b 100644
--- a/recipes/navit/navit_svn.bb
+++ b/recipes/navit/navit_svn.bb
@@ -1,8 +1,8 @@
require navit.inc
-SRCREV = "4345"
+SRCREV = "4503"
PV = "0.2.0+svnr${SRCPV}"
PR = "${INC_PR}.12"
S = "${WORKDIR}/navit"
-SRC_URI += "svn://anonymous@navit.svn.sourceforge.net/svnroot/navit/trunk;module=navit;proto=https "
+SRC_URI += "svn://anonymous@navit.svn.sourceforge.net/svnroot/navit/trunk;module=navit;proto=http "
diff --git a/recipes/netbase/netbase/bug20/interfaces b/recipes/netbase/netbase/bug20/interfaces
index 6e5f74eb45..ad6bfdd6ef 100644
--- a/recipes/netbase/netbase/bug20/interfaces
+++ b/recipes/netbase/netbase/bug20/interfaces
@@ -4,26 +4,11 @@
auto lo
iface lo inet loopback
-# Ethernet/RNDIS gadget (g_ether)
-# usbnet and static hwaddr for mac users
-auto usb0
-iface usb0 inet static
- hwaddress ether A2:80:F4:8A:3C:91
- address 10.10.10.10
- netmask 255.255.255.0
- gateway 10.10.10.1
-
# Wired interface
# BUGbase Ethernet which is built into kernel
# It is on USB but we rename it by udev rule
auto eth0
-iface eth0 inet dhcp
#
# wireless interface
-auto eth1
-iface eth1 inet dhcp
- wireless_mode managed
- wireless_essid any
- wpa-driver wext
- wpa-conf /etc/wpa_supplicant.conf
+auto wlan0
diff --git a/recipes/networkmanager/networkmanager/0002-respect-libnl-flags-also-in-dns-manager-vpn-manager-.patch b/recipes/networkmanager/networkmanager/0002-respect-libnl-flags-also-in-dns-manager-vpn-manager-.patch
new file mode 100644
index 0000000000..9378da4e11
--- /dev/null
+++ b/recipes/networkmanager/networkmanager/0002-respect-libnl-flags-also-in-dns-manager-vpn-manager-.patch
@@ -0,0 +1,72 @@
+From 80a0d581393d52d1c4047acefb8b855852b2e9d3 Mon Sep 17 00:00:00 2001
+From: Philip Balister <philip@opensdr.com>
+Date: Wed, 4 May 2011 18:24:49 -0400
+Subject: [PATCH 2/2] respect libnl flags also in dns manager, vpn manager, and modem manager
+
+Signed-off-by: Philip Balister <philip@balister.org>
+---
+ src/dns-manager/Makefile.am | 2 ++
+ src/modem-manager/Makefile.am | 2 ++
+ src/vpn-manager/Makefile.am | 2 ++
+ 3 files changed, 6 insertions(+), 0 deletions(-)
+
+diff --git a/src/dns-manager/Makefile.am b/src/dns-manager/Makefile.am
+index 7b5fc4f..b51f667 100644
+--- a/src/dns-manager/Makefile.am
++++ b/src/dns-manager/Makefile.am
+@@ -19,12 +19,14 @@ libdns_manager_la_SOURCES = \
+ nm-dns-utils.c
+
+ libdns_manager_la_CPPFLAGS = \
++ $(LIBNL_CFLAGS) \
+ $(DBUS_CFLAGS) \
+ $(GLIB_CFLAGS) \
+ -DLOCALSTATEDIR=\"$(localstatedir)\"
+
+ libdns_manager_la_LIBADD = \
+ $(top_builddir)/src/logging/libnm-logging.la \
++ $(LIBNL_LIBS) \
+ $(DBUS_LIBS) \
+ $(GLIB_LIBS)
+
+diff --git a/src/modem-manager/Makefile.am b/src/modem-manager/Makefile.am
+index 22ed809..8fb25b6 100644
+--- a/src/modem-manager/Makefile.am
++++ b/src/modem-manager/Makefile.am
+@@ -19,11 +19,13 @@ libmodem_manager_la_SOURCES = \
+ nm-modem-types.h
+
+ libmodem_manager_la_CPPFLAGS = \
++ $(LIBNL_CFLAGS) \
+ $(DBUS_CFLAGS)
+
+ libmodem_manager_la_LIBADD = \
+ $(top_builddir)/marshallers/libmarshallers.la \
+ $(top_builddir)/src/logging/libnm-logging.la \
++ $(LIBNL_LIBS) \
+ $(DBUS_LIBS)
+
+ nm-serial-device-glue.h: $(top_srcdir)/introspection/nm-device-serial.xml
+diff --git a/src/vpn-manager/Makefile.am b/src/vpn-manager/Makefile.am
+index 3b20661..ce99728 100644
+--- a/src/vpn-manager/Makefile.am
++++ b/src/vpn-manager/Makefile.am
+@@ -22,6 +22,7 @@ libvpn_manager_la_SOURCES = \
+ nm-vpn-connection.h
+
+ libvpn_manager_la_CPPFLAGS = \
++ $(LIBNL_CFLAGS) \
+ $(DBUS_CFLAGS) \
+ $(GLIB_CFLAGS) \
+ -DG_DISABLE_DEPRECATED
+@@ -30,6 +31,7 @@ libvpn_manager_la_LIBADD = \
+ $(top_builddir)/marshallers/libmarshallers.la \
+ $(top_builddir)/src/logging/libnm-logging.la \
+ $(top_builddir)/libnm-util/libnm-util.la \
++ $(LIBNL_LIBS) \
+ $(DBUS_LIBS) \
+ $(GLIB_LIBS)
+
+--
+1.7.3.4
+
diff --git a/recipes/networkmanager/networkmanager/0002-respect-libnl-flags-also-in-dns-manager.patch b/recipes/networkmanager/networkmanager/0002-respect-libnl-flags-also-in-dns-manager.patch
deleted file mode 100644
index ede777fab3..0000000000
--- a/recipes/networkmanager/networkmanager/0002-respect-libnl-flags-also-in-dns-manager.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From f7ff232d2c335eec5192b23861d8bfa2fd098425 Mon Sep 17 00:00:00 2001
-From: Philip Balister <philip@opensdr.com>
-Date: Wed, 4 May 2011 18:24:49 -0400
-Subject: [PATCH 2/2] respect-libnl-flags-also-in-dns-manager
-
-Signed-off-by: Philip Balister <philip@balister.org>
----
- src/dns-manager/Makefile.am | 2 ++
- 1 files changed, 2 insertions(+), 0 deletions(-)
-
-diff --git a/src/dns-manager/Makefile.am b/src/dns-manager/Makefile.am
-index 7b5fc4f..b51f667 100644
---- a/src/dns-manager/Makefile.am
-+++ b/src/dns-manager/Makefile.am
-@@ -19,12 +19,14 @@ libdns_manager_la_SOURCES = \
- nm-dns-utils.c
-
- libdns_manager_la_CPPFLAGS = \
-+ $(LIBNL_CFLAGS) \
- $(DBUS_CFLAGS) \
- $(GLIB_CFLAGS) \
- -DLOCALSTATEDIR=\"$(localstatedir)\"
-
- libdns_manager_la_LIBADD = \
- $(top_builddir)/src/logging/libnm-logging.la \
-+ $(LIBNL_LIBS) \
- $(DBUS_LIBS) \
- $(GLIB_LIBS)
-
---
-1.7.3.4
-
diff --git a/recipes/networkmanager/networkmanager_git.bb b/recipes/networkmanager/networkmanager_git.bb
index 8187787d11..fd8f52f8e3 100644
--- a/recipes/networkmanager/networkmanager_git.bb
+++ b/recipes/networkmanager/networkmanager_git.bb
@@ -20,7 +20,7 @@ SRC_URI += " \
file://NetworkManager \
file://gtk-doc.make \
file://0001-respect-libnl-flags-also-in-backends-ip6-manager.patch \
- file://0002-respect-libnl-flags-also-in-dns-manager.patch \
+ file://0002-respect-libnl-flags-also-in-dns-manager-vpn-manager-.patch \
"
EXTRA_OECONF += " --with-dhclient=${base_sbindir}/dhclient \
diff --git a/recipes/nodejs/nodejs_0.4.2.bb b/recipes/nodejs/nodejs_0.4.2.bb
index 912eb5ded2..40787b4199 100644
--- a/recipes/nodejs/nodejs_0.4.2.bb
+++ b/recipes/nodejs/nodejs_0.4.2.bb
@@ -18,6 +18,8 @@ S = "${WORKDIR}/node-v${PV}"
CCACHE = ""
do_configure () {
+ sed -i -e 's:/usr/lib:${STAGING_LIBDIR}:g' wscript
+ sed -i -e 's:/usr/local/lib:${STAGING_LIBDIR}:g' wscript
./configure --prefix=${prefix} --without-snapshot
}
diff --git a/recipes/ntp/ntp_4.2.6p3.bb b/recipes/ntp/ntp_4.2.6p3.bb
index 1476c6fbb7..844198fa6e 100644
--- a/recipes/ntp/ntp_4.2.6p3.bb
+++ b/recipes/ntp/ntp_4.2.6p3.bb
@@ -1,6 +1,6 @@
require ntp.inc
-PR = "r1"
+PR = "r2"
SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/${P}.tar.gz \
file://tickadj.c.patch \
@@ -12,7 +12,9 @@ SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/${P}.tar.gz \
SRC_URI[md5sum] = "59876a9009b098ff59767ee45a88ebd2"
SRC_URI[sha256sum] = "6e84d4ddfa14b911c3ed88463af10867e1fa9b287e7b34d8a02e78be85a7c40e"
-EXTRA_OECONF += " --with-net-snmp-config=no --without-ntpsnmpd"
+EXTRA_OECONF += " --with-net-snmp-config=no --without-ntpsnmpd"
+
+CONFFILES_${PN} = "${sysconfdir}/ntp.conf"
do_install_append() {
install -d ${D}/${sysconfdir}/init.d
diff --git a/recipes/opencv/opencv-dsp-acceleration_svn.bb b/recipes/opencv/opencv-dsp-acceleration_svn.bb
index 788e8e21ee..4ca24d3056 100644
--- a/recipes/opencv/opencv-dsp-acceleration_svn.bb
+++ b/recipes/opencv/opencv-dsp-acceleration_svn.bb
@@ -3,6 +3,7 @@ DEPENDS = "ti-codec-engine ti-dsplib"
PV = "0+svnr${SRCPV}"
SRCREV = "128"
+PR = "r2"
SRC_URI = "svn://opencv-dsp-acceleration.googlecode.com/svn/;proto=http;module=trunk \
http://focus.ti.com/lit/sw/sprc264/sprc264.zip;name=imglib \
diff --git a/recipes/openssh/openssh-5.2p1/aurora/sshd_config b/recipes/openssh/openssh-5.2p1/aurora/sshd_config
new file mode 100644
index 0000000000..3d36cdf601
--- /dev/null
+++ b/recipes/openssh/openssh-5.2p1/aurora/sshd_config
@@ -0,0 +1,119 @@
+# $OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 djm Exp $
+
+# This is the sshd server system-wide configuration file. See
+# sshd_config(5) for more information.
+
+# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
+
+# The strategy used for options in the default sshd_config shipped with
+# OpenSSH is to specify options with their default value where
+# possible, but leave them commented. Uncommented options change a
+# default value.
+
+#Port 22
+#AddressFamily any
+#ListenAddress 0.0.0.0
+#ListenAddress ::
+
+# Disable legacy (protocol version 1) support in the server for new
+# installations. In future the default will change to require explicit
+# activation of protocol 1
+Protocol 2
+
+# HostKey for protocol version 1
+#HostKey /etc/ssh/ssh_host_key
+# HostKeys for protocol version 2
+#HostKey /etc/ssh/ssh_host_rsa_key
+#HostKey /etc/ssh/ssh_host_dsa_key
+
+# Lifetime and size of ephemeral version 1 server key
+#KeyRegenerationInterval 1h
+#ServerKeyBits 1024
+
+# Logging
+# obsoletes QuietMode and FascistLogging
+#SyslogFacility AUTH
+#LogLevel INFO
+
+# Authentication:
+
+#LoginGraceTime 2m
+#PermitRootLogin yes
+#StrictModes yes
+#MaxAuthTries 6
+#MaxSessions 10
+
+#RSAAuthentication yes
+#PubkeyAuthentication yes
+#AuthorizedKeysFile .ssh/authorized_keys
+
+# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
+#RhostsRSAAuthentication no
+# similar for protocol version 2
+#HostbasedAuthentication no
+# Change to yes if you don't trust ~/.ssh/known_hosts for
+# RhostsRSAAuthentication and HostbasedAuthentication
+#IgnoreUserKnownHosts no
+# Don't read the user's ~/.rhosts and ~/.shosts files
+#IgnoreRhosts yes
+
+# To disable tunneled clear text passwords, change to no here!
+#PasswordAuthentication yes
+PermitEmptyPasswords yes
+
+# Change to no to disable s/key passwords
+#ChallengeResponseAuthentication yes
+
+# Kerberos options
+#KerberosAuthentication no
+#KerberosOrLocalPasswd yes
+#KerberosTicketCleanup yes
+#KerberosGetAFSToken no
+
+# GSSAPI options
+#GSSAPIAuthentication no
+#GSSAPICleanupCredentials yes
+
+# Set this to 'yes' to enable PAM authentication, account processing,
+# and session processing. If this is enabled, PAM authentication will
+# be allowed through the ChallengeResponseAuthentication and
+# PasswordAuthentication. Depending on your PAM configuration,
+# PAM authentication via ChallengeResponseAuthentication may bypass
+# the setting of "PermitRootLogin without-password".
+# If you just want the PAM account and session checks to run without
+# PAM authentication, then enable this but set PasswordAuthentication
+# and ChallengeResponseAuthentication to 'no'.
+#UsePAM no
+
+#AllowAgentForwarding yes
+#AllowTcpForwarding yes
+#GatewayPorts no
+#X11Forwarding no
+#X11DisplayOffset 10
+#X11UseLocalhost yes
+#PrintMotd yes
+#PrintLastLog yes
+#TCPKeepAlive yes
+#UseLogin no
+UsePrivilegeSeparation yes
+#PermitUserEnvironment no
+Compression no
+ClientAliveInterval 15
+ClientAliveCountMax 4
+UseDNS no
+#PidFile /var/run/sshd.pid
+#MaxStartups 10
+#PermitTunnel no
+#ChrootDirectory none
+
+# no default banner path
+#Banner none
+
+# override default of no subsystems
+Subsystem sftp /usr/libexec/sftp-server
+
+# Example of overriding settings on a per-user basis
+#Match User anoncvs
+# X11Forwarding no
+# AllowTcpForwarding no
+# ForceCommand cvs server
diff --git a/recipes/openssh/openssh_5.2p1.bb b/recipes/openssh/openssh_5.2p1.bb
index 2dd389432e..20d8dae647 100644
--- a/recipes/openssh/openssh_5.2p1.bb
+++ b/recipes/openssh/openssh_5.2p1.bb
@@ -1,6 +1,6 @@
require openssh.inc
-PR = "${INC_PR}.2"
+PR = "${INC_PR}.3"
SRC_URI = "ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar.gz \
file://sshd_config \
diff --git a/recipes/openssl/openssl.inc b/recipes/openssl/openssl.inc
index 24b517d3af..2460913642 100644
--- a/recipes/openssl/openssl.inc
+++ b/recipes/openssl/openssl.inc
@@ -78,9 +78,12 @@ do_configure () {
linux-mipsel)
target=debian-mipsel
;;
- linux-powerpc | linux-powerpc64)
+ linux-powerpc)
target=linux-ppc
;;
+ linux-powerpc64)
+ target=linux-ppc64
+ ;;
linux-supersparc)
target=linux-sparcv8
;;
diff --git a/recipes/opkg-utils/opkg-utils/arfile_header_split.patch b/recipes/opkg-utils/opkg-utils/arfile_header_split.patch
new file mode 100644
index 0000000000..464036707f
--- /dev/null
+++ b/recipes/opkg-utils/opkg-utils/arfile_header_split.patch
@@ -0,0 +1,17 @@
+--- ipkg-utils/arfile.py.orig 2010-09-29 13:38:15.000000000 -0700
++++ ipkg-utils/arfile.py 2010-10-01 16:06:00.000000000 -0700
+@@ -74,7 +74,12 @@
+ if l == "\n":
+ l = self.f.readline()
+ if not l: break
+ l = l.replace('`', '')
+- descriptor = l.split()
++ # Field lengths from /usr/include/ar.h:
++ ar_field_lens = [ 16, 12, 6, 6, 8, 10, 2 ]
++ descriptor = []
++ for field_len in ar_field_lens:
++ descriptor.append(l[:field_len].strip())
++ l = l[field_len:]
+ # print descriptor
+ size = int(descriptor[5])
+ memberName = descriptor[0][:-1]
diff --git a/recipes/opkg-utils/opkg-utils_svn.bb b/recipes/opkg-utils/opkg-utils_svn.bb
index 6b8d3ea682..a8f2cb7eb0 100644
--- a/recipes/opkg-utils/opkg-utils_svn.bb
+++ b/recipes/opkg-utils/opkg-utils_svn.bb
@@ -6,10 +6,11 @@ RDEPENDS_${PN} = "python"
RDEPENDS_${PN}_virtclass-native = ""
SRCREV = "4747"
PV = "0.1.8+svnr${SRCPV}"
-PR = "r6"
+PR = "r7"
SRC_URI = "svn://svn.openmoko.org/trunk/src/host/;module=opkg-utils;proto=http \
file://index-ignore-filenotfound.patch \
+ file://arfile_header_split.patch \
file://mtime-int.patch"
S = "${WORKDIR}/opkg-utils"
diff --git a/recipes/ortp/ortp_0.13.1.bb b/recipes/ortp/ortp_0.13.1.bb
deleted file mode 100644
index 32e5290632..0000000000
--- a/recipes/ortp/ortp_0.13.1.bb
+++ /dev/null
@@ -1,5 +0,0 @@
-require ortp.inc
-PR = "${INC_PR}.0"
-
-SRC_URI[md5sum] = "293f16da6dd434e68652f0f725b7f97c"
-SRC_URI[sha256sum] = "2ba471a2a4f1d7f10fb70de5b68dbb7d32b43494efcecb88b3bd8445f630494c"
diff --git a/recipes/ortp/ortp_0.16.5.bb b/recipes/ortp/ortp_0.16.5.bb
new file mode 100644
index 0000000000..604b7bcc6c
--- /dev/null
+++ b/recipes/ortp/ortp_0.16.5.bb
@@ -0,0 +1,5 @@
+require ortp.inc
+PR = "${INC_PR}.0"
+
+SRC_URI[md5sum] = "94546901d14b85f97342f4ecf39489b1"
+SRC_URI[sha256sum] = "3b655a79f9122afd298e9cd702e542908bbd6ea1337c02553110c57e0b3c5835"
diff --git a/recipes/owl-wifi/files/0001-owl-wifi-include-linux-semaphore.h.patch b/recipes/owl-wifi/files/0001-owl-wifi-include-linux-semaphore.h.patch
new file mode 100644
index 0000000000..411f96538e
--- /dev/null
+++ b/recipes/owl-wifi/files/0001-owl-wifi-include-linux-semaphore.h.patch
@@ -0,0 +1,25 @@
+From 2f334b4563af8a8fc508b8d7245b901f0c5deab3 Mon Sep 17 00:00:00 2001
+From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
+Date: Sat, 16 Apr 2011 17:22:00 +0200
+Subject: [PATCH] owl-wifi: include linux/semaphore.h
+
+Signed-off-by: Ulf Samuelsson <ulf.samuelsson@atmel.com>
+---
+ owl_net.h | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/owl_net.h b/owl_net.h
+index c019ef4..6a88100 100644
+--- a/owl_net.h
++++ b/owl_net.h
+@@ -24,6 +24,7 @@
+ #include <linux/etherdevice.h>
+ #include <linux/wireless.h>
+ #include <linux/timer.h>
++#include <linux/semaphore.h>
+
+ #include "wl_api.h"
+
+--
+1.6.3.3
+
diff --git a/recipes/owl-wifi/files/0002-owl-wifi-Add-include-file-for-kmalloc-kfree.patch b/recipes/owl-wifi/files/0002-owl-wifi-Add-include-file-for-kmalloc-kfree.patch
new file mode 100644
index 0000000000..6811b7b397
--- /dev/null
+++ b/recipes/owl-wifi/files/0002-owl-wifi-Add-include-file-for-kmalloc-kfree.patch
@@ -0,0 +1,25 @@
+From 3ac35324bc7e6cb0afda82d84f7b63d673a71199 Mon Sep 17 00:00:00 2001
+From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
+Date: Sat, 16 Apr 2011 17:44:19 +0200
+Subject: [PATCH] owl-wifi: Add include file for kmalloc/kfree
+
+Signed-off-by: Ulf Samuelsson <ulf.samuelsson@atmel.com>
+---
+ owl_os.c | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/owl_os.c b/owl_os.c
+index 270e541..4d7d116 100644
+--- a/owl_os.c
++++ b/owl_os.c
+@@ -20,6 +20,7 @@
+ #include <linux/kernel.h>
+ #include <linux/string.h>
+ #include <linux/hardirq.h>
++#include <linux/slab.h>
+ #include <stdarg.h>
+
+ /*
+--
+1.6.3.3
+
diff --git a/recipes/owl-wifi/files/0003-owl-wifi-include-sched.h.patch b/recipes/owl-wifi/files/0003-owl-wifi-include-sched.h.patch
new file mode 100644
index 0000000000..561a6f06e8
--- /dev/null
+++ b/recipes/owl-wifi/files/0003-owl-wifi-include-sched.h.patch
@@ -0,0 +1,24 @@
+From 6b4a1ffc0485c6efb0742d2965fed126b9fd3fc4 Mon Sep 17 00:00:00 2001
+From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
+Date: Sat, 16 Apr 2011 18:01:34 +0200
+Subject: [PATCH] owl-wifi: include sched.h
+
+---
+ owl_sync.c | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/owl_sync.c b/owl_sync.c
+index 317010d..3be3efe 100644
+--- a/owl_sync.c
++++ b/owl_sync.c
+@@ -16,6 +16,7 @@
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include <linux/sched.h>
+ #include "owl_sync.h"
+ #include "owl_wext_event.h"
+
+--
+1.6.3.3
+
diff --git a/recipes/owl-wifi/owl-wifi_1.0.4.bb b/recipes/owl-wifi/owl-wifi_1.0.4.bb
index 5e31b82afc..8e29b4f98c 100644
--- a/recipes/owl-wifi/owl-wifi_1.0.4.bb
+++ b/recipes/owl-wifi/owl-wifi_1.0.4.bb
@@ -3,12 +3,15 @@ HOMEPAGE = "http://www.hd-wireless.se"
PRIORITY = "optional"
SECTION = "kernel/modules"
LICENSE = "GPL"
-PR = "r1"
+PR = "r2"
RDEPENDS = "wireless-tools \
wpa-supplicant \
"
SRC_URI = "http://www.hd-wireless.se/images/stories/public_pdf/owl-linux-arm-${PV}.tar.gz \
+ file://0001-owl-wifi-include-linux-semaphore.h.patch;apply=yes \
+ file://0002-owl-wifi-Add-include-file-for-kmalloc-kfree.patch;apply=yes \
+ file://0003-owl-wifi-include-sched.h.patch;apply=yes \
"
S = "${WORKDIR}/owl-linux-arm-${PV}"
@@ -29,3 +32,7 @@ do_install() {
install -d ${D}${base_libdir}/modules/${KERNEL_VERSION}/kernel/drivers/net
install -m 0644 ${S}/owl*${KERNEL_OBJECT_SUFFIX} ${D}${base_libdir}/modules/${KERNEL_VERSION}/kernel/drivers/net
}
+
+SRC_URI[md5sum] = "e8df44b8c766436fdd798fa5cd6d1a02"
+SRC_URI[sha256sum] = "c2b47ecb6375e7a5904fefd6ec7b715ca4a6ac347fb68324fea7ade152244e6e"
+
diff --git a/recipes/perl/files/ubuntu-11.04-multiarch.patch b/recipes/perl/files/ubuntu-11.04-multiarch.patch
new file mode 100644
index 0000000000..4f51eb3a4e
--- /dev/null
+++ b/recipes/perl/files/ubuntu-11.04-multiarch.patch
@@ -0,0 +1,12 @@
+diff --git perl-5.10.1/Configure-orig perl-5.10.1/Configure
+index 5508fd2..8ee7dae 100755
+--- perl-5.10.1/Configure-orig
++++ perl-5.10.1/Configure
+@@ -1311,6 +1311,7 @@ glibpth="/lib /usr/lib /lib64 /usr/lib64 $xlibpth"
+ glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
+ test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
+ test -f /shlib/libc.so && glibpth="/shlib $glibpth"
++test -f /usr/lib/*-linux-gnu/libc.so && glibpth="/usr/lib/*-linux-gnu $glibpth"
+ test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
+
+ : Private path used by Configure to find libraries. Its value
diff --git a/recipes/perl/perl-native_5.10.1.bb b/recipes/perl/perl-native_5.10.1.bb
index 5aa0c7b123..80d6937f8e 100644
--- a/recipes/perl/perl-native_5.10.1.bb
+++ b/recipes/perl/perl-native_5.10.1.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "Perl is a popular scripting language."
HOMEPAGE = "http://www.perl.org/"
SECTION = "libs"
LICENSE = "Artistic|GPLv1+"
-PR = "r10"
+PR = "r12"
NATIVE_INSTALL_WORKS = "1"
INHIBIT_DEFAULT_DEPS = "1"
PATCHTOOL = "patch"
@@ -20,6 +20,7 @@ SRC_URI = "http://ftp.funet.fi/pub/CPAN/src/perl-${PV}.tar.gz;name=perl-${PV} \
file://native-nopacklist.patch \
file://native-perlinc.patch \
file://perl-fix-cross-library-check.patch \
+ file://ubuntu-11.04-multiarch.patch \
"
SRC_URI[perl-5.10.1.md5sum] = "b9b2fdb957f50ada62d73f43ee75d044"
@@ -29,6 +30,8 @@ S = "${WORKDIR}/perl-${PV}"
inherit native
+export LD="${CC}"
+
do_configure () {
./Configure \
-Dcc="${CC}" \
@@ -105,6 +108,7 @@ do_install() {
done
create_wrapper ${D}${bindir}/perl PERL5LIB='$PERL5LIB:${STAGING_LIBDIR}/perl/${PV}:${STAGING_LIBDIR}/perl/'
+ create_wrapper ${D}${bindir}/perl${PV} PERL5LIB='$PERL5LIB:${STAGING_LIBDIR}/perl/${PV}:${STAGING_LIBDIR}/perl/'
}
do_install_append_nylon() {
diff --git a/recipes/pkgconfig/pkgconfig-0.23.inc b/recipes/pkgconfig/pkgconfig-0.23.inc
new file mode 100644
index 0000000000..5f87d28ec3
--- /dev/null
+++ b/recipes/pkgconfig/pkgconfig-0.23.inc
@@ -0,0 +1,14 @@
+require pkgconfig.inc
+
+SRC_URI += " \
+ file://autofoo.patch \
+ file://sysrootfix.patch \
+ file://glibconfig-sysdefs.h \
+ "
+SRC_URI[md5sum] = "d922a88782b64441d06547632fd85744"
+SRC_URI[sha256sum] = "08a0e072d6a05419a58124db864f0685e6ac96e71b2875bf15ac12714e983b53"
+
+acpaths = "-I ."
+do_configure_prepend () {
+ install -m 0644 ${WORKDIR}/glibconfig-sysdefs.h glib-1.2.*/
+}
diff --git a/recipes/pkgconfig/pkgconfig-native_0.23.bb b/recipes/pkgconfig/pkgconfig-native_0.23.bb
index f5f44ace40..309077a743 100644
--- a/recipes/pkgconfig/pkgconfig-native_0.23.bb
+++ b/recipes/pkgconfig/pkgconfig-native_0.23.bb
@@ -1,11 +1,7 @@
-require pkgconfig.inc
+require pkgconfig-0.23.inc
FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/pkgconfig-${PV}"
PR = "${INC_PR}.1"
-S = "${WORKDIR}/pkg-config-${PV}/"
inherit native
DEPENDS = ""
-
-SRC_URI[md5sum] = "d922a88782b64441d06547632fd85744"
-SRC_URI[sha256sum] = "08a0e072d6a05419a58124db864f0685e6ac96e71b2875bf15ac12714e983b53"
diff --git a/recipes/pkgconfig/pkgconfig-sdk_0.23.bb b/recipes/pkgconfig/pkgconfig-sdk_0.23.bb
index cbe6b81575..4efb7bd620 100644
--- a/recipes/pkgconfig/pkgconfig-sdk_0.23.bb
+++ b/recipes/pkgconfig/pkgconfig-sdk_0.23.bb
@@ -1,11 +1,7 @@
-require pkgconfig.inc
+require pkgconfig-0.23.inc
FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/pkgconfig-${PV}"
PR = "${INC_PR}.1"
-S = "${WORKDIR}/pkg-config-${PV}/"
inherit sdk
DEPENDS = ""
-
-SRC_URI[md5sum] = "d922a88782b64441d06547632fd85744"
-SRC_URI[sha256sum] = "08a0e072d6a05419a58124db864f0685e6ac96e71b2875bf15ac12714e983b53"
diff --git a/recipes/pkgconfig/pkgconfig.inc b/recipes/pkgconfig/pkgconfig.inc
index 4edad6acec..e6fa5f1f99 100644
--- a/recipes/pkgconfig/pkgconfig.inc
+++ b/recipes/pkgconfig/pkgconfig.inc
@@ -5,22 +5,17 @@ It replaces the ubiquitous *-config scripts you may have \
seen with a single tool."
HOMEPAGE = "http://pkg-config.freedesktop.org/wiki/"
LICENSE = "GPLv2+"
+DEPENDS = "glib-2.0"
INC_PR = "r8"
SRC_URI = "http://pkgconfig.freedesktop.org/releases/pkg-config-${PV}.tar.gz \
- file://autofoo.patch \
- file://sysrootfix.patch \
- file://glibconfig-sysdefs.h"
+ "
+# Setting `S` is needed, since the recipe name is `pkgconfig` instead of `pkg-config`.
S = "${WORKDIR}/pkg-config-${PV}/"
inherit autotools
-acpaths = "-I ."
-do_configure_prepend () {
- install -m 0644 ${WORKDIR}/glibconfig-sysdefs.h glib-1.2.*/
-}
-
do_install_append() {
install -d -m 0755 ${D}${libdir}/pkgconfig
}
diff --git a/recipes/pkgconfig/pkgconfig_0.23.bb b/recipes/pkgconfig/pkgconfig_0.23.bb
index 39f7010b6d..3d8fe6c9dc 100644
--- a/recipes/pkgconfig/pkgconfig_0.23.bb
+++ b/recipes/pkgconfig/pkgconfig_0.23.bb
@@ -1,9 +1,6 @@
-require pkgconfig.inc
+require ${PN}.inc
+require ${P}.inc
PR = "${INC_PR}.3"
-DEPENDS += "glib-2.0"
EXTRA_OECONF = "--with-installed-glib"
-
-SRC_URI[md5sum] = "d922a88782b64441d06547632fd85744"
-SRC_URI[sha256sum] = "08a0e072d6a05419a58124db864f0685e6ac96e71b2875bf15ac12714e983b53"
diff --git a/recipes/powervr-drivers/libgles-omap3.inc b/recipes/powervr-drivers/libgles-omap3.inc
index ab4b2482d3..db7681d26c 100644
--- a/recipes/powervr-drivers/libgles-omap3.inc
+++ b/recipes/powervr-drivers/libgles-omap3.inc
@@ -1,7 +1,7 @@
DESCRIPTION = "libGLES for the omap3"
LICENSE = "proprietary-binary"
-PR = "r14"
+PR = "r15"
COMPATIBLE_MACHINE = "(omap3|ti816x)"
@@ -145,6 +145,7 @@ do_install () {
cp -pPr ${S}/GFX_Linux_SDK/OVG/SDKPackage/Builds/OVG/Include/v* ${D}${includedir}/ || true
cp -pPr ${S}/GFX_Linux_SDK/OVG/SDKPackage/Builds/OVG/Include/V* ${D}${includedir}/ || true
cp -pPr ${S}/include/*.h ${D}${includedir} || true
+ cp -pPr ${S}/include/wsegl/*.h ${D}${includedir} || true
install -d ${D}${sysconfdir}/init.d/
cp -pP ${WORKDIR}/rc.pvr ${D}${sysconfdir}/init.d/pvr-init
diff --git a/recipes/proxy-libintl/proxy-libintl_20080418.bb b/recipes/proxy-libintl/proxy-libintl_20080418.bb
index f15afbf955..fe998e2ae9 100644
--- a/recipes/proxy-libintl/proxy-libintl_20080418.bb
+++ b/recipes/proxy-libintl/proxy-libintl_20080418.bb
@@ -6,8 +6,11 @@ LICENSE = "LGPL"
PR = "r7"
PROVIDES = "virtual/libintl"
+BBCLASSEXTEND = "native"
+NATIVE_INSTALL_WORKS = "1"
+
SRC_URI = " \
- http://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/${PN}-${PV}.zip \
+ http://ftp.gnome.org/pub/GNOME/binaries/win32/dependencies/proxy-libintl-${PV}.zip \
file://stub-only.patch \
file://create-as-shared-lib.patch \
file://soname.patch \
diff --git a/recipes/pulseaudio/files/ubacktrace.patch b/recipes/pulseaudio/files/ubacktrace.patch
new file mode 100644
index 0000000000..83f1e62ed8
--- /dev/null
+++ b/recipes/pulseaudio/files/ubacktrace.patch
@@ -0,0 +1,13 @@
+Index: pulseaudio-0.9.22/configure.ac
+===================================================================
+--- pulseaudio-0.9.22.orig/configure.ac 2011-05-22 22:45:03.102936387 +0200
++++ pulseaudio-0.9.22/configure.ac 2011-05-22 22:46:29.886301698 +0200
+@@ -409,7 +409,7 @@
+
+ # BSD
+ AC_SEARCH_LIBS([connect], [socket])
+-AC_SEARCH_LIBS([backtrace], [execinfo])
++AC_SEARCH_LIBS([backtrace], [execinfo ubacktrace])
+
+ # Non-standard
+
diff --git a/recipes/pulseaudio/pulseaudio.inc b/recipes/pulseaudio/pulseaudio.inc
index 85048f2485..49daa455ec 100644
--- a/recipes/pulseaudio/pulseaudio.inc
+++ b/recipes/pulseaudio/pulseaudio.inc
@@ -6,7 +6,7 @@ LICENSE = "LGPL"
DEPENDS = "bluez4 libatomics-ops liboil avahi libsamplerate0 libsndfile1 libtool hal virtual/libx11 tcp-wrappers"
# optional
DEPENDS += "alsa-lib glib-2.0 dbus consolekit hal openssl"
-INC_PR = "r11"
+INC_PR = "r12"
SRC_URI = "http://0pointer.de/lennart/projects/pulseaudio/pulseaudio-${PV}.tar.gz \
file://gcc4-compile-fix.patch \
@@ -66,7 +66,7 @@ FILES_${PN}-dev += "${libdir}/pulse-${PV}/modules/*.la"
FILES_${PN}-conf = "${sysconfdir}"
FILES_${PN}-bin = "${bindir}/* \
${sysconfdir}/default/volatiles/volatiles.04_pulse"
-FILES_${PN}-server = "${bindir}/pulseaudio ${bindir}/start-* ${sysconfdir} ${bindir}/pactl"
+FILES_${PN}-server = "${bindir}/pulseaudio ${bindir}/start-* ${sysconfdir} ${bindir}/pactl ${base_libdir}/udev/rules.d/*.rules"
FILES_${PN}-gconf-helper = "${libexecdir}/pulse/gconf-helper"
FILES_${PN}-misc = "${bindir}/*"
diff --git a/recipes/pulseaudio/pulseaudio_0.9.22.bb b/recipes/pulseaudio/pulseaudio_0.9.22.bb
index 71ac6582d5..2368829b22 100644
--- a/recipes/pulseaudio/pulseaudio_0.9.22.bb
+++ b/recipes/pulseaudio/pulseaudio_0.9.22.bb
@@ -1,6 +1,6 @@
require pulseaudio.inc
-PR = ${INC_PR}.1
+PR = ${INC_PR}.2
DEPENDS += "gdbm speex"
@@ -26,6 +26,7 @@ SRC_URI += "\
file://configure_silent_rules.patch \
file://armv4+v5asm.patch \
file://fixbluezbuild.patch \
+ file://ubacktrace.patch \
"
#do_compile_prepend() {
diff --git a/recipes/pyside/libshiboken_1.0.2.bb b/recipes/pyside/libshiboken_1.0.2.bb
index a65e4efeb8..a9edded6af 100644
--- a/recipes/pyside/libshiboken_1.0.2.bb
+++ b/recipes/pyside/libshiboken_1.0.2.bb
@@ -1,7 +1,10 @@
require shiboken.inc
+DEPENDS = "python"
RDEPENDS_${PN} = "python-core"
-PR = "${INC_PR}.0"
+PR = "${INC_PR}.1"
+
+inherit cmake pkgconfig python-dir
SRC_URI += " \
file://FindQt4.cmake \
@@ -18,7 +21,12 @@ do_configure_prepend() {
cp ${WORKDIR}/FindQt4.cmake ${S}/cmake/Modules/FindQt4.cmake
}
-do_install_prepend() {
+STAGING_LIBDIR_NATIVE = ${STAGING_DIR}/${BUILD_SYS}${prefix}/lib
+STAGING_INCDIR_NATIVE = ${STAGING_DIR}/${BUILD_SYS}${prefix}/include
+
+# NOTE: This needs to be appended to do_configure as pkgconfig.bbclass uses
+# do_install_prepend for it's fixups and we need to run before it!
+do_configure_append() {
# Fixup generated *.cmake and *.pc files for wrong paths
for i in `find ${S}/data -name "*.cmake" -type f` ; do \
sed -i -e 's:${STAGING_BINDIR_NATIVE}:${bindir}:g' \
@@ -26,16 +34,18 @@ do_install_prepend() {
-e 's:${STAGING_LIBDIR}:${libdir}:g' \
$i
done
+
# We need do this here a second time (pkgconfig.bbclass already replaces the -L.. and
# -I .. ones) as there are additional variables for python in the pkgconfig file
for i in `find ${S}/data -name "*.pc" -type f` ; do \
sed -i -e 's:${STAGING_BINDIR_NATIVE}:${bindir}:g' \
-e 's:${STAGING_INCDIR}:${includedir}:g' \
-e 's:${STAGING_LIBDIR}:${libdir}:g' \
+ -e 's:${STAGING_INCDIR_NATIVE}:${includedir}:g' \
+ -e 's:${STAGING_LIBDIR_NATIVE}:${libdir}:g' \
+ -e 's:-lshiboken:-lshiboken-${PYTHON_DIR}:g' \
$i
done
}
-inherit cmake pkgconfig
-
-FILES_${PN}-dev += "${libdir}/cmake/"
+FILES_${PN}-dev += "${libdir}/cmake/ ${libdir}/pkgconfig"
diff --git a/recipes/pyside/python-pyside-embedded/support-qws.patch b/recipes/pyside/python-pyside-embedded/support-qws.patch
index fed126f3fb..1070a2785d 100644
--- a/recipes/pyside/python-pyside-embedded/support-qws.patch
+++ b/recipes/pyside/python-pyside-embedded/support-qws.patch
@@ -1,18 +1,27 @@
diff -Naur pyside-qt4.7+1.0.2-orig/CMakeLists.txt pyside-qt4.7+1.0.2/CMakeLists.txt
--- pyside-qt4.7+1.0.2-orig/CMakeLists.txt 2011-04-28 22:43:01.000000000 +0200
-+++ pyside-qt4.7+1.0.2/CMakeLists.txt 2011-05-01 19:01:11.824051001 +0200
-@@ -105,6 +105,8 @@
++++ pyside-qt4.7+1.0.2/CMakeLists.txt 2011-05-21 22:49:28.043397002 +0200
+@@ -89,6 +89,7 @@
+ set(ENABLE_MAC "0")
+ set(ENABLE_WIN "0")
+ set(ENABLE_SIMULATOR "0")
++set(ENABLE_QWS "0")
+ if(Q_WS_X11)
+ set(ENABLE_X11 "1")
+ if(Q_WS_MAEMO_5)
+@@ -105,6 +106,9 @@
elseif(Q_WS_SIMULATOR)
set(ENABLE_SIMULATOR "1")
set(AUTO_OS "simulator")
+elseif(Q_WS_QWS)
++ set(ENABLE_QWS "1")
+ set(AUTO_OS "qws")
else()
message(FATAL_ERROR "OS not supported")
endif()
diff -Naur pyside-qt4.7+1.0.2-orig/PySide/QtGui/typesystem_gui_qws.xml pyside-qt4.7+1.0.2/PySide/QtGui/typesystem_gui_qws.xml
--- pyside-qt4.7+1.0.2-orig/PySide/QtGui/typesystem_gui_qws.xml 1970-01-01 01:00:00.000000000 +0100
-+++ pyside-qt4.7+1.0.2/PySide/QtGui/typesystem_gui_qws.xml 2011-05-01 19:01:27.544051001 +0200
++++ pyside-qt4.7+1.0.2/PySide/QtGui/typesystem_gui_qws.xml 2011-05-25 23:02:02.830307000 +0200
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!--
diff --git a/recipes/pyside/python-pyside-embedded_1.0.2.bb b/recipes/pyside/python-pyside-embedded_1.0.2.bb
index 865d0b0dc0..a684c8336f 100644
--- a/recipes/pyside/python-pyside-embedded_1.0.2.bb
+++ b/recipes/pyside/python-pyside-embedded_1.0.2.bb
@@ -1,6 +1,7 @@
+inherit qt4e
require python-pyside.inc
-PR = "${INC_PR}.0"
+PR = "${INC_PR}.3"
SRC_URI += " \
file://no-accessibility-support.patch \
file://support-qws.patch \
diff --git a/recipes/pyside/python-pyside.inc b/recipes/pyside/python-pyside.inc
index c018925840..bc5d33480a 100644
--- a/recipes/pyside/python-pyside.inc
+++ b/recipes/pyside/python-pyside.inc
@@ -1,9 +1,9 @@
QTV = "4.7"
DESCRIPTION = "Python Bindings for Qt ${QTV}"
-DEPENDS = "apiextractor-native generatorrunner-native libshiboken"
+DEPENDS = "apiextractor-native generatorrunner-native shiboken-native libshiboken"
RDEPENDS_${pn} = "python-core"
PROVIDES = "python-pyside"
-INC_PR = "r0"
+INC_PR = "r2"
SRC_URI = " \
http://www.pyside.org/files/pyside-qt${QTV}+${PV}.tar.bz2;name=code \
@@ -20,7 +20,7 @@ export HOST_SYS
export BUILD_SYS
# NOTE this should be reworked when a x11 version of qt4 is needed
-inherit qt4e cmake pkgconfig python-dir
+inherit cmake pkgconfig python-dir
EXTRA_OECMAKE = " \
-DQT_LIBRARY_DIR=${STAGING_TARGET_LIBDIR} \
diff --git a/recipes/pyside/shiboken.inc b/recipes/pyside/shiboken.inc
index f6455f717d..d09953dee0 100644
--- a/recipes/pyside/shiboken.inc
+++ b/recipes/pyside/shiboken.inc
@@ -2,7 +2,9 @@ DESCRIPTION = "Shiboken is a plugin (front-end) for Generator Runner and a runti
bindings for C++ libraries using CPython source code."
HOMEPAGE = "http://www.pyside.org"
LICENSE = "LGPL"
-INC_PR = "r0"
+INC_PR = "r1"
+
+DEPENDS = "generatorrunner-native"
SRC_URI = "http://www.pyside.org/files/shiboken-${PV}.tar.bz2"
S = "${WORKDIR}/shiboken-${PV}"
diff --git a/recipes/python/python-2.6.6/pkgconfig-support.patch b/recipes/python/python-2.6.6/pkgconfig-support.patch
new file mode 100644
index 0000000000..d970b006da
--- /dev/null
+++ b/recipes/python/python-2.6.6/pkgconfig-support.patch
@@ -0,0 +1,94 @@
+diff -Naur Python-2.6.6-orig/Makefile.pre.in Python-2.6.6/Makefile.pre.in
+--- Python-2.6.6-orig/Makefile.pre.in 2010-08-02 00:05:31.000000000 +0200
++++ Python-2.6.6/Makefile.pre.in 2011-05-24 21:16:19.943550002 +0200
+@@ -763,6 +763,9 @@
+ (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON))
+ -rm -f $(DESTDIR)$(BINDIR)/python-config
+ (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python-config)
++ -test -d $(DESTDIR)$(LIBPC) || $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC)
++ -rm -f $(DESTDIR)$(LIBPC)/python.pc
++ (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python.pc)
+
+ # Install the interpreter with $(VERSION) affixed
+ # This goes into $(exec_prefix)
+@@ -936,8 +939,12 @@
+ # Install the library and miscellaneous stuff needed for extending/embedding
+ # This goes into $(exec_prefix)
+ LIBPL= $(LIBP)/config
++
++# pkgconfig directory
++LIBPC= $(LIBDIR)/pkgconfig
++
+ libainstall: all
+- @for i in $(LIBDIR) $(LIBP) $(LIBPL); \
++ @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
+ do \
+ if test ! -d $(DESTDIR)$$i; then \
+ echo "Creating directory $$i"; \
+@@ -964,6 +971,7 @@
+ $(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
+ $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
+ $(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
++ $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
+ $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
+ $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
+ # Substitution happens here, as the completely-expanded BINDIR
+@@ -1159,7 +1167,8 @@
+ # Keep configure and Python-ast.[ch], it's possible they can't be generated
+ distclean: clobber
+ -rm -f core Makefile Makefile.pre config.status \
+- Modules/Setup Modules/Setup.local Modules/Setup.config
++ Modules/Setup Modules/Setup.local Modules/Setup.config \
++ Misc/python.pc
+ find $(srcdir) '(' -name '*.fdc' -o -name '*~' \
+ -o -name '[@,#]*' -o -name '*.old' \
+ -o -name '*.orig' -o -name '*.rej' \
+diff -Naur Python-2.6.6-orig/Misc/python.pc.in Python-2.6.6/Misc/python.pc.in
+--- Python-2.6.6-orig/Misc/python.pc.in 1970-01-01 01:00:00.000000000 +0100
++++ Python-2.6.6/Misc/python.pc.in 2011-05-24 21:09:22.733550002 +0200
+@@ -0,0 +1,13 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: Python
++Description: Python library
++Requires:
++Version: @VERSION@
++Libs.private: @LIBS@
++Libs: -L${libdir} -lpython@VERSION@
++Cflags: -I${includedir}/python@VERSION@
++
+diff -Naur Python-2.6.6-orig/configure Python-2.6.6/configure
+--- Python-2.6.6-orig/configure 2010-05-25 04:27:03.000000000 +0200
++++ Python-2.6.6/configure 2011-05-24 21:14:55.553550001 +0200
+@@ -12863,7 +12863,7 @@
+ $as_echo "done" >&6; }
+
+ # generate output files
+-ac_config_files="$ac_config_files Makefile.pre Modules/Setup.config"
++ac_config_files="$ac_config_files Makefile.pre Modules/Setup.config Misc/python.pc"
+
+ cat >confcache <<\_ACEOF
+ # This file is a shell script that caches the results of configure
+@@ -13557,6 +13557,7 @@
+ "Mac/Resources/app/Info.plist") CONFIG_FILES="$CONFIG_FILES Mac/Resources/app/Info.plist" ;;
+ "Makefile.pre") CONFIG_FILES="$CONFIG_FILES Makefile.pre" ;;
+ "Modules/Setup.config") CONFIG_FILES="$CONFIG_FILES Modules/Setup.config" ;;
++ "Misc/python.pc") CONFIG_FILES="$CONFIG_FILES Misc/python.pc" ;;
+
+ *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+diff -Naur Python-2.6.6-orig/configure.in Python-2.6.6/configure.in
+--- Python-2.6.6-orig/configure.in 2010-05-25 04:27:03.000000000 +0200
++++ Python-2.6.6/configure.in 2011-05-24 21:09:53.733550001 +0200
+@@ -3935,7 +3935,7 @@
+ AC_MSG_RESULT(done)
+
+ # generate output files
+-AC_CONFIG_FILES(Makefile.pre Modules/Setup.config)
++AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc)
+ AC_OUTPUT
+
+ echo "creating Modules/Setup"
diff --git a/recipes/python/python-numpy_1.1.1.bb b/recipes/python/python-numpy_1.1.1.bb
index f5c23e055f..8594ea00b5 100644
--- a/recipes/python/python-numpy_1.1.1.bb
+++ b/recipes/python/python-numpy_1.1.1.bb
@@ -4,6 +4,8 @@ PRIORITY = "optional"
LICENSE = "PSF"
PR = "ml0"
+RDEPENDS_${PN} = "python-compiler python-mmap python-pkgutil python-pydoc python-unittest"
+
SRC_URI = "${SOURCEFORGE_MIRROR}/numpy/numpy-${PV}.tar.gz \
file://unbreak-assumptions.diff \
file://trycompile.diff \
diff --git a/recipes/python/python-pyqt-4.8.3/assistantclient-fix.patch b/recipes/python/python-pyqt-4.8.4/assistantclient-fix.patch
index 15f83d23b0..15f83d23b0 100644
--- a/recipes/python/python-pyqt-4.8.3/assistantclient-fix.patch
+++ b/recipes/python/python-pyqt-4.8.4/assistantclient-fix.patch
diff --git a/recipes/python/python-pyqt-4.8.3/debian_configure_changes.diff b/recipes/python/python-pyqt-4.8.4/debian_configure_changes.diff
index 8f065a275a..8f065a275a 100644
--- a/recipes/python/python-pyqt-4.8.3/debian_configure_changes.diff
+++ b/recipes/python/python-pyqt-4.8.4/debian_configure_changes.diff
diff --git a/recipes/python/python-pyqt-4.8.3/fix_qthelp_ftbfs.diff b/recipes/python/python-pyqt-4.8.4/fix_qthelp_ftbfs.diff
index e7a68829ad..e7a68829ad 100644
--- a/recipes/python/python-pyqt-4.8.3/fix_qthelp_ftbfs.diff
+++ b/recipes/python/python-pyqt-4.8.4/fix_qthelp_ftbfs.diff
diff --git a/recipes/python/python-pyqt-4.8.3/fix_the_QAssitant_ftbfs.diff b/recipes/python/python-pyqt-4.8.4/fix_the_QAssitant_ftbfs.diff
index 96e3062471..96e3062471 100644
--- a/recipes/python/python-pyqt-4.8.3/fix_the_QAssitant_ftbfs.diff
+++ b/recipes/python/python-pyqt-4.8.4/fix_the_QAssitant_ftbfs.diff
diff --git a/recipes/python/python-pyqt-4.8.3/fix_uiparser_buttonbox.diff b/recipes/python/python-pyqt-4.8.4/fix_uiparser_buttonbox.diff
index 7bb6468f94..7bb6468f94 100644
--- a/recipes/python/python-pyqt-4.8.3/fix_uiparser_buttonbox.diff
+++ b/recipes/python/python-pyqt-4.8.4/fix_uiparser_buttonbox.diff
diff --git a/recipes/python/python-pyqt-4.8.3/qreal_float_support.diff b/recipes/python/python-pyqt-4.8.4/qreal_float_support.diff
index abdf70fab0..abdf70fab0 100644
--- a/recipes/python/python-pyqt-4.8.3/qreal_float_support.diff
+++ b/recipes/python/python-pyqt-4.8.4/qreal_float_support.diff
diff --git a/recipes/python/python-pyqt_4.8.3.bb b/recipes/python/python-pyqt_4.8.4.bb
index 3b593ff7ba..e0bdf0b169 100644
--- a/recipes/python/python-pyqt_4.8.3.bb
+++ b/recipes/python/python-pyqt_4.8.4.bb
@@ -7,7 +7,7 @@ LICENSE = "GPL"
DEPENDS = "sip-native python-sip"
RDEPENDS_${PN} = "python-core"
SRCNAME = "pyqt"
-PR = "r2"
+PR = "r0"
PYQT_OE_VERSION = "Qt_4_7_1"
@@ -16,11 +16,10 @@ SRC_URI = "\
\
file://fix_qthelp_ftbfs.diff;apply=yes \
file://fix_the_QAssitant_ftbfs.diff;apply=yes \
- file://fix_uiparser_buttonbox.diff;apply=yes \
file://assistantclient-fix.patch;apply=yes \
"
-SRC_URI[md5sum] = "d54fd1c37a74864faf42709c8102f254"
-SRC_URI[sha256sum] = "8a59fe9dbb4d7f441dfa2e9405ebbf016aa3da838aa7ccfd429a429457c3d664"
+SRC_URI[md5sum] = "97c5dc1042feb5b3fe20baabad055af1"
+SRC_URI[sha256sum] = "fcfa3ecc0b4fad6d93227751b36a6f81ea104ee19dd26905f52de59f060b3e98"
S = "${WORKDIR}/PyQt-x11-gpl-${PV}"
# arm and mips machines need some extra patches
diff --git a/recipes/python/python-sip_4.12.1.bb b/recipes/python/python-sip_4.12.1.bb
deleted file mode 100644
index 541da44893..0000000000
--- a/recipes/python/python-sip_4.12.1.bb
+++ /dev/null
@@ -1,7 +0,0 @@
-require python-sip.inc
-PR = "r0"
-
-SRC_URI[md5sum] = "0f8e8305b14c1812191de2e0ee22fea9"
-SRC_URI[sha256sum] = "e9d66e8830c2a58e6c17b9952710f67d495ddb84ce6f3d89400c8b52913381b5"
-
-
diff --git a/recipes/python/python-sip_4.12.2.bb b/recipes/python/python-sip_4.12.2.bb
new file mode 100644
index 0000000000..0578486606
--- /dev/null
+++ b/recipes/python/python-sip_4.12.2.bb
@@ -0,0 +1,8 @@
+require python-sip.inc
+PR = "r0"
+
+SRC_URI[md5sum] = "9df80f88e0e4022cdd8a8891c6c38048"
+SRC_URI[sha256sum] = "3e42bea028a1713558b5b8a317af4195d3b0feaa6c179d99401a7048f1a3cec4"
+
+
+
diff --git a/recipes/python/python_2.6.6.bb b/recipes/python/python_2.6.6.bb
index 3c054bbf6b..eacc5c2b96 100644
--- a/recipes/python/python_2.6.6.bb
+++ b/recipes/python/python_2.6.6.bb
@@ -3,7 +3,7 @@ DEPENDS = "python-native db gdbm openssl readline sqlite3 tcl zlib\
${@base_contains('DISTRO_FEATURES', 'tk', 'tk', '', d)}"
DEPENDS_sharprom = "python-native db readline zlib gdbm openssl"
# set to .0 on every increase of INC_PR
-PR = "${INC_PR}.2"
+PR = "${INC_PR}.3"
SRC_URI = "\
http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.bz2 \
@@ -17,6 +17,7 @@ SRC_URI = "\
file://ipv6-cross.patch \
file://python-module-rpath-fix.patch \
file://sitecustomize.py \
+ file://pkgconfig-support.patch \
"
SRC_URI[md5sum] = "cf4e6881bb84a7ce6089e4a307f71f14"
SRC_URI[sha256sum] = "134c5e0736bae2e5570d0b915693374f11108ded63c35a23a35d282737d2ce83"
diff --git a/recipes/qt4/files/palmpre/qte.sh b/recipes/qt4/files/palmpre/qte.sh
new file mode 100644
index 0000000000..bb8dfae6c2
--- /dev/null
+++ b/recipes/qt4/files/palmpre/qte.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+if [ -e /dev/input/touchscreen0 ]
+then
+ QWS_MOUSE_PROTO=LinuxInput:/dev/input/touchscreen0
+ export QWS_MOUSE_PROTO
+fi
diff --git a/recipes/qt4/qt-4.6.3.inc b/recipes/qt4/qt-4.6.3.inc
index 77c5cf69d4..36c6a56b4b 100644
--- a/recipes/qt4/qt-4.6.3.inc
+++ b/recipes/qt4/qt-4.6.3.inc
@@ -19,9 +19,6 @@ SRC_URI = "ftp://ftp.trolltech.com/qt/source/qt-everywhere-opensource-src-${PV}.
file://linux.conf \
"
-# Set necessary variables in the profile
-SRC_URI += "file://qte.sh"
-
S = "${WORKDIR}/qt-everywhere-opensource-src-${PV}"
do_configure_prepend() {
@@ -46,11 +43,6 @@ QT_GLFLAGS ?= ""
QT_CONFIG_FLAGS += " -no-rpath -qt3support -reduce-relocations -silent ${QT_GLFLAGS}"
do_compile() {
- # Fixup missing wsegl header in some SGX SDKs
- if ! [ -e ${STAGING_INCDIR}/wsegl.h ] ; then
- cp src/3rdparty/powervr/wsegl.h src/plugins/gfxdrivers/powervr/QWSWSEGL/
- fi
-
unset CFLAGS CXXFLAGS
oe_runmake ${EXTRA_ENV}
}
diff --git a/recipes/qt4/qt-4.7.2.inc b/recipes/qt4/qt-4.7.3.inc
index e6a7b9023d..b29d892515 100644
--- a/recipes/qt4/qt-4.7.2.inc
+++ b/recipes/qt4/qt-4.7.3.inc
@@ -5,17 +5,16 @@ FILESPATHPKG =. "qt-${PV}:"
SRC_URI = "\
ftp://ftp.trolltech.com/qt/source/qt-everywhere-opensource-src-${PV}.tar.gz \
- file://blacklist-fraudulent-comodo-certificates-patch.diff \
file://0004-no-qmake.patch \
file://hack-out-pg2-4.7.0.patch \
file://0006-freetype-host-includes.patch \
file://0001-Added-Openembedded-crossarch-option.patch \
file://0010-phonon-gstreamer-rgb-endianess.patch \
+ file://fix-translations.patch \
+ file://0001-wsegl2-support.patch \
file://g++.conf \
file://linux.conf \
- "
-# Set necessary variables in the profile
-SRC_URI += "file://qte.sh"
+ "
S = "${WORKDIR}/qt-everywhere-opensource-src-${PV}"
@@ -23,7 +22,7 @@ FILES_${QT_BASE_NAME}-tools += "${bindir}/qml"
do_configure_prepend() {
for pro in $(find ${S} -name "*.pro") ; do
- sed -i 's:$$QT_BUILD_TREE/bin/lrelease:${OE_QMAKE_LRELEASE}:g' $pro
+ sed -i 's:$$LRELEASE:${STAGING_BINDIR_NATIVE}/lrelease4:g' $pro
done
sed -i s:SEDME:${S}: ${WORKDIR}/linux.conf
@@ -35,24 +34,11 @@ do_configure_prepend() {
${S}/configure
}
-do_configure_append() {
- sed -e '/QMAKE_TARGET /d' -e '/TARGET /d' -i ${S}/translations/Makefile
-}
-
QT_GLFLAGS ?= ""
QT_CONFIG_FLAGS += " -javascript-jit -script -scripttools -declarative -xmlpatterns -no-rpath -qt3support -reduce-relocations -silent ${QT_GLFLAGS}"
do_compile() {
- # Fixup missing wsegl header in some SGX SDKs
- if ! [ -e ${STAGING_INCDIR}/wsegl.h ] ; then
- cp src/3rdparty/powervr/wsegl.h src/plugins/gfxdrivers/powervr/QWSWSEGL/
- fi
-
unset CFLAGS CXXFLAGS
- install -m 0755 ${STAGING_BINDIR_NATIVE}/rcc4 ${S}/bin/rcc
- install -m 0755 ${STAGING_BINDIR_NATIVE}/moc4 ${S}/bin/moc
- install -m 0755 ${STAGING_BINDIR_NATIVE}/uic4 ${S}/bin/uic
- install -m 0755 ${STAGING_BINDIR_NATIVE}/lrelease4 ${S}/bin/lrelease
oe_runmake ${EXTRA_ENV}
}
@@ -69,5 +55,5 @@ do_install_append() {
fi
}
-SRC_URI[md5sum] = "66b992f5c21145df08c99d21847f4fdb"
-SRC_URI[sha256sum] = "d4783b524b90bcd270ccf6e7a30d5fb51696c47eb5de49ebc2d553cd3eb49336"
+SRC_URI[md5sum] = "49b96eefb1224cc529af6fe5608654fe"
+SRC_URI[sha256sum] = "d02b6fd69d089c01f4a787aa18175d074ccaecf8980a5956e328c2991905937e"
diff --git a/recipes/qt4/qt-4.7.2/0001-Added-Openembedded-crossarch-option.patch b/recipes/qt4/qt-4.7.3/0001-Added-Openembedded-crossarch-option.patch
index 71a04a59d2..71a04a59d2 100644
--- a/recipes/qt4/qt-4.7.2/0001-Added-Openembedded-crossarch-option.patch
+++ b/recipes/qt4/qt-4.7.3/0001-Added-Openembedded-crossarch-option.patch
diff --git a/recipes/qt4/qt-4.7.3/0001-wsegl2-support.patch b/recipes/qt4/qt-4.7.3/0001-wsegl2-support.patch
new file mode 100644
index 0000000000..ad61fe7afa
--- /dev/null
+++ b/recipes/qt4/qt-4.7.3/0001-wsegl2-support.patch
@@ -0,0 +1,997 @@
+diff -Nurp qt-everywhere-opensource-src-4.6.3-orig//src/3rdparty/powervr/wsegl2/pvr2d.h qt-everywhere-opensource-src-4.6.3/src/3rdparty/powervr/wsegl2/pvr2d.h
+--- qt-everywhere-opensource-src-4.6.3-orig//src/3rdparty/powervr/wsegl2/pvr2d.h 1970-01-01 00:00:00.000000000 +0000
++++ qt-everywhere-opensource-src-4.6.3/src/3rdparty/powervr/wsegl2/pvr2d.h 2011-05-16 22:51:43.158564336 +0000
+@@ -0,0 +1,669 @@
++/**********************************************************************
++*
++* Copyright(c) Imagination Technologies Ltd.
++*
++* The contents of this file are subject to the MIT license as set out below.
++*
++* Permission is hereby granted, free of charge, to any person obtaining a copy
++* of this software and associated documentation files (the "Software"),
++* to deal in the Software without restriction, including without limitation
++* the rights to use, copy, modify, merge, publish, distribute, sublicense,
++* and/or sell copies of the Software, and to permit persons to whom the
++* Software is furnished to do so, subject to the following conditions:
++*
++* The above copyright notice and this permission notice shall be included
++* in all copies or substantial portions of the Software.
++*
++* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
++* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
++* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
++* OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
++* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++*
++* This License is also included in this distribution in the file called
++* "COPYING".
++*
++******************************************************************************/
++
++
++
++/******************************************************************************
++Modifications :-
++$Log: pvr2d.h $
++
++ --- Revision Logs Removed ---
++******************************************************************************/
++
++#ifndef _PVR2D_H_
++#define _PVR2D_H_
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++/* PVR2D Platform-specific definitions */
++#if defined (__linux__)
++#define PVR2D_EXPORT __attribute__((visibility("default")))
++#define PVR2D_IMPORT
++#else
++#define PVR2D_EXPORT
++#define PVR2D_IMPORT
++#endif
++
++/* PVR2D header revision */
++#define PVR2D_REV_MAJOR 3
++#define PVR2D_REV_MINOR 5
++
++/* Basic types */
++typedef enum
++{
++ PVR2D_FALSE = 0,
++ PVR2D_TRUE
++} PVR2D_BOOL;
++
++typedef void* PVR2D_HANDLE;
++
++typedef char PVR2D_CHAR, *PVR2D_PCHAR;
++typedef unsigned char PVR2D_UCHAR, *PVR2D_PUCHAR;
++typedef int PVR2D_INT, *PVR2D_PINT;
++typedef unsigned int PVR2D_UINT, *PVR2D_PUINT;
++typedef long PVR2D_LONG, *PVR2D_PLONG;
++typedef unsigned long PVR2D_ULONG, *PVR2D_PULONG;
++
++typedef void PVR2D_VOID, *PVR2D_PVOID;
++
++
++/* error codes */
++typedef enum
++{
++ PVR2D_OK = 0,
++ PVR2DERROR_INVALID_PARAMETER = -1,
++ PVR2DERROR_DEVICE_UNAVAILABLE = -2,
++ PVR2DERROR_INVALID_CONTEXT = -3,
++ PVR2DERROR_MEMORY_UNAVAILABLE = -4,
++ PVR2DERROR_DEVICE_NOT_PRESENT = -5,
++ PVR2DERROR_IOCTL_ERROR = -6,
++ PVR2DERROR_GENERIC_ERROR = -7,
++ PVR2DERROR_BLT_NOTCOMPLETE = -8,
++ PVR2DERROR_HW_FEATURE_NOT_SUPPORTED = -9,
++ PVR2DERROR_NOT_YET_IMPLEMENTED = -10,
++ PVR2DERROR_MAPPING_FAILED = -11
++}PVR2DERROR;
++
++/* 32 bit PVR2D pixel format specifier */
++typedef unsigned long PVR2DFORMAT;
++
++/* Standard PVR2D pixel formats */
++#define PVR2D_1BPP 0x00UL // 1bpp mask surface or palletized 1 bit source with 2x32 bit CLUT
++#define PVR2D_RGB565 0x01UL // Common rgb 565 format
++#define PVR2D_ARGB4444 0x02UL // Common argb 4444 format
++#define PVR2D_RGB888 0x03UL // Common rgb 888 format (not supported)
++#define PVR2D_ARGB8888 0x04UL // Common argb 8888 format
++#define PVR2D_ARGB1555 0x05UL // Common argb 1555 format
++#define PVR2D_ALPHA8 0x06UL // Alpha-only 8 bit per pixel (used with a constant fill colour)
++#define PVR2D_ALPHA4 0x07UL // Alpha-only 4 bits per pixel (used with a constant fill colour)
++#define PVR2D_PAL2 0x08UL // Palletized 2 bit format (requires 4x32 bit CLUT)
++#define PVR2D_PAL4 0x09UL // Palletized 4 bit format (requires 16x32 bit CLUT)
++#define PVR2D_PAL8 0x0AUL // Palletized 8 bit format (requires 256x32 bit CLUT)
++#define PVR2D_U8 0x10UL // monochrome unsigned 8 bit
++#define PVR2D_U88 0x11UL // monochrome unsigned 16 bit
++#define PVR2D_S8 0x12UL // signed 8 bit
++#define PVR2D_YUV422_YUYV 0x13UL // YUV 422 low-high byte order Y0UY1V
++#define PVR2D_YUV422_UYVY 0x14UL // YUV 422 low-high byte order UY0VY1
++#define PVR2D_YUV422_YVYU 0x15UL // YUV 422 low-high byte order Y0VY1U
++#define PVR2D_YUV422_VYUY 0x16UL // YUV 422 low-high byte order VY0UY1
++#define PVR2D_YUV420_2PLANE 0x17UL // YUV420 2 Plane
++#define PVR2D_YUV420_3PLANE 0x18UL // YUV420 3 Plane
++#define PVR2D_2101010ARGB 0x19UL // 32 bit 2 10 10 10
++#define PVR2D_888RSGSBS 0x1AUL
++#define PVR2D_16BPP_RAW 0x1BUL // 16 bit raw (no format conversion)
++#define PVR2D_32BPP_RAW 0x1CUL // 32 bit raw
++#define PVR2D_64BPP_RAW 0x1DUL // 64 bit raw
++#define PVR2D_128BPP_RAW 0x1EUL // 128 bit raw
++
++#define PVR2D_NO_OF_FORMATS 0x1FUL
++
++/* Format modifier bit field (DstFormat and SrcFormat bits 16..23) */
++#define PVR2D_FORMAT_MASK 0x0000FFFFUL // PVR2D Format bits
++#define PVR2D_FORMAT_LAYOUT_MASK 0x000F0000UL // Format layout (strided / twiddled / tiled)
++#define PVR2D_FORMAT_FLAGS_MASK 0x0FF00000UL // Surface Flags mask
++
++/* Layout */
++#define PVR2D_FORMAT_LAYOUT_SHIFT 16
++#define PVR2D_FORMAT_LAYOUT_STRIDED 0x00000000UL
++#define PVR2D_FORMAT_LAYOUT_TILED 0x00010000UL
++#define PVR2D_FORMAT_LAYOUT_TWIDDLED 0x00020000UL
++
++/*
++ PVR2D_SURFACE_PDUMP
++ This flag requests a surface pdump, to capture the pixel state after host writes.
++ Not needed if the surface state has resulted from previous SGX 2D/3D core writes.
++*/
++#define PVR2D_SURFACE_PDUMP 0x00100000UL // calls PVRSRVPDumpMem to capture the surface (pdump builds only)
++
++/*
++ Low level 3D format extension - for blts via the 3D core only.
++ If the top bit of the format field is set then PVR2D reads it as a PVRSRV_PIXEL_FORMAT.
++ The outcome is hardware dependant.
++ There is no guarantee that any specific PVRSRV format will be supported.
++*/
++#define PVR2D_FORMAT_PVRSRV 0x80000000
++
++/* wrap surface type */
++typedef enum
++{
++ PVR2D_WRAPFLAG_NONCONTIGUOUS = 0,
++ PVR2D_WRAPFLAG_CONTIGUOUS = 1,
++
++}PVR2DWRAPFLAGS;
++
++#define PVR2D_CONTEXT_FLAGS_PRIORITY_MASK 0x00000003
++
++#define PVR2D_CONTEXT_FLAGS_LOW_PRIORITY_CONTEXT 1
++#define PVR2D_CONTEXT_FLAGS_NORMAL_PRIORITY_CONTEXT 0
++#define PVR2D_CONTEXT_FLAGS_HIGH_PRIORITY_CONTEXT 2
++
++/* flags for control information of additional blits */
++typedef enum
++{
++ PVR2D_BLIT_DISABLE_ALL = 0x00000000, /* disable all additional controls */
++ PVR2D_BLIT_CK_ENABLE = 0x00000001, /* enable colour key */
++ PVR2D_BLIT_GLOBAL_ALPHA_ENABLE = 0x00000002, /* enable standard global alpha */
++ PVR2D_BLIT_PERPIXEL_ALPHABLEND_ENABLE = 0x00000004, /* enable per-pixel alpha bleding */
++ PVR2D_BLIT_PAT_SURFACE_ENABLE = 0x00000008, /* enable pattern surf (disable fill) */
++ PVR2D_BLIT_FULLY_SPECIFIED_ALPHA_ENABLE = 0x00000010, /* enable fully specified alpha */
++ PVR2D_BLIT_ROT_90 = 0x00000020, /* apply 90 degree rotation to the blt */
++ PVR2D_BLIT_ROT_180 = 0x00000040, /* apply 180 degree rotation to the blt */
++ PVR2D_BLIT_ROT_270 = 0x00000080, /* apply 270 degree rotation to the blt */
++ PVR2D_BLIT_COPYORDER_TL2BR = 0x00000100, /* copy order overrides */
++ PVR2D_BLIT_COPYORDER_BR2TL = 0x00000200,
++ PVR2D_BLIT_COPYORDER_TR2BL = 0x00000400,
++ PVR2D_BLIT_COPYORDER_BL2TR = 0x00000800,
++ PVR2D_BLIT_COLKEY_SOURCE = 0x00001000, /* Key colour is on the source surface */
++ PVR2D_BLIT_COLKEY_DEST = 0x00002000, /* Key colour is on the destination surface */
++ PVR2D_BLIT_COLKEY_MASKED = 0x00004000, /* Mask enabled for colour key */
++ PVR2D_BLIT_COLKEY_OP_PASS = 0x00008000, /* Colour key op = pass */
++ PVR2D_BLIT_COLKEY_OP_REJECT = 0x00010000, /* Colour key op = reject */
++ PVR2D_BLIT_PATH_2DCORE = 0x00100000, /* Blt via dedicated 2D Core or PTLA */
++ PVR2D_BLIT_PATH_3DCORE = 0x00200000, /* Blt via 3D Core */
++ PVR2D_BLIT_PATH_SWBLT = 0x00400000, /* Blt via host software */
++ PVR2D_BLIT_NO_SRC_SYNC_INFO = 0x00800000, /* Dont send a source sync info*/
++ PVR2D_BLIT_ISSUE_STATUS_UPDATES = 0x01000000, /* Issue status updates */
++
++} PVR2DBLITFLAGS;
++
++/* standard alpha-blending functions, AlphaBlendingFunc field of PVR2DBLTINFO */
++typedef enum
++{
++ PVR2D_ALPHA_OP_SRC_DSTINV = 1, /* source alpha : Cdst = Csrc*Asrc + Cdst*(1-Asrc) */
++ PVR2D_ALPHA_OP_SRCP_DSTINV = 2 /* premultiplied source alpha : Cdst = Csrc + Cdst*(1-Asrc) */
++} PVR2D_ALPHABLENDFUNC;
++
++/* blend ops for fully specified alpha (SGX 2D Core only) */
++typedef enum
++{
++ PVR2D_BLEND_OP_ZERO = 0,
++ PVR2D_BLEND_OP_ONE = 1,
++ PVR2D_BLEND_OP_SRC = 2,
++ PVR2D_BLEND_OP_DST = 3,
++ PVR2D_BLEND_OP_GLOBAL = 4,
++ PVR2D_BLEND_OP_SRC_PLUS_GLOBAL = 5,
++ PVR2D_BLEND_OP_DST_PLUS_GLOBAL = 6
++}PVR2D_BLEND_OP;
++
++/* SGX 2D Core Fully specified alpha blend : pAlpha field of PVR2DBLTINFO structure */
++/* a fully specified Alpha Blend operation is defined as */
++/* DST (ALPHA) = (ALPHA_1 * SRC (ALPHA)) + (ALPHA_3 * DST (ALPHA)) */
++/* DST (RGB) = (ALPHA_2 * SRC (RGB)) + (ALPHA_4 * DST (RGB)) */
++/* if the pre-multiplication stage is enabled then the equations become the following: */
++/* PRE_MUL = ((SRC(A)) * (Global Alpha Value)) */
++/* DST (ALPHA) = (ALPHA_1 * SRC (ALPHA)) + (PRE_MUL * DST (ALPHA)) */
++/* DST (RGB) = (ALPHA_2 * SRC (RGB)) + (PRE_MUL * DST (RGB)) */
++/* if the transparent source alpha stage is enabled then a source alpha of zero forces the */
++/* source to be transparent for that pixel regardless of the blend equation being used. */
++typedef struct _PVR2D_ALPHABLT
++{
++ PVR2D_BLEND_OP eAlpha1;
++ PVR2D_BOOL bAlpha1Invert;
++ PVR2D_BLEND_OP eAlpha2;
++ PVR2D_BOOL bAlpha2Invert;
++ PVR2D_BLEND_OP eAlpha3;
++ PVR2D_BOOL bAlpha3Invert;
++ PVR2D_BLEND_OP eAlpha4;
++ PVR2D_BOOL bAlpha4Invert;
++ PVR2D_BOOL bPremulAlpha; /* enable pre-multiplication stage */
++ PVR2D_BOOL bTransAlpha; /* enable transparent source alpha stage */
++ PVR2D_BOOL bUpdateAlphaLookup; /* enable and update the 1555-Lookup alpha table */
++ PVR2D_UCHAR uAlphaLookup0; /* 8 bit alpha when A=0 in a 1555-Lookup surface */
++ PVR2D_UCHAR uAlphaLookup1; /* 8 bit alpha when A=1 in a 1555-Lookup surface */
++ PVR2D_UCHAR uGlobalRGB; /* Global Alpha Value for RGB, 0=transparent 255=opaque */
++ PVR2D_UCHAR uGlobalA; /* Global Alpha Value for Alpha */
++
++} PVR2D_ALPHABLT, *PPVR2D_ALPHABLT;
++
++
++/* surface memory info structure */
++typedef struct _PVR2DMEMINFO
++{
++ PVR2D_VOID *pBase;
++ PVR2D_ULONG ui32MemSize;
++ PVR2D_ULONG ui32DevAddr;
++ PVR2D_ULONG ulFlags;
++ PVR2D_VOID *hPrivateData;
++ PVR2D_VOID *hPrivateMapData;
++
++}PVR2DMEMINFO, *PPVR2DMEMINFO;
++
++
++#define PVR2D_MAX_DEVICE_NAME 20
++
++typedef struct _PVR2DDEVICEINFO
++{
++ PVR2D_ULONG ulDevID;
++ PVR2D_CHAR szDeviceName[PVR2D_MAX_DEVICE_NAME];
++}PVR2DDEVICEINFO;
++
++
++typedef struct _PVR2DISPLAYINFO
++{
++ PVR2D_ULONG ulMaxFlipChains;
++ PVR2D_ULONG ulMaxBuffersInChain;
++ PVR2DFORMAT eFormat;
++ PVR2D_ULONG ulWidth;
++ PVR2D_ULONG ulHeight;
++ PVR2D_LONG lStride;
++ PVR2D_ULONG ulMinFlipInterval;
++ PVR2D_ULONG ulMaxFlipInterval;
++
++}PVR2DDISPLAYINFO;
++
++
++typedef struct _PVR2MISCDISPLAYINFO
++{
++ PVR2D_ULONG ulPhysicalWidthmm;
++ PVR2D_ULONG ulPhysicalHeightmm;
++ PVR2D_ULONG ulUnused[10];
++
++}PVR2DMISCDISPLAYINFO;
++
++
++typedef struct _PVR2DBLTINFO
++{
++ PVR2D_ULONG CopyCode; /* rop code */
++ PVR2D_ULONG Colour; /* fill colour */
++ PVR2D_ULONG ColourKey; /* colour key argb8888 (see CKEY_ defs below) */
++ PVR2D_UCHAR GlobalAlphaValue; /* global alpha blending */
++ PVR2D_UCHAR AlphaBlendingFunc; /* per-pixel alpha-blending function */
++
++ PVR2DBLITFLAGS BlitFlags; /* additional blit control information */
++
++ PVR2DMEMINFO *pDstMemInfo; /* destination memory */
++ PVR2D_ULONG DstOffset; /* byte offset from start of allocation to destination surface pixel 0,0 */
++ PVR2D_LONG DstStride; /* signed stride, the number of bytes from pixel 0,0 to 0,1 */
++ PVR2D_LONG DstX, DstY; /* pixel offset from start of dest surface to start of blt rectangle */
++ PVR2D_LONG DSizeX,DSizeY; /* blt size */
++ PVR2DFORMAT DstFormat; /* dest format */
++ PVR2D_ULONG DstSurfWidth; /* size of dest surface in pixels */
++ PVR2D_ULONG DstSurfHeight; /* size of dest surface in pixels */
++
++ PVR2DMEMINFO *pSrcMemInfo; /* source mem, (source fields are also used for patterns) */
++ PVR2D_ULONG SrcOffset; /* byte offset from start of allocation to src/pat surface pixel 0,0 */
++ PVR2D_LONG SrcStride; /* signed stride, the number of bytes from pixel 0,0 to 0,1 */
++ PVR2D_LONG SrcX, SrcY; /* pixel offset from start of surface to start of source rectangle */
++ /* for patterns this is the start offset within the pattern */
++ PVR2D_LONG SizeX,SizeY; /* source rectangle size or pattern size in pixels */
++ PVR2DFORMAT SrcFormat; /* source/pattern format */
++ PVR2DMEMINFO *pPalMemInfo; /* source/pattern palette memory containing argb8888 colour table */
++ PVR2D_ULONG PalOffset; /* byte offset from start of allocation to start of palette */
++ PVR2D_ULONG SrcSurfWidth; /* size of source surface in pixels */
++ PVR2D_ULONG SrcSurfHeight; /* size of source surface in pixels */
++
++ PVR2DMEMINFO *pMaskMemInfo; /* mask memory, 1bpp format implied */
++ PVR2D_ULONG MaskOffset; /* byte offset from start of allocation to mask surface pixel 0,0 */
++ PVR2D_LONG MaskStride; /* signed stride, the number of bytes from pixel 0,0 to 0,1 */
++ PVR2D_LONG MaskX, MaskY; /* mask rect top left (mask size = blt size) */
++ PVR2D_ULONG MaskSurfWidth; /* size of mask surface in pixels */
++ PVR2D_ULONG MaskSurfHeight; /* size of mask surface in pixels */
++
++ PPVR2D_ALPHABLT pAlpha; /* fully specified alpha blend (2DCore only) */
++
++ PVR2D_ULONG uSrcChromaPlane1; /* mem offset from start of source alloc to chroma plane 1 */
++ PVR2D_ULONG uSrcChromaPlane2; /* mem offset from start of source alloc to chroma plane 2 */
++ PVR2D_ULONG uDstChromaPlane1; /* mem offset from start of dest alloc to chroma plane 1 */
++ PVR2D_ULONG uDstChromaPlane2; /* mem offset from start of dest alloc to chroma plane 2 */
++
++ PVR2D_ULONG ColourKeyMask; /* 32 bit colour key mask, only valid when PVR2D_BLIT_COLKEY_MASKED is set */
++
++}PVR2DBLTINFO, *PPVR2DBLTINFO;
++
++typedef struct _PVR2DRECT
++{
++ PVR2D_LONG left, top;
++ PVR2D_LONG right, bottom;
++} PVR2DRECT;
++
++typedef struct
++{
++ PVR2DMEMINFO *pSurfMemInfo; /* surface memory */
++ PVR2D_ULONG SurfOffset; /* byte offset from start of allocation to destination surface pixel 0,0 */
++ PVR2D_LONG Stride; /* signed stride */
++ PVR2DFORMAT Format; /* format */
++ PVR2D_ULONG SurfWidth; /* surface width in pixels */
++ PVR2D_ULONG SurfHeight; /* surface height in pixels */
++
++} PVR2D_SURFACE, *PPVR2D_SURFACE;
++
++typedef struct
++{
++ PVR2D_ULONG uChromaPlane1; /* YUV multiplane - byte offset from start of alloc to chroma plane 1 */
++ PVR2D_ULONG uChromaPlane2; /* YUV multiplane - byte offset from start of alloc to chroma plane 2 */
++ PVR2D_LONG Reserved[2]; /* Reserved, must be zero */
++
++} PVR2D_SURFACE_EXT, *PPVR2D_SURFACE_EXT;
++
++typedef struct
++{
++ PVR2D_ULONG *pUseCode; /* USSE code */
++ PVR2D_ULONG UseCodeSize; /* usse code size in bytes */
++
++} PVR2D_USECODE, *PPVR2D_USECODE;
++
++typedef struct
++{
++ PVR2D_SURFACE sDst; /* destination surface */
++ PVR2D_SURFACE sSrc; /* source surface */
++ PVR2DRECT rcDest; /* destination rectangle */
++ PVR2DRECT rcSource; /* source rectangle */
++ PVR2D_HANDLE hUseCode; /* custom USE code (NULL implies source copy) */
++ PVR2D_ULONG UseParams[2]; /* per-blt params for use code */
++
++} PVR2D_3DBLT, *PPVR2D_3DBLT;
++
++typedef struct
++{
++ PVR2D_SURFACE sDst; /* destination surface */
++ PVR2DRECT rcDest; /* destination rectangle; scaling is supported */
++ PVR2D_SURFACE sSrc; /* source surface */
++ PVR2DRECT rcSource; /* source rectangle; scaling is supported */
++ PPVR2D_SURFACE pSrc2; /* optional second source surface (NULL if not required) */
++ PVR2DRECT* prcSource2; /* optional pSrc2 rectangle */
++ PVR2D_HANDLE hUseCode; /* custom USSE shader code (NULL implies default source copy) */
++ PVR2D_ULONG UseParams[2]; /* per-blt params for usse code */
++ PVR2D_ULONG uiNumTemporaryRegisters; /* no. of temporary registers used in custom shader code */
++ PVR2D_BOOL bDisableDestInput; /* set true if the destination is output only */
++ PPVR2D_SURFACE_EXT pDstExt; /* Extended format params for dest */
++ PPVR2D_SURFACE_EXT pSrcExt[2]; /* Extended format params for source 1 and 2 */
++ PVR2D_LONG Reserved[4]; /* Reserved, must be zero */
++
++} PVR2D_3DBLT_EXT, *PPVR2D_3DBLT_EXT;
++
++
++#define MAKE_COPY_BLIT(src,soff,dest,doff,sx,sy,dx,dy,sz)
++
++typedef void* PVR2DCONTEXTHANDLE;
++typedef void* PVR2DFLIPCHAINHANDLE;
++
++
++// CopyCode field of PVR2DBLTINFO structure:
++// the CopyCode field of the PVR2DBLTINFO structure should contain a rop3 or rop4 code.
++// a rop3 is an 8 bit code that describes a blt with three inputs : source dest and pattern
++// rop4 is a 16 bit code that describes a blt with four inputs : source dest pattern and mask
++// common rop3 codes are defined below
++// a colour fill blt is processed in the pattern channel as a constant colour with a rop code of 0xF0
++// PVR2D_BLIT_PAT_SURFACE_ENABLE defines whether the pattern channel is a surface or a fill colour.
++// a rop4 is defined by two rop3 codes, and the 1 bit-per-pixel mask surface defines which is used.
++// a common rop4 is 0xAAF0 which is the mask copy blt used for text glyphs.
++// CopyCode is taken to be a rop4 when pMaskMemInfo is non zero, otherwise it is assumed to be a rop3
++// use the PVR2DMASKROP4 macro below to construct a rop4 from two rop3's
++// rop3a is the rop used when mask pixel = 1, and rop3b when mask = 0
++#define PVR2DROP4(rop3b, rop3a) ((rop3b<<8)|rop3a)
++
++/* common rop codes */
++#define PVR2DROPclear 0x00 /* 0 (whiteness) */
++#define PVR2DROPset 0xFF /* 1 (blackness) */
++#define PVR2DROPnoop 0xAA /* dst (used for masked blts) */
++
++/* source and dest rop codes */
++#define PVR2DROPand 0x88 /* src AND dst */
++#define PVR2DROPandReverse 0x44 /* src AND NOT dst */
++#define PVR2DROPcopy 0xCC /* src (used for source copy and alpha blts) */
++#define PVR2DROPandInverted 0x22 /* NOT src AND dst */
++#define PVR2DROPxor 0x66 /* src XOR dst */
++#define PVR2DROPor 0xEE /* src OR dst */
++#define PVR2DROPnor 0x11 /* NOT src AND NOT dst */
++#define PVR2DROPequiv 0x99 /* NOT src XOR dst */
++#define PVR2DROPinvert 0x55 /* NOT dst */
++#define PVR2DROPorReverse 0xDD /* src OR NOT dst */
++#define PVR2DROPcopyInverted 0x33 /* NOT src */
++#define PVR2DROPorInverted 0xBB /* NOT src OR dst */
++#define PVR2DROPnand 0x77 /* NOT src OR NOT dst */
++
++/* pattern rop codes */
++#define PVR2DPATROPand 0xA0 /* pat AND dst */
++#define PVR2DPATROPandReverse 0x50 /* pat AND NOT dst */
++#define PVR2DPATROPcopy 0xF0 /* pat (used for solid color fills and pattern blts) */
++#define PVR2DPATROPandInverted 0x0A /* NOT pat AND dst */
++#define PVR2DPATROPxor 0x5A /* pat XOR dst */
++#define PVR2DPATROPor 0xFA /* pat OR dst */
++#define PVR2DPATROPnor 0x05 /* NOT pat AND NOT dst */
++#define PVR2DPATROPequiv 0xA5 /* NOT pat XOR dst */
++#define PVR2DPATROPinvert 0x55 /* NOT dst */
++#define PVR2DPATROPorReverse 0xF5 /* pat OR NOT dst */
++#define PVR2DPATROPcopyInverted 0x0F /* NOT pat */
++#define PVR2DPATROPorInverted 0xAF /* NOT pat OR dst */
++#define PVR2DPATROPnand 0x5F /* NOT pat OR NOT dst */
++
++/* common rop4 codes */
++#define PVR2DROP4MaskedCopy PVR2DROP4(PVR2DROPnoop,PVR2DROPcopy) /* masked source copy blt (used for rounded window corners etc) */
++#define PVR2DROP4MaskedFill PVR2DROP4(PVR2DROPnoop,PVR2DPATROPcopy) /* masked colour fill blt (used for text) */
++
++/* Legacy support */
++#define PVR2DROP3_PATMASK PVR2DPATROPcopy
++#define PVR2DROP3_SRCMASK PVR2DROPcopy
++
++/* pixmap memory alignment */
++#define PVR2D_ALIGNMENT_4 4 /* DWORD alignment */
++#define PVR2D_ALIGNMENT_ANY 0 /* no alignment */
++#define PVR2D_ALIGNMENT_PALETTE 16 /* 16 byte alignment is required for palettes */
++
++/* Heap number for PVR2DGetFrameBuffer */
++#define PVR2D_FB_PRIMARY_SURFACE 0
++
++#define PVR2D_PRESENT_PROPERTY_SRCSTRIDE (1UL << 0)
++#define PVR2D_PRESENT_PROPERTY_DSTSIZE (1UL << 1)
++#define PVR2D_PRESENT_PROPERTY_DSTPOS (1UL << 2)
++#define PVR2D_PRESENT_PROPERTY_CLIPRECTS (1UL << 3)
++#define PVR2D_PRESENT_PROPERTY_INTERVAL (1UL << 4)
++
++#define PVR2D_CREATE_FLIPCHAIN_SHARED (1UL << 0)
++#define PVR2D_CREATE_FLIPCHAIN_QUERY (1UL << 1)
++#define PVR2D_CREATE_FLIPCHAIN_OEMOVERLAY (1UL << 2)
++#define PVR2D_CREATE_FLIPCHAIN_AS_BLITCHAIN (1UL << 3)
++
++/* Colour-key colour must be translated into argb8888 format */
++#define CKEY_8888(P) (P)
++#define CKEY_4444(P) (((P&0xF000UL)<<16) | ((P&0x0F00UL)<<12) | ((P&0x00F0UL)<<8) | ((P&0x000FUL)<<4))
++#define CKEY_1555(P) (((P&0x8000UL)<<16) | ((P&0x7C00UL)<<9) | ((P&0x3E0UL)<<6) | ((P&0x1FUL)<<3))
++#define CKEY_565(P) (((P&0xF800UL)<<8) | ((P&0x7E0UL)<<5) | ((P&0x1FUL)<<3))
++#define CKEY_MASK_8888 0x00FFFFFFUL
++#define CKEY_MASK_4444 0x00F0F0F0UL
++#define CKEY_MASK_1555 0x00F8F8F8UL /* Alpha is not normally included in the key test */
++#define CKEY_MASK_565 0x00F8FCF8UL
++
++/* Fill colours must be translated into argb8888 format */
++#define CFILL_4444(P) (((P&0xF000UL)<<16) | ((P&0x0F00UL)<<12) | ((P&0x00F0UL)<<8) | ((P&0x000FUL)<<4))
++#define CFILL_1555(P) (((P&0x8000UL)<<16) | ((P&0x7C00UL)<<9) | ((P&0x3E0UL)<<6) | ((P&0x1FUL)<<3))
++#define CFILL_565(P) (((P&0xF800UL)<<8) | ((P&0x7E0UL)<<5) | ((P&0x1FUL)<<3))
++
++/* PVR2DCreateDeviceContext flags */
++#define PVR2D_XSERVER_PROC 0x00000001UL /*!< Set for the Xserver connection */
++
++/* PVR2DMemAlloc flags */
++#define PVR2D_MEM_UNCACHED 0x00000000UL /* Default */
++#define PVR2D_MEM_CACHED 0x00000001UL /* Caller must flush and sync when necessary */
++#define PVR2D_MEM_WRITECOMBINE 0x00000002UL
++
++/* Functions that the library exports */
++
++PVR2D_IMPORT
++int PVR2DEnumerateDevices(PVR2DDEVICEINFO *pDevInfo);
++
++PVR2D_IMPORT
++PVR2DERROR PVR2DCreateDeviceContext(PVR2D_ULONG ulDevID,
++ PVR2DCONTEXTHANDLE* phContext,
++ PVR2D_ULONG ulFlags);
++
++PVR2D_IMPORT
++PVR2DERROR PVR2DDestroyDeviceContext(PVR2DCONTEXTHANDLE hContext);
++
++PVR2D_IMPORT
++PVR2DERROR PVR2DGetDeviceInfo(PVR2DCONTEXTHANDLE hContext,
++ PVR2DDISPLAYINFO *pDisplayInfo);
++
++PVR2D_IMPORT
++PVR2DERROR PVR2DGetMiscDisplayInfo(PVR2DCONTEXTHANDLE hContext,
++ PVR2DMISCDISPLAYINFO *pMiscDisplayInfo);
++
++PVR2D_IMPORT
++PVR2DERROR PVR2DGetScreenMode(PVR2DCONTEXTHANDLE hContext,
++ PVR2DFORMAT *pFormat,
++ PVR2D_LONG *plWidth,
++ PVR2D_LONG *plHeight,
++ PVR2D_LONG *plStride,
++ PVR2D_INT *piRefreshRate);
++
++PVR2D_IMPORT
++PVR2DERROR PVR2DGetFrameBuffer(PVR2DCONTEXTHANDLE hContext,
++ PVR2D_INT nHeap,
++ PVR2DMEMINFO **ppsMemInfo);
++
++PVR2D_IMPORT
++PVR2DERROR PVR2DMemAlloc(PVR2DCONTEXTHANDLE hContext,
++ PVR2D_ULONG ulBytes,
++ PVR2D_ULONG ulAlign,
++ PVR2D_ULONG ulFlags,
++ PVR2DMEMINFO **ppsMemInfo);
++
++PVR2D_IMPORT
++PVR2DERROR PVR2DMemExport(PVR2DCONTEXTHANDLE hContext,
++ PVR2D_ULONG ulFlags,
++ PVR2DMEMINFO *psMemInfo,
++ PVR2D_HANDLE *phMemHandle);
++
++PVR2D_IMPORT
++PVR2DERROR PVR2DMemWrap(PVR2DCONTEXTHANDLE hContext,
++ PVR2D_VOID *pMem,
++ PVR2D_ULONG ulFlags,
++ PVR2D_ULONG ulBytes,
++ PVR2D_ULONG alPageAddress[],
++ PVR2DMEMINFO **ppsMemInfo);
++
++PVR2D_IMPORT
++PVR2DERROR PVR2DMemMap(PVR2DCONTEXTHANDLE hContext,
++ PVR2D_ULONG ulFlags,
++ PVR2D_HANDLE hMemHandle,
++ PVR2DMEMINFO **ppsDstMem);
++
++PVR2D_IMPORT
++PVR2DERROR PVR2DMemFree(PVR2DCONTEXTHANDLE hContext,
++ PVR2DMEMINFO *psMemInfo);
++
++PVR2D_IMPORT
++PVR2DERROR PVR2DBlt(PVR2DCONTEXTHANDLE hContext,
++ PVR2DBLTINFO *pBltInfo);
++
++PVR2D_IMPORT
++PVR2DERROR PVR2DBltClipped(PVR2DCONTEXTHANDLE hContext,
++ PVR2DBLTINFO *pBltInfo,
++ PVR2D_ULONG ulNumClipRects,
++ PVR2DRECT *pClipRects);
++
++PVR2D_EXPORT
++PVR2DERROR PVR2DSet1555Alpha (PVR2DCONTEXTHANDLE hContext,
++ PVR2D_UCHAR Alpha0, PVR2D_UCHAR Alpha1);
++
++PVR2D_IMPORT
++PVR2DERROR PVR2DQueryBlitsComplete(PVR2DCONTEXTHANDLE hContext,
++ const PVR2DMEMINFO *pMemInfo,
++ PVR2D_UINT uiWaitForComplete);
++
++PVR2D_IMPORT
++PVR2DERROR PVR2DSetPresentBltProperties(PVR2DCONTEXTHANDLE hContext,
++ PVR2D_ULONG ulPropertyMask,
++ PVR2D_LONG lSrcStride,
++ PVR2D_ULONG ulDstWidth,
++ PVR2D_ULONG ulDstHeight,
++ PVR2D_LONG lDstXPos,
++ PVR2D_LONG lDstYPos,
++ PVR2D_ULONG ulNumClipRects,
++ PVR2DRECT *pClipRects,
++ PVR2D_ULONG ulSwapInterval);
++
++PVR2D_IMPORT
++PVR2DERROR PVR2DPresentBlt(PVR2DCONTEXTHANDLE hContext,
++ PVR2DMEMINFO *pMemInfo,
++ PVR2D_LONG lRenderID);
++
++PVR2D_IMPORT
++PVR2DERROR PVR2DCreateFlipChain(PVR2DCONTEXTHANDLE hContext,
++ PVR2D_ULONG ulFlags,
++ PVR2D_ULONG ulNumBuffers,
++ PVR2D_ULONG ulWidth,
++ PVR2D_ULONG ulHeight,
++ PVR2DFORMAT eFormat,
++ PVR2D_LONG *plStride,
++ PVR2D_ULONG *pulFlipChainID,
++ PVR2DFLIPCHAINHANDLE *phFlipChain);
++
++PVR2D_IMPORT
++PVR2DERROR PVR2DDestroyFlipChain(PVR2DCONTEXTHANDLE hContext,
++ PVR2DFLIPCHAINHANDLE hFlipChain);
++
++PVR2D_IMPORT
++PVR2DERROR PVR2DGetFlipChainBuffers(PVR2DCONTEXTHANDLE hContext,
++ PVR2DFLIPCHAINHANDLE hFlipChain,
++ PVR2D_ULONG *pulNumBuffers,
++ PVR2DMEMINFO *psMemInfo[]);
++
++PVR2D_IMPORT
++PVR2DERROR PVR2DSetPresentFlipProperties(PVR2DCONTEXTHANDLE hContext,
++ PVR2DFLIPCHAINHANDLE hFlipChain,
++ PVR2D_ULONG ulPropertyMask,
++ PVR2D_LONG lDstXPos,
++ PVR2D_LONG lDstYPos,
++ PVR2D_ULONG ulNumClipRects,
++ PVR2DRECT *pClipRects,
++ PVR2D_ULONG ulSwapInterval);
++
++PVR2D_IMPORT
++PVR2DERROR PVR2DPresentFlip(PVR2DCONTEXTHANDLE hContext,
++ PVR2DFLIPCHAINHANDLE hFlipChain,
++ PVR2DMEMINFO *psMemInfo,
++ PVR2D_LONG lRenderID);
++
++PVR2D_IMPORT
++PVR2DERROR PVR2DGetAPIRev(PVR2D_LONG *lRevMajor, PVR2D_LONG *lRevMinor);
++
++PVR2D_IMPORT
++PVR2DERROR PVR2DLoadUseCode (const PVR2DCONTEXTHANDLE hContext, const PVR2D_UCHAR *pUseCode,
++ const PVR2D_ULONG UseCodeSize, PVR2D_HANDLE *pUseCodeHandle);
++PVR2D_IMPORT
++PVR2DERROR PVR2DFreeUseCode (const PVR2DCONTEXTHANDLE hContext, const PVR2D_HANDLE hUseCodeHandle);
++
++PVR2D_IMPORT
++PVR2DERROR PVR2DBlt3D (const PVR2DCONTEXTHANDLE hContext, const PPVR2D_3DBLT pBlt3D);
++
++PVR2D_IMPORT
++PVR2DERROR PVR2DBlt3DExt (const PVR2DCONTEXTHANDLE hContext, const PPVR2D_3DBLT_EXT pBlt3D);
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* _PVR2D_H_ */
++
++/******************************************************************************
++ End of file (pvr2d.h)
++******************************************************************************/
+diff -Nurp qt-everywhere-opensource-src-4.6.3-orig//src/3rdparty/powervr/wsegl2/wsegl.h qt-everywhere-opensource-src-4.6.3/src/3rdparty/powervr/wsegl2/wsegl.h
+--- qt-everywhere-opensource-src-4.6.3-orig//src/3rdparty/powervr/wsegl2/wsegl.h 1970-01-01 00:00:00.000000000 +0000
++++ qt-everywhere-opensource-src-4.6.3/src/3rdparty/powervr/wsegl2/wsegl.h 2011-05-16 22:51:52.702601769 +0000
+@@ -0,0 +1,285 @@
++/**********************************************************************
++*
++* Copyright(c) Imagination Technologies Ltd.
++*
++* The contents of this file are subject to the MIT license as set out below.
++*
++* Permission is hereby granted, free of charge, to any person obtaining a copy
++* of this software and associated documentation files (the "Software"),
++* to deal in the Software without restriction, including without limitation
++* the rights to use, copy, modify, merge, publish, distribute, sublicense,
++* and/or sell copies of the Software, and to permit persons to whom the
++* Software is furnished to do so, subject to the following conditions:
++*
++* The above copyright notice and this permission notice shall be included
++* in all copies or substantial portions of the Software.
++*
++* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
++* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
++* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
++* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
++* OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
++* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
++*
++* This License is also included in this distribution in the file called
++* "COPYING".
++*
++******************************************************************************/
++
++
++
++#if !defined(__WSEGL_H__)
++#define __WSEGL_H__
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++/*
++// WSEGL Platform-specific definitions
++*/
++#if defined(__linux__)
++#define WSEGL_EXPORT __attribute__((visibility("default")))
++#define WSEGL_IMPORT
++#else
++#define WSEGL_EXPORT
++#define WSEGL_IMPORT
++#endif
++
++/*
++// WSEGL API Version Number
++*/
++
++#define WSEGL_VERSION 2
++#define WSEGL_DEFAULT_DISPLAY 0
++#define WSEGL_DEFAULT_NATIVE_ENGINE 0
++
++#define WSEGL_FALSE 0
++#define WSEGL_TRUE 1
++#define WSEGL_NULL 0
++
++#define WSEGL_UNREFERENCED_PARAMETER(param) (param) = (param)
++
++/*
++// WSEGL handles
++*/
++typedef void *WSEGLDisplayHandle;
++typedef void *WSEGLDrawableHandle;
++
++/*
++// Display capability type
++*/
++typedef enum WSEGLCapsType_TAG
++{
++ WSEGL_NO_CAPS = 0,
++ WSEGL_CAP_MIN_SWAP_INTERVAL = 1, /* System default value = 1 */
++ WSEGL_CAP_MAX_SWAP_INTERVAL = 2, /* System default value = 1 */
++ WSEGL_CAP_WINDOWS_USE_HW_SYNC = 3, /* System default value = 0 (FALSE) */
++ WSEGL_CAP_PIXMAPS_USE_HW_SYNC = 4, /* System default value = 0 (FALSE) */
++
++} WSEGLCapsType;
++
++/*
++// Display capability
++*/
++typedef struct WSEGLCaps_TAG
++{
++ WSEGLCapsType eCapsType;
++ unsigned long ui32CapsValue;
++
++} WSEGLCaps;
++
++/*
++// Drawable type
++*/
++#define WSEGL_NO_DRAWABLE 0x0
++#define WSEGL_DRAWABLE_WINDOW 0x1
++#define WSEGL_DRAWABLE_PIXMAP 0x2
++
++
++/*
++// Pixel format of display/drawable
++*/
++typedef enum WSEGLPixelFormat_TAG
++{
++ /* These must not be re-ordered */
++ WSEGL_PIXELFORMAT_RGB565 = 0,
++ WSEGL_PIXELFORMAT_ARGB4444 = 1,
++ WSEGL_PIXELFORMAT_ARGB8888 = 2,
++ WSEGL_PIXELFORMAT_ARGB1555 = 3,
++ WSEGL_PIXELFORMAT_ABGR8888 = 4,
++ WSEGL_PIXELFORMAT_XBGR8888 = 5,
++
++ /* These are compatibility names only; new WSEGL
++ * modules should not use them.
++ */
++ WSEGL_PIXELFORMAT_565 = WSEGL_PIXELFORMAT_RGB565,
++ WSEGL_PIXELFORMAT_4444 = WSEGL_PIXELFORMAT_ARGB4444,
++ WSEGL_PIXELFORMAT_8888 = WSEGL_PIXELFORMAT_ARGB8888,
++ WSEGL_PIXELFORMAT_1555 = WSEGL_PIXELFORMAT_ARGB1555,
++
++} WSEGLPixelFormat;
++
++/*
++// Transparent of display/drawable
++*/
++typedef enum WSEGLTransparentType_TAG
++{
++ WSEGL_OPAQUE = 0,
++ WSEGL_COLOR_KEY = 1,
++
++} WSEGLTransparentType;
++
++/*
++// Display/drawable configuration
++*/
++typedef struct WSEGLConfig_TAG
++{
++ /*
++ // Type of drawables this configuration applies to -
++ // OR'd values of drawable types.
++ */
++ unsigned long ui32DrawableType;
++
++ /* Pixel format */
++ WSEGLPixelFormat ePixelFormat;
++
++ /* Native Renderable - set to WSEGL_TRUE if native renderable */
++ unsigned long ulNativeRenderable;
++
++ /* FrameBuffer Level Parameter */
++ unsigned long ulFrameBufferLevel;
++
++ /* Native Visual ID */
++ unsigned long ulNativeVisualID;
++
++ /* Native Visual */
++ void *hNativeVisual;
++
++ /* Transparent Type */
++ WSEGLTransparentType eTransparentType;
++
++ /* Transparent Color - only used if transparent type is COLOR_KEY */
++ unsigned long ulTransparentColor; /* packed as 0x00RRGGBB */
++
++
++} WSEGLConfig;
++
++/*
++// WSEGL errors
++*/
++typedef enum WSEGLError_TAG
++{
++ WSEGL_SUCCESS = 0,
++ WSEGL_CANNOT_INITIALISE = 1,
++ WSEGL_BAD_NATIVE_DISPLAY = 2,
++ WSEGL_BAD_NATIVE_WINDOW = 3,
++ WSEGL_BAD_NATIVE_PIXMAP = 4,
++ WSEGL_BAD_NATIVE_ENGINE = 5,
++ WSEGL_BAD_DRAWABLE = 6,
++ WSEGL_BAD_MATCH = 7,
++ WSEGL_OUT_OF_MEMORY = 8,
++
++ /* These are compatibility names only; new WSEGL
++ * modules should not use them.
++ */
++ WSEGL_BAD_CONFIG = WSEGL_BAD_MATCH,
++
++} WSEGLError;
++
++/*
++// Drawable orientation (in degrees anti-clockwise)
++*/
++typedef enum WSEGLRotationAngle_TAG
++{
++ WSEGL_ROTATE_0 = 0,
++ WSEGL_ROTATE_90 = 1,
++ WSEGL_ROTATE_180 = 2,
++ WSEGL_ROTATE_270 = 3
++
++} WSEGLRotationAngle;
++
++/*
++// Drawable information required by OpenGL-ES driver
++*/
++typedef struct WSEGLDrawableParams_TAG
++{
++ /* Width in pixels of the drawable */
++ unsigned long ui32Width;
++
++ /* Height in pixels of the drawable */
++ unsigned long ui32Height;
++
++ /* Stride in pixels of the drawable */
++ unsigned long ui32Stride;
++
++ /* Pixel format of the drawable */
++ WSEGLPixelFormat ePixelFormat;
++
++ /* User space cpu virtual address of the drawable */
++ void *pvLinearAddress;
++
++ /* HW address of the drawable */
++ unsigned long ui32HWAddress;
++
++ /* Private data for the drawable */
++ void *hPrivateData;
++
++
++} WSEGLDrawableParams;
++
++
++/*
++// Table of function pointers that is returned by WSEGL_GetFunctionTablePointer()
++//
++// The first entry in the table is the version number of the wsegl.h header file that
++// the module has been written against, and should therefore be set to WSEGL_VERSION
++*/
++typedef struct WSEGL_FunctionTable_TAG
++{
++ unsigned long ui32WSEGLVersion;
++
++ WSEGLError (*pfnWSEGL_IsDisplayValid)(NativeDisplayType);
++
++ WSEGLError (*pfnWSEGL_InitialiseDisplay)(NativeDisplayType, WSEGLDisplayHandle *, const WSEGLCaps **, WSEGLConfig **);
++
++ WSEGLError (*pfnWSEGL_CloseDisplay)(WSEGLDisplayHandle);
++
++ WSEGLError (*pfnWSEGL_CreateWindowDrawable)(WSEGLDisplayHandle, WSEGLConfig *, WSEGLDrawableHandle *, NativeWindowType, WSEGLRotationAngle *);
++
++ WSEGLError (*pfnWSEGL_CreatePixmapDrawable)(WSEGLDisplayHandle, WSEGLConfig *, WSEGLDrawableHandle *, NativePixmapType, WSEGLRotationAngle *);
++
++ WSEGLError (*pfnWSEGL_DeleteDrawable)(WSEGLDrawableHandle);
++
++ WSEGLError (*pfnWSEGL_SwapDrawable)(WSEGLDrawableHandle, unsigned long);
++
++ WSEGLError (*pfnWSEGL_SwapControlInterval)(WSEGLDrawableHandle, unsigned long);
++
++ WSEGLError (*pfnWSEGL_WaitNative)(WSEGLDrawableHandle, unsigned long);
++
++ WSEGLError (*pfnWSEGL_CopyFromDrawable)(WSEGLDrawableHandle, NativePixmapType);
++
++ WSEGLError (*pfnWSEGL_CopyFromPBuffer)(void *, unsigned long, unsigned long, unsigned long, WSEGLPixelFormat, NativePixmapType);
++
++ WSEGLError (*pfnWSEGL_GetDrawableParameters)(WSEGLDrawableHandle, WSEGLDrawableParams *, WSEGLDrawableParams *);
++
++ WSEGLError (*pfnWSEGL_ConnectDrawable)(WSEGLDrawableHandle);
++
++ WSEGLError (*pfnWSEGL_DisconnectDrawable)(WSEGLDrawableHandle);
++
++
++} WSEGL_FunctionTable;
++
++
++WSEGL_IMPORT const WSEGL_FunctionTable *WSEGL_GetFunctionTablePointer(void);
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* __WSEGL_H__ */
++
++/******************************************************************************
++ End of file (wsegl.h)
++******************************************************************************/
+diff -Nurp qt-everywhere-opensource-src-4.6.3-orig//src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c qt-everywhere-opensource-src-4.6.3/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c
+--- qt-everywhere-opensource-src-4.6.3-orig//src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c 2010-06-02 02:03:17.000000000 +0000
++++ qt-everywhere-opensource-src-4.6.3/src/plugins/gfxdrivers/powervr/QWSWSEGL/pvrqwswsegl.c 2011-05-16 23:08:51.618597097 +0000
+@@ -378,6 +378,20 @@ static WSEGLError wseglGetDrawableParame
+ return WSEGL_SUCCESS;
+ }
+
++/* Function stub for ConnectDrawable() */
++static WSEGLError wseglConnectDrawable(WSEGLDrawableHandle hDrawable)
++{
++ WSEGL_UNREFERENCED_PARAMETER(hDrawable);
++ return WSEGL_SUCCESS;
++}
++
++/* Function stub for DisconnectDrawable() */
++static WSEGLError wseglDisconnectDrawable(WSEGLDrawableHandle hDrawable)
++{
++ WSEGL_UNREFERENCED_PARAMETER(hDrawable);
++ return WSEGL_SUCCESS;
++}
++
+ static WSEGL_FunctionTable const wseglFunctions = {
+ WSEGL_VERSION,
+ wseglIsDisplayValid,
+@@ -391,7 +405,9 @@ static WSEGL_FunctionTable const wseglFu
+ wseglWaitNative,
+ wseglCopyFromDrawable,
+ wseglCopyFromPBuffer,
+- wseglGetDrawableParameters
++ wseglGetDrawableParameters,
++ wseglConnectDrawable,
++ wseglDisconnectDrawable
+ };
+
+ /* Return the table of WSEGL functions to the EGL implementation */
diff --git a/recipes/qt4/qt-4.7.2/0010-phonon-gstreamer-rgb-endianess.patch b/recipes/qt4/qt-4.7.3/0010-phonon-gstreamer-rgb-endianess.patch
index d43366c3a4..d43366c3a4 100644
--- a/recipes/qt4/qt-4.7.2/0010-phonon-gstreamer-rgb-endianess.patch
+++ b/recipes/qt4/qt-4.7.3/0010-phonon-gstreamer-rgb-endianess.patch
diff --git a/recipes/qt4/qt-4.7.3/fix-translations.patch b/recipes/qt4/qt-4.7.3/fix-translations.patch
new file mode 100644
index 0000000000..fe20b5b73c
--- /dev/null
+++ b/recipes/qt4/qt-4.7.3/fix-translations.patch
@@ -0,0 +1,22 @@
+diff --git a/translations/translations.pro b/translations/translations.pro
+index cdaf04a..24fa668 100644
+--- a/translations/translations.pro
++++ b/translations/translations.pro
+@@ -20,7 +20,7 @@ updateqm.name = LRELEASE ${QMAKE_FILE_IN}
+ updateqm.CONFIG += no_link
+ QMAKE_EXTRA_COMPILERS += updateqm
+
+-isEmpty(vcproj) {
++!isEmpty(vcproj) {
+ QMAKE_LINK = @: IGNORE THIS LINE
+ OBJECTS_DIR =
+ win32:CONFIG -= embed_manifest_exe
+@@ -30,7 +30,7 @@ isEmpty(vcproj) {
+ phony_src.input = PHONY_DEPS
+ phony_src.output = phony.c
+ phony_src.variable_out = GENERATED_SOURCES
+- phony_src.commands = echo int main() { return 0; } > phony.c
++ phony_src.commands = echo \"int main() { return 0; }\" > phony.c
+ phony_src.name = CREATE phony.c
+ phony_src.CONFIG += combine
+ QMAKE_EXTRA_COMPILERS += phony_src
diff --git a/recipes/qt4/qt-4.7.2/g++.conf b/recipes/qt4/qt-4.7.3/g++.conf
index 80f925cc5e..80f925cc5e 100644
--- a/recipes/qt4/qt-4.7.2/g++.conf
+++ b/recipes/qt4/qt-4.7.3/g++.conf
diff --git a/recipes/qt4/qt-4.7.2/hack-out-pg2-4.7.0.patch b/recipes/qt4/qt-4.7.3/hack-out-pg2-4.7.0.patch
index 5c588ff0f7..5c588ff0f7 100644
--- a/recipes/qt4/qt-4.7.2/hack-out-pg2-4.7.0.patch
+++ b/recipes/qt4/qt-4.7.3/hack-out-pg2-4.7.0.patch
diff --git a/recipes/qt4/qt-4.7.2/linux.conf b/recipes/qt4/qt-4.7.3/linux.conf
index a54135513b..a54135513b 100644
--- a/recipes/qt4/qt-4.7.2/linux.conf
+++ b/recipes/qt4/qt-4.7.3/linux.conf
diff --git a/recipes/qt4/qt4-embedded-gles_4.7.2.bb b/recipes/qt4/qt4-embedded-gles_4.7.3.bb
index 8ab5a6c7a1..8ab5a6c7a1 100644
--- a/recipes/qt4/qt4-embedded-gles_4.7.2.bb
+++ b/recipes/qt4/qt4-embedded-gles_4.7.3.bb
diff --git a/recipes/qt4/qt4-embedded.inc b/recipes/qt4/qt4-embedded.inc
index af9d545b1d..168a8677e8 100644
--- a/recipes/qt4/qt4-embedded.inc
+++ b/recipes/qt4/qt4-embedded.inc
@@ -4,7 +4,7 @@ LICENSE = "GPL QPL"
PRIORITY = "optional"
HOMEPAGE = "http://www.trolltech.com"
DEPENDS += "directfb tslib"
-INC_PR = "r28"
+INC_PR = "r33"
QT_BASE_NAME ?= "qt4-embedded"
QT_BASE_LIB ?= "libqt-embedded"
diff --git a/recipes/qt4/qt4-embedded_4.6.3.bb b/recipes/qt4/qt4-embedded_4.6.3.bb
index fe49fdba8f..8c883f54a8 100644
--- a/recipes/qt4/qt4-embedded_4.6.3.bb
+++ b/recipes/qt4/qt4-embedded_4.6.3.bb
@@ -5,3 +5,7 @@ PR = "${INC_PR}.2"
QT_CONFIG_FLAGS_append_armv6 = " -no-neon "
require qt-${PV}.inc
+
+# SRC_URI from qt4-embedded.inc was replaced in .inc above and qte.sh lost
+# Set necessary variables in the profile
+SRC_URI += "file://qte.sh"
diff --git a/recipes/qt4/qt4-embedded_4.7.2.bb b/recipes/qt4/qt4-embedded_4.7.3.bb
index 7e3d4b8325..47176a9c0b 100644
--- a/recipes/qt4/qt4-embedded_4.7.2.bb
+++ b/recipes/qt4/qt4-embedded_4.7.3.bb
@@ -8,6 +8,10 @@ QT_CONFIG_FLAGS_append_armv6 = " -no-neon "
require qt-${PV}.inc
+# SRC_URI from qt4-embedded.inc was replaced in .inc above and qte.sh lost
+# Set necessary variables in the profile
+SRC_URI += "file://qte.sh"
+
QT_CONFIG_FLAGS += " \
-exceptions \
"
diff --git a/recipes/qt4/qt4-native.inc b/recipes/qt4/qt4-native.inc
index ee702e9f9b..2156023793 100644
--- a/recipes/qt4/qt4-native.inc
+++ b/recipes/qt4/qt4-native.inc
@@ -6,7 +6,7 @@ PRIORITY = "optional"
LICENSE = "GPL"
PROVIDES = "qt4-tools-native"
-INC_PR = "r0"
+INC_PR = "r1"
inherit native
@@ -51,6 +51,10 @@ TOBUILD = "\
src/gui \
src/testlib \
src/qt3support \
+ src/tools/uic3 \
+ tools/linguist/lrelease \
+ tools/linguist/lupdate \
+ tools/qdbus \
"
do_compile() {
@@ -62,6 +66,18 @@ do_compile() {
NATIVE_INSTALL_WORKS = "1"
do_install() {
+ install -d ${D}${bindir}/
+ install -m 0755 bin/qmake ${D}${bindir}/qmake2
+ for i in moc uic uic3 rcc lrelease lupdate qdbuscpp2xml qdbusxml2cpp; do
+ install -m 0755 bin/${i} ${D}${bindir}/${i}4
+ done
+
+ install -d ${D}${datadir}/qt4/
+ cp -PfR mkspecs ${D}${datadir}/qt4/
+ ln -sf linux-g++ ${D}${datadir}/qt4/mkspecs/${BUILD_OS}-oe-g++
+ cp -f ${WORKDIR}/g++.conf ${WORKDIR}/linux.conf ${D}${datadir}/qt4/mkspecs/common/
+ install -m 0644 tools/porting/src/q3porting.xml ${D}${datadir}/qt4/
+
for i in ${TOBUILD}; do
cd ${S}/$i && oe_runmake install INSTALL_ROOT=${D}
done
diff --git a/recipes/qt4/qt4-native_4.7.2.bb b/recipes/qt4/qt4-native_4.7.3.bb
index 7e98035fe6..a6880a693a 100644
--- a/recipes/qt4/qt4-native_4.7.2.bb
+++ b/recipes/qt4/qt4-native_4.7.3.bb
@@ -15,5 +15,5 @@ EXTRA_OECONF += " -no-fast -silent -no-rpath"
TOBUILD := "src/tools/bootstrap ${TOBUILD}"
-SRC_URI[md5sum] = "66b992f5c21145df08c99d21847f4fdb"
-SRC_URI[sha256sum] = "d4783b524b90bcd270ccf6e7a30d5fb51696c47eb5de49ebc2d553cd3eb49336"
+SRC_URI[md5sum] = "49b96eefb1224cc529af6fe5608654fe"
+SRC_URI[sha256sum] = "d02b6fd69d089c01f4a787aa18175d074ccaecf8980a5956e328c2991905937e"
diff --git a/recipes/qt4/qt4-tools-sdk_4.7.2.bb b/recipes/qt4/qt4-tools-sdk_4.7.2.bb
deleted file mode 100644
index c86ac2a1ac..0000000000
--- a/recipes/qt4/qt4-tools-sdk_4.7.2.bb
+++ /dev/null
@@ -1,8 +0,0 @@
-require qt4-tools-sdk.inc
-
-PR = "${INC_PR}.0"
-
-DEFAULT_PREFERENCE = "-1"
-
-SRC_URI[md5sum] = "66b992f5c21145df08c99d21847f4fdb"
-SRC_URI[sha256sum] = "d4783b524b90bcd270ccf6e7a30d5fb51696c47eb5de49ebc2d553cd3eb49336"
diff --git a/recipes/qt4/qt4-tools-sdk_4.7.3.bb b/recipes/qt4/qt4-tools-sdk_4.7.3.bb
new file mode 100644
index 0000000000..832d3896f8
--- /dev/null
+++ b/recipes/qt4/qt4-tools-sdk_4.7.3.bb
@@ -0,0 +1,8 @@
+require qt4-tools-sdk.inc
+
+PR = "${INC_PR}.0"
+
+DEFAULT_PREFERENCE = "-1"
+
+SRC_URI[md5sum] = "49b96eefb1224cc529af6fe5608654fe"
+SRC_URI[sha256sum] = "d02b6fd69d089c01f4a787aa18175d074ccaecf8980a5956e328c2991905937e"
diff --git a/recipes/qt4/qt4-x11-free-gles_4.7.2.bb b/recipes/qt4/qt4-x11-free-gles_4.7.3.bb
index c5fd6f30ea..c5fd6f30ea 100644
--- a/recipes/qt4/qt4-x11-free-gles_4.7.2.bb
+++ b/recipes/qt4/qt4-x11-free-gles_4.7.3.bb
diff --git a/recipes/qt4/qt4-x11-free.inc b/recipes/qt4/qt4-x11-free.inc
index c4074225fb..70d85c2068 100644
--- a/recipes/qt4/qt4-x11-free.inc
+++ b/recipes/qt4/qt4-x11-free.inc
@@ -5,7 +5,7 @@ HOMEPAGE = "http://www.trolltech.com"
LICENSE = "GPL QPL"
DEPENDS += "virtual/libx11 fontconfig libxft libxext libxrender libxrandr libxcursor"
-INC_PR = "r24"
+INC_PR = "r28"
SRC_URI = "ftp://ftp.trolltech.com/qt/source/qt-x11-opensource-src-${PV}.tar.gz \
file://0001-cross-compile.patch \
diff --git a/recipes/qt4/qt4-x11-free_4.7.2.bb b/recipes/qt4/qt4-x11-free_4.7.3.bb
index 79a765ed74..79a765ed74 100644
--- a/recipes/qt4/qt4-x11-free_4.7.2.bb
+++ b/recipes/qt4/qt4-x11-free_4.7.3.bb
diff --git a/recipes/qt4/qt4.inc b/recipes/qt4/qt4.inc
index 52fa146d5d..b37e7ffb5c 100644
--- a/recipes/qt4/qt4.inc
+++ b/recipes/qt4/qt4.inc
@@ -17,8 +17,9 @@ EXTRA_OEMAKE = "-e"
EXTRA_ENV = 'QMAKE="${STAGING_BINDIR_NATIVE}/qmake2 -after \
INCPATH+=${STAGING_INCDIR}/freetype2 LIBS+=-L${STAGING_LIBDIR}" \
QMAKESPEC="${QMAKESPEC}" LINK="${CXX} -Wl,-rpath-link,${STAGING_LIBDIR}" \
- AR="${TARGET_PREFIX}ar cqs" \
- MOC="${STAGING_BINDIR_NATIVE}/moc4" UIC="${STAGING_BINDIR_NATIVE}/uic4" MAKE="make -e"'
+ AR="${TARGET_PREFIX}ar cqs" QMAKE_LRELEASE="${STAGING_BINDIR_NATIVE}/lrelease4" \
+ QMAKE_RCC="${STAGING_BINDIR_NATIVE}/rcc4" QMAKE_MOC="${STAGING_BINDIR_NATIVE}/moc4" \
+ QMAKE_UIC="${STAGING_BINDIR_NATIVE}/uic4" MAKE="make -e"'
export QT_CONF_PATH="${WORKDIR}/qt.conf"
@@ -90,7 +91,8 @@ OTHER_PACKAGES = "\
${QT_BASE_NAME}-pixeltool \
${QT_BASE_NAME}-qmlviewer \
${QT_BASE_NAME}-xmlpatterns \
- ${QT_BASE_NAME}-qt3to4"
+ ${QT_BASE_NAME}-qt3to4 \
+ ${QT_BASE_NAME}-qml-plugins"
PACKAGES += "${LIB_PACKAGES} ${DEV_PACKAGES} ${DBG_PACKAGES} ${OTHER_PACKAGES}"
PACKAGES_DYNAMIC = "${QT_BASE_NAME}-plugin-* ${QT_BASE_NAME}-translation-* ${QT_BASE_NAME}-fonts-*"
@@ -142,7 +144,8 @@ FILES_${QT_BASE_NAME}-makeqpf-dbg = "${bindir}/.debug/makeqpf"
FILES_${QT_BASE_NAME}-mkspecs = "${datadir}/${QT_DIR_NAME}/mkspecs/*"
FILES_${QT_BASE_NAME}-xmlpatterns = "${bindir}/xmlpatterns*"
FILES_${QT_BASE_NAME}-xmlpatterns-dbg = "${bindir}/.debug/xmlpatterns*"
-
+FILES_${QT_BASE_NAME}-qml-plugins = "${libdir}/${QT_DIR_NAME}/imports/*"
+FILES_${QT_BASE_NAME}-qml-plugins-dbg = "${libdir}/${QT_DIR_NAME}/imports/*/*/*/.debug/* ${libdir}/${QT_DIR_NAME}/imports/*/.debug"
do_configure() {
unset QMAKESPEC
@@ -165,6 +168,7 @@ do_configure() {
echo "Libraries=${libdir}" >> $QT_CONF_PATH
echo "Binaries=${bindir}" >> $QT_CONF_PATH
echo "Plugins=${libdir}/${QT_DIR_NAME}/plugins" >> $QT_CONF_PATH
+ echo "Imports=${libdir}/${QT_DIR_NAME}/imports" >> $QT_CONF_PATH
echo "Data=${datadir}/${QT_DIR_NAME}" >> $QT_CONF_PATH
echo "Translations=${datadir}/${QT_DIR_NAME}/translations" >> $QT_CONF_PATH
echo "Settings=${sysconfdir}/${QT_DIR_NAME}" >> $QT_CONF_PATH
@@ -182,6 +186,7 @@ do_configure() {
-docdir ${docdir}/${QT_DIR_NAME} \
-headerdir ${includedir}/${QT_DIR_NAME} \
-plugindir ${libdir}/${QT_DIR_NAME}/plugins \
+ -importdir ${libdir}/${QT_DIR_NAME}/imports \
-translationdir ${datadir}/${QT_DIR_NAME}/translations \
-examplesdir ${bindir}/${QT_DIR_NAME}/examples \
-demosdir ${bindir}/${QT_DIR_NAME}/demos \
diff --git a/recipes/qte/qte-2.3.10/support_18bpp.patch b/recipes/qte/qte-2.3.10/support_18bpp.patch
new file mode 100644
index 0000000000..138c4ce0bc
--- /dev/null
+++ b/recipes/qte/qte-2.3.10/support_18bpp.patch
@@ -0,0 +1,275 @@
+diff -urN qt-2.3.10/configure qt-2.3.10_mod/configure
+--- qt-2.3.10/configure 2005-01-23 08:00:36.000000000 -0600
++++ qt-2.3.10_mod/configure 2006-10-21 23:13:29.000000000 -0500
+@@ -805,7 +805,8 @@
+ echo " 4. 4bpp grayscale - also enables 8bpp"
+ echo " 8. 8bpp"
+ echo " 16. 16bpp"
+- echo " 24. 24bpp - also enables 32bpp"
++ echo " 18. 18bpp - packed into 24bpp, cannot be enabled with 24bpp"
++ echo " 24. 24bpp - also enables 32bpp, cannot be enabled with 18bpp"
+ echo " 32. 32bpp"
+ echo
+ echo "Each depth adds around 100Kb on 80386."
+@@ -830,7 +831,7 @@
+
+ if [ -n "$DEPTHS" ]
+ then
+- DV=;D4=;D8=;D16=;D24=;D32=
++ DV=;D4=;D8=;D16=;D18=;D24=;D32=
+ for D in `echo "$DEPTHS" | sed -e 's/,/ /g'`
+ do
+ case "$D" in
+@@ -838,10 +839,20 @@
+ ;; 4) D4=y; D8=y
+ ;; 8) D8=y
+ ;; 16) D16=y
++ ;; 18) D18=y
+ ;; 24) D24=y; D32=y
+ ;; 32) D32=y
+ esac
+ done
++
++ if [ ! -z "$D18" -a ! -z "$D24" ]
++ then
++ echo
++ echo "WARNING: You have configured with depth 18 and 24."
++ echo " These depths are not compatible. Depth 24"
++ echo " will be disabled."
++ fi
++
+ if [ -z "$DV" ]
+ then
+ QT_CXX="$QT_CXX -DQT_NO_QWS_VGA_16"
+@@ -858,9 +869,19 @@
+ then
+ QT_CXX="$QT_CXX -DQT_NO_QWS_DEPTH_16"
+ fi
++ if [ -z "$D18" ]
++ then
++ QT_CXX="$QT_CXX -DQT_NO_QWS_DEPTH_18"
++ fi
+ if [ -z "$D24" ]
+ then
+ QT_CXX="$QT_CXX -DQT_NO_QWS_DEPTH_24"
++ else
++ # Disable depth 24 if depth 18 enabled
++ if [ ! -z "$D18" ]
++ then
++ QT_CXX="$QT_CXX -DQT_NO_QWS_DEPTH_24"
++ fi
+ fi
+ if [ -z "$D32" ]
+ then
+@@ -1326,7 +1347,7 @@
+ default ($QCONFIG).
+
+ -depths list ....... Comma-separated list of supported bit-per-pixel
+- depths, from: v, 4, 8, 16, 24, and 32. 'v' is VGA16.
++ depths, from: v, 4, 8, 16, 18, 24, and 32. 'v' is VGA16.
+
+ -accel-snap ........ Enable SciTech SNAP Graphics acceleration.
+ -accel-voodoo3 ..... Enable Voodoo3 acceleration.
+diff -urN qt-2.3.10/src/kernel/qgfxlinuxfb_qws.cpp qt-2.3.10_mod/src/kernel/qgfxlinuxfb_qws.cpp
+--- qt-2.3.10/src/kernel/qgfxlinuxfb_qws.cpp 2011-04-09 18:48:17.000000000 +0100
++++ qt-2.3.10_mod/src/kernel/qgfxlinuxfb_qws.cpp 2011-04-09 18:54:45.000000000 +0100
+@@ -134,6 +134,10 @@
+ }
+
+ d=vinfo.bits_per_pixel;
++ // 18-bpp-support
++ if ((d == 18) || (d == 19))
++ d = 24;
++ // End of 18-bpp-support
+ lstep=finfo.line_length;
+ int xoff = vinfo.xoffset;
+ int yoff = vinfo.yoffset;
+@@ -427,6 +431,15 @@
+ gbits=6;
+ bbits=5;
+ break;
++ // 18-bpp-support
++ case 18: case 19:
++ rbits=6;
++ gbits=6;
++ bbits=6;
++ vinfo.bits_per_pixel=24;
++ startupd=24;
++ break;
++ // End of 18-bpp-support
+ case 24: case 32:
+ rbits=gbits=bbits=8;
+ break;
+@@ -819,6 +832,10 @@
+ w=vinfo.xres;
+ h=vinfo.yres;
+ d=vinfo.bits_per_pixel;
++ // 18-bpp-support
++ if ((d == 18) || (d == 19))
++ d = 24;
++ // End of 18-bpp-support
+ lstep=finfo.line_length;
+ size=h*lstep;
+ }
+diff -urN qt-2.3.10/src/kernel/qgfxraster_qws.cpp qt-2.3.10_mod/src/kernel/qgfxraster_qws.cpp
+--- qt-2.3.10/src/kernel/qgfxraster_qws.cpp 2005-01-23 08:00:47.000000000 -0600
++++ qt-2.3.10_mod/src/kernel/qgfxraster_qws.cpp 2006-10-22 08:38:38.000000000 -0500
+@@ -161,25 +161,51 @@
+ #endif
+
+ #define MASK4BPP(x) (0xf0 >> (x))
+-
++// 18-bpp-support
+ inline void gfxSetRgb24( unsigned char *d, unsigned int p )
+ {
+- *d = p & 0x0000ff;
++#ifdef QT_NO_QWS_DEPTH_18
++ *d = p & 0x000ff;
+ *(d+1) = (p & 0x00ff00 ) >> 8;
+ *(d+2) = (p & 0xff0000 ) >> 16;
++#else
++ uint b = (p & 0x0000ff) >> 0;
++ uint g = (p & 0x00ff00) >> 8;
++ uint r = (p & 0xff0000) >> 16;
++ uint data = (b>>2) | ((g>>2) << 6) | ((r>>2) << 12);
++ *d = data & 0xff;
++ *(d+1) = (data >> 8) & 0xff;
++ *(d+2) = (data >> 16) & 0xff;
++#endif
+ }
+
+ inline void gfxSetRgb24( unsigned char *d, int r, int g, int b )
+ {
++#ifdef QT_NO_QWS_DEPTH_18
+ *d = b;
+ *(d+1) = g;
+ *(d+2) = r;
++#else
++ uint data = (b>>2) | ((g>>2) << 6) | ((r>>2) << 12);
++ *d = data & 0xff;
++ *(d+1) = (data >> 8) & 0xff;
++ *(d+2) = (data >> 16) & 0xff;
++#endif
+ }
+
+ inline unsigned int gfxGetRgb24( unsigned char *d )
+ {
++#ifdef QT_NO_QWS_DEPTH_18
+ return *d | (*(d+1)<<8) | (*(d+2)<<16);
++#else
++ uint data = *d | (*(d+1)<<8) | (*(d+2)<<16);
++ uint r = ((data >> 10) & 0xfc);
++ uint g = ((data >> 4) & 0xfc);
++ uint b = ((data << 2) & 0xfc);
++ return b | (g << 8) | (r << 16);
++#endif
+ }
++// End of 18-bpp-support
+
+ static bool simple_8bpp_alloc=FALSE;
+
+@@ -1767,11 +1793,12 @@
+ } else {
+ (*srcdata)+=4;
+ }
+-#if !defined( QT_NO_QWS_DEPTH_24 )
++// 18-bpp hack (mlk)
++//#if !defined( QT_NO_QWS_DEPTH_24 )
+ } else if(sdepth==24) {
+ ret = gfxGetRgb24( *srcdata );
+ (*srcdata) += 3;
+-#endif
++//#endif
+ #if !defined( QT_NO_IMAGE_16_BIT ) || !defined( QT_NO_QWS_DEPTH_16 )
+ } else if(sdepth==16) {
+ unsigned short int hold=*((unsigned short int *)(*srcdata));
+@@ -3963,9 +3990,22 @@
+ unsigned char *alphaptr = (unsigned char *)alphabuf;
+ unsigned char *avp = alphas;
+ int loopc;
+-
++// 18-bpp-support
++#ifdef QT_NO_QWS_DEPTH_18
+ memcpy( alphabuf, myptr+x1*3, w*3 );
+-
++#else
++ { uchar *srcptr24 = myptr+x1*3;
++ uchar *dstptr24 = (uchar*)alphabuf;
++ for ( int i = 0; i < w; i++ ) {
++ uint pix = gfxGetRgb24(srcptr24);
++ dstptr24[2] = (pix >> 16) & 0xff;
++ dstptr24[1] = (pix >> 8) & 0xff;
++ dstptr24[0] = (pix >> 0) & 0xff;
++ srcptr24 += 3;
++ dstptr24 += 3;
++ } }
++#endif
++// End of 18-bpp-support
+ // Now blend with source data
+ unsigned char * srcptr=srcdata;
+ unsigned int srcval;
+@@ -5808,10 +5848,10 @@
+ } else if(d==8) {
+ ret = new QGfxRaster<8,0>(bytes,w,h);
+ #endif
+-#ifndef QT_NO_QWS_DEPTH_24
++//#ifndef QT_NO_QWS_DEPTH_24
+ } else if(d==24) {
+ ret = new QGfxRaster<24,0>(bytes,w,h);
+-#endif
++//#endif
+ #ifndef QT_NO_QWS_DEPTH_32
+ } else if(d==32) {
+ ret = new QGfxRaster<32,0>(bytes,w,h);
+diff -urN qt-2.3.10/src/kernel/qgfxtransformed_qws.cpp qt-2.3.10_mod/src/kernel/qgfxtransformed_qws.cpp
+--- qt-2.3.10/src/kernel/qgfxtransformed_qws.cpp 2005-01-23 08:00:46.000000000 -0600
++++ qt-2.3.10_mod/src/kernel/qgfxtransformed_qws.cpp 2006-10-22 00:57:27.000000000 -0500
+@@ -1020,10 +1020,10 @@
+ } else if (d==8) {
+ ret = new QGfxTransformedRaster<8,0>(bytes,w,h);
+ #endif
+-#ifndef QT_NO_QWS_DEPTH_24
++//#ifndef QT_NO_QWS_DEPTH_24
+ } else if (d==24) {
+ ret = new QGfxTransformedRaster<24,0>(bytes,w,h);
+-#endif
++//#endif
+ #ifndef QT_NO_QWS_DEPTH_32
+ } else if (d==32) {
+ ret = new QGfxTransformedRaster<32,0>(bytes,w,h);
+diff -urN qt-2.3.10/src/kernel/qgfxvfb_qws.cpp qt-2.3.10_mod/src/kernel/qgfxvfb_qws.cpp
+--- qt-2.3.10/src/kernel/qgfxvfb_qws.cpp 2005-01-23 08:00:47.000000000 -0600
++++ qt-2.3.10_mod/src/kernel/qgfxvfb_qws.cpp 2006-10-22 00:19:30.000000000 -0500
+@@ -288,10 +288,14 @@
+ d = hdr->depth;
+ lstep = hdr->linestep;
+
+-#ifdef DEBUG
++//#ifdef DEBUG
+ qDebug( "Connected to VFB server: %d x %d x %d", w, h, d );
+-#endif
++//#endif
+
++// 18-bpp-support
++ if ( (d == 18) || (d == 19) )
++ d = 24;
++// End of 18-bpp-support
+ size = lstep * h;
+ mapsize = size;
+ screencols = hdr->numcols;
+@@ -434,6 +438,15 @@
+ else
+ ret = new QGfxRaster<32,0>(bytes,w,h);
+ #endif
++// 18-bpp-support
++//#ifndef QT_NO_QWS_DEPTH_24
++ } else if (d==24) {
++ if ( bytes == qt_screen->base() )
++ ret = new QGfxVFb<24,0>(bytes,w,h);
++ else
++ ret = new QGfxRaster<24,0>(bytes,w,h);
++//#endif
++// 18-bpp-support
+ } else {
+ qFatal("Can't drive depth %d",d);
+ }
diff --git a/recipes/qte/qte-common_2.3.10.inc b/recipes/qte/qte-common_2.3.10.inc
index 2eed76d1cc..40b8446508 100644
--- a/recipes/qte/qte-common_2.3.10.inc
+++ b/recipes/qte/qte-common_2.3.10.inc
@@ -48,6 +48,7 @@ SRC_URI = "ftp://ftp.trolltech.com/pub/qt/source/qt-embedded-${PV}-free.tar.gz;m
file://remove-unused-kbdhandler.patch \
file://disable-dup-rotation.patch \
file://fix-qte-asm-include.patch \
+ file://support_18bpp.patch \
file://sharp_char.h \
file://switches.h "
@@ -83,7 +84,7 @@ EXTRA_OECONF_CONFIG = "-qconfig qpe"
EXTRA_OECONF_CONFIG_native = "-qconfig qpe -qvfb"
EXTRA_OECONF = "-system-jpeg -system-libpng -system-zlib -no-qvfb -no-xft -no-vnc -gif \
- -xplatform ${TARGET_OS}-${QTE_ARCH}-g++ ${EXTRA_OECONF_CONFIG} -depths 8,16,32"
+ -xplatform ${TARGET_OS}-${QTE_ARCH}-g++ ${EXTRA_OECONF_CONFIG} -depths 8,16,18,32"
EXTRA_OEMAKE = "-e"
#
diff --git a/recipes/qte/qte-mt_2.3.10.bb b/recipes/qte/qte-mt_2.3.10.bb
index 1a60f8315c..58bb7c81c1 100644
--- a/recipes/qte/qte-mt_2.3.10.bb
+++ b/recipes/qte/qte-mt_2.3.10.bb
@@ -1,5 +1,5 @@
require qte-common_${PV}.inc
-PR = "r29"
+PR = "r30"
EXTRA_OECONF += "-thread"
diff --git a/recipes/qte/qte_2.3.10.bb b/recipes/qte/qte_2.3.10.bb
index 1e92893e49..88bc07f033 100644
--- a/recipes/qte/qte_2.3.10.bb
+++ b/recipes/qte/qte_2.3.10.bb
@@ -1,5 +1,5 @@
require qte-common_${PV}.inc
-PR = "r54"
+PR = "r55"
SRC_URI[md5sum] = "1f7ad30113afc500cab7f5b2f4dec0d7"
diff --git a/recipes/sdr/dttsp_svn.bb b/recipes/sdr/dttsp_svn.bb
index 216a0a7ba1..2d5f7abe1f 100644
--- a/recipes/sdr/dttsp_svn.bb
+++ b/recipes/sdr/dttsp_svn.bb
@@ -1,6 +1,6 @@
DESCRIPTION = "Software Radio Core"
LICENSE = "GPLv3"
-DEPENDS = "fftwf jack"
+DEPENDS = "gsl fftwf jack"
PV = "${SRCREV}"
SRCREV = "241"
diff --git a/recipes/sdr/sdrshell-qt4_svn.bb b/recipes/sdr/sdrshell-qt4_svn.bb
index ec81f96f60..036e583595 100644
--- a/recipes/sdr/sdrshell-qt4_svn.bb
+++ b/recipes/sdr/sdrshell-qt4_svn.bb
@@ -1,11 +1,11 @@
DESCRIPTION = "SDR-Shell is Qt GUI for the sdr-core (DttSP) Software Defined Radio"
LICENSE = "GPLv2"
-DEPENDS = "dttsp"
+DEPENDS = "hamlib dttsp libusb1 ncurses"
inherit qt4x11
-SRCREV = "129"
+SRCREV = "154"
PV = "${SRCREV}"
SRC_URI = "svn://sdr-shell.googlecode.com/svn/branches;module=sdr-shell-v4;proto=http \
@@ -27,4 +27,3 @@ do_install() {
install -m 0755 ${S}/sdr-shell ${D}${bindir}
}
-
diff --git a/recipes/sflphone/sflphone-common/fix-Makefile.patch b/recipes/sflphone/sflphone-common/fix-Makefile.patch
index 5a5034aefb..f156c117b4 100644
--- a/recipes/sflphone/sflphone-common/fix-Makefile.patch
+++ b/recipes/sflphone/sflphone-common/fix-Makefile.patch
@@ -1,44 +1,28 @@
-diff -Nurd sflphone-common-orig/configure.ac sflphone-common/configure.ac
---- sflphone-common-orig/configure.ac 2011-01-14 20:29:03.000000000 +0100
-+++ sflphone-common/configure.ac 2011-01-15 03:01:11.000000000 +0100
-@@ -44,10 +44,6 @@
- libs/utilspp/Makefile \
- libs/utilspp/functor/Makefile \
- libs/utilspp/singleton/Makefile \
-- libs/dbus-c++/Makefile \
-- libs/dbus-c++/src/Makefile \
-- libs/dbus-c++/tools/Makefile \
-- libs/dbus-c++/data/Makefile \
- libs/iax2/Makefile])
-
- AC_CONFIG_FILES([src/Makefile \
-@@ -154,12 +150,9 @@
- dnl Check for GNU ccRTP
- PKG_PROG_PKG_CONFIG
-
--#Trying to set PJSIP using pkg-config
--#PKG_CHECK_MODULES(SIP, libpj-sfl, have_libpj=true, have_libpj=false)
--#if test "x${have_libpj}" = "xfalse" ; then
--# AC_MSG_ERROR([PJSIP not found. http://www.pjsip.org/download.htm])
--#fi
--#AC_SUBST(SIP_CFLAGS)
-+ PKG_CHECK_MODULES(PJLIB, libpj)
-+ AC_SUBST(PJLIB_CFLAGS)
-+ AC_SUBST(PJLIB_LIBS)
-
- dnl Check for uuid development package - name: uuid-dev
- dnl PKG_CHECK_MODULES(UUID, uuid >= ${UUID_MIN_VERSION})
-@@ -191,7 +184,7 @@
- LIBCCGNU2_MIN_VERSION=1.3.1
- PKG_CHECK_MODULES(CCGNU2, libccgnu2 >= ${LIBCCGNU2_MIN_VERSION})
- AC_SUBST(CCGNU2_LIBS)
+diff -Nurd sflphone-common/configure.ac sflphone-common.new//configure.ac
+--- sflphone-common/configure.ac 2011-04-05 01:01:39.000000000 +0200
++++ sflphone-common.new//configure.ac 2011-05-28 10:59:32.443337188 +0200
+@@ -43,10 +43,6 @@
+ libs/utilspp/Makefile \
+ libs/utilspp/functor/Makefile \
+ libs/utilspp/singleton/Makefile \
+- libs/dbus-c++/Makefile \
+- libs/dbus-c++/src/Makefile \
+- libs/dbus-c++/tools/Makefile \
+- libs/dbus-c++/data/Makefile \
+ libs/iax2/Makefile])
+
+ AC_CONFIG_FILES([src/Makefile \
+@@ -202,7 +198,7 @@
+ LIBCCGNU2_MIN_VERSION=1.3.1
+ PKG_CHECK_MODULES(CCGNU2, libccgnu2 >= ${LIBCCGNU2_MIN_VERSION},, AC_MSG_ERROR([Mising common cpp development package: libcommoncpp2-dev]))
+ AC_SUBST(CCGNU2_LIBS)
-AC_SUBST(CCGNU2_FLAGS)
+AC_SUBST(CCGNU2_CFLAGS)
- LIBCCEXT2_MIN_VERSION=1.3.1
- PKG_CHECK_MODULES(CCEXT2, libccext2 >= ${LIBCCEXT2_MIN_VERSION})
-@@ -214,6 +207,10 @@
- AC_SUBST(ZRTPCPP_LIBS)
+ LIBCCEXT2_MIN_VERSION=1.3.1
+ PKG_CHECK_MODULES(CCEXT2, libccext2 >= ${LIBCCEXT2_MIN_VERSION})
+@@ -225,6 +221,10 @@
+ AC_SUBST(ZRTPCPP_LIBS)
AC_SUBST(ZRTPCPP_CFLAGS)
+ LIBDBUSCPLUSPLUS_MIN_VERSION=0.6.0-pre1
@@ -47,46 +31,20 @@ diff -Nurd sflphone-common-orig/configure.ac sflphone-common/configure.ac
+AC_SUBST(DBUSCPLUSPLUS_CFLAGS)
dnl DBus-C++ detection (used to be in library own build system)
- DBUS_REQUIRED_VERSION=0.60
-diff -Nurd sflphone-common-orig/globals.mak sflphone-common/globals.mak
---- sflphone-common-orig/globals.mak 2011-01-14 20:29:03.000000000 +0100
-+++ sflphone-common/globals.mak 2011-01-15 03:00:04.000000000 +0100
-@@ -7,34 +7,6 @@
- sflcodecdir=$(sfllibdir)/codecs
- sflplugindir=$(sfllibdir)/plugins
+ DBUS_REQUIRED_VERSION=0.60
+diff -Nurd sflphone-common/globals.mak sflphone-common.new//globals.mak
+--- sflphone-common/globals.mak 2011-04-05 01:01:39.000000000 +0200
++++ sflphone-common.new//globals.mak 2011-05-28 11:00:10.586337202 +0200
+@@ -33,8 +33,6 @@
+ -I$(src)/libs/pjproject/pjmedia/include \
+ -I$(src)/libs/pjproject/pjnath/include
--ASTYLERC="$(top_srcdir)/../astylerc"
--indent="/usr/bin/astyle"
--
--# for pjsip
--PJSIP_LIBS= \
-- -L$(src)/libs/pjproject/pjnath/lib/ \
-- -L$(src)/libs/pjproject/pjsip/lib/ \
-- -L$(src)/libs/pjproject/pjlib/lib/ \
-- -L$(src)/libs/pjproject/pjlib-util/lib/ \
-- -L$(src)/libs/pjproject/pjmedia/lib/ \
-- -lpjnath-$(target) \
-- -lpjsua-$(target) \
-- -lpjsip-$(target) \
-- -lpjmedia-$(target) \
-- -lpjsip-simple-$(target) \
-- -lpjsip-ua-$(target) \
-- -lpjmedia-codec-$(target) \
-- -lpjlib-util-$(target) \
-- -lpj-$(target)
--
--SIP_CFLAGS=-I$(src)/libs/pjproject/pjsip/include \
-- -I$(src)/libs/pjproject/pjlib/include \
-- -I$(src)/libs/pjproject/pjlib-util/include \
-- -I$(src)/libs/pjproject/pjmedia/include \
-- -I$(src)/libs/pjproject/pjnath/include
--
-DBUSCPP_CFLAGS=$(top_srcdir)/libs/dbus-c++/include/dbus-c++
-
if BUILD_SPEEX
SPEEXCODEC=-DHAVE_SPEEX_CODEC
else
-@@ -50,7 +22,6 @@
+@@ -50,7 +48,6 @@
# Preprocessor flags
AM_CPPFLAGS = \
-I$(src)/libs \
@@ -94,7 +52,7 @@ diff -Nurd sflphone-common-orig/globals.mak sflphone-common/globals.mak
-I$(src)/libs/iax2 \
-I$(src)/libs/pjproject \
-I$(src)/src \
-@@ -69,10 +40,3 @@
+@@ -69,10 +66,3 @@
-DENABLE_TRACE \
$(SPEEXCODEC) \
$(GSMCODEC)
@@ -105,15 +63,15 @@ diff -Nurd sflphone-common-orig/globals.mak sflphone-common/globals.mak
- if [ -f $(ASTYLERC) ] ; then \
- find $(top_srcdir)/src/ -name \*.cpp -o -name \*.h | xargs $(indent) --options=$(ASTYLERC) ; \
- fi
-diff -Nurd sflphone-common-orig/libs/Makefile.am sflphone-common/libs/Makefile.am
---- sflphone-common-orig/libs/Makefile.am 2011-01-14 20:29:03.000000000 +0100
-+++ sflphone-common/libs/Makefile.am 2011-01-15 02:59:49.000000000 +0100
+diff -Nurd sflphone-common/libs/Makefile.am sflphone-common.new//libs/Makefile.am
+--- sflphone-common/libs/Makefile.am 2011-04-05 01:01:39.000000000 +0200
++++ sflphone-common.new//libs/Makefile.am 2011-05-28 11:00:35.028337210 +0200
@@ -1 +1 @@
-SUBDIRS = utilspp iax2 dbus-c++
+SUBDIRS = utilspp iax2
-diff -Nurd sflphone-common-orig/src/audio/alsa/Makefile.am sflphone-common/src/audio/alsa/Makefile.am
---- sflphone-common-orig/src/audio/alsa/Makefile.am 2011-01-14 20:29:03.000000000 +0100
-+++ sflphone-common/src/audio/alsa/Makefile.am 2011-01-15 02:59:49.000000000 +0100
+diff -Nurd sflphone-common/src/audio/alsa/Makefile.am sflphone-common.new//src/audio/alsa/Makefile.am
+--- sflphone-common/src/audio/alsa/Makefile.am 2011-04-05 01:01:39.000000000 +0200
++++ sflphone-common.new//src/audio/alsa/Makefile.am 2011-05-28 11:00:59.180337220 +0200
@@ -4,5 +4,7 @@
libalsalayer_la_SOURCES = alsalayer.cpp
@@ -122,44 +80,57 @@ diff -Nurd sflphone-common-orig/src/audio/alsa/Makefile.am sflphone-common/src/a
+
noinst_HEADERS = alsalayer.h
-diff -Nurd sflphone-common-orig/src/audio/audiortp/Makefile.am sflphone-common/src/audio/audiortp/Makefile.am
---- sflphone-common-orig/src/audio/audiortp/Makefile.am 2011-01-14 20:29:03.000000000 +0100
-+++ sflphone-common/src/audio/audiortp/Makefile.am 2011-01-15 02:59:49.000000000 +0100
-@@ -10,6 +10,8 @@
- ZrtpSessionCallback.cpp \
- AudioSrtpSession.cpp
+diff -Nurd sflphone-common/src/audio/audiortp/Makefile.am sflphone-common.new//src/audio/audiortp/Makefile.am
+--- sflphone-common/src/audio/audiortp/Makefile.am 2011-04-05 01:01:39.000000000 +0200
++++ sflphone-common.new//src/audio/audiortp/Makefile.am 2011-05-28 11:01:31.196337231 +0200
+@@ -2,6 +2,8 @@
+
+ noinst_LTLIBRARIES = libaudiortp.la
+libaudiortp_la_CXXFLAGS = @DBUSCPLUSPLUS_CFLAGS@
+
- noinst_HEADERS = \
- AudioRtpRecordHandler.h \
- AudioRtpFactory.h \
-diff -Nurd sflphone-common-orig/src/audio/Makefile.am sflphone-common/src/audio/Makefile.am
---- sflphone-common-orig/src/audio/Makefile.am 2011-01-14 20:29:03.000000000 +0100
-+++ sflphone-common/src/audio/Makefile.am 2011-01-15 02:59:49.000000000 +0100
-@@ -45,6 +45,8 @@
- dcblocker.h \
- samplerateconverter.h
+ libaudiortp_la_SOURCES = \
+ AudioRtpSession.cpp \
+ AudioRtpRecordHandler.cpp \
+diff -Nurd sflphone-common/src/audio/Makefile.am sflphone-common.new//src/audio/Makefile.am
+--- sflphone-common/src/audio/Makefile.am 2011-04-05 01:01:39.000000000 +0200
++++ sflphone-common.new//src/audio/Makefile.am 2011-05-28 11:03:13.367337267 +0200
+@@ -8,6 +8,8 @@
+ # SPEEXDSP=-DHAVE_SPEEXDSP_LIB
+ # endif
+libaudio_la_CXXFLAGS = @DBUSCPLUSPLUS_CFLAGS@
+
- libaudio_la_LIBADD = \
- ./audiortp/libaudiortp.la \
- ./codecs/libcodecdescriptor.la \
-diff -Nurd sflphone-common-orig/src/audio/pulseaudio/Makefile.am sflphone-common/src/audio/pulseaudio/Makefile.am
---- sflphone-common-orig/src/audio/pulseaudio/Makefile.am 2011-01-14 20:29:03.000000000 +0100
-+++ sflphone-common/src/audio/pulseaudio/Makefile.am 2011-01-15 02:59:49.000000000 +0100
-@@ -6,6 +6,7 @@
+ libaudio_la_SOURCES = \
+ audioloop.cpp \
+ ringbuffer.cpp \
+diff -Nurd sflphone-common/src/audio/pulseaudio/Makefile.am sflphone-common.new//src/audio/pulseaudio/Makefile.am
+--- sflphone-common/src/audio/pulseaudio/Makefile.am 2011-04-05 01:01:39.000000000 +0200
++++ sflphone-common.new//src/audio/pulseaudio/Makefile.am 2011-05-28 11:02:03.934337242 +0200
+@@ -2,6 +2,8 @@
+
+ noinst_LTLIBRARIES = libpulselayer.la
+
++libpulselayer_la_CXXFLAGS = @DBUSCPLUSPLUS_CFLAGS@
++
+ libpulselayer_la_SOURCES = \
audiostream.cpp \
pulselayer.cpp
+diff -Nurd sflphone-common/src/audio/sound/Makefile.am sflphone-common.new//src/audio/sound/Makefile.am
+--- sflphone-common/src/audio/sound/Makefile.am 2011-04-05 01:01:39.000000000 +0200
++++ sflphone-common.new//src/audio/sound/Makefile.am 2011-05-28 11:02:48.411337259 +0200
+@@ -2,6 +2,8 @@
-+libpulselayer_la_CXXFLAGS = @DBUSCPLUSPLUS_CFLAGS@
+ noinst_LTLIBRARIES = libsound.la
- noinst_HEADERS = \
- audiostream.h \
-diff -Nurd sflphone-common-orig/src/dbus/Makefile.am sflphone-common/src/dbus/Makefile.am
---- sflphone-common-orig/src/dbus/Makefile.am 2011-01-14 20:29:03.000000000 +0100
-+++ sflphone-common/src/dbus/Makefile.am 2011-01-15 02:59:49.000000000 +0100
++libsound_la_CXXFLAGS = @DBUSCPLUSPLUS_CFLAGS@
++
+ libsound_la_SOURCES = \
+ audiofile.cpp \
+ tone.cpp \
+diff -Nurd sflphone-common/src/dbus/Makefile.am sflphone-common.new//src/dbus/Makefile.am
+--- sflphone-common/src/dbus/Makefile.am 2011-04-05 01:01:39.000000000 +0200
++++ sflphone-common.new//src/dbus/Makefile.am 2011-05-28 11:04:16.179337289 +0200
@@ -1,6 +1,6 @@
include $(top_srcdir)/globals.mak
@@ -179,21 +150,21 @@ diff -Nurd sflphone-common-orig/src/dbus/Makefile.am sflphone-common/src/dbus/Ma
noinst_HEADERS = \
callmanager.h \
-diff -Nurd sflphone-common-orig/src/history/Makefile.am sflphone-common/src/history/Makefile.am
---- sflphone-common-orig/src/history/Makefile.am 2011-01-14 20:29:03.000000000 +0100
-+++ sflphone-common/src/history/Makefile.am 2011-01-15 02:59:49.000000000 +0100
-@@ -4,6 +4,8 @@
+diff -Nurd sflphone-common/src/history/Makefile.am sflphone-common.new//src/history/Makefile.am
+--- sflphone-common/src/history/Makefile.am 2011-04-05 01:01:39.000000000 +0200
++++ sflphone-common.new//src/history/Makefile.am 2011-05-28 11:04:37.341337298 +0200
+@@ -2,6 +2,8 @@
- noinst_LTLIBRARIES = libhistory.la
+ SUBDIRS =
+libhistory_la_CXXFLAGS = @DBUSCPLUSPLUS_CFLAGS@
+
+ noinst_LTLIBRARIES = libhistory.la
+
libhistory_la_SOURCES = \
- historyitem.h \
- historyitem.cpp \
-diff -Nurd sflphone-common-orig/src/iax/Makefile.am sflphone-common/src/iax/Makefile.am
---- sflphone-common-orig/src/iax/Makefile.am 2011-01-14 20:29:03.000000000 +0100
-+++ sflphone-common/src/iax/Makefile.am 2011-01-15 02:59:49.000000000 +0100
+diff -Nurd sflphone-common/src/iax/Makefile.am sflphone-common.new//src/iax/Makefile.am
+--- sflphone-common/src/iax/Makefile.am 2011-04-05 01:01:39.000000000 +0200
++++ sflphone-common.new//src/iax/Makefile.am 2011-05-28 11:04:58.246337305 +0200
@@ -10,7 +10,8 @@
iaxvoiplink.cpp
@@ -204,25 +175,19 @@ diff -Nurd sflphone-common-orig/src/iax/Makefile.am sflphone-common/src/iax/Make
noinst_HEADERS = \
iaxaccount.h \
-diff -Nurd sflphone-common-orig/src/Makefile.am sflphone-common/src/Makefile.am
---- sflphone-common-orig/src/Makefile.am 2011-01-14 20:29:03.000000000 +0100
-+++ sflphone-common/src/Makefile.am 2011-01-15 03:02:12.000000000 +0100
-@@ -38,11 +38,12 @@
+diff -Nurd sflphone-common/src/Makefile.am sflphone-common.new//src/Makefile.am
+--- sflphone-common/src/Makefile.am 2011-04-05 01:01:39.000000000 +0200
++++ sflphone-common.new//src/Makefile.am 2011-05-28 11:06:03.630337329 +0200
+@@ -40,7 +40,7 @@
sflphoned_CXXFLAGS = \
-DPREFIX=\"$(prefix)\" -DPROGSHAREDIR=\"${datadir}/sflphone\" $(IAX_CXXFLAG) $(NETWORKMANAGER) \
- -DVERSION=\"$(VERSION)\"
-+ -DVERSION=\"$(VERSION)\" \
-+ @DBUSCPLUSPLUS_CFLAGS@
++ -DVERSION=\"$(VERSION)\" @DBUSCPLUSPLUS_CFLAGS@
# libsflphone
--sflphoned_LDADD = ./libsflphone.la $(libssl_LIBS) -lcrypto
-+sflphoned_LDADD = ./libsflphone.la $(libssl_LIBS) -lcrypto @PJLIB_LIBS@
- noinst_LTLIBRARIES = libsflphone.la
-
- noinst_HEADERS = \
-@@ -64,7 +65,6 @@
+@@ -66,7 +66,6 @@
libsflphone_la_LIBADD = \
$(src)/libs/utilspp/libutilspp.la \
$(src)/libs/iax2/libiax2.la \
@@ -230,7 +195,7 @@ diff -Nurd sflphone-common-orig/src/Makefile.am sflphone-common/src/Makefile.am
$(IAX_LIB) \
./im/libim.la \
./sip/libsiplink.la \
-@@ -76,10 +76,11 @@
+@@ -78,6 +77,7 @@
./history/libhistory.la
libsflphone_la_LDFLAGS = \
@@ -238,12 +203,7 @@ diff -Nurd sflphone-common-orig/src/Makefile.am sflphone-common/src/Makefile.am
@CCGNU2_LIBS@ \
@CCEXT2_LIBS@ \
@ZRTPCPP_LIBS@ \
-- $(PJSIP_LIBS) \
-+ @PJLIB_LIBS@ \
- @CCRTP_LIBS@ \
- @ALSA_LIBS@ \
- @PULSEAUDIO_LIBS@ \
-@@ -90,10 +91,11 @@
+@@ -92,6 +92,7 @@
@xml_LIBS@
libsflphone_la_CFLAGS = \
@@ -251,45 +211,17 @@ diff -Nurd sflphone-common-orig/src/Makefile.am sflphone-common/src/Makefile.am
@CCGNU2_CFLAGS@ \
@CCEXT2_CFLAGS@ \
@ZRTPCPP_CFLAGS@ \
-- $(PJSIP_CFLAGS) \
-+ @PJLIB_CFLAGS@ \
- @CCRTP_CFLAGS@ \
- @ALSA_CFLAGS@ \
- @PULSEAUDIO_CFLAGS@ \
-@@ -104,5 +106,3 @@
- @xml_CFLAGS@
-
- libsflphone_la_SOURCES =
--
--all: indent
-diff -Nurd sflphone-common-orig/src/sip/Makefile.am sflphone-common/src/sip/Makefile.am
---- sflphone-common-orig/src/sip/Makefile.am 2011-01-14 20:29:03.000000000 +0100
-+++ sflphone-common/src/sip/Makefile.am 2011-01-15 02:59:49.000000000 +0100
-@@ -21,4 +21,8 @@
+diff -Nurd sflphone-common/src/sip/Makefile.am sflphone-common.new//src/sip/Makefile.am
+--- sflphone-common/src/sip/Makefile.am 2011-04-05 01:01:39.000000000 +0200
++++ sflphone-common.new//src/sip/Makefile.am 2011-05-28 11:06:37.973337340 +0200
+@@ -21,4 +21,9 @@
sipvoiplink.h
libsiplink_la_CXXFLAGS = \
- @PCRE_LIBS@
++ @PCRE_LIBS@ \
+ @DBUSCPLUSPLUS_CFLAGS@
++
+libsiplink_la_LIBADD = \
+ @PCRE_LIBS@ \
-+ @DBUSCPLUSPLUS_LIBS@ \
-+ @PJLIB_LIBS@
-diff -Nurd sflphone-common-orig/src/sip/sipvoiplink.cpp sflphone-common/src/sip/sipvoiplink.cpp
---- sflphone-common/src/sip/sipvoiplink.cpp 2011-01-15 12:14:14.000000000 +0100
-+++ sflphone-common/src/sip/sipvoiplink.cpp 2011-01-15 12:14:14.000000000 +0100
-@@ -49,10 +49,10 @@
-
- #include "audio/audiolayer.h"
-
--#include "pjsip/sip_endpoint.h"
--#include "pjsip/sip_transport_tls.h"
--#include "pjsip/sip_transport_tls.h"
--#include "pjsip/sip_uri.h"
-+#include <pjsip/sip_endpoint.h>
-+#include <pjsip/sip_transport_tls.h>
-+#include <pjsip/sip_transport_tls.h>
-+#include <pjsip/sip_uri.h>
- #include <pjnath.h>
-
- #include <netinet/in.h>
++ @DBUSCPLUSPLUS_LIBS@
diff --git a/recipes/sflphone/sflphone-common_0.9.12.bb b/recipes/sflphone/sflphone-common_0.9.13.bb
index ea149d9e29..0877e7b2f1 100644
--- a/recipes/sflphone/sflphone-common_0.9.12.bb
+++ b/recipes/sflphone/sflphone-common_0.9.13.bb
@@ -5,19 +5,28 @@ LICENSE = "GPLv3"
DEPENDS = "blktool alsa-lib expat-native dbus-native openssl \
pulseaudio libsamplerate0 commoncpp2 ccrtp libzrtpcpp \
- libpcre dbus-c++ dbus-c++-native sflphone-pjproject speex libgsm"
+ libpcre dbus-c++ dbus-c++-native speex libgsm libyaml"
-SRC_URI = "https://projects.savoirfairelinux.com/attachments/download/1977/sflphone-${PV}.tar.gz \
+SRC_URI = "https://projects.savoirfairelinux.com/attachments/download/2162/sflphone-0.9.13.tar.gz \
file://fix-Makefile.patch"
-SRC_URI[md5sum] = "f784b5dd02542a5beb07d872d50bd8ee"
-SRC_URI[sha256sum] = "eab77836d1205402ad05fc33af2fb9734f69743eabbec4d93fdb5ae7bfdef02b"
+SRC_URI[md5sum] = "203bae7342b80ab87c1c606232d9b38e"
+SRC_URI[sha256sum] = "c264c325c3820189772e63c9cd24ed72f3947f7cb15e8e2d939295ebfcc599fb"
S = "${WORKDIR}/sflphone-${PV}/${PN}"
inherit autotools
-EXTRA_OECONF = "--without-networkmanager"
+EXTRA_OECONF = "--without-networkmanager --without-celt"
FILES_${PN}-dbg += "${libdir}/sflphone/.debug/ ${libdir}/sflphone/*/.debug/"
FILES_${PN} += "${datadir} ${libdir}/sflphone/"
+do_configure_prepend() {
+ cd ${S}/libs/pjproject
+ ${S}/libs/pjproject/autogen.sh
+ ${S}/libs/pjproject/configure ${CONFIGUREOPTS} --disable-ilbc-codec
+ make clean
+ make dep
+ make
+ cd ${S}
+} \ No newline at end of file
diff --git a/recipes/sflphone/sflphone-pjproject/fix-Makefile.patch b/recipes/sflphone/sflphone-pjproject/fix-Makefile.patch
deleted file mode 100644
index 35c7d6f8da..0000000000
--- a/recipes/sflphone/sflphone-pjproject/fix-Makefile.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-diff -Nurd pjproject-orig/aconfigure pjproject/aconfigure
---- pjproject-orig/aconfigure 2011-01-14 20:29:03.000000000 +0100
-+++ pjproject/aconfigure 2011-01-15 03:08:28.000000000 +0100
-@@ -534,7 +534,7 @@
- #
- # Initializations.
- #
--ac_default_prefix=/usr/local
-+ac_default_prefix=/usr
- ac_clean_files=
- ac_config_libobj_dir=.
- LIBOBJS=
-diff -Nurd pjproject-orig/libpj.pc.in pjproject/libpj.pc.in
---- pjproject-orig/libpj.pc.in 2011-01-14 20:29:03.000000000 +0100
-+++ pjproject/libpj.pc.in 2011-01-15 03:06:31.000000000 +0100
-@@ -1,6 +1,6 @@
- # Package Information for pkg-config
-
--prefix=@PREFIX@
-+prefix=/usr
- exec_prefix=${prefix}
- libdir=${exec_prefix}/lib
- includedir=${prefix}/include
-@@ -8,5 +8,5 @@
- Name: libpj
- Description: Multimedia communication library
- Version: 0.5.10.3
--Libs: -L${libdir} -lpjsua -lpjsip -lpjmedia -lpjsip-ua -lpjsip-simple -lpjsip-ua -lpjmedia-codec -lpjlib-util -lpj
-+Libs: -L${libdir} -lpjnath -lpjsua -lpjsip -lpjmedia -lpjsip-simple -lpjsip-ua -lpjmedia-codec -lpjlib-util -lpj -lpjsdp
- Cflags: -I${includedir}
-diff -Nurd pjproject-orig/Makefile pjproject/Makefile
---- pjproject-orig/Makefile 2011-01-14 20:29:03.000000000 +0100
-+++ pjproject/Makefile 2011-01-15 13:43:07.000000000 +0100
-@@ -90,7 +90,7 @@
- pjsua-test:
- cd tests/pjsua && python runall.py
-
--prefix = /usr/local
-+prefix = /usr
- install:
- mkdir -p $(DESTDIR)$(prefix)/lib
- cp -L $$(find . -name '*.a') $(DESTDIR)$(prefix)/lib
diff --git a/recipes/sflphone/sflphone-pjproject_0.9.12.bb b/recipes/sflphone/sflphone-pjproject_0.9.12.bb
deleted file mode 100644
index 29b39e5da2..0000000000
--- a/recipes/sflphone/sflphone-pjproject_0.9.12.bb
+++ /dev/null
@@ -1,21 +0,0 @@
-DESCRIPTION = "pjproject "
-SECTION = "libs"
-HOMEPAGE = "http://www.pjsip.org/"
-LICENSE = "GPLv3"
-
-DEPENDS = "alsa-lib openssl"
-
-PARALLEL_MAKE = ""
-
-SRC_URI = "https://projects.savoirfairelinux.com/attachments/download/1977/sflphone-0.9.12.tar.gz \
- file://fix-Makefile.patch"
-SRC_URI[md5sum] = "f784b5dd02542a5beb07d872d50bd8ee"
-SRC_URI[sha256sum] = "eab77836d1205402ad05fc33af2fb9734f69743eabbec4d93fdb5ae7bfdef02b"
-
-S = "${WORKDIR}/sflphone-${PV}/sflphone-common/libs/pjproject"
-
-inherit pkgconfig autotools
-
-do_compile_prepend() {
- oe_runmake dep
-} \ No newline at end of file
diff --git a/recipes/sip/sip-native_4.12.1.bb b/recipes/sip/sip-native_4.12.2.bb
index cd4329266c..ff8f7998d2 100644
--- a/recipes/sip/sip-native_4.12.1.bb
+++ b/recipes/sip/sip-native_4.12.2.bb
@@ -7,8 +7,8 @@ LICENSE = "GPL"
PR = "r0"
SRC_URI = "http://www.riverbankcomputing.co.uk/static/Downloads/sip4/sip-${PV}.tar.gz"
-SRC_URI[md5sum] = "0f8e8305b14c1812191de2e0ee22fea9"
-SRC_URI[sha256sum] = "e9d66e8830c2a58e6c17b9952710f67d495ddb84ce6f3d89400c8b52913381b5"
+SRC_URI[md5sum] = "9df80f88e0e4022cdd8a8891c6c38048"
+SRC_URI[sha256sum] = "3e42bea028a1713558b5b8a317af4195d3b0feaa6c179d99401a7048f1a3cec4"
S = "${WORKDIR}/sip-${PV}/sipgen"
inherit qt4x11 native python-dir
diff --git a/recipes/systemd/systemd-v26/0002-systemd-analyze-print-hostname-kernelversion-and-arc.patch b/recipes/systemd/systemd-v26/0002-systemd-analyze-print-hostname-kernelversion-and-arc.patch
deleted file mode 100644
index fad0134ef5..0000000000
--- a/recipes/systemd/systemd-v26/0002-systemd-analyze-print-hostname-kernelversion-and-arc.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 59c95610fe9601091807a089a463607bd0a01f24 Mon Sep 17 00:00:00 2001
-From: Koen Kooi <koen@dominion.thruhere.net>
-Date: Tue, 10 May 2011 20:27:29 +0200
-Subject: [PATCH 2/2] systemd-analyze: print hostname, kernelversion and arch at the top of the plot
-
-Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
----
- src/systemd-analyze | 5 ++++-
- 1 files changed, 4 insertions(+), 1 deletions(-)
-
-diff --git a/src/systemd-analyze b/src/systemd-analyze
-index 4f3e478..ae7dcfb 100755
---- a/src/systemd-analyze
-+++ b/src/systemd-analyze
-@@ -110,7 +110,7 @@ elif sys.argv[1] == 'blame':
- sys.stdout.write("%6lums %s\n" % ((aet - ixt) / 1000, name))
-
- elif sys.argv[1] == 'plot':
-- import cairo
-+ import cairo, os
-
- initrd_time, start_time, finish_time = acquire_start_time()
- data = acquire_time_data()
-@@ -160,6 +160,9 @@ elif sys.argv[1] == 'plot':
- context.stroke()
- context.restore()
-
-+ banner = "Running on %s (%s %s) %s" % (os.uname()[1], os.uname()[2], os.uname()[3], os.uname()[4])
-+ draw_text(context, 0, -15, banner, hcenter = 0, vcenter = 1)
-+
- for x in range(0, (finish_time - start_time)/10000, 100):
- draw_text(context, x, -5, "%lus" % (x/100), vcenter = 0, hcenter = 0)
-
---
-1.6.6.1
-
diff --git a/recipes/systemd/systemd-v26/0003-Angstrom-support.patch b/recipes/systemd/systemd-v26/0003-Angstrom-support.patch
deleted file mode 100644
index c75cee4c30..0000000000
--- a/recipes/systemd/systemd-v26/0003-Angstrom-support.patch
+++ /dev/null
@@ -1,165 +0,0 @@
-From 0fa5b59c5f484c80453e9d3201b87e4253f8bec3 Mon Sep 17 00:00:00 2001
-From: Koen Kooi <koen@dominion.thruhere.net>
-Date: Thu, 5 May 2011 17:15:41 +0200
-Subject: [PATCH 3/3] Angstrom support
-
-This commit consists of the initial work to include Angstrom as a ported
-distribution for systemd.
-
-Angstrom tries to follow the debian way as much as possible, but deviates
-where it doesn't make sense for 'embedded'.
-
-Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
----
- Makefile.am | 7 +++++++
- configure.ac | 7 +++++++
- src/locale-setup.c | 2 +-
- src/service.c | 10 +++++-----
- src/util.c | 12 ++++++++++++
- 5 files changed, 32 insertions(+), 6 deletions(-)
-
-diff --git a/Makefile.am b/Makefile.am
-index 49d2ee8..f3f7818 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -96,6 +96,12 @@ AM_CPPFLAGS += \
- -DKBD_SETFONT=\"/bin/setfont\" \
- -DDEFAULT_FONT=\"LatArCyrHeb-16\"
- else
-+if TARGET_ANGSTROM
-+AM_CPPFLAGS += \
-+ -DKBD_LOADKEYS=\"/usr/bin/loadkeys\" \
-+ -DKBD_SETFONT=\"/usr/bin/setfont\" \
-+ -DDEFAULT_FONT=\"LatArCyrHeb-16\"
-+else
- AM_CPPFLAGS += \
- -DKBD_LOADKEYS=\"/bin/loadkeys\" \
- -DKBD_SETFONT=\"/bin/setfont\" \
-@@ -105,6 +111,7 @@ endif
- endif
- endif
- endif
-+endif
-
- rootbin_PROGRAMS = \
- systemd \
-diff --git a/configure.ac b/configure.ac
-index dcd4b9d..b5b7ac3 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -295,6 +295,7 @@ if test "z$with_distro" = "z"; then
- test -f "/etc/altlinux-release" && with_distro="altlinux"
- test -f "/etc/mandriva-release" && with_distro="mandriva"
- test -f "/etc/meego-release" && with_distro="meego"
-+ test -f "/etc/angstrom-version" && with_distro="angstrom"
- if test "x`lsb_release -is 2>/dev/null`" = "xUbuntu"; then
- with_distro="ubuntu"
- fi
-@@ -375,6 +376,11 @@ case $with_distro in
- AC_DEFINE(TARGET_MEEGO, [], [Target is MeeGo])
- M4_DISTRO_FLAG=-DTARGET_MEEGO=1
- ;;
-+ angstrom)
-+ SYSTEM_SYSVRCND_PATH=/etc
-+ AC_DEFINE(TARGET_ANGSTROM, [], [Target is Ångström])
-+ M4_DISTRO_FLAG=-DTARGET_ANGSTROM=1
-+ ;;
- other)
- ;;
- *)
-@@ -425,6 +431,7 @@ AM_CONDITIONAL(TARGET_FRUGALWARE, test x"$with_distro" = xfrugalware)
- AM_CONDITIONAL(TARGET_ALTLINUX, test x"$with_distro" = xaltlinux)
- AM_CONDITIONAL(TARGET_MANDRIVA, test x"$with_distro" = xmandriva)
- AM_CONDITIONAL(TARGET_MEEGO, test x"$with_distro" = xmeego)
-+AM_CONDITIONAL(TARGET_ANGSTROM, test x"$with_distro" = xangstrom)
-
- AM_CONDITIONAL(HAVE_PLYMOUTH, test -n "$have_plymouth")
- AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")
-diff --git a/src/locale-setup.c b/src/locale-setup.c
-index d9adfa3..33111da 100644
---- a/src/locale-setup.c
-+++ b/src/locale-setup.c
-@@ -136,7 +136,7 @@ int locale_setup(void) {
- log_warning("Failed to read /etc/sysconfig/language: %s", strerror(-r));
- }
-
--#elif defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU)
-+#elif defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU) || defined(TARGET_ANGSTROM)
- if (r <= 0 &&
- (r = parse_env_file("/etc/default/locale", NEWLINE,
- "LANG", &variables[VARIABLE_LANG],
-diff --git a/src/service.c b/src/service.c
-index e7a5622..f826754 100644
---- a/src/service.c
-+++ b/src/service.c
-@@ -65,7 +65,7 @@ static const struct {
- { "boot.d", SPECIAL_SYSINIT_TARGET, RUNLEVEL_SYSINIT },
- #endif
-
--#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU) || defined(TARGET_FRUGALWARE)
-+#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU) || defined(TARGET_FRUGALWARE) || defined(TARGET_ANGSTROM)
- /* Debian style rcS.d */
- { "rcS.d", SPECIAL_SYSINIT_TARGET, RUNLEVEL_SYSINIT },
- #endif
-@@ -246,7 +246,7 @@ static char *sysv_translate_name(const char *name) {
- if (!(r = new(char, strlen(name) + sizeof(".service"))))
- return NULL;
-
--#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU)
-+#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU) || defined(TARGET_ANGSTROM)
- if (endswith(name, ".sh"))
- /* Drop Debian-style .sh suffix */
- strcpy(stpcpy(r, name) - 3, ".service");
-@@ -297,7 +297,7 @@ static int sysv_translate_facility(const char *name, const char *filename, char
- "x-display-manager", SPECIAL_DISPLAY_MANAGER_SERVICE,
- "null", NULL,
-
--#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU)
-+#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU) || defined(TARGET_ANGSTROM)
- "mail-transport-agent", SPECIAL_MAIL_TRANSFER_AGENT_TARGET,
- #endif
-
-@@ -887,7 +887,7 @@ static int service_load_sysv_name(Service *s, const char *name) {
-
- /* For SysV services we strip the boot.*, rc.* and *.sh
- * prefixes/suffixes. */
--#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU)
-+#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU) || defined(TARGET_ANGSTROM)
- if (endswith(name, ".sh.service"))
- return -ENOENT;
- #endif
-@@ -914,7 +914,7 @@ static int service_load_sysv_name(Service *s, const char *name) {
-
- r = service_load_sysv_path(s, path);
-
--#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU)
-+#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU) || defined(TARGET_ANGSTROM)
- if (r >= 0 && s->meta.load_state == UNIT_STUB) {
- /* Try Debian style *.sh source'able init scripts */
- strcat(path, ".sh");
-diff --git a/src/util.c b/src/util.c
-index f0051ee..5af9161 100644
---- a/src/util.c
-+++ b/src/util.c
-@@ -3426,6 +3426,18 @@ void status_welcome(void) {
-
- if (!ansi_color)
- const_color = "1;35"; /* Bright Magenta for MeeGo */
-+#elif defined(TARGET_ANGSTROM)
-+
-+ if (!pretty_name) {
-+ if ((r = read_one_line_file("/etc/angstrom-version", &pretty_name)) < 0) {
-+
-+ if (r != -ENOENT)
-+ log_warning("Failed to read /etc/angstrom-version: %s", strerror(-r));
-+ }
-+ }
-+
-+ if (!ansi_color)
-+ const_color = "1;35"; /* Bright Magenta for Angstrom */
- #endif
-
- if (!pretty_name && !const_pretty)
---
-1.6.6.1
-
diff --git a/recipes/systemd/systemd-v26/systemadm.patch b/recipes/systemd/systemd-v26/systemadm.patch
deleted file mode 100644
index b9c09dbbee..0000000000
--- a/recipes/systemd/systemd-v26/systemadm.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: git/src/systemadm.vala
-===================================================================
---- git.orig/src/systemadm.vala 2010-06-15 11:02:35.863509632 +0200
-+++ git/src/systemadm.vala 2010-06-15 11:06:16.305986249 +0200
-@@ -297,7 +297,7 @@
-
- bbox.pack_start(cancel_button, false, true, 0);
-
-- bus = Bus.get(session ? BusType.SESSION : BusType.SYSTEM);
-+ bus = DBus.Bus.get(session ? DBus.BusType.SESSION : DBus.BusType.SYSTEM);
-
- manager = bus.get_object(
- "org.freedesktop.systemd1",
diff --git a/recipes/systemd/systemd-v26/0001-systemd-disable-xml-file-stuff-and-introspection.patch b/recipes/systemd/systemd/0001-systemd-disable-xml-file-stuff-and-introspection.patch
index 63310aaecd..63310aaecd 100644
--- a/recipes/systemd/systemd-v26/0001-systemd-disable-xml-file-stuff-and-introspection.patch
+++ b/recipes/systemd/systemd/0001-systemd-disable-xml-file-stuff-and-introspection.patch
diff --git a/recipes/systemd/systemd-v26/execute.patch b/recipes/systemd/systemd/execute.patch
index c9f88c82ea..c9f88c82ea 100644
--- a/recipes/systemd/systemd-v26/execute.patch
+++ b/recipes/systemd/systemd/execute.patch
diff --git a/recipes/systemd/systemd-v26/serial-getty@.service b/recipes/systemd/systemd/serial-getty@.service
index daf0dac723..daf0dac723 100644
--- a/recipes/systemd/systemd-v26/serial-getty@.service
+++ b/recipes/systemd/systemd/serial-getty@.service
diff --git a/recipes/systemd/systemd_git.bb b/recipes/systemd/systemd_git.bb
index 52e37470a3..c39d761cf3 100644
--- a/recipes/systemd/systemd_git.bb
+++ b/recipes/systemd/systemd_git.bb
@@ -9,19 +9,20 @@ DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
PRIORITY = "optional"
SECTION = "base/shell"
-PV = "v26"
-PR = "r9"
-PR_append = "+${SRCPV}"
+inherit gitpkgv
+PKGV = "v${GITPKGVTAG}"
+
+# This gets reset to the proper version with PKGV above
+PV = "git"
+PR = "r10"
inherit autotools vala update-alternatives
-TAG = "7a6000a68241d23c9f6f6bde47b2cfa9c18189da"
+SRCREV = "da2617378523e007ec0c6efe99d0cebb2be994e1"
-SRC_URI = "git://anongit.freedesktop.org/systemd;protocol=git;tag=${TAG} \
+SRC_URI = "git://anongit.freedesktop.org/systemd;protocol=git \
file://execute.patch \
file://0001-systemd-disable-xml-file-stuff-and-introspection.patch \
- file://0002-systemd-analyze-print-hostname-kernelversion-and-arc.patch \
- file://0003-Angstrom-support.patch \
file://serial-getty@.service \
"
@@ -83,6 +84,6 @@ FILES_${PN} = " ${base_bindir}/* \
FILES_${PN}-dbg += "${base_libdir}/systemd/.debug ${base_libdir}/systemd/*/.debug"
-# util-linux -> hwclock, kbd -> loadkeys,setfont
-RRECOMMENDS_${PN} += "util-linux kbd kbd-consolefonts ${PN}-serialgetty"
+# kbd -> loadkeys,setfont
+RRECOMMENDS_${PN} += "kbd kbd-consolefonts ${PN}-serialgetty"
diff --git a/recipes/sysvinit/sysvinit-2.86/100_fix_ftbfs_enoioctlcmd.patch b/recipes/sysvinit/sysvinit-2.86/100_fix_ftbfs_enoioctlcmd.patch
new file mode 100644
index 0000000000..d4ed61ed23
--- /dev/null
+++ b/recipes/sysvinit/sysvinit-2.86/100_fix_ftbfs_enoioctlcmd.patch
@@ -0,0 +1,16 @@
+## Description: fixes FTBFS on natty
+## Origin/Author: http://bazaar.launchpad.net/~vcs-imports/sysvinit/trunk/revision/40
+Index: sysvinit-2.86/src/bootlogd.c
+===================================================================
+--- sysvinit-2.86.orig/src/bootlogd.c
++++ sysvinit-2.86/src/bootlogd.c
+@@ -228,6 +228,9 @@ int consolename(char *res, int rlen)
+ }
+
+ #ifdef TIOCGDEV
++# ifndef ENOIOCTLCMD
++# define ENOIOCTLCMD 515
++# endif
+ if (ioctl(0, TIOCGDEV, &kdev) == 0)
+ return findtty(res, rlen, (dev_t)kdev);
+ if (errno != ENOIOCTLCMD) return -1;
diff --git a/recipes/sysvinit/sysvinit_2.86.bb b/recipes/sysvinit/sysvinit_2.86.bb
index dacc397b87..e39ff40d8c 100644
--- a/recipes/sysvinit/sysvinit_2.86.bb
+++ b/recipes/sysvinit/sysvinit_2.86.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "System-V like init."
SECTION = "base"
LICENSE = "GPLv2+"
HOMEPAGE = "http://freshmeat.net/projects/sysvinit/"
-PR = "r64"
+PR = "r65"
# USE_VT and SERIAL_CONSOLE are generally defined by the MACHINE .conf.
# Set PACKAGE_ARCH appropriately.
@@ -20,6 +20,7 @@ SYSVINIT_ENABLED_GETTYS ?= "1"
SRC_URI = "ftp://ftp.cistron.nl/pub/people/miquels/sysvinit/sysvinit-${PV}.tar.gz \
file://install.patch \
+ file://100_fix_ftbfs_enoioctlcmd.patch \
file://need \
file://provide \
file://inittab \
diff --git a/recipes/tasks/task-base.bb b/recipes/tasks/task-base.bb
index 0b03d64096..8157db07ad 100644
--- a/recipes/tasks/task-base.bb
+++ b/recipes/tasks/task-base.bb
@@ -1,5 +1,5 @@
DESCRIPTION = "Merge machine and distro options to create a basic machine task/package"
-PR = "r94"
+PR = "r97"
inherit task
@@ -63,6 +63,9 @@ DISTRO_SSH_DAEMON ?= "dropbear"
# Distro can override apm provider
DISTRO_APM ?= "apm"
+# Distro can override alsa-state provider
+DISTRO_ALSA_STATE ?= "alsa-state"
+
#
# bluetooth manager
#
@@ -219,7 +222,7 @@ RDEPENDS_task-base-alsa = "\
# alsa-states are machine related so can be missing in feed, OSS support is optional
#
RRECOMMENDS_task-base-alsa = "\
- alsa-state \
+ ${DISTRO_ALSA_STATE} \
kernel-module-snd-mixer-oss \
kernel-module-snd-pcm-oss"
diff --git a/recipes/tasks/task-bug-feed-extra.bb b/recipes/tasks/task-bug-feed-extra.bb
index e144597168..b86c278c6b 100644
--- a/recipes/tasks/task-bug-feed-extra.bb
+++ b/recipes/tasks/task-bug-feed-extra.bb
@@ -18,6 +18,7 @@ DEPENDS = "\
cacao \
usb-modeswitch \
# com.buglabs.bug.jni.bluecove \
+ gdbserver \
"
-PR = "r11"
+PR = "r12"
diff --git a/recipes/tasks/task-bug.bb b/recipes/tasks/task-bug.bb
index 1317a6ec47..bf16646ed9 100644
--- a/recipes/tasks/task-bug.bb
+++ b/recipes/tasks/task-bug.bb
@@ -1,6 +1,6 @@
# Copyright (C) 2011 Bug Labs, Inc
-PR = "r88"
+PR = "r91"
ALLOW_EMPTY = "1"
@@ -25,7 +25,7 @@ RDEPENDS_${PN} = "${MACHINE_EXTRA_RRECOMMENDS} \
RDEPENDS_${PN}_append_bug20 = "bug2v4l2"
RDEPENDS_${PN}-network = "\
- dnsmasq \
+ dnsmasq-dbus \
hostap-daemon \
iptables \
eject \
@@ -34,7 +34,7 @@ RDEPENDS_${PN}-network = "\
connman \
connman-plugin-wifi \
# connman-plugin-ofono \
-# connman-plugin-ethernet \
+ connman-plugin-ethernet \
"
RDEPENDS_${PN}-x11-debug = "\
@@ -95,11 +95,13 @@ RDEPENDS_${PN}-java-osgi = " \
com.buglabs.bug.jni.rxtx \
com.buglabs.bug.jni.vonhippel \
com.buglabs.bug.jni.camera \
+ com.buglabs.bug.jni.motion \
com.buglabs.bug.module.camera \
com.buglabs.bug.module.vonhippel \
com.buglabs.bug.module.gps \
com.buglabs.bug.module.lcd \
com.buglabs.bug.module.video \
+ com.buglabs.bug.module.motion \
com.buglabs.bug.module \
com.buglabs.bug.program \
com.buglabs.bug.service \
diff --git a/recipes/tasks/task-sdk-gnuradio-native.bb b/recipes/tasks/task-sdk-gnuradio-native.bb
index a671fa9990..f657b4a6f0 100644
--- a/recipes/tasks/task-sdk-gnuradio-native.bb
+++ b/recipes/tasks/task-sdk-gnuradio-native.bb
@@ -1,6 +1,6 @@
require task-sdk-native.inc
-DEPENDS += "libusb1 guile fftw python alsa-lib jack boost cppunit sdcc swig \
+DEPENDS += "libusb1 guile fftw python alsa-lib jack boost cppunit swig \
python python-numpy git util-linux-ng gsl python-cheetah git \
distcc libdbd-sqlite-perl libdbix-simple-perl pkgconfig \
"
@@ -12,13 +12,13 @@ RDEPENDS_${PN} += "libusb1-dev guile-dev fftwf-dev alsa-dev alsa-lib-dev jack-de
python-pprint python-compiler python-pkgutil python-pydoc \
python-mmap python-netclient python-difflib python-compile \
python-cheetah python-netserver python-xml cmake \
- boost boost-dev gsl-dev sdcc git distcc pkgconfig-dev \
+ boost boost-dev gsl-dev git distcc pkgconfig-dev \
util-linux-ng util-linux-ng-swaponoff \
"
RPROVIDES_${PN} = "task-native-gnuradio-sdk"
-PR = "${INC_PR}.15"
+PR = "${INC_PR}.16"
ALLOW_EMPTY = "1"
PACKAGES = "${PN}"
diff --git a/recipes/tasks/task-shr-feed.bb b/recipes/tasks/task-shr-feed.bb
index 8cd972877b..97f8820584 100644
--- a/recipes/tasks/task-shr-feed.bb
+++ b/recipes/tasks/task-shr-feed.bb
@@ -271,7 +271,6 @@ RDEPENDS_${PN} += "\
fltkhackdiet \
fltkwwpointcal \
transmission \
- xf86-input-tslib \
xf86-video-fbdev \
fltkcocktailbar \
fltkcurrency \
diff --git a/recipes/tasks/task-x11.bb b/recipes/tasks/task-x11.bb
index 1021bfba68..107f0d1de4 100644
--- a/recipes/tasks/task-x11.bb
+++ b/recipes/tasks/task-x11.bb
@@ -2,7 +2,7 @@ DESCRIPTION = "The X Window System -- install this task to get a client/server b
SECTION = "x11/server"
LICENSE = "MIT"
PV = "1.0"
-PR = "r7"
+PR = "r8"
# WORK IN PROGRESS
diff --git a/recipes/ti/matrix-gui-common_1.4.bb b/recipes/ti/matrix-gui-common_1.4.bb
index d436044a1a..6f7376deb8 100644
--- a/recipes/ti/matrix-gui-common_1.4.bb
+++ b/recipes/ti/matrix-gui-common_1.4.bb
@@ -4,5 +4,5 @@ require matrix-gui-common.inc
# prebuilt version in the repository.
RRECOMMENDS_${PN} = "am-sysinfo"
-SRCREV = "245"
-PR = "${INC_PR}.9"
+SRCREV = "249"
+PR = "${INC_PR}.10"
diff --git a/recipes/ti/matrix-gui-e_1.3.bb b/recipes/ti/matrix-gui-e_1.3.bb
index fb7e4b3d47..8f2df1cafc 100644
--- a/recipes/ti/matrix-gui-e_1.3.bb
+++ b/recipes/ti/matrix-gui-e_1.3.bb
@@ -1,5 +1,5 @@
require matrix-gui-e.inc
-SRCREV = "245"
-PR = "${INC_PR}.8"
+SRCREV = "249"
+PR = "${INC_PR}.9"
diff --git a/recipes/ti/matrix-gui_1.3.bb b/recipes/ti/matrix-gui_1.3.bb
index 2c38fc39a5..f7e56a3533 100644
--- a/recipes/ti/matrix-gui_1.3.bb
+++ b/recipes/ti/matrix-gui_1.3.bb
@@ -1,4 +1,4 @@
require matrix-gui.inc
-SRCREV = "245"
-PR = "${INC_PR}.4"
+SRCREV = "249"
+PR = "${INC_PR}.5"
diff --git a/recipes/ti/ti-wifi-utils_git.bb b/recipes/ti/ti-wifi-utils_git.bb
index 1ee5f2d81a..8d10051304 100644
--- a/recipes/ti/ti-wifi-utils_git.bb
+++ b/recipes/ti/ti-wifi-utils_git.bb
@@ -3,11 +3,11 @@ LICENSE = "TI-BSD"
DEPENDS = "libnl"
-PR ="r1"
+PR ="r2"
PV ="0.0"
PR_append = "+gitr${SRCPV}"
-SRCREV = "7f63af54eb66e5b2515f92c59fcc19a8065ce481"
+SRCREV = "268dbf03091b632c2697eb8028e90fe40513a9d8"
SRC_URI = "git://github.com/gxk/ti-utils.git;protocol=git"
S = "${WORKDIR}/git"
diff --git a/recipes/u-boot/u-boot-2009.11/at91/0001-Add-environment-size.patch b/recipes/u-boot/u-boot-2009.11/at91/0001-Add-environment-size.patch
new file mode 100644
index 0000000000..0b1e938085
--- /dev/null
+++ b/recipes/u-boot/u-boot-2009.11/at91/0001-Add-environment-size.patch
@@ -0,0 +1,26 @@
+From 2fde0fc4d5e6e92d123286bb410f7a5e00edba91 Mon Sep 17 00:00:00 2001
+From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
+Date: Fri, 4 Feb 2011 08:21:43 +0100
+Subject: [PATCH 1/2] Add environment size
+
+---
+ include/configs/at91sam9m10g45ek.h | 3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/include/configs/at91sam9m10g45ek.h b/include/configs/at91sam9m10g45ek.h
+index 261d698..a3d854b 100644
+--- a/include/configs/at91sam9m10g45ek.h
++++ b/include/configs/at91sam9m10g45ek.h
+@@ -234,6 +234,9 @@
+ #endif /* CONFIG_SYS_USE_DATAFLASH */
+
+ #ifdef CONFIG_SYS_USE_SDCARD
++#define CONFIG_ENV_IS_NOWHERE
++#define CONFIG_ENV_SIZE 0x4200
++#define CONFIG_ENV_SECT_SIZE 0x420
+ #define CONFIG_SYS_ROOTFS_SD 1
+ #define CONFIG_EXTRA_ENV_SETTINGS \
+ "load_env=fatload mmc 0:1 0x70000000 u-boot.env ; source 0x70000000 \0" \
+--
+1.6.3.3
+
diff --git a/recipes/u-boot/u-boot-2009.11/at91/0016-SupportEnv-load-from-SD-Card.patch b/recipes/u-boot/u-boot-2009.11/at91/0016-SupportEnv-load-from-SD-Card.patch
new file mode 100644
index 0000000000..a5e9ddf6c8
--- /dev/null
+++ b/recipes/u-boot/u-boot-2009.11/at91/0016-SupportEnv-load-from-SD-Card.patch
@@ -0,0 +1,126 @@
+diff -urN u-boot-2009.11/common/cmd_factory.c u-boot-2009.11-OK/common/cmd_factory.c
+--- u-boot-2009.11/common/cmd_factory.c 1970-01-01 01:00:00.000000000 +0100
++++ u-boot-2009.11-OK/common/cmd_factory.c 2010-09-26 21:39:09.000000000 +0200
+@@ -0,0 +1,46 @@
++/*
++ * (C) Copyright 2010
++ * Ulf Samuelsson <ulf.samuelsson@atmel.com>
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of
++ * the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ */
++
++#include <common.h>
++#include <command.h>
++#include <debug.h>
++
++#undef DEBUG
++#if defined(DEBUG)
++#define pr_debug(fmt, args...) printf(fmt, ##args)
++#else
++#define pr_debug(...) do { } while(0)
++#endif
++
++extern set_default_env(void);
++int do_factory (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
++{
++ set_default_env();
++ return 0;
++}
++
++U_BOOT_CMD(
++ factory, 1, 0, do_factory,
++ "factory\t- set factory default environment\n",
++ "\n"
++);
+diff -urN u-boot-2009.11/common/Makefile u-boot-2009.11-OK/common/Makefile
+--- u-boot-2009.11/common/Makefile 2011-01-26 01:26:46.000000000 +0100
++++ u-boot-2009.11-OK/common/Makefile 2010-09-26 21:27:30.000000000 +0200
+@@ -88,6 +88,7 @@
+ COBJS-$(CONFIG_CMD_EEPROM) += cmd_eeprom.o
+ COBJS-$(CONFIG_CMD_ELF) += cmd_elf.o
+ COBJS-$(CONFIG_CMD_EXT2) += cmd_ext2.o
++COBJS-$(CONFIG_CMD_FACTORY) += cmd_factory.o
+ COBJS-$(CONFIG_CMD_FAT) += cmd_fat.o
+ COBJS-$(CONFIG_CMD_FDC)$(CONFIG_CMD_FDOS) += cmd_fdc.o
+ COBJS-$(CONFIG_OF_LIBFDT) += cmd_fdt.o fdt_support.o
+diff -urN u-boot-2009.11/include/configs/at91sam9m10g45ek.h u-boot-2009.11-OK/include/configs/at91sam9m10g45ek.h
+--- u-boot-2009.11/include/configs/at91sam9m10g45ek.h 2011-01-26 01:26:46.000000000 +0100
++++ u-boot-2009.11-OK/include/configs/at91sam9m10g45ek.h 2011-01-15 23:18:18.000000000 +0100
+@@ -28,6 +28,7 @@
+ #define __CONFIG_H
+ #define CONFIG_CMD_DEBUG 1
+ #define CONFIG_SYS_ROOTFS_SD 1
++#define CONFIG_CMD_FACTORY 1
+ /* ARM asynchronous clock */
+ #define AT91_MAIN_CLOCK 12000000 /* from 12 MHz crystal */
+ #define CONFIG_SYS_HZ 1000
+@@ -105,6 +106,8 @@
+ #define CONFIG_CMD_FAT
+ #undef CONFIG_CMD_JFFS2
+ #define CONFIG_CMD_MMC
++#define CONFIG_CMD_AUTOSCRIPT
++
+ #define CONFIG_CMD_PING 1
+ #define CONFIG_CMD_DHCP 1
+ #define CONFIG_CMD_NAND 1
+@@ -219,9 +222,19 @@
+ #endif
+
+ #ifdef CONFIG_SYS_ROOTFS_SD
+-#define CONFIG_BOOTCOMMAND "mmc init; fatload mmc 1:1 0x72000000 uImage; bootm 0x72000000"
+-#define CONFIG_BOOTARGS "console=ttyS0,115200 " \
+- "root=/dev/mmcblk1p2 " \
++#define CONFIG_EXTRA_ENV_SETTINGS \
++ "load_env=fatload mmc 0:1 0x70000000 u-boot.env ; source 0x70000000 \0" \
++ "load_kernel=fatload mmc 0:1 0x72000000 uimage\0" \
++ "at91sam9m10ekes=9cd\0" \
++ "at91sam9g45ekes=8a4\0" \
++ "at91sam9m10g45ek=726\0" \
++ "machid=726\0"
++
++
++#define CONFIG_BOOTCOMMAND "mmc init; run load_env ; run load_kernel ; bootm 0x72000000"
++#define CONFIG_BOOTARGS "mem=128M " \
++ "console=ttyS0,115200 " \
++ "root=/dev/mmcblk0p2 " \
+ "rootdelay=2 "\
+ "rootfstype=rootfs rw"
+ #endif
+diff -urN u-boot-2009.11/Makefile u-boot-2009.11-OK/Makefile
+--- u-boot-2009.11/Makefile 2011-01-26 01:26:46.000000000 +0100
++++ u-boot-2009.11-OK/Makefile 2010-09-26 21:46:35.000000000 +0200
+@@ -295,7 +295,7 @@
+ #########################################################################
+
+ # Always append ALL so that arch config.mk's can add custom ones
+-ALL += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map $(U_BOOT_NAND) $(U_BOOT_ONENAND)
++ALL += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)U-BOOT.BIN $(obj)System.map $(U_BOOT_NAND) $(U_BOOT_ONENAND)
+
+ all: $(ALL)
+
+@@ -308,6 +308,9 @@
+ $(obj)u-boot.bin: $(obj)u-boot
+ $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+
++$(obj)U-BOOT.BIN: $(obj)u-boot
++ $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
++
+ $(obj)u-boot.ldr: $(obj)u-boot
+ $(obj)tools/envcrc --binary > $(obj)env-ldr.o
+ $(LDR) -T $(CONFIG_BFIN_CPU) -c $@ $< $(LDR_FLAGS)
diff --git a/recipes/u-boot/u-boot-2009.11/at91/0017-SD-Card-boot-patch-for-SAM9M10-G45.patch b/recipes/u-boot/u-boot-2009.11/at91/0017-SD-Card-boot-patch-for-SAM9M10-G45.patch
new file mode 100644
index 0000000000..2a16a125b5
--- /dev/null
+++ b/recipes/u-boot/u-boot-2009.11/at91/0017-SD-Card-boot-patch-for-SAM9M10-G45.patch
@@ -0,0 +1,151 @@
+From d3fa929dc47c3c4273eefd381f619d9892ff8685 Mon Sep 17 00:00:00 2001
+From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
+Date: Fri, 4 Feb 2011 07:30:16 +0100
+Subject: [PATCH] SD-Card boot patch for SAM9M10/G45
+
+---
+ Makefile | 7 ++++++-
+ include/configs/at91sam9m10g45ek.h | 34 ++++++++++++++++++++--------------
+ 2 files changed, 26 insertions(+), 15 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 0857fa4..2db49be 100644
+--- a/Makefile
++++ b/Makefile
+@@ -2862,13 +2862,15 @@ pm9261_config : unconfig
+ at91sam9m10g45ek_nandflash_config \
+ at91sam9m10g45ek_dataflash_config \
+ at91sam9m10g45ek_dataflash_cs0_config \
++at91sam9m10g45ek_sd_config \
+ at91sam9m10g45ek_config \
+ at91sam9g45ekes_nandflash_config \
+ at91sam9g45ekes_dataflash_config \
+ at91sam9g45ekes_dataflash_cs0_config \
++at91sam9g45ekes_sd_config \
+ at91sam9g45ekes_config : unconfig
+ @mkdir -p $(obj)include
+- @if [ "$(findstring 9m10,$@)" ] ; then \
++ @if [ "$(findstring 9m10,$@)" ] ; then \
+ echo "#define CONFIG_AT91SAM9M10G45EK 1" >>$(obj)include/config.h ; \
+ $(XECHO) "... 9M10G45 Variant" ; \
+ else \
+@@ -2878,6 +2880,9 @@ at91sam9g45ekes_config : unconfig
+ @if [ "$(findstring _nandflash,$@)" ] ; then \
+ echo "#define CONFIG_SYS_USE_NANDFLASH 1" >>$(obj)include/config.h ; \
+ $(XECHO) "... with environment variable in NAND FLASH" ; \
++ elif [ "$(findstring _sd,$@)" ] ; then \
++ echo "#define CONFIG_SYS_USE_SDCARD 1" >>$(obj)include/config.h ; \
++ $(XECHO) "... with environment variables on an SD-Card" ; \
+ else \
+ echo "#define CONFIG_SYS_USE_DATAFLASH 1" >>$(obj)include/config.h ; \
+ $(XECHO) "... with environment variable in SPI DATAFLASH CS0" ; \
+diff --git a/include/configs/at91sam9m10g45ek.h b/include/configs/at91sam9m10g45ek.h
+index 1d29067..261d698 100644
+--- a/include/configs/at91sam9m10g45ek.h
++++ b/include/configs/at91sam9m10g45ek.h
+@@ -26,9 +26,7 @@
+
+ #ifndef __CONFIG_H
+ #define __CONFIG_H
+-#define CONFIG_CMD_DEBUG 1
+-#define CONFIG_SYS_ROOTFS_SD 1
+-#define CONFIG_CMD_FACTORY 1
++
+ /* ARM asynchronous clock */
+ #define AT91_MAIN_CLOCK 12000000 /* from 12 MHz crystal */
+ #define CONFIG_SYS_HZ 1000
+@@ -113,6 +111,9 @@
+ #define CONFIG_CMD_NAND 1
+ #define CONFIG_CMD_USB 1
+
++#define CONFIG_CMD_DEBUG 1
++#define CONFIG_CMD_FACTORY 1
++
+ /* MCI */
+ #define MMCI_BASE AT91SAM9G45_BASE_MCI0
+ #define CONFIG_MMC 1
+@@ -206,7 +207,7 @@
+ #define CONFIG_SYS_MEMTEST_END PHYS_SDRAM + PHYS_SDRAM_SIZE
+
+ #ifdef CONFIG_SYS_USE_DATAFLASH
+-
++#define CONFIG_SYS_ROOTFS_NAND 1
+ /* bootstrap + u-boot + env + linux in dataflash on CS0 */
+ #define CONFIG_ENV_IS_IN_DATAFLASH 1
+ /* #define CONFIG_ENV_IS_IN_SPI_FLASH 1 */
+@@ -219,9 +220,21 @@
+ #else
+ #define CONFIG_ENV_SIZE 0x420
+ #define CONFIG_ENV_SECT_SIZE 0x420
++
++#ifdef CONFIG_SYS_ROOTFS_NAND
++#define CONFIG_BOOTCOMMAND "cp.b 0xC0042000 0x72000000 0x290000; bootm 0x72000000"
++#define CONFIG_BOOTARGS "console=ttyS0,115200 " \
++ "root=/dev/mtdblock1 " \
++ "mtdparts=atmel_nand:4M(unused)ro,-(root) "\
++ "rw rootfstype=jffs2"
++#endif
++
+ #endif
+
+-#ifdef CONFIG_SYS_ROOTFS_SD
++#endif /* CONFIG_SYS_USE_DATAFLASH */
++
++#ifdef CONFIG_SYS_USE_SDCARD
++#define CONFIG_SYS_ROOTFS_SD 1
+ #define CONFIG_EXTRA_ENV_SETTINGS \
+ "load_env=fatload mmc 0:1 0x70000000 u-boot.env ; source 0x70000000 \0" \
+ "load_kernel=fatload mmc 0:1 0x72000000 uimage\0" \
+@@ -239,16 +252,9 @@
+ "rootfstype=rootfs rw"
+ #endif
+
+-#ifdef CONFIG_SYS_ROOTFS_NAND
+-#define CONFIG_BOOTCOMMAND "cp.b 0xC0042000 0x72000000 0x290000; bootm 0x72000000"
+-#define CONFIG_BOOTARGS "console=ttyS0,115200 " \
+- "root=/dev/mtdblock1 " \
+- "mtdparts=atmel_nand:4M(unused)ro,-(root) "\
+- "rw rootfstype=jffs2"
+-#endif
+
+
+-#else /* CONFIG_SYS_USE_NANDFLASH */
++#ifdef CONFIG_SYS_USE_NANDFLASH
+
+ /* bootstrap + u-boot + env + linux in nandflash */
+ #define CONFIG_ENV_IS_IN_NAND 1
+@@ -263,7 +269,7 @@
+ 2M(linux),-(root) " \
+ "rw rootfstype=jffs2"
+
+-#endif
++#endif /* CONFIG_SYS_USE_NANDFLASH */
+
+ #define CONFIG_BAUDRATE 115200
+ #define CONFIG_SYS_BAUDRATE_TABLE {115200 , 19200, 38400, 57600, 9600 }
+From 2fde0fc4d5e6e92d123286bb410f7a5e00edba91 Mon Sep 17 00:00:00 2001
+From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
+Date: Fri, 4 Feb 2011 08:21:43 +0100
+Subject: [PATCH 1/2] Add environment size
+
+---
+ include/configs/at91sam9m10g45ek.h | 3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/include/configs/at91sam9m10g45ek.h b/include/configs/at91sam9m10g45ek.h
+index 261d698..a3d854b 100644
+--- a/include/configs/at91sam9m10g45ek.h
++++ b/include/configs/at91sam9m10g45ek.h
+@@ -234,6 +234,9 @@
+ #endif /* CONFIG_SYS_USE_DATAFLASH */
+
+ #ifdef CONFIG_SYS_USE_SDCARD
++#define CONFIG_ENV_IS_NOWHERE
++#define CONFIG_ENV_SIZE 0x4200
++#define CONFIG_ENV_SECT_SIZE 0x420
+ #define CONFIG_SYS_ROOTFS_SD 1
+ #define CONFIG_EXTRA_ENV_SETTINGS \
+ "load_env=fatload mmc 0:1 0x70000000 u-boot.env ; source 0x70000000 \0" \
+--
+1.6.3.3
+
diff --git a/recipes/u-boot/u-boot-2009.11/at91/0018-ADD-AT91-Build-script.patch b/recipes/u-boot/u-boot-2009.11/at91/0018-ADD-AT91-Build-script.patch
new file mode 100644
index 0000000000..d6b8fcb211
--- /dev/null
+++ b/recipes/u-boot/u-boot-2009.11/at91/0018-ADD-AT91-Build-script.patch
@@ -0,0 +1,45 @@
+From 6d57c07c8335af032b70396aa10f817bdaedf8ce Mon Sep 17 00:00:00 2001
+From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
+Date: Fri, 4 Feb 2011 08:22:21 +0100
+Subject: [PATCH 2/2] ADD AT91 Build script
+
+---
+ AT91BUILD | 26 ++++++++++++++++++++++++++
+ 1 files changed, 26 insertions(+), 0 deletions(-)
+ create mode 100755 AT91BUILD
+
+diff --git a/AT91BUILD b/AT91BUILD
+new file mode 100755
+index 0000000..c138bd1
+--- /dev/null
++++ b/AT91BUILD
+@@ -0,0 +1,26 @@
++#!/bin/sh
++
++GCCROOT=~/projects/OE_atmel/build/tmp/sysroots/i686-linux/usr/armv5te/bin
++PATH=${GCCROOT}:${PATH}
++CROSS_COMPILE=${GCCROOT}/arm-angstrom-linux-gnueabi-
++mkdir -p binaries
++
++build ( )
++{
++ FLAGS="-j 2 CROSS_COMPILE=${CROSS_COMPILE} O=binaries/$1"
++ mkdir -p binaries/$1
++ make ${FLAGS} distclean
++ make ${FLAGS} $1_config
++ make ${FLAGS} all
++}
++
++build at91sam9m10g45ek_nandflash
++build at91sam9m10g45ek_dataflash
++build at91sam9m10g45ek_dataflash_cs0
++build at91sam9m10g45ek_sd
++build at91sam9m10g45ek
++build at91sam9g45ekes_nandflash
++build at91sam9g45ekes_dataflash
++build at91sam9g45ekes_dataflash_cs0
++build at91sam9g45ekes_sd
++build at91sam9g45ekes
+--
+1.6.3.3
+
diff --git a/recipes/u-boot/u-boot-git/am3517-crane/0004-Ethernet-MACID-display-fix-for-am3517-craneboard.patch b/recipes/u-boot/u-boot-git/am3517-crane/0004-Ethernet-MACID-display-fix-for-am3517-craneboard.patch
new file mode 100644
index 0000000000..5ff135df27
--- /dev/null
+++ b/recipes/u-boot/u-boot-git/am3517-crane/0004-Ethernet-MACID-display-fix-for-am3517-craneboard.patch
@@ -0,0 +1,108 @@
+From 2e0ac19c4b32700ec07c04465b45a55b0dfa8962 Mon Sep 17 00:00:00 2001
+From: Anil Kumar M <anilm@mistralsolutions.com>
+Date: Thu, 5 May 2011 16:53:59 +0530
+Subject: [PATCH] Ethernet MACID display fix for am3517-craneboard
+
+Signed-off-by: Anil Kumar M <anilm@mistralsolutions.com>
+---
+ board/ti/am3517crane/am3517crane.c | 41 ++++++++++++++++++++---------------
+ board/ti/am3517crane/am3517crane.h | 9 ++++---
+ 2 files changed, 28 insertions(+), 22 deletions(-)
+
+diff --git a/board/ti/am3517crane/am3517crane.c b/board/ti/am3517crane/am3517crane.c
+index 40e8b91..019758e 100644
+--- a/board/ti/am3517crane/am3517crane.c
++++ b/board/ti/am3517crane/am3517crane.c
+@@ -38,7 +38,7 @@
+ #if defined(CONFIG_DRIVER_TI_EMAC)
+ #define AM3517_IP_SW_RESET 0x48002598
+ #define CPGMACSS_SW_RST (1 << 1)
+-#define ETHERNET_NRST 34
++#define ETHERNET_NRST 65
+ #define EMACID_ADDR_LSB 0x48002380
+ #define EMACID_ADDR_MSB 0x48002384
+ #endif
+@@ -204,30 +204,35 @@ int misc_init_r(void)
+ int cpu_eth_init(bd_t *bis)
+ {
+ #if defined(CONFIG_DRIVER_TI_EMAC)
+- char mac_buf_lsb[8];
+- char mac_buf_msb[16];
+- char mac_id[24];
+- const unsigned char separator = ':';
++ /* Check for efficient way of code*/
++ u8 mac_id[32];
++
++ u16 aa, bb, cc, dd, ee, ff;
++ u32 emac_lsb, emac_msb;
++
++ memset(mac_id, '\0', sizeof(mac_id));
+
+ printf("davinci_emac_initialize\n");
+ davinci_emac_initialize();
+
+- memset(mac_buf_lsb, '\0', sizeof(mac_buf_lsb));
+- memset(mac_buf_msb, '\0', sizeof(mac_buf_msb));
+- memset(mac_id, '\0', sizeof(mac_id));
++ emac_lsb = readl(EMACID_ADDR_LSB);
++ emac_msb = readl(EMACID_ADDR_MSB);
+
+- sprintf(mac_buf_msb, "%x", readl(EMACID_ADDR_MSB));
+- sprintf(mac_buf_lsb, "%x", readl(EMACID_ADDR_LSB));
+- strcat(mac_buf_msb, mac_buf_lsb);
+- sprintf(mac_id, "%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c",
+- mac_buf_msb[0], mac_buf_msb[1], separator,
+- mac_buf_msb[2], mac_buf_msb[3], separator,
+- mac_buf_msb[4], mac_buf_msb[5], separator,
+- mac_buf_msb[6], mac_buf_msb[7], separator,
+- mac_buf_msb[8], mac_buf_msb[9], separator,
+- mac_buf_msb[10], mac_buf_msb[11]);
++ cc = (emac_msb & 0x000000FF) >> 0;
++ bb = (emac_msb & 0x0000FF00) >> 8;
++ aa = (emac_msb & 0x00FF0000) >> 16;
+
++ ff = (emac_lsb & 0x000000FF);
++ ee = (emac_lsb & 0x0000FF00) >> 8;
++ dd = (emac_lsb & 0x00FF0000) >> 16;
++
++ sprintf(mac_id, "%02x:%02x:%02x:%02x:%02x:%02x",
++ aa, bb, cc, dd, ee, ff);
++
++ printf("-----------------------------\n");
+ printf("EMAC ID %s\n", mac_id);
++ printf("-----------------------------\n");
++
+ setenv("ethaddr", mac_id);
+ #endif
+ return 0;
+diff --git a/board/ti/am3517crane/am3517crane.h b/board/ti/am3517crane/am3517crane.h
+index 83fe858..cdb0542 100644
+--- a/board/ti/am3517crane/am3517crane.h
++++ b/board/ti/am3517crane/am3517crane.h
+@@ -88,10 +88,10 @@ const omap3_sysinfo sysinfo = {
+ MUX_VAL(CP(STRBEN_DLY0), (IEN | PTD | EN | M0)) \
+ MUX_VAL(CP(STRBEN_DLY1), (IEN | PTD | EN | M0)) \
+ /* GPMC */\
+- /* GPIO_34 ETHERNET_nRST */ \
+- MUX_VAL(CP(GPMC_A1), (IDIS | PTU | EN | M4)) \
++ /* GPIO_34 NC */ \
++ MUX_VAL(CP(GPMC_A1), (M7)) \
+ /* GPIO_35 USB1_HOST_EN */ \
+- MUX_VAL(CP(GPMC_A2), (IDIS | PTU | EN | M4)) \
++ MUX_VAL(CP(GPMC_A2), (IDIS | PTU | DIS | M4)) \
+ /* GPIO_36 USB0_OVER_CURRENT*/ \
+ MUX_VAL(CP(GPMC_A3), (IDIS | PTU | EN | M4)) \
+ /* GPIO_37 USB1_OVER_CURRENT */ \
+@@ -140,7 +140,8 @@ const omap3_sysinfo sysinfo = {
+ MUX_VAL(CP(GPMC_WAIT0), (IEN | PTD | DIS | M0)) \
+ MUX_VAL(CP(GPMC_WAIT1), (M7)) \
+ MUX_VAL(CP(GPMC_WAIT2), (M7)) \
+- MUX_VAL(CP(GPMC_WAIT3), (M7)) \
++ /* GPIO_65 ETHERNET_nRST */ \
++ MUX_VAL(CP(GPMC_WAIT3), (IDIS | PTU | EN | M4)) \
+ /* DSS */\
+ MUX_VAL(CP(DSS_PCLK), (IDIS | PTD | DIS | M0)) \
+ MUX_VAL(CP(DSS_HSYNC), (IDIS | PTD | DIS | M0)) \
+--
+1.7.2.3
+
diff --git a/recipes/u-boot/u-boot_2009.11.bb b/recipes/u-boot/u-boot_2009.11.bb
index 90a9089270..3b51e3c1ca 100644
--- a/recipes/u-boot/u-boot_2009.11.bb
+++ b/recipes/u-boot/u-boot_2009.11.bb
@@ -1,5 +1,5 @@
-PR = "r1"
-require u-boot.inc
+PR = "r2"
+require u-boot_r2.inc
DEFAULT_PREFERENCE = "-1"
DEFAULT_PREFERENCE_at91sam9g10ek = "2"
@@ -28,6 +28,9 @@ SRC_URI_append_at91 = "\
file://at91/0013-atmel_dataflash.c-Status-printout-depend-on-DEBUG.patch \
file://at91/0014-AT91-MCI-Add-support-for-SD-Card.patch \
file://at91/0015-sam9m10g45ek-Add-configuration-file.patch \
+ file://at91/0016-SupportEnv-load-from-SD-Card.patch \
+ file://0017-SD-Card-boot-patch-for-SAM9M10-G45.patch \
+ file://0018-ADD-AT91-Build-script.patch \
"
SRC_URI_append_adb4000 = "\
@@ -39,8 +42,19 @@ TARGET_LDFLAGS = ""
inherit base
do_compile () {
- oe_runmake ${UBOOT_MACHINE}
- oe_runmake all
+ if ! [ "x${UBOOT_MACHINES}" == "x" ] ; then
+ for board in ${UBOOT_MACHINES} ; do
+ if ! [ `grep ${board}_config Makefile | wc -c` == 0 ] ; then
+ mkdir -p binaries/${board}
+ oe_runmake O=binaries/${board} distclean
+ oe_runmake O=binaries/${board} ${board}_config
+ oe_runmake O=binaries/${board} all
+ fi
+ done
+ else
+ oe_runmake ${UBOOT_MACHINE}
+ oe_runmake all
+ fi
}
SRC_URI[md5sum] = "d94700614225f53c853dfe714eb5fa47"
diff --git a/recipes/u-boot/u-boot_git.bb b/recipes/u-boot/u-boot_git.bb
index d7c4f6aff3..b67b70e40b 100644
--- a/recipes/u-boot/u-boot_git.bb
+++ b/recipes/u-boot/u-boot_git.bb
@@ -1,5 +1,5 @@
require u-boot.inc
-PR = "r75"
+PR = "r76"
FILESPATHPKG =. "u-boot-git:"
@@ -138,6 +138,7 @@ SRC_URI_am3517-crane = "git://arago-project.org/git/projects/u-boot-omap3.git;pr
file://0001-OMAP2-3-I2C-Add-support-for-second-and-third-bus.patch \
file://0002-ARMV7-Restructure-OMAP-i2c-driver-to-allow-code-shar.patch \
file://0003-craneboard-add-expansionboard-support.patch \
+ file://0004-Ethernet-MACID-display-fix-for-am3517-craneboard.patch \
"
SRCREV_am3517-crane = "c0a8fb217fdca7888d89f9a3dee74a4cec865620"
@@ -291,6 +292,30 @@ SRC_URI_append_c7x0 = "file://pdaXrom-u-boot.patch \
SRC_URI_sheevaplug = "git://git.denx.de/u-boot-marvell.git;protocol=git;branch=master"
SRCREV_sheevaplug = "749c971873dbba301bd138c95d31223a25b32150"
+SRC_URI_mx28 = "git://opensource.freescale.com/pub/scm/imx/uboot-imx.git;protocol=http;branch=imx_v2009.08_10.12.01 \
+ http://foss.doredevelopment.dk/mirrors/imx/imx-bootlets-src-${PV_imx_bootlets}.tar.gz;name=imx-bootlets"
+SRCREV_mx28 = "e4437f1c192a1a68028e6fcff3f50ff50352041d"
+SRC_URI[imx-bootlets.md5sum] = "cf0ab3822dca694b930a051501c1d0e4"
+SRC_URI[imx-bootlets.sha256sum] = "63f6068ae36884adef4259bbb1fe2591755718f22c46d0a59d854883dfab1ffc"
+PV_mx28 = "2009.08-imx+${PR}+gitr${SRCREV}"
+PV_imx_bootlets = "10.12.01"
+DEPENDS_append_mx28 = " elftosb-native"
+
+do_compile_prepend_mx28() {
+ # We just build the bootlets here
+ oe_runmake -C ${WORKDIR}/imx-bootlets-src-${PV_imx_bootlets} -e MAKEFLAGS= linux_prep boot_prep power_prep CC="${CC}" CFLAGS="${CFLAGS}" AR="${AR}" BOARD=iMX28_EVK
+}
+
+do_deploy_append_mx28 () {
+ cd ${WORKDIR}/imx-bootlets-src-${PV_imx_bootlets}
+ sed -i 's,[^ *]u_boot.*;,\tu_boot="'${S}/u-boot'";,' uboot_ivt.bd
+ sed -i 's,[^ *]u_boot.*;,\tu_boot="'${S}/u-boot'";,' uboot.bd
+ elftosb -z -c uboot.bd -o imx28_uboot.sb
+ elftosb -z -f imx28 -c uboot_ivt.bd -o imx28_ivt_uboot.sb
+ install -d ${DEPLOY_DIR_IMAGE}
+ install -m 0644 ${WORKDIR}/imx-bootlets-src-${PV_imx_bootlets}/imx28*uboot.sb ${DEPLOY_DIR_IMAGE}/
+}
+
SRC_URI_xilinx-ml507 = "git://git.xilinx.com/u-boot-xlnx.git;protocol=git"
SRCREV_xilinx-ml507 = "26e999650cf77c16f33c580abaadab2532f5e8b2"
diff --git a/recipes/u-boot/u-boot_r2.inc b/recipes/u-boot/u-boot_r2.inc
new file mode 100644
index 0000000000..50c22670cc
--- /dev/null
+++ b/recipes/u-boot/u-boot_r2.inc
@@ -0,0 +1,90 @@
+DESCRIPTION = "U-Boot - the Universal Boot Loader"
+HOMEPAGE = "http://www.denx.de/wiki/U-Boot/WebHome"
+SECTION = "bootloaders"
+PRIORITY = "optional"
+LICENSE = "GPLv2"
+PROVIDES = "virtual/bootloader"
+
+DEPENDS = "mtd-utils"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+PARALLEL_MAKE=""
+
+EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX}"
+
+UBOOT_MACHINE ?= "${MACHINE}_config"
+UBOOT_BINARY ?= "u-boot.bin"
+UBOOT_IMAGE ?= "u-boot-${MACHINE}-${PV}-${PR}.bin"
+UBOOT_SYMLINK ?= "u-boot-${MACHINE}.bin"
+
+do_configure () {
+ oe_runmake ${UBOOT_MACHINE}
+}
+
+do_compile () {
+ unset LDFLAGS
+ unset CFLAGS
+ unset CPPFLAGS
+ oe_runmake all
+ oe_runmake tools env
+}
+
+do_install () {
+ install -d ${D}/boot
+ if ! [ "x${UBOOT_MACHINES}" == "x" ] ; then
+ for board in ${UBOOT_MACHINES} ; do
+ if ! [ `grep ${board}_config ${S}/Makefile | wc -c` == 0 ] ; then
+ install ${S}/binaries/${board}/${UBOOT_BINARY} ${D}/boot/${board}-u-boot-${PV}-${PR}.bin
+ fi
+ if [ -e ${WORKDIR}/binaries/${board}/fw_env.config ] ; then
+ if ! [ -e ${D}${sysconfdir}/fw_env.config ] ; then
+ install -d ${D}${base_sbindir}
+ install -d ${D}${sysconfdir}
+ install -m 644 ${WORKDIR}/binaries/${board}/fw_env.config ${D}${sysconfdir}/fw_env.config
+ install -m 755 ${S}/binaries/${board}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
+ install -m 755 ${S}/binaries/${board}/tools/env/fw_printenv ${D}${base_sbindir}/fw_setenv
+ fi
+ fi
+ done
+ else
+ install ${S}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE}
+ ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY}
+
+ if [ -e ${WORKDIR}/fw_env.config ] ; then
+ install -d ${D}${base_sbindir}
+ install -d ${D}${sysconfdir}
+ install -m 644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config
+ install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
+ install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_setenv
+ fi
+ fi
+
+}
+
+FILES_${PN} = "/boot"
+# no gnu_hash in uboot.bin, by design, so skip QA
+INSANE_SKIP_${PN} = True
+
+PACKAGES += "${PN}-fw-utils"
+FILES_${PN}-fw-utils = "${sysconfdir} ${base_sbindir}"
+# u-boot doesn't use LDFLAGS for fw files, needs to get fixed, but until then:
+INSANE_SKIP_${PN}-fw-utils = True
+
+do_deploy () {
+ install -d ${DEPLOY_DIR_IMAGE}
+ if ! [ "x${UBOOT_MACHINES}" == "x" ] ; then
+ for board in ${UBOOT_MACHINES} ; do
+ install ${S}/binaries/${board}/${UBOOT_BINARY} ${DEPLOY_DIR_IMAGE}/${board}-u-boot-${PV}-${PR}.bin
+ package_stagefile_shell ${DEPLOY_DIR_IMAGE}/${board}-u-boot-${PV}-${PR}.bin
+ done
+ else
+ install ${S}/${UBOOT_BINARY} ${DEPLOY_DIR_IMAGE}/${UBOOT_IMAGE}
+ package_stagefile_shell ${DEPLOY_DIR_IMAGE}/${UBOOT_IMAGE}
+ cd ${DEPLOY_DIR_IMAGE}
+ rm -f ${UBOOT_SYMLINK}
+ ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK}
+ package_stagefile_shell ${DEPLOY_DIR_IMAGE}/${UBOOT_SYMLINK}
+ fi
+}
+do_deploy[dirs] = "${S}"
+addtask deploy before do_package_stage after do_compile
diff --git a/recipes/uclibc/uclibc-git/fts-support.patch b/recipes/uclibc/uclibc-git/fts-support.patch
deleted file mode 100644
index eda25c710b..0000000000
--- a/recipes/uclibc/uclibc-git/fts-support.patch
+++ /dev/null
@@ -1,1375 +0,0 @@
-Added fts support for traversing UNIX file hierarchies.
-It is required by libdwfl in elfutils package.
-
-Signed-off-by: Salvatore Cro <salvatore.cro at st.com>
----
- extra/Configs/Config.in | 9 +
- include/fts.h | 131 ++++++
- libc/misc/Makefile.in | 1 +
- libc/misc/fts/Makefile | 14 +
- libc/misc/fts/Makefile.in | 22 +
- libc/misc/fts/fts.c | 1139 +++++++++++++++++++++++++++++++++++++++++++++
- 6 files changed, 1316 insertions(+), 0 deletions(-)
- create mode 100644 include/fts.h
- create mode 100644 libc/misc/fts/Makefile
- create mode 100644 libc/misc/fts/Makefile.in
- create mode 100644 libc/misc/fts/fts.c
-
-Index: git/extra/Configs/Config.in
-===================================================================
---- git.orig/extra/Configs/Config.in
-+++ git/extra/Configs/Config.in
-@@ -1899,6 +1899,15 @@ config UCLIBC_HAS_FTW
- a pressing need for ftw(), you should probably answer N.
-
-
-+config UCLIBC_HAS_FTS
-+ bool "Support the fts() interface"
-+ default n
-+ help
-+ The fts functions are provided for traversing UNIX file hierarchies.
-+
-+ This interface is currently used by the elfutils, and adds around 7.5k.
-+ Unless you need to build/use elfutils, you should probably answer N.
-+
- config UCLIBC_HAS_GLOB
- bool "Support the glob() interface"
- depends on UCLIBC_HAS_FNMATCH
-Index: git/include/fts.h
-===================================================================
---- /dev/null
-+++ git/include/fts.h
-@@ -0,0 +1,131 @@
-+/*
-+ * Copyright (c) 1989, 1993
-+ * The Regents of the University of California. All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ * notice, this list of conditions and the following disclaimer.
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ * notice, this list of conditions and the following disclaimer in the
-+ * documentation and/or other materials provided with the distribution.
-+ * 4. Neither the name of the University nor the names of its contributors
-+ * may be used to endorse or promote products derived from this software
-+ * without specific prior written permission.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+ * SUCH DAMAGE.
-+ *
-+ * @(#)fts.h 8.3 (Berkeley) 8/14/94
-+ */
-+
-+#ifndef _FTS_H
-+#define _FTS_H 1
-+
-+#include <features.h>
-+#include <sys/types.h>
-+
-+/* The fts interface is incompatible with the LFS interface which
-+ transparently uses the 64-bit file access functions. */
-+#ifdef __USE_FILE_OFFSET64
-+# error "<fts.h> cannot be used with -D_FILE_OFFSET_BITS==64"
-+#endif
-+
-+
-+typedef struct {
-+ struct _ftsent *fts_cur; /* current node */
-+ struct _ftsent *fts_child; /* linked list of children */
-+ struct _ftsent **fts_array; /* sort array */
-+ dev_t fts_dev; /* starting device # */
-+ char *fts_path; /* path for this descent */
-+ int fts_rfd; /* fd for root */
-+ int fts_pathlen; /* sizeof(path) */
-+ int fts_nitems; /* elements in the sort array */
-+ int (*fts_compar) (const void *, const void *); /* compare fn */
-+
-+#define FTS_COMFOLLOW 0x0001 /* follow command line symlinks */
-+#define FTS_LOGICAL 0x0002 /* logical walk */
-+#define FTS_NOCHDIR 0x0004 /* don't change directories */
-+#define FTS_NOSTAT 0x0008 /* don't get stat info */
-+#define FTS_PHYSICAL 0x0010 /* physical walk */
-+#define FTS_SEEDOT 0x0020 /* return dot and dot-dot */
-+#define FTS_XDEV 0x0040 /* don't cross devices */
-+#define FTS_WHITEOUT 0x0080 /* return whiteout information */
-+#define FTS_OPTIONMASK 0x00ff /* valid user option mask */
-+
-+#define FTS_NAMEONLY 0x0100 /* (private) child names only */
-+#define FTS_STOP 0x0200 /* (private) unrecoverable error */
-+ int fts_options; /* fts_open options, global flags */
-+} FTS;
-+
-+typedef struct _ftsent {
-+ struct _ftsent *fts_cycle; /* cycle node */
-+ struct _ftsent *fts_parent; /* parent directory */
-+ struct _ftsent *fts_link; /* next file in directory */
-+ long fts_number; /* local numeric value */
-+ void *fts_pointer; /* local address value */
-+ char *fts_accpath; /* access path */
-+ char *fts_path; /* root path */
-+ int fts_errno; /* errno for this node */
-+ int fts_symfd; /* fd for symlink */
-+ u_short fts_pathlen; /* strlen(fts_path) */
-+ u_short fts_namelen; /* strlen(fts_name) */
-+
-+ ino_t fts_ino; /* inode */
-+ dev_t fts_dev; /* device */
-+ nlink_t fts_nlink; /* link count */
-+
-+#define FTS_ROOTPARENTLEVEL -1
-+#define FTS_ROOTLEVEL 0
-+ short fts_level; /* depth (-1 to N) */
-+
-+#define FTS_D 1 /* preorder directory */
-+#define FTS_DC 2 /* directory that causes cycles */
-+#define FTS_DEFAULT 3 /* none of the above */
-+#define FTS_DNR 4 /* unreadable directory */
-+#define FTS_DOT 5 /* dot or dot-dot */
-+#define FTS_DP 6 /* postorder directory */
-+#define FTS_ERR 7 /* error; errno is set */
-+#define FTS_F 8 /* regular file */
-+#define FTS_INIT 9 /* initialized only */
-+#define FTS_NS 10 /* stat(2) failed */
-+#define FTS_NSOK 11 /* no stat(2) requested */
-+#define FTS_SL 12 /* symbolic link */
-+#define FTS_SLNONE 13 /* symbolic link without target */
-+#define FTS_W 14 /* whiteout object */
-+ u_short fts_info; /* user flags for FTSENT structure */
-+
-+#define FTS_DONTCHDIR 0x01 /* don't chdir .. to the parent */
-+#define FTS_SYMFOLLOW 0x02 /* followed a symlink to get here */
-+ u_short fts_flags; /* private flags for FTSENT structure */
-+
-+#define FTS_AGAIN 1 /* read node again */
-+#define FTS_FOLLOW 2 /* follow symbolic link */
-+#define FTS_NOINSTR 3 /* no instructions */
-+#define FTS_SKIP 4 /* discard node */
-+ u_short fts_instr; /* fts_set() instructions */
-+
-+ struct stat *fts_statp; /* stat(2) information */
-+ char fts_name[1]; /* file name */
-+} FTSENT;
-+
-+__BEGIN_DECLS
-+FTSENT *fts_children (FTS *, int);
-+int fts_close (FTS *);
-+FTS *fts_open (char * const *, int,
-+ int (*)(const FTSENT **, const FTSENT **));
-+FTSENT *fts_read (FTS *);
-+int fts_set (FTS *, FTSENT *, int) __THROW;
-+__END_DECLS
-+
-+#endif /* fts.h */
-Index: git/libc/misc/Makefile.in
-===================================================================
---- git.orig/libc/misc/Makefile.in
-+++ git/libc/misc/Makefile.in
-@@ -16,6 +16,7 @@ include $(top_srcdir)libc/misc/elf/Makef
- include $(top_srcdir)libc/misc/file/Makefile.in
- include $(top_srcdir)libc/misc/fnmatch/Makefile.in
- include $(top_srcdir)libc/misc/ftw/Makefile.in
-+include $(top_srcdir)libc/misc/fts/Makefile.in
- include $(top_srcdir)libc/misc/glob/Makefile.in
- include $(top_srcdir)libc/misc/gnu/Makefile.in
- include $(top_srcdir)libc/misc/internals/Makefile.in
-Index: git/libc/misc/fts/Makefile
-===================================================================
---- /dev/null
-+++ git/libc/misc/fts/Makefile
-@@ -0,0 +1,14 @@
-+# Makefile for uClibc
-+#
-+# Copyright (C) 2009 STMicroelectronics Ltd.
-+# Author: Salvatore Cro <salvatore.cro at st.com>
-+#
-+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
-+#
-+
-+top_srcdir=../../../
-+top_builddir=../../../
-+all: objs
-+include $(top_builddir)Rules.mak
-+include Makefile.in
-+include $(top_srcdir)Makerules
-Index: git/libc/misc/fts/Makefile.in
-===================================================================
---- /dev/null
-+++ git/libc/misc/fts/Makefile.in
-@@ -0,0 +1,22 @@
-+# FTS Makefile for uClibc
-+#
-+# Copyright (C) 2009 STMicroelectronics Ltd.
-+# Author: Salvatore Cro <salvatore.cro at st.com>
-+#
-+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
-+#
-+
-+CSRC := fts.c
-+
-+MISC_FTS_DIR := $(top_srcdir)libc/misc/fts
-+MISC_FTS_OUT := $(top_builddir)libc/misc/fts
-+
-+MISC_FTS_SRC := $(patsubst %.c,$(MISC_FTS_DIR)/%.c,$(CSRC))
-+MISC_FTS_OBJ := $(patsubst %.c,$(MISC_FTS_OUT)/%.o,$(CSRC))
-+
-+libc-$(UCLIBC_HAS_FTS) += $(MISC_FTS_OBJ)
-+
-+objclean-$(UCLIBC_HAS_FTS) += misc_fts_clean
-+
-+misc_fts_clean:
-+ $(do_rm) $(addprefix $(MISC_FTS_OUT)/*., o os)
-Index: git/libc/misc/fts/fts.c
-===================================================================
---- /dev/null
-+++ git/libc/misc/fts/fts.c
-@@ -0,0 +1,1139 @@
-+/*-
-+ * Copyright (c) 1990, 1993, 1994
-+ * The Regents of the University of California. All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ * notice, this list of conditions and the following disclaimer.
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ * notice, this list of conditions and the following disclaimer in the
-+ * documentation and/or other materials provided with the distribution.
-+ * 4. Neither the name of the University nor the names of its contributors
-+ * may be used to endorse or promote products derived from this software
-+ * without specific prior written permission.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-+ * SUCH DAMAGE.
-+ */
-+
-+#include <sys/param.h>
-+#include <sys/stat.h>
-+#include <fcntl.h>
-+#include <dirent.h>
-+#include <errno.h>
-+#include <fts.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <unistd.h>
-+
-+
-+/* Largest alignment size needed, minus one.
-+ Usually long double is the worst case. */
-+#ifndef ALIGNBYTES
-+#define ALIGNBYTES (__alignof__ (long double) - 1)
-+#endif
-+/* Align P to that size. */
-+#ifndef ALIGN
-+#define ALIGN(p) (((unsigned long int) (p) + ALIGNBYTES) & ~ALIGNBYTES)
-+#endif
-+
-+
-+static FTSENT *fts_alloc (FTS *, const char *, size_t) internal_function;
-+static FTSENT *fts_build (FTS *, int) internal_function;
-+static void fts_lfree (FTSENT *) internal_function;
-+static void fts_load (FTS *, FTSENT *) internal_function;
-+static size_t fts_maxarglen (char * const *) internal_function;
-+static void fts_padjust (FTS *, FTSENT *) internal_function;
-+static int fts_palloc (FTS *, size_t) internal_function;
-+static FTSENT *fts_sort (FTS *, FTSENT *, int) internal_function;
-+static u_short fts_stat (FTS *, FTSENT *, int) internal_function;
-+static int fts_safe_changedir (FTS *, FTSENT *, int, const char *)
-+ internal_function;
-+
-+#ifndef MAX
-+#define MAX(a, b) ({ __typeof__ (a) _a = (a); \
-+ __typeof__ (b) _b = (b); \
-+ _a > _b ? _a : _b; })
-+#endif
-+
-+#define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])))
-+
-+#define CLR(opt) (sp->fts_options &= ~(opt))
-+#define ISSET(opt) (sp->fts_options & (opt))
-+#define SET(opt) (sp->fts_options |= (opt))
-+
-+#define FCHDIR(sp, fd) (!ISSET(FTS_NOCHDIR) && fchdir(fd))
-+
-+/* fts_build flags */
-+#define BCHILD 1 /* fts_children */
-+#define BNAMES 2 /* fts_children, names only */
-+#define BREAD 3 /* fts_read */
-+
-+FTS *
-+fts_open(argv, options, compar)
-+ char * const *argv;
-+ register int options;
-+ int (*compar) (const FTSENT **, const FTSENT **);
-+{
-+ register FTS *sp;
-+ register FTSENT *p, *root;
-+ register int nitems;
-+ FTSENT *parent = NULL;
-+ FTSENT *tmp = NULL;
-+
-+ /* Options check. */
-+ if (options & ~FTS_OPTIONMASK) {
-+ __set_errno (EINVAL);
-+ return (NULL);
-+ }
-+
-+ /* Allocate/initialize the stream */
-+ if ((sp = malloc((u_int)sizeof(FTS))) == NULL)
-+ return (NULL);
-+ memset(sp, 0, sizeof(FTS));
-+ sp->fts_compar = (int (*) (const void *, const void *)) compar;
-+ sp->fts_options = options;
-+
-+ /* Logical walks turn on NOCHDIR; symbolic links are too hard. */
-+ if (ISSET(FTS_LOGICAL))
-+ SET(FTS_NOCHDIR);
-+
-+ /*
-+ * Start out with 1K of path space, and enough, in any case,
-+ * to hold the user's paths.
-+ */
-+#ifndef MAXPATHLEN
-+#define MAXPATHLEN 1024
-+#endif
-+ size_t maxarglen = fts_maxarglen(argv);
-+ if (fts_palloc(sp, MAX(maxarglen, MAXPATHLEN)))
-+ goto mem1;
-+
-+ /* Allocate/initialize root's parent. */
-+ if (*argv != NULL) {
-+ if ((parent = fts_alloc(sp, "", 0)) == NULL)
-+ goto mem2;
-+ parent->fts_level = FTS_ROOTPARENTLEVEL;
-+ }
-+
-+ /* Allocate/initialize root(s). */
-+ for (root = NULL, nitems = 0; *argv != NULL; ++argv, ++nitems) {
-+ /* Don't allow zero-length paths. */
-+ size_t len = strlen(*argv);
-+ if (len == 0) {
-+ __set_errno (ENOENT);
-+ goto mem3;
-+ }
-+
-+ p = fts_alloc(sp, *argv, len);
-+ p->fts_level = FTS_ROOTLEVEL;
-+ p->fts_parent = parent;
-+ p->fts_accpath = p->fts_name;
-+ p->fts_info = fts_stat(sp, p, ISSET(FTS_COMFOLLOW));
-+
-+ /* Command-line "." and ".." are real directories. */
-+ if (p->fts_info == FTS_DOT)
-+ p->fts_info = FTS_D;
-+
-+ /*
-+ * If comparison routine supplied, traverse in sorted
-+ * order; otherwise traverse in the order specified.
-+ */
-+ if (compar) {
-+ p->fts_link = root;
-+ root = p;
-+ } else {
-+ p->fts_link = NULL;
-+ if (root == NULL)
-+ tmp = root = p;
-+ else {
-+ tmp->fts_link = p;
-+ tmp = p;
-+ }
-+ }
-+ }
-+ if (compar && nitems > 1)
-+ root = fts_sort(sp, root, nitems);
-+
-+ /*
-+ * Allocate a dummy pointer and make fts_read think that we've just
-+ * finished the node before the root(s); set p->fts_info to FTS_INIT
-+ * so that everything about the "current" node is ignored.
-+ */
-+ if ((sp->fts_cur = fts_alloc(sp, "", 0)) == NULL)
-+ goto mem3;
-+ sp->fts_cur->fts_link = root;
-+ sp->fts_cur->fts_info = FTS_INIT;
-+
-+ /*
-+ * If using chdir(2), grab a file descriptor pointing to dot to ensure
-+ * that we can get back here; this could be avoided for some paths,
-+ * but almost certainly not worth the effort. Slashes, symbolic links,
-+ * and ".." are all fairly nasty problems. Note, if we can't get the
-+ * descriptor we run anyway, just more slowly.
-+ */
-+ if (!ISSET(FTS_NOCHDIR)
-+ && (sp->fts_rfd = open(".", O_RDONLY, 0)) < 0)
-+ SET(FTS_NOCHDIR);
-+
-+ return (sp);
-+
-+mem3: fts_lfree(root);
-+ free(parent);
-+mem2: free(sp->fts_path);
-+mem1: free(sp);
-+ return (NULL);
-+}
-+
-+static void
-+internal_function
-+fts_load(sp, p)
-+ FTS *sp;
-+ register FTSENT *p;
-+{
-+ register int len;
-+ register char *cp;
-+
-+ /*
-+ * Load the stream structure for the next traversal. Since we don't
-+ * actually enter the directory until after the preorder visit, set
-+ * the fts_accpath field specially so the chdir gets done to the right
-+ * place and the user can access the first node. From fts_open it's
-+ * known that the path will fit.
-+ */
-+ len = p->fts_pathlen = p->fts_namelen;
-+ memmove(sp->fts_path, p->fts_name, len + 1);
-+ if ((cp = strrchr(p->fts_name, '/')) && (cp != p->fts_name || cp[1])) {
-+ len = strlen(++cp);
-+ memmove(p->fts_name, cp, len + 1);
-+ p->fts_namelen = len;
-+ }
-+ p->fts_accpath = p->fts_path = sp->fts_path;
-+ sp->fts_dev = p->fts_dev;
-+}
-+
-+int
-+fts_close(sp)
-+ FTS *sp;
-+{
-+ register FTSENT *freep, *p;
-+ int saved_errno;
-+
-+ /*
-+ * This still works if we haven't read anything -- the dummy structure
-+ * points to the root list, so we step through to the end of the root
-+ * list which has a valid parent pointer.
-+ */
-+ if (sp->fts_cur) {
-+ for (p = sp->fts_cur; p->fts_level >= FTS_ROOTLEVEL;) {
-+ freep = p;
-+ p = p->fts_link != NULL ? p->fts_link : p->fts_parent;
-+ free(freep);
-+ }
-+ free(p);
-+ }
-+
-+ /* Free up child linked list, sort array, path buffer. */
-+ if (sp->fts_child)
-+ fts_lfree(sp->fts_child);
-+ free(sp->fts_array);
-+ free(sp->fts_path);
-+
-+ /* Return to original directory, save errno if necessary. */
-+ if (!ISSET(FTS_NOCHDIR)) {
-+ saved_errno = fchdir(sp->fts_rfd) ? errno : 0;
-+ (void)close(sp->fts_rfd);
-+
-+ /* Set errno and return. */
-+ if (saved_errno != 0) {
-+ /* Free up the stream pointer. */
-+ free(sp);
-+ __set_errno (saved_errno);
-+ return (-1);
-+ }
-+ }
-+
-+ /* Free up the stream pointer. */
-+ free(sp);
-+ return (0);
-+}
-+
-+/*
-+ * Special case of "/" at the end of the path so that slashes aren't
-+ * appended which would cause paths to be written as "....//foo".
-+ */
-+#define NAPPEND(p) \
-+ (p->fts_path[p->fts_pathlen - 1] == '/' \
-+ ? p->fts_pathlen - 1 : p->fts_pathlen)
-+
-+FTSENT *
-+fts_read(sp)
-+ register FTS *sp;
-+{
-+ register FTSENT *p, *tmp;
-+ register int instr;
-+ register char *t;
-+ int saved_errno;
-+
-+ /* If finished or unrecoverable error, return NULL. */
-+ if (sp->fts_cur == NULL || ISSET(FTS_STOP))
-+ return (NULL);
-+
-+ /* Set current node pointer. */
-+ p = sp->fts_cur;
-+
-+ /* Save and zero out user instructions. */
-+ instr = p->fts_instr;
-+ p->fts_instr = FTS_NOINSTR;
-+
-+ /* Any type of file may be re-visited; re-stat and re-turn. */
-+ if (instr == FTS_AGAIN) {
-+ p->fts_info = fts_stat(sp, p, 0);
-+ return (p);
-+ }
-+
-+ /*
-+ * Following a symlink -- SLNONE test allows application to see
-+ * SLNONE and recover. If indirecting through a symlink, have
-+ * keep a pointer to current location. If unable to get that
-+ * pointer, follow fails.
-+ */
-+ if (instr == FTS_FOLLOW &&
-+ (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) {
-+ p->fts_info = fts_stat(sp, p, 1);
-+ if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
-+ if ((p->fts_symfd = open(".", O_RDONLY, 0)) < 0) {
-+ p->fts_errno = errno;
-+ p->fts_info = FTS_ERR;
-+ } else
-+ p->fts_flags |= FTS_SYMFOLLOW;
-+ }
-+ return (p);
-+ }
-+
-+ /* Directory in pre-order. */
-+ if (p->fts_info == FTS_D) {
-+ /* If skipped or crossed mount point, do post-order visit. */
-+ if (instr == FTS_SKIP ||
-+ (ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev)) {
-+ if (p->fts_flags & FTS_SYMFOLLOW)
-+ (void)close(p->fts_symfd);
-+ if (sp->fts_child) {
-+ fts_lfree(sp->fts_child);
-+ sp->fts_child = NULL;
-+ }
-+ p->fts_info = FTS_DP;
-+ return (p);
-+ }
-+
-+ /* Rebuild if only read the names and now traversing. */
-+ if (sp->fts_child != NULL && ISSET(FTS_NAMEONLY)) {
-+ CLR(FTS_NAMEONLY);
-+ fts_lfree(sp->fts_child);
-+ sp->fts_child = NULL;
-+ }
-+
-+ /*
-+ * Cd to the subdirectory.
-+ *
-+ * If have already read and now fail to chdir, whack the list
-+ * to make the names come out right, and set the parent errno
-+ * so the application will eventually get an error condition.
-+ * Set the FTS_DONTCHDIR flag so that when we logically change
-+ * directories back to the parent we don't do a chdir.
-+ *
-+ * If haven't read do so. If the read fails, fts_build sets
-+ * FTS_STOP or the fts_info field of the node.
-+ */
-+ if (sp->fts_child != NULL) {
-+ if (fts_safe_changedir(sp, p, -1, p->fts_accpath)) {
-+ p->fts_errno = errno;
-+ p->fts_flags |= FTS_DONTCHDIR;
-+ for (p = sp->fts_child; p != NULL;
-+ p = p->fts_link)
-+ p->fts_accpath =
-+ p->fts_parent->fts_accpath;
-+ }
-+ } else if ((sp->fts_child = fts_build(sp, BREAD)) == NULL) {
-+ if (ISSET(FTS_STOP))
-+ return (NULL);
-+ return (p);
-+ }
-+ p = sp->fts_child;
-+ sp->fts_child = NULL;
-+ sp->fts_cur = p;
-+ goto name;
-+ }
-+
-+ /* Move to the next node on this level. */
-+next: tmp = p;
-+ if ((p = p->fts_link) != NULL) {
-+ sp->fts_cur = p;
-+ free(tmp);
-+
-+ /*
-+ * If reached the top, return to the original directory (or
-+ * the root of the tree), and load the paths for the next root.
-+ */
-+ if (p->fts_level == FTS_ROOTLEVEL) {
-+ if (FCHDIR(sp, sp->fts_rfd)) {
-+ SET(FTS_STOP);
-+ return (NULL);
-+ }
-+ fts_load(sp, p);
-+ return p;
-+ }
-+
-+ /*
-+ * User may have called fts_set on the node. If skipped,
-+ * ignore. If followed, get a file descriptor so we can
-+ * get back if necessary.
-+ */
-+ if (p->fts_instr == FTS_SKIP)
-+ goto next;
-+ if (p->fts_instr == FTS_FOLLOW) {
-+ p->fts_info = fts_stat(sp, p, 1);
-+ if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
-+ if ((p->fts_symfd =
-+ open(".", O_RDONLY, 0)) < 0) {
-+ p->fts_errno = errno;
-+ p->fts_info = FTS_ERR;
-+ } else
-+ p->fts_flags |= FTS_SYMFOLLOW;
-+ }
-+ p->fts_instr = FTS_NOINSTR;
-+ }
-+
-+name: t = sp->fts_path + NAPPEND(p->fts_parent);
-+ *t++ = '/';
-+ memmove(t, p->fts_name, p->fts_namelen + 1);
-+ return p;
-+ }
-+
-+ /* Move up to the parent node. */
-+ p = tmp->fts_parent;
-+ sp->fts_cur = p;
-+ free(tmp);
-+
-+ if (p->fts_level == FTS_ROOTPARENTLEVEL) {
-+ /*
-+ * Done; free everything up and set errno to 0 so the user
-+ * can distinguish between error and EOF.
-+ */
-+ free(p);
-+ __set_errno (0);
-+ return (sp->fts_cur = NULL);
-+ }
-+
-+ /* NUL terminate the pathname. */
-+ sp->fts_path[p->fts_pathlen] = '\0';
-+
-+ /*
-+ * Return to the parent directory. If at a root node or came through
-+ * a symlink, go back through the file descriptor. Otherwise, cd up
-+ * one directory.
-+ */
-+ if (p->fts_level == FTS_ROOTLEVEL) {
-+ if (FCHDIR(sp, sp->fts_rfd)) {
-+ SET(FTS_STOP);
-+ return (NULL);
-+ }
-+ } else if (p->fts_flags & FTS_SYMFOLLOW) {
-+ if (FCHDIR(sp, p->fts_symfd)) {
-+ saved_errno = errno;
-+ (void)close(p->fts_symfd);
-+ __set_errno (saved_errno);
-+ SET(FTS_STOP);
-+ return (NULL);
-+ }
-+ (void)close(p->fts_symfd);
-+ } else if (!(p->fts_flags & FTS_DONTCHDIR) &&
-+ fts_safe_changedir(sp, p->fts_parent, -1, "..")) {
-+ SET(FTS_STOP);
-+ return (NULL);
-+ }
-+ p->fts_info = p->fts_errno ? FTS_ERR : FTS_DP;
-+ return p;
-+}
-+
-+/*
-+ * Fts_set takes the stream as an argument although it's not used in this
-+ * implementation; it would be necessary if anyone wanted to add global
-+ * semantics to fts using fts_set. An error return is allowed for similar
-+ * reasons.
-+ */
-+/* ARGSUSED */
-+int
-+fts_set(sp, p, instr)
-+ FTS *sp;
-+ FTSENT *p;
-+ int instr;
-+{
-+ if (instr != 0 && instr != FTS_AGAIN && instr != FTS_FOLLOW &&
-+ instr != FTS_NOINSTR && instr != FTS_SKIP) {
-+ __set_errno (EINVAL);
-+ return (1);
-+ }
-+ p->fts_instr = instr;
-+ return (0);
-+}
-+
-+FTSENT *
-+fts_children(sp, instr)
-+ register FTS *sp;
-+ int instr;
-+{
-+ register FTSENT *p;
-+ int fd;
-+
-+ if (instr != 0 && instr != FTS_NAMEONLY) {
-+ __set_errno (EINVAL);
-+ return (NULL);
-+ }
-+
-+ /* Set current node pointer. */
-+ p = sp->fts_cur;
-+
-+ /*
-+ * Errno set to 0 so user can distinguish empty directory from
-+ * an error.
-+ */
-+ __set_errno (0);
-+
-+ /* Fatal errors stop here. */
-+ if (ISSET(FTS_STOP))
-+ return (NULL);
-+
-+ /* Return logical hierarchy of user's arguments. */
-+ if (p->fts_info == FTS_INIT)
-+ return (p->fts_link);
-+
-+ /*
-+ * If not a directory being visited in pre-order, stop here. Could
-+ * allow FTS_DNR, assuming the user has fixed the problem, but the
-+ * same effect is available with FTS_AGAIN.
-+ */
-+ if (p->fts_info != FTS_D /* && p->fts_info != FTS_DNR */)
-+ return (NULL);
-+
-+ /* Free up any previous child list. */
-+ if (sp->fts_child != NULL)
-+ fts_lfree(sp->fts_child);
-+
-+ if (instr == FTS_NAMEONLY) {
-+ SET(FTS_NAMEONLY);
-+ instr = BNAMES;
-+ } else
-+ instr = BCHILD;
-+
-+ /*
-+ * If using chdir on a relative path and called BEFORE fts_read does
-+ * its chdir to the root of a traversal, we can lose -- we need to
-+ * chdir into the subdirectory, and we don't know where the current
-+ * directory is, so we can't get back so that the upcoming chdir by
-+ * fts_read will work.
-+ */
-+ if (p->fts_level != FTS_ROOTLEVEL || p->fts_accpath[0] == '/' ||
-+ ISSET(FTS_NOCHDIR))
-+ return (sp->fts_child = fts_build(sp, instr));
-+
-+ if ((fd = open(".", O_RDONLY, 0)) < 0)
-+ return (NULL);
-+ sp->fts_child = fts_build(sp, instr);
-+ if (fchdir(fd))
-+ return (NULL);
-+ (void)close(fd);
-+ return (sp->fts_child);
-+}
-+
-+/*
-+ * This is the tricky part -- do not casually change *anything* in here. The
-+ * idea is to build the linked list of entries that are used by fts_children
-+ * and fts_read. There are lots of special cases.
-+ *
-+ * The real slowdown in walking the tree is the stat calls. If FTS_NOSTAT is
-+ * set and it's a physical walk (so that symbolic links can't be directories),
-+ * we can do things quickly. First, if it's a 4.4BSD file system, the type
-+ * of the file is in the directory entry. Otherwise, we assume that the number
-+ * of subdirectories in a node is equal to the number of links to the parent.
-+ * The former skips all stat calls. The latter skips stat calls in any leaf
-+ * directories and for any files after the subdirectories in the directory have
-+ * been found, cutting the stat calls by about 2/3.
-+ */
-+static FTSENT *
-+internal_function
-+fts_build(sp, type)
-+ register FTS *sp;
-+ int type;
-+{
-+ register struct dirent *dp;
-+ register FTSENT *p, *head;
-+ register int nitems;
-+ FTSENT *cur, *tail;
-+ DIR *dirp;
-+ void *oldaddr;
-+ int cderrno, descend, len, level, nlinks, saved_errno,
-+ nostat, doadjust;
-+ size_t maxlen;
-+ char *cp;
-+
-+ /* Set current node pointer. */
-+ cur = sp->fts_cur;
-+
-+ /*
-+ * Open the directory for reading. If this fails, we're done.
-+ * If being called from fts_read, set the fts_info field.
-+ */
-+#if defined FTS_WHITEOUT && 0
-+ if (ISSET(FTS_WHITEOUT))
-+ oflag = DTF_NODUP|DTF_REWIND;
-+ else
-+ oflag = DTF_HIDEW|DTF_NODUP|DTF_REWIND;
-+#else
-+# define opendir2(path, flag) opendir(path)
-+#endif
-+ if ((dirp = opendir2(cur->fts_accpath, oflag)) == NULL) {
-+ if (type == BREAD) {
-+ cur->fts_info = FTS_DNR;
-+ cur->fts_errno = errno;
-+ }
-+ return (NULL);
-+ }
-+
-+ /*
-+ * Nlinks is the number of possible entries of type directory in the
-+ * directory if we're cheating on stat calls, 0 if we're not doing
-+ * any stat calls at all, -1 if we're doing stats on everything.
-+ */
-+ if (type == BNAMES) {
-+ nlinks = 0;
-+ /* Be quiet about nostat, GCC. */
-+ nostat = 0;
-+ } else if (ISSET(FTS_NOSTAT) && ISSET(FTS_PHYSICAL)) {
-+ nlinks = cur->fts_nlink - (ISSET(FTS_SEEDOT) ? 0 : 2);
-+ nostat = 1;
-+ } else {
-+ nlinks = -1;
-+ nostat = 0;
-+ }
-+
-+#ifdef notdef
-+ (void)printf("nlinks == %d (cur: %d)\n", nlinks, cur->fts_nlink);
-+ (void)printf("NOSTAT %d PHYSICAL %d SEEDOT %d\n",
-+ ISSET(FTS_NOSTAT), ISSET(FTS_PHYSICAL), ISSET(FTS_SEEDOT));
-+#endif
-+ /*
-+ * If we're going to need to stat anything or we want to descend
-+ * and stay in the directory, chdir. If this fails we keep going,
-+ * but set a flag so we don't chdir after the post-order visit.
-+ * We won't be able to stat anything, but we can still return the
-+ * names themselves. Note, that since fts_read won't be able to
-+ * chdir into the directory, it will have to return different path
-+ * names than before, i.e. "a/b" instead of "b". Since the node
-+ * has already been visited in pre-order, have to wait until the
-+ * post-order visit to return the error. There is a special case
-+ * here, if there was nothing to stat then it's not an error to
-+ * not be able to stat. This is all fairly nasty. If a program
-+ * needed sorted entries or stat information, they had better be
-+ * checking FTS_NS on the returned nodes.
-+ */
-+ cderrno = 0;
-+ if (nlinks || type == BREAD) {
-+ if (fts_safe_changedir(sp, cur, dirfd(dirp), NULL)) {
-+ if (nlinks && type == BREAD)
-+ cur->fts_errno = errno;
-+ cur->fts_flags |= FTS_DONTCHDIR;
-+ descend = 0;
-+ cderrno = errno;
-+ (void)closedir(dirp);
-+ dirp = NULL;
-+ } else
-+ descend = 1;
-+ } else
-+ descend = 0;
-+
-+ /*
-+ * Figure out the max file name length that can be stored in the
-+ * current path -- the inner loop allocates more path as necessary.
-+ * We really wouldn't have to do the maxlen calculations here, we
-+ * could do them in fts_read before returning the path, but it's a
-+ * lot easier here since the length is part of the dirent structure.
-+ *
-+ * If not changing directories set a pointer so that can just append
-+ * each new name into the path.
-+ */
-+ len = NAPPEND(cur);
-+ if (ISSET(FTS_NOCHDIR)) {
-+ cp = sp->fts_path + len;
-+ *cp++ = '/';
-+ } else {
-+ /* GCC, you're too verbose. */
-+ cp = NULL;
-+ }
-+ len++;
-+ maxlen = sp->fts_pathlen - len;
-+
-+ level = cur->fts_level + 1;
-+
-+ /* Read the directory, attaching each entry to the `link' pointer. */
-+ doadjust = 0;
-+ for (head = tail = NULL, nitems = 0; dirp && (dp = readdir(dirp));) {
-+ if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
-+ continue;
-+
-+ if ((p = fts_alloc(sp, dp->d_name, _D_EXACT_NAMLEN (dp))) == NULL)
-+ goto mem1;
-+ if (_D_EXACT_NAMLEN (dp) >= maxlen) {/* include space for NUL */
-+ oldaddr = sp->fts_path;
-+ if (fts_palloc(sp, _D_EXACT_NAMLEN (dp) + len + 1)) {
-+ /*
-+ * No more memory for path or structures. Save
-+ * errno, free up the current structure and the
-+ * structures already allocated.
-+ */
-+mem1: saved_errno = errno;
-+ free(p);
-+ fts_lfree(head);
-+ (void)closedir(dirp);
-+ cur->fts_info = FTS_ERR;
-+ SET(FTS_STOP);
-+ __set_errno (saved_errno);
-+ return (NULL);
-+ }
-+ /* Did realloc() change the pointer? */
-+ if (oldaddr != sp->fts_path) {
-+ doadjust = 1;
-+ if (ISSET(FTS_NOCHDIR))
-+ cp = sp->fts_path + len;
-+ }
-+ maxlen = sp->fts_pathlen - len;
-+ }
-+
-+ if (len + _D_EXACT_NAMLEN (dp) >= USHRT_MAX) {
-+ /*
-+ * In an FTSENT, fts_pathlen is a u_short so it is
-+ * possible to wraparound here. If we do, free up
-+ * the current structure and the structures already
-+ * allocated, then error out with ENAMETOOLONG.
-+ */
-+ free(p);
-+ fts_lfree(head);
-+ (void)closedir(dirp);
-+ cur->fts_info = FTS_ERR;
-+ SET(FTS_STOP);
-+ __set_errno (ENAMETOOLONG);
-+ return (NULL);
-+ }
-+ p->fts_level = level;
-+ p->fts_parent = sp->fts_cur;
-+ p->fts_pathlen = len + _D_EXACT_NAMLEN (dp);
-+
-+#if defined FTS_WHITEOUT && 0
-+ if (dp->d_type == DT_WHT)
-+ p->fts_flags |= FTS_ISW;
-+#endif
-+
-+#if 0
-+ /* Unreachable code. cderrno is only ever set to a nonnull
-+ value if dirp is closed at the same time. But then we
-+ cannot enter this loop. */
-+ if (cderrno) {
-+ if (nlinks) {
-+ p->fts_info = FTS_NS;
-+ p->fts_errno = cderrno;
-+ } else
-+ p->fts_info = FTS_NSOK;
-+ p->fts_accpath = cur->fts_accpath;
-+ } else
-+#endif
-+ if (nlinks == 0
-+#if defined DT_DIR && defined _DIRENT_HAVE_D_TYPE
-+ || (nostat &&
-+ dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN)
-+#endif
-+ ) {
-+ p->fts_accpath =
-+ ISSET(FTS_NOCHDIR) ? p->fts_path : p->fts_name;
-+ p->fts_info = FTS_NSOK;
-+ } else {
-+ /* Build a file name for fts_stat to stat. */
-+ if (ISSET(FTS_NOCHDIR)) {
-+ p->fts_accpath = p->fts_path;
-+ memmove(cp, p->fts_name, p->fts_namelen + 1);
-+ } else
-+ p->fts_accpath = p->fts_name;
-+ /* Stat it. */
-+ p->fts_info = fts_stat(sp, p, 0);
-+
-+ /* Decrement link count if applicable. */
-+ if (nlinks > 0 && (p->fts_info == FTS_D ||
-+ p->fts_info == FTS_DC || p->fts_info == FTS_DOT))
-+ --nlinks;
-+ }
-+
-+ /* We walk in directory order so "ls -f" doesn't get upset. */
-+ p->fts_link = NULL;
-+ if (head == NULL)
-+ head = tail = p;
-+ else {
-+ tail->fts_link = p;
-+ tail = p;
-+ }
-+ ++nitems;
-+ }
-+ if (dirp)
-+ (void)closedir(dirp);
-+
-+ /*
-+ * If realloc() changed the address of the path, adjust the
-+ * addresses for the rest of the tree and the dir list.
-+ */
-+ if (doadjust)
-+ fts_padjust(sp, head);
-+
-+ /*
-+ * If not changing directories, reset the path back to original
-+ * state.
-+ */
-+ if (ISSET(FTS_NOCHDIR)) {
-+ if (len == sp->fts_pathlen || nitems == 0)
-+ --cp;
-+ *cp = '\0';
-+ }
-+
-+ /*
-+ * If descended after called from fts_children or after called from
-+ * fts_read and nothing found, get back. At the root level we use
-+ * the saved fd; if one of fts_open()'s arguments is a relative path
-+ * to an empty directory, we wind up here with no other way back. If
-+ * can't get back, we're done.
-+ */
-+ if (descend && (type == BCHILD || !nitems) &&
-+ (cur->fts_level == FTS_ROOTLEVEL ?
-+ FCHDIR(sp, sp->fts_rfd) :
-+ fts_safe_changedir(sp, cur->fts_parent, -1, ".."))) {
-+ cur->fts_info = FTS_ERR;
-+ SET(FTS_STOP);
-+ fts_lfree(head);
-+ return (NULL);
-+ }
-+
-+ /* If didn't find anything, return NULL. */
-+ if (!nitems) {
-+ if (type == BREAD)
-+ cur->fts_info = FTS_DP;
-+ fts_lfree(head);
-+ return (NULL);
-+ }
-+
-+ /* Sort the entries. */
-+ if (sp->fts_compar && nitems > 1)
-+ head = fts_sort(sp, head, nitems);
-+ return (head);
-+}
-+
-+static u_short
-+internal_function
-+fts_stat(sp, p, follow)
-+ FTS *sp;
-+ register FTSENT *p;
-+ int follow;
-+{
-+ register FTSENT *t;
-+ register dev_t dev;
-+ register ino_t ino;
-+ struct stat *sbp, sb;
-+ int saved_errno;
-+
-+ /* If user needs stat info, stat buffer already allocated. */
-+ sbp = ISSET(FTS_NOSTAT) ? &sb : p->fts_statp;
-+
-+#if defined FTS_WHITEOUT && 0
-+ /* check for whiteout */
-+ if (p->fts_flags & FTS_ISW) {
-+ if (sbp != &sb) {
-+ memset(sbp, '\0', sizeof (*sbp));
-+ sbp->st_mode = S_IFWHT;
-+ }
-+ return (FTS_W);
-+ }
-+#endif
-+
-+ /*
-+ * If doing a logical walk, or application requested FTS_FOLLOW, do
-+ * a stat(2). If that fails, check for a non-existent symlink. If
-+ * fail, set the errno from the stat call.
-+ */
-+ if (ISSET(FTS_LOGICAL) || follow) {
-+ if (stat(p->fts_accpath, sbp)) {
-+ saved_errno = errno;
-+ if (!lstat(p->fts_accpath, sbp)) {
-+ __set_errno (0);
-+ return (FTS_SLNONE);
-+ }
-+ p->fts_errno = saved_errno;
-+ goto err;
-+ }
-+ } else if (lstat(p->fts_accpath, sbp)) {
-+ p->fts_errno = errno;
-+err: memset(sbp, 0, sizeof(struct stat));
-+ return (FTS_NS);
-+ }
-+
-+ if (S_ISDIR(sbp->st_mode)) {
-+ /*
-+ * Set the device/inode. Used to find cycles and check for
-+ * crossing mount points. Also remember the link count, used
-+ * in fts_build to limit the number of stat calls. It is
-+ * understood that these fields are only referenced if fts_info
-+ * is set to FTS_D.
-+ */
-+ dev = p->fts_dev = sbp->st_dev;
-+ ino = p->fts_ino = sbp->st_ino;
-+ p->fts_nlink = sbp->st_nlink;
-+
-+ if (ISDOT(p->fts_name))
-+ return (FTS_DOT);
-+
-+ /*
-+ * Cycle detection is done by brute force when the directory
-+ * is first encountered. If the tree gets deep enough or the
-+ * number of symbolic links to directories is high enough,
-+ * something faster might be worthwhile.
-+ */
-+ for (t = p->fts_parent;
-+ t->fts_level >= FTS_ROOTLEVEL; t = t->fts_parent)
-+ if (ino == t->fts_ino && dev == t->fts_dev) {
-+ p->fts_cycle = t;
-+ return (FTS_DC);
-+ }
-+ return (FTS_D);
-+ }
-+ if (S_ISLNK(sbp->st_mode))
-+ return (FTS_SL);
-+ if (S_ISREG(sbp->st_mode))
-+ return (FTS_F);
-+ return (FTS_DEFAULT);
-+}
-+
-+static FTSENT *
-+internal_function
-+fts_sort(sp, head, nitems)
-+ FTS *sp;
-+ FTSENT *head;
-+ register int nitems;
-+{
-+ register FTSENT **ap, *p;
-+
-+ /*
-+ * Construct an array of pointers to the structures and call qsort(3).
-+ * Reassemble the array in the order returned by qsort. If unable to
-+ * sort for memory reasons, return the directory entries in their
-+ * current order. Allocate enough space for the current needs plus
-+ * 40 so don't realloc one entry at a time.
-+ */
-+ if (nitems > sp->fts_nitems) {
-+ struct _ftsent **a;
-+
-+ sp->fts_nitems = nitems + 40;
-+ if ((a = realloc(sp->fts_array,
-+ (size_t)(sp->fts_nitems * sizeof(FTSENT *)))) == NULL) {
-+ free(sp->fts_array);
-+ sp->fts_array = NULL;
-+ sp->fts_nitems = 0;
-+ return (head);
-+ }
-+ sp->fts_array = a;
-+ }
-+ for (ap = sp->fts_array, p = head; p; p = p->fts_link)
-+ *ap++ = p;
-+ qsort((void *)sp->fts_array, nitems, sizeof(FTSENT *), sp->fts_compar);
-+ for (head = *(ap = sp->fts_array); --nitems; ++ap)
-+ ap[0]->fts_link = ap[1];
-+ ap[0]->fts_link = NULL;
-+ return (head);
-+}
-+
-+static FTSENT *
-+internal_function
-+fts_alloc(sp, name, namelen)
-+ FTS *sp;
-+ const char *name;
-+ size_t namelen;
-+{
-+ register FTSENT *p;
-+ size_t len;
-+
-+ /*
-+ * The file name is a variable length array and no stat structure is
-+ * necessary if the user has set the nostat bit. Allocate the FTSENT
-+ * structure, the file name and the stat structure in one chunk, but
-+ * be careful that the stat structure is reasonably aligned. Since the
-+ * fts_name field is declared to be of size 1, the fts_name pointer is
-+ * namelen + 2 before the first possible address of the stat structure.
-+ */
-+ len = sizeof(FTSENT) + namelen;
-+ if (!ISSET(FTS_NOSTAT))
-+ len += sizeof(struct stat) + ALIGNBYTES;
-+ if ((p = malloc(len)) == NULL)
-+ return (NULL);
-+
-+ /* Copy the name and guarantee NUL termination. */
-+ memmove(p->fts_name, name, namelen);
-+ p->fts_name[namelen] = '\0';
-+
-+ if (!ISSET(FTS_NOSTAT))
-+ p->fts_statp = (struct stat *)ALIGN(p->fts_name + namelen + 2);
-+ p->fts_namelen = namelen;
-+ p->fts_path = sp->fts_path;
-+ p->fts_errno = 0;
-+ p->fts_flags = 0;
-+ p->fts_instr = FTS_NOINSTR;
-+ p->fts_number = 0;
-+ p->fts_pointer = NULL;
-+ return (p);
-+}
-+
-+static void
-+internal_function
-+fts_lfree(head)
-+ register FTSENT *head;
-+{
-+ register FTSENT *p;
-+
-+ /* Free a linked list of structures. */
-+ while ((p = head)) {
-+ head = head->fts_link;
-+ free(p);
-+ }
-+}
-+
-+/*
-+ * Allow essentially unlimited paths; find, rm, ls should all work on any tree.
-+ * Most systems will allow creation of paths much longer than MAXPATHLEN, even
-+ * though the kernel won't resolve them. Add the size (not just what's needed)
-+ * plus 256 bytes so don't realloc the path 2 bytes at a time.
-+ */
-+static int
-+internal_function
-+fts_palloc(sp, more)
-+ FTS *sp;
-+ size_t more;
-+{
-+ char *p;
-+
-+ sp->fts_pathlen += more + 256;
-+ /*
-+ * Check for possible wraparound. In an FTS, fts_pathlen is
-+ * a signed int but in an FTSENT it is an unsigned short.
-+ * We limit fts_pathlen to USHRT_MAX to be safe in both cases.
-+ */
-+ if (sp->fts_pathlen < 0 || sp->fts_pathlen >= USHRT_MAX) {
-+ free(sp->fts_path);
-+ sp->fts_path = NULL;
-+ __set_errno (ENAMETOOLONG);
-+ return (1);
-+ }
-+ p = realloc(sp->fts_path, sp->fts_pathlen);
-+ if (p == NULL) {
-+ free(sp->fts_path);
-+ sp->fts_path = NULL;
-+ return 1;
-+ }
-+ sp->fts_path = p;
-+ return 0;
-+}
-+
-+/*
-+ * When the path is realloc'd, have to fix all of the pointers in structures
-+ * already returned.
-+ */
-+static void
-+internal_function
-+fts_padjust(sp, head)
-+ FTS *sp;
-+ FTSENT *head;
-+{
-+ FTSENT *p;
-+ char *addr = sp->fts_path;
-+
-+#define ADJUST(p) do { \
-+ if ((p)->fts_accpath != (p)->fts_name) { \
-+ (p)->fts_accpath = \
-+ (char *)addr + ((p)->fts_accpath - (p)->fts_path); \
-+ } \
-+ (p)->fts_path = addr; \
-+} while (0)
-+ /* Adjust the current set of children. */
-+ for (p = sp->fts_child; p; p = p->fts_link)
-+ ADJUST(p);
-+
-+ /* Adjust the rest of the tree, including the current level. */
-+ for (p = head; p->fts_level >= FTS_ROOTLEVEL;) {
-+ ADJUST(p);
-+ p = p->fts_link ? p->fts_link : p->fts_parent;
-+ }
-+}
-+
-+static size_t
-+internal_function
-+fts_maxarglen(argv)
-+ char * const *argv;
-+{
-+ size_t len, max;
-+
-+ for (max = 0; *argv; ++argv)
-+ if ((len = strlen(*argv)) > max)
-+ max = len;
-+ return (max + 1);
-+}
-+
-+/*
-+ * Change to dir specified by fd or p->fts_accpath without getting
-+ * tricked by someone changing the world out from underneath us.
-+ * Assumes p->fts_dev and p->fts_ino are filled in.
-+ */
-+static int
-+internal_function
-+fts_safe_changedir(sp, p, fd, path)
-+ FTS *sp;
-+ FTSENT *p;
-+ int fd;
-+ const char *path;
-+{
-+ int ret, oerrno, newfd;
-+ struct stat64 sb;
-+
-+ newfd = fd;
-+ if (ISSET(FTS_NOCHDIR))
-+ return (0);
-+ if (fd < 0 && (newfd = open(path, O_RDONLY, 0)) < 0)
-+ return (-1);
-+ if (fstat64(newfd, &sb)) {
-+ ret = -1;
-+ goto bail;
-+ }
-+ if (p->fts_dev != sb.st_dev || p->fts_ino != sb.st_ino) {
-+ __set_errno (ENOENT); /* disinformation */
-+ ret = -1;
-+ goto bail;
-+ }
-+ ret = fchdir(newfd);
-+bail:
-+ oerrno = errno;
-+ if (fd < 0)
-+ (void)close(newfd);
-+ __set_errno (oerrno);
-+ return (ret);
-+}
diff --git a/recipes/uclibc/uclibc-git/orign_path.patch b/recipes/uclibc/uclibc-git/orign_path.patch
new file mode 100644
index 0000000000..fcd786500c
--- /dev/null
+++ b/recipes/uclibc/uclibc-git/orign_path.patch
@@ -0,0 +1,178 @@
+diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
+index 505247e..2b2d429 100644
+--- a/ldso/ldso/dl-elf.c
++++ b/ldso/ldso/dl-elf.c
+@@ -133,53 +133,60 @@ _dl_protect_relro (struct elf_resolve *l)
+ * in uClibc/ldso/util/ldd.c */
+ static struct elf_resolve *
+ search_for_named_library(const char *name, int secure, const char *path_list,
+- struct dyn_elf **rpnt)
++ struct dyn_elf **rpnt, const char *origin)
+ {
+- char *path, *path_n, *mylibname;
++ char *mylibname;
++ const char *p, *pn;
+ struct elf_resolve *tpnt;
+- int done;
++ int plen;
+
+ if (path_list==NULL)
+ return NULL;
+
+- /* We need a writable copy of this string, but we don't
+- * need this allocated permanently since we don't want
+- * to leak memory, so use alloca to put path on the stack */
+- done = _dl_strlen(path_list);
+- path = alloca(done + 1);
+-
+ /* another bit of local storage */
+ mylibname = alloca(2050);
+
+- _dl_memcpy(path, path_list, done+1);
+-
+ /* Unlike ldd.c, don't bother to eliminate double //s */
+
+ /* Replace colons with zeros in path_list */
+ /* : at the beginning or end of path maps to CWD */
+ /* :: anywhere maps CWD */
+ /* "" maps to CWD */
+- done = 0;
+- path_n = path;
+- do {
+- if (*path == 0) {
+- *path = ':';
+- done = 1;
+- }
+- if (*path == ':') {
+- *path = 0;
+- if (*path_n)
+- _dl_strcpy(mylibname, path_n);
+- else
+- _dl_strcpy(mylibname, "."); /* Assume current dir if empty path */
+- _dl_strcat(mylibname, "/");
+- _dl_strcat(mylibname, name);
+- if ((tpnt = _dl_load_elf_shared_library(secure, rpnt, mylibname)) != NULL)
+- return tpnt;
+- path_n = path+1;
++ for (p = path_list; p != NULL; p = pn) {
++ pn = _dl_strchr(p + 1, ':');
++ if (pn != NULL) {
++ plen = pn - p;
++ pn++;
++ } else
++ plen = _dl_strlen(p);
++
++ if (plen >= 7 && _dl_memcmp(p, "$ORIGIN", 7) == 0) {
++ int olen;
++ if (secure && plen != 7)
++ continue;
++ if (origin == NULL)
++ continue;
++ for (olen = _dl_strlen(origin) - 1; olen >= 0 && origin[olen] != '/'; olen--)
++ ;
++ if (olen <= 0)
++ continue;
++ _dl_memcpy(&mylibname[0], origin, olen);
++ _dl_memcpy(&mylibname[olen], p + 7, plen - 7);
++ mylibname[olen + plen - 7] = 0;
++ } else if (plen != 0) {
++ _dl_memcpy(mylibname, p, plen);
++ mylibname[plen] = 0;
++ } else {
++ _dl_strcpy(mylibname, ".");
+ }
+- path++;
+- } while (!done);
++ _dl_strcat(mylibname, "/");
++ _dl_strcat(mylibname, name);
++
++ tpnt = _dl_load_elf_shared_library(secure, rpnt, mylibname);
++ if (tpnt != NULL)
++ return tpnt;
++ }
++
+ return NULL;
+ }
+
+@@ -231,7 +238,8 @@ struct elf_resolve *_dl_load_shared_library(int secure, struct dyn_elf **rpnt,
+ if (pnt) {
+ pnt += (unsigned long) tpnt->dynamic_info[DT_STRTAB];
+ _dl_if_debug_dprint("\tsearching RPATH='%s'\n", pnt);
+- if ((tpnt1 = search_for_named_library(libname, secure, pnt, rpnt)) != NULL)
++ if ((tpnt1 = search_for_named_library(libname, secure, pnt, rpnt,
++ tpnt->libname)) != NULL)
+ return tpnt1;
+ }
+ #endif
+@@ -239,7 +247,7 @@ struct elf_resolve *_dl_load_shared_library(int secure, struct dyn_elf **rpnt,
+ /* Check in LD_{ELF_}LIBRARY_PATH, if specified and allowed */
+ if (_dl_library_path) {
+ _dl_if_debug_dprint("\tsearching LD_LIBRARY_PATH='%s'\n", _dl_library_path);
+- if ((tpnt1 = search_for_named_library(libname, secure, _dl_library_path, rpnt)) != NULL)
++ if ((tpnt1 = search_for_named_library(libname, secure, _dl_library_path, rpnt, NULL)) != NULL)
+ {
+ return tpnt1;
+ }
+@@ -253,7 +261,7 @@ struct elf_resolve *_dl_load_shared_library(int secure, struct dyn_elf **rpnt,
+ if (pnt) {
+ pnt += (unsigned long) tpnt->dynamic_info[DT_STRTAB];
+ _dl_if_debug_dprint("\tsearching RUNPATH='%s'\n", pnt);
+- if ((tpnt1 = search_for_named_library(libname, secure, pnt, rpnt)) != NULL)
++ if ((tpnt1 = search_for_named_library(libname, secure, pnt, rpnt, NULL)) != NULL)
+ return tpnt1;
+ }
+ #endif
+@@ -287,7 +295,7 @@ struct elf_resolve *_dl_load_shared_library(int secure, struct dyn_elf **rpnt,
+ /* Look for libraries wherever the shared library loader
+ * was installed */
+ _dl_if_debug_dprint("\tsearching ldso dir='%s'\n", _dl_ldsopath);
+- tpnt1 = search_for_named_library(libname, secure, _dl_ldsopath, rpnt);
++ tpnt1 = search_for_named_library(libname, secure, _dl_ldsopath, rpnt, NULL);
+ if (tpnt1 != NULL)
+ return tpnt1;
+
+@@ -300,7 +308,7 @@ struct elf_resolve *_dl_load_shared_library(int secure, struct dyn_elf **rpnt,
+ #ifndef __LDSO_CACHE_SUPPORT__
+ ":" UCLIBC_RUNTIME_PREFIX "usr/X11R6/lib"
+ #endif
+- , rpnt);
++ , rpnt, NULL);
+ if (tpnt1 != NULL)
+ return tpnt1;
+
+diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
+index 7ee9257..9423670 100644
+--- a/ldso/ldso/ldso.c
++++ b/ldso/ldso/ldso.c
+@@ -272,6 +272,20 @@ static void __attribute__ ((destructor)) __attribute_used__ _dl_fini(void)
+ }
+ }
+
++static void _dl_setup_progname(const char *argv0)
++{
++ char image[PATH_MAX];
++ ssize_t s;
++
++ s = _dl_readlink("/proc/self/exe", image, sizeof(image));
++ if (s > 0 && image[0] == '/') {
++ image[s] = 0;
++ _dl_progname = _dl_strdup(image);
++ } else if (argv0) {
++ _dl_progname = argv0;
++ }
++}
++
+ void _dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LOADADDR_TYPE load_addr,
+ ElfW(auxv_t) auxvt[AT_EGID + 1], char **envp,
+ char **argv
+@@ -321,9 +335,7 @@ void _dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LOADADDR_TYPE load_addr,
+ * been fixed up by now. Still no function calls outside of this
+ * library, since the dynamic resolver is not yet ready.
+ */
+- if (argv[0]) {
+- _dl_progname = argv[0];
+- }
++ _dl_setup_progname(argv[0]);
+
+ if (_start == (void *) auxvt[AT_ENTRY].a_un.a_val) {
+ _dl_dprintf(_dl_debug_file, "Standalone execution is not supported yet\n");
diff --git a/recipes/uclibc/uclibc-git/rtld_no.patch b/recipes/uclibc/uclibc-git/rtld_no.patch
new file mode 100644
index 0000000000..7cdcd3be3b
--- /dev/null
+++ b/recipes/uclibc/uclibc-git/rtld_no.patch
@@ -0,0 +1,210 @@
+diff --git a/ldso/include/dl-elf.h b/ldso/include/dl-elf.h
+index 7fbb373..7102351 100644
+--- a/ldso/include/dl-elf.h
++++ b/ldso/include/dl-elf.h
+@@ -25,16 +25,18 @@ static __inline__ void _dl_map_cache(void) { }
+ static __inline__ void _dl_unmap_cache(void) { }
+ #endif
+
++#define DL_RESOLVE_SECURE 0x0001
++#define DL_RESOLVE_NOLOAD 0x0002
+
+ /* Function prototypes for non-static stuff in readelflib1.c */
+ extern void _dl_parse_lazy_relocation_information(struct dyn_elf *rpnt,
+ unsigned long rel_addr, unsigned long rel_size);
+ extern int _dl_parse_relocation_information(struct dyn_elf *rpnt,
+ unsigned long rel_addr, unsigned long rel_size);
+-extern struct elf_resolve * _dl_load_shared_library(int secure,
++extern struct elf_resolve * _dl_load_shared_library(int resolve_flags,
+ struct dyn_elf **rpnt, struct elf_resolve *tpnt, char *full_libname,
+ int trace_loaded_objects);
+-extern struct elf_resolve * _dl_load_elf_shared_library(int secure,
++extern struct elf_resolve * _dl_load_elf_shared_library(int resolve_flags,
+ struct dyn_elf **rpnt, char *libname);
+ extern struct elf_resolve *_dl_check_if_named_library_is_loaded(const char *full_libname,
+ int trace_loaded_objects);
+diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
+index 2b2d429..6d35bf2 100644
+--- a/ldso/ldso/dl-elf.c
++++ b/ldso/ldso/dl-elf.c
+@@ -132,7 +132,7 @@ _dl_protect_relro (struct elf_resolve *l)
+ /* This function's behavior must exactly match that
+ * in uClibc/ldso/util/ldd.c */
+ static struct elf_resolve *
+-search_for_named_library(const char *name, int secure, const char *path_list,
++search_for_named_library(const char *name, int resolve_flags, const char *path_list,
+ struct dyn_elf **rpnt, const char *origin)
+ {
+ char *mylibname;
+@@ -162,7 +162,7 @@ search_for_named_library(const char *name, int secure, const char *path_list,
+
+ if (plen >= 7 && _dl_memcmp(p, "$ORIGIN", 7) == 0) {
+ int olen;
+- if (secure && plen != 7)
++ if ((resolve_flags & DL_RESOLVE_SECURE) && plen != 7)
+ continue;
+ if (origin == NULL)
+ continue;
+@@ -182,7 +182,7 @@ search_for_named_library(const char *name, int secure, const char *path_list,
+ _dl_strcat(mylibname, "/");
+ _dl_strcat(mylibname, name);
+
+- tpnt = _dl_load_elf_shared_library(secure, rpnt, mylibname);
++ tpnt = _dl_load_elf_shared_library(resolve_flags, rpnt, mylibname);
+ if (tpnt != NULL)
+ return tpnt;
+ }
+@@ -194,7 +194,7 @@ search_for_named_library(const char *name, int secure, const char *path_list,
+ unsigned long _dl_error_number;
+ unsigned long _dl_internal_error_number;
+
+-struct elf_resolve *_dl_load_shared_library(int secure, struct dyn_elf **rpnt,
++struct elf_resolve *_dl_load_shared_library(int resolve_flags, struct dyn_elf **rpnt,
+ struct elf_resolve *tpnt, char *full_libname, int attribute_unused trace_loaded_objects)
+ {
+ char *pnt;
+@@ -223,7 +223,7 @@ struct elf_resolve *_dl_load_shared_library(int secure, struct dyn_elf **rpnt,
+
+ if (libname != full_libname) {
+ _dl_if_debug_dprint("\ttrying file='%s'\n", full_libname);
+- tpnt1 = _dl_load_elf_shared_library(secure, rpnt, full_libname);
++ tpnt1 = _dl_load_elf_shared_library(resolve_flags, rpnt, full_libname);
+ if (tpnt1) {
+ return tpnt1;
+ }
+@@ -238,7 +238,7 @@ struct elf_resolve *_dl_load_shared_library(int secure, struct dyn_elf **rpnt,
+ if (pnt) {
+ pnt += (unsigned long) tpnt->dynamic_info[DT_STRTAB];
+ _dl_if_debug_dprint("\tsearching RPATH='%s'\n", pnt);
+- if ((tpnt1 = search_for_named_library(libname, secure, pnt, rpnt,
++ if ((tpnt1 = search_for_named_library(libname, resolve_flags, pnt, rpnt,
+ tpnt->libname)) != NULL)
+ return tpnt1;
+ }
+@@ -247,7 +247,7 @@ struct elf_resolve *_dl_load_shared_library(int secure, struct dyn_elf **rpnt,
+ /* Check in LD_{ELF_}LIBRARY_PATH, if specified and allowed */
+ if (_dl_library_path) {
+ _dl_if_debug_dprint("\tsearching LD_LIBRARY_PATH='%s'\n", _dl_library_path);
+- if ((tpnt1 = search_for_named_library(libname, secure, _dl_library_path, rpnt, NULL)) != NULL)
++ if ((tpnt1 = search_for_named_library(libname, resolve_flags, _dl_library_path, rpnt, NULL)) != NULL)
+ {
+ return tpnt1;
+ }
+@@ -261,7 +261,7 @@ struct elf_resolve *_dl_load_shared_library(int secure, struct dyn_elf **rpnt,
+ if (pnt) {
+ pnt += (unsigned long) tpnt->dynamic_info[DT_STRTAB];
+ _dl_if_debug_dprint("\tsearching RUNPATH='%s'\n", pnt);
+- if ((tpnt1 = search_for_named_library(libname, secure, pnt, rpnt, NULL)) != NULL)
++ if ((tpnt1 = search_for_named_library(libname, resolve_flags, pnt, rpnt, NULL)) != NULL)
+ return tpnt1;
+ }
+ #endif
+@@ -284,7 +284,7 @@ struct elf_resolve *_dl_load_shared_library(int secure, struct dyn_elf **rpnt,
+ || libent[i].flags == LIB_ELF_LIBC0
+ || libent[i].flags == LIB_ELF_LIBC5)
+ && _dl_strcmp(libname, strs + libent[i].sooffset) == 0
+- && (tpnt1 = _dl_load_elf_shared_library(secure, rpnt, strs + libent[i].liboffset))
++ && (tpnt1 = _dl_load_elf_shared_library(resolve_flags, rpnt, strs + libent[i].liboffset))
+ ) {
+ return tpnt1;
+ }
+@@ -295,14 +295,14 @@ struct elf_resolve *_dl_load_shared_library(int secure, struct dyn_elf **rpnt,
+ /* Look for libraries wherever the shared library loader
+ * was installed */
+ _dl_if_debug_dprint("\tsearching ldso dir='%s'\n", _dl_ldsopath);
+- tpnt1 = search_for_named_library(libname, secure, _dl_ldsopath, rpnt, NULL);
++ tpnt1 = search_for_named_library(libname, resolve_flags, _dl_ldsopath, rpnt, NULL);
+ if (tpnt1 != NULL)
+ return tpnt1;
+
+ /* Lastly, search the standard list of paths for the library.
+ This list must exactly match the list in uClibc/ldso/util/ldd.c */
+ _dl_if_debug_dprint("\tsearching full lib path list\n");
+- tpnt1 = search_for_named_library(libname, secure,
++ tpnt1 = search_for_named_library(libname, resolve_flags,
+ UCLIBC_RUNTIME_PREFIX "lib:"
+ UCLIBC_RUNTIME_PREFIX "usr/lib"
+ #ifndef __LDSO_CACHE_SUPPORT__
+@@ -329,7 +329,7 @@ goof:
+ * are required.
+ */
+
+-struct elf_resolve *_dl_load_elf_shared_library(int secure,
++struct elf_resolve *_dl_load_elf_shared_library(int resolve_flags,
+ struct dyn_elf **rpnt, char *libname)
+ {
+ ElfW(Ehdr) *epnt;
+@@ -368,7 +368,7 @@ struct elf_resolve *_dl_load_elf_shared_library(int secure,
+ }
+ /* If we are in secure mode (i.e. a setu/gid binary using LD_PRELOAD),
+ we don't load the library if it isn't setuid. */
+- if (secure) {
++ if (resolve_flags & DL_RESOLVE_SECURE) {
+ if (!(st.st_mode & S_ISUID)) {
+ _dl_close(infile);
+ return NULL;
+@@ -384,6 +384,10 @@ struct elf_resolve *_dl_load_elf_shared_library(int secure,
+ return tpnt;
+ }
+ }
++ if (resolve_flags & DL_RESOLVE_NOLOAD) {
++ _dl_close(infile);
++ return NULL;
++ }
+ header = _dl_mmap((void *) 0, _dl_pagesize, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANONYMOUS | MAP_UNINITIALIZE, -1, 0);
+ if (_dl_mmap_check_error(header)) {
+diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
+index 9423670..b71af34 100644
+--- a/ldso/ldso/ldso.c
++++ b/ldso/ldso/ldso.c
+@@ -646,7 +646,9 @@ void _dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LOADADDR_TYPE load_addr,
+ if (!_dl_secure || _dl_strchr(str, '/') == NULL) {
+ _dl_if_debug_dprint("\tfile='%s'; needed by '%s'\n", str, _dl_progname);
+
+- tpnt1 = _dl_load_shared_library(_dl_secure, &rpnt, NULL, str, trace_loaded_objects);
++ tpnt1 = _dl_load_shared_library(
++ _dl_secure ? DL_RESOLVE_SECURE : 0,
++ &rpnt, NULL, str, trace_loaded_objects);
+ if (!tpnt1) {
+ #ifdef __LDSO_LDD_SUPPORT__
+ if (trace_loaded_objects)
+diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c
+index 68cd579..edf38d2 100644
+--- a/ldso/libdl/libdl.c
++++ b/ldso/libdl/libdl.c
+@@ -288,7 +288,7 @@ void *dlopen(const char *libname, int flag)
+ #endif
+
+ /* A bit of sanity checking... */
+- if (!(flag & (RTLD_LAZY|RTLD_NOW))) {
++ if (!(flag & (RTLD_LAZY|RTLD_NOW|RTLD_NOLOAD))) {
+ _dl_error_number = LD_BAD_HANDLE;
+ return NULL;
+ }
+@@ -358,8 +358,9 @@ void *dlopen(const char *libname, int flag)
+ /* Try to load the specified library */
+ _dl_if_debug_print("Trying to dlopen '%s', RTLD_GLOBAL:%d RTLD_NOW:%d\n",
+ (char*)libname, (flag & RTLD_GLOBAL ? 1:0), (now_flag & RTLD_NOW ? 1:0));
+- tpnt = _dl_load_shared_library(0, &rpnt, tfrom, (char*)libname, 0);
+
++ tpnt = _dl_load_shared_library((flag & RTLD_NOLOAD) ? DL_RESOLVE_NOLOAD : 0,
++ &rpnt, tfrom, (char*)libname, 0);
+ if (tpnt == NULL) {
+ _dl_unmap_cache();
+ return NULL;
+diff --git a/libc/sysdeps/linux/common/bits/dlfcn.h b/libc/sysdeps/linux/common/bits/dlfcn.h
+index 4bfbbff..47b42ad 100644
+--- a/libc/sysdeps/linux/common/bits/dlfcn.h
++++ b/libc/sysdeps/linux/common/bits/dlfcn.h
+@@ -24,9 +24,9 @@
+ /* The MODE argument to `dlopen' contains one of the following: */
+ #define RTLD_LAZY 0x00001 /* Lazy function call binding. */
+ #define RTLD_NOW 0x00002 /* Immediate function call binding. */
+-#if 0 /* uClibc doesnt support these */
+-#define RTLD_BINDING_MASK 0x3 /* Mask of binding time value. */
++#define RTLD_BINDING_MASK 0x3 /* Mask of binding time value. */
+ #define RTLD_NOLOAD 0x00004 /* Do not load the object. */
++#if 0 /* uClibc doesnt support these */
+ #define RTLD_DEEPBIND 0x00008 /* Use deep binding. */
+ #endif
diff --git a/recipes/uclibc/uclibc-git/uClibc.distro b/recipes/uclibc/uclibc-git/uClibc.distro
index e25324d3d1..63fc821491 100644
--- a/recipes/uclibc/uclibc-git/uClibc.distro
+++ b/recipes/uclibc/uclibc-git/uClibc.distro
@@ -147,6 +147,7 @@ UCLIBC_EXTRA_CFLAGS=""
# SUPPORT_LD_DEBUG is not set
# SUPPORT_LD_DEBUG_EARLY is not set
# UCLIBC_MALLOC_DEBUGGING is not set
+UCLIBC_HAS_BACKTRACE=y
WARNINGS="-Wall"
# EXTRA_WARNINGS is not set
# DOMULTI is not set
diff --git a/recipes/uclibc/uclibc_git.bb b/recipes/uclibc/uclibc_git.bb
index 385377c547..a7f8a5f3f1 100644
--- a/recipes/uclibc/uclibc_git.bb
+++ b/recipes/uclibc/uclibc_git.bb
@@ -7,14 +7,14 @@
# on whether the base patches apply to the selected (SRCDATE) svn release.
#
UCLIBC_BASE ?= "0.9.32"
-SRCREV="251f2266bf24b1b396f59eef60d0acf41fdd02e4"
+SRCREV="71d63ed75648da9b0b71afabb9c60aaad792c55c"
PR_append = "+gitr${SRCPV}"
DEFAULT_PREFERENCE = "-1"
#DEFAULT_PREFERENCE is 0 (empty), releases have a preference of 1 so take
# precedence.
require uclibc.inc
-PR = "${INC_PR}.9"
+PR = "${INC_PR}.10"
PROVIDES += "virtual/${TARGET_PREFIX}libc-for-gcc"
#recent versions uclibc require real kernel headers
@@ -39,6 +39,13 @@ SRC_URI = "git://uclibc.org/uClibc.git;branch=master;protocol=git \
file://detect-bx-availibility.patch \
file://remove-eabi-oabi-selection.patch \
file://powerpc_copysignl.patch \
- file://fts-support.patch \
+ file://orign_path.patch \
+ file://rtld_no.patch \
"
S = "${WORKDIR}/git"
+
+PACKAGES =+ "libubacktrace"
+
+FILES_libubacktrace = "\
+ ${base_libdir}/libubacktrace*.so.* ${base_libdir}/libubacktrace-*.so \
+ "
diff --git a/recipes/udev-rules-buglabs/bug-udev/00-bug20.rules b/recipes/udev-rules-buglabs/bug-udev/00-bug20.rules
index 0722c5c235..946c89c299 100644
--- a/recipes/udev-rules-buglabs/bug-udev/00-bug20.rules
+++ b/recipes/udev-rules-buglabs/bug-udev/00-bug20.rules
@@ -12,12 +12,13 @@ KERNEL=="ttySC1", SUBSYSTEMS=="platform", SYMLINK+="ttyBMI3"
ACTION=="add" KERNEL=="mmcblk1*", RUN+="/sbin/modprobe g_file_storage file=/dev/%k removable=1"
ACTION=="remove" KERNEL=="mmcblk1*", RUN+="/sbin/modprobe -r g_file_storage"
# For Novatel USB 3G (CDMA) Dongle
-ATTRS{idVendor}=="1410", ATTRS{idProduct}=="5030", RUN+="/usr/bin/eject %k"
-ATTRS{idVendor}=="1410", ATTRS{idProduct}=="6000", RUN+="/sbin/modprobe usbserial vendor=0x1410 product=0x6000"
+SUBSYSTEMS=="scsi",DRIVERS=="sr",ATTRS{vendor}=="Novatel ",ACTION=="add",RUN+="/usr/bin/eject %k"
# For Sprint U301 3g/4g
ATTRS{idVendor}=="1a40", ATTRS{idProduct}=="0101", RUN+="/usr/bin/eject %k"
ATTRS{idVendor}=="16d8", ATTRS{idProduct}=="6008" RUN+="/sbin/modprobe usbserial vendor=0x16d8 product=0x6008"
# For libertas_sdio named eth1
SUBSYSTEMS=="sdio", DRIVERS=="libertas_sdio", NAME="wlan0"
KERNEL=="event*",ATTRS{name}=="twl4030_pwrbutton",SYMLINK+="input/power_button"
-KERNEL=="event*",ATTRS{name}=="omap_twl4030keypad",SYMLINK+="input/user_button"
+KERNEL=="event*",ATTRS{name}=="TWL4030 Keypad",SYMLINK+="input/user_button"
+# Set eth1assoc as the default trigger for the wifi-green LED
+SUBSYSTEMS=="sdio", DRIVERS=="libertas_sdio", NAME="wlan0", RUN+="/etc/udev/scripts/wlan-trigger.sh"
diff --git a/recipes/udev-rules-buglabs/bug-udev/wlan-trigger.sh b/recipes/udev-rules-buglabs/bug-udev/wlan-trigger.sh
new file mode 100644
index 0000000000..1eb4ca1b93
--- /dev/null
+++ b/recipes/udev-rules-buglabs/bug-udev/wlan-trigger.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+if [ -e /sys/class/net/eth0 ]; then
+ echo phy1assoc > /sys/class/leds/omap3bug\:green\:wifi/trigger
+else
+ echo phy0assoc > /sys/class/leds/omap3bug\:green\:wifi/trigger
+fi
+echo none > /sys/class/leds/omap3bug\:red\:wifi/trigger
diff --git a/recipes/udev-rules-buglabs/bug-udev_0.1.bb b/recipes/udev-rules-buglabs/bug-udev_0.1.bb
index b9238fae06..35db9e383e 100644
--- a/recipes/udev-rules-buglabs/bug-udev_0.1.bb
+++ b/recipes/udev-rules-buglabs/bug-udev_0.1.bb
@@ -3,14 +3,15 @@ LICENSE = "GPL"
SECTION = "x11"
PRIORITY = "optional"
RDEPENDS_${PN} = "udev"
-PR = "r25"
+PR = "r26"
SRC_URI = "file://00-bug20.rules \
- file://bmi_eventpipe.sh \
- file://bt_init.sh \
- file://working.psr \
+ file://bmi_eventpipe.sh \
+ file://bt_init.sh \
+ file://working.psr \
file://mbkb-stop.sh \
file://mbkb-start.sh \
+ file://wlan-trigger.sh \
"
S = "${WORKDIR}"
diff --git a/recipes/udev/udev/0001-rip-put-doc-generation-it-depends-on-a-working-docto.patch b/recipes/udev/udev/0001-rip-put-doc-generation-it-depends-on-a-working-docto.patch
new file mode 100644
index 0000000000..baf5acdee1
--- /dev/null
+++ b/recipes/udev/udev/0001-rip-put-doc-generation-it-depends-on-a-working-docto.patch
@@ -0,0 +1,45 @@
+From 85dcc3a22951d3586b05e3305d735f33b84ee3e5 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Mon, 16 May 2011 14:11:01 +0200
+Subject: [PATCH] rip put doc generation, it depends on a working doctools setup
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ Makefile.am | 21 +--------------------
+ 1 files changed, 1 insertions(+), 20 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 651a154..69eb9d9 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -174,26 +174,7 @@ udev_udevadm_LDADD = libudev/libudev-private.la
+ # ------------------------------------------------------------------------------
+ # udev man pages
+ # ------------------------------------------------------------------------------
+-dist_man_MANS = \
+- udev/udev.7 \
+- udev/udevadm.8 \
+- udev/udevd.8
+-
+-dist_noinst_DATA = \
+- udev/udev.html \
+- udev/udevadm.html \
+- udev/udevd.html
+-
+-EXTRA_DIST += \
+- udev/udev.xml \
+- udev/udevadm.xml \
+- udev/udevd.xml
+-
+-udev/%.7 udev/%.8 : udev/%.xml
+- $(AM_V_GEN)$(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
+-
+-udev/%.html : udev/%.xml
+- $(AM_V_GEN)$(XSLTPROC) -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/xhtml-1_1/docbook.xsl $<
++dist_man_MANS =
+
+ # ------------------------------------------------------------------------------
+ # udev tests
+--
+1.6.6.1
+
diff --git a/recipes/udev/udev/gtk-doc.make b/recipes/udev/udev/gtk-doc.make
new file mode 100644
index 0000000000..57fab98686
--- /dev/null
+++ b/recipes/udev/udev/gtk-doc.make
@@ -0,0 +1,230 @@
+# -*- mode: makefile -*-
+
+####################################
+# Everything below here is generic #
+####################################
+
+if GTK_DOC_USE_LIBTOOL
+GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
+GTKDOC_RUN = $(LIBTOOL) --mode=execute
+else
+GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
+GTKDOC_RUN =
+endif
+
+# We set GPATH here; this gives us semantics for GNU make
+# which are more like other make's VPATH, when it comes to
+# whether a source that is a target of one rule is then
+# searched for in VPATH/GPATH.
+#
+GPATH = $(srcdir)
+
+TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
+
+EXTRA_DIST = \
+ $(content_files) \
+ $(HTML_IMAGES) \
+ $(DOC_MAIN_SGML_FILE) \
+ $(DOC_MODULE)-sections.txt \
+ $(DOC_MODULE)-overrides.txt
+
+DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
+ pdf-build.stamp \
+ $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp \
+ $(srcdir)/pdf.stamp
+
+SCANOBJ_FILES = \
+ $(DOC_MODULE).args \
+ $(DOC_MODULE).hierarchy \
+ $(DOC_MODULE).interfaces \
+ $(DOC_MODULE).prerequisites \
+ $(DOC_MODULE).signals
+
+REPORT_FILES = \
+ $(DOC_MODULE)-undocumented.txt \
+ $(DOC_MODULE)-undeclared.txt \
+ $(DOC_MODULE)-unused.txt
+
+CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS)
+
+if ENABLE_GTK_DOC
+if GTK_DOC_BUILD_HTML
+HTML_BUILD_STAMP=html-build.stamp
+else
+HTML_BUILD_STAMP=
+endif
+if GTK_DOC_BUILD_PDF
+PDF_BUILD_STAMP=pdf-build.stamp
+else
+PDF_BUILD_STAMP=
+endif
+
+all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
+else
+all-local:
+endif
+
+docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
+
+$(REPORT_FILES): sgml-build.stamp
+
+#### scan ####
+
+scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
+ @echo 'gtk-doc: Scanning header files'
+ @-chmod -R u+w $(srcdir)
+ @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \
+ _source_dir="$${_source_dir} --source-dir=$$i" ; \
+ done ; \
+ cd $(srcdir) && \
+ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES)
+ @if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \
+ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
+ else \
+ cd $(srcdir) ; \
+ for i in $(SCANOBJ_FILES) ; do \
+ test -f $$i || touch $$i ; \
+ done \
+ fi
+ @touch scan-build.stamp
+
+$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp
+ @true
+
+#### templates ####
+
+tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
+ @echo 'gtk-doc: Rebuilding template files'
+ @-chmod -R u+w $(srcdir)
+ @cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)
+ @touch tmpl-build.stamp
+
+tmpl.stamp: tmpl-build.stamp
+ @true
+
+$(srcdir)/tmpl/*.sgml:
+ @true
+
+#### xml ####
+
+sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files)
+ @echo 'gtk-doc: Building XML'
+ @-chmod -R u+w $(srcdir)
+ @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \
+ _source_dir="$${_source_dir} --source-dir=$$i" ; \
+ done ; \
+ cd $(srcdir) && \
+ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS)
+ @touch sgml-build.stamp
+
+sgml.stamp: sgml-build.stamp
+ @true
+
+#### html ####
+
+html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
+ @echo 'gtk-doc: Building HTML'
+ @-chmod -R u+w $(srcdir)
+ @rm -rf $(srcdir)/html
+ @mkdir $(srcdir)/html
+ @mkhtml_options=""; \
+ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \
+ if test "$(?)" = "0"; then \
+ mkhtml_options=--path="$(srcdir)"; \
+ fi; \
+ cd $(srcdir)/html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
+ @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
+ @echo 'gtk-doc: Fixing cross-references'
+ @cd $(srcdir) && gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
+ @touch html-build.stamp
+
+#### pdf ####
+
+pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
+ @echo 'gtk-doc: Building PDF'
+ @-chmod -R u+w $(srcdir)
+ @rm -rf $(srcdir)/$(DOC_MODULE).pdf
+ @mkpdf_imgdirs=""; \
+ if test "x$(HTML_IMAGES)" != "x"; then \
+ for img in $(HTML_IMAGES); do \
+ part=`dirname $$img`; \
+ echo $$mkpdf_imgdirs | grep >/dev/null "\-\-imgdir=$$part "; \
+ if test $$? != 0; then \
+ mkpdf_imgdirs="$$mkpdf_imgdirs --imgdir=$$part"; \
+ fi; \
+ done; \
+ fi; \
+ cd $(srcdir) && gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
+ @touch pdf-build.stamp
+
+##############
+
+clean-local:
+ rm -f *~ *.bak
+ rm -rf .libs
+
+distclean-local:
+ cd $(srcdir) && \
+ rm -rf xml $(REPORT_FILES) $(DOC_MODULE).pdf \
+ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
+
+maintainer-clean-local: clean
+ cd $(srcdir) && rm -rf xml html
+
+install-data-local:
+ @installfiles=`echo $(srcdir)/html/*`; \
+ if test "$$installfiles" = '$(srcdir)/html/*'; \
+ then echo '-- Nothing to install' ; \
+ else \
+ if test -n "$(DOC_MODULE_VERSION)"; then \
+ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
+ else \
+ installdir="$(DESTDIR)$(TARGET_DIR)"; \
+ fi; \
+ $(mkinstalldirs) $${installdir} ; \
+ for i in $$installfiles; do \
+ echo '-- Installing '$$i ; \
+ $(INSTALL_DATA) $$i $${installdir}; \
+ done; \
+ if test -n "$(DOC_MODULE_VERSION)"; then \
+ mv -f $${installdir}/$(DOC_MODULE).devhelp2 \
+ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \
+ mv -f $${installdir}/$(DOC_MODULE).devhelp \
+ $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \
+ fi; \
+ $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \
+ fi
+
+uninstall-local:
+ @if test -n "$(DOC_MODULE_VERSION)"; then \
+ installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
+ else \
+ installdir="$(DESTDIR)$(TARGET_DIR)"; \
+ fi; \
+ rm -rf $${installdir}
+
+#
+# Require gtk-doc when making dist
+#
+if ENABLE_GTK_DOC
+dist-check-gtkdoc:
+else
+dist-check-gtkdoc:
+ @echo "*** gtk-doc must be installed and enabled in order to make dist"
+ @false
+endif
+
+dist-hook: dist-check-gtkdoc dist-hook-local
+ mkdir $(distdir)/tmpl
+ mkdir $(distdir)/html
+ -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
+ cp $(srcdir)/html/* $(distdir)/html
+ -cp $(srcdir)/$(DOC_MODULE).pdf $(distdir)/
+ -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/
+ -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/
+ cd $(distdir) && rm -f $(DISTCLEANFILES)
+ $(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html
+
+.PHONY : dist-hook-local docs
diff --git a/recipes/udev/udev_165.bb b/recipes/udev/udev_165.bb
index bad847b8b7..f90925699e 100644
--- a/recipes/udev/udev_165.bb
+++ b/recipes/udev/udev_165.bb
@@ -3,13 +3,13 @@ DESCRIPTION = "udev is a daemon which dynamically creates and removes device nod
the hotplug package and requires a kernel not older than 2.6.12."
LICENSE = "GPLv2+"
-PR = "r5"
+PR = "r6"
# Untested
DEFAULT_PREFERENCE = "-1"
# Needed for udev-extras
-DEPENDS = "gperf-native usbutils acl glib-2.0"
+DEPENDS = "gperf-native usbutils acl glib-2.0 mtd-utils"
RDEPENDS_${PN} += "module-init-tools-depmod udev-utils"
SRC_URI = "http://kernel.org/pub/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \
diff --git a/recipes/udev/udev_171.bb b/recipes/udev/udev_171.bb
new file mode 100644
index 0000000000..e53b4903db
--- /dev/null
+++ b/recipes/udev/udev_171.bb
@@ -0,0 +1,125 @@
+DESCRIPTION = "udev is a daemon which dynamically creates and removes device nodes from \
+/dev/, handles hotplug events and loads drivers at boot time. It replaces \
+the hotplug package and requires a kernel not older than 2.6.27."
+
+# udev 169 and up require kernel 2.6.36 for ARM:
+# http://git.kernel.org/?p=linux/hotplug/udev.git;a=commit;h=67a77c8bf299f6264f001677becd056316ebce2f
+
+LICENSE = "GPLv2+"
+
+# Untested
+DEFAULT_PREFERENCE = "-1"
+
+# Needed for udev-extras
+DEPENDS = "gperf-native usbutils acl glib-2.0"
+
+SRCREV = "${PV}"
+PR = "r0"
+
+# version specific SRC_URI
+SRC_URI = "git://git.kernel.org/pub/scm/linux/hotplug/udev.git;protocol=git \
+ file://0001-rip-put-doc-generation-it-depends-on-a-working-docto.patch \
+ file://gtk-doc.make"
+SRC_URI[md5sum] = "08eb7c2564bc89defcefdaa6ec4a9fc1"
+SRC_URI[sha256sum] = "1d5c548d7c85d30b3508b82ad88d853e28dddb6c526d0e67aa92ac18af93d218"
+
+# generic SRC_URI
+SRC_URI += " \
+ file://mount.sh \
+ file://mount.blacklist \
+ file://network.sh \
+ file://local.rules \
+ file://default \
+ file://init \
+ file://cache \
+ file://udev-compat-wrapper-patch \
+"
+
+# Machine specific udev rules should be in their own recipe that ${PN} can add to RRECOMMENDS
+
+
+S = "${WORKDIR}/git"
+
+inherit update-rc.d autotools
+
+EXTRA_OECONF += " \
+ --disable-introspection \
+ --with-pci-ids-path=/usr/share/misc \
+ ac_cv_file__usr_share_pci_ids=no \
+ ac_cv_file__usr_share_hwdata_pci_ids=no \
+ ac_cv_file__usr_share_misc_pci_ids=yes \
+ --sbindir=${base_sbindir} \
+ --libexecdir=${base_libdir}/udev \
+ --with-rootlibdir=${base_libdir} \
+ --disable-gtk-doc-html \
+ --with-systemdsystemunitdir=${base_libdir}/systemd/system/ \
+"
+
+do_configure_prepend() {
+ cp ${WORKDIR}/gtk-doc.make ${S}
+}
+
+INITSCRIPT_NAME = "udev"
+INITSCRIPT_PARAMS = "start 04 S ."
+
+PACKAGES =+ "libudev libgudev udev-utils"
+
+FILES_libudev = "${base_libdir}/libudev.so.*"
+FILES_libgudev = "${base_libdir}/libgudev*.so.*"
+
+FILES_udev-utils = "${bindir}/udevinfo ${bindir}/udevtest ${base_sbindir}/udevadm"
+
+RPROVIDES_${PN} = "hotplug"
+FILES_${PN} += "${usrbindir}/* ${usrsbindir}/udevd"
+FILES_${PN}-dbg += "${usrbindir}/.debug ${usrsbindir}/.debug"
+RDEPENDS_${PN} += "module-init-tools-depmod udev-utils"
+
+# udev installs binaries under $(udev_prefix)/lib/udev, even if ${libdir}
+# is ${prefix}/lib64
+FILES_${PN} += "/lib/udev* ${libdir}/ConsoleKit"
+FILES_${PN}-dbg += "/lib/udev/.debug"
+
+# Package up systemd files
+FILES_${PN} += "${base_libdir}/systemd"
+
+RPROVIDES_${PN}_append = " udev-compat-wrapper"
+
+do_install () {
+ install -d ${D}${usrsbindir} \
+ ${D}${sbindir}
+ oe_runmake 'DESTDIR=${D}' INSTALL=install install
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev
+ install -m 0755 ${WORKDIR}/cache ${D}${sysconfdir}/init.d/udev-cache
+
+ install -d ${D}${sysconfdir}/default
+ install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/udev
+
+ install -m 0644 ${WORKDIR}/mount.blacklist ${D}${sysconfdir}/udev/
+ install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/local.rules
+
+ touch ${D}${sysconfdir}/udev/saved.uname
+ touch ${D}${sysconfdir}/udev/saved.cmdline
+ touch ${D}${sysconfdir}/udev/saved.devices
+ touch ${D}${sysconfdir}/udev/saved.atags
+
+ install -d ${D}${sysconfdir}/udev/scripts/
+
+ install -m 0755 ${WORKDIR}/mount.sh ${D}${sysconfdir}/udev/scripts/mount.sh
+ install -m 0755 ${WORKDIR}/network.sh ${D}${sysconfdir}/udev/scripts
+
+ # disable udev-cache sysv script on systemd installs
+ if [ -d {D}/${base_libdir}/systemd/ ] ; then
+ ln -sf /dev/null ${D}/${base_libdir}/systemd/udev-cache.service
+ fi
+}
+
+# Create the cache after checkroot has run
+pkg_postinst_udev_append() {
+ if test "x$D" != "x"; then
+ OPT="-r $D"
+ else
+ OPT="-s"
+ fi
+ update-rc.d $OPT udev-cache start 36 S .
+}
diff --git a/recipes/udev/udev_git.bb b/recipes/udev/udev_git.bb
new file mode 100644
index 0000000000..04d21a2cb1
--- /dev/null
+++ b/recipes/udev/udev_git.bb
@@ -0,0 +1,126 @@
+DESCRIPTION = "udev is a daemon which dynamically creates and removes device nodes from \
+/dev/, handles hotplug events and loads drivers at boot time. It replaces \
+the hotplug package and requires a kernel not older than 2.6.27."
+
+# udev 169 and up require kernel 2.6.36 for ARM:
+# http://git.kernel.org/?p=linux/hotplug/udev.git;a=commit;h=67a77c8bf299f6264f001677becd056316ebce2f
+
+LICENSE = "GPLv2+"
+
+# Untested
+DEFAULT_PREFERENCE = "-1"
+
+# Needed for udev-extras
+DEPENDS = "gperf-native usbutils acl glib-2.0"
+
+SRCREV = "3e227830ad6494700e18ae03297e8fb833ff26bf"
+PV = "171"
+PR = "r0"
+PR_append = "+gitr${SRCPV}"
+
+# version specific SRC_URI
+SRC_URI = "git://git.kernel.org/pub/scm/linux/hotplug/udev.git;protocol=git \
+ file://0001-rip-put-doc-generation-it-depends-on-a-working-docto.patch \
+ file://gtk-doc.make"
+SRC_URI[md5sum] = "08eb7c2564bc89defcefdaa6ec4a9fc1"
+SRC_URI[sha256sum] = "1d5c548d7c85d30b3508b82ad88d853e28dddb6c526d0e67aa92ac18af93d218"
+
+# generic SRC_URI
+SRC_URI += " \
+ file://mount.sh \
+ file://mount.blacklist \
+ file://network.sh \
+ file://local.rules \
+ file://default \
+ file://init \
+ file://cache \
+ file://udev-compat-wrapper-patch \
+"
+
+S = "${WORKDIR}/git"
+
+inherit update-rc.d autotools
+
+EXTRA_OECONF += " \
+ --disable-introspection \
+ --with-pci-ids-path=/usr/share/misc \
+ ac_cv_file__usr_share_pci_ids=no \
+ ac_cv_file__usr_share_hwdata_pci_ids=no \
+ ac_cv_file__usr_share_misc_pci_ids=yes \
+ --sbindir=${base_sbindir} \
+ --libexecdir=${base_libdir}/udev \
+ --with-rootlibdir=${base_libdir} \
+ --disable-gtk-doc-html \
+ --with-systemdsystemunitdir=${base_libdir}/systemd/system/ \
+"
+
+do_configure_prepend() {
+ cp ${WORKDIR}/gtk-doc.make ${S}
+}
+
+INITSCRIPT_NAME = "udev"
+INITSCRIPT_PARAMS = "start 04 S ."
+
+PACKAGES =+ "libudev libgudev udev-utils"
+
+FILES_libudev = "${base_libdir}/libudev.so.*"
+FILES_libgudev = "${base_libdir}/libgudev*.so.*"
+
+FILES_udev-utils = "${bindir}/udevinfo ${bindir}/udevtest ${base_sbindir}/udevadm"
+
+RPROVIDES_${PN} = "hotplug"
+FILES_${PN} += "${usrbindir}/* ${usrsbindir}/udevd"
+FILES_${PN}-dbg += "${usrbindir}/.debug ${usrsbindir}/.debug"
+RDEPENDS_${PN} += "module-init-tools-depmod udev-utils"
+
+# udev installs binaries under $(udev_prefix)/lib/udev, even if ${libdir}
+# is ${prefix}/lib64
+FILES_${PN} += "/lib/udev* ${libdir}/ConsoleKit"
+FILES_${PN}-dbg += "/lib/udev/.debug"
+
+# Package up systemd files
+FILES_${PN} += "${base_libdir}/systemd"
+
+RPROVIDES_${PN}_append = " udev-compat-wrapper"
+
+do_install () {
+ install -d ${D}${usrsbindir} \
+ ${D}${sbindir}
+ oe_runmake 'DESTDIR=${D}' INSTALL=install install
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev
+ install -m 0755 ${WORKDIR}/cache ${D}${sysconfdir}/init.d/udev-cache
+
+ install -d ${D}${sysconfdir}/default
+ install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/udev
+
+ cp ${S}/rules/rules.d/* ${D}${sysconfdir}/udev/rules.d/
+
+ install -m 0644 ${WORKDIR}/mount.blacklist ${D}${sysconfdir}/udev/
+ install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/local.rules
+
+ touch ${D}${sysconfdir}/udev/saved.uname
+ touch ${D}${sysconfdir}/udev/saved.cmdline
+ touch ${D}${sysconfdir}/udev/saved.devices
+ touch ${D}${sysconfdir}/udev/saved.atags
+
+ install -d ${D}${sysconfdir}/udev/scripts/
+
+ install -m 0755 ${WORKDIR}/mount.sh ${D}${sysconfdir}/udev/scripts/mount.sh
+ install -m 0755 ${WORKDIR}/network.sh ${D}${sysconfdir}/udev/scripts
+
+ # disable udev-cache sysv script on systemd installs
+ if [ -d {D}/${base_libdir}/systemd/ ] ; then
+ ln -sf /dev/null ${D}/${base_libdir}/systemd/udev-cache.service
+ fi
+}
+
+# Create the cache after checkroot has run
+pkg_postinst_udev_append() {
+ if test "x$D" != "x"; then
+ OPT="-r $D"
+ else
+ OPT="-s"
+ fi
+ update-rc.d $OPT udev-cache start 36 S .
+}
diff --git a/recipes/uhd/uhd-firmware_003.000.001.bb b/recipes/uhd/uhd-firmware_003.000.001.bb
deleted file mode 100644
index 59018f4fab..0000000000
--- a/recipes/uhd/uhd-firmware_003.000.001.bb
+++ /dev/null
@@ -1,7 +0,0 @@
-require recipes/uhd/uhd-firmware.inc
-
-PR = "${INC_PR}.0"
-
-SRC_URI[md5sum] = "00bf346a4e6b8fb1f0d1633e4464cd34"
-SRC_URI[sha256sum] = "231e8e63b6a3348b36881540e3738912d082a74118fd439feeec32ed76b56ba3"
-
diff --git a/recipes/uhd/uhd-firmware_003.001.000.bb b/recipes/uhd/uhd-firmware_003.001.000.bb
new file mode 100644
index 0000000000..5d30806798
--- /dev/null
+++ b/recipes/uhd/uhd-firmware_003.001.000.bb
@@ -0,0 +1,7 @@
+require recipes/uhd/uhd-firmware.inc
+
+PR = "${INC_PR}.0"
+
+SRC_URI[md5sum] = "0d6a6792c6b98e9163d67cb62bf29dce"
+SRC_URI[sha256sum] = "3b25726946026c6d25061403e3343d72b34cc41e7e44026b272510379d01233a"
+
diff --git a/recipes/uhd/uhd_git.bb b/recipes/uhd/uhd_git.bb
index 6c90ec3743..80f32b78f5 100644
--- a/recipes/uhd/uhd_git.bb
+++ b/recipes/uhd/uhd_git.bb
@@ -1,8 +1,8 @@
require recipes/uhd/uhd.inc
-PR = "${INC_PR}.3"
+PR = "${INC_PR}.4"
SRC_URI = "git://ettus.sourcerepo.com/ettus/uhd.git;protocol=git"
S = "${WORKDIR}/git/host"
-SRCREV = "81e891f3f38259e7450b454933c979f2d8c93d65"
+SRCREV = "0aff497dacc9cc4eba5d800cc46343da083cfdf1"
diff --git a/recipes/v4l2apps/media-ctl_git.bb b/recipes/v4l2apps/media-ctl_git.bb
new file mode 100644
index 0000000000..99ec8e2558
--- /dev/null
+++ b/recipes/v4l2apps/media-ctl_git.bb
@@ -0,0 +1,16 @@
+DESCRIPTION = "Media controller control application"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=751419260aa954499f7abaabaa882bbe"
+
+SRC_URI = "git://git.ideasonboard.org/media-ctl.git;protocol=git"
+SRCREV = "a183835abdefb8e40650fc9eb22e2d291aac9883"
+
+PV = "0.0.1"
+S = "${WORKDIR}/git"
+
+inherit autotools
+
+# It needs some kernel definitions for v4l2, so it isn't machine specific
+EXTRA_OECONF = "--with-kernel-headers=${STAGING_KERNEL_DIR}"
+
+
diff --git a/recipes/v4l2apps/yavta_git.bb b/recipes/v4l2apps/yavta_git.bb
new file mode 100644
index 0000000000..705bf7d3e6
--- /dev/null
+++ b/recipes/v4l2apps/yavta_git.bb
@@ -0,0 +1,16 @@
+DESCRIPTION = "Yet Another V4L2 Test Application"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=751419260aa954499f7abaabaa882bbe"
+
+SRC_URI = "git://git.ideasonboard.org/yavta.git;protocol=git"
+SRCREV = "d62cb9d7435525660fd5c97941c7cf57921370b3"
+
+PV = "0.0"
+S = "${WORKDIR}/git"
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 yavta ${D}${bindir}
+}
+
+
diff --git a/recipes/vsftpd/vsftpd_2.0.5.bb b/recipes/vsftpd/vsftpd_2.0.5.bb
index 42a8236b16..af884b421e 100644
--- a/recipes/vsftpd/vsftpd_2.0.5.bb
+++ b/recipes/vsftpd/vsftpd_2.0.5.bb
@@ -1,7 +1,7 @@
DESCRIPTION = "Secure ftp daemon"
SECTION = "console/network"
LICENSE = "GPL"
-PR = "r3"
+PR = "r4"
DEPENDS = "libcap"
@@ -14,6 +14,8 @@ SRC_URI = "ftp://vsftpd.beasts.org/users/cevans/vsftpd-${PV}.tar.gz \
inherit update-rc.d
+CONFFILES_${PN} = "${sysconfdir}/vsftpd.conf"
+
do_configure() {
# Fix hardcoded /usr, /etc, /var mess.
cat tunables.c|sed s:\"/usr:\"${prefix}:g|sed s:\"/var:\"${localstatedir}:g \
diff --git a/recipes/watchdog/watchdog_5.2.6.bb b/recipes/watchdog/watchdog_5.2.6.bb
deleted file mode 100644
index d11751077f..0000000000
--- a/recipes/watchdog/watchdog_5.2.6.bb
+++ /dev/null
@@ -1,13 +0,0 @@
-#CONFFILES = "${sysconfdir}/watchdog.conf"
-DESCRIPTION = "Software watchdog"
-LICENSE = "GPL"
-PR = "r4"
-
-SRC_URI = "http://www.ibiblio.org/pub/Linux/system/daemons/watchdog/${P}.tar.gz"
-
-inherit autotools
-
-FILES = "${sysconfdir}/watchdog.conf ${sbindir}/watchdog"
-
-SRC_URI[md5sum] = "5a1a4476087973852e30f8cdb5b0ff92"
-SRC_URI[sha256sum] = "c762525fdbf5f5dd32c6c950f2a63d8c1b15ec3dc7afca5d2dc3dbd1b129a00d"
diff --git a/recipes/wordwarvi/wordwarvi_0.26.bb b/recipes/wordwarvi/wordwarvi_0.26.bb
index 772fa488ff..6b1de0010c 100644
--- a/recipes/wordwarvi/wordwarvi_0.26.bb
+++ b/recipes/wordwarvi/wordwarvi_0.26.bb
@@ -1,9 +1,9 @@
-DESCRIPTION = "World war VI is a retro styled side scrolling shoot'em up arcade game"
+DESCRIPTION = "Word war vi is a retro styled side scrolling shoot'em up arcade game"
HOMEPAGE = "http://wordwarvi.sourceforge.net/"
LICENSE = "GPLv2"
SECTION = "x/games"
PRIORITY = "optional"
-PR = "r0"
+PR = "r1"
DEPENDS = "portaudio-v19 libvorbis gtk+ glib-2.0"
diff --git a/recipes/x-load/x-load_git.bb b/recipes/x-load/x-load_git.bb
index 17a33b86b9..85ee9697ac 100644
--- a/recipes/x-load/x-load_git.bb
+++ b/recipes/x-load/x-load_git.bb
@@ -5,10 +5,10 @@ DEFAULT_PREFERENCE_omap3-pandora = "-1"
FILESPATHPKG_prepend = "x-load-git:x-load-git/${MACHINE}"
PV = "1.5.0+${PR}+gitr${SRCREV}"
-PR ="r22"
+PR ="r23"
PE = "1"
-SRCREV = "b6bbfe7848de547b64edf1c363c86cec4921b517"
+SRCREV = "04b1732220078d47c18a84cbafc52e45db71f13d"
SRC_URI = "git://gitorious.org/x-loader/x-loader.git;branch=master;protocol=git \
"
diff --git a/recipes/xerces-c/xerces-c_3.1.1.bb b/recipes/xerces-c/xerces-c_3.1.1.bb
new file mode 100644
index 0000000000..46ec6d28ab
--- /dev/null
+++ b/recipes/xerces-c/xerces-c_3.1.1.bb
@@ -0,0 +1,32 @@
+DESCRIPTION = "Xerces-c is a validating xml parser written in C++"
+HOMEPAGE = "http://xerces.apache.org/xerces-c/"
+SECTION = "libs"
+PRIORITY = "optional"
+LICENSE = "Apache-2.0"
+
+SRC_URI = "http://apache.lauf-forum.at/xerces/c/3/sources/${BP}.tar.gz"
+
+inherit autotools pkgconfig
+
+PACKAGES = "libxerces-c \
+ libxerces-c-dbg \
+ libxerces-c-dev \
+ xerces-c-samples \
+ xerces-c-samples-dbg \
+"
+
+FILES_libxerces-c = "${libdir}/libxerces-c-3.1.so"
+FILES_libxerces-c-dbg = "${libdir}/.debug/"
+FILES_libxerces-c-dev = "${libdir}/lib*.la \
+ ${libdir}/lib*.a \
+ ${libdir}/libxerces-c.so \
+ ${libdir}/pkgconfig/xerces-c.pc \
+ ${includedir}/xercesc \
+"
+FILES_xerces-c-samples = "${bindir}/*"
+FILES_xerces-c-samples-dbg = "${bindir}/.debug/"
+
+SRC_URI[md5sum] = "6a8ec45d83c8cfb1584c5a5345cb51ae"
+SRC_URI[sha256sum] = "a42785f71e0b91d5fd273831c87410ce60a73ccfdd207de1b805d26d44968736"
+
+BBCLASSEXTEND += "native"
diff --git a/recipes/xinput-calibrator/pointercal-xinput/bug20/pointercal.xinput b/recipes/xinput-calibrator/pointercal-xinput/bug20/pointercal.xinput
new file mode 100644
index 0000000000..50e2632777
--- /dev/null
+++ b/recipes/xinput-calibrator/pointercal-xinput/bug20/pointercal.xinput
@@ -0,0 +1 @@
+xinput set-int-prop "TSC2004 Touchscreen" "Evdev Axis Calibration" 32 239 10 232 6;
diff --git a/recipes/xinput-calibrator/pointercal-xinput_0.0.bb b/recipes/xinput-calibrator/pointercal-xinput_0.0.bb
index 2d62f20070..957e5774ee 100644
--- a/recipes/xinput-calibrator/pointercal-xinput_0.0.bb
+++ b/recipes/xinput-calibrator/pointercal-xinput_0.0.bb
@@ -1,8 +1,11 @@
DESCRIPTION = "Touchscreen calibration data from xinput-calibrator"
-LICENSE = "MIT/X11"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
SECTION = "base"
-PR = "r2"
+PR = "r4"
+
SRC_URI = "file://pointercal.xinput"
S = "${WORKDIR}"
@@ -14,6 +17,5 @@ do_install() {
fi
}
-ALLOW_EMPTY_${PN} = "1"
PACKAGE_ARCH = "${MACHINE_ARCH}"
CONFFILES_${PN} = "${sysconfdir}/pointercal.xinput"
diff --git a/recipes/xinput-calibrator/xinput-calibrator-0.5.0/xinput-calibrator.desktop b/recipes/xinput-calibrator/xinput-calibrator-0.5.0/xinput-calibrator.desktop
deleted file mode 100644
index 813d7c1ac5..0000000000
--- a/recipes/xinput-calibrator/xinput-calibrator-0.5.0/xinput-calibrator.desktop
+++ /dev/null
@@ -1,11 +0,0 @@
-[Desktop Entry]
-Name=Calibrate Xinput Touchscreen
-Name[de]=Xinput Touchscreen Kalibrieren
-Comment=Run the calibration tool for Xinput touchscreens
-Encoding=UTF-8
-Exec=/usr/bin/xinput_calibrator
-Terminal=false
-Type=Application
-Icon=calibrate
-StartupNotify=true
-Categories=System;Settings;
diff --git a/recipes/xinput-calibrator/xinput-calibrator-0.5.0/xinput_calibrator_once.sh b/recipes/xinput-calibrator/xinput-calibrator-0.5.0/xinput_calibrator_once.sh
deleted file mode 100644
index 82fcfc6570..0000000000
--- a/recipes/xinput-calibrator/xinput-calibrator-0.5.0/xinput_calibrator_once.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-if [ -e /etc/pointercal.xinput ] ; then
- echo Using calibration data stored in /etc/pointercal.xinput
- . /etc/pointercal.xinput
-else
- CAL=`/usr/bin/xinput_calibrator | tee /etc/pointercal.xinput.log | grep xinput| sed 's/^ //g; s/$/;/g'`
- if [ ! -z "$CAL" ] ; then
- echo $CAL > /etc/pointercal.xinput
- echo Calibration data stored in /etc/pointercal.xinput
- fi
-fi
diff --git a/recipes/xinput-calibrator/xinput-calibrator-0.6.0/0001-calibratorXorgPrint.cpp-fix-miny-and-maxx-printing-o.patch b/recipes/xinput-calibrator/xinput-calibrator-0.6.0/0001-calibratorXorgPrint.cpp-fix-miny-and-maxx-printing-o.patch
deleted file mode 100644
index fa0314726b..0000000000
--- a/recipes/xinput-calibrator/xinput-calibrator-0.6.0/0001-calibratorXorgPrint.cpp-fix-miny-and-maxx-printing-o.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 383a3a8523814d1b108d2dc1ed812f80d6c9f050 Mon Sep 17 00:00:00 2001
-From: Mario Domenech Goulart <mario@ossystems.com.br>
-Date: Thu, 11 Mar 2010 11:05:18 -0300
-Subject: [PATCH] calibratorXorgPrint.cpp: fix miny and maxx printing order for UDEV and HAL
-
-
-Signed-off-by: Mario Domenech Goulart <mario@ossystems.com.br>
----
- src/calibrator/calibratorXorgPrint.cpp | 4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/calibrator/calibratorXorgPrint.cpp b/src/calibrator/calibratorXorgPrint.cpp
-index 92d297a..1f74de0 100644
---- a/src/calibrator/calibratorXorgPrint.cpp
-+++ b/src/calibrator/calibratorXorgPrint.cpp
-@@ -69,7 +69,7 @@ bool CalibratorXorgPrint::finish_data(const XYinfo new_axys, int swap_xy)
- \tENV{x11_options.miny}=\"%d\"\n\
- \tENV{x11_options.maxx}=\"%d\"\n\
- \tENV{x11_options.maxy}=\"%d\"\n"
-- , new_axys.x_min, new_axys.x_max, new_axys.y_min, new_axys.y_max);
-+ , new_axys.x_min, new_axys.y_min, new_axys.x_max, new_axys.y_max);
- if (swap_xy != 0)
- printf("\tENV{x11_options.swapxy}=\"%d\"\n", swap_xy);
- printf("\tLABEL=\"xorg_touchscreen_end\"\n");
-@@ -81,7 +81,7 @@ bool CalibratorXorgPrint::finish_data(const XYinfo new_axys, int swap_xy)
- \t <merge key=\"input.x11_options.miny\" type=\"string\">%d</merge>\n\
- \t <merge key=\"input.x11_options.maxx\" type=\"string\">%d</merge>\n\
- \t <merge key=\"input.x11_options.maxy\" type=\"string\">%d</merge>\n"
-- , new_axys.x_min, new_axys.x_max, new_axys.y_min, new_axys.y_max);
-+ , new_axys.x_min, new_axys.y_min, new_axys.x_max, new_axys.y_max);
- if (swap_xy != 0)
- printf("\t <merge key=\"input.x11_options.swapxy\" type=\"string\">%d</merge>\n", swap_xy);
- printf("\t</match>\n");
---
-1.6.3.3.444.g4ecbc
-
diff --git a/recipes/xinput-calibrator/xinput-calibrator.inc b/recipes/xinput-calibrator/xinput-calibrator.inc
deleted file mode 100644
index 357b0e5c04..0000000000
--- a/recipes/xinput-calibrator/xinput-calibrator.inc
+++ /dev/null
@@ -1,8 +0,0 @@
-DESCRIPTION = "A generic touchscreen calibration program for X.Org"
-HOMEPAGE = "http://www.freedesktop.org/wiki/Software/xinput_calibrator"
-LICENSE = "MIT/X11"
-DEPENDS = "virtual/libx11 libxi"
-RDEPENDS_${PN} = "xinput pointercal-xinput"
-INC_PR = "r7"
-
-inherit autotools
diff --git a/recipes/xinput-calibrator/xinput-calibrator_0.5.0.bb b/recipes/xinput-calibrator/xinput-calibrator_0.5.0.bb
deleted file mode 100644
index ba04865f99..0000000000
--- a/recipes/xinput-calibrator/xinput-calibrator_0.5.0.bb
+++ /dev/null
@@ -1,19 +0,0 @@
-require xinput-calibrator.inc
-
-PR = "${INC_PR}.0"
-
-SRC_URI = "git://github.com/tias/xinput_calibrator.git;protocol=git \
- file://xinput-calibrator.desktop \
- file://xinput_calibrator_once.sh \
-"
-
-SRCREV = "1c715824334c5d33085dba02f195c9720c2883b5"
-S = "${WORKDIR}/git/"
-
-do_install() {
- install -d ${D}${bindir}
- install -m 0755 src/xinput_calibrator_x11 ${D}${bindir}/xinput_calibrator
- install -m 0755 ${WORKDIR}/xinput_calibrator_once.sh ${D}${bindir}/xinput_calibrator_once.sh
- install -d ${D}${datadir}/applications/
- install -m 0755 ${WORKDIR}/xinput-calibrator.desktop ${D}${datadir}/applications/xinput-calibrator.desktop
-}
diff --git a/recipes/xinput-calibrator/xinput-calibrator_0.6.0.bb b/recipes/xinput-calibrator/xinput-calibrator_0.6.0.bb
deleted file mode 100644
index 06f46d0bbb..0000000000
--- a/recipes/xinput-calibrator/xinput-calibrator_0.6.0.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-require xinput-calibrator.inc
-
-SRC_URI = "git://github.com/tias/xinput_calibrator.git;protocol=git \
- file://0001-calibratorXorgPrint.cpp-fix-miny-and-maxx-printing-o.patch"
-
-SRCREV = "d6e01d780001948f55006698e8e9e48c12894810"
-S = "${WORKDIR}/git/"
-
-PR = "${INC_PR}.0"
-
-do_install_append() {
- install -d ${D}${bindir}
- install -m 0755 scripts/xinput_calibrator_pointercal.sh ${D}${bindir}/xinput_calibrator_once.sh
- ln -s ${bindir}/xinput_calibrator_x11 ${D}${bindir}/xinput_calibrator
- install -d ${D}${datadir}/applications/
- install -m 0755 scripts/xinput_calibrator.desktop ${D}${datadir}/applications/xinput-calibrator.desktop
- install -m 0755 scripts/xinput_calibrator_get_hal_calibration.sh ${D}${bindir}/xinput_calibrator_get_hal_calibration.sh
-}
diff --git a/recipes/xinput-calibrator/xinput-calibrator_0.6.1.bb b/recipes/xinput-calibrator/xinput-calibrator_0.6.1.bb
deleted file mode 100644
index 7dc6f29e13..0000000000
--- a/recipes/xinput-calibrator/xinput-calibrator_0.6.1.bb
+++ /dev/null
@@ -1,16 +0,0 @@
-require xinput-calibrator.inc
-
-SRC_URI = "git://github.com/tias/xinput_calibrator.git;protocol=git"
-
-SRCREV = "d2ce98b3f638667dd64b6d718721379b2dc750a7"
-PR = "${INC_PR}.0"
-S = "${WORKDIR}/git/"
-
-do_install_append() {
- install -d ${D}${bindir}
- install -m 0755 scripts/xinput_calibrator_pointercal.sh ${D}${bindir}/xinput_calibrator_once.sh
- ln -s ${bindir}/xinput_calibrator_x11 ${D}${bindir}/xinput_calibrator
- install -d ${D}${datadir}/applications/
- install -m 0755 scripts/xinput_calibrator.desktop ${D}${datadir}/applications/xinput-calibrator.desktop
- install -m 0755 scripts/xinput_calibrator_get_hal_calibration.sh ${D}${bindir}/xinput_calibrator_get_hal_calibration.sh
-}
diff --git a/recipes/xinput-calibrator/xinput-calibrator_0.7.5.bb b/recipes/xinput-calibrator/xinput-calibrator_0.7.5.bb
new file mode 100644
index 0000000000..4024883463
--- /dev/null
+++ b/recipes/xinput-calibrator/xinput-calibrator_0.7.5.bb
@@ -0,0 +1,22 @@
+DESCRIPTION = "A generic touchscreen calibration program for X.Org"
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/xinput_calibrator"
+LICENSE = "MIT/X11"
+LIC_FILES_CHKSUM = "file://src/calibrator.cpp;endline=22;md5=998e238a7638a7446eaeb02398f691fc"
+DEPENDS = "virtual/libx11 libxi"
+
+inherit autotools
+
+RDEPENDS_${PN} = "xinput"
+RRECOMMENDS_${PN} = "pointercal-xinput"
+
+SRC_URI = "http://github.com/downloads/tias/xinput_calibrator/xinput_calibrator-${PV}.tar.gz"
+SRC_URI[md5sum] = "20da0a2055a5a75962add8c6b44f60fa"
+SRC_URI[sha256sum] = "baa4ddca49ec94c27ba4c715bfa26692fec1132103e927213c3169e475d3d971"
+
+S = "${WORKDIR}/xinput_calibrator-${PV}"
+
+do_install_append() {
+ install -d ${D}${bindir}
+ install -m 0755 scripts/xinput_calibrator_pointercal.sh ${D}${bindir}/xinput_calibrator_once.sh
+ install -m 0755 scripts/xinput_calibrator_get_hal_calibration.sh ${D}${bindir}/xinput_calibrator_get_hal_calibration.sh
+}
diff --git a/recipes/xinput-calibrator/xinput-calibrator_git.bb b/recipes/xinput-calibrator/xinput-calibrator_git.bb
deleted file mode 100644
index c6188e6a7c..0000000000
--- a/recipes/xinput-calibrator/xinput-calibrator_git.bb
+++ /dev/null
@@ -1,20 +0,0 @@
-require xinput-calibrator.inc
-
-PV = "0.6.0+gitr${SRCPV}"
-PR = "${INC_PR}.0"
-
-SRC_URI = "git://github.com/tias/xinput_calibrator.git;protocol=git;branch=misclick"
-
-SRCREV = "496d4401731c6e5ed550e446cc2fc4b12d999ad8"
-S = "${WORKDIR}/git/"
-
-do_install_append() {
- install -d ${D}${bindir}
- install -m 0755 scripts/xinput_calibrator_pointercal.sh ${D}${bindir}/xinput_calibrator_once.sh
- ln -s ${bindir}/xinput_calibrator_x11 ${D}${bindir}/xinput_calibrator
- install -d ${D}${datadir}/applications/
- install -m 0755 scripts/xinput_calibrator.desktop ${D}${datadir}/applications/xinput-calibrator.desktop
-}
-
-# remove this after misclick branch is well-tested and merged to master
-DEFAULT_PREFERENCE = "-1"
diff --git a/recipes/xorg-app/xlsclients_1.1.1.bb b/recipes/xorg-app/xlsclients_1.1.1.bb
deleted file mode 100644
index a3bdb0ee3a..0000000000
--- a/recipes/xorg-app/xlsclients_1.1.1.bb
+++ /dev/null
@@ -1,7 +0,0 @@
-require xorg-app-common.inc
-DEPENDS += " xcb-util"
-PE = "1"
-PR = "${INC_PR}.0"
-
-SRC_URI[archive.md5sum] = "6d42621616da0c720f640d23873604ce"
-SRC_URI[archive.sha256sum] = "453b5e13a61d4b2a2a52ba75d529c5d761bbb65ecd65fe5b7b0121402a0be859"
diff --git a/recipes/xorg-app/xlsclients_1.1.2.bb b/recipes/xorg-app/xlsclients_1.1.2.bb
new file mode 100644
index 0000000000..31e3f2bc02
--- /dev/null
+++ b/recipes/xorg-app/xlsclients_1.1.2.bb
@@ -0,0 +1,7 @@
+require xorg-app-common.inc
+DEPENDS += " xcb-util"
+PE = "1"
+PR = "${INC_PR}.0"
+
+SRC_URI[archive.md5sum] = "760099f0af112401735801e3b9aa8595"
+SRC_URI[archive.sha256sum] = "1ce5f3987b63ea79b3f8421fcb1dd9c739e99efa97f280eafd8e93574b9027d1"
diff --git a/recipes/xorg-driver/xf86-video-intel_2.14.902.bb b/recipes/xorg-driver/xf86-video-intel_2.15.0.bb
index 20f47d01a9..445fc27b51 100644
--- a/recipes/xorg-driver/xf86-video-intel_2.14.902.bb
+++ b/recipes/xorg-driver/xf86-video-intel_2.15.0.bb
@@ -7,5 +7,5 @@ RDEPENDS_${PN} += "xserver-xorg-extension-dri \
PE = "1"
PR = "${INC_PR}.0"
-SRC_URI[archive.md5sum] = "7c48151a87311beea39837812e7b9e2b"
-SRC_URI[archive.sha256sum] = "da9ab33ad03c2a51d1c78d648d481f251b5fd3c13f0644a58a7f097b08d6a27f"
+SRC_URI[archive.md5sum] = "ba56ae395a9769ada1fef2014468bee9"
+SRC_URI[archive.sha256sum] = "c377e1e9ab8b846d7e039acc9105479d5dce6a03f1ddccccf01c8474259c1720"
diff --git a/recipes/xorg-driver/xf86-video-omapfb_git.bb b/recipes/xorg-driver/xf86-video-omapfb_git.bb
index fce8ff83a4..bd81264871 100644
--- a/recipes/xorg-driver/xf86-video-omapfb_git.bb
+++ b/recipes/xorg-driver/xf86-video-omapfb_git.bb
@@ -2,7 +2,7 @@ require xorg-driver-video.inc
DESCRIPTION = "X.Org X server -- OMAP display driver"
PE = "1"
PV = "0.1.1+${PR}+gitr${SRCREV}"
-PR = "${INC_PR}.2"
+PR = "${INC_PR}.3"
SRC_URI = "git://git.pingu.fi/xf86-video-omapfb.git;protocol=http \
file://0001-blacklist-tv-out.patch \
@@ -10,7 +10,7 @@ SRC_URI = "git://git.pingu.fi/xf86-video-omapfb.git;protocol=http \
file://0003-force-plain-mode.patch \
"
-SRCREV = "044617665d6737f4909aab96f91b06261dff05d2"
+SRCREV = "28c006c94e57ea71df11ec4fff79d7ffcfc4860f"
S = "${WORKDIR}/git"
EXTRA_OECONF_armv7a = " --enable-neon "
diff --git a/recipes/xorg-driver/xorg-driver-common.inc b/recipes/xorg-driver/xorg-driver-common.inc
index 53b499ee9a..f7878a9ad3 100644
--- a/recipes/xorg-driver/xorg-driver-common.inc
+++ b/recipes/xorg-driver/xorg-driver-common.inc
@@ -2,7 +2,7 @@ DESCRIPTION = "X driver"
HOMEPAGE = "http://www.x.org"
SECTION = "x11/drivers"
LICENSE = "MIT-X"
-INC_PR = "r15"
+INC_PR = "r16"
DEPENDS = "randrproto xorg-server xproto"
diff --git a/recipes/xorg-lib/libxaw_1.0.9.bb b/recipes/xorg-lib/libxaw_1.0.9.bb
index a4d2cf4916..1d472c3566 100644
--- a/recipes/xorg-lib/libxaw_1.0.9.bb
+++ b/recipes/xorg-lib/libxaw_1.0.9.bb
@@ -2,7 +2,7 @@ require xorg-lib-common.inc
DESCRIPTION = "X Athena Widget Set"
DEPENDS += "xproto virtual/libx11 libxext xextproto libxt libxmu libxpm libxp printproto libxau"
PE = "1"
-PR = "${INC_PR}.0"
+PR = "${INC_PR}.1"
SRC_URI[archive.md5sum] = "ccc57478c41b7a75b9702241b889b1d4"
SRC_URI[archive.sha256sum] = "a83977546b78e24ac5dca86affc10b6404a87c16272405b05386feca1a2db037"
@@ -22,4 +22,7 @@ FILES_libxaw6 = "${libdir}/libXaw*.so.6*"
FILES_libxaw7 = "${libdir}/libXaw*.so.7*"
FILES_libxaw8 = "${libdir}/libXaw8.so.8*"
+# fix -dev depchains
+ALLOW_EMPTY_${PN} = 1
+
XORG_PN = "libXaw"
diff --git a/recipes/xorg-lib/libxext-1.2.0/xgeExtRegister.hidden.patch b/recipes/xorg-lib/libxext-1.2.0/xgeExtRegister.hidden.patch
deleted file mode 100644
index 52f3fb452d..0000000000
--- a/recipes/xorg-lib/libxext-1.2.0/xgeExtRegister.hidden.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From patchwork Sun Sep 5 07:25:12 2010
-Content-Type: text/plain; charset="utf-8"
-MIME-Version: 1.0
-Content-Transfer-Encoding: 8bit
-Subject: [libXext] sync declarations/definitions of xgeExtRegister()
-Date: Sun, 05 Sep 2010 15:25:12 -0000
-From: =?utf-8?q?R=C3=A9mi_Cardona_=3Cremi=40gentoo=2Eorg=3E?=
-X-Patchwork-Id: 1786
-Message-Id: <1283671512-6655-1-git-send-email-remi@gentoo.org>
-To: xorg-devel@lists.x.org
-
-src/extutil.c has _X_HIDDEN while src/Xge.c didn't. This apparently went
-unnoticed by most compilers for a while, but not on Gentoo-prefix/amd64
-where this issue breaks the build.
-
-Fixes https://bugs.freedesktop.org/show_bug.cgi?id=29958
-
-Signed-off-by: Ivan Jager <aij+freedesktop.org@mrph.org>
-Reviewed-by: Rémi Cardona <remi@gentoo.org>
-Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
-
----
-Could I get an extra pair of eyes to ACK this before committing?
-
-Thanks,
-
-Rémi
-
- src/Xge.c | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/src/Xge.c b/src/Xge.c
-index 0655e00..2e25894 100644
---- a/src/Xge.c
-+++ b/src/Xge.c
-@@ -291,7 +291,7 @@ _xgeEventToWire(Display* dpy, XEvent* re, xEvent* event)
- /*
- * Extensions need to register callbacks for their events.
- */
--Bool
-+_X_HIDDEN Bool
- xgeExtRegister(Display* dpy, int offset, XExtensionHooks* callbacks)
- {
- XGEExtNode* newExt;
diff --git a/recipes/xorg-lib/libxext_1.2.0.bb b/recipes/xorg-lib/libxext_1.2.0.bb
deleted file mode 100644
index da1677e723..0000000000
--- a/recipes/xorg-lib/libxext_1.2.0.bb
+++ /dev/null
@@ -1,14 +0,0 @@
-require xorg-lib-common.inc
-DESCRIPTION = "X11 miscellaneous extension library"
-DEPENDS += "xproto virtual/libx11 xextproto libxau"
-PE = "1"
-PR = "${INC_PR}.1"
-
-SRC_URI += "file://xgeExtRegister.hidden.patch"
-
-SRC_URI[archive.md5sum] = "9bb236ff0193e9fc1c1fb504dd840331"
-SRC_URI[archive.sha256sum] = "4aed3e211e41c47908c293515580e731c26048f61a1212bf0888d1f456de6ff7"
-
-BBCLASSEXTEND = "native nativesdk"
-
-XORG_PN = "libXext"
diff --git a/recipes/xorg-lib/libxext_1.3.0.bb b/recipes/xorg-lib/libxext_1.3.0.bb
new file mode 100644
index 0000000000..092426978f
--- /dev/null
+++ b/recipes/xorg-lib/libxext_1.3.0.bb
@@ -0,0 +1,12 @@
+require xorg-lib-common.inc
+DESCRIPTION = "X11 miscellaneous extension library"
+DEPENDS += "xproto virtual/libx11 xextproto libxau"
+PE = "1"
+PR = "${INC_PR}.0"
+
+SRC_URI[archive.md5sum] = "161d200b690ace818db1cc7537e70ba9"
+SRC_URI[archive.sha256sum] = "e9daeb400855b9836e328500cec356b2769033174fc1b2be0df4a80f031debc0"
+
+BBCLASSEXTEND = "native nativesdk"
+
+XORG_PN = "libXext"
diff --git a/recipes/xorg-proto/dri2proto-2.4/f3c211e1ae183dab5c7529814c9f42af2c29fc6c.patch b/recipes/xorg-proto/dri2proto-2.4/f3c211e1ae183dab5c7529814c9f42af2c29fc6c.patch
new file mode 100644
index 0000000000..8ccae8929c
--- /dev/null
+++ b/recipes/xorg-proto/dri2proto-2.4/f3c211e1ae183dab5c7529814c9f42af2c29fc6c.patch
@@ -0,0 +1,32 @@
+From f3c211e1ae183dab5c7529814c9f42af2c29fc6c Mon Sep 17 00:00:00 2001
+From: Jesse Barnes <jbarnes@virtuousgeek.org>
+Date: Thu, 05 May 2011 16:22:39 +0000
+Subject: Revert "dri2proto: make DRI2 swap event match GLX spec"
+
+This reverts commit 0ca3778de195a82087d0f07415a1cf8fc94f5b0a.
+
+This broke compatibility by renaming existing struct fields. So revert
+in favor of a new struct.
+---
+diff --git a/dri2proto.h b/dri2proto.h
+index ff76355..9708a4a 100644
+--- a/dri2proto.h
++++ b/dri2proto.h
+@@ -290,13 +290,13 @@ typedef struct {
+ CARD8 pad;
+ CARD16 sequenceNumber B16;
+ CARD16 event_type B16;
+- CARD16 pad2;
+ CARD32 drawable B32;
+ CARD32 ust_hi B32;
+ CARD32 ust_lo B32;
+ CARD32 msc_hi B32;
+ CARD32 msc_lo B32;
+- CARD32 sbc B32;
++ CARD32 sbc_hi B32;
++ CARD32 sbc_lo B32;
+ } xDRI2BufferSwapComplete;
+ #define sz_xDRI2BufferSwapComplete 32
+
+--
+cgit v0.8.3-6-g21f6
diff --git a/recipes/xorg-proto/dri2proto_2.3.bb b/recipes/xorg-proto/dri2proto_2.3.bb
deleted file mode 100644
index 8dba4aa78a..0000000000
--- a/recipes/xorg-proto/dri2proto_2.3.bb
+++ /dev/null
@@ -1,6 +0,0 @@
-require xorg-proto-common.inc
-DESCRIPTION = "DRI2 extension headers"
-PR = "${INC_PR}.0"
-
-SRC_URI[archive.md5sum] = "3407b494d5e90d584c9af52aa8f9f028"
-SRC_URI[archive.sha256sum] = "b2141892a0db35feffa5e952ff5e1d2727c4436b07d7e2e9dd2ed89c8bb3e677"
diff --git a/recipes/xorg-proto/dri2proto_2.4.bb b/recipes/xorg-proto/dri2proto_2.4.bb
new file mode 100644
index 0000000000..a7a11420f9
--- /dev/null
+++ b/recipes/xorg-proto/dri2proto_2.4.bb
@@ -0,0 +1,8 @@
+require xorg-proto-common.inc
+DESCRIPTION = "DRI2 extension headers"
+PR = "${INC_PR}.1"
+
+SRC_URI += "file://f3c211e1ae183dab5c7529814c9f42af2c29fc6c.patch"
+
+SRC_URI[archive.md5sum] = "0cdeb1e95901813385dc9576be272bd3"
+SRC_URI[archive.sha256sum] = "ff156f178d48ab31beeb4be5eb39d5df7540791ba489a8d94c443bb99a2376f1"
diff --git a/recipes/xorg-proto/glproto-1.4.13/7196c9441af941be74180f8e8d4e10a08659b80f.patch b/recipes/xorg-proto/glproto-1.4.13/7196c9441af941be74180f8e8d4e10a08659b80f.patch
new file mode 100644
index 0000000000..988e8e809e
--- /dev/null
+++ b/recipes/xorg-proto/glproto-1.4.13/7196c9441af941be74180f8e8d4e10a08659b80f.patch
@@ -0,0 +1,32 @@
+From 7196c9441af941be74180f8e8d4e10a08659b80f Mon Sep 17 00:00:00 2001
+From: Jesse Barnes <jbarnes@virtuousgeek.org>
+Date: Thu, 05 May 2011 16:21:19 +0000
+Subject: Revert "glxproto: make GLX swap event struct match spec"
+
+This reverts commit f5403828c68af0f12c79c0504df0a4781ca84b2b.
+
+This broke compatibility with existing code, so revert in favor of a new
+struct definition instead.
+---
+diff --git a/glxproto.h b/glxproto.h
+index dfa0647..0ff44e3 100644
+--- a/glxproto.h
++++ b/glxproto.h
+@@ -1375,13 +1375,13 @@ typedef struct {
+ BYTE pad;
+ CARD16 sequenceNumber B16;
+ CARD16 event_type B16;
+- CARD16 pad2;
+ CARD32 drawable;
+ CARD32 ust_hi B32;
+ CARD32 ust_lo B32;
+ CARD32 msc_hi B32;
+ CARD32 msc_lo B32;
+- CARD32 sbc B32;
++ CARD32 sbc_hi B32;
++ CARD32 sbc_lo B32;
+ } xGLXBufferSwapComplete;
+
+ /************************************************************************/
+--
+cgit v0.8.3-6-g21f6
diff --git a/recipes/xorg-proto/glproto_1.4.12.bb b/recipes/xorg-proto/glproto_1.4.12.bb
deleted file mode 100644
index 40b0f38dc8..0000000000
--- a/recipes/xorg-proto/glproto_1.4.12.bb
+++ /dev/null
@@ -1,6 +0,0 @@
-require xorg-proto-common.inc
-PE = "1"
-PR = "${INC_PR}.0"
-
-SRC_URI[archive.md5sum] = "55edc5ff2efb734215c868f72f7cf27e"
-SRC_URI[archive.sha256sum] = "48be7a9d190b600210e5ad08b4e8862a6b08e72dc52dbdf324716a888eb457de"
diff --git a/recipes/xorg-proto/glproto_1.4.13.bb b/recipes/xorg-proto/glproto_1.4.13.bb
new file mode 100644
index 0000000000..afb35077d4
--- /dev/null
+++ b/recipes/xorg-proto/glproto_1.4.13.bb
@@ -0,0 +1,8 @@
+require xorg-proto-common.inc
+PE = "1"
+PR = "${INC_PR}.1"
+
+SRC_URI += "file://7196c9441af941be74180f8e8d4e10a08659b80f.patch"
+
+SRC_URI[archive.md5sum] = "9542f2d36751a8ad7eae9d8e176f70d4"
+SRC_URI[archive.sha256sum] = "fc0a94d4df003cb6b6953173e6498d9c4c3268ee24bcc46a1172a1e1dbd3d742"
diff --git a/recipes/xorg-xserver/xserver-xorg-1.10.2/50b9d3142ff90af2f7fa35b7b1bf9e5a07723dbd.patch b/recipes/xorg-xserver/xserver-xorg-1.10.2/50b9d3142ff90af2f7fa35b7b1bf9e5a07723dbd.patch
new file mode 100644
index 0000000000..2c4078a001
--- /dev/null
+++ b/recipes/xorg-xserver/xserver-xorg-1.10.2/50b9d3142ff90af2f7fa35b7b1bf9e5a07723dbd.patch
@@ -0,0 +1,61 @@
+From 50b9d3142ff90af2f7fa35b7b1bf9e5a07723dbd Mon Sep 17 00:00:00 2001
+From: Aaron Plattner <aplattner@nvidia.com>
+Date: Tue, 24 May 2011 23:02:42 +0000
+Subject: randr: check rotated virtual size limits correctly
+
+Commit d1107918d4626268803b54033a07405122278e7f introduced checks to
+the RandR path that cause RRSetScreenConfig requests to fail if the
+size is too large. Unfortunately, when RandR 1.1 rotation is enabled
+it compares the rotated screen dimensions to the unrotated limits,
+which causes 90- and 270-degree rotation to fail unless your screen
+happens to be square:
+
+ X Error of failed request: BadValue (integer parameter out of range for operation)
+ Major opcode of failed request: 153 (RANDR)
+ Minor opcode of failed request: 2 (RRSetScreenConfig)
+ Value in failed request: 0x780
+ Serial number of failed request: 14
+ Current serial number in output stream: 14
+
+Fix this by moving the check above the code that swaps the dimensions
+based on the rotation.
+
+Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
+Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
+Tested-by: Robert Hooker <robert.hooker@canonical.com>
+Tested-by: Kent Baxley <kent.baxley@canonical.com>
+Signed-off-by: Keith Packard <keithp@keithp.com>
+(cherry picked from commit b6c7b9b2f39e970cedb6bc1e073f901e28cb0fa3)
+---
+diff --git a/randr/rrscreen.c b/randr/rrscreen.c
+index 1bc1a9e..da6d48d 100644
+--- a/randr/rrscreen.c
++++ b/randr/rrscreen.c
+@@ -910,12 +910,6 @@ ProcRRSetScreenConfig (ClientPtr client)
+ */
+ width = mode->mode.width;
+ height = mode->mode.height;
+- if (rotation & (RR_Rotate_90|RR_Rotate_270))
+- {
+- width = mode->mode.height;
+- height = mode->mode.width;
+- }
+-
+ if (width < pScrPriv->minWidth || pScrPriv->maxWidth < width) {
+ client->errorValue = width;
+ free(pData);
+@@ -927,6 +921,12 @@ ProcRRSetScreenConfig (ClientPtr client)
+ return BadValue;
+ }
+
++ if (rotation & (RR_Rotate_90|RR_Rotate_270))
++ {
++ width = mode->mode.height;
++ height = mode->mode.width;
++ }
++
+ if (width != pScreen->width || height != pScreen->height)
+ {
+ int c;
+--
+cgit v0.8.3-6-g21f6
diff --git a/recipes/xorg-xserver/xserver-xorg-1.10.0.902/hack-assume-pixman-supports-overlapped-blt.patch b/recipes/xorg-xserver/xserver-xorg-1.10.2/hack-assume-pixman-supports-overlapped-blt.patch
index a947582f15..a947582f15 100644
--- a/recipes/xorg-xserver/xserver-xorg-1.10.0.902/hack-assume-pixman-supports-overlapped-blt.patch
+++ b/recipes/xorg-xserver/xserver-xorg-1.10.2/hack-assume-pixman-supports-overlapped-blt.patch
diff --git a/recipes/xorg-xserver/xserver-xorg-1.10.0.902/hack-fbdev-ignore-return-mode.patch b/recipes/xorg-xserver/xserver-xorg-1.10.2/hack-fbdev-ignore-return-mode.patch
index d3661cbea2..d3661cbea2 100644
--- a/recipes/xorg-xserver/xserver-xorg-1.10.0.902/hack-fbdev-ignore-return-mode.patch
+++ b/recipes/xorg-xserver/xserver-xorg-1.10.2/hack-fbdev-ignore-return-mode.patch
diff --git a/recipes/xorg-xserver/xserver-xorg-1.10.2/randr-support.patch b/recipes/xorg-xserver/xserver-xorg-1.10.2/randr-support.patch
new file mode 100644
index 0000000000..632a64ce52
--- /dev/null
+++ b/recipes/xorg-xserver/xserver-xorg-1.10.2/randr-support.patch
@@ -0,0 +1,102 @@
+diff -ur xorg-server-1.10.1.901//hw/xfree86/common/xf86Xinput.c git/xorg-server-1.10.1.901//hw/xfree86/common/xf86Xinput.c
+--- xorg-server-1.10.1.901//hw/xfree86/common/xf86Xinput.c 2011-04-28 09:25:00.000000000 +0200
++++ git/xorg-server-1.10.1.901//hw/xfree86/common/xf86Xinput.c 2011-05-19 00:31:01.178439874 +0200
+@@ -99,6 +99,8 @@
+ return; \
+ }
+
++#define RR_Rotate_All (RR_Rotate_0|RR_Rotate_90|RR_Rotate_180|RR_Rotate_270)
++
+ EventListPtr xf86Events = NULL;
+
+ static int
+@@ -1408,4 +1410,73 @@
+ EnableDevice(dev, TRUE);
+ }
+
++/* Taken from evdev-properties.h. */
++#define EVDEV_PROP_SWAP_AXES "Evdev Axes Swap"
++#define EVDEV_PROP_INVERT_AXES "Evdev Axis Inversion"
++
++/* This is a hack until we get device -> CRTC association. */
++void
++xf86InputRotationNotify(Rotation rotation)
++{
++ DeviceIntPtr dev;
++ //LocalDevicePtr local;
++ int ret;
++ int swap_axes = 0;
++ CARD8 invert[2] = { 0, 0 };
++ static Atom prop_swap = 0, prop_invert = 0;
++ static int atom_generation = -1;
++
++ if (atom_generation != serverGeneration) {
++ prop_swap = 0;
++ prop_invert = 0;
++ }
++
++ switch (rotation & RR_Rotate_All) {
++ case RR_Rotate_0:
++ swap_axes = 1;
++ invert[0] = 0;
++ invert[1] = 0;
++ break;
++ case RR_Rotate_90:
++ swap_axes = 0;
++ invert[0] = 0;
++ invert[1] = 1;
++ break;
++ case RR_Rotate_180:
++ swap_axes = 1;
++ invert[0] = 1;
++ invert[1] = 1;
++ break;
++ case RR_Rotate_270:
++ swap_axes = 0;
++ invert[0] = 1;
++ invert[1] = 0;
++ break;
++ }
++
++ if (!prop_swap)
++ prop_swap = MakeAtom(EVDEV_PROP_SWAP_AXES,
++ strlen(EVDEV_PROP_SWAP_AXES), TRUE);
++ if (!prop_invert)
++ prop_invert = MakeAtom(EVDEV_PROP_INVERT_AXES,
++ strlen(EVDEV_PROP_INVERT_AXES), TRUE);
++
++ for (dev = inputInfo.devices; dev; dev = dev->next) {
++ //local = dev->public.devicePrivate;
++ ret = XIChangeDeviceProperty(dev, prop_swap, XA_INTEGER, 8,
++ PropModeReplace, 1, &swap_axes, FALSE);
++ if (ret != Success) {
++ xf86Msg(X_ERROR, "Changing swap_xy property failed!\n");
++ continue;
++ }
++ ret = XIChangeDeviceProperty(dev, prop_invert, XA_INTEGER, 8,
++ PropModeReplace, 2, invert, FALSE);
++ if (ret != Success) {
++ xf86Msg(X_ERROR, "Changing invert property failed!\n");
++ continue;
++ }
++ }
++}
++
++
+ /* end of xf86Xinput.c */
+diff -ur xorg-server-1.10.1.901//hw/xfree86/modes/xf86Crtc.c git/xorg-server-1.10.1.901//hw/xfree86/modes/xf86Crtc.c
+--- xorg-server-1.10.1.901//hw/xfree86/modes/xf86Crtc.c 2011-04-28 09:25:00.000000000 +0200
++++ git/xorg-server-1.10.1.901//hw/xfree86/modes/xf86Crtc.c 2011-05-19 00:23:16.244383998 +0200
+@@ -389,6 +389,12 @@
+ if (didLock)
+ crtc->funcs->unlock (crtc);
+
++ /*
++ * Rotate Touchscreen
++ */
++ xf86InputRotationNotify(crtc->rotation);
++
++
+ return ret;
+ }
+
diff --git a/recipes/xorg-xserver/xserver-xorg-conf/om-gta01/xorg.conf b/recipes/xorg-xserver/xserver-xorg-conf/om-gta01/xorg.conf
index e957e41439..edb5e0ee41 100644
--- a/recipes/xorg-xserver/xserver-xorg-conf/om-gta01/xorg.conf
+++ b/recipes/xorg-xserver/xserver-xorg-conf/om-gta01/xorg.conf
@@ -32,9 +32,8 @@ EndSection
Section "InputDevice"
Identifier "Touchscreen"
- Driver "tslib"
+ Driver "evdev"
Option "Device" "/dev/input/event1"
- Option "EmulateRightButton" "1"
EndSection
Section "ServerFlags"
diff --git a/recipes/xorg-xserver/xserver-xorg-conf/om-gta02/xorg.conf b/recipes/xorg-xserver/xserver-xorg-conf/om-gta02/xorg.conf
index 8b116fc491..de6ed1c14f 100644
--- a/recipes/xorg-xserver/xserver-xorg-conf/om-gta02/xorg.conf
+++ b/recipes/xorg-xserver/xserver-xorg-conf/om-gta02/xorg.conf
@@ -38,9 +38,8 @@ EndSection
Section "InputDevice"
Identifier "Touchscreen"
- Driver "tslib"
+ Driver "evdev"
Option "Device" "/dev/input/event1"
- Option "EmulateRightButton" "1"
EndSection
Section "ServerFlags"
diff --git a/recipes/xorg-xserver/xserver-xorg-conf_0.1.bb b/recipes/xorg-xserver/xserver-xorg-conf_0.1.bb
index 5de24be107..7cc8a5df04 100644
--- a/recipes/xorg-xserver/xserver-xorg-conf_0.1.bb
+++ b/recipes/xorg-xserver/xserver-xorg-conf_0.1.bb
@@ -1,5 +1,5 @@
DESCRIPTION = "Machine specific xorg.conf files"
-PR = "r46"
+PR = "r47"
SRC_URI = "file://xorg.conf"
diff --git a/recipes/xorg-xserver/xserver-xorg_1.10.0.902.bb b/recipes/xorg-xserver/xserver-xorg_1.10.2.bb
index 9ac0c41843..95877c4b8f 100644
--- a/recipes/xorg-xserver/xserver-xorg_1.10.0.902.bb
+++ b/recipes/xorg-xserver/xserver-xorg_1.10.2.bb
@@ -9,13 +9,16 @@ PE = "2"
PR = "${INC_PR}.0"
DEFAULT_PREFERENCE = "-1"
+DEFAULT_PREFERENCE_shr = "1"
SRC_URI += " \
+ file://50b9d3142ff90af2f7fa35b7b1bf9e5a07723dbd.patch \
+ file://randr-support.patch \
file://hack-fbdev-ignore-return-mode.patch \
file://hack-assume-pixman-supports-overlapped-blt.patch \
"
-SRC_URI[archive.md5sum] = "65e5db9e614cd75e97840247c3754521"
-SRC_URI[archive.sha256sum] = "994ab87bb0cc9b56203e01e3294fddd502a96d074139496ea4ffc03c95b41b42"
+SRC_URI[archive.md5sum] = "c9ba50bd44ea70da51f13100336a5484"
+SRC_URI[archive.sha256sum] = "65264f6640568b9db8d738aec1ddd036c3ae21b7ba05b98d006759d11a72792c"
do_install_prepend() {
mkdir -p ${D}/${libdir}/X11/fonts
diff --git a/recipes/xserver-common/files/Xserver.htcdream.patch b/recipes/xserver-common/files/Xserver.htcdream.patch
new file mode 100644
index 0000000000..11842a2974
--- /dev/null
+++ b/recipes/xserver-common/files/Xserver.htcdream.patch
@@ -0,0 +1,14 @@
+Index: xserver-common-1.34/X11/xserver-common
+===================================================================
+--- xserver-common-1.34.orig/X11/xserver-common 2011-05-20 23:37:56.031433456 +0200
++++ xserver-common-1.34/X11/xserver-common 2011-05-20 23:39:56.451433492 +0200
+@@ -126,6 +126,9 @@
+ "htc_tornado")
+ ARGS="$ARGS -hide-cursor"
+ DPI="100" ;;
++ "trout")
++ DPI="181"
++ ARGS="$ARGS -dpi ${DPI}";;
+ "generic_omap1510/1610/1710")
+ ARGS="$ARGS -screen ${SCREEN_SIZE}"
+ DPI="225" ;;
diff --git a/recipes/xserver-common/files/gplv2-license.patch b/recipes/xserver-common/files/gplv2-license.patch
new file mode 100644
index 0000000000..ec93253347
--- /dev/null
+++ b/recipes/xserver-common/files/gplv2-license.patch
@@ -0,0 +1,353 @@
+COPYING: add GPLv2 license file
+
+this is a local file recipe and the license file is missing.In order
+to pass the license checksum checking, the license file is needed. So
+this patch add the GPLv2 license file.
+
+Signed-off-by: Yu Ke <ke.yu@intel.com>
+
+diff --git a/COPYING b/COPYING
+new file mode 100644
+index 0000000..d511905
+--- /dev/null
++++ b/COPYING
+@@ -0,0 +1,339 @@
++ GNU GENERAL PUBLIC LICENSE
++ Version 2, June 1991
++
++ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
++ Everyone is permitted to copy and distribute verbatim copies
++ of this license document, but changing it is not allowed.
++
++ Preamble
++
++ The licenses for most software are designed to take away your
++freedom to share and change it. By contrast, the GNU General Public
++License is intended to guarantee your freedom to share and change free
++software--to make sure the software is free for all its users. This
++General Public License applies to most of the Free Software
++Foundation's software and to any other program whose authors commit to
++using it. (Some other Free Software Foundation software is covered by
++the GNU Lesser General Public License instead.) You can apply it to
++your programs, too.
++
++ When we speak of free software, we are referring to freedom, not
++price. Our General Public Licenses are designed to make sure that you
++have the freedom to distribute copies of free software (and charge for
++this service if you wish), that you receive source code or can get it
++if you want it, that you can change the software or use pieces of it
++in new free programs; and that you know you can do these things.
++
++ To protect your rights, we need to make restrictions that forbid
++anyone to deny you these rights or to ask you to surrender the rights.
++These restrictions translate to certain responsibilities for you if you
++distribute copies of the software, or if you modify it.
++
++ For example, if you distribute copies of such a program, whether
++gratis or for a fee, you must give the recipients all the rights that
++you have. You must make sure that they, too, receive or can get the
++source code. And you must show them these terms so they know their
++rights.
++
++ We protect your rights with two steps: (1) copyright the software, and
++(2) offer you this license which gives you legal permission to copy,
++distribute and/or modify the software.
++
++ Also, for each author's protection and ours, we want to make certain
++that everyone understands that there is no warranty for this free
++software. If the software is modified by someone else and passed on, we
++want its recipients to know that what they have is not the original, so
++that any problems introduced by others will not reflect on the original
++authors' reputations.
++
++ Finally, any free program is threatened constantly by software
++patents. We wish to avoid the danger that redistributors of a free
++program will individually obtain patent licenses, in effect making the
++program proprietary. To prevent this, we have made it clear that any
++patent must be licensed for everyone's free use or not licensed at all.
++
++ The precise terms and conditions for copying, distribution and
++modification follow.
++
++ GNU GENERAL PUBLIC LICENSE
++ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
++
++ 0. This License applies to any program or other work which contains
++a notice placed by the copyright holder saying it may be distributed
++under the terms of this General Public License. The "Program", below,
++refers to any such program or work, and a "work based on the Program"
++means either the Program or any derivative work under copyright law:
++that is to say, a work containing the Program or a portion of it,
++either verbatim or with modifications and/or translated into another
++language. (Hereinafter, translation is included without limitation in
++the term "modification".) Each licensee is addressed as "you".
++
++Activities other than copying, distribution and modification are not
++covered by this License; they are outside its scope. The act of
++running the Program is not restricted, and the output from the Program
++is covered only if its contents constitute a work based on the
++Program (independent of having been made by running the Program).
++Whether that is true depends on what the Program does.
++
++ 1. You may copy and distribute verbatim copies of the Program's
++source code as you receive it, in any medium, provided that you
++conspicuously and appropriately publish on each copy an appropriate
++copyright notice and disclaimer of warranty; keep intact all the
++notices that refer to this License and to the absence of any warranty;
++and give any other recipients of the Program a copy of this License
++along with the Program.
++
++You may charge a fee for the physical act of transferring a copy, and
++you may at your option offer warranty protection in exchange for a fee.
++
++ 2. You may modify your copy or copies of the Program or any portion
++of it, thus forming a work based on the Program, and copy and
++distribute such modifications or work under the terms of Section 1
++above, provided that you also meet all of these conditions:
++
++ a) You must cause the modified files to carry prominent notices
++ stating that you changed the files and the date of any change.
++
++ b) You must cause any work that you distribute or publish, that in
++ whole or in part contains or is derived from the Program or any
++ part thereof, to be licensed as a whole at no charge to all third
++ parties under the terms of this License.
++
++ c) If the modified program normally reads commands interactively
++ when run, you must cause it, when started running for such
++ interactive use in the most ordinary way, to print or display an
++ announcement including an appropriate copyright notice and a
++ notice that there is no warranty (or else, saying that you provide
++ a warranty) and that users may redistribute the program under
++ these conditions, and telling the user how to view a copy of this
++ License. (Exception: if the Program itself is interactive but
++ does not normally print such an announcement, your work based on
++ the Program is not required to print an announcement.)
++
++These requirements apply to the modified work as a whole. If
++identifiable sections of that work are not derived from the Program,
++and can be reasonably considered independent and separate works in
++themselves, then this License, and its terms, do not apply to those
++sections when you distribute them as separate works. But when you
++distribute the same sections as part of a whole which is a work based
++on the Program, the distribution of the whole must be on the terms of
++this License, whose permissions for other licensees extend to the
++entire whole, and thus to each and every part regardless of who wrote it.
++
++Thus, it is not the intent of this section to claim rights or contest
++your rights to work written entirely by you; rather, the intent is to
++exercise the right to control the distribution of derivative or
++collective works based on the Program.
++
++In addition, mere aggregation of another work not based on the Program
++with the Program (or with a work based on the Program) on a volume of
++a storage or distribution medium does not bring the other work under
++the scope of this License.
++
++ 3. You may copy and distribute the Program (or a work based on it,
++under Section 2) in object code or executable form under the terms of
++Sections 1 and 2 above provided that you also do one of the following:
++
++ a) Accompany it with the complete corresponding machine-readable
++ source code, which must be distributed under the terms of Sections
++ 1 and 2 above on a medium customarily used for software interchange; or,
++
++ b) Accompany it with a written offer, valid for at least three
++ years, to give any third party, for a charge no more than your
++ cost of physically performing source distribution, a complete
++ machine-readable copy of the corresponding source code, to be
++ distributed under the terms of Sections 1 and 2 above on a medium
++ customarily used for software interchange; or,
++
++ c) Accompany it with the information you received as to the offer
++ to distribute corresponding source code. (This alternative is
++ allowed only for noncommercial distribution and only if you
++ received the program in object code or executable form with such
++ an offer, in accord with Subsection b above.)
++
++The source code for a work means the preferred form of the work for
++making modifications to it. For an executable work, complete source
++code means all the source code for all modules it contains, plus any
++associated interface definition files, plus the scripts used to
++control compilation and installation of the executable. However, as a
++special exception, the source code distributed need not include
++anything that is normally distributed (in either source or binary
++form) with the major components (compiler, kernel, and so on) of the
++operating system on which the executable runs, unless that component
++itself accompanies the executable.
++
++If distribution of executable or object code is made by offering
++access to copy from a designated place, then offering equivalent
++access to copy the source code from the same place counts as
++distribution of the source code, even though third parties are not
++compelled to copy the source along with the object code.
++
++ 4. You may not copy, modify, sublicense, or distribute the Program
++except as expressly provided under this License. Any attempt
++otherwise to copy, modify, sublicense or distribute the Program is
++void, and will automatically terminate your rights under this License.
++However, parties who have received copies, or rights, from you under
++this License will not have their licenses terminated so long as such
++parties remain in full compliance.
++
++ 5. You are not required to accept this License, since you have not
++signed it. However, nothing else grants you permission to modify or
++distribute the Program or its derivative works. These actions are
++prohibited by law if you do not accept this License. Therefore, by
++modifying or distributing the Program (or any work based on the
++Program), you indicate your acceptance of this License to do so, and
++all its terms and conditions for copying, distributing or modifying
++the Program or works based on it.
++
++ 6. Each time you redistribute the Program (or any work based on the
++Program), the recipient automatically receives a license from the
++original licensor to copy, distribute or modify the Program subject to
++these terms and conditions. You may not impose any further
++restrictions on the recipients' exercise of the rights granted herein.
++You are not responsible for enforcing compliance by third parties to
++this License.
++
++ 7. If, as a consequence of a court judgment or allegation of patent
++infringement or for any other reason (not limited to patent issues),
++conditions are imposed on you (whether by court order, agreement or
++otherwise) that contradict the conditions of this License, they do not
++excuse you from the conditions of this License. If you cannot
++distribute so as to satisfy simultaneously your obligations under this
++License and any other pertinent obligations, then as a consequence you
++may not distribute the Program at all. For example, if a patent
++license would not permit royalty-free redistribution of the Program by
++all those who receive copies directly or indirectly through you, then
++the only way you could satisfy both it and this License would be to
++refrain entirely from distribution of the Program.
++
++If any portion of this section is held invalid or unenforceable under
++any particular circumstance, the balance of the section is intended to
++apply and the section as a whole is intended to apply in other
++circumstances.
++
++It is not the purpose of this section to induce you to infringe any
++patents or other property right claims or to contest validity of any
++such claims; this section has the sole purpose of protecting the
++integrity of the free software distribution system, which is
++implemented by public license practices. Many people have made
++generous contributions to the wide range of software distributed
++through that system in reliance on consistent application of that
++system; it is up to the author/donor to decide if he or she is willing
++to distribute software through any other system and a licensee cannot
++impose that choice.
++
++This section is intended to make thoroughly clear what is believed to
++be a consequence of the rest of this License.
++
++ 8. If the distribution and/or use of the Program is restricted in
++certain countries either by patents or by copyrighted interfaces, the
++original copyright holder who places the Program under this License
++may add an explicit geographical distribution limitation excluding
++those countries, so that distribution is permitted only in or among
++countries not thus excluded. In such case, this License incorporates
++the limitation as if written in the body of this License.
++
++ 9. The Free Software Foundation may publish revised and/or new versions
++of the General Public License from time to time. Such new versions will
++be similar in spirit to the present version, but may differ in detail to
++address new problems or concerns.
++
++Each version is given a distinguishing version number. If the Program
++specifies a version number of this License which applies to it and "any
++later version", you have the option of following the terms and conditions
++either of that version or of any later version published by the Free
++Software Foundation. If the Program does not specify a version number of
++this License, you may choose any version ever published by the Free Software
++Foundation.
++
++ 10. If you wish to incorporate parts of the Program into other free
++programs whose distribution conditions are different, write to the author
++to ask for permission. For software which is copyrighted by the Free
++Software Foundation, write to the Free Software Foundation; we sometimes
++make exceptions for this. Our decision will be guided by the two goals
++of preserving the free status of all derivatives of our free software and
++of promoting the sharing and reuse of software generally.
++
++ NO WARRANTY
++
++ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
++FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
++OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
++PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
++OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
++MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
++TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
++PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
++REPAIR OR CORRECTION.
++
++ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
++WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
++REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
++INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
++OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
++TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
++YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
++PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
++POSSIBILITY OF SUCH DAMAGES.
++
++ END OF TERMS AND CONDITIONS
++
++ How to Apply These Terms to Your New Programs
++
++ If you develop a new program, and you want it to be of the greatest
++possible use to the public, the best way to achieve this is to make it
++free software which everyone can redistribute and change under these terms.
++
++ To do so, attach the following notices to the program. It is safest
++to attach them to the start of each source file to most effectively
++convey the exclusion of warranty; and each file should have at least
++the "copyright" line and a pointer to where the full notice is found.
++
++ <one line to give the program's name and a brief idea of what it does.>
++ Copyright (C) <year> <name of author>
++
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2 of the License, or
++ (at your option) any later version.
++
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ GNU General Public License for more details.
++
++ You should have received a copy of the GNU General Public License along
++ with this program; if not, write to the Free Software Foundation, Inc.,
++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
++
++Also add information on how to contact you by electronic and paper mail.
++
++If the program is interactive, make it output a short notice like this
++when it starts in an interactive mode:
++
++ Gnomovision version 69, Copyright (C) year name of author
++ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
++ This is free software, and you are welcome to redistribute it
++ under certain conditions; type `show c' for details.
++
++The hypothetical commands `show w' and `show c' should show the appropriate
++parts of the General Public License. Of course, the commands you use may
++be called something other than `show w' and `show c'; they could even be
++mouse-clicks or menu items--whatever suits your program.
++
++You should also get your employer (if you work as a programmer) or your
++school, if any, to sign a "copyright disclaimer" for the program, if
++necessary. Here is a sample; alter the names:
++
++ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
++ `Gnomovision' (which makes passes at compilers) written by James Hacker.
++
++ <signature of Ty Coon>, 1 April 1989
++ Ty Coon, President of Vice
++
++This General Public License does not permit incorporating your program into
++proprietary programs. If your program is a subroutine library, you may
++consider it more useful to permit linking proprietary applications with the
++library. If this is what you want to do, use the GNU Lesser General
++Public License instead of this License.
diff --git a/recipes/xserver-common/xserver-common_1.34.bb b/recipes/xserver-common/xserver-common_1.34.bb
index 0254965351..0b2da5b998 100644
--- a/recipes/xserver-common/xserver-common_1.34.bb
+++ b/recipes/xserver-common/xserver-common_1.34.bb
@@ -1,14 +1,8 @@
DESCRIPTION = "Common X11 scripts and support files"
-LICENSE = "GPL"
-SECTION = "x11"
-RDEPENDS_${PN} = "xmodmap xrandr xdpyinfo"
-PR = "r0"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
-PACKAGE_ARCH = "all"
-DEFAULT_PREFERENCE = "-1"
-
-RCONFLICTS_${PN} = "xserver-kdrive-common"
-RREPLACES_${PN} = "xserver-kdrive-common"
+PR = "r2"
# we are using a gpe-style Makefile
inherit gpe
@@ -17,23 +11,29 @@ SRC_URI[md5sum] = "82f2f84cd96610e8f7b92c700cd31c14"
SRC_URI[sha256sum] = "cd04c33418f776b1e13fcc7af3d6bd0c7cccd03fbabd7dbcd97f88166cc34210"
SRC_URI_append = " \
+ file://gplv2-license.patch \
file://setDPI.sh \
- file://89xdgautostart.sh"
+ file://89xdgautostart.sh \
+ file://89xTs_Calibrate.xinput_calibrator.patch \
+ file://90xXWindowManager.patch \
+ file://Xserver.add.xserver-system.patch \
+ file://Xserver.add.nocursor.for.gta.patch \
+ file://Xserver.add.dpi.for.gta.patch \
+ file://Xserver.n900.patch \
+ file://Xserver.htcdream.patch \
+"
-SRC_URI_append_angstrom = " file://xtscal-fix.patch "
-RDEPENDS_${PN}_append_angstrom = " tslib-calibrate "
-RDEPENDS_${PN}_append_shr = " xinput-calibrator "
-
-SRC_URI_append_shr = " file://89xTs_Calibrate.xinput_calibrator.patch \
- file://90xXWindowManager.patch \
- file://Xserver.add.nocursor.for.gta.patch \
- file://Xserver.add.xserver-system.patch \
- file://Xserver.add.dpi.for.gta.patch \
- file://Xserver.n900.patch"
do_install_append() {
- install -m 0755 "${WORKDIR}/setDPI.sh" "${D}/etc/X11/Xinit.d/50setdpi"
- install -m 0755 "${WORKDIR}/89xdgautostart.sh" "${D}/etc/X11/Xsession.d/89xdgautostart"
- sed -i 's:^BINDIR=.*$:BINDIR=${bindir}:' ${D}/etc/X11/xserver-common
+ install -m 0755 "${WORKDIR}/setDPI.sh" "${D}/etc/X11/Xinit.d/50setdpi"
+ install -m 0755 "${WORKDIR}/89xdgautostart.sh" "${D}/etc/X11/Xsession.d/89xdgautostart"
+ sed -i 's:^BINDIR=.*$:BINDIR=${bindir}:' ${D}/etc/X11/xserver-common
}
+PACKAGE_ARCH = "all"
+
+RDEPENDS_${PN} = "xmodmap xrandr xdpyinfo fbset xinput-calibrator"
+
+RCONFLICTS_${PN} = "xserver-kdrive-common x11-common"
+RREPLACES_${PN} = "xserver-kdrive-common x11-common"
+