summaryrefslogtreecommitdiffstats
path: root/freed-ora/current/master
diff options
context:
space:
mode:
authorAlexandre Oliva <lxoliva@fsfla.org>2012-05-18 01:35:41 +0000
committerAlexandre Oliva <lxoliva@fsfla.org>2012-05-18 01:35:41 +0000
commit55938e90b44e47c448cf1da7ade6b61bce726e36 (patch)
treeb2f3450cd19d16b59a84a1a31835fcc8d63fc8c1 /freed-ora/current/master
parentba697ba9ec36bc03db4002779ff539d5ec3f965e (diff)
downloadlinux-libre-raptor-55938e90b44e47c448cf1da7ade6b61bce726e36.tar.gz
linux-libre-raptor-55938e90b44e47c448cf1da7ade6b61bce726e36.zip
3.4.0-0.rc7.git2.1.fc18.gnu
Diffstat (limited to 'freed-ora/current/master')
-rw-r--r--freed-ora/current/master/ACPICA-Fix-regression-in-FADT-revision-checks.patch58
-rw-r--r--freed-ora/current/master/Makefile8
-rw-r--r--freed-ora/current/master/Makefile.config31
-rw-r--r--freed-ora/current/master/Makefile.release1
-rw-r--r--freed-ora/current/master/TODO4
-rw-r--r--freed-ora/current/master/acpi-ensure-thermal-limits-match-cpu-freq.patch146
-rw-r--r--freed-ora/current/master/arm-tegra-usb-no-reset-linux33.patch16
-rw-r--r--freed-ora/current/master/atl1c_net_next_update-3.4.patch3658
-rw-r--r--freed-ora/current/master/config-arm-generic232
-rw-r--r--freed-ora/current/master/config-arm-imx1
-rw-r--r--freed-ora/current/master/config-arm-kirkwood2
-rw-r--r--freed-ora/current/master/config-arm-omap257
-rw-r--r--freed-ora/current/master/config-arm-omap-generic1079
-rw-r--r--freed-ora/current/master/config-arm-tegra25
-rw-r--r--freed-ora/current/master/config-arm-versatile72
-rw-r--r--freed-ora/current/master/config-debug2
-rw-r--r--freed-ora/current/master/config-generic31
-rw-r--r--freed-ora/current/master/config-nodebug112
-rw-r--r--freed-ora/current/master/config-powerpc-generic3
-rw-r--r--freed-ora/current/master/config-powerpc641
-rw-r--r--freed-ora/current/master/config-x86-generic11
-rwxr-xr-xfreed-ora/current/master/deblob-3.42559
-rwxr-xr-xfreed-ora/current/master/deblob-check232
-rwxr-xr-xfreed-ora/current/master/deblob-main4
-rw-r--r--freed-ora/current/master/ext4-Support-check-none-nocheck-mount-options.patch51
-rw-r--r--freed-ora/current/master/ext4-fix-resize-when-resizing-within-single-group.patch82
-rw-r--r--freed-ora/current/master/floppy-Remove-_hlt-related-functions.patch107
-rw-r--r--freed-ora/current/master/fs-proc-devtree-remove_proc_entry.patch12
-rw-r--r--freed-ora/current/master/hfsplus-Add-an-ioctl-to-bless-files.patch98
-rw-r--r--freed-ora/current/master/hfsplus-Change-finder_info-to-u32.patch26
-rw-r--r--freed-ora/current/master/hfsplus-Fix-bless-ioctl-when-used-with-hardlinks.patch100
-rw-r--r--freed-ora/current/master/ipw2x00-add-supported-cipher-suites-to-wiphy-initialization.patch155
-rw-r--r--freed-ora/current/master/jbd2-clear-BH_Delay-and-BH_Unwritten-in-journal_unmap_buf.patch91
-rw-r--r--freed-ora/current/master/kernel.spec539
-rw-r--r--freed-ora/current/master/libata-forbid-port-runtime-pm-by-default.patch24
-rw-r--r--freed-ora/current/master/linux-2.6-32bit-mmap-exec-randomization.patch194
-rw-r--r--freed-ora/current/master/linux-2.6-acpi-debug-infinite-loop.patch4
-rw-r--r--freed-ora/current/master/linux-2.6-defaults-aspm.patch12
-rw-r--r--freed-ora/current/master/linux-2.6-i386-nx-emulation.patch22
-rw-r--r--freed-ora/current/master/linux-3.1-keys-remove-special-keyring.patch110
-rw-r--r--freed-ora/current/master/linux-3.3-newidmapper-01.patch217
-rw-r--r--freed-ora/current/master/linux-3.3-newidmapper-02.patch97
-rw-r--r--freed-ora/current/master/linux-3.3-newidmapper-03.patch40
-rw-r--r--freed-ora/current/master/linux-3.3-virtio-scsi.patch993
-rw-r--r--freed-ora/current/master/mac80211-fix-possible-tid_rx-reorder_timer-use-after-free.patch42
-rw-r--r--freed-ora/current/master/macvtap-zerocopy-validate-vector-length.patch25
-rw-r--r--freed-ora/current/master/mcelog-rcu-splat.patch15
-rw-r--r--freed-ora/current/master/mm-thp-fix-pmd_bad-triggering.patch447
-rw-r--r--freed-ora/current/master/mod-extra.list18
-rw-r--r--freed-ora/current/master/modsign-20111207.patch31
-rw-r--r--freed-ora/current/master/nx-emu-remove-cpuinitdata-for-disable_nx-on-x86_32.patch47
-rw-r--r--freed-ora/current/master/patch-3.3-gnu-3.4-rc7-gnu.xz.sign7
-rw-r--r--freed-ora/current/master/rebase-notes.txt7
-rw-r--r--freed-ora/current/master/rt2x00_fix_MCU_request_failures.patch136
-rwxr-xr-xfreed-ora/current/master/scripts/allarchconfig.sh16
-rw-r--r--freed-ora/current/master/selinux-apply-different-permission-to-ptrace-child.patch162
-rw-r--r--freed-ora/current/master/shlib_base_randomize.patch69
-rw-r--r--freed-ora/current/master/sony-laptop-Enable-keyboard-backlight-by-default.patch44
-rw-r--r--freed-ora/current/master/sources2
-rw-r--r--freed-ora/current/master/udlfb-remove-sysfs-framebuffer-device-with-USB-disconnect.patch118
-rw-r--r--freed-ora/current/master/ums_realtek-do-not-use-stack-memory-for-DMA-in-__do_.patch48
-rw-r--r--freed-ora/current/master/utrace.patch4696
-rw-r--r--freed-ora/current/master/vgaarb-vga_default_device.patch552
63 files changed, 8761 insertions, 9240 deletions
diff --git a/freed-ora/current/master/ACPICA-Fix-regression-in-FADT-revision-checks.patch b/freed-ora/current/master/ACPICA-Fix-regression-in-FADT-revision-checks.patch
deleted file mode 100644
index d6b590389..000000000
--- a/freed-ora/current/master/ACPICA-Fix-regression-in-FADT-revision-checks.patch
+++ /dev/null
@@ -1,58 +0,0 @@
- commit 64b3db22c04586997ab4be46dd5a5b99f8a2d390 (2.6.39),
-"Remove use of unreliable FADT revision field" causes regression
-for old P4 systems because now cst_control and other fields are
-not reset to 0.
-
- The effect is that acpi_processor_power_init will notice
-cst_control != 0 and a write to CST_CNT register is performed
-that should not happen. As result, the system oopses after the
-"No _CST, giving up" message, sometimes in acpi_ns_internalize_name,
-sometimes in acpi_ns_get_type, usually at random places. May be
-during migration to CPU 1 in acpi_processor_get_throttling.
-
- Every one of these settings help to avoid this problem:
- - acpi=off
- - processor.nocst=1
- - maxcpus=1
-
- The fix is to update acpi_gbl_FADT.header.length after
-the original value is used to check for old revisions.
-
-Signed-off-by: Julian Anastasov <ja@ssi.bg>
----
- drivers/acpi/acpica/tbfadt.c | 8 ++++----
- 1 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/acpi/acpica/tbfadt.c b/drivers/acpi/acpica/tbfadt.c
-index c5d8704..4c9c760 100644
---- a/drivers/acpi/acpica/tbfadt.c
-+++ b/drivers/acpi/acpica/tbfadt.c
-@@ -363,10 +363,6 @@ static void acpi_tb_convert_fadt(void)
- u32 address32;
- u32 i;
-
-- /* Update the local FADT table header length */
--
-- acpi_gbl_FADT.header.length = sizeof(struct acpi_table_fadt);
--
- /*
- * Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary.
- * Later code will always use the X 64-bit field. Also, check for an
-@@ -408,6 +404,10 @@ static void acpi_tb_convert_fadt(void)
- acpi_gbl_FADT.boot_flags = 0;
- }
-
-+ /* Update the local FADT table header length */
-+
-+ acpi_gbl_FADT.header.length = sizeof(struct acpi_table_fadt);
-+
- /*
- * Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X"
- * generic address structures as necessary. Later code will always use
---
-1.7.3.4
-
---
-To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
-the body of a message to majordomo@vger.kernel.org
-More majordomo info at http://vger.kernel.org/majordomo-info.html \ No newline at end of file
diff --git a/freed-ora/current/master/Makefile b/freed-ora/current/master/Makefile
index b9475a43f..2a87029f7 100644
--- a/freed-ora/current/master/Makefile
+++ b/freed-ora/current/master/Makefile
@@ -1,11 +1,6 @@
# Makefile for source rpm: kernel
SPECFILE := kernel.spec
-# use noarch for make prep instead of the current CPU
-# noarch creates and checks all config files not just the current one,
-# in addition "i386" isn't a valid kernel target
-PREPARCH = noarch
-
# we only check the .sign signatures
UPSTREAM_CHECKS = sign
@@ -18,7 +13,7 @@ help:
include Makefile.config
prep:
- fedpkg -v prep --arch=$(PREPARCH)
+ fedpkg -v prep
noarch:
fedpkg -v local --arch=noarch
@@ -76,6 +71,7 @@ debug:
@perl -pi -e 's/# CONFIG_EXT4_DEBUG is not set/CONFIG_EXT4_DEBUG=y/' config-nodebug
@perl -pi -e 's/# CONFIG_DEBUG_PERF_USE_VMALLOC is not set/CONFIG_DEBUG_PERF_USE_VMALLOC=y/' config-nodebug
@perl -pi -e 's/# CONFIG_JBD2_DEBUG is not set/CONFIG_JBD2_DEBUG=y/' config-nodebug
+ @perl -pi -e 's/# CONFIG_NFSD_FAULT_INJECTION is not set/CONFIG_NFSD_FAULT_INJECTION=y/' config-nodebug
@perl -pi -e 's/# CONFIG_DEBUG_BLK_CGROUP is not set/CONFIG_DEBUG_BLK_CGROUP=y/' config-nodebug
@perl -pi -e 's/# CONFIG_DRBD_FAULT_INJECTION is not set/CONFIG_DRBD_FAULT_INJECTION=y/' config-nodebug
@perl -pi -e 's/# CONFIG_ATH_DEBUG is not set/CONFIG_ATH_DEBUG=y/' config-nodebug
diff --git a/freed-ora/current/master/Makefile.config b/freed-ora/current/master/Makefile.config
index 9f00c576b..e6b4a5bc5 100644
--- a/freed-ora/current/master/Makefile.config
+++ b/freed-ora/current/master/Makefile.config
@@ -9,12 +9,12 @@ CONFIGFILES = \
$(CFG)-i686-PAE.config $(CFG)-i686-PAEdebug.config \
$(CFG)-x86_64.config $(CFG)-x86_64-debug.config \
$(CFG)-s390x.config \
- $(CFG)-arm.config $(CFG)-armv5tel.config $(CFG)-armv7hl.config \
- $(CFG)-armv5tel-kirkwood.config \
- $(CFG)-armv7l-imx.config $(CFG)-armv7l-omap.config \
- $(CFG)-armv7l-tegra.config $(CFG)-armv7l-highbank.config \
- $(CFG)-armv7hl-imx.config $(CFG)-armv7hl-omap.config \
- $(CFG)-armv7hl-tegra.config $(CFG)-armv7hl-highbank.config \
+ $(CFG)-arm.config $(CFG)-armv5tel-kirkwood.config \
+ $(CFG)-armv7l.config $(CFG)-armv7hl.config \
+ $(CFG)-armv7l-imx.config $(CFG)-armv7hl-imx.config \
+ $(CFG)-armv7l-omap.config $(CFG)-armv7hl-omap.config \
+ $(CFG)-armv7l-tegra.config $(CFG)-armv7hl-tegra.config \
+ $(CFG)-armv7l-highbank.config $(CFG)-armv7hl-highbank.config \
$(CFG)-ppc.config $(CFG)-ppc-smp.config \
$(CFG)-sparc64.config \
$(CFG)-ppc64.config $(CFG)-ppc64-debug.config
@@ -40,7 +40,10 @@ temp-debug-generic: config-generic
temp-arm-generic: config-arm-generic temp-generic
perl merge.pl $^ > $@
-temp-armv7l-omap-generic: config-arm-omap-generic temp-arm-generic
+temp-armv7l-versatile: config-arm-versatile temp-arm-generic
+ perl merge.pl $^ > $@
+
+temp-armv7l-omap: config-arm-omap temp-arm-generic
perl merge.pl $^ > $@
temp-armv7l-tegra: config-arm-tegra temp-arm-generic
@@ -121,13 +124,10 @@ kernel-$(VERSION)-s390x.config: config-s390x temp-s390-generic
kernel-$(VERSION)-arm.config: /dev/null temp-arm-generic
perl merge.pl $^ arm > $@
-kernel-$(VERSION)-armv5tel.config: /dev/null temp-arm-generic
- perl merge.pl $^ arm > $@
-
-kernel-$(VERSION)-armv7hl.config: /dev/null temp-arm-generic
+kernel-$(VERSION)-armv5tel-kirkwood.config: /dev/null temp-armv5tel-kirkwood
perl merge.pl $^ arm > $@
-kernel-$(VERSION)-armv5tel-kirkwood.config: /dev/null temp-armv5tel-kirkwood
+kernel-$(VERSION)-armv7l.config: /dev/null temp-armv7l-versatile
perl merge.pl $^ arm > $@
kernel-$(VERSION)-armv7l-imx.config: /dev/null temp-armv7l-imx
@@ -136,19 +136,22 @@ kernel-$(VERSION)-armv7l-imx.config: /dev/null temp-armv7l-imx
kernel-$(VERSION)-armv7l-highbank.config: /dev/null temp-armv7l-highbank
perl merge.pl $^ arm > $@
-kernel-$(VERSION)-armv7l-omap.config: /dev/null temp-armv7l-omap-generic
+kernel-$(VERSION)-armv7l-omap.config: /dev/null temp-armv7l-omap
perl merge.pl $^ arm > $@
kernel-$(VERSION)-armv7l-tegra.config: /dev/null temp-armv7l-tegra
perl merge.pl $^ arm > $@
+kernel-$(VERSION)-armv7hl.config: /dev/null temp-armv7l-versatile
+ perl merge.pl $^ arm > $@
+
kernel-$(VERSION)-armv7hl-imx.config: /dev/null temp-armv7l-imx
perl merge.pl $^ arm > $@
kernel-$(VERSION)-armv7hl-highbank.config: /dev/null temp-armv7l-highbank
perl merge.pl $^ arm > $@
-kernel-$(VERSION)-armv7hl-omap.config: /dev/null temp-armv7l-omap-generic
+kernel-$(VERSION)-armv7hl-omap.config: /dev/null temp-armv7l-omap
perl merge.pl $^ arm > $@
kernel-$(VERSION)-armv7hl-tegra.config: /dev/null temp-armv7l-tegra
diff --git a/freed-ora/current/master/Makefile.release b/freed-ora/current/master/Makefile.release
index 85fa9897b..e3ad8071a 100644
--- a/freed-ora/current/master/Makefile.release
+++ b/freed-ora/current/master/Makefile.release
@@ -51,6 +51,7 @@ config-release:
@perl -pi -e 's/CONFIG_EXT4_DEBUG=y/# CONFIG_EXT4_DEBUG is not set/' config-nodebug
@perl -pi -e 's/CONFIG_DEBUG_PERF_USE_VMALLOC=y/# CONFIG_DEBUG_PERF_USE_VMALLOC is not set/' config-nodebug
@perl -pi -e 's/CONFIG_JBD2_DEBUG=y/# CONFIG_JBD2_DEBUG is not set/' config-nodebug
+ @perl -pi -e 's/CONFIG_NFSD_FAULT_INJECTION=y/# CONFIG_NFSD_FAULT_INJECTION is not set/' config-nodebug
@perl -pi -e 's/CONFIG_DEBUG_BLK_CGROUP=y/# CONFIG_DEBUG_BLK_CGROUP is not set/' config-nodebug
@perl -pi -e 's/CONFIG_DRBD_FAULT_INJECTION=y/# CONFIG_DRBD_FAULT_INJECTION is not set/' config-nodebug
@perl -pi -e 's/CONFIG_ATH_DEBUG=y/# CONFIG_ATH_DEBUG is not set/' config-nodebug
diff --git a/freed-ora/current/master/TODO b/freed-ora/current/master/TODO
index 652000ee2..b730fd591 100644
--- a/freed-ora/current/master/TODO
+++ b/freed-ora/current/master/TODO
@@ -1,7 +1,9 @@
+* Post 3.5:
+- Check if PaulMcK has fixed CONFIG_RCU_FAST_NO_HZ
+
Config TODOs:
* review & disable a bunch of the I2C, RTC, DVB, SOUND options.
-
Spec file TODOs:
* modules-extra: Do a few more things to make it a bit more robust.
diff --git a/freed-ora/current/master/acpi-ensure-thermal-limits-match-cpu-freq.patch b/freed-ora/current/master/acpi-ensure-thermal-limits-match-cpu-freq.patch
deleted file mode 100644
index 9d97b6024..000000000
--- a/freed-ora/current/master/acpi-ensure-thermal-limits-match-cpu-freq.patch
+++ /dev/null
@@ -1,146 +0,0 @@
-From 9a056a5843ff83db987d6e18625f4a2ee64b5450 Mon Sep 17 00:00:00 2001
-From: Matthew Garrett <mjg@redhat.com>
-Date: Tue, 30 Aug 2011 10:07:24 -0400
-Subject: [PATCH] ACPI: Ensure thermal limits match CPU frequencies
-
-The ACPI thermal management code supports slowing down a CPU when it's
-overheating. Right now that's done by choosing to run it at 100%, 75%, 50%
-or 25% of full speed. However, most CPUs do not allow an arbitrary
-frequency to be set and so will run at the first frequency below that value.
-This doesn't match the intent of the specification, which is to drop the
-frequency state by state until the temperature stabalises. Fix this up
-so it uses actual frequencies rather than percentages.
-
-Reported by: Gene Snider <snider6982@comcast.net>
-Signed-off-by: Matthew Garrett <mjg@redhat.com>
----
- drivers/acpi/Kconfig | 1 +
- drivers/acpi/processor_thermal.c | 45 +++++++++++++++++++++----------------
- 2 files changed, 26 insertions(+), 20 deletions(-)
-
-diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
-index de0e3df..7d1bdb5 100644
---- a/drivers/acpi/Kconfig
-+++ b/drivers/acpi/Kconfig
-@@ -185,6 +185,7 @@ config ACPI_PROCESSOR
- tristate "Processor"
- select THERMAL
- select CPU_IDLE
-+ select CPU_FREQ_TABLE
- default y
- help
- This driver installs ACPI as the idle handler for Linux and uses
-diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c
-index 870550d..1c4eb60 100644
---- a/drivers/acpi/processor_thermal.c
-+++ b/drivers/acpi/processor_thermal.c
-@@ -52,10 +52,8 @@ ACPI_MODULE_NAME("processor_thermal");
- * _any_ cpufreq driver and not only the acpi-cpufreq driver.
- */
-
--#define CPUFREQ_THERMAL_MIN_STEP 0
--#define CPUFREQ_THERMAL_MAX_STEP 3
-
--static DEFINE_PER_CPU(unsigned int, cpufreq_thermal_reduction_pctg);
-+static DEFINE_PER_CPU(unsigned int, cpufreq_thermal_limit_state);
- static unsigned int acpi_thermal_cpufreq_is_init = 0;
-
- static int cpu_has_cpufreq(unsigned int cpu)
-@@ -70,19 +68,19 @@ static int acpi_thermal_cpufreq_notifier(struct notifier_block *nb,
- unsigned long event, void *data)
- {
- struct cpufreq_policy *policy = data;
-- unsigned long max_freq = 0;
-+ int state = per_cpu(cpufreq_thermal_limit_state, policy->cpu);
-+ struct cpufreq_frequency_table *table;
-
- if (event != CPUFREQ_ADJUST)
-- goto out;
-+ return 0;
-+
-+ table = cpufreq_frequency_get_table(policy->cpu);
-
-- max_freq = (
-- policy->cpuinfo.max_freq *
-- (100 - per_cpu(cpufreq_thermal_reduction_pctg, policy->cpu) * 20)
-- ) / 100;
-+ if (!table)
-+ return 0;
-
-- cpufreq_verify_within_limits(policy, 0, max_freq);
-+ cpufreq_verify_within_limits(policy, 0, table[state].frequency);
-
-- out:
- return 0;
- }
-
-@@ -92,10 +90,21 @@ static struct notifier_block acpi_thermal_cpufreq_notifier_block = {
-
- static int cpufreq_get_max_state(unsigned int cpu)
- {
-+ int count = 0;
-+ struct cpufreq_frequency_table *table;
-+
- if (!cpu_has_cpufreq(cpu))
- return 0;
-
-- return CPUFREQ_THERMAL_MAX_STEP;
-+ table = cpufreq_frequency_get_table(cpu);
-+
-+ if (!table)
-+ return 0;
-+
-+ while (table[count].frequency != CPUFREQ_TABLE_END)
-+ count++;
-+
-+ return count;
- }
-
- static int cpufreq_get_cur_state(unsigned int cpu)
-@@ -103,7 +112,7 @@ static int cpufreq_get_cur_state(unsigned int cpu)
- if (!cpu_has_cpufreq(cpu))
- return 0;
-
-- return per_cpu(cpufreq_thermal_reduction_pctg, cpu);
-+ return per_cpu(cpufreq_thermal_limit_state, cpu);
- }
-
- static int cpufreq_set_cur_state(unsigned int cpu, int state)
-@@ -111,7 +120,7 @@ static int cpufreq_set_cur_state(unsigned int cpu, int state)
- if (!cpu_has_cpufreq(cpu))
- return 0;
-
-- per_cpu(cpufreq_thermal_reduction_pctg, cpu) = state;
-+ per_cpu(cpufreq_thermal_limit_state, cpu) = state;
- cpufreq_update_policy(cpu);
- return 0;
- }
-@@ -122,7 +131,7 @@ void acpi_thermal_cpufreq_init(void)
-
- for (i = 0; i < nr_cpu_ids; i++)
- if (cpu_present(i))
-- per_cpu(cpufreq_thermal_reduction_pctg, i) = 0;
-+ per_cpu(cpufreq_thermal_limit_state, i) = 0;
-
- i = cpufreq_register_notifier(&acpi_thermal_cpufreq_notifier_block,
- CPUFREQ_POLICY_NOTIFIER);
-@@ -170,15 +179,11 @@ int acpi_processor_get_limit_info(struct acpi_processor *pr)
- return 0;
- }
-
--/* thermal coolign device callbacks */
-+/* thermal cooling device callbacks */
- static int acpi_processor_max_state(struct acpi_processor *pr)
- {
- int max_state = 0;
-
-- /*
-- * There exists four states according to
-- * cpufreq_thermal_reduction_ptg. 0, 1, 2, 3
-- */
- max_state += cpufreq_get_max_state(pr->id);
- if (pr->flags.throttling)
- max_state += (pr->throttling.state_count -1);
---
-1.7.6
-
diff --git a/freed-ora/current/master/arm-tegra-usb-no-reset-linux33.patch b/freed-ora/current/master/arm-tegra-usb-no-reset-linux33.patch
new file mode 100644
index 000000000..342e80f5a
--- /dev/null
+++ b/freed-ora/current/master/arm-tegra-usb-no-reset-linux33.patch
@@ -0,0 +1,16 @@
+--- linux-3.3.4-3.fc17.x86_64_orig/drivers/usb/core/hub.c 2012-05-02 20:08:18.421685932 -0400
++++ linux-3.3.4-3.fc17.x86_64/drivers/usb/core/hub.c 2012-05-02 20:30:36.565865425 -0400
+@@ -3484,6 +3484,13 @@ static void hub_events(void)
+ (u16) hub->change_bits[0],
+ (u16) hub->event_bits[0]);
+
++ /* Don't disconnect USB-SATA on TrimSlice */
++ if (strcmp(dev_name(hdev->bus->controller), "tegra-ehci.0") == 0) {
++ if ((hdev->state == 7) && (hub->change_bits[0] == 0) &&
++ (hub->event_bits[0] == 0x2))
++ hub->event_bits[0] = 0;
++ }
++
+ /* Lock the device, then check to see if we were
+ * disconnected while waiting for the lock to succeed. */
+ usb_lock_device(hdev);
diff --git a/freed-ora/current/master/atl1c_net_next_update-3.4.patch b/freed-ora/current/master/atl1c_net_next_update-3.4.patch
new file mode 100644
index 000000000..1ec9771bc
--- /dev/null
+++ b/freed-ora/current/master/atl1c_net_next_update-3.4.patch
@@ -0,0 +1,3658 @@
+diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c.h b/drivers/net/ethernet/atheros/atl1c/atl1c.h
+index ca70e16..b2bf324 100644
+--- a/drivers/net/ethernet/atheros/atl1c/atl1c.h
++++ b/drivers/net/ethernet/atheros/atl1c/atl1c.h
+@@ -74,8 +74,6 @@
+
+ #define AT_RX_BUF_SIZE (ETH_FRAME_LEN + VLAN_HLEN + ETH_FCS_LEN)
+ #define MAX_JUMBO_FRAME_SIZE (6*1024)
+-#define MAX_TSO_FRAME_SIZE (7*1024)
+-#define MAX_TX_OFFLOAD_THRESH (9*1024)
+
+ #define AT_MAX_RECEIVE_QUEUE 4
+ #define AT_DEF_RECEIVE_QUEUE 1
+@@ -100,7 +98,7 @@
+ #define ATL1C_ASPM_L0s_ENABLE 0x0001
+ #define ATL1C_ASPM_L1_ENABLE 0x0002
+
+-#define AT_REGS_LEN (75 * sizeof(u32))
++#define AT_REGS_LEN (74 * sizeof(u32))
+ #define AT_EEPROM_LEN 512
+
+ #define ATL1C_GET_DESC(R, i, type) (&(((type *)((R)->desc))[i]))
+@@ -297,20 +295,6 @@ enum atl1c_dma_req_block {
+ atl1c_dma_req_4096 = 5
+ };
+
+-enum atl1c_rss_mode {
+- atl1c_rss_mode_disable = 0,
+- atl1c_rss_sig_que = 1,
+- atl1c_rss_mul_que_sig_int = 2,
+- atl1c_rss_mul_que_mul_int = 4,
+-};
+-
+-enum atl1c_rss_type {
+- atl1c_rss_disable = 0,
+- atl1c_rss_ipv4 = 1,
+- atl1c_rss_ipv4_tcp = 2,
+- atl1c_rss_ipv6 = 4,
+- atl1c_rss_ipv6_tcp = 8
+-};
+
+ enum atl1c_nic_type {
+ athr_l1c = 0,
+@@ -388,7 +372,6 @@ struct atl1c_hw {
+ enum atl1c_dma_order dma_order;
+ enum atl1c_dma_rcb rcb_value;
+ enum atl1c_dma_req_block dmar_block;
+- enum atl1c_dma_req_block dmaw_block;
+
+ u16 device_id;
+ u16 vendor_id;
+@@ -399,8 +382,6 @@ struct atl1c_hw {
+ u16 phy_id2;
+
+ u32 intr_mask;
+- u8 dmaw_dly_cnt;
+- u8 dmar_dly_cnt;
+
+ u8 preamble_len;
+ u16 max_frame_size;
+@@ -440,10 +421,6 @@ struct atl1c_hw {
+ #define ATL1C_FPGA_VERSION 0x8000
+ u16 link_cap_flags;
+ #define ATL1C_LINK_CAP_1000M 0x0001
+- u16 cmb_tpd;
+- u16 cmb_rrd;
+- u16 cmb_rx_timer; /* 2us resolution */
+- u16 cmb_tx_timer;
+ u32 smb_timer;
+
+ u16 rrd_thresh; /* Threshold of number of RRD produced to trigger
+@@ -451,9 +428,6 @@ struct atl1c_hw {
+ u16 tpd_thresh;
+ u8 tpd_burst; /* Number of TPD to prefetch in cache-aligned burst. */
+ u8 rfd_burst;
+- enum atl1c_rss_type rss_type;
+- enum atl1c_rss_mode rss_mode;
+- u8 rss_hash_bits;
+ u32 base_cpu;
+ u32 indirect_tab;
+ u8 mac_addr[ETH_ALEN];
+@@ -462,12 +436,12 @@ struct atl1c_hw {
+ bool phy_configured;
+ bool re_autoneg;
+ bool emi_ca;
++ bool msi_lnkpatch; /* link patch for specific platforms */
+ };
+
+ /*
+ * atl1c_ring_header represents a single, contiguous block of DMA space
+- * mapped for the three descriptor rings (tpd, rfd, rrd) and the two
+- * message blocks (cmb, smb) described below
++ * mapped for the three descriptor rings (tpd, rfd, rrd) described below
+ */
+ struct atl1c_ring_header {
+ void *desc; /* virtual address */
+@@ -541,16 +515,6 @@ struct atl1c_rrd_ring {
+ u16 next_to_clean;
+ };
+
+-struct atl1c_cmb {
+- void *cmb;
+- dma_addr_t dma;
+-};
+-
+-struct atl1c_smb {
+- void *smb;
+- dma_addr_t dma;
+-};
+-
+ /* board specific private data structure */
+ struct atl1c_adapter {
+ struct net_device *netdev;
+@@ -586,11 +550,8 @@ struct atl1c_adapter {
+ /* All Descriptor memory */
+ struct atl1c_ring_header ring_header;
+ struct atl1c_tpd_ring tpd_ring[AT_MAX_TRANSMIT_QUEUE];
+- struct atl1c_rfd_ring rfd_ring[AT_MAX_RECEIVE_QUEUE];
+- struct atl1c_rrd_ring rrd_ring[AT_MAX_RECEIVE_QUEUE];
+- struct atl1c_cmb cmb;
+- struct atl1c_smb smb;
+- int num_rx_queues;
++ struct atl1c_rfd_ring rfd_ring;
++ struct atl1c_rrd_ring rrd_ring;
+ u32 bd_number; /* board number;*/
+ };
+
+@@ -618,8 +579,14 @@ struct atl1c_adapter {
+ #define AT_WRITE_REGW(a, reg, value) (\
+ writew((value), ((a)->hw_addr + reg)))
+
+-#define AT_READ_REGW(a, reg) (\
+- readw((a)->hw_addr + reg))
++#define AT_READ_REGW(a, reg, pdata) do { \
++ if (unlikely((a)->hibernate)) { \
++ readw((a)->hw_addr + reg); \
++ *(u16 *)pdata = readw((a)->hw_addr + reg); \
++ } else { \
++ *(u16 *)pdata = readw((a)->hw_addr + reg); \
++ } \
++ } while (0)
+
+ #define AT_WRITE_REG_ARRAY(a, reg, offset, value) ( \
+ writel((value), (((a)->hw_addr + reg) + ((offset) << 2))))
+diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_ethtool.c b/drivers/net/ethernet/atheros/atl1c/atl1c_ethtool.c
+index 0a9326a..859ea84 100644
+--- a/drivers/net/ethernet/atheros/atl1c/atl1c_ethtool.c
++++ b/drivers/net/ethernet/atheros/atl1c/atl1c_ethtool.c
+@@ -141,8 +141,7 @@ static void atl1c_get_regs(struct net_device *netdev,
+
+ memset(p, 0, AT_REGS_LEN);
+
+- regs->version = 0;
+- AT_READ_REG(hw, REG_VPD_CAP, p++);
++ regs->version = 1;
+ AT_READ_REG(hw, REG_PM_CTRL, p++);
+ AT_READ_REG(hw, REG_MAC_HALF_DUPLX_CTRL, p++);
+ AT_READ_REG(hw, REG_TWSI_CTRL, p++);
+@@ -154,7 +153,7 @@ static void atl1c_get_regs(struct net_device *netdev,
+ AT_READ_REG(hw, REG_LINK_CTRL, p++);
+ AT_READ_REG(hw, REG_IDLE_STATUS, p++);
+ AT_READ_REG(hw, REG_MDIO_CTRL, p++);
+- AT_READ_REG(hw, REG_SERDES_LOCK, p++);
++ AT_READ_REG(hw, REG_SERDES, p++);
+ AT_READ_REG(hw, REG_MAC_CTRL, p++);
+ AT_READ_REG(hw, REG_MAC_IPG_IFG, p++);
+ AT_READ_REG(hw, REG_MAC_STA_ADDR, p++);
+@@ -167,9 +166,9 @@ static void atl1c_get_regs(struct net_device *netdev,
+ AT_READ_REG(hw, REG_WOL_CTRL, p++);
+
+ atl1c_read_phy_reg(hw, MII_BMCR, &phy_data);
+- regs_buff[73] = (u32) phy_data;
++ regs_buff[AT_REGS_LEN/sizeof(u32) - 2] = (u32) phy_data;
+ atl1c_read_phy_reg(hw, MII_BMSR, &phy_data);
+- regs_buff[74] = (u32) phy_data;
++ regs_buff[AT_REGS_LEN/sizeof(u32) - 1] = (u32) phy_data;
+ }
+
+ static int atl1c_get_eeprom_len(struct net_device *netdev)
+diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_hw.c b/drivers/net/ethernet/atheros/atl1c/atl1c_hw.c
+index bd1667c..ff9c738 100644
+--- a/drivers/net/ethernet/atheros/atl1c/atl1c_hw.c
++++ b/drivers/net/ethernet/atheros/atl1c/atl1c_hw.c
+@@ -43,7 +43,7 @@ int atl1c_check_eeprom_exist(struct atl1c_hw *hw)
+ return 0;
+ }
+
+-void atl1c_hw_set_mac_addr(struct atl1c_hw *hw)
++void atl1c_hw_set_mac_addr(struct atl1c_hw *hw, u8 *mac_addr)
+ {
+ u32 value;
+ /*
+@@ -51,35 +51,48 @@ void atl1c_hw_set_mac_addr(struct atl1c_hw *hw)
+ * 0: 6AF600DC 1: 000B
+ * low dword
+ */
+- value = (((u32)hw->mac_addr[2]) << 24) |
+- (((u32)hw->mac_addr[3]) << 16) |
+- (((u32)hw->mac_addr[4]) << 8) |
+- (((u32)hw->mac_addr[5])) ;
++ value = mac_addr[2] << 24 |
++ mac_addr[3] << 16 |
++ mac_addr[4] << 8 |
++ mac_addr[5];
+ AT_WRITE_REG_ARRAY(hw, REG_MAC_STA_ADDR, 0, value);
+ /* hight dword */
+- value = (((u32)hw->mac_addr[0]) << 8) |
+- (((u32)hw->mac_addr[1])) ;
++ value = mac_addr[0] << 8 |
++ mac_addr[1];
+ AT_WRITE_REG_ARRAY(hw, REG_MAC_STA_ADDR, 1, value);
+ }
+
++/* read mac address from hardware register */
++static bool atl1c_read_current_addr(struct atl1c_hw *hw, u8 *eth_addr)
++{
++ u32 addr[2];
++
++ AT_READ_REG(hw, REG_MAC_STA_ADDR, &addr[0]);
++ AT_READ_REG(hw, REG_MAC_STA_ADDR + 4, &addr[1]);
++
++ *(u32 *) &eth_addr[2] = htonl(addr[0]);
++ *(u16 *) &eth_addr[0] = htons((u16)addr[1]);
++
++ return is_valid_ether_addr(eth_addr);
++}
++
+ /*
+ * atl1c_get_permanent_address
+ * return 0 if get valid mac address,
+ */
+ static int atl1c_get_permanent_address(struct atl1c_hw *hw)
+ {
+- u32 addr[2];
+ u32 i;
+ u32 otp_ctrl_data;
+ u32 twsi_ctrl_data;
+- u32 ltssm_ctrl_data;
+- u32 wol_data;
+- u8 eth_addr[ETH_ALEN];
+ u16 phy_data;
+ bool raise_vol = false;
+
++ /* MAC-address from BIOS is the 1st priority */
++ if (atl1c_read_current_addr(hw, hw->perm_mac_addr))
++ return 0;
++
+ /* init */
+- addr[0] = addr[1] = 0;
+ AT_READ_REG(hw, REG_OTP_CTRL, &otp_ctrl_data);
+ if (atl1c_check_eeprom_exist(hw)) {
+ if (hw->nic_type == athr_l1c || hw->nic_type == athr_l2c) {
+@@ -91,33 +104,17 @@ static int atl1c_get_permanent_address(struct atl1c_hw *hw)
+ msleep(1);
+ }
+ }
+-
+- if (hw->nic_type == athr_l2c_b ||
+- hw->nic_type == athr_l2c_b2 ||
+- hw->nic_type == athr_l1d) {
+- atl1c_write_phy_reg(hw, MII_DBG_ADDR, 0x00);
+- if (atl1c_read_phy_reg(hw, MII_DBG_DATA, &phy_data))
+- goto out;
+- phy_data &= 0xFF7F;
+- atl1c_write_phy_reg(hw, MII_DBG_DATA, phy_data);
+-
+- atl1c_write_phy_reg(hw, MII_DBG_ADDR, 0x3B);
+- if (atl1c_read_phy_reg(hw, MII_DBG_DATA, &phy_data))
+- goto out;
+- phy_data |= 0x8;
+- atl1c_write_phy_reg(hw, MII_DBG_DATA, phy_data);
++ /* raise voltage temporally for l2cb */
++ if (hw->nic_type == athr_l2c_b || hw->nic_type == athr_l2c_b2) {
++ atl1c_read_phy_dbg(hw, MIIDBG_ANACTRL, &phy_data);
++ phy_data &= ~ANACTRL_HB_EN;
++ atl1c_write_phy_dbg(hw, MIIDBG_ANACTRL, phy_data);
++ atl1c_read_phy_dbg(hw, MIIDBG_VOLT_CTRL, &phy_data);
++ phy_data |= VOLT_CTRL_SWLOWEST;
++ atl1c_write_phy_dbg(hw, MIIDBG_VOLT_CTRL, phy_data);
+ udelay(20);
+ raise_vol = true;
+ }
+- /* close open bit of ReadOnly*/
+- AT_READ_REG(hw, REG_LTSSM_ID_CTRL, &ltssm_ctrl_data);
+- ltssm_ctrl_data &= ~LTSSM_ID_EN_WRO;
+- AT_WRITE_REG(hw, REG_LTSSM_ID_CTRL, ltssm_ctrl_data);
+-
+- /* clear any WOL settings */
+- AT_WRITE_REG(hw, REG_WOL_CTRL, 0);
+- AT_READ_REG(hw, REG_WOL_CTRL, &wol_data);
+-
+
+ AT_READ_REG(hw, REG_TWSI_CTRL, &twsi_ctrl_data);
+ twsi_ctrl_data |= TWSI_CTRL_SW_LDSTART;
+@@ -138,37 +135,18 @@ static int atl1c_get_permanent_address(struct atl1c_hw *hw)
+ msleep(1);
+ }
+ if (raise_vol) {
+- if (hw->nic_type == athr_l2c_b ||
+- hw->nic_type == athr_l2c_b2 ||
+- hw->nic_type == athr_l1d ||
+- hw->nic_type == athr_l1d_2) {
+- atl1c_write_phy_reg(hw, MII_DBG_ADDR, 0x00);
+- if (atl1c_read_phy_reg(hw, MII_DBG_DATA, &phy_data))
+- goto out;
+- phy_data |= 0x80;
+- atl1c_write_phy_reg(hw, MII_DBG_DATA, phy_data);
+-
+- atl1c_write_phy_reg(hw, MII_DBG_ADDR, 0x3B);
+- if (atl1c_read_phy_reg(hw, MII_DBG_DATA, &phy_data))
+- goto out;
+- phy_data &= 0xFFF7;
+- atl1c_write_phy_reg(hw, MII_DBG_DATA, phy_data);
+- udelay(20);
+- }
++ atl1c_read_phy_dbg(hw, MIIDBG_ANACTRL, &phy_data);
++ phy_data |= ANACTRL_HB_EN;
++ atl1c_write_phy_dbg(hw, MIIDBG_ANACTRL, phy_data);
++ atl1c_read_phy_dbg(hw, MIIDBG_VOLT_CTRL, &phy_data);
++ phy_data &= ~VOLT_CTRL_SWLOWEST;
++ atl1c_write_phy_dbg(hw, MIIDBG_VOLT_CTRL, phy_data);
++ udelay(20);
+ }
+
+- /* maybe MAC-address is from BIOS */
+- AT_READ_REG(hw, REG_MAC_STA_ADDR, &addr[0]);
+- AT_READ_REG(hw, REG_MAC_STA_ADDR + 4, &addr[1]);
+- *(u32 *) &eth_addr[2] = swab32(addr[0]);
+- *(u16 *) &eth_addr[0] = swab16(*(u16 *)&addr[1]);
+-
+- if (is_valid_ether_addr(eth_addr)) {
+- memcpy(hw->perm_mac_addr, eth_addr, ETH_ALEN);
++ if (atl1c_read_current_addr(hw, hw->perm_mac_addr))
+ return 0;
+- }
+
+-out:
+ return -1;
+ }
+
+@@ -278,33 +256,158 @@ void atl1c_hash_set(struct atl1c_hw *hw, u32 hash_value)
+ }
+
+ /*
+- * Reads the value from a PHY register
+- * hw - Struct containing variables accessed by shared code
+- * reg_addr - address of the PHY register to read
++ * wait mdio module be idle
++ * return true: idle
++ * false: still busy
+ */
+-int atl1c_read_phy_reg(struct atl1c_hw *hw, u16 reg_addr, u16 *phy_data)
++bool atl1c_wait_mdio_idle(struct atl1c_hw *hw)
+ {
+ u32 val;
+ int i;
+
+- val = ((u32)(reg_addr & MDIO_REG_ADDR_MASK)) << MDIO_REG_ADDR_SHIFT |
+- MDIO_START | MDIO_SUP_PREAMBLE | MDIO_RW |
+- MDIO_CLK_25_4 << MDIO_CLK_SEL_SHIFT;
++ for (i = 0; i < MDIO_MAX_AC_TO; i++) {
++ AT_READ_REG(hw, REG_MDIO_CTRL, &val);
++ if (!(val & (MDIO_CTRL_BUSY | MDIO_CTRL_START)))
++ break;
++ udelay(10);
++ }
++
++ return i != MDIO_MAX_AC_TO;
++}
++
++void atl1c_stop_phy_polling(struct atl1c_hw *hw)
++{
++ if (!(hw->ctrl_flags & ATL1C_FPGA_VERSION))
++ return;
++
++ AT_WRITE_REG(hw, REG_MDIO_CTRL, 0);
++ atl1c_wait_mdio_idle(hw);
++}
++
++void atl1c_start_phy_polling(struct atl1c_hw *hw, u16 clk_sel)
++{
++ u32 val;
++
++ if (!(hw->ctrl_flags & ATL1C_FPGA_VERSION))
++ return;
+
++ val = MDIO_CTRL_SPRES_PRMBL |
++ FIELDX(MDIO_CTRL_CLK_SEL, clk_sel) |
++ FIELDX(MDIO_CTRL_REG, 1) |
++ MDIO_CTRL_START |
++ MDIO_CTRL_OP_READ;
++ AT_WRITE_REG(hw, REG_MDIO_CTRL, val);
++ atl1c_wait_mdio_idle(hw);
++ val |= MDIO_CTRL_AP_EN;
++ val &= ~MDIO_CTRL_START;
+ AT_WRITE_REG(hw, REG_MDIO_CTRL, val);
++ udelay(30);
++}
+
+- for (i = 0; i < MDIO_WAIT_TIMES; i++) {
+- udelay(2);
+- AT_READ_REG(hw, REG_MDIO_CTRL, &val);
+- if (!(val & (MDIO_START | MDIO_BUSY)))
+- break;
++
++/*
++ * atl1c_read_phy_core
++ * core funtion to read register in PHY via MDIO control regsiter.
++ * ext: extension register (see IEEE 802.3)
++ * dev: device address (see IEEE 802.3 DEVAD, PRTAD is fixed to 0)
++ * reg: reg to read
++ */
++int atl1c_read_phy_core(struct atl1c_hw *hw, bool ext, u8 dev,
++ u16 reg, u16 *phy_data)
++{
++ u32 val;
++ u16 clk_sel = MDIO_CTRL_CLK_25_4;
++
++ atl1c_stop_phy_polling(hw);
++
++ *phy_data = 0;
++
++ /* only l2c_b2 & l1d_2 could use slow clock */
++ if ((hw->nic_type == athr_l2c_b2 || hw->nic_type == athr_l1d_2) &&
++ hw->hibernate)
++ clk_sel = MDIO_CTRL_CLK_25_128;
++ if (ext) {
++ val = FIELDX(MDIO_EXTN_DEVAD, dev) | FIELDX(MDIO_EXTN_REG, reg);
++ AT_WRITE_REG(hw, REG_MDIO_EXTN, val);
++ val = MDIO_CTRL_SPRES_PRMBL |
++ FIELDX(MDIO_CTRL_CLK_SEL, clk_sel) |
++ MDIO_CTRL_START |
++ MDIO_CTRL_MODE_EXT |
++ MDIO_CTRL_OP_READ;
++ } else {
++ val = MDIO_CTRL_SPRES_PRMBL |
++ FIELDX(MDIO_CTRL_CLK_SEL, clk_sel) |
++ FIELDX(MDIO_CTRL_REG, reg) |
++ MDIO_CTRL_START |
++ MDIO_CTRL_OP_READ;
+ }
+- if (!(val & (MDIO_START | MDIO_BUSY))) {
+- *phy_data = (u16)val;
+- return 0;
++ AT_WRITE_REG(hw, REG_MDIO_CTRL, val);
++
++ if (!atl1c_wait_mdio_idle(hw))
++ return -1;
++
++ AT_READ_REG(hw, REG_MDIO_CTRL, &val);
++ *phy_data = (u16)FIELD_GETX(val, MDIO_CTRL_DATA);
++
++ atl1c_start_phy_polling(hw, clk_sel);
++
++ return 0;
++}
++
++/*
++ * atl1c_write_phy_core
++ * core funtion to write to register in PHY via MDIO control regsiter.
++ * ext: extension register (see IEEE 802.3)
++ * dev: device address (see IEEE 802.3 DEVAD, PRTAD is fixed to 0)
++ * reg: reg to write
++ */
++int atl1c_write_phy_core(struct atl1c_hw *hw, bool ext, u8 dev,
++ u16 reg, u16 phy_data)
++{
++ u32 val;
++ u16 clk_sel = MDIO_CTRL_CLK_25_4;
++
++ atl1c_stop_phy_polling(hw);
++
++
++ /* only l2c_b2 & l1d_2 could use slow clock */
++ if ((hw->nic_type == athr_l2c_b2 || hw->nic_type == athr_l1d_2) &&
++ hw->hibernate)
++ clk_sel = MDIO_CTRL_CLK_25_128;
++
++ if (ext) {
++ val = FIELDX(MDIO_EXTN_DEVAD, dev) | FIELDX(MDIO_EXTN_REG, reg);
++ AT_WRITE_REG(hw, REG_MDIO_EXTN, val);
++ val = MDIO_CTRL_SPRES_PRMBL |
++ FIELDX(MDIO_CTRL_CLK_SEL, clk_sel) |
++ FIELDX(MDIO_CTRL_DATA, phy_data) |
++ MDIO_CTRL_START |
++ MDIO_CTRL_MODE_EXT;
++ } else {
++ val = MDIO_CTRL_SPRES_PRMBL |
++ FIELDX(MDIO_CTRL_CLK_SEL, clk_sel) |
++ FIELDX(MDIO_CTRL_DATA, phy_data) |
++ FIELDX(MDIO_CTRL_REG, reg) |
++ MDIO_CTRL_START;
+ }
++ AT_WRITE_REG(hw, REG_MDIO_CTRL, val);
+
+- return -1;
++ if (!atl1c_wait_mdio_idle(hw))
++ return -1;
++
++ atl1c_start_phy_polling(hw, clk_sel);
++
++ return 0;
++}
++
++/*
++ * Reads the value from a PHY register
++ * hw - Struct containing variables accessed by shared code
++ * reg_addr - address of the PHY register to read
++ */
++int atl1c_read_phy_reg(struct atl1c_hw *hw, u16 reg_addr, u16 *phy_data)
++{
++ return atl1c_read_phy_core(hw, false, 0, reg_addr, phy_data);
+ }
+
+ /*
+@@ -315,27 +418,47 @@ int atl1c_read_phy_reg(struct atl1c_hw *hw, u16 reg_addr, u16 *phy_data)
+ */
+ int atl1c_write_phy_reg(struct atl1c_hw *hw, u32 reg_addr, u16 phy_data)
+ {
+- int i;
+- u32 val;
++ return atl1c_write_phy_core(hw, false, 0, reg_addr, phy_data);
++}
+
+- val = ((u32)(phy_data & MDIO_DATA_MASK)) << MDIO_DATA_SHIFT |
+- (reg_addr & MDIO_REG_ADDR_MASK) << MDIO_REG_ADDR_SHIFT |
+- MDIO_SUP_PREAMBLE | MDIO_START |
+- MDIO_CLK_25_4 << MDIO_CLK_SEL_SHIFT;
++/* read from PHY extension register */
++int atl1c_read_phy_ext(struct atl1c_hw *hw, u8 dev_addr,
++ u16 reg_addr, u16 *phy_data)
++{
++ return atl1c_read_phy_core(hw, true, dev_addr, reg_addr, phy_data);
++}
+
+- AT_WRITE_REG(hw, REG_MDIO_CTRL, val);
++/* write to PHY extension register */
++int atl1c_write_phy_ext(struct atl1c_hw *hw, u8 dev_addr,
++ u16 reg_addr, u16 phy_data)
++{
++ return atl1c_write_phy_core(hw, true, dev_addr, reg_addr, phy_data);
++}
+
+- for (i = 0; i < MDIO_WAIT_TIMES; i++) {
+- udelay(2);
+- AT_READ_REG(hw, REG_MDIO_CTRL, &val);
+- if (!(val & (MDIO_START | MDIO_BUSY)))
+- break;
+- }
++int atl1c_read_phy_dbg(struct atl1c_hw *hw, u16 reg_addr, u16 *phy_data)
++{
++ int err;
+
+- if (!(val & (MDIO_START | MDIO_BUSY)))
+- return 0;
++ err = atl1c_write_phy_reg(hw, MII_DBG_ADDR, reg_addr);
++ if (unlikely(err))
++ return err;
++ else
++ err = atl1c_read_phy_reg(hw, MII_DBG_DATA, phy_data);
+
+- return -1;
++ return err;
++}
++
++int atl1c_write_phy_dbg(struct atl1c_hw *hw, u16 reg_addr, u16 phy_data)
++{
++ int err;
++
++ err = atl1c_write_phy_reg(hw, MII_DBG_ADDR, reg_addr);
++ if (unlikely(err))
++ return err;
++ else
++ err = atl1c_write_phy_reg(hw, MII_DBG_DATA, phy_data);
++
++ return err;
+ }
+
+ /*
+@@ -380,119 +503,100 @@ static int atl1c_phy_setup_adv(struct atl1c_hw *hw)
+
+ void atl1c_phy_disable(struct atl1c_hw *hw)
+ {
+- AT_WRITE_REGW(hw, REG_GPHY_CTRL,
+- GPHY_CTRL_PW_WOL_DIS | GPHY_CTRL_EXT_RESET);
++ atl1c_power_saving(hw, 0);
+ }
+
+-static void atl1c_phy_magic_data(struct atl1c_hw *hw)
+-{
+- u16 data;
+-
+- data = ANA_LOOP_SEL_10BT | ANA_EN_MASK_TB | ANA_EN_10BT_IDLE |
+- ((1 & ANA_INTERVAL_SEL_TIMER_MASK) <<
+- ANA_INTERVAL_SEL_TIMER_SHIFT);
+-
+- atl1c_write_phy_reg(hw, MII_DBG_ADDR, MII_ANA_CTRL_18);
+- atl1c_write_phy_reg(hw, MII_DBG_DATA, data);
+-
+- data = (2 & ANA_SERDES_CDR_BW_MASK) | ANA_MS_PAD_DBG |
+- ANA_SERDES_EN_DEEM | ANA_SERDES_SEL_HSP | ANA_SERDES_EN_PLL |
+- ANA_SERDES_EN_LCKDT;
+-
+- atl1c_write_phy_reg(hw, MII_DBG_ADDR, MII_ANA_CTRL_5);
+- atl1c_write_phy_reg(hw, MII_DBG_DATA, data);
+-
+- data = (44 & ANA_LONG_CABLE_TH_100_MASK) |
+- ((33 & ANA_SHORT_CABLE_TH_100_MASK) <<
+- ANA_SHORT_CABLE_TH_100_SHIFT) | ANA_BP_BAD_LINK_ACCUM |
+- ANA_BP_SMALL_BW;
+-
+- atl1c_write_phy_reg(hw, MII_DBG_ADDR, MII_ANA_CTRL_54);
+- atl1c_write_phy_reg(hw, MII_DBG_DATA, data);
+-
+- data = (11 & ANA_IECHO_ADJ_MASK) | ((11 & ANA_IECHO_ADJ_MASK) <<
+- ANA_IECHO_ADJ_2_SHIFT) | ((8 & ANA_IECHO_ADJ_MASK) <<
+- ANA_IECHO_ADJ_1_SHIFT) | ((8 & ANA_IECHO_ADJ_MASK) <<
+- ANA_IECHO_ADJ_0_SHIFT);
+-
+- atl1c_write_phy_reg(hw, MII_DBG_ADDR, MII_ANA_CTRL_4);
+- atl1c_write_phy_reg(hw, MII_DBG_DATA, data);
+-
+- data = ANA_RESTART_CAL | ((7 & ANA_MANUL_SWICH_ON_MASK) <<
+- ANA_MANUL_SWICH_ON_SHIFT) | ANA_MAN_ENABLE |
+- ANA_SEL_HSP | ANA_EN_HB | ANA_OEN_125M;
+-
+- atl1c_write_phy_reg(hw, MII_DBG_ADDR, MII_ANA_CTRL_0);
+- atl1c_write_phy_reg(hw, MII_DBG_DATA, data);
+-
+- if (hw->ctrl_flags & ATL1C_HIB_DISABLE) {
+- atl1c_write_phy_reg(hw, MII_DBG_ADDR, MII_ANA_CTRL_41);
+- if (atl1c_read_phy_reg(hw, MII_DBG_DATA, &data) != 0)
+- return;
+- data &= ~ANA_TOP_PS_EN;
+- atl1c_write_phy_reg(hw, MII_DBG_DATA, data);
+-
+- atl1c_write_phy_reg(hw, MII_DBG_ADDR, MII_ANA_CTRL_11);
+- if (atl1c_read_phy_reg(hw, MII_DBG_DATA, &data) != 0)
+- return;
+- data &= ~ANA_PS_HIB_EN;
+- atl1c_write_phy_reg(hw, MII_DBG_DATA, data);
+- }
+-}
+
+ int atl1c_phy_reset(struct atl1c_hw *hw)
+ {
+ struct atl1c_adapter *adapter = hw->adapter;
+ struct pci_dev *pdev = adapter->pdev;
+ u16 phy_data;
+- u32 phy_ctrl_data = GPHY_CTRL_DEFAULT;
+- u32 mii_ier_data = IER_LINK_UP | IER_LINK_DOWN;
++ u32 phy_ctrl_data, lpi_ctrl;
+ int err;
+
+- if (hw->ctrl_flags & ATL1C_HIB_DISABLE)
+- phy_ctrl_data &= ~GPHY_CTRL_HIB_EN;
+-
++ /* reset PHY core */
++ AT_READ_REG(hw, REG_GPHY_CTRL, &phy_ctrl_data);
++ phy_ctrl_data &= ~(GPHY_CTRL_EXT_RESET | GPHY_CTRL_PHY_IDDQ |
++ GPHY_CTRL_GATE_25M_EN | GPHY_CTRL_PWDOWN_HW | GPHY_CTRL_CLS);
++ phy_ctrl_data |= GPHY_CTRL_SEL_ANA_RST;
++ if (!(hw->ctrl_flags & ATL1C_HIB_DISABLE))
++ phy_ctrl_data |= (GPHY_CTRL_HIB_EN | GPHY_CTRL_HIB_PULSE);
++ else
++ phy_ctrl_data &= ~(GPHY_CTRL_HIB_EN | GPHY_CTRL_HIB_PULSE);
+ AT_WRITE_REG(hw, REG_GPHY_CTRL, phy_ctrl_data);
+ AT_WRITE_FLUSH(hw);
+- msleep(40);
+- phy_ctrl_data |= GPHY_CTRL_EXT_RESET;
+- AT_WRITE_REG(hw, REG_GPHY_CTRL, phy_ctrl_data);
++ udelay(10);
++ AT_WRITE_REG(hw, REG_GPHY_CTRL, phy_ctrl_data | GPHY_CTRL_EXT_RESET);
+ AT_WRITE_FLUSH(hw);
+- msleep(10);
++ udelay(10 * GPHY_CTRL_EXT_RST_TO); /* delay 800us */
+
++ /* switch clock */
+ if (hw->nic_type == athr_l2c_b) {
+- atl1c_write_phy_reg(hw, MII_DBG_ADDR, 0x0A);
+- atl1c_read_phy_reg(hw, MII_DBG_DATA, &phy_data);
+- atl1c_write_phy_reg(hw, MII_DBG_DATA, phy_data & 0xDFFF);
++ atl1c_read_phy_dbg(hw, MIIDBG_CFGLPSPD, &phy_data);
++ atl1c_write_phy_dbg(hw, MIIDBG_CFGLPSPD,
++ phy_data & ~CFGLPSPD_RSTCNT_CLK125SW);
+ }
+
+- if (hw->nic_type == athr_l2c_b ||
+- hw->nic_type == athr_l2c_b2 ||
+- hw->nic_type == athr_l1d ||
+- hw->nic_type == athr_l1d_2) {
+- atl1c_write_phy_reg(hw, MII_DBG_ADDR, 0x3B);
+- atl1c_read_phy_reg(hw, MII_DBG_DATA, &phy_data);
+- atl1c_write_phy_reg(hw, MII_DBG_DATA, phy_data & 0xFFF7);
+- msleep(20);
++ /* tx-half amplitude issue fix */
++ if (hw->nic_type == athr_l2c_b || hw->nic_type == athr_l2c_b2) {
++ atl1c_read_phy_dbg(hw, MIIDBG_CABLE1TH_DET, &phy_data);
++ phy_data |= CABLE1TH_DET_EN;
++ atl1c_write_phy_dbg(hw, MIIDBG_CABLE1TH_DET, phy_data);
+ }
+- if (hw->nic_type == athr_l1d) {
+- atl1c_write_phy_reg(hw, MII_DBG_ADDR, 0x29);
+- atl1c_write_phy_reg(hw, MII_DBG_DATA, 0x929D);
++
++ /* clear bit3 of dbgport 3B to lower voltage */
++ if (!(hw->ctrl_flags & ATL1C_HIB_DISABLE)) {
++ if (hw->nic_type == athr_l2c_b || hw->nic_type == athr_l2c_b2) {
++ atl1c_read_phy_dbg(hw, MIIDBG_VOLT_CTRL, &phy_data);
++ phy_data &= ~VOLT_CTRL_SWLOWEST;
++ atl1c_write_phy_dbg(hw, MIIDBG_VOLT_CTRL, phy_data);
++ }
++ /* power saving config */
++ phy_data =
++ hw->nic_type == athr_l1d || hw->nic_type == athr_l1d_2 ?
++ L1D_LEGCYPS_DEF : L1C_LEGCYPS_DEF;
++ atl1c_write_phy_dbg(hw, MIIDBG_LEGCYPS, phy_data);
++ /* hib */
++ atl1c_write_phy_dbg(hw, MIIDBG_SYSMODCTRL,
++ SYSMODCTRL_IECHOADJ_DEF);
++ } else {
++ /* disable pws */
++ atl1c_read_phy_dbg(hw, MIIDBG_LEGCYPS, &phy_data);
++ atl1c_write_phy_dbg(hw, MIIDBG_LEGCYPS,
++ phy_data & ~LEGCYPS_EN);
++ /* disable hibernate */
++ atl1c_read_phy_dbg(hw, MIIDBG_HIBNEG, &phy_data);
++ atl1c_write_phy_dbg(hw, MIIDBG_HIBNEG,
++ phy_data & HIBNEG_PSHIB_EN);
+ }
+- if (hw->nic_type == athr_l1c || hw->nic_type == athr_l2c_b2
+- || hw->nic_type == athr_l2c) {
+- atl1c_write_phy_reg(hw, MII_DBG_ADDR, 0x29);
+- atl1c_write_phy_reg(hw, MII_DBG_DATA, 0xB6DD);
++ /* disable AZ(EEE) by default */
++ if (hw->nic_type == athr_l1d || hw->nic_type == athr_l1d_2 ||
++ hw->nic_type == athr_l2c_b2) {
++ AT_READ_REG(hw, REG_LPI_CTRL, &lpi_ctrl);
++ AT_WRITE_REG(hw, REG_LPI_CTRL, lpi_ctrl & ~LPI_CTRL_EN);
++ atl1c_write_phy_ext(hw, MIIEXT_ANEG, MIIEXT_LOCAL_EEEADV, 0);
++ atl1c_write_phy_ext(hw, MIIEXT_PCS, MIIEXT_CLDCTRL3,
++ L2CB_CLDCTRL3);
+ }
+- err = atl1c_write_phy_reg(hw, MII_IER, mii_ier_data);
++
++ /* other debug port to set */
++ atl1c_write_phy_dbg(hw, MIIDBG_ANACTRL, ANACTRL_DEF);
++ atl1c_write_phy_dbg(hw, MIIDBG_SRDSYSMOD, SRDSYSMOD_DEF);
++ atl1c_write_phy_dbg(hw, MIIDBG_TST10BTCFG, TST10BTCFG_DEF);
++ /* UNH-IOL test issue, set bit7 */
++ atl1c_write_phy_dbg(hw, MIIDBG_TST100BTCFG,
++ TST100BTCFG_DEF | TST100BTCFG_LITCH_EN);
++
++ /* set phy interrupt mask */
++ phy_data = IER_LINK_UP | IER_LINK_DOWN;
++ err = atl1c_write_phy_reg(hw, MII_IER, phy_data);
+ if (err) {
+ if (netif_msg_hw(adapter))
+ dev_err(&pdev->dev,
+ "Error enable PHY linkChange Interrupt\n");
+ return err;
+ }
+- if (!(hw->ctrl_flags & ATL1C_FPGA_VERSION))
+- atl1c_phy_magic_data(hw);
+ return 0;
+ }
+
+@@ -589,7 +693,8 @@ int atl1c_get_speed_and_duplex(struct atl1c_hw *hw, u16 *speed, u16 *duplex)
+ return 0;
+ }
+
+-int atl1c_phy_power_saving(struct atl1c_hw *hw)
++/* select one link mode to get lower power consumption */
++int atl1c_phy_to_ps_link(struct atl1c_hw *hw)
+ {
+ struct atl1c_adapter *adapter = (struct atl1c_adapter *)hw->adapter;
+ struct pci_dev *pdev = adapter->pdev;
+@@ -660,3 +765,101 @@ int atl1c_restart_autoneg(struct atl1c_hw *hw)
+
+ return atl1c_write_phy_reg(hw, MII_BMCR, mii_bmcr_data);
+ }
++
++int atl1c_power_saving(struct atl1c_hw *hw, u32 wufc)
++{
++ struct atl1c_adapter *adapter = (struct atl1c_adapter *)hw->adapter;
++ struct pci_dev *pdev = adapter->pdev;
++ u32 master_ctrl, mac_ctrl, phy_ctrl;
++ u32 wol_ctrl, speed;
++ u16 phy_data;
++
++ wol_ctrl = 0;
++ speed = adapter->link_speed == SPEED_1000 ?
++ MAC_CTRL_SPEED_1000 : MAC_CTRL_SPEED_10_100;
++
++ AT_READ_REG(hw, REG_MASTER_CTRL, &master_ctrl);
++ AT_READ_REG(hw, REG_MAC_CTRL, &mac_ctrl);
++ AT_READ_REG(hw, REG_GPHY_CTRL, &phy_ctrl);
++
++ master_ctrl &= ~MASTER_CTRL_CLK_SEL_DIS;
++ mac_ctrl = FIELD_SETX(mac_ctrl, MAC_CTRL_SPEED, speed);
++ mac_ctrl &= ~(MAC_CTRL_DUPLX | MAC_CTRL_RX_EN | MAC_CTRL_TX_EN);
++ if (adapter->link_duplex == FULL_DUPLEX)
++ mac_ctrl |= MAC_CTRL_DUPLX;
++ phy_ctrl &= ~(GPHY_CTRL_EXT_RESET | GPHY_CTRL_CLS);
++ phy_ctrl |= GPHY_CTRL_SEL_ANA_RST | GPHY_CTRL_HIB_PULSE |
++ GPHY_CTRL_HIB_EN;
++ if (!wufc) { /* without WoL */
++ master_ctrl |= MASTER_CTRL_CLK_SEL_DIS;
++ phy_ctrl |= GPHY_CTRL_PHY_IDDQ | GPHY_CTRL_PWDOWN_HW;
++ AT_WRITE_REG(hw, REG_MASTER_CTRL, master_ctrl);
++ AT_WRITE_REG(hw, REG_MAC_CTRL, mac_ctrl);
++ AT_WRITE_REG(hw, REG_GPHY_CTRL, phy_ctrl);
++ AT_WRITE_REG(hw, REG_WOL_CTRL, 0);
++ hw->phy_configured = false; /* re-init PHY when resume */
++ return 0;
++ }
++ phy_ctrl |= GPHY_CTRL_EXT_RESET;
++ if (wufc & AT_WUFC_MAG) {
++ mac_ctrl |= MAC_CTRL_RX_EN | MAC_CTRL_BC_EN;
++ wol_ctrl |= WOL_MAGIC_EN | WOL_MAGIC_PME_EN;
++ if (hw->nic_type == athr_l2c_b && hw->revision_id == L2CB_V11)
++ wol_ctrl |= WOL_PATTERN_EN | WOL_PATTERN_PME_EN;
++ }
++ if (wufc & AT_WUFC_LNKC) {
++ wol_ctrl |= WOL_LINK_CHG_EN | WOL_LINK_CHG_PME_EN;
++ if (atl1c_write_phy_reg(hw, MII_IER, IER_LINK_UP) != 0) {
++ dev_dbg(&pdev->dev, "%s: write phy MII_IER faild.\n",
++ atl1c_driver_name);
++ }
++ }
++ /* clear PHY interrupt */
++ atl1c_read_phy_reg(hw, MII_ISR, &phy_data);
++
++ dev_dbg(&pdev->dev, "%s: suspend MAC=%x,MASTER=%x,PHY=0x%x,WOL=%x\n",
++ atl1c_driver_name, mac_ctrl, master_ctrl, phy_ctrl, wol_ctrl);
++ AT_WRITE_REG(hw, REG_MASTER_CTRL, master_ctrl);
++ AT_WRITE_REG(hw, REG_MAC_CTRL, mac_ctrl);
++ AT_WRITE_REG(hw, REG_GPHY_CTRL, phy_ctrl);
++ AT_WRITE_REG(hw, REG_WOL_CTRL, wol_ctrl);
++
++ return 0;
++}
++
++
++/* configure phy after Link change Event */
++void atl1c_post_phy_linkchg(struct atl1c_hw *hw, u16 link_speed)
++{
++ u16 phy_val;
++ bool adj_thresh = false;
++
++ if (hw->nic_type == athr_l2c_b || hw->nic_type == athr_l2c_b2 ||
++ hw->nic_type == athr_l1d || hw->nic_type == athr_l1d_2)
++ adj_thresh = true;
++
++ if (link_speed != SPEED_0) { /* link up */
++ /* az with brcm, half-amp */
++ if (hw->nic_type == athr_l1d_2) {
++ atl1c_read_phy_ext(hw, MIIEXT_PCS, MIIEXT_CLDCTRL6,
++ &phy_val);
++ phy_val = FIELD_GETX(phy_val, CLDCTRL6_CAB_LEN);
++ phy_val = phy_val > CLDCTRL6_CAB_LEN_SHORT ?
++ AZ_ANADECT_LONG : AZ_ANADECT_DEF;
++ atl1c_write_phy_dbg(hw, MIIDBG_AZ_ANADECT, phy_val);
++ }
++ /* threshold adjust */
++ if (adj_thresh && link_speed == SPEED_100 && hw->msi_lnkpatch) {
++ atl1c_write_phy_dbg(hw, MIIDBG_MSE16DB, L1D_MSE16DB_UP);
++ atl1c_write_phy_dbg(hw, MIIDBG_SYSMODCTRL,
++ L1D_SYSMODCTRL_IECHOADJ_DEF);
++ }
++ } else { /* link down */
++ if (adj_thresh && hw->msi_lnkpatch) {
++ atl1c_write_phy_dbg(hw, MIIDBG_SYSMODCTRL,
++ SYSMODCTRL_IECHOADJ_DEF);
++ atl1c_write_phy_dbg(hw, MIIDBG_MSE16DB,
++ L1D_MSE16DB_DOWN);
++ }
++ }
++}
+diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_hw.h b/drivers/net/ethernet/atheros/atl1c/atl1c_hw.h
+index 655fc6c..17d935b 100644
+--- a/drivers/net/ethernet/atheros/atl1c/atl1c_hw.h
++++ b/drivers/net/ethernet/atheros/atl1c/atl1c_hw.h
+@@ -25,12 +25,18 @@
+ #include <linux/types.h>
+ #include <linux/mii.h>
+
++#define FIELD_GETX(_x, _name) ((_x) >> (_name##_SHIFT) & (_name##_MASK))
++#define FIELD_SETX(_x, _name, _v) \
++(((_x) & ~((_name##_MASK) << (_name##_SHIFT))) |\
++(((_v) & (_name##_MASK)) << (_name##_SHIFT)))
++#define FIELDX(_name, _v) (((_v) & (_name##_MASK)) << (_name##_SHIFT))
++
+ struct atl1c_adapter;
+ struct atl1c_hw;
+
+ /* function prototype */
+ void atl1c_phy_disable(struct atl1c_hw *hw);
+-void atl1c_hw_set_mac_addr(struct atl1c_hw *hw);
++void atl1c_hw_set_mac_addr(struct atl1c_hw *hw, u8 *mac_addr);
+ int atl1c_phy_reset(struct atl1c_hw *hw);
+ int atl1c_read_mac_addr(struct atl1c_hw *hw);
+ int atl1c_get_speed_and_duplex(struct atl1c_hw *hw, u16 *speed, u16 *duplex);
+@@ -42,47 +48,45 @@ bool atl1c_read_eeprom(struct atl1c_hw *hw, u32 offset, u32 *p_value);
+ int atl1c_phy_init(struct atl1c_hw *hw);
+ int atl1c_check_eeprom_exist(struct atl1c_hw *hw);
+ int atl1c_restart_autoneg(struct atl1c_hw *hw);
+-int atl1c_phy_power_saving(struct atl1c_hw *hw);
++int atl1c_phy_to_ps_link(struct atl1c_hw *hw);
++int atl1c_power_saving(struct atl1c_hw *hw, u32 wufc);
++bool atl1c_wait_mdio_idle(struct atl1c_hw *hw);
++void atl1c_stop_phy_polling(struct atl1c_hw *hw);
++void atl1c_start_phy_polling(struct atl1c_hw *hw, u16 clk_sel);
++int atl1c_read_phy_core(struct atl1c_hw *hw, bool ext, u8 dev,
++ u16 reg, u16 *phy_data);
++int atl1c_write_phy_core(struct atl1c_hw *hw, bool ext, u8 dev,
++ u16 reg, u16 phy_data);
++int atl1c_read_phy_ext(struct atl1c_hw *hw, u8 dev_addr,
++ u16 reg_addr, u16 *phy_data);
++int atl1c_write_phy_ext(struct atl1c_hw *hw, u8 dev_addr,
++ u16 reg_addr, u16 phy_data);
++int atl1c_read_phy_dbg(struct atl1c_hw *hw, u16 reg_addr, u16 *phy_data);
++int atl1c_write_phy_dbg(struct atl1c_hw *hw, u16 reg_addr, u16 phy_data);
++void atl1c_post_phy_linkchg(struct atl1c_hw *hw, u16 link_speed);
++
++/* hw-ids */
++#define PCI_DEVICE_ID_ATTANSIC_L2C 0x1062
++#define PCI_DEVICE_ID_ATTANSIC_L1C 0x1063
++#define PCI_DEVICE_ID_ATHEROS_L2C_B 0x2060 /* AR8152 v1.1 Fast 10/100 */
++#define PCI_DEVICE_ID_ATHEROS_L2C_B2 0x2062 /* AR8152 v2.0 Fast 10/100 */
++#define PCI_DEVICE_ID_ATHEROS_L1D 0x1073 /* AR8151 v1.0 Gigabit 1000 */
++#define PCI_DEVICE_ID_ATHEROS_L1D_2_0 0x1083 /* AR8151 v2.0 Gigabit 1000 */
++#define L2CB_V10 0xc0
++#define L2CB_V11 0xc1
++
+ /* register definition */
+ #define REG_DEVICE_CAP 0x5C
+ #define DEVICE_CAP_MAX_PAYLOAD_MASK 0x7
+ #define DEVICE_CAP_MAX_PAYLOAD_SHIFT 0
+
+-#define REG_DEVICE_CTRL 0x60
+-#define DEVICE_CTRL_MAX_PAYLOAD_MASK 0x7
+-#define DEVICE_CTRL_MAX_PAYLOAD_SHIFT 5
+-#define DEVICE_CTRL_MAX_RREQ_SZ_MASK 0x7
+-#define DEVICE_CTRL_MAX_RREQ_SZ_SHIFT 12
++#define DEVICE_CTRL_MAXRRS_MIN 2
+
+ #define REG_LINK_CTRL 0x68
+ #define LINK_CTRL_L0S_EN 0x01
+ #define LINK_CTRL_L1_EN 0x02
+ #define LINK_CTRL_EXT_SYNC 0x80
+
+-#define REG_VPD_CAP 0x6C
+-#define VPD_CAP_ID_MASK 0xff
+-#define VPD_CAP_ID_SHIFT 0
+-#define VPD_CAP_NEXT_PTR_MASK 0xFF
+-#define VPD_CAP_NEXT_PTR_SHIFT 8
+-#define VPD_CAP_VPD_ADDR_MASK 0x7FFF
+-#define VPD_CAP_VPD_ADDR_SHIFT 16
+-#define VPD_CAP_VPD_FLAG 0x80000000
+-
+-#define REG_VPD_DATA 0x70
+-
+-#define REG_PCIE_UC_SEVERITY 0x10C
+-#define PCIE_UC_SERVRITY_TRN 0x00000001
+-#define PCIE_UC_SERVRITY_DLP 0x00000010
+-#define PCIE_UC_SERVRITY_PSN_TLP 0x00001000
+-#define PCIE_UC_SERVRITY_FCP 0x00002000
+-#define PCIE_UC_SERVRITY_CPL_TO 0x00004000
+-#define PCIE_UC_SERVRITY_CA 0x00008000
+-#define PCIE_UC_SERVRITY_UC 0x00010000
+-#define PCIE_UC_SERVRITY_ROV 0x00020000
+-#define PCIE_UC_SERVRITY_MLFP 0x00040000
+-#define PCIE_UC_SERVRITY_ECRC 0x00080000
+-#define PCIE_UC_SERVRITY_UR 0x00100000
+-
+ #define REG_DEV_SERIALNUM_CTRL 0x200
+ #define REG_DEV_MAC_SEL_MASK 0x0 /* 0:EUI; 1:MAC */
+ #define REG_DEV_MAC_SEL_SHIFT 0
+@@ -90,25 +94,17 @@ int atl1c_phy_power_saving(struct atl1c_hw *hw);
+ #define REG_DEV_SERIAL_NUM_EN_SHIFT 1
+
+ #define REG_TWSI_CTRL 0x218
++#define TWSI_CTLR_FREQ_MASK 0x3UL
++#define TWSI_CTRL_FREQ_SHIFT 24
++#define TWSI_CTRL_FREQ_100K 0
++#define TWSI_CTRL_FREQ_200K 1
++#define TWSI_CTRL_FREQ_300K 2
++#define TWSI_CTRL_FREQ_400K 3
++#define TWSI_CTRL_LD_EXIST BIT(23)
++#define TWSI_CTRL_HW_LDSTAT BIT(12) /* 0:finish,1:in progress */
++#define TWSI_CTRL_SW_LDSTART BIT(11)
+ #define TWSI_CTRL_LD_OFFSET_MASK 0xFF
+ #define TWSI_CTRL_LD_OFFSET_SHIFT 0
+-#define TWSI_CTRL_LD_SLV_ADDR_MASK 0x7
+-#define TWSI_CTRL_LD_SLV_ADDR_SHIFT 8
+-#define TWSI_CTRL_SW_LDSTART 0x800
+-#define TWSI_CTRL_HW_LDSTART 0x1000
+-#define TWSI_CTRL_SMB_SLV_ADDR_MASK 0x7F
+-#define TWSI_CTRL_SMB_SLV_ADDR_SHIFT 15
+-#define TWSI_CTRL_LD_EXIST 0x400000
+-#define TWSI_CTRL_READ_FREQ_SEL_MASK 0x3
+-#define TWSI_CTRL_READ_FREQ_SEL_SHIFT 23
+-#define TWSI_CTRL_FREQ_SEL_100K 0
+-#define TWSI_CTRL_FREQ_SEL_200K 1
+-#define TWSI_CTRL_FREQ_SEL_300K 2
+-#define TWSI_CTRL_FREQ_SEL_400K 3
+-#define TWSI_CTRL_SMB_SLV_ADDR
+-#define TWSI_CTRL_WRITE_FREQ_SEL_MASK 0x3
+-#define TWSI_CTRL_WRITE_FREQ_SEL_SHIFT 24
+-
+
+ #define REG_PCIE_DEV_MISC_CTRL 0x21C
+ #define PCIE_DEV_MISC_EXT_PIPE 0x2
+@@ -118,16 +114,23 @@ int atl1c_phy_power_saving(struct atl1c_hw *hw);
+ #define PCIE_DEV_MISC_SERDES_SEL_DIN 0x10
+
+ #define REG_PCIE_PHYMISC 0x1000
+-#define PCIE_PHYMISC_FORCE_RCV_DET 0x4
++#define PCIE_PHYMISC_FORCE_RCV_DET BIT(2)
++#define PCIE_PHYMISC_NFTS_MASK 0xFFUL
++#define PCIE_PHYMISC_NFTS_SHIFT 16
+
+ #define REG_PCIE_PHYMISC2 0x1004
+-#define PCIE_PHYMISC2_SERDES_CDR_MASK 0x3
+-#define PCIE_PHYMISC2_SERDES_CDR_SHIFT 16
+-#define PCIE_PHYMISC2_SERDES_TH_MASK 0x3
+-#define PCIE_PHYMISC2_SERDES_TH_SHIFT 18
++#define PCIE_PHYMISC2_L0S_TH_MASK 0x3UL
++#define PCIE_PHYMISC2_L0S_TH_SHIFT 18
++#define L2CB1_PCIE_PHYMISC2_L0S_TH 3
++#define PCIE_PHYMISC2_CDR_BW_MASK 0x3UL
++#define PCIE_PHYMISC2_CDR_BW_SHIFT 16
++#define L2CB1_PCIE_PHYMISC2_CDR_BW 3
+
+ #define REG_TWSI_DEBUG 0x1108
+-#define TWSI_DEBUG_DEV_EXIST 0x20000000
++#define TWSI_DEBUG_DEV_EXIST BIT(29)
++
++#define REG_DMA_DBG 0x1114
++#define DMA_DBG_VENDOR_MSG BIT(0)
+
+ #define REG_EEPROM_CTRL 0x12C0
+ #define EEPROM_CTRL_DATA_HI_MASK 0xFFFF
+@@ -140,56 +143,81 @@ int atl1c_phy_power_saving(struct atl1c_hw *hw);
+ #define REG_EEPROM_DATA_LO 0x12C4
+
+ #define REG_OTP_CTRL 0x12F0
+-#define OTP_CTRL_CLK_EN 0x0002
++#define OTP_CTRL_CLK_EN BIT(1)
+
+ #define REG_PM_CTRL 0x12F8
+-#define PM_CTRL_SDES_EN 0x00000001
+-#define PM_CTRL_RBER_EN 0x00000002
+-#define PM_CTRL_CLK_REQ_EN 0x00000004
+-#define PM_CTRL_ASPM_L1_EN 0x00000008
+-#define PM_CTRL_SERDES_L1_EN 0x00000010
+-#define PM_CTRL_SERDES_PLL_L1_EN 0x00000020
+-#define PM_CTRL_SERDES_PD_EX_L1 0x00000040
+-#define PM_CTRL_SERDES_BUDS_RX_L1_EN 0x00000080
+-#define PM_CTRL_L0S_ENTRY_TIMER_MASK 0xF
+-#define PM_CTRL_L0S_ENTRY_TIMER_SHIFT 8
+-#define PM_CTRL_ASPM_L0S_EN 0x00001000
+-#define PM_CTRL_CLK_SWH_L1 0x00002000
+-#define PM_CTRL_CLK_PWM_VER1_1 0x00004000
+-#define PM_CTRL_RCVR_WT_TIMER 0x00008000
+-#define PM_CTRL_L1_ENTRY_TIMER_MASK 0xF
+-#define PM_CTRL_L1_ENTRY_TIMER_SHIFT 16
+-#define PM_CTRL_PM_REQ_TIMER_MASK 0xF
+-#define PM_CTRL_PM_REQ_TIMER_SHIFT 20
+-#define PM_CTRL_LCKDET_TIMER_MASK 0xF
++#define PM_CTRL_HOTRST BIT(31)
++#define PM_CTRL_MAC_ASPM_CHK BIT(30) /* L0s/L1 dis by MAC based on
++ * thrghput(setting in 15A0) */
++#define PM_CTRL_SA_DLY_EN BIT(29)
++#define PM_CTRL_L0S_BUFSRX_EN BIT(28)
++#define PM_CTRL_LCKDET_TIMER_MASK 0xFUL
+ #define PM_CTRL_LCKDET_TIMER_SHIFT 24
+-#define PM_CTRL_EN_BUFS_RX_L0S 0x10000000
+-#define PM_CTRL_SA_DLY_EN 0x20000000
+-#define PM_CTRL_MAC_ASPM_CHK 0x40000000
+-#define PM_CTRL_HOTRST 0x80000000
++#define PM_CTRL_LCKDET_TIMER_DEF 0xC
++#define PM_CTRL_PM_REQ_TIMER_MASK 0xFUL
++#define PM_CTRL_PM_REQ_TIMER_SHIFT 20 /* pm_request_l1 time > @
++ * ->L0s not L1 */
++#define PM_CTRL_PM_REQ_TO_DEF 0xF
++#define PMCTRL_TXL1_AFTER_L0S BIT(19) /* l1dv2.0+ */
++#define L1D_PMCTRL_L1_ENTRY_TM_MASK 7UL /* l1dv2.0+, 3bits */
++#define L1D_PMCTRL_L1_ENTRY_TM_SHIFT 16
++#define L1D_PMCTRL_L1_ENTRY_TM_DIS 0
++#define L1D_PMCTRL_L1_ENTRY_TM_2US 1
++#define L1D_PMCTRL_L1_ENTRY_TM_4US 2
++#define L1D_PMCTRL_L1_ENTRY_TM_8US 3
++#define L1D_PMCTRL_L1_ENTRY_TM_16US 4
++#define L1D_PMCTRL_L1_ENTRY_TM_24US 5
++#define L1D_PMCTRL_L1_ENTRY_TM_32US 6
++#define L1D_PMCTRL_L1_ENTRY_TM_63US 7
++#define PM_CTRL_L1_ENTRY_TIMER_MASK 0xFUL /* l1C 4bits */
++#define PM_CTRL_L1_ENTRY_TIMER_SHIFT 16
++#define L2CB1_PM_CTRL_L1_ENTRY_TM 7
++#define L1C_PM_CTRL_L1_ENTRY_TM 0xF
++#define PM_CTRL_RCVR_WT_TIMER BIT(15) /* 1:1us, 0:2ms */
++#define PM_CTRL_CLK_PWM_VER1_1 BIT(14) /* 0:1.0a,1:1.1 */
++#define PM_CTRL_CLK_SWH_L1 BIT(13) /* en pcie clk sw in L1 */
++#define PM_CTRL_ASPM_L0S_EN BIT(12)
++#define PM_CTRL_RXL1_AFTER_L0S BIT(11) /* l1dv2.0+ */
++#define L1D_PMCTRL_L0S_TIMER_MASK 7UL /* l1d2.0+, 3bits*/
++#define L1D_PMCTRL_L0S_TIMER_SHIFT 8
++#define PM_CTRL_L0S_ENTRY_TIMER_MASK 0xFUL /* l1c, 4bits */
++#define PM_CTRL_L0S_ENTRY_TIMER_SHIFT 8
++#define PM_CTRL_SERDES_BUFS_RX_L1_EN BIT(7)
++#define PM_CTRL_SERDES_PD_EX_L1 BIT(6) /* power down serdes rx */
++#define PM_CTRL_SERDES_PLL_L1_EN BIT(5)
++#define PM_CTRL_SERDES_L1_EN BIT(4)
++#define PM_CTRL_ASPM_L1_EN BIT(3)
++#define PM_CTRL_CLK_REQ_EN BIT(2)
++#define PM_CTRL_RBER_EN BIT(1)
++#define PM_CTRL_SPRSDWER_EN BIT(0)
+
+ #define REG_LTSSM_ID_CTRL 0x12FC
+ #define LTSSM_ID_EN_WRO 0x1000
++
++
+ /* Selene Master Control Register */
+ #define REG_MASTER_CTRL 0x1400
+-#define MASTER_CTRL_SOFT_RST 0x1
+-#define MASTER_CTRL_TEST_MODE_MASK 0x3
+-#define MASTER_CTRL_TEST_MODE_SHIFT 2
+-#define MASTER_CTRL_BERT_START 0x10
+-#define MASTER_CTRL_OOB_DIS_OFF 0x40
+-#define MASTER_CTRL_SA_TIMER_EN 0x80
+-#define MASTER_CTRL_MTIMER_EN 0x100
+-#define MASTER_CTRL_MANUAL_INT 0x200
+-#define MASTER_CTRL_TX_ITIMER_EN 0x400
+-#define MASTER_CTRL_RX_ITIMER_EN 0x800
+-#define MASTER_CTRL_CLK_SEL_DIS 0x1000
+-#define MASTER_CTRL_CLK_SWH_MODE 0x2000
+-#define MASTER_CTRL_INT_RDCLR 0x4000
+-#define MASTER_CTRL_REV_NUM_SHIFT 16
+-#define MASTER_CTRL_REV_NUM_MASK 0xff
+-#define MASTER_CTRL_DEV_ID_SHIFT 24
+-#define MASTER_CTRL_DEV_ID_MASK 0x7f
+-#define MASTER_CTRL_OTP_SEL 0x80000000
++#define MASTER_CTRL_OTP_SEL BIT(31)
++#define MASTER_DEV_NUM_MASK 0x7FUL
++#define MASTER_DEV_NUM_SHIFT 24
++#define MASTER_REV_NUM_MASK 0xFFUL
++#define MASTER_REV_NUM_SHIFT 16
++#define MASTER_CTRL_INT_RDCLR BIT(14)
++#define MASTER_CTRL_CLK_SEL_DIS BIT(12) /* 1:alwys sel pclk from
++ * serdes, not sw to 25M */
++#define MASTER_CTRL_RX_ITIMER_EN BIT(11) /* IRQ MODURATION FOR RX */
++#define MASTER_CTRL_TX_ITIMER_EN BIT(10) /* MODURATION FOR TX/RX */
++#define MASTER_CTRL_MANU_INT BIT(9) /* SOFT MANUAL INT */
++#define MASTER_CTRL_MANUTIMER_EN BIT(8)
++#define MASTER_CTRL_SA_TIMER_EN BIT(7) /* SYS ALIVE TIMER EN */
++#define MASTER_CTRL_OOB_DIS BIT(6) /* OUT OF BOX DIS */
++#define MASTER_CTRL_WAKEN_25M BIT(5) /* WAKE WO. PCIE CLK */
++#define MASTER_CTRL_BERT_START BIT(4)
++#define MASTER_PCIE_TSTMOD_MASK 3UL
++#define MASTER_PCIE_TSTMOD_SHIFT 2
++#define MASTER_PCIE_RST BIT(1)
++#define MASTER_CTRL_SOFT_RST BIT(0) /* RST MAC & DMA */
++#define DMA_MAC_RST_TO 50
+
+ /* Timer Initial Value Register */
+ #define REG_MANUAL_TIMER_INIT 0x1404
+@@ -201,87 +229,85 @@ int atl1c_phy_power_saving(struct atl1c_hw *hw);
+ #define IRQ_MODRT_RX_TIMER_SHIFT 16
+
+ #define REG_GPHY_CTRL 0x140C
+-#define GPHY_CTRL_EXT_RESET 0x1
+-#define GPHY_CTRL_RTL_MODE 0x2
+-#define GPHY_CTRL_LED_MODE 0x4
+-#define GPHY_CTRL_ANEG_NOW 0x8
+-#define GPHY_CTRL_REV_ANEG 0x10
+-#define GPHY_CTRL_GATE_25M_EN 0x20
+-#define GPHY_CTRL_LPW_EXIT 0x40
+-#define GPHY_CTRL_PHY_IDDQ 0x80
+-#define GPHY_CTRL_PHY_IDDQ_DIS 0x100
+-#define GPHY_CTRL_GIGA_DIS 0x200
+-#define GPHY_CTRL_HIB_EN 0x400
+-#define GPHY_CTRL_HIB_PULSE 0x800
+-#define GPHY_CTRL_SEL_ANA_RST 0x1000
+-#define GPHY_CTRL_PHY_PLL_ON 0x2000
+-#define GPHY_CTRL_PWDOWN_HW 0x4000
+-#define GPHY_CTRL_PHY_PLL_BYPASS 0x8000
+-
+-#define GPHY_CTRL_DEFAULT ( \
+- GPHY_CTRL_SEL_ANA_RST |\
+- GPHY_CTRL_HIB_PULSE |\
+- GPHY_CTRL_HIB_EN)
+-
+-#define GPHY_CTRL_PW_WOL_DIS ( \
+- GPHY_CTRL_SEL_ANA_RST |\
+- GPHY_CTRL_HIB_PULSE |\
+- GPHY_CTRL_HIB_EN |\
+- GPHY_CTRL_PWDOWN_HW |\
+- GPHY_CTRL_PHY_IDDQ)
+-
+-#define GPHY_CTRL_POWER_SAVING ( \
+- GPHY_CTRL_SEL_ANA_RST |\
+- GPHY_CTRL_HIB_EN |\
+- GPHY_CTRL_HIB_PULSE |\
+- GPHY_CTRL_PWDOWN_HW |\
+- GPHY_CTRL_PHY_IDDQ)
++#define GPHY_CTRL_ADDR_MASK 0x1FUL
++#define GPHY_CTRL_ADDR_SHIFT 19
++#define GPHY_CTRL_BP_VLTGSW BIT(18)
++#define GPHY_CTRL_100AB_EN BIT(17)
++#define GPHY_CTRL_10AB_EN BIT(16)
++#define GPHY_CTRL_PHY_PLL_BYPASS BIT(15)
++#define GPHY_CTRL_PWDOWN_HW BIT(14) /* affect MAC&PHY, to low pw */
++#define GPHY_CTRL_PHY_PLL_ON BIT(13) /* 1:pll always on, 0:can sw */
++#define GPHY_CTRL_SEL_ANA_RST BIT(12)
++#define GPHY_CTRL_HIB_PULSE BIT(11)
++#define GPHY_CTRL_HIB_EN BIT(10)
++#define GPHY_CTRL_GIGA_DIS BIT(9)
++#define GPHY_CTRL_PHY_IDDQ_DIS BIT(8) /* pw on RST */
++#define GPHY_CTRL_PHY_IDDQ BIT(7) /* bit8 affect bit7 while rb */
++#define GPHY_CTRL_LPW_EXIT BIT(6)
++#define GPHY_CTRL_GATE_25M_EN BIT(5)
++#define GPHY_CTRL_REV_ANEG BIT(4)
++#define GPHY_CTRL_ANEG_NOW BIT(3)
++#define GPHY_CTRL_LED_MODE BIT(2)
++#define GPHY_CTRL_RTL_MODE BIT(1)
++#define GPHY_CTRL_EXT_RESET BIT(0) /* 1:out of DSP RST status */
++#define GPHY_CTRL_EXT_RST_TO 80 /* 800us atmost */
++#define GPHY_CTRL_CLS (\
++ GPHY_CTRL_LED_MODE |\
++ GPHY_CTRL_100AB_EN |\
++ GPHY_CTRL_PHY_PLL_ON)
++
+ /* Block IDLE Status Register */
+-#define REG_IDLE_STATUS 0x1410
+-#define IDLE_STATUS_MASK 0x00FF
+-#define IDLE_STATUS_RXMAC_NO_IDLE 0x1
+-#define IDLE_STATUS_TXMAC_NO_IDLE 0x2
+-#define IDLE_STATUS_RXQ_NO_IDLE 0x4
+-#define IDLE_STATUS_TXQ_NO_IDLE 0x8
+-#define IDLE_STATUS_DMAR_NO_IDLE 0x10
+-#define IDLE_STATUS_DMAW_NO_IDLE 0x20
+-#define IDLE_STATUS_SMB_NO_IDLE 0x40
+-#define IDLE_STATUS_CMB_NO_IDLE 0x80
++#define REG_IDLE_STATUS 0x1410
++#define IDLE_STATUS_SFORCE_MASK 0xFUL
++#define IDLE_STATUS_SFORCE_SHIFT 14
++#define IDLE_STATUS_CALIB_DONE BIT(13)
++#define IDLE_STATUS_CALIB_RES_MASK 0x1FUL
++#define IDLE_STATUS_CALIB_RES_SHIFT 8
++#define IDLE_STATUS_CALIBERR_MASK 0xFUL
++#define IDLE_STATUS_CALIBERR_SHIFT 4
++#define IDLE_STATUS_TXQ_BUSY BIT(3)
++#define IDLE_STATUS_RXQ_BUSY BIT(2)
++#define IDLE_STATUS_TXMAC_BUSY BIT(1)
++#define IDLE_STATUS_RXMAC_BUSY BIT(0)
++#define IDLE_STATUS_MASK (\
++ IDLE_STATUS_TXQ_BUSY |\
++ IDLE_STATUS_RXQ_BUSY |\
++ IDLE_STATUS_TXMAC_BUSY |\
++ IDLE_STATUS_RXMAC_BUSY)
+
+ /* MDIO Control Register */
+ #define REG_MDIO_CTRL 0x1414
+-#define MDIO_DATA_MASK 0xffff /* On MDIO write, the 16-bit
+- * control data to write to PHY
+- * MII management register */
+-#define MDIO_DATA_SHIFT 0 /* On MDIO read, the 16-bit
+- * status data that was read
+- * from the PHY MII management register */
+-#define MDIO_REG_ADDR_MASK 0x1f /* MDIO register address */
+-#define MDIO_REG_ADDR_SHIFT 16
+-#define MDIO_RW 0x200000 /* 1: read, 0: write */
+-#define MDIO_SUP_PREAMBLE 0x400000 /* Suppress preamble */
+-#define MDIO_START 0x800000 /* Write 1 to initiate the MDIO
+- * master. And this bit is self
+- * cleared after one cycle */
+-#define MDIO_CLK_SEL_SHIFT 24
+-#define MDIO_CLK_25_4 0
+-#define MDIO_CLK_25_6 2
+-#define MDIO_CLK_25_8 3
+-#define MDIO_CLK_25_10 4
+-#define MDIO_CLK_25_14 5
+-#define MDIO_CLK_25_20 6
+-#define MDIO_CLK_25_28 7
+-#define MDIO_BUSY 0x8000000
+-#define MDIO_AP_EN 0x10000000
+-#define MDIO_WAIT_TIMES 10
+-
+-/* MII PHY Status Register */
+-#define REG_PHY_STATUS 0x1418
+-#define PHY_GENERAL_STATUS_MASK 0xFFFF
+-#define PHY_STATUS_RECV_ENABLE 0x0001
+-#define PHY_OE_PWSP_STATUS_MASK 0x07FF
+-#define PHY_OE_PWSP_STATUS_SHIFT 16
+-#define PHY_STATUS_LPW_STATE 0x80000000
++#define MDIO_CTRL_MODE_EXT BIT(30)
++#define MDIO_CTRL_POST_READ BIT(29)
++#define MDIO_CTRL_AP_EN BIT(28)
++#define MDIO_CTRL_BUSY BIT(27)
++#define MDIO_CTRL_CLK_SEL_MASK 0x7UL
++#define MDIO_CTRL_CLK_SEL_SHIFT 24
++#define MDIO_CTRL_CLK_25_4 0 /* 25MHz divide 4 */
++#define MDIO_CTRL_CLK_25_6 2
++#define MDIO_CTRL_CLK_25_8 3
++#define MDIO_CTRL_CLK_25_10 4
++#define MDIO_CTRL_CLK_25_32 5
++#define MDIO_CTRL_CLK_25_64 6
++#define MDIO_CTRL_CLK_25_128 7
++#define MDIO_CTRL_START BIT(23)
++#define MDIO_CTRL_SPRES_PRMBL BIT(22)
++#define MDIO_CTRL_OP_READ BIT(21) /* 1:read, 0:write */
++#define MDIO_CTRL_REG_MASK 0x1FUL
++#define MDIO_CTRL_REG_SHIFT 16
++#define MDIO_CTRL_DATA_MASK 0xFFFFUL
++#define MDIO_CTRL_DATA_SHIFT 0
++#define MDIO_MAX_AC_TO 120 /* 1.2ms timeout for slow clk */
++
++/* for extension reg access */
++#define REG_MDIO_EXTN 0x1448
++#define MDIO_EXTN_PORTAD_MASK 0x1FUL
++#define MDIO_EXTN_PORTAD_SHIFT 21
++#define MDIO_EXTN_DEVAD_MASK 0x1FUL
++#define MDIO_EXTN_DEVAD_SHIFT 16
++#define MDIO_EXTN_REG_MASK 0xFFFFUL
++#define MDIO_EXTN_REG_SHIFT 0
++
+ /* BIST Control and Status Register0 (for the Packet Memory) */
+ #define REG_BIST0_CTRL 0x141c
+ #define BIST0_NOW 0x1
+@@ -299,50 +325,81 @@ int atl1c_phy_power_saving(struct atl1c_hw *hw);
+ #define BIST1_FUSE_FLAG 0x4
+
+ /* SerDes Lock Detect Control and Status Register */
+-#define REG_SERDES_LOCK 0x1424
+-#define SERDES_LOCK_DETECT 0x1 /* SerDes lock detected. This signal
+- * comes from Analog SerDes */
+-#define SERDES_LOCK_DETECT_EN 0x2 /* 1: Enable SerDes Lock detect function */
+-#define SERDES_LOCK_STS_SELFB_PLL_SHIFT 0xE
+-#define SERDES_LOCK_STS_SELFB_PLL_MASK 0x3
+-#define SERDES_OVCLK_18_25 0x0
+-#define SERDES_OVCLK_12_18 0x1
+-#define SERDES_OVCLK_0_4 0x2
+-#define SERDES_OVCLK_4_12 0x3
+-#define SERDES_MAC_CLK_SLOWDOWN 0x20000
+-#define SERDES_PYH_CLK_SLOWDOWN 0x40000
++#define REG_SERDES 0x1424
++#define SERDES_PHY_CLK_SLOWDOWN BIT(18)
++#define SERDES_MAC_CLK_SLOWDOWN BIT(17)
++#define SERDES_SELFB_PLL_MASK 0x3UL
++#define SERDES_SELFB_PLL_SHIFT 14
++#define SERDES_PHYCLK_SEL_GTX BIT(13) /* 1:gtx_clk, 0:25M */
++#define SERDES_PCIECLK_SEL_SRDS BIT(12) /* 1:serdes,0:25M */
++#define SERDES_BUFS_RX_EN BIT(11)
++#define SERDES_PD_RX BIT(10)
++#define SERDES_PLL_EN BIT(9)
++#define SERDES_EN BIT(8)
++#define SERDES_SELFB_PLL_SEL_CSR BIT(6) /* 0:state-machine,1:csr */
++#define SERDES_SELFB_PLL_CSR_MASK 0x3UL
++#define SERDES_SELFB_PLL_CSR_SHIFT 4
++#define SERDES_SELFB_PLL_CSR_4 3 /* 4-12% OV-CLK */
++#define SERDES_SELFB_PLL_CSR_0 2 /* 0-4% OV-CLK */
++#define SERDES_SELFB_PLL_CSR_12 1 /* 12-18% OV-CLK */
++#define SERDES_SELFB_PLL_CSR_18 0 /* 18-25% OV-CLK */
++#define SERDES_VCO_SLOW BIT(3)
++#define SERDES_VCO_FAST BIT(2)
++#define SERDES_LOCK_DETECT_EN BIT(1)
++#define SERDES_LOCK_DETECT BIT(0)
++
++#define REG_LPI_DECISN_TIMER 0x143C
++#define L2CB_LPI_DESISN_TIMER 0x7D00
++
++#define REG_LPI_CTRL 0x1440
++#define LPI_CTRL_CHK_DA BIT(31)
++#define LPI_CTRL_ENH_TO_MASK 0x1FFFUL
++#define LPI_CTRL_ENH_TO_SHIFT 12
++#define LPI_CTRL_ENH_TH_MASK 0x1FUL
++#define LPI_CTRL_ENH_TH_SHIFT 6
++#define LPI_CTRL_ENH_EN BIT(5)
++#define LPI_CTRL_CHK_RX BIT(4)
++#define LPI_CTRL_CHK_STATE BIT(3)
++#define LPI_CTRL_GMII BIT(2)
++#define LPI_CTRL_TO_PHY BIT(1)
++#define LPI_CTRL_EN BIT(0)
++
++#define REG_LPI_WAIT 0x1444
++#define LPI_WAIT_TIMER_MASK 0xFFFFUL
++#define LPI_WAIT_TIMER_SHIFT 0
+
+ /* MAC Control Register */
+ #define REG_MAC_CTRL 0x1480
+-#define MAC_CTRL_TX_EN 0x1
+-#define MAC_CTRL_RX_EN 0x2
+-#define MAC_CTRL_TX_FLOW 0x4
+-#define MAC_CTRL_RX_FLOW 0x8
+-#define MAC_CTRL_LOOPBACK 0x10
+-#define MAC_CTRL_DUPLX 0x20
+-#define MAC_CTRL_ADD_CRC 0x40
+-#define MAC_CTRL_PAD 0x80
+-#define MAC_CTRL_LENCHK 0x100
+-#define MAC_CTRL_HUGE_EN 0x200
+-#define MAC_CTRL_PRMLEN_SHIFT 10
+-#define MAC_CTRL_PRMLEN_MASK 0xf
+-#define MAC_CTRL_RMV_VLAN 0x4000
+-#define MAC_CTRL_PROMIS_EN 0x8000
+-#define MAC_CTRL_TX_PAUSE 0x10000
+-#define MAC_CTRL_SCNT 0x20000
+-#define MAC_CTRL_SRST_TX 0x40000
+-#define MAC_CTRL_TX_SIMURST 0x80000
+-#define MAC_CTRL_SPEED_SHIFT 20
+-#define MAC_CTRL_SPEED_MASK 0x3
+-#define MAC_CTRL_DBG_TX_BKPRESURE 0x400000
+-#define MAC_CTRL_TX_HUGE 0x800000
+-#define MAC_CTRL_RX_CHKSUM_EN 0x1000000
+-#define MAC_CTRL_MC_ALL_EN 0x2000000
+-#define MAC_CTRL_BC_EN 0x4000000
+-#define MAC_CTRL_DBG 0x8000000
+-#define MAC_CTRL_SINGLE_PAUSE_EN 0x10000000
+-#define MAC_CTRL_HASH_ALG_CRC32 0x20000000
+-#define MAC_CTRL_SPEED_MODE_SW 0x40000000
++#define MAC_CTRL_SPEED_MODE_SW BIT(30) /* 0:phy,1:sw */
++#define MAC_CTRL_HASH_ALG_CRC32 BIT(29) /* 1:legacy,0:lw_5b */
++#define MAC_CTRL_SINGLE_PAUSE_EN BIT(28)
++#define MAC_CTRL_DBG BIT(27)
++#define MAC_CTRL_BC_EN BIT(26)
++#define MAC_CTRL_MC_ALL_EN BIT(25)
++#define MAC_CTRL_RX_CHKSUM_EN BIT(24)
++#define MAC_CTRL_TX_HUGE BIT(23)
++#define MAC_CTRL_DBG_TX_BKPRESURE BIT(22)
++#define MAC_CTRL_SPEED_MASK 3UL
++#define MAC_CTRL_SPEED_SHIFT 20
++#define MAC_CTRL_SPEED_10_100 1
++#define MAC_CTRL_SPEED_1000 2
++#define MAC_CTRL_TX_SIMURST BIT(19)
++#define MAC_CTRL_SCNT BIT(17)
++#define MAC_CTRL_TX_PAUSE BIT(16)
++#define MAC_CTRL_PROMIS_EN BIT(15)
++#define MAC_CTRL_RMV_VLAN BIT(14)
++#define MAC_CTRL_PRMLEN_MASK 0xFUL
++#define MAC_CTRL_PRMLEN_SHIFT 10
++#define MAC_CTRL_HUGE_EN BIT(9)
++#define MAC_CTRL_LENCHK BIT(8)
++#define MAC_CTRL_PAD BIT(7)
++#define MAC_CTRL_ADD_CRC BIT(6)
++#define MAC_CTRL_DUPLX BIT(5)
++#define MAC_CTRL_LOOPBACK BIT(4)
++#define MAC_CTRL_RX_FLOW BIT(3)
++#define MAC_CTRL_TX_FLOW BIT(2)
++#define MAC_CTRL_RX_EN BIT(1)
++#define MAC_CTRL_TX_EN BIT(0)
+
+ /* MAC IPG/IFG Control Register */
+ #define REG_MAC_IPG_IFG 0x1484
+@@ -386,34 +443,53 @@ int atl1c_phy_power_saving(struct atl1c_hw *hw);
+
+ /* Wake-On-Lan control register */
+ #define REG_WOL_CTRL 0x14a0
+-#define WOL_PATTERN_EN 0x00000001
+-#define WOL_PATTERN_PME_EN 0x00000002
+-#define WOL_MAGIC_EN 0x00000004
+-#define WOL_MAGIC_PME_EN 0x00000008
+-#define WOL_LINK_CHG_EN 0x00000010
+-#define WOL_LINK_CHG_PME_EN 0x00000020
+-#define WOL_PATTERN_ST 0x00000100
+-#define WOL_MAGIC_ST 0x00000200
+-#define WOL_LINKCHG_ST 0x00000400
+-#define WOL_CLK_SWITCH_EN 0x00008000
+-#define WOL_PT0_EN 0x00010000
+-#define WOL_PT1_EN 0x00020000
+-#define WOL_PT2_EN 0x00040000
+-#define WOL_PT3_EN 0x00080000
+-#define WOL_PT4_EN 0x00100000
+-#define WOL_PT5_EN 0x00200000
+-#define WOL_PT6_EN 0x00400000
++#define WOL_PT7_MATCH BIT(31)
++#define WOL_PT6_MATCH BIT(30)
++#define WOL_PT5_MATCH BIT(29)
++#define WOL_PT4_MATCH BIT(28)
++#define WOL_PT3_MATCH BIT(27)
++#define WOL_PT2_MATCH BIT(26)
++#define WOL_PT1_MATCH BIT(25)
++#define WOL_PT0_MATCH BIT(24)
++#define WOL_PT7_EN BIT(23)
++#define WOL_PT6_EN BIT(22)
++#define WOL_PT5_EN BIT(21)
++#define WOL_PT4_EN BIT(20)
++#define WOL_PT3_EN BIT(19)
++#define WOL_PT2_EN BIT(18)
++#define WOL_PT1_EN BIT(17)
++#define WOL_PT0_EN BIT(16)
++#define WOL_LNKCHG_ST BIT(10)
++#define WOL_MAGIC_ST BIT(9)
++#define WOL_PATTERN_ST BIT(8)
++#define WOL_OOB_EN BIT(6)
++#define WOL_LINK_CHG_PME_EN BIT(5)
++#define WOL_LINK_CHG_EN BIT(4)
++#define WOL_MAGIC_PME_EN BIT(3)
++#define WOL_MAGIC_EN BIT(2)
++#define WOL_PATTERN_PME_EN BIT(1)
++#define WOL_PATTERN_EN BIT(0)
+
+ /* WOL Length ( 2 DWORD ) */
+-#define REG_WOL_PATTERN_LEN 0x14a4
+-#define WOL_PT_LEN_MASK 0x7f
+-#define WOL_PT0_LEN_SHIFT 0
+-#define WOL_PT1_LEN_SHIFT 8
+-#define WOL_PT2_LEN_SHIFT 16
+-#define WOL_PT3_LEN_SHIFT 24
+-#define WOL_PT4_LEN_SHIFT 0
+-#define WOL_PT5_LEN_SHIFT 8
+-#define WOL_PT6_LEN_SHIFT 16
++#define REG_WOL_PTLEN1 0x14A4
++#define WOL_PTLEN1_3_MASK 0xFFUL
++#define WOL_PTLEN1_3_SHIFT 24
++#define WOL_PTLEN1_2_MASK 0xFFUL
++#define WOL_PTLEN1_2_SHIFT 16
++#define WOL_PTLEN1_1_MASK 0xFFUL
++#define WOL_PTLEN1_1_SHIFT 8
++#define WOL_PTLEN1_0_MASK 0xFFUL
++#define WOL_PTLEN1_0_SHIFT 0
++
++#define REG_WOL_PTLEN2 0x14A8
++#define WOL_PTLEN2_7_MASK 0xFFUL
++#define WOL_PTLEN2_7_SHIFT 24
++#define WOL_PTLEN2_6_MASK 0xFFUL
++#define WOL_PTLEN2_6_SHIFT 16
++#define WOL_PTLEN2_5_MASK 0xFFUL
++#define WOL_PTLEN2_5_SHIFT 8
++#define WOL_PTLEN2_4_MASK 0xFFUL
++#define WOL_PTLEN2_4_SHIFT 0
+
+ /* Internal SRAM Partition Register */
+ #define RFDX_HEAD_ADDR_MASK 0x03FF
+@@ -458,66 +534,50 @@ int atl1c_phy_power_saving(struct atl1c_hw *hw);
+ */
+ #define REG_RX_BASE_ADDR_HI 0x1540
+ #define REG_TX_BASE_ADDR_HI 0x1544
+-#define REG_SMB_BASE_ADDR_HI 0x1548
+-#define REG_SMB_BASE_ADDR_LO 0x154C
+ #define REG_RFD0_HEAD_ADDR_LO 0x1550
+-#define REG_RFD1_HEAD_ADDR_LO 0x1554
+-#define REG_RFD2_HEAD_ADDR_LO 0x1558
+-#define REG_RFD3_HEAD_ADDR_LO 0x155C
+ #define REG_RFD_RING_SIZE 0x1560
+ #define RFD_RING_SIZE_MASK 0x0FFF
+ #define REG_RX_BUF_SIZE 0x1564
+ #define RX_BUF_SIZE_MASK 0xFFFF
+ #define REG_RRD0_HEAD_ADDR_LO 0x1568
+-#define REG_RRD1_HEAD_ADDR_LO 0x156C
+-#define REG_RRD2_HEAD_ADDR_LO 0x1570
+-#define REG_RRD3_HEAD_ADDR_LO 0x1574
+ #define REG_RRD_RING_SIZE 0x1578
+ #define RRD_RING_SIZE_MASK 0x0FFF
+-#define REG_HTPD_HEAD_ADDR_LO 0x157C
+-#define REG_NTPD_HEAD_ADDR_LO 0x1580
++#define REG_TPD_PRI1_ADDR_LO 0x157C
++#define REG_TPD_PRI0_ADDR_LO 0x1580
+ #define REG_TPD_RING_SIZE 0x1584
+ #define TPD_RING_SIZE_MASK 0xFFFF
+-#define REG_CMB_BASE_ADDR_LO 0x1588
+-
+-/* RSS about */
+-#define REG_RSS_KEY0 0x14B0
+-#define REG_RSS_KEY1 0x14B4
+-#define REG_RSS_KEY2 0x14B8
+-#define REG_RSS_KEY3 0x14BC
+-#define REG_RSS_KEY4 0x14C0
+-#define REG_RSS_KEY5 0x14C4
+-#define REG_RSS_KEY6 0x14C8
+-#define REG_RSS_KEY7 0x14CC
+-#define REG_RSS_KEY8 0x14D0
+-#define REG_RSS_KEY9 0x14D4
+-#define REG_IDT_TABLE0 0x14E0
+-#define REG_IDT_TABLE1 0x14E4
+-#define REG_IDT_TABLE2 0x14E8
+-#define REG_IDT_TABLE3 0x14EC
+-#define REG_IDT_TABLE4 0x14F0
+-#define REG_IDT_TABLE5 0x14F4
+-#define REG_IDT_TABLE6 0x14F8
+-#define REG_IDT_TABLE7 0x14FC
+-#define REG_IDT_TABLE REG_IDT_TABLE0
+-#define REG_RSS_HASH_VALUE 0x15B0
+-#define REG_RSS_HASH_FLAG 0x15B4
+-#define REG_BASE_CPU_NUMBER 0x15B8
+
+ /* TXQ Control Register */
+-#define REG_TXQ_CTRL 0x1590
+-#define TXQ_NUM_TPD_BURST_MASK 0xF
+-#define TXQ_NUM_TPD_BURST_SHIFT 0
+-#define TXQ_CTRL_IP_OPTION_EN 0x10
+-#define TXQ_CTRL_EN 0x20
+-#define TXQ_CTRL_ENH_MODE 0x40
+-#define TXQ_CTRL_LS_8023_EN 0x80
+-#define TXQ_TXF_BURST_NUM_SHIFT 16
+-#define TXQ_TXF_BURST_NUM_MASK 0xFFFF
++#define REG_TXQ_CTRL 0x1590
++#define TXQ_TXF_BURST_NUM_MASK 0xFFFFUL
++#define TXQ_TXF_BURST_NUM_SHIFT 16
++#define L1C_TXQ_TXF_BURST_PREF 0x200
++#define L2CB_TXQ_TXF_BURST_PREF 0x40
++#define TXQ_CTRL_PEDING_CLR BIT(8)
++#define TXQ_CTRL_LS_8023_EN BIT(7)
++#define TXQ_CTRL_ENH_MODE BIT(6)
++#define TXQ_CTRL_EN BIT(5)
++#define TXQ_CTRL_IP_OPTION_EN BIT(4)
++#define TXQ_NUM_TPD_BURST_MASK 0xFUL
++#define TXQ_NUM_TPD_BURST_SHIFT 0
++#define TXQ_NUM_TPD_BURST_DEF 5
++#define TXQ_CFGV (\
++ FIELDX(TXQ_NUM_TPD_BURST, TXQ_NUM_TPD_BURST_DEF) |\
++ TXQ_CTRL_ENH_MODE |\
++ TXQ_CTRL_LS_8023_EN |\
++ TXQ_CTRL_IP_OPTION_EN)
++#define L1C_TXQ_CFGV (\
++ TXQ_CFGV |\
++ FIELDX(TXQ_TXF_BURST_NUM, L1C_TXQ_TXF_BURST_PREF))
++#define L2CB_TXQ_CFGV (\
++ TXQ_CFGV |\
++ FIELDX(TXQ_TXF_BURST_NUM, L2CB_TXQ_TXF_BURST_PREF))
++
+
+ /* Jumbo packet Threshold for task offload */
+ #define REG_TX_TSO_OFFLOAD_THRESH 0x1594 /* In 8-bytes */
+ #define TX_TSO_OFFLOAD_THRESH_MASK 0x07FF
++#define MAX_TSO_FRAME_SIZE (7*1024)
+
+ #define REG_TXF_WATER_MARK 0x1598 /* In 8-bytes */
+ #define TXF_WATER_MARK_MASK 0x0FFF
+@@ -537,26 +597,21 @@ int atl1c_phy_power_saving(struct atl1c_hw *hw);
+ #define ASPM_THRUPUT_LIMIT_NO 0x00
+ #define ASPM_THRUPUT_LIMIT_1M 0x01
+ #define ASPM_THRUPUT_LIMIT_10M 0x02
+-#define ASPM_THRUPUT_LIMIT_100M 0x04
+-#define RXQ1_CTRL_EN 0x10
+-#define RXQ2_CTRL_EN 0x20
+-#define RXQ3_CTRL_EN 0x40
+-#define IPV6_CHKSUM_CTRL_EN 0x80
+-#define RSS_HASH_BITS_MASK 0x00FF
+-#define RSS_HASH_BITS_SHIFT 8
+-#define RSS_HASH_IPV4 0x10000
+-#define RSS_HASH_IPV4_TCP 0x20000
+-#define RSS_HASH_IPV6 0x40000
+-#define RSS_HASH_IPV6_TCP 0x80000
++#define ASPM_THRUPUT_LIMIT_100M 0x03
++#define IPV6_CHKSUM_CTRL_EN BIT(7)
+ #define RXQ_RFD_BURST_NUM_MASK 0x003F
+ #define RXQ_RFD_BURST_NUM_SHIFT 20
+-#define RSS_MODE_MASK 0x0003
++#define RXQ_NUM_RFD_PREF_DEF 8
++#define RSS_MODE_MASK 3UL
+ #define RSS_MODE_SHIFT 26
+-#define RSS_NIP_QUEUE_SEL_MASK 0x1
+-#define RSS_NIP_QUEUE_SEL_SHIFT 28
+-#define RRS_HASH_CTRL_EN 0x20000000
+-#define RX_CUT_THRU_EN 0x40000000
+-#define RXQ_CTRL_EN 0x80000000
++#define RSS_MODE_DIS 0
++#define RSS_MODE_SQSI 1
++#define RSS_MODE_MQSI 2
++#define RSS_MODE_MQMI 3
++#define RSS_NIP_QUEUE_SEL BIT(28) /* 0:q0, 1:table */
++#define RRS_HASH_CTRL_EN BIT(29)
++#define RX_CUT_THRU_EN BIT(30)
++#define RXQ_CTRL_EN BIT(31)
+
+ #define REG_RFD_FREE_THRESH 0x15A4
+ #define RFD_FREE_THRESH_MASK 0x003F
+@@ -577,57 +632,45 @@ int atl1c_phy_power_saving(struct atl1c_hw *hw);
+ #define RXD_DMA_DOWN_TIMER_SHIFT 16
+
+ /* DMA Engine Control Register */
+-#define REG_DMA_CTRL 0x15C0
+-#define DMA_CTRL_DMAR_IN_ORDER 0x1
+-#define DMA_CTRL_DMAR_ENH_ORDER 0x2
+-#define DMA_CTRL_DMAR_OUT_ORDER 0x4
+-#define DMA_CTRL_RCB_VALUE 0x8
+-#define DMA_CTRL_DMAR_BURST_LEN_MASK 0x0007
+-#define DMA_CTRL_DMAR_BURST_LEN_SHIFT 4
+-#define DMA_CTRL_DMAW_BURST_LEN_MASK 0x0007
+-#define DMA_CTRL_DMAW_BURST_LEN_SHIFT 7
+-#define DMA_CTRL_DMAR_REQ_PRI 0x400
+-#define DMA_CTRL_DMAR_DLY_CNT_MASK 0x001F
+-#define DMA_CTRL_DMAR_DLY_CNT_SHIFT 11
+-#define DMA_CTRL_DMAW_DLY_CNT_MASK 0x000F
+-#define DMA_CTRL_DMAW_DLY_CNT_SHIFT 16
+-#define DMA_CTRL_CMB_EN 0x100000
+-#define DMA_CTRL_SMB_EN 0x200000
+-#define DMA_CTRL_CMB_NOW 0x400000
+-#define MAC_CTRL_SMB_DIS 0x1000000
+-#define DMA_CTRL_SMB_NOW 0x80000000
+-
+-/* CMB/SMB Control Register */
++#define REG_DMA_CTRL 0x15C0
++#define DMA_CTRL_SMB_NOW BIT(31)
++#define DMA_CTRL_WPEND_CLR BIT(30)
++#define DMA_CTRL_RPEND_CLR BIT(29)
++#define DMA_CTRL_WDLY_CNT_MASK 0xFUL
++#define DMA_CTRL_WDLY_CNT_SHIFT 16
++#define DMA_CTRL_WDLY_CNT_DEF 4
++#define DMA_CTRL_RDLY_CNT_MASK 0x1FUL
++#define DMA_CTRL_RDLY_CNT_SHIFT 11
++#define DMA_CTRL_RDLY_CNT_DEF 15
++#define DMA_CTRL_RREQ_PRI_DATA BIT(10) /* 0:tpd, 1:data */
++#define DMA_CTRL_WREQ_BLEN_MASK 7UL
++#define DMA_CTRL_WREQ_BLEN_SHIFT 7
++#define DMA_CTRL_RREQ_BLEN_MASK 7UL
++#define DMA_CTRL_RREQ_BLEN_SHIFT 4
++#define L1C_CTRL_DMA_RCB_LEN128 BIT(3) /* 0:64bytes,1:128bytes */
++#define DMA_CTRL_RORDER_MODE_MASK 7UL
++#define DMA_CTRL_RORDER_MODE_SHIFT 0
++#define DMA_CTRL_RORDER_MODE_OUT 4
++#define DMA_CTRL_RORDER_MODE_ENHANCE 2
++#define DMA_CTRL_RORDER_MODE_IN 1
++
++/* INT-triggle/SMB Control Register */
+ #define REG_SMB_STAT_TIMER 0x15C4 /* 2us resolution */
+ #define SMB_STAT_TIMER_MASK 0xFFFFFF
+-#define REG_CMB_TPD_THRESH 0x15C8
+-#define CMB_TPD_THRESH_MASK 0xFFFF
+-#define REG_CMB_TX_TIMER 0x15CC /* 2us resolution */
+-#define CMB_TX_TIMER_MASK 0xFFFF
++#define REG_TINT_TPD_THRESH 0x15C8 /* tpd th to trig intrrupt */
+
+ /* Mail box */
+ #define MB_RFDX_PROD_IDX_MASK 0xFFFF
+ #define REG_MB_RFD0_PROD_IDX 0x15E0
+-#define REG_MB_RFD1_PROD_IDX 0x15E4
+-#define REG_MB_RFD2_PROD_IDX 0x15E8
+-#define REG_MB_RFD3_PROD_IDX 0x15EC
+
+-#define MB_PRIO_PROD_IDX_MASK 0xFFFF
+-#define REG_MB_PRIO_PROD_IDX 0x15F0
+-#define MB_HTPD_PROD_IDX_SHIFT 0
+-#define MB_NTPD_PROD_IDX_SHIFT 16
+-
+-#define MB_PRIO_CONS_IDX_MASK 0xFFFF
+-#define REG_MB_PRIO_CONS_IDX 0x15F4
+-#define MB_HTPD_CONS_IDX_SHIFT 0
+-#define MB_NTPD_CONS_IDX_SHIFT 16
++#define REG_TPD_PRI1_PIDX 0x15F0 /* 16bit,hi-tpd producer idx */
++#define REG_TPD_PRI0_PIDX 0x15F2 /* 16bit,lo-tpd producer idx */
++#define REG_TPD_PRI1_CIDX 0x15F4 /* 16bit,hi-tpd consumer idx */
++#define REG_TPD_PRI0_CIDX 0x15F6 /* 16bit,lo-tpd consumer idx */
+
+ #define REG_MB_RFD01_CONS_IDX 0x15F8
+ #define MB_RFD0_CONS_IDX_MASK 0x0000FFFF
+ #define MB_RFD1_CONS_IDX_MASK 0xFFFF0000
+-#define REG_MB_RFD23_CONS_IDX 0x15FC
+-#define MB_RFD2_CONS_IDX_MASK 0x0000FFFF
+-#define MB_RFD3_CONS_IDX_MASK 0xFFFF0000
+
+ /* Interrupt Status Register */
+ #define REG_ISR 0x1600
+@@ -705,13 +748,6 @@ int atl1c_phy_power_saving(struct atl1c_hw *hw);
+ #define REG_INT_RETRIG_TIMER 0x1608
+ #define INT_RETRIG_TIMER_MASK 0xFFFF
+
+-#define REG_HDS_CTRL 0x160C
+-#define HDS_CTRL_EN 0x0001
+-#define HDS_CTRL_BACKFILLSIZE_SHIFT 8
+-#define HDS_CTRL_BACKFILLSIZE_MASK 0x0FFF
+-#define HDS_CTRL_MAX_HDRSIZE_SHIFT 20
+-#define HDS_CTRL_MAC_HDRSIZE_MASK 0x0FFF
+-
+ #define REG_MAC_RX_STATUS_BIN 0x1700
+ #define REG_MAC_RX_STATUS_END 0x175c
+ #define REG_MAC_TX_STATUS_BIN 0x1760
+@@ -796,73 +832,188 @@ int atl1c_phy_power_saving(struct atl1c_hw *hw);
+ #define MII_DBG_ADDR 0x1D
+ #define MII_DBG_DATA 0x1E
+
+-#define MII_ANA_CTRL_0 0x0
+-#define ANA_RESTART_CAL 0x0001
+-#define ANA_MANUL_SWICH_ON_SHIFT 0x1
+-#define ANA_MANUL_SWICH_ON_MASK 0xF
+-#define ANA_MAN_ENABLE 0x0020
+-#define ANA_SEL_HSP 0x0040
+-#define ANA_EN_HB 0x0080
+-#define ANA_EN_HBIAS 0x0100
+-#define ANA_OEN_125M 0x0200
+-#define ANA_EN_LCKDT 0x0400
+-#define ANA_LCKDT_PHY 0x0800
+-#define ANA_AFE_MODE 0x1000
+-#define ANA_VCO_SLOW 0x2000
+-#define ANA_VCO_FAST 0x4000
+-#define ANA_SEL_CLK125M_DSP 0x8000
+-
+-#define MII_ANA_CTRL_4 0x4
+-#define ANA_IECHO_ADJ_MASK 0xF
+-#define ANA_IECHO_ADJ_3_SHIFT 0
+-#define ANA_IECHO_ADJ_2_SHIFT 4
+-#define ANA_IECHO_ADJ_1_SHIFT 8
+-#define ANA_IECHO_ADJ_0_SHIFT 12
+-
+-#define MII_ANA_CTRL_5 0x5
+-#define ANA_SERDES_CDR_BW_SHIFT 0
+-#define ANA_SERDES_CDR_BW_MASK 0x3
+-#define ANA_MS_PAD_DBG 0x0004
+-#define ANA_SPEEDUP_DBG 0x0008
+-#define ANA_SERDES_TH_LOS_SHIFT 4
+-#define ANA_SERDES_TH_LOS_MASK 0x3
+-#define ANA_SERDES_EN_DEEM 0x0040
+-#define ANA_SERDES_TXELECIDLE 0x0080
+-#define ANA_SERDES_BEACON 0x0100
+-#define ANA_SERDES_HALFTXDR 0x0200
+-#define ANA_SERDES_SEL_HSP 0x0400
+-#define ANA_SERDES_EN_PLL 0x0800
+-#define ANA_SERDES_EN 0x1000
+-#define ANA_SERDES_EN_LCKDT 0x2000
+-
+-#define MII_ANA_CTRL_11 0xB
+-#define ANA_PS_HIB_EN 0x8000
+-
+-#define MII_ANA_CTRL_18 0x12
+-#define ANA_TEST_MODE_10BT_01SHIFT 0
+-#define ANA_TEST_MODE_10BT_01MASK 0x3
+-#define ANA_LOOP_SEL_10BT 0x0004
+-#define ANA_RGMII_MODE_SW 0x0008
+-#define ANA_EN_LONGECABLE 0x0010
+-#define ANA_TEST_MODE_10BT_2 0x0020
+-#define ANA_EN_10BT_IDLE 0x0400
+-#define ANA_EN_MASK_TB 0x0800
+-#define ANA_TRIGGER_SEL_TIMER_SHIFT 12
+-#define ANA_TRIGGER_SEL_TIMER_MASK 0x3
+-#define ANA_INTERVAL_SEL_TIMER_SHIFT 14
+-#define ANA_INTERVAL_SEL_TIMER_MASK 0x3
+-
+-#define MII_ANA_CTRL_41 0x29
+-#define ANA_TOP_PS_EN 0x8000
+-
+-#define MII_ANA_CTRL_54 0x36
+-#define ANA_LONG_CABLE_TH_100_SHIFT 0
+-#define ANA_LONG_CABLE_TH_100_MASK 0x3F
+-#define ANA_DESERVED 0x0040
+-#define ANA_EN_LIT_CH 0x0080
+-#define ANA_SHORT_CABLE_TH_100_SHIFT 8
+-#define ANA_SHORT_CABLE_TH_100_MASK 0x3F
+-#define ANA_BP_BAD_LINK_ACCUM 0x4000
+-#define ANA_BP_SMALL_BW 0x8000
++/***************************** debug port *************************************/
++
++#define MIIDBG_ANACTRL 0x00
++#define ANACTRL_CLK125M_DELAY_EN 0x8000
++#define ANACTRL_VCO_FAST 0x4000
++#define ANACTRL_VCO_SLOW 0x2000
++#define ANACTRL_AFE_MODE_EN 0x1000
++#define ANACTRL_LCKDET_PHY 0x800
++#define ANACTRL_LCKDET_EN 0x400
++#define ANACTRL_OEN_125M 0x200
++#define ANACTRL_HBIAS_EN 0x100
++#define ANACTRL_HB_EN 0x80
++#define ANACTRL_SEL_HSP 0x40
++#define ANACTRL_CLASSA_EN 0x20
++#define ANACTRL_MANUSWON_SWR_MASK 3U
++#define ANACTRL_MANUSWON_SWR_SHIFT 2
++#define ANACTRL_MANUSWON_SWR_2V 0
++#define ANACTRL_MANUSWON_SWR_1P9V 1
++#define ANACTRL_MANUSWON_SWR_1P8V 2
++#define ANACTRL_MANUSWON_SWR_1P7V 3
++#define ANACTRL_MANUSWON_BW3_4M 0x2
++#define ANACTRL_RESTART_CAL 0x1
++#define ANACTRL_DEF 0x02EF
++
++#define MIIDBG_SYSMODCTRL 0x04
++#define SYSMODCTRL_IECHOADJ_PFMH_PHY 0x8000
++#define SYSMODCTRL_IECHOADJ_BIASGEN 0x4000
++#define SYSMODCTRL_IECHOADJ_PFML_PHY 0x2000
++#define SYSMODCTRL_IECHOADJ_PS_MASK 3U
++#define SYSMODCTRL_IECHOADJ_PS_SHIFT 10
++#define SYSMODCTRL_IECHOADJ_PS_40 3
++#define SYSMODCTRL_IECHOADJ_PS_20 2
++#define SYSMODCTRL_IECHOADJ_PS_0 1
++#define SYSMODCTRL_IECHOADJ_10BT_100MV 0x40 /* 1:100mv, 0:200mv */
++#define SYSMODCTRL_IECHOADJ_HLFAP_MASK 3U
++#define SYSMODCTRL_IECHOADJ_HLFAP_SHIFT 4
++#define SYSMODCTRL_IECHOADJ_VDFULBW 0x8
++#define SYSMODCTRL_IECHOADJ_VDBIASHLF 0x4
++#define SYSMODCTRL_IECHOADJ_VDAMPHLF 0x2
++#define SYSMODCTRL_IECHOADJ_VDLANSW 0x1
++#define SYSMODCTRL_IECHOADJ_DEF 0x88BB /* ???? */
++
++/* for l1d & l2cb */
++#define SYSMODCTRL_IECHOADJ_CUR_ADD 0x8000
++#define SYSMODCTRL_IECHOADJ_CUR_MASK 7U
++#define SYSMODCTRL_IECHOADJ_CUR_SHIFT 12
++#define SYSMODCTRL_IECHOADJ_VOL_MASK 0xFU
++#define SYSMODCTRL_IECHOADJ_VOL_SHIFT 8
++#define SYSMODCTRL_IECHOADJ_VOL_17ALL 3
++#define SYSMODCTRL_IECHOADJ_VOL_100M15 1
++#define SYSMODCTRL_IECHOADJ_VOL_10M17 0
++#define SYSMODCTRL_IECHOADJ_BIAS1_MASK 0xFU
++#define SYSMODCTRL_IECHOADJ_BIAS1_SHIFT 4
++#define SYSMODCTRL_IECHOADJ_BIAS2_MASK 0xFU
++#define SYSMODCTRL_IECHOADJ_BIAS2_SHIFT 0
++#define L1D_SYSMODCTRL_IECHOADJ_DEF 0x4FBB
++
++#define MIIDBG_SRDSYSMOD 0x05
++#define SRDSYSMOD_LCKDET_EN 0x2000
++#define SRDSYSMOD_PLL_EN 0x800
++#define SRDSYSMOD_SEL_HSP 0x400
++#define SRDSYSMOD_HLFTXDR 0x200
++#define SRDSYSMOD_TXCLK_DELAY_EN 0x100
++#define SRDSYSMOD_TXELECIDLE 0x80
++#define SRDSYSMOD_DEEMP_EN 0x40
++#define SRDSYSMOD_MS_PAD 0x4
++#define SRDSYSMOD_CDR_ADC_VLTG 0x2
++#define SRDSYSMOD_CDR_DAC_1MA 0x1
++#define SRDSYSMOD_DEF 0x2C46
++
++#define MIIDBG_CFGLPSPD 0x0A
++#define CFGLPSPD_RSTCNT_MASK 3U
++#define CFGLPSPD_RSTCNT_SHIFT 14
++#define CFGLPSPD_RSTCNT_CLK125SW 0x2000
++
++#define MIIDBG_HIBNEG 0x0B
++#define HIBNEG_PSHIB_EN 0x8000
++#define HIBNEG_WAKE_BOTH 0x4000
++#define HIBNEG_ONOFF_ANACHG_SUDEN 0x2000
++#define HIBNEG_HIB_PULSE 0x1000
++#define HIBNEG_GATE_25M_EN 0x800
++#define HIBNEG_RST_80U 0x400
++#define HIBNEG_RST_TIMER_MASK 3U
++#define HIBNEG_RST_TIMER_SHIFT 8
++#define HIBNEG_GTX_CLK_DELAY_MASK 3U
++#define HIBNEG_GTX_CLK_DELAY_SHIFT 5
++#define HIBNEG_BYPSS_BRKTIMER 0x10
++#define HIBNEG_DEF 0xBC40
++
++#define MIIDBG_TST10BTCFG 0x12
++#define TST10BTCFG_INTV_TIMER_MASK 3U
++#define TST10BTCFG_INTV_TIMER_SHIFT 14
++#define TST10BTCFG_TRIGER_TIMER_MASK 3U
++#define TST10BTCFG_TRIGER_TIMER_SHIFT 12
++#define TST10BTCFG_DIV_MAN_MLT3_EN 0x800
++#define TST10BTCFG_OFF_DAC_IDLE 0x400
++#define TST10BTCFG_LPBK_DEEP 0x4 /* 1:deep,0:shallow */
++#define TST10BTCFG_DEF 0x4C04
++
++#define MIIDBG_AZ_ANADECT 0x15
++#define AZ_ANADECT_10BTRX_TH 0x8000
++#define AZ_ANADECT_BOTH_01CHNL 0x4000
++#define AZ_ANADECT_INTV_MASK 0x3FU
++#define AZ_ANADECT_INTV_SHIFT 8
++#define AZ_ANADECT_THRESH_MASK 0xFU
++#define AZ_ANADECT_THRESH_SHIFT 4
++#define AZ_ANADECT_CHNL_MASK 0xFU
++#define AZ_ANADECT_CHNL_SHIFT 0
++#define AZ_ANADECT_DEF 0x3220
++#define AZ_ANADECT_LONG 0xb210
++
++#define MIIDBG_MSE16DB 0x18 /* l1d */
++#define L1D_MSE16DB_UP 0x05EA
++#define L1D_MSE16DB_DOWN 0x02EA
++
++#define MIIDBG_LEGCYPS 0x29
++#define LEGCYPS_EN 0x8000
++#define LEGCYPS_DAC_AMP1000_MASK 7U
++#define LEGCYPS_DAC_AMP1000_SHIFT 12
++#define LEGCYPS_DAC_AMP100_MASK 7U
++#define LEGCYPS_DAC_AMP100_SHIFT 9
++#define LEGCYPS_DAC_AMP10_MASK 7U
++#define LEGCYPS_DAC_AMP10_SHIFT 6
++#define LEGCYPS_UNPLUG_TIMER_MASK 7U
++#define LEGCYPS_UNPLUG_TIMER_SHIFT 3
++#define LEGCYPS_UNPLUG_DECT_EN 0x4
++#define LEGCYPS_ECNC_PS_EN 0x1
++#define L1D_LEGCYPS_DEF 0x129D
++#define L1C_LEGCYPS_DEF 0x36DD
++
++#define MIIDBG_TST100BTCFG 0x36
++#define TST100BTCFG_NORMAL_BW_EN 0x8000
++#define TST100BTCFG_BADLNK_BYPASS 0x4000
++#define TST100BTCFG_SHORTCABL_TH_MASK 0x3FU
++#define TST100BTCFG_SHORTCABL_TH_SHIFT 8
++#define TST100BTCFG_LITCH_EN 0x80
++#define TST100BTCFG_VLT_SW 0x40
++#define TST100BTCFG_LONGCABL_TH_MASK 0x3FU
++#define TST100BTCFG_LONGCABL_TH_SHIFT 0
++#define TST100BTCFG_DEF 0xE12C
++
++#define MIIDBG_VOLT_CTRL 0x3B /* only for l2cb 1 & 2 */
++#define VOLT_CTRL_CABLE1TH_MASK 0x1FFU
++#define VOLT_CTRL_CABLE1TH_SHIFT 7
++#define VOLT_CTRL_AMPCTRL_MASK 3U
++#define VOLT_CTRL_AMPCTRL_SHIFT 5
++#define VOLT_CTRL_SW_BYPASS 0x10
++#define VOLT_CTRL_SWLOWEST 0x8
++#define VOLT_CTRL_DACAMP10_MASK 7U
++#define VOLT_CTRL_DACAMP10_SHIFT 0
++
++#define MIIDBG_CABLE1TH_DET 0x3E
++#define CABLE1TH_DET_EN 0x8000
++
++
++/******* dev 3 *********/
++#define MIIEXT_PCS 3
++
++#define MIIEXT_CLDCTRL3 0x8003
++#define CLDCTRL3_BP_CABLE1TH_DET_GT 0x8000
++#define CLDCTRL3_AZ_DISAMP 0x1000
++#define L2CB_CLDCTRL3 0x4D19
++#define L1D_CLDCTRL3 0xDD19
++
++#define MIIEXT_CLDCTRL6 0x8006
++#define CLDCTRL6_CAB_LEN_MASK 0x1FFU
++#define CLDCTRL6_CAB_LEN_SHIFT 0
++#define CLDCTRL6_CAB_LEN_SHORT 0x50
++
++/********* dev 7 **********/
++#define MIIEXT_ANEG 7
++
++#define MIIEXT_LOCAL_EEEADV 0x3C
++#define LOCAL_EEEADV_1000BT 0x4
++#define LOCAL_EEEADV_100BT 0x2
++
++#define MIIEXT_REMOTE_EEEADV 0x3D
++#define REMOTE_EEEADV_1000BT 0x4
++#define REMOTE_EEEADV_100BT 0x2
++
++#define MIIEXT_EEE_ANEG 0x8000
++#define EEE_ANEG_1000M 0x4
++#define EEE_ANEG_100M 0x2
+
+ #endif /*_ATL1C_HW_H_*/
+diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+index 1ef0c92..9cc1570 100644
+--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
++++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+@@ -24,14 +24,6 @@
+ #define ATL1C_DRV_VERSION "1.0.1.0-NAPI"
+ char atl1c_driver_name[] = "atl1c";
+ char atl1c_driver_version[] = ATL1C_DRV_VERSION;
+-#define PCI_DEVICE_ID_ATTANSIC_L2C 0x1062
+-#define PCI_DEVICE_ID_ATTANSIC_L1C 0x1063
+-#define PCI_DEVICE_ID_ATHEROS_L2C_B 0x2060 /* AR8152 v1.1 Fast 10/100 */
+-#define PCI_DEVICE_ID_ATHEROS_L2C_B2 0x2062 /* AR8152 v2.0 Fast 10/100 */
+-#define PCI_DEVICE_ID_ATHEROS_L1D 0x1073 /* AR8151 v1.0 Gigabit 1000 */
+-#define PCI_DEVICE_ID_ATHEROS_L1D_2_0 0x1083 /* AR8151 v2.0 Gigabit 1000 */
+-#define L2CB_V10 0xc0
+-#define L2CB_V11 0xc1
+
+ /*
+ * atl1c_pci_tbl - PCI Device ID Table
+@@ -54,70 +46,72 @@ static DEFINE_PCI_DEVICE_TABLE(atl1c_pci_tbl) = {
+ };
+ MODULE_DEVICE_TABLE(pci, atl1c_pci_tbl);
+
+-MODULE_AUTHOR("Jie Yang <jie.yang@atheros.com>");
+-MODULE_DESCRIPTION("Atheros 1000M Ethernet Network Driver");
++MODULE_AUTHOR("Jie Yang");
++MODULE_AUTHOR("Qualcomm Atheros Inc., <nic-devel@qualcomm.com>");
++MODULE_DESCRIPTION("Qualcom Atheros 100/1000M Ethernet Network Driver");
+ MODULE_LICENSE("GPL");
+ MODULE_VERSION(ATL1C_DRV_VERSION);
+
+ static int atl1c_stop_mac(struct atl1c_hw *hw);
+-static void atl1c_enable_rx_ctrl(struct atl1c_hw *hw);
+-static void atl1c_enable_tx_ctrl(struct atl1c_hw *hw);
+ static void atl1c_disable_l0s_l1(struct atl1c_hw *hw);
+-static void atl1c_set_aspm(struct atl1c_hw *hw, bool linkup);
+-static void atl1c_setup_mac_ctrl(struct atl1c_adapter *adapter);
+-static void atl1c_clean_rx_irq(struct atl1c_adapter *adapter, u8 que,
++static void atl1c_set_aspm(struct atl1c_hw *hw, u16 link_speed);
++static void atl1c_start_mac(struct atl1c_adapter *adapter);
++static void atl1c_clean_rx_irq(struct atl1c_adapter *adapter,
+ int *work_done, int work_to_do);
+ static int atl1c_up(struct atl1c_adapter *adapter);
+ static void atl1c_down(struct atl1c_adapter *adapter);
++static int atl1c_reset_mac(struct atl1c_hw *hw);
++static void atl1c_reset_dma_ring(struct atl1c_adapter *adapter);
++static int atl1c_configure(struct atl1c_adapter *adapter);
++static int atl1c_alloc_rx_buffer(struct atl1c_adapter *adapter);
+
+ static const u16 atl1c_pay_load_size[] = {
+ 128, 256, 512, 1024, 2048, 4096,
+ };
+
+-static const u16 atl1c_rfd_prod_idx_regs[AT_MAX_RECEIVE_QUEUE] =
+-{
+- REG_MB_RFD0_PROD_IDX,
+- REG_MB_RFD1_PROD_IDX,
+- REG_MB_RFD2_PROD_IDX,
+- REG_MB_RFD3_PROD_IDX
+-};
+-
+-static const u16 atl1c_rfd_addr_lo_regs[AT_MAX_RECEIVE_QUEUE] =
+-{
+- REG_RFD0_HEAD_ADDR_LO,
+- REG_RFD1_HEAD_ADDR_LO,
+- REG_RFD2_HEAD_ADDR_LO,
+- REG_RFD3_HEAD_ADDR_LO
+-};
+-
+-static const u16 atl1c_rrd_addr_lo_regs[AT_MAX_RECEIVE_QUEUE] =
+-{
+- REG_RRD0_HEAD_ADDR_LO,
+- REG_RRD1_HEAD_ADDR_LO,
+- REG_RRD2_HEAD_ADDR_LO,
+- REG_RRD3_HEAD_ADDR_LO
+-};
+
+ static const u32 atl1c_default_msg = NETIF_MSG_DRV | NETIF_MSG_PROBE |
+ NETIF_MSG_LINK | NETIF_MSG_TIMER | NETIF_MSG_IFDOWN | NETIF_MSG_IFUP;
+ static void atl1c_pcie_patch(struct atl1c_hw *hw)
+ {
+- u32 data;
++ u32 mst_data, data;
+
+- AT_READ_REG(hw, REG_PCIE_PHYMISC, &data);
+- data |= PCIE_PHYMISC_FORCE_RCV_DET;
+- AT_WRITE_REG(hw, REG_PCIE_PHYMISC, data);
++ /* pclk sel could switch to 25M */
++ AT_READ_REG(hw, REG_MASTER_CTRL, &mst_data);
++ mst_data &= ~MASTER_CTRL_CLK_SEL_DIS;
++ AT_WRITE_REG(hw, REG_MASTER_CTRL, mst_data);
+
++ /* WoL/PCIE related settings */
++ if (hw->nic_type == athr_l1c || hw->nic_type == athr_l2c) {
++ AT_READ_REG(hw, REG_PCIE_PHYMISC, &data);
++ data |= PCIE_PHYMISC_FORCE_RCV_DET;
++ AT_WRITE_REG(hw, REG_PCIE_PHYMISC, data);
++ } else { /* new dev set bit5 of MASTER */
++ if (!(mst_data & MASTER_CTRL_WAKEN_25M))
++ AT_WRITE_REG(hw, REG_MASTER_CTRL,
++ mst_data | MASTER_CTRL_WAKEN_25M);
++ }
++ /* aspm/PCIE setting only for l2cb 1.0 */
+ if (hw->nic_type == athr_l2c_b && hw->revision_id == L2CB_V10) {
+ AT_READ_REG(hw, REG_PCIE_PHYMISC2, &data);
+-
+- data &= ~(PCIE_PHYMISC2_SERDES_CDR_MASK <<
+- PCIE_PHYMISC2_SERDES_CDR_SHIFT);
+- data |= 3 << PCIE_PHYMISC2_SERDES_CDR_SHIFT;
+- data &= ~(PCIE_PHYMISC2_SERDES_TH_MASK <<
+- PCIE_PHYMISC2_SERDES_TH_SHIFT);
+- data |= 3 << PCIE_PHYMISC2_SERDES_TH_SHIFT;
++ data = FIELD_SETX(data, PCIE_PHYMISC2_CDR_BW,
++ L2CB1_PCIE_PHYMISC2_CDR_BW);
++ data = FIELD_SETX(data, PCIE_PHYMISC2_L0S_TH,
++ L2CB1_PCIE_PHYMISC2_L0S_TH);
+ AT_WRITE_REG(hw, REG_PCIE_PHYMISC2, data);
++ /* extend L1 sync timer */
++ AT_READ_REG(hw, REG_LINK_CTRL, &data);
++ data |= LINK_CTRL_EXT_SYNC;
++ AT_WRITE_REG(hw, REG_LINK_CTRL, data);
++ }
++ /* l2cb 1.x & l1d 1.x */
++ if (hw->nic_type == athr_l2c_b || hw->nic_type == athr_l1d) {
++ AT_READ_REG(hw, REG_PM_CTRL, &data);
++ data |= PM_CTRL_L0S_BUFSRX_EN;
++ AT_WRITE_REG(hw, REG_PM_CTRL, data);
++ /* clear vendor msg */
++ AT_READ_REG(hw, REG_DMA_DBG, &data);
++ AT_WRITE_REG(hw, REG_DMA_DBG, data & ~DMA_DBG_VENDOR_MSG);
+ }
+ }
+
+@@ -130,6 +124,7 @@ static void atl1c_reset_pcie(struct atl1c_hw *hw, u32 flag)
+ u32 data;
+ u32 pci_cmd;
+ struct pci_dev *pdev = hw->adapter->pdev;
++ int pos;
+
+ AT_READ_REG(hw, PCI_COMMAND, &pci_cmd);
+ pci_cmd &= ~PCI_COMMAND_INTX_DISABLE;
+@@ -142,14 +137,23 @@ static void atl1c_reset_pcie(struct atl1c_hw *hw, u32 flag)
+ */
+ pci_enable_wake(pdev, PCI_D3hot, 0);
+ pci_enable_wake(pdev, PCI_D3cold, 0);
++ /* wol sts read-clear */
++ AT_READ_REG(hw, REG_WOL_CTRL, &data);
++ AT_WRITE_REG(hw, REG_WOL_CTRL, 0);
+
+ /*
+ * Mask some pcie error bits
+ */
+- AT_READ_REG(hw, REG_PCIE_UC_SEVERITY, &data);
+- data &= ~PCIE_UC_SERVRITY_DLP;
+- data &= ~PCIE_UC_SERVRITY_FCP;
+- AT_WRITE_REG(hw, REG_PCIE_UC_SEVERITY, data);
++ pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_ERR);
++ pci_read_config_dword(pdev, pos + PCI_ERR_UNCOR_SEVER, &data);
++ data &= ~(PCI_ERR_UNC_DLP | PCI_ERR_UNC_FCP);
++ pci_write_config_dword(pdev, pos + PCI_ERR_UNCOR_SEVER, data);
++ /* clear error status */
++ pci_write_config_word(pdev, pci_pcie_cap(pdev) + PCI_EXP_DEVSTA,
++ PCI_EXP_DEVSTA_NFED |
++ PCI_EXP_DEVSTA_FED |
++ PCI_EXP_DEVSTA_CED |
++ PCI_EXP_DEVSTA_URD);
+
+ AT_READ_REG(hw, REG_LTSSM_ID_CTRL, &data);
+ data &= ~LTSSM_ID_EN_WRO;
+@@ -158,11 +162,6 @@ static void atl1c_reset_pcie(struct atl1c_hw *hw, u32 flag)
+ atl1c_pcie_patch(hw);
+ if (flag & ATL1C_PCIE_L0S_L1_DISABLE)
+ atl1c_disable_l0s_l1(hw);
+- if (flag & ATL1C_PCIE_PHY_RESET)
+- AT_WRITE_REG(hw, REG_GPHY_CTRL, GPHY_CTRL_DEFAULT);
+- else
+- AT_WRITE_REG(hw, REG_GPHY_CTRL,
+- GPHY_CTRL_DEFAULT | GPHY_CTRL_EXT_RESET);
+
+ msleep(5);
+ }
+@@ -207,14 +206,14 @@ static inline void atl1c_irq_reset(struct atl1c_adapter *adapter)
+ * atl1c_wait_until_idle - wait up to AT_HW_MAX_IDLE_DELAY reads
+ * of the idle status register until the device is actually idle
+ */
+-static u32 atl1c_wait_until_idle(struct atl1c_hw *hw)
++static u32 atl1c_wait_until_idle(struct atl1c_hw *hw, u32 modu_ctrl)
+ {
+ int timeout;
+ u32 data;
+
+ for (timeout = 0; timeout < AT_HW_MAX_IDLE_DELAY; timeout++) {
+ AT_READ_REG(hw, REG_IDLE_STATUS, &data);
+- if ((data & IDLE_STATUS_MASK) == 0)
++ if ((data & modu_ctrl) == 0)
+ return 0;
+ msleep(1);
+ }
+@@ -261,15 +260,16 @@ static void atl1c_check_link_status(struct atl1c_adapter *adapter)
+
+ if ((phy_data & BMSR_LSTATUS) == 0) {
+ /* link down */
+- hw->hibernate = true;
+- if (atl1c_stop_mac(hw) != 0)
+- if (netif_msg_hw(adapter))
+- dev_warn(&pdev->dev, "stop mac failed\n");
+- atl1c_set_aspm(hw, false);
+ netif_carrier_off(netdev);
+ netif_stop_queue(netdev);
+- atl1c_phy_reset(hw);
+- atl1c_phy_init(&adapter->hw);
++ hw->hibernate = true;
++ if (atl1c_reset_mac(hw) != 0)
++ if (netif_msg_hw(adapter))
++ dev_warn(&pdev->dev, "reset mac failed\n");
++ atl1c_set_aspm(hw, SPEED_0);
++ atl1c_post_phy_linkchg(hw, SPEED_0);
++ atl1c_reset_dma_ring(adapter);
++ atl1c_configure(adapter);
+ } else {
+ /* Link Up */
+ hw->hibernate = false;
+@@ -283,10 +283,9 @@ static void atl1c_check_link_status(struct atl1c_adapter *adapter)
+ adapter->link_duplex != duplex) {
+ adapter->link_speed = speed;
+ adapter->link_duplex = duplex;
+- atl1c_set_aspm(hw, true);
+- atl1c_enable_tx_ctrl(hw);
+- atl1c_enable_rx_ctrl(hw);
+- atl1c_setup_mac_ctrl(adapter);
++ atl1c_set_aspm(hw, speed);
++ atl1c_post_phy_linkchg(hw, speed);
++ atl1c_start_mac(adapter);
+ if (netif_msg_link(adapter))
+ dev_info(&pdev->dev,
+ "%s: %s NIC Link is Up<%d Mbps %s>\n",
+@@ -337,6 +336,9 @@ static void atl1c_common_task(struct work_struct *work)
+ adapter = container_of(work, struct atl1c_adapter, common_task);
+ netdev = adapter->netdev;
+
++ if (test_bit(__AT_DOWN, &adapter->flags))
++ return;
++
+ if (test_and_clear_bit(ATL1C_WORK_EVENT_RESET, &adapter->work_event)) {
+ netif_device_detach(netdev);
+ atl1c_down(adapter);
+@@ -345,8 +347,11 @@ static void atl1c_common_task(struct work_struct *work)
+ }
+
+ if (test_and_clear_bit(ATL1C_WORK_EVENT_LINK_CHANGE,
+- &adapter->work_event))
++ &adapter->work_event)) {
++ atl1c_irq_disable(adapter);
+ atl1c_check_link_status(adapter);
++ atl1c_irq_enable(adapter);
++ }
+ }
+
+
+@@ -470,7 +475,7 @@ static int atl1c_set_mac_addr(struct net_device *netdev, void *p)
+ memcpy(adapter->hw.mac_addr, addr->sa_data, netdev->addr_len);
+ netdev->addr_assign_type &= ~NET_ADDR_RANDOM;
+
+- atl1c_hw_set_mac_addr(&adapter->hw);
++ atl1c_hw_set_mac_addr(&adapter->hw, adapter->hw.mac_addr);
+
+ return 0;
+ }
+@@ -523,11 +528,16 @@ static int atl1c_set_features(struct net_device *netdev,
+ static int atl1c_change_mtu(struct net_device *netdev, int new_mtu)
+ {
+ struct atl1c_adapter *adapter = netdev_priv(netdev);
++ struct atl1c_hw *hw = &adapter->hw;
+ int old_mtu = netdev->mtu;
+ int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN;
+
+- if ((max_frame < ETH_ZLEN + ETH_FCS_LEN) ||
+- (max_frame > MAX_JUMBO_FRAME_SIZE)) {
++ /* Fast Ethernet controller doesn't support jumbo packet */
++ if (((hw->nic_type == athr_l2c ||
++ hw->nic_type == athr_l2c_b ||
++ hw->nic_type == athr_l2c_b2) && new_mtu > ETH_DATA_LEN) ||
++ max_frame < ETH_ZLEN + ETH_FCS_LEN ||
++ max_frame > MAX_JUMBO_FRAME_SIZE) {
+ if (netif_msg_link(adapter))
+ dev_warn(&adapter->pdev->dev, "invalid MTU setting\n");
+ return -EINVAL;
+@@ -543,14 +553,6 @@ static int atl1c_change_mtu(struct net_device *netdev, int new_mtu)
+ netdev_update_features(netdev);
+ atl1c_up(adapter);
+ clear_bit(__AT_RESETTING, &adapter->flags);
+- if (adapter->hw.ctrl_flags & ATL1C_FPGA_VERSION) {
+- u32 phy_data;
+-
+- AT_READ_REG(&adapter->hw, 0x1414, &phy_data);
+- phy_data |= 0x10000000;
+- AT_WRITE_REG(&adapter->hw, 0x1414, phy_data);
+- }
+-
+ }
+ return 0;
+ }
+@@ -563,7 +565,7 @@ static int atl1c_mdio_read(struct net_device *netdev, int phy_id, int reg_num)
+ struct atl1c_adapter *adapter = netdev_priv(netdev);
+ u16 result;
+
+- atl1c_read_phy_reg(&adapter->hw, reg_num & MDIO_REG_ADDR_MASK, &result);
++ atl1c_read_phy_reg(&adapter->hw, reg_num, &result);
+ return result;
+ }
+
+@@ -572,7 +574,7 @@ static void atl1c_mdio_write(struct net_device *netdev, int phy_id,
+ {
+ struct atl1c_adapter *adapter = netdev_priv(netdev);
+
+- atl1c_write_phy_reg(&adapter->hw, reg_num & MDIO_REG_ADDR_MASK, val);
++ atl1c_write_phy_reg(&adapter->hw, reg_num, val);
+ }
+
+ /*
+@@ -687,21 +689,15 @@ static void atl1c_set_mac_type(struct atl1c_hw *hw)
+
+ static int atl1c_setup_mac_funcs(struct atl1c_hw *hw)
+ {
+- u32 phy_status_data;
+ u32 link_ctrl_data;
+
+ atl1c_set_mac_type(hw);
+- AT_READ_REG(hw, REG_PHY_STATUS, &phy_status_data);
+ AT_READ_REG(hw, REG_LINK_CTRL, &link_ctrl_data);
+
+ hw->ctrl_flags = ATL1C_INTR_MODRT_ENABLE |
+ ATL1C_TXQ_MODE_ENHANCE;
+- if (link_ctrl_data & LINK_CTRL_L0S_EN)
+- hw->ctrl_flags |= ATL1C_ASPM_L0S_SUPPORT;
+- if (link_ctrl_data & LINK_CTRL_L1_EN)
+- hw->ctrl_flags |= ATL1C_ASPM_L1_SUPPORT;
+- if (link_ctrl_data & LINK_CTRL_EXT_SYNC)
+- hw->ctrl_flags |= ATL1C_LINK_EXT_SYNC;
++ hw->ctrl_flags |= ATL1C_ASPM_L0S_SUPPORT |
++ ATL1C_ASPM_L1_SUPPORT;
+ hw->ctrl_flags |= ATL1C_ASPM_CTRL_MON;
+
+ if (hw->nic_type == athr_l1c ||
+@@ -710,6 +706,55 @@ static int atl1c_setup_mac_funcs(struct atl1c_hw *hw)
+ hw->link_cap_flags |= ATL1C_LINK_CAP_1000M;
+ return 0;
+ }
++
++struct atl1c_platform_patch {
++ u16 pci_did;
++ u8 pci_revid;
++ u16 subsystem_vid;
++ u16 subsystem_did;
++ u32 patch_flag;
++#define ATL1C_LINK_PATCH 0x1
++};
++static const struct atl1c_platform_patch plats[] __devinitdata = {
++{0x2060, 0xC1, 0x1019, 0x8152, 0x1},
++{0x2060, 0xC1, 0x1019, 0x2060, 0x1},
++{0x2060, 0xC1, 0x1019, 0xE000, 0x1},
++{0x2062, 0xC0, 0x1019, 0x8152, 0x1},
++{0x2062, 0xC0, 0x1019, 0x2062, 0x1},
++{0x2062, 0xC0, 0x1458, 0xE000, 0x1},
++{0x2062, 0xC1, 0x1019, 0x8152, 0x1},
++{0x2062, 0xC1, 0x1019, 0x2062, 0x1},
++{0x2062, 0xC1, 0x1458, 0xE000, 0x1},
++{0x2062, 0xC1, 0x1565, 0x2802, 0x1},
++{0x2062, 0xC1, 0x1565, 0x2801, 0x1},
++{0x1073, 0xC0, 0x1019, 0x8151, 0x1},
++{0x1073, 0xC0, 0x1019, 0x1073, 0x1},
++{0x1073, 0xC0, 0x1458, 0xE000, 0x1},
++{0x1083, 0xC0, 0x1458, 0xE000, 0x1},
++{0x1083, 0xC0, 0x1019, 0x8151, 0x1},
++{0x1083, 0xC0, 0x1019, 0x1083, 0x1},
++{0x1083, 0xC0, 0x1462, 0x7680, 0x1},
++{0x1083, 0xC0, 0x1565, 0x2803, 0x1},
++{0},
++};
++
++static void __devinit atl1c_patch_assign(struct atl1c_hw *hw)
++{
++ int i = 0;
++
++ hw->msi_lnkpatch = false;
++
++ while (plats[i].pci_did != 0) {
++ if (plats[i].pci_did == hw->device_id &&
++ plats[i].pci_revid == hw->revision_id &&
++ plats[i].subsystem_vid == hw->subsystem_vendor_id &&
++ plats[i].subsystem_did == hw->subsystem_id) {
++ if (plats[i].patch_flag & ATL1C_LINK_PATCH)
++ hw->msi_lnkpatch = true;
++ }
++ i++;
++ }
++}
+ /*
+ * atl1c_sw_init - Initialize general software structures (struct atl1c_adapter)
+ * @adapter: board private structure to initialize
+@@ -729,9 +774,8 @@ static int __devinit atl1c_sw_init(struct atl1c_adapter *adapter)
+ device_set_wakeup_enable(&pdev->dev, false);
+ adapter->link_speed = SPEED_0;
+ adapter->link_duplex = FULL_DUPLEX;
+- adapter->num_rx_queues = AT_DEF_RECEIVE_QUEUE;
+ adapter->tpd_ring[0].count = 1024;
+- adapter->rfd_ring[0].count = 512;
++ adapter->rfd_ring.count = 512;
+
+ hw->vendor_id = pdev->vendor;
+ hw->device_id = pdev->device;
+@@ -746,26 +790,18 @@ static int __devinit atl1c_sw_init(struct atl1c_adapter *adapter)
+ dev_err(&pdev->dev, "set mac function pointers failed\n");
+ return -1;
+ }
++ atl1c_patch_assign(hw);
++
+ hw->intr_mask = IMR_NORMAL_MASK;
+ hw->phy_configured = false;
+ hw->preamble_len = 7;
+ hw->max_frame_size = adapter->netdev->mtu;
+- if (adapter->num_rx_queues < 2) {
+- hw->rss_type = atl1c_rss_disable;
+- hw->rss_mode = atl1c_rss_mode_disable;
+- } else {
+- hw->rss_type = atl1c_rss_ipv4;
+- hw->rss_mode = atl1c_rss_mul_que_mul_int;
+- hw->rss_hash_bits = 16;
+- }
+ hw->autoneg_advertised = ADVERTISED_Autoneg;
+ hw->indirect_tab = 0xE4E4E4E4;
+ hw->base_cpu = 0;
+
+ hw->ict = 50000; /* 100ms */
+ hw->smb_timer = 200000; /* 400ms */
+- hw->cmb_tpd = 4;
+- hw->cmb_tx_timer = 1; /* 2 us */
+ hw->rx_imt = 200;
+ hw->tx_imt = 1000;
+
+@@ -773,9 +809,6 @@ static int __devinit atl1c_sw_init(struct atl1c_adapter *adapter)
+ hw->rfd_burst = 8;
+ hw->dma_order = atl1c_dma_ord_out;
+ hw->dmar_block = atl1c_dma_req_1024;
+- hw->dmaw_block = atl1c_dma_req_1024;
+- hw->dmar_dly_cnt = 15;
+- hw->dmaw_dly_cnt = 4;
+
+ if (atl1c_alloc_queues(adapter)) {
+ dev_err(&pdev->dev, "Unable to allocate memory for queues\n");
+@@ -851,24 +884,22 @@ static void atl1c_clean_tx_ring(struct atl1c_adapter *adapter,
+ */
+ static void atl1c_clean_rx_ring(struct atl1c_adapter *adapter)
+ {
+- struct atl1c_rfd_ring *rfd_ring = adapter->rfd_ring;
+- struct atl1c_rrd_ring *rrd_ring = adapter->rrd_ring;
++ struct atl1c_rfd_ring *rfd_ring = &adapter->rfd_ring;
++ struct atl1c_rrd_ring *rrd_ring = &adapter->rrd_ring;
+ struct atl1c_buffer *buffer_info;
+ struct pci_dev *pdev = adapter->pdev;
+- int i, j;
++ int j;
+
+- for (i = 0; i < adapter->num_rx_queues; i++) {
+- for (j = 0; j < rfd_ring[i].count; j++) {
+- buffer_info = &rfd_ring[i].buffer_info[j];
+- atl1c_clean_buffer(pdev, buffer_info, 0);
+- }
+- /* zero out the descriptor ring */
+- memset(rfd_ring[i].desc, 0, rfd_ring[i].size);
+- rfd_ring[i].next_to_clean = 0;
+- rfd_ring[i].next_to_use = 0;
+- rrd_ring[i].next_to_use = 0;
+- rrd_ring[i].next_to_clean = 0;
++ for (j = 0; j < rfd_ring->count; j++) {
++ buffer_info = &rfd_ring->buffer_info[j];
++ atl1c_clean_buffer(pdev, buffer_info, 0);
+ }
++ /* zero out the descriptor ring */
++ memset(rfd_ring->desc, 0, rfd_ring->size);
++ rfd_ring->next_to_clean = 0;
++ rfd_ring->next_to_use = 0;
++ rrd_ring->next_to_use = 0;
++ rrd_ring->next_to_clean = 0;
+ }
+
+ /*
+@@ -877,8 +908,8 @@ static void atl1c_clean_rx_ring(struct atl1c_adapter *adapter)
+ static void atl1c_init_ring_ptrs(struct atl1c_adapter *adapter)
+ {
+ struct atl1c_tpd_ring *tpd_ring = adapter->tpd_ring;
+- struct atl1c_rfd_ring *rfd_ring = adapter->rfd_ring;
+- struct atl1c_rrd_ring *rrd_ring = adapter->rrd_ring;
++ struct atl1c_rfd_ring *rfd_ring = &adapter->rfd_ring;
++ struct atl1c_rrd_ring *rrd_ring = &adapter->rrd_ring;
+ struct atl1c_buffer *buffer_info;
+ int i, j;
+
+@@ -890,15 +921,13 @@ static void atl1c_init_ring_ptrs(struct atl1c_adapter *adapter)
+ ATL1C_SET_BUFFER_STATE(&buffer_info[i],
+ ATL1C_BUFFER_FREE);
+ }
+- for (i = 0; i < adapter->num_rx_queues; i++) {
+- rfd_ring[i].next_to_use = 0;
+- rfd_ring[i].next_to_clean = 0;
+- rrd_ring[i].next_to_use = 0;
+- rrd_ring[i].next_to_clean = 0;
+- for (j = 0; j < rfd_ring[i].count; j++) {
+- buffer_info = &rfd_ring[i].buffer_info[j];
+- ATL1C_SET_BUFFER_STATE(buffer_info, ATL1C_BUFFER_FREE);
+- }
++ rfd_ring->next_to_use = 0;
++ rfd_ring->next_to_clean = 0;
++ rrd_ring->next_to_use = 0;
++ rrd_ring->next_to_clean = 0;
++ for (j = 0; j < rfd_ring->count; j++) {
++ buffer_info = &rfd_ring->buffer_info[j];
++ ATL1C_SET_BUFFER_STATE(buffer_info, ATL1C_BUFFER_FREE);
+ }
+ }
+
+@@ -935,27 +964,23 @@ static int atl1c_setup_ring_resources(struct atl1c_adapter *adapter)
+ {
+ struct pci_dev *pdev = adapter->pdev;
+ struct atl1c_tpd_ring *tpd_ring = adapter->tpd_ring;
+- struct atl1c_rfd_ring *rfd_ring = adapter->rfd_ring;
+- struct atl1c_rrd_ring *rrd_ring = adapter->rrd_ring;
++ struct atl1c_rfd_ring *rfd_ring = &adapter->rfd_ring;
++ struct atl1c_rrd_ring *rrd_ring = &adapter->rrd_ring;
+ struct atl1c_ring_header *ring_header = &adapter->ring_header;
+- int num_rx_queues = adapter->num_rx_queues;
+ int size;
+ int i;
+ int count = 0;
+ int rx_desc_count = 0;
+ u32 offset = 0;
+
+- rrd_ring[0].count = rfd_ring[0].count;
++ rrd_ring->count = rfd_ring->count;
+ for (i = 1; i < AT_MAX_TRANSMIT_QUEUE; i++)
+ tpd_ring[i].count = tpd_ring[0].count;
+
+- for (i = 1; i < adapter->num_rx_queues; i++)
+- rfd_ring[i].count = rrd_ring[i].count = rfd_ring[0].count;
+-
+ /* 2 tpd queue, one high priority queue,
+ * another normal priority queue */
+ size = sizeof(struct atl1c_buffer) * (tpd_ring->count * 2 +
+- rfd_ring->count * num_rx_queues);
++ rfd_ring->count);
+ tpd_ring->buffer_info = kzalloc(size, GFP_KERNEL);
+ if (unlikely(!tpd_ring->buffer_info)) {
+ dev_err(&pdev->dev, "kzalloc failed, size = %d\n",
+@@ -968,12 +993,11 @@ static int atl1c_setup_ring_resources(struct atl1c_adapter *adapter)
+ count += tpd_ring[i].count;
+ }
+
+- for (i = 0; i < num_rx_queues; i++) {
+- rfd_ring[i].buffer_info =
+- (struct atl1c_buffer *) (tpd_ring->buffer_info + count);
+- count += rfd_ring[i].count;
+- rx_desc_count += rfd_ring[i].count;
+- }
++ rfd_ring->buffer_info =
++ (struct atl1c_buffer *) (tpd_ring->buffer_info + count);
++ count += rfd_ring->count;
++ rx_desc_count += rfd_ring->count;
++
+ /*
+ * real ring DMA buffer
+ * each ring/block may need up to 8 bytes for alignment, hence the
+@@ -983,8 +1007,7 @@ static int atl1c_setup_ring_resources(struct atl1c_adapter *adapter)
+ sizeof(struct atl1c_tpd_desc) * tpd_ring->count * 2 +
+ sizeof(struct atl1c_rx_free_desc) * rx_desc_count +
+ sizeof(struct atl1c_recv_ret_status) * rx_desc_count +
+- sizeof(struct atl1c_hw_stats) +
+- 8 * 4 + 8 * 2 * num_rx_queues;
++ 8 * 4;
+
+ ring_header->desc = pci_alloc_consistent(pdev, ring_header->size,
+ &ring_header->dma);
+@@ -1005,25 +1028,18 @@ static int atl1c_setup_ring_resources(struct atl1c_adapter *adapter)
+ offset += roundup(tpd_ring[i].size, 8);
+ }
+ /* init RFD ring */
+- for (i = 0; i < num_rx_queues; i++) {
+- rfd_ring[i].dma = ring_header->dma + offset;
+- rfd_ring[i].desc = (u8 *) ring_header->desc + offset;
+- rfd_ring[i].size = sizeof(struct atl1c_rx_free_desc) *
+- rfd_ring[i].count;
+- offset += roundup(rfd_ring[i].size, 8);
+- }
++ rfd_ring->dma = ring_header->dma + offset;
++ rfd_ring->desc = (u8 *) ring_header->desc + offset;
++ rfd_ring->size = sizeof(struct atl1c_rx_free_desc) * rfd_ring->count;
++ offset += roundup(rfd_ring->size, 8);
+
+ /* init RRD ring */
+- for (i = 0; i < num_rx_queues; i++) {
+- rrd_ring[i].dma = ring_header->dma + offset;
+- rrd_ring[i].desc = (u8 *) ring_header->desc + offset;
+- rrd_ring[i].size = sizeof(struct atl1c_recv_ret_status) *
+- rrd_ring[i].count;
+- offset += roundup(rrd_ring[i].size, 8);
+- }
++ rrd_ring->dma = ring_header->dma + offset;
++ rrd_ring->desc = (u8 *) ring_header->desc + offset;
++ rrd_ring->size = sizeof(struct atl1c_recv_ret_status) *
++ rrd_ring->count;
++ offset += roundup(rrd_ring->size, 8);
+
+- adapter->smb.dma = ring_header->dma + offset;
+- adapter->smb.smb = (u8 *)ring_header->desc + offset;
+ return 0;
+
+ err_nomem:
+@@ -1034,26 +1050,20 @@ err_nomem:
+ static void atl1c_configure_des_ring(struct atl1c_adapter *adapter)
+ {
+ struct atl1c_hw *hw = &adapter->hw;
+- struct atl1c_rfd_ring *rfd_ring = (struct atl1c_rfd_ring *)
+- adapter->rfd_ring;
+- struct atl1c_rrd_ring *rrd_ring = (struct atl1c_rrd_ring *)
+- adapter->rrd_ring;
++ struct atl1c_rfd_ring *rfd_ring = &adapter->rfd_ring;
++ struct atl1c_rrd_ring *rrd_ring = &adapter->rrd_ring;
+ struct atl1c_tpd_ring *tpd_ring = (struct atl1c_tpd_ring *)
+ adapter->tpd_ring;
+- struct atl1c_cmb *cmb = (struct atl1c_cmb *) &adapter->cmb;
+- struct atl1c_smb *smb = (struct atl1c_smb *) &adapter->smb;
+- int i;
+- u32 data;
+
+ /* TPD */
+ AT_WRITE_REG(hw, REG_TX_BASE_ADDR_HI,
+ (u32)((tpd_ring[atl1c_trans_normal].dma &
+ AT_DMA_HI_ADDR_MASK) >> 32));
+ /* just enable normal priority TX queue */
+- AT_WRITE_REG(hw, REG_NTPD_HEAD_ADDR_LO,
++ AT_WRITE_REG(hw, REG_TPD_PRI0_ADDR_LO,
+ (u32)(tpd_ring[atl1c_trans_normal].dma &
+ AT_DMA_LO_ADDR_MASK));
+- AT_WRITE_REG(hw, REG_HTPD_HEAD_ADDR_LO,
++ AT_WRITE_REG(hw, REG_TPD_PRI1_ADDR_LO,
+ (u32)(tpd_ring[atl1c_trans_high].dma &
+ AT_DMA_LO_ADDR_MASK));
+ AT_WRITE_REG(hw, REG_TPD_RING_SIZE,
+@@ -1062,31 +1072,21 @@ static void atl1c_configure_des_ring(struct atl1c_adapter *adapter)
+
+ /* RFD */
+ AT_WRITE_REG(hw, REG_RX_BASE_ADDR_HI,
+- (u32)((rfd_ring[0].dma & AT_DMA_HI_ADDR_MASK) >> 32));
+- for (i = 0; i < adapter->num_rx_queues; i++)
+- AT_WRITE_REG(hw, atl1c_rfd_addr_lo_regs[i],
+- (u32)(rfd_ring[i].dma & AT_DMA_LO_ADDR_MASK));
++ (u32)((rfd_ring->dma & AT_DMA_HI_ADDR_MASK) >> 32));
++ AT_WRITE_REG(hw, REG_RFD0_HEAD_ADDR_LO,
++ (u32)(rfd_ring->dma & AT_DMA_LO_ADDR_MASK));
+
+ AT_WRITE_REG(hw, REG_RFD_RING_SIZE,
+- rfd_ring[0].count & RFD_RING_SIZE_MASK);
++ rfd_ring->count & RFD_RING_SIZE_MASK);
+ AT_WRITE_REG(hw, REG_RX_BUF_SIZE,
+ adapter->rx_buffer_len & RX_BUF_SIZE_MASK);
+
+ /* RRD */
+- for (i = 0; i < adapter->num_rx_queues; i++)
+- AT_WRITE_REG(hw, atl1c_rrd_addr_lo_regs[i],
+- (u32)(rrd_ring[i].dma & AT_DMA_LO_ADDR_MASK));
++ AT_WRITE_REG(hw, REG_RRD0_HEAD_ADDR_LO,
++ (u32)(rrd_ring->dma & AT_DMA_LO_ADDR_MASK));
+ AT_WRITE_REG(hw, REG_RRD_RING_SIZE,
+- (rrd_ring[0].count & RRD_RING_SIZE_MASK));
++ (rrd_ring->count & RRD_RING_SIZE_MASK));
+
+- /* CMB */
+- AT_WRITE_REG(hw, REG_CMB_BASE_ADDR_LO, cmb->dma & AT_DMA_LO_ADDR_MASK);
+-
+- /* SMB */
+- AT_WRITE_REG(hw, REG_SMB_BASE_ADDR_HI,
+- (u32)((smb->dma & AT_DMA_HI_ADDR_MASK) >> 32));
+- AT_WRITE_REG(hw, REG_SMB_BASE_ADDR_LO,
+- (u32)(smb->dma & AT_DMA_LO_ADDR_MASK));
+ if (hw->nic_type == athr_l2c_b) {
+ AT_WRITE_REG(hw, REG_SRAM_RXF_LEN, 0x02a0L);
+ AT_WRITE_REG(hw, REG_SRAM_TXF_LEN, 0x0100L);
+@@ -1097,13 +1097,6 @@ static void atl1c_configure_des_ring(struct atl1c_adapter *adapter)
+ AT_WRITE_REG(hw, REG_TXF_WATER_MARK, 0); /* TX watermark, to enter l1 state.*/
+ AT_WRITE_REG(hw, REG_RXD_DMA_CTRL, 0); /* RXD threshold.*/
+ }
+- if (hw->nic_type == athr_l2c_b || hw->nic_type == athr_l1d_2) {
+- /* Power Saving for L2c_B */
+- AT_READ_REG(hw, REG_SERDES_LOCK, &data);
+- data |= SERDES_MAC_CLK_SLOWDOWN;
+- data |= SERDES_PYH_CLK_SLOWDOWN;
+- AT_WRITE_REG(hw, REG_SERDES_LOCK, data);
+- }
+ /* Load all of base address above */
+ AT_WRITE_REG(hw, REG_LOAD_PTR, 1);
+ }
+@@ -1111,32 +1104,26 @@ static void atl1c_configure_des_ring(struct atl1c_adapter *adapter)
+ static void atl1c_configure_tx(struct atl1c_adapter *adapter)
+ {
+ struct atl1c_hw *hw = &adapter->hw;
+- u32 dev_ctrl_data;
+- u32 max_pay_load;
++ int max_pay_load;
+ u16 tx_offload_thresh;
+ u32 txq_ctrl_data;
+- u32 max_pay_load_data;
+
+- tx_offload_thresh = MAX_TX_OFFLOAD_THRESH;
++ tx_offload_thresh = MAX_TSO_FRAME_SIZE;
+ AT_WRITE_REG(hw, REG_TX_TSO_OFFLOAD_THRESH,
+ (tx_offload_thresh >> 3) & TX_TSO_OFFLOAD_THRESH_MASK);
+- AT_READ_REG(hw, REG_DEVICE_CTRL, &dev_ctrl_data);
+- max_pay_load = (dev_ctrl_data >> DEVICE_CTRL_MAX_PAYLOAD_SHIFT) &
+- DEVICE_CTRL_MAX_PAYLOAD_MASK;
+- hw->dmaw_block = min_t(u32, max_pay_load, hw->dmaw_block);
+- max_pay_load = (dev_ctrl_data >> DEVICE_CTRL_MAX_RREQ_SZ_SHIFT) &
+- DEVICE_CTRL_MAX_RREQ_SZ_MASK;
++ max_pay_load = pcie_get_readrq(adapter->pdev) >> 8;
+ hw->dmar_block = min_t(u32, max_pay_load, hw->dmar_block);
+-
+- txq_ctrl_data = (hw->tpd_burst & TXQ_NUM_TPD_BURST_MASK) <<
+- TXQ_NUM_TPD_BURST_SHIFT;
+- if (hw->ctrl_flags & ATL1C_TXQ_MODE_ENHANCE)
+- txq_ctrl_data |= TXQ_CTRL_ENH_MODE;
+- max_pay_load_data = (atl1c_pay_load_size[hw->dmar_block] &
+- TXQ_TXF_BURST_NUM_MASK) << TXQ_TXF_BURST_NUM_SHIFT;
+- if (hw->nic_type == athr_l2c_b || hw->nic_type == athr_l2c_b2)
+- max_pay_load_data >>= 1;
+- txq_ctrl_data |= max_pay_load_data;
++ /*
++ * if BIOS had changed the dam-read-max-length to an invalid value,
++ * restore it to default value
++ */
++ if (hw->dmar_block < DEVICE_CTRL_MAXRRS_MIN) {
++ pcie_set_readrq(adapter->pdev, 128 << DEVICE_CTRL_MAXRRS_MIN);
++ hw->dmar_block = DEVICE_CTRL_MAXRRS_MIN;
++ }
++ txq_ctrl_data =
++ hw->nic_type == athr_l2c_b || hw->nic_type == athr_l2c_b2 ?
++ L2CB_TXQ_CFGV : L1C_TXQ_CFGV;
+
+ AT_WRITE_REG(hw, REG_TXQ_CTRL, txq_ctrl_data);
+ }
+@@ -1151,34 +1138,13 @@ static void atl1c_configure_rx(struct atl1c_adapter *adapter)
+
+ if (hw->ctrl_flags & ATL1C_RX_IPV6_CHKSUM)
+ rxq_ctrl_data |= IPV6_CHKSUM_CTRL_EN;
+- if (hw->rss_type == atl1c_rss_ipv4)
+- rxq_ctrl_data |= RSS_HASH_IPV4;
+- if (hw->rss_type == atl1c_rss_ipv4_tcp)
+- rxq_ctrl_data |= RSS_HASH_IPV4_TCP;
+- if (hw->rss_type == atl1c_rss_ipv6)
+- rxq_ctrl_data |= RSS_HASH_IPV6;
+- if (hw->rss_type == atl1c_rss_ipv6_tcp)
+- rxq_ctrl_data |= RSS_HASH_IPV6_TCP;
+- if (hw->rss_type != atl1c_rss_disable)
+- rxq_ctrl_data |= RRS_HASH_CTRL_EN;
+-
+- rxq_ctrl_data |= (hw->rss_mode & RSS_MODE_MASK) <<
+- RSS_MODE_SHIFT;
+- rxq_ctrl_data |= (hw->rss_hash_bits & RSS_HASH_BITS_MASK) <<
+- RSS_HASH_BITS_SHIFT;
+- if (hw->ctrl_flags & ATL1C_ASPM_CTRL_MON)
+- rxq_ctrl_data |= (ASPM_THRUPUT_LIMIT_1M &
+- ASPM_THRUPUT_LIMIT_MASK) << ASPM_THRUPUT_LIMIT_SHIFT;
+
+- AT_WRITE_REG(hw, REG_RXQ_CTRL, rxq_ctrl_data);
+-}
+-
+-static void atl1c_configure_rss(struct atl1c_adapter *adapter)
+-{
+- struct atl1c_hw *hw = &adapter->hw;
++ /* aspm for gigabit */
++ if (hw->nic_type != athr_l1d_2 && (hw->device_id & 1) != 0)
++ rxq_ctrl_data = FIELD_SETX(rxq_ctrl_data, ASPM_THRUPUT_LIMIT,
++ ASPM_THRUPUT_LIMIT_100M);
+
+- AT_WRITE_REG(hw, REG_IDT_TABLE, hw->indirect_tab);
+- AT_WRITE_REG(hw, REG_BASE_CPU_NUMBER, hw->base_cpu);
++ AT_WRITE_REG(hw, REG_RXQ_CTRL, rxq_ctrl_data);
+ }
+
+ static void atl1c_configure_dma(struct atl1c_adapter *adapter)
+@@ -1186,36 +1152,11 @@ static void atl1c_configure_dma(struct atl1c_adapter *adapter)
+ struct atl1c_hw *hw = &adapter->hw;
+ u32 dma_ctrl_data;
+
+- dma_ctrl_data = DMA_CTRL_DMAR_REQ_PRI;
+- if (hw->ctrl_flags & ATL1C_CMB_ENABLE)
+- dma_ctrl_data |= DMA_CTRL_CMB_EN;
+- if (hw->ctrl_flags & ATL1C_SMB_ENABLE)
+- dma_ctrl_data |= DMA_CTRL_SMB_EN;
+- else
+- dma_ctrl_data |= MAC_CTRL_SMB_DIS;
+-
+- switch (hw->dma_order) {
+- case atl1c_dma_ord_in:
+- dma_ctrl_data |= DMA_CTRL_DMAR_IN_ORDER;
+- break;
+- case atl1c_dma_ord_enh:
+- dma_ctrl_data |= DMA_CTRL_DMAR_ENH_ORDER;
+- break;
+- case atl1c_dma_ord_out:
+- dma_ctrl_data |= DMA_CTRL_DMAR_OUT_ORDER;
+- break;
+- default:
+- break;
+- }
+-
+- dma_ctrl_data |= (((u32)hw->dmar_block) & DMA_CTRL_DMAR_BURST_LEN_MASK)
+- << DMA_CTRL_DMAR_BURST_LEN_SHIFT;
+- dma_ctrl_data |= (((u32)hw->dmaw_block) & DMA_CTRL_DMAW_BURST_LEN_MASK)
+- << DMA_CTRL_DMAW_BURST_LEN_SHIFT;
+- dma_ctrl_data |= (((u32)hw->dmar_dly_cnt) & DMA_CTRL_DMAR_DLY_CNT_MASK)
+- << DMA_CTRL_DMAR_DLY_CNT_SHIFT;
+- dma_ctrl_data |= (((u32)hw->dmaw_dly_cnt) & DMA_CTRL_DMAW_DLY_CNT_MASK)
+- << DMA_CTRL_DMAW_DLY_CNT_SHIFT;
++ dma_ctrl_data = FIELDX(DMA_CTRL_RORDER_MODE, DMA_CTRL_RORDER_MODE_OUT) |
++ DMA_CTRL_RREQ_PRI_DATA |
++ FIELDX(DMA_CTRL_RREQ_BLEN, hw->dmar_block) |
++ FIELDX(DMA_CTRL_WDLY_CNT, DMA_CTRL_WDLY_CNT_DEF) |
++ FIELDX(DMA_CTRL_RDLY_CNT, DMA_CTRL_RDLY_CNT_DEF);
+
+ AT_WRITE_REG(hw, REG_DMA_CTRL, dma_ctrl_data);
+ }
+@@ -1230,52 +1171,53 @@ static int atl1c_stop_mac(struct atl1c_hw *hw)
+ u32 data;
+
+ AT_READ_REG(hw, REG_RXQ_CTRL, &data);
+- data &= ~(RXQ1_CTRL_EN | RXQ2_CTRL_EN |
+- RXQ3_CTRL_EN | RXQ_CTRL_EN);
++ data &= ~RXQ_CTRL_EN;
+ AT_WRITE_REG(hw, REG_RXQ_CTRL, data);
+
+ AT_READ_REG(hw, REG_TXQ_CTRL, &data);
+ data &= ~TXQ_CTRL_EN;
+- AT_WRITE_REG(hw, REG_TWSI_CTRL, data);
++ AT_WRITE_REG(hw, REG_TXQ_CTRL, data);
+
+- atl1c_wait_until_idle(hw);
++ atl1c_wait_until_idle(hw, IDLE_STATUS_RXQ_BUSY | IDLE_STATUS_TXQ_BUSY);
+
+ AT_READ_REG(hw, REG_MAC_CTRL, &data);
+ data &= ~(MAC_CTRL_TX_EN | MAC_CTRL_RX_EN);
+ AT_WRITE_REG(hw, REG_MAC_CTRL, data);
+
+- return (int)atl1c_wait_until_idle(hw);
+-}
+-
+-static void atl1c_enable_rx_ctrl(struct atl1c_hw *hw)
+-{
+- u32 data;
+-
+- AT_READ_REG(hw, REG_RXQ_CTRL, &data);
+- switch (hw->adapter->num_rx_queues) {
+- case 4:
+- data |= (RXQ3_CTRL_EN | RXQ2_CTRL_EN | RXQ1_CTRL_EN);
+- break;
+- case 3:
+- data |= (RXQ2_CTRL_EN | RXQ1_CTRL_EN);
+- break;
+- case 2:
+- data |= RXQ1_CTRL_EN;
+- break;
+- default:
+- break;
+- }
+- data |= RXQ_CTRL_EN;
+- AT_WRITE_REG(hw, REG_RXQ_CTRL, data);
++ return (int)atl1c_wait_until_idle(hw,
++ IDLE_STATUS_TXMAC_BUSY | IDLE_STATUS_RXMAC_BUSY);
+ }
+
+-static void atl1c_enable_tx_ctrl(struct atl1c_hw *hw)
++static void atl1c_start_mac(struct atl1c_adapter *adapter)
+ {
+- u32 data;
++ struct atl1c_hw *hw = &adapter->hw;
++ u32 mac, txq, rxq;
++
++ hw->mac_duplex = adapter->link_duplex == FULL_DUPLEX ? true : false;
++ hw->mac_speed = adapter->link_speed == SPEED_1000 ?
++ atl1c_mac_speed_1000 : atl1c_mac_speed_10_100;
++
++ AT_READ_REG(hw, REG_TXQ_CTRL, &txq);
++ AT_READ_REG(hw, REG_RXQ_CTRL, &rxq);
++ AT_READ_REG(hw, REG_MAC_CTRL, &mac);
++
++ txq |= TXQ_CTRL_EN;
++ rxq |= RXQ_CTRL_EN;
++ mac |= MAC_CTRL_TX_EN | MAC_CTRL_TX_FLOW |
++ MAC_CTRL_RX_EN | MAC_CTRL_RX_FLOW |
++ MAC_CTRL_ADD_CRC | MAC_CTRL_PAD |
++ MAC_CTRL_BC_EN | MAC_CTRL_SINGLE_PAUSE_EN |
++ MAC_CTRL_HASH_ALG_CRC32;
++ if (hw->mac_duplex)
++ mac |= MAC_CTRL_DUPLX;
++ else
++ mac &= ~MAC_CTRL_DUPLX;
++ mac = FIELD_SETX(mac, MAC_CTRL_SPEED, hw->mac_speed);
++ mac = FIELD_SETX(mac, MAC_CTRL_PRMLEN, hw->preamble_len);
+
+- AT_READ_REG(hw, REG_TXQ_CTRL, &data);
+- data |= TXQ_CTRL_EN;
+- AT_WRITE_REG(hw, REG_TXQ_CTRL, data);
++ AT_WRITE_REG(hw, REG_TXQ_CTRL, txq);
++ AT_WRITE_REG(hw, REG_RXQ_CTRL, rxq);
++ AT_WRITE_REG(hw, REG_MAC_CTRL, mac);
+ }
+
+ /*
+@@ -1287,10 +1229,7 @@ static int atl1c_reset_mac(struct atl1c_hw *hw)
+ {
+ struct atl1c_adapter *adapter = (struct atl1c_adapter *)hw->adapter;
+ struct pci_dev *pdev = adapter->pdev;
+- u32 master_ctrl_data = 0;
+-
+- AT_WRITE_REG(hw, REG_IMR, 0);
+- AT_WRITE_REG(hw, REG_ISR, ISR_DIS_INT);
++ u32 ctrl_data = 0;
+
+ atl1c_stop_mac(hw);
+ /*
+@@ -1299,194 +1238,148 @@ static int atl1c_reset_mac(struct atl1c_hw *hw)
+ * the current PCI configuration. The global reset bit is self-
+ * clearing, and should clear within a microsecond.
+ */
+- AT_READ_REG(hw, REG_MASTER_CTRL, &master_ctrl_data);
+- master_ctrl_data |= MASTER_CTRL_OOB_DIS_OFF;
+- AT_WRITE_REGW(hw, REG_MASTER_CTRL, ((master_ctrl_data | MASTER_CTRL_SOFT_RST)
+- & 0xFFFF));
++ AT_READ_REG(hw, REG_MASTER_CTRL, &ctrl_data);
++ ctrl_data |= MASTER_CTRL_OOB_DIS;
++ AT_WRITE_REG(hw, REG_MASTER_CTRL, ctrl_data | MASTER_CTRL_SOFT_RST);
+
+ AT_WRITE_FLUSH(hw);
+ msleep(10);
+ /* Wait at least 10ms for All module to be Idle */
+
+- if (atl1c_wait_until_idle(hw)) {
++ if (atl1c_wait_until_idle(hw, IDLE_STATUS_MASK)) {
+ dev_err(&pdev->dev,
+ "MAC state machine can't be idle since"
+ " disabled for 10ms second\n");
+ return -1;
+ }
++ AT_WRITE_REG(hw, REG_MASTER_CTRL, ctrl_data);
++
++ /* driver control speed/duplex */
++ AT_READ_REG(hw, REG_MAC_CTRL, &ctrl_data);
++ AT_WRITE_REG(hw, REG_MAC_CTRL, ctrl_data | MAC_CTRL_SPEED_MODE_SW);
++
++ /* clk switch setting */
++ AT_READ_REG(hw, REG_SERDES, &ctrl_data);
++ switch (hw->nic_type) {
++ case athr_l2c_b:
++ ctrl_data &= ~(SERDES_PHY_CLK_SLOWDOWN |
++ SERDES_MAC_CLK_SLOWDOWN);
++ AT_WRITE_REG(hw, REG_SERDES, ctrl_data);
++ break;
++ case athr_l2c_b2:
++ case athr_l1d_2:
++ ctrl_data |= SERDES_PHY_CLK_SLOWDOWN | SERDES_MAC_CLK_SLOWDOWN;
++ AT_WRITE_REG(hw, REG_SERDES, ctrl_data);
++ break;
++ default:
++ break;
++ }
++
+ return 0;
+ }
+
+ static void atl1c_disable_l0s_l1(struct atl1c_hw *hw)
+ {
+- u32 pm_ctrl_data;
++ u16 ctrl_flags = hw->ctrl_flags;
+
+- AT_READ_REG(hw, REG_PM_CTRL, &pm_ctrl_data);
+- pm_ctrl_data &= ~(PM_CTRL_L1_ENTRY_TIMER_MASK <<
+- PM_CTRL_L1_ENTRY_TIMER_SHIFT);
+- pm_ctrl_data &= ~PM_CTRL_CLK_SWH_L1;
+- pm_ctrl_data &= ~PM_CTRL_ASPM_L0S_EN;
+- pm_ctrl_data &= ~PM_CTRL_ASPM_L1_EN;
+- pm_ctrl_data &= ~PM_CTRL_MAC_ASPM_CHK;
+- pm_ctrl_data &= ~PM_CTRL_SERDES_PD_EX_L1;
+-
+- pm_ctrl_data |= PM_CTRL_SERDES_BUDS_RX_L1_EN;
+- pm_ctrl_data |= PM_CTRL_SERDES_PLL_L1_EN;
+- pm_ctrl_data |= PM_CTRL_SERDES_L1_EN;
+- AT_WRITE_REG(hw, REG_PM_CTRL, pm_ctrl_data);
++ hw->ctrl_flags &= ~(ATL1C_ASPM_L0S_SUPPORT | ATL1C_ASPM_L1_SUPPORT);
++ atl1c_set_aspm(hw, SPEED_0);
++ hw->ctrl_flags = ctrl_flags;
+ }
+
+ /*
+ * Set ASPM state.
+ * Enable/disable L0s/L1 depend on link state.
+ */
+-static void atl1c_set_aspm(struct atl1c_hw *hw, bool linkup)
++static void atl1c_set_aspm(struct atl1c_hw *hw, u16 link_speed)
+ {
+ u32 pm_ctrl_data;
+- u32 link_ctrl_data;
+- u32 link_l1_timer = 0xF;
++ u32 link_l1_timer;
+
+ AT_READ_REG(hw, REG_PM_CTRL, &pm_ctrl_data);
+- AT_READ_REG(hw, REG_LINK_CTRL, &link_ctrl_data);
++ pm_ctrl_data &= ~(PM_CTRL_ASPM_L1_EN |
++ PM_CTRL_ASPM_L0S_EN |
++ PM_CTRL_MAC_ASPM_CHK);
++ /* L1 timer */
++ if (hw->nic_type == athr_l2c_b2 || hw->nic_type == athr_l1d_2) {
++ pm_ctrl_data &= ~PMCTRL_TXL1_AFTER_L0S;
++ link_l1_timer =
++ link_speed == SPEED_1000 || link_speed == SPEED_100 ?
++ L1D_PMCTRL_L1_ENTRY_TM_16US : 1;
++ pm_ctrl_data = FIELD_SETX(pm_ctrl_data,
++ L1D_PMCTRL_L1_ENTRY_TM, link_l1_timer);
++ } else {
++ link_l1_timer = hw->nic_type == athr_l2c_b ?
++ L2CB1_PM_CTRL_L1_ENTRY_TM : L1C_PM_CTRL_L1_ENTRY_TM;
++ if (link_speed != SPEED_1000 && link_speed != SPEED_100)
++ link_l1_timer = 1;
++ pm_ctrl_data = FIELD_SETX(pm_ctrl_data,
++ PM_CTRL_L1_ENTRY_TIMER, link_l1_timer);
++ }
+
+- pm_ctrl_data &= ~PM_CTRL_SERDES_PD_EX_L1;
+- pm_ctrl_data &= ~(PM_CTRL_L1_ENTRY_TIMER_MASK <<
+- PM_CTRL_L1_ENTRY_TIMER_SHIFT);
+- pm_ctrl_data &= ~(PM_CTRL_LCKDET_TIMER_MASK <<
+- PM_CTRL_LCKDET_TIMER_SHIFT);
+- pm_ctrl_data |= AT_LCKDET_TIMER << PM_CTRL_LCKDET_TIMER_SHIFT;
++ /* L0S/L1 enable */
++ if ((hw->ctrl_flags & ATL1C_ASPM_L0S_SUPPORT) && link_speed != SPEED_0)
++ pm_ctrl_data |= PM_CTRL_ASPM_L0S_EN | PM_CTRL_MAC_ASPM_CHK;
++ if (hw->ctrl_flags & ATL1C_ASPM_L1_SUPPORT)
++ pm_ctrl_data |= PM_CTRL_ASPM_L1_EN | PM_CTRL_MAC_ASPM_CHK;
+
++ /* l2cb & l1d & l2cb2 & l1d2 */
+ if (hw->nic_type == athr_l2c_b || hw->nic_type == athr_l1d ||
+- hw->nic_type == athr_l2c_b2 || hw->nic_type == athr_l1d_2) {
+- link_ctrl_data &= ~LINK_CTRL_EXT_SYNC;
+- if (!(hw->ctrl_flags & ATL1C_APS_MODE_ENABLE)) {
+- if (hw->nic_type == athr_l2c_b && hw->revision_id == L2CB_V10)
+- link_ctrl_data |= LINK_CTRL_EXT_SYNC;
+- }
+-
+- AT_WRITE_REG(hw, REG_LINK_CTRL, link_ctrl_data);
+-
+- pm_ctrl_data |= PM_CTRL_RCVR_WT_TIMER;
+- pm_ctrl_data &= ~(PM_CTRL_PM_REQ_TIMER_MASK <<
+- PM_CTRL_PM_REQ_TIMER_SHIFT);
+- pm_ctrl_data |= AT_ASPM_L1_TIMER <<
+- PM_CTRL_PM_REQ_TIMER_SHIFT;
+- pm_ctrl_data &= ~PM_CTRL_SA_DLY_EN;
+- pm_ctrl_data &= ~PM_CTRL_HOTRST;
+- pm_ctrl_data |= 1 << PM_CTRL_L1_ENTRY_TIMER_SHIFT;
+- pm_ctrl_data |= PM_CTRL_SERDES_PD_EX_L1;
+- }
+- pm_ctrl_data |= PM_CTRL_MAC_ASPM_CHK;
+- if (linkup) {
+- pm_ctrl_data &= ~PM_CTRL_ASPM_L1_EN;
+- pm_ctrl_data &= ~PM_CTRL_ASPM_L0S_EN;
+- if (hw->ctrl_flags & ATL1C_ASPM_L1_SUPPORT)
+- pm_ctrl_data |= PM_CTRL_ASPM_L1_EN;
+- if (hw->ctrl_flags & ATL1C_ASPM_L0S_SUPPORT)
+- pm_ctrl_data |= PM_CTRL_ASPM_L0S_EN;
+-
+- if (hw->nic_type == athr_l2c_b || hw->nic_type == athr_l1d ||
+- hw->nic_type == athr_l2c_b2 || hw->nic_type == athr_l1d_2) {
+- if (hw->nic_type == athr_l2c_b)
+- if (!(hw->ctrl_flags & ATL1C_APS_MODE_ENABLE))
+- pm_ctrl_data &= ~PM_CTRL_ASPM_L0S_EN;
+- pm_ctrl_data &= ~PM_CTRL_SERDES_L1_EN;
+- pm_ctrl_data &= ~PM_CTRL_SERDES_PLL_L1_EN;
+- pm_ctrl_data &= ~PM_CTRL_SERDES_BUDS_RX_L1_EN;
+- pm_ctrl_data |= PM_CTRL_CLK_SWH_L1;
+- if (hw->adapter->link_speed == SPEED_100 ||
+- hw->adapter->link_speed == SPEED_1000) {
+- pm_ctrl_data &= ~(PM_CTRL_L1_ENTRY_TIMER_MASK <<
+- PM_CTRL_L1_ENTRY_TIMER_SHIFT);
+- if (hw->nic_type == athr_l2c_b)
+- link_l1_timer = 7;
+- else if (hw->nic_type == athr_l2c_b2 ||
+- hw->nic_type == athr_l1d_2)
+- link_l1_timer = 4;
+- pm_ctrl_data |= link_l1_timer <<
+- PM_CTRL_L1_ENTRY_TIMER_SHIFT;
+- }
+- } else {
+- pm_ctrl_data |= PM_CTRL_SERDES_L1_EN;
+- pm_ctrl_data |= PM_CTRL_SERDES_PLL_L1_EN;
+- pm_ctrl_data |= PM_CTRL_SERDES_BUDS_RX_L1_EN;
+- pm_ctrl_data &= ~PM_CTRL_CLK_SWH_L1;
++ hw->nic_type == athr_l2c_b2 || hw->nic_type == athr_l1d_2) {
++ pm_ctrl_data = FIELD_SETX(pm_ctrl_data,
++ PM_CTRL_PM_REQ_TIMER, PM_CTRL_PM_REQ_TO_DEF);
++ pm_ctrl_data |= PM_CTRL_RCVR_WT_TIMER |
++ PM_CTRL_SERDES_PD_EX_L1 |
++ PM_CTRL_CLK_SWH_L1;
++ pm_ctrl_data &= ~(PM_CTRL_SERDES_L1_EN |
++ PM_CTRL_SERDES_PLL_L1_EN |
++ PM_CTRL_SERDES_BUFS_RX_L1_EN |
++ PM_CTRL_SA_DLY_EN |
++ PM_CTRL_HOTRST);
++ /* disable l0s if link down or l2cb */
++ if (link_speed == SPEED_0 || hw->nic_type == athr_l2c_b)
+ pm_ctrl_data &= ~PM_CTRL_ASPM_L0S_EN;
+- pm_ctrl_data &= ~PM_CTRL_ASPM_L1_EN;
+-
++ } else { /* l1c */
++ pm_ctrl_data =
++ FIELD_SETX(pm_ctrl_data, PM_CTRL_L1_ENTRY_TIMER, 0);
++ if (link_speed != SPEED_0) {
++ pm_ctrl_data |= PM_CTRL_SERDES_L1_EN |
++ PM_CTRL_SERDES_PLL_L1_EN |
++ PM_CTRL_SERDES_BUFS_RX_L1_EN;
++ pm_ctrl_data &= ~(PM_CTRL_SERDES_PD_EX_L1 |
++ PM_CTRL_CLK_SWH_L1 |
++ PM_CTRL_ASPM_L0S_EN |
++ PM_CTRL_ASPM_L1_EN);
++ } else { /* link down */
++ pm_ctrl_data |= PM_CTRL_CLK_SWH_L1;
++ pm_ctrl_data &= ~(PM_CTRL_SERDES_L1_EN |
++ PM_CTRL_SERDES_PLL_L1_EN |
++ PM_CTRL_SERDES_BUFS_RX_L1_EN |
++ PM_CTRL_ASPM_L0S_EN);
+ }
+- } else {
+- pm_ctrl_data &= ~PM_CTRL_SERDES_L1_EN;
+- pm_ctrl_data &= ~PM_CTRL_ASPM_L0S_EN;
+- pm_ctrl_data &= ~PM_CTRL_SERDES_PLL_L1_EN;
+- pm_ctrl_data |= PM_CTRL_CLK_SWH_L1;
+-
+- if (hw->ctrl_flags & ATL1C_ASPM_L1_SUPPORT)
+- pm_ctrl_data |= PM_CTRL_ASPM_L1_EN;
+- else
+- pm_ctrl_data &= ~PM_CTRL_ASPM_L1_EN;
+ }
+ AT_WRITE_REG(hw, REG_PM_CTRL, pm_ctrl_data);
+
+ return;
+ }
+
+-static void atl1c_setup_mac_ctrl(struct atl1c_adapter *adapter)
+-{
+- struct atl1c_hw *hw = &adapter->hw;
+- struct net_device *netdev = adapter->netdev;
+- u32 mac_ctrl_data;
+-
+- mac_ctrl_data = MAC_CTRL_TX_EN | MAC_CTRL_RX_EN;
+- mac_ctrl_data |= (MAC_CTRL_TX_FLOW | MAC_CTRL_RX_FLOW);
+-
+- if (adapter->link_duplex == FULL_DUPLEX) {
+- hw->mac_duplex = true;
+- mac_ctrl_data |= MAC_CTRL_DUPLX;
+- }
+-
+- if (adapter->link_speed == SPEED_1000)
+- hw->mac_speed = atl1c_mac_speed_1000;
+- else
+- hw->mac_speed = atl1c_mac_speed_10_100;
+-
+- mac_ctrl_data |= (hw->mac_speed & MAC_CTRL_SPEED_MASK) <<
+- MAC_CTRL_SPEED_SHIFT;
+-
+- mac_ctrl_data |= (MAC_CTRL_ADD_CRC | MAC_CTRL_PAD);
+- mac_ctrl_data |= ((hw->preamble_len & MAC_CTRL_PRMLEN_MASK) <<
+- MAC_CTRL_PRMLEN_SHIFT);
+-
+- __atl1c_vlan_mode(netdev->features, &mac_ctrl_data);
+-
+- mac_ctrl_data |= MAC_CTRL_BC_EN;
+- if (netdev->flags & IFF_PROMISC)
+- mac_ctrl_data |= MAC_CTRL_PROMIS_EN;
+- if (netdev->flags & IFF_ALLMULTI)
+- mac_ctrl_data |= MAC_CTRL_MC_ALL_EN;
+-
+- mac_ctrl_data |= MAC_CTRL_SINGLE_PAUSE_EN;
+- if (hw->nic_type == athr_l1d || hw->nic_type == athr_l2c_b2 ||
+- hw->nic_type == athr_l1d_2) {
+- mac_ctrl_data |= MAC_CTRL_SPEED_MODE_SW;
+- mac_ctrl_data |= MAC_CTRL_HASH_ALG_CRC32;
+- }
+- AT_WRITE_REG(hw, REG_MAC_CTRL, mac_ctrl_data);
+-}
+-
+ /*
+ * atl1c_configure - Configure Transmit&Receive Unit after Reset
+ * @adapter: board private structure
+ *
+ * Configure the Tx /Rx unit of the MAC after a reset.
+ */
+-static int atl1c_configure(struct atl1c_adapter *adapter)
++static int atl1c_configure_mac(struct atl1c_adapter *adapter)
+ {
+ struct atl1c_hw *hw = &adapter->hw;
+ u32 master_ctrl_data = 0;
+ u32 intr_modrt_data;
+ u32 data;
+
++ AT_READ_REG(hw, REG_MASTER_CTRL, &master_ctrl_data);
++ master_ctrl_data &= ~(MASTER_CTRL_TX_ITIMER_EN |
++ MASTER_CTRL_RX_ITIMER_EN |
++ MASTER_CTRL_INT_RDCLR);
+ /* clear interrupt status */
+ AT_WRITE_REG(hw, REG_ISR, 0xFFFFFFFF);
+ /* Clear any WOL status */
+@@ -1525,30 +1418,39 @@ static int atl1c_configure(struct atl1c_adapter *adapter)
+ master_ctrl_data |= MASTER_CTRL_SA_TIMER_EN;
+ AT_WRITE_REG(hw, REG_MASTER_CTRL, master_ctrl_data);
+
+- if (hw->ctrl_flags & ATL1C_CMB_ENABLE) {
+- AT_WRITE_REG(hw, REG_CMB_TPD_THRESH,
+- hw->cmb_tpd & CMB_TPD_THRESH_MASK);
+- AT_WRITE_REG(hw, REG_CMB_TX_TIMER,
+- hw->cmb_tx_timer & CMB_TX_TIMER_MASK);
+- }
++ AT_WRITE_REG(hw, REG_SMB_STAT_TIMER,
++ hw->smb_timer & SMB_STAT_TIMER_MASK);
+
+- if (hw->ctrl_flags & ATL1C_SMB_ENABLE)
+- AT_WRITE_REG(hw, REG_SMB_STAT_TIMER,
+- hw->smb_timer & SMB_STAT_TIMER_MASK);
+ /* set MTU */
+ AT_WRITE_REG(hw, REG_MTU, hw->max_frame_size + ETH_HLEN +
+ VLAN_HLEN + ETH_FCS_LEN);
+- /* HDS, disable */
+- AT_WRITE_REG(hw, REG_HDS_CTRL, 0);
+
+ atl1c_configure_tx(adapter);
+ atl1c_configure_rx(adapter);
+- atl1c_configure_rss(adapter);
+ atl1c_configure_dma(adapter);
+
+ return 0;
+ }
+
++static int atl1c_configure(struct atl1c_adapter *adapter)
++{
++ struct net_device *netdev = adapter->netdev;
++ int num;
++
++ atl1c_init_ring_ptrs(adapter);
++ atl1c_set_multi(netdev);
++ atl1c_restore_vlan(adapter);
++
++ num = atl1c_alloc_rx_buffer(adapter);
++ if (unlikely(num == 0))
++ return -ENOMEM;
++
++ if (atl1c_configure_mac(adapter))
++ return -EIO;
++
++ return 0;
++}
++
+ static void atl1c_update_hw_stats(struct atl1c_adapter *adapter)
+ {
+ u16 hw_reg_addr = 0;
+@@ -1635,16 +1537,11 @@ static bool atl1c_clean_tx_irq(struct atl1c_adapter *adapter,
+ struct pci_dev *pdev = adapter->pdev;
+ u16 next_to_clean = atomic_read(&tpd_ring->next_to_clean);
+ u16 hw_next_to_clean;
+- u16 shift;
+- u32 data;
++ u16 reg;
+
+- if (type == atl1c_trans_high)
+- shift = MB_HTPD_CONS_IDX_SHIFT;
+- else
+- shift = MB_NTPD_CONS_IDX_SHIFT;
++ reg = type == atl1c_trans_high ? REG_TPD_PRI1_CIDX : REG_TPD_PRI0_CIDX;
+
+- AT_READ_REG(&adapter->hw, REG_MB_PRIO_CONS_IDX, &data);
+- hw_next_to_clean = (data >> shift) & MB_PRIO_PROD_IDX_MASK;
++ AT_READ_REGW(&adapter->hw, reg, &hw_next_to_clean);
+
+ while (next_to_clean != hw_next_to_clean) {
+ buffer_info = &tpd_ring->buffer_info[next_to_clean];
+@@ -1746,9 +1643,9 @@ static inline void atl1c_rx_checksum(struct atl1c_adapter *adapter,
+ skb_checksum_none_assert(skb);
+ }
+
+-static int atl1c_alloc_rx_buffer(struct atl1c_adapter *adapter, const int ringid)
++static int atl1c_alloc_rx_buffer(struct atl1c_adapter *adapter)
+ {
+- struct atl1c_rfd_ring *rfd_ring = &adapter->rfd_ring[ringid];
++ struct atl1c_rfd_ring *rfd_ring = &adapter->rfd_ring;
+ struct pci_dev *pdev = adapter->pdev;
+ struct atl1c_buffer *buffer_info, *next_info;
+ struct sk_buff *skb;
+@@ -1800,7 +1697,7 @@ static int atl1c_alloc_rx_buffer(struct atl1c_adapter *adapter, const int ringid
+ /* TODO: update mailbox here */
+ wmb();
+ rfd_ring->next_to_use = rfd_next_to_use;
+- AT_WRITE_REG(&adapter->hw, atl1c_rfd_prod_idx_regs[ringid],
++ AT_WRITE_REG(&adapter->hw, REG_MB_RFD0_PROD_IDX,
+ rfd_ring->next_to_use & MB_RFDX_PROD_IDX_MASK);
+ }
+
+@@ -1839,7 +1736,7 @@ static void atl1c_clean_rfd(struct atl1c_rfd_ring *rfd_ring,
+ rfd_ring->next_to_clean = rfd_index;
+ }
+
+-static void atl1c_clean_rx_irq(struct atl1c_adapter *adapter, u8 que,
++static void atl1c_clean_rx_irq(struct atl1c_adapter *adapter,
+ int *work_done, int work_to_do)
+ {
+ u16 rfd_num, rfd_index;
+@@ -1847,8 +1744,8 @@ static void atl1c_clean_rx_irq(struct atl1c_adapter *adapter, u8 que,
+ u16 length;
+ struct pci_dev *pdev = adapter->pdev;
+ struct net_device *netdev = adapter->netdev;
+- struct atl1c_rfd_ring *rfd_ring = &adapter->rfd_ring[que];
+- struct atl1c_rrd_ring *rrd_ring = &adapter->rrd_ring[que];
++ struct atl1c_rfd_ring *rfd_ring = &adapter->rfd_ring;
++ struct atl1c_rrd_ring *rrd_ring = &adapter->rrd_ring;
+ struct sk_buff *skb;
+ struct atl1c_recv_ret_status *rrs;
+ struct atl1c_buffer *buffer_info;
+@@ -1914,7 +1811,7 @@ rrs_checked:
+ count++;
+ }
+ if (count)
+- atl1c_alloc_rx_buffer(adapter, que);
++ atl1c_alloc_rx_buffer(adapter);
+ }
+
+ /*
+@@ -1931,7 +1828,7 @@ static int atl1c_clean(struct napi_struct *napi, int budget)
+ if (!netif_carrier_ok(adapter->netdev))
+ goto quit_polling;
+ /* just enable one RXQ */
+- atl1c_clean_rx_irq(adapter, 0, &work_done, budget);
++ atl1c_clean_rx_irq(adapter, &work_done, budget);
+
+ if (work_done < budget) {
+ quit_polling:
+@@ -2206,23 +2103,10 @@ static void atl1c_tx_queue(struct atl1c_adapter *adapter, struct sk_buff *skb,
+ struct atl1c_tpd_desc *tpd, enum atl1c_trans_queue type)
+ {
+ struct atl1c_tpd_ring *tpd_ring = &adapter->tpd_ring[type];
+- u32 prod_data;
++ u16 reg;
+
+- AT_READ_REG(&adapter->hw, REG_MB_PRIO_PROD_IDX, &prod_data);
+- switch (type) {
+- case atl1c_trans_high:
+- prod_data &= 0xFFFF0000;
+- prod_data |= tpd_ring->next_to_use & 0xFFFF;
+- break;
+- case atl1c_trans_normal:
+- prod_data &= 0x0000FFFF;
+- prod_data |= (tpd_ring->next_to_use & 0xFFFF) << 16;
+- break;
+- default:
+- break;
+- }
+- wmb();
+- AT_WRITE_REG(&adapter->hw, REG_MB_PRIO_PROD_IDX, prod_data);
++ reg = type == atl1c_trans_high ? REG_TPD_PRI1_PIDX : REG_TPD_PRI0_PIDX;
++ AT_WRITE_REGW(&adapter->hw, reg, tpd_ring->next_to_use);
+ }
+
+ static netdev_tx_t atl1c_xmit_frame(struct sk_buff *skb,
+@@ -2307,8 +2191,7 @@ static int atl1c_request_irq(struct atl1c_adapter *adapter)
+ "Unable to allocate MSI interrupt Error: %d\n",
+ err);
+ adapter->have_msi = false;
+- } else
+- netdev->irq = pdev->irq;
++ }
+
+ if (!adapter->have_msi)
+ flags |= IRQF_SHARED;
+@@ -2328,44 +2211,38 @@ static int atl1c_request_irq(struct atl1c_adapter *adapter)
+ return err;
+ }
+
++
++static void atl1c_reset_dma_ring(struct atl1c_adapter *adapter)
++{
++ /* release tx-pending skbs and reset tx/rx ring index */
++ atl1c_clean_tx_ring(adapter, atl1c_trans_normal);
++ atl1c_clean_tx_ring(adapter, atl1c_trans_high);
++ atl1c_clean_rx_ring(adapter);
++}
++
+ static int atl1c_up(struct atl1c_adapter *adapter)
+ {
+ struct net_device *netdev = adapter->netdev;
+- int num;
+ int err;
+- int i;
+
+ netif_carrier_off(netdev);
+- atl1c_init_ring_ptrs(adapter);
+- atl1c_set_multi(netdev);
+- atl1c_restore_vlan(adapter);
+
+- for (i = 0; i < adapter->num_rx_queues; i++) {
+- num = atl1c_alloc_rx_buffer(adapter, i);
+- if (unlikely(num == 0)) {
+- err = -ENOMEM;
+- goto err_alloc_rx;
+- }
+- }
+-
+- if (atl1c_configure(adapter)) {
+- err = -EIO;
++ err = atl1c_configure(adapter);
++ if (unlikely(err))
+ goto err_up;
+- }
+
+ err = atl1c_request_irq(adapter);
+ if (unlikely(err))
+ goto err_up;
+
++ atl1c_check_link_status(adapter);
+ clear_bit(__AT_DOWN, &adapter->flags);
+ napi_enable(&adapter->napi);
+ atl1c_irq_enable(adapter);
+- atl1c_check_link_status(adapter);
+ netif_start_queue(netdev);
+ return err;
+
+ err_up:
+-err_alloc_rx:
+ atl1c_clean_rx_ring(adapter);
+ return err;
+ }
+@@ -2383,15 +2260,15 @@ static void atl1c_down(struct atl1c_adapter *adapter)
+ napi_disable(&adapter->napi);
+ atl1c_irq_disable(adapter);
+ atl1c_free_irq(adapter);
++ /* disable ASPM if device inactive */
++ atl1c_disable_l0s_l1(&adapter->hw);
+ /* reset MAC to disable all RX/TX */
+ atl1c_reset_mac(&adapter->hw);
+ msleep(1);
+
+ adapter->link_speed = SPEED_0;
+ adapter->link_duplex = -1;
+- atl1c_clean_tx_ring(adapter, atl1c_trans_normal);
+- atl1c_clean_tx_ring(adapter, atl1c_trans_high);
+- atl1c_clean_rx_ring(adapter);
++ atl1c_reset_dma_ring(adapter);
+ }
+
+ /*
+@@ -2424,13 +2301,6 @@ static int atl1c_open(struct net_device *netdev)
+ if (unlikely(err))
+ goto err_up;
+
+- if (adapter->hw.ctrl_flags & ATL1C_FPGA_VERSION) {
+- u32 phy_data;
+-
+- AT_READ_REG(&adapter->hw, REG_MDIO_CTRL, &phy_data);
+- phy_data |= MDIO_AP_EN;
+- AT_WRITE_REG(&adapter->hw, REG_MDIO_CTRL, phy_data);
+- }
+ return 0;
+
+ err_up:
+@@ -2456,6 +2326,8 @@ static int atl1c_close(struct net_device *netdev)
+ struct atl1c_adapter *adapter = netdev_priv(netdev);
+
+ WARN_ON(test_bit(__AT_RESETTING, &adapter->flags));
++ set_bit(__AT_DOWN, &adapter->flags);
++ cancel_work_sync(&adapter->common_task);
+ atl1c_down(adapter);
+ atl1c_free_ring_resources(adapter);
+ return 0;
+@@ -2467,10 +2339,6 @@ static int atl1c_suspend(struct device *dev)
+ struct net_device *netdev = pci_get_drvdata(pdev);
+ struct atl1c_adapter *adapter = netdev_priv(netdev);
+ struct atl1c_hw *hw = &adapter->hw;
+- u32 mac_ctrl_data = 0;
+- u32 master_ctrl_data = 0;
+- u32 wol_ctrl_data = 0;
+- u16 mii_intr_status_data = 0;
+ u32 wufc = adapter->wol;
+
+ atl1c_disable_l0s_l1(hw);
+@@ -2481,75 +2349,10 @@ static int atl1c_suspend(struct device *dev)
+ netif_device_detach(netdev);
+
+ if (wufc)
+- if (atl1c_phy_power_saving(hw) != 0)
++ if (atl1c_phy_to_ps_link(hw) != 0)
+ dev_dbg(&pdev->dev, "phy power saving failed");
+
+- AT_READ_REG(hw, REG_MASTER_CTRL, &master_ctrl_data);
+- AT_READ_REG(hw, REG_MAC_CTRL, &mac_ctrl_data);
+-
+- master_ctrl_data &= ~MASTER_CTRL_CLK_SEL_DIS;
+- mac_ctrl_data &= ~(MAC_CTRL_PRMLEN_MASK << MAC_CTRL_PRMLEN_SHIFT);
+- mac_ctrl_data |= (((u32)adapter->hw.preamble_len &
+- MAC_CTRL_PRMLEN_MASK) <<
+- MAC_CTRL_PRMLEN_SHIFT);
+- mac_ctrl_data &= ~(MAC_CTRL_SPEED_MASK << MAC_CTRL_SPEED_SHIFT);
+- mac_ctrl_data &= ~MAC_CTRL_DUPLX;
+-
+- if (wufc) {
+- mac_ctrl_data |= MAC_CTRL_RX_EN;
+- if (adapter->link_speed == SPEED_1000 ||
+- adapter->link_speed == SPEED_0) {
+- mac_ctrl_data |= atl1c_mac_speed_1000 <<
+- MAC_CTRL_SPEED_SHIFT;
+- mac_ctrl_data |= MAC_CTRL_DUPLX;
+- } else
+- mac_ctrl_data |= atl1c_mac_speed_10_100 <<
+- MAC_CTRL_SPEED_SHIFT;
+-
+- if (adapter->link_duplex == DUPLEX_FULL)
+- mac_ctrl_data |= MAC_CTRL_DUPLX;
+-
+- /* turn on magic packet wol */
+- if (wufc & AT_WUFC_MAG)
+- wol_ctrl_data |= WOL_MAGIC_EN | WOL_MAGIC_PME_EN;
+-
+- if (wufc & AT_WUFC_LNKC) {
+- wol_ctrl_data |= WOL_LINK_CHG_EN | WOL_LINK_CHG_PME_EN;
+- /* only link up can wake up */
+- if (atl1c_write_phy_reg(hw, MII_IER, IER_LINK_UP) != 0) {
+- dev_dbg(&pdev->dev, "%s: read write phy "
+- "register failed.\n",
+- atl1c_driver_name);
+- }
+- }
+- /* clear phy interrupt */
+- atl1c_read_phy_reg(hw, MII_ISR, &mii_intr_status_data);
+- /* Config MAC Ctrl register */
+- __atl1c_vlan_mode(netdev->features, &mac_ctrl_data);
+-
+- /* magic packet maybe Broadcast&multicast&Unicast frame */
+- if (wufc & AT_WUFC_MAG)
+- mac_ctrl_data |= MAC_CTRL_BC_EN;
+-
+- dev_dbg(&pdev->dev,
+- "%s: suspend MAC=0x%x\n",
+- atl1c_driver_name, mac_ctrl_data);
+- AT_WRITE_REG(hw, REG_MASTER_CTRL, master_ctrl_data);
+- AT_WRITE_REG(hw, REG_WOL_CTRL, wol_ctrl_data);
+- AT_WRITE_REG(hw, REG_MAC_CTRL, mac_ctrl_data);
+-
+- AT_WRITE_REG(hw, REG_GPHY_CTRL, GPHY_CTRL_DEFAULT |
+- GPHY_CTRL_EXT_RESET);
+- } else {
+- AT_WRITE_REG(hw, REG_GPHY_CTRL, GPHY_CTRL_POWER_SAVING);
+- master_ctrl_data |= MASTER_CTRL_CLK_SEL_DIS;
+- mac_ctrl_data |= atl1c_mac_speed_10_100 << MAC_CTRL_SPEED_SHIFT;
+- mac_ctrl_data |= MAC_CTRL_DUPLX;
+- AT_WRITE_REG(hw, REG_MASTER_CTRL, master_ctrl_data);
+- AT_WRITE_REG(hw, REG_MAC_CTRL, mac_ctrl_data);
+- AT_WRITE_REG(hw, REG_WOL_CTRL, 0);
+- hw->phy_configured = false; /* re-init PHY when resume */
+- }
++ atl1c_power_saving(hw, wufc);
+
+ return 0;
+ }
+@@ -2562,8 +2365,7 @@ static int atl1c_resume(struct device *dev)
+ struct atl1c_adapter *adapter = netdev_priv(netdev);
+
+ AT_WRITE_REG(&adapter->hw, REG_WOL_CTRL, 0);
+- atl1c_reset_pcie(&adapter->hw, ATL1C_PCIE_L0S_L1_DISABLE |
+- ATL1C_PCIE_PHY_RESET);
++ atl1c_reset_pcie(&adapter->hw, ATL1C_PCIE_L0S_L1_DISABLE);
+
+ atl1c_phy_reset(&adapter->hw);
+ atl1c_reset_mac(&adapter->hw);
+@@ -2616,7 +2418,6 @@ static int atl1c_init_netdev(struct net_device *netdev, struct pci_dev *pdev)
+ SET_NETDEV_DEV(netdev, &pdev->dev);
+ pci_set_drvdata(pdev, netdev);
+
+- netdev->irq = pdev->irq;
+ netdev->netdev_ops = &atl1c_netdev_ops;
+ netdev->watchdog_timeo = AT_TX_WATCHDOG;
+ atl1c_set_ethtool_ops(netdev);
+@@ -2706,14 +2507,13 @@ static int __devinit atl1c_probe(struct pci_dev *pdev,
+ dev_err(&pdev->dev, "cannot map device registers\n");
+ goto err_ioremap;
+ }
+- netdev->base_addr = (unsigned long)adapter->hw.hw_addr;
+
+ /* init mii data */
+ adapter->mii.dev = netdev;
+ adapter->mii.mdio_read = atl1c_mdio_read;
+ adapter->mii.mdio_write = atl1c_mdio_write;
+ adapter->mii.phy_id_mask = 0x1f;
+- adapter->mii.reg_num_mask = MDIO_REG_ADDR_MASK;
++ adapter->mii.reg_num_mask = MDIO_CTRL_REG_MASK;
+ netif_napi_add(netdev, &adapter->napi, atl1c_clean, 64);
+ setup_timer(&adapter->phy_config_timer, atl1c_phy_config,
+ (unsigned long)adapter);
+@@ -2723,8 +2523,7 @@ static int __devinit atl1c_probe(struct pci_dev *pdev,
+ dev_err(&pdev->dev, "net device private data init failed\n");
+ goto err_sw_init;
+ }
+- atl1c_reset_pcie(&adapter->hw, ATL1C_PCIE_L0S_L1_DISABLE |
+- ATL1C_PCIE_PHY_RESET);
++ atl1c_reset_pcie(&adapter->hw, ATL1C_PCIE_L0S_L1_DISABLE);
+
+ /* Init GPHY as early as possible due to power saving issue */
+ atl1c_phy_reset(&adapter->hw);
+@@ -2752,7 +2551,7 @@ static int __devinit atl1c_probe(struct pci_dev *pdev,
+ dev_dbg(&pdev->dev, "mac address : %pM\n",
+ adapter->hw.mac_addr);
+
+- atl1c_hw_set_mac_addr(&adapter->hw);
++ atl1c_hw_set_mac_addr(&adapter->hw, adapter->hw.mac_addr);
+ INIT_WORK(&adapter->common_task, atl1c_common_task);
+ adapter->work_event = 0;
+ err = register_netdev(netdev);
+@@ -2796,6 +2595,8 @@ static void __devexit atl1c_remove(struct pci_dev *pdev)
+ struct atl1c_adapter *adapter = netdev_priv(netdev);
+
+ unregister_netdev(netdev);
++ /* restore permanent address */
++ atl1c_hw_set_mac_addr(&adapter->hw, adapter->hw.perm_mac_addr);
+ atl1c_phy_disable(&adapter->hw);
+
+ iounmap(adapter->hw.hw_addr);
diff --git a/freed-ora/current/master/config-arm-generic b/freed-ora/current/master/config-arm-generic
index 6cc0d0d58..5aabaa67b 100644
--- a/freed-ora/current/master/config-arm-generic
+++ b/freed-ora/current/master/config-arm-generic
@@ -1,66 +1,94 @@
-CONFIG_ARM=y
-CONFIG_SYS_SUPPORTS_APM_EMULATION=y
-# CONFIG_SMP is not set
+# Generic ARM config. This is common config options that should be
+# enabled on all ARM kernels and hence should be added here
+#
+# FIXME - we need to add debug/nodebug generic build options
+# CONFIG_DEBUG_PER_CPU_MAPS is not set
-# CONFIG_CMDLINE_FORCE is not set
+# Generic ARM processor options
+CONFIG_ARM=y
-CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_ARM_THUMB=y
+CONFIG_AEABI=y
+CONFIG_OABI_COMPAT=y
+CONFIG_VFP=y
+CONFIG_ARM_UNWIND=y
-CONFIG_ARCH_VERSATILE=y
-CONFIG_ARCH_VERSATILE_PB=y
-CONFIG_MACH_VERSATILE_AB=y
-CONFIG_MACH_VERSATILE_DT=y
+CONFIG_SMP=y
+CONFIG_NR_CPUS=4
+CONFIG_SMP_ON_UP=y
-CONFIG_HIGHMEM=y
-# CONFIG_HIGHPTE is not set
+# CONFIG_FPE_NWFPE is not set
+CONFIG_FPE_FASTFPE=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
+# Generic ARM Errata
+CONFIG_ARM_ERRATA_720789=y
+CONFIG_ARM_ERRATA_751472=y
+CONFIG_OMAP4_ERRATA_I688=y
+# Generic ARM config options
CONFIG_ZBOOT_ROM_TEXT=0
CONFIG_ZBOOT_ROM_BSS=0
-# CONFIG_XIP_KERNEL is not set
-
CONFIG_ATAGS_PROC=y
+# DeviceTree
+CONFIG_USE_OF=y
+# CONFIG_OF_SELFTEST is not set
+CONFIG_PROC_DEVICETREE=y
+CONFIG_ARM_APPENDED_DTB=y
+
+# Generic options we want for ARM that aren't defualt
+CONFIG_HIGHMEM=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+
+CONFIG_SCHED_MC=y
+CONFIG_SCHED_SMT=y
+
+CONFIG_RCU_FANOUT=32
+
CONFIG_CPU_IDLE=y
# CONFIG_CPU_IDLE_GOV_LADDER is not set
-ONFIG_CPU_IDLE_GOV_MENU=y
+CONFIG_CPU_IDLE_GOV_MENU=y
CONFIG_NO_HZ=y
CONFIG_HIGH_RES_TIMERS=y
-# CONFIG_FPE_NWFPE is not set
-CONFIG_FPE_FASTFPE=y
-CONFIG_VFP=y
-
CONFIG_PM=y
-# CONFIG_PM_DEBUG is not set
-# CONFIG_PM_TRACE is not set
+CONFIG_PM_STD_PARTITION=""
CONFIG_SUSPEND=y
-# CONFIG_PM_TEST_SUSPEND is not set
-CONFIG_APM_EMULATION=y
+CONFIG_ARM_CPU_SUSPEND=y
+CONFIG_ARM_CPU_TOPOLOGY=y
-CONFIG_ARM_THUMB=y
+CONFIG_THERMAL=y
-CONFIG_AEABI=y
-CONFIG_OABI_COMPAT=y
+CONFIG_PERF_EVENTS=y
+CONFIG_PERF_COUNTERS=y
-CONFIG_HW_PERF_EVENTS=y
+CONFIG_CC_STACKPROTECTOR=y
-# CONFIG_UACCESS_WITH_MEMCPY is not set
+CONFIG_AUTO_ZRELADDR=y
-CONFIG_CMDLINE="console=ttyAM0,115200 root=/dev/sda1 rootdelay=20"
+CONFIG_SECCOMP=y
+CONFIG_STRICT_DEVMEM=y
+
+CONFIG_SPARSE_IRQ=y
+CONFIG_DEFAULT_MMAP_MIN_ADDR=32768
+CONFIG_LSM_MMAP_MIN_ADDR=32768
+
+# Generic HW for all ARM platforms
CONFIG_LEDS=y
CONFIG_LEDS_CPU=y
+CONFIG_LEDS_GPIO=m
-CONFIG_MTD_AFS_PARTS=y
-CONFIG_MTD_ARM_INTEGRATOR=y
-CONFIG_MTD_IMPA7=y
+CONFIG_RFKILL_GPIO=m
+CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
+
+CONFIG_SND_ARM=y
+CONFIG_SND_ARMAACI=m
+CONFIG_SND_SOC=m
+# CONFIG_SND_SOC_CACHE_LZO is not set
+CONFIG_SND_SOC_ALL_CODECS=m
CONFIG_AX88796=m
CONFIG_AX88796_93CX6=y
@@ -71,103 +99,35 @@ CONFIG_DM9000_DEBUGLEVEL=4
CONFIG_SMC911X=m
CONFIG_SMSC911X=m
-CONFIG_SERIO_AMBAKMI=m
-
-CONFIG_SERIAL_AMBA_PL011=y
-CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
-
-CONFIG_I2C_VERSATILE=y
-
-CONFIG_THERMAL=y
-
-# CONFIG_MFD_T7L66XB is not set
-# CONFIG_MFD_TC6387XB is not set
-
-CONFIG_FB_ARMCLCD=m
-
-CONFIG_SND_ARM=y
-CONFIG_SND_ARMAACI=m
-CONFIG_SND_SOC=m
-# CONFIG_SND_SOC_CACHE_LZO is not set
-# CONFIG_SND_SOC_ALL_CODECS is not set
-
-CONFIG_USB_MUSB_HDRC=y
-CONFIG_MUSB_PIO_ONLY=y
-CONFIG_USB_TUSB6010=y
-# CONFIG_USB_MUSB_DEBUG is not set
-
-CONFIG_MMC_ARMMMCI=m
-CONFIG_MMC_DW=m
-# CONFIG_MMC_DW_IDMAC is not set
-
-CONFIG_RTC_DRV_PL030=m
-CONFIG_RTC_DRV_PL031=m
-
-# CONFIG_SGI_IOC4 is not set
-
-# CONFIG_DEBUG_USER is not set
-# CONFIG_DEBUG_ERRORS is not set
-# CONFIG_DEBUG_LL is not set
-# CONFIG_DEBUG_PER_CPU_MAPS is not set
-
-CONFIG_ARM_UNWIND=y
-
-CONFIG_RCU_FANOUT=32
-
-# CONFIG_USB_ULPI is not set
-# CONFIG_OC_ETM is not set
-
+# Generic MTD options. Platform specific set there
+CONFIG_MTD=y
+CONFIG_MTD_TESTS=m
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set
+# CONFIG_MTD_AR7_PARTS is not set
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+CONFIG_SM_FTL=m
+CONFIG_MTD_PHYSMAP=m
+# CONFIG_MTD_PHYSMAP_COMPAT is not set
+# CONFIG_MTD_GPIO_ADDR is not set
+CONFIG_MTD_PLATRAM=m
+CONFIG_MTD_AFS_PARTS=y
+CONFIG_MTD_ARM_INTEGRATOR=y
+CONFIG_MTD_IMPA7=y
# CONFIG_MTD_PISMO is not set
-
-CONFIG_PERF_EVENTS=y
-CONFIG_PERF_COUNTERS=y
-
-# CONFIG_MG_DISK is not set
-# CONFIG_GPIO_PL061 is not set
-
-CONFIG_CC_STACKPROTECTOR=y
-
-CONFIG_AUTO_ZRELADDR=y
-
-# CONFIG_ARM_CHARLCD is not set
-# CONFIG_DEPRECATED_PARAM_STRUCT is not set
-
-# CONFIG_ARM_SP805_WATCHDOG is not set
-
-CONFIG_PM_OPP=y
-
-CONFIG_SECCOMP=y
-CONFIG_STRICT_DEVMEM=y
-
-# CONFIG_AMBA_PL08X is not set
-
-# CONFIG_HVC_DCC is not set
-
-CONFIG_SPARSE_IRQ=y
-
-# CONFIG_ARM_PATCH_PHYS_VIRT is not set
-
-CONFIG_HWSPINLOCK_OMAP=m
-
-CONFIG_USE_OF=y
-CONFIG_PROC_DEVICETREE=y
CONFIG_MTD_PHYSMAP_OF=m
-CONFIG_SERIAL_OF_PLATFORM=m
-CONFIG_MMC_SDHCI_OF=m
-CONFIG_MMC_SDHCI_PXAV3=m
-CONFIG_MMC_SDHCI_PXAV2=m
-
-CONFIG_ARM_APPENDED_DTB=y
CONFIG_MTD_OF_PARTS=y
-CONFIG_PL330_DMA=y
-# CONFIG_ARM_KPROBES_TEST is not set
-# CONFIG_ARM_ATAG_DTB_COMPAT is not set
-# CONFIG_FTGMAC100 is not set
-# CONFIG_FTMAC100 is not set
-#
-CONFIG_DEFAULT_MMAP_MIN_ADDR=32768
-CONFIG_LSM_MMAP_MIN_ADDR=32768
+CONFIG_MMC_SDHCI_PLTFM=m
+
+# Generic GPIO options
+CONFIG_GENERIC_GPIO=y
+
+# We'll enable this here as various platforms will need it
+CONFIG_DRM=m
+# HW Disabled because it causes issues on ARM platforms
# disable TPM on arm at least on the trimslices it causes havoc
# CONFIG_TCG_TPM is not set
@@ -197,25 +157,9 @@ CONFIG_LSM_MMAP_MIN_ADDR=32768
# CONFIG_TOUCHSCREEN_EGALAX is not set
# CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set
#
-# FIXME: Guesses, need checking
-# CONFIG_MACH_EUKREA_CPUIMX35SD is not set
-CONFIG_ARM_ERRATA_720789=y
-CONFIG_ARM_ERRATA_751472=y
-CONFIG_OMAP4_ERRATA_I688=y
# CONFIG_FB_MX3 is not set
# CONFIG_MX3_IPU is not set
# CONFIG_MX3_IPU_IRQS is not set
# CONFIG_NET_VENDOR_CIRRUS is not set
# CONFIG_CS89x0 is not set
-
-# CONFIG_OF_SELFTEST is not set
-# CONFIG_MACH_IMX51_DT is not set
-# CONFIG_MACH_IMX53_DT is not set
-# CONFIG_MACH_MX53_EVK is not set
-# CONFIG_MACH_MX53_SMD is not set
-# CONFIG_MACH_MX53_LOCO is not set
-# CONFIG_MACH_MX53_ARD is not set
-# CONFIG_ARM_EXYNOS4210_CPUFREQ is not set
-
-CONFIG_OF_GPIO=y
diff --git a/freed-ora/current/master/config-arm-imx b/freed-ora/current/master/config-arm-imx
index f4c7d26cb..9e7191159 100644
--- a/freed-ora/current/master/config-arm-imx
+++ b/freed-ora/current/master/config-arm-imx
@@ -39,7 +39,6 @@ CONFIG_ARM_ERRATA_411920=y
CONFIG_PL310_ERRATA_588369=y
CONFIG_PL310_ERRATA_727915=y
CONFIG_ARM_ERRATA_364296=y
-CONFIG_RFKILL_GPIO=m
CONFIG_PATA_IMX=m
CONFIG_ETHERNET=y
CONFIG_NET_VENDOR_BROADCOM=y
diff --git a/freed-ora/current/master/config-arm-kirkwood b/freed-ora/current/master/config-arm-kirkwood
index 592b5aa1b..c7f22e501 100644
--- a/freed-ora/current/master/config-arm-kirkwood
+++ b/freed-ora/current/master/config-arm-kirkwood
@@ -1,4 +1,6 @@
CONFIG_ARCH_KIRKWOOD=y
+# CONFIG_SMP is not set
+# CONFIG_VFP is not set
CONFIG_MACH_DB88F6281_BP=y
CONFIG_MACH_RD88F6192_NAS=y
CONFIG_MACH_RD88F6281=y
diff --git a/freed-ora/current/master/config-arm-omap b/freed-ora/current/master/config-arm-omap
new file mode 100644
index 000000000..f53d7d3bc
--- /dev/null
+++ b/freed-ora/current/master/config-arm-omap
@@ -0,0 +1,257 @@
+CONFIG_ARCH_OMAP=y
+# 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=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_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
+CONFIG_OMAP_IOMMU=y
+CONFIG_OMAP3_EMU=y
+CONFIG_HWSPINLOCK_OMAP=m
+
+#
+# TI OMAP2/3/4 Specific Features
+#
+CONFIG_ARCH_OMAP2PLUS_TYPICAL=y
+# CONFIG_ARCH_OMAP2 is not set
+CONFIG_ARCH_OMAP3=y
+CONFIG_ARCH_OMAP4=y
+CONFIG_SOC_OMAP3430=y
+# CONFIG_SOC_OMAPTI81XX is not set
+# CONFIG_SOC_OMAPAM33XX is not set
+# CONFIG_SOC_OMAPTI816X is not set
+CONFIG_OMAP_PACKAGE_CBB=y
+CONFIG_OMAP_PACKAGE_CBL=y
+CONFIG_OMAP_PACKAGE_CBS=y
+
+#
+# OMAP Board Type
+#
+CONFIG_MACH_OMAP_GENERIC=y
+CONFIG_MACH_OMAP3_BEAGLE=y
+CONFIG_MACH_DEVKIT8000=y
+CONFIG_MACH_OMAP_LDP=y
+CONFIG_MACH_OMAP3530_LV_SOM=y
+CONFIG_MACH_OMAP3_TORPEDO=y
+CONFIG_MACH_OVERO=y
+CONFIG_MACH_OMAP3EVM=y
+CONFIG_MACH_OMAP3517EVM=y
+CONFIG_MACH_CRANEBOARD=y
+CONFIG_MACH_OMAP3_PANDORA=y
+CONFIG_MACH_OMAP3_TOUCHBOOK=y
+CONFIG_MACH_OMAP_3430SDP=y
+CONFIG_MACH_NOKIA_RM680=y
+CONFIG_MACH_NOKIA_RX51=y
+CONFIG_MACH_OMAP_ZOOM2=y
+CONFIG_MACH_OMAP_ZOOM3=y
+CONFIG_MACH_CM_T35=y
+CONFIG_MACH_CM_T3517=y
+CONFIG_MACH_IGEP0020=y
+CONFIG_MACH_IGEP0030=y
+CONFIG_MACH_SBC3530=y
+CONFIG_MACH_OMAP_3630SDP=y
+CONFIG_MACH_OMAP_4430SDP=y
+CONFIG_MACH_OMAP4_PANDA=y
+CONFIG_MACH_TI8168EVM=y
+# CONFIG_MACH_TI8148EVM is not set
+CONFIG_MACH_OMAP3_WESTBRIDGE_AST_PNAND_HAL=y
+
+
+# CONFIG_OMAP3_SDRC_AC_TIMING is not set
+
+
+# System MMU
+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_ARM_THUMBEE=y
+CONFIG_SWP_EMULATE=y
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+CONFIG_OUTER_CACHE=y
+CONFIG_OUTER_CACHE_SYNC=y
+CONFIG_CACHE_L2X0=y
+CONFIG_CACHE_PL310=y
+CONFIG_ARM_DMA_MEM_BUFFERABLE=y
+CONFIG_CPU_HAS_PMU=y
+CONFIG_ARM_ERRATA_430973=y
+# CONFIG_ARM_ERRATA_458693 is not set
+# CONFIG_ARM_ERRATA_460075 is not set
+# CONFIG_ARM_ERRATA_742230 is not set
+# CONFIG_ARM_ERRATA_742231 is not set
+CONFIG_PL310_ERRATA_588369=y
+CONFIG_PL310_ERRATA_769419=y
+CONFIG_ARM_ERRATA_720789=y
+# CONFIG_ARM_ERRATA_743622 is not set
+# CONFIG_ARM_ERRATA_751472 is not set
+# CONFIG_ARM_ERRATA_753970 is not set
+# CONFIG_ARM_ERRATA_754322 is not set
+# CONFIG_ARM_ERRATA_754327 is not set
+# CONFIG_ARM_ERRATA_764369 is not set
+CONFIG_ARM_GIC=y
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_PCCARD is not set
+CONFIG_HAVE_ARM_SCU=y
+CONFIG_HAVE_ARM_TWD=y
+CONFIG_HOTPLUG_CPU=y
+CONFIG_LOCAL_TIMERS=y
+CONFIG_HZ=128
+# CONFIG_THUMB2_KERNEL is not set
+CONFIG_ARCH_HAS_HOLES_MEMORYMODEL=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_KSM is not set
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_CMDLINE=""
+# CONFIG_AUTO_ZRELADDR is not set
+CONFIG_VFPv3=y
+CONFIG_NEON=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_BINFMT_MISC=m
+CONFIG_PM_DEBUG=y
+# CONFIG_PM_ADVANCED_DEBUG is not set
+# CONFIG_PM_VERBOSE is not set
+CONFIG_CAN_PM_TRACE=y
+CONFIG_PM_SLEEP_SMP=y
+CONFIG_ARCH_HAS_OPP=y
+CONFIG_PM_OPP=y
+
+#
+# OMAP Hardware
+#
+CONFIG_TI_ST=m
+CONFIG_GPIOLIB=y
+CONFIG_MTD_NAND_OMAP2=y
+CONFIG_MTD_NAND_OMAP_PREFETCH=y
+CONFIG_MTD_NAND_OMAP_PREFETCH_DMA=y
+CONFIG_WL1251_SPI=m
+CONFIG_WL12XX_SPI=m
+CONFIG_WL12XX_SDIO_TEST=m
+CONFIG_INPUT_TWL4030_PWRBUTTON=y
+CONFIG_INPUT_TWL4030_VIBRA=y
+CONFIG_INPUT_TWL6040_VIBRA=y
+CONFIG_SERIAL_OMAP=y
+CONFIG_SERIAL_OMAP_CONSOLE=y
+CONFIG_OMAP_WATCHDOG=y
+CONFIG_TWL4030_CORE=y
+# CONFIG_TWL4030_MADC is not set
+CONFIG_TWL4030_POWER=y
+CONFIG_TWL4030_CODEC=y
+# CONFIG_TWL6030_PWM is not set
+
+CONFIG_MTD_ONENAND_OMAP2=y
+CONFIG_I2C_OMAP=y
+CONFIG_SPI_OMAP24XX=y
+# CONFIG_MFD_OMAP_USB_HOST is not set
+# CONFIG_MFD_WL1273_CORE is not set
+CONFIG_REGULATOR_TWL4030=y
+CONFIG_VIDEO_OMAP2_VOUT=m
+# CONFIG_VIDEO_OMAP3 is not set
+
+CONFIG_DRM=m
+CONFIG_DRM_OMAP=m
+# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
+# CONFIG_FB_OMAP_LCD_VGA is not set
+CONFIG_OMAP2_VRAM=y
+CONFIG_OMAP2_VRFB=y
+CONFIG_OMAP2_DSS=y
+CONFIG_OMAP2_VRAM_SIZE=12
+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
+ONFIG_OMAP2_DSS_VENC=y
+CONFIG_OMAP4_DSS_HDMI=y
+# CONFIG_OMAP2_DSS_SDI is not set
+# CONFIG_OMAP2_DSS_DSI is not set
+# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set
+CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=1
+CONFIG_OMAP2_DSS_SLEEP_BEFORE_RESET=y
+CONFIG_OMAP2_DSS_SLEEP_AFTER_VENC_RESET=y
+# CONFIG_FB_OMAP2 is not set
+
+#
+# OMAP2/3 Display Device Drivers
+#
+CONFIG_PANEL_GENERIC_DPI=y
+CONFIG_PANEL_SHARP_LS037V7DW01=y
+CONFIG_PANEL_NEC_NL8048HL11_01B=y
+CONFIG_PANEL_TPO_TD043MTEA1=y
+
+CONFIG_SND_OMAP_SOC=y
+CONFIG_SND_OMAP_SOC_MCBSP=y
+CONFIG_SND_OMAP_SOC_MCPDM=y
+CONFIG_SND_OMAP_SOC_RX51=y
+CONFIG_SND_OMAP_SOC_OVERO=y
+CONFIG_SND_OMAP_SOC_OMAP3EVM=y
+CONFIG_SND_OMAP_SOC_AM3517EVM=y
+CONFIG_SND_OMAP_SOC_SDP3430=y
+CONFIG_SND_OMAP_SOC_SDP4430=y
+CONFIG_SND_OMAP_SOC_OMAP3_PANDORA=y
+CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE=y
+CONFIG_SND_OMAP_SOC_ZOOM2=y
+CONFIG_SND_OMAP_SOC_IGEP0020=y
+# Because alsa is modular http://www.spinics.net/lists/linux-omap/msg67307.html
+# CONFIG_SND_OMAP_SOC_OMAP4_HDMI is not set
+CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040=m
+CONFIG_SND_SOC_I2C_AND_SPI=y
+# CONFIG_SND_SOC_ALL_CODECS is not set
+CONFIG_SND_SOC_TLV320AIC23=y
+CONFIG_SND_SOC_TLV320AIC3X=y
+CONFIG_SND_SOC_TWL4030=y
+CONFIG_SND_SOC_TWL6040=y
+CONFIG_RADIO_WL128X
+
+CONFIG_USB_OTG=y
+CONFIG_USB_EHCI_HCD_OMAP=y
+CONFIG_USB_MUSB_OMAP2PLUS=y
+CONFIG_USB_MUSB_HDRC=y
+CONFIG_MUSB_PIO_ONLY=y
+# CONFIG_USB_MUSB_DEBUG is not set
+#
+
+# CONFIG_USB_GADGET_OMAP is not set
+# CONFIG_ISP1301_OMAP is not set
+CONFIG_MMC_OMAP=m
+CONFIG_MMC_OMAP_HS=y
+CONFIG_TWL4030_USB=y
+CONFIG_TWL6030_USB=y
+CONFIG_RTC_DRV_TWL4030=m
+
+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=y
+CONFIG_TIDSPBRIDGE_WDT_TIMEOUT=5
+# CONFIG_TIDSPBRIDGE_NTFY_PWRERR is not set
+# CONFIG_TIDSPBRIDGE_BACKTRACE is not set
+
+CONFIG_CRYPTO_DEV_OMAP_SHAM=m
+CONFIG_CRYPTO_DEV_OMAP_AES=m
diff --git a/freed-ora/current/master/config-arm-omap-generic b/freed-ora/current/master/config-arm-omap-generic
deleted file mode 100644
index 772121b45..000000000
--- a/freed-ora/current/master/config-arm-omap-generic
+++ /dev/null
@@ -1,1079 +0,0 @@
-CONFIG_GENERIC_GPIO=y
-CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
-CONFIG_GENERIC_LOCKBREAK=y
-CONFIG_ARCH_HAS_CPUFREQ=y
-# CONFIG_SPARSE_IRQ is not set
-CONFIG_TREE_PREEMPT_RCU=y
-CONFIG_PREEMPT_RCU=y
-CONFIG_RCU_FANOUT=32
-# CONFIG_RCU_FANOUT_EXACT is not set
-# CONFIG_RCU_BOOST is not set
-CONFIG_IKCONFIG=y
-CONFIG_IKCONFIG_PROC=y
-# CONFIG_SCHED_AUTOGROUP is not set
-# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-# CONFIG_KALLSYMS_EXTRA_PASS is not set
-CONFIG_USE_GENERIC_SMP_HELPERS=y
-CONFIG_HAVE_HW_BREAKPOINT=y
-CONFIG_STOP_MACHINE=y
-# CONFIG_INLINE_SPIN_UNLOCK is not set
-# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
-# CONFIG_INLINE_READ_UNLOCK is not set
-# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
-# CONFIG_INLINE_WRITE_UNLOCK is not set
-# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
-CONFIG_MUTEX_SPIN_ON_OWNER=y
-# CONFIG_ARCH_VERSATILE is not set
-CONFIG_ARCH_OMAP=y
-# 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=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_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=y
-CONFIG_SOC_OMAP3430=y
-# CONFIG_SOC_OMAPTI816X is not set
-CONFIG_OMAP_PACKAGE_CBB=y
-CONFIG_OMAP_PACKAGE_CBL=y
-CONFIG_OMAP_PACKAGE_CBS=y
-
-#
-# OMAP Board Type
-#
-CONFIG_MACH_OMAP3_BEAGLE=y
-CONFIG_MACH_DEVKIT8000=y
-CONFIG_MACH_OMAP_LDP=y
-CONFIG_MACH_OMAP3530_LV_SOM=y
-CONFIG_MACH_OMAP3_TORPEDO=y
-CONFIG_MACH_OVERO=y
-CONFIG_MACH_OMAP3EVM=y
-CONFIG_MACH_OMAP3517EVM=y
-CONFIG_MACH_CRANEBOARD=y
-CONFIG_MACH_OMAP3_PANDORA=y
-CONFIG_MACH_OMAP3_TOUCHBOOK=y
-CONFIG_MACH_OMAP_3430SDP=y
-CONFIG_MACH_NOKIA_RM680=y
-CONFIG_MACH_NOKIA_RX51=y
-CONFIG_MACH_OMAP_ZOOM2=y
-CONFIG_MACH_OMAP_ZOOM3=y
-CONFIG_MACH_CM_T35=y
-CONFIG_MACH_CM_T3517=y
-CONFIG_MACH_IGEP0020=y
-CONFIG_MACH_IGEP0030=y
-CONFIG_MACH_SBC3530=y
-CONFIG_MACH_OMAP_3630SDP=y
-CONFIG_MACH_OMAP_4430SDP=y
-CONFIG_MACH_OMAP4_PANDA=y
-CONFIG_MACH_TI8168EVM=y
-CONFIG_OMAP3_EMU=y
-# CONFIG_OMAP3_SDRC_AC_TIMING is not set
-# System MMU
-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_ARM_THUMBEE=y
-CONFIG_SWP_EMULATE=y
-# CONFIG_CPU_BPREDICT_DISABLE is not set
-CONFIG_OUTER_CACHE=y
-CONFIG_OUTER_CACHE_SYNC=y
-CONFIG_CACHE_L2X0=y
-CONFIG_CACHE_PL310=y
-CONFIG_ARM_DMA_MEM_BUFFERABLE=y
-CONFIG_CPU_HAS_PMU=y
-CONFIG_ARM_ERRATA_430973=y
-# CONFIG_ARM_ERRATA_458693 is not set
-# CONFIG_ARM_ERRATA_460075 is not set
-# CONFIG_ARM_ERRATA_742230 is not set
-# CONFIG_ARM_ERRATA_742231 is not set
-CONFIG_PL310_ERRATA_588369=y
-CONFIG_PL310_ERRATA_769419=y
-CONFIG_ARM_ERRATA_720789=y
-# CONFIG_ARM_ERRATA_743622 is not set
-# CONFIG_ARM_ERRATA_751472 is not set
-# CONFIG_ARM_ERRATA_753970 is not set
-# CONFIG_ARM_ERRATA_754322 is not set
-# CONFIG_ARM_ERRATA_754327 is not set
-# CONFIG_ARM_ERRATA_764369 is not set
-CONFIG_ARM_GIC=y
-# CONFIG_PCI_SYSCALL is not set
-# CONFIG_PCCARD is not set
-CONFIG_SMP=y
-CONFIG_SMP_ON_UP=y
-CONFIG_HAVE_ARM_SCU=y
-CONFIG_HAVE_ARM_TWD=y
-CONFIG_NR_CPUS=2
-CONFIG_HOTPLUG_CPU=y
-CONFIG_LOCAL_TIMERS=y
-# CONFIG_PREEMPT_VOLUNTARY is not set
-CONFIG_PREEMPT=y
-CONFIG_HZ=128
-# CONFIG_THUMB2_KERNEL is not set
-CONFIG_ARCH_HAS_HOLES_MEMORYMODEL=y
-CONFIG_SPLIT_PTLOCK_CPUS=4
-# CONFIG_KSM is not set
-# CONFIG_CC_STACKPROTECTOR is not set
-CONFIG_ZBOOT_ROM_TEXT=0x0
-CONFIG_ZBOOT_ROM_BSS=0x0
-CONFIG_CMDLINE=""
-# CONFIG_AUTO_ZRELADDR is not set
-CONFIG_VFPv3=y
-CONFIG_NEON=y
-# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
-CONFIG_BINFMT_MISC=m
-CONFIG_PM_DEBUG=y
-# CONFIG_PM_ADVANCED_DEBUG is not set
-# CONFIG_PM_VERBOSE is not set
-CONFIG_CAN_PM_TRACE=y
-CONFIG_PM_SLEEP_SMP=y
-# CONFIG_APM_EMULATION is not set
-CONFIG_ARCH_HAS_OPP=y
-CONFIG_PM_OPP=y
-# CONFIG_NET_IPGRE_DEMUX is not set
-# CONFIG_IP_MROUTE_MULTIPLE_TABLES is not set
-# CONFIG_ARPD is not set
-CONFIG_INET_DIAG=y
-CONFIG_INET_TCP_DIAG=y
-CONFIG_IPV6=y
-# CONFIG_IPV6_ROUTER_PREF is not set
-# CONFIG_IPV6_OPTIMISTIC_DAD is not set
-# CONFIG_IPV6_MIP6 is not set
-# CONFIG_IPV6_SUBTREES is not set
-# CONFIG_IPV6_MROUTE is not set
-CONFIG_NF_DEFRAG_IPV4=m
-# CONFIG_NET_DCCPPROBE is not set
-# CONFIG_L2TP_V3 is not set
-# CONFIG_DECNET_ROUTER is not set
-# CONFIG_NET_SCH_INGRESS is not set
-# CONFIG_NET_CLS_U32 is not set
-# CONFIG_NET_CLS_FLOW is not set
-# CONFIG_NET_ACT_CSUM is not set
-# CONFIG_NET_CLS_IND is not set
-CONFIG_RPS=y
-CONFIG_XPS=y
-# CONFIG_CAN_SLCAN is not set
-# CONFIG_CAN_DEV is not set
-CONFIG_RXKAD=m
-CONFIG_FIRMWARE_IN_KERNEL=y
-# CONFIG_DEBUG_DEVRES is not set
-CONFIG_MTD=y
-CONFIG_MTD_TESTS=m
-CONFIG_MTD_CMDLINE_PARTS=y
-# CONFIG_MTD_AFS_PARTS is not set
-# CONFIG_MTD_AR7_PARTS is not set
-CONFIG_MTD_CHAR=y
-CONFIG_MTD_BLKDEVS=y
-CONFIG_MTD_BLOCK=y
-CONFIG_SM_FTL=m
-CONFIG_MTD_PHYSMAP=m
-# CONFIG_MTD_PHYSMAP_COMPAT is not set
-# CONFIG_MTD_ARM_INTEGRATOR is not set
-# CONFIG_MTD_IMPA7 is not set
-# CONFIG_MTD_GPIO_ADDR is not set
-CONFIG_MTD_PLATRAM=m
-# CONFIG_MTD_DATAFLASH is not set
-CONFIG_MTD_M25P80=m
-CONFIG_M25PXX_USE_FAST_READ=y
-# CONFIG_MTD_SST25L is not set
-CONFIG_MTD_SLRAM=m
-CONFIG_MTD_PHRAM=m
-CONFIG_MTD_DOC2000=m
-CONFIG_MTD_DOC2001=m
-CONFIG_MTD_DOC2001PLUS=m
-CONFIG_MTD_DOCPROBE=m
-CONFIG_MTD_DOCECC=m
-# CONFIG_MTD_DOCPROBE_ADVANCED is not set
-CONFIG_MTD_DOCPROBE_ADDRESS=0
-CONFIG_MTD_NAND_ECC=y
-# CONFIG_MTD_NAND_ECC_SMC is not set
-CONFIG_MTD_NAND=y
-# CONFIG_MTD_SM_COMMON is not set
-# CONFIG_MTD_NAND_GPIO is not set
-CONFIG_MTD_NAND_OMAP2=y
-CONFIG_MTD_NAND_OMAP_PREFETCH=y
-CONFIG_MTD_NAND_OMAP_PREFETCH_DMA=y
-CONFIG_MTD_NAND_IDS=y
-# CONFIG_MTD_NAND_NANDSIM is not set
-CONFIG_MTD_NAND_PLATFORM=y
-# CONFIG_MTD_ALAUDA is not set
-CONFIG_MTD_ONENAND=y
-# CONFIG_MTD_ONENAND_VERIFY_WRITE is not set
-# CONFIG_MTD_ONENAND_GENERIC is not set
-CONFIG_MTD_ONENAND_OMAP2=y
-# CONFIG_MTD_ONENAND_OTP is not set
-CONFIG_MTD_ONENAND_2X_PROGRAM=y
-CONFIG_MTD_ONENAND_SIM=m
-CONFIG_MTD_UBI_GLUEBI=m
-# CONFIG_PARPORT is not set
-CONFIG_BLK_DEV_RAM_SIZE=65536
-CONFIG_MG_DISK=m
-CONFIG_MG_DISK_RES=0
-# CONFIG_BLK_DEV_RBD is not set
-# CONFIG_APDS9802ALS is not set
-# CONFIG_ISL29020 is not set
-# CONFIG_SENSORS_BH1770 is not set
-# CONFIG_SENSORS_APDS990X is not set
-CONFIG_HMC6352=m
-CONFIG_DS1682=m
-CONFIG_TI_DAC7512=m
-CONFIG_BMP085=m
-CONFIG_C2PORT=m
-CONFIG_EEPROM_AT25=m
-CONFIG_EEPROM_93XX46=m
-# CONFIG_IWMC3200TOP_DEBUGFS is not set
-# CONFIG_SCSI_PROC_FS is not set
-# CONFIG_BLK_DEV_SR_VENDOR is not set
-# CONFIG_SCSI_SPI_ATTRS is not set
-# CONFIG_ISCSI_BOOT_SYSFS is not set
-# CONFIG_SCSI_OSD_INITIATOR is not set
-# CONFIG_SATA_AHCI_PLATFORM is not set
-# CONFIG_DM_DEBUG is not set
-# CONFIG_DM_RAID is not set
-# CONFIG_DM_LOG_USERSPACE is not set
-CONFIG_DM_MULTIPATH=y
-# CONFIG_TARGET_CORE is not set
-# CONFIG_MACVTAP is not set
-CONFIG_MII=y
-# 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 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_AX88796 is not set
-# CONFIG_SMC91X is not set
-# CONFIG_TI_DAVINCI_EMAC is not set
-# CONFIG_TI_DAVINCI_MDIO is not set
-# CONFIG_TI_DAVINCI_CPDMA is not set
-CONFIG_DM9000_FORCE_SIMPLE_PHY_POLL=y
-CONFIG_ENC28J60=m
-# CONFIG_ENC28J60_WRITEVERIFY is not set
-# CONFIG_ETHOC is not set
-CONFIG_SMC911X=y
-CONFIG_SMSC911X=y
-# CONFIG_DNET is not set
-# CONFIG_B44 is not set
-CONFIG_KS8851=m
-# CONFIG_NETDEV_1000 is not set
-# CONFIG_NETDEV_10000 is not set
-# CONFIG_ATH9K_HTC is not set
-# CONFIG_AR9170_USB is not set
-# CONFIG_B43_SDIO is not set
-# CONFIG_B43_PHY_N is not set
-# CONFIG_HOSTAP is not set
-# CONFIG_IWM is not set
-CONFIG_LIBERTAS_SPI=m
-# CONFIG_LIBERTAS_MESH is not set
-CONFIG_P54_SPI=m
-# CONFIG_P54_SPI_DEFAULT_EEPROM is not set
-# CONFIG_RT2800USB_RT33XX is not set
-# CONFIG_RTL8192CE is not set
-CONFIG_WL1251_SPI=m
-CONFIG_WL12XX_SPI=m
-CONFIG_WL12XX_SDIO_TEST=m
-# CONFIG_WIMAX_IWMC3200_SDIO is not set
-CONFIG_USB_USBNET=y
-CONFIG_USB_NET_CDCETHER=y
-CONFIG_USB_NET_CDC_NCM=y
-CONFIG_USB_NET_RNDIS_HOST=y
-# CONFIG_ATM_TCP is not set
-# CONFIG_IEEE802154_FAKEHARD is not set
-# CONFIG_CAIF_TTY is not set
-# CONFIG_CAIF_SPI_SLAVE is not set
-CONFIG_PPP_BSDCOMP=m
-# CONFIG_PPPOL2TP is not set
-# CONFIG_NETPOLL is not set
-# CONFIG_NET_POLL_CONTROLLER is not set
-# CONFIG_ISDN is not set
-CONFIG_INPUT_POLLDEV=y
-CONFIG_INPUT_MOUSEDEV_PSAUX=y
-CONFIG_INPUT_EVBUG=m
-# CONFIG_KEYBOARD_QT2160 is not set
-CONFIG_KEYBOARD_LKKBD=m
-CONFIG_KEYBOARD_GPIO=m
-CONFIG_KEYBOARD_TCA6416=m
-CONFIG_KEYBOARD_MATRIX=m
-CONFIG_KEYBOARD_LM8323=m
-CONFIG_KEYBOARD_MCS=m
-CONFIG_KEYBOARD_NEWTON=m
-CONFIG_KEYBOARD_STOWAWAY=m
-CONFIG_KEYBOARD_SUNKBD=m
-# CONFIG_KEYBOARD_OMAP4 is not set
-CONFIG_KEYBOARD_TWL4030=m
-CONFIG_KEYBOARD_XTKBD=m
-CONFIG_MOUSE_PS2=m
-CONFIG_MOUSE_GPIO=m
-CONFIG_JOYSTICK_AS5011=m
-# CONFIG_TABLET_USB_HANWANG is not set
-CONFIG_TOUCHSCREEN_ADS7846=m
-CONFIG_TOUCHSCREEN_AD7877=m
-CONFIG_TOUCHSCREEN_AD7879=m
-CONFIG_TOUCHSCREEN_AD7879_I2C=m
-# CONFIG_TOUCHSCREEN_AD7879_SPI is not set
-CONFIG_TOUCHSCREEN_CY8CTMG110=m
-CONFIG_TOUCHSCREEN_HAMPSHIRE=m
-CONFIG_TOUCHSCREEN_QT602240=m
-CONFIG_TOUCHSCREEN_TPS6507X=m
-# CONFIG_TOUCHSCREEN_TSC2005 is not set
-CONFIG_INPUT_AD714X=m
-CONFIG_INPUT_AD714X_I2C=m
-CONFIG_INPUT_AD714X_SPI=m
-# CONFIG_INPUT_APPLEIR is not set
-CONFIG_INPUT_TWL4030_PWRBUTTON=y
-CONFIG_INPUT_TWL4030_VIBRA=y
-CONFIG_INPUT_TWL6040_VIBRA=y
-CONFIG_INPUT_UINPUT=y
-# 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_I2C is not set
-# CONFIG_SERIO_AMBAKMI is not set
-# CONFIG_SERIO_RAW is not set
-# CONFIG_SERIO_ALTERA_PS2 is not set
-# CONFIG_GAMEPORT_NS558 is not set
-# CONFIG_GAMEPORT_L4 is not set
-# CONFIG_SERIAL_NONSTANDARD is not set
-# CONFIG_N_GSM is not set
-CONFIG_SERIAL_8250_DETECT_IRQ=y
-# CONFIG_SERIAL_AMBA_PL010 is not set
-# CONFIG_SERIAL_AMBA_PL011 is not set
-# CONFIG_SERIAL_MAX3100 is not set
-# CONFIG_SERIAL_MAX3107 is not set
-CONFIG_SERIAL_OMAP=y
-CONFIG_SERIAL_OMAP_CONSOLE=y
-# CONFIG_SERIAL_IFX6X60 is not set
-# CONFIG_IPMI_HANDLER is not set
-# CONFIG_HW_RANDOM_TIMERIOMEM is not set
-# CONFIG_R3964 is not set
-# CONFIG_RAW_DRIVER is not set
-CONFIG_I2C=y
-CONFIG_I2C_CHARDEV=y
-# CONFIG_I2C_GPIO is not set
-CONFIG_I2C_OMAP=y
-# CONFIG_I2C_SIMTEC is not set
-CONFIG_I2C_TAOS_EVM=m
-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_PL022 is not set
-# 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
-CONFIG_ARCH_REQUIRE_GPIOLIB=y
-CONFIG_GPIOLIB=y
-# CONFIG_DEBUG_GPIO is not set
-CONFIG_GPIO_SYSFS=y
-
-#
-# Memory mapped GPIO expanders:
-#
-# CONFIG_GPIO_BASIC_MMIO is not set
-# CONFIG_GPIO_IT8761E is not set
-# CONFIG_GPIO_PL061 is not set
-
-#
-# I2C GPIO expanders:
-#
-# CONFIG_GPIO_MAX7300 is not set
-# 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 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_CHARGER_TWL4030 is not set
-# CONFIG_CHARGER_GPIO is not set
-# CONFIG_HWMON_VID is not set
-# 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_DS620 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_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_SHT21 is not set
-# CONFIG_SENSORS_DME1737 is not set
-# CONFIG_SENSORS_EMC1403 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_SENSORS_LIS3_I2C is not set
-CONFIG_WATCHDOG_NOWAYOUT=y
-# CONFIG_SOFT_WATCHDOG is not set
-# CONFIG_MPCORE_WATCHDOG is not set
-CONFIG_OMAP_WATCHDOG=y
-# CONFIG_TWL4030_WATCHDOG is not set
-CONFIG_SSB=y
-# CONFIG_SSB_SDIOHOST is not set
-CONFIG_MFD_CORE=y
-# CONFIG_MFD_AAT2870_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_I2CPLD is not set
-# CONFIG_TPS65010 is not set
-CONFIG_TWL4030_CORE=y
-# CONFIG_TWL4030_MADC is not set
-CONFIG_TWL4030_POWER=y
-CONFIG_TWL4030_CODEC=y
-# CONFIG_TWL6030_PWM is not set
-# CONFIG_MFD_STMPE is not set
-# CONFIG_MFD_TC3589X 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_MC13XXX is not set
-# CONFIG_EZX_PCAP is not set
-CONFIG_MFD_OMAP_USB_HOST=y
-# CONFIG_MFD_TPS6586X is not set
-# CONFIG_MFD_TPS65910 is not set
-# CONFIG_MFD_TPS65912_I2C is not set
-# CONFIG_MFD_TPS65912_SPI is not set
-# CONFIG_MFD_WL1273_CORE 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_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_REGULATOR_TPS6524X is not set
-CONFIG_VIDEOBUF_DMA_CONTIG=m
-CONFIG_V4L2_MEM2MEM_DEV=m
-# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set
-# Encoders/decoders and other helper chips
-#
-
-#
-CONFIG_VIDEO_IR_I2C=m
-CONFIG_VIDEO_CS5345=m
-CONFIG_VIDEO_M52790=m
-CONFIG_VIDEO_WM8739=m
-CONFIG_VIDEO_VP27SMPX=m
-CONFIG_VIDEO_OV7670=m
-CONFIG_VIDEO_SAA717X=m
-CONFIG_VIDEO_SAA7127=m
-CONFIG_VIDEO_UPD64031A=m
-CONFIG_VIDEO_UPD64083=m
-CONFIG_VIDEO_ADP1653=m
-#
-# 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_TLV320AIC23B is not set
-# CONFIG_VIDEO_SAA6588 is not set
-# 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_MT9V011 is not set
-# CONFIG_VIDEO_MT9V032 is not set
-# CONFIG_VIDEO_TCM825X is not set
-# CONFIG_VIDEO_SAA7110 is not set
-# CONFIG_VIDEO_SAA7191 is not set
-# CONFIG_VIDEO_TVP514X is not set
-# CONFIG_VIDEO_TVP5150 is not set
-CONFIG_VIDEO_TVP7002=m
-# CONFIG_VIDEO_VPX3220 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=m
-# CONFIG_VIDEO_VPFE_CAPTURE is not set
-CONFIG_VIDEO_OMAP2_VOUT=m
-# CONFIG_VIDEO_CPIA2 is not set
-# CONFIG_VIDEO_AU0828 is not set
-# CONFIG_VIDEO_SR030PC30 is not set
-# CONFIG_VIDEO_OMAP3 is not set
-# CONFIG_SOC_CAMERA is not set
-CONFIG_USB_ET61X251=m
-CONFIG_USB_SN9C102=m
-CONFIG_VIDEO_MEM2MEM_TESTDEV=m
-CONFIG_RADIO_TEA5764=m
-CONFIG_RADIO_SAA7706H=m
-CONFIG_RADIO_TEF6862=m
-# CONFIG_TTPCI_EEPROM is not set
-# CONFIG_SMS_SDIO_DRV is not set
-# CONFIG_DVB_DUMMY_FE is not set
-CONFIG_DVB_TDA1004X=m
-CONFIG_DVB_PLL=m
-# CONFIG_DRM is not set
-# CONFIG_VGASTATE is not set
-# CONFIG_VIDEO_OUTPUT_CONTROL is not set
-# CONFIG_FB_DDC is not set
-CONFIG_FB_CFB_FILLRECT=y
-CONFIG_FB_CFB_COPYAREA=y
-CONFIG_FB_CFB_IMAGEBLIT=y
-# CONFIG_FB_SVGALIB is not set
-# CONFIG_FB_BACKLIGHT is not set
-# CONFIG_FB_TILEBLITTING is not set
-# CONFIG_FB_ARMCLCD is not set
-# CONFIG_FB_VIRTUAL is not set
-# CONFIG_FB_METRONOME is not set
-# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
-# CONFIG_FB_OMAP_LCD_VGA is not set
-CONFIG_OMAP2_VRAM=y
-CONFIG_OMAP2_VRFB=y
-CONFIG_OMAP2_DSS=y
-CONFIG_OMAP2_VRAM_SIZE=12
-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_OMAP4_DSS_HDMI=y
-# CONFIG_OMAP2_DSS_SDI is not set
-# CONFIG_OMAP2_DSS_DSI is not set
-# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set
-CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=1
-CONFIG_OMAP2_DSS_SLEEP_BEFORE_RESET=y
-CONFIG_OMAP2_DSS_SLEEP_AFTER_VENC_RESET=y
-CONFIG_FB_OMAP2=y
-CONFIG_FB_OMAP2_DEBUG_SUPPORT=y
-CONFIG_FB_OMAP2_NUM_FBS=3
-
-#
-# OMAP2/3 Display Device Drivers
-#
-CONFIG_PANEL_GENERIC_DPI=y
-CONFIG_PANEL_SHARP_LS037V7DW01=y
-CONFIG_PANEL_NEC_NL8048HL11_01B=y
-CONFIG_PANEL_TPO_TD043MTEA1=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_AMS369FG06 is not set
-CONFIG_BACKLIGHT_GENERIC=m
-CONFIG_DISPLAY_SUPPORT=y
-# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
-CONFIG_LOGO_LINUX_MONO=y
-CONFIG_LOGO_LINUX_VGA16=y
-CONFIG_SOUND=y
-CONFIG_SND=y
-CONFIG_SND_TIMER=y
-CONFIG_SND_PCM=y
-CONFIG_SND_HWDEP=m
-CONFIG_SND_RAWMIDI=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_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 is not set
-# CONFIG_SND_ARM is not set
-# CONFIG_SND_SPI is not set
-CONFIG_SND_USB=y
-CONFIG_SND_USB_AUDIO=m
-CONFIG_SND_USB_UA101=m
-CONFIG_SND_USB_CAIAQ=m
-CONFIG_SND_USB_CAIAQ_INPUT=y
-CONFIG_SND_SOC=y
-# CONFIG_SND_SOC_CACHE_LZO is not set
-CONFIG_SND_OMAP_SOC=y
-CONFIG_SND_OMAP_SOC_MCBSP=y
-CONFIG_SND_OMAP_SOC_MCPDM=y
-CONFIG_SND_OMAP_SOC_RX51=y
-CONFIG_SND_OMAP_SOC_OVERO=y
-CONFIG_SND_OMAP_SOC_OMAP3EVM=y
-CONFIG_SND_OMAP_SOC_AM3517EVM=y
-CONFIG_SND_OMAP_SOC_SDP3430=y
-CONFIG_SND_OMAP_SOC_SDP4430=y
-CONFIG_SND_OMAP_SOC_OMAP3_PANDORA=y
-CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE=y
-CONFIG_SND_OMAP_SOC_ZOOM2=y
-CONFIG_SND_OMAP_SOC_IGEP0020=y
-CONFIG_SND_OMAP_SOC_OMAP4_HDMI=y
-CONFIG_SND_SOC_I2C_AND_SPI=y
-# CONFIG_SND_SOC_ALL_CODECS is not set
-CONFIG_SND_SOC_TLV320AIC23=y
-CONFIG_SND_SOC_TLV320AIC3X=y
-CONFIG_SND_SOC_TWL4030=y
-CONFIG_SND_SOC_TWL6040=y
-# CONFIG_SOUND_PRIME is not set
-# CONFIG_HID_TIVO_SLIDE is not set
-# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
-# CONFIG_USB_DEVICEFS is not set
-CONFIG_USB_OTG=y
-# CONFIG_USB_OTG_WHITELIST is not set
-# CONFIG_USB_OTG_BLACKLIST_HUB is not set
-# CONFIG_USB_WUSB is not set
-# CONFIG_USB_WUSB_CBAF is not set
-# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
-CONFIG_USB_EHCI_HCD_OMAP=y
-# 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_HWA_HCD is not set
-# 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_INVENTRA_DMA=y
-CONFIG_USB_STORAGE=y
-# CONFIG_USB_STORAGE_DEBUG is not set
-CONFIG_USB_STORAGE_DATAFAB=m
-CONFIG_USB_STORAGE_FREECOM=m
-CONFIG_USB_STORAGE_ISD200=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_ONETOUCH=m
-CONFIG_USB_STORAGE_KARMA=m
-CONFIG_USB_STORAGE_CYPRESS_ATACB=m
-# CONFIG_USB_UAS is not set
-# CONFIG_USB_LIBUSUAL is not set
-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_SAFE_PADDED is not set
-# CONFIG_USB_SERIAL_SAMBA is not set
-CONFIG_USB_SERIAL_ZIO=m
-CONFIG_USB_RIO500=m
-CONFIG_USB_CYPRESS_CY7C63=m
-CONFIG_USB_CYTHERM=m
-CONFIG_USB_TEST=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=2
-CONFIG_USB_GADGET_SELECTED=y
-# 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=y
-CONFIG_USB_ETH_RNDIS=y
-CONFIG_USB_ETH_EEM=y
-# CONFIG_USB_G_NCM is not set
-# CONFIG_USB_GADGETFS is not set
-# CONFIG_USB_FUNCTIONFS is not set
-# CONFIG_USB_FILE_STORAGE is not set
-# CONFIG_USB_MASS_STORAGE is not set
-# CONFIG_USB_G_SERIAL is not set
-# CONFIG_USB_MIDI_GADGET is not set
-# CONFIG_USB_G_PRINTER is not set
-# CONFIG_USB_CDC_COMPOSITE is not set
-# CONFIG_USB_G_NOKIA 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
-CONFIG_USB_GPIO_VBUS=y
-# CONFIG_ISP1301_OMAP is not set
-CONFIG_TWL4030_USB=y
-CONFIG_TWL6030_USB=y
-CONFIG_NOP_USB_XCEIV=y
-CONFIG_MMC=y
-CONFIG_MMC_BLOCK=y
-CONFIG_MMC_SDHCI=y
-CONFIG_MMC_OMAP=m
-CONFIG_MMC_OMAP_HS=y
-CONFIG_MMC_SPI=m
-# CONFIG_MMC_DW is not set
-# CONFIG_MMC_USHC is not set
-# CONFIG_MEMSTICK is not set
-CONFIG_LEDS_GPIO=y
-CONFIG_LEDS_GPIO_PLATFORM=y
-CONFIG_LEDS_GPIO_OF=y
-# CONFIG_LEDS_LP3944 is not set
-# CONFIG_LEDS_LP5521 is not set
-# CONFIG_LEDS_LP5523 is not set
-# CONFIG_LEDS_DAC124S085 is not set
-# CONFIG_LEDS_REGULATOR is not set
-# CONFIG_LEDS_LT3593 is not set
-CONFIG_LEDS_TRIGGER_HEARTBEAT=y
-# CONFIG_LEDS_TRIGGER_GPIO is not set
-# CONFIG_NFC_DEVICES is not set
-# CONFIG_ACCESSIBILITY is not set
-CONFIG_RTC_CLASS=y
-CONFIG_RTC_DRV_TWL4030=m
-CONFIG_RTC_DRV_S35390A=m
-CONFIG_RTC_DRV_M41T94=m
-CONFIG_RTC_DRV_DS1305=m
-CONFIG_RTC_DRV_DS1390=m
-CONFIG_RTC_DRV_MAX6902=m
-CONFIG_RTC_DRV_R9701=m
-CONFIG_RTC_DRV_RS5C348=m
-CONFIG_RTC_DRV_DS3234=m
-CONFIG_RTC_DRV_PCF2123=m
-CONFIG_RTC_DRV_CMOS=m
-CONFIG_RTC_DRV_M48T86=m
-# CONFIG_RTC_DRV_PL030 is not set
-# CONFIG_RTC_DRV_PL031 is not set
-# CONFIG_USB_SE401 is not set
-# CONFIG_USB_VICAM is not set
-CONFIG_PRISM2_USB=m
-CONFIG_BRCM80211=y
-CONFIG_BRCMFMAC=y
-CONFIG_RT2870=m
-CONFIG_R8712U=m
-CONFIG_R8712_AP=y
-CONFIG_ZRAM=m
-# CONFIG_ZRAM_DEBUG 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=y
-CONFIG_TIDSPBRIDGE_WDT_TIMEOUT=5
-# 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_TOUCHSCREEN_CLEARPAD_TM1217 is not set
-# CONFIG_REISERFS_PROC_INFO is not set
-CONFIG_JFS_STATISTICS=y
-CONFIG_XFS_RT=y
-CONFIG_OCFS2_FS_STATS=y
-CONFIG_OCFS2_DEBUG_MASKLOG=y
-# CONFIG_BTRFS_FS is not set
-CONFIG_PRINT_QUOTA_WARNING=y
-CONFIG_QUOTA_TREE=m
-CONFIG_QFMT_V1=m
-CONFIG_QFMT_V2=m
-CONFIG_AUTOFS4_FS=m
-# CONFIG_NTFS_DEBUG is not set
-# CONFIG_NTFS_RW is not set
-# CONFIG_JFFS2_SUMMARY is not set
-# CONFIG_JFFS2_FS_XATTR is not set
-CONFIG_JFFS2_COMPRESSION_OPTIONS=y
-CONFIG_JFFS2_LZO=y
-CONFIG_JFFS2_ZLIB=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_NFS_FS=m
-# CONFIG_NFS_V4_1 is not set
-CONFIG_ROOT_NFS=y
-CONFIG_NFSD_DEPRECATED=y
-CONFIG_LOCKD=y
-CONFIG_NFS_ACL_SUPPORT=y
-# CONFIG_CIFS_STATS is not set
-# CONFIG_CIFS_FSCACHE is not set
-# CONFIG_CIFS_ACL is not set
-# CONFIG_NCPFS_SMALLDOS is not set
-# CONFIG_9P_FSCACHE is not set
-# CONFIG_9P_FS_POSIX_ACL is not set
-CONFIG_NLS_DEFAULT="iso8859-1"
-CONFIG_NLS_ASCII=m
-CONFIG_NLS_ISO8859_1=y
-# CONFIG_DLM_DEBUG is not set
-CONFIG_ENABLE_WARN_DEPRECATED=y
-# CONFIG_STRIP_ASM_SYMS is not set
-# CONFIG_HEADERS_CHECK is not set
-# CONFIG_DEBUG_SHIRQ is not set
-# CONFIG_LOCKUP_DETECTOR is not set
-CONFIG_DETECT_HUNG_TASK=y
-CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120
-# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
-CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
-CONFIG_DEBUG_PREEMPT=y
-# CONFIG_BKL is not set
-# CONFIG_SPARSE_RCU_POINTER is not set
-# CONFIG_DEBUG_HIGHMEM is not set
-# CONFIG_DEBUG_INFO is not set
-# CONFIG_DEBUG_LIST is not set
-# CONFIG_BOOT_PRINTK_DELAY is not set
-# CONFIG_RCU_CPU_STALL_DETECTOR is not set
-CONFIG_RCU_CPU_STALL_TIMEOUT=60
-CONFIG_RCU_CPU_STALL_VERBOSE=y
-# CONFIG_CPU_NOTIFIER_ERROR_INJECT is not set
-CONFIG_SYSCTL_SYSCALL_CHECK=y
-# CONFIG_FUNCTION_TRACER is not set
-# CONFIG_PREEMPT_TRACER is not set
-# CONFIG_STACK_TRACER is not set
-# CONFIG_RING_BUFFER_BENCHMARK is not set
-# CONFIG_DYNAMIC_DEBUG is not set
-# CONFIG_ATOMIC64_SELFTEST is not set
-# CONFIG_KGDB_TESTS is not set
-# CONFIG_TEST_KSTRTOX is not set
-# CONFIG_STRICT_DEVMEM is not set
-CONFIG_DEBUG_USER=y
-CONFIG_DEBUG_ERRORS=y
-CONFIG_DEBUG_LL=y
-CONFIG_EARLY_PRINTK=y
-# CONFIG_DEBUG_ICEDCC is not set
-CONFIG_OC_ETM=y
-# CONFIG_KEYS_DEBUG_PROC_KEYS is not set
-# CONFIG_IMA is not set
-CONFIG_CRYPTO_AEAD=m
-CONFIG_CRYPTO_RNG=m
-# CONFIG_CRYPTO_PCRYPT is not set
-CONFIG_CRYPTO_CRYPTD=m
-CONFIG_CRYPTO_SEQIV=m
-CONFIG_CRYPTO_CTR=m
-# CONFIG_CRYPTO_VMAC is not set
-CONFIG_CRYPTO_SHA1=m
-CONFIG_CRYPTO_AES=m
-# CONFIG_CRYPTO_CAST6 is not set
-CONFIG_CRYPTO_DES=y
-CONFIG_CRYPTO_USER_API=m
-CONFIG_CRYPTO_USER_API_HASH=m
-CONFIG_CRYPTO_USER_API_SKCIPHER=m
-CONFIG_CRYPTO_DEV_OMAP_SHAM=m
-CONFIG_CRYPTO_DEV_OMAP_AES=m
-CONFIG_LIBCRC32C=y
-# CONFIG_RFKILL_REGULATOR is not set
-# CONFIG_RFKILL_GPIO is not set
-# CONFIG_PANEL_LGPHILIPS_LB035Q02 is not set
-# CONFIG_LCD_LD9040 is not set
-# CONFIG_RTC_DRV_M41T93 is not set
-# CONFIG_EXT2_FS_XATTR is not set
-# CONFIG_OPROFILE is not set
-# CONFIG_OPROFILE is not set
-# CONFIG_PATA_ARASAN_CF is not set
-# CONFIG_BT_ATH3K is not set
-# CONFIG_BT_WILINK is not set
-# CONFIG_USB_HSO is not set
-
-CONFIG_CRYSTALHD=m
-
-CONFIG_GPIO_GENERIC_PLATFORM=y
-
-CONFIG_MACH_OMAP_GENERIC=y
-CONFIG_PL310_ERRATA_753970=y
-CONFIG_ARM_CPU_TOPOLOGY=y
-CONFIG_SCHED_MC=y
-CONFIG_SCHED_SMT=y
-CONFIG_ETHERNET=y
-CONFIG_NET_VENDOR_BROADCOM=y
-CONFIG_NET_VENDOR_MICROCHIP=y
-CONFIG_SENSORS_AD7314=m
-CONFIG_REGULATOR_GPIO=y
-CONFIG_VIDEO_MT9P031=m
-CONFIG_VIDEO_MT9T001=m
-CONFIG_VIDEO_S5K6AA=m
-CONFIG_PANEL_DVI=m
-CONFIG_PANEL_PICODLP=m
-CONFIG_USB_RENESAS_USBHS=m
-CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2
-CONFIG_LEDS_RENESAS_TPU=y
-# CONFIG_OMAP_IOMMU is not set
-CONFIG_USB_RENESAS_USBHS_HCD=m
-
-# CONFIG_ARM_LPAE is not set
-# CONFIG_INPUT_GP2A is not set
-# CONFIG_INPUT_GPIO_TILT_POLLED is not set
-# CONFIG_SOC_OMAPTI81XX is not set
-# CONFIG_SOC_OMAPAM33XX is not set
-# CONFIG_MACH_TI8148EVM is not set
-# CONFIG_ARM_EXYNOS4210_CPUFREQ is not set
-# CONFIG_MICREL_KS8995MA is not set
-# CONFIG_CHARGER_MANAGER is not set
-# CONFIG_MFD_DA9052_SPI is not set
-# CONFIG_MFD_DA9052_I2C is not set
-# CONFIG_MFD_S5M_CORE is not set
-# CONFIG_VIDEO_AS3645A is not set
-#
-
diff --git a/freed-ora/current/master/config-arm-tegra b/freed-ora/current/master/config-arm-tegra
index 9037d4b26..1f20ce7f9 100644
--- a/freed-ora/current/master/config-arm-tegra
+++ b/freed-ora/current/master/config-arm-tegra
@@ -19,19 +19,11 @@ CONFIG_MACH_TEGRA_DT=y
CONFIG_MACH_VENTANA=y
CONFIG_TEGRA_DEBUG_UARTD=y
-CONFIG_NO_HZ=y
-CONFIG_SMP=y
CONFIG_NR_CPUS=4
CONFIG_ARM_CPU_TOPOLOGY=y
-CONFIG_PREEMPT=y
-CONFIG_AEABI=y
CONFIG_I2C_TEGRA=y
-CONFIG_MMC=y
-CONFIG_MMC_BLOCK=y
-CONFIG_MMC_SDHCI=y
-CONFIG_MMC_SDHCI_PLTFM=y
CONFIG_MMC_SDHCI_TEGRA=y
# CONFIG_RCU_BOOST is not set
@@ -56,11 +48,9 @@ CONFIG_ARM_ERRATA_720789=y
# CONFIG_ARM_ERRATA_754322 is not set
# CONFIG_ARM_ERRATA_754327 is not set
# CONFIG_ARM_ERRATA_764369 is not set
-CONFIG_SMP_ON_UP=y
CONFIG_LOCAL_TIMERS=y
# CONFIG_THUMB2_KERNEL is not set
# CONFIG_NEON is not set
-# CONFIG_RFKILL_GPIO is not set
CONFIG_GPIO_GENERIC_PLATFORM=y
# CONFIG_GPIO_MCP23S08 is not set
# CONFIG_KEYBOARD_TEGRA is not set
@@ -73,9 +63,6 @@ CONFIG_SND_SOC_TEGRA_WM8903=m
CONFIG_SND_SOC_TEGRA_TRIMSLICE=m
CONFIG_MFD_NVEC=y
-# CONFIG_DEBUG_PREEMPT is not set
-# CONFIG_RCU_CPU_STALL_VERBOSE is not set
-# CONFIG_PREEMPT_TRACER is not set
CONFIG_KEYBOARD_NVEC=y
CONFIG_SERIO_NVEC_PS2=y
CONFIG_NVEC_POWER=y
@@ -83,23 +70,13 @@ CONFIG_POWER_SUPPLY=y
CONFIG_NVEC_LEDS=y
CONFIG_CPU_PM=y
-CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ARM_CPU_SUSPEND=y
-CONFIG_CRYSTALHD=m
+#CONFIG_CRYPTO_DEV_TEGRA_AES=m
CONFIG_PL310_ERRATA_753970=y
-CONFIG_SCHED_MC=y
-CONFIG_SCHED_SMT=y
CONFIG_LEDS_RENESAS_TPU=y
-# CONFIG_ARM_EXYNOS4210_CPUFREQ is not set
-# CONFIG_ETHERNET is not set
-# CONFIG_NET_VENDOR_BROADCOM is not set
-# CONFIG_INPUT_GP2A is not set
-# CONFIG_INPUT_GPIO_TILT_POLLED is not set
-# CONFIG_DVB_TDA1004X is not set
-# CONFIG_DVB_PLL is not set
# CONFIG_SND_SOC_TEGRA_ALC5632 is not set
CONFIG_PCI=y
diff --git a/freed-ora/current/master/config-arm-versatile b/freed-ora/current/master/config-arm-versatile
new file mode 100644
index 000000000..207042501
--- /dev/null
+++ b/freed-ora/current/master/config-arm-versatile
@@ -0,0 +1,72 @@
+CONFIG_ARCH_VEXPRESS=y
+CONFIG_ARCH_VEXPRESS_CA9X4=y
+CONFIG_PLAT_VERSATILE_CLCD=y
+CONFIG_PLAT_VERSATILE_SCHED_CLOCK=y
+CONFIG_PLAT_VERSATILE=y
+CONFIG_ARM_TIMER_SP804=y
+
+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
+CONFIG_CPU_HAS_PMU=y
+
+# Need to verify whether these are generic or vexpress specific
+CONFIG_ARM_AMBA=y
+
+CONFIG_USE_GENERIC_SMP_HELPERS=y
+CONFIG_VFP=y
+CONFIG_VFPv3=y
+
+CONFIG_CPUSETS=y
+# CONFIG_THUMB2_AVOID_R_ARM_THM_JUMP11 is not set
+# CONFIG_THUMB2_KERNEL is not set
+CONFIG_TICK_ONESHOT=y
+
+CONFIG_ARM_ASM_UNIFIED=y
+CONFIG_ARM_CPU_TOPOLOGY=y
+CONFIG_ARM_DMA_MEM_BUFFERABLE=y
+
+CONFIG_ARM_ERRATA_720789=y
+CONFIG_ARM_ERRATA_751472=y
+CONFIG_ARM_ERRATA_753970=y
+
+CONFIG_ARM_GIC=y
+CONFIG_ARM_L1_CACHE_SHIFT=5
+
+CONFIG_ARM_THUMB=y
+CONFIG_ARM_TIMER_SP804=y
+CONFIG_ARM_UNWIND=y
+
+CONFIG_FB=y
+CONFIG_FB_ARMCLCD=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+
+CONFIG_TOUCHSCREEN_ADS7846=m
+
+CONFIG_CMDLINE="console=ttyAM0,115200 root=/dev/sda1 rootdelay=20"
+
+CONFIG_SERIO_AMBAKMI=m
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+
+CONFIG_FB_ARMCLCD=m
+
+CONFIG_MMC_ARMMMCI=y
+CONFIG_MMC_DW=m
+# CONFIG_MMC_DW_IDMAC is not set
+
+# CONFIG_ARM_CHARLCD is not set
+CONFIG_PL330_DMA=y
+
+CONFIG_I2C_VERSATILE=y
diff --git a/freed-ora/current/master/config-debug b/freed-ora/current/master/config-debug
index 03964c6c4..b9334f4ac 100644
--- a/freed-ora/current/master/config-debug
+++ b/freed-ora/current/master/config-debug
@@ -72,6 +72,8 @@ CONFIG_DEBUG_PERF_USE_VMALLOC=y
CONFIG_JBD2_DEBUG=y
+CONFIG_NFSD_FAULT_INJECTION=y
+
CONFIG_DEBUG_BLK_CGROUP=y
CONFIG_DRBD_FAULT_INJECTION=y
diff --git a/freed-ora/current/master/config-generic b/freed-ora/current/master/config-generic
index 6a2d236be..9bc5a9115 100644
--- a/freed-ora/current/master/config-generic
+++ b/freed-ora/current/master/config-generic
@@ -39,7 +39,7 @@ CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_SYSCTL=y
-CONFIG_LOG_BUF_SHIFT=17
+CONFIG_LOG_BUF_SHIFT=18
# CONFIG_IKCONFIG is not set
# CONFIG_EMBEDDED is not set
# CONFIG_EXPERT is not set
@@ -747,7 +747,7 @@ CONFIG_BRIDGE=m
CONFIG_BRIDGE_IGMP_SNOOPING=y
# PHY timestamping adds overhead
-# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
+CONFIG_NETWORK_PHY_TIMESTAMPING=y
CONFIG_NETFILTER=y
CONFIG_NETFILTER_ADVANCED=y
@@ -1391,7 +1391,10 @@ CONFIG_IPPP_FILTER=y
CONFIG_PPP_BSDCOMP=y
CONFIG_PPPOE=m
CONFIG_PPP_MPPE=m
-# CONFIG_SLIP is not set
+CONFIG_SLIP=m
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLIP_SMART=y
+# CONFIG_SLIP_MODE_SLIP6 is not set
#
# Wireless LAN
@@ -1411,7 +1414,7 @@ CONFIG_CFG80211_DEFAULT_PS=y
CONFIG_NL80211=y
# CONFIG_NL80211_TESTMODE is not set
CONFIG_WIRELESS_EXT=y
-CONFIG_WIRELESS_EXT_SYSFS=y
+# CONFIG_WIRELESS_EXT_SYSFS is not set
CONFIG_LIB80211=m
CONFIG_LIB80211_CRYPT_WEP=m
CONFIG_LIB80211_CRYPT_CCMP=m
@@ -1464,13 +1467,13 @@ CONFIG_B43_SDIO=y
CONFIG_B43_BCMA=y
# CONFIG_B43_BCMA_EXTRA is not set
CONFIG_B43_BCMA_PIO=y
-# CONFIG_B43_DEBUG is not set
+CONFIG_B43_DEBUG=y
CONFIG_B43_PHY_LP=y
CONFIG_B43_PHY_N=y
CONFIG_B43_PHY_HT=y
# CONFIG_B43_FORCE_PIO is not set
CONFIG_B43LEGACY=m
-# CONFIG_B43LEGACY_DEBUG is not set
+CONFIG_B43LEGACY_DEBUG=y
CONFIG_B43LEGACY_DMA=y
CONFIG_B43LEGACY_PIO=y
CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y
@@ -2385,7 +2388,7 @@ CONFIG_DRM_RADEON_KMS=y
# CONFIG_DRM_SAVAGE is not set
CONFIG_DRM_I915=m
CONFIG_DRM_I915_KMS=y
-# CONFIG_DRM_VIA is not set
+CONFIG_DRM_VIA=m
CONFIG_DRM_NOUVEAU=m
CONFIG_DRM_NOUVEAU_BACKLIGHT=y
CONFIG_DRM_NOUVEAU_DEBUG=y
@@ -3055,7 +3058,7 @@ CONFIG_USB_STORAGE_REALTEK=m
CONFIG_REALTEK_AUTOPM=y
CONFIG_USB_STORAGE_ENE_UB6250=m
# CONFIG_USB_LIBUSUAL is not set
-# CONFIG_USB_UAS is not set
+CONFIG_USB_UAS=m
#
@@ -3472,7 +3475,7 @@ CONFIG_DNOTIFY=y
CONFIG_AUTOFS4_FS=y
# CONFIG_EXOFS_FS is not set
# CONFIG_EXOFS_DEBUG is not set
-# CONFIG_NILFS2_FS is not set
+CONFIG_NILFS2_FS=m
# CONFIG_LOGFS is not set
CONFIG_CEPH_FS=m
CONFIG_BLK_DEV_RBD=m
@@ -3569,8 +3572,6 @@ CONFIG_NFSD=m
CONFIG_NFSD_V3=y
CONFIG_NFSD_V3_ACL=y
CONFIG_NFSD_V4=y
-# Maybe see if we want this on for debug kernels?
-# CONFIG_NFSD_FAULT_INJECTION is not set
CONFIG_NFS_FSCACHE=y
# CONFIG_NFS_USE_LEGACY_DNS is not set
CONFIG_NFS_USE_NEW_IDMAPPER=y
@@ -3582,6 +3583,7 @@ CONFIG_EXPORTFS=y
CONFIG_SUNRPC=m
CONFIG_SUNRPC_GSS=m
CONFIG_SUNRPC_XPRT_RDMA=m
+CONFIG_SUNRPC_DEBUG=y
CONFIG_RPCSEC_GSS_KRB5=m
CONFIG_CIFS=m
CONFIG_CIFS_STATS=y
@@ -3960,7 +3962,7 @@ CONFIG_IBMASR=m
CONFIG_PM_DEBUG=y
CONFIG_PM_TRACE=y
CONFIG_PM_TRACE_RTC=y
-# CONFIG_PM_TEST_SUSPEND is not set
+CONFIG_PM_TEST_SUSPEND=y
CONFIG_PM_RUNTIME=y
# CONFIG_PM_OPP is not set
@@ -4297,7 +4299,8 @@ CONFIG_LSM_MMAP_MIN_ADDR=65536
CONFIG_STRIP_ASM_SYMS=y
# CONFIG_RCU_FANOUT_EXACT is not set
-CONFIG_RCU_FAST_NO_HZ=y
+# FIXME: Revisit FAST_NO_HZ after 3.5
+# CONFIG_RCU_FAST_NO_HZ is not set
CONFIG_RCU_CPU_STALL_TIMEOUT=60
# CONFIG_RCU_TORTURE_TEST is not set
# CONFIG_RCU_TRACE is not set
@@ -4390,7 +4393,7 @@ CONFIG_BCMA_HOST_PCI=y
# CONFIG_BCMA_DEBUG is not set
# CONFIG_GOOGLE_FIRMWARE is not set
-CONFIG_INTEL_MID_PTI=m
+# CONFIG_INTEL_MID_PTI is not set
CONFIG_IOMMU_SUPPORT=y
# CONFIG_PM_DEVFREQ is not set
diff --git a/freed-ora/current/master/config-nodebug b/freed-ora/current/master/config-nodebug
index aff30011e..485f1b0af 100644
--- a/freed-ora/current/master/config-nodebug
+++ b/freed-ora/current/master/config-nodebug
@@ -2,109 +2,111 @@ CONFIG_SND_VERBOSE_PRINTK=y
CONFIG_SND_DEBUG=y
CONFIG_SND_PCM_XRUN_DEBUG=y
-# CONFIG_DEBUG_ATOMIC_SLEEP is not set
-
-# CONFIG_DEBUG_MUTEXES is not set
-# CONFIG_DEBUG_RT_MUTEXES is not set
-# CONFIG_DEBUG_LOCK_ALLOC is not set
-# CONFIG_PROVE_LOCKING is not set
-# CONFIG_DEBUG_SPINLOCK is not set
-# CONFIG_PROVE_RCU is not set
+CONFIG_DEBUG_ATOMIC_SLEEP=y
+
+CONFIG_DEBUG_MUTEXES=y
+CONFIG_DEBUG_RT_MUTEXES=y
+CONFIG_DEBUG_LOCK_ALLOC=y
+CONFIG_PROVE_LOCKING=y
+CONFIG_DEBUG_SPINLOCK=y
+CONFIG_PROVE_RCU=y
# CONFIG_PROVE_RCU_REPEATEDLY is not set
-# CONFIG_DEBUG_PER_CPU_MAPS is not set
+CONFIG_DEBUG_PER_CPU_MAPS=y
CONFIG_CPUMASK_OFFSTACK=y
-# CONFIG_CPU_NOTIFIER_ERROR_INJECT is not set
+CONFIG_CPU_NOTIFIER_ERROR_INJECT=m
-# CONFIG_FAULT_INJECTION is not set
-# CONFIG_FAILSLAB is not set
-# CONFIG_FAIL_PAGE_ALLOC is not set
-# CONFIG_FAIL_MAKE_REQUEST is not set
-# CONFIG_FAULT_INJECTION_DEBUG_FS is not set
-# CONFIG_FAULT_INJECTION_STACKTRACE_FILTER is not set
-# CONFIG_FAIL_IO_TIMEOUT is not set
-# CONFIG_FAIL_MMC_REQUEST is not set
+CONFIG_FAULT_INJECTION=y
+CONFIG_FAILSLAB=y
+CONFIG_FAIL_PAGE_ALLOC=y
+CONFIG_FAIL_MAKE_REQUEST=y
+CONFIG_FAULT_INJECTION_DEBUG_FS=y
+CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y
+CONFIG_FAIL_IO_TIMEOUT=y
+CONFIG_FAIL_MMC_REQUEST=y
-# CONFIG_SLUB_DEBUG_ON is not set
+CONFIG_SLUB_DEBUG_ON=y
-# CONFIG_LOCK_STAT is not set
+CONFIG_LOCK_STAT=y
-# CONFIG_DEBUG_STACK_USAGE is not set
+CONFIG_DEBUG_STACK_USAGE=y
-# CONFIG_ACPI_DEBUG is not set
+CONFIG_ACPI_DEBUG=y
# CONFIG_ACPI_DEBUG_FUNC_TRACE is not set
-# CONFIG_DEBUG_SG is not set
+CONFIG_DEBUG_SG=y
# CONFIG_DEBUG_PAGEALLOC is not set
-# CONFIG_DEBUG_WRITECOUNT is not set
-# CONFIG_DEBUG_OBJECTS is not set
+CONFIG_DEBUG_WRITECOUNT=y
+CONFIG_DEBUG_OBJECTS=y
# CONFIG_DEBUG_OBJECTS_SELFTEST is not set
-# CONFIG_DEBUG_OBJECTS_FREE is not set
-# CONFIG_DEBUG_OBJECTS_TIMERS is not set
-# CONFIG_DEBUG_OBJECTS_RCU_HEAD is not set
+CONFIG_DEBUG_OBJECTS_FREE=y
+CONFIG_DEBUG_OBJECTS_TIMERS=y
+CONFIG_DEBUG_OBJECTS_RCU_HEAD=y
CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1
-# CONFIG_X86_PTDUMP is not set
+CONFIG_X86_PTDUMP=y
-# CONFIG_CAN_DEBUG_DEVICES is not set
+CONFIG_CAN_DEBUG_DEVICES=y
-# CONFIG_MODULE_FORCE_UNLOAD is not set
+CONFIG_MODULE_FORCE_UNLOAD=y
-# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+CONFIG_SYSCTL_SYSCALL_CHECK=y
-# CONFIG_DEBUG_NOTIFIERS is not set
+CONFIG_DEBUG_NOTIFIERS=y
-# CONFIG_DMA_API_DEBUG is not set
+CONFIG_DMA_API_DEBUG=y
-# CONFIG_MMIOTRACE is not set
+CONFIG_MMIOTRACE=y
-# CONFIG_DEBUG_CREDENTIALS is not set
+CONFIG_DEBUG_CREDENTIALS=y
# off in both production debug and nodebug builds,
# on in rawhide nodebug builds
-# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
+CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y
-# CONFIG_EXT4_DEBUG is not set
+CONFIG_EXT4_DEBUG=y
-# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
+CONFIG_DEBUG_PERF_USE_VMALLOC=y
-# CONFIG_JBD2_DEBUG is not set
+CONFIG_JBD2_DEBUG=y
-# CONFIG_DEBUG_BLK_CGROUP is not set
+CONFIG_NFSD_FAULT_INJECTION=y
-# CONFIG_DRBD_FAULT_INJECTION is not set
+CONFIG_DEBUG_BLK_CGROUP=y
-# CONFIG_ATH_DEBUG is not set
-# CONFIG_CARL9170_DEBUGFS is not set
-# CONFIG_IWLWIFI_DEVICE_TRACING is not set
+CONFIG_DRBD_FAULT_INJECTION=y
-# CONFIG_DEBUG_OBJECTS_WORK is not set
+CONFIG_ATH_DEBUG=y
+CONFIG_CARL9170_DEBUGFS=y
+CONFIG_IWLWIFI_DEVICE_TRACING=y
-# CONFIG_DMADEVICES_DEBUG is not set
-# CONFIG_DMADEVICES_VDEBUG is not set
+CONFIG_DEBUG_OBJECTS_WORK=y
+
+CONFIG_DMADEVICES_DEBUG=y
+CONFIG_DMADEVICES_VDEBUG=y
CONFIG_PM_ADVANCED_DEBUG=y
-# CONFIG_CEPH_LIB_PRETTYDEBUG is not set
-# CONFIG_QUOTA_DEBUG is not set
+CONFIG_CEPH_LIB_PRETTYDEBUG=y
+CONFIG_QUOTA_DEBUG=y
CONFIG_PCI_DEFAULT_USE_CRS=y
CONFIG_KGDB_KDB=y
CONFIG_KDB_KEYBOARD=y
-# CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER is not set
-# CONFIG_TEST_LIST_SORT is not set
+CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER=y
+CONFIG_TEST_LIST_SORT=y
-# CONFIG_DETECT_HUNG_TASK is not set
+CONFIG_DETECT_HUNG_TASK=y
CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120
# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
-# CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK is not set
+CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK=y
-# CONFIG_DEBUG_KMEMLEAK is not set
+CONFIG_DEBUG_KMEMLEAK=y
CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=1024
# CONFIG_DEBUG_KMEMLEAK_TEST is not set
CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF=y
diff --git a/freed-ora/current/master/config-powerpc-generic b/freed-ora/current/master/config-powerpc-generic
index a05befa1d..49ba30efe 100644
--- a/freed-ora/current/master/config-powerpc-generic
+++ b/freed-ora/current/master/config-powerpc-generic
@@ -159,8 +159,7 @@ CONFIG_IDE_TASK_IOCTL=y
# CONFIG_BLK_DEV_SLC90E66 is not set
# CONFIG_BLK_DEV_TRM290 is not set
# CONFIG_BLK_DEV_VIA82CXXX is not set
-CONFIG_BLK_DEV_IDE_PMAC=m
-CONFIG_BLK_DEV_IDE_PMAC_ATA100FIRST=y
+# CONFIG_BLK_DEV_IDE_PMAC is not set
CONFIG_BLK_DEV_IDEDMA=y
# CONFIG_BLK_DEV_HD is not set
# CONFIG_USB_STORAGE_ISD200 is not set
diff --git a/freed-ora/current/master/config-powerpc64 b/freed-ora/current/master/config-powerpc64
index d099c513c..f54bcdc34 100644
--- a/freed-ora/current/master/config-powerpc64
+++ b/freed-ora/current/master/config-powerpc64
@@ -162,4 +162,5 @@ CONFIG_BPF_JIT=y
# CONFIG_PPC_ICSWX_PID is not set
# CONFIG_PPC_ICSWX_USE_SIGILL is not set
# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set
+# CONFIG_PCIEPORTBUS is not set
diff --git a/freed-ora/current/master/config-x86-generic b/freed-ora/current/master/config-x86-generic
index 859d92dcb..ad2ae8ecd 100644
--- a/freed-ora/current/master/config-x86-generic
+++ b/freed-ora/current/master/config-x86-generic
@@ -215,6 +215,7 @@ CONFIG_DELL_WMI_AIO=m
CONFIG_EEEPC_WMI=m
CONFIG_INTEL_OAKTRAIL=m
CONFIG_SAMSUNG_Q10=m
+CONFIG_APPLE_GMUX=m
CONFIG_XO15_EBOOK=m
# CONFIG_TOUCHSCREEN_INTEL_MID is not set
@@ -313,7 +314,7 @@ CONFIG_STRICT_DEVMEM=y
# CONFIG_NO_BOOTMEM is not set
# CONFIG_MEMTEST is not set
-# CONFIG_MAXSMP is not set
+CONFIG_MAXSMP=y
CONFIG_HP_ILO=m
@@ -394,14 +395,18 @@ CONFIG_SCHED_SMT=y
CONFIG_CC_STACKPROTECTOR=y
CONFIG_RELOCATABLE=y
-# CONFIG_HYPERV is not set
+CONFIG_HYPERV=m
+CONFIG_HYPERV_UTILS=m
+CONFIG_HID_HYPERV_MOUSE=m
+CONFIG_HYPERV_NET=m
+CONFIG_HYPERV_STORAGE=m
# Depends on HOTPLUG_PCI_PCIE
CONFIG_BLK_DEV_PCIESSD_MTIP32XX=m
CONFIG_DRM_GMA500=m
# CONFIG_DRM_GMA600 is not set
-# CONFIG_DRM_GMA3600 is not set
+CONFIG_DRM_GMA3600=y
# Maybe enable in debug kernels?
# CONFIG_DEBUG_NMI_SELFTEST is not set
diff --git a/freed-ora/current/master/deblob-3.4 b/freed-ora/current/master/deblob-3.4
new file mode 100755
index 000000000..41ecc8a42
--- /dev/null
+++ b/freed-ora/current/master/deblob-3.4
@@ -0,0 +1,2559 @@
+#!/bin/sh
+
+# Copyright (C) 2008-2012 Alexandre Oliva <lxoliva@fsfla.org>
+# Copyright (C) 2008 Jeff Moe
+# Copyright (C) 2009 Rubén Rodríguez <ruben@gnu.org>
+#
+# This program is part of GNU Linux-libre, a GNU project that
+# publishes scripts to clean up Linux so as to make it suitable for
+# use in the GNU Project and in Free System Distributions.
+#
+# 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 St, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+# deblob - remove non-free blobs from the vanilla linux kernel
+
+# http://www.fsfla.org/svn/fsfla/software/linux-libre
+
+
+# This script, suited for the kernel version named below, in kver,
+# attempts to remove only non-Free Software bits, without removing
+# Free Software that happens to be in the same file.
+
+# Drivers that currently require non-Free firmware are retained, but
+# firmware included in GPLed sources is replaced with /*(DEBLOBBED)*/
+# if the deblob-check script, that knows how to do this, is present.
+# -lxoliva
+
+
+# See also:
+# http://wiki.debian.org/KernelFirmwareLicensing
+# svn://svn.debian.org/kernel/dists/trunk/linux-2.6/debian/patches/debian/dfsg/files-1
+# http://wiki.gnewsense.org/Builder gen-kernel
+
+# Thanks to Brian Brazil @ gnewsense
+
+
+# For each kver release, start extra with an empty string, then count
+# from 1 if changes are needed that require rebuilding the tarball.
+kver=3.4 extra=
+
+case $1 in
+--force)
+ echo "WARNING: Using the force, ignored errors will be" >&2
+ die () {
+ echo ERROR: "$@" >&2
+ errors=:
+ }
+ forced=: errors=false
+ shift
+ ;;
+*)
+ die () {
+ echo ERROR: "$@" >&2
+ echo Use --force to ignore
+ exit 1
+ }
+ forced=false errors=false
+ ;;
+esac
+
+check=`echo "$0" | sed 's,[^/]*$,,;s,^$,.,;s,/*$,,'`/deblob-check
+if [ ! -f $check ] ; then
+ if $forced; then
+ die deblob-check script missing, will remove entire files
+ else
+ die deblob-check script missing
+ fi
+ have_check=false
+else
+ have_check=:
+fi
+
+filetest () {
+ if [ ! -f $1 ]; then
+ die $1 does not exist, something is wrong && return 1
+ fi
+}
+
+announce () {
+ echo
+ echo "$@"
+}
+
+clean_file () {
+ #$1 = filename
+ filetest $1 || return
+ rm $1
+ echo $1: removed
+}
+
+check_changed () {
+ #$1 = filename
+ if cmp $1.deblob $1 > /dev/null; then
+ rm $1.deblob
+ die $1 did not change, something is wrong && return 1
+ fi
+ mv $1.deblob $1
+}
+
+clean_blob () {
+ #$1 = filename
+ filetest $1 || return
+ if $have_check; then
+ name=$1
+ set fnord "$@" -d
+ shift 2
+ $check "$@" -i linux-$kver $name > $name.deblob
+ check_changed $name && echo $name: removed blobs
+ else
+ clean_file $1
+ fi
+}
+
+dummy_blob () {
+ #$1 = filename
+ if test -f $1; then
+ die $1 exists, something is wrong && return
+ elif test ! -f firmware/Makefile; then
+ die firmware/Makefile does not exist, something is wrong && return
+ fi
+
+ clean_sed "s,`echo $1 | sed s,^firmware/,,`,\$(DEBLOBBED),g" \
+ firmware/Makefile "dropped $1"
+}
+
+clean_fw () {
+ #$1 = firmware text input, $2 = firmware output
+ filetest $1 || return
+ if test -f $2; then
+ die $2 exists, something is wrong && return
+ fi
+ clean_blob $1 -s 4
+ dummy_blob $2
+}
+
+drop_fw_file () {
+ #$1 = firmware text input, $2 = firmware output
+ filetest $1 || return
+ if test -f $2; then
+ die $2 exists, something is wrong && return
+ fi
+ clean_file $1
+ dummy_blob $2
+}
+
+clean_kconfig () {
+ #$1 = filename $2 = things to remove
+ case $1 in
+ -f)
+ shift
+ ;;
+ *)
+ if $have_check; then
+ return
+ fi
+ ;;
+ esac
+ filetest $1 || return
+ sed "/^config \\($2\\)\$/{p;i\
+ depends on NONFREE
+d;}" $1 > $1.deblob
+ check_changed $1 && echo $1: marked config $2 as depending on NONFREE
+}
+
+clean_mk () {
+ #$1 = config $2 = Makefile name
+ # We don't clean up Makefiles any more --lxoliva
+ # sed -i "/\\($1\\)/d" $2
+ # echo $2: removed $1 support
+ # check_changed $2
+ filetest $2 || return
+ if sed -n "/\\($1\\)/p" $2 | grep . > /dev/null; then
+ :
+ else
+ die $2 does not contain matches for $1
+ fi
+}
+
+clean_sed () {
+ #$1 = sed-script $2 = file $3 = comment
+ filetest $2 || return
+ sed -e "$1" "$2" > "$2".deblob || {
+ die $2: failed: ${3-applied sed script $1} && return 1; }
+ check_changed $2 && echo $2: ${3-applied sed script $1}
+}
+
+reject_firmware () {
+ #$1 = file $2 = pre sed pattern
+ filetest $1 || return
+ clean_sed "$2"'
+s,request\(_ihex\)\?_firmware\(_nowait\)\?,reject_firmware\2,g
+' "$1" 'disabled non-Free firmware-loading machinery'
+}
+
+maybe_reject_firmware () {
+ #$1 = file $2 = pre sed pattern
+ filetest $1 || return
+ clean_sed "$2"'
+s,request_firmware\(_nowait\)\?,maybe_reject_firmware\1,g
+' "$1" 'retain Free firmware-loading machinery, disabling non-Free one'
+}
+
+undefine_macro () {
+ #$1 - macro name
+ #$2 - substitution
+ #$3 - message
+ #rest - file names
+ macro=$1 repl=$2 msg=$3; shift 3
+ for f in "$@"; do
+ clean_sed "
+s,^#define $macro .*\$,/*(DEBLOBBED)*/,;
+s,$macro,$repl,g;
+" "$f" "$msg"
+ done
+}
+
+undefault_firmware () {
+ #$1 - pattern such that $1_DEFAULT_FIRMWARE is #defined to non-Free firmware
+ #$@ other than $1 - file names
+ macro="$1"_DEFAULT_FIRMWARE; shift
+ undefine_macro "$macro" "\"/*(DEBLOBBED)*/\"" \
+ "disabled non-Free firmware" "$@"
+}
+
+# First, check that files that contain firmwares and their
+# corresponding sources are present.
+
+for f in \
+ drivers/char/ser_a2232fw.h \
+ drivers/char/ser_a2232fw.ax \
+ drivers/gpu/drm/nouveau/nva3_copy.fuc.h \
+ drivers/gpu/drm/nouveau/nva3_copy.fuc \
+ drivers/gpu/drm/nouveau/nvc0_copy.fuc.h \
+ drivers/gpu/drm/nouveau/nva3_copy.fuc \
+ drivers/gpu/drm/nouveau/nvc0_grgpc.fuc.h \
+ drivers/gpu/drm/nouveau/nvc0_grgpc.fuc \
+ drivers/gpu/drm/nouveau/nvc0_grhub.fuc.h \
+ drivers/gpu/drm/nouveau/nvc0_grhub.fuc \
+ drivers/net/ixp2000/ixp2400_rx.ucode \
+ drivers/net/ixp2000/ixp2400_rx.uc \
+ drivers/net/ixp2000/ixp2400_tx.ucode \
+ drivers/net/ixp2000/ixp2400_rx.uc \
+ drivers/net/wan/wanxlfw.inc_shipped \
+ drivers/net/wan/wanxlfw.S \
+ drivers/net/wireless/atmel.c \
+ drivers/net/wireless/atmel.c \
+ drivers/scsi/53c700_d.h_shipped \
+ drivers/scsi/53c700.scr \
+ drivers/scsi/aic7xxx/aic79xx_seq.h_shipped \
+ drivers/scsi/aic7xxx/aic79xx.seq \
+ drivers/scsi/aic7xxx/aic7xxx_seq.h_shipped \
+ drivers/scsi/aic7xxx/aic7xxx.seq \
+ drivers/scsi/aic7xxx_old/aic7xxx_seq.c \
+ drivers/scsi/aic7xxx_old/aic7xxx.seq \
+ drivers/scsi/53c7xx_d.h_shipped \
+ drivers/scsi/53c7xx.scr \
+ drivers/scsi/sym53c8xx_2/sym_fw1.h \
+ drivers/scsi/sym53c8xx_2/sym_fw1.h \
+ drivers/scsi/sym53c8xx_2/sym_fw2.h \
+ drivers/scsi/sym53c8xx_2/sym_fw2.h \
+ firmware/dsp56k/bootstrap.bin.ihex \
+ firmware/dsp56k/bootstrap.asm \
+ firmware/keyspan_pda/keyspan_pda.HEX \
+ firmware/keyspan_pda/keyspan_pda.S \
+ firmware/keyspan_pda/xircom_pgs.HEX \
+ firmware/keyspan_pda/xircom_pgs.S \
+ sound/pci/cs46xx/imgs/cwcdma.h \
+ sound/pci/cs46xx/imgs/cwcdma.asp \
+ firmware/isci/isci_firmware.bin.ihex \
+ drivers/scsi/isci/firmware/create_fw.c \
+; do
+ if test ! $f; then
+ die $f is not present, something is amiss && return
+ fi
+done
+
+# Identify the tarball.
+grep -q 'EXTRAVERSION.*-gnu' Makefile ||
+clean_sed "s,^EXTRAVERSION.*,&-gnu$extra,
+" Makefile 'added -gnu to EXTRAVERSION'
+
+grep -q Linux-libre README ||
+clean_sed '
+1,3 s,Linux kernel release.*kernel\.org.*,GNU Linux-libre <http://linux-libre.fsfla.org>,
+2,5 s,Linux version [0-9.]*,GNU Linux-libre,
+1,20 s,\(operating system \)\?Unix,Unix kernel,
+/WHAT IS LINUX/i\
+WHAT IS GNU Linux-libre?\
+\
+ GNU Linux-libre is a Free version of the kernel Linux (see below),\
+ suitable for use with the GNU Operating System in 100% Free\
+ GNU/Linux-libre System Distributions.\
+ http://www.gnu.org/distros/\
+\
+ It removes non-Free components from Linux, that are disguised as\
+ source code or distributed in separate files. It also disables\
+ run-time requests for non-Free components, shipped separately or as\
+ part of Linux, and documentation pointing to them, so as to avoid\
+ (Free-)baiting users into the trap of non-Free Software.\
+ http://www.fsfla.org/anuncio/2010-11-Linux-2.6.36-libre-debait\
+\
+ Linux-libre started within the gNewSense GNU/Linux distribution.\
+ It was later adopted by Jeff Moe, who coined its name, and in 2008\
+ it became a project maintained by FSF Latin America. In 2012, it\
+ became part of the GNU Project.\
+\
+ The GNU Linux-libre project takes a minimal-changes approach to\
+ cleaning up Linux, making no effort to substitute components that\
+ need to be removed with functionally equivalent Free ones.\
+ Nevertheless, we encourage and support efforts towards doing so.\
+ http://libreplanet.org/wiki/LinuxLibre:Devices_that_require_non-free_firmware\
+\
+ Our mascot is Freedo, a light-blue penguin that has just come out\
+ of the shower. Although we like penguins, GNU is a much greater\
+ contribution to the entire system, so its mascot deserves more\
+ promotion. See our web page for their images.\
+ http://linux-libre.fsfla.org/\
+
+' README 'added blurb about GNU Linux-libre'
+
+# Add reject_firmware and maybe_reject_firmware
+grep -q _LINUX_LIBRE_FIRMWARE_H include/linux/firmware.h ||
+clean_sed '$i\
+#ifndef _LINUX_LIBRE_FIRMWARE_H\
+#define _LINUX_LIBRE_FIRMWARE_H\
+\
+#include <linux/device.h>\
+\
+#define NONFREE_FIRMWARE "/*(DEBLOBBED)*/"\
+\
+static inline int\
+report_missing_free_firmware(const char *name, const char *what)\
+{\
+ printk(KERN_ERR "%s: Missing Free %s\\n", name,\
+ what ? what : "firmware");\
+ return -EINVAL;\
+}\
+static inline int\
+reject_firmware(const struct firmware **fw,\
+ const char *name, struct device *device)\
+{\
+ const struct firmware *xfw = NULL;\
+ int retval;\
+ report_missing_free_firmware(dev_name(device), NULL);\
+ retval = request_firmware(&xfw, NONFREE_FIRMWARE, device);\
+ if (!retval)\
+ release_firmware(xfw);\
+ return -EINVAL;\
+}\
+static inline int\
+maybe_reject_firmware(const struct firmware **fw,\
+ const char *name, struct device *device)\
+{\
+ if (strstr (name, NONFREE_FIRMWARE))\
+ return reject_firmware(fw, name, device);\
+ else\
+ return request_firmware(fw, name, device);\
+}\
+static inline void\
+discard_rejected_firmware(const struct firmware *fw, void *context)\
+{\
+ release_firmware(fw);\
+}\
+static inline int\
+reject_firmware_nowait(struct module *module, int uevent,\
+ const char *name, struct device *device,\
+ gfp_t gfp, void *context,\
+ void (*cont)(const struct firmware *fw,\
+ void *context))\
+{\
+ int retval;\
+ report_missing_free_firmware(dev_name(device), NULL);\
+ retval = request_firmware_nowait(module, uevent, NONFREE_FIRMWARE,\
+ device, gfp, NULL,\
+ discard_rejected_firmware);\
+ if (retval)\
+ return retval;\
+ return -EINVAL;\
+}\
+static inline int\
+maybe_reject_firmware_nowait(struct module *module, int uevent,\
+ const char *name, struct device *device,\
+ gfp_t gfp, void *context,\
+ void (*cont)(const struct firmware *fw,\
+ void *context))\
+{\
+ if (strstr (name, NONFREE_FIRMWARE))\
+ return reject_firmware_nowait(module, uevent, name,\
+ device, gfp, context, cont);\
+ else\
+ return request_firmware_nowait(module, uevent, name,\
+ device, gfp, context, cont);\
+}\
+\
+#endif /* _LINUX_LIBRE_FIRMWARE_H */\
+' include/linux/firmware.h 'added non-Free firmware notification support'
+
+########
+# Arch #
+########
+
+# x86
+
+announce MICROCODE_AMD - "AMD microcode patch loading support"
+reject_firmware arch/x86/kernel/microcode_amd.c
+clean_blob arch/x86/kernel/microcode_amd.c
+clean_kconfig arch/x86/Kconfig 'MICROCODE_AMD'
+clean_mk CONFIG_MICROCODE_AMD arch/x86/kernel/Makefile
+
+announce MICROCODE_INTEL - "Intel microcode patch loading support"
+reject_firmware arch/x86/kernel/microcode_intel.c
+clean_blob arch/x86/kernel/microcode_intel.c
+clean_kconfig arch/x86/Kconfig 'MICROCODE_INTEL'
+clean_mk CONFIG_MICROCODE_INTEL arch/x86/kernel/Makefile
+
+# arm
+
+announce IXP4XX_NPE - "IXP4xx Network Processor Engine support"
+reject_firmware arch/arm/mach-ixp4xx/ixp4xx_npe.c
+clean_blob Documentation/arm/IXP4xx
+
+announce ARCH_NETX - "Hilscher NetX based"
+clean_sed '
+s,\([" ]\)request_firmware(,\1reject_firmware(,
+' arch/arm/mach-netx/xc.c 'disabled non-Free firmware-loading machinery'
+clean_blob arch/arm/mach-netx/xc.c
+clean_blob drivers/net/ethernet/netx-eth.c
+clean_kconfig arch/arm/Kconfig 'ARCH_NETX'
+clean_mk CONFIG_ARCH_NETX arch/arm/Makefile
+
+#######
+# ATM #
+#######
+
+announce ATM_AMBASSADOR - "Madge Ambassador, Collage PCI 155 Server"
+reject_firmware drivers/atm/ambassador.c
+clean_blob drivers/atm/ambassador.c
+clean_fw firmware/atmsar11.HEX firmware/atmsar11.fw
+clean_kconfig drivers/atm/Kconfig 'ATM_AMBASSADOR'
+clean_mk CONFIG_ATM_AMBASSADOR drivers/atm/Makefile
+
+announce ATM_FORE200E - "FORE Systems 200E-series"
+reject_firmware drivers/atm/fore200e.c
+clean_blob drivers/atm/fore200e.c
+clean_blob Documentation/networking/fore200e.txt
+clean_blob drivers/atm/.gitignore
+clean_blob Documentation/dontdiff
+clean_kconfig drivers/atm/Kconfig 'ATM_FORE200E'
+clean_mk CONFIG_ATM_FORE200E drivers/atm/Makefile
+
+announce ATM_SOLOS - "Solos ADSL2+ PCI Multiport card driver"
+reject_firmware drivers/atm/solos-pci.c
+clean_blob drivers/atm/solos-pci.c
+clean_kconfig drivers/atm/Kconfig 'ATM_SOLOS'
+clean_mk CONFIG_ATM_SOLOS drivers/atm/Makefile
+
+########
+# tty #
+########
+
+announce COMPUTONE - "Computone IntelliPort Plus serial"
+drop_fw_file firmware/intelliport2.bin.ihex firmware/intelliport2.bin
+
+announce CYCLADES - "Cyclades async mux support"
+reject_firmware drivers/tty/cyclades.c
+clean_blob drivers/tty/cyclades.c
+clean_kconfig drivers/tty/Kconfig 'CYCLADES'
+clean_mk CONFIG_CYCLADES drivers/tty/Makefile
+
+announce ISI - "Multi-Tech multiport card support"
+reject_firmware drivers/tty/isicom.c
+clean_blob drivers/tty/isicom.c
+clean_kconfig drivers/tty/Kconfig 'ISI'
+clean_mk CONFIG_ISI drivers/tty/Makefile
+
+announce MOXA_INTELLIO - "Moxa Intellio support"
+reject_firmware drivers/tty/moxa.c
+clean_blob drivers/tty/moxa.c
+clean_kconfig drivers/tty/Kconfig 'MOXA_INTELLIO'
+clean_mk CONFIG_MOXA_INTELLIO drivers/tty/Makefile
+
+# gpu drm
+
+announce DRM_NOUVEAU - "Nouveau (nVidia) cards"
+reject_firmware drivers/gpu/drm/nouveau/nvc0_graph.c
+clean_blob drivers/gpu/drm/nouveau/nvc0_graph.c
+clean_kconfig drivers/gpu/drm/nouveau/Kconfig 'DRM_NOUVEAU'
+clean_mk CONFIG_DRM_NOUVEAU drivers/gpu/drm/nouveau/Makefile
+
+announce DRM_MGA - "Matrox g200/g400"
+drop_fw_file firmware/matrox/g200_warp.H16 firmware/matrox/g200_warp.fw
+drop_fw_file firmware/matrox/g400_warp.H16 firmware/matrox/g400_warp.fw
+reject_firmware drivers/gpu/drm/mga/mga_warp.c
+clean_blob drivers/gpu/drm/mga/mga_warp.c
+clean_kconfig drivers/gpu/drm/Kconfig 'DRM_MGA'
+clean_mk CONFIG_DRM_MGA drivers/gpu/drm/Makefile
+
+announce DRM_R128 - "ATI Rage 128"
+drop_fw_file firmware/r128/r128_cce.bin.ihex firmware/r128/r128_cce.bin
+reject_firmware drivers/gpu/drm/r128/r128_cce.c
+clean_blob drivers/gpu/drm/r128/r128_cce.c
+clean_kconfig drivers/gpu/drm/Kconfig 'DRM_R128'
+clean_mk CONFIG_DRM_R128 drivers/gpu/drm/Makefile
+
+announce DRM_RADEON - "ATI Radeon"
+drop_fw_file firmware/radeon/R100_cp.bin.ihex firmware/radeon/R100_cp.bin
+drop_fw_file firmware/radeon/R200_cp.bin.ihex firmware/radeon/R200_cp.bin
+drop_fw_file firmware/radeon/R300_cp.bin.ihex firmware/radeon/R300_cp.bin
+drop_fw_file firmware/radeon/R420_cp.bin.ihex firmware/radeon/R420_cp.bin
+drop_fw_file firmware/radeon/R520_cp.bin.ihex firmware/radeon/R520_cp.bin
+drop_fw_file firmware/radeon/R600_me.bin.ihex firmware/radeon/R600_me.bin
+drop_fw_file firmware/radeon/R600_pfp.bin.ihex firmware/radeon/R600_pfp.bin
+drop_fw_file firmware/radeon/RS600_cp.bin.ihex firmware/radeon/RS600_cp.bin
+drop_fw_file firmware/radeon/RS690_cp.bin.ihex firmware/radeon/RS690_cp.bin
+drop_fw_file firmware/radeon/RS780_me.bin.ihex firmware/radeon/RS780_me.bin
+drop_fw_file firmware/radeon/RS780_pfp.bin.ihex firmware/radeon/RS780_pfp.bin
+drop_fw_file firmware/radeon/RV610_me.bin.ihex firmware/radeon/RV610_me.bin
+drop_fw_file firmware/radeon/RV610_pfp.bin.ihex firmware/radeon/RV610_pfp.bin
+drop_fw_file firmware/radeon/RV620_me.bin.ihex firmware/radeon/RV620_me.bin
+drop_fw_file firmware/radeon/RV620_pfp.bin.ihex firmware/radeon/RV620_pfp.bin
+drop_fw_file firmware/radeon/RV630_me.bin.ihex firmware/radeon/RV630_me.bin
+drop_fw_file firmware/radeon/RV630_pfp.bin.ihex firmware/radeon/RV630_pfp.bin
+drop_fw_file firmware/radeon/RV635_me.bin.ihex firmware/radeon/RV635_me.bin
+drop_fw_file firmware/radeon/RV635_pfp.bin.ihex firmware/radeon/RV635_pfp.bin
+drop_fw_file firmware/radeon/RV670_me.bin.ihex firmware/radeon/RV670_me.bin
+drop_fw_file firmware/radeon/RV670_pfp.bin.ihex firmware/radeon/RV670_pfp.bin
+drop_fw_file firmware/radeon/RV710_me.bin.ihex firmware/radeon/RV710_me.bin
+drop_fw_file firmware/radeon/RV710_pfp.bin.ihex firmware/radeon/RV710_pfp.bin
+drop_fw_file firmware/radeon/RV730_me.bin.ihex firmware/radeon/RV730_me.bin
+drop_fw_file firmware/radeon/RV730_pfp.bin.ihex firmware/radeon/RV730_pfp.bin
+drop_fw_file firmware/radeon/RV770_me.bin.ihex firmware/radeon/RV770_me.bin
+drop_fw_file firmware/radeon/RV770_pfp.bin.ihex firmware/radeon/RV770_pfp.bin
+reject_firmware drivers/gpu/drm/radeon/radeon_cp.c
+clean_blob drivers/gpu/drm/radeon/radeon_cp.c
+reject_firmware drivers/gpu/drm/radeon/r100.c
+clean_blob drivers/gpu/drm/radeon/r100.c
+reject_firmware drivers/gpu/drm/radeon/r600.c
+clean_blob drivers/gpu/drm/radeon/r600.c
+reject_firmware drivers/gpu/drm/radeon/r600_cp.c
+clean_blob drivers/gpu/drm/radeon/r600_cp.c
+reject_firmware drivers/gpu/drm/radeon/ni.c
+clean_blob drivers/gpu/drm/radeon/ni.c
+reject_firmware drivers/gpu/drm/radeon/si.c
+clean_blob drivers/gpu/drm/radeon/si.c
+clean_kconfig drivers/gpu/drm/Kconfig 'DRM_RADEON'
+clean_mk CONFIG_DRM_RADEON drivers/gpu/drm/Makefile
+
+#######
+# dma #
+#######
+
+announce IMX_SDMA - "i.MX SDMA support"
+reject_firmware drivers/dma/imx-sdma.c
+clean_blob arch/arm/mach-imx/mm-imx25.c
+clean_blob arch/arm/mach-imx/mm-imx3.c
+clean_blob arch/arm/mach-imx/mm-imx5.c
+clean_blob arch/arm/boot/dts/imx51-babbage.dts
+clean_blob arch/arm/boot/dts/imx53-ard.dts
+clean_blob arch/arm/boot/dts/imx53-evk.dts
+clean_blob arch/arm/boot/dts/imx53-qsb.dts
+clean_blob arch/arm/boot/dts/imx53-smd.dts
+clean_blob Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt
+clean_kconfig drivers/dma/Kconfig 'IMX_SDMA'
+clean_mk CONFIG_IMX_SDMA drivers/dma/Makefile
+
+#########
+# Media #
+#########
+
+# media/tuner
+
+announce MEDIA_TUNER_XC2028 - "XCeive xc2028/xc3028 tuners"
+undefault_firmware 'XC\(2028\|3028L\)' \
+ drivers/media/common/tuners/tuner-xc2028.h \
+ drivers/media/video/saa7134/saa7134-cards.c \
+ drivers/media/video/ivtv/ivtv-driver.c \
+ drivers/media/video/cx18/cx18-driver.c \
+ drivers/media/video/cx18/cx18-dvb.c \
+ drivers/media/video/cx23885/cx23885-dvb.c \
+ drivers/media/video/cx23885/cx23885-video.c \
+ drivers/media/video/cx88/cx88-dvb.c \
+ drivers/media/video/cx88/cx88-cards.c \
+ drivers/media/video/em28xx/em28xx-cards.c \
+ drivers/media/dvb/dvb-usb/dib0700_devices.c \
+ drivers/media/dvb/dvb-usb/cxusb.c
+reject_firmware drivers/media/common/tuners/tuner-xc2028.c
+clean_kconfig drivers/media/common/tuners/Kconfig 'MEDIA_TUNER_XC2028'
+clean_mk CONFIG_MEDIA_TUNER_XC2028 drivers/media/common/tuners/Makefile
+
+announce VIDEO_TM6000_DVB - "DVB Support for tm6000 based TV cards"
+clean_blob drivers/media/video/tm6000/tm6000-cards.c
+clean_kconfig drivers/media/video/tm6000/Kconfig 'VIDEO_TM6000_DVB'
+clean_mk CONFIG_VIDEO_TM6000_DVB drivers/media/video/tm6000/Makefile
+
+announce MEDIA_TUNER_XC4000 - "Xceive XC4000 silicon tuner"
+undefault_firmware 'XC4000' drivers/media/common/tuners/xc4000.c
+maybe_reject_firmware drivers/media/common/tuners/xc4000.c
+clean_kconfig drivers/media/common/tuners/Kconfig 'MEDIA_TUNER_XC4000'
+clean_mk CONFIG_MEDIA_TUNER_XC4000 drivers/media/common/tuners/Makefile
+
+announce MEDIA_TUNER_XC5000 - "Xceive XC5000 silicon tuner"
+undefault_firmware 'XC5000' \
+ drivers/media/video/cx231xx/cx231xx-cards.c
+reject_firmware drivers/media/common/tuners/xc5000.c
+clean_blob drivers/media/common/tuners/xc5000.c
+clean_kconfig drivers/media/common/tuners/Kconfig 'MEDIA_TUNER_XC5000'
+clean_mk CONFIG_MEDIA_TUNER_XC5000 drivers/media/common/tuners/Makefile
+
+announce DVB_USB - "Support for various USB DVB devices"
+reject_firmware drivers/media/dvb/dvb-usb/dvb-usb-firmware.c
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB'
+clean_mk CONFIG_DVB_USB drivers/media/dvb/dvb-usb/Makefile
+
+announce DVB_USB_AF9005 - "Afatech AF9005 DVB-T USB1.1"
+clean_file drivers/media/dvb/dvb-usb/af9005-script.h
+clean_sed '
+s,^ deb_info("load init script\\n");$, {\n err("Missing Free init script\\n");\n return scriptlen = ret = -EINVAL;\n ,;
+' drivers/media/dvb/dvb-usb/af9005-fe.c 'report missing Free init script'
+clean_blob drivers/media/dvb/dvb-usb/af9005-fe.c
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB_AF9005'
+clean_mk CONFIG_DVB_USB_AF9005 drivers/media/dvb/dvb-usb/Makefile
+
+announce DVB_B2C2_FLEXCOP - "Technisat/B2C2 FlexCopII(b) and FlexCopIII adapters"
+reject_firmware drivers/media/dvb/b2c2/flexcop-fe-tuner.c
+
+announce DVB_BT8XX - "BT8xx based PCI cards"
+reject_firmware drivers/media/dvb/bt8xx/dvb-bt8xx.c
+
+announce DVB_USB_A800 - "AVerMedia AverTV DVB-T USB 2.0 (A800)"
+clean_blob drivers/media/dvb/dvb-usb/a800.c
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB_A800'
+clean_mk CONFIG_DVB_USB_A800 drivers/media/dvb/dvb-usb/Makefile
+
+announce DVB_USB_AF9005 - "Afatech AF9005 DVB-T USB1.1 support"
+clean_blob drivers/media/dvb/dvb-usb/af9005.c
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB_AF9005'
+clean_mk CONFIG_DVB_USB_AF9005 drivers/media/dvb/dvb-usb/Makefile
+
+announce DVB_USB_AF9015 - "Afatech AF9015 DVB-T USB2.0 support"
+clean_blob drivers/media/dvb/dvb-usb/af9015.c
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB_AF9015'
+clean_mk CONFIG_DVB_USB_AF9015 drivers/media/dvb/dvb-usb/Makefile
+
+announce DVB_USB_AZ6007 - "Azurewave 6007 and clones DVB-T/C USB2.0 support"
+clean_blob drivers/media/dvb/dvb-usb/az6007.c
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB_AZ6007'
+clean_mk CONFIG_DVB_USB_AZ6007 drivers/media/dvb/dvb-usb/Makefile
+
+announce DVB_USB_AZ6027 - "Azurewave DVB-S/S2 USB2.0 AZ6027 support"
+clean_blob drivers/media/dvb/dvb-usb/az6027.c
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB_AZ6027'
+clean_mk CONFIG_DVB_USB_AZ6027 drivers/media/dvb/dvb-usb/Makefile
+
+announce DVB_USB_CXUSB - "Conexant USB2.0 hybrid reference design support"
+clean_blob drivers/media/dvb/dvb-usb/cxusb.c
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB_CXUSB'
+clean_mk CONFIG_DVB_USB_CXUSB drivers/media/dvb/dvb-usb/Makefile
+
+announce DVB_USB_DIB0700 - "DiBcom DiB0700 USB DVB devices"
+reject_firmware drivers/media/dvb/dvb-usb/dib0700_devices.c
+clean_blob drivers/media/dvb/dvb-usb/dib0700_devices.c
+clean_blob drivers/media/dvb/dvb-usb/dib0700_core.c
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB_DIB0700'
+clean_mk CONFIG_DVB_USB_DIB0700 drivers/media/dvb/dvb-usb/Makefile
+
+announce DVB_USB_DIBUSB_MB - "DiBcom USB DVB-T devices (based on the DiB3000M-B)"
+clean_blob drivers/media/dvb/dvb-usb/dibusb-mb.c
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB_DIBUSB_MB'
+clean_mk CONFIG_DVB_USB_DIBUSB_MB drivers/media/dvb/dvb-usb/Makefile
+
+announce DVB_USB_DIBUSB_MC - "DiBcom USB DVB-T devices (based on the DiB3000M-C/P)"
+clean_blob drivers/media/dvb/dvb-usb/dibusb-mc.c
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB_DIBUSB_MC'
+clean_mk CONFIG_DVB_USB_DIBUSB_MC drivers/media/dvb/dvb-usb/Makefile
+
+announce DVB_USB_DIGITV - "Nebula Electronics uDigiTV DVB-T USB2.0 support"
+clean_blob drivers/media/dvb/dvb-usb/digitv.c
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB_DIGITV'
+clean_mk CONFIG_DVB_USB_DIGITV drivers/media/dvb/dvb-usb/Makefile
+
+announce DVB_USB_DTT200U - "WideView WT-200U and WT-220U (pen) DVB-T USB2.0 support (Yakumo/Hama/Typhoon/Yuan)"
+clean_blob drivers/media/dvb/dvb-usb/dtt200u.c
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB_DTT200U'
+clean_mk CONFIG_DVB_USB_DTT200U drivers/media/dvb/dvb-usb/Makefile
+
+announce DVB_USB_DW2102 - "DvbWorld DVB-S/S2 USB2.0 support"
+reject_firmware drivers/media/dvb/dvb-usb/dw2102.c
+clean_blob drivers/media/dvb/dvb-usb/dw2102.c
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB_DW2102'
+clean_mk CONFIG_DVB_USB_DW2102 drivers/media/dvb/dvb-usb/Makefile
+
+announce DVB_USB_EC168 - "E3C EC168 DVB-T USB2.0 support"
+clean_blob drivers/media/dvb/dvb-usb/ec168.c
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB_EC168'
+clean_mk CONFIG_DVB_USB_EC168 drivers/media/dvb/dvb-usb/Makefile
+
+announce DVB_USB_GP8PSK - "GENPIX 8PSK->USB module support"
+reject_firmware drivers/media/dvb/dvb-usb/gp8psk.c
+clean_blob drivers/media/dvb/dvb-usb/gp8psk.c
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB_GP8PSK'
+clean_mk CONFIG_DVB_USB_GP8PSK drivers/media/dvb/dvb-usb/Makefile
+
+announce DVB_USB_IT913X - "it913x driver"
+clean_blob drivers/media/dvb/dvb-usb/it913x.c
+clean_file Documentation/dvb/it9137.txt
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB_IT913X'
+clean_mk CONFIG_DVB_USB_IT913X drivers/media/dvb/dvb-usb/Makefile
+
+announce DVB_USB_LME2510 - "LME DM04/QQBOX DVB-S USB2.0 support"
+reject_firmware drivers/media/dvb/dvb-usb/lmedm04.c
+clean_blob drivers/media/dvb/dvb-usb/lmedm04.c
+clean_file Documentation/dvb/lmedm04.txt
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB_LME2510'
+clean_mk CONFIG_DVB_USB_LME2510 drivers/media/dvb/dvb-usb/Makefile
+
+announce DVB_USB_M920X - "Uli m920x DVB-T USB2.0 support"
+reject_firmware drivers/media/dvb/dvb-usb/m920x.c
+clean_blob drivers/media/dvb/dvb-usb/m920x.c
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB_M920X'
+clean_mk CONFIG_DVB_USB_M920X drivers/media/dvb/dvb-usb/Makefile
+
+announce DVB_USB_NOVA_T_USB2 - "Hauppauge WinTV-NOVA-T usb2 DVB-T USB2.0 support"
+clean_blob drivers/media/dvb/dvb-usb/nova-t-usb2.c
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB_NOVA_T_USB2'
+clean_mk CONFIG_DVB_USB_NOVA_T_USB2 drivers/media/dvb/dvb-usb/Makefile
+
+announce DVB_USB_OPERA1 - "Opera1 DVB-S USB2.0 receiver"
+reject_firmware drivers/media/dvb/dvb-usb/opera1.c
+clean_blob drivers/media/dvb/dvb-usb/opera1.c
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB_OPERA1'
+clean_mk CONFIG_DVB_USB_OPERA1 drivers/media/dvb/dvb-usb/Makefile
+
+announce DVB_USB_TECHNISAT_USB2 - "Technisat DVB-S/S2 USB2.0 support"
+clean_blob drivers/media/dvb/dvb-usb/technisat-usb2.c
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB_TECHNISAT_USB2'
+clean_mk CONFIG_DVB_USB_TECHNISAT_USB2 drivers/media/dvb/dvb-usb/Makefile
+
+announce DVB_USB_TTUSB2 - "Pinnacle 400e DVB-S USB2.0 support"
+clean_blob drivers/media/dvb/dvb-usb/ttusb2.c
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB_TTUSB2'
+clean_mk CONFIG_DVB_USB_TTUSB2 drivers/media/dvb/dvb-usb/Makefile
+
+announce DVB_USB_UMT_010 - "HanfTek UMT-010 DVB-T USB2.0 support"
+clean_blob drivers/media/dvb/dvb-usb/umt-010.c
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB_UMT_010'
+clean_mk CONFIG_DVB_USB_UMT_010 drivers/media/dvb/dvb-usb/Makefile
+
+announce DVB_USB_VP702X - "TwinhanDTV StarBox and clones DVB-S USB2.0 support"
+clean_blob drivers/media/dvb/dvb-usb/vp702x.c
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB_VP702X'
+clean_mk CONFIG_DVB_USB_VP702X drivers/media/dvb/dvb-usb/Makefile
+
+announce DVB_USB_VP7045 - "TwinhanDTV Alpha/MagicBoxII, DNTV tinyUSB2, Beetle USB2.0 support"
+clean_blob drivers/media/dvb/dvb-usb/vp7045.c
+clean_kconfig drivers/media/dvb/dvb-usb/Kconfig 'DVB_USB_VP7045'
+clean_mk CONFIG_DVB_USB_VP7045 drivers/media/dvb/dvb-usb/Makefile
+
+# dvb/frontends
+
+announce DVB_AF9013 - "Afatech AF9013 demodulator"
+undefault_firmware 'AF9013' \
+ drivers/media/dvb/frontends/af9013.c \
+ drivers/media/dvb/frontends/af9013_priv.h
+reject_firmware drivers/media/dvb/frontends/af9013.c
+clean_kconfig drivers/media/dvb/frontends/Kconfig 'DVB_AF9013'
+clean_mk CONFIG_DVB_AF9013 drivers/media/dvb/frontends/Makefile
+
+announce DVB_BCM3510 - "Broadcom BCM3510"
+undefault_firmware 'BCM3510' drivers/media/dvb/frontends/bcm3510.c
+reject_firmware drivers/media/dvb/frontends/bcm3510.c
+reject_firmware drivers/media/dvb/frontends/bcm3510.h
+clean_sed '
+/You.ll need a firmware/,/dvb-fe-bcm/d;
+' drivers/media/dvb/frontends/bcm3510.c \
+ "removed non-Free firmware notes"
+clean_kconfig drivers/media/dvb/frontends/Kconfig 'DVB_BCM3510'
+clean_mk CONFIG_DVB_BCM3510 drivers/media/dvb/frontends/Makefile
+
+announce DVB_DS3000 - "Montage Tehnology DS3000 based"
+undefault_firmware 'DS3000' \
+ drivers/media/dvb/frontends/ds3000.c
+reject_firmware drivers/media/dvb/frontends/ds3000.c
+clean_blob drivers/media/dvb/frontends/ds3000.c
+clean_kconfig drivers/media/dvb/frontends/Kconfig 'DVB_DS3000'
+clean_mk CONFIG_DVB_DS3000 drivers/media/dvb/frontends/Makefile
+
+announce DVB_LGS8GXX - "Legend Silicon LGS8913/LGS8GL5/LGS8GXX DMB-TH demodulator"
+reject_firmware drivers/media/dvb/frontends/lgs8gxx.c
+clean_blob drivers/media/dvb/frontends/lgs8gxx.c
+clean_kconfig drivers/media/dvb/frontends/Kconfig 'DVB_LGS8GXX'
+clean_mk CONFIG_DVB_LGS8GXX drivers/media/dvb/frontends/Makefile
+
+announce DVB_NXT200X - "NxtWave Communications NXT2002/NXT2004 based"
+undefault_firmware 'NXT200[24]' drivers/media/dvb/frontends/nxt200x.c
+reject_firmware drivers/media/dvb/frontends/nxt200x.c
+clean_blob drivers/media/dvb/frontends/nxt200x.c
+clean_kconfig drivers/media/dvb/frontends/Kconfig 'DVB_NXT200X'
+clean_mk CONFIG_DVB_NXT200X drivers/media/dvb/frontends/Makefile
+
+announce DVB_OR51132 - "Oren OR51132 based"
+reject_firmware drivers/media/dvb/frontends/or51132.c
+clean_blob drivers/media/dvb/frontends/or51132.c
+clean_kconfig drivers/media/dvb/frontends/Kconfig 'DVB_OR51132'
+clean_mk CONFIG_DVB_OR51132 drivers/media/dvb/frontends/Makefile
+
+announce DVB_OR51211 - "Oren OR51211 based"
+undefault_firmware 'OR51211' drivers/media/dvb/frontends/or51211.c
+reject_firmware drivers/media/dvb/frontends/or51211.c
+reject_firmware drivers/media/dvb/frontends/or51211.h
+clean_blob drivers/media/dvb/frontends/or51211.c
+clean_kconfig drivers/media/dvb/frontends/Kconfig 'DVB_OR51211'
+clean_mk CONFIG_DVB_OR51211 drivers/media/dvb/frontends/Makefile
+
+announce DVB_SP8870 - "Spase sp8870"
+undefault_firmware 'SP8870' drivers/media/dvb/frontends/sp8870.c
+reject_firmware drivers/media/dvb/frontends/sp8870.c
+reject_firmware drivers/media/dvb/frontends/sp8870.h
+clean_blob drivers/media/dvb/frontends/sp8870.c
+clean_kconfig drivers/media/dvb/frontends 'DVB_SP8870'
+clean_mk CONFIG_DVB_SP8870 drivers/media/dvb/frontends/Makefile
+
+announce DVB_CX24116 - "Conexant CX24116 based"
+undefault_firmware CX24116 drivers/media/dvb/frontends/cx24116.c
+reject_firmware drivers/media/dvb/frontends/cx24116.c
+clean_kconfig drivers/media/dvb/frontends/Kconfig 'DVB_CX24116'
+clean_mk CONFIG_DVB_CX24116 drivers/media/dvb/frontends/Makefile
+
+announce DVB_SP887X - "Spase sp887x based"
+undefault_firmware 'SP887X' drivers/media/dvb/frontends/sp887x.c
+reject_firmware drivers/media/dvb/frontends/sp887x.c
+reject_firmware drivers/media/dvb/frontends/sp887x.h
+clean_blob drivers/media/dvb/frontends/sp887x.c
+clean_kconfig drivers/media/dvb/frontends/Kconfig 'DVB_SP887X'
+clean_mk CONFIG_DVB_SP887X drivers/media/dvb/frontends/Makefile
+
+announce DVB_TDA10048 - "Philips TDA10048HN based"
+undefine_macro 'TDA10048_DEFAULT_FIRMWARE_SIZE' 0 \
+ 'removed non-Free firmware size' drivers/media/dvb/frontends/tda10048.c
+undefault_firmware 'TDA10048' drivers/media/dvb/frontends/tda10048.c
+reject_firmware drivers/media/dvb/frontends/tda10048.c
+clean_kconfig drivers/media/dvb/frontends/Kconfig 'DVB_TDA10048'
+clean_mk CONFIG_DVB_TDA10048 drivers/media/dvb/frontends/Makefile
+
+announce DVB_TDA1004X - "Philips TDA10045H/TDA10046H"
+undefault_firmware 'TDA1004[56]' drivers/media/dvb/frontends/tda1004x.c
+reject_firmware drivers/media/dvb/frontends/tda1004x.c
+reject_firmware drivers/media/dvb/frontends/tda1004x.h
+clean_blob drivers/media/dvb/frontends/tda1004x.c
+clean_kconfig drivers/media/dvb/frontends 'DVB_TDA1004X'
+clean_mk CONFIG_DVB_TDA1004X drivers/media/dvb/frontends/Makefile
+
+announce DVB_TDA10071 - "NXP TDA10071"
+undefault_firmware 'TDA10071' drivers/media/dvb/frontends/tda10071_priv.h
+undefault_firmware 'TDA10071' drivers/media/dvb/frontends/tda10071.c
+reject_firmware drivers/media/dvb/frontends/tda10071.c
+clean_kconfig drivers/media/dvb/frontends 'DVB_TDA10071'
+clean_mk CONFIG_DVB_TDA10071 drivers/media/dvb/frontends/Makefile
+
+# dvb
+
+announce DVB_AS102 - "Abilis AS102 DVB receiver"
+reject_firmware drivers/staging/media/as102/as102_fw.c
+clean_blob drivers/staging/media/as102/as102_fw.c
+clean_kconfig drivers/staging/media/as102/Kconfig 'DVB_AS102'
+clean_mk CONFIG_DVB_AS102 drivers/staging/media/as102/Makefile
+
+announce DVB_AV7110 - "AV7110 cards"
+reject_firmware drivers/media/dvb/ttpci/av7110.c
+clean_blob drivers/media/dvb/ttpci/av7110.c
+clean_kconfig drivers/media/dvb/ttpci/Kconfig 'DVB_AV7110'
+clean_mk CONFIG_DVB_AV7110 drivers/media/dvb/ttpci/Makefile
+
+announce DVB_BUDGET - "Budget cards"
+reject_firmware drivers/media/dvb/ttpci/budget.c
+reject_firmware drivers/media/dvb/frontends/tdhd1.h
+
+announce DVB_BUDGET_AV - "Budget cards with analog video inputs"
+reject_firmware drivers/media/dvb/ttpci/budget-av.c
+
+announce DVB_BUDGET_CI - "Budget cards with onboard CI connector"
+reject_firmware drivers/media/dvb/ttpci/budget-ci.c
+
+announce DVB_DRXD - "Micronas DRXD driver"
+reject_firmware drivers/media/dvb/frontends/drxd_hard.c
+clean_blob drivers/media/dvb/frontends/drxd_hard.c
+clean_kconfig drivers/media/dvb/frontends/Kconfig 'DVB_DRXD'
+clean_mk CONFIG_DVB_DRXD drivers/media/dvb/frontends/Makefile
+
+announce DVB_DRXK - "Micronas DRXK based"
+reject_firmware drivers/media/dvb/frontends/drxk_hard.c
+clean_kconfig drivers/media/dvb/frontends/Kconfig 'DVB_DRXK'
+clean_mk CONFIG_DVB_DRXK drivers/media/dvb/frontends/Makefile
+
+announce DVB_NGENE - "Micronas nGene support"
+reject_firmware drivers/media/dvb/ngene/ngene-core.c
+clean_blob drivers/media/dvb/ngene/ngene-core.c
+clean_kconfig drivers/media/dvb/ngene/Kconfig 'DVB_NGENE'
+clean_mk CONFIG_DVB_NGENE drivers/media/dvb/ngene/Makefile
+
+announce DVB_PLUTO2 - "Pluto2 cards"
+reject_firmware drivers/media/dvb/pluto2/pluto2.c
+
+announce SMS_SIANO_MDTV - "Siano SMS1xxx based MDTV receiver"
+reject_firmware drivers/media/dvb/siano/smscoreapi.c
+clean_blob drivers/media/dvb/siano/smscoreapi.c
+clean_blob drivers/media/dvb/siano/sms-cards.c
+clean_kconfig drivers/media/dvb/siano/Kconfig 'SMS_SIANO_MDTV'
+clean_mk CONFIG_SMS_SIANO_MDTV drivers/media/dvb/siano/Makefile
+
+announce SMS_USB_DRV - "Siano's USB interface support"
+reject_firmware drivers/media/dvb/siano/smsusb.c
+clean_blob drivers/media/dvb/siano/smsusb.c
+clean_kconfig drivers/media/dvb/siano/Kconfig 'SMS_USB_DRV'
+clean_mk CONFIG_SMS_USB_DRV drivers/media/dvb/siano/Makefile
+
+announce DVB_TTUSB_BUDGET - "Technotrend/Hauppauge Nova-USB devices"
+drop_fw_file firmware/ttusb-budget/dspbootcode.bin.ihex firmware/ttusb-budget/dspbootcode.bin
+reject_firmware drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+clean_blob drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+clean_kconfig drivers/media/dvb/ttusb-budget/Kconfig 'DVB_TTUSB_BUDGET'
+clean_mk CONFIG_DVB_TTUSB_BUDGET drivers/media/dvb/ttusb-budget/Makefile
+
+announce DVB_TTUSB_DEC - "Technotrend/Hauppauge USB DEC devices"
+reject_firmware drivers/media/dvb/ttusb-dec/ttusb_dec.c
+clean_blob drivers/media/dvb/ttusb-dec/ttusb_dec.c
+clean_blob Documentation/dvb/ttusb-dec.txt
+clean_kconfig drivers/media/dvb/ttusb-dec/Kconfig 'DVB_TTUSB_DEC'
+clean_mk CONFIG_DVB_TTUSB_DEC drivers/media/dvb/ttusb-dec/Makefile
+
+# video
+
+announce VIDEO_BT848 - "BT848 Video For Linux"
+reject_firmware drivers/media/video/bt8xx/bttv-cards.c
+clean_blob drivers/media/video/bt8xx/bttv-cards.c
+clean_blob Documentation/video4linux/bttv/README
+clean_kconfig drivers/media/video/bt8xx/Kconfig 'VIDEO_BT848'
+clean_mk CONFIG_VIDEO_BT848 drivers/media/video/bt8xx/Makefile
+
+announce VIDEO_CPIA2 - "CPiA2 Video For Linux"
+clean_fw firmware/cpia2/stv0672_vp4.bin.ihex firmware/cpia2/stv0672_vp4.bin
+reject_firmware drivers/media/video/cpia2/cpia2_core.c
+clean_blob drivers/media/video/cpia2/cpia2_core.c
+clean_kconfig drivers/media/video/cpia2/Kconfig 'VIDEO_CPIA2'
+clean_mk CONFIG_VIDEO_CPIA2 drivers/media/video/cpia2/Makefile
+
+announce VIDEO_CX18 - "Conexant cx23418 MPEG encoder support"
+reject_firmware drivers/media/video/cx18/cx18-av-firmware.c
+reject_firmware drivers/media/video/cx18/cx18-dvb.c
+reject_firmware drivers/media/video/cx18/cx18-firmware.c
+clean_blob drivers/media/video/cx18/cx18-av-firmware.c
+clean_blob drivers/media/video/cx18/cx18-dvb.c
+clean_blob drivers/media/video/cx18/cx18-firmware.c
+clean_kconfig drivers/media/video/cx18/Kconfig 'VIDEO_CX18'
+clean_mk CONFIG_VIDEO_CX18 drivers/media/video/cx18/Makefile
+
+announce VIDEO_CX231XX - "Conexant cx231xx USB video capture support"
+reject_firmware drivers/media/video/cx231xx/cx231xx-417.c
+clean_blob drivers/media/video/cx231xx/cx231xx-417.c
+clean_kconfig drivers/media/video/cx231xx/Kconfig 'VIDEO_CX231XX'
+clean_mk CONFIG_VIDEO_CX231XX drivers/media/video/cx231xx/Makefile
+
+announce VIDEO_CX23885 - "Conexant cx23885 (2388x successor) support"
+reject_firmware drivers/media/video/cx23885/cx23885-417.c
+clean_blob drivers/media/video/cx23885/cx23885-417.c
+reject_firmware drivers/media/video/cx23885/cx23885-cards.c
+clean_blob drivers/media/video/cx23885/cx23885-cards.c
+clean_kconfig drivers/media/video/cx23885/Kconfig 'VIDEO_CX23885'
+clean_mk CONFIG_VIDEO_CX23885 drivers/media/video/cx23885/Makefile
+
+announce VIDEO_CX25840 - "Conexant CX2584x audio/video decoders"
+reject_firmware drivers/media/video/cx25840/cx25840-firmware.c
+clean_blob drivers/media/video/cx25840/cx25840-firmware.c
+clean_kconfig drivers/media/video/cx25840/Kconfig 'VIDEO_CX25840'
+clean_mk CONFIG_VIDEO_CX25840 drivers/media/video/cx25840/Makefile
+
+announce VIDEO_CX88_BLACKBIRD - "Blackbird MPEG encoder support (cx2388x + cx23416)"
+reject_firmware drivers/media/video/cx88/cx88-blackbird.c
+clean_kconfig drivers/media/video/cx88/Kconfig 'VIDEO_CX88_BLACKBIRD'
+clean_mk CONFIG_VIDEO_CX88_BLACKBIRD drivers/media/video/cx88/Makefile
+
+announce VIDEO_EM28XX_DVB - "DVB/ATSC Support for em28xx based TV cards"
+clean_blob drivers/media/video/em28xx/em28xx-dvb.c
+clean_kconfig drivers/media/video/em28xx/Kconfig 'VIDEO_EM28XX_DVB'
+clean_mk CONFIG_VIDEO_EM28XX_DVB drivers/media/video/em28xx/Makefile
+
+announce VIDEO_IVTV - "Conexant cx23416/cx23415 MPEG encoder/decoder support"
+reject_firmware drivers/media/video/ivtv/ivtv-firmware.c
+clean_blob drivers/media/video/ivtv/ivtv-firmware.c
+clean_kconfig drivers/media/video/ivtv/Kconfig 'VIDEO_IVTV'
+clean_mk CONFIG_VIDEO_IVTV drivers/media/video/ivtv/Makefile
+
+announce VIDEO_PVRUSB2 - "Hauppauge WinTV-PVR USB2 support"
+reject_firmware drivers/media/video/pvrusb2/pvrusb2-hdw.c
+clean_blob drivers/media/video/pvrusb2/pvrusb2-devattr.c
+clean_kconfig drivers/media/video/pvrusb2/Kconfig 'VIDEO_PVRUSB2'
+clean_mk CONFIG_VIDEO_PVRUSB2 drivers/media/video/pvrusb2/Makefile
+
+announce "VIDEO_CX23885, VIDEO_CX88_BLACKBIRD, VIDEO_IVTV, VIDEO_PVRUSB2" - "See above"
+clean_blob include/media/cx2341x.h
+
+announce VIDEO_GO7007 - "Go 7007 support"
+reject_firmware drivers/staging/media/go7007/go7007-driver.c
+clean_blob drivers/staging/media/go7007/go7007-driver.c
+reject_firmware drivers/staging/media/go7007/go7007-fw.c
+clean_blob drivers/staging/media/go7007/go7007-usb.c
+clean_blob drivers/staging/media/go7007/saa7134-go7007.c
+clean_kconfig drivers/staging/media/go7007/Kconfig 'VIDEO_GO7007'
+clean_mk CONFIG_VIDEO_GO7007 drivers/staging/media/go7007/Makefile
+
+announce VIDEO_GO7007_USB_S2250_BOARD - "Sensoray 2250/2251 support"
+reject_firmware drivers/staging/media/go7007/s2250-loader.c
+clean_blob drivers/staging/media/go7007/s2250-loader.c
+clean_kconfig drivers/staging/media/go7007/Kconfig 'VIDEO_GO7007_USB_S2250_BOARD'
+clean_mk CONFIG_VIDEO_GO7007_USB_S2250_BOARD drivers/staging/media/go7007/Makefile
+
+announce VIDEO_SAA7134_DVB - "DVB/ATSC Support for saa7134 based TV cards"
+reject_firmware drivers/media/video/saa7134/saa7134-dvb.c
+clean_kconfig drivers/media/video/saa7134/Kconfig 'VIDEO_SAA7134_DVB'
+clean_mk CONFIG_VIDEO_SAA7134_DVB drivers/media/video/saa7134/Makefile
+
+announce VIDEO_SAA7164 - "NXP SAA7164 support"
+reject_firmware drivers/media/video/saa7164/saa7164-fw.c
+clean_blob drivers/media/video/saa7164/saa7164-fw.c
+clean_kconfig drivers/media/video/saa7164/Kconfig 'VIDEO_SAA7164'
+clean_mk CONFIG_VIDEO_SAA7164 drivers/media/video/saa7164/Makefile
+
+announce VIDEO_TLG2300 - "Telegent TLG2300 USB video capture support"
+reject_firmware drivers/media/video/tlg2300/pd-main.c
+clean_blob drivers/media/video/tlg2300/pd-main.c
+clean_kconfig drivers/media/video/tlg2300/Kconfig 'VIDEO_TLG2300'
+clean_mk CONFIG_VIDEO_TLG2300 drivers/media/video/tlg2300/Makefile
+
+announce VIDEO_SAMSUNG_S5P_MFC - "Samsung S5P MFC 5.1 Video Codec"
+reject_firmware drivers/media/video/s5p-mfc/s5p_mfc_ctrl.c
+clean_blob drivers/media/video/s5p-mfc/s5p_mfc_ctrl.c
+clean_kconfig drivers/media/video/Kconfig 'VIDEO_SAMSUNG_S5P_MFC'
+clean_mk CONFIG_VIDEO_SAMSUNG_S5P_MFC drivers/media/video/s5p-mfc/Makefile
+
+announce USB_DABUSB - "left-over DABUSB firmware"
+clean_fw firmware/dabusb/bitstream.bin.ihex firmware/dabusb/bitstream.bin
+clean_fw firmware/dabusb/firmware.HEX firmware/dabusb/firmware.fw
+
+announce USB_S2255 - "USB Sensoray 2255 video capture device"
+reject_firmware drivers/media/video/s2255drv.c
+clean_blob drivers/media/video/s2255drv.c
+clean_kconfig drivers/media/video/Kconfig 'USB_S2255'
+clean_mk CONFIG_USB_S2255 drivers/media/video/Makefile
+
+announce USB_GSPCA_VICAM - "USB 3com HomeConnect, AKA vicam"
+drop_fw_file firmware/vicam/firmware.H16 firmware/vicam/firmware.fw
+reject_firmware drivers/media/video/gspca/vicam.c
+clean_blob drivers/media/video/gspca/vicam.c
+clean_kconfig drivers/media/video/gspca/Kconfig 'USB_GSPCA_VICAM'
+clean_mk CONFIG_USB_GSPCA_VICAM drivers/media/video/gspca/Makefile
+
+# radio
+
+announce RADIO_WL1273 - "Texas Instruments WL1273 I2C FM Radio"
+reject_firmware drivers/media/radio/radio-wl1273.c
+clean_blob drivers/media/radio/radio-wl1273.c
+clean_kconfig drivers/media/radio/Kconfig 'RADIO_WL1273'
+clean_mk CONFIG_RADIO_WL1273 drivers/media/radio/Makefile
+
+announce RADIO_WL128X - "Texas Instruments WL128x FM Radio"
+clean_blob drivers/media/radio/wl128x/fmdrv_common.h
+reject_firmware drivers/media/radio/wl128x/fmdrv_common.c
+clean_blob drivers/media/radio/wl128x/fmdrv_common.c
+clean_kconfig drivers/media/radio/Kconfig 'RADIO_WL128X'
+clean_mk CONFIG_RADIO_WL128X drivers/media/radio/Makefile
+
+#######
+# net #
+#######
+
+announce ACENIC - "Alteon AceNIC/3Com 3C985/NetGear GA620 Gigabit"
+drop_fw_file firmware/acenic/tg1.bin.ihex firmware/acenic/tg1.bin
+drop_fw_file firmware/acenic/tg2.bin.ihex firmware/acenic/tg2.bin
+reject_firmware drivers/net/ethernet/alteon/acenic.c
+clean_blob drivers/net/ethernet/alteon/acenic.c
+clean_kconfig drivers/net/ethernet/alteon/Kconfig 'ACENIC'
+clean_mk CONFIG_ACENIC drivers/net/ethernet/alteon/Makefile
+
+announce ADAPTEC_STARFIRE - "Adaptec Starfire/DuraLAN support"
+clean_fw firmware/adaptec/starfire_rx.bin.ihex firmware/adaptec/starfire_rx.bin
+clean_fw firmware/adaptec/starfire_tx.bin.ihex firmware/adaptec/starfire_tx.bin
+reject_firmware drivers/net/ethernet/adaptec/starfire.c
+clean_blob drivers/net/ethernet/adaptec/starfire.c
+clean_kconfig drivers/net/ethernet/adaptec/Kconfig 'ADAPTEC_STARFIRE'
+clean_mk CONFIG_ADAPTEC_STARFIRE drivers/net/ethernet/adaptec/Makefile
+
+announce BNA - "Brocade 1010/1020 10Gb Ethernet Driver support"
+clean_blob drivers/net/ethernet/brocade/bna/bnad.c
+clean_blob drivers/net/ethernet/brocade/bna/cna.h
+reject_firmware drivers/net/ethernet/brocade/bna/bnad_ethtool.c
+reject_firmware drivers/net/ethernet/brocade/bna/cna_fwimg.c
+clean_kconfig drivers/net/ethernet/brocade/bna/Kconfig 'BNA'
+clean_mk CONFIG_BNA drivers/net/ethernet/brocade/bna/Makefile
+
+announce BNX2 - "Broadcom NetXtremeII"
+drop_fw_file firmware/bnx2/bnx2-mips-09-6.2.1a.fw.ihex firmware/bnx2/bnx2-mips-09-6.2.1a.fw
+drop_fw_file firmware/bnx2/bnx2-rv2p-09-6.0.17.fw.ihex firmware/bnx2/bnx2-rv2p-09-6.0.17.fw
+drop_fw_file firmware/bnx2/bnx2-rv2p-09ax-6.0.17.fw.ihex firmware/bnx2/bnx2-rv2p-09ax-6.0.17.fw
+drop_fw_file firmware/bnx2/bnx2-mips-06-6.2.1.fw.ihex firmware/bnx2/bnx2-mips-06-6.2.1.fw
+drop_fw_file firmware/bnx2/bnx2-rv2p-06-6.0.15.fw.ihex firmware/bnx2/bnx2-rv2p-06-6.0.15.fw
+reject_firmware drivers/net/ethernet/broadcom/bnx2.c
+clean_blob drivers/net/ethernet/broadcom/bnx2.c
+clean_kconfig drivers/net/ethernet/broadcom/Kconfig 'BNX2'
+clean_mk CONFIG_BNX2 drivers/net/ethernet/broadcom/Makefile
+
+announce BNX2X - "Broadcom NetXtremeII 10Gb support"
+drop_fw_file firmware/bnx2x/bnx2x-e1-6.2.9.0.fw.ihex firmware/bnx2x/bnx2x-e1-6.2.9.0.fw
+drop_fw_file firmware/bnx2x/bnx2x-e1h-6.2.9.0.fw.ihex firmware/bnx2x/bnx2x-e1h-6.2.9.0.fw
+drop_fw_file firmware/bnx2x/bnx2x-e2-6.2.9.0.fw.ihex firmware/bnx2x/bnx2x-e2-6.2.9.0.fw
+reject_firmware drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+clean_sed '
+/^#include "bnx2x_init\.h"/,/^$/{
+ /^$/i\
+#define bnx2x_init_block(bp, start, end) \\\
+ return (printk(KERN_ERR "%s: Missing Free firmware\\n", bp->dev->name),\\\
+ -EINVAL)
+}' drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c 'report missing Free firmware'
+clean_blob drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+clean_sed '
+/^bool bnx2x_test_firmware_version/,/^}$/{
+ /^ u32 my_fw = /i\
+ /*(DEBLOBBED)*/
+ /^ u32 my_fw = /,/<< 24);/d;
+ /^ u32 loaded_fw = /,/^$/{
+ /^$/i\
+\
+ u32 my_fw = ~loaded_fw;
+ }
+}' drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c 'fail already-loaded test'
+clean_blob drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h
+clean_sed '
+/static void bnx2x_init_wr_wb/{
+ i\
+extern void bnx2x_init_wr_wb(struct bnx2x *, u32, const u32 *, u32);
+}' drivers/net/ethernet/broadcom/bnx2x/bnx2x_init_ops.h 'declare removed function'
+clean_blob drivers/net/ethernet/broadcom/bnx2x/bnx2x_init_ops.h
+clean_kconfig drivers/net/ethernet/broadcom/Kconfig 'BNX2X'
+clean_mk CONFIG_BNX2X drivers/net/ethernet/broadcom/bnx2x/Makefile
+
+announce CASSINI - "Sun Cassini"
+drop_fw_file firmware/sun/cassini.bin.ihex firmware/sun/cassini.bin
+reject_firmware drivers/net/ethernet/sun/cassini.c
+clean_blob drivers/net/ethernet/sun/cassini.c
+clean_kconfig drivers/net/ethernet/sun/Kconfig 'CASSINI'
+clean_mk CONFIG_CASSINI drivers/net/ethernet/sun/Makefile
+
+announce CHELSIO_T3 - "Chelsio AEL 2005 support"
+drop_fw_file firmware/cxgb3/t3b_psram-1.1.0.bin.ihex firmware/cxgb3/t3b_psram-1.1.0.bin
+drop_fw_file firmware/cxgb3/t3c_psram-1.1.0.bin.ihex firmware/cxgb3/t3c_psram-1.1.0.bin
+drop_fw_file firmware/cxgb3/t3fw-7.10.0.bin.ihex firmware/cxgb3/t3fw-7.10.0.bin
+drop_fw_file firmware/cxgb3/ael2005_opt_edc.bin.ihex firmware/cxgb3/ael2005_opt_edc.bin
+drop_fw_file firmware/cxgb3/ael2005_twx_edc.bin.ihex firmware/cxgb3/ael2005_twx_edc.bin
+drop_fw_file firmware/cxgb3/ael2020_twx_edc.bin.ihex firmware/cxgb3/ael2020_twx_edc.bin
+reject_firmware drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
+clean_blob drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
+clean_kconfig drivers/net/ethernet/chelsio/Kconfig 'CHELSIO_T3'
+clean_mk CONFIG_CHELSIO_T3 drivers/net/ethernet/chelsio/cxgb3/Makefile
+
+announce CHELSIO_T4 - "Chelsio Communications T4 Ethernet support"
+reject_firmware drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+clean_blob drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+clean_kconfig drivers/net/ethernet/chelsio/Kconfig 'CHELSIO_T4'
+clean_mk CONFIG_CHELSIO_T4 drivers/net/ethernet/chelsio/cxgb4/Makefile
+
+announce E100 - "Intel PRO/100+"
+drop_fw_file firmware/e100/d101m_ucode.bin.ihex firmware/e100/d101m_ucode.bin
+drop_fw_file firmware/e100/d101s_ucode.bin.ihex firmware/e100/d101s_ucode.bin
+drop_fw_file firmware/e100/d102e_ucode.bin.ihex firmware/e100/d102e_ucode.bin
+reject_firmware drivers/net/ethernet/intel/e100.c
+clean_sed '
+/^static const struct firmware \*e100_\(reject\|request\)_firmware(/,/^}$/{
+ s:^\(.*\)return ERR_PTR(err);$:\1netif_err(nic, probe, nic->netdev, "Proceeding without firmware\\n");\n\1return NULL;:
+}' drivers/net/ethernet/intel/e100.c 'proceed without firmware'
+clean_blob drivers/net/ethernet/intel/e100.c
+clean_kconfig drivers/net/ethernet/intel/Kconfig 'E100'
+clean_mk CONFIG_E100 drivers/net/ethernet/intel/Makefile
+
+announce FT1000_PCMCIA - "Driver for ft1000 pcmcia device."
+clean_file drivers/staging/ft1000/ft1000-pcmcia/ft1000.img
+reject_firmware drivers/staging/ft1000/TODO
+clean_blob drivers/staging/ft1000/ft1000-pcmcia/boot.h
+clean_sed '
+/^static int ft1000_reset_card/,/^}$/ {
+ /card_bootload/i\
+ return /*(DEBLOBBED)*/ false;
+}
+' drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c \
+ 'disabled non-Free firmware-loading machinery'
+reject_firmware drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
+clean_blob drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
+clean_kconfig drivers/staging/ft1000/Kconfig 'FT1000_PCMCIA'
+clean_mk CONFIG_FT1000_PCMCIA drivers/staging/ft1000/Makefile
+
+announce FT1000_USB - "Driver for ft1000 USB devices."
+clean_file drivers/staging/ft1000/ft1000-usb/ft3000.img
+reject_firmware drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
+clean_blob drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
+clean_kconfig drivers/staging/ft1000/Kconfig 'FT1000_USB'
+clean_mk CONFIG_FT1000_USB drivers/staging/ft1000/Makefile
+
+announce MYRI_SBUS - "MyriCOM Gigabit Ethernet"
+drop_fw_file firmware/myricom/lanai.bin.ihex firmware/myricom/lanai.bin
+
+announce MYRI10GE - "Myricom Myri-10G Ethernet support"
+reject_firmware drivers/net/ethernet/myricom/myri10ge/myri10ge.c
+clean_blob drivers/net/ethernet/myricom/myri10ge/myri10ge.c
+clean_kconfig drivers/net/ethernet/myricom/Kconfig 'MYRI10GE'
+clean_mk CONFIG_MYRI10GE drivers/net/ethernet/myricom/myri10ge/Makefile
+
+announce NETXEN_NIC - "NetXen Multi port (1/10) Gigabit Ethernet NIC"
+reject_firmware drivers/net/ethernet/qlogic/netxen/netxen_nic.h
+reject_firmware drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+reject_firmware drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c
+clean_blob drivers/net/ethernet/qlogic/netxen/netxen_nic.h
+clean_blob drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+clean_kconfig drivers/net/ethernet/qlogic/Kconfig 'NETXEN_NIC'
+clean_mk CONFIG_NETXEN_NIC drivers/net/ethernet/qlogic/Makefile
+
+announce QLCNIC - "QLOGIC QLCNIC 1/10Gb Converged Ethernet NIC Support"
+reject_firmware drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+reject_firmware drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c
+reject_firmware drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+clean_blob drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+clean_blob drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+clean_kconfig drivers/net/ethernet/qlogic/Kconfig 'QLCNIC'
+clean_mk CONFIG_QLCNIC drivers/net/ethernet/qlogic/qlcnic/Makefile
+
+announce R8169 - "Realtek 8169 gigabit ethernet support"
+reject_firmware drivers/net/ethernet/realtek/r8169.c
+clean_blob drivers/net/ethernet/realtek/r8169.c
+clean_kconfig drivers/net/ethernet/realtek/Kconfig R8169
+clean_mk CONFIG_R8169 drivers/net/ethernet/realtek/Makefile
+
+announce SLICOSS - "Alacritech Gigabit IS-NIC cards"
+reject_firmware drivers/staging/slicoss/slicoss.c
+clean_blob drivers/staging/slicoss/slicoss.c
+clean_kconfig drivers/staging/slicoss/Kconfig 'SLICOSS'
+clean_mk CONFIG_SLICOSS drivers/staging/slicoss/Makefile
+
+announce SPIDER_NET - "Spider Gigabit Ethernet driver"
+reject_firmware drivers/net/ethernet/toshiba/spider_net.c
+clean_sed 's,spider_fw\.bin,DEBLOBBED.bin,g' \
+ drivers/net/ethernet/toshiba/spider_net.c 'removed non-Free firmware notes'
+clean_blob drivers/net/ethernet/toshiba/spider_net.c
+clean_blob drivers/net/ethernet/toshiba/spider_net.h
+clean_kconfig drivers/net/ethernet/toshiba/Kconfig 'SPIDER_NET'
+clean_mk CONFIG_SPIDER_NET drivers/net/ethernet/toshiba/Makefile
+
+announce TEHUTI - "Tehuti Networks 10G Ethernet"
+drop_fw_file firmware/tehuti/bdx.bin.ihex firmware/tehuti/bdx.bin
+reject_firmware drivers/net/ethernet/tehuti/tehuti.c
+clean_blob drivers/net/ethernet/tehuti/tehuti.c
+clean_kconfig drivers/net/ethernet/tehuti/Kconfig 'TEHUTI'
+clean_mk CONFIG_TEHUTI drivers/net/ethernet/tehuti/Makefile
+
+announce TIGON3 - "Broadcom Tigon3"
+drop_fw_file firmware/tigon/tg3.bin.ihex firmware/tigon/tg3.bin
+drop_fw_file firmware/tigon/tg3_tso.bin.ihex firmware/tigon/tg3_tso.bin
+drop_fw_file firmware/tigon/tg3_tso5.bin.ihex firmware/tigon/tg3_tso5.bin
+reject_firmware drivers/net/ethernet/broadcom/tg3.c
+clean_blob drivers/net/ethernet/broadcom/tg3.c
+clean_kconfig drivers/net/ethernet/broadcom/Kconfig 'TIGON3'
+clean_mk CONFIG_TIGON3 drivers/net/ethernet/broadcom/Makefile
+
+announce TYPHOON - "3cr990 series Typhoon"
+drop_fw_file firmware/3com/typhoon.bin.ihex firmware/3com/typhoon.bin
+reject_firmware drivers/net/ethernet/3com/typhoon.c
+clean_blob drivers/net/ethernet/3com/typhoon.c
+clean_kconfig drivers/net/ethernet/3com/Kconfig 'TYPHOON'
+clean_mk CONFIG_TYPHOON drivers/net/ethernet/3com/Makefile
+
+announce VXGE - "Exar X3100 Series 10GbE PCIe Server Adapter"
+reject_firmware drivers/net/ethernet/neterion/vxge/vxge-main.c
+clean_blob drivers/net/ethernet/neterion/vxge/vxge-main.c
+clean_kconfig drivers/net/ethernet/neterion/Kconfig 'VXGE'
+clean_mk CONFIG_VXGE drivers/net/ethernet/neterion/vxge/Makefile
+
+# appletalk
+
+announce COPS - "COPS LocalTalk PC"
+clean_sed '
+/sizeof(\(ff\|lt\)drv_code)/{
+ i\
+ printk(KERN_INFO "%s: Missing Free firmware.\\n", dev->name);\
+ return;
+}
+/\(ff\|lt\)drv_code/d;
+' drivers/net/appletalk/cops.c 'report missing Free firmware'
+clean_blob drivers/net/appletalk/cops.c
+clean_file drivers/net/appletalk/cops_ffdrv.h
+clean_file drivers/net/appletalk/cops_ltdrv.h
+clean_kconfig drivers/net/appletalk/Kconfig 'COPS'
+clean_mk CONFIG_COPS drivers/net/appletalk/Makefile
+
+# hamradio
+
+announce YAM - "YAM driver for AX.25"
+drop_fw_file firmware/yam/1200.bin.ihex firmware/yam/1200.bin
+drop_fw_file firmware/yam/9600.bin.ihex firmware/yam/9600.bin
+reject_firmware drivers/net/hamradio/yam.c
+clean_blob drivers/net/hamradio/yam.c
+clean_kconfig drivers/net/hamradio/Kconfig 'YAM'
+clean_mk CONFIG_YAM drivers/net/hamradio/Makefile
+
+# irda
+
+announce USB_IRDA - "IrDA USB dongles"
+reject_firmware drivers/net/irda/irda-usb.c
+clean_blob drivers/net/irda/irda-usb.c
+clean_kconfig drivers/net/irda/Kconfig 'USB_IRDA'
+clean_mk CONFIG_USB_IRDA drivers/net/irda/Makefile
+
+# smsc
+
+announce PCMCIA_SMC91C92 - "SMC 91Cxx PCMCIA"
+drop_fw_file firmware/ositech/Xilinx7OD.bin.ihex firmware/ositech/Xilinx7OD.bin
+reject_firmware drivers/net/ethernet/smsc/smc91c92_cs.c
+clean_blob drivers/net/ethernet/smsc/smc91c92_cs.c
+clean_kconfig drivers/net/ethernet/smsc/Kconfig 'PCMCIA_SMC91C92'
+clean_mk CONFIG_PCMCIA_SMC91C92 drivers/net/ethernet/smsc/Makefile
+
+# near-field communication
+
+announce NFC_WILINK - "Texas Instruments NFC WiLink driver"
+reject_firmware drivers/nfc/nfcwilink.c
+clean_blob drivers/nfc/nfcwilink.c
+clean_kconfig drivers/nfc/Kconfig 'NFC_WILINK'
+clean_mk CONFIG_NFC_WILINK drivers/nfc/Makefile
+
+# pcmcia
+
+# CIS files are not software.
+# announce PCCARD - "PCCard (PCMCIA/CardBus) support"
+# reject_firmware drivers/pcmcia/ds.c
+# clean_kconfig drivers/pcmcia/Kconfig 'PCCARD'
+# clean_mk CONFIG_PCCARD drivers/pcmcia/Makefile
+
+announce PCMCIA_3C574 - "3Com 3c574 PCMCIA support"
+# This is not software; it's Free, but GPLed without in-tree sources.
+drop_fw_file firmware/cis/3CCFEM556.cis.ihex firmware/cis/3CCFEM556.cis
+# clean_blob drivers/net/pcmcia/3c574_cs.c
+# clean_kconfig drivers/net/pcmcia/Kconfig 'PCMCIA_3C574'
+# clean_mk CONFIG_PCMCIA_3C574 drivers/net/pcmcia/Makefile
+
+announce PCMCIA_3C589 - "3Com 3c589 PCMCIA support"
+# This is not software; it's Free, but GPLed without in-tree sources.
+drop_fw_file firmware/cis/3CXEM556.cis.ihex firmware/cis/3CXEM556.cis
+# clean_blob drivers/net/pcmcia/3c589_cs.c
+# clean_kconfig drivers/net/pcmcia/Kconfig 'PCMCIA_3C589'
+# clean_mk CONFIG_PCMCIA_3C589 drivers/net/pcmcia/Makefile
+
+announce PCMCIA_PCNET - "NE2000 compatible PCMCIA support"
+# These are not software; they're Free, but GPLed without in-tree sources.
+drop_fw_file firmware/cis/LA-PCM.cis.ihex firmware/cis/LA-PCM.cis
+drop_fw_file firmware/cis/PCMLM28.cis.ihex firmware/cis/PCMLM28.cis
+drop_fw_file firmware/cis/DP83903.cis.ihex firmware/cis/DP83903.cis
+drop_fw_file firmware/cis/NE2K.cis.ihex firmware/cis/NE2K.cis
+drop_fw_file firmware/cis/tamarack.cis.ihex firmware/cis/tamarack.cis
+drop_fw_file firmware/cis/PE-200.cis.ihex firmware/cis/PE-200.cis
+drop_fw_file firmware/cis/PE520.cis.ihex firmware/cis/PE520.cis
+# clean_blob drivers/net/pcmcia/pcnet_cs.c
+# clean_kconfig drivers/net/pcmcia/Kconfig 'PCMCIA_PCNET'
+# clean_mk CONFIG_PCMCIA_PCNET drivers/net/pcmcia/Makefile
+
+# tokenring
+
+announce 3C359 - "3Com 3C359 Token Link Velocity XL adapter"
+drop_fw_file firmware/3com/3C359.bin.ihex firmware/3com/3C359.bin
+reject_firmware drivers/net/tokenring/3c359.c
+clean_blob drivers/net/tokenring/3c359.c
+clean_kconfig drivers/net/tokenring/Kconfig '3C359'
+clean_mk CONFIG_3C359 drivers/net/tokenring/Makefile
+
+announce SMCTR - "SMC ISA/MCA adapter"
+drop_fw_file firmware/tr_smctr.bin.ihex firmware/tr_smctr.bin
+reject_firmware drivers/net/tokenring/smctr.c
+clean_blob drivers/net/tokenring/smctr.c
+clean_kconfig drivers/net/tokenring/Kconfig 'SMCTR'
+clean_mk CONFIG_SMCTR drivers/net/tokenring/Makefile
+
+announce TMS380TR - "Generic TMS380 Token Ring ISA/PCI adapter support"
+reject_firmware drivers/net/tokenring/tms380tr.c
+clean_blob drivers/net/tokenring/tms380tr.c
+clean_kconfig drivers/net/tokenring/Kconfig 'TMS380TR'
+clean_mk CONFIG_TMS380TR drivers/net/tokenring/Makefile
+
+# usb
+
+announce USB_KAWETH - "USB KLSI KL5USB101-based ethernet device support"
+drop_fw_file firmware/kaweth/new_code.bin.ihex firmware/kaweth/new_code.bin
+drop_fw_file firmware/kaweth/new_code_fix.bin.ihex firmware/kaweth/new_code_fix.bin
+drop_fw_file firmware/kaweth/trigger_code.bin.ihex firmware/kaweth/trigger_code.bin
+drop_fw_file firmware/kaweth/trigger_code_fix.bin.ihex firmware/kaweth/trigger_code_fix.bin
+reject_firmware drivers/net/usb/kaweth.c
+clean_blob drivers/net/usb/kaweth.c
+clean_kconfig drivers/net/usb/Kconfig 'USB_KAWETH'
+clean_mk CONFIG_USB_KAWETH drivers/net/usb/Makefile
+
+# wireless
+
+announce ATMEL "Atmel at76c50x chipset 802.11b support"
+reject_firmware drivers/net/wireless/atmel.c
+clean_blob drivers/net/wireless/atmel.c
+clean_kconfig drivers/net/wireless/Kconfig 'ATMEL'
+clean_mk CONFIG_ATMEL drivers/net/wireless/Makefile
+
+announce AT76C50X_USB - "Atmel at76c503/at76c505/at76c505a USB cards"
+reject_firmware drivers/net/wireless/at76c50x-usb.c
+clean_blob drivers/net/wireless/at76c50x-usb.c
+clean_kconfig drivers/net/wireless/Kconfig 'AT76C50X_USB'
+clean_mk CONFIG_AT76C50X_USB drivers/net/wireless/Makefile
+
+announce B43 - "Broadcom 43xx wireless support (mac80211 stack)"
+maybe_reject_firmware drivers/net/wireless/b43/main.c
+clean_sed '
+/^static int b43_upload_microcode(/,/^}$/{
+ / if (dev->fw\.opensource) {$/i\
+ if (!dev->fw.opensource) {\
+ b43err(dev->wl, "Rejected non-Free firmware\\n");\
+ err = -EOPNOTSUPP;\
+ goto error;\
+ }
+}' drivers/net/wireless/b43/main.c 'double-check and reject non-Free firmware'
+# Major portions of firmware filenames not deblobbed.
+clean_blob drivers/net/wireless/b43/main.c
+clean_kconfig drivers/net/wireless/b43/Kconfig 'B43'
+clean_mk CONFIG_B43 drivers/net/wireless/b43/Makefile
+
+announce B43LEGACY - "Broadcom 43xx-legacy wireless support (mac80211 stack)"
+reject_firmware drivers/net/wireless/b43legacy/main.c
+# Major portions of firwmare filenames not deblobbed.
+clean_blob drivers/net/wireless/b43legacy/main.c
+clean_kconfig drivers/net/wireless/b43legacy/Kconfig 'B43LEGACY'
+clean_mk CONFIG_B43LEGACY drivers/net/wireless/b43legacy/Makefile
+
+announce BRCMSMAC - "Broadcom IEEE802.11n PCIe SoftMAC WLAN driver"
+reject_firmware drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
+clean_blob drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
+clean_kconfig drivers/net/wireless/brcm80211/Kconfig 'BRCMSMAC'
+clean_mk CONFIG_BRCMSMAC drivers/net/wireless/brcm80211/Makefile
+
+announce BRCMFMAC_SDIO - "Broadcom IEEE802.11n SDIO FullMAC WLAN driver"
+reject_firmware drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
+clean_blob drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
+clean_kconfig drivers/net/wireless/brcm80211/Kconfig 'BRCMFMAC_SDIO'
+clean_mk CONFIG_BRCMFMAC_SDIO drivers/net/wireless/brcm80211/brcmfmac/Makefile
+
+announce BRCMFMAC_USB - "Broadcom IEEE802.11n USB FullMAC WLAN driver"
+reject_firmware drivers/net/wireless/brcm80211/brcmfmac/usb.c
+clean_blob drivers/net/wireless/brcm80211/brcmfmac/usb.c
+clean_kconfig drivers/net/wireless/brcm80211/Kconfig 'BRCMFMAC_USB'
+clean_mk CONFIG_BRCMFMAC_USB drivers/net/wireless/brcm80211/brcmfmac/Makefile
+
+announce HERMES - "Hermes chipset 802.11b support (Orinoco/Prism2/Symbol)"
+reject_firmware drivers/net/wireless/orinoco/fw.c
+clean_blob drivers/net/wireless/orinoco/fw.c
+clean_kconfig drivers/net/wireless/orinoco/Kconfig 'HERMES'
+clean_mk CONFIG_HERMES drivers/net/wireless/orinoco/Makefile
+
+announce ORINOCO_USB - "Agere Orinoco USB support"
+reject_firmware drivers/net/wireless/orinoco/orinoco_usb.c
+clean_blob drivers/net/wireless/orinoco/orinoco_usb.c
+clean_kconfig drivers/net/wireless/orinoco/Kconfig 'ORINOCO_USB'
+clean_mk CONFIG_ORINOCO_USB drivers/net/wireless/orinoco/Makefile
+
+announce WLAGS49_H2 - "Agere Systems HERMES II Wireless PC Card Model 0110"
+# Some pieces of the firmware images are most definitely data, but
+# others seem to be code.
+clean_blob drivers/staging/wlags49_h2/ap_h2.c
+clean_blob drivers/staging/wlags49_h2/sta_h2.c
+echo 'extern int deblobbed; /*(DEBLOBBED)*/' > drivers/staging/wlags49_h2/ap_h2.c
+echo 'extern int deblobbed; /*(DEBLOBBED)*/' > drivers/staging/wlags49_h2/sta_h2.c
+clean_blob drivers/staging/wlags49_h2/wl_profile.c
+clean_sed '
+ s,\(.*hcf_status = \)dhf_download_fw(.*&fw_image );,//& /*(DEBLOBBED)*/\n\1HCF_ERR_INCOMP_FW;,
+' drivers/staging/wlags49_h2/wl_main.c 'reject built-in non-Free firmware'
+clean_kconfig drivers/staging/wlags49_h2/Kconfig 'WLAGS49_H2'
+clean_mk CONFIG_WLAGS49_H2 drivers/staging/Makefile
+
+announce WLAGS49_H25 - "Linksys Systems HERMES II.5 Wireless-G_CompactFlash_Card"
+# Some pieces of the firmware images are most definitely data, but
+# others seem to be code.
+clean_blob drivers/staging/wlags49_h2/ap_h25.c
+clean_blob drivers/staging/wlags49_h2/sta_h25.c
+echo 'extern int deblobbed; /*(DEBLOBBED)*/' > drivers/staging/wlags49_h2/ap_h25.c
+echo 'extern int deblobbed; /*(DEBLOBBED)*/' > drivers/staging/wlags49_h2/sta_h25.c
+clean_kconfig drivers/staging/wlags49_h25/Kconfig 'WLAGS49_H25'
+clean_mk CONFIG_WLAGS49_H25 drivers/staging/Makefile
+
+announce IPW2100 - "Intel PRO/Wireless 2100 Network Connection"
+reject_firmware drivers/net/wireless/ipw2x00/ipw2100.c
+clean_blob drivers/net/wireless/ipw2x00/ipw2100.c
+clean_kconfig drivers/net/wireless/Kconfig 'IPW2100'
+clean_mk CONFIG_IPW2100 drivers/net/wireless/ipw2x00/Makefile
+
+announce IPW2200 - "Intel PRO/Wireless 2200BG and 2915ABG Network Connection"
+reject_firmware drivers/net/wireless/ipw2x00/ipw2200.c
+clean_blob drivers/net/wireless/ipw2x00/ipw2200.c
+clean_kconfig drivers/net/wireless/Kconfig 'IPW2200'
+clean_mk CONFIG_IPW2200 drivers/net/wireless/ipw2x00/Makefile
+
+announce IWL3945 - "Intel PRO/Wireless 3945ABG/BG Network Connection"
+reject_firmware drivers/net/wireless/iwlegacy/3945-mac.c
+clean_blob drivers/net/wireless/iwlegacy/3945-mac.c
+clean_blob drivers/net/wireless/iwlegacy/3945.h
+clean_kconfig drivers/net/wireless/iwlegacy/Kconfig 'IWL3945'
+clean_mk CONFIG_IWL3945 drivers/net/wireless/iwlegacy/Makefile
+
+announce IWLWIFI - "Intel Wireless WiFi Next Gen AGN"
+reject_firmware drivers/net/wireless/iwlwifi/iwl-drv.c
+clean_blob drivers/net/wireless/iwlwifi/iwl-drv.c
+clean_blob drivers/net/wireless/iwlwifi/iwl-5000.c
+clean_blob drivers/net/wireless/iwlwifi/iwl-6000.c
+clean_blob drivers/net/wireless/iwlwifi/iwl-1000.c
+clean_blob drivers/net/wireless/iwlwifi/iwl-2000.c
+clean_kconfig drivers/net/wireless/iwlwifi/Kconfig 'IWLWIFI'
+clean_mk CONFIG_IWLWIFI drivers/net/wireless/iwlwifi/Makefile
+
+announce IWL4965 - "Intel Wireless WiFi 4965AGN"
+reject_firmware drivers/net/wireless/iwlegacy/4965-mac.c
+clean_blob drivers/net/wireless/iwlegacy/4965-mac.c
+clean_blob drivers/net/wireless/iwlegacy/4965.c
+clean_kconfig drivers/net/wireless/iwlegacy/Kconfig 'IWL4965'
+clean_mk CONFIG_IWL4965 drivers/net/wireless/iwlegacy/Makefile
+
+announce IWM - "Intel Wireless Multicomm 3200 WiFi driver"
+reject_firmware drivers/net/wireless/iwmc3200wifi/fw.c
+clean_blob drivers/net/wireless/iwmc3200wifi/sdio.c
+clean_kconfig drivers/net/wireless/iwmc3200wifi/Kconfig 'IWM'
+clean_mk CONFIG_IWM drivers/net/wireless/iwmc3200wifi/Makefile
+
+announce IWMC3200TOP - "Intel Wireless MultiCom Top Driver"
+reject_firmware drivers/misc/iwmc3200top/fw-download.c
+undefine_macro '_FW_NAME(api)' '"/*(DEBLOBBED)*/"' \
+ 'removed non-Free firmware name' drivers/misc/iwmc3200top/iwmc3200top.h
+clean_blob drivers/misc/iwmc3200top/main.c
+clean_kconfig drivers/misc/iwmc3200top/Kconfig 'IWMC3200TOP'
+clean_mk CONFIG_IWMC3200TOP drivers/misc/iwmc3200top/Makefile
+
+announce LIBERTAS - "Marvell 8xxx Libertas WLAN driver support"
+reject_firmware drivers/net/wireless/libertas/main.c '
+/Try user-specified firmware first/{
+ :end1
+ /request_firmware(helper, user_helper/! {N; b end1;};
+ :end2
+ /request_firmware(helper, user_helper.*request_firmware(mainfw, user_mainfw/! {N; b end2;};
+ /request_firmware(helper, user_helper.*request_firmware(mainfw, user_mainfw/{
+ /request_firmware.*request_firmware.*request_firmware/!{p; d;};
+ }
+}
+'
+clean_kconfig drivers/net/wireless/Kconfig 'LIBERTAS'
+clean_mk CONFIG_LIBERTAS drivers/net/wireless/libertas/Makefile
+
+announce LIBERTAS_CS - "Marvell Libertas 8385 CompactFlash 802.11b/g cards"
+clean_blob drivers/net/wireless/libertas/if_cs.c
+clean_kconfig drivers/net/wireless/Kconfig 'LIBERTAS_CS'
+clean_mk CONFIG_LIBERTAS_CS drivers/net/wireless/libertas/Makefile
+
+announce LIBERTAS_SDIO - "Marvell Libertas 8385 and 8686 SDIO 802.11b/g cards"
+clean_blob drivers/net/wireless/libertas/if_sdio.c
+clean_kconfig drivers/net/wireless/Kconfig 'LIBERTAS_SDIO'
+clean_mk CONFIG_LIBERTAS_SDIO drivers/net/wireless/libertas/Makefile
+
+announce LIBERTAS_SPI - "Marvell Libertas 8686 SPI 802.11b/g cards"
+clean_blob drivers/net/wireless/libertas/if_spi.c
+clean_kconfig drivers/net/wireless/Kconfig 'LIBERTAS_SPI'
+clean_mk CONFIG_LIBERTAS_SPI drivers/net/wireless/libertas/Makefile
+
+announce LIBERTAS_USB - "Marvell Libertas 8388 USB 802.11b/g cards"
+reject_firmware drivers/net/wireless/libertas/if_usb.c '
+/Try user-specified firmware first/{
+ /request_firmware/!N;
+ /request_firmware/!N;
+ /request_firmware/{p; d;};
+}
+'
+clean_blob drivers/net/wireless/libertas/if_usb.c
+clean_blob drivers/net/wireless/libertas/README
+clean_kconfig drivers/net/wireless/Kconfig 'LIBERTAS_USB'
+clean_mk CONFIG_LIBERTAS_USB drivers/net/wireless/libertas/Makefile
+
+announce LIBERTAS_THINFIRM_USB - "Marvell Libertas 8388 USB 802.11b/g cards with thin firmware"
+reject_firmware drivers/net/wireless/libertas_tf/if_usb.c
+clean_blob drivers/net/wireless/libertas_tf/if_usb.c
+clean_kconfig drivers/net/wireless/Kconfig 'LIBERTAS_THINFIRM_USB'
+clean_mk CONFIG_LIBERTAS_THINFIRM_USB drivers/net/wireless/libertas_tf/Makefile
+
+announce MWIFIEX - "Marvell WiFi-Ex Driver"
+clean_blob drivers/net/wireless/mwifiex/README
+reject_firmware drivers/net/wireless/mwifiex/main.c
+clean_kconfig drivers/net/wireless/mwifiex/Kconfig 'MWIFIEX'
+clean_mk CONFIG_MWIFIEX drivers/net/wireless/mwifiex/Makefile
+
+announce MWIFIEX_SDIO - "Marvell WiFi-Ex Driver for SD8787"
+clean_blob drivers/net/wireless/mwifiex/sdio.h
+clean_blob drivers/net/wireless/mwifiex/sdio.c
+clean_kconfig drivers/net/wireless/mwifiex/Kconfig 'MWIFIEX_SDIO'
+clean_mk CONFIG_MWIFIEX_SDIO drivers/net/wireless/mwifiex/Makefile
+
+announce MWIFIEX_PCIE - "Marvell WiFi-Ex Driver for PCI 8766"
+clean_blob drivers/net/wireless/mwifiex/pcie.h
+clean_blob drivers/net/wireless/mwifiex/pcie.c
+clean_kconfig drivers/net/wireless/mwifiex/Kconfig 'MWIFIEX_PCIE'
+clean_mk CONFIG_MWIFIEX_PCIE drivers/net/wireless/mwifiex/Makefile
+
+announce MWL8K - "Marvell 88W8xxx PCI/PCIe Wireless support"
+reject_firmware drivers/net/wireless/mwl8k.c
+clean_blob drivers/net/wireless/mwl8k.c
+clean_kconfig drivers/net/wireless/Kconfig 'MWL8K'
+clean_mk CONFIG_MWL8K drivers/net/wireless/Makefile
+
+announce ATH6KL - "Atheros ath6kl support"
+reject_firmware drivers/net/wireless/ath/ath6kl/init.c
+clean_blob drivers/net/wireless/ath/ath6kl/init.c
+clean_blob drivers/net/wireless/ath/ath6kl/core.h
+clean_kconfig drivers/net/wireless/ath/ath6kl/Kconfig 'ATH6KL'
+clean_mk CONFIG_ATH6KL drivers/net/wireless/ath/ath6kl/Makefile
+
+announce ATH6KL_SDIO - "Atheros ath6kl SDIO support"
+clean_blob drivers/net/wireless/ath/ath6kl/sdio.c
+clean_kconfig drivers/net/wireless/ath/ath6kl/Kconfig 'ATH6KL_SDIO'
+clean_mk CONFIG_ATH6KL_SDIO drivers/net/wireless/ath/ath6kl/Makefile
+
+announce ATH6KL_USB - "Atheros ath6kl USB support"
+clean_blob drivers/net/wireless/ath/ath6kl/usb.c
+clean_kconfig drivers/net/wireless/ath/ath6kl/Kconfig 'ATH6KL_USB'
+clean_mk CONFIG_ATH6KL_USB drivers/net/wireless/ath/ath6kl/Makefile
+
+announce ATH9K_HTC - "Atheros HTC based wireless cards support"
+reject_firmware drivers/net/wireless/ath/ath9k/hif_usb.c
+clean_blob drivers/net/wireless/ath/ath9k/hif_usb.c
+clean_kconfig drivers/net/wireless/ath/ath9k/Kconfig 'ATH9K_HTC'
+clean_mk CONFIG_ATH9K_HTC drivers/net/wireless/ath/ath9k/Makefile
+
+announce PRISM2_USB - "Prism2.5/3 USB driver"
+reject_firmware drivers/staging/wlan-ng/prism2fw.c
+clean_blob drivers/staging/wlan-ng/prism2fw.c
+clean_kconfig drivers/staging/wlan-ng/Kconfig PRISM2_USB
+clean_mk CONFIG_PRISM2_USB drivers/staging/wlan-ng/Makefile
+
+announce P54_PCI - "Prism54 PCI support"
+reject_firmware drivers/net/wireless/p54/p54pci.c
+clean_blob drivers/net/wireless/p54/p54pci.c
+clean_kconfig drivers/net/wireless/p54/Kconfig 'P54_PCI'
+clean_mk CONFIG_P54_PCI drivers/net/wireless/p54/Makefile
+
+announce P54_SPI - "Prism54 SPI (stlc45xx) support"
+# There's support for loading custom 3826.eeprom here, with a default
+# eeprom that is clearly pure data. Without Free 3826.arm, there's
+# little point in trying to retain the ability to load 3826.eeprom, so
+# we drop it altogether.
+reject_firmware drivers/net/wireless/p54/p54spi.c
+clean_blob drivers/net/wireless/p54/p54spi.c
+clean_kconfig drivers/net/wireless/p54/Kconfig 'P54_SPI'
+clean_mk CONFIG_P54_SPI drivers/net/wireless/p54/Makefile
+
+announce P54_USB - "Prism54 USB support"
+reject_firmware drivers/net/wireless/p54/p54usb.c
+clean_blob drivers/net/wireless/p54/p54usb.c
+clean_blob drivers/net/wireless/p54/p54usb.h
+clean_kconfig drivers/net/wireless/p54/Kconfig 'P54_USB'
+clean_mk CONFIG_P54_USB drivers/net/wireless/p54/Makefile
+
+announce PRISM54 - "Intersil Prism GT/Duette/Indigo PCI/Cardbus"
+reject_firmware drivers/net/wireless/prism54/islpci_dev.c
+clean_blob drivers/net/wireless/prism54/islpci_dev.c
+clean_kconfig drivers/net/wireless/Kconfig 'PRISM54'
+clean_mk CONFIG_PRISM54 drivers/net/wireless/prism54/Makefile
+
+announce RT2X00_LIB_FIRMWARE - "Ralink driver firmware support"
+reject_firmware drivers/net/wireless/rt2x00/rt2x00firmware.c
+clean_kconfig drivers/net/wireless/rt2x00/Kconfig 'RT2X00_LIB_FIRMWARE'
+clean_mk CONFIG_RT2X00_LIB_FIRMWARE drivers/net/wireless/rt2x00/Makefile
+
+announce RT61PCI - "Ralink rt2501/rt61 (PCI/PCMCIA) support"
+clean_blob drivers/net/wireless/rt2x00/rt61pci.h
+clean_blob drivers/net/wireless/rt2x00/rt61pci.c
+clean_kconfig drivers/net/wireless/rt2x00/Kconfig 'RT61PCI'
+clean_mk CONFIG_RT61PCI drivers/net/wireless/rt2x00/Makefile
+
+announce RT73USB - "Ralink rt2501/rt73 (USB) support"
+clean_blob drivers/net/wireless/rt2x00/rt73usb.h
+clean_blob drivers/net/wireless/rt2x00/rt73usb.c
+clean_kconfig drivers/net/wireless/rt2x00/Kconfig 'RT73USB'
+clean_mk CONFIG_RT73USB drivers/net/wireless/rt2x00/Makefile
+
+announce RT2800PCI - "Ralink rt2800 (PCI/PCMCIA) support"
+clean_blob drivers/net/wireless/rt2x00/rt2800pci.h
+clean_blob drivers/net/wireless/rt2x00/rt2800pci.c
+clean_kconfig drivers/net/wireless/rt2x00/Kconfig RT2800PCI
+clean_mk CONFIG_RT2800PCI drivers/net/wireless/rt2x00/Makefile
+
+announce RT2800USB - "Ralink rt2800 (USB) support"
+clean_blob drivers/net/wireless/rt2x00/rt2800usb.h
+clean_blob drivers/net/wireless/rt2x00/rt2800usb.c
+clean_kconfig drivers/net/wireless/rt2x00/Kconfig RT2800USB
+clean_mk CONFIG_RT2800USB drivers/net/wireless/rt2x00/Makefile
+
+announce RTL8192CE - "Realtek RTL8192CE/RTL8188CE Wireless Network Adapter"
+reject_firmware drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
+clean_blob drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
+clean_kconfig drivers/net/wireless/rtlwifi/Kconfig RTL8192CE
+clean_mk CONFIG_RTL8192CE drivers/net/wireless/rtlwifi/rtl8192ce/Makefile
+
+announce RTL8192CU - "Realtek RTL8192CU/RTL8188CU USB Wireless Network Adapter"
+reject_firmware drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
+clean_blob drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
+clean_kconfig drivers/net/wireless/rtlwifi/Kconfig RTL8192CU
+clean_mk CONFIG_RTL8192CU drivers/net/wireless/rtlwifi/rtl8192cu/Makefile
+
+announce RTL8192DE - "Realtek RTL8192DE/RTL8188DE PCIe Wireless Network Adapter"
+reject_firmware drivers/net/wireless/rtlwifi/rtl8192de/sw.c
+clean_blob drivers/net/wireless/rtlwifi/rtl8192de/sw.c
+clean_kconfig drivers/net/wireless/rtlwifi/Kconfig RTL8192DE
+clean_mk CONFIG_RTL8192DE drivers/net/wireless/rtlwifi/rtl8192de/Makefile
+
+announce RTL8192SE - "Realtek RTL8192SE/RTL8191SE PCIe Wireless Network Adapter"
+reject_firmware drivers/net/wireless/rtlwifi/rtl8192se/sw.c
+clean_blob drivers/net/wireless/rtlwifi/rtl8192se/sw.c
+clean_kconfig drivers/net/wireless/rtlwifi/Kconfig RTL8192SE
+clean_mk CONFIG_RTL8192SE drivers/net/wireless/rtlwifi/rtl8192se/Makefile
+
+announce RTL8192E - "RealTek RTL8192E Wireless LAN NIC driver"
+reject_firmware drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
+clean_blob drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c
+clean_blob drivers/staging/rtl8192e/rtl8192e/r8192E_hwimg.c
+clean_kconfig drivers/staging/rtl8192e/Kconfig RTL8192E
+clean_mk CONFIG_RTL8192E drivers/staging/rtl8192e/Makefile
+
+announce RTL8192U - "RealTek RTL8192U Wireless LAN NIC driver"
+reject_firmware drivers/staging/rtl8192u/r819xU_firmware.c
+clean_blob drivers/staging/rtl8192u/r819xU_firmware.c
+clean_kconfig drivers/staging/rtl8192u/Kconfig 'RTL8192U'
+clean_mk CONFIG_RTL8192U drivers/staging/rtl8192u/Makefile
+
+announce R8712U - "RealTek RTL8712U (RTL8192SU) Wireless LAN NIC driver"
+reject_firmware drivers/staging/rtl8712/hal_init.c
+clean_blob drivers/staging/rtl8712/hal_init.c
+clean_kconfig drivers/staging/rtl8712/Kconfig 'R8712U'
+clean_mk CONFIG_R8712U drivers/staging/rtl8712/Makefile
+
+announce VT6656 - "VIA Technologies VT6656 support"
+reject_firmware drivers/staging/vt6656/firmware.c
+clean_blob drivers/staging/vt6656/firmware.c
+clean_kconfig drivers/staging/vt6656/Kconfig 'VT6656'
+clean_mk CONFIG_VT6656 drivers/staging/vt6656/Makefile
+
+announce WL1251 - "TI wl1251 support"
+reject_firmware drivers/net/wireless/wl1251/main.c
+clean_blob drivers/net/wireless/wl1251/main.c
+clean_blob drivers/net/wireless/wl1251/wl1251.h
+clean_kconfig drivers/net/wireless/wl1251/Kconfig 'WL1251'
+clean_mk CONFIG_WL1251 drivers/net/wireless/wl1251/Makefile
+
+announce WL12XX - "TI wl12xx support"
+reject_firmware drivers/net/wireless/wl12xx/main.c
+clean_blob drivers/net/wireless/wl12xx/wl12xx.h
+clean_kconfig drivers/net/wireless/wl12xx/Kconfig 'WL12XX'
+clean_mk CONFIG_WL12XX drivers/net/wireless/wl12xx/Makefile
+
+announce WL12XX_SDIO - "TI wl12xx SDIO support"
+clean_blob drivers/net/wireless/wl12xx/sdio.c
+clean_kconfig drivers/net/wireless/wl12xx/Kconfig 'WL12XX_SDIO'
+clean_mk CONFIG_WL12XX_SDIO drivers/net/wireless/wl12xx/Makefile
+
+announce WL12XX_SPI - "TI wl12xx SPI support"
+clean_blob drivers/net/wireless/wl12xx/spi.c
+clean_kconfig drivers/net/wireless/wl12xx/Kconfig 'WL12XX_SPI'
+clean_mk CONFIG_WL12XX_SPI drivers/net/wireless/wl12xx/Makefile
+
+announce USB_ZD1201 - "USB ZD1201 based Wireless device support"
+reject_firmware drivers/net/wireless/zd1201.c
+clean_blob drivers/net/wireless/zd1201.c
+clean_kconfig drivers/net/wireless/Kconfig 'USB_ZD1201'
+clean_mk CONFIG_USB_ZD1201 drivers/net/wireless/Makefile
+
+announce ZD1211RW - "ZyDAS ZD1211/ZD1211B USB-wireless support"
+reject_firmware drivers/net/wireless/zd1211rw/zd_usb.c
+clean_blob drivers/net/wireless/zd1211rw/zd_usb.c
+clean_kconfig drivers/net/wireless/zd1211rw/Kconfig 'ZD1211RW'
+clean_mk CONFIG_ZD1211RW drivers/net/wireless/zd1211rw/Makefile
+
+# bluetooth
+
+announce BT_ATH3K - "Atheros firmware download driver"
+reject_firmware drivers/bluetooth/ath3k.c
+clean_blob drivers/bluetooth/ath3k.c
+clean_kconfig drivers/bluetooth/Kconfig 'BT_ATH3K'
+clean_mk CONFIG_BT_ATH3K drivers/bluetooth/Makefile
+
+announce BT_HCIBCM203X - "HCI BCM203x USB driver"
+reject_firmware drivers/bluetooth/bcm203x.c
+clean_blob drivers/bluetooth/bcm203x.c
+clean_kconfig drivers/bluetooth/Kconfig 'BT_HCIBCM203X'
+clean_mk CONFIG_BT_HCIBCM203X drivers/bluetooth/Makefile
+
+announce BT_HCIBFUSB - "HCI BlueFRITZ! USB driver"
+reject_firmware drivers/bluetooth/bfusb.c
+clean_blob drivers/bluetooth/bfusb.c
+clean_kconfig drivers/bluetooth/Kconfig 'BT_HCIBFUSB'
+clean_mk CONFIG_BT_HCIBFUSB drivers/bluetooth/Makefile
+
+announce BT_HCIBT3C - "HCI BT3C (PC Card) driver"
+reject_firmware drivers/bluetooth/bt3c_cs.c
+clean_blob drivers/bluetooth/bt3c_cs.c
+clean_kconfig drivers/bluetooth/Kconfig 'BT_HCIBT3C'
+clean_mk CONFIG_BT_HCIBT3C drivers/bluetooth/Makefile
+
+announce BT_MRVL_SDIO - "Marvell BT-over-SDIO driver"
+reject_firmware drivers/bluetooth/btmrvl_sdio.c
+clean_blob drivers/bluetooth/btmrvl_sdio.c
+clean_blob Documentation/btmrvl.txt
+clean_kconfig drivers/bluetooth/Kconfig 'BT_MRVL_SDIO'
+clean_mk CONFIG_BT_MRVL_SDIO drivers/bluetooth/Makefile
+
+announce TI_ST - "Texas Instruments shared transport line discipline"
+reject_firmware drivers/misc/ti-st/st_kim.c
+clean_blob drivers/misc/ti-st/st_kim.c
+clean_kconfig drivers/misc/ti-st/Kconfig 'TI_ST'
+clean_mk CONFIG_TI_ST drivers/misc/ti-st/Makefile
+
+# wimax
+
+announce WIMAX_I2400M - "Intel Wireless WiMAX Connection 2400"
+reject_firmware drivers/net/wimax/i2400m/fw.c
+clean_blob drivers/net/wimax/i2400m/sdio.c
+clean_blob drivers/net/wimax/i2400m/usb.c
+clean_blob Documentation/wimax/README.i2400m
+clean_kconfig drivers/net/wimax/i2400m/Kconfig 'WIMAX_I2400M'
+clean_mk CONFIG_WIMAX_I2400M drivers/net/wimax/i2400m/Makefile
+
+announce BCM_WIMAX - "Beceem BCS200/BCS220-3 and BCSM250 wimax support"
+clean_blob drivers/staging/bcm/Macros.h
+# This disables loading of the .cfg file as well, but it's useless without
+# the firmware proper.
+clean_sed '
+/^static \(inline \)\?struct file \*open_firmware_file/,/^}$/ {
+ /oldfs *= *get_fs();/i\
+ return /*(DEBLOBBED)*/ NULL;
+}' drivers/staging/bcm/Misc.c 'disabled non-Free firmware loading machinery'
+clean_kconfig drivers/staging/bcm/Kconfig 'BCM_WIMAX'
+clean_mk CONFIG_BCM_WIMAX drivers/staging/bcm/Makefile
+
+# infiniband
+
+announce INFINIBAND_QIB - "QLogic PCIe HCA support"
+drop_fw_file firmware/qlogic/sd7220.fw.ihex firmware/qlogic/sd7220.fw
+reject_firmware drivers/infiniband/hw/qib/qib_sd7220.c
+clean_blob drivers/infiniband/hw/qib/qib_sd7220.c
+clean_kconfig drivers/infiniband/hw/qib/Kconfig 'INFINIBAND_QIB'
+clean_mk CONFIG_INFINIBAND_QIB drivers/infiniband/hw/qib/Makefile
+
+# CAN
+
+announce CAN_SOFTING - "Softing Gmbh CAN generic support"
+reject_firmware drivers/net/can/softing/softing_fw.c
+clean_kconfig drivers/net/can/softing/Kconfig 'CAN_SOFTING'
+clean_mk CONFIG_CAN_SOFTING drivers/net/can/softing/Makefile
+
+announce CAN_SOFTING_CS - "Softing Gmbh CAN pcmcia cards"
+clean_blob drivers/net/can/softing/softing_cs.c
+clean_blob drivers/net/can/softing/softing_platform.h
+clean_sed '
+/^config CAN_SOFTING_CS$/,${
+ /You need firmware/i\
+ /*(DEBLOBBED)*/
+ /You need firmware/,/softing-fw.*tar\.gz/d
+}' drivers/net/can/softing/Kconfig 'removed firmware notes'
+clean_kconfig drivers/net/can/softing/Kconfig 'CAN_SOFTING_CS'
+clean_mk CONFIG_CAN_SOFTING_CS drivers/net/can/softing/Makefile
+
+########
+# ISDN #
+########
+
+announce ISDN_DIVAS - "Support Eicon DIVA Server cards"
+clean_blob drivers/isdn/hardware/eicon/cardtype.h
+clean_blob drivers/isdn/hardware/eicon/dsp_defs.h
+clean_kconfig drivers/isdn/hardware/eicon/Kconfig 'ISDN_DIVAS'
+clean_mk CONFIG_ISDN_DIVAS drivers/isdn/hardware/eicon/Makefile
+
+announce MISDN_SPEEDFAX - "Support for Sedlbauer Speedfax+"
+reject_firmware drivers/isdn/hardware/mISDN/speedfax.c
+clean_blob drivers/isdn/hardware/mISDN/speedfax.c
+clean_kconfig drivers/isdn/hardware/mISDN/Kconfig 'MISDN_SPEEDFAX'
+clean_mk CONFIG_MISDN_SPEEDFAX drivers/isdn/hardware/mISDN/Makefile
+
+##########
+# Serial #
+##########
+
+announce SERIAL_8250_CS - "8250/16550 PCMCIA device support"
+# These are not software; they're Free, but GPLed without in-tree sources.
+drop_fw_file firmware/cis/MT5634ZLX.cis.ihex firmware/cis/MT5634ZLX.cis
+drop_fw_file firmware/cis/RS-COM-2P.cis.ihex firmware/cis/RS-COM-2P.cis
+drop_fw_file firmware/cis/COMpad2.cis.ihex firmware/cis/COMpad2.cis
+drop_fw_file firmware/cis/COMpad4.cis.ihex firmware/cis/COMpad4.cis
+# These are not software; they're Free, but GPLed without textual sources.
+# It could be assumed that these binaries *are* sources, since they
+# can be trivially converted back to a textual form, without loss,
+# but we're better off safe than sorry, so remove them from our tree.
+drop_fw_file firmware/cis/SW_555_SER.cis.ihex firmware/cis/SW_555_SER.cis
+drop_fw_file firmware/cis/SW_7xx_SER.cis.ihex firmware/cis/SW_7xx_SER.cis
+drop_fw_file firmware/cis/SW_8xx_SER.cis.ihex firmware/cis/SW_8xx_SER.cis
+# clean_blob drivers/tty/serial/serial_cs.c
+# clean_kconfig drivers/tty/serial/Kconfig 'SERIAL_8250_CS'
+# clean_mk CONFIG_SERIAL_8250_CS drivers/tty/serial/Makefile
+
+announce SERIAL_ICOM - "IBM Multiport Serial Adapter"
+reject_firmware drivers/tty/serial/icom.c
+clean_blob drivers/tty/serial/icom.c
+clean_kconfig drivers/tty/serial/Kconfig 'SERIAL_ICOM'
+clean_mk CONFIG_SERIAL_ICOM drivers/tty/serial/Makefile
+
+announce SERIAL_QE - "Freescale QUICC Engine serial port support"
+reject_firmware drivers/tty/serial/ucc_uart.c
+clean_blob drivers/tty/serial/ucc_uart.c
+clean_kconfig drivers/tty/serial/Kconfig 'SERIAL_QE'
+clean_mk CONFIG_SERIAL_QE drivers/tty/serial/Makefile
+
+#########
+# input #
+#########
+
+announce TOUCHSCREEN_ATMEL_MXT - "Atmel mXT I2C Touchscreen"
+reject_firmware drivers/input/touchscreen/atmel_mxt_ts.c
+clean_blob drivers/input/touchscreen/atmel_mxt_ts.c
+clean_kconfig drivers/input/touchscreen/Kconfig 'TOUCHSCREEN_ATMEL_MXT'
+clean_mk CONFIG_TOUCHSCREEN_ATMEL_MXT drivers/input/touchscreen/Makefile
+
+announce LIRC_ZILOG - "Zilog/Hauppauge IR Transmitter"
+reject_firmware drivers/staging/media/lirc/lirc_zilog.c
+clean_blob drivers/staging/media/lirc/lirc_zilog.c
+clean_kconfig drivers/staging/media/lirc/Kconfig 'LIRC_ZILOG'
+clean_mk CONFIG_LIRC_ZILOG drivers/staging/media/lirc/Makefile
+
+####################
+# Data acquisition #
+####################
+
+announce COMEDI_PCI_DRIVERS - "Data acquisition support Comedi PCI drivers"
+reject_firmware drivers/staging/comedi/drivers/jr3_pci.c
+clean_blob drivers/staging/comedi/drivers/jr3_pci.c
+clean_kconfig drivers/staging/comedi/Kconfig 'COMEDI_PCI_DRIVERS'
+clean_mk CONFIG_COMEDI_PCI_DRIVERS drivers/staging/comedi/drivers/Makefile
+
+announce COMEDI_USBDUX - "ITL USBDUX support"
+reject_firmware drivers/staging/comedi/drivers/usbdux.c
+clean_blob drivers/staging/comedi/drivers/usbdux.c
+clean_kconfig drivers/staging/comedi/Kconfig 'COMEDI_USBDUX'
+clean_mk CONFIG_COMEDI_USBDUX drivers/staging/comedi/drivers/Makefile
+
+announce COMEDI_USBDUXFAST - "ITL USB-DUXfast support"
+reject_firmware drivers/staging/comedi/drivers/usbduxfast.c
+clean_blob drivers/staging/comedi/drivers/usbduxfast.c
+clean_kconfig drivers/staging/comedi/Kconfig 'COMEDI_USBDUXFAST'
+clean_mk CONFIG_COMEDI_USBDUXFAST drivers/staging/comedi/drivers/Makefile
+
+announce COMEDI_USBDUXSIGMA - "ITL USB-DUXsigma support"
+reject_firmware drivers/staging/comedi/drivers/usbduxsigma.c
+clean_blob drivers/staging/comedi/drivers/usbduxsigma.c
+clean_kconfig drivers/staging/comedi/Kconfig 'COMEDI_USBDUXSIGMA'
+clean_mk CONFIG_COMEDI_USBDUXSIGMA drivers/staging/comedi/drivers/Makefile
+
+
+#######
+# MMC #
+#######
+
+announce MMC_VUB300 - "VUB300 USB to SDIO/SD/MMC Host Controller support"
+clean_sed '
+/^config MMC_VUB300/,/^config /{
+ /Some SDIO cards/i\
+ /*(DEBLOBBED)*/
+ /Some SDIO cards/,/obtainable data rate\.$/d
+}
+' drivers/mmc/host/Kconfig "removed firmware notes"
+reject_firmware drivers/mmc/host/vub300.c
+clean_blob drivers/mmc/host/vub300.c
+clean_kconfig drivers/mmc/host/Kconfig 'MMC_VUB300'
+clean_mk CONFIG_MMC_VUB300 drivers/mmc/host/Makefile
+
+########
+# SCSI #
+########
+
+announce SCSI_QLOGICPTI - "PTI Qlogic, ISP Driver"
+drop_fw_file firmware/qlogic/isp1000.bin.ihex firmware/qlogic/isp1000.bin
+reject_firmware drivers/scsi/qlogicpti.c
+clean_blob drivers/scsi/qlogicpti.c
+clean_kconfig drivers/scsi/Kconfig 'SCSI_QLOGICPTI'
+clean_mk CONFIG_SCSI_QLOGICPTI drivers/scsi/Makefile
+
+announce SCSI_ADVANSYS - "AdvanSys SCSI"
+drop_fw_file firmware/advansys/mcode.bin.ihex firmware/advansys/mcode.bin
+drop_fw_file firmware/advansys/3550.bin.ihex firmware/advansys/3550.bin
+drop_fw_file firmware/advansys/38C0800.bin.ihex firmware/advansys/38C0800.bin
+drop_fw_file firmware/advansys/38C1600.bin.ihex firmware/advansys/38C1600.bin
+reject_firmware drivers/scsi/advansys.c
+clean_blob drivers/scsi/advansys.c
+clean_kconfig drivers/scsi/Kconfig 'SCSI_ADVANSYS'
+clean_mk CONFIG_SCSI_ADVANSYS drivers/scsi/Makefile
+
+announce SCSI_QLOGIC_1280 - "Qlogic QLA 1240/1x80/1x160 SCSI"
+drop_fw_file firmware/qlogic/1040.bin.ihex firmware/qlogic/1040.bin
+drop_fw_file firmware/qlogic/1280.bin.ihex firmware/qlogic/1280.bin
+drop_fw_file firmware/qlogic/12160.bin.ihex firmware/qlogic/12160.bin
+reject_firmware drivers/scsi/qla1280.c
+clean_blob drivers/scsi/qla1280.c
+clean_kconfig drivers/scsi/Kconfig 'SCSI_QLOGIC_1280'
+clean_mk CONFIG_SCSI_QLOGIC_1280 drivers/scsi/Makefile
+
+announce SCSI_AIC94XX - "Adaptec AIC94xx SAS/SATA support"
+reject_firmware drivers/scsi/aic94xx/aic94xx_seq.c
+clean_blob drivers/scsi/aic94xx/aic94xx_seq.c
+clean_blob drivers/scsi/aic94xx/aic94xx_seq.h
+clean_kconfig drivers/scsi/aic94xx/Kconfig 'SCSI_AIC94XX'
+clean_mk CONFIG_SCSI_AIC94XX drivers/scsi/aic94xx/Makefile
+
+announce SCSI_BFA_FC - "Brocade BFA Fibre Channel Support"
+reject_firmware drivers/scsi/bfa/bfad.c
+clean_blob drivers/scsi/bfa/bfad.c
+clean_kconfig drivers/scsi/Kconfig 'SCSI_BFA_FC'
+clean_mk CONFIG_SCSI_BFA_FC drivers/scsi/bfa/Makefile
+
+announce SCSI_LPFC - "Emulex LightPulse Fibre Channel Support"
+# The firmware name is built out of Vital Product Data read from the
+# adapter. The firmware is definitely code, and I couldn't find
+# evidence it is Free, so I'm disabling it. It's not clear whether
+# this is the hardware or the software inducing to the installation of
+# non-Free firmware.
+reject_firmware drivers/scsi/lpfc/lpfc_init.c
+clean_kconfig drivers/scsi/Kconfig 'SCSI_LPFC'
+clean_mk CONFIG_SCSI_LPFC drivers/scsi/lpfc/Makefile
+
+announce SCSI_QLA_FC - "QLogic QLA2XXX Fibre Channel Support"
+reject_firmware drivers/scsi/qla2xxx/qla_gbl.h
+reject_firmware drivers/scsi/qla2xxx/qla_init.c
+reject_firmware drivers/scsi/qla2xxx/qla_os.c
+reject_firmware drivers/scsi/qla2xxx/qla_nx.c
+clean_sed '
+/^config SCSI_QLA_FC$/,/^config /{
+ /^ By default, firmware/i\
+ /*(DEBLOBBED)*/
+ /^ By default, firmware/,/ftp:[/][/].*firmware[/]/d
+}' drivers/scsi/qla2xxx/Kconfig 'removed firmware notes'
+clean_blob drivers/scsi/qla2xxx/qla_os.c
+clean_kconfig drivers/scsi/qla2xxx/Kconfig 'SCSI_QLA_FC'
+clean_mk CONFIG_SCSI_QLA_FC drivers/scsi/qla2xxx/Makefile
+
+
+#######
+# USB #
+#######
+
+# atm
+
+announce USB_CXACRU - "Conexant AccessRunner USB support"
+reject_firmware drivers/usb/atm/cxacru.c
+clean_blob drivers/usb/atm/cxacru.c
+clean_kconfig drivers/usb/atm/Kconfig 'USB_CXACRU'
+clean_mk CONFIG_USB_CXACRU drivers/usb/atm/Makefile
+
+announce USB_SPEEDTOUCH - "Speedtouch USB support"
+reject_firmware drivers/usb/atm/speedtch.c
+clean_blob drivers/usb/atm/speedtch.c
+clean_kconfig drivers/usb/atm/Kconfig 'USB_SPEEDTOUCH'
+clean_mk CONFIG_USB_SPEEDTOUCH drivers/usb/atm/Makefile
+
+announce USB_UEAGLEATM - "ADI 930 and eagle USB DSL modem"
+reject_firmware drivers/usb/atm/ueagle-atm.c
+clean_blob drivers/usb/atm/ueagle-atm.c
+clean_kconfig drivers/usb/atm/Kconfig 'USB_UEAGLEATM'
+clean_mk CONFIG_USB_UEAGLEATM drivers/usb/atm/Makefile
+
+# misc
+
+announce USB_EMI26 - "EMI 2|6 USB Audio interface"
+# These files are not under the GPL, better remove them all.
+drop_fw_file firmware/emi26/bitstream.HEX firmware/emi26/bitstream.fw
+drop_fw_file firmware/emi26/firmware.HEX firmware/emi26/firmware.fw
+drop_fw_file firmware/emi26/loader.HEX firmware/emi26/loader.fw
+reject_firmware drivers/usb/misc/emi26.c
+clean_blob drivers/usb/misc/emi26.c
+clean_kconfig drivers/usb/misc/Kconfig 'USB_EMI26'
+clean_mk CONFIG_USB_EMI26 drivers/usb/misc/Makefile
+
+announce USB_EMI62 - "EMI 6|2m USB Audio interface"
+# These files are probably not under the GPL, better remove them all.
+drop_fw_file firmware/emi62/bitstream.HEX firmware/emi62/bitstream.fw
+drop_fw_file firmware/emi62/loader.HEX firmware/emi62/loader.fw
+drop_fw_file firmware/emi62/midi.HEX firmware/emi62/midi.fw
+drop_fw_file firmware/emi62/spdif.HEX firmware/emi62/spdif.fw
+reject_firmware drivers/usb/misc/emi62.c
+clean_blob drivers/usb/misc/emi62.c
+clean_kconfig drivers/usb/misc/Kconfig 'USB_EMI62'
+clean_mk CONFIG_USB_EMI62 drivers/usb/misc/Makefile
+
+announce USB_ISIGHTFW - "iSight firmware loading support"
+reject_firmware drivers/usb/misc/isight_firmware.c
+clean_blob drivers/usb/misc/isight_firmware.c
+clean_kconfig drivers/usb/misc/Kconfig 'USB_ISIGHTFW'
+clean_mk CONFIG_USB_ISIGHTFW drivers/usb/misc/Makefile
+
+# storage
+
+announce USB_STORAGE_ENE_UB6250 - "USB ENE card reader support"
+reject_firmware drivers/usb/storage/ene_ub6250.c
+clean_blob drivers/usb/storage/ene_ub6250.c
+clean_kconfig drivers/usb/storage/Kconfig 'USB_STORAGE_ENE_UB6250'
+clean_mk 'CONFIG_USB_STORAGE_ENE_UB6250' drivers/usb/storage/Makefile
+
+announce USB_ENESTORAGE - "USB ENE card reader support"
+clean_blob drivers/staging/keucr/init.h
+clean_sed '
+/^int ENE_LoadBinCode(/,/^}$/ {
+ /kmalloc/i\
+ return /*(DEBLOBBED)*/ USB_STOR_TRANSPORT_ERROR;
+}
+' drivers/staging/keucr/init.c 'disable non-Free firmware loading machinery'
+clean_kconfig drivers/staging/keucr/Kconfig 'USB_ENESTORAGE'
+clean_mk 'CONFIG_USB_ENESTORAGE' drivers/staging/keucr/Makefile
+
+# serial
+
+announce USB_SERIAL_KEYSPAN - "USB Keyspan USA-xxx Serial Driver"
+drop_fw_file firmware/keyspan/mpr.HEX firmware/keyspan/mpr.fw
+clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN_MPR'
+drop_fw_file firmware/keyspan/usa18x.HEX firmware/keyspan/usa18x.fw
+clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN_USA18X'
+drop_fw_file firmware/keyspan/usa19.HEX firmware/keyspan/usa19.fw
+clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN_USA19'
+drop_fw_file firmware/keyspan/usa19qi.HEX firmware/keyspan/usa19qi.fw
+clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN_USA19QI'
+drop_fw_file firmware/keyspan/usa19qw.HEX firmware/keyspan/usa19qw.fw
+clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN_USA19QW'
+drop_fw_file firmware/keyspan/usa19w.HEX firmware/keyspan/usa19w.fw
+clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN_USA19W'
+drop_fw_file firmware/keyspan/usa28.HEX firmware/keyspan/usa28.fw
+clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN_USA28'
+drop_fw_file firmware/keyspan/usa28xa.HEX firmware/keyspan/usa28xa.fw
+clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN_USA28XA'
+drop_fw_file firmware/keyspan/usa28xb.HEX firmware/keyspan/usa28xb.fw
+clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN_USA28XB'
+drop_fw_file firmware/keyspan/usa28x.HEX firmware/keyspan/usa28x.fw
+clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN_USA28X'
+drop_fw_file firmware/keyspan/usa49w.HEX firmware/keyspan/usa49w.fw
+clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN_USA49W'
+drop_fw_file firmware/keyspan/usa49wlc.HEX firmware/keyspan/usa49wlc.fw
+clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN_USA49WLC'
+reject_firmware drivers/usb/serial/keyspan.c
+clean_blob drivers/usb/serial/keyspan.c
+clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_KEYSPAN'
+clean_mk CONFIG_USB_SERIAL_KEYSPAN drivers/usb/serial/Makefile
+
+announce USB_SERIAL_KEYSPAN_PDA - "USB Keyspan PDA Single Port Serial Driver"
+clean_sed '
+s,request_ihex_firmware,/*KEYSPAN_PDA*/&,
+' drivers/usb/serial/keyspan_pda.c 'accept Free firmware'
+
+announce USB_SERIAL_EDGEPORT - "USB Inside Out Edgeport Serial Driver"
+clean_fw firmware/edgeport/boot.H16 firmware/edgeport/boot.fw
+clean_fw firmware/edgeport/boot2.H16 firmware/edgeport/boot2.fw
+clean_fw firmware/edgeport/down.H16 firmware/edgeport/down.fw
+clean_fw firmware/edgeport/down2.H16 firmware/edgeport/down2.fw
+reject_firmware drivers/usb/serial/io_edgeport.c
+clean_blob drivers/usb/serial/io_edgeport.c
+clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_EDGEPORT'
+clean_mk CONFIG_USB_SERIAL_EDGEPORT drivers/usb/serial/Makefile
+
+announce USB_SERIAL_EDGEPORT_TI - "USB Inside Out Edgeport Serial Driver (TI devices)"
+clean_fw firmware/edgeport/down3.bin.ihex firmware/edgeport/down3.bin
+reject_firmware drivers/usb/serial/io_ti.c
+clean_blob drivers/usb/serial/io_ti.c
+clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_EDGEPORT_TI'
+clean_mk CONFIG_USB_SERIAL_EDGEPORT_TI drivers/usb/serial/Makefile
+
+announce USB_SERIAL_TI - "USB TI 3410/5052 Serial Driver"
+drop_fw_file firmware/ti_3410.fw.ihex firmware/ti_3410.fw
+drop_fw_file firmware/ti_5052.fw.ihex firmware/ti_5052.fw
+drop_fw_file firmware/mts_cdma.fw.ihex firmware/mts_cdma.fw
+drop_fw_file firmware/mts_gsm.fw.ihex firmware/mts_gsm.fw
+drop_fw_file firmware/mts_edge.fw.ihex firmware/mts_edge.fw
+reject_firmware drivers/usb/serial/ti_usb_3410_5052.c
+clean_blob drivers/usb/serial/ti_usb_3410_5052.c
+clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_TI'
+clean_mk CONFIG_USB_SERIAL_TI drivers/usb/serial/Makefile
+
+announce USB_SERIAL_WHITEHEAT - "USB ConnectTech WhiteHEAT Serial Driver"
+clean_fw firmware/whiteheat.HEX firmware/whiteheat.fw
+clean_fw firmware/whiteheat_loader.HEX firmware/whiteheat_loader.fw
+clean_fw firmware/whiteheat_loader_debug.HEX firmware/whiteheat_loader_debug.fw
+reject_firmware drivers/usb/serial/whiteheat.c
+clean_blob drivers/usb/serial/whiteheat.c
+clean_kconfig drivers/usb/serial/Kconfig 'USB_SERIAL_WHITEHEAT'
+clean_mk CONFIG_USB_SERIAL_WHITEHEAT drivers/usb/serial/Makefile
+
+# uwb
+
+announce UWB_I1480U - Support for Intel Wireless UWB Link 1480 HWA
+reject_firmware drivers/uwb/i1480/dfu/i1480-dfu.h
+reject_firmware drivers/uwb/i1480/dfu/mac.c
+reject_firmware drivers/uwb/i1480/dfu/phy.c
+clean_blob drivers/uwb/i1480/dfu/usb.c
+clean_kconfig drivers/uwb/Kconfig 'UWB_I1480U'
+clean_mk CONFIG_UWB_I1480U drivers/uwb/i1480/dfu/Makefile
+
+
+
+#########
+# Sound #
+#########
+
+announce SND_ASIHPI - "AudioScience ASIxxxx"
+reject_firmware sound/pci/asihpi/hpidspcd.c
+clean_blob sound/pci/asihpi/hpidspcd.c
+clean_blob sound/pci/asihpi/hpioctl.c
+clean_kconfig sound/pci/Kconfig 'SND_ASIHPI'
+clean_mk CONFIG_SND_ASIHPI sound/pci/asihpi/Makefile
+
+announce SND_CS46XX - "Cirrus Logic (Sound Fusion) CS4280/CS461x/CS462x/CS463x"
+# This appears to have been extracted from some non-Free driver
+clean_file sound/pci/cs46xx/cs46xx_image.h
+# The following blobs are definitely extracted from non-Free drivers.
+clean_file sound/pci/cs46xx/imgs/cwc4630.h
+clean_file sound/pci/cs46xx/imgs/cwcasync.h
+clean_file sound/pci/cs46xx/imgs/cwcsnoop.h
+clean_sed '
+/^\(int \)\?snd_cs46xx_download_image([^;]*$/,/^}$/{
+ /for.*BA1_MEMORY_COUNT/i\
+#if 0
+ /^}$/{
+ i\
+#else\
+ snd_printk(KERN_ERR "cs46xx: Missing Free firmware\\n");\
+ return -EINVAL;\
+#endif
+ }
+}
+s/cs46xx_dsp_load_module(chip, [&]cwc\(4630\|async\|snoop\)_module)/(snd_printk(KERN_ERR "cs46xx: Missing Free firmware\\n"),-EINVAL)/
+' sound/pci/cs46xx/cs46xx_lib.c 'report missing Free firmware'
+clean_blob sound/pci/cs46xx/cs46xx_lib.c
+clean_kconfig sound/pci/Kconfig 'SND_CS46XX'
+clean_mk 'CONFIG_SND_CS46XX' sound/pci/cs46xx/Makefile
+
+announce SND_KORG1212 - "Korg 1212 IO"
+drop_fw_file firmware/korg/k1212.dsp.ihex firmware/korg/k1212.dsp
+reject_firmware sound/pci/korg1212/korg1212.c
+clean_blob sound/pci/korg1212/korg1212.c
+clean_kconfig sound/pci/Kconfig 'SND_KORG1212'
+clean_mk 'CONFIG_SND_KORG1212' sound/pci/korg1212/Makefile
+
+announce SND_MAESTRO3 - "ESS Allegro/Maestro3"
+drop_fw_file firmware/ess/maestro3_assp_kernel.fw.ihex firmware/ess/maestro3_assp_kernel.fw
+drop_fw_file firmware/ess/maestro3_assp_minisrc.fw.ihex firmware/ess/maestro3_assp_minisrc.fw
+reject_firmware sound/pci/maestro3.c
+clean_blob sound/pci/maestro3.c
+clean_kconfig sound/pci/Kconfig 'SND_MAESTRO3'
+clean_mk 'CONFIG_SND_MAESTRO3' sound/pci/Makefile
+
+announce SND_YMFPCI - "Yamaha YMF724/740/744/754"
+drop_fw_file firmware/yamaha/ds1_ctrl.fw.ihex firmware/yamaha/ds1_ctrl.fw
+drop_fw_file firmware/yamaha/ds1_dsp.fw.ihex firmware/yamaha/ds1_dsp.fw
+drop_fw_file firmware/yamaha/ds1e_ctrl.fw.ihex firmware/yamaha/ds1e_ctrl.fw
+reject_firmware sound/pci/ymfpci/ymfpci_main.c
+clean_blob sound/pci/ymfpci/ymfpci_main.c
+clean_kconfig sound/pci/Kconfig 'SND_YMFPCI'
+clean_mk 'CONFIG_SND_YMFPCI' sound/pci/ymfpci/Makefile
+
+announce SND_SB16_CSP - "SB16 Advanced Signal Processor"
+drop_fw_file firmware/sb16/alaw_main.csp.ihex firmware/sb16/alaw_main.csp
+drop_fw_file firmware/sb16/mulaw_main.csp.ihex firmware/sb16/mulaw_main.csp
+drop_fw_file firmware/sb16/ima_adpcm_init.csp.ihex firmware/sb16/ima_adpcm_init.csp
+drop_fw_file firmware/sb16/ima_adpcm_capture.csp.ihex firmware/sb16/ima_adpcm_capture.csp
+drop_fw_file firmware/sb16/ima_adpcm_playback.csp.ihex firmware/sb16/ima_adpcm_playback.csp
+reject_firmware sound/isa/sb/sb16_csp.c
+clean_blob sound/isa/sb/sb16_csp.c
+clean_kconfig sound/isa/Kconfig 'SND_SB16_CSP'
+clean_mk 'CONFIG_SND_SB16_CSP' sound/isa/sb/Makefile
+
+announce SND_WAVEFRONT - "Turtle Beach Maui,Tropez,Tropez+ (Wavefront)"
+drop_fw_file firmware/yamaha/yss225_registers.bin.ihex firmware/yamaha/yss225_registers.bin
+reject_firmware sound/isa/wavefront/wavefront_fx.c
+clean_blob sound/isa/wavefront/wavefront_fx.c
+reject_firmware sound/isa/wavefront/wavefront_synth.c
+clean_blob sound/isa/wavefront/wavefront_synth.c
+clean_kconfig sound/isa/Kconfig 'SND_WAVEFRONT'
+clean_mk 'CONFIG_SND_WAVEFRONT' sound/isa/wavefront/Makefile
+
+announce SND_VX_LIB - Digigram VX soundcards
+reject_firmware sound/drivers/vx/vx_hwdep.c
+clean_blob sound/drivers/vx/vx_hwdep.c
+clean_kconfig sound/drivers/Kconfig 'SND_VX_LIB'
+clean_mk CONFIG_SND_VX_LIB sound/drivers/vx/Makefile
+
+announce SND_DARLA20 - "(Echoaudio) Darla20"
+clean_blob sound/pci/echoaudio/darla20.c
+clean_kconfig sound/pci/Kconfig 'SND_DARLA20'
+clean_mk CONFIG_SND_DARLA20 sound/pci/echoaudio/Makefile
+
+announce SND_DARLA24 - "(Echoaudio) Darla24"
+clean_blob sound/pci/echoaudio/darla24.c
+clean_kconfig sound/pci/Kconfig 'SND_DARLA24'
+clean_mk CONFIG_SND_DARLA24 sound/pci/echoaudio/Makefile
+
+announce SND_ECHO3G - "(Echoaudio) 3G cards"
+clean_blob sound/pci/echoaudio/echo3g.c
+clean_kconfig sound/pci/Kconfig 'SND_ECHO3G'
+clean_mk CONFIG_SND_ECHO3G sound/pci/echoaudio/Makefile
+
+announce SND_GINA20 - "(Echoaudio) Gina20"
+clean_blob sound/pci/echoaudio/gina20.c
+clean_kconfig sound/pci/Kconfig 'SND_GINA20'
+clean_mk CONFIG_SND_GINA20 sound/pci/echoaudio/Makefile
+
+announce SND_GINA24 - "(Echoaudio) Gina24"
+clean_blob sound/pci/echoaudio/gina24.c
+clean_kconfig sound/pci/Kconfig 'SND_GINA24'
+clean_mk CONFIG_SND_GINA24 sound/pci/echoaudio/Makefile
+
+announce SND_INDIGO - "(Echoaudio) Indigo"
+clean_blob sound/pci/echoaudio/indigo.c
+clean_kconfig sound/pci/Kconfig 'SND_INDIGO'
+clean_mk CONFIG_SND_INDIGO sound/pci/echoaudio/Makefile
+
+announce SND_INDIGODJ - "(Echoaudio) Indigo DJ"
+clean_blob sound/pci/echoaudio/indigodj.c
+clean_kconfig sound/pci/Kconfig 'SND_INDIGODJ'
+clean_mk CONFIG_SND_INDIGODJ sound/pci/echoaudio/Makefile
+
+announce SND_INDIGODJX - "(Echoaudio) Indigo DJx"
+clean_blob sound/pci/echoaudio/indigodjx.c
+clean_kconfig sound/pci/Kconfig 'SND_INDIGODJX'
+clean_mk CONFIG_SND_INDIGODJX sound/pci/echoaudio/Makefile
+
+announce SND_INDIGOIO - "(Echoaudio) Indigo IO"
+clean_blob sound/pci/echoaudio/indigoio.c
+clean_kconfig sound/pci/Kconfig 'SND_INDIGOIO'
+clean_mk CONFIG_SND_INDIGOIO sound/pci/echoaudio/Makefile
+
+announce SND_INDIGOIOX - "(Echoaudio) Indigo IOx"
+clean_blob sound/pci/echoaudio/indigoiox.c
+clean_kconfig sound/pci/Kconfig 'SND_INDIGOIOX'
+clean_mk CONFIG_SND_INDIGOIOX sound/pci/echoaudio/Makefile
+
+announce SND_LAYLA20 - "(Echoaudio) Layla20"
+clean_blob sound/pci/echoaudio/layla20.c
+clean_kconfig sound/pci/Kconfig 'SND_LAYLA20'
+clean_mk CONFIG_SND_LAYLA20 sound/pci/echoaudio/Makefile
+
+announce SND_LAYLA24 - "(Echoaudio) Layla24"
+clean_blob sound/pci/echoaudio/layla24.c
+clean_kconfig sound/pci/Kconfig 'SND_LAYLA24'
+clean_mk CONFIG_SND_LAYLA24 sound/pci/echoaudio/Makefile
+
+announce SND_MIA - "(Echoaudio) Mia"
+clean_blob sound/pci/echoaudio/mia.c
+clean_kconfig sound/pci/Kconfig 'SND_MIA'
+clean_mk CONFIG_SND_MIA sound/pci/echoaudio/Makefile
+
+announce SND_MONA - "(Echoaudio) Mona"
+clean_blob sound/pci/echoaudio/mona.c
+clean_kconfig sound/pci/Kconfig 'SND_MONA'
+clean_mk CONFIG_SND_MONA sound/pci/echoaudio/Makefile
+
+announce SND_'<(Echoaudio)>' - "(Echoaudio) all of the above "
+reject_firmware sound/pci/echoaudio/echoaudio.c
+clean_blob sound/pci/echoaudio/echoaudio.c
+
+announce SND_EMU10K1 - "Emu10k1 (SB Live!, Audigy, E-mu APS)"
+reject_firmware sound/pci/emu10k1/emu10k1_main.c
+clean_blob sound/pci/emu10k1/emu10k1_main.c
+clean_kconfig sound/pci/Kconfig 'SND_EMU10K1'
+clean_mk CONFIG_SND_EMU10K1 sound/pci/emu10k1/Makefile
+
+announce SND_MIXART - "Digigram miXart"
+reject_firmware sound/pci/mixart/mixart_hwdep.c
+clean_blob sound/pci/mixart/mixart_hwdep.c
+clean_kconfig sound/pci/Kconfig 'SND_MIXART'
+clean_mk CONFIG_SND_MIXART sound/pci/mixart/Makefile
+
+announce SND_PCXHR - "Digigram PCXHR"
+reject_firmware sound/pci/pcxhr/pcxhr_hwdep.c
+clean_blob sound/pci/pcxhr/pcxhr_hwdep.c
+clean_kconfig sound/pci/Kconfig 'SND_PCXHR'
+clean_mk CONFIG_SND_PCXHR sound/pci/pcxhr/Makefile
+
+announce SND_RIPTIDE - "Conexant Riptide"
+reject_firmware sound/pci/riptide/riptide.c
+clean_blob sound/pci/riptide/riptide.c
+clean_kconfig sound/pci/Kconfig 'SND_RIPTIDE'
+clean_mk CONFIG_SND_RIPTIDE sound/pci/riptide/Makefile
+
+# This is ok, patch filenames are supplied as module parameters, and
+# they are text files with patch instructions.
+#announce SND_HDA_PATCH_LOADER - "Support initialization patch loading for HD-audio"
+#reject_firmware sound/pci/hda/hda_hwdep.c
+#clean_kconfig sound/pci/hda/Kconfig 'SND_HDA_PATCH_LOADER'
+
+announce SND_HDSP - "RME Hammerfall DSP Audio"
+reject_firmware sound/pci/rme9652/hdsp.c
+clean_blob sound/pci/rme9652/hdsp.c
+clean_kconfig sound/pci/Kconfig 'SND_HDSP'
+clean_mk CONFIG_SND_HDSP sound/pci/rme9652/Makefile
+
+announce SND_AICA - "Dreamcast Yamaha AICA sound"
+reject_firmware sound/sh/aica.c
+clean_blob sound/sh/aica.c
+clean_kconfig sound/sh/Kconfig 'SND_AICA'
+clean_mk CONFIG_SND_AICA sound/sh/Makefile
+
+announce SND_MSND_PINNACLE - "Support for Turtle Beach MultiSound Pinnacle"
+clean_blob sound/isa/msnd/msnd_pinnacle.h
+reject_firmware sound/isa/msnd/msnd_pinnacle.c
+clean_blob sound/isa/msnd/msnd_pinnacle.c
+clean_kconfig sound/isa/Kconfig 'SND_MSND_PINNACLE'
+clean_mk CONFIG_SND_MSND_PINNACLE sound/isa/msnd/Makefile
+
+announce SND_MSND_CLASSIC - "Support for Turtle Beach MultiSound Classic, Tahiti, Monterey"
+clean_blob sound/isa/msnd/msnd_classic.h
+clean_kconfig sound/isa/Kconfig 'SND_MSND_CLASSIC'
+clean_mk CONFIG_SND_MSND_CLASSIC sound/isa/msnd/Makefile
+
+announce SOUND_MSNDCLAS - "Support for Turtle Beach MultiSound Classic, Tahiti, Monterey (oss)"
+clean_blob sound/oss/msnd_classic.h
+clean_kconfig sound/oss/Kconfig 'SOUND_MSNDCLAS'
+clean_sed '
+/^config MSNDCLAS_INIT_FILE$/, /^config / {
+ /^ default.*msndinit\.bin/ s,".*","/*(DEBLOBBED)*/",;
+}
+/^config MSNDCLAS_PERM_FILE$/, /^config / {
+ /^ default.*msndperm\.bin/ s,".*","/*(DEBLOBBED)*/",;
+}' sound/oss/Kconfig 'removed default firmware'
+clean_mk CONFIG_SOUND_MSNDCLAS sound/oss/Makefile
+
+announce SOUND_MSNDPIN - "Support for Turtle Beach MultiSound Pinnacle (oss)"
+clean_blob sound/oss/msnd_pinnacle.h
+clean_kconfig sound/oss/Kconfig 'SOUND_MSNDPIN'
+clean_sed '
+/^config MSNDPIN_INIT_FILE$/, /^config / {
+ /^ default.*pndspini\.bin/ s,".*","/*(DEBLOBBED)*/",;
+}
+/^config MSNDPIN_PERM_FILE$/, /^config / {
+ /^ default.*pndsperm\.bin/ s,".*","/*(DEBLOBBED)*/",;
+}' sound/oss/Kconfig 'removed default firmware'
+clean_mk CONFIG_SOUND_MSNDPIN sound/oss/Makefile
+
+announce SND_SSCAPE - "Ensoniq SoundScape driver"
+reject_firmware sound/isa/sscape.c
+clean_blob sound/isa/sscape.c
+clean_sed '
+/^config SND_SSCAPE$/, /^config / {
+ s,"\(scope\|sndscape\)\.co[d?]","/*(DEBLOBBED)*/",g;
+}' sound/isa/Kconfig 'removed firmware names'
+clean_kconfig sound/isa/Kconfig 'SND_SSCAPE'
+clean_mk CONFIG_SND_SSCAPE sound/isa/Makefile
+
+announce SND_SOC_ADAU1701 - "ADAU1701 SigmaDSP processor"
+clean_blob sound/soc/codecs/adau1701.c
+clean_kconfig sound/soc/codecs/Kconfig 'SND_SOC_ADAU1701'
+clean_mk CONFIG_SND_SOC_ADAU1701 sound/soc/codecs/Makefile
+
+announce SND_SOC_SIGMADSP - "SigmaStudio firmware loader"
+maybe_reject_firmware sound/soc/codecs/sigmadsp.c
+
+# It's not clear that wm2000_anc.bin is pure data.
+# Check with developer, clean up for now.
+announce SND_SOC_WM2000 - "WM2000 ALSA Soc Audio codecs"
+reject_firmware sound/soc/codecs/wm2000.c
+clean_blob sound/soc/codecs/wm2000.c
+clean_kconfig sound/soc/codecs/Kconfig 'SND_SOC_WM2000'
+clean_mk CONFIG_SND_SOC_WM2000 sound/soc/codecs/Makefile
+
+announce SND_SOC_WM8994 - "WM8994 ALSA Soc Audio codecs"
+reject_firmware sound/soc/codecs/wm8958-dsp2.c
+clean_blob sound/soc/codecs/wm8958-dsp2.c
+clean_kconfig sound/soc/codecs/Kconfig 'SND_SOC_WM8994'
+clean_mk CONFIG_SND_SOC_WM8994 sound/soc/codecs/Makefile
+
+announce SND_SOC_SH4_SIU - "ALSA SoC driver for Renesas SH7343, SH7722 SIU peripheral"
+reject_firmware sound/soc/sh/siu_dai.c
+clean_blob sound/soc/sh/siu_dai.c
+clean_kconfig sound/soc/sh/Kconfig 'SND_SOC_SH4_SIU'
+clean_mk CONFIG_SND_SOC_SH4_SIU sound/soc/sh/Makefile
+
+announce SOUND_TRIX - "MediaTrix AudioTrix Pro support"
+clean_blob sound/oss/trix.c
+clean_kconfig sound/oss/Kconfig 'SOUND_TRIX'
+clean_sed '
+/^config TRIX_BOOT_FILE$/, /^config / {
+ /^ default.*trxpro\.hex/ s,".*","/*(DEBLOBBED)*/",;
+}' sound/oss/Kconfig 'removed default firmware'
+clean_mk CONFIG_SOUND_TRIX sound/oss/Makefile
+
+announce SOUND_TRIX - "See above,"
+announce SOUND_PAS - "ProAudioSpectrum 16 support,"
+announce SOUND_SB - "100% Sound Blaster compatibles (SB16/32/64, ESS, Jazz16) support"
+clean_blob sound/oss/sb_common.c
+clean_kconfig sound/oss/Kconfig 'SOUND_PAS'
+clean_kconfig sound/oss/Kconfig 'SOUND_SB'
+clean_mk CONFIG_SOUND_PAS sound/oss/Makefile
+clean_mk CONFIG_SOUND_SB sound/oss/Makefile
+
+announce SOUND_PSS - "PSS (AD1848, ADSP-2115, ESC614) support"
+clean_sed 's,^\( [*] .*synth"\)\.$,\1/*.,' sound/oss/pss.c 'avoid nested comments'
+clean_blob sound/oss/pss.c
+clean_kconfig sound/oss/Kconfig 'SOUND_PSS'
+clean_sed '
+/^config PSS_BOOT_FILE$/, /^config / {
+ /^ default.*dsp001\.ld/ s,".*","/*(DEBLOBBED)*/",;
+}' sound/oss/Kconfig 'removed default firmware'
+clean_mk CONFIG_SOUND_PSS sound/oss/Makefile
+
+announce SND_USB_6FIRE - "TerraTec DMX 6Fire USB"
+reject_firmware sound/usb/6fire/firmware.c
+clean_blob sound/usb/6fire/firmware.c
+clean_kconfig sound/usb/Kconfig 'SND_USB_6FIRE'
+clean_mk 'CONFIG_SND_USB_6FIRE' sound/usb/6fire/Makefile
+
+#################
+# Documentation #
+#################
+
+announce Documentation - "non-Free firmware scripts and documentation"
+clean_blob Documentation/dvb/avermedia.txt
+clean_blob Documentation/dvb/opera-firmware.txt
+clean_blob Documentation/sound/alsa/ALSA-Configuration.txt
+clean_blob Documentation/sound/oss/MultiSound
+clean_blob Documentation/sound/oss/PSS
+clean_blob Documentation/sound/oss/PSS-updates
+clean_blob Documentation/sound/oss/README.OSS
+clean_file Documentation/dvb/get_dvb_firmware
+clean_file Documentation/video4linux/extract_xc3028.pl
+clean_sed s,usb8388,whatever,g drivers/base/Kconfig 'removed blob name'
+clean_blob firmware/README.AddingFirmware
+clean_blob firmware/WHENCE
+
+if $errors; then
+ echo errors above were ignored because of --force >&2
+fi
+
+exit 0
diff --git a/freed-ora/current/master/deblob-check b/freed-ora/current/master/deblob-check
index 5c2d8454d..dc4d5e3ca 100755
--- a/freed-ora/current/master/deblob-check
+++ b/freed-ora/current/master/deblob-check
@@ -1,6 +1,6 @@
#! /bin/sh
-# deblob-check version 2012-03-19
+# deblob-check version 2012-05-16
# Inspired in gNewSense's find-firmware script.
# Written by Alexandre Oliva <lxoliva@fsfla.org>
@@ -1095,7 +1095,7 @@ set_except () {
initnc 'static[ ]crb_128M_2M_block_map_t[ ]crb_128M_2M_map\[64\][ ]=' drivers/net/netxen/netxen_hw.c
initnc 'static[ ]const[ ]__u16[ ]crc10_table\[256\][ ]=' drivers/usb/serial/safe_serial.c
accept '[ ]*\([ ]*0\)*\([ ]*1\)*[\n][ ]*0[ ]1[ ]2[ ]3[ ]4[ ]5[ ]6[ ]7[ ]8[ ]9[ ]0[ ]1[ ]*2[ ]3[ ]4[ ]5[ ]6[ ]7' Documentation/bt8xxgpio.txt
- initnc '[ ]static[ ]int[ ]exp_lut\[256\][ ]=' drivers/isdn/mISDN/dsp_audio.c
+ defsnc '[ ]static[ ]int[ ]exp_lut\[256\][ ]=' drivers/isdn/mISDN/dsp_audio.c
initnc 'static[ ]const[ ]u32[ ]bf_pbox\[16[ ][+][ ]2\][ ]=' drivers/isdn/mISDN/dsp_blowfish.c
initnc 'static[ ]const[ ]u32[ ]bf_sbox\[256[ ][*][ ]4\][ ]=' drivers/isdn/mISDN/dsp_blowfish.c
initnc 'static[ ]u8[ ]sample_\(german_\(all\|old\)\|american_\(dialtone\|ringing\|busy\)\|special[123]\|silence\)\[\][ ]=' drivers/isdn/mISDN/dsp_tones.c
@@ -1145,7 +1145,7 @@ set_except () {
accept '[ ]-[ ]move[ ]firmware[ ]loading[ ]to[ ]request_firmware[(][)]' drivers/staging/slicoss/README
accept 'config[ ]FIRMWARE_IN_KERNEL.*let[ ]firmware[ ]be[ ]loaded[ ]from[ ]userspace\.' drivers/base/Kconfig
accept '[ ]*and[ ]request_firmware[(][)][ ]in[ ]the[ ]source' drivers/base/Kconfig
- accept '\(static[ ]int[\n ]\)\?_request_firmware[(]const[ ]struct[ ]firmware[ ][*][*]firmware_p,[^{]*[\n][{]\([\n]\+[^\n}][^\n]*\)*[^\n]*[\n]\+[}][\n]' drivers/base/firmware_class.c
+ accept '\(static[ ]\(int\|void\)[\n ]\)\?_request_firmware\(_prepare\|_cleanup\)\?[(]const[ ]struct[ ]firmware[ ][*][*]\?firmware\(_p\)\?[,)][^{]*[\n][{]\([\n]\+[^\n}][^\n]*\)*[^\n]*[\n]\+[}][\n]' drivers/base/firmware_class.c
accept 'static[ ]int[\n ]request_firmware_work_func[(]void[ ][*]arg[)][\n][{]\([\n]\+[^\n}][^\n]*\)*ret[ ]=[ ]_request_firmware[(][^\n]*\([\n]\+[^\n}][^\n]*\)*[\n]\+[}][\n]' drivers/base/firmware_class.c
accept '[/][*][*][\n][ ][*][ ]request_firmware:[ ]-[ ]send[ ]firmware[ ][^{]*[\n][{]\([\n]\+[^\n}][^\n]*\)*[^\n]*[\n]\+[}][\n]' drivers/base/firmware_class.c
accept '[/][*][*][\n][ ][*][ ]request_firmware_nowait\(:\|[ ]-\)[ ]asynchronous[ ]version[^{]*[\n][{]\([\n]\+[^\n}][^\n]*\)*[^\n]*[\n]\+[}][\n]' drivers/base/firmware_class.c
@@ -1860,7 +1860,7 @@ set_except () {
defsnc 'static[ ]xtalk_dline_t[ ]const[ ]alXtalkDline\(Test\|Zeros\)[ ]=' sound/pci/au88x0/au88x0_xtalk.c
initnc 'static[ ]struct[ ]nand_ecclayout[ ]rtc_from4_nand_oobinfo[ ]=[ ][{]'
initnc 'static[ ]const[ ]s16[ ]tempLUT\[\][ ]='
- initnc 'static[ ]const[ ]u8[ ]viaLUT\[\][ ]='
+ defsnc 'static[ ]const[ ]u8[ ]viaLUT\[\][ ]=' drivers/hwmon/via686a.c
initnc 'static[ ]struct[ ][{][ ]int[ ]xres,[ ]yres,[ ]left,[ ]right,[ ]upper,[ ]lower,[ ]hslen,[ ]vslen,[ ]vfreq[;][ ][}][ ]timmings\[\][ ]__initdata[ ]=[ ][{]'
initnc 'static[ ]struct[ ]platinum_regvals[ ]platinum_reg_init_[0-9]*[ ]=[ ][{]'
initnc '[}][ ]sisfb_ddc[sf]modes\[\][ ]__devinitdata[ ]='
@@ -1908,8 +1908,8 @@ set_except () {
initnc '[ ]static[ ]unsigned[ ]char[ ]log_scale\[101\][ ]=' sound/oss/pss.c
initnc '[ ]static[ ]unsigned[ ]char[ ]msg\[\][ ]='
initnc '[ ]static[ ]unsigned[ ]char[ ]static_pad\[\][ ]='
- initnc '[ ]static[ ]unsigned[ ]char[ ]table_alaw2ulaw\[\][ ]='
- initnc '[ ]static[ ]unsigned[ ]char[ ]table_ulaw2alaw\[\][ ]='
+ defsnc '[ ]static[ ]unsigned[ ]char[ ]table_alaw2ulaw\[\][ ]=' drivers/staging/telephony/ixj.c
+ defsnc '[ ]static[ ]unsigned[ ]char[ ]table_ulaw2alaw\[\][ ]=' drivers/staging/telephony/ixj.c
defsnc '[ ]\(static[ ]const[ ]\)\?u32[ ]reg_boundaries\[\][ ]=' drivers/net/bnx2.c
initnc '[ ]u8[ ]b\[\][ ]='
initnc '[ ]uint8_t[ ]tx\[\][ ]='
@@ -1948,7 +1948,7 @@ set_except () {
initnc 'static[ ]__const__[ ]__u16[ ]gx_coeff\[256\][ ]='
initnc 'static[ ]__u8[ ]init7121ntsc\[\][ ]='
initnc 'static[ ]__u8[ ]init7121pal\[\][ ]='
- initnc 'static[ ]byte[ ]capidtmf_leading_zeroes_table\[0x100\][ ]='
+ defsnc 'static[ ]byte[ ]capidtmf_leading_zeroes_table\[0x100\][ ]=' drivers/isdn/hardware/eicon/capidtmf.c
defsnc 'static[ ]char[ ]channel_map_madi_[sdq]s\[HDSPM_MAX_CHANNELS\][ ]=' sound/pci/rme9652/hdspm.c
initnc 'static[ ]char[ ]coefficients\[NM_TOTAL_COEFF_COUNT[ ][*][ ]4\][ ]='
initnc 'static[ ]char[ ]ecc_syndrome_table\[\][ ]='
@@ -2000,7 +2000,7 @@ set_except () {
defsnc 'static[ ]const[ ]u32[ ]camellia_sp1110\[256\][ ]=' crypto/camellia.c
defsnc 'static[ ]const[ ]u32[ ]camellia_sp3033\[256\][ ]=' crypto/camellia.c
defsnc 'static[ ]const[ ]u32[ ]camellia_sp4404\[256\][ ]=' crypto/camellia.c
- initnc 'static[ ]const[ ]u32[ ]crc32c_table\[256\][ ]='
+ defsnc 'static[ ]const[ ]u32[ ]crc32c_table\[256\][ ]=' crypto/crc32c.c
initnc 'static[ ]const[ ]u32[ ]db_table\[101\][ ]='
initnc 'static[ ]const[ ]u32[ ]m8xx_size_to_gray\[M8XX_SIZES_NO\][ ]='
initnc 'static[ ]const[ ]u32[ ]mds\[4\]\[256\][ ]='
@@ -2031,7 +2031,7 @@ set_except () {
defsnc 'static[ ]const[ ]unsigned[ ]char[ ]__\(cpu\)\?initdata[ ]mV_mobilevrm\[32\][ ]=' arch/x86/kernel/cpu/cpufreq/longhaul.h
defsnc 'static[ ]const[ ]unsigned[ ]char[ ]__\(cpu\)\?initdata[ ]mV_vrm85\[32\][ ]=' arch/x86/kernel/cpu/cpufreq/longhaul.h
initnc 'static[ ]const[ ]unsigned[ ]char[ ]barco_p1\[2\]\[9\]\[7\]\[3\][ ]='
- initnc 'static[ ]const[ ]unsigned[ ]char[ ]bitcounts\[256\][ ]='
+ defsnc 'static[ ]const[ ]unsigned[ ]char[ ]bitcounts\[256\][ ]=' drivers/isdn/gigaset/isocdata.c
initnc 'static[ ]const[ ]unsigned[ ]char[ ]blue\[256\][ ]='
initnc 'static[ ]const[ ]unsigned[ ]char[ ]chktab[hl]\[256\][ ]='
initnc 'static[ ]const[ ]unsigned[ ]char[ ]comet_miireg2offset\[32\][ ]='
@@ -2625,7 +2625,7 @@ set_except () {
defsnc '\(static[ ]const[ ]\)\?u16[ \n]*LCNPHY_txdigfiltcoeffs_\(cck\|ofdm\)\[LCNPHY_NUM_TX_DIG_FILTERS_\(CCK\|OFDM\)\][\n ]*\[LCNPHY_NUM_DIG_FILT_COEFFS[ ][+][ ]1\][ ]=' 'drivers/\(staging\|net/wireless\)/brcm80211/brcmsmac/phy/phy_lcn\.c'
defsnc '\(static[ ]const[ ]\)\?nphy_ipa_txrxgain_t[ ]nphy_ipa_rxcal_gaintbl_2GHz\(_rev7\)\?\[\][ ]=' 'drivers/\(staging\|net/wireless\)/brcm80211/\(phy/wlc_phy_n\.c\|brcmsmac/phy/phy_n\.c\)'
defsnc 'static[ ]\(const[ ]\)\?chan_info_nphy_\(radio\)\?205[5x7]\(_rev5\)\?_t[ ]chan_info_nphy\(rev[3-9]\(n6\)\?\)\?_205[5-7]\(_A1\|v\([5-8]\|11\)\|_rev[4-8]\(v1\)\?\)\?\[\][ ]=' 'drivers/\(staging\|net/wireless\)/brcm80211/\(phy/wlc_phy_n\.c\|brcmsmac/phy/phy_n\.c\)'
- defsnc '\(static[ ]\)radio_\(20xx_\)\?regs_t[ ]regs_\(SYN_\|[RT]X_\)\?205[5-7]\(_A1\|_rev\([4-8]\|11\)\(v1\)\?\)\?\[\][ ]=' 'drivers/\(staging\|net/wireless\)/brcm80211/\(phy/wlc_phy_n\.c\|brcmsmac/phy/phy_n\.c\)'
+ defsnc '\(static[ ]\)\?radio_\(20xx_\)\?regs_t[ ]regs_\(SYN_\|[RT]X_\)\?205[5-7]\(_A1\|_rev\([4-8]\|11\)\(v1\)\?\)\?\[\][ ]=' 'drivers/\(staging\|net/wireless\)/brcm80211/\(phy/wlc_phy_n\.c\|brcmsmac/phy/phy_n\.c\)'
defsnc 'static[ ]const[ ]u16[ ]tbl_iqcal_gainparams_nphy\[2\]\[NPHY_IQCAL_NUMGAINS\]\[8\][ ]=' 'drivers/\(staging\|net/wireless\)/brcm80211/\(phy/wlc_phy_n\.c\|brcmsmac/phy/phy_n\.c\)'
defsnc 'static[ ]\(const[ ]\)\?u32[ ]nphy_tpc_\(5GHz_\)\?txgain\(_[ei]pa\)\?\(\(_[25]g\)\?\(_\(2057\)\?\(rev\([3-7]\|4n6\)\?\)\?\)\?\|_HiPwrEPA\)\?\[\][ ]=' 'drivers/\(staging\|net/wireless\)/brcm80211/\(phy/wlc_phy_n\.c\|brcmsmac/phy/phy_n\.c\)'
defsnc 'static[ ]const[ ]u16[ ]nphy_tpc_loscale\[\][ ]=' 'drivers/\(staging\|net/wireless\)/brcm80211/\(phy/wlc_phy_n\.c\|brcmsmac/phy/phy_n\.c\)'
@@ -2697,7 +2697,7 @@ set_except () {
accept '[*][ ]*0[ ]1[ ]2[ ]3[ ]4[ ]5[ ]6[ ]7[ ]8[ ]9[ ]0[ ]1[ ]2[ ]3[ ]4[ ]5[ ]6[ ]7[ ]8[ ]9[ ]0[ ]1[ ]2[ ]3[ ]4[ ]5[ ]6[ ]7[ ]8[ ]9[ ]0[ ]1' arch/x86/crypto/aesni-intel_asm.S
defsnc 'static[ ]struct[ ]aead_testvec[ ]\(aes_gcm_rfc4106\)_\(enc\|dec\)_tv_template\[\][ ]=' 'crypto/testmgr.h'
blobname '\(sep[/]\)\?\extapp\.image\.bin' drivers/staging/sep/sep_driver.c
- blobname 'radeon[/]\(BARTS\|BTC\|TURKS\|CAICOS\|%s\)_\(pfp\|rlc\|m[ec]\)\.bin' drivers/gpu/drm/radeon/ni.c
+ blobname 'radeon[/]\(BARTS\|BTC\|TURKS\|CAICOS\|%s\)_\(pfp\|rlc\|[mc][ec]\)\.bin' 'drivers/gpu/drm/radeon/[ns]i\.c'
defsnc 'static[ ]const[ ]u32[ ]\(barts\|turks\|caicos\)_io_mc_regs\[BTC_IO_MC_REGS_SIZE\]\[2\][ ]=' drivers/gpu/drm/radeon/ni.c
defsnc 'static[ ]int[ ]types\[0x80\][ ]=' drivers/gpu/drm/nouveau/nv50_vram.c
blobname '\(nouveau[/]\)\?fuc4\(09\|1a\)[cd]' drivers/gpu/drm/nouveau/nvc0_graph.c
@@ -2778,7 +2778,7 @@ set_except () {
defsnc 'u32[ ]\(RTL\|Rtl\)8192CU\(PHY_REG\|_\?\(RADIO\|Radio\)[AB]\|MAC\|AGCTAB\)_\([21]T\(_HP\)\?_\?\(ARRAY\|Array\)\|\(ARRAY\|Array\)_PG\)\(_HP\)\?\[RTL8192CU\(PHY_REG\|\(RADIO\|Radio\)[AB]\|MAC\|AGCTAB\)_\([21]T\(_HP\)\?_\?\(ARRAY\|Array\)_\?\|\(ARRAY\|Array\)_PG\)\(_HP\)\?\(LENGTH\|Length\)\][ ]=' drivers/net/wireless/rtlwifi/rtl8192cu/table.c
blobname 'rtl_nic[/]rtl8105e-1\.fw' drivers/net/r8169.c
defsnc 'static[ ]const[ ]\(A_INT32\|s32\)[ ]wmi_rateTable\[\]\[2\][ ]=' drivers/staging/ath6kl/wmi/wmi.c
- defsnc '\(static[ ]\)\?const[ ]struct[ ]\(stk1160\|saa7113\)config[ ]\([{][^}]*[}][ ]\)\?\(stk1160\|saa7113\)config\(PAL\|NTSC\)\[\(256\)\?\][ ]=' drivers/staging/easycap/easycap_low.c
+ defsnc '\(static[ ]\)\?const[ ]struct[ ]\(stk1160\|saa7113\)config[ ]\([{][^}]*[}][ ]\)\?\(stk1160\|saa7113\)config\(PAL\|NTSC\)\?\[\(256\)\?\][ ]=' drivers/staging/easycap/easycap_low.c
defsnc 'static[ ]const[ ]ccktxbbgain_struct[ ]rtl8192_cck_txbbgain_\(ch14_\)\?table\[\][ ]=' drivers/staging/rtl8192e/r8192E_dm.c
defsnc '[ ]unsigned[ ]char[ ]data_ptr\[36\][ ]=' drivers/usb/storage/ene_ub6250.c
blobname 'ene-ub6250[/]sd_\(init[12]\|rdwr\)\.bin' drivers/usb/storage/ene_ub6250.c
@@ -2807,7 +2807,7 @@ set_except () {
accept '[ ]struct[ ]nvc0_graph_fuc[ ]fuc4\(09\|1a\)[cd]' drivers/gpu/drm/nouveau/nvc0_graph.h
defsnc 'static[ ]const[ ]u8[ ]sht15_crc8_table\[\][ ]=' drivers/hwmon/sht15.c
defsnc 'static[ ]u8[ ]stv0288_bsbe1_d01a_inittab\[\][ ]=' drivers/media/dvb/frontends/bsbe1-d01a.h
- defsnc '[ ]struct[ ]reg_val_mask[ ]tab\[\][ ]=' 'drivers/media/dvb/frontends/cxd2820r_\(c\|t2\)\.c'
+ defsnc '[ ]struct[ ]reg_val_mask[ ]tab\[\][ ]=' 'drivers/media/dvb/frontends/\(cxd2820r_\(c\|t2\)\|af9033\)\.c'
blobname 'drxd-a2-1\.1\.fw' drivers/media/dvb/frontends/drxd_hard.c
blobname 'drxd-b1-1\.1\.fw' drivers/media/dvb/frontends/drxd_hard.c
blob '[/][*][ ]if[ ][(]\(reject\|request\)_firmware[(][&]state->fw[,][ ]["]drxd\.fw["][,][ ]state->dev[)]<0[)][ ][*][/]'
@@ -2856,7 +2856,7 @@ set_except () {
accept '[ ][ ]*\(if[ ][(]\|[ ][ ][ ][ ]\)nvc0_graph_create_fw[(]dev[,][ ]["]fuc4\(09\|1a\)[cd]["][,][ ][&]priv->fuc4\(09\|1a\)[cd][)]' drivers/gpu/drm/nouveau/nvc0_graph.c
blobname 'nouveau[/]\(nv%02x_\)\?%s' drivers/gpu/drm/nouveau/nvc0_graph.c
blobname 'radeon[/]SUMO2\?_\(pfp\|me\)\.bin' drivers/gpu/drm/radeon/r600.c
- blobname 'iwlwifi-\(105\|20[03]0\)-' drivers/net/iwlwifi/iwl-2000.c
+ blobname 'iwlwifi-\(105\|20[03]\?0\)-' drivers/net/iwlwifi/iwl-2000.c
blobname '__stringify[(]api[)][ ]["]\.ucode["]' 'drivers/net/iwlwifi/iwl-\(3945.h\|\(4965\|[1256]000\)\.c\)'
# New in 3.1
blobname 'sdma-imx25\.bin' arch/arm/mach-imx/mm-imx25.c
@@ -2887,7 +2887,7 @@ set_except () {
defsnc '[ ]u8[ ]channel_\(5g\|all\|info\)\[\(45\|59\)\][ ]=' drivers/net/wireless/rtlwifi/rtl8192de/phy.c
blobname 'rtlwifi[/]rtl8192defw[.]bin' drivers/net/wireless/rtlwifi/rtl8192de/sw.c
defsnc 'u32[ ]rtl8192de_\(phy_reg\|radio[ab]\|mac\|agctab\)_\(\(2t\(_int_pa\)\?\|[25]g\)\?array\|array_pg\)\[\(PHY_REG\|RADIO[AB]\|MAC\|AGCTAB\)_\(\(2T\(_INT_PA\)\?_\|[25]G_\)\?ARRAY\|ARRAY_PG_\)LENGTH\][ ]=' drivers/net/wireless/rtlwifi/rtl8192de/table.c
- defsnc 'static[ ]\(const[ ]\)struct[ ]chan_info_basic[ ]chan_info_all\[\][ ]=' 'drivers/\(staging\|net/wireless\)/brcm80211/brcmsmac/phy/phy_cmn\.c'
+ defsnc 'static[ ]\(const[ ]\)\?struct[ ]chan_info_basic[ ]chan_info_all\[\][ ]=' 'drivers/\(staging\|net/wireless\)/brcm80211/brcmsmac/phy/phy_cmn\.c'
defsnc 'struct[ ]lcnphy_rx_iqcomp[ ]lcnphy_rx_iqcomp_table_rev0\[\][ ]=' 'drivers/\(staging\|net/wireless\)/brcm80211/brcmsmac/phy/phy_lcn\.c'
defsnc 'static[ ]\(const[ ]\)\?struct[ ]chan_info_2064_lcnphy[ ]chan_info_2064_lcnphy\[\][ ]=' 'drivers/\(staging\|net/wireless\)/brcm80211/brcmsmac/phy/phy_lcn\.c'
defsnc '\(static[ ]const[ ]\)\?struct[ ]lcnphy_radio_regs[ ]lcnphy_radio_regs_2064\[\][ ]=' 'drivers/\(staging\|net/wireless\)/brcm80211/brcmsmac/phy/phy_lcn\.c'
@@ -3002,17 +3002,215 @@ set_except () {
accept '[ ]*props->firmware[ ]=[ ]fw_it913\(5_v[12]\|7\)' drivers/media/dvb/dvb-usb/it913x.c
blobname 'dvb-usb-hauppauge-hvr930c-drxk\.fw' drivers/media/video/em28xx/em28xx-dvb.c
blobname 'brcm[/]brcmfmac\.\(bin\|txt\)' drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
+
+ # New in 3.4
+ blobname 'dvb-fe-xc5000-1\.6\.114\.fw' drivers/media/common/tuners/xc5000.c
+ blobname 'dvb-fe-xc5000c-41\.024\.5\.fw' drivers/media/common/tuners/xc5000.c
+ accept '[ ]*nvidia,emc-registers[ ]=[ ]<[ ]\(0[ \n]*\)*>' Documentation/devicetree/bindings/arm/tegra/emc.txt
+ defsnc '[ ]*interrupts[ ]=[ ]<[ ]\(0[ ]1[345][0-9][ ]0x04[ \n]*\)*>[;]' Documentation/devicetree/bindings/dma/tegra20-apbdma.txt
+ accept '[ ]*nvidia,emc-registers[ ]=[ ]<[ ]\(0x[0-9a-f]*[ \n]*\)*>' arch/arm/boot/dts/tegra-seaboard.dts
+ defsnc '[ ]*interrupts[ ]=[ ]<[ ]\(0[ ]1[0-4][0-9][ ]0x04[ \n]*\)*>[;]' 'arch/arm/boot/dts/tegra[23]0\.dtsi'
+ defsnc 'static[ ]struct[ ]clk_pll_freq_table[ ]tegra_pll_[cu]_freq_table\[\][ ]=' arch/arm/mach-tegra/tegra30_clocks.c
+ defsnc '[ ]static[ ]const[ ]u8[ ]snum_init_[74]6\[\][ ]=' arch/powerpc/sysdev/qe_lib/qe.c
+ defsnc 'const[ ]u64[ ]camellia_sp\(10011110\|22000222\|03303033\|00444404\|02220222\|30333033\|44044404\|11101110\)\[256\][ ]=' arch/x86/crypto/camellia_glue.c
+ accept 'static[ ]int[ ]_request_firmware_load[(]struct[ ]firmware_priv[ ][*]fw_priv[,]' drivers/base/firmware_class.c
+ accept 'static[ ]void[ ]request_firmware_work_func[(]struct[ ]work_struct[ ][*]work[)]' drivers/base/firmware_class.c
+ accept '[ ]fw_priv[ ]=[ ]_request_firmware_prepare[(][&]fw[,]' drivers/base/firmware_class.c
+ accept '[ ][ ]ret[ ]=[ ]_request_firmware_load[(]fw_priv[,]' drivers/base/firmware_class.c
+ accept '[ ][ ]_request_firmware_cleanup[(][&]fw[)][;]' drivers/base/firmware_class.c
+ defsnc 'static[ ]const[ ]u32[ ]\(tahiti\|pitcairn\|verde\)_io_mc_regs\[TAHITI_IO_MC_REGS_SIZE\]\[2\][ ]=' drivers/gpu/drm/drm/radeon/si.c
+ defsnc 'static[ ]const[ ]char[ ]fake_edid_info\[\][ ]=' drivers/gpu/drm/exynos/exynos_drm_vidi.c
+ defsnc 'static[ ]const[ ]u8[ ]hdmiphy_v13_conf\(27\(_027\)\?\|74_\(175\|25\)\|148_5\)\[32\][ ]=' drivers/gpu/drm/exynos/exynos_hdmi.c
+ defsnc 'static[ ]char[ ][*]generic_edid_name\[GENERIC_EDIDS\][ ]=' drivers/gpu/drm/drm_edid_load.c
+ defsnc 'static[ ]u8[ ]generic_edid\[GENERIC_EDIDS\]\[128\][ ]=' drivers/gpu/drm/drm_edid_load.c
+ defsnc 'static[ ]int[ ]edid_load[(][^)]*[)][\n][{]\([\n]\+[^\n}][^\n]*\)*[^\n]*err[ ]=[ ]request_firmware[(][&]fw[,][ ]name[,][ ][&]pdev' drivers/gpu/drm/drm_edid_load.c
+ blobname 'dvb-usb-terratec-h7-\(drxk\|az6007\)\.fw' drivers/media/dvb/dvb-usb/az6007.c
+ accept 'static[ ]struct[ ]dvb_usb_device_properties[ ]az6007_properties[ ]=[ ][{][\n]\([ ]\.\(caps\|usb_ctrl\)[ ]*=[ ][^",]*,[\n]*\)*[ ]\.firmware[ ]*=[ ]' drivers/media/dvb/dvb-usb/gp8psk.c
+ blobname 'dvb-usb-lme2510c-rs2000\.fw' drivers/media/dvb/dvb-usb/lmedm04.c
+ defsnc '[ ]struct[ ]rtl2830_reg_val_mask[ ]tab\[\][ ]=' drivers/media/dvb/frontends/rtl2830.c
+ defsnc '[ ]static[ ]u8[ ]bw_params1\[3\]\[34\][ ]=' drivers/media/dvb/frontends/rtl2830.c
+ blobname 'dvb-demod-drxk-pctv\.fw' drivers/media/video/em28xx/em28xx-dvb.c
+ defsnc 'static[ ]const[ ]u8[ ]\(start\|page3\)_7302\[\][ ]=' drivers/media/video/gspca/pac7302.c
+ defsnc 'static[ ]const[ ]u16[ ]vs6624_p1\[\][ ]=' drivers/media/video/vs6624.c
+ defsnc 'static[ ]struct[ ]nand_ecclayout[ ]oob_\(2048\|4096\)_ecc[48][ ]=' drivers/mtd/nand/fsl_ifc_nand.c
+ defsnc 'static[ ]struct[ ]nand_ecclayout[ ]fsmc_ecc4_\(256\|224\|128\|64\)_layout[ ]=' drivers/mtd/nand/fsmc_nand.c
+ defsnc '[ ]static[ ]const[ ]u8[ ]dhcp_\(pattern\|mask\)\[\][ ]=' drivers/net/wireless/ath/ath6kl/cfg80211.c
+ blobname 'fw-[23]\.bin' drivers/netwireless/ath/ath6kl/core.h
+ blobname '\(fw\.ram\|otp\|ath\(wlan\|tcmd_ram\)\|utf\|nullTestFlow\|data\.patch\|bdata\(\.SD31\)\?\)\.bin\(\.z77\)\?' drivers/net/wireless/ath/ath6kl/core.h
+ accept '[ ]hif_dev->firmware[ ]=[ ]fw[;]' drivers/net/wireless/ath/ath9k/hif_usb.c
+ defsnc 'static[ ]const[ ]u32[ ]b43_ntab_tx_gain_rev\(0_1_2\|3plus_2ghz\|[34]_5ghz\|5plus_5ghz\)\[\][ ]=' drivers/net/wireless/b43/tables_nphy.c
+ defsnc 'static[ ]const[ ]u32[ ]txpwrctrl_tx_gain_ipa\(\|_rev[56]\|_5g\)\[\][ ]=' drivers/net/wireless/b43/tables_nphy.c
+ blobname 'brcm[/]brcmfmac-sdio\.bin' drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
+ blobname 'brcm[/]brcmfmac43236b\.bin' drivers/net/wireless/brcm80211/brcmfmac/usb.c
+ blobname 'ti-connectivity[/]wl12[78]x-fw-4-\([ms]r\|plt\)\.bin' drivers/net/wireless/wl12xx/wl12xx.h
+ blobname 'TINfcInit_%d\.%d\.%d\.%d\.bts' drivers/nfc/nfcwilink.c
+ defsnc 'static[ ]int[ ]ab8500_\(charger\|fg_lowbat\)_voltage_map\[\][ ]=' drivers/power/ab8500_charger.c
+ defsnc '[ ]static[ ]const[ ]u8[ ]parity\[\][ ]=' drivers/staging/sep/sep_crypto.c
+ defsnc 'static[ ]struct[ ]SiS_MCLKData[ ]XGI\(340\|27\)New_MCLKData\[\][ ]=' drivers/staging/xgifb/vb_table.h
+ defsnc 'static[ ]struct[ ]SiS_StandTable_S[ ]XGI330_StandTable\[\][ ]=' drivers/staging/xgifb/vb_table.h
+ defsnc 'static[ ]struct[ ]SiS_ModeResInfo_S[ ]XGI330_ModeResInfo\[\][ ]=' drivers/staging/xgifb/vb_table.h
+ defsnc 'static[ ]const[ ]u8[ ]dim_table\[101\][ ]=' drivers/video/backlight/ot200_bl.c
+ defsnc '[ ]static[ ]const[ ]unsigned[ ]char[ ]data_to_send\[\][ ]=' drivers/video/exynos/s6e8ax0.c
+ accept '[ ]ret[ ]=[ ]request_firmware\([(][&]firmware_p[,][ ]rproc->firmware[,][ ]dev[)]\|_nowait[(]THIS_MODULE[,][ ]FW_ACTION_HOTPLUG[,][\n][ ]*rproc->firmware[,][ ]dev[,][ ]GFP_KERNEL[,][\n][ ]*rproc[,][ ]rproc_fw_config_virtio[)]\)[;][\n][ ]if[ ][(]ret[ ]<[ ]0[)][ ][{][\n][ ][ ]dev_err[(]dev[,][ ]["]request_firmware\(_nowait\)\?[ ]failed' drivers/remoteproc/remoteproc_core.c
+ accept '[ ]rproc->firmware[ ][=][ ]firmware[;]' drivers/remoteproc/remoteproc_core.c
+ blobname 'ql\(2600\|8300\)_fw\.bin' drivers/scsi/qla2xxx/qla_os.c
+ defsnc 'static[ ]u8[ ]__attribute__[(][(]__aligned__[(]8[)][)][)][ ]test_buf\[\][ ]=' lib/crc32.c
+ defsnc '[}][ ]test\[\][ ]=' lib/crc32.c
+ defsnc 'static[ ]struct[ ]reg_default[ ]da7210_reg_defaults\[\][ ]=' sound/soc/codecs/da7210.c
+ defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]wm2200_reva_patch\[\][ ]=' sound/soc/codecs/wm2200.c
+ defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]wm8753_reg_defaults\[\][ ]=' sound/soc/codecs/wm8753.c
+ defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]wm8978_reg_defaults\[\][ ]=' sound/soc/codecs/wm8978.c
+ defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]wm8988_reg_defaults\[\][ ]=' sound/soc/codecs/wm8988.c
;;
*/*freedo*.patch | */*logo*.patch)
accept 'P[13]\([\n]#[^\n]*\)*[\n]*\([\n][0-9 ]*\)\+' drivers/video/logo/logo_libre_clut224.ppm
;;
+ */patch-3.3*gnu*)
+ # These patterns are *way* too broad for general use, but they're fine
+ # for patches between deblob-checked releases.
+ accept 'static[ ]\(int\|void\)[ ]_request_firmware' drivers/base/firmware_class.c
+ accept 'request_firmware[(]const' drivers/base/firmware_class.c
+ accept '[ ]*ret[ ]=[ ]_request_firmware' drivers/base/firmware_class.c
+ accept '[ ]*_request_firmware_cleanup' drivers/base/firmware_class.c
+ accept '[ ]INIT_WORK[(][&]fw_work->work[,][ ]request_firmware_work_func[)][;]' drivers/base/firmware_class.c
+ accept '[ ]0x43[,][ ]11[,][ ]0x00[,][0-9xa-f, \n]*' drivers/media/video/gspca/pac7302.c
+ accept '\([ ][{][ ]0x[12][02][,][ ]0x[0-9a-f][0-9a-f][,][ ]0x[0-9a-f][0-9a-f][ ][}][,][\n]\?\)\+[ ][{][ ]0[ ][}][ ][/][*][ ]TERMINATING[ ]ENTRY[ ][*][/]' sound/usb/6fire/control.c
+ # Some of the above were present before, but not covered by these
+ # specific patterns.
+ defsnc 'static[ ]u32[ ]epll_div\[\]\[6\][ ]=' arch/arm/mach-s5pv210/clock.c
+ defsnc 'static[ ]struct[ ]clk_pll_\(freq_\)\?table[ ]tegra_pll_[adpxm]_\(freq_\)\?table\[\][ ]=' arch/arm/mach-tegra/tegra2_clocks.c
+ defsnc '\(static[ ]\)\?unsigned[ ]char[ ]\(__attribute__[ ][(][(]aligned[(]16[)][)][)][ ]\)\?bootlogo_bits\[\][ ]=' arch/m68k/platform/68328/bootlogo.h
+ accept '[ ][ ]ranges[ ]=[ ]<'"$blobpat*"'>[;]' 'arch/powerpc/boot/dts/\(mpc8572ds\|p2020ds\|katmai\)\.dts'
+ defsnc 'static[ ]const[ ]u32[ ]camellia_sp0222\[256\][ ]=' crypto/camellia.c
+ defsnc 'static[ ]const[ ]u32[ ]camellia_sp1110\[256\][ ]=' crypto/camellia.c
+ defsnc 'static[ ]const[ ]u32[ ]camellia_sp3033\[256\][ ]=' crypto/camellia.c
+ defsnc 'static[ ]const[ ]u32[ ]camellia_sp4404\[256\][ ]=' crypto/camellia.c
+ defsnc 'static[ ]struct[ ]cipher_testvec[ ]\(aes\|anubis\|bf\|camellia\|cts_mode\|des3_ede\|cast6\|salsa20_stream\|serpent\|tf\|tnepres\|xeta\|x\?tea\)\(_\(cbc\|ctr\(_rfc3686\)\?\|xts\)\)\?_\(enc\|dec\)_tv_template\[\][ ]=' 'crypto/\(tcrypt\|testmgr\).h'
+ accept '\(static[ ]\(int\|void\)[\n ]\)\?_request_firmware\(_prepare\|_cleanup\)\?[(]const[ ]struct[ ]firmware[ ][*][*]\?firmware\(_p\)\?[,)][^{]*[\n][{]\([\n]\+[^\n}][^\n]*\)*[^\n]*[\n]\+[}][\n]' drivers/base/firmware_class.c
+ accept '[ ]fw_priv[ ]=[ ]_request_firmware_prepare[(]firmware_p[,]' drivers/base/firmware_class.c
+ defsnc 'static[ ]const[ ]u8[ ]hdmiphy_conf\(27\(_027\)\?\|74\(_175\|_25\)\|148_5\)\[32\][ ]=' drivers/media/video/s5p-tv/hdmiphy_drv.c
+ defsnc 'static[ ]const[ ]u8[ ]viaLUT\[\][ ]=' drivers/hwmon/via686a.c
+ defsnc 'static[ ]const[ ]u16[ ]stufftab\[5[ ][*][ ]256\][ ]=' drivers/isdn/gigaset/isocdata.c
+ defsnc 'static[ ]const[ ]unsigned[ ]char[ ]bitcounts\[256\][ ]=' drivers/isdn/gigaset/isocdata.c
+ defsnc 'static[ ]byte[ ]capidtmf_leading_zeroes_table\[0x100\][ ]=' drivers/isdn/hardware/eicon/capidtmf.c
+ defsnc '[ ]static[ ]int[ ]exp_lut\[256\][ ]=' drivers/isdn/mISDN/dsp_audio.c
+ accept '[ ]*props->firmware[ ]=[ ]fw_it913\(5_v[12]\|7\)' drivers/media/dvb/dvb-usb/it913x.c
+ defsnc '[ ][}][ ]regs\[\][ ]=' drivers/media/video/em28xx/em28xx-dvb.c
+ defsnc '[ ]static[ ]unsigned[ ]char[ ]table_alaw2ulaw\[\][ ]=' drivers/staging/telephony/ixj.c
+ defsnc '[ ]static[ ]unsigned[ ]char[ ]table_ulaw2alaw\[\][ ]=' drivers/staging/telephony/ixj.c
+ accept '[ ]INITCODESIZE[ ]=[ ]mod_firmware_load[(]INITCODEFILE,[ ][&]INITCODE[)][;]' sound/oss/msnd_pinnacle.c
+ accept '[ ]hif_dev->firmware[ ]=[ ]NULL[;]' drivers/net/wireless/ath/ath9k/hif_usb.c
+ # New in 3.4.
+ accept '[ ]*nvidia,emc-registers[ ]=[ ]<[ ]\(0[ \n]*\)*>' Documentation/devicetree/bindings/arm/tegra/emc.txt
+ defsnc '[ ]*interrupts[ ]=[ ]<[ ]\(0[ ]1[345][0-9][ ]0x04[ \n]*\)*>[;]' Documentation/devicetree/bindings/dma/tegra20-apbdma.txt
+ accept '[ ]*nvidia,emc-registers[ ]=[ ]<[ ]\(0x[0-9a-f]*[ \n]*\)*>' arch/arm/boot/dts/tegra-seaboard.dts
+ defsnc '[ ]*interrupts[ ]=[ ]<[ ]\(0[ ]1[0-4][0-9][ ]0x04[ \n]*\)*>[;]' 'arch/arm/boot/dts/tegra[23]0\.dtsi'
+ defsnc 'static[ ]struct[ ]clk_pll_freq_table[ ]tegra_pll_[cu]_freq_table\[\][ ]=' arch/arm/mach-tegra/tegra30_clocks.c
+ defsnc '[ ]static[ ]const[ ]u8[ ]snum_init_[74]6\[\][ ]=' arch/powerpc/sysdev/qe_lib/qe.c
+ defsnc 'const[ ]u64[ ]camellia_sp\(10011110\|22000222\|03303033\|00444404\|02220222\|30333033\|44044404\|11101110\)\[256\][ ]=' arch/x86/crypto/camellia_glue.c
+ accept 'static[ ]int[ ]_request_firmware_load[(]struct[ ]firmware_priv[ ][*]fw_priv[,]' drivers/base/firmware_class.c
+ accept 'static[ ]void[ ]request_firmware_work_func[(]struct[ ]work_struct[ ][*]work[)]' drivers/base/firmware_class.c
+ accept '[ ]fw_priv[ ]=[ ]_request_firmware_prepare[(][&]fw[,]' drivers/base/firmware_class.c
+ accept '[ ][ ]ret[ ]=[ ]_request_firmware_load[(]fw_priv[,]' drivers/base/firmware_class.c
+ accept '[ ][ ]_request_firmware_cleanup[(][&]fw[)][;]' drivers/base/firmware_class.c
+ defsnc 'static[ ]const[ ]u32[ ]\(tahiti\|pitcairn\|verde\)_io_mc_regs\[TAHITI_IO_MC_REGS_SIZE\]\[2\][ ]=' drivers/gpu/drm/drm/radeon/si.c
+ defsnc 'static[ ]const[ ]char[ ]fake_edid_info\[\][ ]=' drivers/gpu/drm/exynos/exynos_drm_vidi.c
+ defsnc 'static[ ]const[ ]u8[ ]hdmiphy_v13_conf\(27\(_027\)\?\|74_\(175\|25\)\|148_5\)\[32\][ ]=' drivers/gpu/drm/exynos/exynos_hdmi.c
+ defsnc 'static[ ]char[ ][*]generic_edid_name\[GENERIC_EDIDS\][ ]=' drivers/gpu/drm/drm_edid_load.c
+ defsnc 'static[ ]u8[ ]generic_edid\[GENERIC_EDIDS\]\[128\][ ]=' drivers/gpu/drm/drm_edid_load.c
+ defsnc 'static[ ]int[ ]edid_load[(][^)]*[)][\n][{]\([\n]\+[^\n}][^\n]*\)*[^\n]*err[ ]=[ ]request_firmware[(][&]fw[,][ ]name[,][ ][&]pdev' drivers/gpu/drm/drm_edid_load.c
+ blobname 'dvb-usb-terratec-h7-\(drxk\|az6007\)\.fw' drivers/media/dvb/dvb-usb/az6007.c
+ accept 'static[ ]struct[ ]dvb_usb_device_properties[ ]az6007_properties[ ]=[ ][{][\n]\([ ]\.\(caps\|usb_ctrl\)[ ]*=[ ][^",]*,[\n]*\)*[ ]\.firmware[ ]*=[ ]' drivers/media/dvb/dvb-usb/gp8psk.c
+ blobname 'dvb-usb-lme2510c-rs2000\.fw' drivers/media/dvb/dvb-usb/lmedm04.c
+ defsnc '[ ]struct[ ]rtl2830_reg_val_mask[ ]tab\[\][ ]=' drivers/media/dvb/frontends/rtl2830.c
+ defsnc '[ ]static[ ]u8[ ]bw_params1\[3\]\[34\][ ]=' drivers/media/dvb/frontends/rtl2830.c
+ blobname 'dvb-demod-drxk-pctv\.fw' drivers/media/video/em28xx/em28xx-dvb.c
+ defsnc 'static[ ]const[ ]u8[ ]\(start\|page3\)_7302\[\][ ]=' drivers/media/video/gspca/pac7302.c
+ defsnc 'static[ ]const[ ]u16[ ]vs6624_p1\[\][ ]=' drivers/media/video/vs6624.c
+ defsnc 'static[ ]struct[ ]nand_ecclayout[ ]oob_\(2048\|4096\)_ecc[48][ ]=' drivers/mtd/nand/fsl_ifc_nand.c
+ defsnc 'static[ ]struct[ ]nand_ecclayout[ ]fsmc_ecc4_\(256\|224\|128\|64\)_layout[ ]=' drivers/mtd/nand/fsmc_nand.c
+ defsnc '[ ]static[ ]const[ ]u8[ ]dhcp_\(pattern\|mask\)\[\][ ]=' drivers/net/wireless/ath/ath6kl/cfg80211.c
+ blobname 'fw-[23]\.bin' drivers/netwireless/ath/ath6kl/core.h
+ blobname '\(fw\.ram\|otp\|ath\(wlan\|tcmd_ram\)\|utf\|nullTestFlow\|data\.patch\|bdata\(\.SD31\)\?\)\.bin\(\.z77\)\?' drivers/net/wireless/ath/ath6kl/core.h
+ accept '[ ]hif_dev->firmware[ ]=[ ]fw[;]' drivers/net/wireless/ath/ath9k/hif_usb.c
+ defsnc 'static[ ]const[ ]u32[ ]b43_ntab_tx_gain_rev\(0_1_2\|3plus_2ghz\|[34]_5ghz\|5plus_5ghz\)\[\][ ]=' drivers/net/wireless/b43/tables_nphy.c
+ defsnc 'static[ ]const[ ]u32[ ]txpwrctrl_tx_gain_ipa\(\|_rev[56]\|_5g\)\[\][ ]=' drivers/net/wireless/b43/tables_nphy.c
+ blobname 'brcm[/]brcmfmac-sdio\.bin' drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
+ blobname 'brcm[/]brcmfmac43236b\.bin' drivers/net/wireless/brcm80211/brcmfmac/usb.c
+ blobname 'ti-connectivity[/]wl12[78]x-fw-4-\([ms]r\|plt\)\.bin' drivers/net/wireless/wl12xx/wl12xx.h
+ blobname 'TINfcInit_%d\.%d\.%d\.%d\.bts' drivers/nfc/nfcwilink.c
+ defsnc 'static[ ]int[ ]ab8500_\(charger\|fg_lowbat\)_voltage_map\[\][ ]=' drivers/power/ab8500_charger.c
+ defsnc '[ ]static[ ]const[ ]u8[ ]parity\[\][ ]=' drivers/staging/sep/sep_crypto.c
+ defsnc 'static[ ]struct[ ]SiS_MCLKData[ ]XGI\(340\|27\)New_MCLKData\[\][ ]=' drivers/staging/xgifb/vb_table.h
+ defsnc 'static[ ]struct[ ]SiS_StandTable_S[ ]XGI330_StandTable\[\][ ]=' drivers/staging/xgifb/vb_table.h
+ defsnc 'static[ ]struct[ ]SiS_ModeResInfo_S[ ]XGI330_ModeResInfo\[\][ ]=' drivers/staging/xgifb/vb_table.h
+ defsnc 'static[ ]const[ ]u8[ ]dim_table\[101\][ ]=' drivers/video/backlight/ot200_bl.c
+ defsnc '[ ]static[ ]const[ ]unsigned[ ]char[ ]data_to_send\[\][ ]=' drivers/video/exynos/s6e8ax0.c
+ accept '[ ]ret[ ]=[ ]request_firmware\([(][&]firmware_p[,][ ]rproc->firmware[,][ ]dev[)]\|_nowait[(]THIS_MODULE[,][ ]FW_ACTION_HOTPLUG[,][\n][ ]*rproc->firmware[,][ ]dev[,][ ]GFP_KERNEL[,][\n][ ]*rproc[,][ ]rproc_fw_config_virtio[)]\)[;][\n][ ]if[ ][(]ret[ ]<[ ]0[)][ ][{][\n][ ][ ]dev_err[(]dev[,][ ]["]request_firmware\(_nowait\)\?[ ]failed' drivers/remoteproc/remoteproc_core.c
+ accept '[ ]rproc->firmware[ ][=][ ]firmware[;]' drivers/remoteproc/remoteproc_core.c
+ blobname 'ql\(2600\|8300\)_fw\.bin' drivers/scsi/qla2xxx/qla_os.c
+ defsnc 'static[ ]u8[ ]__attribute__[(][(]__aligned__[(]8[)][)][)][ ]test_buf\[\][ ]=' lib/crc32.c
+ defsnc '[}][ ]test\[\][ ]=' lib/crc32.c
+ defsnc 'static[ ]struct[ ]reg_default[ ]da7210_reg_defaults\[\][ ]=' sound/soc/codecs/da7210.c
+ defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]wm2200_reva_patch\[\][ ]=' sound/soc/codecs/wm2200.c
+ defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]wm8753_reg_defaults\[\][ ]=' sound/soc/codecs/wm8753.c
+ defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]wm8978_reg_defaults\[\][ ]=' sound/soc/codecs/wm8978.c
+ defsnc 'static[ ]const[ ]struct[ ]reg_default[ ]wm8988_reg_defaults\[\][ ]=' sound/soc/codecs/wm8988.c
+ # Removed in 3.4, for --reverse-patch only.
+ defsnc 'static[ ]unsigned[ ]char[ ]splash_bits\[\][ ]=' arch/m68k/platform/68EZ328/bootlogo.h
+ accept '[ ]memcpy[(]src,[ ]["]\\x01\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00["].*PROGxxxx' arch/powerpc/platforms/iseries/mf.c
+ defsnc 'static[ ]const[ ]u32[ ]crc32c_table\[256\][ ]=' crypto/crc32c.c
+ defsnc 'static[ ]\(u8\|struct[ ]i2c_reg_u8\)[ ]\(soi968\|ov\(76[67]0\|965[05]\)\|hv7131r\)_init\[\]\(\[2\]\)\?[ ]=' drivers/media/video/gspca/sn9c20x.c
+ defsnc 'static[ ]\(const[ ]\)\?u32[ ]ar\(5416\|9280\)\(Modes\(_fast_clock\)\?\|Common\|BB_RfGain\|Bank6\(TPC\)\?\|Addac\)\(_91[06]0\(_\?1_1\)\?\|_9280\(_2\)\?\)\?\[\]\[[236]\][ ]=' 'drivers/net/wireless/ath9k/\(ar\(5008\|9001\)_\)\?initvals\.h'
+ defsnc 'static[ ]const[ ]u32[ ]ar9300Common_\(wo_xlna_\)\?rx_gain_table_\(merlin_\)\?2p[02]\[\]\[2\][ ]=' 'drivers/net/wireless/ath/ath9k/ar9003_\(2p[02]_\)\?initvals\.h'
+ defsnc 'static[ ]const[ ]u32[ ]ar9\(300\|200_merlin\)_2p[02]_\(radio\|mac\|baseband\)_core\[\]\[2\][ ]=' 'drivers/net/wireless/ath/ath9k/ar9003_\(2p[02]_\)\?initvals\.h'
+ defsnc 'static[ ]const[ ]u32[ ]\(ar5416Modes\(_91[06]0\)\?\|ar9280Modes\(_\(backoff_[12]3db\|original\)_rxgain\|_\(high_power\|original\)_tx_gain\)\?_9280_2\|ar9285Modes\(\(_\(high_power\|original\)_tx_gain\)\?_9285_1_2\|_XE2_0_\(normal\|high\)_power\)\|ar9287Modes\(_[tr]x_gain\)\?_9287_1_1\|ar9271Modes\(_\(normal\|high\)_power_tx_gain\)\?_9271\(_ANI_reg\)\?\)\[\]\[5\][ ]=' 'drivers/net/wireless/ath/ath9k/ar\(5008\|9002\)_initvals\.h'
+ defsnc 'static[ ]const[ ]u32[ ]\(ar9\(462\|580\)_\([12]p0_\)\?\(\(baseband\|mac\|radio\)_core\(_emulation\)\?\|\(common_\)\?\(wo_xlna_\|mixed_\)\?rx_gain_table\(_ar9280\)\?\(_[12]p0\)*\)\|ar9200_ar9280_2p0_radio_core\(_1p0\)\?\)\[\]\[2\][ ]=' 'drivers/net/wireless/ath/ath9k/ar9\(462\|580\)_[12]p0_initvals\.h'
+ defsnc 'static[ ]const[ ]u32[ ]ar9\(462\|580\)_\([12]p0_\)\?\(\(tx_gain_table_\)\?\(baseband\|mac\|radio\)_postamble\(_emulation\)\?\|\(modes_\)\?\(high\|low\(est\)\?\|mixed\|green\)_\(ob_db\|power\)_tx_gain_table\(_[12]p0\)\?\)\[\]\[5\][ ]=' 'drivers/net/wireless/ath/ath9k/ar9\(462\|580\)_[12]p0_initvals\.h'
+ defsnc 'static[ ]const[ ]struct[ ]hdmi_timings[ ]cea_vesa_timings\[OMAP_HDMI_TIMINGS_NB\][ ]=' drivers/video/omap2/dss/hdmi.c
+ defsnc 'static[ ]const[ ]u16[ ]wm8753_reg\[\][ ]=' sound/soc/codecs/wm8753.c
+ defsnc 'static[ ]const[ ]u8[ ]log_volume_table\[128\][ ]=' sound/usb/6fire/control.c
+ accept '[ ]*return[ ]_request_firmware[(]firmware_p,' drivers/base/firmware_class.c
+ accept 'static[ ]int[\n ]request_firmware_work_func[(]' drivers/base/firmware_class.c
+ accept '[ ]task[ ]=[ ]kthread_run[(]request_firmware_work_func' drivers/base/firmware_class.c
+ accept '-3[,]-2[,]-2[,]-1[,]-1[,]0[,][0-9,\n]*[}][;]' drivers/hwmon/via686a.c
+ accept '[ ][{]0xa1[,][ ]0x6e[,][ ][0-9xa-f, ]*[,][ ]0x00[,][ ]0x10[}][,]\([\n][ ][{]0x[ac]1[,][ ]0x6e[,][ ][0-9xa-f, ]*[,][ ]0x00[,][ ]0x10[}][,][}][,]\)*' drivers/media/video/gspca/sonixj.c
+ ;;
+
+ */atl1c_net_next_update-3.4.patch)
+ defsnc 'static[ ]const[ ]struct[ ]atl1c_platform_patch[ ]plats\[\][ ]__devinitdata[ ]=' drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+ ;;
+
+ */drivers-media-update.patch)
+ blobname 'dvb-usb-lme2510c\?-\(lg\|s7395\)\.fw' drivers/media/dvb/dvb-usb/lmedm04.c
+ blobname 'dvb-usb-lme2510c\?-s0194\.fw' drivers/media/dvb/dvb-usb/lmedm04.c
+ accept '[ ]*props->firmware[ ]=[ ]fw_it913\(5_v[12]\|7\)' drivers/media/dvb/dvb-usb/it913x.c
+ defsnc '[ ][}][ ]regs\[\][ ]=' drivers/media/video/em28xx/em28xx-dvb.c
+ defsnc '[ ]struct[ ]reg_val_mask[ ]tab\[\][ ]=' 'drivers/media/dvb/frontends/\(cxd2820r_\(c\|t2\)\|af9033\)\.c'
+ accept '[ ]0x43,[ ]11,[ ][0-9a-fx, \n]*' drivers/media/video/gspca/pac7302.c
+ # Entries above are in 3.3; below are for 3.4.
+ blobname 'dvb-usb-terratec-h7-drxk\.fw' drivers/media/dvb/dvb-usb/az6007.c
+ blobname 'dvb-usb-terratec-h7-az6007\.fw' drivers/media/dvb/dvb-usb/az6007.c
+ blobname 'dvb-usb-lme2510c-rs2000\.fw' drivers/media/dvb/dvb-usb/lmedm04.c
+ blobname 'dvb-fe-xc5000\(-1\.6\.114\|c-41\.024\.5-31875\)\.fw' drivers/media/common/tuners/xc5000.c
+ defsnc '[ ]struct[ ]rtl2830_reg_val_mask[ ]tab\[\][ ]=' drivers/media/dvb/frontends/rtl2830.c
+ defsnc '[ ]static[ ]u8[ ]bw_params1\[3\]\[34\][ ]=' drivers/media/dvb/frontends/rtl2830.c
+ blobname 'dvb-demod-drxk-pctv\.fw' drivers/media/video/em28xx/em28xx-dvb.c
+ defsnc 'static[ ]const[ ]u16[ ]vs6624_p1\[\][ ]=' drivers/media/video/vs6624.c
+ defsnc 'static[ ]const[ ]struct[ ]coeff[ ]coeff_lut\[\][ ]=' drivers/media/dvb/frontends/af9033_priv.h
+ defsnc 'static[ ]const[ ]struct[ ]val_snr[ ]\(qpsk\|qam\(16\|64\)\)_snr_lut\[\][ ]=' drivers/media/dvb/frontends/af9033_priv.h
+ defsnc 'static[ ]const[ ]struct[ ]reg_val[ ]\(ofsm_init\|tuner_init_\(tua9001\|fc0011\|mxl5007t\|tda18218\)\)\[\][ ]=' drivers/media/dvb/frontends/af9033_priv.h
+ accept 'static[ ]struct[ ]dvb_usb_device_properties[ ]az6007_properties[ ]=[ ][{][\n]\([ ]\.\(caps\|usb_ctrl\)[ ]*=[ ][^",]*,[\n]*\)*[ ]\.firmware[ ]*=[ ]' drivers/media/dvb/dvb-usb/az6007.c
+ accept '[ ]*\.download_firmware[ ]=[ ]af9035_download_firmware\(_it9135\)\?[,][\n][ ]*\.firmware[ ]=[ ]["]' drivers/media/dvb/dvb-usb/af9035.c
+ ;;
+
*/brcm80211.patch)
blobname 'brcm[/]bcm4329-fullmac-4\.\(bin\|txt\)' 'drivers/\(staging\|net/wireless\)/brcm80211/brcmfmac/bcmchip\.h'
blobname 'brcm[/]bcm43xx' 'drivers/\(staging\|net/wireless\)/brcm80211/sys/wl_mac80211\.c'
blobname '%s\(_hdr\)\?-%d\.fw' 'drivers/\(staging\|net/wireless\)/brcm80211/sys/wl_mac80211\.c'
- defsnc 'static[ ]\(const[ ]\)struct[ ]chan_info_basic[ ]chan_info_all\[\][ ]=' 'drivers/\(staging\|net/wireless\)/brcm80211/brcmsmac/phy/phy_cmn\.c'
+ defsnc 'static[ ]\(const[ ]\)\?struct[ ]chan_info_basic[ ]chan_info_all\[\][ ]=' 'drivers/\(staging\|net/wireless\)/brcm80211/brcmsmac/phy/phy_cmn\.c'
defsnc 'static[ ]const[ ]s8[ ]lcnphy_gain_index_offset_for_pkt_rssi\[\][ ]=' drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c
defsnc '\(static[ ]const[ ]\)\?s8[ ]lcnphy_gain_index_offset_for_pkt_rssi\[\][ ]=' 'drivers/\(staging\|net/wireless\)/brcm80211/\(phy/wlc_phy_lcn\.c\|brcmsmac/phy/phy_lcn\.c\)'
defsnc 'static[ ]\(const[ ]\)\?struct[ ]chan_info_2064_lcnphy[ ]chan_info_2064_lcnphy\[\][ ]=' 'drivers/\(staging\|net/wireless\)/brcm80211/brcmsmac/phy/phy_lcn\.c'
@@ -3372,7 +3570,7 @@ set_except () {
defsnc 'u32[ ]\(RTL\|Rtl\)8192CU\(PHY_REG\|_\?\(RADIO\|Radio\)[AB]\|MAC\|AGCTAB\)_\([21]T\(_HP\)\?_\?\(ARRAY\|Array\)\|\(ARRAY\|Array\)_PG\)\(_HP\)\?\[RTL8192CU\(PHY_REG\|\(RADIO\|Radio\)[AB]\|MAC\|AGCTAB\)_\([21]T\(_HP\)\?_\?\(ARRAY\|Array\)_\?\|\(ARRAY\|Array\)_PG\)\(_HP\)\?\(LENGTH\|Length\)\][ ]=' drivers/net/wireless/rtlwifi/rtl8192cu/table.c
blobname 'rtl_nic[/]rtl8105e-1\.fw' drivers/net/r8169.c
defsnc 'static[ ]const[ ]\(A_INT32\|s32\)[ ]wmi_rateTable\[\]\[2\][ ]=' drivers/staging/ath6kl/wmi/wmi.c
- defsnc '\(static[ ]\)\?const[ ]struct[ ]\(stk1160\|saa7113\)config[ ]\([{][^}]*[}][ ]\)\?\(stk1160\|saa7113\)config\(PAL\|NTSC\)\[256\][ ]=' drivers/staging/easycap/easycap_low.c
+ defsnc '\(static[ ]\)\?const[ ]struct[ ]\(stk1160\|saa7113\)config[ ]\([{][^}]*[}][ ]\)\?\(stk1160\|saa7113\)config\(PAL\|NTSC\)\?\[256\][ ]=' drivers/staging/easycap/easycap_low.c
defsnc 'static[ ]const[ ]ccktxbbgain_struct[ ]rtl8192_cck_txbbgain_\(ch14_\)\?table\[\][ ]=' drivers/staging/rtl8192e/r8192E_dm.c
defsnc '[ ]unsigned[ ]char[ ]data_ptr\[36\][ ]=' drivers/usb/storage/ene_ub6250.c
blobname 'ene-ub6250[/]sd_\(init[12]\|rdwr\)\.bin' drivers/usb/storage/ene_ub6250.c
diff --git a/freed-ora/current/master/deblob-main b/freed-ora/current/master/deblob-main
index 656e2a4f3..6ec8e69bf 100755
--- a/freed-ora/current/master/deblob-main
+++ b/freed-ora/current/master/deblob-main
@@ -199,7 +199,7 @@ else
fi
fi
-trap "status=$?; echo cleaning up...; rm -rf $cleanup; (exit $status); exit" 0 1 2 15
+trap 'status=$?; echo cleaning up...; rm -rf $cleanup; (exit $status); exit' 0 1 2 15
set -e
@@ -309,7 +309,7 @@ done
rm -f linux-libre-$kver-$gnu.tar
cleanup=
-trap "status=$?; (exit $status); exit" 0 1 2 15
+trap 'status=$?; (exit $status); exit' 0 1 2 15
echo All set, please review linux-libre-$kver-$gnu.patch
diff --git a/freed-ora/current/master/ext4-Support-check-none-nocheck-mount-options.patch b/freed-ora/current/master/ext4-Support-check-none-nocheck-mount-options.patch
deleted file mode 100644
index 281e4237a..000000000
--- a/freed-ora/current/master/ext4-Support-check-none-nocheck-mount-options.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From ea75f7357e3a881bd1bd0db5e483fc6a8681567b Mon Sep 17 00:00:00 2001
-From: Josh Boyer <jwboyer@redhat.com>
-Date: Tue, 10 Jan 2012 09:39:02 -0500
-Subject: [PATCH] ext4: Support "check=none" "nocheck" mount options
-
-The ext2/ext3 filesystems supported "check=none" and "nocheck" as mount options
-even though that was already the default behavior and it essentially did
-nothing. When using ext4 to mount ext2/ext3 filesystems, that mount option
-causes the mount to fail. That isn't as backward compatible as it could be,
-so add support to ext4 to accept the option.
-
-Signed-off-by: Josh Boyer <jwboyer@redhat.com>
----
- fs/ext4/super.c | 7 ++++++-
- 1 files changed, 6 insertions(+), 1 deletions(-)
-
-diff --git a/fs/ext4/super.c b/fs/ext4/super.c
-index 3e1329e..5ff09e7 100644
---- a/fs/ext4/super.c
-+++ b/fs/ext4/super.c
-@@ -1333,7 +1333,7 @@ enum {
- Opt_nomblk_io_submit, Opt_block_validity, Opt_noblock_validity,
- Opt_inode_readahead_blks, Opt_journal_ioprio,
- Opt_dioread_nolock, Opt_dioread_lock,
-- Opt_discard, Opt_nodiscard, Opt_init_itable, Opt_noinit_itable,
-+ Opt_discard, Opt_nodiscard, Opt_init_itable, Opt_noinit_itable, Opt_nocheck,
- };
-
- static const match_table_t tokens = {
-@@ -1409,6 +1409,8 @@ static const match_table_t tokens = {
- {Opt_init_itable, "init_itable=%u"},
- {Opt_init_itable, "init_itable"},
- {Opt_noinit_itable, "noinit_itable"},
-+ {Opt_nocheck, "check=none"},
-+ {Opt_nocheck, "nocheck"},
- {Opt_err, NULL},
- };
-
-@@ -1905,6 +1907,9 @@ set_qf_format:
- case Opt_noinit_itable:
- clear_opt(sb, INIT_INODE_TABLE);
- break;
-+ case Opt_nocheck:
-+ /* ext2/ext3 used to "support" this option. Silently eat it */
-+ break;
- default:
- ext4_msg(sb, KERN_ERR,
- "Unrecognized mount option \"%s\" "
---
-1.7.7.5
-
diff --git a/freed-ora/current/master/ext4-fix-resize-when-resizing-within-single-group.patch b/freed-ora/current/master/ext4-fix-resize-when-resizing-within-single-group.patch
deleted file mode 100644
index 9d911b425..000000000
--- a/freed-ora/current/master/ext4-fix-resize-when-resizing-within-single-group.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From a0ade1deb86d2325aecc36272bb4505a6eec9235 Mon Sep 17 00:00:00 2001
-From: Lukas Czerner <lczerner@redhat.com>
-Date: Mon, 20 Feb 2012 23:02:06 -0500
-Subject: [PATCH] ext4: fix resize when resizing within single group
-
-When resizing file system in the way that the new size of the file
-system is still in the same group (no new groups are added), then we can
-hit a BUG_ON in ext4_alloc_group_tables()
-
-BUG_ON(flex_gd->count == 0 || group_data == NULL);
-
-because flex_gd->count is zero. The reason is the missing check for such
-case, so the code always extend the last group fully and then attempt to
-add more groups, but at that time n_blocks_count is actually smaller
-than o_blocks_count.
-
-It can be easily reproduced like this:
-
-mkfs.ext4 -b 4096 /dev/sda 30M
-mount /dev/sda /mnt/test
-resize2fs /dev/sda 50M
-
-Fix this by checking whether the resize happens within the singe group
-and only add that many blocks into the last group to satisfy user
-request. Then o_blocks_count == n_blocks_count and the resize will exit
-successfully without and attempt to add more groups into the fs.
-
-Also fix mixing together block number and blocks count which might be
-confusing and can easily lead to off-by-one errors (but it is actually
-not the case here since the two occurrence of this mix-up will cancel
-each other).
-
-Signed-off-by: Lukas Czerner <lczerner@redhat.com>
-Reported-by: Milan Broz <mbroz@redhat.com>
-Reviewed-by: Eric Sandeen <sandeen@redhat.com>
-Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
----
- fs/ext4/resize.c | 14 ++++++++------
- 1 files changed, 8 insertions(+), 6 deletions(-)
-
-diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
-index f9d948f..3fed79d 100644
---- a/fs/ext4/resize.c
-+++ b/fs/ext4/resize.c
-@@ -1582,7 +1582,7 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count)
- ext4_fsblk_t o_blocks_count;
- ext4_group_t o_group;
- ext4_group_t n_group;
-- ext4_grpblk_t offset;
-+ ext4_grpblk_t offset, add;
- unsigned long n_desc_blocks;
- unsigned long o_desc_blocks;
- unsigned long desc_blocks;
-@@ -1605,7 +1605,7 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count)
- return 0;
-
- ext4_get_group_no_and_offset(sb, n_blocks_count - 1, &n_group, &offset);
-- ext4_get_group_no_and_offset(sb, o_blocks_count, &o_group, &offset);
-+ ext4_get_group_no_and_offset(sb, o_blocks_count - 1, &o_group, &offset);
-
- n_desc_blocks = (n_group + EXT4_DESC_PER_BLOCK(sb)) /
- EXT4_DESC_PER_BLOCK(sb);
-@@ -1634,10 +1634,12 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count)
- }
- brelse(bh);
-
-- if (offset != 0) {
-- /* extend the last group */
-- ext4_grpblk_t add;
-- add = EXT4_BLOCKS_PER_GROUP(sb) - offset;
-+ /* extend the last group */
-+ if (n_group == o_group)
-+ add = n_blocks_count - o_blocks_count;
-+ else
-+ add = EXT4_BLOCKS_PER_GROUP(sb) - (offset + 1);
-+ if (add > 0) {
- err = ext4_group_extend_no_check(sb, o_blocks_count, add);
- if (err)
- goto out;
---
-1.7.6.5
-
diff --git a/freed-ora/current/master/floppy-Remove-_hlt-related-functions.patch b/freed-ora/current/master/floppy-Remove-_hlt-related-functions.patch
deleted file mode 100644
index 75609ddae..000000000
--- a/freed-ora/current/master/floppy-Remove-_hlt-related-functions.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-From 5c21b39ab123ada8ce248efc733420bd8c9ea255 Mon Sep 17 00:00:00 2001
-From: Josh Boyer <jwboyer@redhat.com>
-Date: Fri, 28 Oct 2011 15:38:06 -0400
-Subject: [PATCH] floppy: Remove _hlt related functions
-
-It's close enough to 2012 and the WARN_ONCE is causing things like abrt to
-auto-file bugs that aren't really bugs.
-
-Signed-off-by: Josh Boyer <jwboyer@redhat.com>
-
-diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
-index d5ac362..df1e87c 100644
---- a/Documentation/feature-removal-schedule.txt
-+++ b/Documentation/feature-removal-schedule.txt
-@@ -6,14 +6,6 @@ be removed from this file.
-
- ---------------------------
-
--What: x86 floppy disable_hlt
--When: 2012
--Why: ancient workaround of dubious utility clutters the
-- code used by everybody else.
--Who: Len Brown <len.brown@intel.com>
--
-----------------------------
--
- What: CONFIG_APM_CPU_IDLE, and its ability to call APM BIOS in idle
- When: 2012
- Why: This optional sub-feature of APM is of dubious reliability,
-diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
-index 9955a53..40bf4c2 100644
---- a/drivers/block/floppy.c
-+++ b/drivers/block/floppy.c
-@@ -1032,37 +1032,6 @@ static int fd_wait_for_completion(unsigned long delay, timeout_fn function)
- return 0;
- }
-
--static DEFINE_SPINLOCK(floppy_hlt_lock);
--static int hlt_disabled;
--static void floppy_disable_hlt(void)
--{
-- unsigned long flags;
--
-- WARN_ONCE(1, "floppy_disable_hlt() scheduled for removal in 2012");
-- spin_lock_irqsave(&floppy_hlt_lock, flags);
-- if (!hlt_disabled) {
-- hlt_disabled = 1;
--#ifdef HAVE_DISABLE_HLT
-- disable_hlt();
--#endif
-- }
-- spin_unlock_irqrestore(&floppy_hlt_lock, flags);
--}
--
--static void floppy_enable_hlt(void)
--{
-- unsigned long flags;
--
-- spin_lock_irqsave(&floppy_hlt_lock, flags);
-- if (hlt_disabled) {
-- hlt_disabled = 0;
--#ifdef HAVE_DISABLE_HLT
-- enable_hlt();
--#endif
-- }
-- spin_unlock_irqrestore(&floppy_hlt_lock, flags);
--}
--
- static void setup_DMA(void)
- {
- unsigned long f;
-@@ -1107,7 +1076,6 @@ static void setup_DMA(void)
- fd_enable_dma();
- release_dma_lock(f);
- #endif
-- floppy_disable_hlt();
- }
-
- static void show_floppy(void);
-@@ -1709,7 +1677,6 @@ irqreturn_t floppy_interrupt(int irq, void *dev_id)
- fd_disable_dma();
- release_dma_lock(f);
-
-- floppy_enable_hlt();
- do_floppy = NULL;
- if (fdc >= N_FDC || FDCS->address == -1) {
- /* we don't even know which FDC is the culprit */
-@@ -1858,8 +1825,6 @@ static void floppy_shutdown(unsigned long data)
- show_floppy();
- cancel_activity();
-
-- floppy_enable_hlt();
--
- flags = claim_dma_lock();
- fd_disable_dma();
- release_dma_lock(flags);
-@@ -4504,7 +4469,6 @@ static void floppy_release_irq_and_dma(void)
- #if N_FDC > 1
- set_dor(1, ~8, 0);
- #endif
-- floppy_enable_hlt();
-
- if (floppy_track_buffer && max_buffer_sectors) {
- tmpsize = max_buffer_sectors * 1024;
---
-1.7.6.4
-
diff --git a/freed-ora/current/master/fs-proc-devtree-remove_proc_entry.patch b/freed-ora/current/master/fs-proc-devtree-remove_proc_entry.patch
new file mode 100644
index 000000000..c32e79e6e
--- /dev/null
+++ b/freed-ora/current/master/fs-proc-devtree-remove_proc_entry.patch
@@ -0,0 +1,12 @@
+diff --git a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c
+index 927cbd1..f060f28 100644
+--- a/fs/proc/proc_devtree.c
++++ b/fs/proc/proc_devtree.c
+@@ -233,6 +233,7 @@ void __init proc_device_tree_init(void)
+ return;
+ root = of_find_node_by_path("/");
+ if (root == NULL) {
++ remove_proc_entry("device-tree", NULL);
+ pr_debug("/proc/device-tree: can't find root\n");
+ return;
+ }
diff --git a/freed-ora/current/master/hfsplus-Add-an-ioctl-to-bless-files.patch b/freed-ora/current/master/hfsplus-Add-an-ioctl-to-bless-files.patch
deleted file mode 100644
index 082627f91..000000000
--- a/freed-ora/current/master/hfsplus-Add-an-ioctl-to-bless-files.patch
+++ /dev/null
@@ -1,98 +0,0 @@
-Making an hfsplus partition bootable requires the ability to "bless" a
-file by putting its inode number in the volume header. Doing this from
-userspace on a mounted filesystem is impractical since the kernel will
-write back the original values on unmount. Add an ioctl to allow userspace
-to update the volume header information based on the target file.
-
-Signed-off-by: Matthew Garrett <mjg@redhat.com>
----
-Kept the ioctl in the hfs code, but moved it to a different range to reduce
-reduce the chances of someone stepping on it with another filesystem.
- Documentation/ioctl/ioctl-number.txt | 1 +
- fs/hfsplus/hfsplus_fs.h | 5 +++++
- fs/hfsplus/ioctl.c | 34 ++++++++++++++++++++++++++++++++++
- 3 files changed, 40 insertions(+), 0 deletions(-)
-diff --git a/Documentation/ioctl/ioctl-number.txt b/Documentation/ioctl/ioctl-number.txt
-index 4840334..37a4248 100644
---- a/Documentation/ioctl/ioctl-number.txt
-+++ b/Documentation/ioctl/ioctl-number.txt
-@@ -218,6 +218,7 @@ Code Seq#(hex) Include File Comments
- 'h' 00-7F conflict! Charon filesystem
- <mailto:zapman@interlan.net>
- 'h' 00-1F linux/hpet.h conflict!
-+'h' 80-8F fs/hfsplus/ioctl.c
- 'i' 00-3F linux/i2o-dev.h conflict!
- 'i' 0B-1F linux/ipmi.h conflict!
- 'i' 80-8F linux/i8k.h
-diff --git a/fs/hfsplus/hfsplus_fs.h b/fs/hfsplus/hfsplus_fs.h
-index 21a5b7f..4e75ac6 100644
---- a/fs/hfsplus/hfsplus_fs.h
-+++ b/fs/hfsplus/hfsplus_fs.h
-@@ -317,6 +317,11 @@ static inline unsigned short hfsplus_min_io_size(struct super_block *sb)
-
-
- /*
-+ * hfs+-specific ioctl for making the filesystem bootable
-+ */
-+#define HFSPLUS_IOC_BLESS _IO('h', 0x80)
-+
-+/*
- * Functions in any *.c used in other files
- */
-
-diff --git a/fs/hfsplus/ioctl.c b/fs/hfsplus/ioctl.c
-index f66c765..c640ba5 100644
---- a/fs/hfsplus/ioctl.c
-+++ b/fs/hfsplus/ioctl.c
-@@ -20,6 +20,38 @@
- #include <asm/uaccess.h>
- #include "hfsplus_fs.h"
-
-+/*
-+ * "Blessing" an HFS+ filesystem writes metadata to the superblock informing
-+ * the platform firmware which file to boot from
-+ */
-+static int hfsplus_ioctl_bless(struct file *file, int __user *user_flags)
-+{
-+ struct dentry *dentry = file->f_path.dentry;
-+ struct inode *inode = dentry->d_inode;
-+ struct hfsplus_sb_info *sbi = HFSPLUS_SB(inode->i_sb);
-+ struct hfsplus_vh *vh = sbi->s_vhdr;
-+ struct hfsplus_vh *bvh = sbi->s_backup_vhdr;
-+
-+ if (!capable(CAP_SYS_ADMIN))
-+ return -EPERM;
-+
-+ mutex_lock(&sbi->vh_mutex);
-+
-+ /* Directory containing the bootable system */
-+ vh->finder_info[0] = bvh->finder_info[0] =
-+ cpu_to_be32(parent_ino(dentry));
-+
-+ /* Bootloader */
-+ vh->finder_info[1] = bvh->finder_info[1] = cpu_to_be32(inode->i_ino);
-+
-+ /* Per spec, the OS X system folder - same as finder_info[0] here */
-+ vh->finder_info[5] = bvh->finder_info[5] =
-+ cpu_to_be32(parent_ino(dentry));
-+
-+ mutex_unlock(&sbi->vh_mutex);
-+ return 0;
-+}
-+
- static int hfsplus_ioctl_getflags(struct file *file, int __user *user_flags)
- {
- struct inode *inode = file->f_path.dentry->d_inode;
-@@ -108,6 +140,8 @@ long hfsplus_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
- return hfsplus_ioctl_getflags(file, argp);
- case HFSPLUS_IOC_EXT2_SETFLAGS:
- return hfsplus_ioctl_setflags(file, argp);
-+ case HFSPLUS_IOC_BLESS:
-+ return hfsplus_ioctl_bless(file, argp);
- default:
- return -ENOTTY;
- }
---
-1.7.7.6
-
-
diff --git a/freed-ora/current/master/hfsplus-Change-finder_info-to-u32.patch b/freed-ora/current/master/hfsplus-Change-finder_info-to-u32.patch
deleted file mode 100644
index 15e3e67d8..000000000
--- a/freed-ora/current/master/hfsplus-Change-finder_info-to-u32.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-The finder_info block in the hfsplus volume header is currently defined as
-an array of 8 bit values, but TN1150 defines it as being an array of 32 bit
-values. Fix for convenience.
-
-Signed-off-by: Matthew Garrett <mjg@redhat.com>
----
- fs/hfsplus/hfsplus_raw.h | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/fs/hfsplus/hfsplus_raw.h b/fs/hfsplus/hfsplus_raw.h
-index 927cdd6..921967e 100644
---- a/fs/hfsplus/hfsplus_raw.h
-+++ b/fs/hfsplus/hfsplus_raw.h
-@@ -117,7 +117,7 @@ struct hfsplus_vh {
- __be32 write_count;
- __be64 encodings_bmp;
-
-- u8 finder_info[32];
-+ u32 finder_info[8];
-
- struct hfsplus_fork_raw alloc_file;
- struct hfsplus_fork_raw ext_file;
---
-1.7.7.1
-
-
diff --git a/freed-ora/current/master/hfsplus-Fix-bless-ioctl-when-used-with-hardlinks.patch b/freed-ora/current/master/hfsplus-Fix-bless-ioctl-when-used-with-hardlinks.patch
new file mode 100644
index 000000000..3e0b4a5c7
--- /dev/null
+++ b/freed-ora/current/master/hfsplus-Fix-bless-ioctl-when-used-with-hardlinks.patch
@@ -0,0 +1,100 @@
+Path: news.gmane.org!not-for-mail
+From: Matthew Garrett <mjg@redhat.com>
+Newsgroups: gmane.linux.kernel,gmane.linux.file-systems
+Subject: [PATCH V2] hfsplus: Fix bless ioctl when used with hardlinks
+Date: Mon, 16 Apr 2012 16:57:18 -0400
+Lines: 45
+Approved: news@gmane.org
+Message-ID: <1334609838-14831-1-git-send-email-mjg@redhat.com>
+NNTP-Posting-Host: plane.gmane.org
+X-Trace: dough.gmane.org 1334609870 7622 80.91.229.3 (16 Apr 2012 20:57:50 GMT)
+X-Complaints-To: usenet@dough.gmane.org
+NNTP-Posting-Date: Mon, 16 Apr 2012 20:57:50 +0000 (UTC)
+Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
+ Matthew Garrett <mjg@redhat.com>
+To: hch@infradead.org
+Original-X-From: linux-kernel-owner@vger.kernel.org Mon Apr 16 22:57:49 2012
+Return-path: <linux-kernel-owner@vger.kernel.org>
+Envelope-to: glk-linux-kernel-3@plane.gmane.org
+Original-Received: from vger.kernel.org ([209.132.180.67])
+ by plane.gmane.org with esmtp (Exim 4.69)
+ (envelope-from <linux-kernel-owner@vger.kernel.org>)
+ id 1SJszc-0006G8-Gd
+ for glk-linux-kernel-3@plane.gmane.org; Mon, 16 Apr 2012 22:57:48 +0200
+Original-Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
+ id S1755330Ab2DPU5g (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>);
+ Mon, 16 Apr 2012 16:57:36 -0400
+Original-Received: from mx1.redhat.com ([209.132.183.28]:44295 "EHLO mx1.redhat.com"
+ rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
+ id S1752969Ab2DPU5e (ORCPT <rfc822;linux-kernel@vger.kernel.org>);
+ Mon, 16 Apr 2012 16:57:34 -0400
+Original-Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22])
+ by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3GKvQoA029518
+ (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
+ Mon, 16 Apr 2012 16:57:26 -0400
+Original-Received: from cavan.codon.org.uk (ovpn-113-122.phx2.redhat.com [10.3.113.122])
+ by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q3GKvP1p017146
+ (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);
+ Mon, 16 Apr 2012 16:57:26 -0400
+Original-Received: from nat-pool-rdu.redhat.com ([66.187.233.202] helo=x220.boston.devel.redhat.com)
+ by cavan.codon.org.uk with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
+ (Exim 4.72)
+ (envelope-from <mjg@redhat.com>)
+ id 1SJszC-0003jY-P9; Mon, 16 Apr 2012 21:57:23 +0100
+X-SA-Do-Not-Run: Yes
+X-SA-Exim-Connect-IP: 66.187.233.202
+X-SA-Exim-Mail-From: mjg@redhat.com
+X-SA-Exim-Scanned: No (on cavan.codon.org.uk); SAEximRunCond expanded to false
+X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22
+Original-Sender: linux-kernel-owner@vger.kernel.org
+Precedence: bulk
+List-ID: <linux-kernel.vger.kernel.org>
+X-Mailing-List: linux-kernel@vger.kernel.org
+Xref: news.gmane.org gmane.linux.kernel:1282933 gmane.linux.file-systems:63394
+Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1282933>
+
+HFS+ doesn't really implement hard links - instead, hardlinks are indicated
+by a magic file type which refers to an indirect node in a hidden
+directory. The spec indicates that stat() should return the inode number
+of the indirect node, but it turns out that this doesn't satisfy the
+firmware when it's looking for a bootloader - it wants the catalog ID of
+the hardlink file instead. Fix up this case.
+
+Signed-off-by: Matthew Garrett <mjg@redhat.com>
+---
+
+V2 cleans up the casting.
+
+ fs/hfsplus/ioctl.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/fs/hfsplus/ioctl.c b/fs/hfsplus/ioctl.c
+index c640ba5..09addc8 100644
+--- a/fs/hfsplus/ioctl.c
++++ b/fs/hfsplus/ioctl.c
+@@ -31,6 +31,7 @@ static int hfsplus_ioctl_bless(struct file *file, int __user *user_flags)
+ struct hfsplus_sb_info *sbi = HFSPLUS_SB(inode->i_sb);
+ struct hfsplus_vh *vh = sbi->s_vhdr;
+ struct hfsplus_vh *bvh = sbi->s_backup_vhdr;
++ u32 cnid = (unsigned long)dentry->d_fsdata;
+
+ if (!capable(CAP_SYS_ADMIN))
+ return -EPERM;
+@@ -41,8 +42,12 @@ static int hfsplus_ioctl_bless(struct file *file, int __user *user_flags)
+ vh->finder_info[0] = bvh->finder_info[0] =
+ cpu_to_be32(parent_ino(dentry));
+
+- /* Bootloader */
+- vh->finder_info[1] = bvh->finder_info[1] = cpu_to_be32(inode->i_ino);
++ /*
++ * Bootloader. Just using the inode here breaks in the case of
++ * hard links - the firmware wants the ID of the hard link file,
++ * but the inode points at the indirect inode
++ */
++ vh->finder_info[1] = bvh->finder_info[1] = cpu_to_be32(cnid);
+
+ /* Per spec, the OS X system folder - same as finder_info[0] here */
+ vh->finder_info[5] = bvh->finder_info[5] =
+--
+1.7.10
+
diff --git a/freed-ora/current/master/ipw2x00-add-supported-cipher-suites-to-wiphy-initialization.patch b/freed-ora/current/master/ipw2x00-add-supported-cipher-suites-to-wiphy-initialization.patch
new file mode 100644
index 000000000..705c5eff0
--- /dev/null
+++ b/freed-ora/current/master/ipw2x00-add-supported-cipher-suites-to-wiphy-initialization.patch
@@ -0,0 +1,155 @@
+Path: news.gmane.org!not-for-mail
+From: Stanislav Yakovlev <stas.yakovlev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
+Newsgroups: gmane.linux.kernel.wireless.general
+Subject: [PATCH] net/wireless: ipw2x00: add supported cipher suites to wiphy initialization
+Date: Tue, 10 Apr 2012 21:44:47 -0400
+Lines: 97
+Approved: news@gmane.org
+Message-ID: <1334108687-12954-1-git-send-email-stas.yakovlev@gmail.com>
+NNTP-Posting-Host: plane.gmane.org
+X-Trace: dough.gmane.org 1334108469 22291 80.91.229.3 (11 Apr 2012 01:41:09 GMT)
+X-Complaints-To: usenet@dough.gmane.org
+NNTP-Posting-Date: Wed, 11 Apr 2012 01:41:09 +0000 (UTC)
+Cc: simar-hi6Y0CQ0nG0@public.gmane.org, linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
+ Stanislav Yakovlev <stas.yakovlev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
+To: linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org
+Original-X-From: linux-wireless-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Wed Apr 11 03:41:07 2012
+Return-path: <linux-wireless-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
+Envelope-to: glkwg-linux-wireless-wOFGN7rlS/M9smdsby/KFg@public.gmane.org
+Original-Received: from vger.kernel.org ([209.132.180.67])
+ by plane.gmane.org with esmtp (Exim 4.69)
+ (envelope-from <linux-wireless-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>)
+ id 1SHmYV-0004IK-CT
+ for glkwg-linux-wireless-wOFGN7rlS/M9smdsby/KFg@public.gmane.org; Wed, 11 Apr 2012 03:41:07 +0200
+Original-Received: (majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org) by vger.kernel.org via listexpand
+ id S1759898Ab2DKBlF (ORCPT
+ <rfc822;glkwg-linux-wireless@m.gmane.org>);
+ Tue, 10 Apr 2012 21:41:05 -0400
+Original-Received: from mail-ob0-f174.google.com ([209.85.214.174]:60108 "EHLO
+ mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
+ with ESMTP id S1753779Ab2DKBlE (ORCPT
+ <rfc822;linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>);
+ Tue, 10 Apr 2012 21:41:04 -0400
+Original-Received: by obbtb18 with SMTP id tb18so567970obb.19
+ for <linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>; Tue, 10 Apr 2012 18:41:02 -0700 (PDT)
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+ d=gmail.com; s=20120113;
+ h=from:to:cc:subject:date:message-id:x-mailer;
+ bh=8+D+Uuo0bIOG6rz8vxd6TGAxmrbuAw2bjWhd058IjOQ=;
+ b=beOgy1Y9ZAV1Xw5XqsnPDJ1Oc0qOpOo+gCWlwmWbLdVHxUVG+ZVuRW9eCRQkh+5bZm
+ 5Ic+xOISztYUJp144Fr4flnbGPRKKp7jP8qQ/HvCOo34J6MCgBlnuWNYKbn4/NUvOYAh
+ SeHpk2D8yOHbiWAMV+JGTqGG+/N4jVvRL147Yg1IfNDAJd8Ahbl0wARLOVg8WGGTSPvn
+ MU3HNbmKFFBDhnukYr4keCnjixuDkqPYGMYuDrsmKdiAFHBRDI6qudnvaqi8F8gbtaWg
+ dfssdTbmNYM/R/PJenInoy7IbRps2iW9ZX+zFzydZWp2EyJ4EZkKrYKmnezQgNJzRVex
+ KHfg==
+Original-Received: by 10.60.24.9 with SMTP id q9mr19071024oef.4.1334108462648;
+ Tue, 10 Apr 2012 18:41:02 -0700 (PDT)
+Original-Received: from localhost.localdomain (50-0-191-227.dsl.static.sonic.net. [50.0.191.227])
+ by mx.google.com with ESMTPS id tx2sm1309336obb.8.2012.04.10.18.40.54
+ (version=TLSv1/SSLv3 cipher=OTHER);
+ Tue, 10 Apr 2012 18:41:01 -0700 (PDT)
+X-Mailer: git-send-email 1.7.2.5
+Original-Sender: linux-wireless-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
+Precedence: bulk
+List-ID: <linux-wireless.vger.kernel.org>
+X-Mailing-List: linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
+Xref: news.gmane.org gmane.linux.kernel.wireless.general:88613
+Archived-At: <http://permalink.gmane.org/gmane.linux.kernel.wireless.general/88613>
+
+Driver doesn't report its supported cipher suites through cfg80211
+interface. It still uses wext interface and probably will not work
+through nl80211, but will at least correctly advertise supported
+features.
+
+Bug was reported by Omar Siam.
+https://bugzilla.kernel.org/show_bug.cgi?id=43049
+
+Signed-off-by: Stanislav Yakovlev <stas.yakovlev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
+---
+ drivers/net/wireless/ipw2x00/ipw.h | 23 +++++++++++++++++++++++
+ drivers/net/wireless/ipw2x00/ipw2100.c | 4 ++++
+ drivers/net/wireless/ipw2x00/ipw2200.c | 4 ++++
+ 3 files changed, 31 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/net/wireless/ipw2x00/ipw.h
+
+diff --git a/drivers/net/wireless/ipw2x00/ipw.h b/drivers/net/wireless/ipw2x00/ipw.h
+new file mode 100644
+index 0000000..4007bf5
+--- /dev/null
++++ b/drivers/net/wireless/ipw2x00/ipw.h
+@@ -0,0 +1,23 @@
++/*
++ * Intel Pro/Wireless 2100, 2200BG, 2915ABG network connection driver
++ *
++ * Copyright 2012 Stanislav Yakovlev <stas.yakovlev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
++ *
++ * 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 __IPW_H__
++#define __IPW_H__
++
++#include <linux/ieee80211.h>
++
++static const u32 ipw_cipher_suites[] = {
++ WLAN_CIPHER_SUITE_WEP40,
++ WLAN_CIPHER_SUITE_WEP104,
++ WLAN_CIPHER_SUITE_TKIP,
++ WLAN_CIPHER_SUITE_CCMP,
++};
++
++#endif
+diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
+index f0551f8..7c8e8b1 100644
+--- a/drivers/net/wireless/ipw2x00/ipw2100.c
++++ b/drivers/net/wireless/ipw2x00/ipw2100.c
+@@ -166,6 +166,7 @@ that only one external action is invoked at a time.
+ #include <net/lib80211.h>
+
+ #include "ipw2100.h"
++#include "ipw.h"
+
+ #define IPW2100_VERSION "git-1.2.2"
+
+@@ -1946,6 +1947,9 @@ static int ipw2100_wdev_init(struct net_device *dev)
+ wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = bg_band;
+ }
+
++ wdev->wiphy->cipher_suites = ipw_cipher_suites;
++ wdev->wiphy->n_cipher_suites = ARRAY_SIZE(ipw_cipher_suites);
++
+ set_wiphy_dev(wdev->wiphy, &priv->pci_dev->dev);
+ if (wiphy_register(wdev->wiphy)) {
+ ipw2100_down(priv);
+diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
+index 2b02257..bb4f42a 100644
+--- a/drivers/net/wireless/ipw2x00/ipw2200.c
++++ b/drivers/net/wireless/ipw2x00/ipw2200.c
+@@ -34,6 +34,7 @@
+ #include <linux/slab.h>
+ #include <net/cfg80211-wext.h>
+ #include "ipw2200.h"
++#include "ipw.h"
+
+
+ #ifndef KBUILD_EXTMOD
+@@ -11533,6 +11534,9 @@ static int ipw_wdev_init(struct net_device *dev)
+ wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = a_band;
+ }
+
++ wdev->wiphy->cipher_suites = ipw_cipher_suites;
++ wdev->wiphy->n_cipher_suites = ARRAY_SIZE(ipw_cipher_suites);
++
+ set_wiphy_dev(wdev->wiphy, &priv->pci_dev->dev);
+
+ /* With that information in place, we can now register the wiphy... */
+--
+1.7.2.5
+
+--
+To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
+the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
+More majordomo info at http://vger.kernel.org/majordomo-info.html
+
diff --git a/freed-ora/current/master/jbd2-clear-BH_Delay-and-BH_Unwritten-in-journal_unmap_buf.patch b/freed-ora/current/master/jbd2-clear-BH_Delay-and-BH_Unwritten-in-journal_unmap_buf.patch
deleted file mode 100644
index 5ea8ccc10..000000000
--- a/freed-ora/current/master/jbd2-clear-BH_Delay-and-BH_Unwritten-in-journal_unmap_buf.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-Path: news.gmane.org!not-for-mail
-From: Eric Sandeen <sandeen@redhat.com>
-Newsgroups: gmane.comp.file-systems.ext4
-Subject: [PATCH] jbd2: clear BH_Delay & BH_Unwritten in journal_unmap_buffer
-Date: Tue, 07 Feb 2012 16:07:20 -0600
-Lines: 42
-Approved: news@gmane.org
-Message-ID: <4F31A098.4050601@redhat.com>
-NNTP-Posting-Host: plane.gmane.org
-Mime-Version: 1.0
-Content-Type: text/plain; charset=ISO-8859-1
-Content-Transfer-Encoding: 7bit
-X-Trace: dough.gmane.org 1328656072 12026 80.91.229.3 (7 Feb 2012 23:07:52 GMT)
-X-Complaints-To: usenet@dough.gmane.org
-NNTP-Posting-Date: Tue, 7 Feb 2012 23:07:52 +0000 (UTC)
-To: ext4 development <linux-ext4@vger.kernel.org>
-Original-X-From: linux-ext4-owner@vger.kernel.org Wed Feb 08 00:07:52 2012
-Return-path: <linux-ext4-owner@vger.kernel.org>
-Envelope-to: gcfe-linux-ext4@plane.gmane.org
-Original-Received: from vger.kernel.org ([209.132.180.67])
- by plane.gmane.org with esmtp (Exim 4.69)
- (envelope-from <linux-ext4-owner@vger.kernel.org>)
- id 1Ruu8d-0000lK-5P
- for gcfe-linux-ext4@plane.gmane.org; Wed, 08 Feb 2012 00:07:51 +0100
-Original-Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
- id S1756187Ab2BGXHt (ORCPT <rfc822;gcfe-linux-ext4@m.gmane.org>);
- Tue, 7 Feb 2012 18:07:49 -0500
-Original-Received: from mx1.redhat.com ([209.132.183.28]:19432 "EHLO mx1.redhat.com"
- rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
- id S1753992Ab2BGXHs (ORCPT <rfc822;linux-ext4@vger.kernel.org>);
- Tue, 7 Feb 2012 18:07:48 -0500
-Original-Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])
- by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q17N7dj0027622
- (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
- for <linux-ext4@vger.kernel.org>; Tue, 7 Feb 2012 18:07:48 -0500
-Original-Received: from liberator.sandeen.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1])
- by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q17M7Kgt001990
- (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
- for <linux-ext4@vger.kernel.org>; Tue, 7 Feb 2012 17:07:21 -0500
-User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0) Gecko/20120129 Thunderbird/10.0
-X-Enigmail-Version: 1.3.5
-X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11
-Original-Sender: linux-ext4-owner@vger.kernel.org
-Precedence: bulk
-List-ID: <linux-ext4.vger.kernel.org>
-X-Mailing-List: linux-ext4@vger.kernel.org
-Xref: news.gmane.org gmane.comp.file-systems.ext4:30623
-Archived-At: <http://permalink.gmane.org/gmane.comp.file-systems.ext4/30623>
-
-journal_unmap_buffer()'s zap_buffer: code clears a lot of buffer head
-state ala discard_buffer(), but does not touch _Delay or _Unwritten
-as discard_buffer() does.
-
-This can be problematic in some areas of the ext4 code which assume
-that if they have found a buffer marked unwritten or delay, then it's
-a live one. Perhaps those spots should check whether it is mapped
-as well, but if jbd2 is going to tear down a buffer, let's really
-tear it down completely.
-
-Without this I get some fsx failures on sub-page-block filesystems
-up until v3.2, at which point 4e96b2dbbf1d7e81f22047a50f862555a6cb87cb
-and 189e868fa8fdca702eb9db9d8afc46b5cb9144c9 make the failures go
-away, because buried within that large change is some more flag
-clearing. I still think it's worth doing in jbd2, since
-->invalidatepage leads here directly, and it's the right place
-to clear away these flags.
-
-Signed-off-by: Eric Sandeen <sandeen@redhat.com>
-Cc: stable@vger.kernel.org
----
-
-diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
-index 35ae096..52653306 100644
---- a/fs/jbd2/transaction.c
-+++ b/fs/jbd2/transaction.c
-@@ -1949,6 +1949,8 @@ zap_buffer_unlocked:
- clear_buffer_mapped(bh);
- clear_buffer_req(bh);
- clear_buffer_new(bh);
-+ clear_buffer_delay(bh);
-+ clear_buffer_unwritten(bh);
- bh->b_bdev = NULL;
- return may_free;
- }
-
-
---
-To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
-the body of a message to majordomo@vger.kernel.org
-More majordomo info at http://vger.kernel.org/majordomo-info.html
-
diff --git a/freed-ora/current/master/kernel.spec b/freed-ora/current/master/kernel.spec
index 400928910..66c3ea75c 100644
--- a/freed-ora/current/master/kernel.spec
+++ b/freed-ora/current/master/kernel.spec
@@ -6,7 +6,7 @@ Summary: The Linux kernel
# For a stable, released kernel, released_kernel should be 1. For rawhide
# and/or a kernel built from an rc or git snapshot, released_kernel should
# be 0.
-%global released_kernel 1
+%global released_kernel 0
# Sign modules on x86. Make sure the config files match this setting if more
# architectures are added.
@@ -62,7 +62,7 @@ Summary: The Linux kernel
# For non-released -rc kernels, this will be appended after the rcX and
# gitX tags, so a 3 here would become part of release "0.rcX.gitX.3"
#
-%global baserelease 2
+%global baserelease 1
%global fedora_build %{baserelease}
# base_sublevel is the kernel version we're starting with and patching
@@ -78,8 +78,8 @@ Summary: The Linux kernel
%define basegnu -gnu%{?librev}
# To be inserted between "patch" and "-2.6.".
-#define stablelibre -3.3%{?stablegnux}
-#define rcrevlibre -3.3%{?rcrevgnux}
+%define stablelibre -3.3%{?stablegnux}
+%define rcrevlibre -3.3%{?rcrevgnux}
#define gitrevlibre -3.3%{?gitrevgnux}
%if 0%{?stablelibre:1}
@@ -203,7 +203,7 @@ Summary: The Linux kernel
# Set debugbuildsenabled to 1 for production (build separate debug kernels)
# and 0 for rawhide (all kernels are debug kernels).
# See also 'make debug' and 'make release'.
-%define debugbuildsenabled 1
+%define debugbuildsenabled 0
# Want to build a vanilla kernel build without any non-upstream patches?
%define with_vanilla %{?_with_vanilla: 1} %{?!_with_vanilla: 0}
@@ -216,7 +216,7 @@ Summary: The Linux kernel
%define doc_build_fail true
%endif
-%define rawhide_skip_docs 0
+%define rawhide_skip_docs 1
%if 0%{?rawhide_skip_docs}
%define with_doc 0
%define doc_build_fail true
@@ -296,12 +296,12 @@ Summary: The Linux kernel
%define with_pae 0
%endif
-# kernel-tegra, omap, imx and highbank are only built on armv7 hard and softfp
+# kernel up (versatile express), tegra, omap, imx and highbank are only built on armv7 hfp/sfp
%ifnarch armv7hl armv7l
-%define with_tegra 0
-%define with_omap 0
%define with_imx 0
%define with_highbank 0
+%define with_omap 0
+%define with_tegra 0
%endif
# kernel-kirkwood is only built for armv5
@@ -453,12 +453,11 @@ Summary: The Linux kernel
%define hdrarch arm
%define make_target bzImage
%define kernel_image arch/arm/boot/zImage
-# we build a up kernel on base softfp/hardfp platforms. its used for qemu.
-%ifnarch armv5tel armv7hl
-%define with_up 0
-%endif
# we only build headers/perf/tools on the base arm arches
# just like we used to only build them on i386 for x86
+%ifarch armv5tel
+%define with_up 0
+%endif
%ifnarch armv5tel armv7hl
%define with_headers 0
%define with_perf 0
@@ -466,14 +465,6 @@ Summary: The Linux kernel
%endif
%endif
-# Should make listnewconfig fail if there's config options
-# printed out?
-%if %{nopatches}%{using_upstream_branch}
-%define listnewconfig_fail 0
-%else
-%define listnewconfig_fail 1
-%endif
-
# To temporarily exclude an architecture from being built, add it to
# %%nobuildarches. Do _NOT_ use the ExclusiveArch: line, because if we
# don't build kernel-headers then the new build system will no longer let
@@ -587,14 +578,14 @@ ExclusiveOS: Linux
#
BuildRequires: module-init-tools, patch >= 2.5.4, bash >= 2.03, sh-utils, tar
BuildRequires: bzip2, xz, findutils, gzip, m4, perl, make >= 3.78, diffutils, gawk
-BuildRequires: gcc >= 3.4.2, binutils >= 2.12, redhat-rpm-config
+BuildRequires: gcc >= 3.4.2, binutils >= 2.12, redhat-rpm-config, hmaccalc
BuildRequires: net-tools
BuildRequires: xmlto, asciidoc
%if %{with_sparse}
BuildRequires: sparse >= 0.4.1
%endif
%if %{with_perf}
-BuildRequires: elfutils-devel zlib-devel binutils-devel newt-devel python-devel perl(ExtUtils::Embed)
+BuildRequires: elfutils-devel zlib-devel binutils-devel newt-devel python-devel perl(ExtUtils::Embed) bison
%endif
%if %{with_tools}
BuildRequires: pciutils-devel gettext
@@ -619,7 +610,7 @@ Source0: http://linux-libre.fsfla.org/pub/linux-libre/freed-ora/src/linux%{?base
Source3: deblob-main
Source4: deblob-check
Source5: deblob-%{kversion}
-# Source6: deblob-3.%{upstream_sublevel}
+Source6: deblob-3.%{upstream_sublevel}
%if %{signmodules}
Source11: genkey
@@ -650,11 +641,12 @@ Source70: config-s390x
Source90: config-sparc64-generic
Source100: config-arm-generic
-Source110: config-arm-omap-generic
+Source110: config-arm-omap
Source111: config-arm-tegra
Source112: config-arm-kirkwood
Source113: config-arm-imx
Source114: config-arm-highbank
+Source115: config-arm-versatile
# This file is intentionally left empty in the stock kernel. Its a nicety
# added for those wanting to do custom rebuilds with altered config opts.
@@ -689,7 +681,7 @@ Patch01: patch%{?gitrevlibre}-3.%{upstream_sublevel}-rc%{rcrev}-git%{gitrev}%{?g
%else
# pre-{base_sublevel+1}-rc1 case
%if 0%{?gitrev}
-Patch00: patch%{?gitrevlibre}-3.%{base_sublevel}-git%{gitrev}%{?gitrevgnu}.bz2
+Patch00: patch%{?gitrevlibre}-3.%{base_sublevel}-git%{gitrev}%{?gitrevgnu}.xz
%endif
%endif
%endif
@@ -718,13 +710,11 @@ Patch09: linux-2.6-upstream-reverts.patch
Patch100: taint-vbox.patch
Patch160: linux-2.6-32bit-mmap-exec-randomization.patch
Patch161: linux-2.6-i386-nx-emulation.patch
-
-Patch383: linux-2.6-defaults-aspm.patch
+Patch162: nx-emu-remove-cpuinitdata-for-disable_nx-on-x86_32.patch
Patch390: linux-2.6-defaults-acpi-video.patch
Patch391: linux-2.6-acpi-video-dos.patch
Patch394: linux-2.6-acpi-debug-infinite-loop.patch
-Patch395: acpi-ensure-thermal-limits-match-cpu-freq.patch
Patch396: acpi-sony-nonvs-blacklist.patch
Patch450: linux-2.6-input-kill-stupid-messages.patch
@@ -733,7 +723,6 @@ Patch452: linux-2.6.30-no-pcspkr-modalias.patch
Patch460: linux-2.6-serial-460800.patch
Patch470: die-floppy-die.patch
-Patch471: floppy-Remove-_hlt-related-functions.patch
Patch510: linux-2.6-silence-noise.patch
Patch520: quite-apm.patch
@@ -748,7 +737,6 @@ Patch900: modsign-20111207.patch
# virt + ksm patches
Patch1555: fix_xen_guest_on_old_EC2.patch
-Patch1556: linux-3.3-virtio-scsi.patch
# DRM
#atch1700: drm-edid-try-harder-to-fix-up-broken-headers.patch
@@ -771,15 +759,12 @@ Patch2900: linux-2.6-v4l-dvb-update.patch
Patch2901: linux-2.6-v4l-dvb-experimental.patch
# fs fixes
-Patch4000: ext4-fix-resize-when-resizing-within-single-group.patch
# NFSv4
-Patch1101: linux-3.1-keys-remove-special-keyring.patch
-Patch1102: linux-3.3-newidmapper-01.patch
-Patch1103: linux-3.3-newidmapper-02.patch
-Patch1104: linux-3.3-newidmapper-03.patch
# patches headed upstream
+Patch10000: fs-proc-devtree-remove_proc_entry.patch
+
Patch12016: disable-i8042-check-on-apple-mac.patch
Patch12303: dmar-disable-when-ricoh-multifunction.patch
@@ -790,52 +775,50 @@ Patch14000: hibernate-freeze-filesystems.patch
Patch14010: lis3-improve-handling-of-null-rate.patch
-Patch20000: utrace.patch
-
+# ARM
# Flattened devicetree support
Patch21000: arm-omap-dt-compat.patch
Patch21001: arm-smsc-support-reading-mac-address-from-device-tree.patch
+
+# ARM tegra
Patch21004: arm-tegra-nvec-kconfig.patch
+Patch21005: arm-tegra-usb-no-reset-linux33.patch
-# highbank patches
+# ARM highbank patches
# Highbank clock functions need to be EXPORT for module builds
Patch21010: highbank-export-clock-functions.patch
-Patch21070: ext4-Support-check-none-nocheck-mount-options.patch
-
-Patch21092: udlfb-remove-sysfs-framebuffer-device-with-USB-disconnect.patch
-
-Patch21093: rt2x00_fix_MCU_request_failures.patch
-
Patch21094: power-x86-destdir.patch
-Patch21095: hfsplus-Change-finder_info-to-u32.patch
-Patch21096: hfsplus-Add-an-ioctl-to-bless-files.patch
-
-#rhbz 788260
-Patch21233: jbd2-clear-BH_Delay-and-BH_Unwritten-in-journal_unmap_buf.patch
+Patch21098: hfsplus-Fix-bless-ioctl-when-used-with-hardlinks.patch
#rhbz 754518
Patch21235: scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch
-Patch21250: mcelog-rcu-splat.patch
Patch21260: x86-Avoid-invoking-RCU-when-CPU-is-idle.patch
-#rhbz 795544
-Patch21280: ums_realtek-do-not-use-stack-memory-for-DMA-in-__do_.patch
+#rhbz 804957 CVE-2012-1568
+Patch21306: shlib_base_randomize.patch
-#rhbz 727865 730007
-Patch21300: ACPICA-Fix-regression-in-FADT-revision-checks.patch
+Patch21400: unhandled-irqs-switch-to-polling.patch
-#rhbz 728478
-Patch21302: sony-laptop-Enable-keyboard-backlight-by-default.patch
+Patch21620: vgaarb-vga_default_device.patch
-#rhbz 803809 CVE-2012-1179
-Patch21304: mm-thp-fix-pmd_bad-triggering.patch
+Patch22000: weird-root-dentry-name-debug.patch
-Patch21400: unhandled-irqs-switch-to-polling.patch
+#selinux ptrace child permissions
+Patch22001: selinux-apply-different-permission-to-ptrace-child.patch
-Patch22000: weird-root-dentry-name-debug.patch
+#rhbz 814278 814289 CVE-2012-2119
+Patch22007: macvtap-zerocopy-validate-vector-length.patch
+
+#rhbz 817298
+Patch22013: ipw2x00-add-supported-cipher-suites-to-wiphy-initialization.patch
+
+#rhbz 749276
+Patch22018: atl1c_net_next_update-3.4.patch
+
+# END OF PATCH DEFINITIONS
%endif
@@ -1249,9 +1232,7 @@ ApplyOptionalPatch()
# we don't want a .config file when building firmware: it just confuses the build system
%define build_firmware \
- mv .config .config.firmware_save \
make INSTALL_FW_PATH=$RPM_BUILD_ROOT/lib/firmware firmware_install \
- mv .config.firmware_save .config
# First we unpack the kernel tarball.
# If this isn't the first make prep, we use links to the existing clean tarball
@@ -1288,6 +1269,23 @@ ApplyOptionalPatch()
sharedirs=$(find "$PWD" -maxdepth 1 -type d -name 'kernel-3.*' \
| grep -x -v "$PWD"/kernel-%{kversion}%{?dist}) ||:
+# Delete all old stale trees.
+if [ -d kernel-%{kversion}%{?dist} ]; then
+ cd kernel-%{kversion}%{?dist}
+ for i in linux-*
+ do
+ if [ -d $i ]; then
+ # Just in case we ctrl-c'd a prep already
+ rm -rf deleteme.%{_target_cpu}
+ # Move away the stale away, and delete in background.
+ mv $i deleteme-$i
+ rm -rf deleteme* &
+ fi
+ done
+ cd ..
+fi
+
+# Generate new tree
if [ ! -d kernel-%{kversion}%{?dist}/vanilla-%{vanillaversion} ]; then
if [ -d kernel-%{kversion}%{?dist}/vanilla-%{kversion} ]; then
@@ -1355,7 +1353,7 @@ perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION =%{?stablegnux}/" vanilla-%{kversi
perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION =%{?gitrevgnux}/" Makefile
%endif
%if 0%{?gitrev}
- ApplyPatch patch%{?gitrevlibre}-3.%{base_sublevel}-git%{gitrev}%{?gitrevgnu}.bz2
+ ApplyPatch patch%{?gitrevlibre}-3.%{base_sublevel}-git%{gitrev}%{?gitrevgnu}.xz
%endif
%endif
@@ -1373,14 +1371,6 @@ else
fi
# Now build the fedora kernel tree.
-if [ -d linux-%{KVERREL} ]; then
- # Just in case we ctrl-c'd a prep already
- rm -rf deleteme.%{_target_cpu}
- # Move away the stale away, and delete in background.
- mv linux-%{KVERREL} deleteme.%{_target_cpu}
- rm -rf deleteme.%{_target_cpu} &
-fi
-
cp -rl vanilla-%{vanillaversion} linux-%{KVERREL}
cd linux-%{KVERREL}
@@ -1445,33 +1435,29 @@ ApplyPatch taint-vbox.patch
# x86(-64)
ApplyPatch linux-2.6-32bit-mmap-exec-randomization.patch
ApplyPatch linux-2.6-i386-nx-emulation.patch
+ApplyPatch nx-emu-remove-cpuinitdata-for-disable_nx-on-x86_32.patch
#
# ARM
#
-#pplyPatch arm-omap-dt-compat.patch
-ApplyPatch arm-smsc-support-reading-mac-address-from-device-tree.patch
+#ApplyPatch arm-omap-dt-compat.patch
+#ApplyPatch arm-smsc-support-reading-mac-address-from-device-tree.patch
ApplyPatch arm-tegra-nvec-kconfig.patch
+ApplyPatch arm-tegra-usb-no-reset-linux33.patch
#
# bugfixes to drivers and filesystems
#
# ext4
-ApplyPatch ext4-fix-resize-when-resizing-within-single-group.patch
# xfs
# btrfs
-
# eCryptfs
# NFSv4
-ApplyPatch linux-3.1-keys-remove-special-keyring.patch
-ApplyPatch linux-3.3-newidmapper-01.patch
-ApplyPatch linux-3.3-newidmapper-02.patch
-ApplyPatch linux-3.3-newidmapper-03.patch
# USB
@@ -1481,14 +1467,11 @@ ApplyPatch linux-3.3-newidmapper-03.patch
ApplyPatch linux-2.6-defaults-acpi-video.patch
ApplyPatch linux-2.6-acpi-video-dos.patch
ApplyPatch linux-2.6-acpi-debug-infinite-loop.patch
-ApplyPatch acpi-ensure-thermal-limits-match-cpu-freq.patch
ApplyPatch acpi-sony-nonvs-blacklist.patch
#
# PCI
#
-# enable ASPM by default on hardware we expect to work
-ApplyPatch linux-2.6-defaults-aspm.patch
#
# SCSI Bits.
@@ -1506,7 +1489,6 @@ ApplyPatch linux-2.6-input-kill-stupid-messages.patch
# stop floppy.ko from autoloading during udev...
ApplyPatch die-floppy-die.patch
-ApplyPatch floppy-Remove-_hlt-related-functions.patch
ApplyPatch linux-2.6.30-no-pcspkr-modalias.patch
@@ -1557,60 +1539,52 @@ ApplyOptionalPatch linux-2.6-v4l-dvb-update.patch
ApplyOptionalPatch linux-2.6-v4l-dvb-experimental.patch
# Patches headed upstream
+ApplyPatch fs-proc-devtree-remove_proc_entry.patch
+
ApplyPatch disable-i8042-check-on-apple-mac.patch
-ApplyPatch linux-3.3-virtio-scsi.patch
# rhbz#605888
ApplyPatch dmar-disable-when-ricoh-multifunction.patch
ApplyPatch efi-dont-map-boot-services-on-32bit.patch
-ApplyPatch hibernate-freeze-filesystems.patch
+# FIXME: REBASE
+#ApplyPatch hibernate-freeze-filesystems.patch
ApplyPatch lis3-improve-handling-of-null-rate.patch
-# utrace.
-ApplyPatch utrace.patch
-
-ApplyPatch ext4-Support-check-none-nocheck-mount-options.patch
-
-ApplyPatch udlfb-remove-sysfs-framebuffer-device-with-USB-disconnect.patch
-
-#rhbz 772772
-ApplyPatch rt2x00_fix_MCU_request_failures.patch
-
ApplyPatch power-x86-destdir.patch
-ApplyPatch hfsplus-Change-finder_info-to-u32.patch
-ApplyPatch hfsplus-Add-an-ioctl-to-bless-files.patch
-
-#rhbz 788269
-ApplyPatch jbd2-clear-BH_Delay-and-BH_Unwritten-in-journal_unmap_buf.patch
+ApplyPatch hfsplus-Fix-bless-ioctl-when-used-with-hardlinks.patch
#rhbz 754518
ApplyPatch scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch
-ApplyPatch mcelog-rcu-splat.patch
-
-#rhbz 795544
-ApplyPatch ums_realtek-do-not-use-stack-memory-for-DMA-in-__do_.patch
-
-#rhbz 727865 730007
-ApplyPatch ACPICA-Fix-regression-in-FADT-revision-checks.patch
-
-#rhbz 728478
-ApplyPatch sony-laptop-Enable-keyboard-backlight-by-default.patch
+#rhbz 804957 CVE-2012-1568
+ApplyPatch shlib_base_randomize.patch
ApplyPatch unhandled-irqs-switch-to-polling.patch
ApplyPatch weird-root-dentry-name-debug.patch
-#rhbz 803809 CVE-2012-1179
-ApplyPatch mm-thp-fix-pmd_bad-triggering.patch
+#selinux ptrace child permissions
+ApplyPatch selinux-apply-different-permission-to-ptrace-child.patch
#Highbank clock functions
ApplyPatch highbank-export-clock-functions.patch
+#vgaarb patches. blame mjg59
+ApplyPatch vgaarb-vga_default_device.patch
+
+#rhbz 814278 814289 CVE-2012-2119
+ApplyPatch macvtap-zerocopy-validate-vector-length.patch
+
+#rhbz 817298
+ApplyPatch ipw2x00-add-supported-cipher-suites-to-wiphy-initialization.patch
+
+#rhbz 749276
+ApplyPatch atl1c_net_next_update-3.4.patch
+
# END OF PATCH APPLICATIONS
%endif
@@ -1638,23 +1612,17 @@ done
rm -f kernel-%{version}-*debug.config
%endif
-# now run oldconfig over all the config files
-for i in *.config
-do
- mv $i .config
- Arch=`head -1 .config | cut -b 3-`
- make ARCH=$Arch listnewconfig | grep -E '^CONFIG_' >.newoptions || true
-%if %{listnewconfig_fail}
- if [ -s .newoptions ]; then
- cat .newoptions
- exit 1
- fi
-%endif
- rm -f .newoptions
- make ARCH=$Arch oldnoconfig
- echo "# $Arch" > configs/$i
- cat .config >> configs/$i
-done
+# run oldconfig over the config files (except when noarch)
+if [ "%{_target_cpu}" != "noarch" ]; then
+ for i in kernel-*-%{_target_cpu}*.config
+ do
+ mv $i .config
+ Arch=`head -1 .config | cut -b 3-`
+ make ARCH=$Arch oldnoconfig
+ echo "# $Arch" > configs/$i
+ cat .config >> configs/$i
+ done
+fi
# end of kernel config
%endif
@@ -1761,7 +1729,12 @@ BuildKernel() {
echo USING ARCH=$Arch
make -s ARCH=$Arch oldnoconfig >/dev/null
+%ifarch %{arm}
+ # http://lists.infradead.org/pipermail/linux-arm-kernel/2012-March/091404.html
+ make -s ARCH=$Arch V=1 %{?_smp_mflags} $MakeTarget %{?sparse_mflags} KALLSYMS_EXTRA_PASS=1
+%else
make -s ARCH=$Arch V=1 %{?_smp_mflags} $MakeTarget %{?sparse_mflags}
+%endif
make -s ARCH=$Arch V=1 %{?_smp_mflags} modules %{?sparse_mflags} || exit 1
# Start installing the results
@@ -1784,6 +1757,11 @@ BuildKernel() {
$RPM_BUILD_ROOT/%{image_install_path}/$InstallName-$KernelVer
chmod 755 $RPM_BUILD_ROOT/%{image_install_path}/$InstallName-$KernelVer
+ # hmac sign the kernel for FIPS
+ echo "Creating hmac file: $RPM_BUILD_ROOT/%{image_install_path}/.vmlinuz-$KernelVer.hmac"
+ ls -l $RPM_BUILD_ROOT/%{image_install_path}/$InstallName-$KernelVer
+ sha512hmac $RPM_BUILD_ROOT/%{image_install_path}/$InstallName-$KernelVer | sed -e "s,$RPM_BUILD_ROOT,," > $RPM_BUILD_ROOT/%{image_install_path}/.vmlinuz-$KernelVer.hmac;
+
mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer
# Override $(mod-fw) because we don't want it to install any firmware
# we'll get it from the linux-firmware package and we don't want conflicts
@@ -1929,7 +1907,17 @@ BuildKernel() {
then
continue
else
- echo $mod.ko >> req.list
+ # check if the module we're looking at is in mod-extra too. if so
+ # we don't need to mark the dep as required
+ mod2=`basename $dep`
+ match2=`grep "^$mod2" mod-extra.list` ||:
+ if [ -n "$match2" ]
+ then
+ continue
+ #echo $mod2 >> notreq.list
+ else
+ echo $mod.ko >> req.list
+ fi
fi
done
done
@@ -2032,7 +2020,7 @@ BuildKernel %make_target %kernel_image smp
%endif
%global perf_make \
- make %{?_smp_mflags} -C tools/perf -s V=1 EXTRA_CFLAGS="-Wno-error=array-bounds" HAVE_CPLUS_DEMANGLE=1 prefix=%{_prefix}
+ make %{?_smp_mflags} -C tools/perf -s V=1 WERROR=0 HAVE_CPLUS_DEMANGLE=1 prefix=%{_prefix}
%if %{with_perf}
# perf
%{perf_make} all
@@ -2424,6 +2412,7 @@ fi
%{expand:%%files %{?2}}\
%defattr(-,root,root)\
/%{image_install_path}/%{?-k:%{-k*}}%{!?-k:vmlinuz}-%{KVERREL}%{?2:.%{2}}\
+/%{image_install_path}/.vmlinuz-%{KVERREL}%{?2:.%{2}}.hmac \
%attr(600,root,root) /boot/System.map-%{KVERREL}%{?2:.%{2}}\
/boot/config-%{KVERREL}%{?2:.%{2}}\
%dir /lib/modules/%{KVERREL}%{?2:.%{2}}\
@@ -2477,6 +2466,292 @@ fi
# ||----w |
# || ||
%changelog
+* Wed May 16 2012 Alexandre Oliva <lxoliva@fsfla.org> -libre
+- GNU Linux-libre 3.4-rc7-gnu
+- Fix kernel-libre-firmware build
+
+* Wed May 16 2012 Josh Boyer <jwboyer@redhat.com> - 3.4.0-0.rc7.git2.1
+- Linux v3.4-rc7-24-g568b445
+
+* Tue May 15 2012 Josh Boyer <jwboyer@redhat.com>
+- Enable Nilfs2 and put it in modules-extra (rhbz 821702)
+
+* Tue May 15 2012 Dennis Gilmore <dennis@ausil.us>
+- dont build a up kernel on armv5tel
+
+* Tue May 15 2012 Josh Boyer <jwboyer@redhat.com> - 3.4.0-0.rc7.git1.1
+- Fixup atl1c register programming (rhbz 749276)
+- Linux v3.4-rc7-21-gb6255ee
+
+* Tue May 15 2012 Dennis Gilmore <dennis@ausil.us>
+- make sure smp is on in generic arm config
+- tweak vexpress config
+
+* Mon May 14 2012 Josh Boyer <jwboyer@redhat.com>
+- Enable DRM_VIA again per Adam Jackson
+
+* Mon May 14 2012 Josh Boyer <jwboyer@redhat.com> - 3.4.0-0.rc7.git0.2
+- Reenable debugging options.
+
+* Sun May 13 2012 Josh Boyer <jwboyer@redhat.com> - 3.4.0-0.rc7.git0.1
+- Linux v3.4-rc7
+- Disable debugging options.
+
+* Fri May 11 2012 Josh Boyer <jwboyer@redaht.com>
+- Enable CONFIG_NFSD_FAULT_INJECTION on debug builds (suggested by Jeff Layton)
+- Enable CONFIG_SUNRPC_DEBUG (pointed out by Jeff Layton)
+
+* Fri May 11 2012 Josh Boyer <jwboyer@redhat.com> - 3.4.0-0.rc6.git3.1
+- Linux v3.4-rc6-76-gd60b9c1
+
+* Thu May 10 2012 Josh Boyer <jwboyer@redhat.com> - 3.4.0-0.rc6.git2.2
+- Fix normal kernel builds
+
+* Thu May 10 2012 Josh Boyer <jwboyer@redhat.com> - 3.4.0-0.rc6.git2.1
+- Linux v3.4-rc6-41-g7ee94d9
+
+* Thu May 10 2012 Peter Robinson <pbrobinson@fedoraproject.org>
+- Build in MMC on VExpress so we can boot using qemu
+
+* Tue May 8 2012 Peter Robinson <pbrobinson@fedoraproject.org>
+- Restructure ARM configs to minimise duplication and pull all generic options
+- Spilt Versatile config and use Express chip into dedicated config for qemu
+
+* Tue May 08 2012 Josh Boyer <jwboyer@redhat.com> - 3.4.0-0.rc6.git1.1
+- Linux v3.4-rc6-20-g789505b
+
+* Tue May 08 2012 Josh Boyer <jwboyer@redhat.com> - 3.4.0-0.rc6.git0.2
+- Reenable debugging options.
+
+* Mon May 07 2012 Dave Jones <davej@redhat.com>
+- Remove /proc/device-tree when openfirmware init fails. (rhbz 818378)
+
+* Mon May 07 2012 Josh Boyer <jwboyer@redhat.com> - 3.4.0-0.rc6.git0.1
+- Linux v3.4-rc6
+- Disable debugging options.
+
+* Sat May 05 2012 Josh Boyer <jwboyer@redhat.com> - 3.4.0-0.rc5.git5.1
+- Linux v3.4-rc5-208-g6f24f89
+
+* Fri May 04 2012 Josh Boyer <jwboyer@redhat.com> - 3.4.0-0.rc5.git4.1
+- Linux v3.4-rc5-183-g0a6ba09
+
+* Thu May 03 2012 Dennis Gilmore <dennis@ausil.us>
+- enable omap KMS driver
+
+* Thu May 3 2012 Peter Robinson <pbrobinson@fedoraproject.org>
+- Patch for disconnect issues with storage attached to a tegra-ehci controller
+
+* Thu May 03 2012 Justin M. Forbes <jforbes@redhat.com>
+- Reenable slip and add to module-extras (rhbz 818308)
+
+* Wed May 02 2012 Josh Boyer <jwboyer@redhat.com>
+- Disable PCIEPORTBUS on ppc64 per IBM request
+
+* Wed May 02 2012 Josh Boyer <jwboyer@redhat.com> - 3.4.0-0.rc5.git3.1
+- Linux v3.4-rc5-62-g529acf5
+
+* Tue May 01 2012 Josh Boyer <jwboyer@redhat.com> - 3.4.0-0.rc5.git2.1
+- Drop merged patch. Drink coffee before doing build.
+- Linux v3.4-rc5-34-g655861e
+
+* Mon Apr 30 2012 Josh Boyer <jwboyer@redhat.com> - 3.4.0-0.rc5.git1.1
+- Linux v3.4-rc5-8-g8a7dc4b
+
+* Mon Apr 30 2012 Josh Boyer <jwboyer@redhat.com>
+- Backport ipw2x00 nl80211 cipher suite reporting (rhbz 817298)
+
+* Mon Apr 30 2012 Josh Boyer <jwboyer@redhat.com> - 3.4.0-0.rc5.git0.3
+- Reenable debugging options.
+
+* Mon Apr 30 2012 Josh Boyer <jwboyer@redhat.com> - 3.4.0-0.rc5.git0.2
+- Linux v3.4-rc5
+- Disable debugging options.
+
+* Sat Apr 28 2012 Josh Boyer <jwboyer@redhat.com> - 3.4.0-0.rc4.git4.1
+- Linux v3.4-rc4-308-gf7b0069
+
+* Fri Apr 27 2012 Josh Boyer <jwboyer@redhat.com> - 3.4.0-0.rc4.git3.1
+- Linux v3.4-rc4-180-g82b7690
+
+* Thu Apr 26 2012 Josh Boyer <jwboyer@redhat.com> - 3.4.0-0.rc4.git2.1
+- Linux v3.4-rc4-135-g2300fd6
+
+* Tue Apr 24 2012 Josh Boyer <jwboyer@redhat.com> - 3.4.0-0.rc4.git1.1
+- Linux v3.4-rc4-95-g95f7147
+
+* Tue Apr 24 2012 Josh Boyer <jwboyer@redhat.com>
+- Add patch to fix ipw2200 (rhbz 802106)
+
+* Mon Apr 23 2012 Peter Hutterer <peter.hutterer@redhat.com>
+- Fix regression on clickpads
+
+* Mon Apr 23 2012 Josh Boyer <jwboyer@gmail.com> - 3.4.0-0.rc4.git0.2
+- Add GMA3600 (Cedarview) support (rhbz 810686)
+- Reenable debugging options.
+
+* Mon Apr 23 2012 Josh Boyer <jwboyer@gmail.com> - 3.4.0-0.rc4.git0.1
+- Disable debugging options.
+- Linux v3.4-rc4
+
+* Fri Apr 20 2012 Josh Boyer <jwboyer@redhat.com>
+- Move the dlm module to modules-extra and do additional cleanup (rhbz 811547)
+
+* Fri Apr 20 2012 Justin M. Forbes <jforbes@redhat.com> - 3.4.0-0.rc3.git4.1
+- Linux v3.4-rc3-89-gc6f5c93
+
+* Thu Apr 19 2012 Justin M. Forbes <jforbes@redhat.com> - 3.4.0-0.rc3.git3.1
+- Linux v3.4-rc3-65-g9b7f43a
+
+* Thu Apr 19 2012 Justin M. Forbes <jforbes@redhat.com>
+- CVE-2012-2119 macvtap: zerocopy: vector length is not validated before
+ pinning user pages (rhbz 814278 814289)
+
+* Thu Apr 19 2012 Justin M. Forbes <jforbes@redhat.com>
+- CVE-2012-2121: Fix KVM device assignment page leak (rhbz 814149 814155)
+
+* Wed Apr 18 2012 Justin M. Forbes <jforbes@redhat.com> - 3.4.0-0.rc3.git2.1
+- Linux v3.4-rc3-36-g592fe89
+
+* Wed Apr 18 2012 Josh Boyer <jwboyer@redhat.com>
+- Fix hfsplus bless ioctl with hardlinks (from Matthew Garrett)
+- Change patch to resolve libata hotplug (rhbz 807632)
+
+* Tue Apr 17 2012 Josh Boyer <jwboyer@redhat.com>
+- Move the dlm module to modules-extra (rhbz 811547)
+
+* Tue Apr 17 2012 Justin M. Forbes <jforbes@redhat.com> - 3.4.0-0.rc3.git1.1
+- Linux v3.4-rc3-17-g4643b05
+
+* Tue Apr 17 2012 Josh Boyer <jwboyer@redhat.com>
+- Fix oops on invalid AMD microcode load (rhbz 797559)
+
+* Mon Apr 16 2012 Josh Boyer <jwboyer@redhat.com>
+- Add and use vga_default_device patches (requested by Matthew Garrett)
+- Enable Apple gmux driver
+
+* Mon Apr 16 2012 Justin M. Forbes <jforbes@redhat.com> - 3.4.0-0.rc3.git0.2
+- Reenable debugging options.
+
+* Mon Apr 16 2012 John W. Linville <linville@redhat.com>
+- Disable CONFIG_WIRELESS_EXT_SYSFS (long deprecated upstream)
+
+* Mon Apr 16 2012 Justin M. Forbes <jforbes@redhat.com> - 3.4.0-0.rc3.git0.1
+- Linux v3.4-rc3
+- Disable debugging options.
+
+* Fri Apr 13 2012 Justin M. Forbes <jforbes@redhat.com> - 3.4.0-0.rc2.git3.1
+- Linux v3.4-rc2-269-g4166fb6
+
+* Thu Apr 12 2012 Justin M. Forbes <jforbes@redhat.com> - 3.4.0-0.rc2.git2.1
+- Linux v3.4-rc2-174-gecca5c3
+
+* Thu Apr 12 2012 Dennis Gilmore <dennis@ausil.us>
+- KALLSYMS_EXTRA_PASS=1 has to be passed in on the command line so do so only for arm
+
+* Wed Apr 11 2012 Peter Robinson <pbrobinson@fedoraproject.org>
+- update ARM configs, rename arm-omap
+
+* Wed Apr 11 2012 Dennis Gilmore <dennis@ausil.us>
+- set KALLSYMS_EXTRA_PASS=1 on arm arches
+
+* Wed Apr 11 2012 Justin M. Forbes <jforbes@redhat.com>
+- enable HyperV drivers
+
+* Wed Apr 11 2012 Justin M. Forbes <jforbes@redhat.com> - 3.4.0-0.rc2.git1.1
+- Linux v3.4-rc2-23-g923e9a1
+
+* Tue Apr 10 2012 Josh Boyer <jwboyer@redhat.com>
+- Disable the PMAC ide driver. PATA_MACIO seems to work (rhbz 810579)
+- Backport fixes for correct register constraints in cmpxchg.h (rhbz 809014)
+
+* Mon Apr 09 2012 Justin M. Forbes <jforbes@redhat.com> - 3.4.0-0.rc2.git0.3
+- Reenable debugging options.
+
+* Mon Apr 09 2012 Justin M. Forbes <jforbes@redhat.com>
+- SELinux apply a different permission to ptrace a child vs non-child
+
+* Mon Apr 09 2012 Justin M. Forbes <jforbes@redhat.com> - 3.4.0-0.rc2.git0.2
+- Disable debugging options.
+
+* Mon Apr 09 2012 Justin M. Forbes <jforbes@redhat.com> - 3.4.0-0.rc2
+- Linux v3.4-rc2
+
+* Fri Apr 06 2012 Justin M. Forbes <jforbes@redhat.com> - 3.4.0-0.rc1.git3.1
+- Linux v3.4-rc1-349-g314489b
+
+* Thu Apr 05 2012 Justin M. Forbes <jforbes@redhat.com> - 3.4.0-0.rc1.git2.1
+- Linux v3.4-rc1-246-g6c216ec
+- Turn off CONFIG_RCU_FAST_NO_HZ until it is fixed upstream
+
+* Thu Apr 05 2012 Dave Jones <davej@redhat.com>
+- Better watermark the number of pages used by hibernation I/O (Bojan Smojver) (rhbz 785384)
+
+* Wed Apr 04 2012 Josh Boyer <jwboyer@redhat.com>
+- Disable runtime PM for hotpluggable ATA ports (rhbz 806676 807632)
+
+* Tue Apr 03 2012 Justin M. Forbes <jforbes@redhat.com> - 3.4.0-0.rc1.git1.2
+- BTRFS use after free patch
+
+* Tue Apr 03 2012 Justin M. Forbes <jforbes@redhat.com> - 3.4.0-0.rc1.git1.2
+- Reenable debugging options.
+
+* Tue Apr 03 2012 Justin M. Forbes <jforbes@redhat.com> - 3.4.0-0.rc1.git1.1
+- Linux v3.4-rc1-144-g01627d9
+
+* Tue Apr 03 2012 Josh Boyer <jwboyer@redhat.com>
+- Fix crash in uvc_video_clock_update from Laurent Pinchart (rhbz 806433)
+
+* Mon Apr 02 2012 Justin M. Forbes <jforbes@redhat.com> - 3.4.0-0.rc1.git0.2
+- Fix config since koji preps as noarch
+
+* Mon Apr 02 2012 Justin M. Forbes <jforbes@redhat.com> - 3.4.0-0.rc1.git0.2
+- Disable debugging options.
+
+* Mon Apr 02 2012 Justin M. Forbes <jforbes@redhat.com> - 3.4.0-0.rc1
+- Linux v3.4-rc1
+
+* Fri Mar 30 2012 Justin M. Forbes <jforbes@redhat.com> - 3.4.0-0.rc0.git5.1
+- Linux v3.3-9295-gf52b69f
+
+* Fri Mar 30 2012 Dave Jones <davej@redhat.com>
+- Change config parsing to use {_target_cpu} (From Niels de Vos)
+
+* Thu Mar 29 2012 Justin M. Forbes <jforbes@redhat.com> - 3.4.0-0.rc0.git4.1
+- Linux v3.3-8839-gb5174fa
+
+* Thu Mar 29 2012 Josh Boyer <jwboyer@redhat.com>
+- Drop __cpuinitdata on disable_nx for x86_32 (rhbz 808075)
+
+* Wed Mar 28 2012 Josh Boyer <jwboyer@redhat.com>
+- Move 9p modules back to main package for KVM (rhbz 807733)
+
+* Wed Mar 28 2012 Justin M. Forbes <jforbes@redhat.com> - 3.4.0-0.rc0.git3.1
+- Linux v3.3-7919-g6658a69
+
+* Mon Mar 26 2012 Justin M. Forbes <jforbes@redhat.com> - 3.4.0-0.rc0.git2.1
+- Linux v3.3-6972-ge22057c
+
+* Thu Mar 22 2012 Dave Jones <davej@redhat.com> 3.4.0-0.rc0.git1.2
+- Fix occasional EBADMSG from signed modules. (rhbz 804345)
+
+* Thu Mar 22 2012 Dave Jones <davej@redhat.com>
+- Fix dentry hash collisions that prevented boot with selinux enabled (rhbz 805371)
+
+* Thu Mar 22 2012 Dave Jones <davej@redhat.com> 3.4.0-0.rc0.git1.1
+- Linux v3.3-4074-g5375871
+
+* Wed Mar 21 2012 Josh Boyer <jwboyer@redhat.com>
+- Ship hmac file for vmlinuz for FIPS-140 (rhbz 805538)
+
+* Tue Mar 20 2012 Josh Boyer <jwboyer@redhat.com>
+- CVE-2012-1568: execshield: predictable ascii armour base address (rhbz 804957)
+- mac80211: fix possible tid_rx->reorder_timer use after free
+ from Stanislaw Gruska (rhbz 804007)
+
+* Mon Mar 19 2012 Dave Jones <davej@redhat.com> - 3.3.0-3
+- Reenable debugging options.
+
* Mon Mar 19 2012 Alexandre Oliva <lxoliva@fsfla.org> -libre
- GNU Linux-libre 3.3-gnu
diff --git a/freed-ora/current/master/libata-forbid-port-runtime-pm-by-default.patch b/freed-ora/current/master/libata-forbid-port-runtime-pm-by-default.patch
new file mode 100644
index 000000000..0d93a19f5
--- /dev/null
+++ b/freed-ora/current/master/libata-forbid-port-runtime-pm-by-default.patch
@@ -0,0 +1,24 @@
+From: Lin Ming <ming.m.lin@xxxxxxxxx>
+Date: Wed, 18 Apr 2012 09:13:41 +0800
+Subject: [PATCH] libata: forbid port runtime pm by default
+
+Forbid port runtime pm by default because it has known hotplug issue.
+User can allow it by, for example
+
+echo auto > /sys/devices/pci0000:00/0000:00:1f.2/ata2/power/control
+
+Signed-off-by: Lin Ming <ming.m.lin@xxxxxxxxx>
+---
+ drivers/ata/libata-transport.c | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+--- linux-3.3.noarch.orig/drivers/ata/libata-transport.c
++++ linux-3.3.noarch/drivers/ata/libata-transport.c
+@@ -294,6 +294,7 @@ int ata_tport_add(struct device *parent,
+ device_enable_async_suspend(dev);
+ pm_runtime_set_active(dev);
+ pm_runtime_enable(dev);
++ pm_runtime_forbid(dev);
+
+ transport_add_device(dev);
+ transport_configure_device(dev);
diff --git a/freed-ora/current/master/linux-2.6-32bit-mmap-exec-randomization.patch b/freed-ora/current/master/linux-2.6-32bit-mmap-exec-randomization.patch
index c25323323..e4936991a 100644
--- a/freed-ora/current/master/linux-2.6-32bit-mmap-exec-randomization.patch
+++ b/freed-ora/current/master/linux-2.6-32bit-mmap-exec-randomization.patch
@@ -7,10 +7,96 @@ Heap randomisation test (PIE) : 19 bits (guessed)
Main executable randomisation (PIE) : 12 bits (guessed)
-
---- b/include/linux/sched.h
+diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
+index 1d92a5a..81fef23 100644
+--- a/arch/x86/kernel/process.c
++++ b/arch/x86/kernel/process.c
+@@ -753,6 +753,16 @@ unsigned long arch_align_stack(unsigned long sp)
+ unsigned long arch_randomize_brk(struct mm_struct *mm)
+ {
+ unsigned long range_end = mm->brk + 0x02000000;
+- return randomize_range(mm->brk, range_end, 0) ? : mm->brk;
++ unsigned long bump = 0;
++#ifdef CONFIG_X86_32
++ /* in the case of NX emulation, shove the brk segment way out of the
++ way of the exec randomization area, since it can collide with
++ future allocations if not. */
++ if ( (mm->get_unmapped_exec_area == arch_get_unmapped_exec_area) &&
++ (mm->brk < 0x08000000) ) {
++ bump = (TASK_SIZE/6);
++ }
++#endif
++ return bump + (randomize_range(mm->brk, range_end, 0) ? : mm->brk);
+ }
+
+diff --git a/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c
+index 845df68..d437466 100644
+--- a/arch/x86/mm/mmap.c
++++ b/arch/x86/mm/mmap.c
+@@ -119,6 +119,12 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
+ } else {
+ mm->mmap_base = mmap_base();
+ mm->get_unmapped_area = arch_get_unmapped_area_topdown;
++#ifdef CONFIG_X86_32
++ if (!(current->personality & READ_IMPLIES_EXEC)
++ && !(__supported_pte_mask & _PAGE_NX)
++ && mmap_is_ia32())
++ mm->get_unmapped_exec_area = arch_get_unmapped_exec_area;
++#endif
+ mm->unmap_area = arch_unmap_area_topdown;
+ }
+ }
+diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/vdso/vdso32-setup.c
+index 66e6d93..b80cde7 100644
+--- a/arch/x86/vdso/vdso32-setup.c
++++ b/arch/x86/vdso/vdso32-setup.c
+@@ -330,7 +330,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
+ if (compat)
+ addr = VDSO_HIGH_BASE;
+ else {
+- addr = get_unmapped_area(NULL, 0, PAGE_SIZE, 0, 0);
++ addr = get_unmapped_area_prot(NULL, 0, PAGE_SIZE, 0, 0, 1);
+ if (IS_ERR_VALUE(addr)) {
+ ret = addr;
+ goto up_fail;
+diff --git a/include/linux/mm.h b/include/linux/mm.h
+index 74aa71b..d9971db 100644
+--- a/include/linux/mm.h
++++ b/include/linux/mm.h
+@@ -1391,7 +1391,13 @@ extern int install_special_mapping(struct mm_struct *mm,
+ unsigned long addr, unsigned long len,
+ unsigned long flags, struct page **pages);
+
+-extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
++extern unsigned long get_unmapped_area_prot(struct file *, unsigned long, unsigned long, unsigned long, unsigned long, int);
++
++static inline unsigned long get_unmapped_area(struct file *file, unsigned long addr,
++ unsigned long len, unsigned long pgoff, unsigned long flags)
++{
++ return get_unmapped_area_prot(file, addr, len, pgoff, flags, 0);
++}
+
+ extern unsigned long mmap_region(struct file *file, unsigned long addr,
+ unsigned long len, unsigned long flags,
+diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
+index 3cc3062..b42f00b 100644
+--- a/include/linux/mm_types.h
++++ b/include/linux/mm_types.h
+@@ -293,6 +293,9 @@ struct mm_struct {
+ unsigned long (*get_unmapped_area) (struct file *filp,
+ unsigned long addr, unsigned long len,
+ unsigned long pgoff, unsigned long flags);
++ unsigned long (*get_unmapped_exec_area) (struct file *filp,
++ unsigned long addr, unsigned long len,
++ unsigned long pgoff, unsigned long flags);
+ void (*unmap_area) (struct mm_struct *mm, unsigned long addr);
+ #endif
+ unsigned long mmap_base; /* base of mmap area */
+diff --git a/include/linux/sched.h b/include/linux/sched.h
+index 81a173c..3f9f5c4 100644
+--- a/include/linux/sched.h
+++ b/include/linux/sched.h
-@@ -397,6 +397,10 @@
+@@ -390,6 +390,10 @@ extern void arch_pick_mmap_layout(struct mm_struct *mm);
extern unsigned long
arch_get_unmapped_area(struct file *, unsigned long, unsigned long,
unsigned long, unsigned long);
@@ -21,9 +107,11 @@ Main executable randomisation (PIE) : 12 bits (guessed)
extern unsigned long
arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
unsigned long len, unsigned long pgoff,
---- b/mm/mmap.c
+diff --git a/mm/mmap.c b/mm/mmap.c
+index 848ef52..65650a5 100644
+--- a/mm/mmap.c
+++ b/mm/mmap.c
-@@ -28,6 +28,7 @@
+@@ -30,6 +30,7 @@
#include <linux/perf_event.h>
#include <linux/audit.h>
#include <linux/khugepaged.h>
@@ -31,7 +119,7 @@ Main executable randomisation (PIE) : 12 bits (guessed)
#include <asm/uaccess.h>
#include <asm/cacheflush.h>
-@@ -1000,7 +1001,8 @@
+@@ -995,7 +996,8 @@ static unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
/* Obtain the address to map to. we verify (or select) it and ensure
* that it represents a valid section of the address space.
*/
@@ -41,7 +129,7 @@ Main executable randomisation (PIE) : 12 bits (guessed)
if (addr & ~PAGE_MASK)
return addr;
-@@ -1552,8 +1554,8 @@
+@@ -1580,8 +1582,8 @@ void arch_unmap_area_topdown(struct mm_struct *mm, unsigned long addr)
}
unsigned long
@@ -52,7 +140,7 @@ Main executable randomisation (PIE) : 12 bits (guessed)
{
unsigned long (*get_area)(struct file *, unsigned long,
unsigned long, unsigned long, unsigned long);
-@@ -1566,7 +1568,11 @@
+@@ -1594,7 +1596,11 @@ get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
if (len > TASK_SIZE)
return -ENOMEM;
@@ -65,7 +153,7 @@ Main executable randomisation (PIE) : 12 bits (guessed)
if (file && file->f_op && file->f_op->get_unmapped_area)
get_area = file->f_op->get_unmapped_area;
addr = get_area(file, addr, len, pgoff, flags);
-@@ -1580,8 +1586,83 @@
+@@ -1608,8 +1614,83 @@ get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
return arch_rebalance_pgtables(addr, len);
}
@@ -150,71 +238,11 @@ Main executable randomisation (PIE) : 12 bits (guessed)
/* Look up the first VMA which satisfies addr < vm_end, NULL if none. */
struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr)
---- a/arch/x86/mm/mmap.c
-+++ b/arch/x86/mm/mmap.c
-@@ -124,13 +124,19 @@ static unsigned long mmap_legacy_base(void)
- */
- void arch_pick_mmap_layout(struct mm_struct *mm)
- {
- if (mmap_is_legacy()) {
- mm->mmap_base = mmap_legacy_base();
- mm->get_unmapped_area = arch_get_unmapped_area;
- mm->unmap_area = arch_unmap_area;
- } else {
- mm->mmap_base = mmap_base();
- mm->get_unmapped_area = arch_get_unmapped_area_topdown;
-+#ifdef CONFIG_X86_32
-+ if (!(current->personality & READ_IMPLIES_EXEC)
-+ && !(__supported_pte_mask & _PAGE_NX)
-+ && mmap_is_ia32())
-+ mm->get_unmapped_exec_area = arch_get_unmapped_exec_area;
-+#endif
- mm->unmap_area = arch_unmap_area_topdown;
- }
- }
---- a/arch/x86/vdso/vdso32-setup.c
-+++ b/arch/x86/vdso/vdso32-setup.c
-@@ -331,7 +331,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
- if (compat)
- addr = VDSO_HIGH_BASE;
- else {
-- addr = get_unmapped_area(NULL, 0, PAGE_SIZE, 0, 0);
-+ addr = get_unmapped_area_prot(NULL, 0, PAGE_SIZE, 0, 0, 1);
- if (IS_ERR_VALUE(addr)) {
- ret = addr;
- goto up_fail;
---- a/include/linux/mm.h
-+++ b/include/linux/mm.h
-@@ -1263,7 +1263,13 @@ extern int install_special_mapping(struct mm_struct *mm,
- unsigned long addr, unsigned long len,
- unsigned long flags, struct page **pages);
-
--extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
-+extern unsigned long get_unmapped_area_prot(struct file *, unsigned long, unsigned long, unsigned long, unsigned long, int);
-+
-+static inline unsigned long get_unmapped_area(struct file *file, unsigned long addr,
-+ unsigned long len, unsigned long pgoff, unsigned long flags)
-+{
-+ return get_unmapped_area_prot(file, addr, len, pgoff, flags, 0);
-+}
-
- extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
- unsigned long len, unsigned long prot,
---- a/include/linux/mm_types.h
-+++ b/include/linux/mm_types.h
-@@ -227,6 +227,9 @@ struct mm_struct {
- unsigned long (*get_unmapped_area) (struct file *filp,
- unsigned long addr, unsigned long len,
- unsigned long pgoff, unsigned long flags);
-+ unsigned long (*get_unmapped_exec_area) (struct file *filp,
-+ unsigned long addr, unsigned long len,
-+ unsigned long pgoff, unsigned long flags);
- void (*unmap_area) (struct mm_struct *mm, unsigned long addr);
- #endif
- unsigned long mmap_base; /* base of mmap area */
+diff --git a/mm/mremap.c b/mm/mremap.c
+index db8d983..3a2d940 100644
--- a/mm/mremap.c
+++ b/mm/mremap.c
-@@ -487,10 +487,10 @@ unsigned long do_mremap(unsigned long addr,
+@@ -521,10 +521,10 @@ unsigned long do_mremap(unsigned long addr,
if (vma->vm_flags & VM_MAYSHARE)
map_flags |= MAP_SHARED;
@@ -227,25 +255,3 @@ Main executable randomisation (PIE) : 12 bits (guessed)
if (new_addr & ~PAGE_MASK) {
ret = new_addr;
goto out;
-diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
-index 57d1868..29c0c35 100644
---- a/arch/x86/kernel/process.c
-+++ b/arch/x86/kernel/process.c
-@@ -669,6 +669,16 @@ unsigned long arch_align_stack(unsigned long sp)
- unsigned long arch_randomize_brk(struct mm_struct *mm)
- {
- unsigned long range_end = mm->brk + 0x02000000;
-- return randomize_range(mm->brk, range_end, 0) ? : mm->brk;
-+ unsigned long bump = 0;
-+#ifdef CONFIG_X86_32
-+ /* in the case of NX emulation, shove the brk segment way out of the
-+ way of the exec randomization area, since it can collide with
-+ future allocations if not. */
-+ if ( (mm->get_unmapped_exec_area == arch_get_unmapped_exec_area) &&
-+ (mm->brk < 0x08000000) ) {
-+ bump = (TASK_SIZE/6);
-+ }
-+#endif
-+ return bump + (randomize_range(mm->brk, range_end, 0) ? : mm->brk);
- }
-
diff --git a/freed-ora/current/master/linux-2.6-acpi-debug-infinite-loop.patch b/freed-ora/current/master/linux-2.6-acpi-debug-infinite-loop.patch
index d20025224..f2cc1a55e 100644
--- a/freed-ora/current/master/linux-2.6-acpi-debug-infinite-loop.patch
+++ b/freed-ora/current/master/linux-2.6-acpi-debug-infinite-loop.patch
@@ -1,5 +1,5 @@
---- linux-2.6.34.noarch/drivers/acpi/acpica/acconfig.h~ 2010-07-01 14:49:03.000000000 -0400
-+++ linux-2.6.34.noarch/drivers/acpi/acpica/acconfig.h 2010-07-01 14:49:17.000000000 -0400
+--- linux-2.6.34.noarch/include/acpi/acconfig.h~ 2010-07-01 14:49:03.000000000 -0400
++++ linux-2.6.34.noarch/include/acpi/acconfig.h 2010-07-01 14:49:17.000000000 -0400
@@ -117,7 +117,7 @@
/* Maximum number of While() loop iterations before forced abort */
diff --git a/freed-ora/current/master/linux-2.6-defaults-aspm.patch b/freed-ora/current/master/linux-2.6-defaults-aspm.patch
deleted file mode 100644
index 49b832d2c..000000000
--- a/freed-ora/current/master/linux-2.6-defaults-aspm.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -up linux-2.6.30.noarch/drivers/pci/pcie/aspm.c.mjg linux-2.6.30.noarch/drivers/pci/pcie/aspm.c
---- linux-2.6.30.noarch/drivers/pci/pcie/aspm.c.mjg 2009-07-16 22:01:11.000000000 +0100
-+++ linux-2.6.30.noarch/drivers/pci/pcie/aspm.c 2009-07-16 22:01:30.000000000 +0100
-@@ -65,7 +65,7 @@ static LIST_HEAD(link_list);
- #define POLICY_DEFAULT 0 /* BIOS default setting */
- #define POLICY_PERFORMANCE 1 /* high performance */
- #define POLICY_POWERSAVE 2 /* high power saving */
--static int aspm_policy;
-+static int aspm_policy = POLICY_POWERSAVE;
- static const char *policy_str[] = {
- [POLICY_DEFAULT] = "default",
- [POLICY_PERFORMANCE] = "performance",
diff --git a/freed-ora/current/master/linux-2.6-i386-nx-emulation.patch b/freed-ora/current/master/linux-2.6-i386-nx-emulation.patch
index d1624362b..8a7fe7a47 100644
--- a/freed-ora/current/master/linux-2.6-i386-nx-emulation.patch
+++ b/freed-ora/current/master/linux-2.6-i386-nx-emulation.patch
@@ -333,9 +333,9 @@ index 4d42300..4cb14a1 100644
+#endif /*CONFIG_X86_32*/
+
tsk->thread.error_code = error_code;
- tsk->thread.trap_no = 13;
+ tsk->thread.trap_nr = X86_TRAP_GP;
-@@ -650,19 +745,37 @@ do_device_not_available(struct pt_regs *regs, long error_code)
+@@ -650,20 +745,37 @@ do_device_not_available(struct pt_regs *regs, long error_code)
}
#ifdef CONFIG_X86_32
@@ -362,10 +362,11 @@ index 4d42300..4cb14a1 100644
- info.si_errno = 0;
- info.si_code = ILL_BADSTK;
- info.si_addr = NULL;
-- if (notify_die(DIE_TRAP, "iret exception",
-- regs, error_code, 32, SIGILL) == NOTIFY_STOP)
+- if (notify_die(DIE_TRAP, "iret exception", regs, error_code,
+- X86_TRAP_IRET, SIGILL) == NOTIFY_STOP)
- return;
-- do_trap(32, SIGILL, "iret exception", regs, error_code, &info);
+- do_trap(X86_TRAP_IRET, SIGILL, "iret exception", regs, error_code,
+- &info);
+ cpu = get_cpu();
+ ok = check_lazy_exec_limit(cpu, regs, error_code);
+ put_cpu();
@@ -476,10 +477,10 @@ index 12eb07b..c48ed49 100644
.load_idt = xen_load_idt,
.load_tls = xen_load_tls,
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
-index bcb884e..94e82fa 100644
+index 81878b7..2536ec3 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
-@@ -711,6 +711,15 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
+@@ -711,6 +711,16 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
if (retval)
goto out_free_dentry;
@@ -492,9 +493,10 @@ index bcb884e..94e82fa 100644
+ arch_add_exec_range(current->mm, -1);
+#endif
+
++
/* OK, This is the point of no return */
- current->flags &= ~PF_FORKNOEXEC;
current->mm->def_flags = def_flags;
+
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 7d379a6..90ccb05 100644
--- a/include/linux/sched.h
@@ -576,10 +578,10 @@ index 3f758c7..0e29e1b 100644
err = vma_adjust(vma, vma->vm_start, addr, vma->vm_pgoff, new);
/* Success. */
-@@ -2243,6 +2265,7 @@ void exit_mmap(struct mm_struct *mm)
+@@ -2266,6 +2266,7 @@ void exit_mmap(struct mm_struct *mm)
free_pgtables(&tlb, vma, FIRST_USER_ADDRESS, 0);
- tlb_finish_mmu(&tlb, 0, end);
+ tlb_finish_mmu(&tlb, 0, -1);
+ arch_flush_exec_range(mm);
/*
diff --git a/freed-ora/current/master/linux-3.1-keys-remove-special-keyring.patch b/freed-ora/current/master/linux-3.1-keys-remove-special-keyring.patch
deleted file mode 100644
index 4e7f1395b..000000000
--- a/freed-ora/current/master/linux-3.1-keys-remove-special-keyring.patch
+++ /dev/null
@@ -1,110 +0,0 @@
-diff -up linux-3.1.x86_64/Documentation/networking/dns_resolver.txt.orig linux-3.1.x86_64/Documentation/networking/dns_resolver.txt
---- linux-3.1.x86_64/Documentation/networking/dns_resolver.txt.orig 2011-10-24 03:10:05.000000000 -0400
-+++ linux-3.1.x86_64/Documentation/networking/dns_resolver.txt 2011-12-13 15:09:35.705766078 -0500
-@@ -102,6 +102,10 @@ implemented in the module can be called
- If _expiry is non-NULL, the expiry time (TTL) of the result will be
- returned also.
-
-+The kernel maintains an internal keyring in which it caches looked up keys.
-+This can be cleared by any process that has the CAP_SYS_ADMIN capability by
-+the use of KEYCTL_KEYRING_CLEAR on the keyring ID.
-+
-
- ===============================
- READING DNS KEYS FROM USERSPACE
-diff -up linux-3.1.x86_64/Documentation/security/keys.txt.orig linux-3.1.x86_64/Documentation/security/keys.txt
---- linux-3.1.x86_64/Documentation/security/keys.txt.orig 2011-10-24 03:10:05.000000000 -0400
-+++ linux-3.1.x86_64/Documentation/security/keys.txt 2011-12-13 15:09:35.706766099 -0500
-@@ -554,6 +554,10 @@ The keyctl syscall functions are:
- process must have write permission on the keyring, and it must be a
- keyring (or else error ENOTDIR will result).
-
-+ This function can also be used to clear special kernel keyrings if they
-+ are appropriately marked if the user has CAP_SYS_ADMIN capability. The
-+ DNS resolver cache keyring is an example of this.
-+
-
- (*) Link a key into a keyring:
-
-diff -up linux-3.1.x86_64/fs/cifs/cifsacl.c.orig linux-3.1.x86_64/fs/cifs/cifsacl.c
---- linux-3.1.x86_64/fs/cifs/cifsacl.c.orig 2011-12-13 12:54:12.221145867 -0500
-+++ linux-3.1.x86_64/fs/cifs/cifsacl.c 2011-12-13 15:09:35.707766122 -0500
-@@ -556,6 +556,7 @@ init_cifs_idmap(void)
-
- /* instruct request_key() to use this special keyring as a cache for
- * the results it looks up */
-+ set_bit(KEY_FLAG_ROOT_CAN_CLEAR, &keyring->flags);
- cred->thread_keyring = keyring;
- cred->jit_keyring = KEY_REQKEY_DEFL_THREAD_KEYRING;
- root_cred = cred;
-diff -up linux-3.1.x86_64/fs/nfs/idmap.c.orig linux-3.1.x86_64/fs/nfs/idmap.c
---- linux-3.1.x86_64/fs/nfs/idmap.c.orig 2011-12-13 12:54:14.657203507 -0500
-+++ linux-3.1.x86_64/fs/nfs/idmap.c 2011-12-13 15:10:14.731681691 -0500
-@@ -115,6 +115,7 @@ int nfs_idmap_init(void)
- if (ret < 0)
- goto failed_put_key;
-
-+ set_bit(KEY_FLAG_ROOT_CAN_CLEAR, &keyring->flags);
- cred->thread_keyring = keyring;
- cred->jit_keyring = KEY_REQKEY_DEFL_THREAD_KEYRING;
- id_resolver_cache = cred;
-@@ -185,7 +186,7 @@ static ssize_t nfs_idmap_request_key(con
- }
-
- rcu_read_lock();
-- rkey->perm |= KEY_USR_VIEW;
-+ rkey->perm |= KEY_USR_VIEW|KEY_USR_WRITE;
-
- ret = key_validate(rkey);
- if (ret < 0)
-diff -up linux-3.1.x86_64/include/linux/key.h.orig linux-3.1.x86_64/include/linux/key.h
---- linux-3.1.x86_64/include/linux/key.h.orig 2011-10-24 03:10:05.000000000 -0400
-+++ linux-3.1.x86_64/include/linux/key.h 2011-12-13 15:09:35.748767078 -0500
-@@ -155,6 +155,7 @@ struct key {
- #define KEY_FLAG_IN_QUOTA 3 /* set if key consumes quota */
- #define KEY_FLAG_USER_CONSTRUCT 4 /* set if key is being constructed in userspace */
- #define KEY_FLAG_NEGATIVE 5 /* set if key is negative */
-+#define KEY_FLAG_ROOT_CAN_CLEAR 6 /* set if key can be cleared by root without permission */
-
- /* the description string
- * - this is used to match a key against search criteria
-diff -up linux-3.1.x86_64/net/dns_resolver/dns_key.c.orig linux-3.1.x86_64/net/dns_resolver/dns_key.c
---- linux-3.1.x86_64/net/dns_resolver/dns_key.c.orig 2011-10-24 03:10:05.000000000 -0400
-+++ linux-3.1.x86_64/net/dns_resolver/dns_key.c 2011-12-13 15:09:35.748767078 -0500
-@@ -281,6 +281,7 @@ static int __init init_dns_resolver(void
-
- /* instruct request_key() to use this special keyring as a cache for
- * the results it looks up */
-+ set_bit(KEY_FLAG_ROOT_CAN_CLEAR, &keyring->flags);
- cred->thread_keyring = keyring;
- cred->jit_keyring = KEY_REQKEY_DEFL_THREAD_KEYRING;
- dns_resolver_cache = cred;
-diff -up linux-3.1.x86_64/security/keys/keyctl.c.orig linux-3.1.x86_64/security/keys/keyctl.c
---- linux-3.1.x86_64/security/keys/keyctl.c.orig 2011-12-13 12:54:30.322571289 -0500
-+++ linux-3.1.x86_64/security/keys/keyctl.c 2011-12-13 15:09:35.756767271 -0500
-@@ -388,11 +388,24 @@ long keyctl_keyring_clear(key_serial_t r
- keyring_ref = lookup_user_key(ringid, KEY_LOOKUP_CREATE, KEY_WRITE);
- if (IS_ERR(keyring_ref)) {
- ret = PTR_ERR(keyring_ref);
-+
-+ /* Root is permitted to invalidate certain special keyrings */
-+ if (capable(CAP_SYS_ADMIN)) {
-+ keyring_ref = lookup_user_key(ringid, 0, 0);
-+ if (IS_ERR(keyring_ref))
-+ goto error;
-+ if (test_bit(KEY_FLAG_ROOT_CAN_CLEAR,
-+ &key_ref_to_ptr(keyring_ref)->flags))
-+ goto clear;
-+ goto error_put;
-+ }
-+
- goto error;
- }
-
-+clear:
- ret = keyring_clear(key_ref_to_ptr(keyring_ref));
--
-+error_put:
- key_ref_put(keyring_ref);
- error:
- return ret;
diff --git a/freed-ora/current/master/linux-3.3-newidmapper-01.patch b/freed-ora/current/master/linux-3.3-newidmapper-01.patch
deleted file mode 100644
index 9afbb93fe..000000000
--- a/freed-ora/current/master/linux-3.3-newidmapper-01.patch
+++ /dev/null
@@ -1,217 +0,0 @@
-commit e6499c6f4b5f56a16f8b8ef60529c1da28b13aea
-Author: Bryan Schumaker <bjschuma@netapp.com>
-Date: Thu Jan 26 16:54:23 2012 -0500
-
- NFS: Fall back on old idmapper if request_key() fails
-
- This patch removes the CONFIG_NFS_USE_NEW_IDMAPPER compile option.
- First, the idmapper will attempt to map the id using /sbin/request-key
- and nfsidmap. If this fails (if /etc/request-key.conf is not configured
- properly) then the idmapper will call the legacy code to perform the
- mapping. I left a comment stating where the legacy code begins to make
- it easier for somebody to remove in the future.
-
- Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
- Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-
-diff -up linux-3.2.noarch/fs/nfs/idmap.c.orig linux-3.2.noarch/fs/nfs/idmap.c
---- linux-3.2.noarch/fs/nfs/idmap.c.orig 2012-01-27 10:07:07.209851446 -0500
-+++ linux-3.2.noarch/fs/nfs/idmap.c 2012-01-27 10:15:42.914563082 -0500
-@@ -142,8 +142,6 @@ static int nfs_map_numeric_to_string(__u
- return snprintf(buf, buflen, "%u", id);
- }
-
--#ifdef CONFIG_NFS_USE_NEW_IDMAPPER
--
- #include <linux/cred.h>
- #include <linux/sunrpc/sched.h>
- #include <linux/nfs4.h>
-@@ -328,43 +326,7 @@ static int nfs_idmap_lookup_id(const cha
- return ret;
- }
-
--int nfs_map_name_to_uid(const struct nfs_server *server, const char *name, size_t namelen, __u32 *uid)
--{
-- if (nfs_map_string_to_numeric(name, namelen, uid))
-- return 0;
-- return nfs_idmap_lookup_id(name, namelen, "uid", uid);
--}
--
--int nfs_map_group_to_gid(const struct nfs_server *server, const char *name, size_t namelen, __u32 *gid)
--{
-- if (nfs_map_string_to_numeric(name, namelen, gid))
-- return 0;
-- return nfs_idmap_lookup_id(name, namelen, "gid", gid);
--}
--
--int nfs_map_uid_to_name(const struct nfs_server *server, __u32 uid, char *buf, size_t buflen)
--{
-- int ret = -EINVAL;
--
-- if (!(server->caps & NFS_CAP_UIDGID_NOMAP))
-- ret = nfs_idmap_lookup_name(uid, "user", buf, buflen);
-- if (ret < 0)
-- ret = nfs_map_numeric_to_string(uid, buf, buflen);
-- return ret;
--}
--int nfs_map_gid_to_group(const struct nfs_server *server, __u32 gid, char *buf, size_t buflen)
--{
-- int ret = -EINVAL;
--
-- if (!(server->caps & NFS_CAP_UIDGID_NOMAP))
-- ret = nfs_idmap_lookup_name(gid, "group", buf, buflen);
-- if (ret < 0)
-- ret = nfs_map_numeric_to_string(gid, buf, buflen);
-- return ret;
--}
--
--#else /* CONFIG_NFS_USE_NEW_IDMAPPER not defined */
--
-+/* idmap classic begins here */
- #include <linux/module.h>
- #include <linux/mutex.h>
- #include <linux/init.h>
-@@ -796,19 +758,27 @@ static unsigned int fnvhash32(const void
- int nfs_map_name_to_uid(const struct nfs_server *server, const char *name, size_t namelen, __u32 *uid)
- {
- struct idmap *idmap = server->nfs_client->cl_idmap;
-+ int ret = -EINVAL;
-
- if (nfs_map_string_to_numeric(name, namelen, uid))
- return 0;
-- return nfs_idmap_id(idmap, &idmap->idmap_user_hash, name, namelen, uid);
-+ ret = nfs_idmap_lookup_id(name, namelen, "uid", uid);
-+ if (ret < 0)
-+ ret = nfs_idmap_id(idmap, &idmap->idmap_user_hash, name, namelen, uid);
-+ return ret;
- }
-
--int nfs_map_group_to_gid(const struct nfs_server *server, const char *name, size_t namelen, __u32 *uid)
-+int nfs_map_group_to_gid(const struct nfs_server *server, const char *name, size_t namelen, __u32 *gid)
- {
- struct idmap *idmap = server->nfs_client->cl_idmap;
-+ int ret = -EINVAL;
-
-- if (nfs_map_string_to_numeric(name, namelen, uid))
-+ if (nfs_map_string_to_numeric(name, namelen, gid))
- return 0;
-- return nfs_idmap_id(idmap, &idmap->idmap_group_hash, name, namelen, uid);
-+ ret = nfs_idmap_lookup_id(name, namelen, "gid", gid);
-+ if (ret < 0)
-+ ret = nfs_idmap_id(idmap, &idmap->idmap_group_hash, name, namelen, gid);
-+ return ret;
- }
-
- int nfs_map_uid_to_name(const struct nfs_server *server, __u32 uid, char *buf, size_t buflen)
-@@ -816,22 +786,26 @@ int nfs_map_uid_to_name(const struct nfs
- struct idmap *idmap = server->nfs_client->cl_idmap;
- int ret = -EINVAL;
-
-- if (!(server->caps & NFS_CAP_UIDGID_NOMAP))
-- ret = nfs_idmap_name(idmap, &idmap->idmap_user_hash, uid, buf);
-+ if (!(server->caps & NFS_CAP_UIDGID_NOMAP)) {
-+ ret = nfs_idmap_lookup_name(uid, "user", buf, buflen);
-+ if (ret < 0)
-+ ret = nfs_idmap_name(idmap, &idmap->idmap_user_hash, uid, buf);
-+ }
- if (ret < 0)
- ret = nfs_map_numeric_to_string(uid, buf, buflen);
- return ret;
- }
--int nfs_map_gid_to_group(const struct nfs_server *server, __u32 uid, char *buf, size_t buflen)
-+int nfs_map_gid_to_group(const struct nfs_server *server, __u32 gid, char *buf, size_t buflen)
- {
- struct idmap *idmap = server->nfs_client->cl_idmap;
- int ret = -EINVAL;
-
-- if (!(server->caps & NFS_CAP_UIDGID_NOMAP))
-- ret = nfs_idmap_name(idmap, &idmap->idmap_group_hash, uid, buf);
-+ if (!(server->caps & NFS_CAP_UIDGID_NOMAP)) {
-+ ret = nfs_idmap_lookup_name(gid, "group", buf, buflen);
-+ if (ret < 0)
-+ ret = nfs_idmap_name(idmap, &idmap->idmap_group_hash, gid, buf);
-+ }
- if (ret < 0)
-- ret = nfs_map_numeric_to_string(uid, buf, buflen);
-+ ret = nfs_map_numeric_to_string(gid, buf, buflen);
- return ret;
- }
--
--#endif /* CONFIG_NFS_USE_NEW_IDMAPPER */
-diff -up linux-3.2.noarch/fs/nfs/Kconfig.orig linux-3.2.noarch/fs/nfs/Kconfig
---- linux-3.2.noarch/fs/nfs/Kconfig.orig 2012-01-04 18:55:44.000000000 -0500
-+++ linux-3.2.noarch/fs/nfs/Kconfig 2012-01-27 10:15:42.913562572 -0500
-@@ -132,14 +132,3 @@ config NFS_USE_KERNEL_DNS
- select DNS_RESOLVER
- select KEYS
- default y
--
--config NFS_USE_NEW_IDMAPPER
-- bool "Use the new idmapper upcall routine"
-- depends on NFS_V4 && KEYS
-- help
-- Say Y here if you want NFS to use the new idmapper upcall functions.
-- You will need /sbin/request-key (usually provided by the keyutils
-- package). For details, read
-- <file:Documentation/filesystems/nfs/idmapper.txt>.
--
-- If you are unsure, say N.
-diff -up linux-3.2.noarch/fs/nfs/sysctl.c.orig linux-3.2.noarch/fs/nfs/sysctl.c
---- linux-3.2.noarch/fs/nfs/sysctl.c.orig 2012-01-04 18:55:44.000000000 -0500
-+++ linux-3.2.noarch/fs/nfs/sysctl.c 2012-01-27 10:15:42.914563082 -0500
-@@ -32,7 +32,6 @@ static ctl_table nfs_cb_sysctls[] = {
- .extra1 = (int *)&nfs_set_port_min,
- .extra2 = (int *)&nfs_set_port_max,
- },
--#ifndef CONFIG_NFS_USE_NEW_IDMAPPER
- {
- .procname = "idmap_cache_timeout",
- .data = &nfs_idmap_cache_timeout,
-@@ -40,7 +39,6 @@ static ctl_table nfs_cb_sysctls[] = {
- .mode = 0644,
- .proc_handler = proc_dointvec_jiffies,
- },
--#endif /* CONFIG_NFS_USE_NEW_IDMAPPER */
- #endif
- {
- .procname = "nfs_mountpoint_timeout",
-diff -up linux-3.2.noarch/include/linux/nfs_idmap.h.orig linux-3.2.noarch/include/linux/nfs_idmap.h
---- linux-3.2.noarch/include/linux/nfs_idmap.h.orig 2012-01-27 10:06:46.783643915 -0500
-+++ linux-3.2.noarch/include/linux/nfs_idmap.h 2012-01-27 10:15:42.915563594 -0500
-@@ -69,36 +69,11 @@ struct nfs_server;
- struct nfs_fattr;
- struct nfs4_string;
-
--#ifdef CONFIG_NFS_USE_NEW_IDMAPPER
--
- int nfs_idmap_init(void);
- void nfs_idmap_quit(void);
--
--static inline int nfs_idmap_new(struct nfs_client *clp)
--{
-- return 0;
--}
--
--static inline void nfs_idmap_delete(struct nfs_client *clp)
--{
--}
--
--#else /* CONFIG_NFS_USE_NEW_IDMAPPER not set */
--
--static inline int nfs_idmap_init(void)
--{
-- return 0;
--}
--
--static inline void nfs_idmap_quit(void)
--{
--}
--
- int nfs_idmap_new(struct nfs_client *);
- void nfs_idmap_delete(struct nfs_client *);
-
--#endif /* CONFIG_NFS_USE_NEW_IDMAPPER */
--
- void nfs_fattr_init_names(struct nfs_fattr *fattr,
- struct nfs4_string *owner_name,
- struct nfs4_string *group_name);
diff --git a/freed-ora/current/master/linux-3.3-newidmapper-02.patch b/freed-ora/current/master/linux-3.3-newidmapper-02.patch
deleted file mode 100644
index 9307ee001..000000000
--- a/freed-ora/current/master/linux-3.3-newidmapper-02.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-commit 3cd0f37a2cc9e4d6188df10041a2441eaa41d991
-Author: Bryan Schumaker <bjschuma@netapp.com>
-Date: Thu Jan 26 16:54:24 2012 -0500
-
- NFS: Keep idmapper include files in one place
-
- Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
- Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-
-diff -up linux-3.2.noarch/fs/nfs/idmap.c.orig linux-3.2.noarch/fs/nfs/idmap.c
---- linux-3.2.noarch/fs/nfs/idmap.c.orig 2012-01-27 10:15:42.914563082 -0500
-+++ linux-3.2.noarch/fs/nfs/idmap.c 2012-01-27 10:19:22.711401559 -0500
-@@ -39,6 +39,36 @@
- #include <linux/slab.h>
- #include <linux/nfs_idmap.h>
- #include <linux/nfs_fs.h>
-+#include <linux/cred.h>
-+#include <linux/sunrpc/sched.h>
-+#include <linux/nfs4.h>
-+#include <linux/nfs_fs_sb.h>
-+#include <linux/keyctl.h>
-+#include <linux/key-type.h>
-+#include <linux/rcupdate.h>
-+#include <linux/err.h>
-+#include <keys/user-type.h>
-+
-+/* include files needed by legacy idmapper */
-+#include <linux/module.h>
-+#include <linux/mutex.h>
-+#include <linux/init.h>
-+#include <linux/socket.h>
-+#include <linux/in.h>
-+#include <linux/sched.h>
-+#include <linux/sunrpc/clnt.h>
-+#include <linux/workqueue.h>
-+#include <linux/sunrpc/rpc_pipe_fs.h>
-+#include <linux/nfs_fs.h>
-+#include "nfs4_fs.h"
-+
-+#define NFS_UINT_MAXLEN 11
-+#define IDMAP_HASH_SZ 128
-+
-+/* Default cache timeout is 10 minutes */
-+unsigned int nfs_idmap_cache_timeout = 600 * HZ;
-+const struct cred *id_resolver_cache;
-+
-
- /**
- * nfs_fattr_init_names - initialise the nfs_fattr owner_name/group_name fields
-@@ -142,21 +172,6 @@ static int nfs_map_numeric_to_string(__u
- return snprintf(buf, buflen, "%u", id);
- }
-
--#include <linux/cred.h>
--#include <linux/sunrpc/sched.h>
--#include <linux/nfs4.h>
--#include <linux/nfs_fs_sb.h>
--#include <linux/keyctl.h>
--#include <linux/key-type.h>
--#include <linux/rcupdate.h>
--#include <linux/err.h>
--
--#include <keys/user-type.h>
--
--#define NFS_UINT_MAXLEN 11
--
--const struct cred *id_resolver_cache;
--
- struct key_type key_type_id_resolver = {
- .name = "id_resolver",
- .instantiate = user_instantiate,
-@@ -327,25 +342,6 @@ static int nfs_idmap_lookup_id(const cha
- }
-
- /* idmap classic begins here */
--#include <linux/module.h>
--#include <linux/mutex.h>
--#include <linux/init.h>
--#include <linux/socket.h>
--#include <linux/in.h>
--#include <linux/sched.h>
--#include <linux/sunrpc/clnt.h>
--#include <linux/workqueue.h>
--#include <linux/sunrpc/rpc_pipe_fs.h>
--
--#include <linux/nfs_fs.h>
--
--#include "nfs4_fs.h"
--
--#define IDMAP_HASH_SZ 128
--
--/* Default cache timeout is 10 minutes */
--unsigned int nfs_idmap_cache_timeout = 600 * HZ;
--
- static int param_set_idmap_timeout(const char *val, struct kernel_param *kp)
- {
- char *endp;
diff --git a/freed-ora/current/master/linux-3.3-newidmapper-03.patch b/freed-ora/current/master/linux-3.3-newidmapper-03.patch
deleted file mode 100644
index 7018e3557..000000000
--- a/freed-ora/current/master/linux-3.3-newidmapper-03.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-commit a602bea3e7ccc5ce3da61d2c18245c4058983926
-Author: Bryan Schumaker <bjschuma@netapp.com>
-Date: Thu Jan 26 16:54:25 2012 -0500
-
- NFS: Update idmapper documentation
-
- Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
- Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-
-diff -up linux-3.2.noarch/Documentation/filesystems/nfs/idmapper.txt.orig linux-3.2.noarch/Documentation/filesystems/nfs/idmapper.txt
---- linux-3.2.noarch/Documentation/filesystems/nfs/idmapper.txt.orig 2012-01-04 18:55:44.000000000 -0500
-+++ linux-3.2.noarch/Documentation/filesystems/nfs/idmapper.txt 2012-01-27 10:19:55.406740364 -0500
-@@ -4,13 +4,21 @@ ID Mapper
- =========
- Id mapper is used by NFS to translate user and group ids into names, and to
- translate user and group names into ids. Part of this translation involves
--performing an upcall to userspace to request the information. Id mapper will
--user request-key to perform this upcall and cache the result. The program
--/usr/sbin/nfs.idmap should be called by request-key, and will perform the
--translation and initialize a key with the resulting information.
-+performing an upcall to userspace to request the information. There are two
-+ways NFS could obtain this information: placing a call to /sbin/request-key
-+or by placing a call to the rpc.idmap daemon.
-+
-+NFS will attempt to call /sbin/request-key first. If this succeeds, the
-+result will be cached using the generic request-key cache. This call should
-+only fail if /etc/request-key.conf is not configured for the id_resolver key
-+type, see the "Configuring" section below if you wish to use the request-key
-+method.
-+
-+If the call to /sbin/request-key fails (if /etc/request-key.conf is not
-+configured with the id_resolver key type), then the idmapper will ask the
-+legacy rpc.idmap daemon for the id mapping. This result will be stored
-+in a custom NFS idmap cache.
-
-- NFS_USE_NEW_IDMAPPER must be selected when configuring the kernel to use this
-- feature.
-
- ===========
- Configuring
diff --git a/freed-ora/current/master/linux-3.3-virtio-scsi.patch b/freed-ora/current/master/linux-3.3-virtio-scsi.patch
deleted file mode 100644
index 70b3673a6..000000000
--- a/freed-ora/current/master/linux-3.3-virtio-scsi.patch
+++ /dev/null
@@ -1,993 +0,0 @@
-From 43cf1b6a4ee31e69581042a0c85d1398f83dcedc Mon Sep 17 00:00:00 2001
-From: Paolo Bonzini <pbonzini@redhat.com>
-Date: Fri, 20 Jan 2012 17:27:20 +0100
-Cc: <linux-scsi@vger.kernel.org>
-Cc: Rusty Russell <rusty@rustcorp.com.au>
-Cc: kvm@vger.kernel.org
-Cc: Pekka Enberg <penberg@kernel.org>
-Cc: Michael S. Tsirkin <mst@redhat.com>
-Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>, Mike Christie <michaelc@cs.wisc.edu>
-Subject: [PATCH v5 0/3] virtio-scsi driver
-
-This is the first implementation of the virtio-scsi driver, a virtual
-HBA that will be supported by KVM. It implements a subset of the spec,
-in particular it does not implement asynchronous notifications for either
-LUN reset/removal/addition or CD-ROM media events, but it is already
-functional and usable.
-
-Other matching bits:
-
-- spec at http://people.redhat.com/pbonzini/virtio-spec.pdf
-
-- QEMU implementation at git://github.com/bonzini/qemu.git,
- branch virtio-scsi
-
-Please review. Getting this in 3.3 is starting to look like wishful thinking,
-but the possibility of regressions is obviously zero so I'm still dreaming.
-Otherwise, that would be 3.4.
-
-Paolo Bonzini (3):
- virtio-scsi: first version
- virtio-scsi: add error handling
- virtio-scsi: add power management support
-
-v4->v5: change virtio id from 7 to 8
-
-v3->v4: renamed VIRTIO_SCSI_S_UNDERRUN to VIRTIO_SCSI_S_OVERRUN;
- fixed 32-bit compilation; added power management support;
- adjusted calls to virtqueue_add_buf
-
- drivers/scsi/Kconfig | 8 +
- drivers/scsi/Makefile | 1 +
- drivers/scsi/virtio_scsi.c | 594 +++++++++++++++++++++++++++++++++++++++++++
- include/linux/virtio_ids.h | 1 +
- include/linux/virtio_scsi.h | 114 +++++++++
- 5 files changed, 718 insertions(+), 0 deletions(-)
- create mode 100644 drivers/scsi/virtio_scsi.c
- create mode 100644 include/linux/virtio_scsi.h
-
-From 84ad93b7215e18ab1755a625ede0fb00175e79bb Mon Sep 17 00:00:00 2001
-From: Paolo Bonzini <pbonzini@redhat.com>
-Date: Tue, 29 Nov 2011 16:31:09 +0100
-Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>, Mike Christie <michaelc@cs.wisc.edu>, Pekka Enberg <penberg@kernel.org>
-Subject: [PATCH v5 1/3] virtio-scsi: first version
-
-The virtio-scsi HBA is the basis of an alternative storage stack
-for QEMU-based virtual machines (including KVM). Compared to
-virtio-blk it is more scalable, because it supports many LUNs
-on a single PCI slot), more powerful (it more easily supports
-passthrough of host devices to the guest) and more easily
-extensible (new SCSI features implemented by QEMU should not
-require updating the driver in the guest).
-
-Cc: linux-scsi <linux-scsi@vger.kernel.org>
-Cc: Rusty Russell <rusty@rustcorp.com.au>
-Cc: Michael S. Tsirkin <mst@redhat.com>
-Cc: kvm@vger.kernel.org
-Acked-by: Pekka Enberg <penberg@kernel.org>
-Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
----
- v4->v5: change virtio id from 7 to 8
-
- v3->v4: renamed VIRTIO_SCSI_S_UNDERRUN to VIRTIO_SCSI_S_OVERRUN;
- fixed 32-bit compilation; adjust call to virtqueue_add_buf
-
- v2->v3: added mempool, formatting fixes
-
- v1->v2: use dbg_dev, sdev_printk, scmd_printk
- - renamed lock to vq_lock
- - renamed cmd_vq to req_vq (and other similar changes)
- - fixed missing break in VIRTIO_SCSI_S_OVERRUN
- - added VIRTIO_SCSI_S_BUSY
- - removed unused argument from virtscsi_map_cmd
- - fixed two tabs that had slipped in
- - moved max_sectors and cmd_per_lun from template to config space
- - __attribute__((packed)) -> __packed
-
- drivers/scsi/Kconfig | 8 +
- drivers/scsi/Makefile | 1 +
- drivers/scsi/virtio_scsi.c | 503 +++++++++++++++++++++++++++++++++++++++++++
- include/linux/virtio_ids.h | 1 +
- include/linux/virtio_scsi.h | 114 ++++++++++
- 5 files changed, 627 insertions(+), 0 deletions(-)
- create mode 100644 drivers/scsi/virtio_scsi.c
- create mode 100644 include/linux/virtio_scsi.h
-
-diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
-index 16570aa..827ebaf 100644
---- a/drivers/scsi/Kconfig
-+++ b/drivers/scsi/Kconfig
-@@ -1897,6 +1897,14 @@ config SCSI_BFA_FC
- To compile this driver as a module, choose M here. The module will
- be called bfa.
-
-+config SCSI_VIRTIO
-+ tristate "virtio-scsi support (EXPERIMENTAL)"
-+ depends on EXPERIMENTAL && VIRTIO
-+ help
-+ This is the virtual HBA driver for virtio. If the kernel will
-+ be used in a virtual machine, say Y or M.
-+
-+
- endif # SCSI_LOWLEVEL
-
- source "drivers/scsi/pcmcia/Kconfig"
-diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile
-index 2b88749..351b28b 100644
---- a/drivers/scsi/Makefile
-+++ b/drivers/scsi/Makefile
-@@ -141,6 +141,7 @@ obj-$(CONFIG_SCSI_CXGB4_ISCSI) += libiscsi.o libiscsi_tcp.o cxgbi/
- obj-$(CONFIG_SCSI_BNX2_ISCSI) += libiscsi.o bnx2i/
- obj-$(CONFIG_BE2ISCSI) += libiscsi.o be2iscsi/
- obj-$(CONFIG_SCSI_PMCRAID) += pmcraid.o
-+obj-$(CONFIG_SCSI_VIRTIO) += virtio_scsi.o
- obj-$(CONFIG_VMWARE_PVSCSI) += vmw_pvscsi.o
-
- obj-$(CONFIG_ARM) += arm/
-diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
-new file mode 100644
-index 0000000..3f87ae0
---- /dev/null
-+++ b/drivers/scsi/virtio_scsi.c
-@@ -0,0 +1,503 @@
-+/*
-+ * Virtio SCSI HBA driver
-+ *
-+ * Copyright IBM Corp. 2010
-+ * Copyright Red Hat, Inc. 2011
-+ *
-+ * Authors:
-+ * Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
-+ * Paolo Bonzini <pbonzini@redhat.com>
-+ *
-+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
-+ * See the COPYING file in the top-level directory.
-+ *
-+ */
-+
-+#include <linux/module.h>
-+#include <linux/slab.h>
-+#include <linux/mempool.h>
-+#include <linux/virtio.h>
-+#include <linux/virtio_ids.h>
-+#include <linux/virtio_config.h>
-+#include <linux/virtio_scsi.h>
-+#include <scsi/scsi_host.h>
-+#include <scsi/scsi_device.h>
-+#include <scsi/scsi_cmnd.h>
-+
-+#define VIRTIO_SCSI_MEMPOOL_SZ 64
-+
-+/* Command queue element */
-+struct virtio_scsi_cmd {
-+ struct scsi_cmnd *sc;
-+ union {
-+ struct virtio_scsi_cmd_req cmd;
-+ struct virtio_scsi_ctrl_tmf_req tmf;
-+ struct virtio_scsi_ctrl_an_req an;
-+ } req;
-+ union {
-+ struct virtio_scsi_cmd_resp cmd;
-+ struct virtio_scsi_ctrl_tmf_resp tmf;
-+ struct virtio_scsi_ctrl_an_resp an;
-+ struct virtio_scsi_event evt;
-+ } resp;
-+} ____cacheline_aligned_in_smp;
-+
-+/* Driver instance state */
-+struct virtio_scsi {
-+ /* Protects ctrl_vq, req_vq and sg[] */
-+ spinlock_t vq_lock;
-+
-+ struct virtio_device *vdev;
-+ struct virtqueue *ctrl_vq;
-+ struct virtqueue *event_vq;
-+ struct virtqueue *req_vq;
-+
-+ /* For sglist construction when adding commands to the virtqueue. */
-+ struct scatterlist sg[];
-+};
-+
-+static struct kmem_cache *virtscsi_cmd_cache;
-+static mempool_t *virtscsi_cmd_pool;
-+
-+static inline struct Scsi_Host *virtio_scsi_host(struct virtio_device *vdev)
-+{
-+ return vdev->priv;
-+}
-+
-+static void virtscsi_compute_resid(struct scsi_cmnd *sc, u32 resid)
-+{
-+ if (!resid)
-+ return;
-+
-+ if (!scsi_bidi_cmnd(sc)) {
-+ scsi_set_resid(sc, resid);
-+ return;
-+ }
-+
-+ scsi_in(sc)->resid = min(resid, scsi_in(sc)->length);
-+ scsi_out(sc)->resid = resid - scsi_in(sc)->resid;
-+}
-+
-+/**
-+ * virtscsi_complete_cmd - finish a scsi_cmd and invoke scsi_done
-+ *
-+ * Called with vq_lock held.
-+ */
-+static void virtscsi_complete_cmd(void *buf)
-+{
-+ struct virtio_scsi_cmd *cmd = buf;
-+ struct scsi_cmnd *sc = cmd->sc;
-+ struct virtio_scsi_cmd_resp *resp = &cmd->resp.cmd;
-+
-+ dev_dbg(&sc->device->sdev_gendev,
-+ "cmd %p response %u status %#02x sense_len %u\n",
-+ sc, resp->response, resp->status, resp->sense_len);
-+
-+ sc->result = resp->status;
-+ virtscsi_compute_resid(sc, resp->resid);
-+ switch (resp->response) {
-+ case VIRTIO_SCSI_S_OK:
-+ set_host_byte(sc, DID_OK);
-+ break;
-+ case VIRTIO_SCSI_S_OVERRUN:
-+ set_host_byte(sc, DID_ERROR);
-+ break;
-+ case VIRTIO_SCSI_S_ABORTED:
-+ set_host_byte(sc, DID_ABORT);
-+ break;
-+ case VIRTIO_SCSI_S_BAD_TARGET:
-+ set_host_byte(sc, DID_BAD_TARGET);
-+ break;
-+ case VIRTIO_SCSI_S_RESET:
-+ set_host_byte(sc, DID_RESET);
-+ break;
-+ case VIRTIO_SCSI_S_BUSY:
-+ set_host_byte(sc, DID_BUS_BUSY);
-+ break;
-+ case VIRTIO_SCSI_S_TRANSPORT_FAILURE:
-+ set_host_byte(sc, DID_TRANSPORT_DISRUPTED);
-+ break;
-+ case VIRTIO_SCSI_S_TARGET_FAILURE:
-+ set_host_byte(sc, DID_TARGET_FAILURE);
-+ break;
-+ case VIRTIO_SCSI_S_NEXUS_FAILURE:
-+ set_host_byte(sc, DID_NEXUS_FAILURE);
-+ break;
-+ default:
-+ scmd_printk(KERN_WARNING, sc, "Unknown response %d",
-+ resp->response);
-+ /* fall through */
-+ case VIRTIO_SCSI_S_FAILURE:
-+ set_host_byte(sc, DID_ERROR);
-+ break;
-+ }
-+
-+ WARN_ON(resp->sense_len > VIRTIO_SCSI_SENSE_SIZE);
-+ if (sc->sense_buffer) {
-+ memcpy(sc->sense_buffer, resp->sense,
-+ min_t(u32, resp->sense_len, VIRTIO_SCSI_SENSE_SIZE));
-+ if (resp->sense_len)
-+ set_driver_byte(sc, DRIVER_SENSE);
-+ }
-+
-+ mempool_free(cmd, virtscsi_cmd_pool);
-+ sc->scsi_done(sc);
-+}
-+
-+static void virtscsi_vq_done(struct virtqueue *vq, void (*fn)(void *buf))
-+{
-+ struct Scsi_Host *sh = virtio_scsi_host(vq->vdev);
-+ struct virtio_scsi *vscsi = shost_priv(sh);
-+ void *buf;
-+ unsigned long flags;
-+ unsigned int len;
-+
-+ spin_lock_irqsave(&vscsi->vq_lock, flags);
-+
-+ do {
-+ virtqueue_disable_cb(vq);
-+ while ((buf = virtqueue_get_buf(vq, &len)) != NULL)
-+ fn(buf);
-+ } while (!virtqueue_enable_cb(vq));
-+
-+ spin_unlock_irqrestore(&vscsi->vq_lock, flags);
-+}
-+
-+static void virtscsi_req_done(struct virtqueue *vq)
-+{
-+ virtscsi_vq_done(vq, virtscsi_complete_cmd);
-+};
-+
-+/* These are still stubs. */
-+static void virtscsi_complete_free(void *buf)
-+{
-+ struct virtio_scsi_cmd *cmd = buf;
-+
-+ mempool_free(cmd, virtscsi_cmd_pool);
-+}
-+
-+static void virtscsi_ctrl_done(struct virtqueue *vq)
-+{
-+ virtscsi_vq_done(vq, virtscsi_complete_free);
-+};
-+
-+static void virtscsi_event_done(struct virtqueue *vq)
-+{
-+ virtscsi_vq_done(vq, virtscsi_complete_free);
-+};
-+
-+static void virtscsi_map_sgl(struct scatterlist *sg, unsigned int *p_idx,
-+ struct scsi_data_buffer *sdb)
-+{
-+ struct sg_table *table = &sdb->table;
-+ struct scatterlist *sg_elem;
-+ unsigned int idx = *p_idx;
-+ int i;
-+
-+ for_each_sg(table->sgl, sg_elem, table->nents, i)
-+ sg_set_buf(&sg[idx++], sg_virt(sg_elem), sg_elem->length);
-+
-+ *p_idx = idx;
-+}
-+
-+/**
-+ * virtscsi_map_cmd - map a scsi_cmd to a virtqueue scatterlist
-+ * @vscsi : virtio_scsi state
-+ * @cmd : command structure
-+ * @out_num : number of read-only elements
-+ * @in_num : number of write-only elements
-+ * @req_size : size of the request buffer
-+ * @resp_size : size of the response buffer
-+ *
-+ * Called with vq_lock held.
-+ */
-+static void virtscsi_map_cmd(struct virtio_scsi *vscsi,
-+ struct virtio_scsi_cmd *cmd,
-+ unsigned *out_num, unsigned *in_num,
-+ size_t req_size, size_t resp_size)
-+{
-+ struct scsi_cmnd *sc = cmd->sc;
-+ struct scatterlist *sg = vscsi->sg;
-+ unsigned int idx = 0;
-+
-+ if (sc) {
-+ struct Scsi_Host *shost = virtio_scsi_host(vscsi->vdev);
-+ BUG_ON(scsi_sg_count(sc) > shost->sg_tablesize);
-+
-+ /* TODO: check feature bit and fail if unsupported? */
-+ BUG_ON(sc->sc_data_direction == DMA_BIDIRECTIONAL);
-+ }
-+
-+ /* Request header. */
-+ sg_set_buf(&sg[idx++], &cmd->req, req_size);
-+
-+ /* Data-out buffer. */
-+ if (sc && sc->sc_data_direction != DMA_FROM_DEVICE)
-+ virtscsi_map_sgl(sg, &idx, scsi_out(sc));
-+
-+ *out_num = idx;
-+
-+ /* Response header. */
-+ sg_set_buf(&sg[idx++], &cmd->resp, resp_size);
-+
-+ /* Data-in buffer */
-+ if (sc && sc->sc_data_direction != DMA_TO_DEVICE)
-+ virtscsi_map_sgl(sg, &idx, scsi_in(sc));
-+
-+ *in_num = idx - *out_num;
-+}
-+
-+static int virtscsi_kick_cmd(struct virtio_scsi *vscsi, struct virtqueue *vq,
-+ struct virtio_scsi_cmd *cmd,
-+ size_t req_size, size_t resp_size, gfp_t gfp)
-+{
-+ unsigned int out_num, in_num;
-+ unsigned long flags;
-+ int ret;
-+
-+ spin_lock_irqsave(&vscsi->vq_lock, flags);
-+
-+ virtscsi_map_cmd(vscsi, cmd, &out_num, &in_num, req_size, resp_size);
-+
-+ ret = virtqueue_add_buf(vq, vscsi->sg, out_num, in_num, cmd, gfp);
-+ if (ret >= 0)
-+ virtqueue_kick(vq);
-+
-+ spin_unlock_irqrestore(&vscsi->vq_lock, flags);
-+ return ret;
-+}
-+
-+static int virtscsi_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *sc)
-+{
-+ struct virtio_scsi *vscsi = shost_priv(sh);
-+ struct virtio_scsi_cmd *cmd;
-+ int ret;
-+
-+ dev_dbg(&sc->device->sdev_gendev,
-+ "cmd %p CDB: %#02x\n", sc, sc->cmnd[0]);
-+
-+ ret = SCSI_MLQUEUE_HOST_BUSY;
-+ cmd = mempool_alloc(virtscsi_cmd_pool, GFP_ATOMIC);
-+ if (!cmd)
-+ goto out;
-+
-+ memset(cmd, 0, sizeof(*cmd));
-+ cmd->sc = sc;
-+ cmd->req.cmd = (struct virtio_scsi_cmd_req){
-+ .lun[0] = 1,
-+ .lun[1] = sc->device->id,
-+ .lun[2] = (sc->device->lun >> 8) | 0x40,
-+ .lun[3] = sc->device->lun & 0xff,
-+ .tag = (unsigned long)sc,
-+ .task_attr = VIRTIO_SCSI_S_SIMPLE,
-+ .prio = 0,
-+ .crn = 0,
-+ };
-+
-+ BUG_ON(sc->cmd_len > VIRTIO_SCSI_CDB_SIZE);
-+ memcpy(cmd->req.cmd.cdb, sc->cmnd, sc->cmd_len);
-+
-+ if (virtscsi_kick_cmd(vscsi, vscsi->req_vq, cmd,
-+ sizeof cmd->req.cmd, sizeof cmd->resp.cmd,
-+ GFP_ATOMIC) >= 0)
-+ ret = 0;
-+
-+out:
-+ return ret;
-+}
-+
-+static struct scsi_host_template virtscsi_host_template = {
-+ .module = THIS_MODULE,
-+ .name = "Virtio SCSI HBA",
-+ .proc_name = "virtio_scsi",
-+ .queuecommand = virtscsi_queuecommand,
-+ .this_id = -1,
-+
-+ .can_queue = 1024,
-+ .dma_boundary = UINT_MAX,
-+ .use_clustering = ENABLE_CLUSTERING,
-+};
-+
-+#define virtscsi_config_get(vdev, fld) \
-+ ({ \
-+ typeof(((struct virtio_scsi_config *)0)->fld) __val; \
-+ vdev->config->get(vdev, \
-+ offsetof(struct virtio_scsi_config, fld), \
-+ &__val, sizeof(__val)); \
-+ __val; \
-+ })
-+
-+#define virtscsi_config_set(vdev, fld, val) \
-+ (void)({ \
-+ typeof(((struct virtio_scsi_config *)0)->fld) __val = (val); \
-+ vdev->config->set(vdev, \
-+ offsetof(struct virtio_scsi_config, fld), \
-+ &__val, sizeof(__val)); \
-+ })
-+
-+static int __devinit virtscsi_init(struct virtio_device *vdev,
-+ struct virtio_scsi *vscsi)
-+{
-+ int err;
-+ struct virtqueue *vqs[3];
-+ vq_callback_t *callbacks[] = {
-+ virtscsi_ctrl_done,
-+ virtscsi_event_done,
-+ virtscsi_req_done
-+ };
-+ const char *names[] = {
-+ "control",
-+ "event",
-+ "request"
-+ };
-+
-+ /* Discover virtqueues and write information to configuration. */
-+ err = vdev->config->find_vqs(vdev, 3, vqs, callbacks, names);
-+ if (err)
-+ return err;
-+
-+ vscsi->ctrl_vq = vqs[0];
-+ vscsi->event_vq = vqs[1];
-+ vscsi->req_vq = vqs[2];
-+
-+ virtscsi_config_set(vdev, cdb_size, VIRTIO_SCSI_CDB_SIZE);
-+ virtscsi_config_set(vdev, sense_size, VIRTIO_SCSI_SENSE_SIZE);
-+ return 0;
-+}
-+
-+static int __devinit virtscsi_probe(struct virtio_device *vdev)
-+{
-+ struct Scsi_Host *shost;
-+ struct virtio_scsi *vscsi;
-+ int err;
-+ u32 sg_elems;
-+ u32 cmd_per_lun;
-+
-+ /* We need to know how many segments before we allocate.
-+ * We need an extra sg elements at head and tail.
-+ */
-+ sg_elems = virtscsi_config_get(vdev, seg_max) ?: 1;
-+
-+ /* Allocate memory and link the structs together. */
-+ shost = scsi_host_alloc(&virtscsi_host_template,
-+ sizeof(*vscsi) + sizeof(vscsi->sg[0]) * (sg_elems + 2));
-+
-+ if (!shost)
-+ return -ENOMEM;
-+
-+ shost->sg_tablesize = sg_elems;
-+ vscsi = shost_priv(shost);
-+ vscsi->vdev = vdev;
-+ vdev->priv = shost;
-+
-+ /* Random initializations. */
-+ spin_lock_init(&vscsi->vq_lock);
-+ sg_init_table(vscsi->sg, sg_elems + 2);
-+
-+ err = virtscsi_init(vdev, vscsi);
-+ if (err)
-+ goto virtscsi_init_failed;
-+
-+ cmd_per_lun = virtscsi_config_get(vdev, cmd_per_lun) ?: 1;
-+ shost->cmd_per_lun = min_t(u32, cmd_per_lun, shost->can_queue);
-+ shost->max_sectors = virtscsi_config_get(vdev, max_sectors) ?: 0xFFFF;
-+ shost->max_lun = virtscsi_config_get(vdev, max_lun) + 1;
-+ shost->max_id = virtscsi_config_get(vdev, max_target) + 1;
-+ shost->max_channel = 0;
-+ shost->max_cmd_len = VIRTIO_SCSI_CDB_SIZE;
-+ err = scsi_add_host(shost, &vdev->dev);
-+ if (err)
-+ goto scsi_add_host_failed;
-+
-+ scsi_scan_host(shost);
-+
-+ return 0;
-+
-+scsi_add_host_failed:
-+ vdev->config->del_vqs(vdev);
-+virtscsi_init_failed:
-+ scsi_host_put(shost);
-+ return err;
-+}
-+
-+static void __devexit virtscsi_remove_vqs(struct virtio_device *vdev)
-+{
-+ /* Stop all the virtqueues. */
-+ vdev->config->reset(vdev);
-+
-+ vdev->config->del_vqs(vdev);
-+}
-+
-+static void __devexit virtscsi_remove(struct virtio_device *vdev)
-+{
-+ struct Scsi_Host *shost = virtio_scsi_host(vdev);
-+
-+ scsi_remove_host(shost);
-+
-+ virtscsi_remove_vqs(vdev);
-+ scsi_host_put(shost);
-+}
-+
-+static struct virtio_device_id id_table[] = {
-+ { VIRTIO_ID_SCSI, VIRTIO_DEV_ANY_ID },
-+ { 0 },
-+};
-+
-+static struct virtio_driver virtio_scsi_driver = {
-+ .driver.name = KBUILD_MODNAME,
-+ .driver.owner = THIS_MODULE,
-+ .id_table = id_table,
-+ .probe = virtscsi_probe,
-+ .remove = __devexit_p(virtscsi_remove),
-+};
-+
-+static int __init init(void)
-+{
-+ int ret = -ENOMEM;
-+
-+ virtscsi_cmd_cache = KMEM_CACHE(virtio_scsi_cmd, 0);
-+ if (!virtscsi_cmd_cache) {
-+ printk(KERN_ERR "kmem_cache_create() for "
-+ "virtscsi_cmd_cache failed\n");
-+ goto error;
-+ }
-+
-+
-+ virtscsi_cmd_pool =
-+ mempool_create_slab_pool(VIRTIO_SCSI_MEMPOOL_SZ,
-+ virtscsi_cmd_cache);
-+ if (!virtscsi_cmd_pool) {
-+ printk(KERN_ERR "mempool_create() for"
-+ "virtscsi_cmd_pool failed\n");
-+ goto error;
-+ }
-+ ret = register_virtio_driver(&virtio_scsi_driver);
-+ if (ret < 0)
-+ goto error;
-+
-+ return 0;
-+
-+error:
-+ if (virtscsi_cmd_pool) {
-+ mempool_destroy(virtscsi_cmd_pool);
-+ virtscsi_cmd_pool = NULL;
-+ }
-+ if (virtscsi_cmd_cache) {
-+ kmem_cache_destroy(virtscsi_cmd_cache);
-+ virtscsi_cmd_cache = NULL;
-+ }
-+ return ret;
-+}
-+
-+static void __exit fini(void)
-+{
-+ unregister_virtio_driver(&virtio_scsi_driver);
-+ mempool_destroy(virtscsi_cmd_pool);
-+ kmem_cache_destroy(virtscsi_cmd_cache);
-+}
-+module_init(init);
-+module_exit(fini);
-+
-+MODULE_DEVICE_TABLE(virtio, id_table);
-+MODULE_DESCRIPTION("Virtio SCSI HBA driver");
-+MODULE_LICENSE("GPL");
-diff --git a/include/linux/virtio_ids.h b/include/linux/virtio_ids.h
-index 85bb0bb..d83ae52 100644
---- a/include/linux/virtio_ids.h
-+++ b/include/linux/virtio_ids.h
-@@ -34,6 +34,7 @@
- #define VIRTIO_ID_CONSOLE 3 /* virtio console */
- #define VIRTIO_ID_RNG 4 /* virtio ring */
- #define VIRTIO_ID_BALLOON 5 /* virtio balloon */
-+#define VIRTIO_ID_SCSI 8 /* virtio scsi */
- #define VIRTIO_ID_9P 9 /* 9p virtio console */
-
- #endif /* _LINUX_VIRTIO_IDS_H */
-diff --git a/include/linux/virtio_scsi.h b/include/linux/virtio_scsi.h
-new file mode 100644
-index 0000000..8ddeafd
---- /dev/null
-+++ b/include/linux/virtio_scsi.h
-@@ -0,0 +1,114 @@
-+#ifndef _LINUX_VIRTIO_SCSI_H
-+#define _LINUX_VIRTIO_SCSI_H
-+/* This header is BSD licensed so anyone can use the definitions to implement
-+ * compatible drivers/servers. */
-+
-+#define VIRTIO_SCSI_CDB_SIZE 32
-+#define VIRTIO_SCSI_SENSE_SIZE 96
-+
-+/* SCSI command request, followed by data-out */
-+struct virtio_scsi_cmd_req {
-+ u8 lun[8]; /* Logical Unit Number */
-+ u64 tag; /* Command identifier */
-+ u8 task_attr; /* Task attribute */
-+ u8 prio;
-+ u8 crn;
-+ u8 cdb[VIRTIO_SCSI_CDB_SIZE];
-+} __packed;
-+
-+/* Response, followed by sense data and data-in */
-+struct virtio_scsi_cmd_resp {
-+ u32 sense_len; /* Sense data length */
-+ u32 resid; /* Residual bytes in data buffer */
-+ u16 status_qualifier; /* Status qualifier */
-+ u8 status; /* Command completion status */
-+ u8 response; /* Response values */
-+ u8 sense[VIRTIO_SCSI_SENSE_SIZE];
-+} __packed;
-+
-+/* Task Management Request */
-+struct virtio_scsi_ctrl_tmf_req {
-+ u32 type;
-+ u32 subtype;
-+ u8 lun[8];
-+ u64 tag;
-+} __packed;
-+
-+struct virtio_scsi_ctrl_tmf_resp {
-+ u8 response;
-+} __packed;
-+
-+/* Asynchronous notification query/subscription */
-+struct virtio_scsi_ctrl_an_req {
-+ u32 type;
-+ u8 lun[8];
-+ u32 event_requested;
-+} __packed;
-+
-+struct virtio_scsi_ctrl_an_resp {
-+ u32 event_actual;
-+ u8 response;
-+} __packed;
-+
-+struct virtio_scsi_event {
-+ u32 event;
-+ u8 lun[8];
-+ u32 reason;
-+} __packed;
-+
-+struct virtio_scsi_config {
-+ u32 num_queues;
-+ u32 seg_max;
-+ u32 max_sectors;
-+ u32 cmd_per_lun;
-+ u32 event_info_size;
-+ u32 sense_size;
-+ u32 cdb_size;
-+ u16 max_channel;
-+ u16 max_target;
-+ u32 max_lun;
-+} __packed;
-+
-+/* Response codes */
-+#define VIRTIO_SCSI_S_OK 0
-+#define VIRTIO_SCSI_S_OVERRUN 1
-+#define VIRTIO_SCSI_S_ABORTED 2
-+#define VIRTIO_SCSI_S_BAD_TARGET 3
-+#define VIRTIO_SCSI_S_RESET 4
-+#define VIRTIO_SCSI_S_BUSY 5
-+#define VIRTIO_SCSI_S_TRANSPORT_FAILURE 6
-+#define VIRTIO_SCSI_S_TARGET_FAILURE 7
-+#define VIRTIO_SCSI_S_NEXUS_FAILURE 8
-+#define VIRTIO_SCSI_S_FAILURE 9
-+#define VIRTIO_SCSI_S_FUNCTION_SUCCEEDED 10
-+#define VIRTIO_SCSI_S_FUNCTION_REJECTED 11
-+#define VIRTIO_SCSI_S_INCORRECT_LUN 12
-+
-+/* Controlq type codes. */
-+#define VIRTIO_SCSI_T_TMF 0
-+#define VIRTIO_SCSI_T_AN_QUERY 1
-+#define VIRTIO_SCSI_T_AN_SUBSCRIBE 2
-+
-+/* Valid TMF subtypes. */
-+#define VIRTIO_SCSI_T_TMF_ABORT_TASK 0
-+#define VIRTIO_SCSI_T_TMF_ABORT_TASK_SET 1
-+#define VIRTIO_SCSI_T_TMF_CLEAR_ACA 2
-+#define VIRTIO_SCSI_T_TMF_CLEAR_TASK_SET 3
-+#define VIRTIO_SCSI_T_TMF_I_T_NEXUS_RESET 4
-+#define VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET 5
-+#define VIRTIO_SCSI_T_TMF_QUERY_TASK 6
-+#define VIRTIO_SCSI_T_TMF_QUERY_TASK_SET 7
-+
-+/* Events. */
-+#define VIRTIO_SCSI_T_EVENTS_MISSED 0x80000000
-+#define VIRTIO_SCSI_T_NO_EVENT 0
-+#define VIRTIO_SCSI_T_TRANSPORT_RESET 1
-+#define VIRTIO_SCSI_T_ASYNC_NOTIFY 2
-+
-+#define VIRTIO_SCSI_S_SIMPLE 0
-+#define VIRTIO_SCSI_S_ORDERED 1
-+#define VIRTIO_SCSI_S_HEAD 2
-+#define VIRTIO_SCSI_S_ACA 3
-+
-+
-+#endif /* _LINUX_VIRTIO_SCSI_H */
---
-1.7.1
-
-
-From 3c0e8846ac0fc2175dd0e06f495b16a30b549762 Mon Sep 17 00:00:00 2001
-From: Paolo Bonzini <pbonzini@redhat.com>
-Date: Tue, 29 Nov 2011 16:33:28 +0100
-Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>, Mike Christie <michaelc@cs.wisc.edu>, Pekka Enberg <penberg@kernel.org>
-Subject: [PATCH v5 2/3] virtio-scsi: add error handling
-
-This commit adds basic error handling to the virtio-scsi
-HBA device. Task management functions are sent synchronously
-via the control virtqueue.
-
-Cc: linux-scsi <linux-scsi@vger.kernel.org>
-Cc: Rusty Russell <rusty@rustcorp.com.au>
-Cc: Michael S. Tsirkin <mst@redhat.com>
-Cc: kvm@vger.kernel.org
-Acked-by: Pekka Enberg <penberg@kernel.org>
-Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
----
- v3->v4: fixed 32-bit compilation; adjusted call to virtscsi_kick_cmd
-
- v2->v3: added mempool, used GFP_NOIO instead of GFP_ATOMIC,
- formatting fixes
-
- v1->v2: use scmd_printk
-
- drivers/scsi/virtio_scsi.c | 73 +++++++++++++++++++++++++++++++++++++++++++-
- 1 files changed, 72 insertions(+), 1 deletions(-)
-
-diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
-index 3f87ae0..68104cd 100644
---- a/drivers/scsi/virtio_scsi.c
-+++ b/drivers/scsi/virtio_scsi.c
-@@ -29,6 +29,7 @@
- /* Command queue element */
- struct virtio_scsi_cmd {
- struct scsi_cmnd *sc;
-+ struct completion *comp;
- union {
- struct virtio_scsi_cmd_req cmd;
- struct virtio_scsi_ctrl_tmf_req tmf;
-@@ -168,11 +169,12 @@ static void virtscsi_req_done(struct virtqueue *vq)
- virtscsi_vq_done(vq, virtscsi_complete_cmd);
- };
-
--/* These are still stubs. */
- static void virtscsi_complete_free(void *buf)
- {
- struct virtio_scsi_cmd *cmd = buf;
-
-+ if (cmd->comp)
-+ complete_all(cmd->comp);
- mempool_free(cmd, virtscsi_cmd_pool);
- }
-
-@@ -306,12 +308,81 @@ out:
- return ret;
- }
-
-+static int virtscsi_tmf(struct virtio_scsi *vscsi, struct virtio_scsi_cmd *cmd)
-+{
-+ DECLARE_COMPLETION_ONSTACK(comp);
-+ int ret;
-+
-+ cmd->comp = &comp;
-+ ret = virtscsi_kick_cmd(vscsi, vscsi->ctrl_vq, cmd,
-+ sizeof cmd->req.tmf, sizeof cmd->resp.tmf,
-+ GFP_NOIO);
-+ if (ret < 0)
-+ return FAILED;
-+
-+ wait_for_completion(&comp);
-+ if (cmd->resp.tmf.response != VIRTIO_SCSI_S_OK &&
-+ cmd->resp.tmf.response != VIRTIO_SCSI_S_FUNCTION_SUCCEEDED)
-+ return FAILED;
-+
-+ return SUCCESS;
-+}
-+
-+static int virtscsi_device_reset(struct scsi_cmnd *sc)
-+{
-+ struct virtio_scsi *vscsi = shost_priv(sc->device->host);
-+ struct virtio_scsi_cmd *cmd;
-+
-+ sdev_printk(KERN_INFO, sc->device, "device reset\n");
-+ cmd = mempool_alloc(virtscsi_cmd_pool, GFP_NOIO);
-+ if (!cmd)
-+ return FAILED;
-+
-+ memset(cmd, 0, sizeof(*cmd));
-+ cmd->sc = sc;
-+ cmd->req.tmf = (struct virtio_scsi_ctrl_tmf_req){
-+ .type = VIRTIO_SCSI_T_TMF,
-+ .subtype = VIRTIO_SCSI_T_TMF_LOGICAL_UNIT_RESET,
-+ .lun[0] = 1,
-+ .lun[1] = sc->device->id,
-+ .lun[2] = (sc->device->lun >> 8) | 0x40,
-+ .lun[3] = sc->device->lun & 0xff,
-+ };
-+ return virtscsi_tmf(vscsi, cmd);
-+}
-+
-+static int virtscsi_abort(struct scsi_cmnd *sc)
-+{
-+ struct virtio_scsi *vscsi = shost_priv(sc->device->host);
-+ struct virtio_scsi_cmd *cmd;
-+
-+ scmd_printk(KERN_INFO, sc, "abort\n");
-+ cmd = mempool_alloc(virtscsi_cmd_pool, GFP_NOIO);
-+ if (!cmd)
-+ return FAILED;
-+
-+ memset(cmd, 0, sizeof(*cmd));
-+ cmd->sc = sc;
-+ cmd->req.tmf = (struct virtio_scsi_ctrl_tmf_req){
-+ .type = VIRTIO_SCSI_T_TMF,
-+ .subtype = VIRTIO_SCSI_T_TMF_ABORT_TASK,
-+ .lun[0] = 1,
-+ .lun[1] = sc->device->id,
-+ .lun[2] = (sc->device->lun >> 8) | 0x40,
-+ .lun[3] = sc->device->lun & 0xff,
-+ .tag = (unsigned long)sc,
-+ };
-+ return virtscsi_tmf(vscsi, cmd);
-+}
-+
- static struct scsi_host_template virtscsi_host_template = {
- .module = THIS_MODULE,
- .name = "Virtio SCSI HBA",
- .proc_name = "virtio_scsi",
- .queuecommand = virtscsi_queuecommand,
- .this_id = -1,
-+ .eh_abort_handler = virtscsi_abort,
-+ .eh_device_reset_handler = virtscsi_device_reset,
-
- .can_queue = 1024,
- .dma_boundary = UINT_MAX,
---
-1.7.1
-
-
-From 43cf1b6a4ee31e69581042a0c85d1398f83dcedc Mon Sep 17 00:00:00 2001
-From: Paolo Bonzini <pbonzini@redhat.com>
-Date: Fri, 13 Jan 2012 15:30:08 +0100
-Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>, Mike Christie <michaelc@cs.wisc.edu>, Pekka Enberg <penberg@kernel.org>
-Subject: [PATCH v5 3/3] virtio-scsi: add power management support
-
-This patch adds freeze/restore handlers for the HBA. Block queues
-are managed independently by the disk devices.
-
-Cc: linux-scsi <linux-scsi@vger.kernel.org>
-Cc: Rusty Russell <rusty@rustcorp.com.au>
-Cc: Michael S. Tsirkin <mst@redhat.com>
-Cc: kvm@vger.kernel.org
-Acked-by: Pekka Enberg <penberg@kernel.org>
-Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
----
- The feature has been merged in the virtio core for 3.3, so the patch
- is new in v4.
-
- drivers/scsi/virtio_scsi.c | 26 +++++++++++++++++++++++---
- 1 files changed, 23 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
-index 68104cd..efccd72 100644
---- a/drivers/scsi/virtio_scsi.c
-+++ b/drivers/scsi/virtio_scsi.c
-@@ -406,8 +406,8 @@ static struct scsi_host_template virtscsi_host_template = {
- &__val, sizeof(__val)); \
- })
-
--static int __devinit virtscsi_init(struct virtio_device *vdev,
-- struct virtio_scsi *vscsi)
-+static int virtscsi_init(struct virtio_device *vdev,
-+ struct virtio_scsi *vscsi)
- {
- int err;
- struct virtqueue *vqs[3];
-@@ -491,7 +491,7 @@ virtscsi_init_failed:
- return err;
- }
-
--static void __devexit virtscsi_remove_vqs(struct virtio_device *vdev)
-+static void virtscsi_remove_vqs(struct virtio_device *vdev)
- {
- /* Stop all the virtqueues. */
- vdev->config->reset(vdev);
-@@ -509,6 +509,22 @@ static void __devexit virtscsi_remove(struct virtio_device *vdev)
- scsi_host_put(shost);
- }
-
-+#ifdef CONFIG_PM
-+static int virtscsi_freeze(struct virtio_device *vdev)
-+{
-+ virtscsi_remove_vqs(vdev);
-+ return 0;
-+}
-+
-+static int virtscsi_restore(struct virtio_device *vdev)
-+{
-+ struct Scsi_Host *sh = virtio_scsi_host(vdev);
-+ struct virtio_scsi *vscsi = shost_priv(sh);
-+
-+ return virtscsi_init(vdev, vscsi);
-+}
-+#endif
-+
- static struct virtio_device_id id_table[] = {
- { VIRTIO_ID_SCSI, VIRTIO_DEV_ANY_ID },
- { 0 },
-@@ -519,6 +535,10 @@ static struct virtio_driver virtio_scsi_driver = {
- .driver.owner = THIS_MODULE,
- .id_table = id_table,
- .probe = virtscsi_probe,
-+#ifdef CONFIG_PM
-+ .freeze = virtscsi_freeze,
-+ .restore = virtscsi_restore,
-+#endif
- .remove = __devexit_p(virtscsi_remove),
- };
-
---
-1.7.1
-
diff --git a/freed-ora/current/master/mac80211-fix-possible-tid_rx-reorder_timer-use-after-free.patch b/freed-ora/current/master/mac80211-fix-possible-tid_rx-reorder_timer-use-after-free.patch
new file mode 100644
index 000000000..accda8afc
--- /dev/null
+++ b/freed-ora/current/master/mac80211-fix-possible-tid_rx-reorder_timer-use-after-free.patch
@@ -0,0 +1,42 @@
+Is possible that we will arm the tid_rx->reorder_timer after
+del_timer_sync() in ___ieee80211_stop_rx_ba_session(). We need to stop
+timer after RCU grace period finish, so move it to
+ieee80211_free_tid_rx(). Timer will not be armed again, as
+rcu_dereference(sta->ampdu_mlme.tid_rx[tid]) will return NULL.
+
+Debug object detected problem with the following warning:
+ODEBUG: free active (active state 0) object type: timer_list hint: sta_rx_agg_reorder_timer_expired+0x0/0xf0 [mac80211]
+
+Bug report (with all warning messages):
+https://bugzilla.redhat.com/show_bug.cgi?id=804007
+
+Reported-by: "jan p. springer" <jsd@igroup.org>
+Cc: stable@vger.kernel.org
+Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
+---
+ net/mac80211/agg-rx.c | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c
+index 1068f66..64d3ce5 100644
+--- a/net/mac80211/agg-rx.c
++++ b/net/mac80211/agg-rx.c
+@@ -49,6 +49,8 @@ static void ieee80211_free_tid_rx(struct rcu_head *h)
+ container_of(h, struct tid_ampdu_rx, rcu_head);
+ int i;
+
++ del_timer_sync(&tid_rx->reorder_timer);
++
+ for (i = 0; i < tid_rx->buf_size; i++)
+ dev_kfree_skb(tid_rx->reorder_buf[i]);
+ kfree(tid_rx->reorder_buf);
+@@ -91,7 +93,6 @@ void ___ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
+ tid, WLAN_BACK_RECIPIENT, reason);
+
+ del_timer_sync(&tid_rx->session_timer);
+- del_timer_sync(&tid_rx->reorder_timer);
+
+ call_rcu(&tid_rx->rcu_head, ieee80211_free_tid_rx);
+ }
+--
+1.7.1
diff --git a/freed-ora/current/master/macvtap-zerocopy-validate-vector-length.patch b/freed-ora/current/master/macvtap-zerocopy-validate-vector-length.patch
new file mode 100644
index 000000000..3ac31e4b6
--- /dev/null
+++ b/freed-ora/current/master/macvtap-zerocopy-validate-vector-length.patch
@@ -0,0 +1,25 @@
+Currently we do not validate the vector length before calling
+get_user_pages_fast(), host stack would be easily overflowed by
+malicious guest driver who give us a descriptor with length greater
+than MAX_SKB_FRAGS. Solve this problem by checking the free entries
+before trying to pin user pages.
+
+Signed-off-by: Jason Wang <jasowang@redhat.com>
+---
+ drivers/net/macvtap.c | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
+index 7cb2684..d197a78 100644
+--- a/drivers/net/macvtap.c
++++ b/drivers/net/macvtap.c
+@@ -527,6 +527,8 @@ static int zerocopy_sg_from_iovec(struct sk_buff *skb, const struct iovec *from,
+ }
+ base = (unsigned long)from->iov_base + offset1;
+ size = ((base & ~PAGE_MASK) + len + ~PAGE_MASK) >> PAGE_SHIFT;
++ if (i + size >= MAX_SKB_FRAGS)
++ return -EFAULT;
+ num_pages = get_user_pages_fast(base, size, 0, &page[i]);
+ if ((num_pages != size) ||
+ (num_pages > MAX_SKB_FRAGS - skb_shinfo(skb)->nr_frags))
+
diff --git a/freed-ora/current/master/mcelog-rcu-splat.patch b/freed-ora/current/master/mcelog-rcu-splat.patch
deleted file mode 100644
index 12c1fe3ea..000000000
--- a/freed-ora/current/master/mcelog-rcu-splat.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
-index f22a9f7..f525f99 100644
---- a/arch/x86/kernel/cpu/mcheck/mce.c
-+++ b/arch/x86/kernel/cpu/mcheck/mce.c
-@@ -191,7 +191,7 @@ static void drain_mcelog_buffer(void)
- {
- unsigned int next, i, prev = 0;
-
-- next = rcu_dereference_check_mce(mcelog.next);
-+ next = ACCESS_ONCE(mcelog.next);
-
- do {
- struct mce *m;
-
- \ No newline at end of file
diff --git a/freed-ora/current/master/mm-thp-fix-pmd_bad-triggering.patch b/freed-ora/current/master/mm-thp-fix-pmd_bad-triggering.patch
deleted file mode 100644
index 8e1a77cd7..000000000
--- a/freed-ora/current/master/mm-thp-fix-pmd_bad-triggering.patch
+++ /dev/null
@@ -1,447 +0,0 @@
-In some cases it may happen that pmd_none_or_clear_bad() is called
-with the mmap_sem hold in read mode. In those cases the huge page
-faults can allocate hugepmds under pmd_none_or_clear_bad() and that
-can trigger a false positive from pmd_bad() that will not like to see
-a pmd materializing as trans huge.
-
-It's not khugepaged the problem, khugepaged holds the mmap_sem in
-write mode (and all those sites must hold the mmap_sem in read mode to
-prevent pagetables to go away from under them, during code review it
-seems vm86 mode on 32bit kernels requires that too unless it's
-restricted to 1 thread per process or UP builds). The race is only
-with the huge pagefaults that can convert a pmd_none() into a
-pmd_trans_huge().
-
-Effectively all these pmd_none_or_clear_bad() sites running with
-mmap_sem in read mode are somewhat speculative with the page faults,
-and the result is always undefined when they run simultaneously. This
-is probably why it wasn't common to run into this. For example if the
-madvise(MADV_DONTNEED) runs zap_page_range() shortly before the page
-fault, the hugepage will not be zapped, if the page fault runs first
-it will be zapped.
-
-Altering pmd_bad() not to error out if it finds hugepmds won't be
-enough to fix this, because zap_pmd_range would then proceed to call
-zap_pte_range (which would be incorrect if the pmd become a
-pmd_trans_huge()).
-
-The simplest way to fix this is to read the pmd in the local stack
-(regardless of what we read, no need of actual CPU barriers, only
-compiler barrier needed), and be sure it is not changing under the
-code that computes its value. Even if the real pmd is changing under
-the value we hold on the stack, we don't care. If we actually end up
-in zap_pte_range it means the pmd was not none already and it was not
-huge, and it can't become huge from under us (khugepaged locking
-explained above).
-
-All we need is to enforce that there is no way anymore that in a code
-path like below, pmd_trans_huge can be false, but
-pmd_none_or_clear_bad can run into a hugepmd. The overhead of a
-barrier() is just a compiler tweak and should not be measurable (I
-only added it for THP builds). I don't exclude different compiler
-versions may have prevented the race too by caching the value of *pmd
-on the stack (that hasn't been verified, but it wouldn't be impossible
-considering pmd_none_or_clear_bad, pmd_bad, pmd_trans_huge, pmd_none
-are all inlines and there's no external function called in between
-pmd_trans_huge and pmd_none_or_clear_bad).
-
- if (pmd_trans_huge(*pmd)) {
- if (next-addr != HPAGE_PMD_SIZE) {
- VM_BUG_ON(!rwsem_is_locked(&tlb->mm->mmap_sem));
- split_huge_page_pmd(vma->vm_mm, pmd);
- } else if (zap_huge_pmd(tlb, vma, pmd, addr))
- continue;
- /* fall through */
- }
- if (pmd_none_or_clear_bad(pmd))
-
-Because this race condition could be exercised without special
-privileges this was reported in CVE-2012-1179.
-
-The race was identified and fully explained by Ulrich who debugged it.
-I'm quoting his accurate explanation below, for reference.
-
-====== start quote =======
- mapcount 0 page_mapcount 1
- kernel BUG at mm/huge_memory.c:1384!
-
-At some point prior to the panic, a "bad pmd ..." message similar to the
-following is logged on the console:
-
- mm/memory.c:145: bad pmd ffff8800376e1f98(80000000314000e7).
-
-The "bad pmd ..." message is logged by pmd_clear_bad() before it clears
-the page's PMD table entry.
-
- 143 void pmd_clear_bad(pmd_t *pmd)
- 144 {
--> 145 pmd_ERROR(*pmd);
- 146 pmd_clear(pmd);
- 147 }
-
-After the PMD table entry has been cleared, there is an inconsistency
-between the actual number of PMD table entries that are mapping the page
-and the page's map count (_mapcount field in struct page). When the page
-is subsequently reclaimed, __split_huge_page() detects this inconsistency.
-
- 1381 if (mapcount != page_mapcount(page))
- 1382 printk(KERN_ERR "mapcount %d page_mapcount %d\n",
- 1383 mapcount, page_mapcount(page));
--> 1384 BUG_ON(mapcount != page_mapcount(page));
-
-The root cause of the problem is a race of two threads in a multithreaded
-process. Thread B incurs a page fault on a virtual address that has never
-been accessed (PMD entry is zero) while Thread A is executing an madvise()
-system call on a virtual address within the same 2 MB (huge page) range.
-
- virtual address space
- .---------------------.
- | |
- | |
- .-|---------------------|
- | | |
- | | |<-- B(fault)
- | | |
- 2 MB | |/////////////////////|-.
- huge < |/////////////////////| > A(range)
- page | |/////////////////////|-'
- | | |
- | | |
- '-|---------------------|
- | |
- | |
- '---------------------'
-
-- Thread A is executing an madvise(..., MADV_DONTNEED) system call
- on the virtual address range "A(range)" shown in the picture.
-
-sys_madvise
- // Acquire the semaphore in shared mode.
- down_read(&current->mm->mmap_sem)
- ...
- madvise_vma
- switch (behavior)
- case MADV_DONTNEED:
- madvise_dontneed
- zap_page_range
- unmap_vmas
- unmap_page_range
- zap_pud_range
- zap_pmd_range
- //
- // Assume that this huge page has never been accessed.
- // I.e. content of the PMD entry is zero (not mapped).
- //
- if (pmd_trans_huge(*pmd)) {
- // We don't get here due to the above assumption.
- }
- //
- // Assume that Thread B incurred a page fault and
- .---------> // sneaks in here as shown below.
- | //
- | if (pmd_none_or_clear_bad(pmd))
- | {
- | if (unlikely(pmd_bad(*pmd)))
- | pmd_clear_bad
- | {
- | pmd_ERROR
- | // Log "bad pmd ..." message here.
- | pmd_clear
- | // Clear the page's PMD entry.
- | // Thread B incremented the map count
- | // in page_add_new_anon_rmap(), but
- | // now the page is no longer mapped
- | // by a PMD entry (-> inconsistency).
- | }
- | }
- |
- v
-- Thread B is handling a page fault on virtual address "B(fault)" shown
- in the picture.
-
-...
-do_page_fault
- __do_page_fault
- // Acquire the semaphore in shared mode.
- down_read_trylock(&mm->mmap_sem)
- ...
- handle_mm_fault
- if (pmd_none(*pmd) && transparent_hugepage_enabled(vma))
- // We get here due to the above assumption (PMD entry is zero).
- do_huge_pmd_anonymous_page
- alloc_hugepage_vma
- // Allocate a new transparent huge page here.
- ...
- __do_huge_pmd_anonymous_page
- ...
- spin_lock(&mm->page_table_lock)
- ...
- page_add_new_anon_rmap
- // Here we increment the page's map count (starts at -1).
- atomic_set(&page->_mapcount, 0)
- set_pmd_at
- // Here we set the page's PMD entry which will be cleared
- // when Thread A calls pmd_clear_bad().
- ...
- spin_unlock(&mm->page_table_lock)
-
-The mmap_sem does not prevent the race because both threads are acquiring
-it in shared mode (down_read). Thread B holds the page_table_lock while
-the page's map count and PMD table entry are updated. However, Thread A
-does not synchronize on that lock.
-====== end quote =======
-
-Reported-by: Ulrich Obergfell <uobergfe@redhat.com>
-Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
----
- arch/x86/kernel/vm86_32.c | 2 +
- fs/proc/task_mmu.c | 9 ++++++
- include/asm-generic/pgtable.h | 57 +++++++++++++++++++++++++++++++++++++++++
- mm/memcontrol.c | 4 +++
- mm/memory.c | 14 ++++++++--
- mm/mempolicy.c | 2 +-
- mm/mincore.c | 2 +-
- mm/pagewalk.c | 2 +-
- mm/swapfile.c | 4 +--
- 9 files changed, 87 insertions(+), 9 deletions(-)
-
-diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c
-index b466cab..328cb37 100644
---- a/arch/x86/kernel/vm86_32.c
-+++ b/arch/x86/kernel/vm86_32.c
-@@ -172,6 +172,7 @@ static void mark_screen_rdonly(struct mm_struct *mm)
- spinlock_t *ptl;
- int i;
-
-+ down_write(&mm->mmap_sem);
- pgd = pgd_offset(mm, 0xA0000);
- if (pgd_none_or_clear_bad(pgd))
- goto out;
-@@ -190,6 +191,7 @@ static void mark_screen_rdonly(struct mm_struct *mm)
- }
- pte_unmap_unlock(pte, ptl);
- out:
-+ up_write(&mm->mmap_sem);
- flush_tlb();
- }
-
-diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
-index 7dcd2a2..3efa725 100644
---- a/fs/proc/task_mmu.c
-+++ b/fs/proc/task_mmu.c
-@@ -409,6 +409,9 @@ static int smaps_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
- } else {
- spin_unlock(&walk->mm->page_table_lock);
- }
-+
-+ if (pmd_trans_unstable(pmd))
-+ return 0;
- /*
- * The mmap_sem held all the way back in m_start() is what
- * keeps khugepaged out of here and from collapsing things
-@@ -507,6 +510,8 @@ static int clear_refs_pte_range(pmd_t *pmd, unsigned long addr,
- struct page *page;
-
- split_huge_page_pmd(walk->mm, pmd);
-+ if (pmd_trans_unstable(pmd))
-+ return 0;
-
- pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl);
- for (; addr != end; pte++, addr += PAGE_SIZE) {
-@@ -670,6 +675,8 @@ static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
- int err = 0;
-
- split_huge_page_pmd(walk->mm, pmd);
-+ if (pmd_trans_unstable(pmd))
-+ return 0;
-
- /* find the first VMA at or above 'addr' */
- vma = find_vma(walk->mm, addr);
-@@ -961,6 +968,8 @@ static int gather_pte_stats(pmd_t *pmd, unsigned long addr,
- spin_unlock(&walk->mm->page_table_lock);
- }
-
-+ if (pmd_trans_unstable(pmd))
-+ return 0;
- orig_pte = pte = pte_offset_map_lock(walk->mm, pmd, addr, &ptl);
- do {
- struct page *page = can_gather_numa_stats(*pte, md->vma, addr);
-diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
-index 76bff2b..10f8291 100644
---- a/include/asm-generic/pgtable.h
-+++ b/include/asm-generic/pgtable.h
-@@ -443,6 +443,63 @@ static inline int pmd_write(pmd_t pmd)
- #endif /* __HAVE_ARCH_PMD_WRITE */
- #endif
-
-+/*
-+ * This function is meant to be used by sites walking pagetables with
-+ * the mmap_sem hold in read mode to protect against MADV_DONTNEED and
-+ * transhuge page faults. MADV_DONTNEED can convert a transhuge pmd
-+ * into a null pmd and the transhuge page fault can convert a null pmd
-+ * into an hugepmd or into a regular pmd (if the hugepage allocation
-+ * fails). While holding the mmap_sem in read mode the pmd becomes
-+ * stable and stops changing under us only if it's not null and not a
-+ * transhuge pmd. When those races occurs and this function makes a
-+ * difference vs the standard pmd_none_or_clear_bad, the result is
-+ * undefined so behaving like if the pmd was none is safe (because it
-+ * can return none anyway). The compiler level barrier() is critically
-+ * important to compute the two checks atomically on the same pmdval.
-+ */
-+static inline int pmd_none_or_trans_huge_or_clear_bad(pmd_t *pmd)
-+{
-+ /* depend on compiler for an atomic pmd read */
-+ pmd_t pmdval = *pmd;
-+ /*
-+ * The barrier will stabilize the pmdval in a register or on
-+ * the stack so that it will stop changing under the code.
-+ */
-+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
-+ barrier();
-+#endif
-+ if (pmd_none(pmdval))
-+ return 1;
-+ if (unlikely(pmd_bad(pmdval))) {
-+ if (!pmd_trans_huge(pmdval))
-+ pmd_clear_bad(pmd);
-+ return 1;
-+ }
-+ return 0;
-+}
-+
-+/*
-+ * This is a noop if Transparent Hugepage Support is not built into
-+ * the kernel. Otherwise it is equivalent to
-+ * pmd_none_or_trans_huge_or_clear_bad(), and shall only be called in
-+ * places that already verified the pmd is not none and they want to
-+ * walk ptes while holding the mmap sem in read mode (write mode don't
-+ * need this). If THP is not enabled, the pmd can't go away under the
-+ * code even if MADV_DONTNEED runs, but if THP is enabled we need to
-+ * run a pmd_trans_unstable before walking the ptes after
-+ * split_huge_page_pmd returns (because it may have run when the pmd
-+ * become null, but then a page fault can map in a THP and not a
-+ * regular page).
-+ */
-+static inline int pmd_trans_unstable(pmd_t *pmd)
-+{
-+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
-+ return pmd_none_or_trans_huge_or_clear_bad(pmd);
-+#else
-+ return 0;
-+#endif
-+}
-+
- #endif /* !__ASSEMBLY__ */
-
- #endif /* _ASM_GENERIC_PGTABLE_H */
-diff --git a/mm/memcontrol.c b/mm/memcontrol.c
-index d0e57a3..67b0578 100644
---- a/mm/memcontrol.c
-+++ b/mm/memcontrol.c
-@@ -5193,6 +5193,8 @@ static int mem_cgroup_count_precharge_pte_range(pmd_t *pmd,
- spinlock_t *ptl;
-
- split_huge_page_pmd(walk->mm, pmd);
-+ if (pmd_trans_unstable(pmd))
-+ return 0;
-
- pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl);
- for (; addr != end; pte++, addr += PAGE_SIZE)
-@@ -5355,6 +5357,8 @@ static int mem_cgroup_move_charge_pte_range(pmd_t *pmd,
- spinlock_t *ptl;
-
- split_huge_page_pmd(walk->mm, pmd);
-+ if (pmd_trans_unstable(pmd))
-+ return 0;
- retry:
- pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl);
- for (; addr != end; addr += PAGE_SIZE) {
-diff --git a/mm/memory.c b/mm/memory.c
-index fa2f04e..e3090fc 100644
---- a/mm/memory.c
-+++ b/mm/memory.c
-@@ -1251,12 +1251,20 @@ static inline unsigned long zap_pmd_range(struct mmu_gather *tlb,
- VM_BUG_ON(!rwsem_is_locked(&tlb->mm->mmap_sem));
- split_huge_page_pmd(vma->vm_mm, pmd);
- } else if (zap_huge_pmd(tlb, vma, pmd, addr))
-- continue;
-+ goto next;
- /* fall through */
- }
-- if (pmd_none_or_clear_bad(pmd))
-- continue;
-+ /*
-+ * Here there can be other concurrent MADV_DONTNEED or
-+ * trans huge page faults running, and if the pmd is
-+ * none or trans huge it can change under us. This is
-+ * because MADV_DONTNEED holds the mmap_sem in read
-+ * mode.
-+ */
-+ if (pmd_none_or_trans_huge_or_clear_bad(pmd))
-+ goto next;
- next = zap_pte_range(tlb, vma, pmd, addr, next, details);
-+ next:
- cond_resched();
- } while (pmd++, addr = next, addr != end);
-
-diff --git a/mm/mempolicy.c b/mm/mempolicy.c
-index 47296fe..0a37570 100644
---- a/mm/mempolicy.c
-+++ b/mm/mempolicy.c
-@@ -512,7 +512,7 @@ static inline int check_pmd_range(struct vm_area_struct *vma, pud_t *pud,
- do {
- next = pmd_addr_end(addr, end);
- split_huge_page_pmd(vma->vm_mm, pmd);
-- if (pmd_none_or_clear_bad(pmd))
-+ if (pmd_none_or_trans_huge_or_clear_bad(pmd))
- continue;
- if (check_pte_range(vma, pmd, addr, next, nodes,
- flags, private))
-diff --git a/mm/mincore.c b/mm/mincore.c
-index 636a868..936b4ce 100644
---- a/mm/mincore.c
-+++ b/mm/mincore.c
-@@ -164,7 +164,7 @@ static void mincore_pmd_range(struct vm_area_struct *vma, pud_t *pud,
- }
- /* fall through */
- }
-- if (pmd_none_or_clear_bad(pmd))
-+ if (pmd_none_or_trans_huge_or_clear_bad(pmd))
- mincore_unmapped_range(vma, addr, next, vec);
- else
- mincore_pte_range(vma, pmd, addr, next, vec);
-diff --git a/mm/pagewalk.c b/mm/pagewalk.c
-index 2f5cf10..aa9701e 100644
---- a/mm/pagewalk.c
-+++ b/mm/pagewalk.c
-@@ -59,7 +59,7 @@ again:
- continue;
-
- split_huge_page_pmd(walk->mm, pmd);
-- if (pmd_none_or_clear_bad(pmd))
-+ if (pmd_none_or_trans_huge_or_clear_bad(pmd))
- goto again;
- err = walk_pte_range(pmd, addr, next, walk);
- if (err)
-diff --git a/mm/swapfile.c b/mm/swapfile.c
-index d999f09..f31b29d 100644
---- a/mm/swapfile.c
-+++ b/mm/swapfile.c
-@@ -932,9 +932,7 @@ static inline int unuse_pmd_range(struct vm_area_struct *vma, pud_t *pud,
- pmd = pmd_offset(pud, addr);
- do {
- next = pmd_addr_end(addr, end);
-- if (unlikely(pmd_trans_huge(*pmd)))
-- continue;
-- if (pmd_none_or_clear_bad(pmd))
-+ if (pmd_none_or_trans_huge_or_clear_bad(pmd))
- continue;
- ret = unuse_pte_range(vma, pmd, addr, next, entry, page);
- if (ret)
-
---
-To unsubscribe, send a message with 'unsubscribe linux-mm' in
-the body to majordomo@kvack.org. For more info on Linux MM,
-see: http://www.linux-mm.org/ .
-Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
-Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> \ No newline at end of file
diff --git a/freed-ora/current/master/mod-extra.list b/freed-ora/current/master/mod-extra.list
index b670e836c..d4aefed35 100644
--- a/freed-ora/current/master/mod-extra.list
+++ b/freed-ora/current/master/mod-extra.list
@@ -15,6 +15,7 @@ dccp_ipv4.ko
dccp_ipv6.ko
dccp.ko
dccp_probe.ko
+dlm.ko
sctp.ko
sctp_probe.ko
rds.ko
@@ -31,7 +32,6 @@ l2tp_eth.ko
l2tp_ip.ko
l2tp_netlink.ko
l2tp_ppp.ko
-llc.ko
ipx.ko
appletalk.ko
ipddp.ko
@@ -89,6 +89,8 @@ mptbase.ko
mptctl.ko
mptfc.ko
i2400m.ko
+i2400m-usb.ko
+i2400m-sdio.ko
hisax.ko
hysdn.ko
isdn.ko
@@ -141,13 +143,14 @@ umc.ko
uwb.ko
whci.ko
hwa-rc.ko
-uio.ko
-uio_aec.ko
-uio_pci_generic.ko
gfs2.ko
ocfs2.ko
-ocfs2_stackglue.ko
ocfs2_dlm.ko
+ocfs2_dlmfs.ko
+ocfs2_nodemanager.ko
+ocfs2_stackglue.ko
+ocfs2_stack_o2cb.ko
+ocfs2_stack_user.ko
cuse.ko
affs.ko
befs.ko
@@ -155,8 +158,6 @@ sysv.ko
ufs.ko
ncpfs.ko
coda.ko
-9p.ko
-9pnet.ko
act200l-sir.ko
ali-ircc.ko
esi-sir.ko
@@ -170,8 +171,9 @@ ksdazzle-sir.ko
ma600-sir.ko
mcp2120-sir.ko
toim3232-sir.ko
-pps_core.ko
tpm_atmel.ko
tpm_infineon.ko
tpm_nsc.ko
tpm_tis.ko
+slip.ko
+nilfs2.ko
diff --git a/freed-ora/current/master/modsign-20111207.patch b/freed-ora/current/master/modsign-20111207.patch
index 8e43422a3..5eee17a87 100644
--- a/freed-ora/current/master/modsign-20111207.patch
+++ b/freed-ora/current/master/modsign-20111207.patch
@@ -7359,3 +7359,34 @@ index 5e77c2a..e40f9b68 100644
--
1.7.9.1
+diff --git a/security/keys/crypto_rsa.c b/security/keys/crypto_rsa.c
+--- a/security/keys/crypto_rsa.c
+--- b/security/keys/crypto_rsa.c
+@@ -219,15 +219,24 @@
+ kenter("");
+
+ /* (1) Check the signature size against the public key modulus size */
+- k = (mpi_get_nbits(key->rsa.n) + 7) / 8;
++ k = mpi_get_nbits(key->rsa.n);
++ tsize = mpi_get_nbits(sig->rsa.s);
+
+- tsize = (mpi_get_nbits(sig->rsa.s) + 7) / 8;
++ /* According to RFC 4880 sec 3.2, length of MPI is computed starting
++ * from most significant bit.
++ * So the RFC 3447 sec 8.2.2 size check must be relaxed to conform
++ * with shorter signatures.
++ * Fail here only if signature length is longer than modulus size.
++ */
+ pr_devel("step 1: k=%zu size(S)=%zu\n", k, tsize);
+- if (tsize != k) {
++ if (k < tsize) {
+ ret = -EBADMSG;
+ goto error;
+ }
+
++ /* Round up to octets */
++ k = (k + 7) / 8;
++
+ /* (2b) Apply the RSAVP1 verification primitive to the public key */
+ ret = RSAVP1(key, sig->rsa.s, &m);
+ if (ret < 0)
diff --git a/freed-ora/current/master/nx-emu-remove-cpuinitdata-for-disable_nx-on-x86_32.patch b/freed-ora/current/master/nx-emu-remove-cpuinitdata-for-disable_nx-on-x86_32.patch
new file mode 100644
index 000000000..38c96caed
--- /dev/null
+++ b/freed-ora/current/master/nx-emu-remove-cpuinitdata-for-disable_nx-on-x86_32.patch
@@ -0,0 +1,47 @@
+>From e540f21852043a4d8e8cf5e505607909d0ab0f51 Mon Sep 17 00:00:00 2001
+From: Tim Gardner <tim.gardner@canonical.com>
+Date: Thu, 29 Mar 2012 06:21:01 -0600
+Subject: [PATCH] UBUNTU: SAUCE: disable_nx should not be in __cpuinitdata
+ section for X86_32
+
+I noticed a section mismatch warning while building 3.2.0-20.33 for X86_32.
+
+ AR arch/x86/lib/lib.a
+ LD vmlinux.o
+ MODPOST vmlinux.o
+WARNING: vmlinux.o(.text+0x187833): Section mismatch in reference from the function load_elf_binary() to the variable .cpuinit.data:disable_nx
+The function load_elf_binary() references
+the variable __cpuinitdata disable_nx.
+This is often because load_elf_binary lacks a __cpuinitdata
+annotation or the annotation of disable_nx is wrong.
+
+load_elf_binary() is definitely called after initialization.
+
+This code was added by 'UBUNTU: ubuntu: nx-emu - i386: NX emulation', so
+this is not an upstream problem.
+
+Reported-by: Tetsuo Handa <from-ubuntu@I-love.SAKURA.ne.jp>
+Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
+---
+ arch/x86/mm/setup_nx.c | 4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/arch/x86/mm/setup_nx.c b/arch/x86/mm/setup_nx.c
+index 90c9eff3..89fd946 100644
+--- a/arch/x86/mm/setup_nx.c
++++ b/arch/x86/mm/setup_nx.c
+@@ -6,7 +6,11 @@
+ #include <asm/pgtable.h>
+ #include <asm/proto.h>
+
++#ifdef CONFIG_X86_32
++int disable_nx; /* referenced by load_elf_binary() */
++#else
+ int disable_nx __cpuinitdata;
++#endif
+
+ /*
+ * noexec = on|off
+--
+1.7.9.1
+
diff --git a/freed-ora/current/master/patch-3.3-gnu-3.4-rc7-gnu.xz.sign b/freed-ora/current/master/patch-3.3-gnu-3.4-rc7-gnu.xz.sign
new file mode 100644
index 000000000..2d4e1493e
--- /dev/null
+++ b/freed-ora/current/master/patch-3.3-gnu-3.4-rc7-gnu.xz.sign
@@ -0,0 +1,7 @@
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.18 (GNU/Linux)
+
+iEYEABECAAYFAk+0Z2oACgkQvLfPh359R6cqNwCdGse9hInIgeMmBYZ6/fYvzf8z
+dzcAnRkPaPwSyOI57ilbe/I/FbT+J7Tv
+=iX5M
+-----END PGP SIGNATURE-----
diff --git a/freed-ora/current/master/rebase-notes.txt b/freed-ora/current/master/rebase-notes.txt
new file mode 100644
index 000000000..39029bb0d
--- /dev/null
+++ b/freed-ora/current/master/rebase-notes.txt
@@ -0,0 +1,7 @@
+Linux 3.4 rebase notes:
+
+* Look at the CPU modalias patches from Andi. See if they are sufficient to
+ build the cpufreq drivers as modules again (rhbz 713572 but mostly to just
+ make this person in IRC be quiet)
+
+* Make sure X32 stays disabled. Preferably forever
diff --git a/freed-ora/current/master/rt2x00_fix_MCU_request_failures.patch b/freed-ora/current/master/rt2x00_fix_MCU_request_failures.patch
deleted file mode 100644
index f7b8a6a4c..000000000
--- a/freed-ora/current/master/rt2x00_fix_MCU_request_failures.patch
+++ /dev/null
@@ -1,136 +0,0 @@
-diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
-index 2571a2f..822f9e5 100644
---- a/drivers/net/wireless/rt2x00/rt2800.h
-+++ b/drivers/net/wireless/rt2x00/rt2800.h
-@@ -1627,6 +1627,7 @@ struct mac_iveiv_entry {
-
- /*
- * H2M_MAILBOX_CSR: Host-to-MCU Mailbox.
-+ * CMD_TOKEN: Command id, 0xff disable status reporting
- */
- #define H2M_MAILBOX_CSR 0x7010
- #define H2M_MAILBOX_CSR_ARG0 FIELD32(0x000000ff)
-@@ -1636,6 +1637,8 @@ struct mac_iveiv_entry {
-
- /*
- * H2M_MAILBOX_CID:
-+ * Free slots contain 0xff. MCU will store command's token to lowest free slot.
-+ * If all slots are occupied status will be dropped.
- */
- #define H2M_MAILBOX_CID 0x7014
- #define H2M_MAILBOX_CID_CMD0 FIELD32(0x000000ff)
-@@ -1645,6 +1648,7 @@ struct mac_iveiv_entry {
-
- /*
- * H2M_MAILBOX_STATUS:
-+ * Command status will be saved to same slot as command id.
- */
- #define H2M_MAILBOX_STATUS 0x701c
-
-@@ -2259,6 +2263,12 @@ struct mac_iveiv_entry {
-
- /*
- * MCU mailbox commands.
-+ * MCU_SLEEP - go to power-save mode.
-+ * arg1: 1: save as much power as possible, 0: save less power
-+ * status: 1: success, 2: already asleep,
-+ * 3: maybe MAC is busy so can't finish this task
-+ * MCU_RADIO_OFF
-+ * arg0: 0: do power-saving, NOT turn off radio
- */
- #define MCU_SLEEP 0x30
- #define MCU_WAKEUP 0x31
-@@ -2279,7 +2289,9 @@ struct mac_iveiv_entry {
- /*
- * MCU mailbox tokens
- */
--#define TOKEN_WAKUP 3
-+#define TOKEN_SLEEP 1
-+#define TOKEN_RADIO_OFF 2
-+#define TOKEN_WAKEUP 3
-
- /*
- * DMA descriptor defines.
-diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
-index dc88bae..9ac3017 100644
---- a/drivers/net/wireless/rt2x00/rt2800pci.c
-+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
-@@ -517,23 +517,6 @@ static void rt2800pci_disable_radio(struct rt2x00_dev *rt2x00dev)
- }
- }
-
--static int rt2800pci_set_state(struct rt2x00_dev *rt2x00dev,
-- enum dev_state state)
--{
-- if (state == STATE_AWAKE) {
-- rt2800_mcu_request(rt2x00dev, MCU_WAKEUP, TOKEN_WAKUP, 0, 0x02);
-- rt2800pci_mcu_status(rt2x00dev, TOKEN_WAKUP);
-- } else if (state == STATE_SLEEP) {
-- rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_STATUS,
-- 0xffffffff);
-- rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_CID,
-- 0xffffffff);
-- rt2800_mcu_request(rt2x00dev, MCU_SLEEP, 0x01, 0xff, 0x01);
-- }
--
-- return 0;
--}
--
- static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,
- enum dev_state state)
- {
-@@ -541,14 +524,20 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,
-
- switch (state) {
- case STATE_RADIO_ON:
-- /*
-- * Before the radio can be enabled, the device first has
-- * to be woken up. After that it needs a bit of time
-- * to be fully awake and then the radio can be enabled.
-- */
-- rt2800pci_set_state(rt2x00dev, STATE_AWAKE);
-- msleep(1);
-+ /* Initialise all registers and send MCU_BOOT_SIGNAL. */
- retval = rt2800pci_enable_radio(rt2x00dev);
-+
-+ /* After resume MCU_BOOT_SIGNAL will trash those. */
-+ rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_STATUS, ~0);
-+ rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0);
-+
-+ /* Finish initialization procedure. */
-+ rt2800_mcu_request(rt2x00dev, MCU_SLEEP, TOKEN_RADIO_OFF,
-+ 0xff, 0x02);
-+ rt2800pci_mcu_status(rt2x00dev, TOKEN_RADIO_OFF);
-+
-+ rt2800_mcu_request(rt2x00dev, MCU_WAKEUP, TOKEN_WAKEUP, 0, 0);
-+ rt2800pci_mcu_status(rt2x00dev, TOKEN_WAKEUP);
- break;
- case STATE_RADIO_OFF:
- /*
-@@ -556,7 +545,7 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,
- * be put to sleep for powersaving.
- */
- rt2800pci_disable_radio(rt2x00dev);
-- rt2800pci_set_state(rt2x00dev, STATE_SLEEP);
-+ rt2800pci_set_device_state(rt2x00dev, STATE_SLEEP);
- break;
- case STATE_RADIO_IRQ_ON:
- case STATE_RADIO_IRQ_OFF:
-@@ -565,8 +554,16 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,
- case STATE_DEEP_SLEEP:
- case STATE_SLEEP:
- case STATE_STANDBY:
-+ /* PCIe devices won't report status after SLEEP request. */
-+ rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_STATUS, ~0);
-+ rt2x00pci_register_write(rt2x00dev, H2M_MAILBOX_CID, ~0);
-+ rt2800_mcu_request(rt2x00dev, MCU_SLEEP, TOKEN_SLEEP,
-+ 0xff, 0x01);
-+ break;
- case STATE_AWAKE:
-- retval = rt2800pci_set_state(rt2x00dev, state);
-+ rt2800_mcu_request(rt2x00dev, MCU_WAKEUP, TOKEN_WAKEUP,
-+ 0, 0x02);
-+ rt2800pci_mcu_status(rt2x00dev, TOKEN_WAKEUP);
- break;
- default:
- retval = -ENOTSUPP;
diff --git a/freed-ora/current/master/scripts/allarchconfig.sh b/freed-ora/current/master/scripts/allarchconfig.sh
new file mode 100755
index 000000000..f80c23197
--- /dev/null
+++ b/freed-ora/current/master/scripts/allarchconfig.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+# Run from within a source tree.
+
+for i in configs/kernel-*.config
+do
+ cp -f $i .config
+ Arch=`head -1 .config | cut -b 3-`
+ echo $Arch \($i\)
+ make ARCH=$Arch listnewconfig | grep -E '^CONFIG_' >.newoptions || true;
+ if [ -s .newoptions ]; then
+ cat .newoptions;
+ exit 1;
+ fi;
+ rm -f .newoptions;
+done
+
diff --git a/freed-ora/current/master/selinux-apply-different-permission-to-ptrace-child.patch b/freed-ora/current/master/selinux-apply-different-permission-to-ptrace-child.patch
new file mode 100644
index 000000000..90baad840
--- /dev/null
+++ b/freed-ora/current/master/selinux-apply-different-permission-to-ptrace-child.patch
@@ -0,0 +1,162 @@
+Some applications, like gdb, are able to ptrace both children or other
+completely unrelated tasks. We would like to be able to discern these two
+things and to be able to allow gdb to ptrace it's children, but not to be
+able to ptrace unrelated tasks for security reasons.
+
+Upstream is a bit weary of this patch as it may be incomplete. They are
+not fundamentally opposed to the patch, I was just ask to see if I could
+flush out any needed refinement in Fedora where we already had the
+problem. We may find that we need to emulate the YAMA non-child
+registration module in order to completely deal with 'normal' ptrace on
+a system. At the moment however, this patch will at least let us get
+gdb working for many users in Fedora (See fedora-devel-list for a
+discussion of the current issues people are complaining about in F17
+without this)
+
+---
+
+ security/selinux/hooks.c | 38 +++++++++++++++++++++++++++++++++++
+ security/selinux/include/classmap.h | 2 +-
+ security/selinux/include/security.h | 2 ++
+ security/selinux/selinuxfs.c | 3 ++-
+ security/selinux/ss/services.c | 3 +++
+ 5 files changed, 46 insertions(+), 2 deletions(-)
+
+diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
+index 1a4acf4..b226f26 100644
+--- a/security/selinux/hooks.c
++++ b/security/selinux/hooks.c
+@@ -1805,6 +1805,39 @@ static inline u32 open_file_to_av(struct file *file)
+
+ /* Hook functions begin here. */
+
++/**
++ * task_is_descendant - walk up a process family tree looking for a match
++ * @parent: the process to compare against while walking up from child
++ * @child: the process to start from while looking upwards for parent
++ *
++ * Returns 1 if child is a descendant of parent, 0 if not.
++ */
++static int task_is_descendant(struct task_struct *parent,
++ struct task_struct *child)
++{
++ int rc = 0;
++ struct task_struct *walker = child;
++
++ if (!parent || !child)
++ return 0;
++
++ rcu_read_lock();
++ if (!thread_group_leader(parent))
++ parent = rcu_dereference(parent->group_leader);
++ while (walker->pid > 0) {
++ if (!thread_group_leader(walker))
++ walker = rcu_dereference(walker->group_leader);
++ if (walker == parent) {
++ rc = 1;
++ break;
++ }
++ walker = rcu_dereference(walker->real_parent);
++ }
++ rcu_read_unlock();
++
++ return rc;
++}
++
+ static int selinux_ptrace_access_check(struct task_struct *child,
+ unsigned int mode)
+ {
+@@ -1820,6 +1853,9 @@ static int selinux_ptrace_access_check(struct task_struct *child,
+ return avc_has_perm(sid, csid, SECCLASS_FILE, FILE__READ, NULL);
+ }
+
++
++ if (selinux_policycap_ptrace_child && task_is_descendant(current, child))
++ return current_has_perm(child, PROCESS__PTRACE_CHILD);
+ return current_has_perm(child, PROCESS__PTRACE);
+ }
+
+@@ -1831,6 +1867,8 @@ static int selinux_ptrace_traceme(struct task_struct *parent)
+ if (rc)
+ return rc;
+
++ if (selinux_policycap_ptrace_child && task_is_descendant(parent, current))
++ return task_has_perm(parent, current, PROCESS__PTRACE_CHILD);
+ return task_has_perm(parent, current, PROCESS__PTRACE);
+ }
+
+diff --git a/security/selinux/include/classmap.h b/security/selinux/include/classmap.h
+index 39e678c..72c08b9 100644
+--- a/security/selinux/include/classmap.h
++++ b/security/selinux/include/classmap.h
+@@ -29,7 +29,7 @@ struct security_class_mapping secclass_map[] = {
+ "getattr", "setexec", "setfscreate", "noatsecure", "siginh",
+ "setrlimit", "rlimitinh", "dyntransition", "setcurrent",
+ "execmem", "execstack", "execheap", "setkeycreate",
+- "setsockcreate", NULL } },
++ "setsockcreate", "ptrace_child", NULL } },
+ { "system",
+ { "ipc_info", "syslog_read", "syslog_mod",
+ "syslog_console", "module_request", NULL } },
+diff --git a/security/selinux/include/security.h b/security/selinux/include/security.h
+index dde2005..ac14b0a 100644
+--- a/security/selinux/include/security.h
++++ b/security/selinux/include/security.h
+@@ -68,12 +68,14 @@ extern int selinux_enabled;
+ enum {
+ POLICYDB_CAPABILITY_NETPEER,
+ POLICYDB_CAPABILITY_OPENPERM,
++ POLICYDB_CAPABILITY_PTRACE_CHILD,
+ __POLICYDB_CAPABILITY_MAX
+ };
+ #define POLICYDB_CAPABILITY_MAX (__POLICYDB_CAPABILITY_MAX - 1)
+
+ extern int selinux_policycap_netpeer;
+ extern int selinux_policycap_openperm;
++extern int selinux_policycap_ptrace_child;
+
+ /*
+ * type_datum properties
+diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
+index 4e93f9e..3379765 100644
+--- a/security/selinux/selinuxfs.c
++++ b/security/selinux/selinuxfs.c
+@@ -44,7 +44,8 @@
+ /* Policy capability filenames */
+ static char *policycap_names[] = {
+ "network_peer_controls",
+- "open_perms"
++ "open_perms",
++ "ptrace_child",
+ };
+
+ unsigned int selinux_checkreqprot = CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE;
+diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
+index 9b7e7ed..4d12a6e 100644
+--- a/security/selinux/ss/services.c
++++ b/security/selinux/ss/services.c
+@@ -72,6 +72,7 @@
+
+ int selinux_policycap_netpeer;
+ int selinux_policycap_openperm;
++int selinux_policycap_ptrace_child;
+
+ static DEFINE_RWLOCK(policy_rwlock);
+
+@@ -1812,6 +1813,8 @@ static void security_load_policycaps(void)
+ POLICYDB_CAPABILITY_NETPEER);
+ selinux_policycap_openperm = ebitmap_get_bit(&policydb.policycaps,
+ POLICYDB_CAPABILITY_OPENPERM);
++ selinux_policycap_ptrace_child = ebitmap_get_bit(&policydb.policycaps,
++ POLICYDB_CAPABILITY_PTRACE_CHILD);
+ }
+
+ static int security_preserve_bools(struct policydb *p);
+
+
+
+
+_______________________________________________
+kernel mailing list
+kernel@lists.fedoraproject.org
+https://admin.fedoraproject.org/mailman/listinfo/kernel
diff --git a/freed-ora/current/master/shlib_base_randomize.patch b/freed-ora/current/master/shlib_base_randomize.patch
new file mode 100644
index 000000000..80e4d644b
--- /dev/null
+++ b/freed-ora/current/master/shlib_base_randomize.patch
@@ -0,0 +1,69 @@
+diff -uNrp kernel-3.2.fc16.orig/arch/x86/mm/mmap.c kernel-3.2.fc16.new/arch/x86/mm/mmap.c
+--- kernel-3.2.fc16.orig/arch/x86/mm/mmap.c 2012-03-19 16:47:03.495169091 -0400
++++ kernel-3.2.fc16.new/arch/x86/mm/mmap.c 2012-03-19 16:50:03.574168052 -0400
+@@ -106,6 +106,10 @@ static unsigned long mmap_legacy_base(vo
+ return TASK_UNMAPPED_BASE + mmap_rnd();
+ }
+
++#ifdef CONFIG_X86_32
++ #define SHLIB_BASE 0x00111000
++#endif
++
+ /*
+ * This function, called very early during the creation of a new
+ * process VM image, sets up which VM layout function to use:
+@@ -126,8 +126,10 @@ void arch_pick_mmap_layout(struct mm_str
+ #ifdef CONFIG_X86_32
+ if (!(current->personality & READ_IMPLIES_EXEC)
+ && !(__supported_pte_mask & _PAGE_NX)
+- && mmap_is_ia32())
++ && mmap_is_ia32()) {
++ mm->shlib_base = SHLIB_BASE + mmap_rnd();
+ mm->get_unmapped_exec_area = arch_get_unmapped_exec_area;
++ }
+ #endif
+ mm->unmap_area = arch_unmap_area_topdown;
+ }
+diff -uNrp kernel-3.2.fc16.orig/include/linux/mm_types.h kernel-3.2.fc16.new/include/linux/mm_types.h
+--- kernel-3.2.fc16.orig/include/linux/mm_types.h 2012-03-19 16:46:47.382169153 -0400
++++ kernel-3.2.fc16.new/include/linux/mm_types.h 2012-03-19 16:50:40.738168219 -0400
+@@ -300,6 +300,7 @@ struct mm_struct {
+ void (*unmap_area) (struct mm_struct *mm, unsigned long addr);
+ #endif
+ unsigned long mmap_base; /* base of mmap area */
++ unsigned long shlib_base; /* base of lib map area (ASCII armour)*/
+ unsigned long task_size; /* size of task vm space */
+ unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */
+ unsigned long free_area_cache; /* first hole of size cached_hole_size or larger */
+diff -uNrp kernel-3.2.fc16.orig/mm/mmap.c kernel-3.2.fc16.new/mm/mmap.c
+--- kernel-3.2.fc16.orig/mm/mmap.c 2012-03-19 16:46:15.791169274 -0400
++++ kernel-3.2.fc16.new/mm/mmap.c 2012-03-19 16:51:37.351166875 -0400
+@@ -1594,8 +1594,6 @@ static bool should_randomize(void)
+ !(current->personality & ADDR_NO_RANDOMIZE);
+ }
+
+-#define SHLIB_BASE 0x00110000
+-
+ unsigned long
+ arch_get_unmapped_exec_area(struct file *filp, unsigned long addr0,
+ unsigned long len0, unsigned long pgoff, unsigned long flags)
+@@ -1612,8 +1610,8 @@ arch_get_unmapped_exec_area(struct file
+ return addr;
+
+ if (!addr)
+- addr = !should_randomize() ? SHLIB_BASE :
+- randomize_range(SHLIB_BASE, 0x01000000, len);
++ addr = !should_randomize() ? mm->shlib_base :
++ randomize_range(mm->shlib_base, 0x01000000, len);
+
+ if (addr) {
+ addr = PAGE_ALIGN(addr);
+@@ -1623,7 +1621,7 @@ arch_get_unmapped_exec_area(struct file
+ return addr;
+ }
+
+- addr = SHLIB_BASE;
++ addr = mm->shlib_base;
+ for (vma = find_vma(mm, addr); ; vma = vma->vm_next) {
+ /* At this point: (!vma || addr < vma->vm_end). */
+ if (TASK_SIZE - len < addr)
diff --git a/freed-ora/current/master/sony-laptop-Enable-keyboard-backlight-by-default.patch b/freed-ora/current/master/sony-laptop-Enable-keyboard-backlight-by-default.patch
deleted file mode 100644
index c993fd86d..000000000
--- a/freed-ora/current/master/sony-laptop-Enable-keyboard-backlight-by-default.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 0dbc2bc96b1ec741bdd43451c286ccd45da3310b Mon Sep 17 00:00:00 2001
-From: Josh Boyer <jwboyer@redhat.com>
-Date: Wed, 2 Nov 2011 14:31:59 -0400
-Subject: [PATCH] sony-laptop: Enable keyboard backlight by default
-
-When the keyboard backlight support was originally added, the commit said
-to default it to on with a 10 second timeout. That actually wasn't the
-case, as the default value is commented out for the kbd_backlight parameter.
-Because it is a static variable, it gets set to 0 by default without some
-other form of initialization.
-
-However, it seems the function to set the value wasn't actually called
-immediately, so whatever state the keyboard was in initially would remain.
-Then commit df410d522410e67660 was introduced during the 2.6.39 timeframe to
-immediately set whatever value was present (as well as attempt to
-restore/reset the state on module removal or resume). That seems to have
-now forced the light off immediately when the module is loaded unless
-the option kbd_backlight=1 is specified.
-
-Let's enable it by default again (for the first time). This should solve
-https://bugzilla.redhat.com/show_bug.cgi?id=728478
-
-Acked-by: Mattia Dongili <malattia@linux.it>
-Signed-off-by: Josh Boyer <jwboyer@redhat.com>
----
- drivers/platform/x86/sony-laptop.c | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
-index c006dee..40c4705 100644
---- a/drivers/platform/x86/sony-laptop.c
-+++ b/drivers/platform/x86/sony-laptop.c
-@@ -127,7 +127,7 @@ MODULE_PARM_DESC(minor,
- "default is -1 (automatic)");
- #endif
-
--static int kbd_backlight; /* = 1 */
-+static int kbd_backlight = 1;
- module_param(kbd_backlight, int, 0444);
- MODULE_PARM_DESC(kbd_backlight,
- "set this to 0 to disable keyboard backlight, "
---
-1.7.7.6
-
diff --git a/freed-ora/current/master/sources b/freed-ora/current/master/sources
index 11361b007..ff6c9a709 100644
--- a/freed-ora/current/master/sources
+++ b/freed-ora/current/master/sources
@@ -1 +1,3 @@
5487da14ca81715a469c7594d39722fa linux-libre-3.3-gnu.tar.xz
+35c5c8dc60a2781a72a294609c536114 patch-3.3-gnu-3.4-rc7-gnu.xz
+0be8e2b154d51207260a1269424fd522 patch-3.4-rc7-git2.xz
diff --git a/freed-ora/current/master/udlfb-remove-sysfs-framebuffer-device-with-USB-disconnect.patch b/freed-ora/current/master/udlfb-remove-sysfs-framebuffer-device-with-USB-disconnect.patch
deleted file mode 100644
index c304713a1..000000000
--- a/freed-ora/current/master/udlfb-remove-sysfs-framebuffer-device-with-USB-disconnect.patch
+++ /dev/null
@@ -1,118 +0,0 @@
-From 92a9c19a89af2ca219fbb040a0059f414a4b7223 Mon Sep 17 00:00:00 2001
-From: Kay Sievers <kay.sievers@vrfy.org>
-Date: Sat, 28 Jan 2012 19:57:46 +0000
-Subject: [PATCH] udlfb: remove sysfs framebuffer device with USB
- .disconnect()
-
-The USB graphics card driver delays the unregistering of the framebuffer
-device to a workqueue, which breaks the userspace visible remove uevent
-sequence. Recent userspace tools started to support USB graphics card
-hotplug out-of-the-box and rely on proper events sent by the kernel.
-
-The framebuffer device is a direct child of the USB interface which is
-removed immediately after the USB .disconnect() callback. But the fb device
-in /sys stays around until its final cleanup, at a time where all the parent
-devices have been removed already.
-
-To work around that, we remove the sysfs fb device directly in the USB
-.disconnect() callback and leave only the cleanup of the internal fb
-data to the delayed work.
-
-Before:
- add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 (usb)
- add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0 (usb)
- add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/graphics/fb0 (graphics)
- remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0 (usb)
- remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 (usb)
- remove /2-1.2:1.0/graphics/fb0 (graphics)
-
-After:
- add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 (usb)
- add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0 (usb)
- add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/graphics/fb1 (graphics)
- remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/graphics/fb1 (graphics)
- remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0 (usb)
- remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 (usb)
-
-Cc: stable@vger.kernel.org
-Tested-by: Bernie Thompson <bernie@plugable.com>
-Acked-by: Bernie Thompson <bernie@plugable.com>
-Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
-Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
----
- drivers/video/fbmem.c | 18 +++++++++++++++++-
- drivers/video/udlfb.c | 2 +-
- include/linux/fb.h | 1 +
- 3 files changed, 19 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
-index ac9141b..c6ce416 100644
---- a/drivers/video/fbmem.c
-+++ b/drivers/video/fbmem.c
-@@ -1665,6 +1665,7 @@ static int do_unregister_framebuffer(struct fb_info *fb_info)
- if (ret)
- return -EINVAL;
-
-+ unlink_framebuffer(fb_info);
- if (fb_info->pixmap.addr &&
- (fb_info->pixmap.flags & FB_PIXMAP_DEFAULT))
- kfree(fb_info->pixmap.addr);
-@@ -1672,7 +1673,6 @@ static int do_unregister_framebuffer(struct fb_info *fb_info)
- registered_fb[i] = NULL;
- num_registered_fb--;
- fb_cleanup_device(fb_info);
-- device_destroy(fb_class, MKDEV(FB_MAJOR, i));
- event.info = fb_info;
- fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event);
-
-@@ -1681,6 +1681,22 @@ static int do_unregister_framebuffer(struct fb_info *fb_info)
- return 0;
- }
-
-+int unlink_framebuffer(struct fb_info *fb_info)
-+{
-+ int i;
-+
-+ i = fb_info->node;
-+ if (i < 0 || i >= FB_MAX || registered_fb[i] != fb_info)
-+ return -EINVAL;
-+
-+ if (fb_info->dev) {
-+ device_destroy(fb_class, MKDEV(FB_MAJOR, i));
-+ fb_info->dev = NULL;
-+ }
-+ return 0;
-+}
-+EXPORT_SYMBOL(unlink_framebuffer);
-+
- void remove_conflicting_framebuffers(struct apertures_struct *a,
- const char *name, bool primary)
- {
-diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c
-index a197731..a40c05e 100644
---- a/drivers/video/udlfb.c
-+++ b/drivers/video/udlfb.c
-@@ -1739,7 +1739,7 @@ static void dlfb_usb_disconnect(struct usb_interface *interface)
- for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++)
- device_remove_file(info->dev, &fb_device_attrs[i]);
- device_remove_bin_file(info->dev, &edid_attr);
--
-+ unlink_framebuffer(info);
- usb_set_intfdata(interface, NULL);
-
- /* if clients still have us open, will be freed on last close */
-diff --git a/include/linux/fb.h b/include/linux/fb.h
-index c18122f..a395b8c 100644
---- a/include/linux/fb.h
-+++ b/include/linux/fb.h
-@@ -1003,6 +1003,7 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
- /* drivers/video/fbmem.c */
- extern int register_framebuffer(struct fb_info *fb_info);
- extern int unregister_framebuffer(struct fb_info *fb_info);
-+extern int unlink_framebuffer(struct fb_info *fb_info);
- extern void remove_conflicting_framebuffers(struct apertures_struct *a,
- const char *name, bool primary);
- extern int fb_prepare_logo(struct fb_info *fb_info, int rotate);
---
-1.7.6.5
-
diff --git a/freed-ora/current/master/ums_realtek-do-not-use-stack-memory-for-DMA-in-__do_.patch b/freed-ora/current/master/ums_realtek-do-not-use-stack-memory-for-DMA-in-__do_.patch
deleted file mode 100644
index 1768d5e6a..000000000
--- a/freed-ora/current/master/ums_realtek-do-not-use-stack-memory-for-DMA-in-__do_.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From dadfe1ad137e6fbe251b4a5dc310840cfe414db4 Mon Sep 17 00:00:00 2001
-From: Josh Boyer <jwboyer@redhat.com>
-Date: Mon, 20 Feb 2012 15:28:39 -0500
-Subject: [PATCH] ums_realtek: do not use stack memory for DMA in
- __do_config_autodelink
-
-__do_config_autodelink passes the data variable to the transport function.
-If the calling functions pass a stack variable, this will eventually trigger
-a DMA-API debug backtrace for mapping stack memory in the DMA buffer. Fix
-this by calling kmemdup for the passed data instead.
-
-Signed-off-by: Josh Boyer <jwboyer@redhat.com>
----
- drivers/usb/storage/realtek_cr.c | 8 +++++++-
- 1 files changed, 7 insertions(+), 1 deletions(-)
-
-diff --git a/drivers/usb/storage/realtek_cr.c b/drivers/usb/storage/realtek_cr.c
-index d32f720..eee2a96 100644
---- a/drivers/usb/storage/realtek_cr.c
-+++ b/drivers/usb/storage/realtek_cr.c
-@@ -507,9 +507,14 @@ static int __do_config_autodelink(struct us_data *us, u8 *data, u16 len)
- {
- int retval;
- u8 cmnd[12] = {0};
-+ u8 *buf;
-
- US_DEBUGP("%s, addr = 0xfe47, len = %d\n", __FUNCTION__, len);
-
-+ buf = kmemdup(data, len, GFP_NOIO);
-+ if (!buf)
-+ return USB_STOR_TRANSPORT_ERROR;
-+
- cmnd[0] = 0xF0;
- cmnd[1] = 0x0E;
- cmnd[2] = 0xfe;
-@@ -517,7 +522,8 @@ static int __do_config_autodelink(struct us_data *us, u8 *data, u16 len)
- cmnd[4] = (u8)(len >> 8);
- cmnd[5] = (u8)len;
-
-- retval = rts51x_bulk_transport_special(us, 0, cmnd, 12, data, len, DMA_TO_DEVICE, NULL);
-+ retval = rts51x_bulk_transport_special(us, 0, cmnd, 12, buf, len, DMA_TO_DEVICE, NULL);
-+ kfree(buf);
- if (retval != USB_STOR_TRANSPORT_GOOD) {
- return -EIO;
- }
---
-1.7.9
-
diff --git a/freed-ora/current/master/utrace.patch b/freed-ora/current/master/utrace.patch
deleted file mode 100644
index fdf24a472..000000000
--- a/freed-ora/current/master/utrace.patch
+++ /dev/null
@@ -1,4696 +0,0 @@
-From d007ce2c3f1f67624fde5e6b7ccc00566b7df9c3 Mon Sep 17 00:00:00 2001
-From: Oleg Nesterov <oleg@redhat.com>
-Date: Sat, 25 Feb 2012 07:29:40 -0500
-Subject: [PATCH] utrace for 3.3-rc4 kernel, on top of
- b52b80023f262ce8a0ffdcb490acb23e8678377a.
-
-The split-out series is available in the git repository at:
-
- git@github.com:utrace/linux.git utrace-3.3
-
-Oleg Nesterov (31):
- utrace: add utrace_init_task/utrace_free_task calls
- tracehooks: add utrace hooks
- tracehooks: reintroduce tracehook_consider_fatal_signal()
- add utrace hooks into sig_ignored() and recalc_sigpending()
- restore the EXEC/EXIT/CLONE utrace hooks
- utrace: utrace_report_death() can use task_utrace_struct()
- restore the DEATH/REAP utrace hooks
- utrace: remove jobctl bits
- ptrace: take ->siglock around s/TRACED/RUNNING/
- introduce wake_up_quiescent()
- introduce ptrace_signal_wake_up()
- wait_task_inactive: treat task->state and match_state as bitmasks
- introduce TASK_UTRACED state
- utrace: use TASK_UTRACED instead of TASK_TRACED
- reintroduce tracehook_finish_jctl() as utrace_end_stop()
- teach wake_up_quiescent() to do "selective" wake_up
- ptrace_stop: do not assume the task is running after wake_up_quiescent()
- get_signal_to_deliver: restore/restructure utrace/ptrace signal reporting
- utrace_get_signal: s/JOBCTL_STOP_PENDING/JOBCTL_PENDING_MASK/
- introduce ptrace_set_syscall_trace()
- introduce PT_SYSCALL_TRACE flag
- utrace: don't clear TIF_SYSCALL_TRACE if it is needed by ptrace
- introduce task_utrace_lock/task_utrace_unlock
- teach ptrace_set_syscall_trace() to play well with utrace
- introduce PT_SINGLE_STEP and PT_SINGLE_BLOCK
- utrace: finish_resume_report: don't do user_xxx_step() if ptrace_wants_step()
- ptrace: shift user_*_step() from ptrace_resume() to ptrace_stop()
- ptrace_disable: no need to disable stepping
- ptrace_report_syscall: check TIF_SYSCALL_EMU
- utrace_resume: check irqs_disabled() to shut up lockdep
- utrace: s390: fix the compile problem with traps.c
-
-Roland McGrath (1):
- utrace core
-
-Tony Breeds (1):
- ptrace_report_syscall: check if TIF_SYSCALL_EMU is defined
-
-Signed-off-by: Oleg Nesterov <oleg@redhat.com>
----
- Documentation/DocBook/Makefile | 2 +-
- Documentation/DocBook/utrace.tmpl | 589 +++++++++
- arch/s390/kernel/traps.c | 6 +-
- arch/x86/kernel/ptrace.c | 1 -
- fs/exec.c | 5 +-
- fs/proc/array.c | 14 +-
- include/linux/ptrace.h | 7 +
- include/linux/sched.h | 25 +-
- include/linux/signal.h | 2 +
- include/linux/tracehook.h | 59 +-
- include/linux/utrace.h | 774 ++++++++++++
- init/Kconfig | 9 +
- kernel/Makefile | 1 +
- kernel/exit.c | 5 +
- kernel/fork.c | 9 +
- kernel/ptrace.c | 57 +-
- kernel/sched/core.c | 2 +-
- kernel/signal.c | 97 ++-
- kernel/utrace.c | 2466 +++++++++++++++++++++++++++++++++++++
- 19 files changed, 4074 insertions(+), 56 deletions(-)
- create mode 100644 Documentation/DocBook/utrace.tmpl
- create mode 100644 include/linux/utrace.h
- create mode 100644 kernel/utrace.c
-
-diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
-index 66725a3..08ed954 100644
---- a/Documentation/DocBook/Makefile
-+++ b/Documentation/DocBook/Makefile
-@@ -14,7 +14,7 @@ DOCBOOKS := z8530book.xml mcabook.xml device-drivers.xml \
- genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \
- 80211.xml debugobjects.xml sh.xml regulator.xml \
- alsa-driver-api.xml writing-an-alsa-driver.xml \
-- tracepoint.xml drm.xml media_api.xml
-+ tracepoint.xml utrace.xml drm.xml media_api.xml
-
- include $(srctree)/Documentation/DocBook/media/Makefile
-
-diff --git a/Documentation/DocBook/utrace.tmpl b/Documentation/DocBook/utrace.tmpl
-new file mode 100644
-index 0000000..0c40add
---- /dev/null
-+++ b/Documentation/DocBook/utrace.tmpl
-@@ -0,0 +1,589 @@
-+<?xml version="1.0" encoding="UTF-8"?>
-+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
-+"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
-+
-+<book id="utrace">
-+ <bookinfo>
-+ <title>The utrace User Debugging Infrastructure</title>
-+ </bookinfo>
-+
-+ <toc></toc>
-+
-+ <chapter id="concepts"><title>utrace concepts</title>
-+
-+ <sect1 id="intro"><title>Introduction</title>
-+
-+ <para>
-+ <application>utrace</application> is infrastructure code for tracing
-+ and controlling user threads. This is the foundation for writing
-+ tracing engines, which can be loadable kernel modules.
-+ </para>
-+
-+ <para>
-+ The basic actors in <application>utrace</application> are the thread
-+ and the tracing engine. A tracing engine is some body of code that
-+ calls into the <filename>&lt;linux/utrace.h&gt;</filename>
-+ interfaces, represented by a <structname>struct
-+ utrace_engine_ops</structname>. (Usually it's a kernel module,
-+ though the legacy <function>ptrace</function> support is a tracing
-+ engine that is not in a kernel module.) The interface operates on
-+ individual threads (<structname>struct task_struct</structname>).
-+ If an engine wants to treat several threads as a group, that is up
-+ to its higher-level code.
-+ </para>
-+
-+ <para>
-+ Tracing begins by attaching an engine to a thread, using
-+ <function>utrace_attach_task</function> or
-+ <function>utrace_attach_pid</function>. If successful, it returns a
-+ pointer that is the handle used in all other calls.
-+ </para>
-+
-+ </sect1>
-+
-+ <sect1 id="callbacks"><title>Events and Callbacks</title>
-+
-+ <para>
-+ An attached engine does nothing by default. An engine makes something
-+ happen by requesting callbacks via <function>utrace_set_events</function>
-+ and poking the thread with <function>utrace_control</function>.
-+ The synchronization issues related to these two calls
-+ are discussed further below in <xref linkend="teardown"/>.
-+ </para>
-+
-+ <para>
-+ Events are specified using the macro
-+ <constant>UTRACE_EVENT(<replaceable>type</replaceable>)</constant>.
-+ Each event type is associated with a callback in <structname>struct
-+ utrace_engine_ops</structname>. A tracing engine can leave unused
-+ callbacks <constant>NULL</constant>. The only callbacks required
-+ are those used by the event flags it sets.
-+ </para>
-+
-+ <para>
-+ Many engines can be attached to each thread. When a thread has an
-+ event, each engine gets a callback if it has set the event flag for
-+ that event type. For most events, engines are called in the order they
-+ attached. Engines that attach after the event has occurred do not get
-+ callbacks for that event. This includes any new engines just attached
-+ by an existing engine's callback function. Once the sequence of
-+ callbacks for that one event has completed, such new engines are then
-+ eligible in the next sequence that starts when there is another event.
-+ </para>
-+
-+ <para>
-+ Event reporting callbacks have details particular to the event type,
-+ but are all called in similar environments and have the same
-+ constraints. Callbacks are made from safe points, where no locks
-+ are held, no special resources are pinned (usually), and the
-+ user-mode state of the thread is accessible. So, callback code has
-+ a pretty free hand. But to be a good citizen, callback code should
-+ never block for long periods. It is fine to block in
-+ <function>kmalloc</function> and the like, but never wait for i/o or
-+ for user mode to do something. If you need the thread to wait, use
-+ <constant>UTRACE_STOP</constant> and return from the callback
-+ quickly. When your i/o finishes or whatever, you can use
-+ <function>utrace_control</function> to resume the thread.
-+ </para>
-+
-+ <para>
-+ The <constant>UTRACE_EVENT(SYSCALL_ENTRY)</constant> event is a special
-+ case. While other events happen in the kernel when it will return to
-+ user mode soon, this event happens when entering the kernel before it
-+ will proceed with the work requested from user mode. Because of this
-+ difference, the <function>report_syscall_entry</function> callback is
-+ special in two ways. For this event, engines are called in reverse of
-+ the normal order (this includes the <function>report_quiesce</function>
-+ call that precedes a <function>report_syscall_entry</function> call).
-+ This preserves the semantics that the last engine to attach is called
-+ "closest to user mode"--the engine that is first to see a thread's user
-+ state when it enters the kernel is also the last to see that state when
-+ the thread returns to user mode. For the same reason, if these
-+ callbacks use <constant>UTRACE_STOP</constant> (see the next section),
-+ the thread stops immediately after callbacks rather than only when it's
-+ ready to return to user mode; when allowed to resume, it will actually
-+ attempt the system call indicated by the register values at that time.
-+ </para>
-+
-+ </sect1>
-+
-+ <sect1 id="safely"><title>Stopping Safely</title>
-+
-+ <sect2 id="well-behaved"><title>Writing well-behaved callbacks</title>
-+
-+ <para>
-+ Well-behaved callbacks are important to maintain two essential
-+ properties of the interface. The first of these is that unrelated
-+ tracing engines should not interfere with each other. If your engine's
-+ event callback does not return quickly, then another engine won't get
-+ the event notification in a timely manner. The second important
-+ property is that tracing should be as noninvasive as possible to the
-+ normal operation of the system overall and of the traced thread in
-+ particular. That is, attached tracing engines should not perturb a
-+ thread's behavior, except to the extent that changing its user-visible
-+ state is explicitly what you want to do. (Obviously some perturbation
-+ is unavoidable, primarily timing changes, ranging from small delays due
-+ to the overhead of tracing, to arbitrary pauses in user code execution
-+ when a user stops a thread with a debugger for examination.) Even when
-+ you explicitly want the perturbation of making the traced thread block,
-+ just blocking directly in your callback has more unwanted effects. For
-+ example, the <constant>CLONE</constant> event callbacks are called when
-+ the new child thread has been created but not yet started running; the
-+ child can never be scheduled until the <constant>CLONE</constant>
-+ tracing callbacks return. (This allows engines tracing the parent to
-+ attach to the child.) If a <constant>CLONE</constant> event callback
-+ blocks the parent thread, it also prevents the child thread from
-+ running (even to process a <constant>SIGKILL</constant>). If what you
-+ want is to make both the parent and child block, then use
-+ <function>utrace_attach_task</function> on the child and then use
-+ <constant>UTRACE_STOP</constant> on both threads. A more crucial
-+ problem with blocking in callbacks is that it can prevent
-+ <constant>SIGKILL</constant> from working. A thread that is blocking
-+ due to <constant>UTRACE_STOP</constant> will still wake up and die
-+ immediately when sent a <constant>SIGKILL</constant>, as all threads
-+ should. Relying on the <application>utrace</application>
-+ infrastructure rather than on private synchronization calls in event
-+ callbacks is an important way to help keep tracing robustly
-+ noninvasive.
-+ </para>
-+
-+ </sect2>
-+
-+ <sect2 id="UTRACE_STOP"><title>Using <constant>UTRACE_STOP</constant></title>
-+
-+ <para>
-+ To control another thread and access its state, it must be stopped
-+ with <constant>UTRACE_STOP</constant>. This means that it is
-+ stopped and won't start running again while we access it. When a
-+ thread is not already stopped, <function>utrace_control</function>
-+ returns <constant>-EINPROGRESS</constant> and an engine must wait
-+ for an event callback when the thread is ready to stop. The thread
-+ may be running on another CPU or may be blocked. When it is ready
-+ to be examined, it will make callbacks to engines that set the
-+ <constant>UTRACE_EVENT(QUIESCE)</constant> event bit. To wake up an
-+ interruptible wait, use <constant>UTRACE_INTERRUPT</constant>.
-+ </para>
-+
-+ <para>
-+ As long as some engine has used <constant>UTRACE_STOP</constant> and
-+ not called <function>utrace_control</function> to resume the thread,
-+ then the thread will remain stopped. <constant>SIGKILL</constant>
-+ will wake it up, but it will not run user code. When the stop is
-+ cleared with <function>utrace_control</function> or a callback
-+ return value, the thread starts running again.
-+ (See also <xref linkend="teardown"/>.)
-+ </para>
-+
-+ </sect2>
-+
-+ </sect1>
-+
-+ <sect1 id="teardown"><title>Tear-down Races</title>
-+
-+ <sect2 id="SIGKILL"><title>Primacy of <constant>SIGKILL</constant></title>
-+ <para>
-+ Ordinarily synchronization issues for tracing engines are kept fairly
-+ straightforward by using <constant>UTRACE_STOP</constant>. You ask a
-+ thread to stop, and then once it makes the
-+ <function>report_quiesce</function> callback it cannot do anything else
-+ that would result in another callback, until you let it with a
-+ <function>utrace_control</function> call. This simple arrangement
-+ avoids complex and error-prone code in each one of a tracing engine's
-+ event callbacks to keep them serialized with the engine's other
-+ operations done on that thread from another thread of control.
-+ However, giving tracing engines complete power to keep a traced thread
-+ stuck in place runs afoul of a more important kind of simplicity that
-+ the kernel overall guarantees: nothing can prevent or delay
-+ <constant>SIGKILL</constant> from making a thread die and release its
-+ resources. To preserve this important property of
-+ <constant>SIGKILL</constant>, it as a special case can break
-+ <constant>UTRACE_STOP</constant> like nothing else normally can. This
-+ includes both explicit <constant>SIGKILL</constant> signals and the
-+ implicit <constant>SIGKILL</constant> sent to each other thread in the
-+ same thread group by a thread doing an exec, or processing a fatal
-+ signal, or making an <function>exit_group</function> system call. A
-+ tracing engine can prevent a thread from beginning the exit or exec or
-+ dying by signal (other than <constant>SIGKILL</constant>) if it is
-+ attached to that thread, but once the operation begins, no tracing
-+ engine can prevent or delay all other threads in the same thread group
-+ dying.
-+ </para>
-+ </sect2>
-+
-+ <sect2 id="reap"><title>Final callbacks</title>
-+ <para>
-+ The <function>report_reap</function> callback is always the final event
-+ in the life cycle of a traced thread. Tracing engines can use this as
-+ the trigger to clean up their own data structures. The
-+ <function>report_death</function> callback is always the penultimate
-+ event a tracing engine might see; it's seen unless the thread was
-+ already in the midst of dying when the engine attached. Many tracing
-+ engines will have no interest in when a parent reaps a dead process,
-+ and nothing they want to do with a zombie thread once it dies; for
-+ them, the <function>report_death</function> callback is the natural
-+ place to clean up data structures and detach. To facilitate writing
-+ such engines robustly, given the asynchrony of
-+ <constant>SIGKILL</constant>, and without error-prone manual
-+ implementation of synchronization schemes, the
-+ <application>utrace</application> infrastructure provides some special
-+ guarantees about the <function>report_death</function> and
-+ <function>report_reap</function> callbacks. It still takes some care
-+ to be sure your tracing engine is robust to tear-down races, but these
-+ rules make it reasonably straightforward and concise to handle a lot of
-+ corner cases correctly.
-+ </para>
-+ </sect2>
-+
-+ <sect2 id="refcount"><title>Engine and task pointers</title>
-+ <para>
-+ The first sort of guarantee concerns the core data structures
-+ themselves. <structname>struct utrace_engine</structname> is
-+ a reference-counted data structure. While you hold a reference, an
-+ engine pointer will always stay valid so that you can safely pass it to
-+ any <application>utrace</application> call. Each call to
-+ <function>utrace_attach_task</function> or
-+ <function>utrace_attach_pid</function> returns an engine pointer with a
-+ reference belonging to the caller. You own that reference until you
-+ drop it using <function>utrace_engine_put</function>. There is an
-+ implicit reference on the engine while it is attached. So if you drop
-+ your only reference, and then use
-+ <function>utrace_attach_task</function> without
-+ <constant>UTRACE_ATTACH_CREATE</constant> to look up that same engine,
-+ you will get the same pointer with a new reference to replace the one
-+ you dropped, just like calling <function>utrace_engine_get</function>.
-+ When an engine has been detached, either explicitly with
-+ <constant>UTRACE_DETACH</constant> or implicitly after
-+ <function>report_reap</function>, then any references you hold are all
-+ that keep the old engine pointer alive.
-+ </para>
-+
-+ <para>
-+ There is nothing a kernel module can do to keep a <structname>struct
-+ task_struct</structname> alive outside of
-+ <function>rcu_read_lock</function>. When the task dies and is reaped
-+ by its parent (or itself), that structure can be freed so that any
-+ dangling pointers you have stored become invalid.
-+ <application>utrace</application> will not prevent this, but it can
-+ help you detect it safely. By definition, a task that has been reaped
-+ has had all its engines detached. All
-+ <application>utrace</application> calls can be safely called on a
-+ detached engine if the caller holds a reference on that engine pointer,
-+ even if the task pointer passed in the call is invalid. All calls
-+ return <constant>-ESRCH</constant> for a detached engine, which tells
-+ you that the task pointer you passed could be invalid now. Since
-+ <function>utrace_control</function> and
-+ <function>utrace_set_events</function> do not block, you can call those
-+ inside a <function>rcu_read_lock</function> section and be sure after
-+ they don't return <constant>-ESRCH</constant> that the task pointer is
-+ still valid until <function>rcu_read_unlock</function>. The
-+ infrastructure never holds task references of its own. Though neither
-+ <function>rcu_read_lock</function> nor any other lock is held while
-+ making a callback, it's always guaranteed that the <structname>struct
-+ task_struct</structname> and the <structname>struct
-+ utrace_engine</structname> passed as arguments remain valid
-+ until the callback function returns.
-+ </para>
-+
-+ <para>
-+ The common means for safely holding task pointers that is available to
-+ kernel modules is to use <structname>struct pid</structname>, which
-+ permits <function>put_pid</function> from kernel modules. When using
-+ that, the calls <function>utrace_attach_pid</function>,
-+ <function>utrace_control_pid</function>,
-+ <function>utrace_set_events_pid</function>, and
-+ <function>utrace_barrier_pid</function> are available.
-+ </para>
-+ </sect2>
-+
-+ <sect2 id="reap-after-death">
-+ <title>
-+ Serialization of <constant>DEATH</constant> and <constant>REAP</constant>
-+ </title>
-+ <para>
-+ The second guarantee is the serialization of
-+ <constant>DEATH</constant> and <constant>REAP</constant> event
-+ callbacks for a given thread. The actual reaping by the parent
-+ (<function>release_task</function> call) can occur simultaneously
-+ while the thread is still doing the final steps of dying, including
-+ the <function>report_death</function> callback. If a tracing engine
-+ has requested both <constant>DEATH</constant> and
-+ <constant>REAP</constant> event reports, it's guaranteed that the
-+ <function>report_reap</function> callback will not be made until
-+ after the <function>report_death</function> callback has returned.
-+ If the <function>report_death</function> callback itself detaches
-+ from the thread, then the <function>report_reap</function> callback
-+ will never be made. Thus it is safe for a
-+ <function>report_death</function> callback to clean up data
-+ structures and detach.
-+ </para>
-+ </sect2>
-+
-+ <sect2 id="interlock"><title>Interlock with final callbacks</title>
-+ <para>
-+ The final sort of guarantee is that a tracing engine will know for sure
-+ whether or not the <function>report_death</function> and/or
-+ <function>report_reap</function> callbacks will be made for a certain
-+ thread. These tear-down races are disambiguated by the error return
-+ values of <function>utrace_set_events</function> and
-+ <function>utrace_control</function>. Normally
-+ <function>utrace_control</function> called with
-+ <constant>UTRACE_DETACH</constant> returns zero, and this means that no
-+ more callbacks will be made. If the thread is in the midst of dying,
-+ it returns <constant>-EALREADY</constant> to indicate that the
-+ <constant>report_death</constant> callback may already be in progress;
-+ when you get this error, you know that any cleanup your
-+ <function>report_death</function> callback does is about to happen or
-+ has just happened--note that if the <function>report_death</function>
-+ callback does not detach, the engine remains attached until the thread
-+ gets reaped. If the thread is in the midst of being reaped,
-+ <function>utrace_control</function> returns <constant>-ESRCH</constant>
-+ to indicate that the <function>report_reap</function> callback may
-+ already be in progress; this means the engine is implicitly detached
-+ when the callback completes. This makes it possible for a tracing
-+ engine that has decided asynchronously to detach from a thread to
-+ safely clean up its data structures, knowing that no
-+ <function>report_death</function> or <function>report_reap</function>
-+ callback will try to do the same. <constant>utrace_detach</constant>
-+ returns <constant>-ESRCH</constant> when the <structname>struct
-+ utrace_engine</structname> has already been detached, but is
-+ still a valid pointer because of its reference count. A tracing engine
-+ can use this to safely synchronize its own independent multiple threads
-+ of control with each other and with its event callbacks that detach.
-+ </para>
-+
-+ <para>
-+ In the same vein, <function>utrace_set_events</function> normally
-+ returns zero; if the target thread was stopped before the call, then
-+ after a successful call, no event callbacks not requested in the new
-+ flags will be made. It fails with <constant>-EALREADY</constant> if
-+ you try to clear <constant>UTRACE_EVENT(DEATH)</constant> when the
-+ <function>report_death</function> callback may already have begun, or if
-+ you try to newly set <constant>UTRACE_EVENT(DEATH)</constant> or
-+ <constant>UTRACE_EVENT(QUIESCE)</constant> when the target is already
-+ dead or dying. Like <function>utrace_control</function>, it returns
-+ <constant>-ESRCH</constant> when the <function>report_reap</function>
-+ callback may already have begun, or the thread has already been detached
-+ (including forcible detach on reaping). This lets the tracing engine
-+ know for sure which event callbacks it will or won't see after
-+ <function>utrace_set_events</function> has returned. By checking for
-+ errors, it can know whether to clean up its data structures immediately
-+ or to let its callbacks do the work.
-+ </para>
-+ </sect2>
-+
-+ <sect2 id="barrier"><title>Using <function>utrace_barrier</function></title>
-+ <para>
-+ When a thread is safely stopped, calling
-+ <function>utrace_control</function> with <constant>UTRACE_DETACH</constant>
-+ or calling <function>utrace_set_events</function> to disable some events
-+ ensures synchronously that your engine won't get any more of the callbacks
-+ that have been disabled (none at all when detaching). But these can also
-+ be used while the thread is not stopped, when it might be simultaneously
-+ making a callback to your engine. For this situation, these calls return
-+ <constant>-EINPROGRESS</constant> when it's possible a callback is in
-+ progress. If you are not prepared to have your old callbacks still run,
-+ then you can synchronize to be sure all the old callbacks are finished,
-+ using <function>utrace_barrier</function>. This is necessary if the
-+ kernel module containing your callback code is going to be unloaded.
-+ </para>
-+ <para>
-+ After using <constant>UTRACE_DETACH</constant> once, further calls to
-+ <function>utrace_control</function> with the same engine pointer will
-+ return <constant>-ESRCH</constant>. In contrast, after getting
-+ <constant>-EINPROGRESS</constant> from
-+ <function>utrace_set_events</function>, you can call
-+ <function>utrace_set_events</function> again later and if it returns zero
-+ then know the old callbacks have finished.
-+ </para>
-+ <para>
-+ Unlike all other calls, <function>utrace_barrier</function> (and
-+ <function>utrace_barrier_pid</function>) will accept any engine pointer you
-+ hold a reference on, even if <constant>UTRACE_DETACH</constant> has already
-+ been used. After any <function>utrace_control</function> or
-+ <function>utrace_set_events</function> call (these do not block), you can
-+ call <function>utrace_barrier</function> to block until callbacks have
-+ finished. This returns <constant>-ESRCH</constant> only if the engine is
-+ completely detached (finished all callbacks). Otherwise it waits
-+ until the thread is definitely not in the midst of a callback to this
-+ engine and then returns zero, but can return
-+ <constant>-ERESTARTSYS</constant> if its wait is interrupted.
-+ </para>
-+ </sect2>
-+
-+</sect1>
-+
-+</chapter>
-+
-+<chapter id="core"><title>utrace core API</title>
-+
-+<para>
-+ The utrace API is declared in <filename>&lt;linux/utrace.h&gt;</filename>.
-+</para>
-+
-+!Iinclude/linux/utrace.h
-+!Ekernel/utrace.c
-+
-+</chapter>
-+
-+<chapter id="machine"><title>Machine State</title>
-+
-+<para>
-+ The <function>task_current_syscall</function> function can be used on any
-+ valid <structname>struct task_struct</structname> at any time, and does
-+ not even require that <function>utrace_attach_task</function> was used at all.
-+</para>
-+
-+<para>
-+ The other ways to access the registers and other machine-dependent state of
-+ a task can only be used on a task that is at a known safe point. The safe
-+ points are all the places where <function>utrace_set_events</function> can
-+ request callbacks (except for the <constant>DEATH</constant> and
-+ <constant>REAP</constant> events). So at any event callback, it is safe to
-+ examine <varname>current</varname>.
-+</para>
-+
-+<para>
-+ One task can examine another only after a callback in the target task that
-+ returns <constant>UTRACE_STOP</constant> so that task will not return to user
-+ mode after the safe point. This guarantees that the task will not resume
-+ until the same engine uses <function>utrace_control</function>, unless the
-+ task dies suddenly. To examine safely, one must use a pair of calls to
-+ <function>utrace_prepare_examine</function> and
-+ <function>utrace_finish_examine</function> surrounding the calls to
-+ <structname>struct user_regset</structname> functions or direct examination
-+ of task data structures. <function>utrace_prepare_examine</function> returns
-+ an error if the task is not properly stopped, or is dead. After a
-+ successful examination, the paired <function>utrace_finish_examine</function>
-+ call returns an error if the task ever woke up during the examination. If
-+ so, any data gathered may be scrambled and should be discarded. This means
-+ there was a spurious wake-up (which should not happen), or a sudden death.
-+</para>
-+
-+<sect1 id="regset"><title><structname>struct user_regset</structname></title>
-+
-+<para>
-+ The <structname>struct user_regset</structname> API
-+ is declared in <filename>&lt;linux/regset.h&gt;</filename>.
-+</para>
-+
-+!Finclude/linux/regset.h
-+
-+</sect1>
-+
-+<sect1 id="task_current_syscall">
-+ <title><filename>System Call Information</filename></title>
-+
-+<para>
-+ This function is declared in <filename>&lt;linux/ptrace.h&gt;</filename>.
-+</para>
-+
-+!Elib/syscall.c
-+
-+</sect1>
-+
-+<sect1 id="syscall"><title><filename>System Call Tracing</filename></title>
-+
-+<para>
-+ The arch API for system call information is declared in
-+ <filename>&lt;asm/syscall.h&gt;</filename>.
-+ Each of these calls can be used only at system call entry tracing,
-+ or can be used only at system call exit and the subsequent safe points
-+ before returning to user mode.
-+ At system call entry tracing means either during a
-+ <structfield>report_syscall_entry</structfield> callback,
-+ or any time after that callback has returned <constant>UTRACE_STOP</constant>.
-+</para>
-+
-+!Finclude/asm-generic/syscall.h
-+
-+</sect1>
-+
-+</chapter>
-+
-+<chapter id="internals"><title>Kernel Internals</title>
-+
-+<para>
-+ This chapter covers the interface to the tracing infrastructure
-+ from the core of the kernel and the architecture-specific code.
-+ This is for maintainers of the kernel and arch code, and not relevant
-+ to using the tracing facilities described in preceding chapters.
-+</para>
-+
-+<sect1 id="tracehook"><title>Core Calls In</title>
-+
-+<para>
-+ These calls are declared in <filename>&lt;linux/tracehook.h&gt;</filename>.
-+ The core kernel calls these functions at various important places.
-+</para>
-+
-+!Finclude/linux/tracehook.h
-+
-+</sect1>
-+
-+<sect1 id="arch"><title>Architecture Calls Out</title>
-+
-+<para>
-+ An arch that has done all these things sets
-+ <constant>CONFIG_HAVE_ARCH_TRACEHOOK</constant>.
-+ This is required to enable the <application>utrace</application> code.
-+</para>
-+
-+<sect2 id="arch-ptrace"><title><filename>&lt;asm/ptrace.h&gt;</filename></title>
-+
-+<para>
-+ An arch defines these in <filename>&lt;asm/ptrace.h&gt;</filename>
-+ if it supports hardware single-step or block-step features.
-+</para>
-+
-+!Finclude/linux/ptrace.h arch_has_single_step arch_has_block_step
-+!Finclude/linux/ptrace.h user_enable_single_step user_enable_block_step
-+!Finclude/linux/ptrace.h user_disable_single_step
-+
-+</sect2>
-+
-+<sect2 id="arch-syscall">
-+ <title><filename>&lt;asm/syscall.h&gt;</filename></title>
-+
-+ <para>
-+ An arch provides <filename>&lt;asm/syscall.h&gt;</filename> that
-+ defines these as inlines, or declares them as exported functions.
-+ These interfaces are described in <xref linkend="syscall"/>.
-+ </para>
-+
-+</sect2>
-+
-+<sect2 id="arch-tracehook">
-+ <title><filename>&lt;linux/tracehook.h&gt;</filename></title>
-+
-+ <para>
-+ An arch must define <constant>TIF_NOTIFY_RESUME</constant>
-+ and <constant>TIF_SYSCALL_TRACE</constant>
-+ in its <filename>&lt;asm/thread_info.h&gt;</filename>.
-+ The arch code must call the following functions, all declared
-+ in <filename>&lt;linux/tracehook.h&gt;</filename> and
-+ described in <xref linkend="tracehook"/>:
-+
-+ <itemizedlist>
-+ <listitem>
-+ <para><function>tracehook_notify_resume</function></para>
-+ </listitem>
-+ <listitem>
-+ <para><function>tracehook_report_syscall_entry</function></para>
-+ </listitem>
-+ <listitem>
-+ <para><function>tracehook_report_syscall_exit</function></para>
-+ </listitem>
-+ <listitem>
-+ <para><function>tracehook_signal_handler</function></para>
-+ </listitem>
-+ </itemizedlist>
-+
-+ </para>
-+
-+</sect2>
-+
-+</sect1>
-+
-+</chapter>
-+
-+</book>
-diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
-index 5ce3750..4f0b32f 100644
---- a/arch/s390/kernel/traps.c
-+++ b/arch/s390/kernel/traps.c
-@@ -18,7 +18,7 @@
- #include <linux/kernel.h>
- #include <linux/string.h>
- #include <linux/errno.h>
--#include <linux/ptrace.h>
-+#include <linux/tracehook.h>
- #include <linux/timer.h>
- #include <linux/mm.h>
- #include <linux/smp.h>
-@@ -330,7 +330,7 @@ void __kprobes do_per_trap(struct pt_regs *regs)
-
- if (notify_die(DIE_SSTEP, "sstep", regs, 0, 0, SIGTRAP) == NOTIFY_STOP)
- return;
-- if (!current->ptrace)
-+ if (!tracehook_consider_fatal_signal(current, SIGTRAP))
- return;
- info.si_signo = SIGTRAP;
- info.si_errno = 0;
-@@ -415,7 +415,7 @@ static void __kprobes illegal_op(struct pt_regs *regs)
- if (get_user(*((__u16 *) opcode), (__u16 __user *) location))
- return;
- if (*((__u16 *) opcode) == S390_BREAKPOINT_U16) {
-- if (current->ptrace) {
-+ if (tracehook_consider_fatal_signal(current, SIGTRAP)) {
- info.si_signo = SIGTRAP;
- info.si_errno = 0;
- info.si_code = TRAP_BRKPT;
-diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
-index 5026738..97687f3 100644
---- a/arch/x86/kernel/ptrace.c
-+++ b/arch/x86/kernel/ptrace.c
-@@ -809,7 +809,6 @@ static int ioperm_get(struct task_struct *target,
- */
- void ptrace_disable(struct task_struct *child)
- {
-- user_disable_single_step(child);
- #ifdef TIF_SYSCALL_EMU
- clear_tsk_thread_flag(child, TIF_SYSCALL_EMU);
- #endif
-diff --git a/fs/exec.c b/fs/exec.c
-index 92ce83a..87ff31f 100644
---- a/fs/exec.c
-+++ b/fs/exec.c
-@@ -1402,9 +1402,12 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
- */
- bprm->recursion_depth = depth;
- if (retval >= 0) {
-- if (depth == 0)
-+ if (depth == 0) {
-+ UTRACE_HOOK(current, EXEC,
-+ report_exec(fmt, bprm, regs));
- ptrace_event(PTRACE_EVENT_EXEC,
- old_pid);
-+ }
- put_binfmt(fmt);
- allow_write_access(bprm->file);
- if (bprm->file)
-diff --git a/fs/proc/array.c b/fs/proc/array.c
-index c602b8d..a700b78 100644
---- a/fs/proc/array.c
-+++ b/fs/proc/array.c
-@@ -81,6 +81,7 @@
- #include <linux/pid_namespace.h>
- #include <linux/ptrace.h>
- #include <linux/tracehook.h>
-+#include <linux/utrace.h>
-
- #include <asm/pgtable.h>
- #include <asm/processor.h>
-@@ -137,11 +138,12 @@ static const char * const task_state_array[] = {
- "D (disk sleep)", /* 2 */
- "T (stopped)", /* 4 */
- "t (tracing stop)", /* 8 */
-- "Z (zombie)", /* 16 */
-- "X (dead)", /* 32 */
-- "x (dead)", /* 64 */
-- "K (wakekill)", /* 128 */
-- "W (waking)", /* 256 */
-+ "t (tracing stop)", /* 16 (stopped by utrace) */
-+ "Z (zombie)", /* 32 */
-+ "X (dead)", /* 64 */
-+ "x (dead)", /* 128 */
-+ "K (wakekill)", /* 256 */
-+ "W (waking)", /* 512 */
- };
-
- static inline const char *get_task_state(struct task_struct *tsk)
-@@ -192,6 +194,8 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
- cred->uid, cred->euid, cred->suid, cred->fsuid,
- cred->gid, cred->egid, cred->sgid, cred->fsgid);
-
-+ task_utrace_proc_status(m, p);
-+
- task_lock(p);
- if (p->files)
- fdt = files_fdtable(p->files);
-diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
-index c2f1f6a..236b920 100644
---- a/include/linux/ptrace.h
-+++ b/include/linux/ptrace.h
-@@ -104,6 +104,10 @@
-
- #define PT_TRACE_MASK 0x000003f4
-
-+#define PT_SYSCALL_TRACE 0x00020000
-+#define PT_SINGLE_STEP 0x00040000
-+#define PT_SINGLE_BLOCK 0x00080000
-+
- /* single stepping state bits (used on ARM and PA-RISC) */
- #define PT_SINGLESTEP_BIT 31
- #define PT_SINGLESTEP (1<<PT_SINGLESTEP_BIT)
-@@ -114,6 +118,7 @@
- #include <linux/sched.h> /* For struct task_struct. */
- #include <linux/err.h> /* for IS_ERR_VALUE */
-
-+extern void ptrace_signal_wake_up(struct task_struct *p, int quiescent);
-
- extern long arch_ptrace(struct task_struct *child, long request,
- unsigned long addr, unsigned long data);
-@@ -228,6 +233,8 @@ static inline void ptrace_init_task(struct task_struct *child, bool ptrace)
-
- if (unlikely(ptrace) && current->ptrace) {
- child->ptrace = current->ptrace;
-+ child->ptrace &=
-+ ~(PT_SYSCALL_TRACE | PT_SINGLE_STEP | PT_SINGLE_BLOCK);
- __ptrace_link(child, current->parent);
-
- if (child->ptrace & PT_SEIZED)
-diff --git a/include/linux/sched.h b/include/linux/sched.h
-index 7d379a6..a3c4599 100644
---- a/include/linux/sched.h
-+++ b/include/linux/sched.h
-@@ -185,16 +185,17 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
- #define TASK_UNINTERRUPTIBLE 2
- #define __TASK_STOPPED 4
- #define __TASK_TRACED 8
-+#define __TASK_UTRACED 16
- /* in tsk->exit_state */
--#define EXIT_ZOMBIE 16
--#define EXIT_DEAD 32
-+#define EXIT_ZOMBIE 32
-+#define EXIT_DEAD 64
- /* in tsk->state again */
--#define TASK_DEAD 64
--#define TASK_WAKEKILL 128
--#define TASK_WAKING 256
--#define TASK_STATE_MAX 512
-+#define TASK_DEAD 128
-+#define TASK_WAKEKILL 256
-+#define TASK_WAKING 512
-+#define TASK_STATE_MAX 1024
-
--#define TASK_STATE_TO_CHAR_STR "RSDTtZXxKW"
-+#define TASK_STATE_TO_CHAR_STR "RSDTtUZXxKW"
-
- extern char ___assert_task_state[1 - 2*!!(
- sizeof(TASK_STATE_TO_CHAR_STR)-1 != ilog2(TASK_STATE_MAX)+1)];
-@@ -203,15 +204,16 @@ extern char ___assert_task_state[1 - 2*!!(
- #define TASK_KILLABLE (TASK_WAKEKILL | TASK_UNINTERRUPTIBLE)
- #define TASK_STOPPED (TASK_WAKEKILL | __TASK_STOPPED)
- #define TASK_TRACED (TASK_WAKEKILL | __TASK_TRACED)
-+#define TASK_UTRACED (TASK_WAKEKILL | __TASK_UTRACED)
-
- /* Convenience macros for the sake of wake_up */
- #define TASK_NORMAL (TASK_INTERRUPTIBLE | TASK_UNINTERRUPTIBLE)
--#define TASK_ALL (TASK_NORMAL | __TASK_STOPPED | __TASK_TRACED)
-+#define TASK_ALL (TASK_NORMAL | __TASK_STOPPED | __TASK_TRACED | __TASK_UTRACED)
-
- /* get_task_state() */
- #define TASK_REPORT (TASK_RUNNING | TASK_INTERRUPTIBLE | \
- TASK_UNINTERRUPTIBLE | __TASK_STOPPED | \
-- __TASK_TRACED)
-+ __TASK_TRACED | __TASK_UTRACED)
-
- #define task_is_traced(task) ((task->state & __TASK_TRACED) != 0)
- #define task_is_stopped(task) ((task->state & __TASK_STOPPED) != 0)
-@@ -1420,6 +1422,11 @@ struct task_struct {
- #endif
- seccomp_t seccomp;
-
-+#ifdef CONFIG_UTRACE
-+ struct utrace *utrace;
-+ unsigned long utrace_flags;
-+#endif
-+
- /* Thread group tracking */
- u32 parent_exec_id;
- u32 self_exec_id;
-diff --git a/include/linux/signal.h b/include/linux/signal.h
-index 7987ce74..c320549 100644
---- a/include/linux/signal.h
-+++ b/include/linux/signal.h
-@@ -239,6 +239,8 @@ static inline int valid_signal(unsigned long sig)
- struct timespec;
- struct pt_regs;
-
-+extern int wake_up_quiescent(struct task_struct *p, unsigned int state);
-+
- extern int next_signal(struct sigpending *pending, sigset_t *mask);
- extern int do_send_sig_info(int sig, struct siginfo *info,
- struct task_struct *p, bool group);
-diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
-index a71a292..a1bac95 100644
---- a/include/linux/tracehook.h
-+++ b/include/linux/tracehook.h
-@@ -49,6 +49,7 @@
- #include <linux/sched.h>
- #include <linux/ptrace.h>
- #include <linux/security.h>
-+#include <linux/utrace.h>
- struct linux_binprm;
-
- /*
-@@ -58,8 +59,12 @@ static inline void ptrace_report_syscall(struct pt_regs *regs)
- {
- int ptrace = current->ptrace;
-
-- if (!(ptrace & PT_PTRACED))
-- return;
-+ if (!(ptrace & PT_SYSCALL_TRACE)) {
-+#ifdef TIF_SYSCALL_EMU
-+ if (!test_thread_flag(TIF_SYSCALL_EMU))
-+#endif
-+ return;
-+ }
-
- ptrace_notify(SIGTRAP | ((ptrace & PT_TRACESYSGOOD) ? 0x80 : 0));
-
-@@ -96,10 +101,16 @@ static inline void ptrace_report_syscall(struct pt_regs *regs)
- static inline __must_check int tracehook_report_syscall_entry(
- struct pt_regs *regs)
- {
-+ if ((task_utrace_flags(current) & UTRACE_EVENT(SYSCALL_ENTRY)) &&
-+ utrace_report_syscall_entry(regs))
-+ return 1;
- ptrace_report_syscall(regs);
- return 0;
- }
-
-+#define ptrace_wants_step(task) \
-+ ((task)->ptrace & (PT_SINGLE_STEP | PT_SINGLE_BLOCK))
-+
- /**
- * tracehook_report_syscall_exit - task has just finished a system call
- * @regs: user register state of current task
-@@ -119,7 +130,10 @@ static inline __must_check int tracehook_report_syscall_entry(
- */
- static inline void tracehook_report_syscall_exit(struct pt_regs *regs, int step)
- {
-- if (step) {
-+ if (task_utrace_flags(current) & UTRACE_EVENT(SYSCALL_EXIT))
-+ utrace_report_syscall_exit(regs);
-+
-+ if (step && ptrace_wants_step(current)) {
- siginfo_t info;
- user_single_step_siginfo(current, regs, &info);
- force_sig_info(SIGTRAP, &info, current);
-@@ -148,10 +162,34 @@ static inline void tracehook_signal_handler(int sig, siginfo_t *info,
- const struct k_sigaction *ka,
- struct pt_regs *regs, int stepping)
- {
-- if (stepping)
-+ if (task_utrace_flags(current))
-+ utrace_signal_handler(current, stepping);
-+ if (stepping && ptrace_wants_step(current))
- ptrace_notify(SIGTRAP);
- }
-
-+/**
-+ * tracehook_consider_fatal_signal - suppress special handling of fatal signal
-+ * @task: task receiving the signal
-+ * @sig: signal number being sent
-+ *
-+ * Return nonzero to prevent special handling of this termination signal.
-+ * Normally handler for signal is %SIG_DFL. It can be %SIG_IGN if @sig is
-+ * ignored, in which case force_sig() is about to reset it to %SIG_DFL.
-+ * When this returns zero, this signal might cause a quick termination
-+ * that does not give the debugger a chance to intercept the signal.
-+ *
-+ * Called with or without @task->sighand->siglock held.
-+ */
-+static inline int tracehook_consider_fatal_signal(struct task_struct *task,
-+ int sig)
-+{
-+ if (unlikely(task_utrace_flags(task) & (UTRACE_EVENT(SIGNAL_TERM) |
-+ UTRACE_EVENT(SIGNAL_CORE))))
-+ return 1;
-+ return task->ptrace != 0;
-+}
-+
- #ifdef TIF_NOTIFY_RESUME
- /**
- * set_notify_resume - cause tracehook_notify_resume() to be called
-@@ -179,10 +217,21 @@ static inline void set_notify_resume(struct task_struct *task)
- * asynchronously, this will be called again before we return to
- * user mode.
- *
-- * Called without locks.
-+ * Called without locks. However, on some machines this may be
-+ * called with interrupts disabled.
- */
- static inline void tracehook_notify_resume(struct pt_regs *regs)
- {
-+ struct task_struct *task = current;
-+ /*
-+ * Prevent the following store/load from getting ahead of the
-+ * caller which clears TIF_NOTIFY_RESUME. This pairs with the
-+ * implicit mb() before setting TIF_NOTIFY_RESUME in
-+ * set_notify_resume().
-+ */
-+ smp_mb();
-+ if (task_utrace_flags(task))
-+ utrace_resume(task, regs);
- }
- #endif /* TIF_NOTIFY_RESUME */
-
-diff --git a/include/linux/utrace.h b/include/linux/utrace.h
-new file mode 100644
-index 0000000..46959af
---- /dev/null
-+++ b/include/linux/utrace.h
-@@ -0,0 +1,774 @@
-+/*
-+ * utrace infrastructure interface for debugging user processes
-+ *
-+ * Copyright (C) 2006-2009 Red Hat, Inc. All rights reserved.
-+ *
-+ * This copyrighted material is made available to anyone wishing to use,
-+ * modify, copy, or redistribute it subject to the terms and conditions
-+ * of the GNU General Public License v.2.
-+ *
-+ * Red Hat Author: Roland McGrath.
-+ *
-+ * This interface allows for notification of interesting events in a
-+ * thread. It also mediates access to thread state such as registers.
-+ * Multiple unrelated users can be associated with a single thread.
-+ * We call each of these a tracing engine.
-+ *
-+ * A tracing engine starts by calling utrace_attach_task() or
-+ * utrace_attach_pid() on the chosen thread, passing in a set of hooks
-+ * (&struct utrace_engine_ops), and some associated data. This produces a
-+ * &struct utrace_engine, which is the handle used for all other
-+ * operations. An attached engine has its ops vector, its data, and an
-+ * event mask controlled by utrace_set_events().
-+ *
-+ * For each event bit that is set, that engine will get the
-+ * appropriate ops->report_*() callback when the event occurs. The
-+ * &struct utrace_engine_ops need not provide callbacks for an event
-+ * unless the engine sets one of the associated event bits.
-+ */
-+
-+#ifndef _LINUX_UTRACE_H
-+#define _LINUX_UTRACE_H 1
-+
-+#include <linux/list.h>
-+#include <linux/kref.h>
-+#include <linux/signal.h>
-+#include <linux/sched.h>
-+
-+struct linux_binprm;
-+struct pt_regs;
-+struct utrace;
-+struct user_regset;
-+struct user_regset_view;
-+
-+/*
-+ * Event bits passed to utrace_set_events().
-+ * These appear in &struct task_struct.@utrace_flags
-+ * and &struct utrace_engine.@flags.
-+ */
-+enum utrace_events {
-+ _UTRACE_EVENT_QUIESCE, /* Thread is available for examination. */
-+ _UTRACE_EVENT_REAP, /* Zombie reaped, no more tracing possible. */
-+ _UTRACE_EVENT_CLONE, /* Successful clone/fork/vfork just done. */
-+ _UTRACE_EVENT_EXEC, /* Successful execve just completed. */
-+ _UTRACE_EVENT_EXIT, /* Thread exit in progress. */
-+ _UTRACE_EVENT_DEATH, /* Thread has died. */
-+ _UTRACE_EVENT_SYSCALL_ENTRY, /* User entered kernel for system call. */
-+ _UTRACE_EVENT_SYSCALL_EXIT, /* Returning to user after system call. */
-+ _UTRACE_EVENT_SIGNAL, /* Signal delivery will run a user handler. */
-+ _UTRACE_EVENT_SIGNAL_IGN, /* No-op signal to be delivered. */
-+ _UTRACE_EVENT_SIGNAL_STOP, /* Signal delivery will suspend. */
-+ _UTRACE_EVENT_SIGNAL_TERM, /* Signal delivery will terminate. */
-+ _UTRACE_EVENT_SIGNAL_CORE, /* Signal delivery will dump core. */
-+ _UTRACE_EVENT_JCTL, /* Job control stop or continue completed. */
-+ _UTRACE_NEVENTS
-+};
-+#define UTRACE_EVENT(type) (1UL << _UTRACE_EVENT_##type)
-+
-+/*
-+ * All the kinds of signal events.
-+ * These all use the @report_signal() callback.
-+ */
-+#define UTRACE_EVENT_SIGNAL_ALL (UTRACE_EVENT(SIGNAL) \
-+ | UTRACE_EVENT(SIGNAL_IGN) \
-+ | UTRACE_EVENT(SIGNAL_STOP) \
-+ | UTRACE_EVENT(SIGNAL_TERM) \
-+ | UTRACE_EVENT(SIGNAL_CORE))
-+/*
-+ * Both kinds of syscall events; these call the @report_syscall_entry()
-+ * and @report_syscall_exit() callbacks, respectively.
-+ */
-+#define UTRACE_EVENT_SYSCALL \
-+ (UTRACE_EVENT(SYSCALL_ENTRY) | UTRACE_EVENT(SYSCALL_EXIT))
-+
-+/*
-+ * The event reports triggered synchronously by task death.
-+ */
-+#define _UTRACE_DEATH_EVENTS (UTRACE_EVENT(DEATH) | UTRACE_EVENT(QUIESCE))
-+
-+/*
-+ * Hooks in <linux/tracehook.h> call these entry points to the utrace dispatch.
-+ */
-+void utrace_free_task(struct task_struct *);
-+bool utrace_interrupt_pending(void);
-+void utrace_resume(struct task_struct *, struct pt_regs *);
-+void utrace_finish_stop(void);
-+void utrace_maybe_reap(struct task_struct *, struct utrace *, bool);
-+int utrace_get_signal(struct task_struct *, struct pt_regs *,
-+ siginfo_t *, struct k_sigaction *);
-+void utrace_report_clone(unsigned long, struct task_struct *);
-+void utrace_finish_vfork(struct task_struct *);
-+void utrace_report_exit(long *exit_code);
-+void utrace_report_death(struct task_struct *, bool, int);
-+void utrace_report_jctl(int notify, int type);
-+void utrace_report_exec(struct linux_binfmt *, struct linux_binprm *,
-+ struct pt_regs *regs);
-+bool utrace_report_syscall_entry(struct pt_regs *);
-+void utrace_report_syscall_exit(struct pt_regs *);
-+void utrace_signal_handler(struct task_struct *, int);
-+
-+#define UTRACE_FLAG(task, ev) (task_utrace_flags(task) & UTRACE_EVENT(ev))
-+
-+#define UTRACE_HOOK(task, ev, callback) \
-+ do { \
-+ if (UTRACE_FLAG(task, ev)) \
-+ utrace_ ## callback; \
-+ } while (0)
-+
-+#ifndef CONFIG_UTRACE
-+
-+static inline void task_utrace_lock(struct task_struct *task)
-+{
-+}
-+static inline void task_utrace_unlock(struct task_struct *task)
-+{
-+}
-+/*
-+ * <linux/tracehook.h> uses these accessors to avoid #ifdef CONFIG_UTRACE.
-+ */
-+static inline unsigned long task_utrace_flags(struct task_struct *task)
-+{
-+ return 0;
-+}
-+static inline struct utrace *task_utrace_struct(struct task_struct *task)
-+{
-+ return NULL;
-+}
-+static inline void utrace_init_task(struct task_struct *child)
-+{
-+}
-+
-+static inline void task_utrace_proc_status(struct seq_file *m,
-+ struct task_struct *p)
-+{
-+}
-+
-+#else /* CONFIG_UTRACE */
-+
-+extern void task_utrace_lock(struct task_struct *task);
-+extern void task_utrace_unlock(struct task_struct *task);
-+
-+static inline unsigned long task_utrace_flags(struct task_struct *task)
-+{
-+ return task->utrace_flags;
-+}
-+
-+static inline struct utrace *task_utrace_struct(struct task_struct *task)
-+{
-+ struct utrace *utrace;
-+
-+ /*
-+ * This barrier ensures that any prior load of task->utrace_flags
-+ * is ordered before this load of task->utrace. We use those
-+ * utrace_flags checks in the hot path to decide to call into
-+ * the utrace code. The first attach installs task->utrace before
-+ * setting task->utrace_flags nonzero with implicit barrier in
-+ * between, see utrace_add_engine().
-+ */
-+ smp_rmb();
-+ utrace = task->utrace;
-+
-+ smp_read_barrier_depends(); /* See utrace_task_alloc(). */
-+ return utrace;
-+}
-+
-+static inline void utrace_init_task(struct task_struct *task)
-+{
-+ task->utrace_flags = 0;
-+ task->utrace = NULL;
-+}
-+
-+void task_utrace_proc_status(struct seq_file *m, struct task_struct *p);
-+
-+
-+/*
-+ * Version number of the API defined in this file. This will change
-+ * whenever a tracing engine's code would need some updates to keep
-+ * working. We maintain this here for the benefit of tracing engine code
-+ * that is developed concurrently with utrace API improvements before they
-+ * are merged into the kernel, making LINUX_VERSION_CODE checks unwieldy.
-+ */
-+#define UTRACE_API_VERSION 20091216
-+
-+/**
-+ * enum utrace_resume_action - engine's choice of action for a traced task
-+ * @UTRACE_STOP: Stay quiescent after callbacks.
-+ * @UTRACE_INTERRUPT: Make @report_signal() callback soon.
-+ * @UTRACE_REPORT: Make some callback soon.
-+ * @UTRACE_SINGLESTEP: Resume in user mode for one instruction.
-+ * @UTRACE_BLOCKSTEP: Resume in user mode until next branch.
-+ * @UTRACE_RESUME: Resume normally in user mode.
-+ * @UTRACE_DETACH: Detach my engine (implies %UTRACE_RESUME).
-+ *
-+ * See utrace_control() for detailed descriptions of each action. This is
-+ * encoded in the @action argument and the return value for every callback
-+ * with a &u32 return value.
-+ *
-+ * The order of these is important. When there is more than one engine,
-+ * each supplies its choice and the smallest value prevails.
-+ */
-+enum utrace_resume_action {
-+ UTRACE_STOP,
-+ UTRACE_INTERRUPT,
-+ UTRACE_REPORT,
-+ UTRACE_SINGLESTEP,
-+ UTRACE_BLOCKSTEP,
-+ UTRACE_RESUME,
-+ UTRACE_DETACH,
-+ UTRACE_RESUME_MAX
-+};
-+#define UTRACE_RESUME_BITS (ilog2(UTRACE_RESUME_MAX) + 1)
-+#define UTRACE_RESUME_MASK ((1 << UTRACE_RESUME_BITS) - 1)
-+
-+/**
-+ * utrace_resume_action - &enum utrace_resume_action from callback action
-+ * @action: &u32 callback @action argument or return value
-+ *
-+ * This extracts the &enum utrace_resume_action from @action,
-+ * which is the @action argument to a &struct utrace_engine_ops
-+ * callback or the return value from one.
-+ */
-+static inline enum utrace_resume_action utrace_resume_action(u32 action)
-+{
-+ return action & UTRACE_RESUME_MASK;
-+}
-+
-+/**
-+ * enum utrace_signal_action - disposition of signal
-+ * @UTRACE_SIGNAL_DELIVER: Deliver according to sigaction.
-+ * @UTRACE_SIGNAL_IGN: Ignore the signal.
-+ * @UTRACE_SIGNAL_TERM: Terminate the process.
-+ * @UTRACE_SIGNAL_CORE: Terminate with core dump.
-+ * @UTRACE_SIGNAL_STOP: Deliver as absolute stop.
-+ * @UTRACE_SIGNAL_TSTP: Deliver as job control stop.
-+ * @UTRACE_SIGNAL_REPORT: Reporting before pending signals.
-+ * @UTRACE_SIGNAL_HANDLER: Reporting after signal handler setup.
-+ *
-+ * This is encoded in the @action argument and the return value for
-+ * a @report_signal() callback. It says what will happen to the
-+ * signal described by the &siginfo_t parameter to the callback.
-+ *
-+ * The %UTRACE_SIGNAL_REPORT value is used in an @action argument when
-+ * a tracing report is being made before dequeuing any pending signal.
-+ * If this is immediately after a signal handler has been set up, then
-+ * %UTRACE_SIGNAL_HANDLER is used instead. A @report_signal callback
-+ * that uses %UTRACE_SIGNAL_DELIVER|%UTRACE_SINGLESTEP will ensure
-+ * it sees a %UTRACE_SIGNAL_HANDLER report.
-+ */
-+enum utrace_signal_action {
-+ UTRACE_SIGNAL_DELIVER = 0x00,
-+ UTRACE_SIGNAL_IGN = 0x10,
-+ UTRACE_SIGNAL_TERM = 0x20,
-+ UTRACE_SIGNAL_CORE = 0x30,
-+ UTRACE_SIGNAL_STOP = 0x40,
-+ UTRACE_SIGNAL_TSTP = 0x50,
-+ UTRACE_SIGNAL_REPORT = 0x60,
-+ UTRACE_SIGNAL_HANDLER = 0x70
-+};
-+#define UTRACE_SIGNAL_MASK 0xf0
-+#define UTRACE_SIGNAL_HOLD 0x100 /* Flag, push signal back on queue. */
-+
-+/**
-+ * utrace_signal_action - &enum utrace_signal_action from callback action
-+ * @action: @report_signal callback @action argument or return value
-+ *
-+ * This extracts the &enum utrace_signal_action from @action, which
-+ * is the @action argument to a @report_signal callback or the
-+ * return value from one.
-+ */
-+static inline enum utrace_signal_action utrace_signal_action(u32 action)
-+{
-+ return action & UTRACE_SIGNAL_MASK;
-+}
-+
-+/**
-+ * enum utrace_syscall_action - disposition of system call attempt
-+ * @UTRACE_SYSCALL_RUN: Run the system call.
-+ * @UTRACE_SYSCALL_ABORT: Don't run the system call.
-+ *
-+ * This is encoded in the @action argument and the return value for
-+ * a @report_syscall_entry callback.
-+ */
-+enum utrace_syscall_action {
-+ UTRACE_SYSCALL_RUN = 0x00,
-+ UTRACE_SYSCALL_ABORT = 0x10
-+};
-+#define UTRACE_SYSCALL_MASK 0xf0
-+#define UTRACE_SYSCALL_RESUMED 0x100 /* Flag, report_syscall_entry() repeats */
-+
-+/**
-+ * utrace_syscall_action - &enum utrace_syscall_action from callback action
-+ * @action: @report_syscall_entry callback @action or return value
-+ *
-+ * This extracts the &enum utrace_syscall_action from @action, which
-+ * is the @action argument to a @report_syscall_entry callback or the
-+ * return value from one.
-+ */
-+static inline enum utrace_syscall_action utrace_syscall_action(u32 action)
-+{
-+ return action & UTRACE_SYSCALL_MASK;
-+}
-+
-+/*
-+ * Flags for utrace_attach_task() and utrace_attach_pid().
-+ */
-+#define UTRACE_ATTACH_MATCH_OPS 0x0001 /* Match engines on ops. */
-+#define UTRACE_ATTACH_MATCH_DATA 0x0002 /* Match engines on data. */
-+#define UTRACE_ATTACH_MATCH_MASK 0x000f
-+#define UTRACE_ATTACH_CREATE 0x0010 /* Attach a new engine. */
-+#define UTRACE_ATTACH_EXCLUSIVE 0x0020 /* Refuse if existing match. */
-+#define UTRACE_ATTACH_ATOMIC 0x0040 /* For _CREATE, don't sleep */
-+
-+/**
-+ * struct utrace_engine - per-engine structure
-+ * @ops: &struct utrace_engine_ops pointer passed to utrace_attach_task()
-+ * @data: engine-private &void * passed to utrace_attach_task()
-+ * @flags: event mask set by utrace_set_events() plus internal flag bits
-+ *
-+ * The task itself never has to worry about engines detaching while
-+ * it's doing event callbacks. These structures are removed from the
-+ * task's active list only when it's stopped, or by the task itself.
-+ *
-+ * utrace_engine_get() and utrace_engine_put() maintain a reference count.
-+ * When it drops to zero, the structure is freed. One reference is held
-+ * implicitly while the engine is attached to its task.
-+ */
-+struct utrace_engine {
-+/* private: */
-+ struct kref kref;
-+ void (*release)(void *);
-+ struct list_head entry;
-+
-+/* public: */
-+ const struct utrace_engine_ops *ops;
-+ void *data;
-+
-+ unsigned long flags;
-+};
-+
-+/**
-+ * utrace_engine_get - acquire a reference on a &struct utrace_engine
-+ * @engine: &struct utrace_engine pointer
-+ *
-+ * You must hold a reference on @engine, and you get another.
-+ */
-+static inline void utrace_engine_get(struct utrace_engine *engine)
-+{
-+ kref_get(&engine->kref);
-+}
-+
-+void __utrace_engine_release(struct kref *);
-+
-+/**
-+ * utrace_engine_put - release a reference on a &struct utrace_engine
-+ * @engine: &struct utrace_engine pointer
-+ *
-+ * You must hold a reference on @engine, and you lose that reference.
-+ * If it was the last one, @engine becomes an invalid pointer.
-+ */
-+static inline void utrace_engine_put(struct utrace_engine *engine)
-+{
-+ kref_put(&engine->kref, __utrace_engine_release);
-+}
-+
-+/**
-+ * struct utrace_engine_ops - tracing engine callbacks
-+ *
-+ * Each @report_*() callback corresponds to an %UTRACE_EVENT(*) bit.
-+ * utrace_set_events() calls on @engine choose which callbacks will
-+ * be made to @engine from @task.
-+ *
-+ * Most callbacks take an @action argument, giving the resume action
-+ * chosen by other tracing engines. All callbacks take an @engine
-+ * argument. The @report_reap callback takes a @task argument that
-+ * might or might not be @current. All other @report_* callbacks
-+ * report an event in the @current task.
-+ *
-+ * For some calls, @action also includes bits specific to that event
-+ * and utrace_resume_action() is used to extract the resume action.
-+ * This shows what would happen if @engine wasn't there, or will if
-+ * the callback's return value uses %UTRACE_RESUME. This always
-+ * starts as %UTRACE_RESUME when no other tracing is being done on
-+ * this task.
-+ *
-+ * All return values contain &enum utrace_resume_action bits. For
-+ * some calls, other bits specific to that kind of event are added to
-+ * the resume action bits with OR. These are the same bits used in
-+ * the @action argument. The resume action returned by a callback
-+ * does not override previous engines' choices, it only says what
-+ * @engine wants done. What @current actually does is the action that's
-+ * most constrained among the choices made by all attached engines.
-+ * See utrace_control() for more information on the actions.
-+ *
-+ * When %UTRACE_STOP is used in @report_syscall_entry, then @current
-+ * stops before attempting the system call. In this case, another
-+ * @report_syscall_entry callback will follow after @current resumes if
-+ * %UTRACE_REPORT or %UTRACE_INTERRUPT was returned by some callback
-+ * or passed to utrace_control(). In a second or later callback,
-+ * %UTRACE_SYSCALL_RESUMED is set in the @action argument to indicate
-+ * a repeat callback still waiting to attempt the same system call
-+ * invocation. This repeat callback gives each engine an opportunity
-+ * to reexamine registers another engine might have changed while
-+ * @current was held in %UTRACE_STOP.
-+ *
-+ * In other cases, the resume action does not take effect until @current
-+ * is ready to check for signals and return to user mode. If there
-+ * are more callbacks to be made, the last round of calls determines
-+ * the final action. A @report_quiesce callback with @event zero, or
-+ * a @report_signal callback, will always be the last one made before
-+ * @current resumes. Only %UTRACE_STOP is "sticky"--if @engine returned
-+ * %UTRACE_STOP then @current stays stopped unless @engine returns
-+ * different from a following callback.
-+ *
-+ * The report_death() and report_reap() callbacks do not take @action
-+ * arguments, and only %UTRACE_DETACH is meaningful in the return value
-+ * from a report_death() callback. None of the resume actions applies
-+ * to a dead thread.
-+ *
-+ * All @report_*() hooks are called with no locks held, in a generally
-+ * safe environment when we will be returning to user mode soon (or just
-+ * entered the kernel). It is fine to block for memory allocation and
-+ * the like, but all hooks are asynchronous and must not block on
-+ * external events! If you want the thread to block, use %UTRACE_STOP
-+ * in your hook's return value; then later wake it up with utrace_control().
-+ *
-+ * @report_quiesce:
-+ * Requested by %UTRACE_EVENT(%QUIESCE).
-+ * This does not indicate any event, but just that @current is in a
-+ * safe place for examination. This call is made before each specific
-+ * event callback, except for @report_reap. The @event argument gives
-+ * the %UTRACE_EVENT(@which) value for the event occurring. This
-+ * callback might be made for events @engine has not requested, if
-+ * some other engine is tracing the event; calling utrace_set_events()
-+ * call here can request the immediate callback for this occurrence of
-+ * @event. @event is zero when there is no other event, @current is
-+ * now ready to check for signals and return to user mode, and some
-+ * engine has used %UTRACE_REPORT or %UTRACE_INTERRUPT to request this
-+ * callback. For this case, if @report_signal is not %NULL, the
-+ * @report_quiesce callback may be replaced with a @report_signal
-+ * callback passing %UTRACE_SIGNAL_REPORT in its @action argument,
-+ * whenever @current is entering the signal-check path anyway.
-+ *
-+ * @report_signal:
-+ * Requested by %UTRACE_EVENT(%SIGNAL_*) or %UTRACE_EVENT(%QUIESCE).
-+ * Use utrace_signal_action() and utrace_resume_action() on @action.
-+ * The signal action is %UTRACE_SIGNAL_REPORT when some engine has
-+ * used %UTRACE_REPORT or %UTRACE_INTERRUPT; the callback can choose
-+ * to stop or to deliver an artificial signal, before pending signals.
-+ * It's %UTRACE_SIGNAL_HANDLER instead when signal handler setup just
-+ * finished (after a previous %UTRACE_SIGNAL_DELIVER return); this
-+ * serves in lieu of any %UTRACE_SIGNAL_REPORT callback requested by
-+ * %UTRACE_REPORT or %UTRACE_INTERRUPT, and is also implicitly
-+ * requested by %UTRACE_SINGLESTEP or %UTRACE_BLOCKSTEP into the
-+ * signal delivery. The other signal actions indicate a signal about
-+ * to be delivered; the previous engine's return value sets the signal
-+ * action seen by the the following engine's callback. The @info data
-+ * can be changed at will, including @info->si_signo. The settings in
-+ * @return_ka determines what %UTRACE_SIGNAL_DELIVER does. @orig_ka
-+ * is what was in force before other tracing engines intervened, and
-+ * it's %NULL when this report began as %UTRACE_SIGNAL_REPORT or
-+ * %UTRACE_SIGNAL_HANDLER. For a report without a new signal, @info
-+ * is left uninitialized and must be set completely by an engine that
-+ * chooses to deliver a signal; if there was a previous @report_signal
-+ * callback ending in %UTRACE_STOP and it was just resumed using
-+ * %UTRACE_REPORT or %UTRACE_INTERRUPT, then @info is left unchanged
-+ * from the previous callback. In this way, the original signal can
-+ * be left in @info while returning %UTRACE_STOP|%UTRACE_SIGNAL_IGN
-+ * and then found again when resuming with %UTRACE_INTERRUPT.
-+ * The %UTRACE_SIGNAL_HOLD flag bit can be OR'd into the return value,
-+ * and might be in @action if the previous engine returned it. This
-+ * flag asks that the signal in @info be pushed back on @current's queue
-+ * so that it will be seen again after whatever action is taken now.
-+ *
-+ * @report_clone:
-+ * Requested by %UTRACE_EVENT(%CLONE).
-+ * Event reported for parent, before the new task @child might run.
-+ * @clone_flags gives the flags used in the clone system call, or
-+ * equivalent flags for a fork() or vfork() system call. This
-+ * function can use utrace_attach_task() on @child. Then passing
-+ * %UTRACE_STOP to utrace_control() on @child here keeps the child
-+ * stopped before it ever runs in user mode, %UTRACE_REPORT or
-+ * %UTRACE_INTERRUPT ensures a callback from @child before it
-+ * starts in user mode.
-+ *
-+ * @report_jctl:
-+ * Requested by %UTRACE_EVENT(%JCTL).
-+ * Job control event; @type is %CLD_STOPPED or %CLD_CONTINUED,
-+ * indicating whether we are stopping or resuming now. If @notify
-+ * is nonzero, @current is the last thread to stop and so will send
-+ * %SIGCHLD to its parent after this callback; @notify reflects
-+ * what the parent's %SIGCHLD has in @si_code, which can sometimes
-+ * be %CLD_STOPPED even when @type is %CLD_CONTINUED.
-+ *
-+ * @report_exec:
-+ * Requested by %UTRACE_EVENT(%EXEC).
-+ * An execve system call has succeeded and the new program is about to
-+ * start running. The initial user register state is handy to be tweaked
-+ * directly in @regs. @fmt and @bprm gives the details of this exec.
-+ *
-+ * @report_syscall_entry:
-+ * Requested by %UTRACE_EVENT(%SYSCALL_ENTRY).
-+ * Thread has entered the kernel to request a system call.
-+ * The user register state is handy to be tweaked directly in @regs.
-+ * The @action argument contains an &enum utrace_syscall_action,
-+ * use utrace_syscall_action() to extract it. The return value
-+ * overrides the last engine's action for the system call.
-+ * If the final action is %UTRACE_SYSCALL_ABORT, no system call
-+ * is made. The details of the system call being attempted can
-+ * be fetched here with syscall_get_nr() and syscall_get_arguments().
-+ * The parameter registers can be changed with syscall_set_arguments().
-+ * See above about the %UTRACE_SYSCALL_RESUMED flag in @action.
-+ * Use %UTRACE_REPORT in the return value to guarantee you get
-+ * another callback (with %UTRACE_SYSCALL_RESUMED flag) in case
-+ * @current stops with %UTRACE_STOP before attempting the system call.
-+ *
-+ * @report_syscall_exit:
-+ * Requested by %UTRACE_EVENT(%SYSCALL_EXIT).
-+ * Thread is about to leave the kernel after a system call request.
-+ * The user register state is handy to be tweaked directly in @regs.
-+ * The results of the system call attempt can be examined here using
-+ * syscall_get_error() and syscall_get_return_value(). It is safe
-+ * here to call syscall_set_return_value() or syscall_rollback().
-+ *
-+ * @report_exit:
-+ * Requested by %UTRACE_EVENT(%EXIT).
-+ * Thread is exiting and cannot be prevented from doing so,
-+ * but all its state is still live. The @code value will be
-+ * the wait result seen by the parent, and can be changed by
-+ * this engine or others. The @orig_code value is the real
-+ * status, not changed by any tracing engine. Returning %UTRACE_STOP
-+ * here keeps @current stopped before it cleans up its state and dies,
-+ * so it can be examined by other processes. When @current is allowed
-+ * to run, it will die and get to the @report_death callback.
-+ *
-+ * @report_death:
-+ * Requested by %UTRACE_EVENT(%DEATH).
-+ * Thread is really dead now. It might be reaped by its parent at
-+ * any time, or self-reap immediately. Though the actual reaping
-+ * may happen in parallel, a report_reap() callback will always be
-+ * ordered after a report_death() callback.
-+ *
-+ * @report_reap:
-+ * Requested by %UTRACE_EVENT(%REAP).
-+ * Called when someone reaps the dead task (parent, init, or self).
-+ * This means the parent called wait, or else this was a detached
-+ * thread or a process whose parent ignores SIGCHLD.
-+ * No more callbacks are made after this one.
-+ * The engine is always detached.
-+ * There is nothing more a tracing engine can do about this thread.
-+ * After this callback, the @engine pointer will become invalid.
-+ * The @task pointer may become invalid if get_task_struct() hasn't
-+ * been used to keep it alive.
-+ * An engine should always request this callback if it stores the
-+ * @engine pointer or stores any pointer in @engine->data, so it
-+ * can clean up its data structures.
-+ * Unlike other callbacks, this can be called from the parent's context
-+ * rather than from the traced thread itself--it must not delay the
-+ * parent by blocking.
-+ *
-+ * @release:
-+ * If not %NULL, this is called after the last utrace_engine_put()
-+ * call for a &struct utrace_engine, which could be implicit after
-+ * a %UTRACE_DETACH return from another callback. Its argument is
-+ * the engine's @data member.
-+ */
-+struct utrace_engine_ops {
-+ u32 (*report_quiesce)(u32 action, struct utrace_engine *engine,
-+ unsigned long event);
-+ u32 (*report_signal)(u32 action, struct utrace_engine *engine,
-+ struct pt_regs *regs,
-+ siginfo_t *info,
-+ const struct k_sigaction *orig_ka,
-+ struct k_sigaction *return_ka);
-+ u32 (*report_clone)(u32 action, struct utrace_engine *engine,
-+ unsigned long clone_flags,
-+ struct task_struct *child);
-+ u32 (*report_jctl)(u32 action, struct utrace_engine *engine,
-+ int type, int notify);
-+ u32 (*report_exec)(u32 action, struct utrace_engine *engine,
-+ const struct linux_binfmt *fmt,
-+ const struct linux_binprm *bprm,
-+ struct pt_regs *regs);
-+ u32 (*report_syscall_entry)(u32 action, struct utrace_engine *engine,
-+ struct pt_regs *regs);
-+ u32 (*report_syscall_exit)(u32 action, struct utrace_engine *engine,
-+ struct pt_regs *regs);
-+ u32 (*report_exit)(u32 action, struct utrace_engine *engine,
-+ long orig_code, long *code);
-+ u32 (*report_death)(struct utrace_engine *engine,
-+ bool group_dead, int signal);
-+ void (*report_reap)(struct utrace_engine *engine,
-+ struct task_struct *task);
-+ void (*release)(void *data);
-+};
-+
-+/**
-+ * struct utrace_examiner - private state for using utrace_prepare_examine()
-+ *
-+ * The members of &struct utrace_examiner are private to the implementation.
-+ * This data type holds the state from a call to utrace_prepare_examine()
-+ * to be used by a call to utrace_finish_examine().
-+ */
-+struct utrace_examiner {
-+/* private: */
-+ long state;
-+ unsigned long ncsw;
-+};
-+
-+/*
-+ * These are the exported entry points for tracing engines to use.
-+ * See kernel/utrace.c for their kerneldoc comments with interface details.
-+ */
-+struct utrace_engine *utrace_attach_task(struct task_struct *, int,
-+ const struct utrace_engine_ops *,
-+ void *);
-+struct utrace_engine *utrace_attach_pid(struct pid *, int,
-+ const struct utrace_engine_ops *,
-+ void *);
-+int __must_check utrace_control(struct task_struct *,
-+ struct utrace_engine *,
-+ enum utrace_resume_action);
-+int __must_check utrace_set_events(struct task_struct *,
-+ struct utrace_engine *,
-+ unsigned long eventmask);
-+int __must_check utrace_barrier(struct task_struct *,
-+ struct utrace_engine *);
-+int __must_check utrace_prepare_examine(struct task_struct *,
-+ struct utrace_engine *,
-+ struct utrace_examiner *);
-+int __must_check utrace_finish_examine(struct task_struct *,
-+ struct utrace_engine *,
-+ struct utrace_examiner *);
-+
-+/**
-+ * utrace_control_pid - control a thread being traced by a tracing engine
-+ * @pid: thread to affect
-+ * @engine: attached engine to affect
-+ * @action: &enum utrace_resume_action for thread to do
-+ *
-+ * This is the same as utrace_control(), but takes a &struct pid
-+ * pointer rather than a &struct task_struct pointer. The caller must
-+ * hold a ref on @pid, but does not need to worry about the task
-+ * staying valid. If it's been reaped so that @pid points nowhere,
-+ * then this call returns -%ESRCH.
-+ */
-+static inline __must_check int utrace_control_pid(
-+ struct pid *pid, struct utrace_engine *engine,
-+ enum utrace_resume_action action)
-+{
-+ /*
-+ * We don't bother with rcu_read_lock() here to protect the
-+ * task_struct pointer, because utrace_control will return
-+ * -ESRCH without looking at that pointer if the engine is
-+ * already detached. A task_struct pointer can't die before
-+ * all the engines are detached in release_task() first.
-+ */
-+ struct task_struct *task = pid_task(pid, PIDTYPE_PID);
-+ return unlikely(!task) ? -ESRCH : utrace_control(task, engine, action);
-+}
-+
-+/**
-+ * utrace_set_events_pid - choose which event reports a tracing engine gets
-+ * @pid: thread to affect
-+ * @engine: attached engine to affect
-+ * @eventmask: new event mask
-+ *
-+ * This is the same as utrace_set_events(), but takes a &struct pid
-+ * pointer rather than a &struct task_struct pointer. The caller must
-+ * hold a ref on @pid, but does not need to worry about the task
-+ * staying valid. If it's been reaped so that @pid points nowhere,
-+ * then this call returns -%ESRCH.
-+ */
-+static inline __must_check int utrace_set_events_pid(
-+ struct pid *pid, struct utrace_engine *engine, unsigned long eventmask)
-+{
-+ struct task_struct *task = pid_task(pid, PIDTYPE_PID);
-+ return unlikely(!task) ? -ESRCH :
-+ utrace_set_events(task, engine, eventmask);
-+}
-+
-+/**
-+ * utrace_barrier_pid - synchronize with simultaneous tracing callbacks
-+ * @pid: thread to affect
-+ * @engine: engine to affect (can be detached)
-+ *
-+ * This is the same as utrace_barrier(), but takes a &struct pid
-+ * pointer rather than a &struct task_struct pointer. The caller must
-+ * hold a ref on @pid, but does not need to worry about the task
-+ * staying valid. If it's been reaped so that @pid points nowhere,
-+ * then this call returns -%ESRCH.
-+ */
-+static inline __must_check int utrace_barrier_pid(struct pid *pid,
-+ struct utrace_engine *engine)
-+{
-+ struct task_struct *task = pid_task(pid, PIDTYPE_PID);
-+ return unlikely(!task) ? -ESRCH : utrace_barrier(task, engine);
-+}
-+
-+#endif /* CONFIG_UTRACE */
-+
-+static inline void utrace_release_task(struct task_struct *task)
-+{
-+ /* see utrace_add_engine() about this barrier */
-+ smp_mb();
-+ if (task_utrace_flags(task))
-+ utrace_maybe_reap(task, task_utrace_struct(task), true);
-+}
-+
-+static inline void utrace_exit_notify(struct task_struct *task,
-+ int signal, int group_dead)
-+{
-+ /*
-+ * If utrace_set_events() was just called to enable
-+ * UTRACE_EVENT(DEATH), then we are obliged to call
-+ * utrace_report_death() and not miss it. utrace_set_events()
-+ * checks @task->exit_state under tasklist_lock to synchronize
-+ * with exit_notify(), the caller.
-+ */
-+ if (task_utrace_flags(task) & _UTRACE_DEATH_EVENTS)
-+ utrace_report_death(task, group_dead, signal);
-+}
-+
-+/**
-+ * utrace_end_stop - report about return from STOPPED/TRACED
-+ *
-+ * This is called by do_signal_stop() and ptrace_stop after wakeup.
-+ */
-+static inline void utrace_end_stop(void)
-+{
-+ if (task_utrace_flags(current))
-+ utrace_finish_stop();
-+}
-+
-+/**
-+ * utrace_hook_signal - deliver synthetic signal to traced task
-+ * @task: @current
-+ * @regs: task_pt_regs(@current)
-+ * @info: details of synthetic signal
-+ * @return_ka: sigaction for synthetic signal
-+ *
-+ * Return zero to check for a real pending signal normally.
-+ * Return -1 after releasing the siglock to repeat the check.
-+ * Return a signal number to induce an artificial signal delivery,
-+ * setting *@info and *@return_ka to specify its details and behavior.
-+ *
-+ * The @return_ka->sa_handler value controls the disposition of the
-+ * signal, no matter the signal number. For %SIG_DFL, the return value
-+ * is a representative signal to indicate the behavior (e.g. %SIGTERM
-+ * for death, %SIGQUIT for core dump, %SIGSTOP for job control stop,
-+ * %SIGTSTP for stop unless in an orphaned pgrp), but the signal number
-+ * reported will be @info->si_signo instead.
-+ *
-+ * Called with @task->sighand->siglock held, before dequeuing pending signals.
-+ */
-+static inline int utrace_hook_signal(struct task_struct *task,
-+ struct pt_regs *regs,
-+ siginfo_t *info,
-+ struct k_sigaction *return_ka)
-+{
-+ if (unlikely(task_utrace_flags(task)))
-+ return utrace_get_signal(task, regs, info, return_ka);
-+ return 0;
-+}
-+
-+#endif /* linux/utrace.h */
-diff --git a/init/Kconfig b/init/Kconfig
-index 3f42cd6..5f4f92e 100644
---- a/init/Kconfig
-+++ b/init/Kconfig
-@@ -386,6 +386,15 @@ config AUDIT_LOGINUID_IMMUTABLE
- one to drop potentially dangerous capabilites from the login tasks,
- but may not be backwards compatible with older init systems.
-
-+config UTRACE
-+ bool "Infrastructure for tracing and debugging user processes"
-+ depends on EXPERIMENTAL
-+ depends on HAVE_ARCH_TRACEHOOK
-+ help
-+ Enable the utrace process tracing interface. This is an internal
-+ kernel interface exported to kernel modules, to track events in
-+ user threads, extract and change user thread state.
-+
- source "kernel/irq/Kconfig"
-
- menu "RCU Subsystem"
-diff --git a/kernel/Makefile b/kernel/Makefile
-index 2d9de86..6c6749d 100644
---- a/kernel/Makefile
-+++ b/kernel/Makefile
-@@ -67,6 +67,7 @@ obj-$(CONFIG_IKCONFIG) += configs.o
- obj-$(CONFIG_RESOURCE_COUNTERS) += res_counter.o
- obj-$(CONFIG_SMP) += stop_machine.o
- obj-$(CONFIG_KPROBES_SANITY_TEST) += test_kprobes.o
-+obj-$(CONFIG_UTRACE) += utrace.o
- obj-$(CONFIG_AUDIT) += audit.o auditfilter.o
- obj-$(CONFIG_AUDITSYSCALL) += auditsc.o
- obj-$(CONFIG_AUDIT_WATCH) += audit_watch.o
-diff --git a/kernel/exit.c b/kernel/exit.c
-index 4b4042f..b1e0518 100644
---- a/kernel/exit.c
-+++ b/kernel/exit.c
-@@ -169,6 +169,8 @@ void release_task(struct task_struct * p)
- struct task_struct *leader;
- int zap_leader;
- repeat:
-+ utrace_release_task(p);
-+
- /* don't need to get the RCU readlock here - the process is dead and
- * can't be modifying its own credentials. But shut RCU-lockdep up */
- rcu_read_lock();
-@@ -857,6 +859,8 @@ static void exit_notify(struct task_struct *tsk, int group_dead)
- wake_up_process(tsk->signal->group_exit_task);
- write_unlock_irq(&tasklist_lock);
-
-+ utrace_exit_notify(tsk, autoreap ? -1 : SIGCHLD, group_dead);
-+
- /* If the process is dead, release it - nobody will wait for it */
- if (autoreap)
- release_task(tsk);
-@@ -910,6 +914,7 @@ void do_exit(long code)
- */
- set_fs(USER_DS);
-
-+ UTRACE_HOOK(current, EXIT, report_exit(&code));
- ptrace_event(PTRACE_EVENT_EXIT, code);
-
- validate_creds_for_do_exit(tsk);
-diff --git a/kernel/fork.c b/kernel/fork.c
-index e2cd3e2..fa40928 100644
---- a/kernel/fork.c
-+++ b/kernel/fork.c
-@@ -67,6 +67,7 @@
- #include <linux/oom.h>
- #include <linux/khugepaged.h>
- #include <linux/signalfd.h>
-+#include <linux/utrace.h>
-
- #include <asm/pgtable.h>
- #include <asm/pgalloc.h>
-@@ -170,6 +171,8 @@ void free_task(struct task_struct *tsk)
- free_thread_info(tsk->stack);
- rt_mutex_debug_task_free(tsk);
- ftrace_graph_exit_task(tsk);
-+ if (task_utrace_struct(tsk))
-+ utrace_free_task(tsk);
- free_task_struct(tsk);
- }
- EXPORT_SYMBOL(free_task);
-@@ -1115,6 +1118,8 @@ static struct task_struct *copy_process(unsigned long clone_flags,
- if (!p)
- goto fork_out;
-
-+ utrace_init_task(p);
-+
- ftrace_graph_init_task(p);
-
- rt_mutex_init_task(p);
-@@ -1583,6 +1583,8 @@ long do_fork(unsigned long clone_flags,
- get_task_struct(p);
- }
-
-+ UTRACE_HOOK(current, CLONE, report_clone(clone_flags, p));
-+
- wake_up_new_task(p);
-
- /* forking complete and child started to run, tell ptracer */
-@@ -1561,6 +1568,8 @@ long do_fork(unsigned long clone_flags,
- wake_up_new_task(p);
-
- /* forking complete and child started to run, tell ptracer */
-+ if (clone_flags & CLONE_VFORK)
-+ UTRACE_HOOK(current, CLONE, finish_vfork(current));
- if (unlikely(trace))
- ptrace_event(trace, nr);
-
-diff --git a/kernel/ptrace.c b/kernel/ptrace.c
-index 00ab2ca..a7024b8 100644
---- a/kernel/ptrace.c
-+++ b/kernel/ptrace.c
-@@ -24,7 +24,34 @@
- #include <linux/regset.h>
- #include <linux/hw_breakpoint.h>
- #include <linux/cn_proc.h>
-+#include <linux/utrace.h>
-
-+void ptrace_signal_wake_up(struct task_struct *p, int quiescent)
-+{
-+ unsigned int state;
-+
-+ set_tsk_thread_flag(p, TIF_SIGPENDING);
-+
-+ state = TASK_INTERRUPTIBLE;
-+ if (quiescent)
-+ state |= (__TASK_STOPPED | __TASK_TRACED);
-+ if (!wake_up_quiescent(p, state))
-+ kick_process(p);
-+}
-+
-+static void ptrace_set_syscall_trace(struct task_struct *p, bool on)
-+{
-+ task_utrace_lock(p);
-+ if (on) {
-+ p->ptrace |= PT_SYSCALL_TRACE;
-+ set_tsk_thread_flag(p, TIF_SYSCALL_TRACE);
-+ } else {
-+ p->ptrace &= ~PT_SYSCALL_TRACE;
-+ if (!(task_utrace_flags(p) & UTRACE_EVENT_SYSCALL))
-+ clear_tsk_thread_flag(p, TIF_SYSCALL_TRACE);
-+ }
-+ task_utrace_unlock(p);
-+}
-
- static int ptrace_trapping_sleep_fn(void *flags)
- {
-@@ -117,7 +144,7 @@ void __ptrace_unlink(struct task_struct *child)
- * TASK_KILLABLE sleeps.
- */
- if (child->jobctl & JOBCTL_STOP_PENDING || task_is_traced(child))
-- signal_wake_up(child, task_is_traced(child));
-+ ptrace_signal_wake_up(child, task_is_traced(child));
-
- spin_unlock(&child->sighand->siglock);
- }
-@@ -315,7 +342,7 @@ static int ptrace_attach(struct task_struct *task, long request,
- */
- if (task_is_stopped(task) &&
- task_set_jobctl_pending(task, JOBCTL_TRAP_STOP | JOBCTL_TRAPPING))
-- signal_wake_up(task, 1);
-+ ptrace_signal_wake_up(task, 1);
-
- spin_unlock(&task->sighand->siglock);
-
-@@ -425,7 +452,7 @@ static int ptrace_detach(struct task_struct *child, unsigned int data)
-
- /* Architecture-specific hardware disable .. */
- ptrace_disable(child);
-- clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
-+ ptrace_set_syscall_trace(child, false);
-
- write_lock_irq(&tasklist_lock);
- /*
-@@ -608,13 +635,12 @@ static int ptrace_setsiginfo(struct task_struct *child, const siginfo_t *info)
- static int ptrace_resume(struct task_struct *child, long request,
- unsigned long data)
- {
-+ unsigned long flags;
-+
- if (!valid_signal(data))
- return -EIO;
-
-- if (request == PTRACE_SYSCALL)
-- set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
-- else
-- clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
-+ ptrace_set_syscall_trace(child, request == PTRACE_SYSCALL);
-
- #ifdef TIF_SYSCALL_EMU
- if (request == PTRACE_SYSEMU || request == PTRACE_SYSEMU_SINGLESTEP)
-@@ -623,20 +649,23 @@ static int ptrace_resume(struct task_struct *child, long request,
- clear_tsk_thread_flag(child, TIF_SYSCALL_EMU);
- #endif
-
-+ child->ptrace &= ~(PT_SINGLE_STEP | PT_SINGLE_BLOCK);
- if (is_singleblock(request)) {
- if (unlikely(!arch_has_block_step()))
- return -EIO;
-- user_enable_block_step(child);
-+ child->ptrace |= PT_SINGLE_BLOCK;
- } else if (is_singlestep(request) || is_sysemu_singlestep(request)) {
- if (unlikely(!arch_has_single_step()))
- return -EIO;
-- user_enable_single_step(child);
-- } else {
-- user_disable_single_step(child);
-+ child->ptrace |= PT_SINGLE_STEP;
- }
-
- child->exit_code = data;
-- wake_up_state(child, __TASK_TRACED);
-+
-+ if (lock_task_sighand(child, &flags)) {
-+ wake_up_quiescent(child, __TASK_TRACED);
-+ unlock_task_sighand(child, &flags);
-+ }
-
- return 0;
- }
-@@ -744,7 +773,7 @@ int ptrace_request(struct task_struct *child, long request,
- * tracee into STOP.
- */
- if (likely(task_set_jobctl_pending(child, JOBCTL_TRAP_STOP)))
-- signal_wake_up(child, child->jobctl & JOBCTL_LISTENING);
-+ ptrace_signal_wake_up(child, child->jobctl & JOBCTL_LISTENING);
-
- unlock_task_sighand(child, &flags);
- ret = 0;
-@@ -770,7 +799,7 @@ int ptrace_request(struct task_struct *child, long request,
- * start of this trap and now. Trigger re-trap.
- */
- if (child->jobctl & JOBCTL_TRAP_NOTIFY)
-- signal_wake_up(child, true);
-+ ptrace_signal_wake_up(child, true);
- ret = 0;
- }
- unlock_task_sighand(child, &flags);
-diff --git a/kernel/sched/core.c b/kernel/sched/core.c
-index 5255c9d..f1719b8 100644
---- a/kernel/sched/core.c
-+++ b/kernel/sched/core.c
-@@ -1167,7 +1167,7 @@ unsigned long wait_task_inactive(struct task_struct *p, long match_state)
- * is actually now running somewhere else!
- */
- while (task_running(rq, p)) {
-- if (match_state && unlikely(p->state != match_state))
-+ if (match_state && !likely(p->state & match_state))
- return 0;
- cpu_relax();
- }
-diff --git a/kernel/signal.c b/kernel/signal.c
-index c73c428..0508d93 100644
---- a/kernel/signal.c
-+++ b/kernel/signal.c
-@@ -88,7 +88,7 @@ static int sig_ignored(struct task_struct *t, int sig, int from_ancestor_ns)
- /*
- * Tracers may want to know about even ignored signals.
- */
-- return !t->ptrace;
-+ return !t->ptrace && !UTRACE_FLAG(t, SIGNAL_IGN);
- }
-
- /*
-@@ -151,6 +151,11 @@ void recalc_sigpending_and_wake(struct task_struct *t)
-
- void recalc_sigpending(void)
- {
-+ if (task_utrace_flags(current) && utrace_interrupt_pending()) {
-+ set_thread_flag(TIF_SIGPENDING);
-+ return;
-+ }
-+
- if (!recalc_sigpending_tsk(current) && !freezing(current))
- clear_thread_flag(TIF_SIGPENDING);
-
-@@ -495,7 +500,7 @@ int unhandled_signal(struct task_struct *tsk, int sig)
- if (handler != SIG_IGN && handler != SIG_DFL)
- return 0;
- /* if ptraced, let the tracer determine */
-- return !tsk->ptrace;
-+ return !tracehook_consider_fatal_signal(tsk, sig);
- }
-
- /*
-@@ -697,6 +702,29 @@ void signal_wake_up(struct task_struct *t, int resume)
- kick_process(t);
- }
-
-+#define STATE_QUIESCENT (__TASK_STOPPED | __TASK_TRACED | __TASK_UTRACED)
-+/*
-+ * wakes up the STOPPED/TRACED task, must be called with ->siglock held.
-+ */
-+int wake_up_quiescent(struct task_struct *p, unsigned int state)
-+{
-+ unsigned int quiescent = (p->state & STATE_QUIESCENT);
-+
-+ WARN_ON(state & ~(STATE_QUIESCENT | TASK_INTERRUPTIBLE));
-+
-+ if (quiescent) {
-+ state &= ~TASK_INTERRUPTIBLE;
-+ if ((quiescent & ~state) != 0) {
-+ p->state &= ~state;
-+ WARN_ON(!(p->state & STATE_QUIESCENT));
-+ WARN_ON(!(p->state & TASK_WAKEKILL));
-+ return 0;
-+ }
-+ }
-+
-+ return wake_up_state(p, state);
-+}
-+
- /*
- * Remove signals in mask from the pending set and queue.
- * Returns 1 if any signals were found.
-@@ -842,7 +870,7 @@ static void ptrace_trap_notify(struct task_struct *t)
- assert_spin_locked(&t->sighand->siglock);
-
- task_set_jobctl_pending(t, JOBCTL_TRAP_NOTIFY);
-- signal_wake_up(t, t->jobctl & JOBCTL_LISTENING);
-+ ptrace_signal_wake_up(t, t->jobctl & JOBCTL_LISTENING);
- }
-
- /*
-@@ -884,7 +912,7 @@ static int prepare_signal(int sig, struct task_struct *p, int from_ancestor_ns)
- task_clear_jobctl_pending(t, JOBCTL_STOP_PENDING);
- rm_from_queue(SIG_KERNEL_STOP_MASK, &t->pending);
- if (likely(!(t->ptrace & PT_SEIZED)))
-- wake_up_state(t, __TASK_STOPPED);
-+ wake_up_quiescent(t, __TASK_STOPPED);
- else
- ptrace_trap_notify(t);
- } while_each_thread(p, t);
-@@ -983,7 +1011,7 @@ static void complete_signal(int sig, struct task_struct *p, int group)
- if (sig_fatal(p, sig) &&
- !(signal->flags & (SIGNAL_UNKILLABLE | SIGNAL_GROUP_EXIT)) &&
- !sigismember(&t->real_blocked, sig) &&
-- (sig == SIGKILL || !t->ptrace)) {
-+ (sig == SIGKILL || !tracehook_consider_fatal_signal(t, sig))) {
- /*
- * This signal will be fatal to the whole group.
- */
-@@ -1913,10 +1941,34 @@ static void ptrace_stop(int exit_code, int why, int clear_code, siginfo_t *info)
- if (gstop_done)
- do_notify_parent_cldstop(current, false, why);
-
-- __set_current_state(TASK_RUNNING);
-+ spin_lock_irq(&current->sighand->siglock);
-+ wake_up_quiescent(current, __TASK_TRACED);
-+ spin_unlock_irq(&current->sighand->siglock);
-+
- if (clear_code)
- current->exit_code = 0;
- read_unlock(&tasklist_lock);
-+
-+ /*
-+ * It is possible that __TASK_UTRACED was added by utrace
-+ * while we were __TASK_TRACED and before we take ->siglock
-+ * for wake_up_quiescent(), we need to block in this case.
-+ * Otherwise this is unnecessary but absolutely harmless.
-+ */
-+ schedule();
-+ }
-+
-+ utrace_end_stop();
-+
-+ if (current->ptrace & PT_SINGLE_BLOCK)
-+ user_enable_block_step(current);
-+ else if (current->ptrace & PT_SINGLE_STEP)
-+ user_enable_single_step(current);
-+ else {
-+ user_disable_single_step(current);
-+ /* if utrace needs the stepping it should reassert */
-+ if (task_utrace_flags(current))
-+ set_thread_flag(TIF_NOTIFY_RESUME);
- }
-
- /*
-@@ -2081,6 +2133,9 @@ static bool do_signal_stop(int signr)
-
- /* Now we don't run again until woken by SIGCONT or SIGKILL */
- schedule();
-+
-+ utrace_end_stop();
-+
- return true;
- } else {
- /*
-@@ -2231,17 +2286,27 @@ relock:
- for (;;) {
- struct k_sigaction *ka;
-
-- if (unlikely(current->jobctl & JOBCTL_STOP_PENDING) &&
-- do_signal_stop(0))
-+ signr = utrace_hook_signal(current, regs, info, return_ka);
-+ if (unlikely(signr < 0))
- goto relock;
-
-- if (unlikely(current->jobctl & JOBCTL_TRAP_MASK)) {
-- do_jobctl_trap();
-- spin_unlock_irq(&sighand->siglock);
-- goto relock;
-- }
-+ if (unlikely(signr != 0))
-+ ka = return_ka;
-+ else {
-+ if (unlikely(current->jobctl & JOBCTL_STOP_PENDING) &&
-+ do_signal_stop(0))
-+ goto relock;
-+
-+ if (unlikely(current->jobctl & JOBCTL_TRAP_MASK)) {
-+ do_jobctl_trap();
-+ spin_unlock_irq(&sighand->siglock);
-+ goto relock;
-+ }
-
-- signr = dequeue_signal(current, &current->blocked, info);
-+ signr = dequeue_signal(current, &current->blocked, info);
-+
-+ ka = &sighand->action[signr-1];
-+ }
-
- if (!signr)
- break; /* will return 0 */
-@@ -2251,9 +2316,9 @@ relock:
- regs, cookie);
- if (!signr)
- continue;
-- }
-
-- ka = &sighand->action[signr-1];
-+ ka = &sighand->action[signr-1];
-+ }
-
- /* Trace actually delivered signals. */
- trace_signal_deliver(signr, info, ka);
-diff --git a/kernel/utrace.c b/kernel/utrace.c
-new file mode 100644
-index 0000000..a169e1b
---- /dev/null
-+++ b/kernel/utrace.c
-@@ -0,0 +1,2466 @@
-+/*
-+ * utrace infrastructure interface for debugging user processes
-+ *
-+ * Copyright (C) 2006-2010 Red Hat, Inc. All rights reserved.
-+ *
-+ * This copyrighted material is made available to anyone wishing to use,
-+ * modify, copy, or redistribute it subject to the terms and conditions
-+ * of the GNU General Public License v.2.
-+ *
-+ * Red Hat Author: Roland McGrath.
-+ */
-+
-+#include <linux/utrace.h>
-+#include <linux/tracehook.h>
-+#include <linux/regset.h>
-+#include <asm/syscall.h>
-+#include <linux/ptrace.h>
-+#include <linux/err.h>
-+#include <linux/sched.h>
-+#include <linux/freezer.h>
-+#include <linux/module.h>
-+#include <linux/init.h>
-+#include <linux/slab.h>
-+#include <linux/seq_file.h>
-+
-+
-+/*
-+ * Per-thread structure private to utrace implementation.
-+ * If task_struct.utrace_flags is nonzero, task_struct.utrace
-+ * has always been allocated first. Once allocated, it is
-+ * never freed until free_task().
-+ *
-+ * The common event reporting loops are done by the task making the
-+ * report without ever taking any locks. To facilitate this, the two
-+ * lists @attached and @attaching work together for smooth asynchronous
-+ * attaching with low overhead. Modifying either list requires @lock.
-+ * The @attaching list can be modified any time while holding @lock.
-+ * New engines being attached always go on this list.
-+ *
-+ * The @attached list is what the task itself uses for its reporting
-+ * loops. When the task itself is not quiescent, it can use the
-+ * @attached list without taking any lock. Nobody may modify the list
-+ * when the task is not quiescent. When it is quiescent, that means
-+ * that it won't run again without taking @lock itself before using
-+ * the list.
-+ *
-+ * At each place where we know the task is quiescent (or it's current),
-+ * while holding @lock, we call splice_attaching(), below. This moves
-+ * the @attaching list members on to the end of the @attached list.
-+ * Since this happens at the start of any reporting pass, any new
-+ * engines attached asynchronously go on the stable @attached list
-+ * in time to have their callbacks seen.
-+ */
-+struct utrace {
-+ spinlock_t lock;
-+ struct list_head attached, attaching;
-+
-+ struct task_struct *cloning;
-+
-+ struct utrace_engine *reporting;
-+
-+ enum utrace_resume_action resume:UTRACE_RESUME_BITS;
-+ unsigned int signal_handler:1;
-+ unsigned int vfork_stop:1; /* need utrace_stop() before vfork wait */
-+ unsigned int death:1; /* in utrace_report_death() now */
-+ unsigned int reap:1; /* release_task() has run */
-+ unsigned int pending_attach:1; /* need splice_attaching() */
-+};
-+
-+static struct kmem_cache *utrace_cachep;
-+static struct kmem_cache *utrace_engine_cachep;
-+static const struct utrace_engine_ops utrace_detached_ops; /* forward decl */
-+
-+static int __init utrace_init(void)
-+{
-+ utrace_cachep = KMEM_CACHE(utrace, SLAB_PANIC);
-+ utrace_engine_cachep = KMEM_CACHE(utrace_engine, SLAB_PANIC);
-+ return 0;
-+}
-+module_init(utrace_init);
-+
-+void task_utrace_lock(struct task_struct *task)
-+{
-+ struct utrace *utrace = task_utrace_struct(task);
-+
-+ if (!utrace) {
-+ task_lock(task);
-+ utrace = task_utrace_struct(task);
-+ if (!utrace)
-+ return;
-+
-+ task_unlock(task);
-+ }
-+
-+ spin_lock(&utrace->lock);
-+}
-+
-+void task_utrace_unlock(struct task_struct *task)
-+{
-+ struct utrace *utrace = task_utrace_struct(task);
-+
-+ if (utrace)
-+ spin_unlock(&utrace->lock);
-+ else
-+ task_unlock(task);
-+}
-+
-+/*
-+ * Set up @task.utrace for the first time. We can have races
-+ * between two utrace_attach_task() calls here. The task_lock()
-+ * governs installing the new pointer. If another one got in first,
-+ * we just punt the new one we allocated.
-+ *
-+ * This returns false only in case of a memory allocation failure.
-+ */
-+static bool utrace_task_alloc(struct task_struct *task, gfp_t gfp_flags)
-+{
-+ struct utrace *utrace = kmem_cache_zalloc(utrace_cachep, gfp_flags);
-+ if (unlikely(!utrace))
-+ return false;
-+ spin_lock_init(&utrace->lock);
-+ INIT_LIST_HEAD(&utrace->attached);
-+ INIT_LIST_HEAD(&utrace->attaching);
-+ utrace->resume = UTRACE_RESUME;
-+ task_lock(task);
-+ if (likely(!task->utrace)) {
-+ /*
-+ * This barrier makes sure the initialization of the struct
-+ * precedes the installation of the pointer. This pairs
-+ * with smp_read_barrier_depends() in task_utrace_struct().
-+ */
-+ smp_wmb();
-+ task->utrace = utrace;
-+ }
-+ task_unlock(task);
-+
-+ if (unlikely(task->utrace != utrace))
-+ kmem_cache_free(utrace_cachep, utrace);
-+ return true;
-+}
-+
-+/*
-+ * This is called via tracehook_free_task() from free_task()
-+ * when @task is being deallocated.
-+ */
-+void utrace_free_task(struct task_struct *task)
-+{
-+ kmem_cache_free(utrace_cachep, task->utrace);
-+}
-+
-+/*
-+ * This is calledwhen the task is safely quiescent, i.e. it won't consult
-+ * utrace->attached without the lock. Move any engines attached
-+ * asynchronously from @utrace->attaching onto the @utrace->attached list.
-+ */
-+static void splice_attaching(struct utrace *utrace)
-+{
-+ lockdep_assert_held(&utrace->lock);
-+ list_splice_tail_init(&utrace->attaching, &utrace->attached);
-+ utrace->pending_attach = 0;
-+}
-+
-+/*
-+ * This is the exported function used by the utrace_engine_put() inline.
-+ */
-+void __utrace_engine_release(struct kref *kref)
-+{
-+ struct utrace_engine *engine = container_of(kref, struct utrace_engine,
-+ kref);
-+ BUG_ON(!list_empty(&engine->entry));
-+ if (engine->release)
-+ (*engine->release)(engine->data);
-+ kmem_cache_free(utrace_engine_cachep, engine);
-+}
-+EXPORT_SYMBOL_GPL(__utrace_engine_release);
-+
-+static bool engine_matches(struct utrace_engine *engine, int flags,
-+ const struct utrace_engine_ops *ops, void *data)
-+{
-+ if ((flags & UTRACE_ATTACH_MATCH_OPS) && engine->ops != ops)
-+ return false;
-+ if ((flags & UTRACE_ATTACH_MATCH_DATA) && engine->data != data)
-+ return false;
-+ return engine->ops && engine->ops != &utrace_detached_ops;
-+}
-+
-+static struct utrace_engine *find_matching_engine(
-+ struct utrace *utrace, int flags,
-+ const struct utrace_engine_ops *ops, void *data)
-+{
-+ struct utrace_engine *engine;
-+ list_for_each_entry(engine, &utrace->attached, entry)
-+ if (engine_matches(engine, flags, ops, data))
-+ return engine;
-+ list_for_each_entry(engine, &utrace->attaching, entry)
-+ if (engine_matches(engine, flags, ops, data))
-+ return engine;
-+ return NULL;
-+}
-+
-+/*
-+ * Enqueue @engine, or maybe don't if UTRACE_ATTACH_EXCLUSIVE.
-+ */
-+static int utrace_add_engine(struct task_struct *target,
-+ struct utrace *utrace,
-+ struct utrace_engine *engine,
-+ int flags,
-+ const struct utrace_engine_ops *ops,
-+ void *data)
-+{
-+ int ret;
-+
-+ spin_lock(&utrace->lock);
-+
-+ ret = -EEXIST;
-+ if ((flags & UTRACE_ATTACH_EXCLUSIVE) &&
-+ unlikely(find_matching_engine(utrace, flags, ops, data)))
-+ goto unlock;
-+
-+ /*
-+ * In case we had no engines before, make sure that
-+ * utrace_flags is not zero. Since we did unlock+lock
-+ * at least once after utrace_task_alloc() installed
-+ * ->utrace, we have the necessary barrier which pairs
-+ * with rmb() in task_utrace_struct().
-+ */
-+ ret = -ESRCH;
-+ if (!target->utrace_flags) {
-+ target->utrace_flags = UTRACE_EVENT(REAP);
-+ /*
-+ * If we race with tracehook_prepare_release_task()
-+ * make sure that either it sees utrace_flags != 0
-+ * or we see exit_state == EXIT_DEAD.
-+ */
-+ smp_mb();
-+ if (unlikely(target->exit_state == EXIT_DEAD)) {
-+ target->utrace_flags = 0;
-+ goto unlock;
-+ }
-+ }
-+
-+ /*
-+ * Put the new engine on the pending ->attaching list.
-+ * Make sure it gets onto the ->attached list by the next
-+ * time it's examined. Setting ->pending_attach ensures
-+ * that start_report() takes the lock and splices the lists
-+ * before the next new reporting pass.
-+ *
-+ * When target == current, it would be safe just to call
-+ * splice_attaching() right here. But if we're inside a
-+ * callback, that would mean the new engine also gets
-+ * notified about the event that precipitated its own
-+ * creation. This is not what the user wants.
-+ */
-+ list_add_tail(&engine->entry, &utrace->attaching);
-+ utrace->pending_attach = 1;
-+ utrace_engine_get(engine);
-+ ret = 0;
-+unlock:
-+ spin_unlock(&utrace->lock);
-+
-+ return ret;
-+}
-+
-+/**
-+ * utrace_attach_task - attach new engine, or look up an attached engine
-+ * @target: thread to attach to
-+ * @flags: flag bits combined with OR, see below
-+ * @ops: callback table for new engine
-+ * @data: engine private data pointer
-+ *
-+ * The caller must ensure that the @target thread does not get freed,
-+ * i.e. hold a ref or be its parent. It is always safe to call this
-+ * on @current, or on the @child pointer in a @report_clone callback.
-+ * For most other cases, it's easier to use utrace_attach_pid() instead.
-+ *
-+ * UTRACE_ATTACH_CREATE:
-+ * Create a new engine. If %UTRACE_ATTACH_CREATE is not specified, you
-+ * only look up an existing engine already attached to the thread.
-+ *
-+ * UTRACE_ATTACH_EXCLUSIVE:
-+ * Attempting to attach a second (matching) engine fails with -%EEXIST.
-+ *
-+ * UTRACE_ATTACH_MATCH_OPS: Only consider engines matching @ops.
-+ * UTRACE_ATTACH_MATCH_DATA: Only consider engines matching @data.
-+ *
-+ * Calls with neither %UTRACE_ATTACH_MATCH_OPS nor %UTRACE_ATTACH_MATCH_DATA
-+ * match the first among any engines attached to @target. That means that
-+ * %UTRACE_ATTACH_EXCLUSIVE in such a call fails with -%EEXIST if there
-+ * are any engines on @target at all.
-+ */
-+struct utrace_engine *utrace_attach_task(
-+ struct task_struct *target, int flags,
-+ const struct utrace_engine_ops *ops, void *data)
-+{
-+ struct utrace *utrace = task_utrace_struct(target);
-+ struct utrace_engine *engine;
-+ gfp_t gfp_flags;
-+ int ret;
-+
-+ if (!(flags & UTRACE_ATTACH_CREATE)) {
-+ if (unlikely(!utrace))
-+ return ERR_PTR(-ENOENT);
-+ spin_lock(&utrace->lock);
-+ engine = find_matching_engine(utrace, flags, ops, data);
-+ if (engine)
-+ utrace_engine_get(engine);
-+ spin_unlock(&utrace->lock);
-+ return engine ?: ERR_PTR(-ENOENT);
-+ }
-+
-+ if (unlikely(!ops) || unlikely(ops == &utrace_detached_ops))
-+ return ERR_PTR(-EINVAL);
-+
-+ if (unlikely(target->flags & PF_KTHREAD))
-+ /*
-+ * Silly kernel, utrace is for users!
-+ */
-+ return ERR_PTR(-EPERM);
-+
-+ gfp_flags = (flags & UTRACE_ATTACH_ATOMIC)
-+ ? GFP_ATOMIC : GFP_KERNEL;
-+
-+ if (!utrace) {
-+ if (unlikely(!utrace_task_alloc(target, gfp_flags)))
-+ return ERR_PTR(-ENOMEM);
-+ utrace = task_utrace_struct(target);
-+ }
-+
-+ engine = kmem_cache_alloc(utrace_engine_cachep, gfp_flags);
-+ if (unlikely(!engine))
-+ return ERR_PTR(-ENOMEM);
-+
-+ /*
-+ * Initialize the new engine structure. It starts out with one ref
-+ * to return. utrace_add_engine() adds another for being attached.
-+ */
-+ kref_init(&engine->kref);
-+ engine->flags = 0;
-+ engine->ops = ops;
-+ engine->data = data;
-+ engine->release = ops->release;
-+
-+ ret = utrace_add_engine(target, utrace, engine, flags, ops, data);
-+
-+ if (unlikely(ret)) {
-+ kmem_cache_free(utrace_engine_cachep, engine);
-+ engine = ERR_PTR(ret);
-+ }
-+
-+
-+ return engine;
-+}
-+EXPORT_SYMBOL_GPL(utrace_attach_task);
-+
-+/**
-+ * utrace_attach_pid - attach new engine, or look up an attached engine
-+ * @pid: &struct pid pointer representing thread to attach to
-+ * @flags: flag bits combined with OR, see utrace_attach_task()
-+ * @ops: callback table for new engine
-+ * @data: engine private data pointer
-+ *
-+ * This is the same as utrace_attach_task(), but takes a &struct pid
-+ * pointer rather than a &struct task_struct pointer. The caller must
-+ * hold a ref on @pid, but does not need to worry about the task
-+ * staying valid. If it's been reaped so that @pid points nowhere,
-+ * then this call returns -%ESRCH.
-+ */
-+struct utrace_engine *utrace_attach_pid(
-+ struct pid *pid, int flags,
-+ const struct utrace_engine_ops *ops, void *data)
-+{
-+ struct utrace_engine *engine = ERR_PTR(-ESRCH);
-+ struct task_struct *task = get_pid_task(pid, PIDTYPE_PID);
-+ if (task) {
-+ engine = utrace_attach_task(task, flags, ops, data);
-+ put_task_struct(task);
-+ }
-+ return engine;
-+}
-+EXPORT_SYMBOL_GPL(utrace_attach_pid);
-+
-+/*
-+ * When an engine is detached, the target thread may still see it and
-+ * make callbacks until it quiesces. We install a special ops vector
-+ * with these two callbacks. When the target thread quiesces, it can
-+ * safely free the engine itself. For any event we will always get
-+ * the report_quiesce() callback first, so we only need this one
-+ * pointer to be set. The only exception is report_reap(), so we
-+ * supply that callback too.
-+ */
-+static u32 utrace_detached_quiesce(u32 action, struct utrace_engine *engine,
-+ unsigned long event)
-+{
-+ return UTRACE_DETACH;
-+}
-+
-+static void utrace_detached_reap(struct utrace_engine *engine,
-+ struct task_struct *task)
-+{
-+}
-+
-+static const struct utrace_engine_ops utrace_detached_ops = {
-+ .report_quiesce = &utrace_detached_quiesce,
-+ .report_reap = &utrace_detached_reap
-+};
-+
-+/*
-+ * The caller has to hold a ref on the engine. If the attached flag is
-+ * true (all but utrace_barrier() calls), the engine is supposed to be
-+ * attached. If the attached flag is false (utrace_barrier() only),
-+ * then return -ERESTARTSYS for an engine marked for detach but not yet
-+ * fully detached. The task pointer can be invalid if the engine is
-+ * detached.
-+ *
-+ * Get the utrace lock for the target task.
-+ * Returns the struct if locked, or ERR_PTR(-errno).
-+ *
-+ * This has to be robust against races with:
-+ * utrace_control(target, UTRACE_DETACH) calls
-+ * UTRACE_DETACH after reports
-+ * utrace_report_death
-+ * utrace_release_task
-+ */
-+static struct utrace *get_utrace_lock(struct task_struct *target,
-+ struct utrace_engine *engine,
-+ bool attached)
-+ __acquires(utrace->lock)
-+{
-+ struct utrace *utrace;
-+
-+ rcu_read_lock();
-+
-+ /*
-+ * If this engine was already detached, bail out before we look at
-+ * the task_struct pointer at all. If it's detached after this
-+ * check, then RCU is still keeping this task_struct pointer valid.
-+ *
-+ * The ops pointer is NULL when the engine is fully detached.
-+ * It's &utrace_detached_ops when it's marked detached but still
-+ * on the list. In the latter case, utrace_barrier() still works,
-+ * since the target might be in the middle of an old callback.
-+ */
-+ if (unlikely(!engine->ops)) {
-+ rcu_read_unlock();
-+ return ERR_PTR(-ESRCH);
-+ }
-+
-+ if (unlikely(engine->ops == &utrace_detached_ops)) {
-+ rcu_read_unlock();
-+ return attached ? ERR_PTR(-ESRCH) : ERR_PTR(-ERESTARTSYS);
-+ }
-+
-+ utrace = task_utrace_struct(target);
-+ spin_lock(&utrace->lock);
-+ if (unlikely(utrace->reap) || unlikely(!engine->ops) ||
-+ unlikely(engine->ops == &utrace_detached_ops)) {
-+ /*
-+ * By the time we got the utrace lock,
-+ * it had been reaped or detached already.
-+ */
-+ spin_unlock(&utrace->lock);
-+ utrace = ERR_PTR(-ESRCH);
-+ if (!attached && engine->ops == &utrace_detached_ops)
-+ utrace = ERR_PTR(-ERESTARTSYS);
-+ }
-+ rcu_read_unlock();
-+
-+ return utrace;
-+}
-+
-+/*
-+ * Now that we don't hold any locks, run through any
-+ * detached engines and free their references. Each
-+ * engine had one implicit ref while it was attached.
-+ */
-+static void put_detached_list(struct list_head *list)
-+{
-+ struct utrace_engine *engine, *next;
-+ list_for_each_entry_safe(engine, next, list, entry) {
-+ list_del_init(&engine->entry);
-+ utrace_engine_put(engine);
-+ }
-+}
-+
-+/*
-+ * We use an extra bit in utrace_engine.flags past the event bits,
-+ * to record whether the engine is keeping the target thread stopped.
-+ *
-+ * This bit is set in task_struct.utrace_flags whenever it is set in any
-+ * engine's flags. Only utrace_reset() resets it in utrace_flags.
-+ */
-+#define ENGINE_STOP (1UL << _UTRACE_NEVENTS)
-+
-+#define task_is_utraced(task) ((task->state & __TASK_UTRACED) != 0)
-+
-+static void mark_engine_wants_stop(struct task_struct *task,
-+ struct utrace_engine *engine)
-+{
-+ engine->flags |= ENGINE_STOP;
-+ task->utrace_flags |= ENGINE_STOP;
-+}
-+
-+static void clear_engine_wants_stop(struct utrace_engine *engine)
-+{
-+ engine->flags &= ~ENGINE_STOP;
-+}
-+
-+static bool engine_wants_stop(struct utrace_engine *engine)
-+{
-+ return (engine->flags & ENGINE_STOP) != 0;
-+}
-+
-+/**
-+ * utrace_set_events - choose which event reports a tracing engine gets
-+ * @target: thread to affect
-+ * @engine: attached engine to affect
-+ * @events: new event mask
-+ *
-+ * This changes the set of events for which @engine wants callbacks made.
-+ *
-+ * This fails with -%EALREADY and does nothing if you try to clear
-+ * %UTRACE_EVENT(%DEATH) when the @report_death callback may already have
-+ * begun, or if you try to newly set %UTRACE_EVENT(%DEATH) or
-+ * %UTRACE_EVENT(%QUIESCE) when @target is already dead or dying.
-+ *
-+ * This fails with -%ESRCH if you try to clear %UTRACE_EVENT(%REAP) when
-+ * the @report_reap callback may already have begun, or when @target has
-+ * already been detached, including forcible detach on reaping.
-+ *
-+ * If @target was stopped before the call, then after a successful call,
-+ * no event callbacks not requested in @events will be made; if
-+ * %UTRACE_EVENT(%QUIESCE) is included in @events, then a
-+ * @report_quiesce callback will be made when @target resumes.
-+ *
-+ * If @target was not stopped and @events excludes some bits that were
-+ * set before, this can return -%EINPROGRESS to indicate that @target
-+ * may have been making some callback to @engine. When this returns
-+ * zero, you can be sure that no event callbacks you've disabled in
-+ * @events can be made. If @events only sets new bits that were not set
-+ * before on @engine, then -%EINPROGRESS will never be returned.
-+ *
-+ * To synchronize after an -%EINPROGRESS return, see utrace_barrier().
-+ *
-+ * When @target is @current, -%EINPROGRESS is not returned. But note
-+ * that a newly-created engine will not receive any callbacks related to
-+ * an event notification already in progress. This call enables @events
-+ * callbacks to be made as soon as @engine becomes eligible for any
-+ * callbacks, see utrace_attach_task().
-+ *
-+ * These rules provide for coherent synchronization based on %UTRACE_STOP,
-+ * even when %SIGKILL is breaking its normal simple rules.
-+ */
-+int utrace_set_events(struct task_struct *target,
-+ struct utrace_engine *engine,
-+ unsigned long events)
-+{
-+ struct utrace *utrace;
-+ unsigned long old_flags, old_utrace_flags;
-+ int ret = -EALREADY;
-+
-+ /*
-+ * We just ignore the internal bit, so callers can use
-+ * engine->flags to seed bitwise ops for our argument.
-+ */
-+ events &= ~ENGINE_STOP;
-+
-+ utrace = get_utrace_lock(target, engine, true);
-+ if (unlikely(IS_ERR(utrace)))
-+ return PTR_ERR(utrace);
-+
-+ old_utrace_flags = target->utrace_flags;
-+ old_flags = engine->flags & ~ENGINE_STOP;
-+
-+ /*
-+ * If utrace_report_death() is already progress now,
-+ * it's too late to clear the death event bits.
-+ */
-+ if (((old_flags & ~events) & _UTRACE_DEATH_EVENTS) && utrace->death)
-+ goto unlock;
-+
-+ /*
-+ * When setting these flags, it's essential that we really
-+ * synchronize with exit_notify(). They cannot be set after
-+ * exit_notify() takes the tasklist_lock. By holding the read
-+ * lock here while setting the flags, we ensure that the calls
-+ * to tracehook_notify_death() and tracehook_report_death() will
-+ * see the new flags. This ensures that utrace_release_task()
-+ * knows positively that utrace_report_death() will be called or
-+ * that it won't.
-+ */
-+ if ((events & ~old_flags) & _UTRACE_DEATH_EVENTS) {
-+ read_lock(&tasklist_lock);
-+ if (unlikely(target->exit_state)) {
-+ read_unlock(&tasklist_lock);
-+ goto unlock;
-+ }
-+ target->utrace_flags |= events;
-+ read_unlock(&tasklist_lock);
-+ }
-+
-+ engine->flags = events | (engine->flags & ENGINE_STOP);
-+ target->utrace_flags |= events;
-+
-+ if ((events & UTRACE_EVENT_SYSCALL) &&
-+ !(old_utrace_flags & UTRACE_EVENT_SYSCALL))
-+ set_tsk_thread_flag(target, TIF_SYSCALL_TRACE);
-+
-+ ret = 0;
-+ if ((old_flags & ~events) && target != current &&
-+ !task_is_utraced(target) && !target->exit_state) {
-+ /*
-+ * This barrier ensures that our engine->flags changes
-+ * have hit before we examine utrace->reporting,
-+ * pairing with the barrier in start_callback(). If
-+ * @target has not yet hit finish_callback() to clear
-+ * utrace->reporting, we might be in the middle of a
-+ * callback to @engine.
-+ */
-+ smp_mb();
-+ if (utrace->reporting == engine)
-+ ret = -EINPROGRESS;
-+ }
-+unlock:
-+ spin_unlock(&utrace->lock);
-+
-+ return ret;
-+}
-+EXPORT_SYMBOL_GPL(utrace_set_events);
-+
-+/*
-+ * Asynchronously mark an engine as being detached.
-+ *
-+ * This must work while the target thread races with us doing
-+ * start_callback(), defined below. It uses smp_rmb() between checking
-+ * @engine->flags and using @engine->ops. Here we change @engine->ops
-+ * first, then use smp_wmb() before changing @engine->flags. This ensures
-+ * it can check the old flags before using the old ops, or check the old
-+ * flags before using the new ops, or check the new flags before using the
-+ * new ops, but can never check the new flags before using the old ops.
-+ * Hence, utrace_detached_ops might be used with any old flags in place.
-+ * It has report_quiesce() and report_reap() callbacks to handle all cases.
-+ */
-+static void mark_engine_detached(struct utrace_engine *engine)
-+{
-+ engine->ops = &utrace_detached_ops;
-+ smp_wmb();
-+ engine->flags = UTRACE_EVENT(QUIESCE);
-+}
-+
-+/*
-+ * Get @target to stop and return true if it is already stopped now.
-+ * If we return false, it will make some event callback soonish.
-+ * Called with @utrace locked.
-+ */
-+static bool utrace_do_stop(struct task_struct *target, struct utrace *utrace)
-+{
-+ if (task_is_stopped_or_traced(target)) {
-+ /*
-+ * Stopped is considered quiescent; when it wakes up, it will
-+ * go through utrace_finish_stop() before doing anything else.
-+ */
-+ spin_lock_irq(&target->sighand->siglock);
-+ if (likely(task_is_stopped_or_traced(target)))
-+ target->state |= TASK_UTRACED;
-+ spin_unlock_irq(&target->sighand->siglock);
-+ } else if (utrace->resume > UTRACE_REPORT) {
-+ utrace->resume = UTRACE_REPORT;
-+ set_notify_resume(target);
-+ }
-+
-+ return task_is_utraced(target);
-+}
-+
-+/*
-+ * If the target is not dead it should not be in tracing
-+ * stop any more. Wake it unless it's in job control stop.
-+ */
-+static void utrace_wakeup(struct task_struct *target, struct utrace *utrace)
-+{
-+ lockdep_assert_held(&utrace->lock);
-+ spin_lock_irq(&target->sighand->siglock);
-+ wake_up_quiescent(target, __TASK_UTRACED);
-+ spin_unlock_irq(&target->sighand->siglock);
-+}
-+
-+/*
-+ * This is called when there might be some detached engines on the list or
-+ * some stale bits in @task->utrace_flags. Clean them up and recompute the
-+ * flags. Returns true if we're now fully detached.
-+ *
-+ * Called with @utrace->lock held, returns with it released.
-+ * After this returns, @utrace might be freed if everything detached.
-+ */
-+static bool utrace_reset(struct task_struct *task, struct utrace *utrace)
-+ __releases(utrace->lock)
-+{
-+ struct utrace_engine *engine, *next;
-+ unsigned long flags = 0;
-+ LIST_HEAD(detached);
-+
-+ splice_attaching(utrace);
-+
-+ /*
-+ * Update the set of events of interest from the union
-+ * of the interests of the remaining tracing engines.
-+ * For any engine marked detached, remove it from the list.
-+ * We'll collect them on the detached list.
-+ */
-+ list_for_each_entry_safe(engine, next, &utrace->attached, entry) {
-+ if (engine->ops == &utrace_detached_ops) {
-+ engine->ops = NULL;
-+ list_move(&engine->entry, &detached);
-+ } else {
-+ flags |= engine->flags | UTRACE_EVENT(REAP);
-+ }
-+ }
-+
-+ if (task->exit_state) {
-+ /*
-+ * Once it's already dead, we never install any flags
-+ * except REAP. When ->exit_state is set and events
-+ * like DEATH are not set, then they never can be set.
-+ * This ensures that utrace_release_task() knows
-+ * positively that utrace_report_death() can never run.
-+ */
-+ BUG_ON(utrace->death);
-+ flags &= UTRACE_EVENT(REAP);
-+ } else if (!(flags & UTRACE_EVENT_SYSCALL) &&
-+ !(task->ptrace & PT_SYSCALL_TRACE) &&
-+ test_tsk_thread_flag(task, TIF_SYSCALL_TRACE)) {
-+ clear_tsk_thread_flag(task, TIF_SYSCALL_TRACE);
-+ }
-+
-+ if (!flags) {
-+ /*
-+ * No more engines, cleared out the utrace.
-+ */
-+ utrace->resume = UTRACE_RESUME;
-+ utrace->signal_handler = 0;
-+ }
-+
-+ /*
-+ * If no more engines want it stopped, wake it up.
-+ */
-+ if (task_is_utraced(task) && !(flags & ENGINE_STOP)) {
-+ /*
-+ * It just resumes, so make sure single-step
-+ * is not left set.
-+ */
-+ if (utrace->resume == UTRACE_RESUME)
-+ user_disable_single_step(task);
-+ utrace_wakeup(task, utrace);
-+ }
-+
-+ /*
-+ * In theory spin_lock() doesn't imply rcu_read_lock().
-+ * Once we clear ->utrace_flags this task_struct can go away
-+ * because tracehook_prepare_release_task() path does not take
-+ * utrace->lock when ->utrace_flags == 0.
-+ */
-+ rcu_read_lock();
-+ task->utrace_flags = flags;
-+ spin_unlock(&utrace->lock);
-+ rcu_read_unlock();
-+
-+ put_detached_list(&detached);
-+
-+ return !flags;
-+}
-+
-+void utrace_finish_stop(void)
-+{
-+ /*
-+ * If we were task_is_utraced() and then SIGKILL'ed, make
-+ * sure we do nothing until the tracer drops utrace->lock.
-+ */
-+ if (unlikely(__fatal_signal_pending(current))) {
-+ struct utrace *utrace = task_utrace_struct(current);
-+ spin_unlock_wait(&utrace->lock);
-+ }
-+}
-+
-+/*
-+ * Perform %UTRACE_STOP, i.e. block in TASK_UTRACED until woken up.
-+ * @task == current, @utrace == current->utrace, which is not locked.
-+ * Return true if we were woken up by SIGKILL even though some utrace
-+ * engine may still want us to stay stopped.
-+ */
-+static void utrace_stop(struct task_struct *task, struct utrace *utrace,
-+ enum utrace_resume_action action)
-+{
-+relock:
-+ spin_lock(&utrace->lock);
-+
-+ if (action < utrace->resume) {
-+ /*
-+ * Ensure a reporting pass when we're resumed.
-+ */
-+ utrace->resume = action;
-+ if (action == UTRACE_INTERRUPT)
-+ set_thread_flag(TIF_SIGPENDING);
-+ else
-+ set_thread_flag(TIF_NOTIFY_RESUME);
-+ }
-+
-+ /*
-+ * If the ENGINE_STOP bit is clear in utrace_flags, that means
-+ * utrace_reset() ran after we processed some UTRACE_STOP return
-+ * values from callbacks to get here. If all engines have detached
-+ * or resumed us, we don't stop. This check doesn't require
-+ * siglock, but it should follow the interrupt/report bookkeeping
-+ * steps (this can matter for UTRACE_RESUME but not UTRACE_DETACH).
-+ */
-+ if (unlikely(!(task->utrace_flags & ENGINE_STOP))) {
-+ utrace_reset(task, utrace);
-+ if (task->utrace_flags & ENGINE_STOP)
-+ goto relock;
-+ return;
-+ }
-+
-+ /*
-+ * The siglock protects us against signals. As well as SIGKILL
-+ * waking us up, we must synchronize with the signal bookkeeping
-+ * for stop signals and SIGCONT.
-+ */
-+ spin_lock_irq(&task->sighand->siglock);
-+
-+ if (unlikely(__fatal_signal_pending(task))) {
-+ spin_unlock_irq(&task->sighand->siglock);
-+ spin_unlock(&utrace->lock);
-+ return;
-+ }
-+
-+ __set_current_state(TASK_UTRACED);
-+
-+ spin_unlock_irq(&task->sighand->siglock);
-+ spin_unlock(&utrace->lock);
-+
-+ schedule();
-+
-+ utrace_finish_stop();
-+
-+ /*
-+ * While in TASK_UTRACED, we were considered "frozen enough".
-+ * Now that we woke up, it's crucial if we're supposed to be
-+ * frozen that we freeze now before running anything substantial.
-+ */
-+ try_to_freeze();
-+
-+ /*
-+ * While we were in TASK_UTRACED, complete_signal() considered
-+ * us "uninterested" in signal wakeups. Now make sure our
-+ * TIF_SIGPENDING state is correct for normal running.
-+ */
-+ spin_lock_irq(&task->sighand->siglock);
-+ recalc_sigpending();
-+ spin_unlock_irq(&task->sighand->siglock);
-+}
-+
-+/*
-+ * Called by release_task() with @reap set to true.
-+ * Called by utrace_report_death() with @reap set to false.
-+ * On reap, make report_reap callbacks and clean out @utrace
-+ * unless still making callbacks. On death, update bookkeeping
-+ * and handle the reap work if release_task() came in first.
-+ */
-+void utrace_maybe_reap(struct task_struct *target, struct utrace *utrace,
-+ bool reap)
-+{
-+ struct utrace_engine *engine, *next;
-+ struct list_head attached;
-+
-+ spin_lock(&utrace->lock);
-+
-+ if (reap) {
-+ /*
-+ * If the target will do some final callbacks but hasn't
-+ * finished them yet, we know because it clears these event
-+ * bits after it's done. Instead of cleaning up here and
-+ * requiring utrace_report_death() to cope with it, we
-+ * delay the REAP report and the teardown until after the
-+ * target finishes its death reports.
-+ */
-+ utrace->reap = 1;
-+
-+ if (target->utrace_flags & _UTRACE_DEATH_EVENTS) {
-+ spin_unlock(&utrace->lock);
-+ return;
-+ }
-+ } else {
-+ /*
-+ * After we unlock with this flag clear, any competing
-+ * utrace_control/utrace_set_events calls know that we've
-+ * finished our callbacks and any detach bookkeeping.
-+ */
-+ utrace->death = 0;
-+
-+ if (!utrace->reap) {
-+ /*
-+ * We're just dead, not reaped yet. This will
-+ * reset @target->utrace_flags so the later call
-+ * with @reap set won't hit the check above.
-+ */
-+ utrace_reset(target, utrace);
-+ return;
-+ }
-+ }
-+
-+ /*
-+ * utrace_add_engine() checks ->utrace_flags != 0. Since
-+ * @utrace->reap is set, nobody can set or clear UTRACE_EVENT(REAP)
-+ * in @engine->flags or change @engine->ops and nobody can change
-+ * @utrace->attached after we drop the lock.
-+ */
-+ target->utrace_flags = 0;
-+
-+ /*
-+ * We clear out @utrace->attached before we drop the lock so
-+ * that find_matching_engine() can't come across any old engine
-+ * while we are busy tearing it down.
-+ */
-+ list_replace_init(&utrace->attached, &attached);
-+ list_splice_tail_init(&utrace->attaching, &attached);
-+
-+ spin_unlock(&utrace->lock);
-+
-+ list_for_each_entry_safe(engine, next, &attached, entry) {
-+ if (engine->flags & UTRACE_EVENT(REAP))
-+ engine->ops->report_reap(engine, target);
-+
-+ engine->ops = NULL;
-+ engine->flags = 0;
-+ list_del_init(&engine->entry);
-+
-+ utrace_engine_put(engine);
-+ }
-+}
-+
-+/*
-+ * You can't do anything to a dead task but detach it.
-+ * If release_task() has been called, you can't do that.
-+ *
-+ * On the exit path, DEATH and QUIESCE event bits are set only
-+ * before utrace_report_death() has taken the lock. At that point,
-+ * the death report will come soon, so disallow detach until it's
-+ * done. This prevents us from racing with it detaching itself.
-+ *
-+ * Called only when @target->exit_state is nonzero.
-+ */
-+static inline int utrace_control_dead(struct task_struct *target,
-+ struct utrace *utrace,
-+ enum utrace_resume_action action)
-+{
-+ lockdep_assert_held(&utrace->lock);
-+
-+ if (action != UTRACE_DETACH || unlikely(utrace->reap))
-+ return -ESRCH;
-+
-+ if (unlikely(utrace->death))
-+ /*
-+ * We have already started the death report. We can't
-+ * prevent the report_death and report_reap callbacks,
-+ * so tell the caller they will happen.
-+ */
-+ return -EALREADY;
-+
-+ return 0;
-+}
-+
-+/**
-+ * utrace_control - control a thread being traced by a tracing engine
-+ * @target: thread to affect
-+ * @engine: attached engine to affect
-+ * @action: &enum utrace_resume_action for thread to do
-+ *
-+ * This is how a tracing engine asks a traced thread to do something.
-+ * This call is controlled by the @action argument, which has the
-+ * same meaning as the &enum utrace_resume_action value returned by
-+ * event reporting callbacks.
-+ *
-+ * If @target is already dead (@target->exit_state nonzero),
-+ * all actions except %UTRACE_DETACH fail with -%ESRCH.
-+ *
-+ * The following sections describe each option for the @action argument.
-+ *
-+ * UTRACE_DETACH:
-+ *
-+ * After this, the @engine data structure is no longer accessible,
-+ * and the thread might be reaped. The thread will start running
-+ * again if it was stopped and no longer has any attached engines
-+ * that want it stopped.
-+ *
-+ * If the @report_reap callback may already have begun, this fails
-+ * with -%ESRCH. If the @report_death callback may already have
-+ * begun, this fails with -%EALREADY.
-+ *
-+ * If @target is not already stopped, then a callback to this engine
-+ * might be in progress or about to start on another CPU. If so,
-+ * then this returns -%EINPROGRESS; the detach happens as soon as
-+ * the pending callback is finished. To synchronize after an
-+ * -%EINPROGRESS return, see utrace_barrier().
-+ *
-+ * If @target is properly stopped before utrace_control() is called,
-+ * then after successful return it's guaranteed that no more callbacks
-+ * to the @engine->ops vector will be made.
-+ *
-+ * The only exception is %SIGKILL (and exec or group-exit by another
-+ * thread in the group), which can cause asynchronous @report_death
-+ * and/or @report_reap callbacks even when %UTRACE_STOP was used.
-+ * (In that event, this fails with -%ESRCH or -%EALREADY, see above.)
-+ *
-+ * UTRACE_STOP:
-+ *
-+ * This asks that @target stop running. This returns 0 only if
-+ * @target is already stopped, either for tracing or for job
-+ * control. Then @target will remain stopped until another
-+ * utrace_control() call is made on @engine; @target can be woken
-+ * only by %SIGKILL (or equivalent, such as exec or termination by
-+ * another thread in the same thread group).
-+ *
-+ * This returns -%EINPROGRESS if @target is not already stopped.
-+ * Then the effect is like %UTRACE_REPORT. A @report_quiesce or
-+ * @report_signal callback will be made soon. Your callback can
-+ * then return %UTRACE_STOP to keep @target stopped.
-+ *
-+ * This does not interrupt system calls in progress, including ones
-+ * that sleep for a long time. For that, use %UTRACE_INTERRUPT.
-+ * To interrupt system calls and then keep @target stopped, your
-+ * @report_signal callback can return %UTRACE_STOP.
-+ *
-+ * UTRACE_RESUME:
-+ *
-+ * Just let @target continue running normally, reversing the effect
-+ * of a previous %UTRACE_STOP. If another engine is keeping @target
-+ * stopped, then it remains stopped until all engines let it resume.
-+ * If @target was not stopped, this has no effect.
-+ *
-+ * UTRACE_REPORT:
-+ *
-+ * This is like %UTRACE_RESUME, but also ensures that there will be
-+ * a @report_quiesce or @report_signal callback made soon. If
-+ * @target had been stopped, then there will be a callback before it
-+ * resumes running normally. If another engine is keeping @target
-+ * stopped, then there might be no callbacks until all engines let
-+ * it resume.
-+ *
-+ * Since this is meaningless unless @report_quiesce callbacks will
-+ * be made, it returns -%EINVAL if @engine lacks %UTRACE_EVENT(%QUIESCE).
-+ *
-+ * UTRACE_INTERRUPT:
-+ *
-+ * This is like %UTRACE_REPORT, but ensures that @target will make a
-+ * @report_signal callback before it resumes or delivers signals.
-+ * If @target was in a system call or about to enter one, work in
-+ * progress will be interrupted as if by %SIGSTOP. If another
-+ * engine is keeping @target stopped, then there might be no
-+ * callbacks until all engines let it resume.
-+ *
-+ * This gives @engine an opportunity to introduce a forced signal
-+ * disposition via its @report_signal callback.
-+ *
-+ * UTRACE_SINGLESTEP:
-+ *
-+ * It's invalid to use this unless arch_has_single_step() returned true.
-+ * This is like %UTRACE_RESUME, but resumes for one user instruction only.
-+ *
-+ * Note that passing %UTRACE_SINGLESTEP or %UTRACE_BLOCKSTEP to
-+ * utrace_control() or returning it from an event callback alone does
-+ * not necessarily ensure that stepping will be enabled. If there are
-+ * more callbacks made to any engine before returning to user mode,
-+ * then the resume action is chosen only by the last set of callbacks.
-+ * To be sure, enable %UTRACE_EVENT(%QUIESCE) and look for the
-+ * @report_quiesce callback with a zero event mask, or the
-+ * @report_signal callback with %UTRACE_SIGNAL_REPORT.
-+ *
-+ * Since this is not robust unless @report_quiesce callbacks will
-+ * be made, it returns -%EINVAL if @engine lacks %UTRACE_EVENT(%QUIESCE).
-+ *
-+ * UTRACE_BLOCKSTEP:
-+ *
-+ * It's invalid to use this unless arch_has_block_step() returned true.
-+ * This is like %UTRACE_SINGLESTEP, but resumes for one whole basic
-+ * block of user instructions.
-+ *
-+ * Since this is not robust unless @report_quiesce callbacks will
-+ * be made, it returns -%EINVAL if @engine lacks %UTRACE_EVENT(%QUIESCE).
-+ *
-+ * %UTRACE_BLOCKSTEP devolves to %UTRACE_SINGLESTEP when another
-+ * tracing engine is using %UTRACE_SINGLESTEP at the same time.
-+ */
-+int utrace_control(struct task_struct *target,
-+ struct utrace_engine *engine,
-+ enum utrace_resume_action action)
-+{
-+ struct utrace *utrace;
-+ bool reset;
-+ int ret;
-+
-+ if (unlikely(action >= UTRACE_RESUME_MAX)) {
-+ WARN(1, "invalid action argument to utrace_control()!");
-+ return -EINVAL;
-+ }
-+
-+ /*
-+ * This is a sanity check for a programming error in the caller.
-+ * Their request can only work properly in all cases by relying on
-+ * a follow-up callback, but they didn't set one up! This check
-+ * doesn't do locking, but it shouldn't matter. The caller has to
-+ * be synchronously sure the callback is set up to be operating the
-+ * interface properly.
-+ */
-+ if (action >= UTRACE_REPORT && action < UTRACE_RESUME &&
-+ unlikely(!(engine->flags & UTRACE_EVENT(QUIESCE)))) {
-+ WARN(1, "utrace_control() with no QUIESCE callback in place!");
-+ return -EINVAL;
-+ }
-+
-+ utrace = get_utrace_lock(target, engine, true);
-+ if (unlikely(IS_ERR(utrace)))
-+ return PTR_ERR(utrace);
-+
-+ reset = task_is_utraced(target);
-+ ret = 0;
-+
-+ /*
-+ * ->exit_state can change under us, this doesn't matter.
-+ * We do not care about ->exit_state in fact, but we do
-+ * care about ->reap and ->death. If either flag is set,
-+ * we must also see ->exit_state != 0.
-+ */
-+ if (unlikely(target->exit_state)) {
-+ ret = utrace_control_dead(target, utrace, action);
-+ if (ret) {
-+ spin_unlock(&utrace->lock);
-+ return ret;
-+ }
-+ reset = true;
-+ }
-+
-+ switch (action) {
-+ case UTRACE_STOP:
-+ mark_engine_wants_stop(target, engine);
-+ if (!reset && !utrace_do_stop(target, utrace))
-+ ret = -EINPROGRESS;
-+ reset = false;
-+ break;
-+
-+ case UTRACE_DETACH:
-+ if (engine_wants_stop(engine))
-+ target->utrace_flags &= ~ENGINE_STOP;
-+ mark_engine_detached(engine);
-+ reset = reset || utrace_do_stop(target, utrace);
-+ if (!reset) {
-+ /*
-+ * As in utrace_set_events(), this barrier ensures
-+ * that our engine->flags changes have hit before we
-+ * examine utrace->reporting, pairing with the barrier
-+ * in start_callback(). If @target has not yet hit
-+ * finish_callback() to clear utrace->reporting, we
-+ * might be in the middle of a callback to @engine.
-+ */
-+ smp_mb();
-+ if (utrace->reporting == engine)
-+ ret = -EINPROGRESS;
-+ }
-+ break;
-+
-+ case UTRACE_RESUME:
-+ clear_engine_wants_stop(engine);
-+ break;
-+
-+ case UTRACE_BLOCKSTEP:
-+ /*
-+ * Resume from stopped, step one block.
-+ * We fall through to treat it like UTRACE_SINGLESTEP.
-+ */
-+ if (unlikely(!arch_has_block_step())) {
-+ WARN(1, "UTRACE_BLOCKSTEP when !arch_has_block_step()");
-+ action = UTRACE_SINGLESTEP;
-+ }
-+
-+ case UTRACE_SINGLESTEP:
-+ /*
-+ * Resume from stopped, step one instruction.
-+ * We fall through to the UTRACE_REPORT case.
-+ */
-+ if (unlikely(!arch_has_single_step())) {
-+ WARN(1,
-+ "UTRACE_SINGLESTEP when !arch_has_single_step()");
-+ reset = false;
-+ ret = -EOPNOTSUPP;
-+ break;
-+ }
-+
-+ case UTRACE_REPORT:
-+ /*
-+ * Make the thread call tracehook_notify_resume() soon.
-+ * But don't bother if it's already been interrupted.
-+ * In that case, utrace_get_signal() will be reporting soon.
-+ */
-+ clear_engine_wants_stop(engine);
-+ if (action < utrace->resume) {
-+ utrace->resume = action;
-+ set_notify_resume(target);
-+ }
-+ break;
-+
-+ case UTRACE_INTERRUPT:
-+ /*
-+ * Make the thread call tracehook_get_signal() soon.
-+ */
-+ clear_engine_wants_stop(engine);
-+ if (utrace->resume == UTRACE_INTERRUPT)
-+ break;
-+ utrace->resume = UTRACE_INTERRUPT;
-+
-+ /*
-+ * If it's not already stopped, interrupt it now. We need
-+ * the siglock here in case it calls recalc_sigpending()
-+ * and clears its own TIF_SIGPENDING. By taking the lock,
-+ * we've serialized any later recalc_sigpending() after our
-+ * setting of utrace->resume to force it on.
-+ */
-+ if (reset) {
-+ /*
-+ * This is really just to keep the invariant that
-+ * TIF_SIGPENDING is set with UTRACE_INTERRUPT.
-+ * When it's stopped, we know it's always going
-+ * through utrace_get_signal() and will recalculate.
-+ */
-+ set_tsk_thread_flag(target, TIF_SIGPENDING);
-+ } else {
-+ struct sighand_struct *sighand;
-+ unsigned long irqflags;
-+ sighand = lock_task_sighand(target, &irqflags);
-+ if (likely(sighand)) {
-+ signal_wake_up(target, 0);
-+ unlock_task_sighand(target, &irqflags);
-+ }
-+ }
-+ break;
-+
-+ default:
-+ BUG(); /* We checked it on entry. */
-+ }
-+
-+ /*
-+ * Let the thread resume running. If it's not stopped now,
-+ * there is nothing more we need to do.
-+ */
-+ if (reset)
-+ utrace_reset(target, utrace);
-+ else
-+ spin_unlock(&utrace->lock);
-+
-+ return ret;
-+}
-+EXPORT_SYMBOL_GPL(utrace_control);
-+
-+/**
-+ * utrace_barrier - synchronize with simultaneous tracing callbacks
-+ * @target: thread to affect
-+ * @engine: engine to affect (can be detached)
-+ *
-+ * This blocks while @target might be in the midst of making a callback to
-+ * @engine. It can be interrupted by signals and will return -%ERESTARTSYS.
-+ * A return value of zero means no callback from @target to @engine was
-+ * in progress. Any effect of its return value (such as %UTRACE_STOP) has
-+ * already been applied to @engine.
-+ *
-+ * It's not necessary to keep the @target pointer alive for this call.
-+ * It's only necessary to hold a ref on @engine. This will return
-+ * safely even if @target has been reaped and has no task refs.
-+ *
-+ * A successful return from utrace_barrier() guarantees its ordering
-+ * with respect to utrace_set_events() and utrace_control() calls. If
-+ * @target was not properly stopped, event callbacks just disabled might
-+ * still be in progress; utrace_barrier() waits until there is no chance
-+ * an unwanted callback can be in progress.
-+ */
-+int utrace_barrier(struct task_struct *target, struct utrace_engine *engine)
-+{
-+ struct utrace *utrace;
-+ int ret = -ERESTARTSYS;
-+
-+ if (unlikely(target == current))
-+ return 0;
-+
-+ do {
-+ utrace = get_utrace_lock(target, engine, false);
-+ if (unlikely(IS_ERR(utrace))) {
-+ ret = PTR_ERR(utrace);
-+ if (ret != -ERESTARTSYS)
-+ break;
-+ } else {
-+ /*
-+ * All engine state changes are done while
-+ * holding the lock, i.e. before we get here.
-+ * Since we have the lock, we only need to
-+ * worry about @target making a callback.
-+ * When it has entered start_callback() but
-+ * not yet gotten to finish_callback(), we
-+ * will see utrace->reporting == @engine.
-+ * When @target doesn't take the lock, it uses
-+ * barriers to order setting utrace->reporting
-+ * before it examines the engine state.
-+ */
-+ if (utrace->reporting != engine)
-+ ret = 0;
-+ spin_unlock(&utrace->lock);
-+ if (!ret)
-+ break;
-+ }
-+ schedule_timeout_interruptible(1);
-+ } while (!signal_pending(current));
-+
-+ return ret;
-+}
-+EXPORT_SYMBOL_GPL(utrace_barrier);
-+
-+/*
-+ * This is local state used for reporting loops, perhaps optimized away.
-+ */
-+struct utrace_report {
-+ u32 result;
-+ enum utrace_resume_action action;
-+ enum utrace_resume_action resume_action;
-+ bool detaches;
-+ bool spurious;
-+};
-+
-+#define INIT_REPORT(var) \
-+ struct utrace_report var = { \
-+ .action = UTRACE_RESUME, \
-+ .resume_action = UTRACE_RESUME, \
-+ .spurious = true \
-+ }
-+
-+/*
-+ * We are now making the report, so clear the flag saying we need one.
-+ * When there is a new attach, ->pending_attach is set just so we will
-+ * know to do splice_attaching() here before the callback loop.
-+ */
-+static enum utrace_resume_action start_report(struct utrace *utrace)
-+{
-+ enum utrace_resume_action resume = utrace->resume;
-+ if (utrace->pending_attach ||
-+ (resume > UTRACE_INTERRUPT && resume < UTRACE_RESUME)) {
-+ spin_lock(&utrace->lock);
-+ splice_attaching(utrace);
-+ resume = utrace->resume;
-+ if (resume > UTRACE_INTERRUPT)
-+ utrace->resume = UTRACE_RESUME;
-+ spin_unlock(&utrace->lock);
-+ }
-+ return resume;
-+}
-+
-+static inline void finish_report_reset(struct task_struct *task,
-+ struct utrace *utrace,
-+ struct utrace_report *report)
-+{
-+ if (unlikely(report->spurious || report->detaches)) {
-+ spin_lock(&utrace->lock);
-+ if (utrace_reset(task, utrace))
-+ report->action = UTRACE_RESUME;
-+ }
-+}
-+
-+/*
-+ * Complete a normal reporting pass, pairing with a start_report() call.
-+ * This handles any UTRACE_DETACH or UTRACE_REPORT or UTRACE_INTERRUPT
-+ * returns from engine callbacks. If @will_not_stop is true and any
-+ * engine's last callback used UTRACE_STOP, we do UTRACE_REPORT here to
-+ * ensure we stop before user mode. If there were no callbacks made, it
-+ * will recompute @task->utrace_flags to avoid another false-positive.
-+ */
-+static void finish_report(struct task_struct *task, struct utrace *utrace,
-+ struct utrace_report *report, bool will_not_stop)
-+{
-+ enum utrace_resume_action resume = report->action;
-+
-+ if (resume == UTRACE_STOP)
-+ resume = will_not_stop ? UTRACE_REPORT : UTRACE_RESUME;
-+
-+ if (resume < utrace->resume) {
-+ spin_lock(&utrace->lock);
-+ utrace->resume = resume;
-+ if (resume == UTRACE_INTERRUPT)
-+ set_tsk_thread_flag(task, TIF_SIGPENDING);
-+ else
-+ set_tsk_thread_flag(task, TIF_NOTIFY_RESUME);
-+ spin_unlock(&utrace->lock);
-+ }
-+
-+ finish_report_reset(task, utrace, report);
-+}
-+
-+static void finish_callback_report(struct task_struct *task,
-+ struct utrace *utrace,
-+ struct utrace_report *report,
-+ struct utrace_engine *engine,
-+ enum utrace_resume_action action)
-+{
-+ if (action == UTRACE_DETACH) {
-+ /*
-+ * By holding the lock here, we make sure that
-+ * utrace_barrier() (really get_utrace_lock()) sees the
-+ * effect of this detach. Otherwise utrace_barrier() could
-+ * return 0 after this callback had returned UTRACE_DETACH.
-+ * This way, a 0 return is an unambiguous indicator that any
-+ * callback returning UTRACE_DETACH has indeed caused detach.
-+ */
-+ spin_lock(&utrace->lock);
-+ engine->ops = &utrace_detached_ops;
-+ spin_unlock(&utrace->lock);
-+ }
-+
-+ /*
-+ * If utrace_control() was used, treat that like UTRACE_DETACH here.
-+ */
-+ if (engine->ops == &utrace_detached_ops) {
-+ report->detaches = true;
-+ return;
-+ }
-+
-+ if (action < report->action)
-+ report->action = action;
-+
-+ if (action != UTRACE_STOP) {
-+ if (action < report->resume_action)
-+ report->resume_action = action;
-+
-+ if (engine_wants_stop(engine)) {
-+ spin_lock(&utrace->lock);
-+ clear_engine_wants_stop(engine);
-+ spin_unlock(&utrace->lock);
-+ }
-+
-+ return;
-+ }
-+
-+ if (!engine_wants_stop(engine)) {
-+ spin_lock(&utrace->lock);
-+ /*
-+ * If utrace_control() came in and detached us
-+ * before we got the lock, we must not stop now.
-+ */
-+ if (unlikely(engine->ops == &utrace_detached_ops))
-+ report->detaches = true;
-+ else
-+ mark_engine_wants_stop(task, engine);
-+ spin_unlock(&utrace->lock);
-+ }
-+}
-+
-+/*
-+ * Apply the return value of one engine callback to @report.
-+ * Returns true if @engine detached and should not get any more callbacks.
-+ */
-+static bool finish_callback(struct task_struct *task, struct utrace *utrace,
-+ struct utrace_report *report,
-+ struct utrace_engine *engine,
-+ u32 ret)
-+{
-+ report->result = ret & ~UTRACE_RESUME_MASK;
-+ finish_callback_report(task, utrace, report, engine,
-+ utrace_resume_action(ret));
-+
-+ /*
-+ * Now that we have applied the effect of the return value,
-+ * clear this so that utrace_barrier() can stop waiting.
-+ * A subsequent utrace_control() can stop or resume @engine
-+ * and know this was ordered after its callback's action.
-+ *
-+ * We don't need any barriers here because utrace_barrier()
-+ * takes utrace->lock. If we touched engine->flags above,
-+ * the lock guaranteed this change was before utrace_barrier()
-+ * examined utrace->reporting.
-+ */
-+ utrace->reporting = NULL;
-+
-+ /*
-+ * We've just done an engine callback. These are allowed to sleep,
-+ * though all well-behaved ones restrict that to blocking kalloc()
-+ * or quickly-acquired mutex_lock() and the like. This is a good
-+ * place to make sure tracing engines don't introduce too much
-+ * latency under voluntary preemption.
-+ */
-+ might_sleep();
-+
-+ return engine->ops == &utrace_detached_ops;
-+}
-+
-+/*
-+ * Start the callbacks for @engine to consider @event (a bit mask).
-+ * This makes the report_quiesce() callback first. If @engine wants
-+ * a specific callback for @event, we return the ops vector to use.
-+ * If not, we return NULL. The return value from the ops->callback
-+ * function called should be passed to finish_callback().
-+ */
-+static const struct utrace_engine_ops *start_callback(
-+ struct utrace *utrace, struct utrace_report *report,
-+ struct utrace_engine *engine, struct task_struct *task,
-+ unsigned long event)
-+{
-+ const struct utrace_engine_ops *ops;
-+ unsigned long want;
-+
-+ /*
-+ * This barrier ensures that we've set utrace->reporting before
-+ * we examine engine->flags or engine->ops. utrace_barrier()
-+ * relies on this ordering to indicate that the effect of any
-+ * utrace_control() and utrace_set_events() calls is in place
-+ * by the time utrace->reporting can be seen to be NULL.
-+ */
-+ utrace->reporting = engine;
-+ smp_mb();
-+
-+ /*
-+ * This pairs with the barrier in mark_engine_detached().
-+ * It makes sure that we never see the old ops vector with
-+ * the new flags, in case the original vector had no report_quiesce.
-+ */
-+ want = engine->flags;
-+ smp_rmb();
-+ ops = engine->ops;
-+
-+ if ((want & UTRACE_EVENT(QUIESCE)) || ops == &utrace_detached_ops) {
-+ if (finish_callback(task, utrace, report, engine,
-+ (*ops->report_quiesce)(report->action,
-+ engine, event)))
-+ return NULL;
-+
-+ if (!event) {
-+ /* We only got here to report QUIESCE */
-+ report->spurious = false;
-+ return NULL;
-+ }
-+
-+ /*
-+ * finish_callback() reset utrace->reporting after the
-+ * quiesce callback. Now we set it again (as above)
-+ * before re-examining engine->flags, which could have
-+ * been changed synchronously by ->report_quiesce or
-+ * asynchronously by utrace_control() or utrace_set_events().
-+ */
-+ utrace->reporting = engine;
-+ smp_mb();
-+ want = engine->flags;
-+ }
-+
-+ if (want & ENGINE_STOP)
-+ report->action = UTRACE_STOP;
-+
-+ if (want & event) {
-+ report->spurious = false;
-+ return ops;
-+ }
-+
-+ utrace->reporting = NULL;
-+ return NULL;
-+}
-+
-+/*
-+ * Do a normal reporting pass for engines interested in @event.
-+ * @callback is the name of the member in the ops vector, and remaining
-+ * args are the extras it takes after the standard three args.
-+ */
-+#define REPORT_CALLBACKS(rev, task, utrace, report, event, callback, ...) \
-+ do { \
-+ struct utrace_engine *engine; \
-+ const struct utrace_engine_ops *ops; \
-+ list_for_each_entry##rev(engine, &utrace->attached, entry) { \
-+ ops = start_callback(utrace, report, engine, task, \
-+ event); \
-+ if (!ops) \
-+ continue; \
-+ finish_callback(task, utrace, report, engine, \
-+ (*ops->callback)(__VA_ARGS__)); \
-+ } \
-+ } while (0)
-+#define REPORT(task, utrace, report, event, callback, ...) \
-+ do { \
-+ start_report(utrace); \
-+ REPORT_CALLBACKS(, task, utrace, report, event, callback, \
-+ (report)->action, engine, ## __VA_ARGS__); \
-+ finish_report(task, utrace, report, true); \
-+ } while (0)
-+
-+/*
-+ * Called iff UTRACE_EVENT(EXEC) flag is set.
-+ */
-+void utrace_report_exec(struct linux_binfmt *fmt, struct linux_binprm *bprm,
-+ struct pt_regs *regs)
-+{
-+ struct task_struct *task = current;
-+ struct utrace *utrace = task_utrace_struct(task);
-+ INIT_REPORT(report);
-+
-+ REPORT(task, utrace, &report, UTRACE_EVENT(EXEC),
-+ report_exec, fmt, bprm, regs);
-+}
-+
-+static u32 do_report_syscall_entry(struct pt_regs *regs,
-+ struct task_struct *task,
-+ struct utrace *utrace,
-+ struct utrace_report *report,
-+ u32 resume_report)
-+{
-+ start_report(utrace);
-+ REPORT_CALLBACKS(_reverse, task, utrace, report,
-+ UTRACE_EVENT(SYSCALL_ENTRY), report_syscall_entry,
-+ resume_report | report->result | report->action,
-+ engine, regs);
-+ finish_report(task, utrace, report, false);
-+
-+ if (report->action != UTRACE_STOP)
-+ return 0;
-+
-+ utrace_stop(task, utrace, report->resume_action);
-+
-+ if (fatal_signal_pending(task)) {
-+ /*
-+ * We are continuing despite UTRACE_STOP because of a
-+ * SIGKILL. Don't let the system call actually proceed.
-+ */
-+ report->result = UTRACE_SYSCALL_ABORT;
-+ } else if (utrace->resume <= UTRACE_REPORT) {
-+ /*
-+ * If we've been asked for another report after our stop,
-+ * go back to report (and maybe stop) again before we run
-+ * the system call. The second (and later) reports are
-+ * marked with the UTRACE_SYSCALL_RESUMED flag so that
-+ * engines know this is a second report at the same
-+ * entry. This gives them the chance to examine the
-+ * registers anew after they might have been changed
-+ * while we were stopped.
-+ */
-+ report->detaches = false;
-+ report->spurious = true;
-+ report->action = report->resume_action = UTRACE_RESUME;
-+ return UTRACE_SYSCALL_RESUMED;
-+ }
-+
-+ return 0;
-+}
-+
-+/*
-+ * Called iff UTRACE_EVENT(SYSCALL_ENTRY) flag is set.
-+ * Return true to prevent the system call.
-+ */
-+bool utrace_report_syscall_entry(struct pt_regs *regs)
-+{
-+ struct task_struct *task = current;
-+ struct utrace *utrace = task_utrace_struct(task);
-+ INIT_REPORT(report);
-+ u32 resume_report = 0;
-+
-+ do {
-+ resume_report = do_report_syscall_entry(regs, task, utrace,
-+ &report, resume_report);
-+ } while (resume_report);
-+
-+ return utrace_syscall_action(report.result) == UTRACE_SYSCALL_ABORT;
-+}
-+
-+/*
-+ * Called iff UTRACE_EVENT(SYSCALL_EXIT) flag is set.
-+ */
-+void utrace_report_syscall_exit(struct pt_regs *regs)
-+{
-+ struct task_struct *task = current;
-+ struct utrace *utrace = task_utrace_struct(task);
-+ INIT_REPORT(report);
-+
-+ REPORT(task, utrace, &report, UTRACE_EVENT(SYSCALL_EXIT),
-+ report_syscall_exit, regs);
-+}
-+
-+/*
-+ * Called iff UTRACE_EVENT(CLONE) flag is set.
-+ * This notification call blocks the wake_up_new_task call on the child.
-+ * So we must not quiesce here. tracehook_report_clone_complete will do
-+ * a quiescence check momentarily.
-+ */
-+void utrace_report_clone(unsigned long clone_flags, struct task_struct *child)
-+{
-+ struct task_struct *task = current;
-+ struct utrace *utrace = task_utrace_struct(task);
-+ INIT_REPORT(report);
-+
-+ /*
-+ * We don't use the REPORT() macro here, because we need
-+ * to clear utrace->cloning before finish_report().
-+ * After finish_report(), utrace can be a stale pointer
-+ * in cases when report.action is still UTRACE_RESUME.
-+ */
-+ start_report(utrace);
-+ utrace->cloning = child;
-+
-+ REPORT_CALLBACKS(, task, utrace, &report,
-+ UTRACE_EVENT(CLONE), report_clone,
-+ report.action, engine, clone_flags, child);
-+
-+ utrace->cloning = NULL;
-+ finish_report(task, utrace, &report, !(clone_flags & CLONE_VFORK));
-+
-+ /*
-+ * For a vfork, we will go into an uninterruptible block waiting
-+ * for the child. We need UTRACE_STOP to happen before this, not
-+ * after. For CLONE_VFORK, utrace_finish_vfork() will be called.
-+ */
-+ if (report.action == UTRACE_STOP && (clone_flags & CLONE_VFORK)) {
-+ spin_lock(&utrace->lock);
-+ utrace->vfork_stop = 1;
-+ spin_unlock(&utrace->lock);
-+ }
-+}
-+
-+/*
-+ * We're called after utrace_report_clone() for a CLONE_VFORK.
-+ * If UTRACE_STOP was left from the clone report, we stop here.
-+ * After this, we'll enter the uninterruptible wait_for_completion()
-+ * waiting for the child.
-+ */
-+void utrace_finish_vfork(struct task_struct *task)
-+{
-+ struct utrace *utrace = task_utrace_struct(task);
-+
-+ if (utrace->vfork_stop) {
-+ spin_lock(&utrace->lock);
-+ utrace->vfork_stop = 0;
-+ spin_unlock(&utrace->lock);
-+ utrace_stop(task, utrace, UTRACE_RESUME); /* XXX */
-+ }
-+}
-+
-+/*
-+ * Called iff UTRACE_EVENT(JCTL) flag is set.
-+ *
-+ * Called with siglock held.
-+ */
-+void utrace_report_jctl(int notify, int what)
-+{
-+ struct task_struct *task = current;
-+ struct utrace *utrace = task_utrace_struct(task);
-+ INIT_REPORT(report);
-+
-+ spin_unlock_irq(&task->sighand->siglock);
-+
-+ REPORT(task, utrace, &report, UTRACE_EVENT(JCTL),
-+ report_jctl, what, notify);
-+
-+ spin_lock_irq(&task->sighand->siglock);
-+}
-+
-+/*
-+ * Called iff UTRACE_EVENT(EXIT) flag is set.
-+ */
-+void utrace_report_exit(long *exit_code)
-+{
-+ struct task_struct *task = current;
-+ struct utrace *utrace = task_utrace_struct(task);
-+ INIT_REPORT(report);
-+ long orig_code = *exit_code;
-+
-+ REPORT(task, utrace, &report, UTRACE_EVENT(EXIT),
-+ report_exit, orig_code, exit_code);
-+
-+ if (report.action == UTRACE_STOP)
-+ utrace_stop(task, utrace, report.resume_action);
-+}
-+
-+/*
-+ * Called iff UTRACE_EVENT(DEATH) or UTRACE_EVENT(QUIESCE) flag is set.
-+ *
-+ * It is always possible that we are racing with utrace_release_task here.
-+ * For this reason, utrace_release_task checks for the event bits that get
-+ * us here, and delays its cleanup for us to do.
-+ */
-+void utrace_report_death(struct task_struct *task, bool group_dead, int signal)
-+{
-+ struct utrace *utrace = task_utrace_struct(task);
-+
-+ INIT_REPORT(report);
-+
-+ BUG_ON(!task->exit_state);
-+
-+ /*
-+ * We are presently considered "quiescent"--which is accurate
-+ * inasmuch as we won't run any more user instructions ever again.
-+ * But for utrace_control and utrace_set_events to be robust, they
-+ * must be sure whether or not we will run any more callbacks. If
-+ * a call comes in before we do, taking the lock here synchronizes
-+ * us so we don't run any callbacks just disabled. Calls that come
-+ * in while we're running the callbacks will see the exit.death
-+ * flag and know that we are not yet fully quiescent for purposes
-+ * of detach bookkeeping.
-+ */
-+ spin_lock(&utrace->lock);
-+ BUG_ON(utrace->death);
-+ utrace->death = 1;
-+ utrace->resume = UTRACE_RESUME;
-+ splice_attaching(utrace);
-+ spin_unlock(&utrace->lock);
-+
-+ REPORT_CALLBACKS(, task, utrace, &report, UTRACE_EVENT(DEATH),
-+ report_death, engine, group_dead, signal);
-+
-+ utrace_maybe_reap(task, utrace, false);
-+}
-+
-+/*
-+ * Finish the last reporting pass before returning to user mode.
-+ */
-+static void finish_resume_report(struct task_struct *task,
-+ struct utrace *utrace,
-+ struct utrace_report *report)
-+{
-+ finish_report_reset(task, utrace, report);
-+
-+ switch (report->action) {
-+ case UTRACE_STOP:
-+ utrace_stop(task, utrace, report->resume_action);
-+ break;
-+
-+ case UTRACE_INTERRUPT:
-+ if (!signal_pending(task))
-+ set_tsk_thread_flag(task, TIF_SIGPENDING);
-+ break;
-+
-+ case UTRACE_BLOCKSTEP:
-+ if (likely(arch_has_block_step())) {
-+ if (!ptrace_wants_step(task))
-+ user_enable_block_step(task);
-+ break;
-+ }
-+
-+ /*
-+ * This means some callback is to blame for failing
-+ * to check arch_has_block_step() itself. Warn and
-+ * then fall through to treat it as SINGLESTEP.
-+ */
-+ WARN(1, "UTRACE_BLOCKSTEP when !arch_has_block_step()");
-+
-+ case UTRACE_SINGLESTEP:
-+ if (likely(arch_has_single_step())) {
-+ if (!ptrace_wants_step(task))
-+ user_enable_single_step(task);
-+ } else {
-+ /*
-+ * This means some callback is to blame for failing
-+ * to check arch_has_single_step() itself. Spew
-+ * about it so the loser will fix his module.
-+ */
-+ WARN(1,
-+ "UTRACE_SINGLESTEP when !arch_has_single_step()");
-+ }
-+ break;
-+
-+ case UTRACE_REPORT:
-+ case UTRACE_RESUME:
-+ default:
-+ if (!ptrace_wants_step(task))
-+ user_disable_single_step(task);
-+ break;
-+ }
-+}
-+
-+/*
-+ * This is called when TIF_NOTIFY_RESUME had been set (and is now clear).
-+ * We are close to user mode, and this is the place to report or stop.
-+ * When we return, we're going to user mode or into the signals code.
-+ */
-+void utrace_resume(struct task_struct *task, struct pt_regs *regs)
-+{
-+ struct utrace *utrace = task_utrace_struct(task);
-+ INIT_REPORT(report);
-+ struct utrace_engine *engine;
-+
-+ /*
-+ * Some machines get here with interrupts disabled. The same arch
-+ * code path leads to calling into get_signal_to_deliver(), which
-+ * implicitly reenables them by virtue of spin_unlock_irq.
-+ */
-+ if (irqs_disabled()) /* make trace_hardirqs_on() happy */
-+ local_irq_enable();
-+
-+ /*
-+ * If this flag is still set it's because there was a signal
-+ * handler setup done but no report_signal following it. Clear
-+ * the flag before we get to user so it doesn't confuse us later.
-+ */
-+ if (unlikely(utrace->signal_handler)) {
-+ spin_lock(&utrace->lock);
-+ utrace->signal_handler = 0;
-+ spin_unlock(&utrace->lock);
-+ }
-+
-+ /*
-+ * Update our bookkeeping even if there are no callbacks made here.
-+ */
-+ report.action = start_report(utrace);
-+
-+ switch (report.action) {
-+ case UTRACE_RESUME:
-+ /*
-+ * Anything we might have done was already handled by
-+ * utrace_get_signal(), or this is an entirely spurious
-+ * call. (The arch might use TIF_NOTIFY_RESUME for other
-+ * purposes as well as calling us.)
-+ */
-+ return;
-+ case UTRACE_REPORT:
-+ if (unlikely(!(task->utrace_flags & UTRACE_EVENT(QUIESCE))))
-+ break;
-+ /*
-+ * Do a simple reporting pass, with no specific
-+ * callback after report_quiesce.
-+ */
-+ report.action = UTRACE_RESUME;
-+ list_for_each_entry(engine, &utrace->attached, entry)
-+ start_callback(utrace, &report, engine, task, 0);
-+ break;
-+ default:
-+ /*
-+ * Even if this report was truly spurious, there is no need
-+ * for utrace_reset() now. TIF_NOTIFY_RESUME was already
-+ * cleared--it doesn't stay spuriously set.
-+ */
-+ report.spurious = false;
-+ break;
-+ }
-+
-+ /*
-+ * Finish the report and either stop or get ready to resume.
-+ * If utrace->resume was not UTRACE_REPORT, this applies its
-+ * effect now (i.e. step or interrupt).
-+ */
-+ finish_resume_report(task, utrace, &report);
-+}
-+
-+/*
-+ * Return true if current has forced signal_pending().
-+ *
-+ * This is called only when current->utrace_flags is nonzero, so we know
-+ * that current->utrace must be set. It's not inlined in tracehook.h
-+ * just so that struct utrace can stay opaque outside this file.
-+ */
-+bool utrace_interrupt_pending(void)
-+{
-+ return task_utrace_struct(current)->resume == UTRACE_INTERRUPT;
-+}
-+
-+/*
-+ * Take the siglock and push @info back on our queue.
-+ * Returns with @task->sighand->siglock held.
-+ */
-+static void push_back_signal(struct task_struct *task, siginfo_t *info)
-+ __acquires(task->sighand->siglock)
-+{
-+ struct sigqueue *q;
-+
-+ if (unlikely(!info->si_signo)) { /* Oh, a wise guy! */
-+ spin_lock_irq(&task->sighand->siglock);
-+ return;
-+ }
-+
-+ q = sigqueue_alloc();
-+ if (likely(q)) {
-+ q->flags = 0;
-+ copy_siginfo(&q->info, info);
-+ }
-+
-+ spin_lock_irq(&task->sighand->siglock);
-+
-+ sigaddset(&task->pending.signal, info->si_signo);
-+ if (likely(q))
-+ list_add(&q->list, &task->pending.list);
-+
-+ set_tsk_thread_flag(task, TIF_SIGPENDING);
-+}
-+
-+/*
-+ * This is the hook from the signals code, called with the siglock held.
-+ * Here is the ideal place to stop. We also dequeue and intercept signals.
-+ */
-+int utrace_get_signal(struct task_struct *task, struct pt_regs *regs,
-+ siginfo_t *info, struct k_sigaction *return_ka)
-+ __releases(task->sighand->siglock)
-+ __acquires(task->sighand->siglock)
-+{
-+ struct utrace *utrace;
-+ struct k_sigaction *ka;
-+ INIT_REPORT(report);
-+ struct utrace_engine *engine;
-+ const struct utrace_engine_ops *ops;
-+ unsigned long event, want;
-+ u32 ret;
-+ int signr;
-+
-+ utrace = task_utrace_struct(task);
-+ if (utrace->resume < UTRACE_RESUME ||
-+ utrace->pending_attach || utrace->signal_handler) {
-+ enum utrace_resume_action resume;
-+
-+ /*
-+ * We've been asked for an explicit report before we
-+ * even check for pending signals.
-+ */
-+
-+ spin_unlock_irq(&task->sighand->siglock);
-+
-+ spin_lock(&utrace->lock);
-+
-+ splice_attaching(utrace);
-+
-+ report.result = utrace->signal_handler ?
-+ UTRACE_SIGNAL_HANDLER : UTRACE_SIGNAL_REPORT;
-+ utrace->signal_handler = 0;
-+
-+ resume = utrace->resume;
-+ utrace->resume = UTRACE_RESUME;
-+
-+ spin_unlock(&utrace->lock);
-+
-+ /*
-+ * Make sure signal_pending() only returns true
-+ * if there are real signals pending.
-+ */
-+ if (signal_pending(task)) {
-+ spin_lock_irq(&task->sighand->siglock);
-+ recalc_sigpending();
-+ spin_unlock_irq(&task->sighand->siglock);
-+ }
-+
-+ if (resume > UTRACE_REPORT) {
-+ /*
-+ * We only got here to process utrace->resume.
-+ * Despite no callbacks, this report is not spurious.
-+ */
-+ report.action = resume;
-+ report.spurious = false;
-+ finish_resume_report(task, utrace, &report);
-+ return -1;
-+ } else if (!(task->utrace_flags & UTRACE_EVENT(QUIESCE))) {
-+ /*
-+ * We only got here to clear utrace->signal_handler.
-+ */
-+ return -1;
-+ }
-+
-+ /*
-+ * Do a reporting pass for no signal, just for EVENT(QUIESCE).
-+ * The engine callbacks can fill in *info and *return_ka.
-+ * We'll pass NULL for the @orig_ka argument to indicate
-+ * that there was no original signal.
-+ */
-+ event = 0;
-+ ka = NULL;
-+ memset(return_ka, 0, sizeof *return_ka);
-+ } else if (!(task->utrace_flags & UTRACE_EVENT_SIGNAL_ALL) ||
-+ unlikely(task->jobctl & JOBCTL_PENDING_MASK)) {
-+ /*
-+ * If no engine is interested in intercepting signals or
-+ * we must stop, let the caller just dequeue them normally
-+ * or participate in group-stop.
-+ */
-+ return 0;
-+ } else {
-+ /*
-+ * Steal the next signal so we can let tracing engines
-+ * examine it. From the signal number and sigaction,
-+ * determine what normal delivery would do. If no
-+ * engine perturbs it, we'll do that by returning the
-+ * signal number after setting *return_ka.
-+ */
-+ signr = dequeue_signal(task, &task->blocked, info);
-+ if (signr == 0)
-+ return signr;
-+ BUG_ON(signr != info->si_signo);
-+
-+ ka = &task->sighand->action[signr - 1];
-+ *return_ka = *ka;
-+
-+ /*
-+ * We are never allowed to interfere with SIGKILL.
-+ * Just punt after filling in *return_ka for our caller.
-+ */
-+ if (signr == SIGKILL)
-+ return signr;
-+
-+ if (ka->sa.sa_handler == SIG_IGN) {
-+ event = UTRACE_EVENT(SIGNAL_IGN);
-+ report.result = UTRACE_SIGNAL_IGN;
-+ } else if (ka->sa.sa_handler != SIG_DFL) {
-+ event = UTRACE_EVENT(SIGNAL);
-+ report.result = UTRACE_SIGNAL_DELIVER;
-+ } else if (sig_kernel_coredump(signr)) {
-+ event = UTRACE_EVENT(SIGNAL_CORE);
-+ report.result = UTRACE_SIGNAL_CORE;
-+ } else if (sig_kernel_ignore(signr)) {
-+ event = UTRACE_EVENT(SIGNAL_IGN);
-+ report.result = UTRACE_SIGNAL_IGN;
-+ } else if (signr == SIGSTOP) {
-+ event = UTRACE_EVENT(SIGNAL_STOP);
-+ report.result = UTRACE_SIGNAL_STOP;
-+ } else if (sig_kernel_stop(signr)) {
-+ event = UTRACE_EVENT(SIGNAL_STOP);
-+ report.result = UTRACE_SIGNAL_TSTP;
-+ } else {
-+ event = UTRACE_EVENT(SIGNAL_TERM);
-+ report.result = UTRACE_SIGNAL_TERM;
-+ }
-+
-+ /*
-+ * Now that we know what event type this signal is, we
-+ * can short-circuit if no engines care about those.
-+ */
-+ if ((task->utrace_flags & (event | UTRACE_EVENT(QUIESCE))) == 0)
-+ return signr;
-+
-+ /*
-+ * We have some interested engines, so tell them about
-+ * the signal and let them change its disposition.
-+ */
-+ spin_unlock_irq(&task->sighand->siglock);
-+ }
-+
-+ /*
-+ * This reporting pass chooses what signal disposition we'll act on.
-+ */
-+ list_for_each_entry(engine, &utrace->attached, entry) {
-+ /*
-+ * See start_callback() comment about this barrier.
-+ */
-+ utrace->reporting = engine;
-+ smp_mb();
-+
-+ /*
-+ * This pairs with the barrier in mark_engine_detached(),
-+ * see start_callback() comments.
-+ */
-+ want = engine->flags;
-+ smp_rmb();
-+ ops = engine->ops;
-+
-+ if ((want & (event | UTRACE_EVENT(QUIESCE))) == 0) {
-+ utrace->reporting = NULL;
-+ continue;
-+ }
-+
-+ if (ops->report_signal)
-+ ret = (*ops->report_signal)(
-+ report.result | report.action, engine,
-+ regs, info, ka, return_ka);
-+ else
-+ ret = (report.result | (*ops->report_quiesce)(
-+ report.action, engine, event));
-+
-+ /*
-+ * Avoid a tight loop reporting again and again if some
-+ * engine is too stupid.
-+ */
-+ switch (utrace_resume_action(ret)) {
-+ default:
-+ break;
-+ case UTRACE_INTERRUPT:
-+ case UTRACE_REPORT:
-+ ret = (ret & ~UTRACE_RESUME_MASK) | UTRACE_RESUME;
-+ break;
-+ }
-+
-+ finish_callback(task, utrace, &report, engine, ret);
-+ }
-+
-+ /*
-+ * We express the chosen action to the signals code in terms
-+ * of a representative signal whose default action does it.
-+ * Our caller uses our return value (signr) to decide what to
-+ * do, but uses info->si_signo as the signal number to report.
-+ */
-+ switch (utrace_signal_action(report.result)) {
-+ case UTRACE_SIGNAL_TERM:
-+ signr = SIGTERM;
-+ break;
-+
-+ case UTRACE_SIGNAL_CORE:
-+ signr = SIGQUIT;
-+ break;
-+
-+ case UTRACE_SIGNAL_STOP:
-+ signr = SIGSTOP;
-+ break;
-+
-+ case UTRACE_SIGNAL_TSTP:
-+ signr = SIGTSTP;
-+ break;
-+
-+ case UTRACE_SIGNAL_DELIVER:
-+ signr = info->si_signo;
-+
-+ if (return_ka->sa.sa_handler == SIG_DFL) {
-+ /*
-+ * We'll do signr's normal default action.
-+ * For ignore, we'll fall through below.
-+ * For stop/death, break locks and returns it.
-+ */
-+ if (likely(signr) && !sig_kernel_ignore(signr))
-+ break;
-+ } else if (return_ka->sa.sa_handler != SIG_IGN &&
-+ likely(signr)) {
-+ /*
-+ * Complete the bookkeeping after the report.
-+ * The handler will run. If an engine wanted to
-+ * stop or step, then make sure we do another
-+ * report after signal handler setup.
-+ */
-+ if (report.action != UTRACE_RESUME)
-+ report.action = UTRACE_INTERRUPT;
-+ finish_report(task, utrace, &report, true);
-+
-+ if (unlikely(report.result & UTRACE_SIGNAL_HOLD))
-+ push_back_signal(task, info);
-+ else
-+ spin_lock_irq(&task->sighand->siglock);
-+
-+ /*
-+ * We do the SA_ONESHOT work here since the
-+ * normal path will only touch *return_ka now.
-+ */
-+ if (unlikely(return_ka->sa.sa_flags & SA_ONESHOT)) {
-+ return_ka->sa.sa_flags &= ~SA_ONESHOT;
-+ if (likely(valid_signal(signr))) {
-+ ka = &task->sighand->action[signr - 1];
-+ ka->sa.sa_handler = SIG_DFL;
-+ }
-+ }
-+
-+ return signr;
-+ }
-+
-+ /* Fall through for an ignored signal. */
-+
-+ case UTRACE_SIGNAL_IGN:
-+ case UTRACE_SIGNAL_REPORT:
-+ default:
-+ /*
-+ * If the signal is being ignored, then we are on the way
-+ * directly back to user mode. We can stop here, or step,
-+ * as in utrace_resume(), above. After we've dealt with that,
-+ * our caller will relock and come back through here.
-+ */
-+ finish_resume_report(task, utrace, &report);
-+
-+ if (unlikely(fatal_signal_pending(task))) {
-+ /*
-+ * The only reason we woke up now was because of a
-+ * SIGKILL. Don't do normal dequeuing in case it
-+ * might get a signal other than SIGKILL. That would
-+ * perturb the death state so it might differ from
-+ * what the debugger would have allowed to happen.
-+ * Instead, pluck out just the SIGKILL to be sure
-+ * we'll die immediately with nothing else different
-+ * from the quiescent state the debugger wanted us in.
-+ */
-+ sigset_t sigkill_only;
-+ siginitsetinv(&sigkill_only, sigmask(SIGKILL));
-+ spin_lock_irq(&task->sighand->siglock);
-+ signr = dequeue_signal(task, &sigkill_only, info);
-+ BUG_ON(signr != SIGKILL);
-+ *return_ka = task->sighand->action[SIGKILL - 1];
-+ return signr;
-+ }
-+
-+ if (unlikely(report.result & UTRACE_SIGNAL_HOLD)) {
-+ push_back_signal(task, info);
-+ spin_unlock_irq(&task->sighand->siglock);
-+ }
-+
-+ return -1;
-+ }
-+
-+ /*
-+ * Complete the bookkeeping after the report.
-+ * This sets utrace->resume if UTRACE_STOP was used.
-+ */
-+ finish_report(task, utrace, &report, true);
-+
-+ return_ka->sa.sa_handler = SIG_DFL;
-+
-+ /*
-+ * If this signal is fatal, si_signo gets through as exit_code.
-+ * We can't allow a completely bogus value there or else core
-+ * kernel code can freak out. (If an engine wants to control
-+ * the exit_code value exactly, it can do so in report_exit.)
-+ * We'll produce a big complaint in dmesg, but won't crash.
-+ * That's nicer for debugging your utrace engine.
-+ */
-+ if (unlikely(info->si_signo & 0x80)) {
-+ WARN(1, "utrace engine left bogus si_signo value!");
-+ info->si_signo = SIGTRAP;
-+ }
-+
-+ if (unlikely(report.result & UTRACE_SIGNAL_HOLD))
-+ push_back_signal(task, info);
-+ else
-+ spin_lock_irq(&task->sighand->siglock);
-+
-+ if (sig_kernel_stop(signr))
-+ task->jobctl |= JOBCTL_STOP_DEQUEUED;
-+
-+ return signr;
-+}
-+
-+/*
-+ * This gets called after a signal handler has been set up.
-+ * We set a flag so the next report knows it happened.
-+ * If we're already stepping, make sure we do a report_signal.
-+ * If not, make sure we get into utrace_resume() where we can
-+ * clear the signal_handler flag before resuming.
-+ */
-+void utrace_signal_handler(struct task_struct *task, int stepping)
-+{
-+ struct utrace *utrace = task_utrace_struct(task);
-+
-+ spin_lock(&utrace->lock);
-+
-+ utrace->signal_handler = 1;
-+ if (utrace->resume > UTRACE_INTERRUPT) {
-+ if (stepping) {
-+ utrace->resume = UTRACE_INTERRUPT;
-+ set_tsk_thread_flag(task, TIF_SIGPENDING);
-+ } else if (utrace->resume == UTRACE_RESUME) {
-+ set_tsk_thread_flag(task, TIF_NOTIFY_RESUME);
-+ }
-+ }
-+
-+ spin_unlock(&utrace->lock);
-+}
-+
-+/**
-+ * utrace_prepare_examine - prepare to examine thread state
-+ * @target: thread of interest, a &struct task_struct pointer
-+ * @engine: engine pointer returned by utrace_attach_task()
-+ * @exam: temporary state, a &struct utrace_examiner pointer
-+ *
-+ * This call prepares to safely examine the thread @target using
-+ * &struct user_regset calls, or direct access to thread-synchronous fields.
-+ *
-+ * When @target is current, this call is superfluous. When @target is
-+ * another thread, it must be held stopped via %UTRACE_STOP by @engine.
-+ *
-+ * This call may block the caller until @target stays stopped, so it must
-+ * be called only after the caller is sure @target is about to unschedule.
-+ * This means a zero return from a utrace_control() call on @engine giving
-+ * %UTRACE_STOP, or a report_quiesce() or report_signal() callback to
-+ * @engine that used %UTRACE_STOP in its return value.
-+ *
-+ * Returns -%ESRCH if @target is dead or -%EINVAL if %UTRACE_STOP was
-+ * not used. If @target has started running again despite %UTRACE_STOP
-+ * (for %SIGKILL or a spurious wakeup), this call returns -%EAGAIN.
-+ *
-+ * When this call returns zero, it's safe to use &struct user_regset
-+ * calls and task_user_regset_view() on @target and to examine some of
-+ * its fields directly. When the examination is complete, a
-+ * utrace_finish_examine() call must follow to check whether it was
-+ * completed safely.
-+ */
-+int utrace_prepare_examine(struct task_struct *target,
-+ struct utrace_engine *engine,
-+ struct utrace_examiner *exam)
-+{
-+ int ret = 0;
-+
-+ if (unlikely(target == current))
-+ return 0;
-+
-+ rcu_read_lock();
-+ if (unlikely(!engine_wants_stop(engine)))
-+ ret = -EINVAL;
-+ else if (unlikely(target->exit_state))
-+ ret = -ESRCH;
-+ else {
-+ exam->state = target->state;
-+ if (unlikely(exam->state == TASK_RUNNING))
-+ ret = -EAGAIN;
-+ else
-+ get_task_struct(target);
-+ }
-+ rcu_read_unlock();
-+
-+ if (likely(!ret)) {
-+ exam->ncsw = wait_task_inactive(target, exam->state);
-+ put_task_struct(target);
-+ if (unlikely(!exam->ncsw))
-+ ret = -EAGAIN;
-+ }
-+
-+ return ret;
-+}
-+EXPORT_SYMBOL_GPL(utrace_prepare_examine);
-+
-+/**
-+ * utrace_finish_examine - complete an examination of thread state
-+ * @target: thread of interest, a &struct task_struct pointer
-+ * @engine: engine pointer returned by utrace_attach_task()
-+ * @exam: pointer passed to utrace_prepare_examine() call
-+ *
-+ * This call completes an examination on the thread @target begun by a
-+ * paired utrace_prepare_examine() call with the same arguments that
-+ * returned success (zero).
-+ *
-+ * When @target is current, this call is superfluous. When @target is
-+ * another thread, this returns zero if @target has remained unscheduled
-+ * since the paired utrace_prepare_examine() call returned zero.
-+ *
-+ * When this returns an error, any examination done since the paired
-+ * utrace_prepare_examine() call is unreliable and the data extracted
-+ * should be discarded. The error is -%EINVAL if @engine is not
-+ * keeping @target stopped, or -%EAGAIN if @target woke up unexpectedly.
-+ */
-+int utrace_finish_examine(struct task_struct *target,
-+ struct utrace_engine *engine,
-+ struct utrace_examiner *exam)
-+{
-+ int ret = 0;
-+
-+ if (unlikely(target == current))
-+ return 0;
-+
-+ rcu_read_lock();
-+ if (unlikely(!engine_wants_stop(engine)))
-+ ret = -EINVAL;
-+ else if (unlikely(target->state != exam->state))
-+ ret = -EAGAIN;
-+ else
-+ get_task_struct(target);
-+ rcu_read_unlock();
-+
-+ if (likely(!ret)) {
-+ unsigned long ncsw = wait_task_inactive(target, exam->state);
-+ if (unlikely(ncsw != exam->ncsw))
-+ ret = -EAGAIN;
-+ put_task_struct(target);
-+ }
-+
-+ return ret;
-+}
-+EXPORT_SYMBOL_GPL(utrace_finish_examine);
-+
-+/*
-+ * This is declared in linux/regset.h and defined in machine-dependent
-+ * code. We put the export here to ensure no machine forgets it.
-+ */
-+EXPORT_SYMBOL_GPL(task_user_regset_view);
-+
-+/*
-+ * Called with rcu_read_lock() held.
-+ */
-+void task_utrace_proc_status(struct seq_file *m, struct task_struct *p)
-+{
-+ seq_printf(m, "Utrace:\t%lx\n", p->utrace_flags);
-+}
---
-1.7.9.1
-
diff --git a/freed-ora/current/master/vgaarb-vga_default_device.patch b/freed-ora/current/master/vgaarb-vga_default_device.patch
new file mode 100644
index 000000000..c67c6c861
--- /dev/null
+++ b/freed-ora/current/master/vgaarb-vga_default_device.patch
@@ -0,0 +1,552 @@
+
+Delivered-To: jwboyer@gmail.com
+Received: by 10.229.187.201 with SMTP id cx9csp141480qcb;
+ Mon, 16 Apr 2012 13:27:50 -0700 (PDT)
+Received: by 10.60.0.201 with SMTP id 9mr17463209oeg.59.1334608065659;
+ Mon, 16 Apr 2012 13:27:45 -0700 (PDT)
+Return-Path: <linux-kernel-owner@vger.kernel.org>
+Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67])
+ by mx.google.com with ESMTP id 4si12245496oei.14.2012.04.16.13.27.44;
+ Mon, 16 Apr 2012 13:27:45 -0700 (PDT)
+Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67;
+Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mail=linux-kernel-owner@vger.kernel.org
+Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
+ id S1755065Ab2DPU02 (ORCPT <rfc822;padmanabhlinux@gmail.com>
+ + 99 others); Mon, 16 Apr 2012 16:26:28 -0400
+Received: from mx1.redhat.com ([209.132.183.28]:1184 "EHLO mx1.redhat.com"
+ rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
+ id S1754698Ab2DPU01 (ORCPT <rfc822;linux-kernel@vger.kernel.org>);
+ Mon, 16 Apr 2012 16:26:27 -0400
+Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])
+ by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3GKQPYb007336
+ (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
+ Mon, 16 Apr 2012 16:26:25 -0400
+Received: from cavan.codon.org.uk (ovpn-113-122.phx2.redhat.com [10.3.113.122])
+ by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q3GKQNG5011412
+ (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);
+ Mon, 16 Apr 2012 16:26:24 -0400
+Received: from nat-pool-rdu.redhat.com ([66.187.233.202] helo=x220.boston.devel.redhat.com)
+ by cavan.codon.org.uk with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
+ (Exim 4.72)
+ (envelope-from <mjg@redhat.com>)
+ id 1SJsVA-0003T4-U8; Mon, 16 Apr 2012 21:26:21 +0100
+From: Matthew Garrett <mjg@redhat.com>
+To: linux-kernel@vger.kernel.org
+Cc: Matthew Garrett <mjg@redhat.com>, benh@kernel.crashing.org,
+ airlied@redhat.com
+Subject: [PATCH V2 1/4] vgaarb: Add support for setting the default video device
+Date: Mon, 16 Apr 2012 16:26:02 -0400
+Message-Id: <1334607965-9582-1-git-send-email-mjg@redhat.com>
+X-SA-Do-Not-Run: Yes
+X-SA-Exim-Connect-IP: 66.187.233.202
+X-SA-Exim-Mail-From: mjg@redhat.com
+X-SA-Exim-Scanned: No (on cavan.codon.org.uk); SAEximRunCond expanded to false
+X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11
+Sender: linux-kernel-owner@vger.kernel.org
+Precedence: bulk
+List-ID: <linux-kernel.vger.kernel.org>
+X-Mailing-List: linux-kernel@vger.kernel.org
+
+The default VGA device is a somewhat fluid concept on platforms with
+multiple GPUs. Add support for setting it so switching code can update
+things appropriately, and make sure that the sysfs code returns the right
+device if it's changed.
+
+Signed-off-by: Matthew Garrett <mjg@redhat.com>
+Cc: benh@kernel.crashing.org
+Cc: airlied@redhat.com
+---
+Updated to fix builds when __ARCH_HAS_VGA_DEFAULT_DEVICE is false.
+
+ drivers/gpu/vga/vgaarb.c | 7 +++++++
+ drivers/pci/pci-sysfs.c | 5 +++++
+ include/linux/vgaarb.h | 2 ++
+ 3 files changed, 14 insertions(+)
+
+diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c
+index 111d956..e223b96 100644
+--- a/drivers/gpu/vga/vgaarb.c
++++ b/drivers/gpu/vga/vgaarb.c
+@@ -136,6 +136,11 @@ struct pci_dev *vga_default_device(void)
+ {
+ return vga_default;
+ }
++
++void vga_set_default_device(struct pci_dev *pdev)
++{
++ vga_default = pdev;
++}
+ #endif
+
+ static inline void vga_irq_set_state(struct vga_device *vgadev, bool state)
+@@ -605,10 +610,12 @@ static bool vga_arbiter_del_pci_device(struct pci_dev *pdev)
+ goto bail;
+ }
+
++#ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE
+ if (vga_default == pdev) {
+ pci_dev_put(vga_default);
+ vga_default = NULL;
+ }
++#endif
+
+ if (vgadev->decodes & (VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM))
+ vga_decode_count--;
+diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
+index a3cd8ca..7dd9f2b 100644
+--- a/drivers/pci/pci-sysfs.c
++++ b/drivers/pci/pci-sysfs.c
+@@ -27,6 +27,7 @@
+ #include <linux/security.h>
+ #include <linux/pci-aspm.h>
+ #include <linux/slab.h>
++#include <linux/vgaarb.h>
+ #include "pci.h"
+
+ static int sysfs_initialized; /* = 0 */
+@@ -414,6 +415,10 @@ static ssize_t
+ boot_vga_show(struct device *dev, struct device_attribute *attr, char *buf)
+ {
+ struct pci_dev *pdev = to_pci_dev(dev);
++ struct pci_dev *vga_dev = vga_default_device();
++
++ if (vga_dev)
++ return sprintf(buf, "%u\n", (pdev == vga_dev));
+
+ return sprintf(buf, "%u\n",
+ !!(pdev->resource[PCI_ROM_RESOURCE].flags &
+diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h
+index 9c3120d..759a25b 100644
+--- a/include/linux/vgaarb.h
++++ b/include/linux/vgaarb.h
+@@ -31,6 +31,7 @@
+ #ifndef LINUX_VGA_H
+ #define LINUX_VGA_H
+
++#include <video/vga.h>
+
+ /* Legacy VGA regions */
+ #define VGA_RSRC_NONE 0x00
+@@ -181,6 +182,7 @@ extern void vga_put(struct pci_dev *pdev, unsigned int rsrc);
+
+ #ifndef __ARCH_HAS_VGA_DEFAULT_DEVICE
+ extern struct pci_dev *vga_default_device(void);
++extern void vga_set_default_device(struct pci_dev *pdev);
+ #endif
+
+ /**
+--
+1.7.10
+
+--
+To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
+the body of a message to majordomo@vger.kernel.org
+More majordomo info at http://vger.kernel.org/majordomo-info.html
+Please read the FAQ at http://www.tux.org/lkml/
+
+Delivered-To: jwboyer@gmail.com
+Received: by 10.229.187.201 with SMTP id cx9csp141468qcb;
+ Mon, 16 Apr 2012 13:27:10 -0700 (PDT)
+Received: by 10.182.202.69 with SMTP id kg5mr18039202obc.35.1334608025784;
+ Mon, 16 Apr 2012 13:27:05 -0700 (PDT)
+Return-Path: <linux-kernel-owner@vger.kernel.org>
+Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67])
+ by mx.google.com with ESMTP id p9si5895556obv.34.2012.04.16.13.27.01;
+ Mon, 16 Apr 2012 13:27:05 -0700 (PDT)
+Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67;
+Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mail=linux-kernel-owner@vger.kernel.org
+Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
+ id S1755523Ab2DPU0b (ORCPT <rfc822;padmanabhlinux@gmail.com>
+ + 99 others); Mon, 16 Apr 2012 16:26:31 -0400
+Received: from mx1.redhat.com ([209.132.183.28]:15578 "EHLO mx1.redhat.com"
+ rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
+ id S1752993Ab2DPU00 (ORCPT <rfc822;linux-kernel@vger.kernel.org>);
+ Mon, 16 Apr 2012 16:26:26 -0400
+Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25])
+ by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3GKQPu2015452
+ (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
+ for <linux-kernel@vger.kernel.org>; Mon, 16 Apr 2012 16:26:25 -0400
+Received: from cavan.codon.org.uk (ovpn-113-122.phx2.redhat.com [10.3.113.122])
+ by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q3GKQOk2005441
+ (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);
+ Mon, 16 Apr 2012 16:26:25 -0400
+Received: from nat-pool-rdu.redhat.com ([66.187.233.202] helo=x220.boston.devel.redhat.com)
+ by cavan.codon.org.uk with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
+ (Exim 4.72)
+ (envelope-from <mjg@redhat.com>)
+ id 1SJsVC-0003T4-AS; Mon, 16 Apr 2012 21:26:22 +0100
+From: Matthew Garrett <mjg@redhat.com>
+To: linux-kernel@vger.kernel.org
+Cc: Matthew Garrett <mjg@redhat.com>, airlied@redhat.com
+Subject: [PATCH V2 2/4] vga-switcheroo: Use vga_default_device()
+Date: Mon, 16 Apr 2012 16:26:03 -0400
+Message-Id: <1334607965-9582-2-git-send-email-mjg@redhat.com>
+In-Reply-To: <1334607965-9582-1-git-send-email-mjg@redhat.com>
+References: <1334607965-9582-1-git-send-email-mjg@redhat.com>
+X-SA-Do-Not-Run: Yes
+X-SA-Exim-Connect-IP: 66.187.233.202
+X-SA-Exim-Mail-From: mjg@redhat.com
+X-SA-Exim-Scanned: No (on cavan.codon.org.uk); SAEximRunCond expanded to false
+X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25
+Sender: linux-kernel-owner@vger.kernel.org
+Precedence: bulk
+List-ID: <linux-kernel.vger.kernel.org>
+X-Mailing-List: linux-kernel@vger.kernel.org
+
+vga-switcheroo currently changes the default VGA device by fiddling with
+the IORESOURCE_ROM_SHADOW flag on the device. This isn't strictly accurate,
+since there's no guarantee that switching also changes the ROM decoding.
+Switch over to using the vgaarb functions for this.
+
+Signed-off-by: Matthew Garrett <mjg@redhat.com>
+Cc: airlied@redhat.com
+---
+ drivers/gpu/vga/vga_switcheroo.c | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
+index 9a2c805..44c664e 100644
+--- a/drivers/gpu/vga/vga_switcheroo.c
++++ b/drivers/gpu/vga/vga_switcheroo.c
+@@ -28,6 +28,8 @@
+ #include <linux/pci.h>
+ #include <linux/vga_switcheroo.h>
+
++#include <linux/vgaarb.h>
++
+ struct vga_switcheroo_client {
+ struct pci_dev *pdev;
+ struct fb_info *fb_info;
+@@ -140,7 +142,7 @@ int vga_switcheroo_register_client(struct pci_dev *pdev,
+ vgasr_priv.clients[index].reprobe = reprobe;
+ vgasr_priv.clients[index].can_switch = can_switch;
+ vgasr_priv.clients[index].id = -1;
+- if (pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW)
++ if (pdev == vga_default_device())
+ vgasr_priv.clients[index].active = true;
+
+ vgasr_priv.registered_clients |= (1 << index);
+@@ -248,9 +250,8 @@ static int vga_switchto_stage1(struct vga_switcheroo_client *new_client)
+ if (new_client->pwr_state == VGA_SWITCHEROO_OFF)
+ vga_switchon(new_client);
+
+- /* swap shadow resource to denote boot VGA device has changed so X starts on new device */
+- active->pdev->resource[PCI_ROM_RESOURCE].flags &= ~IORESOURCE_ROM_SHADOW;
+- new_client->pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW;
++ vga_set_default_device(new_client->pdev);
++
+ return 0;
+ }
+
+--
+1.7.10
+
+--
+To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
+the body of a message to majordomo@vger.kernel.org
+More majordomo info at http://vger.kernel.org/majordomo-info.html
+Please read the FAQ at http://www.tux.org/lkml/
+
+Delivered-To: jwboyer@gmail.com
+Received: by 10.229.187.201 with SMTP id cx9csp141463qcb;
+ Mon, 16 Apr 2012 13:27:04 -0700 (PDT)
+Received: by 10.60.10.137 with SMTP id i9mr18822682oeb.23.1334608019708;
+ Mon, 16 Apr 2012 13:26:59 -0700 (PDT)
+Return-Path: <linux-kernel-owner@vger.kernel.org>
+Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67])
+ by mx.google.com with ESMTP id h6si5711741obv.22.2012.04.16.13.26.58;
+ Mon, 16 Apr 2012 13:26:59 -0700 (PDT)
+Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67;
+Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mail=linux-kernel-owner@vger.kernel.org
+Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
+ id S1755396Ab2DPU0a (ORCPT <rfc822;padmanabhlinux@gmail.com>
+ + 99 others); Mon, 16 Apr 2012 16:26:30 -0400
+Received: from mx1.redhat.com ([209.132.183.28]:4863 "EHLO mx1.redhat.com"
+ rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
+ id S1754084Ab2DPU01 (ORCPT <rfc822;linux-kernel@vger.kernel.org>);
+ Mon, 16 Apr 2012 16:26:27 -0400
+Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23])
+ by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3GKQQrr007340
+ (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
+ Mon, 16 Apr 2012 16:26:26 -0400
+Received: from cavan.codon.org.uk (ovpn-113-122.phx2.redhat.com [10.3.113.122])
+ by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q3GKQPuK005698
+ (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);
+ Mon, 16 Apr 2012 16:26:26 -0400
+Received: from nat-pool-rdu.redhat.com ([66.187.233.202] helo=x220.boston.devel.redhat.com)
+ by cavan.codon.org.uk with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
+ (Exim 4.72)
+ (envelope-from <mjg@redhat.com>)
+ id 1SJsVD-0003T4-F3; Mon, 16 Apr 2012 21:26:23 +0100
+From: Matthew Garrett <mjg@redhat.com>
+To: linux-kernel@vger.kernel.org
+Cc: Matthew Garrett <mjg@redhat.com>, mingo@redhat.com, hpa@zytor.com
+Subject: [PATCH V2 3/4] x86: Use vga_default_device() when determining whether an fb is primary
+Date: Mon, 16 Apr 2012 16:26:04 -0400
+Message-Id: <1334607965-9582-3-git-send-email-mjg@redhat.com>
+In-Reply-To: <1334607965-9582-1-git-send-email-mjg@redhat.com>
+References: <1334607965-9582-1-git-send-email-mjg@redhat.com>
+X-SA-Do-Not-Run: Yes
+X-SA-Exim-Connect-IP: 66.187.233.202
+X-SA-Exim-Mail-From: mjg@redhat.com
+X-SA-Exim-Scanned: No (on cavan.codon.org.uk); SAEximRunCond expanded to false
+X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23
+Sender: linux-kernel-owner@vger.kernel.org
+Precedence: bulk
+List-ID: <linux-kernel.vger.kernel.org>
+X-Mailing-List: linux-kernel@vger.kernel.org
+
+IORESOURCE_ROM_SHADOW is not necessarily an indication that the hardware
+is the primary device. Add support for using the vgaarb functions and
+fall back if nothing's set them.
+
+Signed-off-by: Matthew Garrett <mjg@redhat.com>
+Cc: mingo@redhat.com
+Cc: hpa@zytor.com
+---
+ arch/x86/video/fbdev.c | 20 +++++++++++++++-----
+ 1 file changed, 15 insertions(+), 5 deletions(-)
+
+diff --git a/arch/x86/video/fbdev.c b/arch/x86/video/fbdev.c
+index c5ffb6a..d5644bb 100644
+--- a/arch/x86/video/fbdev.c
++++ b/arch/x86/video/fbdev.c
+@@ -9,24 +9,34 @@
+ #include <linux/fb.h>
+ #include <linux/pci.h>
+ #include <linux/module.h>
++#include <linux/vgaarb.h>
+
+ int fb_is_primary_device(struct fb_info *info)
+ {
+ struct device *device = info->device;
+ struct pci_dev *pci_dev = NULL;
++ struct pci_dev *default_device = vga_default_device();
+ struct resource *res = NULL;
+- int retval = 0;
+
+ if (device)
+ pci_dev = to_pci_dev(device);
+
+- if (pci_dev)
+- res = &pci_dev->resource[PCI_ROM_RESOURCE];
++ if (!pci_dev)
++ return 0;
++
++ if (default_device) {
++ if (pci_dev == default_device)
++ return 1;
++ else
++ return 0;
++ }
++
++ res = &pci_dev->resource[PCI_ROM_RESOURCE];
+
+ if (res && res->flags & IORESOURCE_ROM_SHADOW)
+- retval = 1;
++ return 1;
+
+- return retval;
++ return 0;
+ }
+ EXPORT_SYMBOL(fb_is_primary_device);
+ MODULE_LICENSE("GPL");
+--
+1.7.10
+
+--
+To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
+the body of a message to majordomo@vger.kernel.org
+More majordomo info at http://vger.kernel.org/majordomo-info.html
+Please read the FAQ at http://www.tux.org/lkml/
+
+Delivered-To: jwboyer@gmail.com
+Received: by 10.229.187.201 with SMTP id cx9csp141467qcb;
+ Mon, 16 Apr 2012 13:27:10 -0700 (PDT)
+Received: by 10.182.183.73 with SMTP id ek9mr17996942obc.15.1334608026429;
+ Mon, 16 Apr 2012 13:27:06 -0700 (PDT)
+Return-Path: <linux-kernel-owner@vger.kernel.org>
+Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67])
+ by mx.google.com with ESMTP id ry6si1466151obc.95.2012.04.16.13.27.02;
+ Mon, 16 Apr 2012 13:27:06 -0700 (PDT)
+Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67;
+Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mail=linux-kernel-owner@vger.kernel.org
+Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
+ id S1755405Ab2DPU0z (ORCPT <rfc822;padmanabhlinux@gmail.com>
+ + 99 others); Mon, 16 Apr 2012 16:26:55 -0400
+Received: from mx1.redhat.com ([209.132.183.28]:27749 "EHLO mx1.redhat.com"
+ rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
+ id S1755265Ab2DPU03 (ORCPT <rfc822;linux-kernel@vger.kernel.org>);
+ Mon, 16 Apr 2012 16:26:29 -0400
+Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25])
+ by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3GKQShl015458
+ (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
+ Mon, 16 Apr 2012 16:26:28 -0400
+Received: from cavan.codon.org.uk (ovpn-113-122.phx2.redhat.com [10.3.113.122])
+ by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q3GKQQwW005450
+ (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);
+ Mon, 16 Apr 2012 16:26:27 -0400
+Received: from nat-pool-rdu.redhat.com ([66.187.233.202] helo=x220.boston.devel.redhat.com)
+ by cavan.codon.org.uk with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
+ (Exim 4.72)
+ (envelope-from <mjg@redhat.com>)
+ id 1SJsVE-0003T4-Uv; Mon, 16 Apr 2012 21:26:25 +0100
+From: Matthew Garrett <mjg@redhat.com>
+To: linux-kernel@vger.kernel.org
+Cc: Matthew Garrett <mjg@redhat.com>, hpa@zytor.com,
+ matt.fleming@intel.com
+Subject: [PATCH V2 4/4] efifb: Implement vga_default_device()
+Date: Mon, 16 Apr 2012 16:26:05 -0400
+Message-Id: <1334607965-9582-4-git-send-email-mjg@redhat.com>
+In-Reply-To: <1334607965-9582-1-git-send-email-mjg@redhat.com>
+References: <1334607965-9582-1-git-send-email-mjg@redhat.com>
+X-SA-Do-Not-Run: Yes
+X-SA-Exim-Connect-IP: 66.187.233.202
+X-SA-Exim-Mail-From: mjg@redhat.com
+X-SA-Exim-Scanned: No (on cavan.codon.org.uk); SAEximRunCond expanded to false
+X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25
+Sender: linux-kernel-owner@vger.kernel.org
+Precedence: bulk
+List-ID: <linux-kernel.vger.kernel.org>
+X-Mailing-List: linux-kernel@vger.kernel.org
+
+EFI doesn't typically make use of the legacy VGA ROM, but it may still be
+configured to pass that through to a given video device. This may lead to
+an inaccurate choice of default video device. Add support to efifb to pick
+out the correct active video device.
+
+Signed-off-by: Matthew Garrett <mjg@redhat.com>
+Cc: hpa@zytor.com
+Cc: matt.fleming@intel.com
+---
+ arch/x86/include/asm/vga.h | 6 ++++
+ drivers/video/efifb.c | 77 ++++++++++++++++++++++++++++++++------------
+ 2 files changed, 63 insertions(+), 20 deletions(-)
+
+diff --git a/arch/x86/include/asm/vga.h b/arch/x86/include/asm/vga.h
+index c4b9dc2..2723c07 100644
+--- a/arch/x86/include/asm/vga.h
++++ b/arch/x86/include/asm/vga.h
+@@ -17,4 +17,10 @@
+ #define vga_readb(x) (*(x))
+ #define vga_writeb(x, y) (*(y) = (x))
+
++#if CONFIG_FB_EFI
++#define __ARCH_HAS_VGA_DEFAULT_DEVICE
++extern struct pci_dev *vga_default_device(void);
++extern void vga_set_default_device(struct pci_dev *pdev);
++#endif
++
+ #endif /* _ASM_X86_VGA_H */
+diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c
+index 784139a..66ed991 100644
+--- a/drivers/video/efifb.c
++++ b/drivers/video/efifb.c
+@@ -18,6 +18,8 @@
+
+ static bool request_mem_succeeded = false;
+
++static struct pci_dev *default_vga;
++
+ static struct fb_var_screeninfo efifb_defined __devinitdata = {
+ .activate = FB_ACTIVATE_NOW,
+ .height = -1,
+@@ -298,35 +300,70 @@ static struct fb_ops efifb_ops = {
+ .fb_imageblit = cfb_imageblit,
+ };
+
++struct pci_dev *vga_default_device(void)
++{
++ return default_vga;
++}
++
++void vga_set_default_device(struct pci_dev *pdev)
++{
++ default_vga = pdev;
++}
++
+ static int __init efifb_setup(char *options)
+ {
+ char *this_opt;
+ int i;
++ struct pci_dev *dev = NULL;
++
++ if (options && *options) {
++ while ((this_opt = strsep(&options, ",")) != NULL) {
++ if (!*this_opt) continue;
++
++ for (i = 0; i < M_UNKNOWN; i++) {
++ if (!strcmp(this_opt, dmi_list[i].optname) &&
++ dmi_list[i].base != 0) {
++ screen_info.lfb_base = dmi_list[i].base;
++ screen_info.lfb_linelength = dmi_list[i].stride;
++ screen_info.lfb_width = dmi_list[i].width;
++ screen_info.lfb_height = dmi_list[i].height;
++ }
++ }
++ if (!strncmp(this_opt, "base:", 5))
++ screen_info.lfb_base = simple_strtoul(this_opt+5, NULL, 0);
++ else if (!strncmp(this_opt, "stride:", 7))
++ screen_info.lfb_linelength = simple_strtoul(this_opt+7, NULL, 0) * 4;
++ else if (!strncmp(this_opt, "height:", 7))
++ screen_info.lfb_height = simple_strtoul(this_opt+7, NULL, 0);
++ else if (!strncmp(this_opt, "width:", 6))
++ screen_info.lfb_width = simple_strtoul(this_opt+6, NULL, 0);
++ }
++ }
+
+- if (!options || !*options)
+- return 0;
++ for_each_pci_dev(dev) {
++ int i;
+
+- while ((this_opt = strsep(&options, ",")) != NULL) {
+- if (!*this_opt) continue;
++ if ((dev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
++ continue;
+
+- for (i = 0; i < M_UNKNOWN; i++) {
+- if (!strcmp(this_opt, dmi_list[i].optname) &&
+- dmi_list[i].base != 0) {
+- screen_info.lfb_base = dmi_list[i].base;
+- screen_info.lfb_linelength = dmi_list[i].stride;
+- screen_info.lfb_width = dmi_list[i].width;
+- screen_info.lfb_height = dmi_list[i].height;
+- }
++ for (i=0; i < DEVICE_COUNT_RESOURCE; i++) {
++ resource_size_t start, end;
++
++ if (!(pci_resource_flags(dev, i) & IORESOURCE_MEM))
++ continue;
++
++ start = pci_resource_start(dev, i);
++ end = pci_resource_end(dev, i);
++
++ if (!start || !end)
++ continue;
++
++ if (screen_info.lfb_base >= start &&
++ (screen_info.lfb_base + screen_info.lfb_size) < end)
++ default_vga = dev;
+ }
+- if (!strncmp(this_opt, "base:", 5))
+- screen_info.lfb_base = simple_strtoul(this_opt+5, NULL, 0);
+- else if (!strncmp(this_opt, "stride:", 7))
+- screen_info.lfb_linelength = simple_strtoul(this_opt+7, NULL, 0) * 4;
+- else if (!strncmp(this_opt, "height:", 7))
+- screen_info.lfb_height = simple_strtoul(this_opt+7, NULL, 0);
+- else if (!strncmp(this_opt, "width:", 6))
+- screen_info.lfb_width = simple_strtoul(this_opt+6, NULL, 0);
+ }
++
+ return 0;
+ }
+
+--
+1.7.10
+
+--
+To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
+the body of a message to majordomo@vger.kernel.org
+More majordomo info at http://vger.kernel.org/majordomo-info.html
+Please read the FAQ at http://www.tux.org/lkml/
OpenPOWER on IntegriCloud