summaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
Diffstat (limited to 'target')
-rw-r--r--target/arm/bcm28xx/patches/4.1.10/0001-raspberry-pi-github.patch27711
1 files changed, 15542 insertions, 12169 deletions
diff --git a/target/arm/bcm28xx/patches/4.1.10/0001-raspberry-pi-github.patch b/target/arm/bcm28xx/patches/4.1.10/0001-raspberry-pi-github.patch
index ce089a8cd..b65e38285 100644
--- a/target/arm/bcm28xx/patches/4.1.10/0001-raspberry-pi-github.patch
+++ b/target/arm/bcm28xx/patches/4.1.10/0001-raspberry-pi-github.patch
@@ -1,276 +1,368 @@
-diff -Nur linux-4.1.6/Documentation/ABI/stable/sysfs-driver-w1_ds28ea00 linux-rpi/Documentation/ABI/stable/sysfs-driver-w1_ds28ea00
---- linux-4.1.6/Documentation/ABI/stable/sysfs-driver-w1_ds28ea00 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/Documentation/ABI/stable/sysfs-driver-w1_ds28ea00 2015-08-26 10:26:04.449256090 +0200
-@@ -0,0 +1,6 @@
-+What: /sys/bus/w1/devices/.../w1_seq
-+Date: Apr 2015
-+Contact: Matt Campbell <mattrcampbell@gmail.com>
-+Description: Support for the DS28EA00 chain sequence function
-+ see Documentation/w1/slaves/w1_therm for detailed information
-+Users: any user space application which wants to communicate with DS28EA00
-diff -Nur linux-4.1.6/Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt linux-rpi/Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt
---- linux-4.1.6/Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt 2015-08-26 10:26:04.513256993 +0200
-@@ -48,8 +48,8 @@
-
- bcm2835_i2s: i2s@7e203000 {
- compatible = "brcm,bcm2835-i2s";
-- reg = < 0x7e203000 0x20>,
-- < 0x7e101098 0x02>;
-+ reg = < 0x7e203000 0x24>,
-+ < 0x7e101098 0x08>;
-
- dmas = <&dma 2>,
- <&dma 3>;
-diff -Nur linux-4.1.6/Documentation/devicetree/bindings/sound/brcm,bcm2835-i2s.txt linux-rpi/Documentation/devicetree/bindings/sound/brcm,bcm2835-i2s.txt
---- linux-4.1.6/Documentation/devicetree/bindings/sound/brcm,bcm2835-i2s.txt 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/Documentation/devicetree/bindings/sound/brcm,bcm2835-i2s.txt 2015-08-26 10:26:04.549257500 +0200
-@@ -16,8 +16,8 @@
-
- bcm2835_i2s: i2s@7e203000 {
- compatible = "brcm,bcm2835-i2s";
-- reg = <0x7e203000 0x20>,
-- <0x7e101098 0x02>;
-+ reg = <0x7e203000 0x24>,
-+ <0x7e101098 0x08>;
-
- dmas = <&dma 2>,
- <&dma 3>;
-diff -Nur linux-4.1.6/Documentation/video4linux/bcm2835-v4l2.txt linux-rpi/Documentation/video4linux/bcm2835-v4l2.txt
---- linux-4.1.6/Documentation/video4linux/bcm2835-v4l2.txt 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/Documentation/video4linux/bcm2835-v4l2.txt 2015-08-26 10:26:04.645258854 +0200
-@@ -0,0 +1,60 @@
+diff -Nur linux-4.1.10/arch/arm/boot/dts/bcm2708_common.dtsi linux-rpi/arch/arm/boot/dts/bcm2708_common.dtsi
+--- linux-4.1.10/arch/arm/boot/dts/bcm2708_common.dtsi 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/bcm2708_common.dtsi 2015-10-07 16:40:31.000000000 +0200
+@@ -0,0 +1,321 @@
++/include/ "skeleton.dtsi"
+
-+BCM2835 (aka Raspberry Pi) V4L2 driver
-+======================================
++/ {
++ interrupt-parent = <&intc>;
+
-+1. Copyright
-+============
++ aliases {
++ audio = &audio;
++ sound = &sound;
++ soc = &soc;
++ dma = &dma;
++ intc = &intc;
++ watchdog = &watchdog;
++ random = &random;
++ mailbox = &mailbox;
++ gpio = &gpio;
++ uart0 = &uart0;
++ i2s = &i2s;
++ spi0 = &spi0;
++ i2c0 = &i2c0;
++ uart1 = &uart1;
++ mmc = &mmc;
++ i2c1 = &i2c1;
++ i2c2 = &i2c2;
++ usb = &usb;
++ leds = &leds;
++ fb = &fb;
++ vchiq = &vchiq;
++ thermal = &thermal;
++ clocks = &clocks;
++ };
+
-+Copyright © 2013 Raspberry Pi (Trading) Ltd.
++ /* Onboard audio */
++ audio: audio {
++ compatible = "brcm,bcm2835-audio";
++ brcm,pwm-channels = <8>;
++ status = "disabled";
++ };
+
-+2. License
-+==========
++ /* External sound card */
++ sound: sound {
++ };
+
-+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.
++ soc: soc {
++ compatible = "simple-bus";
++ #address-cells = <1>;
++ #size-cells = <1>;
+
-+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.
++ dma: dma@7e007000 {
++ compatible = "brcm,bcm2835-dma";
++ reg = <0x7e007000 0xf00>;
++ interrupts = <1 16>,
++ <1 17>,
++ <1 18>,
++ <1 19>,
++ <1 20>,
++ <1 21>,
++ <1 22>,
++ <1 23>,
++ <1 24>,
++ <1 25>,
++ <1 26>,
++ <1 27>;
+
-+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., 675 Mass Ave, Cambridge, MA 02139, USA.
++ #dma-cells = <1>;
++ brcm,dma-channel-mask = <0x0f35>;
++ };
+
-+3. Quick Start
-+==============
++ intc: interrupt-controller {
++ compatible = "brcm,bcm2708-armctrl-ic";
++ reg = <0x7e00b200 0x200>;
++ interrupt-controller;
++ #interrupt-cells = <2>;
++ };
+
-+You need a version 1.0 or later of v4l2-ctl, available from:
-+ git://git.linuxtv.org/v4l-utils.git
++ mailbox: mailbox@7e00b800 {
++ compatible = "brcm,bcm2835-mbox";
++ reg = <0x7e00b880 0x40>;
++ interrupts = <0 1>;
++ #mbox-cells = <0>;
++ };
+
-+$ sudo modprobe bcm2835-v4l2
++ watchdog: watchdog@7e100000 {
++ compatible = "brcm,bcm2835-pm-wdt";
++ reg = <0x7e100000 0x28>;
++ status = "disabled";
++ };
+
-+Turn on the overlay:
++ random: rng@7e104000 {
++ compatible = "brcm,bcm2835-rng";
++ reg = <0x7e104000 0x10>;
++ status = "disabled";
++ };
+
-+$ v4l2-ctl --overlay=1
++ gpio: gpio@7e200000 {
++ compatible = "brcm,bcm2835-gpio";
++ reg = <0x7e200000 0xb4>;
++ interrupts = <2 17>, <2 18>;
+
-+Turn off the overlay:
++ gpio-controller;
++ #gpio-cells = <2>;
+
-+$ v4l2-ctl --overlay=0
++ interrupt-controller;
++ #interrupt-cells = <2>;
++ };
+
-+Set the capture format for video:
++ uart0: uart@7e201000 {
++ compatible = "arm,pl011", "arm,primecell";
++ reg = <0x7e201000 0x1000>;
++ interrupts = <2 25>;
++ clocks = <&clk_uart0 &clk_apb_p>;
++ clock-names = "uartclk","apb_pclk";
++ arm,primecell-periphid = <0x00241011>; // For an explanation, see
++ // https://github.com/raspberrypi/linux/commit/13731d862cf5219216533a3b0de052cee4cc5038
++ status = "disabled";
++ };
+
-+$ v4l2-ctl --set-fmt-video=width=1920,height=1088,pixelformat=4
++ i2s: i2s@7e203000 {
++ compatible = "brcm,bcm2708-i2s";
++ reg = <0x7e203000 0x24>,
++ <0x7e101098 0x08>;
+
-+(Note: 1088 not 1080).
++ //dmas = <&dma 2>,
++ // <&dma 3>;
++ dma-names = "tx", "rx";
++ status = "disabled";
++ };
+
-+Capture:
++ spi0: spi@7e204000 {
++ compatible = "brcm,bcm2835-spi";
++ reg = <0x7e204000 0x1000>;
++ interrupts = <2 22>;
++ clocks = <&clk_core>;
++ #address-cells = <1>;
++ #size-cells = <0>;
++ status = "disabled";
++ /* the dma channels */
++ dmas = <&dma 6>, <&dma 7>;
++ dma-names = "tx", "rx";
++ /* the chipselects used - <0> means native GPIO
++ * add more gpios if necessary as <&gpio 6 1>
++ * (but do not forget to make them output!)
++ */
++ cs-gpios = <0>, <0>;
++ };
+
-+$ v4l2-ctl --stream-mmap=3 --stream-count=100 --stream-to=somefile.h264
++ i2c0: i2c@7e205000 {
++ compatible = "brcm,bcm2708-i2c";
++ reg = <0x7e205000 0x1000>;
++ interrupts = <2 21>;
++ clocks = <&clk_i2c>;
++ #address-cells = <1>;
++ #size-cells = <0>;
++ status = "disabled";
++ };
+
-+Stills capture:
++ pwm: pwm@7e20c000 {
++ compatible = "brcm,bcm2835-pwm";
++ reg = <0x7e20c000 0x28>;
++ clocks = <&clk_pwm>;
++ #pwm-cells = <2>;
++ status = "disabled";
++ };
+
-+$ v4l2-ctl --set-fmt-video=width=2592,height=1944,pixelformat=3
-+$ v4l2-ctl --stream-mmap=3 --stream-count=1 --stream-to=somefile.jpg
++ uart1: uart@7e215040 {
++ compatible = "brcm,bcm2835-aux-uart", "ns16550";
++ reg = <0x7e215040 0x40>;
++ interrupts = <1 29>;
++ clocks = <&clk_uart1>;
++ reg-shift = <2>;
++ no-loopback-test;
++ status = "disabled";
++ };
+
-+List of available formats:
++ mmc: mmc@7e300000 {
++ compatible = "brcm,bcm2835-mmc";
++ reg = <0x7e300000 0x100>;
++ interrupts = <2 30>;
++ clocks = <&clk_mmc>;
++ dmas = <&dma 11>,
++ <&dma 11>;
++ dma-names = "tx", "rx";
++ status = "disabled";
++ };
+
-+$ v4l2-ctl --list-formats
-diff -Nur linux-4.1.6/Documentation/w1/slaves/w1_therm linux-rpi/Documentation/w1/slaves/w1_therm
---- linux-4.1.6/Documentation/w1/slaves/w1_therm 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/Documentation/w1/slaves/w1_therm 2015-08-26 10:26:04.653258968 +0200
-@@ -11,12 +11,14 @@
- Description
- -----------
-
--w1_therm provides basic temperature conversion for ds18*20 devices.
-+w1_therm provides basic temperature conversion for ds18*20 devices, and the
-+ds28ea00 device.
- supported family codes:
- W1_THERM_DS18S20 0x10
- W1_THERM_DS1822 0x22
- W1_THERM_DS18B20 0x28
- W1_THERM_DS1825 0x3B
-+W1_THERM_DS28EA00 0x42
-
- Support is provided through the sysfs w1_slave file. Each open and
- read sequence will initiate a temperature conversion then provide two
-@@ -48,3 +50,10 @@
- maximum current draw of 1.5mA and that a 5k pullup resistor is not
- sufficient. The strong pullup is designed to provide the additional
- current required.
++ i2c1: i2c@7e804000 {
++ compatible = "brcm,bcm2708-i2c";
++ reg = <0x7e804000 0x1000>;
++ interrupts = <2 21>;
++ clocks = <&clk_i2c>;
++ #address-cells = <1>;
++ #size-cells = <0>;
++ status = "disabled";
++ };
+
-+The DS28EA00 provides an additional two pins for implementing a sequence
-+detection algorithm. This feature allows you to determine the physical
-+location of the chip in the 1-wire bus without needing pre-existing
-+knowledge of the bus ordering. Support is provided through the sysfs
-+w1_seq file. The file will contain a single line with an integer value
-+representing the device index in the bus starting at 0.
-diff -Nur linux-4.1.6/arch/arm/Kconfig linux-rpi/arch/arm/Kconfig
---- linux-4.1.6/arch/arm/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/arch/arm/Kconfig 2015-08-26 10:26:04.685259419 +0200
-@@ -314,6 +314,42 @@
- default ARCH_VERSATILE if !MMU
- default ARCH_MULTIPLATFORM if MMU
-
-+config ARCH_BCM2708
-+ bool "Broadcom BCM2708 family"
-+ select CPU_V6
-+ select ARM_AMBA
-+ select HAVE_SCHED_CLOCK
-+ select NEED_MACH_GPIO_H
-+ select NEED_MACH_MEMORY_H
-+ select COMMON_CLK
-+ select ARCH_HAS_CPUFREQ
-+ select GENERIC_CLOCKEVENTS
-+ select ARM_ERRATA_411920
-+ select MACH_BCM2708
-+ select VC4
-+ select FIQ
-+ help
-+ This enables support for Broadcom BCM2708 boards.
++ i2c2: i2c@7e805000 {
++ // Beware - this is shared with the HDMI module.
++ // Careless use may break (really) your display.
++ // Caveat emptor.
++ compatible = "brcm,bcm2708-i2c";
++ reg = <0x7e805000 0x1000>;
++ interrupts = <2 21>;
++ clocks = <&clk_i2c>;
++ #address-cells = <1>;
++ #size-cells = <0>;
++ status = "disabled";
++ };
+
-+config ARCH_BCM2709
-+ bool "Broadcom BCM2709 family"
-+ select ARCH_HAS_BARRIERS if SMP
-+ select CPU_V7
-+ select HAVE_SMP
-+ select ARM_AMBA
-+ select MIGHT_HAVE_CACHE_L2X0
-+ select HAVE_SCHED_CLOCK
-+ select NEED_MACH_MEMORY_H
-+ select NEED_MACH_IO_H
-+ select COMMON_CLK
-+ select ARCH_HAS_CPUFREQ
-+ select GENERIC_CLOCKEVENTS
-+ select MACH_BCM2709
-+ select VC4
-+ select FIQ
-+ help
-+ This enables support for Broadcom BCM2709 boards.
++ smi: smi@7e600000 {
++ compatible = "brcm,bcm2835-smi";
++ reg = <0x7e600000 0x44>, <0x7e1010b0 0x8>;
++ interrupts = <2 16>;
++ brcm,smi-clock-source = <6>;
++ brcm,smi-clock-divisor = <4>;
++ dmas = <&dma 4>;
++ dma-names = "rx-tx";
++ status = "disabled";
++ };
+
- config ARCH_MULTIPLATFORM
- bool "Allow multiple platforms to be selected"
- depends on MMU
-@@ -823,6 +859,9 @@
- # Kconfigs may be included either alphabetically (according to the
- # plat- suffix) or along side the corresponding mach-* source.
- #
-+source "arch/arm/mach-bcm2708/Kconfig"
-+source "arch/arm/mach-bcm2709/Kconfig"
++ usb: usb@7e980000 {
++ compatible = "brcm,bcm2708-usb";
++ reg = <0x7e980000 0x10000>,
++ <0x7e006000 0x1000>;
++ interrupts = <2 0>,
++ <1 9>;
++ };
+
- source "arch/arm/mach-mvebu/Kconfig"
-
- source "arch/arm/mach-alpine/Kconfig"
-diff -Nur linux-4.1.6/arch/arm/Kconfig.debug linux-rpi/arch/arm/Kconfig.debug
---- linux-4.1.6/arch/arm/Kconfig.debug 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/arch/arm/Kconfig.debug 2015-08-26 10:26:04.685259419 +0200
-@@ -1197,6 +1197,14 @@
- options; the platform specific options are deprecated
- and will be soon removed.
-
-+ config DEBUG_BCM2708_UART0
-+ bool "Broadcom BCM2708 UART0 (PL011)"
-+ depends on MACH_BCM2708
-+ help
-+ Say Y here if you want the debug print routines to direct
-+ their output to UART 0. The port must have been initialised
-+ by the boot-loader before use.
++ firmware: firmware {
++ compatible = "raspberrypi,bcm2835-firmware";
++ mboxes = <&mailbox>;
++ };
+
- endchoice
-
- config DEBUG_AT91_UART
-diff -Nur linux-4.1.6/arch/arm/Makefile linux-rpi/arch/arm/Makefile
---- linux-4.1.6/arch/arm/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/arch/arm/Makefile 2015-08-26 10:26:04.685259419 +0200
-@@ -142,6 +142,8 @@
-
- # Machine directory name. This list is sorted alphanumerically
- # by CONFIG_* macro name.
-+machine-$(CONFIG_ARCH_BCM2708) += bcm2708
-+machine-$(CONFIG_ARCH_BCM2709) += bcm2709
- machine-$(CONFIG_ARCH_ALPINE) += alpine
- machine-$(CONFIG_ARCH_AT91) += at91
- machine-$(CONFIG_ARCH_AXXIA) += axxia
-diff -Nur linux-4.1.6/arch/arm/boot/dts/Makefile linux-rpi/arch/arm/boot/dts/Makefile
---- linux-4.1.6/arch/arm/boot/dts/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/arch/arm/boot/dts/Makefile 2015-08-26 10:26:04.685259419 +0200
-@@ -1,5 +1,21 @@
- ifeq ($(CONFIG_OF),y)
-
-+dtb-$(CONFIG_BCM2708_DT) += bcm2708-rpi-b.dtb
-+dtb-$(CONFIG_BCM2708_DT) += bcm2708-rpi-b-plus.dtb
-+dtb-$(CONFIG_BCM2708_DT) += bcm2708-rpi-cm.dtb
-+dtb-$(CONFIG_BCM2709_DT) += bcm2709-rpi-2-b.dtb
++ leds: leds {
++ compatible = "gpio-leds";
++ };
+
-+# Raspberry Pi
-+ifeq ($(CONFIG_BCM2708_DT),y)
-+ RPI_DT_OVERLAYS=y
-+endif
-+ifeq ($(CONFIG_BCM2709_DT),y)
-+ RPI_DT_OVERLAYS=y
-+endif
-+ifeq ($(CONFIG_ARCH_BCM2835),y)
-+ RPI_DT_OVERLAYS=y
-+endif
++ fb: fb {
++ compatible = "brcm,bcm2708-fb";
++ firmware = <&firmware>;
++ status = "disabled";
++ };
+
- dtb-$(CONFIG_ARCH_ALPINE) += \
- alpine-db.dtb
- dtb-$(CONFIG_MACH_ASM9260) += \
-@@ -660,7 +676,18 @@
- mt6592-evb.dtb \
- mt8127-moose.dtb \
- mt8135-evbp1.dtb
++ vchiq: vchiq {
++ compatible = "brcm,bcm2835-vchiq";
++ reg = <0x7e00b840 0xf>;
++ interrupts = <0 2>;
++ cache-line-size = <32>;
++ firmware = <&firmware>;
++ };
+
-+targets += dtbs dtbs_install
-+targets += $(dtb-y)
++ thermal: thermal {
++ compatible = "brcm,bcm2835-thermal";
++ firmware = <&firmware>;
++ };
++ };
+
- endif
-
- always := $(dtb-y)
- clean-files := *.dtb
++ clocks: clocks {
++ compatible = "simple-bus";
++ #address-cells = <1>;
++ #size-cells = <0>;
+
-+# Enable fixups to support overlays on BCM2708 platforms
-+ifeq ($(RPI_DT_OVERLAYS),y)
-+ DTC_FLAGS ?= -@
-+endif
++ clk_mmc: clock@0 {
++ compatible = "fixed-clock";
++ reg = <0>;
++ #clock-cells = <0>;
++ clock-output-names = "mmc";
++ clock-frequency = <250000000>;
++ };
+
-+subdir-y += overlays
-diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts linux-rpi/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts
---- linux-4.1.6/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts 2015-08-26 10:26:04.693259532 +0200
-@@ -0,0 +1,129 @@
++ clk_i2c: clock@1 {
++ compatible = "fixed-clock";
++ reg = <1>;
++ #clock-cells = <0>;
++ clock-output-names = "i2c";
++ clock-frequency = <250000000>;
++ };
++
++ clk_core: clock@2 {
++ compatible = "fixed-clock";
++ reg = <2>;
++ #clock-cells = <0>;
++ clock-output-names = "core";
++ clock-frequency = <250000000>;
++ };
++
++ clk_uart0: clock@3 {
++ compatible = "fixed-clock";
++ reg = <3>;
++ #clock-cells = <0>;
++ clock-output-names = "uart0_pclk";
++ clock-frequency = <3000000>;
++ };
++
++ clk_apb_p: clock@4 {
++ compatible = "fixed-clock";
++ reg = <4>;
++ #clock-cells = <0>;
++ clock-output-names = "apb_pclk";
++ clock-frequency = <126000000>;
++ };
++
++ clk_pwm: clock@5 {
++ compatible = "fixed-clock";
++ reg = <3>;
++ #clock-cells = <0>;
++ clock-output-names = "pwm";
++ clock-frequency = <100000000>;
++ };
++
++ clk_uart1: clock@6 {
++ compatible = "fixed-factor-clock";
++ clocks = <&clk_core>;
++ #clock-cells = <0>;
++ clock-div = <1>;
++ clock-mult = <2>;
++ };
++ };
++
++ __overrides__ {
++ cache_line_size = <&vchiq>, "cache-line-size:0";
++ };
++};
+diff -Nur linux-4.1.10/arch/arm/boot/dts/bcm2708.dtsi linux-rpi/arch/arm/boot/dts/bcm2708.dtsi
+--- linux-4.1.10/arch/arm/boot/dts/bcm2708.dtsi 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/bcm2708.dtsi 2015-10-07 16:40:31.000000000 +0200
+@@ -0,0 +1,25 @@
++/include/ "bcm2708_common.dtsi"
++
++/ {
++ compatible = "brcm,bcm2708";
++ model = "BCM2708";
++
++ chosen {
++ /* No padding required - the boot loader can do that. */
++ bootargs = "";
++ };
++
++ soc {
++ ranges = <0x7e000000 0x20000000 0x01000000>;
++
++ arm-pmu {
++ compatible = "arm,arm1176-pmu";
++ };
++
++ gpiomem {
++ compatible = "brcm,bcm2835-gpiomem";
++ reg = <0x7e200000 0x1000>;
++ status = "okay";
++ };
++ };
++};
+diff -Nur linux-4.1.10/arch/arm/boot/dts/bcm2708-rpi-b.dts linux-rpi/arch/arm/boot/dts/bcm2708-rpi-b.dts
+--- linux-4.1.10/arch/arm/boot/dts/bcm2708-rpi-b.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/bcm2708-rpi-b.dts 2015-10-07 16:40:31.000000000 +0200
+@@ -0,0 +1,118 @@
+/dts-v1/;
+
+/include/ "bcm2708.dtsi"
+
+/ {
+ compatible = "brcm,bcm2708";
-+ model = "Raspberry Pi Model B+";
++ model = "Raspberry Pi Model B";
+};
+
+&gpio {
@@ -290,8 +382,8 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts linux-rpi/arch/ar
+ };
+
+ i2s_pins: i2s {
-+ brcm,pins = <18 19 20 21>;
-+ brcm,function = <4>; /* alt0 */
++ brcm,pins = <28 29 30 31>;
++ brcm,function = <6>; /* alt2 */
+ };
+};
+
@@ -355,13 +447,7 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts linux-rpi/arch/ar
+ act_led: act {
+ label = "led0";
+ linux,default-trigger = "mmc0";
-+ gpios = <&gpio 47 0>;
-+ };
-+
-+ pwr_led: pwr {
-+ label = "led1";
-+ linux,default-trigger = "input";
-+ gpios = <&gpio 35 0>;
++ gpios = <&gpio 16 1>;
+ };
+};
+
@@ -369,7 +455,6 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts linux-rpi/arch/ar
+ __overrides__ {
+ uart0 = <&uart0>,"status";
+ uart0_clkrate = <&clk_uart0>,"clock-frequency:0";
-+ uart1_clkrate = <&uart1>,"clock-frequency:0";
+ i2s = <&i2s>,"status";
+ spi = <&spi0>,"status";
+ i2c0 = <&i2c0>,"status";
@@ -384,26 +469,22 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts linux-rpi/arch/ar
+ act_led_activelow = <&act_led>,"gpios:8";
+ act_led_trigger = <&act_led>,"linux,default-trigger";
+
-+ pwr_led_gpio = <&pwr_led>,"gpios:4";
-+ pwr_led_activelow = <&pwr_led>,"gpios:8";
-+ pwr_led_trigger = <&pwr_led>,"linux,default-trigger";
-+
+ audio = <&audio>,"status";
+ watchdog = <&watchdog>,"status";
+ random = <&random>,"status";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2708-rpi-b.dts linux-rpi/arch/arm/boot/dts/bcm2708-rpi-b.dts
---- linux-4.1.6/arch/arm/boot/dts/bcm2708-rpi-b.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/bcm2708-rpi-b.dts 2015-08-26 10:26:04.693259532 +0200
-@@ -0,0 +1,119 @@
+diff -Nur linux-4.1.10/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts linux-rpi/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts
+--- linux-4.1.10/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts 2015-10-07 16:40:31.000000000 +0200
+@@ -0,0 +1,128 @@
+/dts-v1/;
+
+/include/ "bcm2708.dtsi"
+
+/ {
+ compatible = "brcm,bcm2708";
-+ model = "Raspberry Pi Model B";
++ model = "Raspberry Pi Model B+";
+};
+
+&gpio {
@@ -423,8 +504,8 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2708-rpi-b.dts linux-rpi/arch/arm/boo
+ };
+
+ i2s_pins: i2s {
-+ brcm,pins = <28 29 30 31>;
-+ brcm,function = <6>; /* alt2 */
++ brcm,pins = <18 19 20 21>;
++ brcm,function = <4>; /* alt0 */
+ };
+};
+
@@ -488,7 +569,13 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2708-rpi-b.dts linux-rpi/arch/arm/boo
+ act_led: act {
+ label = "led0";
+ linux,default-trigger = "mmc0";
-+ gpios = <&gpio 16 1>;
++ gpios = <&gpio 47 0>;
++ };
++
++ pwr_led: pwr {
++ label = "led1";
++ linux,default-trigger = "input";
++ gpios = <&gpio 35 0>;
+ };
+};
+
@@ -496,7 +583,6 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2708-rpi-b.dts linux-rpi/arch/arm/boo
+ __overrides__ {
+ uart0 = <&uart0>,"status";
+ uart0_clkrate = <&clk_uart0>,"clock-frequency:0";
-+ uart1_clkrate = <&uart1>,"clock-frequency:0";
+ i2s = <&i2s>,"status";
+ spi = <&spi0>,"status";
+ i2c0 = <&i2c0>,"status";
@@ -511,15 +597,19 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2708-rpi-b.dts linux-rpi/arch/arm/boo
+ act_led_activelow = <&act_led>,"gpios:8";
+ act_led_trigger = <&act_led>,"linux,default-trigger";
+
++ pwr_led_gpio = <&pwr_led>,"gpios:4";
++ pwr_led_activelow = <&pwr_led>,"gpios:8";
++ pwr_led_trigger = <&pwr_led>,"linux,default-trigger";
++
+ audio = <&audio>,"status";
+ watchdog = <&watchdog>,"status";
+ random = <&random>,"status";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2708-rpi-cm.dts linux-rpi/arch/arm/boot/dts/bcm2708-rpi-cm.dts
---- linux-4.1.6/arch/arm/boot/dts/bcm2708-rpi-cm.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/bcm2708-rpi-cm.dts 2015-08-26 10:26:04.693259532 +0200
-@@ -0,0 +1,93 @@
+diff -Nur linux-4.1.10/arch/arm/boot/dts/bcm2708-rpi-cm.dts linux-rpi/arch/arm/boot/dts/bcm2708-rpi-cm.dts
+--- linux-4.1.10/arch/arm/boot/dts/bcm2708-rpi-cm.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/bcm2708-rpi-cm.dts 2015-10-07 16:40:31.000000000 +0200
+@@ -0,0 +1,92 @@
+/dts-v1/;
+
+/include/ "bcm2708-rpi-cm.dtsi"
@@ -601,7 +691,6 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2708-rpi-cm.dts linux-rpi/arch/arm/bo
+ __overrides__ {
+ uart0 = <&uart0>,"status";
+ uart0_clkrate = <&clk_uart0>,"clock-frequency:0";
-+ uart1_clkrate = <&uart1>,"clock-frequency:0";
+ i2s = <&i2s>,"status";
+ spi = <&spi0>,"status";
+ i2c0 = <&i2c0>,"status";
@@ -613,9 +702,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2708-rpi-cm.dts linux-rpi/arch/arm/bo
+ core_freq = <&clk_core>,"clock-frequency:0";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi linux-rpi/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi
---- linux-4.1.6/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi 2015-08-26 10:26:04.693259532 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi linux-rpi/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi
+--- linux-4.1.10/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,30 @@
+/include/ "bcm2708.dtsi"
+
@@ -647,15 +736,15 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi linux-rpi/arch/arm/b
+ random = <&random>,"status";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2708.dtsi linux-rpi/arch/arm/boot/dts/bcm2708.dtsi
---- linux-4.1.6/arch/arm/boot/dts/bcm2708.dtsi 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/bcm2708.dtsi 2015-08-26 10:26:04.693259532 +0200
-@@ -0,0 +1,25 @@
+diff -Nur linux-4.1.10/arch/arm/boot/dts/bcm2709.dtsi linux-rpi/arch/arm/boot/dts/bcm2709.dtsi
+--- linux-4.1.10/arch/arm/boot/dts/bcm2709.dtsi 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/bcm2709.dtsi 2015-10-07 16:40:31.000000000 +0200
+@@ -0,0 +1,76 @@
+/include/ "bcm2708_common.dtsi"
+
+/ {
-+ compatible = "brcm,bcm2708";
-+ model = "BCM2708";
++ compatible = "brcm,bcm2709";
++ model = "BCM2709";
+
+ chosen {
+ /* No padding required - the boot loader can do that. */
@@ -663,10 +752,11 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2708.dtsi linux-rpi/arch/arm/boot/dts
+ };
+
+ soc {
-+ ranges = <0x7e000000 0x20000000 0x01000000>;
++ ranges = <0x7e000000 0x3f000000 0x01000000>;
+
+ arm-pmu {
-+ compatible = "arm,arm1176-pmu";
++ compatible = "arm,cortex-a7-pmu";
++ interrupts = <3 9>;
+ };
+
+ gpiomem {
@@ -675,317 +765,61 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2708.dtsi linux-rpi/arch/arm/boot/dts
+ status = "okay";
+ };
+ };
-+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2708_common.dtsi linux-rpi/arch/arm/boot/dts/bcm2708_common.dtsi
---- linux-4.1.6/arch/arm/boot/dts/bcm2708_common.dtsi 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/bcm2708_common.dtsi 2015-08-26 10:26:04.693259532 +0200
-@@ -0,0 +1,302 @@
-+/include/ "skeleton.dtsi"
-+
-+/ {
-+ interrupt-parent = <&intc>;
-+
-+ aliases {
-+ audio = &audio;
-+ sound = &sound;
-+ soc = &soc;
-+ dma = &dma;
-+ intc = &intc;
-+ watchdog = &watchdog;
-+ random = &random;
-+ mailbox = &mailbox;
-+ gpio = &gpio;
-+ uart0 = &uart0;
-+ i2s = &i2s;
-+ spi0 = &spi0;
-+ i2c0 = &i2c0;
-+ uart1 = &uart1;
-+ mmc = &mmc;
-+ i2c1 = &i2c1;
-+ i2c2 = &i2c2;
-+ usb = &usb;
-+ leds = &leds;
-+ fb = &fb;
-+ vchiq = &vchiq;
-+ thermal = &thermal;
-+ clocks = &clocks;
-+ };
+
-+ /* Onboard audio */
-+ audio: audio {
-+ compatible = "brcm,bcm2835-audio";
-+ brcm,pwm-channels = <8>;
-+ status = "disabled";
-+ };
-+
-+ /* External sound card */
-+ sound: sound {
-+ };
-+
-+ soc: soc {
-+ compatible = "simple-bus";
-+ #address-cells = <1>;
-+ #size-cells = <1>;
-+
-+ dma: dma@7e007000 {
-+ compatible = "brcm,bcm2835-dma";
-+ reg = <0x7e007000 0xf00>;
-+ interrupts = <1 16>,
-+ <1 17>,
-+ <1 18>,
-+ <1 19>,
-+ <1 20>,
-+ <1 21>,
-+ <1 22>,
-+ <1 23>,
-+ <1 24>,
-+ <1 25>,
-+ <1 26>,
-+ <1 27>;
-+
-+ #dma-cells = <1>;
-+ brcm,dma-channel-mask = <0x0f35>;
-+ };
-+
-+ intc: interrupt-controller {
-+ compatible = "brcm,bcm2708-armctrl-ic";
-+ reg = <0x7e00b200 0x200>;
-+ interrupt-controller;
-+ #interrupt-cells = <2>;
-+ };
-+
-+ mailbox: mailbox@7e00b800 {
-+ compatible = "brcm,bcm2835-mbox";
-+ reg = <0x7e00b880 0x40>;
-+ interrupts = <0 1>;
-+ #mbox-cells = <0>;
-+ };
-+
-+ watchdog: watchdog@7e100000 {
-+ compatible = "brcm,bcm2835-pm-wdt";
-+ reg = <0x7e100000 0x28>;
-+ status = "disabled";
-+ };
-+
-+ random: rng@7e104000 {
-+ compatible = "brcm,bcm2835-rng";
-+ reg = <0x7e104000 0x10>;
-+ status = "disabled";
-+ };
-+
-+ gpio: gpio@7e200000 {
-+ compatible = "brcm,bcm2835-gpio";
-+ reg = <0x7e200000 0xb4>;
-+ interrupts = <2 17>, <2 18>;
-+
-+ gpio-controller;
-+ #gpio-cells = <2>;
-+
-+ interrupt-controller;
-+ #interrupt-cells = <2>;
-+ };
-+
-+ uart0: uart@7e201000 {
-+ compatible = "arm,pl011", "arm,primecell";
-+ reg = <0x7e201000 0x1000>;
-+ interrupts = <2 25>;
-+ clocks = <&clk_uart0 &clk_apb_p>;
-+ clock-names = "uartclk","apb_pclk";
-+ arm,primecell-periphid = <0x00241011>; // For an explanation, see
-+ // https://github.com/raspberrypi/linux/commit/13731d862cf5219216533a3b0de052cee4cc5038
-+ status = "disabled";
-+ };
-+
-+ i2s: i2s@7e203000 {
-+ compatible = "brcm,bcm2708-i2s";
-+ reg = <0x7e203000 0x24>,
-+ <0x7e101098 0x08>;
-+
-+ //dmas = <&dma 2>,
-+ // <&dma 3>;
-+ dma-names = "tx", "rx";
-+ status = "disabled";
-+ };
-+
-+ spi0: spi@7e204000 {
-+ compatible = "brcm,bcm2835-spi";
-+ reg = <0x7e204000 0x1000>;
-+ interrupts = <2 22>;
-+ clocks = <&clk_core>;
-+ #address-cells = <1>;
-+ #size-cells = <0>;
-+ status = "disabled";
-+ /* the dma channels */
-+ dmas = <&dma 6>, <&dma 7>;
-+ dma-names = "tx", "rx";
-+ /* the chipselects used - <0> means native GPIO
-+ * add more gpios if necessary as <&gpio 6 1>
-+ * (but do not forget to make them output!)
-+ */
-+ cs-gpios = <0>, <0>;
-+ };
-+
-+ i2c0: i2c@7e205000 {
-+ compatible = "brcm,bcm2708-i2c";
-+ reg = <0x7e205000 0x1000>;
-+ interrupts = <2 21>;
-+ clocks = <&clk_i2c>;
-+ #address-cells = <1>;
-+ #size-cells = <0>;
-+ status = "disabled";
-+ };
-+
-+ pwm: pwm@7e20c000 {
-+ compatible = "brcm,bcm2835-pwm";
-+ reg = <0x7e20c000 0x28>;
-+ clocks = <&clk_pwm>;
-+ #pwm-cells = <2>;
-+ status = "disabled";
-+ };
-+
-+ uart1: uart@7e215040 {
-+ compatible = "brcm,bcm2835-aux-uart", "ns16550";
-+ reg = <0x7e215040 0x40>;
-+ interrupts = <1 29>;
-+ clock-frequency = <500000000>;
-+ reg-shift = <2>;
-+ no-loopback-test;
-+ status = "disabled";
-+ };
-+
-+ mmc: mmc@7e300000 {
-+ compatible = "brcm,bcm2835-mmc";
-+ reg = <0x7e300000 0x100>;
-+ interrupts = <2 30>;
-+ clocks = <&clk_mmc>;
-+ dmas = <&dma 11>,
-+ <&dma 11>;
-+ dma-names = "tx", "rx";
-+ status = "disabled";
-+ };
-+
-+ i2c1: i2c@7e804000 {
-+ compatible = "brcm,bcm2708-i2c";
-+ reg = <0x7e804000 0x1000>;
-+ interrupts = <2 21>;
-+ clocks = <&clk_i2c>;
-+ #address-cells = <1>;
-+ #size-cells = <0>;
-+ status = "disabled";
-+ };
-+
-+ i2c2: i2c@7e805000 {
-+ // Beware - this is shared with the HDMI module.
-+ // Careless use may break (really) your display.
-+ // Caveat emptor.
-+ compatible = "brcm,bcm2708-i2c";
-+ reg = <0x7e805000 0x1000>;
-+ interrupts = <2 21>;
-+ clocks = <&clk_i2c>;
-+ #address-cells = <1>;
-+ #size-cells = <0>;
-+ status = "disabled";
-+ };
-+
-+ usb: usb@7e980000 {
-+ compatible = "brcm,bcm2708-usb";
-+ reg = <0x7e980000 0x10000>,
-+ <0x7e006000 0x1000>;
-+ interrupts = <2 0>,
-+ <1 9>;
-+ };
-+
-+ firmware: firmware {
-+ compatible = "raspberrypi,bcm2835-firmware";
-+ mboxes = <&mailbox>;
-+ };
-+
-+ leds: leds {
-+ compatible = "gpio-leds";
-+ };
-+
-+ fb: fb {
-+ compatible = "brcm,bcm2708-fb";
-+ firmware = <&firmware>;
-+ status = "disabled";
-+ };
-+
-+ vchiq: vchiq {
-+ compatible = "brcm,bcm2835-vchiq";
-+ reg = <0x7e00b840 0xf>;
-+ interrupts = <0 2>;
-+ cache-line-size = <32>;
-+ firmware = <&firmware>;
-+ };
-+
-+ thermal: thermal {
-+ compatible = "brcm,bcm2835-thermal";
-+ firmware = <&firmware>;
-+ };
++ timer {
++ compatible = "arm,armv7-timer";
++ clock-frequency = <19200000>;
++ interrupts = <3 0>, // PHYS_SECURE_PPI
++ <3 1>, // PHYS_NONSECURE_PPI
++ <3 3>, // VIRT_PPI
++ <3 2>; // HYP_PPI
++ always-on;
+ };
+
-+ clocks: clocks {
-+ compatible = "simple-bus";
++ cpus: cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
-+ clk_mmc: clock@0 {
-+ compatible = "fixed-clock";
-+ reg = <0>;
-+ #clock-cells = <0>;
-+ clock-output-names = "mmc";
-+ clock-frequency = <250000000>;
-+ };
-+
-+ clk_i2c: clock@1 {
-+ compatible = "fixed-clock";
-+ reg = <1>;
-+ #clock-cells = <0>;
-+ clock-output-names = "i2c";
-+ clock-frequency = <250000000>;
-+ };
-+
-+ clk_core: clock@2 {
-+ compatible = "fixed-clock";
-+ reg = <2>;
-+ #clock-cells = <0>;
-+ clock-output-names = "core";
-+ clock-frequency = <250000000>;
++ v7_cpu0: cpu@0 {
++ device_type = "cpu";
++ compatible = "arm,cortex-a7";
++ reg = <0xf00>;
++ clock-frequency = <800000000>;
+ };
+
-+ clk_uart0: clock@3 {
-+ compatible = "fixed-clock";
-+ reg = <3>;
-+ #clock-cells = <0>;
-+ clock-output-names = "uart0_pclk";
-+ clock-frequency = <3000000>;
++ v7_cpu1: cpu@1 {
++ device_type = "cpu";
++ compatible = "arm,cortex-a7";
++ reg = <0xf01>;
++ clock-frequency = <800000000>;
+ };
+
-+ clk_apb_p: clock@4 {
-+ compatible = "fixed-clock";
-+ reg = <4>;
-+ #clock-cells = <0>;
-+ clock-output-names = "apb_pclk";
-+ clock-frequency = <126000000>;
++ v7_cpu2: cpu@2 {
++ device_type = "cpu";
++ compatible = "arm,cortex-a7";
++ reg = <0xf02>;
++ clock-frequency = <800000000>;
+ };
+
-+ clk_pwm: clock@5 {
-+ compatible = "fixed-clock";
-+ reg = <3>;
-+ #clock-cells = <0>;
-+ clock-output-names = "pwm";
-+ clock-frequency = <100000000>;
++ v7_cpu3: cpu@3 {
++ device_type = "cpu";
++ compatible = "arm,cortex-a7";
++ reg = <0xf03>;
++ clock-frequency = <800000000>;
+ };
+ };
+
+ __overrides__ {
-+ cache_line_size = <&vchiq>, "cache-line-size:0";
++ arm_freq = <&v7_cpu0>, "clock-frequency:0",
++ <&v7_cpu1>, "clock-frequency:0",
++ <&v7_cpu2>, "clock-frequency:0",
++ <&v7_cpu3>, "clock-frequency:0";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2709-rpi-2-b.dts linux-rpi/arch/arm/boot/dts/bcm2709-rpi-2-b.dts
---- linux-4.1.6/arch/arm/boot/dts/bcm2709-rpi-2-b.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/bcm2709-rpi-2-b.dts 2015-08-26 10:26:04.693259532 +0200
-@@ -0,0 +1,129 @@
+diff -Nur linux-4.1.10/arch/arm/boot/dts/bcm2709-rpi-2-b.dts linux-rpi/arch/arm/boot/dts/bcm2709-rpi-2-b.dts
+--- linux-4.1.10/arch/arm/boot/dts/bcm2709-rpi-2-b.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/bcm2709-rpi-2-b.dts 2015-10-07 16:40:31.000000000 +0200
+@@ -0,0 +1,128 @@
+/dts-v1/;
+
+/include/ "bcm2709.dtsi"
@@ -1091,7 +925,6 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2709-rpi-2-b.dts linux-rpi/arch/arm/b
+ __overrides__ {
+ uart0 = <&uart0>,"status";
+ uart0_clkrate = <&clk_uart0>,"clock-frequency:0";
-+ uart1_clkrate = <&uart1>,"clock-frequency:0";
+ i2s = <&i2s>,"status";
+ spi = <&spi0>,"status";
+ i2c0 = <&i2c0>,"status";
@@ -1115,89 +948,170 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2709-rpi-2-b.dts linux-rpi/arch/arm/b
+ random = <&random>,"status";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2709.dtsi linux-rpi/arch/arm/boot/dts/bcm2709.dtsi
---- linux-4.1.6/arch/arm/boot/dts/bcm2709.dtsi 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/bcm2709.dtsi 2015-08-26 10:26:04.693259532 +0200
-@@ -0,0 +1,76 @@
-+/include/ "bcm2708_common.dtsi"
-+
-+/ {
-+ compatible = "brcm,bcm2709";
-+ model = "BCM2709";
-+
-+ chosen {
-+ /* No padding required - the boot loader can do that. */
+diff -Nur linux-4.1.10/arch/arm/boot/dts/bcm2835.dtsi linux-rpi/arch/arm/boot/dts/bcm2835.dtsi
+--- linux-4.1.10/arch/arm/boot/dts/bcm2835.dtsi 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/arch/arm/boot/dts/bcm2835.dtsi 2015-10-07 16:40:31.000000000 +0200
+@@ -6,14 +6,15 @@
+ interrupt-parent = <&intc>;
+
+ chosen {
+- bootargs = "earlyprintk console=ttyAMA0";
+ bootargs = "";
-+ };
-+
-+ soc {
-+ ranges = <0x7e000000 0x3f000000 0x01000000>;
-+
-+ arm-pmu {
-+ compatible = "arm,cortex-a7-pmu";
-+ interrupts = <3 9>;
-+ };
-+
-+ gpiomem {
-+ compatible = "brcm,bcm2835-gpiomem";
-+ reg = <0x7e200000 0x1000>;
-+ status = "okay";
+ };
+
+- soc {
++ soc: soc {
+ compatible = "simple-bus";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges = <0x7e000000 0x20000000 0x02000000>;
++ dma-ranges = <0x40000000 0x00000000 0x20000000>;
+
+ timer@7e003000 {
+ compatible = "brcm,bcm2835-system-timer";
+@@ -50,16 +51,23 @@
+ #interrupt-cells = <2>;
+ };
+
+- watchdog@7e100000 {
++ watchdog: watchdog@7e100000 {
+ compatible = "brcm,bcm2835-pm-wdt";
+ reg = <0x7e100000 0x28>;
+ };
+
+- rng@7e104000 {
++ random: rng@7e104000 {
+ compatible = "brcm,bcm2835-rng";
+ reg = <0x7e104000 0x10>;
+ };
+
++ mailbox: mailbox@7e00b800 {
++ compatible = "brcm,bcm2835-mbox";
++ reg = <0x7e00b880 0x40>;
++ interrupts = <0 1>;
++ #mbox-cells = <0>;
+ };
-+ };
+
-+ timer {
-+ compatible = "arm,armv7-timer";
-+ clock-frequency = <19200000>;
-+ interrupts = <3 0>, // PHYS_SECURE_PPI
-+ <3 1>, // PHYS_NONSECURE_PPI
-+ <3 3>, // VIRT_PPI
-+ <3 2>; // HYP_PPI
-+ always-on;
+ gpio: gpio@7e200000 {
+ compatible = "brcm,bcm2835-gpio";
+ reg = <0x7e200000 0xb4>;
+@@ -83,7 +91,7 @@
+ #interrupt-cells = <2>;
+ };
+
+- uart@7e201000 {
++ uart0: uart@7e201000 {
+ compatible = "brcm,bcm2835-pl011", "arm,pl011", "arm,primecell";
+ reg = <0x7e201000 0x1000>;
+ interrupts = <2 25>;
+@@ -93,8 +101,8 @@
+
+ i2s: i2s@7e203000 {
+ compatible = "brcm,bcm2835-i2s";
+- reg = <0x7e203000 0x20>,
+- <0x7e101098 0x02>;
++ reg = <0x7e203000 0x24>,
++ <0x7e101098 0x08>;
+
+ dmas = <&dma 2>,
+ <&dma 3>;
+@@ -102,7 +110,7 @@
+ status = "disabled";
+ };
+
+- spi: spi@7e204000 {
++ spi0: spi@7e204000 {
+ compatible = "brcm,bcm2835-spi";
+ reg = <0x7e204000 0x1000>;
+ interrupts = <2 22>;
+@@ -122,11 +130,14 @@
+ status = "disabled";
+ };
+
+- sdhci: sdhci@7e300000 {
+- compatible = "brcm,bcm2835-sdhci";
++ mmc: mmc@7e300000 {
++ compatible = "brcm,bcm2835-mmc";
+ reg = <0x7e300000 0x100>;
+ interrupts = <2 30>;
+ clocks = <&clk_mmc>;
++ dmas = <&dma 11>,
++ <&dma 11>;
++ dma-names = "tx", "rx";
+ status = "disabled";
+ };
+
+@@ -140,10 +151,12 @@
+ status = "disabled";
+ };
+
+- usb@7e980000 {
+- compatible = "brcm,bcm2835-usb";
+- reg = <0x7e980000 0x10000>;
+- interrupts = <1 9>;
++ usb: usb@7e980000 {
++ compatible = "brcm,bcm2708-usb";
++ reg = <0x7e980000 0x10000>,
++ <0x7e006000 0x1000>;
++ interrupts = <2 0>,
++ <1 9>;
+ };
+
+ arm-pmu {
+@@ -161,7 +174,7 @@
+ reg = <0>;
+ #clock-cells = <0>;
+ clock-output-names = "mmc";
+- clock-frequency = <100000000>;
++ clock-frequency = <250000000>;
+ };
+
+ clk_i2c: clock@1 {
+diff -Nur linux-4.1.10/arch/arm/boot/dts/bcm2835-rpi-b.dts linux-rpi/arch/arm/boot/dts/bcm2835-rpi-b.dts
+--- linux-4.1.10/arch/arm/boot/dts/bcm2835-rpi-b.dts 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/arch/arm/boot/dts/bcm2835-rpi-b.dts 2015-10-07 16:40:31.000000000 +0200
+@@ -5,19 +5,28 @@
+ compatible = "raspberrypi,model-b", "brcm,bcm2835";
+ model = "Raspberry Pi Model B";
+
+- leds {
+- act {
+- gpios = <&gpio 16 1>;
+- };
+- };
+ };
+
+ &gpio {
+- pinctrl-0 = <&gpioout &alt0 &i2s_alt2 &alt3>;
+-
+- /* I2S interface */
+- i2s_alt2: i2s_alt2 {
++ i2s_pins: i2s {
+ brcm,pins = <28 29 30 31>;
+- brcm,function = <6>; /* alt2 */
++ brcm,function = <4>; /* alt0 */
+ };
++};
+
-+ cpus: cpus {
-+ #address-cells = <1>;
-+ #size-cells = <0>;
-+
-+ v7_cpu0: cpu@0 {
-+ device_type = "cpu";
-+ compatible = "arm,cortex-a7";
-+ reg = <0xf00>;
-+ clock-frequency = <800000000>;
-+ };
-+
-+ v7_cpu1: cpu@1 {
-+ device_type = "cpu";
-+ compatible = "arm,cortex-a7";
-+ reg = <0xf01>;
-+ clock-frequency = <800000000>;
-+ };
-+
-+ v7_cpu2: cpu@2 {
-+ device_type = "cpu";
-+ compatible = "arm,cortex-a7";
-+ reg = <0xf02>;
-+ clock-frequency = <800000000>;
-+ };
++&i2s {
++ #sound-dai-cells = <0>;
++ pinctrl-names = "default";
++ pinctrl-0 = <&i2s_pins>;
++};
+
-+ v7_cpu3: cpu@3 {
-+ device_type = "cpu";
-+ compatible = "arm,cortex-a7";
-+ reg = <0xf03>;
-+ clock-frequency = <800000000>;
-+ };
-+ };
++&act_led {
++ gpios = <&gpio 16 1>;
++};
+
++/ {
+ __overrides__ {
-+ arm_freq = <&v7_cpu0>, "clock-frequency:0",
-+ <&v7_cpu1>, "clock-frequency:0",
-+ <&v7_cpu2>, "clock-frequency:0",
-+ <&v7_cpu3>, "clock-frequency:0";
-+ };
-+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts linux-rpi/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
---- linux-4.1.6/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts 2015-08-26 10:26:04.693259532 +0200
++ act_led_gpio = <&act_led>,"gpios:4";
++ act_led_activelow = <&act_led>,"gpios:8";
+ };
+ };
+diff -Nur linux-4.1.10/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts linux-rpi/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
+--- linux-4.1.10/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts 2015-10-07 16:40:31.000000000 +0200
@@ -4,27 +4,40 @@
/ {
compatible = "raspberrypi,model-b-plus", "brcm,bcm2835";
@@ -1256,51 +1170,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts linux-rpi/arch/ar
+ pwr_led_trigger = <&pwr_led>,"linux,default-trigger";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2835-rpi-b.dts linux-rpi/arch/arm/boot/dts/bcm2835-rpi-b.dts
---- linux-4.1.6/arch/arm/boot/dts/bcm2835-rpi-b.dts 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/arch/arm/boot/dts/bcm2835-rpi-b.dts 2015-08-26 10:26:04.693259532 +0200
-@@ -5,19 +5,28 @@
- compatible = "raspberrypi,model-b", "brcm,bcm2835";
- model = "Raspberry Pi Model B";
-
-- leds {
-- act {
-- gpios = <&gpio 16 1>;
-- };
-- };
- };
-
- &gpio {
-- pinctrl-0 = <&gpioout &alt0 &i2s_alt2 &alt3>;
--
-- /* I2S interface */
-- i2s_alt2: i2s_alt2 {
-+ i2s_pins: i2s {
- brcm,pins = <28 29 30 31>;
-- brcm,function = <6>; /* alt2 */
-+ brcm,function = <4>; /* alt0 */
-+ };
-+};
-+
-+&i2s {
-+ #sound-dai-cells = <0>;
-+ pinctrl-names = "default";
-+ pinctrl-0 = <&i2s_pins>;
-+};
-+
-+&act_led {
-+ gpios = <&gpio 16 1>;
-+};
-+
-+/ {
-+ __overrides__ {
-+ act_led_gpio = <&act_led>,"gpios:4";
-+ act_led_activelow = <&act_led>,"gpios:8";
- };
- };
-diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2835-rpi.dtsi linux-rpi/arch/arm/boot/dts/bcm2835-rpi.dtsi
---- linux-4.1.6/arch/arm/boot/dts/bcm2835-rpi.dtsi 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/arch/arm/boot/dts/bcm2835-rpi.dtsi 2015-08-26 10:26:04.693259532 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/bcm2835-rpi.dtsi linux-rpi/arch/arm/boot/dts/bcm2835-rpi.dtsi
+--- linux-4.1.10/arch/arm/boot/dts/bcm2835-rpi.dtsi 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/arch/arm/boot/dts/bcm2835-rpi.dtsi 2015-10-07 16:40:31.000000000 +0200
@@ -1,51 +1,133 @@
/include/ "bcm2835.dtsi"
@@ -1453,133 +1325,18 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2835-rpi.dtsi linux-rpi/arch/arm/boot
+ audio = <&audio>,"status";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/bcm2835.dtsi linux-rpi/arch/arm/boot/dts/bcm2835.dtsi
---- linux-4.1.6/arch/arm/boot/dts/bcm2835.dtsi 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/arch/arm/boot/dts/bcm2835.dtsi 2015-08-26 10:26:04.693259532 +0200
-@@ -6,14 +6,15 @@
- interrupt-parent = <&intc>;
-
- chosen {
-- bootargs = "earlyprintk console=ttyAMA0";
-+ bootargs = "";
- };
-
-- soc {
-+ soc: soc {
- compatible = "simple-bus";
- #address-cells = <1>;
- #size-cells = <1>;
- ranges = <0x7e000000 0x20000000 0x02000000>;
-+ dma-ranges = <0x40000000 0x00000000 0x20000000>;
-
- timer@7e003000 {
- compatible = "brcm,bcm2835-system-timer";
-@@ -50,16 +51,23 @@
- #interrupt-cells = <2>;
- };
-
-- watchdog@7e100000 {
-+ watchdog: watchdog@7e100000 {
- compatible = "brcm,bcm2835-pm-wdt";
- reg = <0x7e100000 0x28>;
- };
-
-- rng@7e104000 {
-+ random: rng@7e104000 {
- compatible = "brcm,bcm2835-rng";
- reg = <0x7e104000 0x10>;
- };
-
-+ mailbox: mailbox@7e00b800 {
-+ compatible = "brcm,bcm2835-mbox";
-+ reg = <0x7e00b880 0x40>;
-+ interrupts = <0 1>;
-+ #mbox-cells = <0>;
-+ };
-+
- gpio: gpio@7e200000 {
- compatible = "brcm,bcm2835-gpio";
- reg = <0x7e200000 0xb4>;
-@@ -83,7 +91,7 @@
- #interrupt-cells = <2>;
- };
-
-- uart@7e201000 {
-+ uart0: uart@7e201000 {
- compatible = "brcm,bcm2835-pl011", "arm,pl011", "arm,primecell";
- reg = <0x7e201000 0x1000>;
- interrupts = <2 25>;
-@@ -93,8 +101,8 @@
-
- i2s: i2s@7e203000 {
- compatible = "brcm,bcm2835-i2s";
-- reg = <0x7e203000 0x20>,
-- <0x7e101098 0x02>;
-+ reg = <0x7e203000 0x24>,
-+ <0x7e101098 0x08>;
-
- dmas = <&dma 2>,
- <&dma 3>;
-@@ -102,7 +110,7 @@
- status = "disabled";
- };
-
-- spi: spi@7e204000 {
-+ spi0: spi@7e204000 {
- compatible = "brcm,bcm2835-spi";
- reg = <0x7e204000 0x1000>;
- interrupts = <2 22>;
-@@ -122,11 +130,14 @@
- status = "disabled";
- };
-
-- sdhci: sdhci@7e300000 {
-- compatible = "brcm,bcm2835-sdhci";
-+ mmc: mmc@7e300000 {
-+ compatible = "brcm,bcm2835-mmc";
- reg = <0x7e300000 0x100>;
- interrupts = <2 30>;
- clocks = <&clk_mmc>;
-+ dmas = <&dma 11>,
-+ <&dma 11>;
-+ dma-names = "tx", "rx";
- status = "disabled";
- };
-
-@@ -140,10 +151,12 @@
- status = "disabled";
- };
-
-- usb@7e980000 {
-- compatible = "brcm,bcm2835-usb";
-- reg = <0x7e980000 0x10000>;
-- interrupts = <1 9>;
-+ usb: usb@7e980000 {
-+ compatible = "brcm,bcm2708-usb";
-+ reg = <0x7e980000 0x10000>,
-+ <0x7e006000 0x1000>;
-+ interrupts = <2 0>,
-+ <1 9>;
- };
-
- arm-pmu {
-@@ -161,7 +174,7 @@
- reg = <0>;
- #clock-cells = <0>;
- clock-output-names = "mmc";
-- clock-frequency = <100000000>;
-+ clock-frequency = <250000000>;
- };
+diff -Nur linux-4.1.10/arch/arm/boot/dts/Makefile linux-rpi/arch/arm/boot/dts/Makefile
+--- linux-4.1.10/arch/arm/boot/dts/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/arch/arm/boot/dts/Makefile 2015-10-07 16:40:31.000000000 +0200
+@@ -1,5 +1,24 @@
+ ifeq ($(CONFIG_OF),y)
- clk_i2c: clock@1 {
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/Makefile linux-rpi/arch/arm/boot/dts/overlays/Makefile
---- linux-4.1.6/arch/arm/boot/dts/overlays/Makefile 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/Makefile 2015-08-26 10:26:04.721259926 +0200
-@@ -0,0 +1,66 @@
-+ifeq ($(CONFIG_OF),y)
-+
-+# Overlays for the Raspberry Pi platform
++dtb-$(CONFIG_BCM2708_DT) += bcm2708-rpi-b.dtb
++dtb-$(CONFIG_BCM2708_DT) += bcm2708-rpi-b-plus.dtb
++dtb-$(CONFIG_BCM2708_DT) += bcm2708-rpi-cm.dtb
++dtb-$(CONFIG_BCM2709_DT) += bcm2709-rpi-2-b.dtb
+
++# Raspberry Pi
+ifeq ($(CONFIG_BCM2708_DT),y)
+ RPI_DT_OVERLAYS=y
+endif
@@ -1589,683 +1346,34 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/Makefile linux-rpi/arch/arm/boo
+ifeq ($(CONFIG_ARCH_BCM2835),y)
+ RPI_DT_OVERLAYS=y
+endif
++ifeq ($(RPI_DT_OVERLAYS),y)
++ dts-dirs += overlays
++endif
+
-+dtb-$(RPI_DT_OVERLAYS) += ads7846-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += dht11-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += enc28j60-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += gpio-poweroff-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += hifiberry-amp-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += hifiberry-dac-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += hifiberry-dacplus-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += hifiberry-digi-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += hy28a-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += hy28b-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += i2c-rtc-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += i2s-mmap-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += iqaudio-dac-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += iqaudio-dacplus-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += lirc-rpi-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += mcp2515-can0-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += mcp2515-can1-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += mmc-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += mz61581-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += piscreen-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += pitft28-resistive-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += pps-gpio-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += pwm-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += pwm-2chan-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += rpi-dac-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += rpi-display-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += rpi-ft5406-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += rpi-proto-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += rpi-sense-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += sdhost-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += spi-bcm2708-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += spi-bcm2835-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += spi-dma-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += tinylcd35-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += uart1-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += vga666-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += w1-gpio-overlay.dtb
-+dtb-$(RPI_DT_OVERLAYS) += w1-gpio-pullup-overlay.dtb
+ dtb-$(CONFIG_ARCH_ALPINE) += \
+ alpine-db.dtb
+ dtb-$(CONFIG_MACH_ASM9260) += \
+@@ -660,7 +679,17 @@
+ mt6592-evb.dtb \
+ mt8127-moose.dtb \
+ mt8135-evbp1.dtb
+
+targets += dtbs dtbs_install
+targets += $(dtb-y)
+
-+endif
-+
-+always := $(dtb-y)
-+clean-files := *.dtb
+ endif
+
+ always := $(dtb-y)
++subdir-y := $(dts-dirs)
+ clean-files := *.dtb
+
+# Enable fixups to support overlays on BCM2708 platforms
+ifeq ($(RPI_DT_OVERLAYS),y)
+ DTC_FLAGS ?= -@
+endif
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/README linux-rpi/arch/arm/boot/dts/overlays/README
---- linux-4.1.6/arch/arm/boot/dts/overlays/README 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/README 2015-08-26 10:26:04.725259982 +0200
-@@ -0,0 +1,617 @@
-+Introduction
-+============
-+
-+This directory contains Device Tree overlays. Device Tree makes it possible
-+to support many hardware configurations with a single kernel and without the
-+need to explicitly load or blacklist kernel modules. Note that this isn't a
-+"pure" Device Tree configuration (c.f. MACH_BCM2835) - some on-board devices
-+are still configured by the board support code, but the intention is to
-+eventually reach that goal.
-+
-+On Raspberry Pi, Device Tree usage is controlled from /boot/config.txt. By
-+default, the Raspberry Pi kernel boots with device tree enabled. You can
-+completely disable DT usage (for now) by adding:
-+
-+ device_tree=
-+
-+to your config.txt, which should cause your Pi to revert to the old way of
-+doing things after a reboot.
-+
-+In /boot you will find a .dtb for each base platform. This describes the
-+hardware that is part of the Raspberry Pi board. The loader (start.elf and its
-+siblings) selects the .dtb file appropriate for the platform by name, and reads
-+it into memory. At this point, all of the optional interfaces (i2c, i2s, spi)
-+are disabled, but they can be enabled using Device Tree parameters:
-+
-+ dtparam=i2c=on,i2s=on,spi=on
-+
-+However, this shouldn't be necessary in many use cases because loading an
-+overlay that requires one of those interfaces will cause it to be enabled
-+automatically, and it is advisable to only enable interfaces if they are
-+needed.
-+
-+Configuring additional, optional hardware is done using Device Tree overlays
-+(see below).
-+
-+raspi-config
-+============
-+
-+The Advanced Options section of the raspi-config utility can enable and disable
-+Device Tree use, as well as toggling the I2C and SPI interfaces. Note that it
-+is possible to both enable an interface and blacklist the driver, if for some
-+reason you should want to defer the loading.
-+
-+Modules
-+=======
-+
-+As well as describing the hardware, Device Tree also gives enough information
-+to allow suitable driver modules to be located and loaded, with the corollary
-+that unneeded modules are not loaded. As a result it should be possible to
-+remove lines from /etc/modules, and /etc/modprobe.d/raspi-blacklist.conf can
-+have its contents deleted (or commented out).
-+
-+Using Overlays
-+==============
-+
-+Overlays are loaded using the "dtoverlay" directive. As an example, consider the
-+popular lirc-rpi module, the Linux Infrared Remote Control driver. In the
-+pre-DT world this would be loaded from /etc/modules, with an explicit
-+"modprobe lirc-rpi" command, or programmatically by lircd. With DT enabled,
-+this becomes a line in config.txt:
-+
-+ dtoverlay=lirc-rpi
-+
-+This causes the file /boot/overlays/lirc-rpi-overlay.dtb to be loaded. By
-+default it will use GPIOs 17 (out) and 18 (in), but this can be modified using
-+DT parameters:
-+
-+ dtoverlay=lirc-rpi,gpio_out_pin=17,gpio_in_pin=13
-+
-+Parameters always have default values, although in some cases (e.g. "w1-gpio")
-+it is necessary to provided multiple overlays in order to get the desired
-+behaviour. See the list of overlays below for a description of the parameters and their defaults.
-+
-+The Overlay and Parameter Reference
-+===================================
-+
-+N.B. When editing this file, please preserve the indentation levels to make it simple to parse
-+programmatically. NO HARD TABS.
-+
-+
-+Name: <The base DTB>
-+Info: Configures the base Raspberry Pi hardware
-+Load: <loaded automatically>
-+Params:
-+ audio Set to "on" to enable the onboard ALSA audio
-+ interface (default "off")
-+
-+ i2c_arm Set to "on" to enable the ARM's i2c interface
-+ (default "off")
-+
-+ i2c_vc Set to "on" to enable the i2c interface
-+ usually reserved for the VideoCore processor
-+ (default "off")
-+
-+ i2c An alias for i2c_arm
-+
-+ i2c_arm_baudrate Set the baudrate of the ARM's i2c interface
-+ (default "100000")
-+
-+ i2c_vc_baudrate Set the baudrate of the VideoCore i2c interface
-+ (default "100000")
-+
-+ i2c_baudrate An alias for i2c_arm_baudrate
-+
-+ i2s Set to "on" to enable the i2s interface
-+ (default "off")
-+
-+ spi Set to "on" to enable the spi interfaces
-+ (default "off")
-+
-+ random Set to "on" to enable the hardware random
-+ number generator (default "off")
-+
-+ uart0 Set to "off" to disable uart0 (default "on")
-+
-+ watchdog Set to "on" to enable the hardware watchdog
-+ (default "off")
-+
-+ act_led_trigger Choose which activity the LED tracks.
-+ Use "heartbeat" for a nice load indicator.
-+ (default "mmc")
-+
-+ act_led_activelow Set to "on" to invert the sense of the LED
-+ (default "off")
-+
-+ act_led_gpio Set which GPIO to use for the activity LED
-+ (in case you want to connect it to an external
-+ device)
-+ (default "16" on a non-Plus board, "47" on a
-+ Plus or Pi 2)
-+
-+ pwr_led_trigger
-+ pwr_led_activelow
-+ pwr_led_gpio
-+ As for act_led_*, but using the PWR LED.
-+ Not available on Model A/B boards.
-+
-+ N.B. It is recommended to only enable those interfaces that are needed.
-+ Leaving all interfaces enabled can lead to unwanted behaviour (i2c_vc
-+ interfering with Pi Camera, I2S and SPI hogging GPIO pins, etc.)
-+ Note also that i2c, i2c_arm and i2c_vc are aliases for the physical
-+ interfaces i2c0 and i2c1. Use of the numeric variants is still possible
-+ but deprecated because the ARM/VC assignments differ between board
-+ revisions. The same board-specific mapping applies to i2c_baudrate,
-+ and the other i2c baudrate parameters.
-+
-+
-+Name: ads7846
-+Info: ADS7846 Touch controller
-+Load: dtoverlay=ads7846,<param>=<val>
-+Params: cs SPI bus Chip Select (default 1)
-+ speed SPI bus speed (default 2Mhz, max 3.25MHz)
-+ penirq GPIO used for PENIRQ. REQUIRED
-+ penirq_pull Set GPIO pull (default 0=none, 2=pullup)
-+ swapxy Swap x and y axis
-+ xmin Minimum value on the X axis (default 0)
-+ ymin Minimum value on the Y axis (default 0)
-+ xmax Maximum value on the X axis (default 4095)
-+ ymax Maximum value on the Y axis (default 4095)
-+ pmin Minimum reported pressure value (default 0)
-+ pmax Maximum reported pressure value (default 65535)
-+ xohms Touchpanel sensitivity (X-plate resistance)
-+ (default 400)
-+
-+ penirq is required and usually xohms (60-100) has to be set as well.
-+ Apart from that, pmax (255) and swapxy are also common.
-+ The rest of the calibration can be done with xinput-calibrator.
-+ See: github.com/notro/fbtft/wiki/FBTFT-on-Raspian
-+ Device Tree binding document:
-+ www.kernel.org/doc/Documentation/devicetree/bindings/input/ads7846.txt
-+
-+
-+Name: bmp085_i2c-sensor
-+Info: Configures the BMP085/BMP180 digital barometric pressure and temperature
-+ sensors from Bosch Sensortec
-+Load: dtoverlay=bmp085_i2c-sensor
-+Params: <None>
-+
-+
-+Name: dht11
-+Info: Overlay for the DHT11/DHT21/DHT22 humidity/temperature sensors
-+ Also sometimes found with the part number(s) AM230x.
-+Load: dtoverlay=dht11,<param>=<val>
-+Params: gpiopin GPIO connected to the sensor's DATA output.
-+ (default 4)
-+
-+
-+[ The ds1307-rtc overlay has been deleted. See i2c-rtc. ]
-+
-+
-+Name: enc28j60
-+Info: Overlay for the Microchip ENC28J60 Ethernet Controller (SPI)
-+Load: dtoverlay=enc28j60,<param>=<val>
-+Params: int_pin GPIO used for INT (default 25)
-+
-+ speed SPI bus speed (default 12000000)
-+
-+
-+Name: gpio-poweroff
-+Info: Drives a GPIO high or low on reboot
-+Load: gpio-poweroff,<param>=<val>
-+Params: gpiopin GPIO for signalling (default 26)
-+
-+ active_low Set if the power control device requires a
-+ high->low transition to trigger a power-down.
-+ Note that this will require the support of a
-+ custom dt-blob.bin to prevent a power-down
-+ during the boot process, and that a reboot
-+ will also cause the pin to go low.
-+
-+
-+Name: hifiberry-amp
-+Info: Configures the HifiBerry Amp and Amp+ audio cards
-+Load: dtoverlay=hifiberry-amp
-+Params: <None>
-+
-+
-+Name: hifiberry-dac
-+Info: Configures the HifiBerry DAC audio card
-+Load: dtoverlay=hifiberry-dac
-+Params: <None>
-+
-+
-+Name: hifiberry-dacplus
-+Info: Configures the HifiBerry DAC+ audio card
-+Load: dtoverlay=hifiberry-dacplus
-+Params: <None>
-+
-+
-+Name: hifiberry-digi
-+Info: Configures the HifiBerry Digi audio card
-+Load: dtoverlay=hifiberry-digi
-+Params: <None>
-+
-+
-+Name: hy28a
-+Info: HY28A - 2.8" TFT LCD Display Module by HAOYU Electronics
-+ Default values match Texy's display shield
-+Load: dtoverlay=hy28a,<param>=<val>
-+Params: speed Display SPI bus speed
-+
-+ rotate Display rotation {0,90,180,270}
-+
-+ fps Delay between frame updates
-+
-+ debug Debug output level {0-7}
-+
-+ xohms Touchpanel sensitivity (X-plate resistance)
-+
-+ resetgpio GPIO used to reset controller
-+
-+ ledgpio GPIO used to control backlight
-+
-+
-+Name: hy28b
-+Info: HY28B - 2.8" TFT LCD Display Module by HAOYU Electronics
-+ Default values match Texy's display shield
-+Load: dtoverlay=hy28b,<param>=<val>
-+Params: speed Display SPI bus speed
-+
-+ rotate Display rotation {0,90,180,270}
-+
-+ fps Delay between frame updates
-+
-+ debug Debug output level {0-7}
-+
-+ xohms Touchpanel sensitivity (X-plate resistance)
-+
-+ resetgpio GPIO used to reset controller
-+
-+ ledgpio GPIO used to control backlight
-+
-+
-+Name: i2c-rtc
-+Info: Adds support for a number of I2C Real Time Clock devices
-+Load: dtoverlay=i2c-rtc,<param>
-+Params: ds1307 Select the DS1307 device
-+
-+ ds3231 Select the DS3231 device
-+
-+ mcp7941x Select the MCP7941x device
-+
-+ pcf2127 Select the PCF2127 device
-+
-+ pcf8523 Select the PCF8523 device
-+
-+ pcf8563 Select the PCF8563 device
-+
-+
-+Name: i2s-mmap
-+Info: Enables mmap support in the bcm2708-i2s driver
-+Load: dtoverlay=i2s-mmap
-+Params: <None>
-+
-+
-+Name: iqaudio-dac
-+Info: Configures the IQaudio DAC audio card
-+Load: dtoverlay=iqaudio-dac
-+Params: <None>
-+
-+
-+Name: iqaudio-dacplus
-+Info: Configures the IQaudio DAC+ audio card
-+Load: dtoverlay=iqaudio-dacplus
-+Params: <None>
-+
-+
-+Name: lirc-rpi
-+Info: Configures lirc-rpi (Linux Infrared Remote Control for Raspberry Pi)
-+ Consult the module documentation for more details.
-+Load: dtoverlay=lirc-rpi,<param>=<val>,...
-+Params: gpio_out_pin GPIO for output (default "17")
-+
-+ gpio_in_pin GPIO for input (default "18")
-+
-+ gpio_in_pull Pull up/down/off on the input pin
-+ (default "down")
-+
-+ sense Override the IR receive auto-detection logic:
-+ "0" = force active-high
-+ "1" = force active-low
-+ "-1" = use auto-detection
-+ (default "-1")
-+
-+ softcarrier Turn the software carrier "on" or "off"
-+ (default "on")
-+
-+ invert "on" = invert the output pin (default "off")
-+
-+ debug "on" = enable additional debug messages
-+ (default "off")
-+
-+
-+Name: mcp2515-can0
-+Info: Configures the MCP2515 CAN controller on spi0.0
-+Load: dtoverlay=mcp2515-can0,<param>=<val>
-+Params: oscillator Clock frequency for the CAN controller (Hz)
-+
-+ spimaxfrequency Maximum SPI frequence (Hz)
-+
-+ interrupt GPIO for interrupt signal
-+
-+
-+Name: mcp2515-can1
-+Info: Configures the MCP2515 CAN controller on spi0.1
-+Load: dtoverlay=mcp2515-can1,<param>=<val>
-+Params: oscillator Clock frequency for the CAN controller (Hz)
-+
-+ spimaxfrequency Maximum SPI frequence (Hz)
-+
-+ interrupt GPIO for interrupt signal
-+
-+
-+Name: mmc
-+Info: Selects the bcm2835-mmc SD/MMC driver, optionally with overclock
-+Load: dtoverlay=mmc,<param>=<val>
-+Params: overclock_50 Clock (in MHz) to use when the MMC framework
-+ requests 50MHz
-+ force_pio Disable DMA support
-+
-+
-+Name: mz61581
-+Info: MZ61581 display by Tontec
-+Load: dtoverlay=mz61581,<param>=<val>
-+Params: speed Display SPI bus speed
-+
-+ rotate Display rotation {0,90,180,270}
-+
-+ fps Delay between frame updates
-+
-+ debug Debug output level {0-7}
-+
-+ xohms Touchpanel sensitivity (X-plate resistance)
-+
-+
-+[ The pcf2127-rtc overlay has been deleted. See i2c-rtc. ]
-+
-+
-+[ The pcf8523-rtc overlay has been deleted. See i2c-rtc. ]
-+
-+
-+[ The pcf8563-rtc overlay has been deleted. See i2c-rtc. ]
-+
-+
-+Name: piscreen
-+Info: PiScreen display by OzzMaker.com
-+Load: dtoverlay=piscreen,<param>=<val>
-+Params: speed Display SPI bus speed
-+
-+ rotate Display rotation {0,90,180,270}
-+
-+ fps Delay between frame updates
-+
-+ debug Debug output level {0-7}
-+
-+ xohms Touchpanel sensitivity (X-plate resistance)
-+
-+
-+Name: pitft28-resistive
-+Info: Adafruit PiTFT 2.8" resistive touch screen
-+Load: dtoverlay=pitft28-resistive,<param>=<val>
-+Params: speed Display SPI bus speed
-+
-+ rotate Display rotation {0,90,180,270}
-+
-+ fps Delay between frame updates
-+
-+ debug Debug output level {0-7}
-+
-+
-+Name: pps-gpio
-+Info: Configures the pps-gpio (pulse-per-second time signal via GPIO).
-+Load: dtoverlay=pps-gpio,<param>=<val>
-+Params: gpiopin Input GPIO (default "18")
-+
-+
-+Name: pwm
-+Info: Configures a single PWM channel
-+ Legal pin,function combinations for each channel:
-+ PWM0: 12,4(Alt0) 18,2(Alt5) 40,4(Alt0) 52,5(Alt1)
-+ PWM1: 13,4(Alt0) 19,2(Alt5) 41,4(Alt0) 45,4(Alt0) 53,5(Alt1)
-+ N.B.:
-+ 1) Pin 18 is the only one available on all platforms, and
-+ it is the one used by the I2S audio interface.
-+ Pins 12 and 13 might be better choices on an A+, B+ or Pi2.
-+ 2) The onboard analogue audio output uses both PWM channels.
-+ 3) So be careful mixing audio and PWM.
-+ 4) Currently the clock must have been enabled and configured
-+ by other means.
-+Load: dtoverlay=pwm-2chan,<param>=<val>
-+Load: dtoverlay=pwm,<param>=<val>
-+Params: pin Output pin (default 18) - see table
-+ func Pin function (default 2 = Alt5) - see above
-+ clock PWM clock frequency (informational)
-+
-+
-+Name: pwm-2chan
-+Info: Configures both PWM channels
-+ Legal pin,function combinations for each channel:
-+ PWM0: 12,4(Alt0) 18,2(Alt5) 40,4(Alt0) 52,5(Alt1)
-+ PWM1: 13,4(Alt0) 19,2(Alt5) 41,4(Alt0) 45,4(Alt0) 53,5(Alt1)
-+ N.B.:
-+ 1) Pin 18 is the only one available on all platforms, and
-+ it is the one used by the I2S audio interface.
-+ Pins 12 and 13 might be better choices on an A+, B+ or Pi2.
-+ 2) The onboard analogue audio output uses both PWM channels.
-+ 3) So be careful mixing audio and PWM.
-+ 4) Currently the clock must have been enabled and configured
-+ by other means.
-+Load: dtoverlay=pwm-2chan,<param>=<val>
-+Params: pin Output pin (default 18) - see table
-+ pin2 Output pin for other channel (default 19)
-+ func Pin function (default 2 = Alt5) - see above
-+ func2 Function for pin2 (default 2 = Alt5)
-+ clock PWM clock frequency (informational)
-+
-+
-+Name: rpi-dac
-+Info: Configures the RPi DAC audio card
-+Load: dtoverlay=rpi-dac
-+Params: <None>
-+
-+
-+Name: rpi-display
-+Info: RPi-Display - 2.8" Touch Display by Watterott
-+Load: dtoverlay=rpi-display,<param>=<val>
-+Params: speed Display SPI bus speed
-+
-+ rotate Display rotation {0,90,180,270}
-+
-+ fps Delay between frame updates
-+
-+ debug Debug output level {0-7}
-+
-+ xohms Touchpanel sensitivity (X-plate resistance)
-+
-+
-+Name: rpi-ft5406
-+Info: Official Raspberry Pi display touchscreen
-+Load: dtoverlay=rpi-ft5406
-+Params: <None>
-+
-+
-+Name: rpi-proto
-+Info: Configures the RPi Proto audio card
-+Load: dtoverlay=rpi-proto
-+Params: <None>
-+
-+
-+Name: rpi-sense
-+Info: Raspberry Pi Sense HAT
-+Load: dtoverlay=rpi-sense
-+Params: <None>
-+
-+
-+Name: sdhost
-+Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock
-+Load: dtoverlay=sdhost,<param>=<val>
-+Params: overclock_50 Clock (in MHz) to use when the MMC framework
-+ requests 50MHz
-+
-+ force_pio Disable DMA support (default off)
-+
-+ pio_limit Number of blocks above which to use DMA
-+ (default 1)
-+
-+ debug Enable debug output (default off)
-+
-+
-+Name: spi-bcm2708
-+Info: Selects the bcm2708-spi SPI driver
-+Load: dtoverlay=spi-bcm2708
-+Params: <None>
-+
-+
-+Name: spi-bcm2835
-+Info: Selects the bcm2835-spi SPI driver
-+Load: dtoverlay=spi-bcm2835
-+Params: <None>
-+
-+
-+Name: spi-dma
-+Info: enables dma modes for spi-bcm2835
-+Load: dtoverlay=spi-dma
-+Params: <None>
-+
-+
-+Name: tinylcd35
-+Info: 3.5" Color TFT Display by www.tinylcd.com
-+ Options: Touch, RTC, keypad
-+Load: dtoverlay=tinylcd35,<param>=<val>
-+Params: speed Display SPI bus speed
-+
-+ rotate Display rotation {0,90,180,270}
-+
-+ fps Delay between frame updates
-+
-+ debug Debug output level {0-7}
-+
-+ touch Enable touch panel
-+
-+ touchgpio Touch controller IRQ GPIO
-+
-+ xohms Touchpanel: Resistance of X-plate in ohms
-+
-+ rtc-pcf PCF8563 Real Time Clock
-+
-+ rtc-ds DS1307 Real Time Clock
-+
-+ keypad Enable keypad
-+
-+ Examples:
-+ Display with touchpanel, PCF8563 RTC and keypad:
-+ dtoverlay=tinylcd35,touch,rtc-pcf,keypad
-+ Old touch display:
-+ dtoverlay=tinylcd35,touch,touchgpio=3
-+
-+
-+Name: uart1
-+Info: Enable uart1 in place of uart0
-+Load: dtoverlay=uart1,<param>=<val>
-+Params: txd1_pin GPIO pin for TXD1 (14, 32 or 40 - default 14)
-+
-+ rxd1_pin GPIO pin for RXD1 (15, 33 or 41 - default 15)
-+
-+
-+Name: vga666
-+Info: Overlay for the Fen Logic VGA666 board
-+ This uses GPIOs 2-21 (so no I2C), and activates the output 2-3 seconds
-+ after the kernel has started.
-+Load: dtoverlay=vga666
-+Params: <None>
-+
-+
-+Name: w1-gpio
-+Info: Configures the w1-gpio Onewire interface module.
-+ Use this overlay if you *don't* need a GPIO to drive an external pullup.
-+Load: dtoverlay=w1-gpio,<param>=<val>
-+Params: gpiopin GPIO for I/O (default "4")
-+
-+ pullup Non-zero, "on", or "y" to enable the parasitic
-+ power (2-wire, power-on-data) feature
-+
-+
-+Name: w1-gpio-pullup
-+Info: Configures the w1-gpio Onewire interface module.
-+ Use this overlay if you *do* need a GPIO to drive an external pullup.
-+Load: dtoverlay=w1-gpio-pullup,<param>=<val>,...
-+Params: gpiopin GPIO for I/O (default "4")
-+
-+ pullup Non-zero, "on", or "y" to enable the parasitic
-+ power (2-wire, power-on-data) feature
-+
-+ extpullup GPIO for external pullup (default "5")
-+
-+
-+Troubleshooting
-+===============
-+
-+If you are experiencing problems that you think are DT-related, enable DT
-+diagnostic output by adding this to /boot/config.txt:
-+
-+ dtdebug=on
-+
-+and rebooting. Then run:
-+
-+ sudo vcdbg log msg
-+
-+and look for relevant messages.
-+
-+Further reading
-+===============
-+
-+This is only meant to be a quick introduction to the subject of Device Tree on
-+Raspberry Pi. There is a more complete explanation here:
-+
-+http://www.raspberrypi.org/documentation/configuration/device-tree.md
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/ads7846-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/ads7846-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/ads7846-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/ads7846-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/ads7846-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/ads7846-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/ads7846-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/ads7846-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,83 @@
+/*
+ * Generic Device Tree overlay for the ADS7846 touch controller
@@ -2350,9 +1458,67 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/ads7846-overlay.dts linux-rpi/a
+ xohms = <&ads7846>,"ti,x-plate-ohms;0";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/bmp085_i2c-sensor-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/bmp085_i2c-sensor-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/bmp085_i2c-sensor-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/bmp085_i2c-sensor-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/at86rf233-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/at86rf233-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/at86rf233-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/at86rf233-overlay.dts 2015-10-07 16:40:31.000000000 +0200
+@@ -0,0 +1,54 @@
++/dts-v1/;
++/plugin/;
++
++/* Overlay for Atmel AT86RF233 IEEE 802.15.4 WPAN transceiver on spi0.0 */
++
++/ {
++ compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2708", "brcm,bcm2709";
++
++ fragment@0 {
++ target = <&spi0>;
++ __overlay__ {
++ #address-cells = <1>;
++ #size-cells = <0>;
++
++ status = "okay";
++
++ spidev@0{
++ status = "disabled";
++ };
++
++ lowpan0: at86rf233@0 {
++ compatible = "atmel,at86rf233";
++ reg = <0>;
++ interrupt-parent = <&gpio>;
++ interrupts = <23 4>; /* active high */
++ reset-gpio = <&gpio 24 1>;
++ sleep-gpio = <&gpio 25 1>;
++ spi-max-frequency = <7500000>;
++ xtal-trim = /bits/ 8 <0xf>;
++ };
++ };
++ };
++
++ fragment@1 {
++ target = <&gpio>;
++ __overlay__ {
++ lowpan0_pins: lowpan0_pins {
++ brcm,pins = <23 24 25>;
++ brcm,function = <0 1 1>; /* in out out */
++ };
++ };
++ };
++
++ __overrides__ {
++ interrupt = <&lowpan0>, "interrupts:0",
++ <&lowpan0_pins>, "brcm,pins:0";
++ reset = <&lowpan0>, "reset-gpio:4",
++ <&lowpan0_pins>, "brcm,pins:4";
++ sleep = <&lowpan0>, "sleep-gpio:4",
++ <&lowpan0_pins>, "brcm,pins:8";
++ speed = <&lowpan0>, "spi-max-frequency:0";
++ trim = <&lowpan0>, "xtal-trim.0";
++ };
++};
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/bmp085_i2c-sensor-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/bmp085_i2c-sensor-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/bmp085_i2c-sensor-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/bmp085_i2c-sensor-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,23 @@
+// Definitions for BMP085/BMP180 digital barometric pressure and temperature sensors from Bosch Sensortec
+/dts-v1/;
@@ -2377,9 +1543,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/bmp085_i2c-sensor-overlay.dts l
+ };
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/dht11-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/dht11-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/dht11-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/dht11-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/dht11-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/dht11-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/dht11-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/dht11-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,39 @@
+/*
+ * Overlay for the DHT11/21/22 humidity/temperature sensor modules.
@@ -2420,9 +1586,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/dht11-overlay.dts linux-rpi/arc
+ <&dht11>,"gpios:4";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/enc28j60-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/enc28j60-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/enc28j60-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/enc28j60-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/enc28j60-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/enc28j60-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/enc28j60-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/enc28j60-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,50 @@
+// Overlay for the Microchip ENC28J60 Ethernet Controller
+/dts-v1/;
@@ -2474,9 +1640,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/enc28j60-overlay.dts linux-rpi/
+ speed = <&eth1>, "spi-max-frequency:0";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/gpio-poweroff-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/gpio-poweroff-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/gpio-poweroff-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/gpio-poweroff-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/gpio-poweroff-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/gpio-poweroff-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/gpio-poweroff-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/gpio-poweroff-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,34 @@
+// Definitions for gpio-poweroff module
+/dts-v1/;
@@ -2512,9 +1678,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/gpio-poweroff-overlay.dts linux
+ active_low = <&power_ctrl>,"gpios:8";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/hifiberry-amp-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/hifiberry-amp-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/hifiberry-amp-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/hifiberry-amp-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/hifiberry-amp-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/hifiberry-amp-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/hifiberry-amp-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/hifiberry-amp-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,39 @@
+// Definitions for HiFiBerry Amp/Amp+
+/dts-v1/;
@@ -2555,9 +1721,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/hifiberry-amp-overlay.dts linux
+ };
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/hifiberry-dac-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/hifiberry-dac-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/hifiberry-dac-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/hifiberry-dac-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/hifiberry-dac-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/hifiberry-dac-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/hifiberry-dac-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/hifiberry-dac-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,34 @@
+// Definitions for HiFiBerry DAC
+/dts-v1/;
@@ -2593,10 +1759,10 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/hifiberry-dac-overlay.dts linux
+ };
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/hifiberry-dacplus-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/hifiberry-dacplus-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/hifiberry-dacplus-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/hifiberry-dacplus-overlay.dts 2015-08-26 10:26:04.725259982 +0200
-@@ -0,0 +1,39 @@
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/hifiberry-dacplus-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/hifiberry-dacplus-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/hifiberry-dacplus-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/hifiberry-dacplus-overlay.dts 2015-10-07 16:40:31.000000000 +0200
+@@ -0,0 +1,50 @@
+// Definitions for HiFiBerry DAC+
+/dts-v1/;
+/plugin/;
@@ -2605,6 +1771,16 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/hifiberry-dacplus-overlay.dts l
+ compatible = "brcm,bcm2708";
+
+ fragment@0 {
++ target-path = "/clocks";
++ __overlay__ {
++ dacpro_osc: dacpro_osc {
++ compatible = "hifiberry,dacpro-clk";
++ #clock-cells = <0>;
++ };
++ };
++ };
++
++ fragment@1 {
+ target = <&sound>;
+ __overlay__ {
+ compatible = "hifiberry,hifiberry-dacplus";
@@ -2613,14 +1789,14 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/hifiberry-dacplus-overlay.dts l
+ };
+ };
+
-+ fragment@1 {
++ fragment@2 {
+ target = <&i2s>;
+ __overlay__ {
+ status = "okay";
+ };
+ };
+
-+ fragment@2 {
++ fragment@3 {
+ target = <&i2c1>;
+ __overlay__ {
+ #address-cells = <1>;
@@ -2631,14 +1807,15 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/hifiberry-dacplus-overlay.dts l
+ #sound-dai-cells = <0>;
+ compatible = "ti,pcm5122";
+ reg = <0x4d>;
++ clocks = <&dacpro_osc>;
+ status = "okay";
+ };
+ };
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/hifiberry-digi-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/hifiberry-digi-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/hifiberry-digi-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/hifiberry-digi-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/hifiberry-digi-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/hifiberry-digi-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/hifiberry-digi-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/hifiberry-digi-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,39 @@
+// Definitions for HiFiBerry Digi
+/dts-v1/;
@@ -2679,9 +1856,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/hifiberry-digi-overlay.dts linu
+ };
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/hy28a-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/hy28a-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/hy28a-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/hy28a-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/hy28a-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/hy28a-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/hy28a-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/hy28a-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,87 @@
+/*
+ * Device Tree overlay for HY28A display
@@ -2770,9 +1947,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/hy28a-overlay.dts linux-rpi/arc
+ <&hy28a_pins>, "brcm,pins:2";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/hy28b-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/hy28b-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/hy28b-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/hy28b-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/hy28b-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/hy28b-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/hy28b-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/hy28b-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,142 @@
+/*
+ * Device Tree overlay for HY28b display shield by Texy
@@ -2916,9 +2093,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/hy28b-overlay.dts linux-rpi/arc
+ <&hy28b_pins>, "brcm,pins:2";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,55 @@
+// Definitions for several I2C based Real Time Clocks
+/dts-v1/;
@@ -2975,9 +2152,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts linux-rpi/a
+ pcf8563 = <&pcf8563>,"status";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/i2s-mmap-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/i2s-mmap-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/i2s-mmap-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/i2s-mmap-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/i2s-mmap-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/i2s-mmap-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/i2s-mmap-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/i2s-mmap-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,13 @@
+/dts-v1/;
+/plugin/;
@@ -2992,9 +2169,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/i2s-mmap-overlay.dts linux-rpi/
+ };
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/iqaudio-dac-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/iqaudio-dac-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/iqaudio-dac-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/iqaudio-dac-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/iqaudio-dac-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/iqaudio-dac-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/iqaudio-dac-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/iqaudio-dac-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,39 @@
+// Definitions for IQaudIO DAC
+/dts-v1/;
@@ -3035,9 +2212,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/iqaudio-dac-overlay.dts linux-r
+ };
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/iqaudio-dacplus-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/iqaudio-dacplus-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/iqaudio-dacplus-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/iqaudio-dacplus-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/iqaudio-dacplus-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/iqaudio-dacplus-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/iqaudio-dacplus-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/iqaudio-dacplus-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,39 @@
+// Definitions for IQaudIO DAC+
+/dts-v1/;
@@ -3078,9 +2255,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/iqaudio-dacplus-overlay.dts lin
+ };
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/lirc-rpi-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/lirc-rpi-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/lirc-rpi-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/lirc-rpi-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/lirc-rpi-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/lirc-rpi-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/lirc-rpi-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/lirc-rpi-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,57 @@
+// Definitions for lirc-rpi module
+/dts-v1/;
@@ -3139,9 +2316,85 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/lirc-rpi-overlay.dts linux-rpi/
+ debug = <&lirc_rpi>,"rpi,debug:0";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/mcp2515-can0-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/mcp2515-can0-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/mcp2515-can0-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/mcp2515-can0-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/Makefile linux-rpi/arch/arm/boot/dts/overlays/Makefile
+--- linux-4.1.10/arch/arm/boot/dts/overlays/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/Makefile 2015-10-07 16:40:31.000000000 +0200
+@@ -0,0 +1,72 @@
++ifeq ($(CONFIG_OF),y)
++
++# Overlays for the Raspberry Pi platform
++
++ifeq ($(CONFIG_BCM2708_DT),y)
++ RPI_DT_OVERLAYS=y
++endif
++ifeq ($(CONFIG_BCM2709_DT),y)
++ RPI_DT_OVERLAYS=y
++endif
++ifeq ($(CONFIG_ARCH_BCM2835),y)
++ RPI_DT_OVERLAYS=y
++endif
++
++dtb-$(RPI_DT_OVERLAYS) += ads7846-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += at86rf233-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += bmp085_i2c-sensor-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += dht11-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += enc28j60-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += gpio-poweroff-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += hifiberry-amp-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += hifiberry-dac-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += hifiberry-dacplus-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += hifiberry-digi-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += hy28a-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += hy28b-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += i2c-rtc-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += i2s-mmap-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += iqaudio-dac-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += iqaudio-dacplus-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += lirc-rpi-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += mcp2515-can0-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += mcp2515-can1-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += mmc-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += mz61581-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += piscreen-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += pitft28-resistive-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += pps-gpio-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += pwm-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += pwm-2chan-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += raspidac3-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += rpi-dac-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += rpi-display-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += rpi-ft5406-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += rpi-proto-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += rpi-sense-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += sdhost-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += sdio-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += smi-dev-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += smi-nand-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += smi-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += spi-bcm2708-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += spi-bcm2835-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += spi-dma-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += tinylcd35-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += uart1-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += vga666-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += w1-gpio-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += w1-gpio-pullup-overlay.dtb
++
++targets += dtbs dtbs_install
++targets += $(dtb-y)
++
++endif
++
++always := $(dtb-y)
++clean-files := *.dtb
++
++# Enable fixups to support overlays on BCM2708 platforms
++ifeq ($(RPI_DT_OVERLAYS),y)
++ DTC_FLAGS ?= -@
++endif
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/mcp2515-can0-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/mcp2515-can0-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/mcp2515-can0-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/mcp2515-can0-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,69 @@
+/*
+ * Device tree overlay for mcp251x/can0 on spi0.0
@@ -3212,9 +2465,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/mcp2515-can0-overlay.dts linux-
+ interrupt = <&can0_pins>,"brcm,pins:0",<&can0>,"interrupts:0";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/mcp2515-can1-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/mcp2515-can1-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/mcp2515-can1-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/mcp2515-can1-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/mcp2515-can1-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/mcp2515-can1-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/mcp2515-can1-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/mcp2515-can1-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,69 @@
+/*
+ * Device tree overlay for mcp251x/can1 on spi0.1 edited by petit_miner
@@ -3285,9 +2538,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/mcp2515-can1-overlay.dts linux-
+ interrupt = <&can1_pins>,"brcm,pins:0",<&can1>,"interrupts:0";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/mmc-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/mmc-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/mmc-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/mmc-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/mmc-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/mmc-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/mmc-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/mmc-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,19 @@
+/dts-v1/;
+/plugin/;
@@ -3308,9 +2561,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/mmc-overlay.dts linux-rpi/arch/
+ force_pio = <&mmc>,"brcm,force-pio?";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/mz61581-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/mz61581-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/mz61581-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/mz61581-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/mz61581-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/mz61581-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/mz61581-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/mz61581-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,111 @@
+/*
+ * Device Tree overlay for MZ61581-PI-EXT 2014.12.28 by Tontec
@@ -3326,8 +2579,6 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/mz61581-overlay.dts linux-rpi/a
+ fragment@0 {
+ target = <&spi0>;
+ __overlay__ {
-+ /* does not work with spi-bcm2835 using software chip selects */
-+ compatible = "brcm,bcm2708-spi";
+ status = "okay";
+
+ spidev@0{
@@ -3373,6 +2624,7 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/mz61581-overlay.dts linux-rpi/a
+ bgr;
+ fps = <30>;
+ buswidth = <8>;
++ txbuflen = <32768>;
+
+ reset-gpios = <&gpio 15 0>;
+ dc-gpios = <&gpio 25 0>;
@@ -3419,13 +2671,14 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/mz61581-overlay.dts linux-rpi/a
+ speed = <&mz61581>, "spi-max-frequency:0";
+ rotate = <&mz61581>, "rotate:0";
+ fps = <&mz61581>, "fps:0";
++ txbuflen = <&mz61581>, "txbuflen:0";
+ debug = <&mz61581>, "debug:0";
+ xohms = <&mz61581_ts>,"ti,x-plate-ohms;0";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/piscreen-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/piscreen-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/piscreen-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/piscreen-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/piscreen-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/piscreen-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/piscreen-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/piscreen-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,96 @@
+/*
+ * Device Tree overlay for PiScreen 3.5" display shield by Ozzmaker
@@ -3523,9 +2776,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/piscreen-overlay.dts linux-rpi/
+ xohms = <&piscreen_ts>,"ti,x-plate-ohms;0";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/pitft28-resistive-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/pitft28-resistive-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/pitft28-resistive-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/pitft28-resistive-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/pitft28-resistive-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/pitft28-resistive-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/pitft28-resistive-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/pitft28-resistive-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,115 @@
+/*
+ * Device Tree overlay for Adafruit PiTFT 2.8" resistive touch screen
@@ -3642,9 +2895,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/pitft28-resistive-overlay.dts l
+ debug = <&pitft>,"debug:0";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/pps-gpio-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/pps-gpio-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/pps-gpio-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/pps-gpio-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/pps-gpio-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/pps-gpio-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/pps-gpio-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/pps-gpio-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,34 @@
+/dts-v1/;
+/plugin/;
@@ -3680,9 +2933,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/pps-gpio-overlay.dts linux-rpi/
+ <&pps_pins>,"brcm,pins:0";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/pwm-2chan-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/pwm-2chan-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/pwm-2chan-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/pwm-2chan-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/pwm-2chan-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/pwm-2chan-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/pwm-2chan-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/pwm-2chan-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,46 @@
+/dts-v1/;
+/plugin/;
@@ -3730,9 +2983,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/pwm-2chan-overlay.dts linux-rpi
+ clock = <&clk_pwm>,"clock-frequency:0";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/pwm-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/pwm-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/pwm-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/pwm-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/pwm-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/pwm-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/pwm-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/pwm-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,42 @@
+/dts-v1/;
+/plugin/;
@@ -3776,9 +3029,733 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/pwm-overlay.dts linux-rpi/arch/
+ clock = <&clk_pwm>,"clock-frequency:0";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/rpi-dac-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/rpi-dac-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/rpi-dac-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/rpi-dac-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/raspidac3-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/raspidac3-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/raspidac3-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/raspidac3-overlay.dts 2015-10-07 16:40:31.000000000 +0200
+@@ -0,0 +1,45 @@
++// Definitions for RaspiDACv3
++/dts-v1/;
++/plugin/;
++
++/ {
++ compatible = "brcm,bcm2708";
++
++ fragment@0 {
++ target = <&sound>;
++ __overlay__ {
++ compatible = "jg,raspidacv3";
++ i2s-controller = <&i2s>;
++ status = "okay";
++ };
++ };
++
++ fragment@1 {
++ target = <&i2s>;
++ __overlay__ {
++ status = "okay";
++ };
++ };
++
++ fragment@2 {
++ target = <&i2c1>;
++ __overlay__ {
++ #address-cells = <1>;
++ #size-cells = <0>;
++ status = "okay";
++
++ pcm5122@4c {
++ #sound-dai-cells = <0>;
++ compatible = "ti,pcm5122";
++ reg = <0x4c>;
++ status = "okay";
++ };
++
++ tpa6130a2: tpa6130a2@60 {
++ compatible = "ti,tpa6130a2";
++ reg = <0x60>;
++ status = "okay";
++ };
++ };
++ };
++};
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/README linux-rpi/arch/arm/boot/dts/overlays/README
+--- linux-4.1.10/arch/arm/boot/dts/overlays/README 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/README 2015-10-07 16:40:31.000000000 +0200
+@@ -0,0 +1,671 @@
++Introduction
++============
++
++This directory contains Device Tree overlays. Device Tree makes it possible
++to support many hardware configurations with a single kernel and without the
++need to explicitly load or blacklist kernel modules. Note that this isn't a
++"pure" Device Tree configuration (c.f. MACH_BCM2835) - some on-board devices
++are still configured by the board support code, but the intention is to
++eventually reach that goal.
++
++On Raspberry Pi, Device Tree usage is controlled from /boot/config.txt. By
++default, the Raspberry Pi kernel boots with device tree enabled. You can
++completely disable DT usage (for now) by adding:
++
++ device_tree=
++
++to your config.txt, which should cause your Pi to revert to the old way of
++doing things after a reboot.
++
++In /boot you will find a .dtb for each base platform. This describes the
++hardware that is part of the Raspberry Pi board. The loader (start.elf and its
++siblings) selects the .dtb file appropriate for the platform by name, and reads
++it into memory. At this point, all of the optional interfaces (i2c, i2s, spi)
++are disabled, but they can be enabled using Device Tree parameters:
++
++ dtparam=i2c=on,i2s=on,spi=on
++
++However, this shouldn't be necessary in many use cases because loading an
++overlay that requires one of those interfaces will cause it to be enabled
++automatically, and it is advisable to only enable interfaces if they are
++needed.
++
++Configuring additional, optional hardware is done using Device Tree overlays
++(see below).
++
++raspi-config
++============
++
++The Advanced Options section of the raspi-config utility can enable and disable
++Device Tree use, as well as toggling the I2C and SPI interfaces. Note that it
++is possible to both enable an interface and blacklist the driver, if for some
++reason you should want to defer the loading.
++
++Modules
++=======
++
++As well as describing the hardware, Device Tree also gives enough information
++to allow suitable driver modules to be located and loaded, with the corollary
++that unneeded modules are not loaded. As a result it should be possible to
++remove lines from /etc/modules, and /etc/modprobe.d/raspi-blacklist.conf can
++have its contents deleted (or commented out).
++
++Using Overlays
++==============
++
++Overlays are loaded using the "dtoverlay" directive. As an example, consider the
++popular lirc-rpi module, the Linux Infrared Remote Control driver. In the
++pre-DT world this would be loaded from /etc/modules, with an explicit
++"modprobe lirc-rpi" command, or programmatically by lircd. With DT enabled,
++this becomes a line in config.txt:
++
++ dtoverlay=lirc-rpi
++
++This causes the file /boot/overlays/lirc-rpi-overlay.dtb to be loaded. By
++default it will use GPIOs 17 (out) and 18 (in), but this can be modified using
++DT parameters:
++
++ dtoverlay=lirc-rpi,gpio_out_pin=17,gpio_in_pin=13
++
++Parameters always have default values, although in some cases (e.g. "w1-gpio")
++it is necessary to provided multiple overlays in order to get the desired
++behaviour. See the list of overlays below for a description of the parameters
++and their defaults.
++
++The Overlay and Parameter Reference
++===================================
++
++N.B. When editing this file, please preserve the indentation levels to make it
++simple to parse programmatically. NO HARD TABS.
++
++
++Name: <The base DTB>
++Info: Configures the base Raspberry Pi hardware
++Load: <loaded automatically>
++Params:
++ audio Set to "on" to enable the onboard ALSA audio
++ interface (default "off")
++
++ i2c_arm Set to "on" to enable the ARM's i2c interface
++ (default "off")
++
++ i2c_vc Set to "on" to enable the i2c interface
++ usually reserved for the VideoCore processor
++ (default "off")
++
++ i2c An alias for i2c_arm
++
++ i2c_arm_baudrate Set the baudrate of the ARM's i2c interface
++ (default "100000")
++
++ i2c_vc_baudrate Set the baudrate of the VideoCore i2c interface
++ (default "100000")
++
++ i2c_baudrate An alias for i2c_arm_baudrate
++
++ i2s Set to "on" to enable the i2s interface
++ (default "off")
++
++ spi Set to "on" to enable the spi interfaces
++ (default "off")
++
++ random Set to "on" to enable the hardware random
++ number generator (default "off")
++
++ uart0 Set to "off" to disable uart0 (default "on")
++
++ watchdog Set to "on" to enable the hardware watchdog
++ (default "off")
++
++ act_led_trigger Choose which activity the LED tracks.
++ Use "heartbeat" for a nice load indicator.
++ (default "mmc")
++
++ act_led_activelow Set to "on" to invert the sense of the LED
++ (default "off")
++
++ act_led_gpio Set which GPIO to use for the activity LED
++ (in case you want to connect it to an external
++ device)
++ (default "16" on a non-Plus board, "47" on a
++ Plus or Pi 2)
++
++ pwr_led_trigger
++ pwr_led_activelow
++ pwr_led_gpio
++ As for act_led_*, but using the PWR LED.
++ Not available on Model A/B boards.
++
++ N.B. It is recommended to only enable those interfaces that are needed.
++ Leaving all interfaces enabled can lead to unwanted behaviour (i2c_vc
++ interfering with Pi Camera, I2S and SPI hogging GPIO pins, etc.)
++ Note also that i2c, i2c_arm and i2c_vc are aliases for the physical
++ interfaces i2c0 and i2c1. Use of the numeric variants is still possible
++ but deprecated because the ARM/VC assignments differ between board
++ revisions. The same board-specific mapping applies to i2c_baudrate,
++ and the other i2c baudrate parameters.
++
++
++Name: ads7846
++Info: ADS7846 Touch controller
++Load: dtoverlay=ads7846,<param>=<val>
++Params: cs SPI bus Chip Select (default 1)
++ speed SPI bus speed (default 2MHz, max 3.25MHz)
++ penirq GPIO used for PENIRQ. REQUIRED
++ penirq_pull Set GPIO pull (default 0=none, 2=pullup)
++ swapxy Swap x and y axis
++ xmin Minimum value on the X axis (default 0)
++ ymin Minimum value on the Y axis (default 0)
++ xmax Maximum value on the X axis (default 4095)
++ ymax Maximum value on the Y axis (default 4095)
++ pmin Minimum reported pressure value (default 0)
++ pmax Maximum reported pressure value (default 65535)
++ xohms Touchpanel sensitivity (X-plate resistance)
++ (default 400)
++
++ penirq is required and usually xohms (60-100) has to be set as well.
++ Apart from that, pmax (255) and swapxy are also common.
++ The rest of the calibration can be done with xinput-calibrator.
++ See: github.com/notro/fbtft/wiki/FBTFT-on-Raspian
++ Device Tree binding document:
++ www.kernel.org/doc/Documentation/devicetree/bindings/input/ads7846.txt
++
++
++Name: at86rf233
++Info: Configures the Atmel AT86RF233 802.15.4 low-power WPAN transceiver,
++ connected to spi0.0
++Load: dtoverlay=at86rf233,<param>=<val>
++Params: interrupt GPIO used for INT (default 23)
++ reset GPIO used for Reset (default 24)
++ sleep GPIO used for Sleep (default 25)
++ speed SPI bus speed in Hz (default 750000)
++ trim Fine tuning of the internal capacitance
++ arrays (0=+0pF, 15=+4.5pF, default 15)
++
++
++Name: bmp085_i2c-sensor
++Info: Configures the BMP085/BMP180 digital barometric pressure and temperature
++ sensors from Bosch Sensortec
++Load: dtoverlay=bmp085_i2c-sensor
++Params: <None>
++
++
++Name: dht11
++Info: Overlay for the DHT11/DHT21/DHT22 humidity/temperature sensors
++ Also sometimes found with the part number(s) AM230x.
++Load: dtoverlay=dht11,<param>=<val>
++Params: gpiopin GPIO connected to the sensor's DATA output.
++ (default 4)
++
++
++[ The ds1307-rtc overlay has been deleted. See i2c-rtc. ]
++
++
++Name: enc28j60
++Info: Overlay for the Microchip ENC28J60 Ethernet Controller (SPI)
++Load: dtoverlay=enc28j60,<param>=<val>
++Params: int_pin GPIO used for INT (default 25)
++
++ speed SPI bus speed (default 12000000)
++
++
++Name: gpio-poweroff
++Info: Drives a GPIO high or low on reboot
++Load: gpio-poweroff,<param>=<val>
++Params: gpiopin GPIO for signalling (default 26)
++
++ active_low Set if the power control device requires a
++ high->low transition to trigger a power-down.
++ Note that this will require the support of a
++ custom dt-blob.bin to prevent a power-down
++ during the boot process, and that a reboot
++ will also cause the pin to go low.
++
++
++Name: hifiberry-amp
++Info: Configures the HifiBerry Amp and Amp+ audio cards
++Load: dtoverlay=hifiberry-amp
++Params: <None>
++
++
++Name: hifiberry-dac
++Info: Configures the HifiBerry DAC audio card
++Load: dtoverlay=hifiberry-dac
++Params: <None>
++
++
++Name: hifiberry-dacplus
++Info: Configures the HifiBerry DAC+ audio card
++Load: dtoverlay=hifiberry-dacplus
++Params: <None>
++
++
++Name: hifiberry-digi
++Info: Configures the HifiBerry Digi audio card
++Load: dtoverlay=hifiberry-digi
++Params: <None>
++
++
++Name: hy28a
++Info: HY28A - 2.8" TFT LCD Display Module by HAOYU Electronics
++ Default values match Texy's display shield
++Load: dtoverlay=hy28a,<param>=<val>
++Params: speed Display SPI bus speed
++
++ rotate Display rotation {0,90,180,270}
++
++ fps Delay between frame updates
++
++ debug Debug output level {0-7}
++
++ xohms Touchpanel sensitivity (X-plate resistance)
++
++ resetgpio GPIO used to reset controller
++
++ ledgpio GPIO used to control backlight
++
++
++Name: hy28b
++Info: HY28B - 2.8" TFT LCD Display Module by HAOYU Electronics
++ Default values match Texy's display shield
++Load: dtoverlay=hy28b,<param>=<val>
++Params: speed Display SPI bus speed
++
++ rotate Display rotation {0,90,180,270}
++
++ fps Delay between frame updates
++
++ debug Debug output level {0-7}
++
++ xohms Touchpanel sensitivity (X-plate resistance)
++
++ resetgpio GPIO used to reset controller
++
++ ledgpio GPIO used to control backlight
++
++
++Name: i2c-rtc
++Info: Adds support for a number of I2C Real Time Clock devices
++Load: dtoverlay=i2c-rtc,<param>
++Params: ds1307 Select the DS1307 device
++
++ ds3231 Select the DS3231 device
++
++ mcp7941x Select the MCP7941x device
++
++ pcf2127 Select the PCF2127 device
++
++ pcf8523 Select the PCF8523 device
++
++ pcf8563 Select the PCF8563 device
++
++
++Name: i2s-mmap
++Info: Enables mmap support in the bcm2708-i2s driver
++Load: dtoverlay=i2s-mmap
++Params: <None>
++
++
++Name: iqaudio-dac
++Info: Configures the IQaudio DAC audio card
++Load: dtoverlay=iqaudio-dac
++Params: <None>
++
++
++Name: iqaudio-dacplus
++Info: Configures the IQaudio DAC+ audio card
++Load: dtoverlay=iqaudio-dacplus
++Params: <None>
++
++
++Name: lirc-rpi
++Info: Configures lirc-rpi (Linux Infrared Remote Control for Raspberry Pi)
++ Consult the module documentation for more details.
++Load: dtoverlay=lirc-rpi,<param>=<val>,...
++Params: gpio_out_pin GPIO for output (default "17")
++
++ gpio_in_pin GPIO for input (default "18")
++
++ gpio_in_pull Pull up/down/off on the input pin
++ (default "down")
++
++ sense Override the IR receive auto-detection logic:
++ "0" = force active-high
++ "1" = force active-low
++ "-1" = use auto-detection
++ (default "-1")
++
++ softcarrier Turn the software carrier "on" or "off"
++ (default "on")
++
++ invert "on" = invert the output pin (default "off")
++
++ debug "on" = enable additional debug messages
++ (default "off")
++
++
++Name: mcp2515-can0
++Info: Configures the MCP2515 CAN controller on spi0.0
++Load: dtoverlay=mcp2515-can0,<param>=<val>
++Params: oscillator Clock frequency for the CAN controller (Hz)
++
++ spimaxfrequency Maximum SPI frequence (Hz)
++
++ interrupt GPIO for interrupt signal
++
++
++Name: mcp2515-can1
++Info: Configures the MCP2515 CAN controller on spi0.1
++Load: dtoverlay=mcp2515-can1,<param>=<val>
++Params: oscillator Clock frequency for the CAN controller (Hz)
++
++ spimaxfrequency Maximum SPI frequence (Hz)
++
++ interrupt GPIO for interrupt signal
++
++
++Name: mmc
++Info: Selects the bcm2835-mmc SD/MMC driver, optionally with overclock
++Load: dtoverlay=mmc,<param>=<val>
++Params: overclock_50 Clock (in MHz) to use when the MMC framework
++ requests 50MHz
++ force_pio Disable DMA support
++
++
++Name: mz61581
++Info: MZ61581 display by Tontec
++Load: dtoverlay=mz61581,<param>=<val>
++Params: speed Display SPI bus speed
++
++ rotate Display rotation {0,90,180,270}
++
++ fps Delay between frame updates
++
++ txbuflen Transmit buffer length (default 32768)
++
++ debug Debug output level {0-7}
++
++ xohms Touchpanel sensitivity (X-plate resistance)
++
++
++[ The pcf2127-rtc overlay has been deleted. See i2c-rtc. ]
++
++
++[ The pcf8523-rtc overlay has been deleted. See i2c-rtc. ]
++
++
++[ The pcf8563-rtc overlay has been deleted. See i2c-rtc. ]
++
++
++Name: piscreen
++Info: PiScreen display by OzzMaker.com
++Load: dtoverlay=piscreen,<param>=<val>
++Params: speed Display SPI bus speed
++
++ rotate Display rotation {0,90,180,270}
++
++ fps Delay between frame updates
++
++ debug Debug output level {0-7}
++
++ xohms Touchpanel sensitivity (X-plate resistance)
++
++
++Name: pitft28-resistive
++Info: Adafruit PiTFT 2.8" resistive touch screen
++Load: dtoverlay=pitft28-resistive,<param>=<val>
++Params: speed Display SPI bus speed
++
++ rotate Display rotation {0,90,180,270}
++
++ fps Delay between frame updates
++
++ debug Debug output level {0-7}
++
++
++Name: pps-gpio
++Info: Configures the pps-gpio (pulse-per-second time signal via GPIO).
++Load: dtoverlay=pps-gpio,<param>=<val>
++Params: gpiopin Input GPIO (default "18")
++
++
++Name: pwm
++Info: Configures a single PWM channel
++ Legal pin,function combinations for each channel:
++ PWM0: 12,4(Alt0) 18,2(Alt5) 40,4(Alt0) 52,5(Alt1)
++ PWM1: 13,4(Alt0) 19,2(Alt5) 41,4(Alt0) 45,4(Alt0) 53,5(Alt1)
++ N.B.:
++ 1) Pin 18 is the only one available on all platforms, and
++ it is the one used by the I2S audio interface.
++ Pins 12 and 13 might be better choices on an A+, B+ or Pi2.
++ 2) The onboard analogue audio output uses both PWM channels.
++ 3) So be careful mixing audio and PWM.
++ 4) Currently the clock must have been enabled and configured
++ by other means.
++Load: dtoverlay=pwm-2chan,<param>=<val>
++Load: dtoverlay=pwm,<param>=<val>
++Params: pin Output pin (default 18) - see table
++ func Pin function (default 2 = Alt5) - see above
++ clock PWM clock frequency (informational)
++
++
++Name: pwm-2chan
++Info: Configures both PWM channels
++ Legal pin,function combinations for each channel:
++ PWM0: 12,4(Alt0) 18,2(Alt5) 40,4(Alt0) 52,5(Alt1)
++ PWM1: 13,4(Alt0) 19,2(Alt5) 41,4(Alt0) 45,4(Alt0) 53,5(Alt1)
++ N.B.:
++ 1) Pin 18 is the only one available on all platforms, and
++ it is the one used by the I2S audio interface.
++ Pins 12 and 13 might be better choices on an A+, B+ or Pi2.
++ 2) The onboard analogue audio output uses both PWM channels.
++ 3) So be careful mixing audio and PWM.
++ 4) Currently the clock must have been enabled and configured
++ by other means.
++Load: dtoverlay=pwm-2chan,<param>=<val>
++Params: pin Output pin (default 18) - see table
++ pin2 Output pin for other channel (default 19)
++ func Pin function (default 2 = Alt5) - see above
++ func2 Function for pin2 (default 2 = Alt5)
++ clock PWM clock frequency (informational)
++
++
++Name: raspidac3
++Info: Configures the RaspiDAV Rev.3x audio card
++Load: dtoverlay=raspidac3
++Params: <None>
++
++
++Name: rpi-dac
++Info: Configures the RPi DAC audio card
++Load: dtoverlay=rpi-dac
++Params: <None>
++
++
++Name: rpi-display
++Info: RPi-Display - 2.8" Touch Display by Watterott
++Load: dtoverlay=rpi-display,<param>=<val>
++Params: speed Display SPI bus speed
++
++ rotate Display rotation {0,90,180,270}
++
++ fps Delay between frame updates
++
++ debug Debug output level {0-7}
++
++ xohms Touchpanel sensitivity (X-plate resistance)
++
++
++Name: rpi-ft5406
++Info: Official Raspberry Pi display touchscreen
++Load: dtoverlay=rpi-ft5406
++Params: <None>
++
++
++Name: rpi-proto
++Info: Configures the RPi Proto audio card
++Load: dtoverlay=rpi-proto
++Params: <None>
++
++
++Name: rpi-sense
++Info: Raspberry Pi Sense HAT
++Load: dtoverlay=rpi-sense
++Params: <None>
++
++
++Name: sdhost
++Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock
++Load: dtoverlay=sdhost,<param>=<val>
++Params: overclock_50 Clock (in MHz) to use when the MMC framework
++ requests 50MHz
++
++ force_pio Disable DMA support (default off)
++
++ pio_limit Number of blocks above which to use DMA
++ (default 1)
++
++ debug Enable debug output (default off)
++
++
++Name: sdio
++Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock,
++ and enables SDIO via GPIOs 22-27.
++Load: dtoverlay=sdio,<param>=<val>
++Params: overclock_50 Clock (in MHz) to use when the MMC framework
++ requests 50MHz
++
++ force_pio Disable DMA support (default off)
++
++ pio_limit Number of blocks above which to use DMA
++ (default 1)
++
++ debug Enable debug output (default off)
++
++
++Name: smi
++Info: Enables the Secondary Memory Interface peripheral. Uses GPIOs 2-25!
++Load: dtoverlay=smi
++Params: <None>
++
++
++Name: smi-dev
++Info: Enables the userspace interface for the SMI driver
++Load: dtoverlay=smi-dev
++Params: <None>
++
++
++Name: smi-nand
++Info: Enables access to NAND flash via the SMI interface
++Load: dtoverlay=smi-nand
++Params: <None>
++
++
++Name: spi-bcm2708
++Info: Selects the bcm2708-spi SPI driver
++Load: dtoverlay=spi-bcm2708
++Params: <None>
++
++
++Name: spi-bcm2835
++Info: Selects the bcm2835-spi SPI driver
++Load: dtoverlay=spi-bcm2835
++Params: <None>
++
++
++Name: spi-dma
++Info: enables dma modes for spi-bcm2835
++Load: dtoverlay=spi-dma
++Params: <None>
++
++
++Name: tinylcd35
++Info: 3.5" Color TFT Display by www.tinylcd.com
++ Options: Touch, RTC, keypad
++Load: dtoverlay=tinylcd35,<param>=<val>
++Params: speed Display SPI bus speed
++
++ rotate Display rotation {0,90,180,270}
++
++ fps Delay between frame updates
++
++ debug Debug output level {0-7}
++
++ touch Enable touch panel
++
++ touchgpio Touch controller IRQ GPIO
++
++ xohms Touchpanel: Resistance of X-plate in ohms
++
++ rtc-pcf PCF8563 Real Time Clock
++
++ rtc-ds DS1307 Real Time Clock
++
++ keypad Enable keypad
++
++ Examples:
++ Display with touchpanel, PCF8563 RTC and keypad:
++ dtoverlay=tinylcd35,touch,rtc-pcf,keypad
++ Old touch display:
++ dtoverlay=tinylcd35,touch,touchgpio=3
++
++
++Name: uart1
++Info: Enable uart1 in place of uart0
++Load: dtoverlay=uart1,<param>=<val>
++Params: txd1_pin GPIO pin for TXD1 (14, 32 or 40 - default 14)
++
++ rxd1_pin GPIO pin for RXD1 (15, 33 or 41 - default 15)
++
++
++Name: vga666
++Info: Overlay for the Fen Logic VGA666 board
++ This uses GPIOs 2-21 (so no I2C), and activates the output 2-3 seconds
++ after the kernel has started.
++Load: dtoverlay=vga666
++Params: <None>
++
++
++Name: w1-gpio
++Info: Configures the w1-gpio Onewire interface module.
++ Use this overlay if you *don't* need a GPIO to drive an external pullup.
++Load: dtoverlay=w1-gpio,<param>=<val>
++Params: gpiopin GPIO for I/O (default "4")
++
++ pullup Non-zero, "on", or "y" to enable the parasitic
++ power (2-wire, power-on-data) feature
++
++
++Name: w1-gpio-pullup
++Info: Configures the w1-gpio Onewire interface module.
++ Use this overlay if you *do* need a GPIO to drive an external pullup.
++Load: dtoverlay=w1-gpio-pullup,<param>=<val>,...
++Params: gpiopin GPIO for I/O (default "4")
++
++ pullup Non-zero, "on", or "y" to enable the parasitic
++ power (2-wire, power-on-data) feature
++
++ extpullup GPIO for external pullup (default "5")
++
++
++Troubleshooting
++===============
++
++If you are experiencing problems that you think are DT-related, enable DT
++diagnostic output by adding this to /boot/config.txt:
++
++ dtdebug=on
++
++and rebooting. Then run:
++
++ sudo vcdbg log msg
++
++and look for relevant messages.
++
++Further reading
++===============
++
++This is only meant to be a quick introduction to the subject of Device Tree on
++Raspberry Pi. There is a more complete explanation here:
++
++http://www.raspberrypi.org/documentation/configuration/device-tree.md
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/rpi-dac-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/rpi-dac-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/rpi-dac-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/rpi-dac-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,34 @@
+// Definitions for RPi DAC
+/dts-v1/;
@@ -3814,9 +3791,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/rpi-dac-overlay.dts linux-rpi/a
+ };
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/rpi-display-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/rpi-display-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/rpi-display-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/rpi-display-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/rpi-display-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/rpi-display-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/rpi-display-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/rpi-display-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,82 @@
+/*
+ * Device Tree overlay for rpi-display by Watterott
@@ -3900,9 +3877,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/rpi-display-overlay.dts linux-r
+ xohms = <&rpidisplay_ts>,"ti,x-plate-ohms;0";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,17 @@
+/dts-v1/;
+/plugin/;
@@ -3921,9 +3898,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts linux-rp
+ };
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/rpi-proto-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/rpi-proto-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/rpi-proto-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/rpi-proto-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/rpi-proto-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/rpi-proto-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/rpi-proto-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/rpi-proto-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,39 @@
+// Definitions for Rpi-Proto
+/dts-v1/;
@@ -3964,9 +3941,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/rpi-proto-overlay.dts linux-rpi
+ };
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/rpi-sense-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/rpi-sense-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/rpi-sense-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/rpi-sense-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/rpi-sense-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/rpi-sense-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/rpi-sense-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/rpi-sense-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,47 @@
+// rpi-sense HAT
+/dts-v1/;
@@ -4015,9 +3992,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/rpi-sense-overlay.dts linux-rpi
+ };
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/sdhost-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/sdhost-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/sdhost-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/sdhost-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/sdhost-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/sdhost-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/sdhost-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/sdhost-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,56 @@
+/dts-v1/;
+/plugin/;
@@ -4075,9 +4052,178 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/sdhost-overlay.dts linux-rpi/ar
+ debug = <&sdhost>,"brcm,debug?";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/spi-bcm2708-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/spi-bcm2708-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/spi-bcm2708-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/spi-bcm2708-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/sdio-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/sdio-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/sdio-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/sdio-overlay.dts 2015-10-07 16:40:31.000000000 +0200
+@@ -0,0 +1,29 @@
++/* Enable SDIO from MMC interface via GPIOs 22-27. Includes sdhost overlay. */
++
++/include/ "sdhost-overlay.dts"
++
++/{
++ compatible = "brcm,bcm2708";
++
++ fragment@3 {
++ target = <&mmc>;
++ __overlay__ {
++ compatible = "brcm,bcm2835-mmc";
++ pinctrl-names = "default";
++ pinctrl-0 = <&sdio_pins>;
++ non-removable;
++ status = "okay";
++ };
++ };
++
++ fragment@4 {
++ target = <&gpio>;
++ __overlay__ {
++ sdio_pins: sdio_pins {
++ brcm,pins = <22 23 24 25 26 27>;
++ brcm,function = <7 7 7 7 7 7>; /* ALT3 = SD1 */
++ brcm,pull = <0 2 2 2 2 2>;
++ };
++ };
++ };
++};
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/smi-dev-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/smi-dev-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/smi-dev-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/smi-dev-overlay.dts 2015-10-07 16:40:31.000000000 +0200
+@@ -0,0 +1,18 @@
++// Description: Overlay to enable character device interface for SMI.
++// Author: Luke Wren <luke@raspberrypi.org>
++
++/dts-v1/;
++/plugin/;
++
++/{
++ fragment@0 {
++ target = <&soc>;
++ __overlay__ {
++ smi_dev {
++ compatible = "brcm,bcm2835-smi-dev";
++ smi_handle = <&smi>;
++ status = "okay";
++ };
++ };
++ };
++};
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/smi-nand-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/smi-nand-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/smi-nand-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/smi-nand-overlay.dts 2015-10-07 16:40:31.000000000 +0200
+@@ -0,0 +1,69 @@
++// Description: Overlay to enable NAND flash through
++// the secondary memory interface
++// Author: Luke Wren
++
++/dts-v1/;
++/plugin/;
++
++/{
++ compatible = "brcm,bcm2708";
++
++ fragment@0 {
++ target = <&smi>;
++ __overlay__ {
++ pinctrl-names = "default";
++ pinctrl-0 = <&smi_pins>;
++ status = "okay";
++ };
++ };
++
++ fragment@1 {
++ target = <&soc>;
++ __overlay__ {
++ #address-cells = <1>;
++ #size-cells = <1>;
++
++ nand: flash@0 {
++ compatible = "brcm,bcm2835-smi-nand";
++ smi_handle = <&smi>;
++ #address-cells = <1>;
++ #size-cells = <1>;
++ status = "okay";
++
++ partition@0 {
++ label = "stage2";
++ // 128k
++ reg = <0 0x20000>;
++ read-only;
++ };
++ partition@1 {
++ label = "firmware";
++ // 16M
++ reg = <0x20000 0x1000000>;
++ read-only;
++ };
++ partition@2 {
++ label = "root";
++ // 2G (will need to use 64 bit for >=4G)
++ reg = <0x1020000 0x80000000>;
++ };
++ };
++ };
++ };
++
++ fragment@2 {
++ target = <&gpio>;
++ __overlay__ {
++ smi_pins: smi_pins {
++ brcm,pins = <0 1 2 3 4 5 6 7 8 9 10 11
++ 12 13 14 15>;
++ /* Alt 1: SMI */
++ brcm,function = <5 5 5 5 5 5 5 5 5 5 5
++ 5 5 5 5 5>;
++ /* /CS, /WE and /OE are pulled high, as they are
++ generally active low signals */
++ brcm,pull = <2 2 2 2 2 2 2 2 0 0 0 0 0 0 0 0>;
++ };
++ };
++ };
++};
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/smi-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/smi-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/smi-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/smi-overlay.dts 2015-10-07 16:40:31.000000000 +0200
+@@ -0,0 +1,37 @@
++// Description: Overlay to enable the secondary memory interface peripheral
++// Author: Luke Wren
++
++/dts-v1/;
++/plugin/;
++
++/{
++ compatible = "brcm,bcm2708";
++
++ fragment@0 {
++ target = <&smi>;
++ __overlay__ {
++ pinctrl-names = "default";
++ pinctrl-0 = <&smi_pins>;
++ status = "okay";
++ };
++ };
++
++ fragment@1 {
++ target = <&gpio>;
++ __overlay__ {
++ smi_pins: smi_pins {
++ /* Don't configure the top two address bits, as
++ these are already used as ID_SD and ID_SC */
++ brcm,pins = <2 3 4 5 6 7 8 9 10 11 12 13 14 15
++ 16 17 18 19 20 21 22 23 24 25>;
++ /* Alt 0: SMI */
++ brcm,function = <5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
++ 5 5 5 5 5 5 5 5 5>;
++ /* /CS, /WE and /OE are pulled high, as they are
++ generally active low signals */
++ brcm,pull = <2 2 2 2 2 2 0 0 0 0 0 0 0 0 0 0 0
++ 0 0 0 0 0 0 0>;
++ };
++ };
++ };
++};
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/spi-bcm2708-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/spi-bcm2708-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/spi-bcm2708-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/spi-bcm2708-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,18 @@
+/*
+ * Device tree overlay for spi-bcm2835
@@ -4097,9 +4243,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/spi-bcm2708-overlay.dts linux-r
+ };
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/spi-bcm2835-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/spi-bcm2835-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/spi-bcm2835-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/spi-bcm2835-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/spi-bcm2835-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/spi-bcm2835-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/spi-bcm2835-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/spi-bcm2835-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,18 @@
+/*
+ * Device tree overlay for spi-bcm2835
@@ -4119,9 +4265,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/spi-bcm2835-overlay.dts linux-r
+ };
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/spi-dma-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/spi-dma-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/spi-dma-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/spi-dma-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/spi-dma-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/spi-dma-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/spi-dma-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/spi-dma-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,20 @@
+/*
+ * Device tree overlay for spi-bcm2835 to allow dma
@@ -4143,9 +4289,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/spi-dma-overlay.dts linux-rpi/a
+ };
+ };
+ };
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/tinylcd35-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/tinylcd35-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/tinylcd35-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/tinylcd35-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/tinylcd35-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/tinylcd35-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/tinylcd35-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/tinylcd35-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,216 @@
+/*
+ * tinylcd35-overlay.dts
@@ -4363,9 +4509,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/tinylcd35-overlay.dts linux-rpi
+ keypad = <&keypad>,"status";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/uart1-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/uart1-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/uart1-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/uart1-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/uart1-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/uart1-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/uart1-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/uart1-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,38 @@
+/dts-v1/;
+/plugin/;
@@ -4405,9 +4551,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/uart1-overlay.dts linux-rpi/arc
+ rxd1_pin = <&uart1_pins>,"brcm,pins:4";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/vga666-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/vga666-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/vga666-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/vga666-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/vga666-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/vga666-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/vga666-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/vga666-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,30 @@
+/dts-v1/;
+/plugin/;
@@ -4439,9 +4585,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/vga666-overlay.dts linux-rpi/ar
+ };
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,39 @@
+// Definitions for w1-gpio module (without external pullup)
+/dts-v1/;
@@ -4482,9 +4628,9 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts linux-rpi/a
+ pullup = <&w1>,"rpi,parasitic-power:0";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts
---- linux-4.1.6/arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts 2015-08-26 10:26:04.725259982 +0200
+diff -Nur linux-4.1.10/arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts linux-rpi/arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts
+--- linux-4.1.10/arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts 2015-10-07 16:40:31.000000000 +0200
@@ -0,0 +1,41 @@
+// Definitions for w1-gpio module (with external pullup)
+/dts-v1/;
@@ -4527,10 +4673,10 @@ diff -Nur linux-4.1.6/arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts linu
+ pullup = <&w1>,"rpi,parasitic-power:0";
+ };
+};
-diff -Nur linux-4.1.6/arch/arm/configs/bcm2709_defconfig linux-rpi/arch/arm/configs/bcm2709_defconfig
---- linux-4.1.6/arch/arm/configs/bcm2709_defconfig 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/configs/bcm2709_defconfig 2015-08-26 10:26:04.745260265 +0200
-@@ -0,0 +1,1233 @@
+diff -Nur linux-4.1.10/arch/arm/configs/bcm2709_defconfig linux-rpi/arch/arm/configs/bcm2709_defconfig
+--- linux-4.1.10/arch/arm/configs/bcm2709_defconfig 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/configs/bcm2709_defconfig 2015-10-07 16:40:31.000000000 +0200
+@@ -0,0 +1,1254 @@
+# CONFIG_ARM_PATCH_PHYS_VIRT is not set
+CONFIG_PHYS_OFFSET=0
+CONFIG_LOCALVERSION="-v7"
@@ -4816,6 +4962,9 @@ diff -Nur linux-4.1.6/arch/arm/configs/bcm2709_defconfig linux-rpi/arch/arm/conf
+CONFIG_VLAN_8021Q_GVRP=y
+CONFIG_ATALK=m
+CONFIG_6LOWPAN=m
++CONFIG_IEEE802154=m
++CONFIG_IEEE802154_6LOWPAN=m
++CONFIG_MAC802154=m
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_CBQ=m
+CONFIG_NET_SCH_HTB=m
@@ -4925,6 +5074,10 @@ diff -Nur linux-4.1.6/arch/arm/configs/bcm2709_defconfig linux-rpi/arch/arm/conf
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_DMA_CMA=y
+CONFIG_CMA_SIZE_MBYTES=5
++CONFIG_MTD=m
++CONFIG_MTD_BLOCK=m
++CONFIG_MTD_NAND=m
++CONFIG_MTD_UBI=m
+CONFIG_ZRAM=m
+CONFIG_ZRAM_LZ4_COMPRESS=y
+CONFIG_BLK_DEV_LOOP=y
@@ -5058,6 +5211,9 @@ diff -Nur linux-4.1.6/arch/arm/configs/bcm2709_defconfig linux-rpi/arch/arm/conf
+CONFIG_MWIFIEX=m
+CONFIG_MWIFIEX_SDIO=m
+CONFIG_WIMAX_I2400M_USB=m
++CONFIG_IEEE802154_AT86RF230=m
++CONFIG_IEEE802154_MRF24J40=m
++CONFIG_IEEE802154_CC2520=m
+CONFIG_INPUT_POLLDEV=m
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_JOYDEV=m
@@ -5365,10 +5521,13 @@ diff -Nur linux-4.1.6/arch/arm/configs/bcm2709_defconfig linux-rpi/arch/arm/conf
+CONFIG_SND_BCM2708_SOC_RPI_DAC=m
+CONFIG_SND_BCM2708_SOC_RPI_PROTO=m
+CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m
++CONFIG_SND_BCM2708_SOC_RASPIDAC3=m
++CONFIG_SND_SOC_ADAU1701=m
+CONFIG_SND_SOC_WM8804_I2C=m
+CONFIG_SND_SIMPLE_CARD=m
+CONFIG_SOUND_PRIME=m
+CONFIG_HIDRAW=y
++CONFIG_UHID=m
+CONFIG_HID_A4TECH=m
+CONFIG_HID_ACRUX=m
+CONFIG_HID_APPLE=m
@@ -5673,6 +5832,9 @@ diff -Nur linux-4.1.6/arch/arm/configs/bcm2709_defconfig linux-rpi/arch/arm/conf
+CONFIG_ECRYPT_FS=m
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
++CONFIG_JFFS2_FS=m
++CONFIG_JFFS2_SUMMARY=y
++CONFIG_UBIFS_FS=m
+CONFIG_SQUASHFS=m
+CONFIG_SQUASHFS_XATTR=y
+CONFIG_SQUASHFS_LZO=y
@@ -5691,6 +5853,10 @@ diff -Nur linux-4.1.6/arch/arm/configs/bcm2709_defconfig linux-rpi/arch/arm/conf
+CONFIG_CIFS_UPCALL=y
+CONFIG_CIFS_XATTR=y
+CONFIG_CIFS_POSIX=y
++CONFIG_CIFS_ACL=y
++CONFIG_CIFS_DFS_UPCALL=y
++CONFIG_CIFS_SMB2=y
++CONFIG_CIFS_FSCACHE=y
+CONFIG_9P_FS=m
+CONFIG_9P_FS_POSIX_ACL=y
+CONFIG_NLS_DEFAULT="utf8"
@@ -5757,6 +5923,7 @@ diff -Nur linux-4.1.6/arch/arm/configs/bcm2709_defconfig linux-rpi/arch/arm/conf
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
++CONFIG_CRYPTO_USER_API_SKCIPHER=m
+# CONFIG_CRYPTO_HW is not set
+CONFIG_ARM_CRYPTO=y
+CONFIG_CRYPTO_SHA1_ARM_NEON=m
@@ -5764,9 +5931,9 @@ diff -Nur linux-4.1.6/arch/arm/configs/bcm2709_defconfig linux-rpi/arch/arm/conf
+CONFIG_CRYPTO_AES_ARM_BS=m
+CONFIG_CRC_ITU_T=y
+CONFIG_LIBCRC32C=y
-diff -Nur linux-4.1.6/arch/arm/configs/bcm2835_defconfig linux-rpi/arch/arm/configs/bcm2835_defconfig
---- linux-4.1.6/arch/arm/configs/bcm2835_defconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/arch/arm/configs/bcm2835_defconfig 2015-08-26 10:26:04.745260265 +0200
+diff -Nur linux-4.1.10/arch/arm/configs/bcm2835_defconfig linux-rpi/arch/arm/configs/bcm2835_defconfig
+--- linux-4.1.10/arch/arm/configs/bcm2835_defconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/arch/arm/configs/bcm2835_defconfig 2015-10-07 16:40:31.000000000 +0200
@@ -1,105 +1,1075 @@
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_SYSVIPC=y
@@ -7019,10 +7186,10 @@ diff -Nur linux-4.1.6/arch/arm/configs/bcm2835_defconfig linux-rpi/arch/arm/conf
+CONFIG_LIBCRC32C=y
# CONFIG_XZ_DEC_ARM is not set
# CONFIG_XZ_DEC_ARMTHUMB is not set
-diff -Nur linux-4.1.6/arch/arm/configs/bcmrpi_defconfig linux-rpi/arch/arm/configs/bcmrpi_defconfig
---- linux-4.1.6/arch/arm/configs/bcmrpi_defconfig 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/configs/bcmrpi_defconfig 2015-08-26 10:26:04.745260265 +0200
-@@ -0,0 +1,1228 @@
+diff -Nur linux-4.1.10/arch/arm/configs/bcmrpi_defconfig linux-rpi/arch/arm/configs/bcmrpi_defconfig
+--- linux-4.1.10/arch/arm/configs/bcmrpi_defconfig 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/configs/bcmrpi_defconfig 2015-10-07 16:40:31.000000000 +0200
+@@ -0,0 +1,1249 @@
+# CONFIG_ARM_PATCH_PHYS_VIRT is not set
+CONFIG_PHYS_OFFSET=0
+# CONFIG_LOCALVERSION_AUTO is not set
@@ -7301,6 +7468,9 @@ diff -Nur linux-4.1.6/arch/arm/configs/bcmrpi_defconfig linux-rpi/arch/arm/confi
+CONFIG_VLAN_8021Q_GVRP=y
+CONFIG_ATALK=m
+CONFIG_6LOWPAN=m
++CONFIG_IEEE802154=m
++CONFIG_IEEE802154_6LOWPAN=m
++CONFIG_MAC802154=m
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_CBQ=m
+CONFIG_NET_SCH_HTB=m
@@ -7410,6 +7580,10 @@ diff -Nur linux-4.1.6/arch/arm/configs/bcmrpi_defconfig linux-rpi/arch/arm/confi
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_DMA_CMA=y
+CONFIG_CMA_SIZE_MBYTES=5
++CONFIG_MTD=m
++CONFIG_MTD_BLOCK=m
++CONFIG_MTD_NAND=m
++CONFIG_MTD_UBI=m
+CONFIG_ZRAM=m
+CONFIG_ZRAM_LZ4_COMPRESS=y
+CONFIG_BLK_DEV_LOOP=y
@@ -7543,6 +7717,9 @@ diff -Nur linux-4.1.6/arch/arm/configs/bcmrpi_defconfig linux-rpi/arch/arm/confi
+CONFIG_MWIFIEX=m
+CONFIG_MWIFIEX_SDIO=m
+CONFIG_WIMAX_I2400M_USB=m
++CONFIG_IEEE802154_AT86RF230=m
++CONFIG_IEEE802154_MRF24J40=m
++CONFIG_IEEE802154_CC2520=m
+CONFIG_INPUT_POLLDEV=m
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+CONFIG_INPUT_JOYDEV=m
@@ -7850,10 +8027,13 @@ diff -Nur linux-4.1.6/arch/arm/configs/bcmrpi_defconfig linux-rpi/arch/arm/confi
+CONFIG_SND_BCM2708_SOC_RPI_DAC=m
+CONFIG_SND_BCM2708_SOC_RPI_PROTO=m
+CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m
++CONFIG_SND_BCM2708_SOC_RASPIDAC3=m
++CONFIG_SND_SOC_ADAU1701=m
+CONFIG_SND_SOC_WM8804_I2C=m
+CONFIG_SND_SIMPLE_CARD=m
+CONFIG_SOUND_PRIME=m
+CONFIG_HIDRAW=y
++CONFIG_UHID=m
+CONFIG_HID_A4TECH=m
+CONFIG_HID_ACRUX=m
+CONFIG_HID_APPLE=m
@@ -8158,6 +8338,9 @@ diff -Nur linux-4.1.6/arch/arm/configs/bcmrpi_defconfig linux-rpi/arch/arm/confi
+CONFIG_ECRYPT_FS=m
+CONFIG_HFS_FS=m
+CONFIG_HFSPLUS_FS=m
++CONFIG_JFFS2_FS=m
++CONFIG_JFFS2_SUMMARY=y
++CONFIG_UBIFS_FS=m
+CONFIG_SQUASHFS=m
+CONFIG_SQUASHFS_XATTR=y
+CONFIG_SQUASHFS_LZO=y
@@ -8176,6 +8359,10 @@ diff -Nur linux-4.1.6/arch/arm/configs/bcmrpi_defconfig linux-rpi/arch/arm/confi
+CONFIG_CIFS_UPCALL=y
+CONFIG_CIFS_XATTR=y
+CONFIG_CIFS_POSIX=y
++CONFIG_CIFS_ACL=y
++CONFIG_CIFS_DFS_UPCALL=y
++CONFIG_CIFS_SMB2=y
++CONFIG_CIFS_FSCACHE=y
+CONFIG_9P_FS=m
+CONFIG_9P_FS_POSIX_ACL=y
+CONFIG_NLS_DEFAULT="utf8"
@@ -8245,15 +8432,16 @@ diff -Nur linux-4.1.6/arch/arm/configs/bcmrpi_defconfig linux-rpi/arch/arm/confi
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
++CONFIG_CRYPTO_USER_API_SKCIPHER=m
+# CONFIG_CRYPTO_HW is not set
+CONFIG_ARM_CRYPTO=y
+CONFIG_CRYPTO_SHA1_ARM=m
+CONFIG_CRYPTO_AES_ARM=m
+CONFIG_CRC_ITU_T=y
+CONFIG_LIBCRC32C=y
-diff -Nur linux-4.1.6/arch/arm/include/asm/entry-macro-multi.S linux-rpi/arch/arm/include/asm/entry-macro-multi.S
---- linux-4.1.6/arch/arm/include/asm/entry-macro-multi.S 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/arch/arm/include/asm/entry-macro-multi.S 2015-08-26 10:26:04.757260435 +0200
+diff -Nur linux-4.1.10/arch/arm/include/asm/entry-macro-multi.S linux-rpi/arch/arm/include/asm/entry-macro-multi.S
+--- linux-4.1.10/arch/arm/include/asm/entry-macro-multi.S 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/arch/arm/include/asm/entry-macro-multi.S 2015-10-07 16:40:31.000000000 +0200
@@ -1,5 +1,6 @@
#include <asm/assembler.h>
@@ -8269,9 +8457,9 @@ diff -Nur linux-4.1.6/arch/arm/include/asm/entry-macro-multi.S linux-rpi/arch/ar
.macro arch_irq_handler, symbol_name
.align 5
-diff -Nur linux-4.1.6/arch/arm/include/asm/irqflags.h linux-rpi/arch/arm/include/asm/irqflags.h
---- linux-4.1.6/arch/arm/include/asm/irqflags.h 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/arch/arm/include/asm/irqflags.h 2015-08-26 10:26:04.761260491 +0200
+diff -Nur linux-4.1.10/arch/arm/include/asm/irqflags.h linux-rpi/arch/arm/include/asm/irqflags.h
+--- linux-4.1.10/arch/arm/include/asm/irqflags.h 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/arch/arm/include/asm/irqflags.h 2015-10-07 16:40:31.000000000 +0200
@@ -145,12 +145,22 @@
}
@@ -8298,9 +8486,9 @@ diff -Nur linux-4.1.6/arch/arm/include/asm/irqflags.h linux-rpi/arch/arm/include
:
: "r" (flags)
: "memory", "cc");
-diff -Nur linux-4.1.6/arch/arm/include/asm/string.h linux-rpi/arch/arm/include/asm/string.h
---- linux-4.1.6/arch/arm/include/asm/string.h 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/arch/arm/include/asm/string.h 2015-08-26 10:26:04.765260547 +0200
+diff -Nur linux-4.1.10/arch/arm/include/asm/string.h linux-rpi/arch/arm/include/asm/string.h
+--- linux-4.1.10/arch/arm/include/asm/string.h 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/arch/arm/include/asm/string.h 2015-10-07 16:40:31.000000000 +0200
@@ -24,6 +24,11 @@
#define __HAVE_ARCH_MEMSET
extern void * memset(void *, int, __kernel_size_t);
@@ -8313,9 +8501,9 @@ diff -Nur linux-4.1.6/arch/arm/include/asm/string.h linux-rpi/arch/arm/include/a
extern void __memzero(void *ptr, __kernel_size_t n);
#define memset(p,v,n) \
-diff -Nur linux-4.1.6/arch/arm/include/asm/uaccess.h linux-rpi/arch/arm/include/asm/uaccess.h
---- linux-4.1.6/arch/arm/include/asm/uaccess.h 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/arch/arm/include/asm/uaccess.h 2015-08-26 10:26:04.765260547 +0200
+diff -Nur linux-4.1.10/arch/arm/include/asm/uaccess.h linux-rpi/arch/arm/include/asm/uaccess.h
+--- linux-4.1.10/arch/arm/include/asm/uaccess.h 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/arch/arm/include/asm/uaccess.h 2015-10-07 16:40:31.000000000 +0200
@@ -475,6 +475,7 @@
#ifdef CONFIG_MMU
@@ -8324,9 +8512,83 @@ diff -Nur linux-4.1.6/arch/arm/include/asm/uaccess.h linux-rpi/arch/arm/include/
extern unsigned long __must_check __copy_to_user(void __user *to, const void *from, unsigned long n);
extern unsigned long __must_check __copy_to_user_std(void __user *to, const void *from, unsigned long n);
extern unsigned long __must_check __clear_user(void __user *addr, unsigned long n);
-diff -Nur linux-4.1.6/arch/arm/kernel/fiqasm.S linux-rpi/arch/arm/kernel/fiqasm.S
---- linux-4.1.6/arch/arm/kernel/fiqasm.S 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/arch/arm/kernel/fiqasm.S 2015-08-26 10:26:04.769260604 +0200
+diff -Nur linux-4.1.10/arch/arm/Kconfig linux-rpi/arch/arm/Kconfig
+--- linux-4.1.10/arch/arm/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/arch/arm/Kconfig 2015-10-07 16:40:31.000000000 +0200
+@@ -314,6 +314,42 @@
+ default ARCH_VERSATILE if !MMU
+ default ARCH_MULTIPLATFORM if MMU
+
++config ARCH_BCM2708
++ bool "Broadcom BCM2708 family"
++ select CPU_V6
++ select ARM_AMBA
++ select HAVE_SCHED_CLOCK
++ select NEED_MACH_GPIO_H
++ select NEED_MACH_MEMORY_H
++ select COMMON_CLK
++ select ARCH_HAS_CPUFREQ
++ select GENERIC_CLOCKEVENTS
++ select ARM_ERRATA_411920
++ select MACH_BCM2708
++ select VC4
++ select FIQ
++ help
++ This enables support for Broadcom BCM2708 boards.
++
++config ARCH_BCM2709
++ bool "Broadcom BCM2709 family"
++ select ARCH_HAS_BARRIERS if SMP
++ select CPU_V7
++ select HAVE_SMP
++ select ARM_AMBA
++ select MIGHT_HAVE_CACHE_L2X0
++ select HAVE_SCHED_CLOCK
++ select NEED_MACH_MEMORY_H
++ select NEED_MACH_IO_H
++ select COMMON_CLK
++ select ARCH_HAS_CPUFREQ
++ select GENERIC_CLOCKEVENTS
++ select MACH_BCM2709
++ select VC4
++ select FIQ
++ help
++ This enables support for Broadcom BCM2709 boards.
++
+ config ARCH_MULTIPLATFORM
+ bool "Allow multiple platforms to be selected"
+ depends on MMU
+@@ -824,6 +860,9 @@
+ # Kconfigs may be included either alphabetically (according to the
+ # plat- suffix) or along side the corresponding mach-* source.
+ #
++source "arch/arm/mach-bcm2708/Kconfig"
++source "arch/arm/mach-bcm2709/Kconfig"
++
+ source "arch/arm/mach-mvebu/Kconfig"
+
+ source "arch/arm/mach-alpine/Kconfig"
+diff -Nur linux-4.1.10/arch/arm/Kconfig.debug linux-rpi/arch/arm/Kconfig.debug
+--- linux-4.1.10/arch/arm/Kconfig.debug 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/arch/arm/Kconfig.debug 2015-10-07 16:40:31.000000000 +0200
+@@ -1197,6 +1197,14 @@
+ options; the platform specific options are deprecated
+ and will be soon removed.
+
++ config DEBUG_BCM2708_UART0
++ bool "Broadcom BCM2708 UART0 (PL011)"
++ depends on MACH_BCM2708
++ help
++ Say Y here if you want the debug print routines to direct
++ their output to UART 0. The port must have been initialised
++ by the boot-loader before use.
++
+ endchoice
+
+ config DEBUG_AT91_UART
+diff -Nur linux-4.1.10/arch/arm/kernel/fiqasm.S linux-rpi/arch/arm/kernel/fiqasm.S
+--- linux-4.1.10/arch/arm/kernel/fiqasm.S 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/arch/arm/kernel/fiqasm.S 2015-10-07 16:40:31.000000000 +0200
@@ -47,3 +47,7 @@
mov r0, r0 @ avoid hazard prior to ARMv4
ret lr
@@ -8335,9 +8597,9 @@ diff -Nur linux-4.1.6/arch/arm/kernel/fiqasm.S linux-rpi/arch/arm/kernel/fiqasm.
+ENTRY(__FIQ_Branch)
+ mov pc, r8
+ENDPROC(__FIQ_Branch)
-diff -Nur linux-4.1.6/arch/arm/kernel/head.S linux-rpi/arch/arm/kernel/head.S
---- linux-4.1.6/arch/arm/kernel/head.S 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/arch/arm/kernel/head.S 2015-08-26 10:26:04.769260604 +0200
+diff -Nur linux-4.1.10/arch/arm/kernel/head.S linux-rpi/arch/arm/kernel/head.S
+--- linux-4.1.10/arch/arm/kernel/head.S 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/arch/arm/kernel/head.S 2015-10-07 16:40:31.000000000 +0200
@@ -680,6 +680,14 @@
ldrcc r7, [r4], #4 @ use branch for delay slot
bcc 1b
@@ -8353,9 +8615,9 @@ diff -Nur linux-4.1.6/arch/arm/kernel/head.S linux-rpi/arch/arm/kernel/head.S
#endif
ENDPROC(__fixup_a_pv_table)
-diff -Nur linux-4.1.6/arch/arm/kernel/process.c linux-rpi/arch/arm/kernel/process.c
---- linux-4.1.6/arch/arm/kernel/process.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/arch/arm/kernel/process.c 2015-08-26 10:26:04.773260660 +0200
+diff -Nur linux-4.1.10/arch/arm/kernel/process.c linux-rpi/arch/arm/kernel/process.c
+--- linux-4.1.10/arch/arm/kernel/process.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/arch/arm/kernel/process.c 2015-10-07 16:40:31.000000000 +0200
@@ -98,6 +98,16 @@
}
#endif
@@ -8373,41 +8635,9 @@ diff -Nur linux-4.1.6/arch/arm/kernel/process.c linux-rpi/arch/arm/kernel/proces
void __show_regs(struct pt_regs *regs)
{
unsigned long flags;
-diff -Nur linux-4.1.6/arch/arm/lib/Makefile linux-rpi/arch/arm/lib/Makefile
---- linux-4.1.6/arch/arm/lib/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/arch/arm/lib/Makefile 2015-08-26 10:26:04.777260716 +0200
-@@ -6,9 +6,8 @@
-
- lib-y := backtrace.o changebit.o csumipv6.o csumpartial.o \
- csumpartialcopy.o csumpartialcopyuser.o clearbit.o \
-- delay.o delay-loop.o findbit.o memchr.o memcpy.o \
-- memmove.o memset.o memzero.o setbit.o \
-- strchr.o strrchr.o \
-+ delay.o delay-loop.o findbit.o memchr.o memzero.o \
-+ setbit.o strchr.o strrchr.o \
- testchangebit.o testclearbit.o testsetbit.o \
- ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \
- ucmpdi2.o lib1funcs.o div64.o \
-@@ -18,6 +17,16 @@
- mmu-y := clear_user.o copy_page.o getuser.o putuser.o \
- copy_from_user.o copy_to_user.o
-
-+# Choose optimised implementations for Raspberry Pi
-+ifeq ($(CONFIG_MACH_BCM2708),y)
-+ CFLAGS_uaccess_with_memcpy.o += -DCOPY_FROM_USER_THRESHOLD=1600
-+ CFLAGS_uaccess_with_memcpy.o += -DCOPY_TO_USER_THRESHOLD=672
-+ obj-$(CONFIG_MODULES) += exports_rpi.o
-+ lib-y += memcpy_rpi.o memmove_rpi.o memset_rpi.o memcmp_rpi.o
-+else
-+ lib-y += memcpy.o memmove.o memset.o
-+endif
-+
- # using lib_ here won't override already available weak symbols
- obj-$(CONFIG_UACCESS_WITH_MEMCPY) += uaccess_with_memcpy.o
-
-diff -Nur linux-4.1.6/arch/arm/lib/arm-mem.h linux-rpi/arch/arm/lib/arm-mem.h
---- linux-4.1.6/arch/arm/lib/arm-mem.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/lib/arm-mem.h 2015-08-26 10:26:04.777260716 +0200
+diff -Nur linux-4.1.10/arch/arm/lib/arm-mem.h linux-rpi/arch/arm/lib/arm-mem.h
+--- linux-4.1.10/arch/arm/lib/arm-mem.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/lib/arm-mem.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,159 @@
+/*
+Copyright (c) 2013, Raspberry Pi Foundation
@@ -8568,9 +8798,9 @@ diff -Nur linux-4.1.6/arch/arm/lib/arm-mem.h linux-rpi/arch/arm/lib/arm-mem.h
+ .endif
+92:
+.endm
-diff -Nur linux-4.1.6/arch/arm/lib/copy_from_user.S linux-rpi/arch/arm/lib/copy_from_user.S
---- linux-4.1.6/arch/arm/lib/copy_from_user.S 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/arch/arm/lib/copy_from_user.S 2015-08-26 10:26:04.777260716 +0200
+diff -Nur linux-4.1.10/arch/arm/lib/copy_from_user.S linux-rpi/arch/arm/lib/copy_from_user.S
+--- linux-4.1.10/arch/arm/lib/copy_from_user.S 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/arch/arm/lib/copy_from_user.S 2015-10-07 16:40:32.000000000 +0200
@@ -89,11 +89,13 @@
.text
@@ -8586,9 +8816,9 @@ diff -Nur linux-4.1.6/arch/arm/lib/copy_from_user.S linux-rpi/arch/arm/lib/copy_
.pushsection .fixup,"ax"
.align 0
-diff -Nur linux-4.1.6/arch/arm/lib/exports_rpi.c linux-rpi/arch/arm/lib/exports_rpi.c
---- linux-4.1.6/arch/arm/lib/exports_rpi.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/lib/exports_rpi.c 2015-08-26 10:26:04.777260716 +0200
+diff -Nur linux-4.1.10/arch/arm/lib/exports_rpi.c linux-rpi/arch/arm/lib/exports_rpi.c
+--- linux-4.1.10/arch/arm/lib/exports_rpi.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/lib/exports_rpi.c 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2014, Raspberry Pi (Trading) Ltd.
@@ -8627,9 +8857,41 @@ diff -Nur linux-4.1.6/arch/arm/lib/exports_rpi.c linux-rpi/arch/arm/lib/exports_
+#include <linux/module.h>
+
+EXPORT_SYMBOL(memcmp);
-diff -Nur linux-4.1.6/arch/arm/lib/memcmp_rpi.S linux-rpi/arch/arm/lib/memcmp_rpi.S
---- linux-4.1.6/arch/arm/lib/memcmp_rpi.S 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/lib/memcmp_rpi.S 2015-08-26 10:26:04.777260716 +0200
+diff -Nur linux-4.1.10/arch/arm/lib/Makefile linux-rpi/arch/arm/lib/Makefile
+--- linux-4.1.10/arch/arm/lib/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/arch/arm/lib/Makefile 2015-10-07 16:40:32.000000000 +0200
+@@ -6,9 +6,8 @@
+
+ lib-y := backtrace.o changebit.o csumipv6.o csumpartial.o \
+ csumpartialcopy.o csumpartialcopyuser.o clearbit.o \
+- delay.o delay-loop.o findbit.o memchr.o memcpy.o \
+- memmove.o memset.o memzero.o setbit.o \
+- strchr.o strrchr.o \
++ delay.o delay-loop.o findbit.o memchr.o memzero.o \
++ setbit.o strchr.o strrchr.o \
+ testchangebit.o testclearbit.o testsetbit.o \
+ ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \
+ ucmpdi2.o lib1funcs.o div64.o \
+@@ -18,6 +17,16 @@
+ mmu-y := clear_user.o copy_page.o getuser.o putuser.o \
+ copy_from_user.o copy_to_user.o
+
++# Choose optimised implementations for Raspberry Pi
++ifeq ($(CONFIG_MACH_BCM2708),y)
++ CFLAGS_uaccess_with_memcpy.o += -DCOPY_FROM_USER_THRESHOLD=1600
++ CFLAGS_uaccess_with_memcpy.o += -DCOPY_TO_USER_THRESHOLD=672
++ obj-$(CONFIG_MODULES) += exports_rpi.o
++ lib-y += memcpy_rpi.o memmove_rpi.o memset_rpi.o memcmp_rpi.o
++else
++ lib-y += memcpy.o memmove.o memset.o
++endif
++
+ # using lib_ here won't override already available weak symbols
+ obj-$(CONFIG_UACCESS_WITH_MEMCPY) += uaccess_with_memcpy.o
+
+diff -Nur linux-4.1.10/arch/arm/lib/memcmp_rpi.S linux-rpi/arch/arm/lib/memcmp_rpi.S
+--- linux-4.1.10/arch/arm/lib/memcmp_rpi.S 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/lib/memcmp_rpi.S 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,285 @@
+/*
+Copyright (c) 2013, Raspberry Pi Foundation
@@ -8916,72 +9178,9 @@ diff -Nur linux-4.1.6/arch/arm/lib/memcmp_rpi.S linux-rpi/arch/arm/lib/memcmp_rp
+ .unreq DAT7
+ .unreq OFF
+ENDPROC(memcmp)
-diff -Nur linux-4.1.6/arch/arm/lib/memcpy_rpi.S linux-rpi/arch/arm/lib/memcpy_rpi.S
---- linux-4.1.6/arch/arm/lib/memcpy_rpi.S 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/lib/memcpy_rpi.S 2015-08-26 10:26:04.777260716 +0200
-@@ -0,0 +1,59 @@
-+/*
-+Copyright (c) 2013, Raspberry Pi Foundation
-+Copyright (c) 2013, RISC OS Open Ltd
-+All rights reserved.
-+
-+Redistribution and use in source and binary forms, with or without
-+modification, are permitted provided that the following conditions are met:
-+ * Redistributions of source code must retain the above copyright
-+ notice, this list of conditions and the following disclaimer.
-+ * Redistributions in binary form must reproduce the above copyright
-+ notice, this list of conditions and the following disclaimer in the
-+ documentation and/or other materials provided with the distribution.
-+ * Neither the name of the copyright holder nor the
-+ names of its contributors may be used to endorse or promote products
-+ derived from this software without specific prior written permission.
-+
-+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
-+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+*/
-+
-+#include <linux/linkage.h>
-+#include "arm-mem.h"
-+#include "memcpymove.h"
-+
-+/* Prevent the stack from becoming executable */
-+#if defined(__linux__) && defined(__ELF__)
-+.section .note.GNU-stack,"",%progbits
-+#endif
-+
-+ .text
-+ .arch armv6
-+ .object_arch armv4
-+ .arm
-+ .altmacro
-+ .p2align 2
-+
-+/*
-+ * void *memcpy(void * restrict s1, const void * restrict s2, size_t n);
-+ * On entry:
-+ * a1 = pointer to destination
-+ * a2 = pointer to source
-+ * a3 = number of bytes to copy
-+ * On exit:
-+ * a1 preserved
-+ */
-+
-+.set prefetch_distance, 3
-+
-+ENTRY(memcpy)
-+ memcpy 0
-+ENDPROC(memcpy)
-diff -Nur linux-4.1.6/arch/arm/lib/memcpymove.h linux-rpi/arch/arm/lib/memcpymove.h
---- linux-4.1.6/arch/arm/lib/memcpymove.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/lib/memcpymove.h 2015-08-26 10:26:04.777260716 +0200
+diff -Nur linux-4.1.10/arch/arm/lib/memcpymove.h linux-rpi/arch/arm/lib/memcpymove.h
+--- linux-4.1.10/arch/arm/lib/memcpymove.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/lib/memcpymove.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,506 @@
+/*
+Copyright (c) 2013, Raspberry Pi Foundation
@@ -9489,9 +9688,72 @@ diff -Nur linux-4.1.6/arch/arm/lib/memcpymove.h linux-rpi/arch/arm/lib/memcpymov
+ .unreq LAST
+ .unreq OFF
+.endm
-diff -Nur linux-4.1.6/arch/arm/lib/memmove_rpi.S linux-rpi/arch/arm/lib/memmove_rpi.S
---- linux-4.1.6/arch/arm/lib/memmove_rpi.S 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/lib/memmove_rpi.S 2015-08-26 10:26:04.777260716 +0200
+diff -Nur linux-4.1.10/arch/arm/lib/memcpy_rpi.S linux-rpi/arch/arm/lib/memcpy_rpi.S
+--- linux-4.1.10/arch/arm/lib/memcpy_rpi.S 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/lib/memcpy_rpi.S 2015-10-07 16:40:32.000000000 +0200
+@@ -0,0 +1,59 @@
++/*
++Copyright (c) 2013, Raspberry Pi Foundation
++Copyright (c) 2013, RISC OS Open Ltd
++All rights reserved.
++
++Redistribution and use in source and binary forms, with or without
++modification, are permitted provided that the following conditions are met:
++ * Redistributions of source code must retain the above copyright
++ notice, this list of conditions and the following disclaimer.
++ * Redistributions in binary form must reproduce the above copyright
++ notice, this list of conditions and the following disclaimer in the
++ documentation and/or other materials provided with the distribution.
++ * Neither the name of the copyright holder nor the
++ names of its contributors may be used to endorse or promote products
++ derived from this software without specific prior written permission.
++
++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
++ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
++WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
++DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
++DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
++(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
++LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
++ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++*/
++
++#include <linux/linkage.h>
++#include "arm-mem.h"
++#include "memcpymove.h"
++
++/* Prevent the stack from becoming executable */
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
++
++ .text
++ .arch armv6
++ .object_arch armv4
++ .arm
++ .altmacro
++ .p2align 2
++
++/*
++ * void *memcpy(void * restrict s1, const void * restrict s2, size_t n);
++ * On entry:
++ * a1 = pointer to destination
++ * a2 = pointer to source
++ * a3 = number of bytes to copy
++ * On exit:
++ * a1 preserved
++ */
++
++.set prefetch_distance, 3
++
++ENTRY(memcpy)
++ memcpy 0
++ENDPROC(memcpy)
+diff -Nur linux-4.1.10/arch/arm/lib/memmove_rpi.S linux-rpi/arch/arm/lib/memmove_rpi.S
+--- linux-4.1.10/arch/arm/lib/memmove_rpi.S 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/lib/memmove_rpi.S 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,61 @@
+/*
+Copyright (c) 2013, Raspberry Pi Foundation
@@ -9554,9 +9816,9 @@ diff -Nur linux-4.1.6/arch/arm/lib/memmove_rpi.S linux-rpi/arch/arm/lib/memmove_
+ bpl memcpy /* pl works even over -1 - 0 and 0x7fffffff - 0x80000000 boundaries */
+ memcpy 1
+ENDPROC(memmove)
-diff -Nur linux-4.1.6/arch/arm/lib/memset_rpi.S linux-rpi/arch/arm/lib/memset_rpi.S
---- linux-4.1.6/arch/arm/lib/memset_rpi.S 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/lib/memset_rpi.S 2015-08-26 10:26:04.777260716 +0200
+diff -Nur linux-4.1.10/arch/arm/lib/memset_rpi.S linux-rpi/arch/arm/lib/memset_rpi.S
+--- linux-4.1.10/arch/arm/lib/memset_rpi.S 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/lib/memset_rpi.S 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,121 @@
+/*
+Copyright (c) 2013, Raspberry Pi Foundation
@@ -9679,9 +9941,9 @@ diff -Nur linux-4.1.6/arch/arm/lib/memset_rpi.S linux-rpi/arch/arm/lib/memset_rp
+ .unreq DAT2
+ .unreq DAT3
+ENDPROC(memset)
-diff -Nur linux-4.1.6/arch/arm/lib/uaccess_with_memcpy.c linux-rpi/arch/arm/lib/uaccess_with_memcpy.c
---- linux-4.1.6/arch/arm/lib/uaccess_with_memcpy.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/arch/arm/lib/uaccess_with_memcpy.c 2015-08-26 10:26:04.777260716 +0200
+diff -Nur linux-4.1.10/arch/arm/lib/uaccess_with_memcpy.c linux-rpi/arch/arm/lib/uaccess_with_memcpy.c
+--- linux-4.1.10/arch/arm/lib/uaccess_with_memcpy.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/arch/arm/lib/uaccess_with_memcpy.c 2015-10-07 16:40:32.000000000 +0200
@@ -22,6 +22,14 @@
#include <asm/current.h>
#include <asm/page.h>
@@ -9825,20 +10087,9 @@ diff -Nur linux-4.1.6/arch/arm/lib/uaccess_with_memcpy.c linux-rpi/arch/arm/lib/
static unsigned long noinline
__clear_user_memset(void __user *addr, unsigned long n)
-diff -Nur linux-4.1.6/arch/arm/mach-bcm/Kconfig linux-rpi/arch/arm/mach-bcm/Kconfig
---- linux-4.1.6/arch/arm/mach-bcm/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/arch/arm/mach-bcm/Kconfig 2015-08-26 10:26:04.781260773 +0200
-@@ -114,6 +114,7 @@
- select ARM_ERRATA_411920
- select ARM_TIMER_SP804
- select CLKSRC_OF
-+ select FIQ
- select PINCTRL
- select PINCTRL_BCM2835
- help
-diff -Nur linux-4.1.6/arch/arm/mach-bcm/board_bcm2835.c linux-rpi/arch/arm/mach-bcm/board_bcm2835.c
---- linux-4.1.6/arch/arm/mach-bcm/board_bcm2835.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/arch/arm/mach-bcm/board_bcm2835.c 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm/board_bcm2835.c linux-rpi/arch/arm/mach-bcm/board_bcm2835.c
+--- linux-4.1.10/arch/arm/mach-bcm/board_bcm2835.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/arch/arm/mach-bcm/board_bcm2835.c 2015-10-07 16:40:32.000000000 +0200
@@ -18,6 +18,7 @@
#include <linux/of_address.h>
#include <linux/of_platform.h>
@@ -9869,75 +10120,20 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm/board_bcm2835.c linux-rpi/arch/arm/mach-
}
static const char * const bcm2835_compat[] = {
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/Kconfig linux-rpi/arch/arm/mach-bcm2708/Kconfig
---- linux-4.1.6/arch/arm/mach-bcm2708/Kconfig 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/Kconfig 2015-08-26 10:26:04.781260773 +0200
-@@ -0,0 +1,45 @@
-+menu "Broadcom BCM2708 Implementations"
-+ depends on ARCH_BCM2708
-+
-+config MACH_BCM2708
-+ bool "Broadcom BCM2708 Development Platform"
-+ select NEED_MACH_MEMORY_H
-+ select NEED_MACH_IO_H
-+ select CPU_V6
-+ help
-+ Include support for the Broadcom(R) BCM2708 platform.
-+
-+config BCM2708_DT
-+ bool "BCM2708 Device Tree support"
-+ depends on MACH_BCM2708
-+ default n
-+ select USE_OF
-+ select ARCH_REQUIRE_GPIOLIB
-+ select PINCTRL
-+ select PINCTRL_BCM2835
-+ help
-+ Enable Device Tree support for BCM2708
-+
-+config BCM2708_GPIO
-+ bool "BCM2708 gpio support"
-+ depends on MACH_BCM2708
-+ select ARCH_REQUIRE_GPIOLIB
-+ default y
-+ help
-+ Include support for the Broadcom(R) BCM2708 gpio.
-+
-+config BCM2708_NOL2CACHE
-+ bool "Videocore L2 cache disable"
-+ depends on MACH_BCM2708
-+ default n
-+ help
-+ Do not allow ARM to use GPU's L2 cache. Requires disable_l2cache in config.txt.
-+
-+config BCM2708_SPIDEV
-+ bool "Bind spidev to SPI0 master"
-+ depends on MACH_BCM2708
-+ depends on SPI
-+ default y
-+ help
-+ Binds spidev driver to the SPI0 master
-+endmenu
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/Makefile linux-rpi/arch/arm/mach-bcm2708/Makefile
---- linux-4.1.6/arch/arm/mach-bcm2708/Makefile 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/Makefile 2015-08-26 10:26:04.781260773 +0200
-@@ -0,0 +1,6 @@
-+#
-+# Makefile for the linux kernel.
-+#
-+
-+obj-$(CONFIG_MACH_BCM2708) += bcm2708.o armctrl.o
-+obj-$(CONFIG_BCM2708_GPIO) += bcm2708_gpio.o
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/Makefile.boot linux-rpi/arch/arm/mach-bcm2708/Makefile.boot
---- linux-4.1.6/arch/arm/mach-bcm2708/Makefile.boot 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/Makefile.boot 2015-08-26 10:26:04.781260773 +0200
-@@ -0,0 +1,3 @@
-+ zreladdr-y := 0x00008000
-+params_phys-y := 0x00000100
-+initrd_phys-y := 0x00800000
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/armctrl.c linux-rpi/arch/arm/mach-bcm2708/armctrl.c
---- linux-4.1.6/arch/arm/mach-bcm2708/armctrl.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/armctrl.c 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm/Kconfig linux-rpi/arch/arm/mach-bcm/Kconfig
+--- linux-4.1.10/arch/arm/mach-bcm/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/arch/arm/mach-bcm/Kconfig 2015-10-07 16:40:32.000000000 +0200
+@@ -114,6 +114,7 @@
+ select ARM_ERRATA_411920
+ select ARM_TIMER_SP804
+ select CLKSRC_OF
++ select FIQ
+ select PINCTRL
+ select PINCTRL_BCM2835
+ help
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/armctrl.c linux-rpi/arch/arm/mach-bcm2708/armctrl.c
+--- linux-4.1.10/arch/arm/mach-bcm2708/armctrl.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/armctrl.c 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,315 @@
+/*
+ * linux/arch/arm/mach-bcm2708/armctrl.c
@@ -10254,9 +10450,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/armctrl.c linux-rpi/arch/arm/mach-bc
+ armctrl_dt_init();
+ return 0;
+}
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/armctrl.h linux-rpi/arch/arm/mach-bcm2708/armctrl.h
---- linux-4.1.6/arch/arm/mach-bcm2708/armctrl.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/armctrl.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/armctrl.h linux-rpi/arch/arm/mach-bcm2708/armctrl.h
+--- linux-4.1.10/arch/arm/mach-bcm2708/armctrl.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/armctrl.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,27 @@
+/*
+ * linux/arch/arm/mach-bcm2708/armctrl.h
@@ -10285,9 +10481,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/armctrl.h linux-rpi/arch/arm/mach-bc
+ u32 armctrl_sources, u32 resume_sources);
+
+#endif
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/bcm2708.c linux-rpi/arch/arm/mach-bcm2708/bcm2708.c
---- linux-4.1.6/arch/arm/mach-bcm2708/bcm2708.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/bcm2708.c 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/bcm2708.c linux-rpi/arch/arm/mach-bcm2708/bcm2708.c
+--- linux-4.1.10/arch/arm/mach-bcm2708/bcm2708.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/bcm2708.c 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,1162 @@
+/*
+ * linux/arch/arm/mach-bcm2708/bcm2708.c
@@ -11451,62 +11647,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/bcm2708.c linux-rpi/arch/arm/mach-bc
+MODULE_PARM_DESC(vc_i2c_override, "Allow the use of VC's I2C peripheral.");
+module_param(pps_gpio_pin, int, 0644);
+MODULE_PARM_DESC(pps_gpio_pin, "Set GPIO pin to reserve for PPS");
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/bcm2708.h linux-rpi/arch/arm/mach-bcm2708/bcm2708.h
---- linux-4.1.6/arch/arm/mach-bcm2708/bcm2708.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/bcm2708.h 2015-08-26 10:26:04.781260773 +0200
-@@ -0,0 +1,49 @@
-+/*
-+ * linux/arch/arm/mach-bcm2708/bcm2708.h
-+ *
-+ * BCM2708 machine support header
-+ *
-+ * Copyright (C) 2010 Broadcom
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-+ */
-+
-+#ifndef __BCM2708_BCM2708_H
-+#define __BCM2708_BCM2708_H
-+
-+#include <linux/amba/bus.h>
-+
-+extern void __init bcm2708_init(void);
-+extern void __init bcm2708_init_irq(void);
-+extern void __init bcm2708_map_io(void);
-+extern struct sys_timer bcm2708_timer;
-+extern unsigned int mmc_status(struct device *dev);
-+
-+#define AMBA_DEVICE(name, busid, base, plat) \
-+static struct amba_device name##_device = { \
-+ .dev = { \
-+ .coherent_dma_mask = ~0, \
-+ .init_name = busid, \
-+ .platform_data = plat, \
-+ }, \
-+ .res = { \
-+ .start = base##_BASE, \
-+ .end = (base##_BASE) + SZ_4K - 1,\
-+ .flags = IORESOURCE_MEM, \
-+ }, \
-+ .irq = base##_IRQ, \
-+}
-+
-+#endif
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/bcm2708_gpio.c linux-rpi/arch/arm/mach-bcm2708/bcm2708_gpio.c
---- linux-4.1.6/arch/arm/mach-bcm2708/bcm2708_gpio.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/bcm2708_gpio.c 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/bcm2708_gpio.c linux-rpi/arch/arm/mach-bcm2708/bcm2708_gpio.c
+--- linux-4.1.10/arch/arm/mach-bcm2708/bcm2708_gpio.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/bcm2708_gpio.c 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,426 @@
+/*
+ * linux/arch/arm/mach-bcm2708/bcm2708_gpio.c
@@ -11934,9 +12077,62 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/bcm2708_gpio.c linux-rpi/arch/arm/ma
+
+MODULE_DESCRIPTION("Broadcom BCM2708 GPIO driver");
+MODULE_LICENSE("GPL");
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/arm_control.h linux-rpi/arch/arm/mach-bcm2708/include/mach/arm_control.h
---- linux-4.1.6/arch/arm/mach-bcm2708/include/mach/arm_control.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/include/mach/arm_control.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/bcm2708.h linux-rpi/arch/arm/mach-bcm2708/bcm2708.h
+--- linux-4.1.10/arch/arm/mach-bcm2708/bcm2708.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/bcm2708.h 2015-10-07 16:40:32.000000000 +0200
+@@ -0,0 +1,49 @@
++/*
++ * linux/arch/arm/mach-bcm2708/bcm2708.h
++ *
++ * BCM2708 machine support header
++ *
++ * Copyright (C) 2010 Broadcom
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++ */
++
++#ifndef __BCM2708_BCM2708_H
++#define __BCM2708_BCM2708_H
++
++#include <linux/amba/bus.h>
++
++extern void __init bcm2708_init(void);
++extern void __init bcm2708_init_irq(void);
++extern void __init bcm2708_map_io(void);
++extern struct sys_timer bcm2708_timer;
++extern unsigned int mmc_status(struct device *dev);
++
++#define AMBA_DEVICE(name, busid, base, plat) \
++static struct amba_device name##_device = { \
++ .dev = { \
++ .coherent_dma_mask = ~0, \
++ .init_name = busid, \
++ .platform_data = plat, \
++ }, \
++ .res = { \
++ .start = base##_BASE, \
++ .end = (base##_BASE) + SZ_4K - 1,\
++ .flags = IORESOURCE_MEM, \
++ }, \
++ .irq = base##_IRQ, \
++}
++
++#endif
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/include/mach/arm_control.h linux-rpi/arch/arm/mach-bcm2708/include/mach/arm_control.h
+--- linux-4.1.10/arch/arm/mach-bcm2708/include/mach/arm_control.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/include/mach/arm_control.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,419 @@
+/*
+ * linux/arch/arm/mach-bcm2708/arm_control.h
@@ -12357,9 +12553,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/arm_control.h linux-rpi
+#define AJBTDO HW_REGISTER_RW(AJB_BASE+0x0c)
+
+#endif
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/clkdev.h linux-rpi/arch/arm/mach-bcm2708/include/mach/clkdev.h
---- linux-4.1.6/arch/arm/mach-bcm2708/include/mach/clkdev.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/include/mach/clkdev.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/include/mach/clkdev.h linux-rpi/arch/arm/mach-bcm2708/include/mach/clkdev.h
+--- linux-4.1.10/arch/arm/mach-bcm2708/include/mach/clkdev.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/include/mach/clkdev.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,7 @@
+#ifndef __ASM_MACH_CLKDEV_H
+#define __ASM_MACH_CLKDEV_H
@@ -12368,9 +12564,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/clkdev.h linux-rpi/arch
+#define __clk_put(clk) do { } while (0)
+
+#endif
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/debug-macro.S linux-rpi/arch/arm/mach-bcm2708/include/mach/debug-macro.S
---- linux-4.1.6/arch/arm/mach-bcm2708/include/mach/debug-macro.S 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/include/mach/debug-macro.S 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/include/mach/debug-macro.S linux-rpi/arch/arm/mach-bcm2708/include/mach/debug-macro.S
+--- linux-4.1.10/arch/arm/mach-bcm2708/include/mach/debug-macro.S 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/include/mach/debug-macro.S 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,22 @@
+/* arch/arm/mach-bcm2708/include/mach/debug-macro.S
+ *
@@ -12394,9 +12590,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/debug-macro.S linux-rpi
+ .endm
+
+#include <debug/pl01x.S>
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/entry-macro.S linux-rpi/arch/arm/mach-bcm2708/include/mach/entry-macro.S
---- linux-4.1.6/arch/arm/mach-bcm2708/include/mach/entry-macro.S 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/include/mach/entry-macro.S 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/include/mach/entry-macro.S linux-rpi/arch/arm/mach-bcm2708/include/mach/entry-macro.S
+--- linux-4.1.10/arch/arm/mach-bcm2708/include/mach/entry-macro.S 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/include/mach/entry-macro.S 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,69 @@
+/*
+ * arch/arm/mach-bcm2708/include/mach/entry-macro.S
@@ -12467,9 +12663,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/entry-macro.S linux-rpi
+1020: @ EQ will be set if no irqs pending
+
+ .endm
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/frc.h linux-rpi/arch/arm/mach-bcm2708/include/mach/frc.h
---- linux-4.1.6/arch/arm/mach-bcm2708/include/mach/frc.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/include/mach/frc.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/include/mach/frc.h linux-rpi/arch/arm/mach-bcm2708/include/mach/frc.h
+--- linux-4.1.10/arch/arm/mach-bcm2708/include/mach/frc.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/include/mach/frc.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,38 @@
+/*
+ * arch/arm/mach-bcm2708/include/mach/timex.h
@@ -12509,9 +12705,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/frc.h linux-rpi/arch/ar
+extern unsigned long long frc_clock_ticks63(void);
+
+#endif
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/gpio.h linux-rpi/arch/arm/mach-bcm2708/include/mach/gpio.h
---- linux-4.1.6/arch/arm/mach-bcm2708/include/mach/gpio.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/include/mach/gpio.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/include/mach/gpio.h linux-rpi/arch/arm/mach-bcm2708/include/mach/gpio.h
+--- linux-4.1.10/arch/arm/mach-bcm2708/include/mach/gpio.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/include/mach/gpio.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,17 @@
+/*
+ * arch/arm/mach-bcm2708/include/mach/gpio.h
@@ -12530,9 +12726,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/gpio.h linux-rpi/arch/a
+#define irq_to_gpio(x) ((x) - GPIO_IRQ_START)
+
+#endif
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/hardware.h linux-rpi/arch/arm/mach-bcm2708/include/mach/hardware.h
---- linux-4.1.6/arch/arm/mach-bcm2708/include/mach/hardware.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/include/mach/hardware.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/include/mach/hardware.h linux-rpi/arch/arm/mach-bcm2708/include/mach/hardware.h
+--- linux-4.1.10/arch/arm/mach-bcm2708/include/mach/hardware.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/include/mach/hardware.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,28 @@
+/*
+ * arch/arm/mach-bcm2708/include/mach/hardware.h
@@ -12562,9 +12758,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/hardware.h linux-rpi/ar
+#include <mach/platform.h>
+
+#endif
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/io.h linux-rpi/arch/arm/mach-bcm2708/include/mach/io.h
---- linux-4.1.6/arch/arm/mach-bcm2708/include/mach/io.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/include/mach/io.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/include/mach/io.h linux-rpi/arch/arm/mach-bcm2708/include/mach/io.h
+--- linux-4.1.10/arch/arm/mach-bcm2708/include/mach/io.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/include/mach/io.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,27 @@
+/*
+ * arch/arm/mach-bcm2708/include/mach/io.h
@@ -12593,9 +12789,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/io.h linux-rpi/arch/arm
+#define __io(a) __typesafe_io(a)
+
+#endif
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/irqs.h linux-rpi/arch/arm/mach-bcm2708/include/mach/irqs.h
---- linux-4.1.6/arch/arm/mach-bcm2708/include/mach/irqs.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/include/mach/irqs.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/include/mach/irqs.h linux-rpi/arch/arm/mach-bcm2708/include/mach/irqs.h
+--- linux-4.1.10/arch/arm/mach-bcm2708/include/mach/irqs.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/include/mach/irqs.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,199 @@
+/*
+ * arch/arm/mach-bcm2708/include/mach/irqs.h
@@ -12796,9 +12992,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/irqs.h linux-rpi/arch/a
+#define NR_IRQS (BCM2708_ALLOC_IRQS+FREE_IRQS)
+
+#endif /* _BCM2708_IRQS_H_ */
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/memory.h linux-rpi/arch/arm/mach-bcm2708/include/mach/memory.h
---- linux-4.1.6/arch/arm/mach-bcm2708/include/mach/memory.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/include/mach/memory.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/include/mach/memory.h linux-rpi/arch/arm/mach-bcm2708/include/mach/memory.h
+--- linux-4.1.10/arch/arm/mach-bcm2708/include/mach/memory.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/include/mach/memory.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,57 @@
+/*
+ * arch/arm/mach-bcm2708/include/mach/memory.h
@@ -12857,9 +13053,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/memory.h linux-rpi/arch
+#define __bus_to_pfn(x) __phys_to_pfn((x) - (BUS_OFFSET - BCM_PLAT_PHYS_OFFSET))
+
+#endif
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/platform.h linux-rpi/arch/arm/mach-bcm2708/include/mach/platform.h
---- linux-4.1.6/arch/arm/mach-bcm2708/include/mach/platform.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/include/mach/platform.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/include/mach/platform.h linux-rpi/arch/arm/mach-bcm2708/include/mach/platform.h
+--- linux-4.1.10/arch/arm/mach-bcm2708/include/mach/platform.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/include/mach/platform.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,230 @@
+/*
+ * arch/arm/mach-bcm2708/include/mach/platform.h
@@ -13091,9 +13287,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/platform.h linux-rpi/ar
+#endif
+
+/* END */
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/system.h linux-rpi/arch/arm/mach-bcm2708/include/mach/system.h
---- linux-4.1.6/arch/arm/mach-bcm2708/include/mach/system.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/include/mach/system.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/include/mach/system.h linux-rpi/arch/arm/mach-bcm2708/include/mach/system.h
+--- linux-4.1.10/arch/arm/mach-bcm2708/include/mach/system.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/include/mach/system.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,38 @@
+/*
+ * arch/arm/mach-bcm2708/include/mach/system.h
@@ -13133,9 +13329,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/system.h linux-rpi/arch
+}
+
+#endif
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/timex.h linux-rpi/arch/arm/mach-bcm2708/include/mach/timex.h
---- linux-4.1.6/arch/arm/mach-bcm2708/include/mach/timex.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/include/mach/timex.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/include/mach/timex.h linux-rpi/arch/arm/mach-bcm2708/include/mach/timex.h
+--- linux-4.1.10/arch/arm/mach-bcm2708/include/mach/timex.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/include/mach/timex.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,23 @@
+/*
+ * arch/arm/mach-bcm2708/include/mach/timex.h
@@ -13160,9 +13356,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/timex.h linux-rpi/arch/
+ */
+
+#define CLOCK_TICK_RATE (1000000)
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/uncompress.h linux-rpi/arch/arm/mach-bcm2708/include/mach/uncompress.h
---- linux-4.1.6/arch/arm/mach-bcm2708/include/mach/uncompress.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/include/mach/uncompress.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/include/mach/uncompress.h linux-rpi/arch/arm/mach-bcm2708/include/mach/uncompress.h
+--- linux-4.1.10/arch/arm/mach-bcm2708/include/mach/uncompress.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/include/mach/uncompress.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,84 @@
+/*
+ * arch/arm/mach-bcn2708/include/mach/uncompress.h
@@ -13248,9 +13444,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/uncompress.h linux-rpi/
+ * nothing to do
+ */
+#define arch_decomp_wdog()
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/vc_sm_defs.h linux-rpi/arch/arm/mach-bcm2708/include/mach/vc_sm_defs.h
---- linux-4.1.6/arch/arm/mach-bcm2708/include/mach/vc_sm_defs.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/include/mach/vc_sm_defs.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/include/mach/vc_sm_defs.h linux-rpi/arch/arm/mach-bcm2708/include/mach/vc_sm_defs.h
+--- linux-4.1.10/arch/arm/mach-bcm2708/include/mach/vc_sm_defs.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/include/mach/vc_sm_defs.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,181 @@
+/*****************************************************************************
+* Copyright 2011 Broadcom Corporation. All rights reserved.
@@ -13433,9 +13629,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/vc_sm_defs.h linux-rpi/
+} VC_SM_MSG_UNION_T;
+
+#endif /* __VC_SM_DEFS_H__INCLUDED__ */
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/vc_sm_knl.h linux-rpi/arch/arm/mach-bcm2708/include/mach/vc_sm_knl.h
---- linux-4.1.6/arch/arm/mach-bcm2708/include/mach/vc_sm_knl.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/include/mach/vc_sm_knl.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/include/mach/vc_sm_knl.h linux-rpi/arch/arm/mach-bcm2708/include/mach/vc_sm_knl.h
+--- linux-4.1.10/arch/arm/mach-bcm2708/include/mach/vc_sm_knl.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/include/mach/vc_sm_knl.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,55 @@
+/*****************************************************************************
+* Copyright 2011 Broadcom Corporation. All rights reserved.
@@ -13492,9 +13688,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/vc_sm_knl.h linux-rpi/a
+ long unsigned int *data);
+
+#endif /* __VC_SM_KNL_H__INCLUDED__ */
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/vc_vchi_sm.h linux-rpi/arch/arm/mach-bcm2708/include/mach/vc_vchi_sm.h
---- linux-4.1.6/arch/arm/mach-bcm2708/include/mach/vc_vchi_sm.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/include/mach/vc_vchi_sm.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/include/mach/vc_vchi_sm.h linux-rpi/arch/arm/mach-bcm2708/include/mach/vc_vchi_sm.h
+--- linux-4.1.10/arch/arm/mach-bcm2708/include/mach/vc_vchi_sm.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/include/mach/vc_vchi_sm.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,82 @@
+/*****************************************************************************
+* Copyright 2011 Broadcom Corporation. All rights reserved.
@@ -13578,9 +13774,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/vc_vchi_sm.h linux-rpi/
+ VC_SM_ACTION_CLEAN_T *action_clean);
+
+#endif /* __VC_VCHI_SM_H__INCLUDED__ */
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/vmalloc.h linux-rpi/arch/arm/mach-bcm2708/include/mach/vmalloc.h
---- linux-4.1.6/arch/arm/mach-bcm2708/include/mach/vmalloc.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/include/mach/vmalloc.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/include/mach/vmalloc.h linux-rpi/arch/arm/mach-bcm2708/include/mach/vmalloc.h
+--- linux-4.1.10/arch/arm/mach-bcm2708/include/mach/vmalloc.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/include/mach/vmalloc.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,20 @@
+/*
+ * arch/arm/mach-bcm2708/include/mach/vmalloc.h
@@ -13602,9 +13798,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/vmalloc.h linux-rpi/arc
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#define VMALLOC_END (0xe8000000)
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/vmcs_sm_ioctl.h linux-rpi/arch/arm/mach-bcm2708/include/mach/vmcs_sm_ioctl.h
---- linux-4.1.6/arch/arm/mach-bcm2708/include/mach/vmcs_sm_ioctl.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2708/include/mach/vmcs_sm_ioctl.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/include/mach/vmcs_sm_ioctl.h linux-rpi/arch/arm/mach-bcm2708/include/mach/vmcs_sm_ioctl.h
+--- linux-4.1.10/arch/arm/mach-bcm2708/include/mach/vmcs_sm_ioctl.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/include/mach/vmcs_sm_ioctl.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,248 @@
+/*****************************************************************************
+* Copyright 2011 Broadcom Corporation. All rights reserved.
@@ -13854,72 +14050,75 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2708/include/mach/vmcs_sm_ioctl.h linux-r
+/* ---- Function Prototypes ---------------------------------------------- */
+
+#endif /* __VMCS_SM_IOCTL_H__INCLUDED__ */
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/Kconfig linux-rpi/arch/arm/mach-bcm2709/Kconfig
---- linux-4.1.6/arch/arm/mach-bcm2709/Kconfig 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/Kconfig 2015-08-26 10:26:04.781260773 +0200
-@@ -0,0 +1,42 @@
-+menu "Broadcom BCM2709 Implementations"
-+ depends on ARCH_BCM2709
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/Kconfig linux-rpi/arch/arm/mach-bcm2708/Kconfig
+--- linux-4.1.10/arch/arm/mach-bcm2708/Kconfig 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/Kconfig 2015-10-07 16:40:32.000000000 +0200
+@@ -0,0 +1,45 @@
++menu "Broadcom BCM2708 Implementations"
++ depends on ARCH_BCM2708
+
-+config MACH_BCM2709
-+ bool "Broadcom BCM2709 Development Platform"
++config MACH_BCM2708
++ bool "Broadcom BCM2708 Development Platform"
++ select NEED_MACH_MEMORY_H
++ select NEED_MACH_IO_H
++ select CPU_V6
+ help
-+ Include support for the Broadcom(R) BCM2709 platform.
++ Include support for the Broadcom(R) BCM2708 platform.
+
-+config BCM2709_DT
-+ bool "BCM2709 Device Tree support"
-+ depends on MACH_BCM2709
++config BCM2708_DT
++ bool "BCM2708 Device Tree support"
++ depends on MACH_BCM2708
+ default n
+ select USE_OF
+ select ARCH_REQUIRE_GPIOLIB
+ select PINCTRL
+ select PINCTRL_BCM2835
+ help
-+ Enable Device Tree support for BCM2709
++ Enable Device Tree support for BCM2708
+
+config BCM2708_GPIO
-+ bool "BCM2709 gpio support"
-+ depends on MACH_BCM2709
++ bool "BCM2708 gpio support"
++ depends on MACH_BCM2708
+ select ARCH_REQUIRE_GPIOLIB
+ default y
+ help
-+ Include support for the Broadcom(R) BCM2709 gpio.
++ Include support for the Broadcom(R) BCM2708 gpio.
+
+config BCM2708_NOL2CACHE
+ bool "Videocore L2 cache disable"
-+ depends on MACH_BCM2709
-+ default y
++ depends on MACH_BCM2708
++ default n
+ help
+ Do not allow ARM to use GPU's L2 cache. Requires disable_l2cache in config.txt.
+
+config BCM2708_SPIDEV
+ bool "Bind spidev to SPI0 master"
-+ depends on MACH_BCM2709
++ depends on MACH_BCM2708
+ depends on SPI
+ default y
+ help
+ Binds spidev driver to the SPI0 master
+endmenu
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/Makefile linux-rpi/arch/arm/mach-bcm2709/Makefile
---- linux-4.1.6/arch/arm/mach-bcm2709/Makefile 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/Makefile 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/Makefile linux-rpi/arch/arm/mach-bcm2708/Makefile
+--- linux-4.1.10/arch/arm/mach-bcm2708/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/Makefile 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,6 @@
+#
+# Makefile for the linux kernel.
+#
+
-+obj-$(CONFIG_MACH_BCM2709) += bcm2709.o armctrl.o
++obj-$(CONFIG_MACH_BCM2708) += bcm2708.o armctrl.o
+obj-$(CONFIG_BCM2708_GPIO) += bcm2708_gpio.o
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/Makefile.boot linux-rpi/arch/arm/mach-bcm2709/Makefile.boot
---- linux-4.1.6/arch/arm/mach-bcm2709/Makefile.boot 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/Makefile.boot 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2708/Makefile.boot linux-rpi/arch/arm/mach-bcm2708/Makefile.boot
+--- linux-4.1.10/arch/arm/mach-bcm2708/Makefile.boot 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2708/Makefile.boot 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,3 @@
+ zreladdr-y := 0x00008000
+params_phys-y := 0x00000100
+initrd_phys-y := 0x00800000
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/armctrl.c linux-rpi/arch/arm/mach-bcm2709/armctrl.c
---- linux-4.1.6/arch/arm/mach-bcm2709/armctrl.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/armctrl.c 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/armctrl.c linux-rpi/arch/arm/mach-bcm2709/armctrl.c
+--- linux-4.1.10/arch/arm/mach-bcm2709/armctrl.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/armctrl.c 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,384 @@
+/*
+ * linux/arch/arm/mach-bcm2708/armctrl.c
@@ -14305,9 +14504,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/armctrl.c linux-rpi/arch/arm/mach-bc
+ armctrl_dt_init();
+ return 0;
+}
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/armctrl.h linux-rpi/arch/arm/mach-bcm2709/armctrl.h
---- linux-4.1.6/arch/arm/mach-bcm2709/armctrl.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/armctrl.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/armctrl.h linux-rpi/arch/arm/mach-bcm2709/armctrl.h
+--- linux-4.1.10/arch/arm/mach-bcm2709/armctrl.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/armctrl.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,27 @@
+/*
+ * linux/arch/arm/mach-bcm2708/armctrl.h
@@ -14336,9 +14535,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/armctrl.h linux-rpi/arch/arm/mach-bc
+ u32 armctrl_sources, u32 resume_sources);
+
+#endif
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/bcm2708_gpio.c linux-rpi/arch/arm/mach-bcm2709/bcm2708_gpio.c
---- linux-4.1.6/arch/arm/mach-bcm2709/bcm2708_gpio.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/bcm2708_gpio.c 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/bcm2708_gpio.c linux-rpi/arch/arm/mach-bcm2709/bcm2708_gpio.c
+--- linux-4.1.10/arch/arm/mach-bcm2709/bcm2708_gpio.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/bcm2708_gpio.c 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,426 @@
+/*
+ * linux/arch/arm/mach-bcm2708/bcm2708_gpio.c
@@ -14766,9 +14965,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/bcm2708_gpio.c linux-rpi/arch/arm/ma
+
+MODULE_DESCRIPTION("Broadcom BCM2708 GPIO driver");
+MODULE_LICENSE("GPL");
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/bcm2709.c linux-rpi/arch/arm/mach-bcm2709/bcm2709.c
---- linux-4.1.6/arch/arm/mach-bcm2709/bcm2709.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/bcm2709.c 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/bcm2709.c linux-rpi/arch/arm/mach-bcm2709/bcm2709.c
+--- linux-4.1.10/arch/arm/mach-bcm2709/bcm2709.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/bcm2709.c 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,1332 @@
+/*
+ * linux/arch/arm/mach-bcm2709/bcm2709.c
@@ -16102,9 +16301,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/bcm2709.c linux-rpi/arch/arm/mach-bc
+MODULE_PARM_DESC(vc_i2c_override, "Allow the use of VC's I2C peripheral.");
+module_param(pps_gpio_pin, int, 0644);
+MODULE_PARM_DESC(pps_gpio_pin, "Set GPIO pin to reserve for PPS");
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/bcm2709.h linux-rpi/arch/arm/mach-bcm2709/bcm2709.h
---- linux-4.1.6/arch/arm/mach-bcm2709/bcm2709.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/bcm2709.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/bcm2709.h linux-rpi/arch/arm/mach-bcm2709/bcm2709.h
+--- linux-4.1.10/arch/arm/mach-bcm2709/bcm2709.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/bcm2709.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,49 @@
+/*
+ * linux/arch/arm/mach-bcm2708/bcm2708.h
@@ -16155,9 +16354,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/bcm2709.h linux-rpi/arch/arm/mach-bc
+}
+
+#endif
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/delay.S linux-rpi/arch/arm/mach-bcm2709/delay.S
---- linux-4.1.6/arch/arm/mach-bcm2709/delay.S 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/delay.S 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/delay.S linux-rpi/arch/arm/mach-bcm2709/delay.S
+--- linux-4.1.10/arch/arm/mach-bcm2709/delay.S 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/delay.S 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,21 @@
+/*
+ * linux/arch/arm/lib/delay.S
@@ -16180,9 +16379,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/delay.S linux-rpi/arch/arm/mach-bcm2
+ bhi bcm2708_delay
+ mov pc, lr
+ENDPROC(bcm2708_delay)
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/arm_control.h linux-rpi/arch/arm/mach-bcm2709/include/mach/arm_control.h
---- linux-4.1.6/arch/arm/mach-bcm2709/include/mach/arm_control.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/include/mach/arm_control.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/include/mach/arm_control.h linux-rpi/arch/arm/mach-bcm2709/include/mach/arm_control.h
+--- linux-4.1.10/arch/arm/mach-bcm2709/include/mach/arm_control.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/include/mach/arm_control.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,493 @@
+/*
+ * linux/arch/arm/mach-bcm2708/arm_control.h
@@ -16677,16 +16876,16 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/arm_control.h linux-rpi
+#define ARM_LOCAL_MAILBOX3_CLR3 HW_REGISTER_RW(ARM_LOCAL_BASE+0x0FC)
+
+#endif
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/barriers.h linux-rpi/arch/arm/mach-bcm2709/include/mach/barriers.h
---- linux-4.1.6/arch/arm/mach-bcm2709/include/mach/barriers.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/include/mach/barriers.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/include/mach/barriers.h linux-rpi/arch/arm/mach-bcm2709/include/mach/barriers.h
+--- linux-4.1.10/arch/arm/mach-bcm2709/include/mach/barriers.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/include/mach/barriers.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,3 @@
+#define mb() dsb()
+#define rmb() dsb()
+#define wmb() mb()
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/clkdev.h linux-rpi/arch/arm/mach-bcm2709/include/mach/clkdev.h
---- linux-4.1.6/arch/arm/mach-bcm2709/include/mach/clkdev.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/include/mach/clkdev.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/include/mach/clkdev.h linux-rpi/arch/arm/mach-bcm2709/include/mach/clkdev.h
+--- linux-4.1.10/arch/arm/mach-bcm2709/include/mach/clkdev.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/include/mach/clkdev.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,7 @@
+#ifndef __ASM_MACH_CLKDEV_H
+#define __ASM_MACH_CLKDEV_H
@@ -16695,9 +16894,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/clkdev.h linux-rpi/arch
+#define __clk_put(clk) do { } while (0)
+
+#endif
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/debug-macro.S linux-rpi/arch/arm/mach-bcm2709/include/mach/debug-macro.S
---- linux-4.1.6/arch/arm/mach-bcm2709/include/mach/debug-macro.S 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/include/mach/debug-macro.S 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/include/mach/debug-macro.S linux-rpi/arch/arm/mach-bcm2709/include/mach/debug-macro.S
+--- linux-4.1.10/arch/arm/mach-bcm2709/include/mach/debug-macro.S 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/include/mach/debug-macro.S 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,22 @@
+/* arch/arm/mach-bcm2708/include/mach/debug-macro.S
+ *
@@ -16721,9 +16920,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/debug-macro.S linux-rpi
+ .endm
+
+#include <debug/pl01x.S>
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/entry-macro.S linux-rpi/arch/arm/mach-bcm2709/include/mach/entry-macro.S
---- linux-4.1.6/arch/arm/mach-bcm2709/include/mach/entry-macro.S 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/include/mach/entry-macro.S 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/include/mach/entry-macro.S linux-rpi/arch/arm/mach-bcm2709/include/mach/entry-macro.S
+--- linux-4.1.10/arch/arm/mach-bcm2709/include/mach/entry-macro.S 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/include/mach/entry-macro.S 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,120 @@
+/*
+ * arch/arm/mach-bcm2708/include/mach/entry-macro.S
@@ -16845,9 +17044,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/entry-macro.S linux-rpi
+ .macro arch_irq_handler_default
+1: get_irqnr_and_base r0, r2, r6, lr
+ .endm
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/frc.h linux-rpi/arch/arm/mach-bcm2709/include/mach/frc.h
---- linux-4.1.6/arch/arm/mach-bcm2709/include/mach/frc.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/include/mach/frc.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/include/mach/frc.h linux-rpi/arch/arm/mach-bcm2709/include/mach/frc.h
+--- linux-4.1.10/arch/arm/mach-bcm2709/include/mach/frc.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/include/mach/frc.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,38 @@
+/*
+ * arch/arm/mach-bcm2708/include/mach/timex.h
@@ -16887,9 +17086,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/frc.h linux-rpi/arch/ar
+extern unsigned long long frc_clock_ticks63(void);
+
+#endif
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/gpio.h linux-rpi/arch/arm/mach-bcm2709/include/mach/gpio.h
---- linux-4.1.6/arch/arm/mach-bcm2709/include/mach/gpio.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/include/mach/gpio.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/include/mach/gpio.h linux-rpi/arch/arm/mach-bcm2709/include/mach/gpio.h
+--- linux-4.1.10/arch/arm/mach-bcm2709/include/mach/gpio.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/include/mach/gpio.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,17 @@
+/*
+ * arch/arm/mach-bcm2708/include/mach/gpio.h
@@ -16908,9 +17107,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/gpio.h linux-rpi/arch/a
+#define irq_to_gpio(x) ((x) - GPIO_IRQ_START)
+
+#endif
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/hardware.h linux-rpi/arch/arm/mach-bcm2709/include/mach/hardware.h
---- linux-4.1.6/arch/arm/mach-bcm2709/include/mach/hardware.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/include/mach/hardware.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/include/mach/hardware.h linux-rpi/arch/arm/mach-bcm2709/include/mach/hardware.h
+--- linux-4.1.10/arch/arm/mach-bcm2709/include/mach/hardware.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/include/mach/hardware.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,28 @@
+/*
+ * arch/arm/mach-bcm2708/include/mach/hardware.h
@@ -16940,9 +17139,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/hardware.h linux-rpi/ar
+#include <mach/platform.h>
+
+#endif
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/io.h linux-rpi/arch/arm/mach-bcm2709/include/mach/io.h
---- linux-4.1.6/arch/arm/mach-bcm2709/include/mach/io.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/include/mach/io.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/include/mach/io.h linux-rpi/arch/arm/mach-bcm2709/include/mach/io.h
+--- linux-4.1.10/arch/arm/mach-bcm2709/include/mach/io.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/include/mach/io.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,27 @@
+/*
+ * arch/arm/mach-bcm2708/include/mach/io.h
@@ -16971,9 +17170,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/io.h linux-rpi/arch/arm
+#define __io(a) __typesafe_io(a)
+
+#endif
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/irqs.h linux-rpi/arch/arm/mach-bcm2709/include/mach/irqs.h
---- linux-4.1.6/arch/arm/mach-bcm2709/include/mach/irqs.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/include/mach/irqs.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/include/mach/irqs.h linux-rpi/arch/arm/mach-bcm2709/include/mach/irqs.h
+--- linux-4.1.10/arch/arm/mach-bcm2709/include/mach/irqs.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/include/mach/irqs.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,225 @@
+/*
+ * arch/arm/mach-bcm2708/include/mach/irqs.h
@@ -17200,9 +17399,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/irqs.h linux-rpi/arch/a
+#define NR_IRQS (BCM2708_ALLOC_IRQS+FREE_IRQS)
+
+#endif /* _BCM2708_IRQS_H_ */
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/memory.h linux-rpi/arch/arm/mach-bcm2709/include/mach/memory.h
---- linux-4.1.6/arch/arm/mach-bcm2709/include/mach/memory.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/include/mach/memory.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/include/mach/memory.h linux-rpi/arch/arm/mach-bcm2709/include/mach/memory.h
+--- linux-4.1.10/arch/arm/mach-bcm2709/include/mach/memory.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/include/mach/memory.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,57 @@
+/*
+ * arch/arm/mach-bcm2708/include/mach/memory.h
@@ -17261,9 +17460,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/memory.h linux-rpi/arch
+#define __bus_to_pfn(x) __phys_to_pfn((x) - (BUS_OFFSET - BCM_PLAT_PHYS_OFFSET))
+
+#endif
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/platform.h linux-rpi/arch/arm/mach-bcm2709/include/mach/platform.h
---- linux-4.1.6/arch/arm/mach-bcm2709/include/mach/platform.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/include/mach/platform.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/include/mach/platform.h linux-rpi/arch/arm/mach-bcm2709/include/mach/platform.h
+--- linux-4.1.10/arch/arm/mach-bcm2709/include/mach/platform.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/include/mach/platform.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,227 @@
+/*
+ * arch/arm/mach-bcm2708/include/mach/platform.h
@@ -17492,9 +17691,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/platform.h linux-rpi/ar
+#endif
+
+/* END */
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/system.h linux-rpi/arch/arm/mach-bcm2709/include/mach/system.h
---- linux-4.1.6/arch/arm/mach-bcm2709/include/mach/system.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/include/mach/system.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/include/mach/system.h linux-rpi/arch/arm/mach-bcm2709/include/mach/system.h
+--- linux-4.1.10/arch/arm/mach-bcm2709/include/mach/system.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/include/mach/system.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,38 @@
+/*
+ * arch/arm/mach-bcm2708/include/mach/system.h
@@ -17534,9 +17733,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/system.h linux-rpi/arch
+}
+
+#endif
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/timex.h linux-rpi/arch/arm/mach-bcm2709/include/mach/timex.h
---- linux-4.1.6/arch/arm/mach-bcm2709/include/mach/timex.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/include/mach/timex.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/include/mach/timex.h linux-rpi/arch/arm/mach-bcm2709/include/mach/timex.h
+--- linux-4.1.10/arch/arm/mach-bcm2709/include/mach/timex.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/include/mach/timex.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,23 @@
+/*
+ * arch/arm/mach-bcm2708/include/mach/timex.h
@@ -17561,9 +17760,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/timex.h linux-rpi/arch/
+ */
+
+#define CLOCK_TICK_RATE (1000000)
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/uncompress.h linux-rpi/arch/arm/mach-bcm2709/include/mach/uncompress.h
---- linux-4.1.6/arch/arm/mach-bcm2709/include/mach/uncompress.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/include/mach/uncompress.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/include/mach/uncompress.h linux-rpi/arch/arm/mach-bcm2709/include/mach/uncompress.h
+--- linux-4.1.10/arch/arm/mach-bcm2709/include/mach/uncompress.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/include/mach/uncompress.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,84 @@
+/*
+ * arch/arm/mach-bcn2708/include/mach/uncompress.h
@@ -17649,9 +17848,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/uncompress.h linux-rpi/
+ * nothing to do
+ */
+#define arch_decomp_wdog()
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/vc_support.h linux-rpi/arch/arm/mach-bcm2709/include/mach/vc_support.h
---- linux-4.1.6/arch/arm/mach-bcm2709/include/mach/vc_support.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/include/mach/vc_support.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/include/mach/vc_support.h linux-rpi/arch/arm/mach-bcm2709/include/mach/vc_support.h
+--- linux-4.1.10/arch/arm/mach-bcm2709/include/mach/vc_support.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/include/mach/vc_support.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,69 @@
+#ifndef _VC_SUPPORT_H_
+#define _VC_SUPPORT_H_
@@ -17722,9 +17921,9 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/vc_support.h linux-rpi/
+ unsigned int r0, unsigned int r1, unsigned int r2, unsigned int r3, unsigned int r4, unsigned int r5);
+
+#endif
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/vmalloc.h linux-rpi/arch/arm/mach-bcm2709/include/mach/vmalloc.h
---- linux-4.1.6/arch/arm/mach-bcm2709/include/mach/vmalloc.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/include/mach/vmalloc.h 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/include/mach/vmalloc.h linux-rpi/arch/arm/mach-bcm2709/include/mach/vmalloc.h
+--- linux-4.1.10/arch/arm/mach-bcm2709/include/mach/vmalloc.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/include/mach/vmalloc.h 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,20 @@
+/*
+ * arch/arm/mach-bcm2708/include/mach/vmalloc.h
@@ -17746,9 +17945,72 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/include/mach/vmalloc.h linux-rpi/arc
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#define VMALLOC_END (0xff000000)
-diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/vc_support.c linux-rpi/arch/arm/mach-bcm2709/vc_support.c
---- linux-4.1.6/arch/arm/mach-bcm2709/vc_support.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/arch/arm/mach-bcm2709/vc_support.c 2015-08-26 10:26:04.781260773 +0200
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/Kconfig linux-rpi/arch/arm/mach-bcm2709/Kconfig
+--- linux-4.1.10/arch/arm/mach-bcm2709/Kconfig 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/Kconfig 2015-10-07 16:40:32.000000000 +0200
+@@ -0,0 +1,42 @@
++menu "Broadcom BCM2709 Implementations"
++ depends on ARCH_BCM2709
++
++config MACH_BCM2709
++ bool "Broadcom BCM2709 Development Platform"
++ help
++ Include support for the Broadcom(R) BCM2709 platform.
++
++config BCM2709_DT
++ bool "BCM2709 Device Tree support"
++ depends on MACH_BCM2709
++ default n
++ select USE_OF
++ select ARCH_REQUIRE_GPIOLIB
++ select PINCTRL
++ select PINCTRL_BCM2835
++ help
++ Enable Device Tree support for BCM2709
++
++config BCM2708_GPIO
++ bool "BCM2709 gpio support"
++ depends on MACH_BCM2709
++ select ARCH_REQUIRE_GPIOLIB
++ default y
++ help
++ Include support for the Broadcom(R) BCM2709 gpio.
++
++config BCM2708_NOL2CACHE
++ bool "Videocore L2 cache disable"
++ depends on MACH_BCM2709
++ default y
++ help
++ Do not allow ARM to use GPU's L2 cache. Requires disable_l2cache in config.txt.
++
++config BCM2708_SPIDEV
++ bool "Bind spidev to SPI0 master"
++ depends on MACH_BCM2709
++ depends on SPI
++ default y
++ help
++ Binds spidev driver to the SPI0 master
++endmenu
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/Makefile linux-rpi/arch/arm/mach-bcm2709/Makefile
+--- linux-4.1.10/arch/arm/mach-bcm2709/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/Makefile 2015-10-07 16:40:32.000000000 +0200
+@@ -0,0 +1,6 @@
++#
++# Makefile for the linux kernel.
++#
++
++obj-$(CONFIG_MACH_BCM2709) += bcm2709.o armctrl.o
++obj-$(CONFIG_BCM2708_GPIO) += bcm2708_gpio.o
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/Makefile.boot linux-rpi/arch/arm/mach-bcm2709/Makefile.boot
+--- linux-4.1.10/arch/arm/mach-bcm2709/Makefile.boot 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/Makefile.boot 2015-10-07 16:40:32.000000000 +0200
+@@ -0,0 +1,3 @@
++ zreladdr-y := 0x00008000
++params_phys-y := 0x00000100
++initrd_phys-y := 0x00800000
+diff -Nur linux-4.1.10/arch/arm/mach-bcm2709/vc_support.c linux-rpi/arch/arm/mach-bcm2709/vc_support.c
+--- linux-4.1.10/arch/arm/mach-bcm2709/vc_support.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/arch/arm/mach-bcm2709/vc_support.c 2015-10-07 16:40:32.000000000 +0200
@@ -0,0 +1,318 @@
+/*
+ * vc_support.c
@@ -18068,9 +18330,21 @@ diff -Nur linux-4.1.6/arch/arm/mach-bcm2709/vc_support.c linux-rpi/arch/arm/mach
+ return 1;
+ }
+}
-diff -Nur linux-4.1.6/arch/arm/mm/Kconfig linux-rpi/arch/arm/mm/Kconfig
---- linux-4.1.6/arch/arm/mm/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/arch/arm/mm/Kconfig 2015-08-26 10:26:04.889262296 +0200
+diff -Nur linux-4.1.10/arch/arm/Makefile linux-rpi/arch/arm/Makefile
+--- linux-4.1.10/arch/arm/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/arch/arm/Makefile 2015-10-07 16:40:31.000000000 +0200
+@@ -142,6 +142,8 @@
+
+ # Machine directory name. This list is sorted alphanumerically
+ # by CONFIG_* macro name.
++machine-$(CONFIG_ARCH_BCM2708) += bcm2708
++machine-$(CONFIG_ARCH_BCM2709) += bcm2709
+ machine-$(CONFIG_ARCH_ALPINE) += alpine
+ machine-$(CONFIG_ARCH_AT91) += at91
+ machine-$(CONFIG_ARCH_AXXIA) += axxia
+diff -Nur linux-4.1.10/arch/arm/mm/Kconfig linux-rpi/arch/arm/mm/Kconfig
+--- linux-4.1.10/arch/arm/mm/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/arch/arm/mm/Kconfig 2015-10-07 16:40:32.000000000 +0200
@@ -358,7 +358,7 @@
# ARMv6
@@ -18080,9 +18354,9 @@ diff -Nur linux-4.1.6/arch/arm/mm/Kconfig linux-rpi/arch/arm/mm/Kconfig
select CPU_32v6
select CPU_ABRT_EV6
select CPU_CACHE_V6
-diff -Nur linux-4.1.6/arch/arm/mm/proc-v6.S linux-rpi/arch/arm/mm/proc-v6.S
---- linux-4.1.6/arch/arm/mm/proc-v6.S 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/arch/arm/mm/proc-v6.S 2015-08-26 10:26:04.893262353 +0200
+diff -Nur linux-4.1.10/arch/arm/mm/proc-v6.S linux-rpi/arch/arm/mm/proc-v6.S
+--- linux-4.1.10/arch/arm/mm/proc-v6.S 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/arch/arm/mm/proc-v6.S 2015-10-07 16:40:32.000000000 +0200
@@ -73,10 +73,19 @@
*
* IRQs are already disabled.
@@ -18106,10 +18380,10 @@ diff -Nur linux-4.1.6/arch/arm/mm/proc-v6.S linux-rpi/arch/arm/mm/proc-v6.S
ret lr
ENTRY(cpu_v6_dcache_clean_area)
-diff -Nur linux-4.1.6/arch/arm/mm/proc-v7.S linux-rpi/arch/arm/mm/proc-v7.S
---- linux-4.1.6/arch/arm/mm/proc-v7.S 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/arch/arm/mm/proc-v7.S 2015-08-26 10:26:04.893262353 +0200
-@@ -456,6 +456,7 @@
+diff -Nur linux-4.1.10/arch/arm/mm/proc-v7.S linux-rpi/arch/arm/mm/proc-v7.S
+--- linux-4.1.10/arch/arm/mm/proc-v7.S 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/arch/arm/mm/proc-v7.S 2015-10-07 16:40:32.000000000 +0200
+@@ -460,6 +460,7 @@
orr r0, r0, r6 @ set them
THUMB( orr r0, r0, #1 << 30 ) @ Thumb exceptions
ret lr @ return to head.S:__ret
@@ -18117,9 +18391,9 @@ diff -Nur linux-4.1.6/arch/arm/mm/proc-v7.S linux-rpi/arch/arm/mm/proc-v7.S
ENDPROC(__v7_setup)
.align 2
-diff -Nur linux-4.1.6/arch/arm/tools/mach-types linux-rpi/arch/arm/tools/mach-types
---- linux-4.1.6/arch/arm/tools/mach-types 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/arch/arm/tools/mach-types 2015-08-26 10:26:04.905262521 +0200
+diff -Nur linux-4.1.10/arch/arm/tools/mach-types linux-rpi/arch/arm/tools/mach-types
+--- linux-4.1.10/arch/arm/tools/mach-types 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/arch/arm/tools/mach-types 2015-10-07 16:40:32.000000000 +0200
@@ -522,6 +522,8 @@
prima2_evb MACH_PRIMA2_EVB PRIMA2_EVB 3103
paz00 MACH_PAZ00 PAZ00 3128
@@ -18129,94 +18403,262 @@ diff -Nur linux-4.1.6/arch/arm/tools/mach-types linux-rpi/arch/arm/tools/mach-ty
ag5evm MACH_AG5EVM AG5EVM 3189
ics_if_voip MACH_ICS_IF_VOIP ICS_IF_VOIP 3206
wlf_cragg_6410 MACH_WLF_CRAGG_6410 WLF_CRAGG_6410 3207
-diff -Nur linux-4.1.6/drivers/char/Kconfig linux-rpi/drivers/char/Kconfig
---- linux-4.1.6/drivers/char/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/char/Kconfig 2015-08-26 10:26:06.405283586 +0200
-@@ -590,6 +590,8 @@
+diff -Nur linux-4.1.10/Documentation/ABI/stable/sysfs-driver-w1_ds28ea00 linux-rpi/Documentation/ABI/stable/sysfs-driver-w1_ds28ea00
+--- linux-4.1.10/Documentation/ABI/stable/sysfs-driver-w1_ds28ea00 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/Documentation/ABI/stable/sysfs-driver-w1_ds28ea00 2015-10-07 16:40:29.000000000 +0200
+@@ -0,0 +1,6 @@
++What: /sys/bus/w1/devices/.../w1_seq
++Date: Apr 2015
++Contact: Matt Campbell <mattrcampbell@gmail.com>
++Description: Support for the DS28EA00 chain sequence function
++ see Documentation/w1/slaves/w1_therm for detailed information
++Users: any user space application which wants to communicate with DS28EA00
+diff -Nur linux-4.1.10/Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt linux-rpi/Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt
+--- linux-4.1.10/Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt 2015-10-07 16:40:29.000000000 +0200
+@@ -48,8 +48,8 @@
- source "drivers/s390/char/Kconfig"
+ bcm2835_i2s: i2s@7e203000 {
+ compatible = "brcm,bcm2835-i2s";
+- reg = < 0x7e203000 0x20>,
+- < 0x7e101098 0x02>;
++ reg = < 0x7e203000 0x24>,
++ < 0x7e101098 0x08>;
-+source "drivers/char/broadcom/Kconfig"
+ dmas = <&dma 2>,
+ <&dma 3>;
+diff -Nur linux-4.1.10/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi-dev.txt linux-rpi/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi-dev.txt
+--- linux-4.1.10/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi-dev.txt 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi-dev.txt 2015-10-07 16:40:29.000000000 +0200
+@@ -0,0 +1,17 @@
++* Broadcom BCM2835 SMI character device driver.
+
- config MSM_SMD_PKT
- bool "Enable device interface for some SMD packet ports"
- default n
-diff -Nur linux-4.1.6/drivers/char/Makefile linux-rpi/drivers/char/Makefile
---- linux-4.1.6/drivers/char/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/char/Makefile 2015-08-26 10:26:06.405283586 +0200
-@@ -62,3 +62,4 @@
++SMI or secondary memory interface is a peripheral specific to certain Broadcom
++SOCs, and is helpful for talking to things like parallel-interface displays
++and NAND flashes (in fact, most things with a parallel register interface).
++
++This driver adds a character device which provides a user-space interface to
++an instance of the SMI driver.
++
++Required properties:
++- compatible: "brcm,bcm2835-smi-dev"
++- smi_handle: a phandle to the smi node.
++
++Optional properties:
++- None.
++
++
+diff -Nur linux-4.1.10/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi.txt linux-rpi/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi.txt
+--- linux-4.1.10/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi.txt 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/Documentation/devicetree/bindings/misc/brcm,bcm2835-smi.txt 2015-10-07 16:40:29.000000000 +0200
+@@ -0,0 +1,48 @@
++* Broadcom BCM2835 SMI driver.
++
++SMI or secondary memory interface is a peripheral specific to certain Broadcom
++SOCs, and is helpful for talking to things like parallel-interface displays
++and NAND flashes (in fact, most things with a parallel register interface).
++
++Required properties:
++- compatible: "brcm,bcm2835-smi"
++- reg: Should contain location and length of SMI registers and SMI clkman regs
++- interrupts: *the* SMI interrupt.
++- pinctrl-names: should be "default".
++- pinctrl-0: the phandle of the gpio pin node.
++- brcm,smi-clock-source: the clock source for clkman
++- brcm,smi-clock-divisor: the integer clock divisor for clkman
++- dmas: the dma controller phandle and the DREQ number (4 on a 2835)
++- dma-names: the name used by the driver to request its channel.
++ Should be "rx-tx".
++
++Optional properties:
++- None.
++
++Examples:
++
++8 data pin configuration:
++
++smi: smi@7e600000 {
++ compatible = "brcm,bcm2835-smi";
++ reg = <0x7e600000 0x44>, <0x7e1010b0 0x8>;
++ interrupts = <2 16>;
++ pinctrl-names = "default";
++ pinctrl-0 = <&smi_pins>;
++ brcm,smi-clock-source = <6>;
++ brcm,smi-clock-divisor = <4>;
++ dmas = <&dma 4>;
++ dma-names = "rx-tx";
++
++ status = "okay";
++};
++
++smi_pins: smi_pins {
++ brcm,pins = <2 3 4 5 6 7 8 9 10 11 12 13 14 15>;
++ /* Alt 1: SMI */
++ brcm,function = <5 5 5 5 5 5 5 5 5 5 5 5 5 5>;
++ /* /CS, /WE and /OE are pulled high, as they are
++ generally active low signals */
++ brcm,pull = <2 2 2 2 2 2 0 0 0 0 0 0 0 0>;
++};
++
+diff -Nur linux-4.1.10/Documentation/devicetree/bindings/mtd/brcm,bcm2835-smi-nand.txt linux-rpi/Documentation/devicetree/bindings/mtd/brcm,bcm2835-smi-nand.txt
+--- linux-4.1.10/Documentation/devicetree/bindings/mtd/brcm,bcm2835-smi-nand.txt 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/Documentation/devicetree/bindings/mtd/brcm,bcm2835-smi-nand.txt 2015-10-07 16:40:29.000000000 +0200
+@@ -0,0 +1,42 @@
++* BCM2835 SMI NAND flash
++
++This driver is a shim between the BCM2835 SMI driver (SMI is a peripheral for
++talking to parallel register interfaces) and Linux's MTD layer.
++
++Required properties:
++- compatible: "brcm,bcm2835-smi-nand"
++- status: "okay"
++
++Optional properties:
++- partition@n, where n is an integer from a consecutive sequence starting at 0
++ - Difficult to store partition table on NAND device - normally put it
++ in the source code, kernel bootparams, or device tree (the best way!)
++ - Sub-properties:
++ - label: the partition name, as shown by mtdinfo /dev/mtd*
++ - reg: the size and offset of this partition.
++ - (optional) read-only: an empty property flagging as read only
++
++Example:
++
++nand: flash@0 {
++ compatible = "brcm,bcm2835-smi-nand";
++ status = "okay";
++
++ partition@0 {
++ label = "stage2";
++ // 128k
++ reg = <0 0x20000>;
++ read-only;
++ };
++ partition@1 {
++ label = "firmware";
++ // 16M
++ reg = <0x20000 0x1000000>;
++ read-only;
++ };
++ partition@2 {
++ label = "root";
++ // 2G
++ reg = <0x1020000 0x80000000>;
++ };
++};
+\ No newline at end of file
+diff -Nur linux-4.1.10/Documentation/devicetree/bindings/sound/brcm,bcm2835-i2s.txt linux-rpi/Documentation/devicetree/bindings/sound/brcm,bcm2835-i2s.txt
+--- linux-4.1.10/Documentation/devicetree/bindings/sound/brcm,bcm2835-i2s.txt 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/Documentation/devicetree/bindings/sound/brcm,bcm2835-i2s.txt 2015-10-07 16:40:29.000000000 +0200
+@@ -16,8 +16,8 @@
- obj-$(CONFIG_TILE_SROM) += tile-srom.o
- obj-$(CONFIG_XILLYBUS) += xillybus/
-+obj-$(CONFIG_BRCM_CHAR_DRIVERS) += broadcom/
-diff -Nur linux-4.1.6/drivers/char/broadcom/Kconfig linux-rpi/drivers/char/broadcom/Kconfig
---- linux-4.1.6/drivers/char/broadcom/Kconfig 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/char/broadcom/Kconfig 2015-08-26 10:26:06.405283586 +0200
-@@ -0,0 +1,49 @@
-+#
-+# Broadcom char driver config
-+#
+ bcm2835_i2s: i2s@7e203000 {
+ compatible = "brcm,bcm2835-i2s";
+- reg = <0x7e203000 0x20>,
+- <0x7e101098 0x02>;
++ reg = <0x7e203000 0x24>,
++ <0x7e101098 0x08>;
+
+ dmas = <&dma 2>,
+ <&dma 3>;
+diff -Nur linux-4.1.10/Documentation/video4linux/bcm2835-v4l2.txt linux-rpi/Documentation/video4linux/bcm2835-v4l2.txt
+--- linux-4.1.10/Documentation/video4linux/bcm2835-v4l2.txt 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/Documentation/video4linux/bcm2835-v4l2.txt 2015-10-07 16:40:31.000000000 +0200
+@@ -0,0 +1,60 @@
+
-+menuconfig BRCM_CHAR_DRIVERS
-+ bool "Broadcom Char Drivers"
-+ help
-+ Broadcom's char drivers
++BCM2835 (aka Raspberry Pi) V4L2 driver
++======================================
+
-+if BRCM_CHAR_DRIVERS
++1. Copyright
++============
+
-+config BCM_VC_CMA
-+ bool "Videocore CMA"
-+ depends on CMA && BCM2708_VCHIQ
-+ default n
-+ help
-+ Helper for videocore CMA access.
++Copyright © 2013 Raspberry Pi (Trading) Ltd.
+
-+config BCM2708_VCMEM
-+ bool "Videocore Memory"
-+ default y
-+ help
-+ Helper for videocore memory access and total size allocation.
++2. License
++==========
+
-+config BCM_VCIO
-+ tristate "Mailbox userspace access"
-+ depends on BCM2835_MBOX
-+ help
-+ Gives access to the mailbox property channel from userspace.
++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.
+
-+endif
++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.
+
-+config BCM_VC_SM
-+ bool "VMCS Shared Memory"
-+ depends on BCM2708_VCHIQ
-+ select BCM2708_VCMEM
-+ default n
-+ help
-+ Support for the VC shared memory on the Broadcom reference
-+ design. Uses the VCHIQ stack.
++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., 675 Mass Ave, Cambridge, MA 02139, USA.
+
-+config BCM2835_DEVGPIOMEM
-+ tristate "/dev/gpiomem rootless GPIO access via mmap() on the BCM2835"
-+ default m
-+ help
-+ Provides users with root-free access to the GPIO registers
-+ on the 2835. Calling mmap(/dev/gpiomem) will map the GPIO
-+ register page to the user's pointer.
++3. Quick Start
++==============
+
-diff -Nur linux-4.1.6/drivers/char/broadcom/Makefile linux-rpi/drivers/char/broadcom/Makefile
---- linux-4.1.6/drivers/char/broadcom/Makefile 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/char/broadcom/Makefile 2015-08-26 10:26:06.405283586 +0200
-@@ -0,0 +1,7 @@
-+obj-$(CONFIG_BCM_VC_CMA) += vc_cma/
-+obj-$(CONFIG_BCM2708_VCMEM) += vc_mem.o
-+obj-$(CONFIG_BCM_VCIO) += vcio.o
-+obj-$(CONFIG_BCM_VC_SM) += vc_sm/
++You need a version 1.0 or later of v4l2-ctl, available from:
++ git://git.linuxtv.org/v4l-utils.git
+
-+obj-$(CONFIG_BCM2835_DEVGPIOMEM)+= bcm2835-gpiomem.o
++$ sudo modprobe bcm2835-v4l2
++
++Turn on the overlay:
++
++$ v4l2-ctl --overlay=1
++
++Turn off the overlay:
++
++$ v4l2-ctl --overlay=0
++
++Set the capture format for video:
++
++$ v4l2-ctl --set-fmt-video=width=1920,height=1088,pixelformat=4
++
++(Note: 1088 not 1080).
++
++Capture:
++
++$ v4l2-ctl --stream-mmap=3 --stream-count=100 --stream-to=somefile.h264
++
++Stills capture:
++
++$ v4l2-ctl --set-fmt-video=width=2592,height=1944,pixelformat=3
++$ v4l2-ctl --stream-mmap=3 --stream-count=1 --stream-to=somefile.jpg
++
++List of available formats:
+
-diff -Nur linux-4.1.6/drivers/char/broadcom/bcm2835-gpiomem.c linux-rpi/drivers/char/broadcom/bcm2835-gpiomem.c
---- linux-4.1.6/drivers/char/broadcom/bcm2835-gpiomem.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/char/broadcom/bcm2835-gpiomem.c 2015-08-26 10:26:06.405283586 +0200
-@@ -0,0 +1,265 @@
++$ v4l2-ctl --list-formats
+diff -Nur linux-4.1.10/Documentation/w1/slaves/w1_therm linux-rpi/Documentation/w1/slaves/w1_therm
+--- linux-4.1.10/Documentation/w1/slaves/w1_therm 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/Documentation/w1/slaves/w1_therm 2015-10-07 16:40:31.000000000 +0200
+@@ -11,12 +11,14 @@
+ Description
+ -----------
+
+-w1_therm provides basic temperature conversion for ds18*20 devices.
++w1_therm provides basic temperature conversion for ds18*20 devices, and the
++ds28ea00 device.
+ supported family codes:
+ W1_THERM_DS18S20 0x10
+ W1_THERM_DS1822 0x22
+ W1_THERM_DS18B20 0x28
+ W1_THERM_DS1825 0x3B
++W1_THERM_DS28EA00 0x42
+
+ Support is provided through the sysfs w1_slave file. Each open and
+ read sequence will initiate a temperature conversion then provide two
+@@ -48,3 +50,10 @@
+ maximum current draw of 1.5mA and that a 5k pullup resistor is not
+ sufficient. The strong pullup is designed to provide the additional
+ current required.
++
++The DS28EA00 provides an additional two pins for implementing a sequence
++detection algorithm. This feature allows you to determine the physical
++location of the chip in the 1-wire bus without needing pre-existing
++knowledge of the bus ordering. Support is provided through the sysfs
++w1_seq file. The file will contain a single line with an integer value
++representing the device index in the bus starting at 0.
+diff -Nur linux-4.1.10/drivers/char/broadcom/bcm2835-gpiomem.c linux-rpi/drivers/char/broadcom/bcm2835-gpiomem.c
+--- linux-4.1.10/drivers/char/broadcom/bcm2835-gpiomem.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/char/broadcom/bcm2835-gpiomem.c 2015-10-07 16:40:34.000000000 +0200
+@@ -0,0 +1,260 @@
+/**
+ * GPIO memory device driver
+ *
@@ -18362,7 +18804,6 @@ diff -Nur linux-4.1.6/drivers/char/broadcom/bcm2835-gpiomem.c linux-rpi/drivers/
+ int err;
+ void *ptr_err;
+ struct device *dev = &pdev->dev;
-+ struct device_node *node = dev->of_node;
+ struct resource *ioresource;
+
+ /* Allocate buffers and instance data */
@@ -18376,6 +18817,15 @@ diff -Nur linux-4.1.6/drivers/char/broadcom/bcm2835-gpiomem.c linux-rpi/drivers/
+
+ inst->dev = dev;
+
++ ioresource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ if (ioresource) {
++ inst->gpio_regs_phys = ioresource->start;
++ } else {
++ dev_err(inst->dev, "failed to get IO resource");
++ err = -ENOENT;
++ goto failed_get_resource;
++ }
++
+ /* Create character device entries */
+
+ err = alloc_chrdev_region(&bcm2835_gpiomem_devid,
@@ -18406,20 +18856,6 @@ diff -Nur linux-4.1.6/drivers/char/broadcom/bcm2835-gpiomem.c linux-rpi/drivers/
+ if (IS_ERR(ptr_err))
+ goto failed_device_create;
+
-+ /* Get address from device tree if available (*_resource() correctly
-+ converts the bus address in device tree to a physical address),
-+ or use hardcoded offset + BCM2708_PERI_BASE if not.
-+ (In spite of its name 2708 actually seems to have the correct
-+ mach-dependent value on 2709 etc, as it is defined in
-+ mach-bcm270x/platform.h) */
-+
-+ if (node) {
-+ ioresource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+ inst->gpio_regs_phys = ioresource->start;
-+ } else {
-+ inst->gpio_regs_phys = GPIO_BASE;
-+ }
-+
+ dev_info(inst->dev, "Initialised: Registers at 0x%08lx",
+ inst->gpio_regs_phys);
+
@@ -18433,6 +18869,7 @@ diff -Nur linux-4.1.6/drivers/char/broadcom/bcm2835-gpiomem.c linux-rpi/drivers/
+failed_cdev_add:
+ unregister_chrdev_region(bcm2835_gpiomem_devid, 1);
+failed_alloc_chrdev:
++failed_get_resource:
+ kfree(inst);
+failed_inst_alloc:
+ dev_err(inst->dev, "could not load bcm2835_gpiomem");
@@ -18482,9 +18919,487 @@ diff -Nur linux-4.1.6/drivers/char/broadcom/bcm2835-gpiomem.c linux-rpi/drivers/
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("gpiomem driver for accessing GPIO from userspace");
+MODULE_AUTHOR("Luke Wren <luke@raspberrypi.org>");
-diff -Nur linux-4.1.6/drivers/char/broadcom/vc_cma/Makefile linux-rpi/drivers/char/broadcom/vc_cma/Makefile
---- linux-4.1.6/drivers/char/broadcom/vc_cma/Makefile 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/char/broadcom/vc_cma/Makefile 2015-08-26 10:26:06.405283586 +0200
+diff -Nur linux-4.1.10/drivers/char/broadcom/bcm2835_smi_dev.c linux-rpi/drivers/char/broadcom/bcm2835_smi_dev.c
+--- linux-4.1.10/drivers/char/broadcom/bcm2835_smi_dev.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/char/broadcom/bcm2835_smi_dev.c 2015-10-07 16:40:34.000000000 +0200
+@@ -0,0 +1,402 @@
++/**
++ * Character device driver for Broadcom Secondary Memory Interface
++ *
++ * Written by Luke Wren <luke@raspberrypi.org>
++ * Copyright (c) 2015, Raspberry Pi (Trading) Ltd.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions, and the following disclaimer,
++ * without modification.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The names of the above-listed copyright holders may not be used
++ * to endorse or promote products derived from this software without
++ * specific prior written permission.
++ *
++ * ALTERNATIVELY, this software may be distributed under the terms of the
++ * GNU General Public License ("GPL") version 2, as published by the Free
++ * Software Foundation.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/of.h>
++#include <linux/platform_device.h>
++#include <linux/slab.h>
++#include <linux/mm.h>
++#include <linux/pagemap.h>
++#include <linux/fs.h>
++#include <linux/cdev.h>
++#include <linux/fs.h>
++
++#include <linux/broadcom/bcm2835_smi.h>
++
++#define DEVICE_NAME "bcm2835-smi-dev"
++#define DRIVER_NAME "smi-dev-bcm2835"
++#define DEVICE_MINOR 0
++
++static struct cdev bcm2835_smi_cdev;
++static dev_t bcm2835_smi_devid;
++static struct class *bcm2835_smi_class;
++static struct device *bcm2835_smi_dev;
++
++struct bcm2835_smi_dev_instance {
++ struct device *dev;
++};
++
++static struct bcm2835_smi_instance *smi_inst;
++static struct bcm2835_smi_dev_instance *inst;
++
++static const char *const ioctl_names[] = {
++ "READ_SETTINGS",
++ "WRITE_SETTINGS",
++ "ADDRESS"
++};
++
++/****************************************************************************
++*
++* SMI chardev file ops
++*
++***************************************************************************/
++static long
++bcm2835_smi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
++{
++ long ret = 0;
++
++ dev_info(inst->dev, "serving ioctl...");
++
++ switch (cmd) {
++ case BCM2835_SMI_IOC_GET_SETTINGS:{
++ struct smi_settings *settings;
++
++ dev_info(inst->dev, "Reading SMI settings to user.");
++ settings = bcm2835_smi_get_settings_from_regs(smi_inst);
++ if (copy_to_user((void *)arg, settings,
++ sizeof(struct smi_settings)))
++ dev_err(inst->dev, "settings copy failed.");
++ break;
++ }
++ case BCM2835_SMI_IOC_WRITE_SETTINGS:{
++ struct smi_settings *settings;
++
++ dev_info(inst->dev, "Setting user's SMI settings.");
++ settings = bcm2835_smi_get_settings_from_regs(smi_inst);
++ if (copy_from_user(settings, (void *)arg,
++ sizeof(struct smi_settings)))
++ dev_err(inst->dev, "settings copy failed.");
++ else
++ bcm2835_smi_set_regs_from_settings(smi_inst);
++ break;
++ }
++ case BCM2835_SMI_IOC_ADDRESS:
++ dev_info(inst->dev, "SMI address set: 0x%02x", (int)arg);
++ bcm2835_smi_set_address(smi_inst, arg);
++ break;
++ default:
++ dev_err(inst->dev, "invalid ioctl cmd: %d", cmd);
++ ret = -ENOTTY;
++ break;
++ }
++
++ return ret;
++}
++
++static int bcm2835_smi_open(struct inode *inode, struct file *file)
++{
++ int dev = iminor(inode);
++
++ dev_dbg(inst->dev, "SMI device opened.");
++
++ if (dev != DEVICE_MINOR) {
++ dev_err(inst->dev,
++ "bcm2835_smi_release: Unknown minor device: %d",
++ dev);
++ return -ENXIO;
++ }
++
++ return 0;
++}
++
++static int bcm2835_smi_release(struct inode *inode, struct file *file)
++{
++ int dev = iminor(inode);
++
++ if (dev != DEVICE_MINOR) {
++ dev_err(inst->dev,
++ "bcm2835_smi_release: Unknown minor device %d", dev);
++ return -ENXIO;
++ }
++
++ return 0;
++}
++
++static ssize_t dma_bounce_user(
++ enum dma_transfer_direction dma_dir,
++ char __user *user_ptr,
++ size_t count,
++ struct bcm2835_smi_bounce_info *bounce)
++{
++ int chunk_size;
++ int chunk_no = 0;
++ int count_left = count;
++
++ while (count_left) {
++ int rv;
++ void *buf;
++
++ /* Wait for current chunk to complete: */
++ if (down_timeout(&bounce->callback_sem,
++ msecs_to_jiffies(1000))) {
++ dev_err(inst->dev, "DMA bounce timed out");
++ count -= (count_left);
++ break;
++ }
++
++ if (bounce->callback_sem.count >= DMA_BOUNCE_BUFFER_COUNT - 1)
++ dev_err(inst->dev, "WARNING: Ring buffer overflow");
++ chunk_size = count_left > DMA_BOUNCE_BUFFER_SIZE ?
++ DMA_BOUNCE_BUFFER_SIZE : count_left;
++ buf = bounce->buffer[chunk_no % DMA_BOUNCE_BUFFER_COUNT];
++ if (dma_dir == DMA_DEV_TO_MEM)
++ rv = copy_to_user(user_ptr, buf, chunk_size);
++ else
++ rv = copy_from_user(buf, user_ptr, chunk_size);
++ if (rv)
++ dev_err(inst->dev, "copy_*_user() failed!: %d", rv);
++ user_ptr += chunk_size;
++ count_left -= chunk_size;
++ chunk_no++;
++ }
++ return count;
++}
++
++static ssize_t
++bcm2835_read_file(struct file *f, char __user *user_ptr,
++ size_t count, loff_t *offs)
++{
++ int odd_bytes;
++
++ dev_dbg(inst->dev, "User reading %d bytes from SMI.", count);
++ /* We don't want to DMA a number of bytes % 4 != 0 (32 bit FIFO) */
++ if (count > DMA_THRESHOLD_BYTES)
++ odd_bytes = count & 0x3;
++ else
++ odd_bytes = count;
++ count -= odd_bytes;
++ if (count) {
++ struct bcm2835_smi_bounce_info *bounce;
++
++ count = bcm2835_smi_user_dma(smi_inst,
++ DMA_DEV_TO_MEM, user_ptr, count,
++ &bounce);
++ if (count)
++ count = dma_bounce_user(DMA_DEV_TO_MEM, user_ptr,
++ count, bounce);
++ }
++ if (odd_bytes) {
++ /* Read from FIFO directly if not using DMA */
++ uint8_t buf[DMA_THRESHOLD_BYTES];
++
++ bcm2835_smi_read_buf(smi_inst, buf, odd_bytes);
++ if (copy_to_user(user_ptr, buf, odd_bytes))
++ dev_err(inst->dev, "copy_to_user() failed.");
++ count += odd_bytes;
++
++ }
++ return count;
++}
++
++static ssize_t
++bcm2835_write_file(struct file *f, const char __user *user_ptr,
++ size_t count, loff_t *offs)
++{
++ int odd_bytes;
++
++ dev_dbg(inst->dev, "User writing %d bytes to SMI.", count);
++ if (count > DMA_THRESHOLD_BYTES)
++ odd_bytes = count & 0x3;
++ else
++ odd_bytes = count;
++ count -= odd_bytes;
++ if (count) {
++ struct bcm2835_smi_bounce_info *bounce;
++
++ count = bcm2835_smi_user_dma(smi_inst,
++ DMA_MEM_TO_DEV, (char __user *)user_ptr, count,
++ &bounce);
++ if (count)
++ count = dma_bounce_user(DMA_MEM_TO_DEV,
++ (char __user *)user_ptr,
++ count, bounce);
++ }
++ if (odd_bytes) {
++ uint8_t buf[DMA_THRESHOLD_BYTES];
++
++ if (copy_from_user(buf, user_ptr, odd_bytes))
++ dev_err(inst->dev, "copy_from_user() failed.");
++ else
++ bcm2835_smi_write_buf(smi_inst, buf, odd_bytes);
++ count += odd_bytes;
++ }
++ return count;
++}
++
++static const struct file_operations
++bcm2835_smi_fops = {
++ .owner = THIS_MODULE,
++ .unlocked_ioctl = bcm2835_smi_ioctl,
++ .open = bcm2835_smi_open,
++ .release = bcm2835_smi_release,
++ .read = bcm2835_read_file,
++ .write = bcm2835_write_file,
++};
++
++
++/****************************************************************************
++*
++* bcm2835_smi_probe - called when the driver is loaded.
++*
++***************************************************************************/
++
++static int bcm2835_smi_dev_probe(struct platform_device *pdev)
++{
++ int err;
++ void *ptr_err;
++ struct device *dev = &pdev->dev;
++ struct device_node *node = dev->of_node, *smi_node;
++
++ if (!node) {
++ dev_err(dev, "No device tree node supplied!");
++ return -EINVAL;
++ }
++
++ smi_node = of_parse_phandle(node, "smi_handle", 0);
++
++ if (!smi_node) {
++ dev_err(dev, "No such property: smi_handle");
++ return -ENXIO;
++ }
++
++ smi_inst = bcm2835_smi_get(smi_node);
++
++ if (!smi_inst)
++ return -EPROBE_DEFER;
++
++ /* Allocate buffers and instance data */
++
++ inst = devm_kzalloc(dev, sizeof(*inst), GFP_KERNEL);
++
++ if (!inst)
++ return -ENOMEM;
++
++ inst->dev = dev;
++
++ /* Create character device entries */
++
++ err = alloc_chrdev_region(&bcm2835_smi_devid,
++ DEVICE_MINOR, 1, DEVICE_NAME);
++ if (err != 0) {
++ dev_err(inst->dev, "unable to allocate device number");
++ return -ENOMEM;
++ }
++ cdev_init(&bcm2835_smi_cdev, &bcm2835_smi_fops);
++ bcm2835_smi_cdev.owner = THIS_MODULE;
++ err = cdev_add(&bcm2835_smi_cdev, bcm2835_smi_devid, 1);
++ if (err != 0) {
++ dev_err(inst->dev, "unable to register device");
++ err = -ENOMEM;
++ goto failed_cdev_add;
++ }
++
++ /* Create sysfs entries */
++
++ bcm2835_smi_class = class_create(THIS_MODULE, DEVICE_NAME);
++ ptr_err = bcm2835_smi_class;
++ if (IS_ERR(ptr_err))
++ goto failed_class_create;
++
++ bcm2835_smi_dev = device_create(bcm2835_smi_class, NULL,
++ bcm2835_smi_devid, NULL,
++ "smi");
++ ptr_err = bcm2835_smi_dev;
++ if (IS_ERR(ptr_err))
++ goto failed_device_create;
++
++ dev_info(inst->dev, "initialised");
++
++ return 0;
++
++failed_device_create:
++ class_destroy(bcm2835_smi_class);
++failed_class_create:
++ cdev_del(&bcm2835_smi_cdev);
++ err = PTR_ERR(ptr_err);
++failed_cdev_add:
++ unregister_chrdev_region(bcm2835_smi_devid, 1);
++ dev_err(dev, "could not load bcm2835_smi_dev");
++ return err;
++}
++
++/****************************************************************************
++*
++* bcm2835_smi_remove - called when the driver is unloaded.
++*
++***************************************************************************/
++
++static int bcm2835_smi_dev_remove(struct platform_device *pdev)
++{
++ device_destroy(bcm2835_smi_class, bcm2835_smi_devid);
++ class_destroy(bcm2835_smi_class);
++ cdev_del(&bcm2835_smi_cdev);
++ unregister_chrdev_region(bcm2835_smi_devid, 1);
++
++ dev_info(inst->dev, "SMI character dev removed - OK");
++ return 0;
++}
++
++/****************************************************************************
++*
++* Register the driver with device tree
++*
++***************************************************************************/
++
++static const struct of_device_id bcm2835_smi_dev_of_match[] = {
++ {.compatible = "brcm,bcm2835-smi-dev",},
++ { /* sentinel */ },
++};
++
++MODULE_DEVICE_TABLE(of, bcm2835_smi_dev_of_match);
++
++static struct platform_driver bcm2835_smi_dev_driver = {
++ .probe = bcm2835_smi_dev_probe,
++ .remove = bcm2835_smi_dev_remove,
++ .driver = {
++ .name = DRIVER_NAME,
++ .owner = THIS_MODULE,
++ .of_match_table = bcm2835_smi_dev_of_match,
++ },
++};
++
++module_platform_driver(bcm2835_smi_dev_driver);
++
++MODULE_ALIAS("platform:smi-dev-bcm2835");
++MODULE_LICENSE("GPL");
++MODULE_DESCRIPTION(
++ "Character device driver for BCM2835's secondary memory interface");
++MODULE_AUTHOR("Luke Wren <luke@raspberrypi.org>");
+diff -Nur linux-4.1.10/drivers/char/broadcom/Kconfig linux-rpi/drivers/char/broadcom/Kconfig
+--- linux-4.1.10/drivers/char/broadcom/Kconfig 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/char/broadcom/Kconfig 2015-10-07 16:40:34.000000000 +0200
+@@ -0,0 +1,57 @@
++#
++# Broadcom char driver config
++#
++
++menuconfig BRCM_CHAR_DRIVERS
++ bool "Broadcom Char Drivers"
++ help
++ Broadcom's char drivers
++
++if BRCM_CHAR_DRIVERS
++
++config BCM_VC_CMA
++ bool "Videocore CMA"
++ depends on CMA && BCM2708_VCHIQ
++ default n
++ help
++ Helper for videocore CMA access.
++
++config BCM2708_VCMEM
++ bool "Videocore Memory"
++ default y
++ help
++ Helper for videocore memory access and total size allocation.
++
++config BCM_VCIO
++ tristate "Mailbox userspace access"
++ depends on BCM2835_MBOX
++ help
++ Gives access to the mailbox property channel from userspace.
++
++endif
++
++config BCM_VC_SM
++ bool "VMCS Shared Memory"
++ depends on BCM2708_VCHIQ
++ select BCM2708_VCMEM
++ default n
++ help
++ Support for the VC shared memory on the Broadcom reference
++ design. Uses the VCHIQ stack.
++
++config BCM2835_DEVGPIOMEM
++ tristate "/dev/gpiomem rootless GPIO access via mmap() on the BCM2835"
++ default m
++ help
++ Provides users with root-free access to the GPIO registers
++ on the 2835. Calling mmap(/dev/gpiomem) will map the GPIO
++ register page to the user's pointer.
++
++config BCM2835_SMI_DEV
++ tristate "Character device driver for BCM2835 Secondary Memory Interface"
++ depends on (MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835) && BCM2835_SMI
++ default m
++ help
++ This driver provides a character device interface (ioctl + read/write) to
++ Broadcom's Secondary Memory interface. The low-level functionality is provided
++ by the SMI driver itself.
+diff -Nur linux-4.1.10/drivers/char/broadcom/Makefile linux-rpi/drivers/char/broadcom/Makefile
+--- linux-4.1.10/drivers/char/broadcom/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/char/broadcom/Makefile 2015-10-07 16:40:34.000000000 +0200
+@@ -0,0 +1,7 @@
++obj-$(CONFIG_BCM_VC_CMA) += vc_cma/
++obj-$(CONFIG_BCM2708_VCMEM) += vc_mem.o
++obj-$(CONFIG_BCM_VCIO) += vcio.o
++obj-$(CONFIG_BCM_VC_SM) += vc_sm/
++
++obj-$(CONFIG_BCM2835_DEVGPIOMEM)+= bcm2835-gpiomem.o
++obj-$(CONFIG_BCM2835_SMI_DEV) += bcm2835_smi_dev.o
+diff -Nur linux-4.1.10/drivers/char/broadcom/vc_cma/Makefile linux-rpi/drivers/char/broadcom/vc_cma/Makefile
+--- linux-4.1.10/drivers/char/broadcom/vc_cma/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/char/broadcom/vc_cma/Makefile 2015-10-07 16:40:34.000000000 +0200
@@ -0,0 +1,14 @@
+ccflags-y += -Wall -Wstrict-prototypes -Wno-trigraphs
+ccflags-y += -Werror
@@ -18500,9 +19415,9 @@ diff -Nur linux-4.1.6/drivers/char/broadcom/vc_cma/Makefile linux-rpi/drivers/ch
+obj-$(CONFIG_BCM_VC_CMA) += vc-cma.o
+
+vc-cma-objs := vc_cma.o
-diff -Nur linux-4.1.6/drivers/char/broadcom/vc_cma/vc_cma.c linux-rpi/drivers/char/broadcom/vc_cma/vc_cma.c
---- linux-4.1.6/drivers/char/broadcom/vc_cma/vc_cma.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/char/broadcom/vc_cma/vc_cma.c 2015-08-26 10:26:06.409283642 +0200
+diff -Nur linux-4.1.10/drivers/char/broadcom/vc_cma/vc_cma.c linux-rpi/drivers/char/broadcom/vc_cma/vc_cma.c
+--- linux-4.1.10/drivers/char/broadcom/vc_cma/vc_cma.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/char/broadcom/vc_cma/vc_cma.c 2015-10-07 16:40:34.000000000 +0200
@@ -0,0 +1,1193 @@
+/**
+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
@@ -19697,9 +20612,188 @@ diff -Nur linux-4.1.6/drivers/char/broadcom/vc_cma/vc_cma.c linux-rpi/drivers/ch
+module_exit(vc_cma_exit);
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Broadcom Corporation");
-diff -Nur linux-4.1.6/drivers/char/broadcom/vc_mem.c linux-rpi/drivers/char/broadcom/vc_mem.c
---- linux-4.1.6/drivers/char/broadcom/vc_mem.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/char/broadcom/vc_mem.c 2015-08-26 10:26:06.409283642 +0200
+diff -Nur linux-4.1.10/drivers/char/broadcom/vcio.c linux-rpi/drivers/char/broadcom/vcio.c
+--- linux-4.1.10/drivers/char/broadcom/vcio.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/char/broadcom/vcio.c 2015-10-07 16:40:34.000000000 +0200
+@@ -0,0 +1,175 @@
++/*
++ * Copyright (C) 2010 Broadcom
++ * Copyright (C) 2015 Noralf Trønnes
++ *
++ * 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.
++ *
++ */
++
++#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
++
++#include <linux/cdev.h>
++#include <linux/device.h>
++#include <linux/fs.h>
++#include <linux/init.h>
++#include <linux/ioctl.h>
++#include <linux/module.h>
++#include <linux/slab.h>
++#include <linux/uaccess.h>
++#include <soc/bcm2835/raspberrypi-firmware.h>
++
++#define MBOX_CHAN_PROPERTY 8
++
++#define VCIO_IOC_MAGIC 100
++#define IOCTL_MBOX_PROPERTY _IOWR(VCIO_IOC_MAGIC, 0, char *)
++
++static struct {
++ dev_t devt;
++ struct cdev cdev;
++ struct class *class;
++ struct rpi_firmware *fw;
++} vcio;
++
++static int vcio_user_property_list(void *user)
++{
++ u32 *buf, size;
++ int ret;
++
++ /* The first 32-bit is the size of the buffer */
++ if (copy_from_user(&size, user, sizeof(size)))
++ return -EFAULT;
++
++ buf = kmalloc(size, GFP_KERNEL);
++ if (!buf)
++ return -ENOMEM;
++
++ if (copy_from_user(buf, user, size)) {
++ kfree(buf);
++ return -EFAULT;
++ }
++
++ /* Strip off protocol encapsulation */
++ ret = rpi_firmware_property_list(vcio.fw, &buf[2], size - 12);
++ if (ret) {
++ kfree(buf);
++ return ret;
++ }
++
++ buf[1] = RPI_FIRMWARE_STATUS_SUCCESS;
++ if (copy_to_user(user, buf, size))
++ ret = -EFAULT;
++
++ kfree(buf);
++
++ return ret;
++}
++
++static int vcio_device_open(struct inode *inode, struct file *file)
++{
++ try_module_get(THIS_MODULE);
++
++ return 0;
++}
++
++static int vcio_device_release(struct inode *inode, struct file *file)
++{
++ module_put(THIS_MODULE);
++
++ return 0;
++}
++
++static long vcio_device_ioctl(struct file *file, unsigned int ioctl_num,
++ unsigned long ioctl_param)
++{
++ switch (ioctl_num) {
++ case IOCTL_MBOX_PROPERTY:
++ return vcio_user_property_list((void *)ioctl_param);
++ default:
++ pr_err("unknown ioctl: %d\n", ioctl_num);
++ return -EINVAL;
++ }
++}
++
++const struct file_operations vcio_fops = {
++ .unlocked_ioctl = vcio_device_ioctl,
++ .open = vcio_device_open,
++ .release = vcio_device_release,
++};
++
++static int __init vcio_init(void)
++{
++ struct device_node *np;
++ static struct device *dev;
++ int ret;
++
++ np = of_find_compatible_node(NULL, NULL,
++ "raspberrypi,bcm2835-firmware");
++/* Uncomment this when we only boot with Device Tree
++ if (!of_device_is_available(np))
++ return -ENODEV;
++*/
++ vcio.fw = rpi_firmware_get(np);
++ if (!vcio.fw)
++ return -ENODEV;
++
++ ret = alloc_chrdev_region(&vcio.devt, 0, 1, "vcio");
++ if (ret) {
++ pr_err("failed to allocate device number\n");
++ return ret;
++ }
++
++ cdev_init(&vcio.cdev, &vcio_fops);
++ vcio.cdev.owner = THIS_MODULE;
++ ret = cdev_add(&vcio.cdev, vcio.devt, 1);
++ if (ret) {
++ pr_err("failed to register device\n");
++ goto err_unregister_chardev;
++ }
++
++ /*
++ * Create sysfs entries
++ * 'bcm2708_vcio' is used for backwards compatibility so we don't break
++ * userspace. Raspian has a udev rule that changes the permissions.
++ */
++ vcio.class = class_create(THIS_MODULE, "bcm2708_vcio");
++ if (IS_ERR(vcio.class)) {
++ ret = PTR_ERR(vcio.class);
++ pr_err("failed to create class\n");
++ goto err_cdev_del;
++ }
++
++ dev = device_create(vcio.class, NULL, vcio.devt, NULL, "vcio");
++ if (IS_ERR(dev)) {
++ ret = PTR_ERR(dev);
++ pr_err("failed to create device\n");
++ goto err_class_destroy;
++ }
++
++ return 0;
++
++err_class_destroy:
++ class_destroy(vcio.class);
++err_cdev_del:
++ cdev_del(&vcio.cdev);
++err_unregister_chardev:
++ unregister_chrdev_region(vcio.devt, 1);
++
++ return ret;
++}
++module_init(vcio_init);
++
++static void __exit vcio_exit(void)
++{
++ device_destroy(vcio.class, vcio.devt);
++ class_destroy(vcio.class);
++ cdev_del(&vcio.cdev);
++ unregister_chrdev_region(vcio.devt, 1);
++}
++module_exit(vcio_exit);
++
++MODULE_AUTHOR("Gray Girling");
++MODULE_AUTHOR("Noralf Trønnes");
++MODULE_DESCRIPTION("Mailbox userspace access");
++MODULE_LICENSE("GPL");
+diff -Nur linux-4.1.10/drivers/char/broadcom/vc_mem.c linux-rpi/drivers/char/broadcom/vc_mem.c
+--- linux-4.1.10/drivers/char/broadcom/vc_mem.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/char/broadcom/vc_mem.c 2015-10-07 16:40:34.000000000 +0200
@@ -0,0 +1,422 @@
+/*****************************************************************************
+* Copyright 2010 - 2011 Broadcom Corporation. All rights reserved.
@@ -20123,9 +21217,9 @@ diff -Nur linux-4.1.6/drivers/char/broadcom/vc_mem.c linux-rpi/drivers/char/broa
+module_param(phys_addr, uint, 0644);
+module_param(mem_size, uint, 0644);
+module_param(mem_base, uint, 0644);
-diff -Nur linux-4.1.6/drivers/char/broadcom/vc_sm/Makefile linux-rpi/drivers/char/broadcom/vc_sm/Makefile
---- linux-4.1.6/drivers/char/broadcom/vc_sm/Makefile 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/char/broadcom/vc_sm/Makefile 2015-08-26 10:26:06.409283642 +0200
+diff -Nur linux-4.1.10/drivers/char/broadcom/vc_sm/Makefile linux-rpi/drivers/char/broadcom/vc_sm/Makefile
+--- linux-4.1.10/drivers/char/broadcom/vc_sm/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/char/broadcom/vc_sm/Makefile 2015-10-07 16:40:34.000000000 +0200
@@ -0,0 +1,21 @@
+EXTRA_CFLAGS += -Wall -Wstrict-prototypes -Wno-trigraphs -O2
+
@@ -20148,9 +21242,9 @@ diff -Nur linux-4.1.6/drivers/char/broadcom/vc_sm/Makefile linux-rpi/drivers/cha
+vc-sm-objs := \
+ vmcs_sm.o \
+ vc_vchi_sm.o
-diff -Nur linux-4.1.6/drivers/char/broadcom/vc_sm/vc_vchi_sm.c linux-rpi/drivers/char/broadcom/vc_sm/vc_vchi_sm.c
---- linux-4.1.6/drivers/char/broadcom/vc_sm/vc_vchi_sm.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/char/broadcom/vc_sm/vc_vchi_sm.c 2015-08-26 10:26:06.409283642 +0200
+diff -Nur linux-4.1.10/drivers/char/broadcom/vc_sm/vc_vchi_sm.c linux-rpi/drivers/char/broadcom/vc_sm/vc_vchi_sm.c
+--- linux-4.1.10/drivers/char/broadcom/vc_sm/vc_vchi_sm.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/char/broadcom/vc_sm/vc_vchi_sm.c 2015-10-07 16:40:34.000000000 +0200
@@ -0,0 +1,492 @@
+/*****************************************************************************
+* Copyright 2011-2012 Broadcom Corporation. All rights reserved.
@@ -20644,9 +21738,9 @@ diff -Nur linux-4.1.6/drivers/char/broadcom/vc_sm/vc_vchi_sm.c linux-rpi/drivers
+ return vc_vchi_sm_send_msg(handle, VC_SM_MSG_TYPE_ACTION_CLEAN,
+ msg, sizeof(*msg), 0, 0, 0, 0);
+}
-diff -Nur linux-4.1.6/drivers/char/broadcom/vc_sm/vmcs_sm.c linux-rpi/drivers/char/broadcom/vc_sm/vmcs_sm.c
---- linux-4.1.6/drivers/char/broadcom/vc_sm/vmcs_sm.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/char/broadcom/vc_sm/vmcs_sm.c 2015-08-26 10:26:06.409283642 +0200
+diff -Nur linux-4.1.10/drivers/char/broadcom/vc_sm/vmcs_sm.c linux-rpi/drivers/char/broadcom/vc_sm/vmcs_sm.c
+--- linux-4.1.10/drivers/char/broadcom/vc_sm/vmcs_sm.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/char/broadcom/vc_sm/vmcs_sm.c 2015-10-07 16:40:34.000000000 +0200
@@ -0,0 +1,3211 @@
+/*****************************************************************************
+* Copyright 2011-2012 Broadcom Corporation. All rights reserved.
@@ -22018,8 +23112,8 @@ diff -Nur linux-4.1.6/drivers/char/broadcom/vc_sm/vmcs_sm.c linux-rpi/drivers/ch
+ return 0;
+
+error:
-+ vmcs_sm_release_resource(resource, 0);
+ resource->res_stats[MAP_FAIL]++;
++ vmcs_sm_release_resource(resource, 0);
+ return ret;
+}
+
@@ -23859,229 +24953,9 @@ diff -Nur linux-4.1.6/drivers/char/broadcom/vc_sm/vmcs_sm.c linux-rpi/drivers/ch
+MODULE_AUTHOR("Broadcom");
+MODULE_DESCRIPTION("VideoCore SharedMemory Driver");
+MODULE_LICENSE("GPL v2");
-diff -Nur linux-4.1.6/drivers/char/broadcom/vcio.c linux-rpi/drivers/char/broadcom/vcio.c
---- linux-4.1.6/drivers/char/broadcom/vcio.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/char/broadcom/vcio.c 2015-08-26 10:26:06.409283642 +0200
-@@ -0,0 +1,175 @@
-+/*
-+ * Copyright (C) 2010 Broadcom
-+ * Copyright (C) 2015 Noralf Trønnes
-+ *
-+ * 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.
-+ *
-+ */
-+
-+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-+
-+#include <linux/cdev.h>
-+#include <linux/device.h>
-+#include <linux/fs.h>
-+#include <linux/init.h>
-+#include <linux/ioctl.h>
-+#include <linux/module.h>
-+#include <linux/slab.h>
-+#include <linux/uaccess.h>
-+#include <soc/bcm2835/raspberrypi-firmware.h>
-+
-+#define MBOX_CHAN_PROPERTY 8
-+
-+#define VCIO_IOC_MAGIC 100
-+#define IOCTL_MBOX_PROPERTY _IOWR(VCIO_IOC_MAGIC, 0, char *)
-+
-+static struct {
-+ dev_t devt;
-+ struct cdev cdev;
-+ struct class *class;
-+ struct rpi_firmware *fw;
-+} vcio;
-+
-+static int vcio_user_property_list(void *user)
-+{
-+ u32 *buf, size;
-+ int ret;
-+
-+ /* The first 32-bit is the size of the buffer */
-+ if (copy_from_user(&size, user, sizeof(size)))
-+ return -EFAULT;
-+
-+ buf = kmalloc(size, GFP_KERNEL);
-+ if (!buf)
-+ return -ENOMEM;
-+
-+ if (copy_from_user(buf, user, size)) {
-+ kfree(buf);
-+ return -EFAULT;
-+ }
-+
-+ /* Strip off protocol encapsulation */
-+ ret = rpi_firmware_property_list(vcio.fw, &buf[2], size - 12);
-+ if (ret) {
-+ kfree(buf);
-+ return ret;
-+ }
-+
-+ buf[1] = RPI_FIRMWARE_STATUS_SUCCESS;
-+ if (copy_to_user(user, buf, size))
-+ ret = -EFAULT;
-+
-+ kfree(buf);
-+
-+ return ret;
-+}
-+
-+static int vcio_device_open(struct inode *inode, struct file *file)
-+{
-+ try_module_get(THIS_MODULE);
-+
-+ return 0;
-+}
-+
-+static int vcio_device_release(struct inode *inode, struct file *file)
-+{
-+ module_put(THIS_MODULE);
-+
-+ return 0;
-+}
-+
-+static long vcio_device_ioctl(struct file *file, unsigned int ioctl_num,
-+ unsigned long ioctl_param)
-+{
-+ switch (ioctl_num) {
-+ case IOCTL_MBOX_PROPERTY:
-+ return vcio_user_property_list((void *)ioctl_param);
-+ default:
-+ pr_err("unknown ioctl: %d\n", ioctl_num);
-+ return -EINVAL;
-+ }
-+}
-+
-+const struct file_operations vcio_fops = {
-+ .unlocked_ioctl = vcio_device_ioctl,
-+ .open = vcio_device_open,
-+ .release = vcio_device_release,
-+};
-+
-+static int __init vcio_init(void)
-+{
-+ struct device_node *np;
-+ static struct device *dev;
-+ int ret;
-+
-+ np = of_find_compatible_node(NULL, NULL,
-+ "raspberrypi,bcm2835-firmware");
-+/* Uncomment this when we only boot with Device Tree
-+ if (!of_device_is_available(np))
-+ return -ENODEV;
-+*/
-+ vcio.fw = rpi_firmware_get(np);
-+ if (!vcio.fw)
-+ return -ENODEV;
-+
-+ ret = alloc_chrdev_region(&vcio.devt, 0, 1, "vcio");
-+ if (ret) {
-+ pr_err("failed to allocate device number\n");
-+ return ret;
-+ }
-+
-+ cdev_init(&vcio.cdev, &vcio_fops);
-+ vcio.cdev.owner = THIS_MODULE;
-+ ret = cdev_add(&vcio.cdev, vcio.devt, 1);
-+ if (ret) {
-+ pr_err("failed to register device\n");
-+ goto err_unregister_chardev;
-+ }
-+
-+ /*
-+ * Create sysfs entries
-+ * 'bcm2708_vcio' is used for backwards compatibility so we don't break
-+ * userspace. Raspian has a udev rule that changes the permissions.
-+ */
-+ vcio.class = class_create(THIS_MODULE, "bcm2708_vcio");
-+ if (IS_ERR(vcio.class)) {
-+ ret = PTR_ERR(vcio.class);
-+ pr_err("failed to create class\n");
-+ goto err_cdev_del;
-+ }
-+
-+ dev = device_create(vcio.class, NULL, vcio.devt, NULL, "vcio");
-+ if (IS_ERR(dev)) {
-+ ret = PTR_ERR(dev);
-+ pr_err("failed to create device\n");
-+ goto err_class_destroy;
-+ }
-+
-+ return 0;
-+
-+err_class_destroy:
-+ class_destroy(vcio.class);
-+err_cdev_del:
-+ cdev_del(&vcio.cdev);
-+err_unregister_chardev:
-+ unregister_chrdev_region(vcio.devt, 1);
-+
-+ return ret;
-+}
-+module_init(vcio_init);
-+
-+static void __exit vcio_exit(void)
-+{
-+ device_destroy(vcio.class, vcio.devt);
-+ class_destroy(vcio.class);
-+ cdev_del(&vcio.cdev);
-+ unregister_chrdev_region(vcio.devt, 1);
-+}
-+module_exit(vcio_exit);
-+
-+MODULE_AUTHOR("Gray Girling");
-+MODULE_AUTHOR("Noralf Trønnes");
-+MODULE_DESCRIPTION("Mailbox userspace access");
-+MODULE_LICENSE("GPL");
-diff -Nur linux-4.1.6/drivers/char/hw_random/Kconfig linux-rpi/drivers/char/hw_random/Kconfig
---- linux-4.1.6/drivers/char/hw_random/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/char/hw_random/Kconfig 2015-08-26 10:26:06.409283642 +0200
-@@ -90,7 +90,7 @@
-
- config HW_RANDOM_BCM2835
- tristate "Broadcom BCM2835 Random Number Generator support"
-- depends on ARCH_BCM2835
-+ depends on ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709
- default HW_RANDOM
- ---help---
- This driver provides kernel-side support for the Random Number
-@@ -333,6 +333,17 @@
-
- If unsure, say Y.
-
-+config HW_RANDOM_BCM2708
-+ tristate "BCM2708 generic true random number generator support"
-+ depends on HW_RANDOM && (ARCH_BCM2708 || ARCH_BCM2709)
-+ ---help---
-+ This driver provides the kernel-side support for the BCM2708 hardware.
-+
-+ To compile this driver as a module, choose M here: the
-+ module will be called bcm2708-rng.
-+
-+ If unsure, say N.
-+
- config HW_RANDOM_MSM
- tristate "Qualcomm SoCs Random Number Generator support"
- depends on HW_RANDOM && ARCH_QCOM
-diff -Nur linux-4.1.6/drivers/char/hw_random/Makefile linux-rpi/drivers/char/hw_random/Makefile
---- linux-4.1.6/drivers/char/hw_random/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/char/hw_random/Makefile 2015-08-26 10:26:06.409283642 +0200
-@@ -4,6 +4,7 @@
-
- obj-$(CONFIG_HW_RANDOM) += rng-core.o
- rng-core-y := core.o
-+obj-$(CONFIG_HW_RANDOM_BCM2708) += bcm2708-rng.o
- obj-$(CONFIG_HW_RANDOM_TIMERIOMEM) += timeriomem-rng.o
- obj-$(CONFIG_HW_RANDOM_INTEL) += intel-rng.o
- obj-$(CONFIG_HW_RANDOM_AMD) += amd-rng.o
-diff -Nur linux-4.1.6/drivers/char/hw_random/bcm2708-rng.c linux-rpi/drivers/char/hw_random/bcm2708-rng.c
---- linux-4.1.6/drivers/char/hw_random/bcm2708-rng.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/char/hw_random/bcm2708-rng.c 2015-08-26 10:26:06.409283642 +0200
+diff -Nur linux-4.1.10/drivers/char/hw_random/bcm2708-rng.c linux-rpi/drivers/char/hw_random/bcm2708-rng.c
+--- linux-4.1.10/drivers/char/hw_random/bcm2708-rng.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/char/hw_random/bcm2708-rng.c 2015-10-07 16:40:34.000000000 +0200
@@ -0,0 +1,118 @@
+/**
+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
@@ -24201,9 +25075,245 @@ diff -Nur linux-4.1.6/drivers/char/hw_random/bcm2708-rng.c linux-rpi/drivers/cha
+
+MODULE_DESCRIPTION("BCM2708 H/W Random Number Generator (RNG) driver");
+MODULE_LICENSE("GPL and additional rights");
-diff -Nur linux-4.1.6/drivers/clocksource/arm_arch_timer.c linux-rpi/drivers/clocksource/arm_arch_timer.c
---- linux-4.1.6/drivers/clocksource/arm_arch_timer.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/clocksource/arm_arch_timer.c 2015-08-26 10:26:06.441284089 +0200
+diff -Nur linux-4.1.10/drivers/char/hw_random/Kconfig linux-rpi/drivers/char/hw_random/Kconfig
+--- linux-4.1.10/drivers/char/hw_random/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/char/hw_random/Kconfig 2015-10-07 16:40:34.000000000 +0200
+@@ -90,7 +90,7 @@
+
+ config HW_RANDOM_BCM2835
+ tristate "Broadcom BCM2835 Random Number Generator support"
+- depends on ARCH_BCM2835
++ depends on ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709
+ default HW_RANDOM
+ ---help---
+ This driver provides kernel-side support for the Random Number
+@@ -333,6 +333,17 @@
+
+ If unsure, say Y.
+
++config HW_RANDOM_BCM2708
++ tristate "BCM2708 generic true random number generator support"
++ depends on HW_RANDOM && (ARCH_BCM2708 || ARCH_BCM2709)
++ ---help---
++ This driver provides the kernel-side support for the BCM2708 hardware.
++
++ To compile this driver as a module, choose M here: the
++ module will be called bcm2708-rng.
++
++ If unsure, say N.
++
+ config HW_RANDOM_MSM
+ tristate "Qualcomm SoCs Random Number Generator support"
+ depends on HW_RANDOM && ARCH_QCOM
+diff -Nur linux-4.1.10/drivers/char/hw_random/Makefile linux-rpi/drivers/char/hw_random/Makefile
+--- linux-4.1.10/drivers/char/hw_random/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/char/hw_random/Makefile 2015-10-07 16:40:34.000000000 +0200
+@@ -4,6 +4,7 @@
+
+ obj-$(CONFIG_HW_RANDOM) += rng-core.o
+ rng-core-y := core.o
++obj-$(CONFIG_HW_RANDOM_BCM2708) += bcm2708-rng.o
+ obj-$(CONFIG_HW_RANDOM_TIMERIOMEM) += timeriomem-rng.o
+ obj-$(CONFIG_HW_RANDOM_INTEL) += intel-rng.o
+ obj-$(CONFIG_HW_RANDOM_AMD) += amd-rng.o
+diff -Nur linux-4.1.10/drivers/char/Kconfig linux-rpi/drivers/char/Kconfig
+--- linux-4.1.10/drivers/char/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/char/Kconfig 2015-10-07 16:40:34.000000000 +0200
+@@ -590,6 +590,8 @@
+
+ source "drivers/s390/char/Kconfig"
+
++source "drivers/char/broadcom/Kconfig"
++
+ config MSM_SMD_PKT
+ bool "Enable device interface for some SMD packet ports"
+ default n
+diff -Nur linux-4.1.10/drivers/char/Makefile linux-rpi/drivers/char/Makefile
+--- linux-4.1.10/drivers/char/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/char/Makefile 2015-10-07 16:40:34.000000000 +0200
+@@ -62,3 +62,4 @@
+
+ obj-$(CONFIG_TILE_SROM) += tile-srom.o
+ obj-$(CONFIG_XILLYBUS) += xillybus/
++obj-$(CONFIG_BRCM_CHAR_DRIVERS) += broadcom/
+diff -Nur linux-4.1.10/drivers/clk/clk-hifiberry-dacpro.c linux-rpi/drivers/clk/clk-hifiberry-dacpro.c
+--- linux-4.1.10/drivers/clk/clk-hifiberry-dacpro.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/clk/clk-hifiberry-dacpro.c 2015-10-07 16:40:34.000000000 +0200
+@@ -0,0 +1,160 @@
++/*
++ * Clock Driver for HiFiBerry DAC Pro
++ *
++ * Author: Stuart MacLean
++ * Copyright 2015
++ *
++ * 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.
++ *
++ * 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.
++ */
++
++#include <linux/clk-provider.h>
++#include <linux/clkdev.h>
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/of.h>
++#include <linux/slab.h>
++#include <linux/platform_device.h>
++
++/* Clock rate of CLK44EN attached to GPIO6 pin */
++#define CLK_44EN_RATE 22579200UL
++/* Clock rate of CLK48EN attached to GPIO3 pin */
++#define CLK_48EN_RATE 24576000UL
++
++/**
++ * struct hifiberry_dacpro_clk - Common struct to the HiFiBerry DAC Pro
++ * @hw: clk_hw for the common clk framework
++ * @mode: 0 => CLK44EN, 1 => CLK48EN
++ */
++struct clk_hifiberry_hw {
++ struct clk_hw hw;
++ uint8_t mode;
++};
++
++#define to_hifiberry_clk(_hw) container_of(_hw, struct clk_hifiberry_hw, hw)
++
++static const struct of_device_id clk_hifiberry_dacpro_dt_ids[] = {
++ { .compatible = "hifiberry,dacpro-clk",},
++ { }
++};
++MODULE_DEVICE_TABLE(of, clk_hifiberry_dacpro_dt_ids);
++
++static unsigned long clk_hifiberry_dacpro_recalc_rate(struct clk_hw *hw,
++ unsigned long parent_rate)
++{
++ return (to_hifiberry_clk(hw)->mode == 0) ? CLK_44EN_RATE :
++ CLK_48EN_RATE;
++}
++
++static long clk_hifiberry_dacpro_round_rate(struct clk_hw *hw,
++ unsigned long rate, unsigned long *parent_rate)
++{
++ long actual_rate;
++
++ if (rate <= CLK_44EN_RATE) {
++ actual_rate = (long)CLK_44EN_RATE;
++ } else if (rate >= CLK_48EN_RATE) {
++ actual_rate = (long)CLK_48EN_RATE;
++ } else {
++ long diff44Rate = (long)(rate - CLK_44EN_RATE);
++ long diff48Rate = (long)(CLK_48EN_RATE - rate);
++
++ if (diff44Rate < diff48Rate)
++ actual_rate = (long)CLK_44EN_RATE;
++ else
++ actual_rate = (long)CLK_48EN_RATE;
++ }
++ return actual_rate;
++}
++
++
++static int clk_hifiberry_dacpro_set_rate(struct clk_hw *hw,
++ unsigned long rate, unsigned long parent_rate)
++{
++ unsigned long actual_rate;
++ struct clk_hifiberry_hw *clk = to_hifiberry_clk(hw);
++
++ actual_rate = (unsigned long)clk_hifiberry_dacpro_round_rate(hw, rate,
++ &parent_rate);
++ clk->mode = (actual_rate == CLK_44EN_RATE) ? 0 : 1;
++ return 0;
++}
++
++
++const struct clk_ops clk_hifiberry_dacpro_rate_ops = {
++ .recalc_rate = clk_hifiberry_dacpro_recalc_rate,
++ .round_rate = clk_hifiberry_dacpro_round_rate,
++ .set_rate = clk_hifiberry_dacpro_set_rate,
++};
++
++static int clk_hifiberry_dacpro_probe(struct platform_device *pdev)
++{
++ int ret;
++ struct clk_hifiberry_hw *proclk;
++ struct clk *clk;
++ struct device *dev;
++ struct clk_init_data init;
++
++ dev = &pdev->dev;
++
++ proclk = kzalloc(sizeof(struct clk_hifiberry_hw), GFP_KERNEL);
++ if (!proclk)
++ return -ENOMEM;
++
++ init.name = "clk-hifiberry-dacpro";
++ init.ops = &clk_hifiberry_dacpro_rate_ops;
++ init.flags = CLK_IS_ROOT | CLK_IS_BASIC;
++ init.parent_names = NULL;
++ init.num_parents = 0;
++
++ proclk->mode = 0;
++ proclk->hw.init = &init;
++
++ clk = devm_clk_register(dev, &proclk->hw);
++ if (!IS_ERR(clk)) {
++ ret = of_clk_add_provider(dev->of_node, of_clk_src_simple_get,
++ clk);
++ } else {
++ dev_err(dev, "Fail to register clock driver\n");
++ kfree(proclk);
++ ret = PTR_ERR(clk);
++ }
++ return ret;
++}
++
++static int clk_hifiberry_dacpro_remove(struct platform_device *pdev)
++{
++ of_clk_del_provider(pdev->dev.of_node);
++ return 0;
++}
++
++static struct platform_driver clk_hifiberry_dacpro_driver = {
++ .probe = clk_hifiberry_dacpro_probe,
++ .remove = clk_hifiberry_dacpro_remove,
++ .driver = {
++ .name = "clk-hifiberry-dacpro",
++ .of_match_table = clk_hifiberry_dacpro_dt_ids,
++ },
++};
++
++static int __init clk_hifiberry_dacpro_init(void)
++{
++ return platform_driver_register(&clk_hifiberry_dacpro_driver);
++}
++core_initcall(clk_hifiberry_dacpro_init);
++
++static void __exit clk_hifiberry_dacpro_exit(void)
++{
++ platform_driver_unregister(&clk_hifiberry_dacpro_driver);
++}
++module_exit(clk_hifiberry_dacpro_exit);
++
++MODULE_DESCRIPTION("HiFiBerry DAC Pro clock driver");
++MODULE_LICENSE("GPL v2");
++MODULE_ALIAS("platform:clk-hifiberry-dacpro");
+diff -Nur linux-4.1.10/drivers/clk/Makefile linux-rpi/drivers/clk/Makefile
+--- linux-4.1.10/drivers/clk/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/clk/Makefile 2015-10-07 16:40:34.000000000 +0200
+@@ -24,6 +24,7 @@
+ obj-$(CONFIG_ARCH_CLPS711X) += clk-clps711x.o
+ obj-$(CONFIG_ARCH_EFM32) += clk-efm32gg.o
+ obj-$(CONFIG_ARCH_HIGHBANK) += clk-highbank.o
++obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS) += clk-hifiberry-dacpro.o
+ obj-$(CONFIG_MACH_LOONGSON1) += clk-ls1x.o
+ obj-$(CONFIG_COMMON_CLK_MAX_GEN) += clk-max-gen.o
+ obj-$(CONFIG_COMMON_CLK_MAX77686) += clk-max77686.o
+diff -Nur linux-4.1.10/drivers/clocksource/arm_arch_timer.c linux-rpi/drivers/clocksource/arm_arch_timer.c
+--- linux-4.1.10/drivers/clocksource/arm_arch_timer.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/clocksource/arm_arch_timer.c 2015-10-07 16:40:34.000000000 +0200
@@ -882,3 +882,39 @@
acpi_table_parse(ACPI_SIG_GTDT, arch_timer_acpi_init);
}
@@ -24244,39 +25354,9 @@ diff -Nur linux-4.1.6/drivers/clocksource/arm_arch_timer.c linux-rpi/drivers/clo
+ arch_timer_common_init();
+ return 0;
+}
-diff -Nur linux-4.1.6/drivers/cpufreq/Kconfig.arm linux-rpi/drivers/cpufreq/Kconfig.arm
---- linux-4.1.6/drivers/cpufreq/Kconfig.arm 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/cpufreq/Kconfig.arm 2015-08-26 10:26:06.445284146 +0200
-@@ -258,6 +258,15 @@
- help
- This adds the CPUFreq driver support for SPEAr SOCs.
-
-+config ARM_BCM2835_CPUFREQ
-+ depends on RASPBERRYPI_FIRMWARE
-+ bool "BCM2835 Driver"
-+ default y
-+ help
-+ This adds the CPUFreq driver for BCM2835
-+
-+ If in doubt, say N.
-+
- config ARM_TEGRA_CPUFREQ
- bool "TEGRA CPUFreq support"
- depends on ARCH_TEGRA
-diff -Nur linux-4.1.6/drivers/cpufreq/Makefile linux-rpi/drivers/cpufreq/Makefile
---- linux-4.1.6/drivers/cpufreq/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/cpufreq/Makefile 2015-08-26 10:26:06.445284146 +0200
-@@ -77,6 +77,7 @@
- obj-$(CONFIG_ARM_SA1100_CPUFREQ) += sa1100-cpufreq.o
- obj-$(CONFIG_ARM_SA1110_CPUFREQ) += sa1110-cpufreq.o
- obj-$(CONFIG_ARM_SPEAR_CPUFREQ) += spear-cpufreq.o
-+obj-$(CONFIG_ARM_BCM2835_CPUFREQ) += bcm2835-cpufreq.o
- obj-$(CONFIG_ARM_TEGRA_CPUFREQ) += tegra-cpufreq.o
- obj-$(CONFIG_ARM_VEXPRESS_SPC_CPUFREQ) += vexpress-spc-cpufreq.o
-
-diff -Nur linux-4.1.6/drivers/cpufreq/bcm2835-cpufreq.c linux-rpi/drivers/cpufreq/bcm2835-cpufreq.c
---- linux-4.1.6/drivers/cpufreq/bcm2835-cpufreq.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/cpufreq/bcm2835-cpufreq.c 2015-08-26 10:26:06.445284146 +0200
+diff -Nur linux-4.1.10/drivers/cpufreq/bcm2835-cpufreq.c linux-rpi/drivers/cpufreq/bcm2835-cpufreq.c
+--- linux-4.1.10/drivers/cpufreq/bcm2835-cpufreq.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/cpufreq/bcm2835-cpufreq.c 2015-10-07 16:40:34.000000000 +0200
@@ -0,0 +1,213 @@
+/*****************************************************************************
+* Copyright 2011 Broadcom Corporation. All rights reserved.
@@ -24491,50 +25571,39 @@ diff -Nur linux-4.1.6/drivers/cpufreq/bcm2835-cpufreq.c linux-rpi/drivers/cpufre
+
+module_init(bcm2835_cpufreq_module_init);
+module_exit(bcm2835_cpufreq_module_exit);
-diff -Nur linux-4.1.6/drivers/dma/Kconfig linux-rpi/drivers/dma/Kconfig
---- linux-4.1.6/drivers/dma/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/dma/Kconfig 2015-08-26 10:26:06.469284482 +0200
-@@ -337,6 +337,17 @@
- select DMA_ENGINE
- select DMA_VIRTUAL_CHANNELS
+diff -Nur linux-4.1.10/drivers/cpufreq/Kconfig.arm linux-rpi/drivers/cpufreq/Kconfig.arm
+--- linux-4.1.10/drivers/cpufreq/Kconfig.arm 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/cpufreq/Kconfig.arm 2015-10-07 16:40:34.000000000 +0200
+@@ -258,6 +258,15 @@
+ help
+ This adds the CPUFreq driver support for SPEAr SOCs.
-+config DMA_BCM2708
-+ tristate "BCM2708 DMA engine support"
-+ depends on MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835
-+ select DMA_ENGINE
-+ select DMA_VIRTUAL_CHANNELS
-+
-+config DMA_BCM2708_LEGACY
-+ bool "BCM2708 DMA legacy API support"
-+ depends on DMA_BCM2708
++config ARM_BCM2835_CPUFREQ
++ depends on RASPBERRYPI_FIRMWARE
++ bool "BCM2835 Driver"
+ default y
++ help
++ This adds the CPUFreq driver for BCM2835
+
- config TI_CPPI41
- tristate "AM33xx CPPI41 DMA support"
- depends on ARCH_OMAP
-@@ -385,7 +396,7 @@
- select DMA_VIRTUAL_CHANNELS
- help
- Enable support for the MOXA ART SoC DMA controller.
--
++ If in doubt, say N.
+
- config FSL_EDMA
- tristate "Freescale eDMA engine support"
- depends on OF
-diff -Nur linux-4.1.6/drivers/dma/Makefile linux-rpi/drivers/dma/Makefile
---- linux-4.1.6/drivers/dma/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/dma/Makefile 2015-08-26 10:26:06.469284482 +0200
-@@ -39,6 +39,7 @@
- obj-$(CONFIG_MMP_TDMA) += mmp_tdma.o
- obj-$(CONFIG_DMA_OMAP) += omap-dma.o
- obj-$(CONFIG_DMA_BCM2835) += bcm2835-dma.o
-+obj-$(CONFIG_DMA_BCM2708) += bcm2708-dmaengine.o
- obj-$(CONFIG_MMP_PDMA) += mmp_pdma.o
- obj-$(CONFIG_DMA_JZ4740) += dma-jz4740.o
- obj-$(CONFIG_DMA_JZ4780) += dma-jz4780.o
-diff -Nur linux-4.1.6/drivers/dma/bcm2708-dmaengine.c linux-rpi/drivers/dma/bcm2708-dmaengine.c
---- linux-4.1.6/drivers/dma/bcm2708-dmaengine.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/dma/bcm2708-dmaengine.c 2015-08-26 10:26:06.473284538 +0200
+ config ARM_TEGRA_CPUFREQ
+ bool "TEGRA CPUFreq support"
+ depends on ARCH_TEGRA
+diff -Nur linux-4.1.10/drivers/cpufreq/Makefile linux-rpi/drivers/cpufreq/Makefile
+--- linux-4.1.10/drivers/cpufreq/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/cpufreq/Makefile 2015-10-07 16:40:34.000000000 +0200
+@@ -77,6 +77,7 @@
+ obj-$(CONFIG_ARM_SA1100_CPUFREQ) += sa1100-cpufreq.o
+ obj-$(CONFIG_ARM_SA1110_CPUFREQ) += sa1110-cpufreq.o
+ obj-$(CONFIG_ARM_SPEAR_CPUFREQ) += spear-cpufreq.o
++obj-$(CONFIG_ARM_BCM2835_CPUFREQ) += bcm2835-cpufreq.o
+ obj-$(CONFIG_ARM_TEGRA_CPUFREQ) += tegra-cpufreq.o
+ obj-$(CONFIG_ARM_VEXPRESS_SPC_CPUFREQ) += vexpress-spc-cpufreq.o
+
+diff -Nur linux-4.1.10/drivers/dma/bcm2708-dmaengine.c linux-rpi/drivers/dma/bcm2708-dmaengine.c
+--- linux-4.1.10/drivers/dma/bcm2708-dmaengine.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/dma/bcm2708-dmaengine.c 2015-10-07 16:40:34.000000000 +0200
@@ -0,0 +1,1314 @@
+/*
+ * BCM2835 DMA engine support
@@ -25850,9 +26919,50 @@ diff -Nur linux-4.1.6/drivers/dma/bcm2708-dmaengine.c linux-rpi/drivers/dma/bcm2
+MODULE_AUTHOR("Florian Meier <florian.meier@koalo.de>");
+MODULE_AUTHOR("Gellert Weisz <gellert@raspberrypi.org>");
+MODULE_LICENSE("GPL v2");
-diff -Nur linux-4.1.6/drivers/firmware/Kconfig linux-rpi/drivers/firmware/Kconfig
---- linux-4.1.6/drivers/firmware/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/firmware/Kconfig 2015-08-26 10:26:06.493284818 +0200
+diff -Nur linux-4.1.10/drivers/dma/Kconfig linux-rpi/drivers/dma/Kconfig
+--- linux-4.1.10/drivers/dma/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/dma/Kconfig 2015-10-07 16:40:34.000000000 +0200
+@@ -337,6 +337,17 @@
+ select DMA_ENGINE
+ select DMA_VIRTUAL_CHANNELS
+
++config DMA_BCM2708
++ tristate "BCM2708 DMA engine support"
++ depends on MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835
++ select DMA_ENGINE
++ select DMA_VIRTUAL_CHANNELS
++
++config DMA_BCM2708_LEGACY
++ bool "BCM2708 DMA legacy API support"
++ depends on DMA_BCM2708
++ default y
++
+ config TI_CPPI41
+ tristate "AM33xx CPPI41 DMA support"
+ depends on ARCH_OMAP
+@@ -385,7 +396,7 @@
+ select DMA_VIRTUAL_CHANNELS
+ help
+ Enable support for the MOXA ART SoC DMA controller.
+-
++
+ config FSL_EDMA
+ tristate "Freescale eDMA engine support"
+ depends on OF
+diff -Nur linux-4.1.10/drivers/dma/Makefile linux-rpi/drivers/dma/Makefile
+--- linux-4.1.10/drivers/dma/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/dma/Makefile 2015-10-07 16:40:34.000000000 +0200
+@@ -39,6 +39,7 @@
+ obj-$(CONFIG_MMP_TDMA) += mmp_tdma.o
+ obj-$(CONFIG_DMA_OMAP) += omap-dma.o
+ obj-$(CONFIG_DMA_BCM2835) += bcm2835-dma.o
++obj-$(CONFIG_DMA_BCM2708) += bcm2708-dmaengine.o
+ obj-$(CONFIG_MMP_PDMA) += mmp_pdma.o
+ obj-$(CONFIG_DMA_JZ4740) += dma-jz4740.o
+ obj-$(CONFIG_DMA_JZ4780) += dma-jz4780.o
+diff -Nur linux-4.1.10/drivers/firmware/Kconfig linux-rpi/drivers/firmware/Kconfig
+--- linux-4.1.10/drivers/firmware/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/firmware/Kconfig 2015-10-07 16:40:34.000000000 +0200
@@ -136,6 +136,13 @@
bool
depends on ARM || ARM64
@@ -25867,9 +26977,9 @@ diff -Nur linux-4.1.6/drivers/firmware/Kconfig linux-rpi/drivers/firmware/Kconfi
source "drivers/firmware/google/Kconfig"
source "drivers/firmware/efi/Kconfig"
-diff -Nur linux-4.1.6/drivers/firmware/Makefile linux-rpi/drivers/firmware/Makefile
---- linux-4.1.6/drivers/firmware/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/firmware/Makefile 2015-08-26 10:26:06.493284818 +0200
+diff -Nur linux-4.1.10/drivers/firmware/Makefile linux-rpi/drivers/firmware/Makefile
+--- linux-4.1.10/drivers/firmware/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/firmware/Makefile 2015-10-07 16:40:34.000000000 +0200
@@ -13,6 +13,7 @@
obj-$(CONFIG_FIRMWARE_MEMMAP) += memmap.o
obj-$(CONFIG_QCOM_SCM) += qcom_scm.o
@@ -25878,9 +26988,9 @@ diff -Nur linux-4.1.6/drivers/firmware/Makefile linux-rpi/drivers/firmware/Makef
obj-$(CONFIG_GOOGLE_FIRMWARE) += google/
obj-$(CONFIG_EFI) += efi/
-diff -Nur linux-4.1.6/drivers/firmware/raspberrypi.c linux-rpi/drivers/firmware/raspberrypi.c
---- linux-4.1.6/drivers/firmware/raspberrypi.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/firmware/raspberrypi.c 2015-08-26 10:26:06.497284874 +0200
+diff -Nur linux-4.1.10/drivers/firmware/raspberrypi.c linux-rpi/drivers/firmware/raspberrypi.c
+--- linux-4.1.10/drivers/firmware/raspberrypi.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/firmware/raspberrypi.c 2015-10-07 16:40:34.000000000 +0200
@@ -0,0 +1,297 @@
+/*
+ * Defines interfaces for interacting wtih the Raspberry Pi firmware's
@@ -26179,9 +27289,9 @@ diff -Nur linux-4.1.6/drivers/firmware/raspberrypi.c linux-rpi/drivers/firmware/
+MODULE_AUTHOR("Eric Anholt <eric@anholt.net>");
+MODULE_DESCRIPTION("Raspberry Pi firmware driver");
+MODULE_LICENSE("GPL v2");
-diff -Nur linux-4.1.6/drivers/hid/usbhid/hid-core.c linux-rpi/drivers/hid/usbhid/hid-core.c
---- linux-4.1.6/drivers/hid/usbhid/hid-core.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/hid/usbhid/hid-core.c 2015-08-26 10:26:06.661287169 +0200
+diff -Nur linux-4.1.10/drivers/hid/usbhid/hid-core.c linux-rpi/drivers/hid/usbhid/hid-core.c
+--- linux-4.1.10/drivers/hid/usbhid/hid-core.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/hid/usbhid/hid-core.c 2015-10-07 16:40:42.000000000 +0200
@@ -49,7 +49,7 @@
* Module parameters.
*/
@@ -26206,59 +27316,9 @@ diff -Nur linux-4.1.6/drivers/hid/usbhid/hid-core.c linux-rpi/drivers/hid/usbhid
ret = -ENOMEM;
if (usb_endpoint_dir_in(endpoint)) {
-diff -Nur linux-4.1.6/drivers/i2c/busses/Kconfig linux-rpi/drivers/i2c/busses/Kconfig
---- linux-4.1.6/drivers/i2c/busses/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/i2c/busses/Kconfig 2015-08-26 10:26:06.689287562 +0200
-@@ -8,6 +8,25 @@
- comment "PC SMBus host controller drivers"
- depends on PCI
-
-+config I2C_BCM2708
-+ tristate "BCM2708 BSC"
-+ depends on MACH_BCM2708 || MACH_BCM2709
-+ help
-+ Enabling this option will add BSC (Broadcom Serial Controller)
-+ support for the BCM2708. BSC is a Broadcom proprietary bus compatible
-+ with I2C/TWI/SMBus.
-+
-+config I2C_BCM2708_BAUDRATE
-+ prompt "BCM2708 I2C baudrate"
-+ depends on I2C_BCM2708
-+ int
-+ default 100000
-+ help
-+ Set the I2C baudrate. This will alter the default value. A
-+ different baudrate can be set by using a module parameter as well. If
-+ no parameter is provided when loading, this is the value that will be
-+ used.
-+
- config I2C_ALI1535
- tristate "ALI 1535"
- depends on PCI
-@@ -362,7 +381,7 @@
-
- config I2C_BCM2835
- tristate "Broadcom BCM2835 I2C controller"
-- depends on ARCH_BCM2835
-+ depends on ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709
- help
- If you say yes to this option, support will be included for the
- BCM2835 I2C controller.
-diff -Nur linux-4.1.6/drivers/i2c/busses/Makefile linux-rpi/drivers/i2c/busses/Makefile
---- linux-4.1.6/drivers/i2c/busses/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/i2c/busses/Makefile 2015-08-26 10:26:06.689287562 +0200
-@@ -2,6 +2,8 @@
- # Makefile for the i2c bus drivers.
- #
-
-+obj-$(CONFIG_I2C_BCM2708) += i2c-bcm2708.o
-+
- # ACPI drivers
- obj-$(CONFIG_I2C_SCMI) += i2c-scmi.o
-
-diff -Nur linux-4.1.6/drivers/i2c/busses/i2c-bcm2708.c linux-rpi/drivers/i2c/busses/i2c-bcm2708.c
---- linux-4.1.6/drivers/i2c/busses/i2c-bcm2708.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/i2c/busses/i2c-bcm2708.c 2015-08-26 10:26:06.689287562 +0200
+diff -Nur linux-4.1.10/drivers/i2c/busses/i2c-bcm2708.c linux-rpi/drivers/i2c/busses/i2c-bcm2708.c
+--- linux-4.1.10/drivers/i2c/busses/i2c-bcm2708.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/i2c/busses/i2c-bcm2708.c 2015-10-07 16:40:42.000000000 +0200
@@ -0,0 +1,524 @@
+/*
+ * Driver for Broadcom BCM2708 BSC Controllers
@@ -26784,9 +27844,59 @@ diff -Nur linux-4.1.6/drivers/i2c/busses/i2c-bcm2708.c linux-rpi/drivers/i2c/bus
+MODULE_AUTHOR("Chris Boot <bootc@bootc.net>");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:" DRV_NAME);
-diff -Nur linux-4.1.6/drivers/input/joystick/Kconfig linux-rpi/drivers/input/joystick/Kconfig
---- linux-4.1.6/drivers/input/joystick/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/input/joystick/Kconfig 2015-08-26 10:26:07.769302643 +0200
+diff -Nur linux-4.1.10/drivers/i2c/busses/Kconfig linux-rpi/drivers/i2c/busses/Kconfig
+--- linux-4.1.10/drivers/i2c/busses/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/i2c/busses/Kconfig 2015-10-07 16:40:42.000000000 +0200
+@@ -8,6 +8,25 @@
+ comment "PC SMBus host controller drivers"
+ depends on PCI
+
++config I2C_BCM2708
++ tristate "BCM2708 BSC"
++ depends on MACH_BCM2708 || MACH_BCM2709
++ help
++ Enabling this option will add BSC (Broadcom Serial Controller)
++ support for the BCM2708. BSC is a Broadcom proprietary bus compatible
++ with I2C/TWI/SMBus.
++
++config I2C_BCM2708_BAUDRATE
++ prompt "BCM2708 I2C baudrate"
++ depends on I2C_BCM2708
++ int
++ default 100000
++ help
++ Set the I2C baudrate. This will alter the default value. A
++ different baudrate can be set by using a module parameter as well. If
++ no parameter is provided when loading, this is the value that will be
++ used.
++
+ config I2C_ALI1535
+ tristate "ALI 1535"
+ depends on PCI
+@@ -362,7 +381,7 @@
+
+ config I2C_BCM2835
+ tristate "Broadcom BCM2835 I2C controller"
+- depends on ARCH_BCM2835
++ depends on ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709
+ help
+ If you say yes to this option, support will be included for the
+ BCM2835 I2C controller.
+diff -Nur linux-4.1.10/drivers/i2c/busses/Makefile linux-rpi/drivers/i2c/busses/Makefile
+--- linux-4.1.10/drivers/i2c/busses/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/i2c/busses/Makefile 2015-10-07 16:40:42.000000000 +0200
+@@ -2,6 +2,8 @@
+ # Makefile for the i2c bus drivers.
+ #
+
++obj-$(CONFIG_I2C_BCM2708) += i2c-bcm2708.o
++
+ # ACPI drivers
+ obj-$(CONFIG_I2C_SCMI) += i2c-scmi.o
+
+diff -Nur linux-4.1.10/drivers/input/joystick/Kconfig linux-rpi/drivers/input/joystick/Kconfig
+--- linux-4.1.10/drivers/input/joystick/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/input/joystick/Kconfig 2015-10-07 16:40:42.000000000 +0200
@@ -329,4 +329,12 @@
To compile this as a module choose M here: the module will be called
maplecontrol.
@@ -26800,18 +27910,18 @@ diff -Nur linux-4.1.6/drivers/input/joystick/Kconfig linux-rpi/drivers/input/joy
+ This is the joystick driver for the Raspberry Pi Sense HAT
+
endif
-diff -Nur linux-4.1.6/drivers/input/joystick/Makefile linux-rpi/drivers/input/joystick/Makefile
---- linux-4.1.6/drivers/input/joystick/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/input/joystick/Makefile 2015-08-26 10:26:07.769302643 +0200
+diff -Nur linux-4.1.10/drivers/input/joystick/Makefile linux-rpi/drivers/input/joystick/Makefile
+--- linux-4.1.10/drivers/input/joystick/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/input/joystick/Makefile 2015-10-07 16:40:42.000000000 +0200
@@ -32,4 +32,5 @@
obj-$(CONFIG_JOYSTICK_XPAD) += xpad.o
obj-$(CONFIG_JOYSTICK_ZHENHUA) += zhenhua.o
obj-$(CONFIG_JOYSTICK_WALKERA0701) += walkera0701.o
+obj-$(CONFIG_JOYSTICK_RPISENSE) += rpisense-js.o
-diff -Nur linux-4.1.6/drivers/input/joystick/rpisense-js.c linux-rpi/drivers/input/joystick/rpisense-js.c
---- linux-4.1.6/drivers/input/joystick/rpisense-js.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/input/joystick/rpisense-js.c 2015-08-26 10:26:07.769302643 +0200
+diff -Nur linux-4.1.10/drivers/input/joystick/rpisense-js.c linux-rpi/drivers/input/joystick/rpisense-js.c
+--- linux-4.1.10/drivers/input/joystick/rpisense-js.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/input/joystick/rpisense-js.c 2015-10-07 16:40:42.000000000 +0200
@@ -0,0 +1,153 @@
+/*
+ * Raspberry Pi Sense HAT joystick driver
@@ -26966,9 +28076,9 @@ diff -Nur linux-4.1.6/drivers/input/joystick/rpisense-js.c linux-rpi/drivers/inp
+MODULE_DESCRIPTION("Raspberry Pi Sense HAT joystick driver");
+MODULE_AUTHOR("Serge Schneider <serge@raspberrypi.org>");
+MODULE_LICENSE("GPL");
-diff -Nur linux-4.1.6/drivers/input/touchscreen/Kconfig linux-rpi/drivers/input/touchscreen/Kconfig
---- linux-4.1.6/drivers/input/touchscreen/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/input/touchscreen/Kconfig 2015-08-26 10:26:07.789302922 +0200
+diff -Nur linux-4.1.10/drivers/input/touchscreen/Kconfig linux-rpi/drivers/input/touchscreen/Kconfig
+--- linux-4.1.10/drivers/input/touchscreen/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/input/touchscreen/Kconfig 2015-10-07 16:40:44.000000000 +0200
@@ -583,6 +583,13 @@
To compile this driver as a module, choose M here: the
module will be called edt-ft5x06.
@@ -26983,9 +28093,9 @@ diff -Nur linux-4.1.6/drivers/input/touchscreen/Kconfig linux-rpi/drivers/input/
config TOUCHSCREEN_MIGOR
tristate "Renesas MIGO-R touchscreen"
depends on SH_MIGOR && I2C
-diff -Nur linux-4.1.6/drivers/input/touchscreen/Makefile linux-rpi/drivers/input/touchscreen/Makefile
---- linux-4.1.6/drivers/input/touchscreen/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/input/touchscreen/Makefile 2015-08-26 10:26:07.789302922 +0200
+diff -Nur linux-4.1.10/drivers/input/touchscreen/Makefile linux-rpi/drivers/input/touchscreen/Makefile
+--- linux-4.1.10/drivers/input/touchscreen/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/input/touchscreen/Makefile 2015-10-07 16:40:44.000000000 +0200
@@ -29,6 +29,7 @@
obj-$(CONFIG_TOUCHSCREEN_DA9052) += da9052_tsi.o
obj-$(CONFIG_TOUCHSCREEN_DYNAPRO) += dynapro.o
@@ -26994,9 +28104,9 @@ diff -Nur linux-4.1.6/drivers/input/touchscreen/Makefile linux-rpi/drivers/input
obj-$(CONFIG_TOUCHSCREEN_HAMPSHIRE) += hampshire.o
obj-$(CONFIG_TOUCHSCREEN_GUNZE) += gunze.o
obj-$(CONFIG_TOUCHSCREEN_EETI) += eeti_ts.o
-diff -Nur linux-4.1.6/drivers/input/touchscreen/rpi-ft5406.c linux-rpi/drivers/input/touchscreen/rpi-ft5406.c
---- linux-4.1.6/drivers/input/touchscreen/rpi-ft5406.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/input/touchscreen/rpi-ft5406.c 2015-08-26 10:26:07.793302977 +0200
+diff -Nur linux-4.1.10/drivers/input/touchscreen/rpi-ft5406.c linux-rpi/drivers/input/touchscreen/rpi-ft5406.c
+--- linux-4.1.10/drivers/input/touchscreen/rpi-ft5406.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/input/touchscreen/rpi-ft5406.c 2015-10-07 16:40:44.000000000 +0200
@@ -0,0 +1,246 @@
+/*
+ * Driver for memory based ft5406 touchscreen
@@ -27244,9 +28354,9 @@ diff -Nur linux-4.1.6/drivers/input/touchscreen/rpi-ft5406.c linux-rpi/drivers/i
+MODULE_AUTHOR("Gordon Hollingworth");
+MODULE_DESCRIPTION("Touchscreen driver for memory based FT5406");
+MODULE_LICENSE("GPL");
-diff -Nur linux-4.1.6/drivers/irqchip/irq-bcm2835.c linux-rpi/drivers/irqchip/irq-bcm2835.c
---- linux-4.1.6/drivers/irqchip/irq-bcm2835.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/irqchip/irq-bcm2835.c 2015-08-26 10:26:07.805303145 +0200
+diff -Nur linux-4.1.10/drivers/irqchip/irq-bcm2835.c linux-rpi/drivers/irqchip/irq-bcm2835.c
+--- linux-4.1.10/drivers/irqchip/irq-bcm2835.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/irqchip/irq-bcm2835.c 2015-10-07 16:40:44.000000000 +0200
@@ -56,7 +56,7 @@
#include "irqchip.h"
@@ -27345,9 +28455,9 @@ diff -Nur linux-4.1.6/drivers/irqchip/irq-bcm2835.c linux-rpi/drivers/irqchip/ir
return 0;
}
-diff -Nur linux-4.1.6/drivers/leds/leds-gpio.c linux-rpi/drivers/leds/leds-gpio.c
---- linux-4.1.6/drivers/leds/leds-gpio.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/leds/leds-gpio.c 2015-08-26 10:26:07.841303647 +0200
+diff -Nur linux-4.1.10/drivers/leds/leds-gpio.c linux-rpi/drivers/leds/leds-gpio.c
+--- linux-4.1.10/drivers/leds/leds-gpio.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/leds/leds-gpio.c 2015-10-07 16:40:44.000000000 +0200
@@ -41,6 +41,13 @@
led_dat->platform_gpio_blink_set(led_dat->gpiod,
led_dat->new_level, NULL, NULL);
@@ -27394,9 +28504,9 @@ diff -Nur linux-4.1.6/drivers/leds/leds-gpio.c linux-rpi/drivers/leds/leds-gpio.
if (template->default_state == LEDS_GPIO_DEFSTATE_KEEP)
state = !!gpiod_get_value_cansleep(led_dat->gpiod);
else
-diff -Nur linux-4.1.6/drivers/leds/trigger/Kconfig linux-rpi/drivers/leds/trigger/Kconfig
---- linux-4.1.6/drivers/leds/trigger/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/leds/trigger/Kconfig 2015-08-26 10:26:07.845303703 +0200
+diff -Nur linux-4.1.10/drivers/leds/trigger/Kconfig linux-rpi/drivers/leds/trigger/Kconfig
+--- linux-4.1.10/drivers/leds/trigger/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/leds/trigger/Kconfig 2015-10-07 16:40:44.000000000 +0200
@@ -108,4 +108,11 @@
This enables direct flash/torch on/off by the driver, kernel space.
If unsure, say Y.
@@ -27409,17 +28519,9 @@ diff -Nur linux-4.1.6/drivers/leds/trigger/Kconfig linux-rpi/drivers/leds/trigge
+ If unsure, say Y.
+
endif # LEDS_TRIGGERS
-diff -Nur linux-4.1.6/drivers/leds/trigger/Makefile linux-rpi/drivers/leds/trigger/Makefile
---- linux-4.1.6/drivers/leds/trigger/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/leds/trigger/Makefile 2015-08-26 10:26:07.845303703 +0200
-@@ -8,3 +8,4 @@
- obj-$(CONFIG_LEDS_TRIGGER_DEFAULT_ON) += ledtrig-default-on.o
- obj-$(CONFIG_LEDS_TRIGGER_TRANSIENT) += ledtrig-transient.o
- obj-$(CONFIG_LEDS_TRIGGER_CAMERA) += ledtrig-camera.o
-+obj-$(CONFIG_LEDS_TRIGGER_INPUT) += ledtrig-input.o
-diff -Nur linux-4.1.6/drivers/leds/trigger/ledtrig-input.c linux-rpi/drivers/leds/trigger/ledtrig-input.c
---- linux-4.1.6/drivers/leds/trigger/ledtrig-input.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/leds/trigger/ledtrig-input.c 2015-08-26 10:26:07.845303703 +0200
+diff -Nur linux-4.1.10/drivers/leds/trigger/ledtrig-input.c linux-rpi/drivers/leds/trigger/ledtrig-input.c
+--- linux-4.1.10/drivers/leds/trigger/ledtrig-input.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/leds/trigger/ledtrig-input.c 2015-10-07 16:40:44.000000000 +0200
@@ -0,0 +1,54 @@
+/*
+ * Set LED GPIO to Input "Trigger"
@@ -27475,35 +28577,17 @@ diff -Nur linux-4.1.6/drivers/leds/trigger/ledtrig-input.c linux-rpi/drivers/led
+MODULE_AUTHOR("Phil Elwell <phil@raspberrypi.org>");
+MODULE_DESCRIPTION("Set LED GPIO to Input \"trigger\"");
+MODULE_LICENSE("GPL");
-diff -Nur linux-4.1.6/drivers/mailbox/Kconfig linux-rpi/drivers/mailbox/Kconfig
---- linux-4.1.6/drivers/mailbox/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/mailbox/Kconfig 2015-08-26 10:26:07.849303759 +0200
-@@ -60,4 +60,13 @@
- An implementation of the Altera Mailbox soft core. It is used
- to send message between processors. Say Y here if you want to use the
- Altera mailbox support.
-+
-+config BCM2835_MBOX
-+ tristate "BCM2835 Mailbox"
-+ depends on ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709
-+ help
-+ An implementation of the BCM2385 Mailbox. It is used to invoke
-+ the services of the Videocore. Say Y here if you want to use the
-+ BCM2835 Mailbox.
-+
- endif
-diff -Nur linux-4.1.6/drivers/mailbox/Makefile linux-rpi/drivers/mailbox/Makefile
---- linux-4.1.6/drivers/mailbox/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/mailbox/Makefile 2015-08-26 10:26:07.849303759 +0200
-@@ -11,3 +11,5 @@
- obj-$(CONFIG_PCC) += pcc.o
-
- obj-$(CONFIG_ALTERA_MBOX) += mailbox-altera.o
-+
-+obj-$(CONFIG_BCM2835_MBOX) += bcm2835-mailbox.o
-diff -Nur linux-4.1.6/drivers/mailbox/bcm2835-mailbox.c linux-rpi/drivers/mailbox/bcm2835-mailbox.c
---- linux-4.1.6/drivers/mailbox/bcm2835-mailbox.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/mailbox/bcm2835-mailbox.c 2015-08-26 10:26:07.849303759 +0200
+diff -Nur linux-4.1.10/drivers/leds/trigger/Makefile linux-rpi/drivers/leds/trigger/Makefile
+--- linux-4.1.10/drivers/leds/trigger/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/leds/trigger/Makefile 2015-10-07 16:40:44.000000000 +0200
+@@ -8,3 +8,4 @@
+ obj-$(CONFIG_LEDS_TRIGGER_DEFAULT_ON) += ledtrig-default-on.o
+ obj-$(CONFIG_LEDS_TRIGGER_TRANSIENT) += ledtrig-transient.o
+ obj-$(CONFIG_LEDS_TRIGGER_CAMERA) += ledtrig-camera.o
++obj-$(CONFIG_LEDS_TRIGGER_INPUT) += ledtrig-input.o
+diff -Nur linux-4.1.10/drivers/mailbox/bcm2835-mailbox.c linux-rpi/drivers/mailbox/bcm2835-mailbox.c
+--- linux-4.1.10/drivers/mailbox/bcm2835-mailbox.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/mailbox/bcm2835-mailbox.c 2015-10-07 16:40:44.000000000 +0200
@@ -0,0 +1,231 @@
+/*
+ * Copyright (C) 2010,2015 Broadcom
@@ -27736,9 +28820,26 @@ diff -Nur linux-4.1.6/drivers/mailbox/bcm2835-mailbox.c linux-rpi/drivers/mailbo
+MODULE_AUTHOR("Lubomir Rintel <lkundrak@v3.sk>");
+MODULE_DESCRIPTION("BCM2835 mailbox IPC driver");
+MODULE_LICENSE("GPL v2");
-diff -Nur linux-4.1.6/drivers/mailbox/mailbox.c linux-rpi/drivers/mailbox/mailbox.c
---- linux-4.1.6/drivers/mailbox/mailbox.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/mailbox/mailbox.c 2015-08-26 10:26:07.853303814 +0200
+diff -Nur linux-4.1.10/drivers/mailbox/Kconfig linux-rpi/drivers/mailbox/Kconfig
+--- linux-4.1.10/drivers/mailbox/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/mailbox/Kconfig 2015-10-07 16:40:44.000000000 +0200
+@@ -60,4 +60,13 @@
+ An implementation of the Altera Mailbox soft core. It is used
+ to send message between processors. Say Y here if you want to use the
+ Altera mailbox support.
++
++config BCM2835_MBOX
++ tristate "BCM2835 Mailbox"
++ depends on ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709
++ help
++ An implementation of the BCM2385 Mailbox. It is used to invoke
++ the services of the Videocore. Say Y here if you want to use the
++ BCM2835 Mailbox.
++
+ endif
+diff -Nur linux-4.1.10/drivers/mailbox/mailbox.c linux-rpi/drivers/mailbox/mailbox.c
+--- linux-4.1.10/drivers/mailbox/mailbox.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/mailbox/mailbox.c 2015-10-07 16:40:44.000000000 +0200
@@ -304,13 +304,23 @@
unsigned long flags;
int ret;
@@ -27772,71 +28873,18 @@ diff -Nur linux-4.1.6/drivers/mailbox/mailbox.c linux-rpi/drivers/mailbox/mailbo
if (!chan || chan->cl || !try_module_get(mbox->dev->driver->owner)) {
dev_dbg(dev, "%s: mailbox not free\n", __func__);
mutex_unlock(&con_mutex);
-diff -Nur linux-4.1.6/drivers/media/platform/Kconfig linux-rpi/drivers/media/platform/Kconfig
---- linux-4.1.6/drivers/media/platform/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/media/platform/Kconfig 2015-08-26 10:26:08.025306213 +0200
-@@ -11,6 +11,8 @@
-
- if V4L_PLATFORM_DRIVERS
-
-+source "drivers/media/platform/bcm2835/Kconfig"
-+
- source "drivers/media/platform/marvell-ccic/Kconfig"
-
- config VIDEO_VIA_CAMERA
-diff -Nur linux-4.1.6/drivers/media/platform/Makefile linux-rpi/drivers/media/platform/Makefile
---- linux-4.1.6/drivers/media/platform/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/media/platform/Makefile 2015-08-26 10:26:08.025306213 +0200
-@@ -2,6 +2,8 @@
- # Makefile for the video capture/playback device drivers.
- #
-
-+obj-$(CONFIG_VIDEO_BCM2835) += bcm2835/
-+
- obj-$(CONFIG_VIDEO_TIMBERDALE) += timblogiw.o
- obj-$(CONFIG_VIDEO_M32R_AR_M64278) += arv.o
+diff -Nur linux-4.1.10/drivers/mailbox/Makefile linux-rpi/drivers/mailbox/Makefile
+--- linux-4.1.10/drivers/mailbox/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/mailbox/Makefile 2015-10-07 16:40:44.000000000 +0200
+@@ -11,3 +11,5 @@
+ obj-$(CONFIG_PCC) += pcc.o
-diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/Kconfig linux-rpi/drivers/media/platform/bcm2835/Kconfig
---- linux-4.1.6/drivers/media/platform/bcm2835/Kconfig 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/media/platform/bcm2835/Kconfig 2015-08-26 10:26:08.025306213 +0200
-@@ -0,0 +1,25 @@
-+# Broadcom VideoCore IV v4l2 camera support
-+
-+config VIDEO_BCM2835
-+ bool "Broadcom BCM2835 camera interface driver"
-+ depends on VIDEO_V4L2 && (ARCH_BCM2708 || ARCH_BCM2709 || ARCH_BCM2835)
-+ ---help---
-+ Say Y here to enable camera host interface devices for
-+ Broadcom BCM2835 SoC. This operates over the VCHIQ interface
-+ to a service running on VideoCore.
-+
-+
-+if VIDEO_BCM2835
-+
-+config VIDEO_BCM2835_MMAL
-+ tristate "Broadcom BM2835 MMAL camera interface driver"
-+ depends on BCM2708_VCHIQ
-+ select VIDEOBUF2_VMALLOC
-+ ---help---
-+ This is a V4L2 driver for the Broadcom BCM2835 MMAL camera host interface
-+
-+ To compile this driver as a module, choose M here: the
-+ module will be called bcm2835-v4l2.o
-+
-+
-+endif # VIDEO_BM2835
-diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/Makefile linux-rpi/drivers/media/platform/bcm2835/Makefile
---- linux-4.1.6/drivers/media/platform/bcm2835/Makefile 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/media/platform/bcm2835/Makefile 2015-08-26 10:26:08.025306213 +0200
-@@ -0,0 +1,5 @@
-+bcm2835-v4l2-objs := bcm2835-camera.o controls.o mmal-vchiq.o
-+
-+obj-$(CONFIG_VIDEO_BCM2835_MMAL) += bcm2835-v4l2.o
+ obj-$(CONFIG_ALTERA_MBOX) += mailbox-altera.o
+
-+ccflags-$(CONFIG_VIDEO_BCM2835) += -Idrivers/misc/vc04_services -Idrivers/misc/vc04_services/interface/vcos/linuxkernel -D__VCCOREVER__=0x04000000
-diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/bcm2835-camera.c linux-rpi/drivers/media/platform/bcm2835/bcm2835-camera.c
---- linux-4.1.6/drivers/media/platform/bcm2835/bcm2835-camera.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/media/platform/bcm2835/bcm2835-camera.c 2015-08-26 10:26:08.025306213 +0200
++obj-$(CONFIG_BCM2835_MBOX) += bcm2835-mailbox.o
+diff -Nur linux-4.1.10/drivers/media/platform/bcm2835/bcm2835-camera.c linux-rpi/drivers/media/platform/bcm2835/bcm2835-camera.c
+--- linux-4.1.10/drivers/media/platform/bcm2835/bcm2835-camera.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/media/platform/bcm2835/bcm2835-camera.c 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,1842 @@
+/*
+ * Broadcom BM2835 V4L2 driver
@@ -29680,9 +30728,9 @@ diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/bcm2835-camera.c linux-rpi/
+
+module_init(bm2835_mmal_init);
+module_exit(bm2835_mmal_exit);
-diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/bcm2835-camera.h linux-rpi/drivers/media/platform/bcm2835/bcm2835-camera.h
---- linux-4.1.6/drivers/media/platform/bcm2835/bcm2835-camera.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/media/platform/bcm2835/bcm2835-camera.h 2015-08-26 10:26:08.025306213 +0200
+diff -Nur linux-4.1.10/drivers/media/platform/bcm2835/bcm2835-camera.h linux-rpi/drivers/media/platform/bcm2835/bcm2835-camera.h
+--- linux-4.1.10/drivers/media/platform/bcm2835/bcm2835-camera.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/media/platform/bcm2835/bcm2835-camera.h 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,126 @@
+/*
+ * Broadcom BM2835 V4L2 driver
@@ -29810,10 +30858,10 @@ diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/bcm2835-camera.h linux-rpi/
+ (pix_fmt)->pixelformat, (pix_fmt)->bytesperline, \
+ (pix_fmt)->sizeimage, (pix_fmt)->colorspace, (pix_fmt)->priv); \
+}
-diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/controls.c linux-rpi/drivers/media/platform/bcm2835/controls.c
---- linux-4.1.6/drivers/media/platform/bcm2835/controls.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/media/platform/bcm2835/controls.c 2015-08-26 10:26:08.025306213 +0200
-@@ -0,0 +1,1322 @@
+diff -Nur linux-4.1.10/drivers/media/platform/bcm2835/controls.c linux-rpi/drivers/media/platform/bcm2835/controls.c
+--- linux-4.1.10/drivers/media/platform/bcm2835/controls.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/media/platform/bcm2835/controls.c 2015-10-07 16:40:46.000000000 +0200
+@@ -0,0 +1,1324 @@
+/*
+ * Broadcom BM2835 V4L2 driver
+ *
@@ -30661,6 +31709,8 @@ diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/controls.c linux-rpi/driver
+ break;
+ }
+ }
++ if (!scene)
++ return -EINVAL;
+ if (i >= ARRAY_SIZE(scene_configs))
+ return -EINVAL;
+
@@ -31136,9 +32186,47 @@ diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/controls.c linux-rpi/driver
+
+ return 0;
+}
-diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/mmal-common.h linux-rpi/drivers/media/platform/bcm2835/mmal-common.h
---- linux-4.1.6/drivers/media/platform/bcm2835/mmal-common.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/media/platform/bcm2835/mmal-common.h 2015-08-26 10:26:08.025306213 +0200
+diff -Nur linux-4.1.10/drivers/media/platform/bcm2835/Kconfig linux-rpi/drivers/media/platform/bcm2835/Kconfig
+--- linux-4.1.10/drivers/media/platform/bcm2835/Kconfig 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/media/platform/bcm2835/Kconfig 2015-10-07 16:40:46.000000000 +0200
+@@ -0,0 +1,25 @@
++# Broadcom VideoCore IV v4l2 camera support
++
++config VIDEO_BCM2835
++ bool "Broadcom BCM2835 camera interface driver"
++ depends on VIDEO_V4L2 && (ARCH_BCM2708 || ARCH_BCM2709 || ARCH_BCM2835)
++ ---help---
++ Say Y here to enable camera host interface devices for
++ Broadcom BCM2835 SoC. This operates over the VCHIQ interface
++ to a service running on VideoCore.
++
++
++if VIDEO_BCM2835
++
++config VIDEO_BCM2835_MMAL
++ tristate "Broadcom BM2835 MMAL camera interface driver"
++ depends on BCM2708_VCHIQ
++ select VIDEOBUF2_VMALLOC
++ ---help---
++ This is a V4L2 driver for the Broadcom BCM2835 MMAL camera host interface
++
++ To compile this driver as a module, choose M here: the
++ module will be called bcm2835-v4l2.o
++
++
++endif # VIDEO_BM2835
+diff -Nur linux-4.1.10/drivers/media/platform/bcm2835/Makefile linux-rpi/drivers/media/platform/bcm2835/Makefile
+--- linux-4.1.10/drivers/media/platform/bcm2835/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/media/platform/bcm2835/Makefile 2015-10-07 16:40:46.000000000 +0200
+@@ -0,0 +1,5 @@
++bcm2835-v4l2-objs := bcm2835-camera.o controls.o mmal-vchiq.o
++
++obj-$(CONFIG_VIDEO_BCM2835_MMAL) += bcm2835-v4l2.o
++
++ccflags-$(CONFIG_VIDEO_BCM2835) += -Idrivers/misc/vc04_services -Idrivers/misc/vc04_services/interface/vcos/linuxkernel -D__VCCOREVER__=0x04000000
+diff -Nur linux-4.1.10/drivers/media/platform/bcm2835/mmal-common.h linux-rpi/drivers/media/platform/bcm2835/mmal-common.h
+--- linux-4.1.10/drivers/media/platform/bcm2835/mmal-common.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/media/platform/bcm2835/mmal-common.h 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,53 @@
+/*
+ * Broadcom BM2835 V4L2 driver
@@ -31193,9 +32281,9 @@ diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/mmal-common.h linux-rpi/dri
+ u32 u;
+ u32 v;
+};
-diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/mmal-encodings.h linux-rpi/drivers/media/platform/bcm2835/mmal-encodings.h
---- linux-4.1.6/drivers/media/platform/bcm2835/mmal-encodings.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/media/platform/bcm2835/mmal-encodings.h 2015-08-26 10:26:08.025306213 +0200
+diff -Nur linux-4.1.10/drivers/media/platform/bcm2835/mmal-encodings.h linux-rpi/drivers/media/platform/bcm2835/mmal-encodings.h
+--- linux-4.1.10/drivers/media/platform/bcm2835/mmal-encodings.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/media/platform/bcm2835/mmal-encodings.h 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,127 @@
+/*
+ * Broadcom BM2835 V4L2 driver
@@ -31324,9 +32412,9 @@ diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/mmal-encodings.h linux-rpi/
+/* @} MmalColorSpace List */
+
+#endif /* MMAL_ENCODINGS_H */
-diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/mmal-msg-common.h linux-rpi/drivers/media/platform/bcm2835/mmal-msg-common.h
---- linux-4.1.6/drivers/media/platform/bcm2835/mmal-msg-common.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/media/platform/bcm2835/mmal-msg-common.h 2015-08-26 10:26:08.025306213 +0200
+diff -Nur linux-4.1.10/drivers/media/platform/bcm2835/mmal-msg-common.h linux-rpi/drivers/media/platform/bcm2835/mmal-msg-common.h
+--- linux-4.1.10/drivers/media/platform/bcm2835/mmal-msg-common.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/media/platform/bcm2835/mmal-msg-common.h 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,50 @@
+/*
+ * Broadcom BM2835 V4L2 driver
@@ -31378,9 +32466,9 @@ diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/mmal-msg-common.h linux-rpi
+};
+
+#endif /* MMAL_MSG_COMMON_H */
-diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/mmal-msg-format.h linux-rpi/drivers/media/platform/bcm2835/mmal-msg-format.h
---- linux-4.1.6/drivers/media/platform/bcm2835/mmal-msg-format.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/media/platform/bcm2835/mmal-msg-format.h 2015-08-26 10:26:08.025306213 +0200
+diff -Nur linux-4.1.10/drivers/media/platform/bcm2835/mmal-msg-format.h linux-rpi/drivers/media/platform/bcm2835/mmal-msg-format.h
+--- linux-4.1.10/drivers/media/platform/bcm2835/mmal-msg-format.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/media/platform/bcm2835/mmal-msg-format.h 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,81 @@
+/*
+ * Broadcom BM2835 V4L2 driver
@@ -31463,120 +32551,9 @@ diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/mmal-msg-format.h linux-rpi
+};
+
+#endif /* MMAL_MSG_FORMAT_H */
-diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/mmal-msg-port.h linux-rpi/drivers/media/platform/bcm2835/mmal-msg-port.h
---- linux-4.1.6/drivers/media/platform/bcm2835/mmal-msg-port.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/media/platform/bcm2835/mmal-msg-port.h 2015-08-26 10:26:08.025306213 +0200
-@@ -0,0 +1,107 @@
-+/*
-+ * Broadcom BM2835 V4L2 driver
-+ *
-+ * Copyright © 2013 Raspberry Pi (Trading) Ltd.
-+ *
-+ * This file is subject to the terms and conditions of the GNU General Public
-+ * License. See the file COPYING in the main directory of this archive
-+ * for more details.
-+ *
-+ * Authors: Vincent Sanders <vincent.sanders@collabora.co.uk>
-+ * Dave Stevenson <dsteve@broadcom.com>
-+ * Simon Mellor <simellor@broadcom.com>
-+ * Luke Diamand <luked@broadcom.com>
-+ */
-+
-+/* MMAL_PORT_TYPE_T */
-+enum mmal_port_type {
-+ MMAL_PORT_TYPE_UNKNOWN = 0, /**< Unknown port type */
-+ MMAL_PORT_TYPE_CONTROL, /**< Control port */
-+ MMAL_PORT_TYPE_INPUT, /**< Input port */
-+ MMAL_PORT_TYPE_OUTPUT, /**< Output port */
-+ MMAL_PORT_TYPE_CLOCK, /**< Clock port */
-+};
-+
-+/** The port is pass-through and doesn't need buffer headers allocated */
-+#define MMAL_PORT_CAPABILITY_PASSTHROUGH 0x01
-+/** The port wants to allocate the buffer payloads.
-+ * This signals a preference that payload allocation should be done
-+ * on this port for efficiency reasons. */
-+#define MMAL_PORT_CAPABILITY_ALLOCATION 0x02
-+/** The port supports format change events.
-+ * This applies to input ports and is used to let the client know
-+ * whether the port supports being reconfigured via a format
-+ * change event (i.e. without having to disable the port). */
-+#define MMAL_PORT_CAPABILITY_SUPPORTS_EVENT_FORMAT_CHANGE 0x04
-+
-+/* mmal port structure (MMAL_PORT_T)
-+ *
-+ * most elements are informational only, the pointer values for
-+ * interogation messages are generally provided as additional
-+ * strucures within the message. When used to set values only teh
-+ * buffer_num, buffer_size and userdata parameters are writable.
-+ */
-+struct mmal_port {
-+ void *priv; /* Private member used by the framework */
-+ const char *name; /* Port name. Used for debugging purposes (RO) */
-+
-+ u32 type; /* Type of the port (RO) enum mmal_port_type */
-+ u16 index; /* Index of the port in its type list (RO) */
-+ u16 index_all; /* Index of the port in the list of all ports (RO) */
-+
-+ u32 is_enabled; /* Indicates whether the port is enabled or not (RO) */
-+ struct mmal_es_format *format; /* Format of the elementary stream */
-+
-+ u32 buffer_num_min; /* Minimum number of buffers the port
-+ * requires (RO). This is set by the
-+ * component.
-+ */
-+
-+ u32 buffer_size_min; /* Minimum size of buffers the port
-+ * requires (RO). This is set by the
-+ * component.
-+ */
-+
-+ u32 buffer_alignment_min; /* Minimum alignment requirement for
-+ * the buffers (RO). A value of
-+ * zero means no special alignment
-+ * requirements. This is set by the
-+ * component.
-+ */
-+
-+ u32 buffer_num_recommended; /* Number of buffers the port
-+ * recommends for optimal
-+ * performance (RO). A value of
-+ * zero means no special
-+ * recommendation. This is set
-+ * by the component.
-+ */
-+
-+ u32 buffer_size_recommended; /* Size of buffers the port
-+ * recommends for optimal
-+ * performance (RO). A value of
-+ * zero means no special
-+ * recommendation. This is set
-+ * by the component.
-+ */
-+
-+ u32 buffer_num; /* Actual number of buffers the port will use.
-+ * This is set by the client.
-+ */
-+
-+ u32 buffer_size; /* Actual maximum size of the buffers that
-+ * will be sent to the port. This is set by
-+ * the client.
-+ */
-+
-+ void *component; /* Component this port belongs to (Read Only) */
-+
-+ void *userdata; /* Field reserved for use by the client */
-+
-+ u32 capabilities; /* Flags describing the capabilities of a
-+ * port (RO). Bitwise combination of \ref
-+ * portcapabilities "Port capabilities"
-+ * values.
-+ */
-+
-+};
-diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/mmal-msg.h linux-rpi/drivers/media/platform/bcm2835/mmal-msg.h
---- linux-4.1.6/drivers/media/platform/bcm2835/mmal-msg.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/media/platform/bcm2835/mmal-msg.h 2015-08-26 10:26:08.025306213 +0200
+diff -Nur linux-4.1.10/drivers/media/platform/bcm2835/mmal-msg.h linux-rpi/drivers/media/platform/bcm2835/mmal-msg.h
+--- linux-4.1.10/drivers/media/platform/bcm2835/mmal-msg.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/media/platform/bcm2835/mmal-msg.h 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,404 @@
+/*
+ * Broadcom BM2835 V4L2 driver
@@ -31982,9 +32959,120 @@ diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/mmal-msg.h linux-rpi/driver
+ u8 payload[MMAL_MSG_MAX_PAYLOAD];
+ } u;
+};
-diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/mmal-parameters.h linux-rpi/drivers/media/platform/bcm2835/mmal-parameters.h
---- linux-4.1.6/drivers/media/platform/bcm2835/mmal-parameters.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/media/platform/bcm2835/mmal-parameters.h 2015-08-26 10:26:08.025306213 +0200
+diff -Nur linux-4.1.10/drivers/media/platform/bcm2835/mmal-msg-port.h linux-rpi/drivers/media/platform/bcm2835/mmal-msg-port.h
+--- linux-4.1.10/drivers/media/platform/bcm2835/mmal-msg-port.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/media/platform/bcm2835/mmal-msg-port.h 2015-10-07 16:40:46.000000000 +0200
+@@ -0,0 +1,107 @@
++/*
++ * Broadcom BM2835 V4L2 driver
++ *
++ * Copyright © 2013 Raspberry Pi (Trading) Ltd.
++ *
++ * This file is subject to the terms and conditions of the GNU General Public
++ * License. See the file COPYING in the main directory of this archive
++ * for more details.
++ *
++ * Authors: Vincent Sanders <vincent.sanders@collabora.co.uk>
++ * Dave Stevenson <dsteve@broadcom.com>
++ * Simon Mellor <simellor@broadcom.com>
++ * Luke Diamand <luked@broadcom.com>
++ */
++
++/* MMAL_PORT_TYPE_T */
++enum mmal_port_type {
++ MMAL_PORT_TYPE_UNKNOWN = 0, /**< Unknown port type */
++ MMAL_PORT_TYPE_CONTROL, /**< Control port */
++ MMAL_PORT_TYPE_INPUT, /**< Input port */
++ MMAL_PORT_TYPE_OUTPUT, /**< Output port */
++ MMAL_PORT_TYPE_CLOCK, /**< Clock port */
++};
++
++/** The port is pass-through and doesn't need buffer headers allocated */
++#define MMAL_PORT_CAPABILITY_PASSTHROUGH 0x01
++/** The port wants to allocate the buffer payloads.
++ * This signals a preference that payload allocation should be done
++ * on this port for efficiency reasons. */
++#define MMAL_PORT_CAPABILITY_ALLOCATION 0x02
++/** The port supports format change events.
++ * This applies to input ports and is used to let the client know
++ * whether the port supports being reconfigured via a format
++ * change event (i.e. without having to disable the port). */
++#define MMAL_PORT_CAPABILITY_SUPPORTS_EVENT_FORMAT_CHANGE 0x04
++
++/* mmal port structure (MMAL_PORT_T)
++ *
++ * most elements are informational only, the pointer values for
++ * interogation messages are generally provided as additional
++ * strucures within the message. When used to set values only teh
++ * buffer_num, buffer_size and userdata parameters are writable.
++ */
++struct mmal_port {
++ void *priv; /* Private member used by the framework */
++ const char *name; /* Port name. Used for debugging purposes (RO) */
++
++ u32 type; /* Type of the port (RO) enum mmal_port_type */
++ u16 index; /* Index of the port in its type list (RO) */
++ u16 index_all; /* Index of the port in the list of all ports (RO) */
++
++ u32 is_enabled; /* Indicates whether the port is enabled or not (RO) */
++ struct mmal_es_format *format; /* Format of the elementary stream */
++
++ u32 buffer_num_min; /* Minimum number of buffers the port
++ * requires (RO). This is set by the
++ * component.
++ */
++
++ u32 buffer_size_min; /* Minimum size of buffers the port
++ * requires (RO). This is set by the
++ * component.
++ */
++
++ u32 buffer_alignment_min; /* Minimum alignment requirement for
++ * the buffers (RO). A value of
++ * zero means no special alignment
++ * requirements. This is set by the
++ * component.
++ */
++
++ u32 buffer_num_recommended; /* Number of buffers the port
++ * recommends for optimal
++ * performance (RO). A value of
++ * zero means no special
++ * recommendation. This is set
++ * by the component.
++ */
++
++ u32 buffer_size_recommended; /* Size of buffers the port
++ * recommends for optimal
++ * performance (RO). A value of
++ * zero means no special
++ * recommendation. This is set
++ * by the component.
++ */
++
++ u32 buffer_num; /* Actual number of buffers the port will use.
++ * This is set by the client.
++ */
++
++ u32 buffer_size; /* Actual maximum size of the buffers that
++ * will be sent to the port. This is set by
++ * the client.
++ */
++
++ void *component; /* Component this port belongs to (Read Only) */
++
++ void *userdata; /* Field reserved for use by the client */
++
++ u32 capabilities; /* Flags describing the capabilities of a
++ * port (RO). Bitwise combination of \ref
++ * portcapabilities "Port capabilities"
++ * values.
++ */
++
++};
+diff -Nur linux-4.1.10/drivers/media/platform/bcm2835/mmal-parameters.h linux-rpi/drivers/media/platform/bcm2835/mmal-parameters.h
+--- linux-4.1.10/drivers/media/platform/bcm2835/mmal-parameters.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/media/platform/bcm2835/mmal-parameters.h 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,656 @@
+/*
+ * Broadcom BM2835 V4L2 driver
@@ -32642,9 +33730,9 @@ diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/mmal-parameters.h linux-rpi
+ u32 num_effect_params;
+ u32 effect_parameter[MMAL_MAX_IMAGEFX_PARAMETERS];
+};
-diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/mmal-vchiq.c linux-rpi/drivers/media/platform/bcm2835/mmal-vchiq.c
---- linux-4.1.6/drivers/media/platform/bcm2835/mmal-vchiq.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/media/platform/bcm2835/mmal-vchiq.c 2015-08-26 10:26:08.025306213 +0200
+diff -Nur linux-4.1.10/drivers/media/platform/bcm2835/mmal-vchiq.c linux-rpi/drivers/media/platform/bcm2835/mmal-vchiq.c
+--- linux-4.1.10/drivers/media/platform/bcm2835/mmal-vchiq.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/media/platform/bcm2835/mmal-vchiq.c 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,1916 @@
+/*
+ * Broadcom BM2835 V4L2 driver
@@ -33499,7 +34587,7 @@ diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/mmal-vchiq.c linux-rpi/driv
+ sizeof(union mmal_es_specific_format));
+
+ m.u.port_info_set.format.extradata_size = port->format.extradata_size;
-+ memcpy(rmsg->u.port_info_set.extradata, port->format.extradata,
++ memcpy(&m.u.port_info_set.extradata, port->format.extradata,
+ port->format.extradata_size);
+
+ ret = send_synchronous_mmal_msg(instance, &m,
@@ -34562,9 +35650,9 @@ diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/mmal-vchiq.c linux-rpi/driv
+ kfree(instance);
+ return -ENODEV;
+}
-diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/mmal-vchiq.h linux-rpi/drivers/media/platform/bcm2835/mmal-vchiq.h
---- linux-4.1.6/drivers/media/platform/bcm2835/mmal-vchiq.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/media/platform/bcm2835/mmal-vchiq.h 2015-08-26 10:26:08.025306213 +0200
+diff -Nur linux-4.1.10/drivers/media/platform/bcm2835/mmal-vchiq.h linux-rpi/drivers/media/platform/bcm2835/mmal-vchiq.h
+--- linux-4.1.10/drivers/media/platform/bcm2835/mmal-vchiq.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/media/platform/bcm2835/mmal-vchiq.h 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,178 @@
+/*
+ * Broadcom BM2835 V4L2 driver
@@ -34744,9 +35832,33 @@ diff -Nur linux-4.1.6/drivers/media/platform/bcm2835/mmal-vchiq.h linux-rpi/driv
+ struct mmal_buffer *buf);
+
+#endif /* MMAL_VCHIQ_H */
-diff -Nur linux-4.1.6/drivers/media/usb/dvb-usb-v2/rtl28xxu.c linux-rpi/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
---- linux-4.1.6/drivers/media/usb/dvb-usb-v2/rtl28xxu.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/media/usb/dvb-usb-v2/rtl28xxu.c 2015-08-26 10:26:08.213308826 +0200
+diff -Nur linux-4.1.10/drivers/media/platform/Kconfig linux-rpi/drivers/media/platform/Kconfig
+--- linux-4.1.10/drivers/media/platform/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/media/platform/Kconfig 2015-10-07 16:40:46.000000000 +0200
+@@ -11,6 +11,8 @@
+
+ if V4L_PLATFORM_DRIVERS
+
++source "drivers/media/platform/bcm2835/Kconfig"
++
+ source "drivers/media/platform/marvell-ccic/Kconfig"
+
+ config VIDEO_VIA_CAMERA
+diff -Nur linux-4.1.10/drivers/media/platform/Makefile linux-rpi/drivers/media/platform/Makefile
+--- linux-4.1.10/drivers/media/platform/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/media/platform/Makefile 2015-10-07 16:40:46.000000000 +0200
+@@ -2,6 +2,8 @@
+ # Makefile for the video capture/playback device drivers.
+ #
+
++obj-$(CONFIG_VIDEO_BCM2835) += bcm2835/
++
+ obj-$(CONFIG_VIDEO_TIMBERDALE) += timblogiw.o
+ obj-$(CONFIG_VIDEO_M32R_AR_M64278) += arv.o
+
+diff -Nur linux-4.1.10/drivers/media/usb/dvb-usb-v2/rtl28xxu.c linux-rpi/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
+--- linux-4.1.10/drivers/media/usb/dvb-usb-v2/rtl28xxu.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/media/usb/dvb-usb-v2/rtl28xxu.c 2015-10-07 16:40:46.000000000 +0200
@@ -1744,6 +1744,10 @@
&rtl28xxu_props, "Compro VideoMate U620F", NULL) },
{ DVB_USB_DEVICE(USB_VID_KWORLD_2, 0xd394,
@@ -34758,9 +35870,9 @@ diff -Nur linux-4.1.6/drivers/media/usb/dvb-usb-v2/rtl28xxu.c linux-rpi/drivers/
{ DVB_USB_DEVICE(USB_VID_LEADTEK, 0x6a03,
&rtl28xxu_props, "Leadtek WinFast DTV Dongle mini", NULL) },
{ DVB_USB_DEVICE(USB_VID_GTEK, USB_PID_CPYTO_REDI_PC50A,
-diff -Nur linux-4.1.6/drivers/mfd/Kconfig linux-rpi/drivers/mfd/Kconfig
---- linux-4.1.6/drivers/mfd/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/mfd/Kconfig 2015-08-26 10:26:08.269309603 +0200
+diff -Nur linux-4.1.10/drivers/mfd/Kconfig linux-rpi/drivers/mfd/Kconfig
+--- linux-4.1.10/drivers/mfd/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/mfd/Kconfig 2015-10-07 16:40:46.000000000 +0200
@@ -10,6 +10,14 @@
select IRQ_DOMAIN
default n
@@ -34776,18 +35888,18 @@ diff -Nur linux-4.1.6/drivers/mfd/Kconfig linux-rpi/drivers/mfd/Kconfig
config MFD_CS5535
tristate "AMD CS5535 and CS5536 southbridge core functions"
select MFD_CORE
-diff -Nur linux-4.1.6/drivers/mfd/Makefile linux-rpi/drivers/mfd/Makefile
---- linux-4.1.6/drivers/mfd/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/mfd/Makefile 2015-08-26 10:26:08.269309603 +0200
+diff -Nur linux-4.1.10/drivers/mfd/Makefile linux-rpi/drivers/mfd/Makefile
+--- linux-4.1.10/drivers/mfd/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/mfd/Makefile 2015-10-07 16:40:46.000000000 +0200
@@ -185,3 +185,5 @@
intel-soc-pmic-objs := intel_soc_pmic_core.o intel_soc_pmic_crc.o
obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o
obj-$(CONFIG_MFD_MT6397) += mt6397-core.o
+
+obj-$(CONFIG_MFD_RPISENSE_CORE) += rpisense-core.o
-diff -Nur linux-4.1.6/drivers/mfd/rpisense-core.c linux-rpi/drivers/mfd/rpisense-core.c
---- linux-4.1.6/drivers/mfd/rpisense-core.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/mfd/rpisense-core.c 2015-08-26 10:26:08.277309715 +0200
+diff -Nur linux-4.1.10/drivers/mfd/rpisense-core.c linux-rpi/drivers/mfd/rpisense-core.c
+--- linux-4.1.10/drivers/mfd/rpisense-core.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/mfd/rpisense-core.c 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,157 @@
+/*
+ * Raspberry Pi Sense HAT core driver
@@ -34946,10 +36058,1014 @@ diff -Nur linux-4.1.6/drivers/mfd/rpisense-core.c linux-rpi/drivers/mfd/rpisense
+MODULE_AUTHOR("Serge Schneider <serge@raspberrypi.org>");
+MODULE_LICENSE("GPL");
+
-diff -Nur linux-4.1.6/drivers/misc/Kconfig linux-rpi/drivers/misc/Kconfig
---- linux-4.1.6/drivers/misc/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/misc/Kconfig 2015-08-26 10:26:08.285309826 +0200
-@@ -524,6 +524,7 @@
+diff -Nur linux-4.1.10/drivers/misc/bcm2835_smi.c linux-rpi/drivers/misc/bcm2835_smi.c
+--- linux-4.1.10/drivers/misc/bcm2835_smi.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/bcm2835_smi.c 2015-10-07 16:40:46.000000000 +0200
+@@ -0,0 +1,985 @@
++/**
++ * Broadcom Secondary Memory Interface driver
++ *
++ * Written by Luke Wren <luke@raspberrypi.org>
++ * Copyright (c) 2015, Raspberry Pi (Trading) Ltd.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions, and the following disclaimer,
++ * without modification.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The names of the above-listed copyright holders may not be used
++ * to endorse or promote products derived from this software without
++ * specific prior written permission.
++ *
++ * ALTERNATIVELY, this software may be distributed under the terms of the
++ * GNU General Public License ("GPL") version 2, as published by the Free
++ * Software Foundation.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/of.h>
++#include <linux/platform_device.h>
++#include <linux/of_address.h>
++#include <linux/of_platform.h>
++#include <linux/mm.h>
++#include <linux/slab.h>
++#include <linux/pagemap.h>
++#include <linux/dma-mapping.h>
++#include <linux/dmaengine.h>
++#include <linux/semaphore.h>
++#include <linux/spinlock.h>
++#include <linux/io.h>
++
++#define BCM2835_SMI_IMPLEMENTATION
++#include <linux/broadcom/bcm2835_smi.h>
++
++#define DRIVER_NAME "smi-bcm2835"
++
++#define N_PAGES_FROM_BYTES(n) ((n + PAGE_SIZE-1) / PAGE_SIZE)
++
++#define DMA_WRITE_TO_MEM true
++#define DMA_READ_FROM_MEM false
++
++struct bcm2835_smi_instance {
++ struct device *dev;
++ struct smi_settings settings;
++ __iomem void *smi_regs_ptr, *cm_smi_regs_ptr;
++ dma_addr_t smi_regs_busaddr;
++
++ struct dma_chan *dma_chan;
++ struct dma_slave_config dma_config;
++
++ struct bcm2835_smi_bounce_info bounce;
++
++ struct scatterlist buffer_sgl;
++
++ int clock_source;
++ int clock_divisor;
++
++ /* Sometimes we are called into in an atomic context (e.g. by
++ JFFS2 + MTD) so we can't use a mutex */
++ spinlock_t transaction_lock;
++};
++
++/****************************************************************************
++*
++* SMI clock manager setup
++*
++***************************************************************************/
++
++static inline void write_smi_cm_reg(struct bcm2835_smi_instance *inst,
++ u32 val, unsigned reg)
++{
++ writel(CM_PWD | val, inst->cm_smi_regs_ptr + reg);
++}
++
++static inline u32 read_smi_cm_reg(struct bcm2835_smi_instance *inst,
++ unsigned reg)
++{
++ return readl(inst->cm_smi_regs_ptr + reg);
++}
++
++static void smi_setup_clock(struct bcm2835_smi_instance *inst)
++{
++ dev_dbg(inst->dev, "Setting up clock...");
++ /* Disable SMI clock and wait for it to stop. */
++ write_smi_cm_reg(inst, 0, CM_SMI_CTL);
++ while (read_smi_cm_reg(inst, CM_SMI_CTL) & CM_SMI_CTL_BUSY)
++ ;
++
++ write_smi_cm_reg(inst, (inst->clock_divisor << CM_SMI_DIV_DIVI_OFFS),
++ CM_SMI_DIV);
++ write_smi_cm_reg(inst, (inst->clock_source << CM_SMI_CTL_SRC_OFFS),
++ CM_SMI_CTL);
++
++ /* Enable the clock */
++ write_smi_cm_reg(inst, (inst->clock_source << CM_SMI_CTL_SRC_OFFS) |
++ CM_SMI_CTL_ENAB, CM_SMI_CTL);
++}
++
++/****************************************************************************
++*
++* SMI peripheral setup
++*
++***************************************************************************/
++
++static inline void write_smi_reg(struct bcm2835_smi_instance *inst,
++ u32 val, unsigned reg)
++{
++ writel(val, inst->smi_regs_ptr + reg);
++}
++
++static inline u32 read_smi_reg(struct bcm2835_smi_instance *inst, unsigned reg)
++{
++ return readl(inst->smi_regs_ptr + reg);
++}
++
++/* Token-paste macro for e.g SMIDSR_RSTROBE -> value of SMIDSR_RSTROBE_MASK */
++#define _CONCAT(x, y) x##y
++#define CONCAT(x, y) _CONCAT(x, y)
++
++#define SET_BIT_FIELD(dest, field, bits) ((dest) = \
++ ((dest) & ~CONCAT(field, _MASK)) | (((bits) << CONCAT(field, _OFFS))& \
++ CONCAT(field, _MASK)))
++#define GET_BIT_FIELD(src, field) (((src) & \
++ CONCAT(field, _MASK)) >> CONCAT(field, _OFFS))
++
++static void smi_dump_context_labelled(struct bcm2835_smi_instance *inst,
++ const char *label)
++{
++ dev_err(inst->dev, "SMI context dump: %s", label);
++ dev_err(inst->dev, "SMICS: 0x%08x", read_smi_reg(inst, SMICS));
++ dev_err(inst->dev, "SMIL: 0x%08x", read_smi_reg(inst, SMIL));
++ dev_err(inst->dev, "SMIDSR: 0x%08x", read_smi_reg(inst, SMIDSR0));
++ dev_err(inst->dev, "SMIDSW: 0x%08x", read_smi_reg(inst, SMIDSW0));
++ dev_err(inst->dev, "SMIDC: 0x%08x", read_smi_reg(inst, SMIDC));
++ dev_err(inst->dev, "SMIFD: 0x%08x", read_smi_reg(inst, SMIFD));
++ dev_err(inst->dev, " ");
++}
++
++static inline void smi_dump_context(struct bcm2835_smi_instance *inst)
++{
++ smi_dump_context_labelled(inst, "");
++}
++
++static void smi_get_default_settings(struct bcm2835_smi_instance *inst)
++{
++ struct smi_settings *settings = &inst->settings;
++
++ settings->data_width = SMI_WIDTH_16BIT;
++ settings->pack_data = true;
++
++ settings->read_setup_time = 1;
++ settings->read_hold_time = 1;
++ settings->read_pace_time = 1;
++ settings->read_strobe_time = 3;
++
++ settings->write_setup_time = settings->read_setup_time;
++ settings->write_hold_time = settings->read_hold_time;
++ settings->write_pace_time = settings->read_pace_time;
++ settings->write_strobe_time = settings->read_strobe_time;
++
++ settings->dma_enable = true;
++ settings->dma_passthrough_enable = false;
++ settings->dma_read_thresh = 0x01;
++ settings->dma_write_thresh = 0x3f;
++ settings->dma_panic_read_thresh = 0x20;
++ settings->dma_panic_write_thresh = 0x20;
++}
++
++void bcm2835_smi_set_regs_from_settings(struct bcm2835_smi_instance *inst)
++{
++ struct smi_settings *settings = &inst->settings;
++ int smidsr_temp = 0, smidsw_temp = 0, smics_temp,
++ smidcs_temp, smidc_temp = 0;
++
++ spin_lock(&inst->transaction_lock);
++
++ /* temporarily disable the peripheral: */
++ smics_temp = read_smi_reg(inst, SMICS);
++ write_smi_reg(inst, 0, SMICS);
++ smidcs_temp = read_smi_reg(inst, SMIDCS);
++ write_smi_reg(inst, 0, SMIDCS);
++
++ if (settings->pack_data)
++ smics_temp |= SMICS_PXLDAT;
++ else
++ smics_temp &= ~SMICS_PXLDAT;
++
++ SET_BIT_FIELD(smidsr_temp, SMIDSR_RWIDTH, settings->data_width);
++ SET_BIT_FIELD(smidsr_temp, SMIDSR_RSETUP, settings->read_setup_time);
++ SET_BIT_FIELD(smidsr_temp, SMIDSR_RHOLD, settings->read_hold_time);
++ SET_BIT_FIELD(smidsr_temp, SMIDSR_RPACE, settings->read_pace_time);
++ SET_BIT_FIELD(smidsr_temp, SMIDSR_RSTROBE, settings->read_strobe_time);
++ write_smi_reg(inst, smidsr_temp, SMIDSR0);
++
++ SET_BIT_FIELD(smidsw_temp, SMIDSW_WWIDTH, settings->data_width);
++ if (settings->data_width == SMI_WIDTH_8BIT)
++ smidsw_temp |= SMIDSW_WSWAP;
++ else
++ smidsw_temp &= ~SMIDSW_WSWAP;
++ SET_BIT_FIELD(smidsw_temp, SMIDSW_WSETUP, settings->write_setup_time);
++ SET_BIT_FIELD(smidsw_temp, SMIDSW_WHOLD, settings->write_hold_time);
++ SET_BIT_FIELD(smidsw_temp, SMIDSW_WPACE, settings->write_pace_time);
++ SET_BIT_FIELD(smidsw_temp, SMIDSW_WSTROBE,
++ settings->write_strobe_time);
++ write_smi_reg(inst, smidsw_temp, SMIDSW0);
++
++ SET_BIT_FIELD(smidc_temp, SMIDC_REQR, settings->dma_read_thresh);
++ SET_BIT_FIELD(smidc_temp, SMIDC_REQW, settings->dma_write_thresh);
++ SET_BIT_FIELD(smidc_temp, SMIDC_PANICR,
++ settings->dma_panic_read_thresh);
++ SET_BIT_FIELD(smidc_temp, SMIDC_PANICW,
++ settings->dma_panic_write_thresh);
++ if (settings->dma_passthrough_enable) {
++ smidc_temp |= SMIDC_DMAP;
++ smidsr_temp |= SMIDSR_RDREQ;
++ write_smi_reg(inst, smidsr_temp, SMIDSR0);
++ smidsw_temp |= SMIDSW_WDREQ;
++ write_smi_reg(inst, smidsw_temp, SMIDSW0);
++ } else
++ smidc_temp &= ~SMIDC_DMAP;
++ if (settings->dma_enable)
++ smidc_temp |= SMIDC_DMAEN;
++ else
++ smidc_temp &= ~SMIDC_DMAEN;
++
++ write_smi_reg(inst, smidc_temp, SMIDC);
++
++ /* re-enable (if was previously enabled) */
++ write_smi_reg(inst, smics_temp, SMICS);
++ write_smi_reg(inst, smidcs_temp, SMIDCS);
++
++ spin_unlock(&inst->transaction_lock);
++}
++EXPORT_SYMBOL(bcm2835_smi_set_regs_from_settings);
++
++struct smi_settings *bcm2835_smi_get_settings_from_regs
++ (struct bcm2835_smi_instance *inst)
++{
++ struct smi_settings *settings = &inst->settings;
++ int smidsr, smidsw, smidc;
++
++ spin_lock(&inst->transaction_lock);
++
++ smidsr = read_smi_reg(inst, SMIDSR0);
++ smidsw = read_smi_reg(inst, SMIDSW0);
++ smidc = read_smi_reg(inst, SMIDC);
++
++ settings->pack_data = (read_smi_reg(inst, SMICS) & SMICS_PXLDAT) ?
++ true : false;
++
++ settings->data_width = GET_BIT_FIELD(smidsr, SMIDSR_RWIDTH);
++ settings->read_setup_time = GET_BIT_FIELD(smidsr, SMIDSR_RSETUP);
++ settings->read_hold_time = GET_BIT_FIELD(smidsr, SMIDSR_RHOLD);
++ settings->read_pace_time = GET_BIT_FIELD(smidsr, SMIDSR_RPACE);
++ settings->read_strobe_time = GET_BIT_FIELD(smidsr, SMIDSR_RSTROBE);
++
++ settings->write_setup_time = GET_BIT_FIELD(smidsw, SMIDSW_WSETUP);
++ settings->write_hold_time = GET_BIT_FIELD(smidsw, SMIDSW_WHOLD);
++ settings->write_pace_time = GET_BIT_FIELD(smidsw, SMIDSW_WPACE);
++ settings->write_strobe_time = GET_BIT_FIELD(smidsw, SMIDSW_WSTROBE);
++
++ settings->dma_read_thresh = GET_BIT_FIELD(smidc, SMIDC_REQR);
++ settings->dma_write_thresh = GET_BIT_FIELD(smidc, SMIDC_REQW);
++ settings->dma_panic_read_thresh = GET_BIT_FIELD(smidc, SMIDC_PANICR);
++ settings->dma_panic_write_thresh = GET_BIT_FIELD(smidc, SMIDC_PANICW);
++ settings->dma_passthrough_enable = (smidc & SMIDC_DMAP) ? true : false;
++ settings->dma_enable = (smidc & SMIDC_DMAEN) ? true : false;
++
++ spin_unlock(&inst->transaction_lock);
++
++ return settings;
++}
++EXPORT_SYMBOL(bcm2835_smi_get_settings_from_regs);
++
++static inline void smi_set_address(struct bcm2835_smi_instance *inst,
++ unsigned int address)
++{
++ int smia_temp = 0, smida_temp = 0;
++
++ SET_BIT_FIELD(smia_temp, SMIA_ADDR, address);
++ SET_BIT_FIELD(smida_temp, SMIDA_ADDR, address);
++
++ /* Write to both address registers - user doesn't care whether we're
++ doing programmed or direct transfers. */
++ write_smi_reg(inst, smia_temp, SMIA);
++ write_smi_reg(inst, smida_temp, SMIDA);
++}
++
++static void smi_setup_regs(struct bcm2835_smi_instance *inst)
++{
++
++ dev_dbg(inst->dev, "Initialising SMI registers...");
++ /* Disable the peripheral if already enabled */
++ write_smi_reg(inst, 0, SMICS);
++ write_smi_reg(inst, 0, SMIDCS);
++
++ smi_get_default_settings(inst);
++ bcm2835_smi_set_regs_from_settings(inst);
++ smi_set_address(inst, 0);
++
++ write_smi_reg(inst, read_smi_reg(inst, SMICS) | SMICS_ENABLE, SMICS);
++ write_smi_reg(inst, read_smi_reg(inst, SMIDCS) | SMIDCS_ENABLE,
++ SMIDCS);
++}
++
++/****************************************************************************
++*
++* Low-level SMI access functions
++* Other modules should use the exported higher-level functions e.g.
++* bcm2835_smi_write_buf() unless they have a good reason to use these
++*
++***************************************************************************/
++
++static inline uint32_t smi_read_single_word(struct bcm2835_smi_instance *inst)
++{
++ int timeout = 0;
++
++ write_smi_reg(inst, SMIDCS_ENABLE, SMIDCS);
++ write_smi_reg(inst, SMIDCS_ENABLE | SMIDCS_START, SMIDCS);
++ /* Make sure things happen in the right order...*/
++ mb();
++ while (!(read_smi_reg(inst, SMIDCS) & SMIDCS_DONE) &&
++ ++timeout < 10000)
++ ;
++ if (timeout < 10000)
++ return read_smi_reg(inst, SMIDD);
++
++ dev_err(inst->dev,
++ "SMI direct read timed out (is the clock set up correctly?)");
++ return 0;
++}
++
++static inline void smi_write_single_word(struct bcm2835_smi_instance *inst,
++ uint32_t data)
++{
++ int timeout = 0;
++
++ write_smi_reg(inst, SMIDCS_ENABLE | SMIDCS_WRITE, SMIDCS);
++ write_smi_reg(inst, data, SMIDD);
++ write_smi_reg(inst, SMIDCS_ENABLE | SMIDCS_WRITE | SMIDCS_START,
++ SMIDCS);
++
++ while (!(read_smi_reg(inst, SMIDCS) & SMIDCS_DONE) &&
++ ++timeout < 10000)
++ ;
++ if (timeout >= 10000)
++ dev_err(inst->dev,
++ "SMI direct write timed out (is the clock set up correctly?)");
++}
++
++/* Initiates a programmed read into the read FIFO. It is up to the caller to
++ * read data from the FIFO - either via paced DMA transfer,
++ * or polling SMICS_RXD to check whether data is available.
++ * SMICS_ACTIVE will go low upon completion. */
++static void smi_init_programmed_read(struct bcm2835_smi_instance *inst,
++ int num_transfers)
++{
++ int smics_temp;
++
++ /* Disable the peripheral: */
++ smics_temp = read_smi_reg(inst, SMICS) & ~(SMICS_ENABLE | SMICS_WRITE);
++ write_smi_reg(inst, smics_temp, SMICS);
++ while (read_smi_reg(inst, SMICS) & SMICS_ENABLE)
++ ;
++
++ /* Program the transfer count: */
++ write_smi_reg(inst, num_transfers, SMIL);
++
++ /* re-enable and start: */
++ smics_temp |= SMICS_ENABLE;
++ write_smi_reg(inst, smics_temp, SMICS);
++ smics_temp |= SMICS_CLEAR;
++ /* Just to be certain: */
++ mb();
++ while (read_smi_reg(inst, SMICS) & SMICS_ACTIVE)
++ ;
++ write_smi_reg(inst, smics_temp, SMICS);
++ smics_temp |= SMICS_START;
++ write_smi_reg(inst, smics_temp, SMICS);
++}
++
++/* Initiates a programmed write sequence, using data from the write FIFO.
++ * It is up to the caller to initiate a DMA transfer before calling,
++ * or use another method to keep the write FIFO topped up.
++ * SMICS_ACTIVE will go low upon completion.
++ */
++static void smi_init_programmed_write(struct bcm2835_smi_instance *inst,
++ int num_transfers)
++{
++ int smics_temp;
++
++ /* Disable the peripheral: */
++ smics_temp = read_smi_reg(inst, SMICS) & ~SMICS_ENABLE;
++ write_smi_reg(inst, smics_temp, SMICS);
++ while (read_smi_reg(inst, SMICS) & SMICS_ENABLE)
++ ;
++
++ /* Program the transfer count: */
++ write_smi_reg(inst, num_transfers, SMIL);
++
++ /* setup, re-enable and start: */
++ smics_temp |= SMICS_WRITE | SMICS_ENABLE;
++ write_smi_reg(inst, smics_temp, SMICS);
++ smics_temp |= SMICS_START;
++ write_smi_reg(inst, smics_temp, SMICS);
++}
++
++/* Initiate a read and then poll FIFO for data, reading out as it appears. */
++static void smi_read_fifo(struct bcm2835_smi_instance *inst,
++ uint32_t *dest, int n_bytes)
++{
++ if (read_smi_reg(inst, SMICS) & SMICS_RXD) {
++ smi_dump_context_labelled(inst,
++ "WARNING: read FIFO not empty at start of read call.");
++ while (read_smi_reg(inst, SMICS))
++ ;
++ }
++
++ /* Dispatch the read: */
++ if (inst->settings.data_width == SMI_WIDTH_8BIT)
++ smi_init_programmed_read(inst, n_bytes);
++ else if (inst->settings.data_width == SMI_WIDTH_16BIT)
++ smi_init_programmed_read(inst, n_bytes / 2);
++ else {
++ dev_err(inst->dev, "Unsupported data width for read.");
++ return;
++ }
++
++ /* Poll FIFO to keep it empty */
++ while (!(read_smi_reg(inst, SMICS) & SMICS_DONE))
++ if (read_smi_reg(inst, SMICS) & SMICS_RXD)
++ *dest++ = read_smi_reg(inst, SMID);
++
++ /* Ensure that the FIFO is emptied */
++ if (read_smi_reg(inst, SMICS) & SMICS_RXD) {
++ int fifo_count;
++
++ fifo_count = GET_BIT_FIELD(read_smi_reg(inst, SMIFD),
++ SMIFD_FCNT);
++ while (fifo_count--)
++ *dest++ = read_smi_reg(inst, SMID);
++ }
++
++ if (!(read_smi_reg(inst, SMICS) & SMICS_DONE))
++ smi_dump_context_labelled(inst,
++ "WARNING: transaction finished but done bit not set.");
++
++ if (read_smi_reg(inst, SMICS) & SMICS_RXD)
++ smi_dump_context_labelled(inst,
++ "WARNING: read FIFO not empty at end of read call.");
++
++}
++
++/* Initiate a write, and then keep the FIFO topped up. */
++static void smi_write_fifo(struct bcm2835_smi_instance *inst,
++ uint32_t *src, int n_bytes)
++{
++ int i, timeout = 0;
++
++ /* Empty FIFOs if not already so */
++ if (!(read_smi_reg(inst, SMICS) & SMICS_TXE)) {
++ smi_dump_context_labelled(inst,
++ "WARNING: write fifo not empty at start of write call.");
++ write_smi_reg(inst, read_smi_reg(inst, SMICS) | SMICS_CLEAR,
++ SMICS);
++ }
++
++ /* Initiate the transfer */
++ if (inst->settings.data_width == SMI_WIDTH_8BIT)
++ smi_init_programmed_write(inst, n_bytes);
++ else if (inst->settings.data_width == SMI_WIDTH_16BIT)
++ smi_init_programmed_write(inst, n_bytes / 2);
++ else {
++ dev_err(inst->dev, "Unsupported data width for write.");
++ return;
++ }
++ /* Fill the FIFO: */
++ for (i = 0; i < (n_bytes - 1) / 4 + 1; ++i) {
++ while (!(read_smi_reg(inst, SMICS) & SMICS_TXD))
++ ;
++ write_smi_reg(inst, *src++, SMID);
++ }
++ /* Busy wait... */
++ while (!(read_smi_reg(inst, SMICS) & SMICS_DONE) && ++timeout <
++ 1000000)
++ ;
++ if (timeout >= 1000000)
++ smi_dump_context_labelled(inst,
++ "Timed out on write operation!");
++ if (!(read_smi_reg(inst, SMICS) & SMICS_TXE))
++ smi_dump_context_labelled(inst,
++ "WARNING: FIFO not empty at end of write operation.");
++}
++
++/****************************************************************************
++*
++* SMI DMA operations
++*
++***************************************************************************/
++
++/* Disable SMI and put it into the correct direction before doing DMA setup.
++ Stops spurious DREQs during setup. Peripheral is re-enabled by init_*() */
++static void smi_disable(struct bcm2835_smi_instance *inst,
++ enum dma_transfer_direction direction)
++{
++ int smics_temp = read_smi_reg(inst, SMICS) & ~SMICS_ENABLE;
++
++ if (direction == DMA_DEV_TO_MEM)
++ smics_temp &= ~SMICS_WRITE;
++ else
++ smics_temp |= SMICS_WRITE;
++ write_smi_reg(inst, smics_temp, SMICS);
++ while (read_smi_reg(inst, SMICS) & SMICS_ACTIVE)
++ ;
++}
++
++static struct scatterlist *smi_scatterlist_from_buffer(
++ struct bcm2835_smi_instance *inst,
++ dma_addr_t buf,
++ size_t len,
++ struct scatterlist *sg)
++{
++ sg_init_table(sg, 1);
++ sg_dma_address(sg) = buf;
++ sg_dma_len(sg) = len;
++ return sg;
++}
++
++static void smi_dma_callback_user_copy(void *param)
++{
++ /* Notify the bottom half that a chunk is ready for user copy */
++ struct bcm2835_smi_instance *inst =
++ (struct bcm2835_smi_instance *)param;
++
++ up(&inst->bounce.callback_sem);
++}
++
++/* Creates a descriptor, assigns the given callback, and submits the
++ descriptor to dmaengine. Does not block - can queue up multiple
++ descriptors and then wait for them all to complete.
++ sg_len is the number of control blocks, NOT the number of bytes.
++ dir can be DMA_MEM_TO_DEV or DMA_DEV_TO_MEM.
++ callback can be NULL - in this case it is not called. */
++static inline struct dma_async_tx_descriptor *smi_dma_submit_sgl(
++ struct bcm2835_smi_instance *inst,
++ struct scatterlist *sgl,
++ size_t sg_len,
++ enum dma_transfer_direction dir,
++ dma_async_tx_callback callback)
++{
++ struct dma_async_tx_descriptor *desc;
++
++ desc = dmaengine_prep_slave_sg(inst->dma_chan,
++ sgl,
++ sg_len,
++ dir,
++ DMA_PREP_INTERRUPT | DMA_CTRL_ACK |
++ DMA_PREP_FENCE);
++ if (!desc) {
++ dev_err(inst->dev, "read_sgl: dma slave preparation failed!");
++ write_smi_reg(inst, read_smi_reg(inst, SMICS) & ~SMICS_ACTIVE,
++ SMICS);
++ while (read_smi_reg(inst, SMICS) & SMICS_ACTIVE)
++ cpu_relax();
++ write_smi_reg(inst, read_smi_reg(inst, SMICS) | SMICS_ACTIVE,
++ SMICS);
++ return NULL;
++ }
++ desc->callback = callback;
++ desc->callback_param = inst;
++ if (dmaengine_submit(desc) < 0)
++ return NULL;
++ return desc;
++}
++
++/* NB this function blocks until the transfer is complete */
++static void
++smi_dma_read_sgl(struct bcm2835_smi_instance *inst,
++ struct scatterlist *sgl, size_t sg_len, size_t n_bytes)
++{
++ struct dma_async_tx_descriptor *desc;
++
++ /* Disable SMI and set to read before dispatching DMA - if SMI is in
++ * write mode and TX fifo is empty, it will generate a DREQ which may
++ * cause the read DMA to complete before the SMI read command is even
++ * dispatched! We want to dispatch DMA before SMI read so that reading
++ * is gapless, for logic analyser.
++ */
++
++ smi_disable(inst, DMA_DEV_TO_MEM);
++
++ desc = smi_dma_submit_sgl(inst, sgl, sg_len, DMA_DEV_TO_MEM, NULL);
++ dma_async_issue_pending(inst->dma_chan);
++
++ if (inst->settings.data_width == SMI_WIDTH_8BIT)
++ smi_init_programmed_read(inst, n_bytes);
++ else
++ smi_init_programmed_read(inst, n_bytes / 2);
++
++ if (dma_wait_for_async_tx(desc) == DMA_ERROR)
++ smi_dump_context_labelled(inst, "DMA timeout!");
++}
++
++static void
++smi_dma_write_sgl(struct bcm2835_smi_instance *inst,
++ struct scatterlist *sgl, size_t sg_len, size_t n_bytes)
++{
++ struct dma_async_tx_descriptor *desc;
++
++ if (inst->settings.data_width == SMI_WIDTH_8BIT)
++ smi_init_programmed_write(inst, n_bytes);
++ else
++ smi_init_programmed_write(inst, n_bytes / 2);
++
++ desc = smi_dma_submit_sgl(inst, sgl, sg_len, DMA_MEM_TO_DEV, NULL);
++ dma_async_issue_pending(inst->dma_chan);
++
++ if (dma_wait_for_async_tx(desc) == DMA_ERROR)
++ smi_dump_context_labelled(inst, "DMA timeout!");
++ else
++ /* Wait for SMI to finish our writes */
++ while (!(read_smi_reg(inst, SMICS) & SMICS_DONE))
++ cpu_relax();
++}
++
++ssize_t bcm2835_smi_user_dma(
++ struct bcm2835_smi_instance *inst,
++ enum dma_transfer_direction dma_dir,
++ char __user *user_ptr, size_t count,
++ struct bcm2835_smi_bounce_info **bounce)
++{
++ int chunk_no = 0, chunk_size, count_left = count;
++ struct scatterlist *sgl;
++ void (*init_trans_func)(struct bcm2835_smi_instance *, int);
++
++ spin_lock(&inst->transaction_lock);
++
++ if (dma_dir == DMA_DEV_TO_MEM)
++ init_trans_func = smi_init_programmed_read;
++ else
++ init_trans_func = smi_init_programmed_write;
++
++ smi_disable(inst, dma_dir);
++
++ sema_init(&inst->bounce.callback_sem, 0);
++ if (bounce)
++ *bounce = &inst->bounce;
++ while (count_left) {
++ chunk_size = count_left > DMA_BOUNCE_BUFFER_SIZE ?
++ DMA_BOUNCE_BUFFER_SIZE : count_left;
++ if (chunk_size == DMA_BOUNCE_BUFFER_SIZE) {
++ sgl =
++ &inst->bounce.sgl[chunk_no % DMA_BOUNCE_BUFFER_COUNT];
++ } else {
++ sgl = smi_scatterlist_from_buffer(
++ inst,
++ inst->bounce.phys[
++ chunk_no % DMA_BOUNCE_BUFFER_COUNT],
++ chunk_size,
++ &inst->buffer_sgl);
++ }
++
++ if (!smi_dma_submit_sgl(inst, sgl, 1, dma_dir,
++ smi_dma_callback_user_copy
++ )) {
++ dev_err(inst->dev, "sgl submit failed");
++ count = 0;
++ goto out;
++ }
++ count_left -= chunk_size;
++ chunk_no++;
++ }
++ dma_async_issue_pending(inst->dma_chan);
++
++ if (inst->settings.data_width == SMI_WIDTH_8BIT)
++ init_trans_func(inst, count);
++ else if (inst->settings.data_width == SMI_WIDTH_16BIT)
++ init_trans_func(inst, count / 2);
++out:
++ spin_unlock(&inst->transaction_lock);
++ return count;
++}
++EXPORT_SYMBOL(bcm2835_smi_user_dma);
++
++
++/****************************************************************************
++*
++* High level buffer transfer functions - for use by other drivers
++*
++***************************************************************************/
++
++/* Buffer must be physically contiguous - i.e. kmalloc, not vmalloc! */
++void bcm2835_smi_write_buf(
++ struct bcm2835_smi_instance *inst,
++ const void *buf, size_t n_bytes)
++{
++ int odd_bytes = n_bytes & 0x3;
++
++ n_bytes -= odd_bytes;
++
++ spin_lock(&inst->transaction_lock);
++
++ if (n_bytes > DMA_THRESHOLD_BYTES) {
++ dma_addr_t phy_addr = dma_map_single(
++ inst->dev,
++ (void *)buf,
++ n_bytes,
++ DMA_MEM_TO_DEV);
++ struct scatterlist *sgl =
++ smi_scatterlist_from_buffer(inst, phy_addr, n_bytes,
++ &inst->buffer_sgl);
++
++ if (!sgl) {
++ smi_dump_context_labelled(inst,
++ "Error: could not create scatterlist for write!");
++ goto out;
++ }
++ smi_dma_write_sgl(inst, sgl, 1, n_bytes);
++
++ dma_unmap_single
++ (inst->dev, phy_addr, n_bytes, DMA_MEM_TO_DEV);
++ } else if (n_bytes) {
++ smi_write_fifo(inst, (uint32_t *) buf, n_bytes);
++ }
++ buf += n_bytes;
++
++ if (inst->settings.data_width == SMI_WIDTH_8BIT) {
++ while (odd_bytes--)
++ smi_write_single_word(inst, *(uint8_t *) (buf++));
++ } else {
++ while (odd_bytes >= 2) {
++ smi_write_single_word(inst, *(uint16_t *)buf);
++ buf += 2;
++ odd_bytes -= 2;
++ }
++ if (odd_bytes) {
++ /* Reading an odd number of bytes on a 16 bit bus is
++ a user bug. It's kinder to fail early and tell them
++ than to e.g. transparently give them the bottom byte
++ of a 16 bit transfer. */
++ dev_err(inst->dev,
++ "WARNING: odd number of bytes specified for wide transfer.");
++ dev_err(inst->dev,
++ "At least one byte dropped as a result.");
++ dump_stack();
++ }
++ }
++out:
++ spin_unlock(&inst->transaction_lock);
++}
++EXPORT_SYMBOL(bcm2835_smi_write_buf);
++
++void bcm2835_smi_read_buf(struct bcm2835_smi_instance *inst,
++ void *buf, size_t n_bytes)
++{
++
++ /* SMI is inherently 32-bit, which causes surprising amounts of mess
++ for bytes % 4 != 0. Easiest to avoid this mess altogether
++ by handling remainder separately. */
++ int odd_bytes = n_bytes & 0x3;
++
++ spin_lock(&inst->transaction_lock);
++ n_bytes -= odd_bytes;
++ if (n_bytes > DMA_THRESHOLD_BYTES) {
++ dma_addr_t phy_addr = dma_map_single(inst->dev,
++ buf, n_bytes,
++ DMA_DEV_TO_MEM);
++ struct scatterlist *sgl = smi_scatterlist_from_buffer(
++ inst, phy_addr, n_bytes,
++ &inst->buffer_sgl);
++ if (!sgl) {
++ smi_dump_context_labelled(inst,
++ "Error: could not create scatterlist for read!");
++ goto out;
++ }
++ smi_dma_read_sgl(inst, sgl, 1, n_bytes);
++ dma_unmap_single(inst->dev, phy_addr, n_bytes, DMA_DEV_TO_MEM);
++ } else if (n_bytes) {
++ smi_read_fifo(inst, (uint32_t *)buf, n_bytes);
++ }
++ buf += n_bytes;
++
++ if (inst->settings.data_width == SMI_WIDTH_8BIT) {
++ while (odd_bytes--)
++ *((uint8_t *) (buf++)) = smi_read_single_word(inst);
++ } else {
++ while (odd_bytes >= 2) {
++ *(uint16_t *) buf = smi_read_single_word(inst);
++ buf += 2;
++ odd_bytes -= 2;
++ }
++ if (odd_bytes) {
++ dev_err(inst->dev,
++ "WARNING: odd number of bytes specified for wide transfer.");
++ dev_err(inst->dev,
++ "At least one byte dropped as a result.");
++ dump_stack();
++ }
++ }
++out:
++ spin_unlock(&inst->transaction_lock);
++}
++EXPORT_SYMBOL(bcm2835_smi_read_buf);
++
++void bcm2835_smi_set_address(struct bcm2835_smi_instance *inst,
++ unsigned int address)
++{
++ spin_lock(&inst->transaction_lock);
++ smi_set_address(inst, address);
++ spin_unlock(&inst->transaction_lock);
++}
++EXPORT_SYMBOL(bcm2835_smi_set_address);
++
++struct bcm2835_smi_instance *bcm2835_smi_get(struct device_node *node)
++{
++ struct platform_device *pdev;
++
++ if (!node)
++ return NULL;
++
++ pdev = of_find_device_by_node(node);
++ if (!pdev)
++ return NULL;
++
++ return platform_get_drvdata(pdev);
++}
++EXPORT_SYMBOL(bcm2835_smi_get);
++
++/****************************************************************************
++*
++* bcm2835_smi_probe - called when the driver is loaded.
++*
++***************************************************************************/
++
++static int bcm2835_smi_dma_setup(struct bcm2835_smi_instance *inst)
++{
++ int i, rv = 0;
++
++ inst->dma_chan = dma_request_slave_channel(inst->dev, "rx-tx");
++
++ inst->dma_config.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
++ inst->dma_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
++ inst->dma_config.src_addr = inst->smi_regs_busaddr + SMID;
++ inst->dma_config.dst_addr = inst->dma_config.src_addr;
++ /* Direction unimportant - always overridden by prep_slave_sg */
++ inst->dma_config.direction = DMA_DEV_TO_MEM;
++ dmaengine_slave_config(inst->dma_chan, &inst->dma_config);
++ /* Alloc and map bounce buffers */
++ for (i = 0; i < DMA_BOUNCE_BUFFER_COUNT; ++i) {
++ inst->bounce.buffer[i] =
++ dmam_alloc_coherent(inst->dev, DMA_BOUNCE_BUFFER_SIZE,
++ &inst->bounce.phys[i],
++ GFP_KERNEL);
++ if (!inst->bounce.buffer[i]) {
++ dev_err(inst->dev, "Could not allocate buffer!");
++ rv = -ENOMEM;
++ break;
++ }
++ smi_scatterlist_from_buffer(
++ inst,
++ inst->bounce.phys[i],
++ DMA_BOUNCE_BUFFER_SIZE,
++ &inst->bounce.sgl[i]
++ );
++ }
++
++ return rv;
++}
++
++static int bcm2835_smi_probe(struct platform_device *pdev)
++{
++ int err;
++ struct device *dev = &pdev->dev;
++ struct device_node *node = dev->of_node;
++ struct resource *ioresource;
++ struct bcm2835_smi_instance *inst;
++
++ /* Allocate buffers and instance data */
++
++ inst = devm_kzalloc(dev, sizeof(struct bcm2835_smi_instance),
++ GFP_KERNEL);
++
++ if (!inst)
++ return -ENOMEM;
++
++ inst->dev = dev;
++ spin_lock_init(&inst->transaction_lock);
++
++ /* We require device tree support */
++ if (!node)
++ return -EINVAL;
++
++ ioresource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++ inst->smi_regs_ptr = devm_ioremap_resource(dev, ioresource);
++ ioresource = platform_get_resource(pdev, IORESOURCE_MEM, 1);
++ inst->cm_smi_regs_ptr = devm_ioremap_resource(dev, ioresource);
++ inst->smi_regs_busaddr = be32_to_cpu(
++ *of_get_address(node, 0, NULL, NULL));
++ of_property_read_u32(node,
++ "brcm,smi-clock-source",
++ &inst->clock_source);
++ of_property_read_u32(node,
++ "brcm,smi-clock-divisor",
++ &inst->clock_divisor);
++
++ err = bcm2835_smi_dma_setup(inst);
++ if (err)
++ return err;
++
++ /* Finally, do peripheral setup */
++
++ smi_setup_clock(inst);
++ smi_setup_regs(inst);
++
++ platform_set_drvdata(pdev, inst);
++
++ dev_info(inst->dev, "initialised");
++
++ return 0;
++}
++
++/****************************************************************************
++*
++* bcm2835_smi_remove - called when the driver is unloaded.
++*
++***************************************************************************/
++
++static int bcm2835_smi_remove(struct platform_device *pdev)
++{
++ struct bcm2835_smi_instance *inst = platform_get_drvdata(pdev);
++ struct device *dev = inst->dev;
++
++ dev_info(dev, "SMI device removed - OK");
++ return 0;
++}
++
++/****************************************************************************
++*
++* Register the driver with device tree
++*
++***************************************************************************/
++
++static const struct of_device_id bcm2835_smi_of_match[] = {
++ {.compatible = "brcm,bcm2835-smi",},
++ { /* sentinel */ },
++};
++
++MODULE_DEVICE_TABLE(of, bcm2835_smi_of_match);
++
++static struct platform_driver bcm2835_smi_driver = {
++ .probe = bcm2835_smi_probe,
++ .remove = bcm2835_smi_remove,
++ .driver = {
++ .name = DRIVER_NAME,
++ .owner = THIS_MODULE,
++ .of_match_table = bcm2835_smi_of_match,
++ },
++};
++
++module_platform_driver(bcm2835_smi_driver);
++
++MODULE_ALIAS("platform:smi-bcm2835");
++MODULE_LICENSE("GPL");
++MODULE_DESCRIPTION("Device driver for BCM2835's secondary memory interface");
++MODULE_AUTHOR("Luke Wren <luke@raspberrypi.org>");
+diff -Nur linux-4.1.10/drivers/misc/Kconfig linux-rpi/drivers/misc/Kconfig
+--- linux-4.1.10/drivers/misc/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/misc/Kconfig 2015-10-07 16:40:46.000000000 +0200
+@@ -10,6 +10,14 @@
+ select INPUT_POLLDEV
+ default n
+
++config BCM2835_SMI
++ tristate "Broadcom 283x Secondary Memory Interface driver"
++ depends on MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835
++ default m
++ help
++ Driver for enabling and using Broadcom's Secondary/Slow Memory Interface.
++ Appears as /dev/bcm2835_smi. For ioctl interface see drivers/misc/bcm2835_smi.h
++
+ config AD525X_DPOT
+ tristate "Analog Devices Digital Potentiometers"
+ depends on (I2C || SPI) && SYSFS
+@@ -524,6 +532,7 @@
source "drivers/misc/altera-stapl/Kconfig"
source "drivers/misc/mei/Kconfig"
source "drivers/misc/vmw_vmci/Kconfig"
@@ -34957,10 +37073,18 @@ diff -Nur linux-4.1.6/drivers/misc/Kconfig linux-rpi/drivers/misc/Kconfig
source "drivers/misc/mic/Kconfig"
source "drivers/misc/genwqe/Kconfig"
source "drivers/misc/echo/Kconfig"
-diff -Nur linux-4.1.6/drivers/misc/Makefile linux-rpi/drivers/misc/Makefile
---- linux-4.1.6/drivers/misc/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/misc/Makefile 2015-08-26 10:26:08.285309826 +0200
-@@ -51,6 +51,7 @@
+diff -Nur linux-4.1.10/drivers/misc/Makefile linux-rpi/drivers/misc/Makefile
+--- linux-4.1.10/drivers/misc/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/misc/Makefile 2015-10-07 16:40:46.000000000 +0200
+@@ -9,6 +9,7 @@
+ obj-$(CONFIG_INTEL_MID_PTI) += pti.o
+ obj-$(CONFIG_ATMEL_SSC) += atmel-ssc.o
+ obj-$(CONFIG_ATMEL_TCLIB) += atmel_tclib.o
++obj-$(CONFIG_BCM2835_SMI) += bcm2835_smi.o
+ obj-$(CONFIG_BMP085) += bmp085.o
+ obj-$(CONFIG_BMP085_I2C) += bmp085-i2c.o
+ obj-$(CONFIG_BMP085_SPI) += bmp085-spi.o
+@@ -51,6 +52,7 @@
obj-$(CONFIG_VMWARE_VMCI) += vmw_vmci/
obj-$(CONFIG_LATTICE_ECP3_CONFIG) += lattice-ecp3-config.o
obj-$(CONFIG_SRAM) += sram.o
@@ -34968,40 +37092,9 @@ diff -Nur linux-4.1.6/drivers/misc/Makefile linux-rpi/drivers/misc/Makefile
obj-y += mic/
obj-$(CONFIG_GENWQE) += genwqe/
obj-$(CONFIG_ECHO) += echo/
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/Kconfig linux-rpi/drivers/misc/vc04_services/Kconfig
---- linux-4.1.6/drivers/misc/vc04_services/Kconfig 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/Kconfig 2015-08-26 10:26:08.301310049 +0200
-@@ -0,0 +1,9 @@
-+config BCM2708_VCHIQ
-+ tristate "Videocore VCHIQ"
-+ depends on RASPBERRYPI_FIRMWARE
-+ default y
-+ help
-+ Kernel to VideoCore communication interface for the
-+ BCM2708 family of products.
-+ Defaults to Y when the Broadcom Videocore services
-+ are included in the build, N otherwise.
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/Makefile linux-rpi/drivers/misc/vc04_services/Makefile
---- linux-4.1.6/drivers/misc/vc04_services/Makefile 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/Makefile 2015-08-26 10:26:08.301310049 +0200
-@@ -0,0 +1,14 @@
-+obj-$(CONFIG_BCM2708_VCHIQ) += vchiq.o
-+
-+vchiq-objs := \
-+ interface/vchiq_arm/vchiq_core.o \
-+ interface/vchiq_arm/vchiq_arm.o \
-+ interface/vchiq_arm/vchiq_kern_lib.o \
-+ interface/vchiq_arm/vchiq_2835_arm.o \
-+ interface/vchiq_arm/vchiq_debugfs.o \
-+ interface/vchiq_arm/vchiq_shim.o \
-+ interface/vchiq_arm/vchiq_util.o \
-+ interface/vchiq_arm/vchiq_connected.o \
-+
-+ccflags-y += -DVCOS_VERIFY_BKPTS=1 -Idrivers/misc/vc04_services -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000
-+
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchi/connections/connection.h linux-rpi/drivers/misc/vc04_services/interface/vchi/connections/connection.h
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchi/connections/connection.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchi/connections/connection.h 2015-08-26 10:26:08.301310049 +0200
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchi/connections/connection.h linux-rpi/drivers/misc/vc04_services/interface/vchi/connections/connection.h
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchi/connections/connection.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchi/connections/connection.h 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,328 @@
+/**
+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
@@ -35331,9 +37424,9 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchi/connections/conn
+#endif /* CONNECTION_H_ */
+
+/****************************** End of file **********************************/
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h linux-rpi/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h 2015-08-26 10:26:08.301310049 +0200
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h linux-rpi/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,204 @@
+/**
+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
@@ -35539,391 +37632,9 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchi/message_drivers/
+#endif // _VCHI_MESSAGE_H_
+
+/****************************** End of file ***********************************/
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchi/vchi.h linux-rpi/drivers/misc/vc04_services/interface/vchi/vchi.h
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchi/vchi.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchi/vchi.h 2015-08-26 10:26:08.301310049 +0200
-@@ -0,0 +1,378 @@
-+/**
-+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ * notice, this list of conditions, and the following disclaimer,
-+ * without modification.
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ * notice, this list of conditions and the following disclaimer in the
-+ * documentation and/or other materials provided with the distribution.
-+ * 3. The names of the above-listed copyright holders may not be used
-+ * to endorse or promote products derived from this software without
-+ * specific prior written permission.
-+ *
-+ * ALTERNATIVELY, this software may be distributed under the terms of the
-+ * GNU General Public License ("GPL") version 2, as published by the Free
-+ * Software Foundation.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
-+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
-+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+ */
-+
-+#ifndef VCHI_H_
-+#define VCHI_H_
-+
-+#include "interface/vchi/vchi_cfg.h"
-+#include "interface/vchi/vchi_common.h"
-+#include "interface/vchi/connections/connection.h"
-+#include "vchi_mh.h"
-+
-+
-+/******************************************************************************
-+ Global defs
-+ *****************************************************************************/
-+
-+#define VCHI_BULK_ROUND_UP(x) ((((unsigned long)(x))+VCHI_BULK_ALIGN-1) & ~(VCHI_BULK_ALIGN-1))
-+#define VCHI_BULK_ROUND_DOWN(x) (((unsigned long)(x)) & ~(VCHI_BULK_ALIGN-1))
-+#define VCHI_BULK_ALIGN_NBYTES(x) (VCHI_BULK_ALIGNED(x) ? 0 : (VCHI_BULK_ALIGN - ((unsigned long)(x) & (VCHI_BULK_ALIGN-1))))
-+
-+#ifdef USE_VCHIQ_ARM
-+#define VCHI_BULK_ALIGNED(x) 1
-+#else
-+#define VCHI_BULK_ALIGNED(x) (((unsigned long)(x) & (VCHI_BULK_ALIGN-1)) == 0)
-+#endif
-+
-+struct vchi_version {
-+ uint32_t version;
-+ uint32_t version_min;
-+};
-+#define VCHI_VERSION(v_) { v_, v_ }
-+#define VCHI_VERSION_EX(v_, m_) { v_, m_ }
-+
-+typedef enum
-+{
-+ VCHI_VEC_POINTER,
-+ VCHI_VEC_HANDLE,
-+ VCHI_VEC_LIST
-+} VCHI_MSG_VECTOR_TYPE_T;
-+
-+typedef struct vchi_msg_vector_ex {
-+
-+ VCHI_MSG_VECTOR_TYPE_T type;
-+ union
-+ {
-+ // a memory handle
-+ struct
-+ {
-+ VCHI_MEM_HANDLE_T handle;
-+ uint32_t offset;
-+ int32_t vec_len;
-+ } handle;
-+
-+ // an ordinary data pointer
-+ struct
-+ {
-+ const void *vec_base;
-+ int32_t vec_len;
-+ } ptr;
-+
-+ // a nested vector list
-+ struct
-+ {
-+ struct vchi_msg_vector_ex *vec;
-+ uint32_t vec_len;
-+ } list;
-+ } u;
-+} VCHI_MSG_VECTOR_EX_T;
-+
-+
-+// Construct an entry in a msg vector for a pointer (p) of length (l)
-+#define VCHI_VEC_POINTER(p,l) VCHI_VEC_POINTER, { { (VCHI_MEM_HANDLE_T)(p), (l) } }
-+
-+// Construct an entry in a msg vector for a message handle (h), starting at offset (o) of length (l)
-+#define VCHI_VEC_HANDLE(h,o,l) VCHI_VEC_HANDLE, { { (h), (o), (l) } }
-+
-+// Macros to manipulate 'FOURCC' values
-+#define MAKE_FOURCC(x) ((int32_t)( (x[0] << 24) | (x[1] << 16) | (x[2] << 8) | x[3] ))
-+#define FOURCC_TO_CHAR(x) (x >> 24) & 0xFF,(x >> 16) & 0xFF,(x >> 8) & 0xFF, x & 0xFF
-+
-+
-+// Opaque service information
-+struct opaque_vchi_service_t;
-+
-+// Descriptor for a held message. Allocated by client, initialised by vchi_msg_hold,
-+// vchi_msg_iter_hold or vchi_msg_iter_hold_next. Fields are for internal VCHI use only.
-+typedef struct
-+{
-+ struct opaque_vchi_service_t *service;
-+ void *message;
-+} VCHI_HELD_MSG_T;
-+
-+
-+
-+// structure used to provide the information needed to open a server or a client
-+typedef struct {
-+ struct vchi_version version;
-+ int32_t service_id;
-+ VCHI_CONNECTION_T *connection;
-+ uint32_t rx_fifo_size;
-+ uint32_t tx_fifo_size;
-+ VCHI_CALLBACK_T callback;
-+ void *callback_param;
-+ /* client intends to receive bulk transfers of
-+ odd lengths or into unaligned buffers */
-+ int32_t want_unaligned_bulk_rx;
-+ /* client intends to transmit bulk transfers of
-+ odd lengths or out of unaligned buffers */
-+ int32_t want_unaligned_bulk_tx;
-+ /* client wants to check CRCs on (bulk) xfers.
-+ Only needs to be set at 1 end - will do both directions. */
-+ int32_t want_crc;
-+} SERVICE_CREATION_T;
-+
-+// Opaque handle for a VCHI instance
-+typedef struct opaque_vchi_instance_handle_t *VCHI_INSTANCE_T;
-+
-+// Opaque handle for a server or client
-+typedef struct opaque_vchi_service_handle_t *VCHI_SERVICE_HANDLE_T;
-+
-+// Service registration & startup
-+typedef void (*VCHI_SERVICE_INIT)(VCHI_INSTANCE_T initialise_instance, VCHI_CONNECTION_T **connections, uint32_t num_connections);
-+
-+typedef struct service_info_tag {
-+ const char * const vll_filename; /* VLL to load to start this service. This is an empty string if VLL is "static" */
-+ VCHI_SERVICE_INIT init; /* Service initialisation function */
-+ void *vll_handle; /* VLL handle; NULL when unloaded or a "static VLL" in build */
-+} SERVICE_INFO_T;
-+
-+/******************************************************************************
-+ Global funcs - implementation is specific to which side you are on (local / remote)
-+ *****************************************************************************/
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+extern /*@observer@*/ VCHI_CONNECTION_T * vchi_create_connection( const VCHI_CONNECTION_API_T * function_table,
-+ const VCHI_MESSAGE_DRIVER_T * low_level);
-+
-+
-+// Routine used to initialise the vchi on both local + remote connections
-+extern int32_t vchi_initialise( VCHI_INSTANCE_T *instance_handle );
-+
-+extern int32_t vchi_exit( void );
-+
-+extern int32_t vchi_connect( VCHI_CONNECTION_T **connections,
-+ const uint32_t num_connections,
-+ VCHI_INSTANCE_T instance_handle );
-+
-+//When this is called, ensure that all services have no data pending.
-+//Bulk transfers can remain 'queued'
-+extern int32_t vchi_disconnect( VCHI_INSTANCE_T instance_handle );
-+
-+// Global control over bulk CRC checking
-+extern int32_t vchi_crc_control( VCHI_CONNECTION_T *connection,
-+ VCHI_CRC_CONTROL_T control );
-+
-+// helper functions
-+extern void * vchi_allocate_buffer(VCHI_SERVICE_HANDLE_T handle, uint32_t *length);
-+extern void vchi_free_buffer(VCHI_SERVICE_HANDLE_T handle, void *address);
-+extern uint32_t vchi_current_time(VCHI_INSTANCE_T instance_handle);
-+
-+
-+/******************************************************************************
-+ Global service API
-+ *****************************************************************************/
-+// Routine to create a named service
-+extern int32_t vchi_service_create( VCHI_INSTANCE_T instance_handle,
-+ SERVICE_CREATION_T *setup,
-+ VCHI_SERVICE_HANDLE_T *handle );
-+
-+// Routine to destory a service
-+extern int32_t vchi_service_destroy( const VCHI_SERVICE_HANDLE_T handle );
-+
-+// Routine to open a named service
-+extern int32_t vchi_service_open( VCHI_INSTANCE_T instance_handle,
-+ SERVICE_CREATION_T *setup,
-+ VCHI_SERVICE_HANDLE_T *handle);
-+
-+extern int32_t vchi_get_peer_version( const VCHI_SERVICE_HANDLE_T handle,
-+ short *peer_version );
-+
-+// Routine to close a named service
-+extern int32_t vchi_service_close( const VCHI_SERVICE_HANDLE_T handle );
-+
-+// Routine to increment ref count on a named service
-+extern int32_t vchi_service_use( const VCHI_SERVICE_HANDLE_T handle );
-+
-+// Routine to decrement ref count on a named service
-+extern int32_t vchi_service_release( const VCHI_SERVICE_HANDLE_T handle );
-+
-+// Routine to set a control option for a named service
-+extern int32_t vchi_service_set_option( const VCHI_SERVICE_HANDLE_T handle,
-+ VCHI_SERVICE_OPTION_T option,
-+ int value);
-+
-+// Routine to send a message across a service
-+extern int32_t vchi_msg_queue( VCHI_SERVICE_HANDLE_T handle,
-+ const void *data,
-+ uint32_t data_size,
-+ VCHI_FLAGS_T flags,
-+ void *msg_handle );
-+
-+// scatter-gather (vector) and send message
-+int32_t vchi_msg_queuev_ex( VCHI_SERVICE_HANDLE_T handle,
-+ VCHI_MSG_VECTOR_EX_T *vector,
-+ uint32_t count,
-+ VCHI_FLAGS_T flags,
-+ void *msg_handle );
-+
-+// legacy scatter-gather (vector) and send message, only handles pointers
-+int32_t vchi_msg_queuev( VCHI_SERVICE_HANDLE_T handle,
-+ VCHI_MSG_VECTOR_T *vector,
-+ uint32_t count,
-+ VCHI_FLAGS_T flags,
-+ void *msg_handle );
-+
-+// Routine to receive a msg from a service
-+// Dequeue is equivalent to hold, copy into client buffer, release
-+extern int32_t vchi_msg_dequeue( VCHI_SERVICE_HANDLE_T handle,
-+ void *data,
-+ uint32_t max_data_size_to_read,
-+ uint32_t *actual_msg_size,
-+ VCHI_FLAGS_T flags );
-+
-+// Routine to look at a message in place.
-+// The message is not dequeued, so a subsequent call to peek or dequeue
-+// will return the same message.
-+extern int32_t vchi_msg_peek( VCHI_SERVICE_HANDLE_T handle,
-+ void **data,
-+ uint32_t *msg_size,
-+ VCHI_FLAGS_T flags );
-+
-+// Routine to remove a message after it has been read in place with peek
-+// The first message on the queue is dequeued.
-+extern int32_t vchi_msg_remove( VCHI_SERVICE_HANDLE_T handle );
-+
-+// Routine to look at a message in place.
-+// The message is dequeued, so the caller is left holding it; the descriptor is
-+// filled in and must be released when the user has finished with the message.
-+extern int32_t vchi_msg_hold( VCHI_SERVICE_HANDLE_T handle,
-+ void **data, // } may be NULL, as info can be
-+ uint32_t *msg_size, // } obtained from HELD_MSG_T
-+ VCHI_FLAGS_T flags,
-+ VCHI_HELD_MSG_T *message_descriptor );
-+
-+// Initialise an iterator to look through messages in place
-+extern int32_t vchi_msg_look_ahead( VCHI_SERVICE_HANDLE_T handle,
-+ VCHI_MSG_ITER_T *iter,
-+ VCHI_FLAGS_T flags );
-+
-+/******************************************************************************
-+ Global service support API - operations on held messages and message iterators
-+ *****************************************************************************/
-+
-+// Routine to get the address of a held message
-+extern void *vchi_held_msg_ptr( const VCHI_HELD_MSG_T *message );
-+
-+// Routine to get the size of a held message
-+extern int32_t vchi_held_msg_size( const VCHI_HELD_MSG_T *message );
-+
-+// Routine to get the transmit timestamp as written into the header by the peer
-+extern uint32_t vchi_held_msg_tx_timestamp( const VCHI_HELD_MSG_T *message );
-+
-+// Routine to get the reception timestamp, written as we parsed the header
-+extern uint32_t vchi_held_msg_rx_timestamp( const VCHI_HELD_MSG_T *message );
-+
-+// Routine to release a held message after it has been processed
-+extern int32_t vchi_held_msg_release( VCHI_HELD_MSG_T *message );
-+
-+// Indicates whether the iterator has a next message.
-+extern int32_t vchi_msg_iter_has_next( const VCHI_MSG_ITER_T *iter );
-+
-+// Return the pointer and length for the next message and advance the iterator.
-+extern int32_t vchi_msg_iter_next( VCHI_MSG_ITER_T *iter,
-+ void **data,
-+ uint32_t *msg_size );
-+
-+// Remove the last message returned by vchi_msg_iter_next.
-+// Can only be called once after each call to vchi_msg_iter_next.
-+extern int32_t vchi_msg_iter_remove( VCHI_MSG_ITER_T *iter );
-+
-+// Hold the last message returned by vchi_msg_iter_next.
-+// Can only be called once after each call to vchi_msg_iter_next.
-+extern int32_t vchi_msg_iter_hold( VCHI_MSG_ITER_T *iter,
-+ VCHI_HELD_MSG_T *message );
-+
-+// Return information for the next message, and hold it, advancing the iterator.
-+extern int32_t vchi_msg_iter_hold_next( VCHI_MSG_ITER_T *iter,
-+ void **data, // } may be NULL
-+ uint32_t *msg_size, // }
-+ VCHI_HELD_MSG_T *message );
-+
-+
-+/******************************************************************************
-+ Global bulk API
-+ *****************************************************************************/
-+
-+// Routine to prepare interface for a transfer from the other side
-+extern int32_t vchi_bulk_queue_receive( VCHI_SERVICE_HANDLE_T handle,
-+ void *data_dst,
-+ uint32_t data_size,
-+ VCHI_FLAGS_T flags,
-+ void *transfer_handle );
-+
-+
-+// Prepare interface for a transfer from the other side into relocatable memory.
-+int32_t vchi_bulk_queue_receive_reloc( const VCHI_SERVICE_HANDLE_T handle,
-+ VCHI_MEM_HANDLE_T h_dst,
-+ uint32_t offset,
-+ uint32_t data_size,
-+ const VCHI_FLAGS_T flags,
-+ void * const bulk_handle );
-+
-+// Routine to queue up data ready for transfer to the other (once they have signalled they are ready)
-+extern int32_t vchi_bulk_queue_transmit( VCHI_SERVICE_HANDLE_T handle,
-+ const void *data_src,
-+ uint32_t data_size,
-+ VCHI_FLAGS_T flags,
-+ void *transfer_handle );
-+
-+
-+/******************************************************************************
-+ Configuration plumbing
-+ *****************************************************************************/
-+
-+// function prototypes for the different mid layers (the state info gives the different physical connections)
-+extern const VCHI_CONNECTION_API_T *single_get_func_table( void );
-+//extern const VCHI_CONNECTION_API_T *local_server_get_func_table( void );
-+//extern const VCHI_CONNECTION_API_T *local_client_get_func_table( void );
-+
-+// declare all message drivers here
-+const VCHI_MESSAGE_DRIVER_T *vchi_mphi_message_driver_func_table( void );
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+extern int32_t vchi_bulk_queue_transmit_reloc( VCHI_SERVICE_HANDLE_T handle,
-+ VCHI_MEM_HANDLE_T h_src,
-+ uint32_t offset,
-+ uint32_t data_size,
-+ VCHI_FLAGS_T flags,
-+ void *transfer_handle );
-+#endif /* VCHI_H_ */
-+
-+/****************************** End of file **********************************/
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h linux-rpi/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h 2015-08-26 10:26:08.301310049 +0200
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h linux-rpi/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,224 @@
+/**
+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
@@ -36149,9 +37860,9 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h linux
+#endif /* VCHI_CFG_H_ */
+
+/****************************** End of file **********************************/
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h linux-rpi/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h 2015-08-26 10:26:08.301310049 +0200
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h linux-rpi/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
@@ -36224,9 +37935,9 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchi/vchi_cfg_interna
+//#define VCHI_RX_NANOLOCKS
+
+#endif /*VCHI_CFG_INTERNAL_H_*/
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchi/vchi_common.h linux-rpi/drivers/misc/vc04_services/interface/vchi/vchi_common.h
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchi/vchi_common.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchi/vchi_common.h 2015-08-26 10:26:08.301310049 +0200
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchi/vchi_common.h linux-rpi/drivers/misc/vc04_services/interface/vchi/vchi_common.h
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchi/vchi_common.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchi/vchi_common.h 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,175 @@
+/**
+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
@@ -36403,10 +38114,10 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchi/vchi_common.h li
+
+
+#endif // VCHI_COMMON_H_
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchi/vchi_mh.h linux-rpi/drivers/misc/vc04_services/interface/vchi/vchi_mh.h
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchi/vchi_mh.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchi/vchi_mh.h 2015-08-26 10:26:08.301310049 +0200
-@@ -0,0 +1,42 @@
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchi/vchi.h linux-rpi/drivers/misc/vc04_services/interface/vchi/vchi.h
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchi/vchi.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchi/vchi.h 2015-10-07 16:40:46.000000000 +0200
+@@ -0,0 +1,378 @@
+/**
+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
+ *
@@ -36440,62 +38151,354 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchi/vchi_mh.h linux-
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
-+#ifndef VCHI_MH_H_
-+#define VCHI_MH_H_
++#ifndef VCHI_H_
++#define VCHI_H_
+
-+#include <linux/types.h>
++#include "interface/vchi/vchi_cfg.h"
++#include "interface/vchi/vchi_common.h"
++#include "interface/vchi/connections/connection.h"
++#include "vchi_mh.h"
+
-+typedef int32_t VCHI_MEM_HANDLE_T;
-+#define VCHI_MEM_HANDLE_INVALID 0
+
++/******************************************************************************
++ Global defs
++ *****************************************************************************/
++
++#define VCHI_BULK_ROUND_UP(x) ((((unsigned long)(x))+VCHI_BULK_ALIGN-1) & ~(VCHI_BULK_ALIGN-1))
++#define VCHI_BULK_ROUND_DOWN(x) (((unsigned long)(x)) & ~(VCHI_BULK_ALIGN-1))
++#define VCHI_BULK_ALIGN_NBYTES(x) (VCHI_BULK_ALIGNED(x) ? 0 : (VCHI_BULK_ALIGN - ((unsigned long)(x) & (VCHI_BULK_ALIGN-1))))
++
++#ifdef USE_VCHIQ_ARM
++#define VCHI_BULK_ALIGNED(x) 1
++#else
++#define VCHI_BULK_ALIGNED(x) (((unsigned long)(x) & (VCHI_BULK_ALIGN-1)) == 0)
+#endif
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h 2015-08-26 10:26:08.301310049 +0200
-@@ -0,0 +1,40 @@
-+/**
-+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions
-+ * are met:
-+ * 1. Redistributions of source code must retain the above copyright
-+ * notice, this list of conditions, and the following disclaimer,
-+ * without modification.
-+ * 2. Redistributions in binary form must reproduce the above copyright
-+ * notice, this list of conditions and the following disclaimer in the
-+ * documentation and/or other materials provided with the distribution.
-+ * 3. The names of the above-listed copyright holders may not be used
-+ * to endorse or promote products derived from this software without
-+ * specific prior written permission.
-+ *
-+ * ALTERNATIVELY, this software may be distributed under the terms of the
-+ * GNU General Public License ("GPL") version 2, as published by the Free
-+ * Software Foundation.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
-+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
-+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+ */
+
-+#ifndef VCHIQ_VCHIQ_H
-+#define VCHIQ_VCHIQ_H
++struct vchi_version {
++ uint32_t version;
++ uint32_t version_min;
++};
++#define VCHI_VERSION(v_) { v_, v_ }
++#define VCHI_VERSION_EX(v_, m_) { v_, m_ }
+
-+#include "vchiq_if.h"
-+#include "vchiq_util.h"
++typedef enum
++{
++ VCHI_VEC_POINTER,
++ VCHI_VEC_HANDLE,
++ VCHI_VEC_LIST
++} VCHI_MSG_VECTOR_TYPE_T;
++
++typedef struct vchi_msg_vector_ex {
+
++ VCHI_MSG_VECTOR_TYPE_T type;
++ union
++ {
++ // a memory handle
++ struct
++ {
++ VCHI_MEM_HANDLE_T handle;
++ uint32_t offset;
++ int32_t vec_len;
++ } handle;
++
++ // an ordinary data pointer
++ struct
++ {
++ const void *vec_base;
++ int32_t vec_len;
++ } ptr;
++
++ // a nested vector list
++ struct
++ {
++ struct vchi_msg_vector_ex *vec;
++ uint32_t vec_len;
++ } list;
++ } u;
++} VCHI_MSG_VECTOR_EX_T;
++
++
++// Construct an entry in a msg vector for a pointer (p) of length (l)
++#define VCHI_VEC_POINTER(p,l) VCHI_VEC_POINTER, { { (VCHI_MEM_HANDLE_T)(p), (l) } }
++
++// Construct an entry in a msg vector for a message handle (h), starting at offset (o) of length (l)
++#define VCHI_VEC_HANDLE(h,o,l) VCHI_VEC_HANDLE, { { (h), (o), (l) } }
++
++// Macros to manipulate 'FOURCC' values
++#define MAKE_FOURCC(x) ((int32_t)( (x[0] << 24) | (x[1] << 16) | (x[2] << 8) | x[3] ))
++#define FOURCC_TO_CHAR(x) (x >> 24) & 0xFF,(x >> 16) & 0xFF,(x >> 8) & 0xFF, x & 0xFF
++
++
++// Opaque service information
++struct opaque_vchi_service_t;
++
++// Descriptor for a held message. Allocated by client, initialised by vchi_msg_hold,
++// vchi_msg_iter_hold or vchi_msg_iter_hold_next. Fields are for internal VCHI use only.
++typedef struct
++{
++ struct opaque_vchi_service_t *service;
++ void *message;
++} VCHI_HELD_MSG_T;
++
++
++
++// structure used to provide the information needed to open a server or a client
++typedef struct {
++ struct vchi_version version;
++ int32_t service_id;
++ VCHI_CONNECTION_T *connection;
++ uint32_t rx_fifo_size;
++ uint32_t tx_fifo_size;
++ VCHI_CALLBACK_T callback;
++ void *callback_param;
++ /* client intends to receive bulk transfers of
++ odd lengths or into unaligned buffers */
++ int32_t want_unaligned_bulk_rx;
++ /* client intends to transmit bulk transfers of
++ odd lengths or out of unaligned buffers */
++ int32_t want_unaligned_bulk_tx;
++ /* client wants to check CRCs on (bulk) xfers.
++ Only needs to be set at 1 end - will do both directions. */
++ int32_t want_crc;
++} SERVICE_CREATION_T;
++
++// Opaque handle for a VCHI instance
++typedef struct opaque_vchi_instance_handle_t *VCHI_INSTANCE_T;
++
++// Opaque handle for a server or client
++typedef struct opaque_vchi_service_handle_t *VCHI_SERVICE_HANDLE_T;
++
++// Service registration & startup
++typedef void (*VCHI_SERVICE_INIT)(VCHI_INSTANCE_T initialise_instance, VCHI_CONNECTION_T **connections, uint32_t num_connections);
++
++typedef struct service_info_tag {
++ const char * const vll_filename; /* VLL to load to start this service. This is an empty string if VLL is "static" */
++ VCHI_SERVICE_INIT init; /* Service initialisation function */
++ void *vll_handle; /* VLL handle; NULL when unloaded or a "static VLL" in build */
++} SERVICE_INFO_T;
++
++/******************************************************************************
++ Global funcs - implementation is specific to which side you are on (local / remote)
++ *****************************************************************************/
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++extern /*@observer@*/ VCHI_CONNECTION_T * vchi_create_connection( const VCHI_CONNECTION_API_T * function_table,
++ const VCHI_MESSAGE_DRIVER_T * low_level);
++
++
++// Routine used to initialise the vchi on both local + remote connections
++extern int32_t vchi_initialise( VCHI_INSTANCE_T *instance_handle );
++
++extern int32_t vchi_exit( void );
++
++extern int32_t vchi_connect( VCHI_CONNECTION_T **connections,
++ const uint32_t num_connections,
++ VCHI_INSTANCE_T instance_handle );
++
++//When this is called, ensure that all services have no data pending.
++//Bulk transfers can remain 'queued'
++extern int32_t vchi_disconnect( VCHI_INSTANCE_T instance_handle );
++
++// Global control over bulk CRC checking
++extern int32_t vchi_crc_control( VCHI_CONNECTION_T *connection,
++ VCHI_CRC_CONTROL_T control );
++
++// helper functions
++extern void * vchi_allocate_buffer(VCHI_SERVICE_HANDLE_T handle, uint32_t *length);
++extern void vchi_free_buffer(VCHI_SERVICE_HANDLE_T handle, void *address);
++extern uint32_t vchi_current_time(VCHI_INSTANCE_T instance_handle);
++
++
++/******************************************************************************
++ Global service API
++ *****************************************************************************/
++// Routine to create a named service
++extern int32_t vchi_service_create( VCHI_INSTANCE_T instance_handle,
++ SERVICE_CREATION_T *setup,
++ VCHI_SERVICE_HANDLE_T *handle );
++
++// Routine to destory a service
++extern int32_t vchi_service_destroy( const VCHI_SERVICE_HANDLE_T handle );
++
++// Routine to open a named service
++extern int32_t vchi_service_open( VCHI_INSTANCE_T instance_handle,
++ SERVICE_CREATION_T *setup,
++ VCHI_SERVICE_HANDLE_T *handle);
++
++extern int32_t vchi_get_peer_version( const VCHI_SERVICE_HANDLE_T handle,
++ short *peer_version );
++
++// Routine to close a named service
++extern int32_t vchi_service_close( const VCHI_SERVICE_HANDLE_T handle );
++
++// Routine to increment ref count on a named service
++extern int32_t vchi_service_use( const VCHI_SERVICE_HANDLE_T handle );
++
++// Routine to decrement ref count on a named service
++extern int32_t vchi_service_release( const VCHI_SERVICE_HANDLE_T handle );
++
++// Routine to set a control option for a named service
++extern int32_t vchi_service_set_option( const VCHI_SERVICE_HANDLE_T handle,
++ VCHI_SERVICE_OPTION_T option,
++ int value);
++
++// Routine to send a message across a service
++extern int32_t vchi_msg_queue( VCHI_SERVICE_HANDLE_T handle,
++ const void *data,
++ uint32_t data_size,
++ VCHI_FLAGS_T flags,
++ void *msg_handle );
++
++// scatter-gather (vector) and send message
++int32_t vchi_msg_queuev_ex( VCHI_SERVICE_HANDLE_T handle,
++ VCHI_MSG_VECTOR_EX_T *vector,
++ uint32_t count,
++ VCHI_FLAGS_T flags,
++ void *msg_handle );
++
++// legacy scatter-gather (vector) and send message, only handles pointers
++int32_t vchi_msg_queuev( VCHI_SERVICE_HANDLE_T handle,
++ VCHI_MSG_VECTOR_T *vector,
++ uint32_t count,
++ VCHI_FLAGS_T flags,
++ void *msg_handle );
++
++// Routine to receive a msg from a service
++// Dequeue is equivalent to hold, copy into client buffer, release
++extern int32_t vchi_msg_dequeue( VCHI_SERVICE_HANDLE_T handle,
++ void *data,
++ uint32_t max_data_size_to_read,
++ uint32_t *actual_msg_size,
++ VCHI_FLAGS_T flags );
++
++// Routine to look at a message in place.
++// The message is not dequeued, so a subsequent call to peek or dequeue
++// will return the same message.
++extern int32_t vchi_msg_peek( VCHI_SERVICE_HANDLE_T handle,
++ void **data,
++ uint32_t *msg_size,
++ VCHI_FLAGS_T flags );
++
++// Routine to remove a message after it has been read in place with peek
++// The first message on the queue is dequeued.
++extern int32_t vchi_msg_remove( VCHI_SERVICE_HANDLE_T handle );
++
++// Routine to look at a message in place.
++// The message is dequeued, so the caller is left holding it; the descriptor is
++// filled in and must be released when the user has finished with the message.
++extern int32_t vchi_msg_hold( VCHI_SERVICE_HANDLE_T handle,
++ void **data, // } may be NULL, as info can be
++ uint32_t *msg_size, // } obtained from HELD_MSG_T
++ VCHI_FLAGS_T flags,
++ VCHI_HELD_MSG_T *message_descriptor );
++
++// Initialise an iterator to look through messages in place
++extern int32_t vchi_msg_look_ahead( VCHI_SERVICE_HANDLE_T handle,
++ VCHI_MSG_ITER_T *iter,
++ VCHI_FLAGS_T flags );
++
++/******************************************************************************
++ Global service support API - operations on held messages and message iterators
++ *****************************************************************************/
++
++// Routine to get the address of a held message
++extern void *vchi_held_msg_ptr( const VCHI_HELD_MSG_T *message );
++
++// Routine to get the size of a held message
++extern int32_t vchi_held_msg_size( const VCHI_HELD_MSG_T *message );
++
++// Routine to get the transmit timestamp as written into the header by the peer
++extern uint32_t vchi_held_msg_tx_timestamp( const VCHI_HELD_MSG_T *message );
++
++// Routine to get the reception timestamp, written as we parsed the header
++extern uint32_t vchi_held_msg_rx_timestamp( const VCHI_HELD_MSG_T *message );
++
++// Routine to release a held message after it has been processed
++extern int32_t vchi_held_msg_release( VCHI_HELD_MSG_T *message );
++
++// Indicates whether the iterator has a next message.
++extern int32_t vchi_msg_iter_has_next( const VCHI_MSG_ITER_T *iter );
++
++// Return the pointer and length for the next message and advance the iterator.
++extern int32_t vchi_msg_iter_next( VCHI_MSG_ITER_T *iter,
++ void **data,
++ uint32_t *msg_size );
++
++// Remove the last message returned by vchi_msg_iter_next.
++// Can only be called once after each call to vchi_msg_iter_next.
++extern int32_t vchi_msg_iter_remove( VCHI_MSG_ITER_T *iter );
++
++// Hold the last message returned by vchi_msg_iter_next.
++// Can only be called once after each call to vchi_msg_iter_next.
++extern int32_t vchi_msg_iter_hold( VCHI_MSG_ITER_T *iter,
++ VCHI_HELD_MSG_T *message );
++
++// Return information for the next message, and hold it, advancing the iterator.
++extern int32_t vchi_msg_iter_hold_next( VCHI_MSG_ITER_T *iter,
++ void **data, // } may be NULL
++ uint32_t *msg_size, // }
++ VCHI_HELD_MSG_T *message );
++
++
++/******************************************************************************
++ Global bulk API
++ *****************************************************************************/
++
++// Routine to prepare interface for a transfer from the other side
++extern int32_t vchi_bulk_queue_receive( VCHI_SERVICE_HANDLE_T handle,
++ void *data_dst,
++ uint32_t data_size,
++ VCHI_FLAGS_T flags,
++ void *transfer_handle );
++
++
++// Prepare interface for a transfer from the other side into relocatable memory.
++int32_t vchi_bulk_queue_receive_reloc( const VCHI_SERVICE_HANDLE_T handle,
++ VCHI_MEM_HANDLE_T h_dst,
++ uint32_t offset,
++ uint32_t data_size,
++ const VCHI_FLAGS_T flags,
++ void * const bulk_handle );
++
++// Routine to queue up data ready for transfer to the other (once they have signalled they are ready)
++extern int32_t vchi_bulk_queue_transmit( VCHI_SERVICE_HANDLE_T handle,
++ const void *data_src,
++ uint32_t data_size,
++ VCHI_FLAGS_T flags,
++ void *transfer_handle );
++
++
++/******************************************************************************
++ Configuration plumbing
++ *****************************************************************************/
++
++// function prototypes for the different mid layers (the state info gives the different physical connections)
++extern const VCHI_CONNECTION_API_T *single_get_func_table( void );
++//extern const VCHI_CONNECTION_API_T *local_server_get_func_table( void );
++//extern const VCHI_CONNECTION_API_T *local_client_get_func_table( void );
++
++// declare all message drivers here
++const VCHI_MESSAGE_DRIVER_T *vchi_mphi_message_driver_func_table( void );
++
++#ifdef __cplusplus
++}
+#endif
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h 2015-08-26 10:26:08.301310049 +0200
++
++extern int32_t vchi_bulk_queue_transmit_reloc( VCHI_SERVICE_HANDLE_T handle,
++ VCHI_MEM_HANDLE_T h_src,
++ uint32_t offset,
++ uint32_t data_size,
++ VCHI_FLAGS_T flags,
++ void *transfer_handle );
++#endif /* VCHI_H_ */
++
++/****************************** End of file **********************************/
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchi/vchi_mh.h linux-rpi/drivers/misc/vc04_services/interface/vchi/vchi_mh.h
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchi/vchi_mh.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchi/vchi_mh.h 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,42 @@
+/**
+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
@@ -36530,18 +38533,18 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
-+#ifndef VCHIQ_2835_H
-+#define VCHIQ_2835_H
++#ifndef VCHI_MH_H_
++#define VCHI_MH_H_
+
-+#include "vchiq_pagelist.h"
++#include <linux/types.h>
+
-+#define VCHIQ_PLATFORM_FRAGMENTS_OFFSET_IDX 0
-+#define VCHIQ_PLATFORM_FRAGMENTS_COUNT_IDX 1
++typedef int32_t VCHI_MEM_HANDLE_T;
++#define VCHI_MEM_HANDLE_INVALID 0
+
-+#endif /* VCHIQ_2835_H */
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c 2015-08-26 10:26:08.301310049 +0200
++#endif
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,580 @@
+/**
+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
@@ -37123,9 +39126,55 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_
+
+ kfree(pagelist);
+}
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c 2015-08-26 10:26:08.301310049 +0200
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h 2015-10-07 16:40:46.000000000 +0200
+@@ -0,0 +1,42 @@
++/**
++ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions, and the following disclaimer,
++ * without modification.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The names of the above-listed copyright holders may not be used
++ * to endorse or promote products derived from this software without
++ * specific prior written permission.
++ *
++ * ALTERNATIVELY, this software may be distributed under the terms of the
++ * GNU General Public License ("GPL") version 2, as published by the Free
++ * Software Foundation.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++#ifndef VCHIQ_2835_H
++#define VCHIQ_2835_H
++
++#include "vchiq_pagelist.h"
++
++#define VCHIQ_PLATFORM_FRAGMENTS_OFFSET_IDX 0
++#define VCHIQ_PLATFORM_FRAGMENTS_COUNT_IDX 1
++
++#endif /* VCHIQ_2835_H */
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,2903 @@
+/**
+ * Copyright (c) 2014 Raspberry Pi (Trading) Ltd. All rights reserved.
@@ -40030,9 +42079,9 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Broadcom Corporation");
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h 2015-08-26 10:26:08.301310049 +0200
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,220 @@
+/**
+ * Copyright (c) 2014 Raspberry Pi (Trading) Ltd. All rights reserved.
@@ -40254,9 +42303,9 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h
+
+
+#endif /* VCHIQ_ARM_H */
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_build_info.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_build_info.h
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_build_info.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_build_info.h 2015-08-26 10:26:08.301310049 +0200
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_build_info.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_build_info.h
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_build_info.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_build_info.h 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
@@ -40295,9 +42344,9 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_build
+const char *vchiq_get_build_version(void);
+const char *vchiq_get_build_time(void);
+const char *vchiq_get_build_date(void);
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h 2015-08-26 10:26:08.301310049 +0200
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2010-2014 Broadcom. All rights reserved.
@@ -40368,9 +42417,9 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h
+#endif
+
+#endif /* VCHIQ_CFG_H */
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c 2015-08-26 10:26:08.301310049 +0200
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,120 @@
+/**
+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
@@ -40492,9 +42541,9 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_conne
+ mutex_unlock(&g_connected_mutex);
+}
+EXPORT_SYMBOL(vchiq_add_connected_callback);
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h 2015-08-26 10:26:08.301310049 +0200
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
@@ -40546,9 +42595,9 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_conne
+void vchiq_call_connected_callbacks(void);
+
+#endif /* VCHIQ_CONNECTED_H */
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c 2015-08-26 10:26:08.301310049 +0200
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,3934 @@
+/**
+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
@@ -44484,9 +46533,9 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.
+ numBytes = 0;
+ }
+}
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h 2015-08-26 10:26:08.301310049 +0200
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,712 @@
+/**
+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
@@ -45200,9 +47249,9 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.
+ size_t numBytes);
+
+#endif
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.c linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.c
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.c 2015-08-26 10:26:08.301310049 +0200
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.c linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.c
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.c 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,383 @@
+/**
+ * Copyright (c) 2014 Raspberry Pi (Trading) Ltd. All rights reserved.
@@ -45587,9 +47636,9 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debug
+}
+
+#endif /* CONFIG_DEBUG_FS */
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.h
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.h 2015-08-26 10:26:08.301310049 +0200
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.h
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debugfs.h 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2014 Raspberry Pi (Trading) Ltd. All rights reserved.
@@ -45643,9 +47692,9 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_debug
+void vchiq_debugfs_remove_instance(VCHIQ_INSTANCE_T instance);
+
+#endif /* VCHIQ_DEBUGFS_H */
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_genversion linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_genversion
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_genversion 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_genversion 2015-08-26 10:26:08.301310049 +0200
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_genversion linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_genversion
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_genversion 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_genversion 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,87 @@
+#!/usr/bin/perl -w
+
@@ -45734,9 +47783,53 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_genve
+ return vchiq_build_time;
+}
+EOF
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h 2015-08-26 10:26:08.301310049 +0200
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h 2015-10-07 16:40:46.000000000 +0200
+@@ -0,0 +1,40 @@
++/**
++ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions, and the following disclaimer,
++ * without modification.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The names of the above-listed copyright holders may not be used
++ * to endorse or promote products derived from this software without
++ * specific prior written permission.
++ *
++ * ALTERNATIVELY, this software may be distributed under the terms of the
++ * GNU General Public License ("GPL") version 2, as published by the Free
++ * Software Foundation.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++#ifndef VCHIQ_VCHIQ_H
++#define VCHIQ_VCHIQ_H
++
++#include "vchiq_if.h"
++#include "vchiq_util.h"
++
++#endif
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,189 @@
+/**
+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
@@ -45927,9 +48020,9 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h
+ short *peer_version);
+
+#endif /* VCHIQ_IF_H */
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h 2015-08-26 10:26:08.301310049 +0200
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,131 @@
+/**
+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
@@ -46062,9 +48155,9 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl
+#define VCHIQ_IOC_MAX 17
+
+#endif
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c 2015-08-26 10:26:08.301310049 +0200
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,458 @@
+/**
+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
@@ -46524,9 +48617,9 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_
+
+ return status;
+}
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_killable.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_killable.h
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_killable.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_killable.h 2015-08-26 10:26:08.301310049 +0200
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_killable.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_killable.h
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_killable.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_killable.h 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
@@ -46597,9 +48690,9 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_killa
+#define mutex_lock_interruptible mutex_lock_interruptible_killable
+
+#endif
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h 2015-08-26 10:26:08.301310049 +0200
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
@@ -46672,9 +48765,9 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdr
+ const VCHIQ_PLATFORM_DATA_T * platform_data);
+
+#endif
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h 2015-08-26 10:26:08.301310049 +0200
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
@@ -46734,9 +48827,9 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagel
+} FRAGMENTS_T;
+
+#endif /* VCHIQ_PAGELIST_H */
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c 2015-08-26 10:26:08.305310104 +0200
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,860 @@
+/**
+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
@@ -47598,10 +49691,10 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.
+ return ret;
+}
+EXPORT_SYMBOL(vchi_service_release);
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c 2015-08-26 10:26:08.305310104 +0200
-@@ -0,0 +1,152 @@
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c 2015-10-07 16:40:46.000000000 +0200
+@@ -0,0 +1,156 @@
+/**
+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
+ *
@@ -47650,6 +49743,7 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.
+ queue->size = size;
+ queue->read = 0;
+ queue->write = 0;
++ queue->initialized = 1;
+
+ sema_init(&queue->pop, 0);
+ sema_init(&queue->push, 0);
@@ -47680,6 +49774,9 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.
+
+void vchiu_queue_push(VCHIU_QUEUE_T *queue, VCHIQ_HEADER_T *header)
+{
++ if (!queue->initialized)
++ return;
++
+ while (queue->write == queue->read + queue->size) {
+ if (down_interruptible(&queue->pop) != 0) {
+ flush_signals(current);
@@ -47754,10 +49851,10 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.
+
+ return header;
+}
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h 2015-08-26 10:26:08.305310104 +0200
-@@ -0,0 +1,81 @@
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h 2015-10-07 16:40:46.000000000 +0200
+@@ -0,0 +1,82 @@
+/**
+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
+ *
@@ -47820,6 +49917,7 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.
+ int size;
+ int read;
+ int write;
++ int initialized;
+
+ struct semaphore pop;
+ struct semaphore push;
@@ -47839,9 +49937,9 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.
+extern VCHIQ_HEADER_T *vchiu_queue_pop(VCHIU_QUEUE_T *queue);
+
+#endif
-diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_version.c linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_version.c
---- linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_version.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_version.c 2015-08-26 10:26:08.305310104 +0200
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_version.c linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_version.c
+--- linux-4.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_version.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_version.c 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
@@ -47902,9 +50000,40 @@ diff -Nur linux-4.1.6/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_versi
+{
+ return vchiq_build_time;
+}
-diff -Nur linux-4.1.6/drivers/mmc/card/block.c linux-rpi/drivers/mmc/card/block.c
---- linux-4.1.6/drivers/mmc/card/block.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/mmc/card/block.c 2015-08-26 10:26:08.305310104 +0200
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/Kconfig linux-rpi/drivers/misc/vc04_services/Kconfig
+--- linux-4.1.10/drivers/misc/vc04_services/Kconfig 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/Kconfig 2015-10-07 16:40:46.000000000 +0200
+@@ -0,0 +1,9 @@
++config BCM2708_VCHIQ
++ tristate "Videocore VCHIQ"
++ depends on RASPBERRYPI_FIRMWARE
++ default y
++ help
++ Kernel to VideoCore communication interface for the
++ BCM2708 family of products.
++ Defaults to Y when the Broadcom Videocore services
++ are included in the build, N otherwise.
+diff -Nur linux-4.1.10/drivers/misc/vc04_services/Makefile linux-rpi/drivers/misc/vc04_services/Makefile
+--- linux-4.1.10/drivers/misc/vc04_services/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/misc/vc04_services/Makefile 2015-10-07 16:40:46.000000000 +0200
+@@ -0,0 +1,14 @@
++obj-$(CONFIG_BCM2708_VCHIQ) += vchiq.o
++
++vchiq-objs := \
++ interface/vchiq_arm/vchiq_core.o \
++ interface/vchiq_arm/vchiq_arm.o \
++ interface/vchiq_arm/vchiq_kern_lib.o \
++ interface/vchiq_arm/vchiq_2835_arm.o \
++ interface/vchiq_arm/vchiq_debugfs.o \
++ interface/vchiq_arm/vchiq_shim.o \
++ interface/vchiq_arm/vchiq_util.o \
++ interface/vchiq_arm/vchiq_connected.o \
++
++ccflags-y += -DVCOS_VERIFY_BKPTS=1 -Idrivers/misc/vc04_services -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000
++
+diff -Nur linux-4.1.10/drivers/mmc/card/block.c linux-rpi/drivers/mmc/card/block.c
+--- linux-4.1.10/drivers/mmc/card/block.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/mmc/card/block.c 2015-10-07 16:40:46.000000000 +0200
@@ -1415,6 +1415,7 @@
brq->data.blocks = card->host->ops->multi_io_quirk(card,
(rq_data_dir(req) == READ) ?
@@ -47913,9 +50042,9 @@ diff -Nur linux-4.1.6/drivers/mmc/card/block.c linux-rpi/drivers/mmc/card/block.
brq->data.blocks);
}
-diff -Nur linux-4.1.6/drivers/mmc/core/quirks.c linux-rpi/drivers/mmc/core/quirks.c
---- linux-4.1.6/drivers/mmc/core/quirks.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/mmc/core/quirks.c 2015-08-26 10:26:08.309310160 +0200
+diff -Nur linux-4.1.10/drivers/mmc/core/quirks.c linux-rpi/drivers/mmc/core/quirks.c
+--- linux-4.1.10/drivers/mmc/core/quirks.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/mmc/core/quirks.c 2015-10-07 16:40:46.000000000 +0200
@@ -71,6 +71,7 @@
void mmc_fixup_device(struct mmc_card *card, const struct mmc_fixup *table)
@@ -47935,71 +50064,10 @@ diff -Nur linux-4.1.6/drivers/mmc/core/quirks.c linux-rpi/drivers/mmc/core/quirk
+ card->quirks |= MMC_QUIRK_BLK_NO_CMD23;
}
EXPORT_SYMBOL(mmc_fixup_device);
-diff -Nur linux-4.1.6/drivers/mmc/host/Kconfig linux-rpi/drivers/mmc/host/Kconfig
---- linux-4.1.6/drivers/mmc/host/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/mmc/host/Kconfig 2015-08-26 10:26:08.309310160 +0200
-@@ -4,6 +4,45 @@
-
- comment "MMC/SD/SDIO Host Controller Drivers"
-
-+config MMC_BCM2835
-+ tristate "MMC support on BCM2835"
-+ depends on MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835
-+ help
-+ This selects the MMC Interface on BCM2835.
-+
-+ If you have a controller with this interface, say Y or M here.
-+
-+ If unsure, say N.
-+
-+config MMC_BCM2835_DMA
-+ bool "DMA support on BCM2835 Arasan controller"
-+ depends on MMC_BCM2835
-+ help
-+ Enable DMA support on the Arasan SDHCI controller in Broadcom 2708
-+ based chips.
-+
-+ If unsure, say N.
-+
-+config MMC_BCM2835_PIO_DMA_BARRIER
-+ int "Block count limit for PIO transfers"
-+ depends on MMC_BCM2835 && MMC_BCM2835_DMA
-+ range 0 256
-+ default 2
-+ help
-+ The inclusive limit in bytes under which PIO will be used instead of DMA
-+
-+ If unsure, say 2 here.
-+
-+config MMC_BCM2835_SDHOST
-+ tristate "Support for the SDHost controller on BCM2708/9"
-+ depends on MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835
-+ help
-+ This selects the SDHost controller on BCM2835/6.
-+
-+ If you have a controller with this interface, say Y or M here.
-+
-+ If unsure, say N.
-+
- config MMC_ARMMMCI
- tristate "ARM AMBA Multimedia Card Interface support"
- depends on ARM_AMBA
-diff -Nur linux-4.1.6/drivers/mmc/host/Makefile linux-rpi/drivers/mmc/host/Makefile
---- linux-4.1.6/drivers/mmc/host/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/mmc/host/Makefile 2015-08-26 10:26:08.309310160 +0200
-@@ -18,6 +18,8 @@
- obj-$(CONFIG_MMC_SDHCI_SIRF) += sdhci-sirf.o
- obj-$(CONFIG_MMC_SDHCI_F_SDH30) += sdhci_f_sdh30.o
- obj-$(CONFIG_MMC_SDHCI_SPEAR) += sdhci-spear.o
-+obj-$(CONFIG_MMC_BCM2835_SDHOST) += bcm2835-sdhost.o
-+obj-$(CONFIG_MMC_BCM2835) += bcm2835-mmc.o
- obj-$(CONFIG_MMC_WBSD) += wbsd.o
- obj-$(CONFIG_MMC_AU1X) += au1xmmc.o
- obj-$(CONFIG_MMC_OMAP) += omap.o
-diff -Nur linux-4.1.6/drivers/mmc/host/bcm2835-mmc.c linux-rpi/drivers/mmc/host/bcm2835-mmc.c
---- linux-4.1.6/drivers/mmc/host/bcm2835-mmc.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/mmc/host/bcm2835-mmc.c 2015-08-26 10:26:08.309310160 +0200
-@@ -0,0 +1,1558 @@
+diff -Nur linux-4.1.10/drivers/mmc/host/bcm2835-mmc.c linux-rpi/drivers/mmc/host/bcm2835-mmc.c
+--- linux-4.1.10/drivers/mmc/host/bcm2835-mmc.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/mmc/host/bcm2835-mmc.c 2015-10-07 16:40:46.000000000 +0200
+@@ -0,0 +1,1559 @@
+/*
+ * BCM2835 MMC host driver.
+ *
@@ -49329,8 +51397,9 @@ diff -Nur linux-4.1.6/drivers/mmc/host/bcm2835-mmc.c linux-rpi/drivers/mmc/host/
+ mmc->max_busy_timeout = (1 << 27) / host->timeout_clk;
+#endif
+ /* host controller capabilities */
-+ mmc->caps = MMC_CAP_CMD23 | MMC_CAP_ERASE | MMC_CAP_NEEDS_POLL | MMC_CAP_SDIO_IRQ |
-+ MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED | MMC_CAP_4_BIT_DATA;
++ mmc->caps |= MMC_CAP_CMD23 | MMC_CAP_ERASE | MMC_CAP_NEEDS_POLL |
++ MMC_CAP_SDIO_IRQ | MMC_CAP_SD_HIGHSPEED |
++ MMC_CAP_MMC_HIGHSPEED | MMC_CAP_4_BIT_DATA;
+
+ host->flags = SDHCI_AUTO_CMD23;
+
@@ -49558,9 +51627,9 @@ diff -Nur linux-4.1.6/drivers/mmc/host/bcm2835-mmc.c linux-rpi/drivers/mmc/host/
+MODULE_DESCRIPTION("BCM2835 SDHCI driver");
+MODULE_LICENSE("GPL v2");
+MODULE_AUTHOR("Gellert Weisz");
-diff -Nur linux-4.1.6/drivers/mmc/host/bcm2835-sdhost.c linux-rpi/drivers/mmc/host/bcm2835-sdhost.c
---- linux-4.1.6/drivers/mmc/host/bcm2835-sdhost.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/mmc/host/bcm2835-sdhost.c 2015-08-26 10:26:08.309310160 +0200
+diff -Nur linux-4.1.10/drivers/mmc/host/bcm2835-sdhost.c linux-rpi/drivers/mmc/host/bcm2835-sdhost.c
+--- linux-4.1.10/drivers/mmc/host/bcm2835-sdhost.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/mmc/host/bcm2835-sdhost.c 2015-10-07 16:40:46.000000000 +0200
@@ -0,0 +1,1930 @@
+/*
+ * BCM2835 SD host driver.
@@ -51492,9 +53561,70 @@ diff -Nur linux-4.1.6/drivers/mmc/host/bcm2835-sdhost.c linux-rpi/drivers/mmc/ho
+MODULE_DESCRIPTION("BCM2835 SDHost driver");
+MODULE_LICENSE("GPL v2");
+MODULE_AUTHOR("Phil Elwell");
-diff -Nur linux-4.1.6/drivers/mmc/host/omap_hsmmc.c linux-rpi/drivers/mmc/host/omap_hsmmc.c
---- linux-4.1.6/drivers/mmc/host/omap_hsmmc.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/mmc/host/omap_hsmmc.c 2015-08-26 10:26:08.313310215 +0200
+diff -Nur linux-4.1.10/drivers/mmc/host/Kconfig linux-rpi/drivers/mmc/host/Kconfig
+--- linux-4.1.10/drivers/mmc/host/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/mmc/host/Kconfig 2015-10-07 16:40:46.000000000 +0200
+@@ -4,6 +4,45 @@
+
+ comment "MMC/SD/SDIO Host Controller Drivers"
+
++config MMC_BCM2835
++ tristate "MMC support on BCM2835"
++ depends on MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835
++ help
++ This selects the MMC Interface on BCM2835.
++
++ If you have a controller with this interface, say Y or M here.
++
++ If unsure, say N.
++
++config MMC_BCM2835_DMA
++ bool "DMA support on BCM2835 Arasan controller"
++ depends on MMC_BCM2835
++ help
++ Enable DMA support on the Arasan SDHCI controller in Broadcom 2708
++ based chips.
++
++ If unsure, say N.
++
++config MMC_BCM2835_PIO_DMA_BARRIER
++ int "Block count limit for PIO transfers"
++ depends on MMC_BCM2835 && MMC_BCM2835_DMA
++ range 0 256
++ default 2
++ help
++ The inclusive limit in bytes under which PIO will be used instead of DMA
++
++ If unsure, say 2 here.
++
++config MMC_BCM2835_SDHOST
++ tristate "Support for the SDHost controller on BCM2708/9"
++ depends on MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835
++ help
++ This selects the SDHost controller on BCM2835/6.
++
++ If you have a controller with this interface, say Y or M here.
++
++ If unsure, say N.
++
+ config MMC_ARMMMCI
+ tristate "ARM AMBA Multimedia Card Interface support"
+ depends on ARM_AMBA
+diff -Nur linux-4.1.10/drivers/mmc/host/Makefile linux-rpi/drivers/mmc/host/Makefile
+--- linux-4.1.10/drivers/mmc/host/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/mmc/host/Makefile 2015-10-07 16:40:46.000000000 +0200
+@@ -18,6 +18,8 @@
+ obj-$(CONFIG_MMC_SDHCI_SIRF) += sdhci-sirf.o
+ obj-$(CONFIG_MMC_SDHCI_F_SDH30) += sdhci_f_sdh30.o
+ obj-$(CONFIG_MMC_SDHCI_SPEAR) += sdhci-spear.o
++obj-$(CONFIG_MMC_BCM2835_SDHOST) += bcm2835-sdhost.o
++obj-$(CONFIG_MMC_BCM2835) += bcm2835-mmc.o
+ obj-$(CONFIG_MMC_WBSD) += wbsd.o
+ obj-$(CONFIG_MMC_AU1X) += au1xmmc.o
+ obj-$(CONFIG_MMC_OMAP) += omap.o
+diff -Nur linux-4.1.10/drivers/mmc/host/omap_hsmmc.c linux-rpi/drivers/mmc/host/omap_hsmmc.c
+--- linux-4.1.10/drivers/mmc/host/omap_hsmmc.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/mmc/host/omap_hsmmc.c 2015-10-07 16:40:46.000000000 +0200
@@ -1749,7 +1749,9 @@
}
@@ -51506,9 +53636,9 @@ diff -Nur linux-4.1.6/drivers/mmc/host/omap_hsmmc.c linux-rpi/drivers/mmc/host/o
{
/* This controller can't do multiblock reads due to hw bugs */
if (direction == MMC_DATA_READ)
-diff -Nur linux-4.1.6/drivers/mmc/host/sh_mobile_sdhi.c linux-rpi/drivers/mmc/host/sh_mobile_sdhi.c
---- linux-4.1.6/drivers/mmc/host/sh_mobile_sdhi.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/mmc/host/sh_mobile_sdhi.c 2015-08-26 10:26:08.317310271 +0200
+diff -Nur linux-4.1.10/drivers/mmc/host/sh_mobile_sdhi.c linux-rpi/drivers/mmc/host/sh_mobile_sdhi.c
+--- linux-4.1.10/drivers/mmc/host/sh_mobile_sdhi.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/mmc/host/sh_mobile_sdhi.c 2015-10-07 16:40:46.000000000 +0200
@@ -170,7 +170,9 @@
}
@@ -51520,9 +53650,9 @@ diff -Nur linux-4.1.6/drivers/mmc/host/sh_mobile_sdhi.c linux-rpi/drivers/mmc/ho
{
/*
* In Renesas controllers, when performing a
-diff -Nur linux-4.1.6/drivers/mmc/host/tmio_mmc_pio.c linux-rpi/drivers/mmc/host/tmio_mmc_pio.c
---- linux-4.1.6/drivers/mmc/host/tmio_mmc_pio.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/mmc/host/tmio_mmc_pio.c 2015-08-26 10:26:08.317310271 +0200
+diff -Nur linux-4.1.10/drivers/mmc/host/tmio_mmc_pio.c linux-rpi/drivers/mmc/host/tmio_mmc_pio.c
+--- linux-4.1.10/drivers/mmc/host/tmio_mmc_pio.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/mmc/host/tmio_mmc_pio.c 2015-10-07 16:40:46.000000000 +0200
@@ -1001,7 +1001,9 @@
}
@@ -51534,9 +53664,309 @@ diff -Nur linux-4.1.6/drivers/mmc/host/tmio_mmc_pio.c linux-rpi/drivers/mmc/host
{
struct tmio_mmc_host *host = mmc_priv(card->host);
-diff -Nur linux-4.1.6/drivers/net/ethernet/microchip/enc28j60.c linux-rpi/drivers/net/ethernet/microchip/enc28j60.c
---- linux-4.1.6/drivers/net/ethernet/microchip/enc28j60.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/net/ethernet/microchip/enc28j60.c 2015-08-26 10:26:08.525313161 +0200
+diff -Nur linux-4.1.10/drivers/mtd/nand/bcm2835_smi_nand.c linux-rpi/drivers/mtd/nand/bcm2835_smi_nand.c
+--- linux-4.1.10/drivers/mtd/nand/bcm2835_smi_nand.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/mtd/nand/bcm2835_smi_nand.c 2015-10-07 16:40:47.000000000 +0200
+@@ -0,0 +1,268 @@
++/**
++ * NAND flash driver for Broadcom Secondary Memory Interface
++ *
++ * Written by Luke Wren <luke@raspberrypi.org>
++ * Copyright (c) 2015, Raspberry Pi (Trading) Ltd.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions, and the following disclaimer,
++ * without modification.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The names of the above-listed copyright holders may not be used
++ * to endorse or promote products derived from this software without
++ * specific prior written permission.
++ *
++ * ALTERNATIVELY, this software may be distributed under the terms of the
++ * GNU General Public License ("GPL") version 2, as published by the Free
++ * Software Foundation.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/of.h>
++#include <linux/platform_device.h>
++#include <linux/slab.h>
++#include <linux/mtd/nand.h>
++#include <linux/mtd/partitions.h>
++
++#include <linux/broadcom/bcm2835_smi.h>
++
++#define DEVICE_NAME "bcm2835-smi-nand"
++#define DRIVER_NAME "smi-nand-bcm2835"
++
++struct bcm2835_smi_nand_host {
++ struct bcm2835_smi_instance *smi_inst;
++ struct nand_chip nand_chip;
++ struct mtd_info mtd;
++ struct device *dev;
++};
++
++/****************************************************************************
++*
++* NAND functionality implementation
++*
++****************************************************************************/
++
++#define SMI_NAND_CLE_PIN 0x01
++#define SMI_NAND_ALE_PIN 0x02
++
++static inline void bcm2835_smi_nand_cmd_ctrl(struct mtd_info *mtd, int cmd,
++ unsigned int ctrl)
++{
++ uint32_t cmd32 = cmd;
++ uint32_t addr = ~(SMI_NAND_CLE_PIN | SMI_NAND_ALE_PIN);
++ struct bcm2835_smi_nand_host *host = dev_get_drvdata(mtd->dev.parent);
++ struct bcm2835_smi_instance *inst = host->smi_inst;
++
++ if (ctrl & NAND_CLE)
++ addr |= SMI_NAND_CLE_PIN;
++ if (ctrl & NAND_ALE)
++ addr |= SMI_NAND_ALE_PIN;
++ /* Lower ALL the CS pins! */
++ if (ctrl & NAND_NCE)
++ addr &= (SMI_NAND_CLE_PIN | SMI_NAND_ALE_PIN);
++
++ bcm2835_smi_set_address(inst, addr);
++
++ if (cmd != NAND_CMD_NONE)
++ bcm2835_smi_write_buf(inst, &cmd32, 1);
++}
++
++static inline uint8_t bcm2835_smi_nand_read_byte(struct mtd_info *mtd)
++{
++ uint8_t byte;
++ struct bcm2835_smi_nand_host *host = dev_get_drvdata(mtd->dev.parent);
++ struct bcm2835_smi_instance *inst = host->smi_inst;
++
++ bcm2835_smi_read_buf(inst, &byte, 1);
++ return byte;
++}
++
++static inline void bcm2835_smi_nand_write_byte(struct mtd_info *mtd,
++ uint8_t byte)
++{
++ struct bcm2835_smi_nand_host *host = dev_get_drvdata(mtd->dev.parent);
++ struct bcm2835_smi_instance *inst = host->smi_inst;
++
++ bcm2835_smi_write_buf(inst, &byte, 1);
++}
++
++static inline void bcm2835_smi_nand_write_buf(struct mtd_info *mtd,
++ const uint8_t *buf, int len)
++{
++ struct bcm2835_smi_nand_host *host = dev_get_drvdata(mtd->dev.parent);
++ struct bcm2835_smi_instance *inst = host->smi_inst;
++
++ bcm2835_smi_write_buf(inst, buf, len);
++}
++
++static inline void bcm2835_smi_nand_read_buf(struct mtd_info *mtd,
++ uint8_t *buf, int len)
++{
++ struct bcm2835_smi_nand_host *host = dev_get_drvdata(mtd->dev.parent);
++ struct bcm2835_smi_instance *inst = host->smi_inst;
++
++ bcm2835_smi_read_buf(inst, buf, len);
++}
++
++/****************************************************************************
++*
++* Probe and remove functions
++*
++***************************************************************************/
++
++static int bcm2835_smi_nand_probe(struct platform_device *pdev)
++{
++ struct bcm2835_smi_nand_host *host;
++ struct nand_chip *this;
++ struct mtd_info *mtd;
++ struct device *dev = &pdev->dev;
++ struct device_node *node = dev->of_node, *smi_node;
++ struct mtd_part_parser_data ppdata;
++ struct smi_settings *smi_settings;
++ struct bcm2835_smi_instance *smi_inst;
++ int ret = -ENXIO;
++
++ if (!node) {
++ dev_err(dev, "No device tree node supplied!");
++ return -EINVAL;
++ }
++
++ smi_node = of_parse_phandle(node, "smi_handle", 0);
++
++ /* Request use of SMI peripheral: */
++ smi_inst = bcm2835_smi_get(smi_node);
++
++ if (!smi_inst) {
++ dev_err(dev, "Could not register with SMI.");
++ return -EPROBE_DEFER;
++ }
++
++ /* Set SMI timing and bus width */
++
++ smi_settings = bcm2835_smi_get_settings_from_regs(smi_inst);
++
++ smi_settings->data_width = SMI_WIDTH_8BIT;
++ smi_settings->read_setup_time = 2;
++ smi_settings->read_hold_time = 1;
++ smi_settings->read_pace_time = 1;
++ smi_settings->read_strobe_time = 3;
++
++ smi_settings->write_setup_time = 2;
++ smi_settings->write_hold_time = 1;
++ smi_settings->write_pace_time = 1;
++ smi_settings->write_strobe_time = 3;
++
++ bcm2835_smi_set_regs_from_settings(smi_inst);
++
++ host = devm_kzalloc(dev, sizeof(struct bcm2835_smi_nand_host),
++ GFP_KERNEL);
++ if (!host)
++ return -ENOMEM;
++
++ host->dev = dev;
++ host->smi_inst = smi_inst;
++
++ platform_set_drvdata(pdev, host);
++
++ /* Link the structures together */
++
++ this = &host->nand_chip;
++ mtd = &host->mtd;
++ mtd->priv = this;
++ mtd->owner = THIS_MODULE;
++ mtd->dev.parent = dev;
++ mtd->name = DRIVER_NAME;
++ ppdata.of_node = node;
++
++ /* 20 us command delay time... */
++ this->chip_delay = 20;
++
++ this->priv = host;
++ this->cmd_ctrl = bcm2835_smi_nand_cmd_ctrl;
++ this->read_byte = bcm2835_smi_nand_read_byte;
++ this->write_byte = bcm2835_smi_nand_write_byte;
++ this->write_buf = bcm2835_smi_nand_write_buf;
++ this->read_buf = bcm2835_smi_nand_read_buf;
++
++ this->ecc.mode = NAND_ECC_SOFT;
++
++ /* Should never be accessed directly: */
++
++ this->IO_ADDR_R = (void *)0xdeadbeef;
++ this->IO_ADDR_W = (void *)0xdeadbeef;
++
++ /* First scan to find the device and get the page size */
++
++ if (nand_scan_ident(mtd, 1, NULL))
++ return -ENXIO;
++
++ /* Second phase scan */
++
++ if (nand_scan_tail(mtd))
++ return -ENXIO;
++
++ ret = mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0);
++ if (!ret)
++ return 0;
++
++ nand_release(mtd);
++ return -EINVAL;
++}
++
++static int bcm2835_smi_nand_remove(struct platform_device *pdev)
++{
++ struct bcm2835_smi_nand_host *host = platform_get_drvdata(pdev);
++
++ nand_release(&host->mtd);
++
++ return 0;
++}
++
++/****************************************************************************
++*
++* Register the driver with device tree
++*
++***************************************************************************/
++
++static const struct of_device_id bcm2835_smi_nand_of_match[] = {
++ {.compatible = "brcm,bcm2835-smi-nand",},
++ { /* sentinel */ }
++};
++
++MODULE_DEVICE_TABLE(of, bcm2835_smi_nand_of_match);
++
++static struct platform_driver bcm2835_smi_nand_driver = {
++ .probe = bcm2835_smi_nand_probe,
++ .remove = bcm2835_smi_nand_remove,
++ .driver = {
++ .name = DRIVER_NAME,
++ .owner = THIS_MODULE,
++ .of_match_table = bcm2835_smi_nand_of_match,
++ },
++};
++
++module_platform_driver(bcm2835_smi_nand_driver);
++
++MODULE_ALIAS("platform:smi-nand-bcm2835");
++MODULE_LICENSE("GPL");
++MODULE_DESCRIPTION
++ ("Driver for NAND chips using Broadcom Secondary Memory Interface");
++MODULE_AUTHOR("Luke Wren <luke@raspberrypi.org>");
+diff -Nur linux-4.1.10/drivers/mtd/nand/Kconfig linux-rpi/drivers/mtd/nand/Kconfig
+--- linux-4.1.10/drivers/mtd/nand/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/mtd/nand/Kconfig 2015-10-07 16:40:47.000000000 +0200
+@@ -41,6 +41,13 @@
+ tristate
+ default n
+
++config MTD_NAND_BCM2835_SMI
++ tristate "Use Broadcom's Secondary Memory Interface as a NAND controller (BCM283x)"
++ depends on (MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835) && BCM2835_SMI && MTD_NAND
++ default m
++ help
++ Uses the BCM2835's SMI peripheral as a NAND controller.
++
+ config MTD_NAND_DENALI
+ tristate "Support Denali NAND controller"
+ depends on HAS_DMA
+diff -Nur linux-4.1.10/drivers/mtd/nand/Makefile linux-rpi/drivers/mtd/nand/Makefile
+--- linux-4.1.10/drivers/mtd/nand/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/mtd/nand/Makefile 2015-10-07 16:40:47.000000000 +0200
+@@ -14,6 +14,7 @@
+ obj-$(CONFIG_MTD_NAND_DENALI_PCI) += denali_pci.o
+ obj-$(CONFIG_MTD_NAND_DENALI_DT) += denali_dt.o
+ obj-$(CONFIG_MTD_NAND_AU1550) += au1550nd.o
++obj-$(CONFIG_MTD_NAND_BCM2835_SMI) += bcm2835_smi_nand.o
+ obj-$(CONFIG_MTD_NAND_BF5XX) += bf5xx_nand.o
+ obj-$(CONFIG_MTD_NAND_S3C2410) += s3c2410.o
+ obj-$(CONFIG_MTD_NAND_DAVINCI) += davinci_nand.o
+diff -Nur linux-4.1.10/drivers/net/ethernet/microchip/enc28j60.c linux-rpi/drivers/net/ethernet/microchip/enc28j60.c
+--- linux-4.1.10/drivers/net/ethernet/microchip/enc28j60.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/net/ethernet/microchip/enc28j60.c 2015-10-07 16:40:48.000000000 +0200
@@ -1630,10 +1630,21 @@
return 0;
}
@@ -51559,9 +53989,9 @@ diff -Nur linux-4.1.6/drivers/net/ethernet/microchip/enc28j60.c linux-rpi/driver
},
.probe = enc28j60_probe,
.remove = enc28j60_remove,
-diff -Nur linux-4.1.6/drivers/net/usb/smsc95xx.c linux-rpi/drivers/net/usb/smsc95xx.c
---- linux-4.1.6/drivers/net/usb/smsc95xx.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/net/usb/smsc95xx.c 2015-08-26 10:26:08.605314274 +0200
+diff -Nur linux-4.1.10/drivers/net/usb/smsc95xx.c linux-rpi/drivers/net/usb/smsc95xx.c
+--- linux-4.1.10/drivers/net/usb/smsc95xx.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/net/usb/smsc95xx.c 2015-10-07 16:40:49.000000000 +0200
@@ -59,6 +59,7 @@
#define SUSPEND_SUSPEND3 (0x08)
#define SUSPEND_ALLMODES (SUSPEND_SUSPEND0 | SUSPEND_SUSPEND1 | \
@@ -51662,9 +54092,9 @@ diff -Nur linux-4.1.6/drivers/net/usb/smsc95xx.c linux-rpi/drivers/net/usb/smsc9
usbnet_skb_return(dev, ax_skb);
}
-diff -Nur linux-4.1.6/drivers/net/wireless/Kconfig linux-rpi/drivers/net/wireless/Kconfig
---- linux-4.1.6/drivers/net/wireless/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/net/wireless/Kconfig 2015-08-26 10:26:08.617314440 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/Kconfig linux-rpi/drivers/net/wireless/Kconfig
+--- linux-4.1.10/drivers/net/wireless/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/net/wireless/Kconfig 2015-10-07 16:40:49.000000000 +0200
@@ -277,7 +277,9 @@
source "drivers/net/wireless/orinoco/Kconfig"
source "drivers/net/wireless/p54/Kconfig"
@@ -51676,9 +54106,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/Kconfig linux-rpi/drivers/net/wireles
source "drivers/net/wireless/ti/Kconfig"
source "drivers/net/wireless/zd1211rw/Kconfig"
source "drivers/net/wireless/mwifiex/Kconfig"
-diff -Nur linux-4.1.6/drivers/net/wireless/Makefile linux-rpi/drivers/net/wireless/Makefile
---- linux-4.1.6/drivers/net/wireless/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/net/wireless/Makefile 2015-08-26 10:26:08.617314440 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/Makefile linux-rpi/drivers/net/wireless/Makefile
+--- linux-4.1.10/drivers/net/wireless/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/net/wireless/Makefile 2015-10-07 16:40:49.000000000 +0200
@@ -24,7 +24,8 @@
obj-$(CONFIG_ZD1211RW) += zd1211rw/
obj-$(CONFIG_RTL8180) += rtl818x/
@@ -51698,9 +54128,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/Makefile linux-rpi/drivers/net/wirele
obj-$(CONFIG_P54_COMMON) += p54/
obj-$(CONFIG_ATH_CARDS) += ath/
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/Kconfig linux-rpi/drivers/net/wireless/mediatek/Kconfig
---- linux-4.1.6/drivers/net/wireless/mediatek/Kconfig 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/Kconfig 2015-08-26 10:26:08.721315886 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/Kconfig linux-rpi/drivers/net/wireless/mediatek/Kconfig
+--- linux-4.1.10/drivers/net/wireless/mediatek/Kconfig 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/Kconfig 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,10 @@
+menuconfig WL_MEDIATEK
+ bool "Mediatek Wireless LAN support"
@@ -51712,37 +54142,14 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/Kconfig linux-rpi/drivers/ne
+if WL_MEDIATEK
+source "drivers/net/wireless/mediatek/mt7601u/Kconfig"
+endif # WL_MEDIATEK
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/Makefile linux-rpi/drivers/net/wireless/mediatek/Makefile
---- linux-4.1.6/drivers/net/wireless/mediatek/Makefile 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/Makefile 2015-08-26 10:26:08.721315886 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/Makefile linux-rpi/drivers/net/wireless/mediatek/Makefile
+--- linux-4.1.10/drivers/net/wireless/mediatek/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/Makefile 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1 @@
+obj-$(CONFIG_MT7601U) += mt7601u/
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/Kconfig linux-rpi/drivers/net/wireless/mediatek/mt7601u/Kconfig
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/Kconfig 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/Kconfig 2015-08-26 10:26:08.721315886 +0200
-@@ -0,0 +1,6 @@
-+config MT7601U
-+ tristate "MediaTek MT7601U (USB) support"
-+ depends on MAC80211
-+ depends on USB
-+ ---help---
-+ This adds support for MT7601U-based wireless USB dongles.
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/Makefile linux-rpi/drivers/net/wireless/mediatek/mt7601u/Makefile
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/Makefile 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/Makefile 2015-08-26 10:26:08.721315886 +0200
-@@ -0,0 +1,9 @@
-+ccflags-y += -D__CHECK_ENDIAN__
-+
-+obj-$(CONFIG_MT7601U) += mt7601u.o
-+
-+mt7601u-objs = \
-+ usb.o init.o main.o mcu.o trace.o dma.o core.o eeprom.o phy.o \
-+ mac.o util.o debugfs.o tx.o
-+
-+CFLAGS_trace.o := -I$(src)
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/core.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/core.c
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/core.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/core.c 2015-08-26 10:26:08.721315886 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/core.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/core.c
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/core.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/core.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org>
@@ -51822,9 +54229,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/core.c linux-rpi/dri
+
+ return false;
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/debugfs.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/debugfs.c
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/debugfs.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/debugfs.c 2015-08-26 10:26:08.721315886 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/debugfs.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/debugfs.c
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/debugfs.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/debugfs.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,172 @@
+/*
+ * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org>
@@ -51998,10 +54405,10 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/debugfs.c linux-rpi/
+ debugfs_create_file("eeprom_param", S_IRUSR, dir, dev,
+ &fops_eeprom_param);
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/dma.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/dma.c
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/dma.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/dma.c 2015-08-26 10:26:08.721315886 +0200
-@@ -0,0 +1,505 @@
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/dma.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/dma.c
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/dma.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/dma.c 2015-10-07 16:40:50.000000000 +0200
+@@ -0,0 +1,529 @@
+/*
+ * Copyright (C) 2015 Jakub Kicinski <kubakici@wp.pl>
+ *
@@ -52116,7 +54523,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/dma.c linux-rpi/driv
+ if (!skb)
+ return;
+
-+ ieee80211_rx_ni(dev->hw, skb);
++ spin_lock(&dev->mac_lock);
++ ieee80211_rx(dev->hw, skb);
++ spin_unlock(&dev->mac_lock);
+}
+
+static u16 mt7601u_rx_next_seg_len(u8 *data, u32 data_len)
@@ -52240,23 +54649,42 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/dma.c linux-rpi/driv
+ skb = q->e[q->start].skb;
+ trace_mt_tx_dma_done(dev, skb);
+
-+ mt7601u_tx_status(dev, skb);
++ __skb_queue_tail(&dev->tx_skb_done, skb);
++ tasklet_schedule(&dev->tx_tasklet);
+
+ if (q->used == q->entries - q->entries / 8)
+ ieee80211_wake_queue(dev->hw, skb_get_queue_mapping(skb));
+
+ q->start = (q->start + 1) % q->entries;
+ q->used--;
++out:
++ spin_unlock_irqrestore(&dev->tx_lock, flags);
++}
+
-+ if (urb->status)
-+ goto out;
++static void mt7601u_tx_tasklet(unsigned long data)
++{
++ struct mt7601u_dev *dev = (struct mt7601u_dev *) data;
++ struct sk_buff_head skbs;
++ unsigned long flags;
++
++ __skb_queue_head_init(&skbs);
++
++ spin_lock_irqsave(&dev->tx_lock, flags);
+
+ set_bit(MT7601U_STATE_MORE_STATS, &dev->state);
+ if (!test_and_set_bit(MT7601U_STATE_READING_STATS, &dev->state))
+ queue_delayed_work(dev->stat_wq, &dev->stat_work,
+ msecs_to_jiffies(10));
-+out:
++
++ skb_queue_splice_init(&dev->tx_skb_done, &skbs);
++
+ spin_unlock_irqrestore(&dev->tx_lock, flags);
++
++ while (!skb_queue_empty(&skbs)) {
++ struct sk_buff *skb = __skb_dequeue(&skbs);
++
++ mt7601u_tx_status(dev, skb);
++ }
+}
+
+static int mt7601u_dma_submit_tx(struct mt7601u_dev *dev,
@@ -52479,6 +54907,7 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/dma.c linux-rpi/driv
+{
+ int ret = -ENOMEM;
+
++ tasklet_init(&dev->tx_tasklet, mt7601u_tx_tasklet, (unsigned long) dev);
+ tasklet_init(&dev->rx_tasklet, mt7601u_rx_tasklet, (unsigned long) dev);
+
+ ret = mt7601u_alloc_tx(dev);
@@ -52506,10 +54935,12 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/dma.c linux-rpi/driv
+
+ mt7601u_free_rx(dev);
+ mt7601u_free_tx(dev);
++
++ tasklet_kill(&dev->tx_tasklet);
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/dma.h linux-rpi/drivers/net/wireless/mediatek/mt7601u/dma.h
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/dma.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/dma.h 2015-08-26 10:26:08.721315886 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/dma.h linux-rpi/drivers/net/wireless/mediatek/mt7601u/dma.h
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/dma.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/dma.h 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org>
@@ -52638,9 +55069,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/dma.h linux-rpi/driv
+};
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/eeprom.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/eeprom.c
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/eeprom.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/eeprom.c 2015-08-26 10:26:08.721315886 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/eeprom.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/eeprom.c
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/eeprom.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/eeprom.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,418 @@
+/*
+ * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org>
@@ -53060,9 +55491,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/eeprom.c linux-rpi/d
+ kfree(eeprom);
+ return ret;
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/eeprom.h linux-rpi/drivers/net/wireless/mediatek/mt7601u/eeprom.h
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/eeprom.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/eeprom.h 2015-08-26 10:26:08.721315886 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/eeprom.h linux-rpi/drivers/net/wireless/mediatek/mt7601u/eeprom.h
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/eeprom.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/eeprom.h 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,151 @@
+/*
+ * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org>
@@ -53215,10 +55646,10 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/eeprom.h linux-rpi/d
+}
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/init.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/init.c
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/init.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/init.c 2015-08-26 10:26:08.721315886 +0200
-@@ -0,0 +1,628 @@
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/init.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/init.c
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/init.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/init.c 2015-10-07 16:40:50.000000000 +0200
+@@ -0,0 +1,630 @@
+/*
+ * (c) Copyright 2002-2010, Ralink Technology, Inc.
+ * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org>
@@ -53675,8 +56106,10 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/init.c linux-rpi/dri
+ spin_lock_init(&dev->tx_lock);
+ spin_lock_init(&dev->rx_lock);
+ spin_lock_init(&dev->lock);
++ spin_lock_init(&dev->mac_lock);
+ spin_lock_init(&dev->con_mon_lock);
+ atomic_set(&dev->avg_ampdu_len, 1);
++ skb_queue_head_init(&dev->tx_skb_done);
+
+ dev->stat_wq = alloc_workqueue("mt7601u", WQ_UNBOUND, 0);
+ if (!dev->stat_wq) {
@@ -53847,9 +56280,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/init.c linux-rpi/dri
+
+ return 0;
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/initvals.h linux-rpi/drivers/net/wireless/mediatek/mt7601u/initvals.h
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/initvals.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/initvals.h 2015-08-26 10:26:08.721315886 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/initvals.h linux-rpi/drivers/net/wireless/mediatek/mt7601u/initvals.h
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/initvals.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/initvals.h 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,164 @@
+/*
+ * (c) Copyright 2002-2010, Ralink Technology, Inc.
@@ -54015,9 +56448,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/initvals.h linux-rpi
+};
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/initvals_phy.h linux-rpi/drivers/net/wireless/mediatek/mt7601u/initvals_phy.h
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/initvals_phy.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/initvals_phy.h 2015-08-26 10:26:08.721315886 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/initvals_phy.h linux-rpi/drivers/net/wireless/mediatek/mt7601u/initvals_phy.h
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/initvals_phy.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/initvals_phy.h 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,291 @@
+/*
+ * (c) Copyright 2002-2010, Ralink Technology, Inc.
@@ -54310,10 +56743,20 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/initvals_phy.h linux
+};
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/mac.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/mac.c
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/mac.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/mac.c 2015-08-26 10:26:08.721315886 +0200
-@@ -0,0 +1,573 @@
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/Kconfig linux-rpi/drivers/net/wireless/mediatek/mt7601u/Kconfig
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/Kconfig 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/Kconfig 2015-10-07 16:40:50.000000000 +0200
+@@ -0,0 +1,6 @@
++config MT7601U
++ tristate "MediaTek MT7601U (USB) support"
++ depends on MAC80211
++ depends on USB
++ ---help---
++ This adds support for MT7601U-based wireless USB dongles.
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/mac.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/mac.c
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/mac.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/mac.c 2015-10-07 16:40:50.000000000 +0200
+@@ -0,0 +1,577 @@
+/*
+ * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org>
+ * Copyright (C) 2015 Jakub Kicinski <kubakici@wp.pl>
@@ -54497,7 +56940,11 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/mac.c linux-rpi/driv
+ }
+
+ mt76_mac_fill_tx_status(dev, &info, stat);
++
++ spin_lock_bh(&dev->mac_lock);
+ ieee80211_tx_status_noskb(dev->hw, sta, &info);
++ spin_unlock_bh(&dev->mac_lock);
++
+ rcu_read_unlock();
+}
+
@@ -54887,9 +57334,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/mac.c linux-rpi/driv
+
+ return 0;
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/mac.h linux-rpi/drivers/net/wireless/mediatek/mt7601u/mac.h
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/mac.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/mac.h 2015-08-26 10:26:08.721315886 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/mac.h linux-rpi/drivers/net/wireless/mediatek/mt7601u/mac.h
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/mac.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/mac.h 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,178 @@
+/*
+ * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org>
@@ -55069,9 +57516,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/mac.h linux-rpi/driv
+void mt76_send_tx_status(struct mt7601u_dev *dev, struct mt76_tx_status *stat);
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/main.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/main.c
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/main.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/main.c 2015-08-26 10:26:08.721315886 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/main.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/main.c
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/main.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/main.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,413 @@
+/*
+ * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org>
@@ -55486,9 +57933,22 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/main.c linux-rpi/dri
+ .sta_rate_tbl_update = mt76_sta_rate_tbl_update,
+ .set_rts_threshold = mt7601u_set_rts_threshold,
+};
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/mcu.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/mcu.c
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/mcu.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/mcu.c 2015-08-26 10:26:08.721315886 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/Makefile linux-rpi/drivers/net/wireless/mediatek/mt7601u/Makefile
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/Makefile 2015-10-07 16:40:50.000000000 +0200
+@@ -0,0 +1,9 @@
++ccflags-y += -D__CHECK_ENDIAN__
++
++obj-$(CONFIG_MT7601U) += mt7601u.o
++
++mt7601u-objs = \
++ usb.o init.o main.o mcu.o trace.o dma.o core.o eeprom.o phy.o \
++ mac.o util.o debugfs.o tx.o
++
++CFLAGS_trace.o := -I$(src)
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/mcu.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/mcu.c
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/mcu.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/mcu.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,534 @@
+/*
+ * (c) Copyright 2002-2010, Ralink Technology, Inc.
@@ -56024,9 +58484,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/mcu.c linux-rpi/driv
+ usb_kill_urb(dev->mcu.resp.urb);
+ mt7601u_usb_free_buf(dev, &dev->mcu.resp);
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/mcu.h linux-rpi/drivers/net/wireless/mediatek/mt7601u/mcu.h
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/mcu.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/mcu.h 2015-08-26 10:26:08.721315886 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/mcu.h linux-rpi/drivers/net/wireless/mediatek/mt7601u/mcu.h
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/mcu.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/mcu.h 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org>
@@ -56122,10 +58582,10 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/mcu.h linux-rpi/driv
+int mt7601u_mcu_tssi_read_kick(struct mt7601u_dev *dev, int use_hvga);
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/mt7601u.h linux-rpi/drivers/net/wireless/mediatek/mt7601u/mt7601u.h
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/mt7601u.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/mt7601u.h 2015-08-26 10:26:08.721315886 +0200
-@@ -0,0 +1,390 @@
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/mt7601u.h linux-rpi/drivers/net/wireless/mediatek/mt7601u/mt7601u.h
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/mt7601u.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/mt7601u.h 2015-10-07 16:40:50.000000000 +0200
+@@ -0,0 +1,396 @@
+/*
+ * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org>
+ * Copyright (C) 2015 Jakub Kicinski <kubakici@wp.pl>
@@ -56269,12 +58729,13 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/mt7601u.h linux-rpi/
+/**
+ * struct mt7601u_dev - adapter structure
+ * @lock: protects @wcid->tx_rate.
++ * @mac_lock: locks out mac80211's tx status and rx paths.
+ * @tx_lock: protects @tx_q and changes of MT7601U_STATE_*_STATS
-+ flags in @state.
++ * flags in @state.
+ * @rx_lock: protects @rx_q.
+ * @con_mon_lock: protects @ap_bssid, @bcn_*, @avg_rssi.
+ * @mutex: ensures exclusive access from mac80211 callbacks.
-+ * @vendor_req_mutex: ensures atomicity of vendor requests.
++ * @vendor_req_mutex: protects @vend_buf, ensures atomicity of split writes.
+ * @reg_atomic_mutex: ensures atomicity of indirect register accesses
+ * (accesses to RF and BBP).
+ * @hw_atomic_mutex: ensures exclusive access to HW during critical
@@ -56305,6 +58766,7 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/mt7601u.h linux-rpi/
+ struct mt76_wcid __rcu *wcid[N_WCIDS];
+
+ spinlock_t lock;
++ spinlock_t mac_lock;
+
+ const u16 *beacon_offsets;
+
@@ -56312,6 +58774,8 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/mt7601u.h linux-rpi/
+ struct mt7601u_eeprom_params *ee;
+
+ struct mutex vendor_req_mutex;
++ void *vend_buf;
++
+ struct mutex reg_atomic_mutex;
+ struct mutex hw_atomic_mutex;
+
@@ -56325,7 +58789,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/mt7601u.h linux-rpi/
+
+ /* TX */
+ spinlock_t tx_lock;
++ struct tasklet_struct tx_tasklet;
+ struct mt7601u_tx_queue *tx_q;
++ struct sk_buff_head tx_skb_done;
+
+ atomic_t avg_ampdu_len;
+
@@ -56516,9 +58982,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/mt7601u.h linux-rpi/
+ struct mt76_wcid *wcid, int hw_q);
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/phy.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/phy.c
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/phy.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/phy.c 2015-08-26 10:26:08.721315886 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/phy.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/phy.c
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/phy.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/phy.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,1251 @@
+/*
+ * (c) Copyright 2002-2010, Ralink Technology, Inc.
@@ -57771,9 +60237,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/phy.c linux-rpi/driv
+
+ return 0;
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/regs.h linux-rpi/drivers/net/wireless/mediatek/mt7601u/regs.h
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/regs.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/regs.h 2015-08-26 10:26:08.721315886 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/regs.h linux-rpi/drivers/net/wireless/mediatek/mt7601u/regs.h
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/regs.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/regs.h 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,636 @@
+/*
+ * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org>
@@ -58411,9 +60877,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/regs.h linux-rpi/dri
+};
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/trace.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/trace.c
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/trace.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/trace.c 2015-08-26 10:26:08.721315886 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/trace.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/trace.c
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/trace.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/trace.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org>
@@ -58436,9 +60902,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/trace.c linux-rpi/dr
+#include "trace.h"
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/trace.h linux-rpi/drivers/net/wireless/mediatek/mt7601u/trace.h
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/trace.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/trace.h 2015-08-26 10:26:08.721315886 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/trace.h linux-rpi/drivers/net/wireless/mediatek/mt7601u/trace.h
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/trace.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/trace.h 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,400 @@
+/*
+ * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org>
@@ -58840,10 +61306,10 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/trace.h linux-rpi/dr
+#define TRACE_INCLUDE_FILE trace
+
+#include <trace/define_trace.h>
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/tx.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/tx.c
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/tx.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/tx.c 2015-08-26 10:26:08.721315886 +0200
-@@ -0,0 +1,319 @@
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/tx.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/tx.c
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/tx.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/tx.c 2015-10-07 16:40:50.000000000 +0200
+@@ -0,0 +1,322 @@
+/*
+ * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org>
+ * Copyright (C) 2015 Jakub Kicinski <kubakici@wp.pl>
@@ -58962,7 +61428,10 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/tx.c linux-rpi/drive
+ ieee80211_tx_info_clear_status(info);
+ info->status.rates[0].idx = -1;
+ info->flags |= IEEE80211_TX_STAT_ACK;
++
++ spin_lock(&dev->mac_lock);
+ ieee80211_tx_status(dev->hw, skb);
++ spin_unlock(&dev->mac_lock);
+}
+
+static int mt7601u_skb_rooms(struct mt7601u_dev *dev, struct sk_buff *skb)
@@ -59163,10 +61632,10 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/tx.c linux-rpi/drive
+
+ return 0;
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/usb.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/usb.c
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/usb.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/usb.c 2015-08-26 10:26:08.721315886 +0200
-@@ -0,0 +1,367 @@
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/usb.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/usb.c
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/usb.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/usb.c 2015-10-07 16:40:50.000000000 +0200
+@@ -0,0 +1,362 @@
+/*
+ * Copyright (C) 2015 Jakub Kicinski <kubakici@wp.pl>
+ *
@@ -59261,10 +61730,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/usb.c linux-rpi/driv
+ complete(cmpl);
+}
+
-+static int
-+__mt7601u_vendor_request(struct mt7601u_dev *dev, const u8 req,
-+ const u8 direction, const u16 val, const u16 offset,
-+ void *buf, const size_t buflen)
++int mt7601u_vendor_request(struct mt7601u_dev *dev, const u8 req,
++ const u8 direction, const u16 val, const u16 offset,
++ void *buf, const size_t buflen)
+{
+ int i, ret;
+ struct usb_device *usb_dev = mt7601u_to_usb_dev(dev);
@@ -59279,6 +61747,8 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/usb.c linux-rpi/driv
+ trace_mt_vend_req(dev, pipe, req, req_type, val, offset,
+ buf, buflen, ret);
+
++ if (ret == -ENODEV)
++ set_bit(MT7601U_STATE_REMOVED, &dev->state);
+ if (ret >= 0 || ret == -ENODEV)
+ return ret;
+
@@ -59291,25 +61761,6 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/usb.c linux-rpi/driv
+ return ret;
+}
+
-+int
-+mt7601u_vendor_request(struct mt7601u_dev *dev, const u8 req,
-+ const u8 direction, const u16 val, const u16 offset,
-+ void *buf, const size_t buflen)
-+{
-+ int ret;
-+
-+ mutex_lock(&dev->vendor_req_mutex);
-+
-+ ret = __mt7601u_vendor_request(dev, req, direction, val, offset,
-+ buf, buflen);
-+ if (ret == -ENODEV)
-+ set_bit(MT7601U_STATE_REMOVED, &dev->state);
-+
-+ mutex_unlock(&dev->vendor_req_mutex);
-+
-+ return ret;
-+}
-+
+void mt7601u_vendor_reset(struct mt7601u_dev *dev)
+{
+ mt7601u_vendor_request(dev, MT_VEND_DEV_MODE, USB_DIR_OUT,
@@ -59319,19 +61770,21 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/usb.c linux-rpi/driv
+u32 mt7601u_rr(struct mt7601u_dev *dev, u32 offset)
+{
+ int ret;
-+ __le32 reg;
-+ u32 val;
++ u32 val = ~0;
+
+ WARN_ONCE(offset > USHRT_MAX, "read high off:%08x", offset);
+
++ mutex_lock(&dev->vendor_req_mutex);
++
+ ret = mt7601u_vendor_request(dev, MT_VEND_MULTI_READ, USB_DIR_IN,
-+ 0, offset, &reg, sizeof(reg));
-+ val = le32_to_cpu(reg);
-+ if (ret > 0 && ret != sizeof(reg)) {
++ 0, offset, dev->vend_buf, MT_VEND_BUF);
++ if (ret == MT_VEND_BUF)
++ val = get_unaligned_le32(dev->vend_buf);
++ else if (ret > 0)
+ dev_err(dev->dev, "Error: wrong size read:%d off:%08x\n",
+ ret, offset);
-+ val = ~0;
-+ }
++
++ mutex_unlock(&dev->vendor_req_mutex);
+
+ trace_reg_read(dev, offset, val);
+ return val;
@@ -59342,12 +61795,17 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/usb.c linux-rpi/driv
+{
+ int ret;
+
++ mutex_lock(&dev->vendor_req_mutex);
++
+ ret = mt7601u_vendor_request(dev, req, USB_DIR_OUT,
+ val & 0xffff, offset, NULL, 0);
-+ if (ret)
-+ return ret;
-+ return mt7601u_vendor_request(dev, req, USB_DIR_OUT,
-+ val >> 16, offset + 2, NULL, 0);
++ if (!ret)
++ ret = mt7601u_vendor_request(dev, req, USB_DIR_OUT,
++ val >> 16, offset + 2, NULL, 0);
++
++ mutex_unlock(&dev->vendor_req_mutex);
++
++ return ret;
+}
+
+void mt7601u_wr(struct mt7601u_dev *dev, u32 offset, u32 val)
@@ -59444,6 +61902,12 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/usb.c linux-rpi/driv
+
+ usb_set_intfdata(usb_intf, dev);
+
++ dev->vend_buf = devm_kmalloc(dev->dev, MT_VEND_BUF, GFP_KERNEL);
++ if (!dev->vend_buf) {
++ ret = -ENOMEM;
++ goto err;
++ }
++
+ ret = mt7601u_assign_pipes(usb_intf, dev);
+ if (ret)
+ goto err;
@@ -59534,10 +61998,10 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/usb.c linux-rpi/driv
+ .disable_hub_initiated_lpm = 1,
+};
+module_usb_driver(mt7601u_driver);
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/usb.h linux-rpi/drivers/net/wireless/mediatek/mt7601u/usb.h
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/usb.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/usb.h 2015-08-26 10:26:08.721315886 +0200
-@@ -0,0 +1,77 @@
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/usb.h linux-rpi/drivers/net/wireless/mediatek/mt7601u/usb.h
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/usb.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/usb.h 2015-10-07 16:40:50.000000000 +0200
+@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2015 Jakub Kicinski <kubakici@wp.pl>
+ *
@@ -59563,6 +62027,8 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/usb.h linux-rpi/driv
+
+#define MT_VEND_DEV_MODE_RESET 1
+
++#define MT_VEND_BUF sizeof(__le32)
++
+enum mt_vendor_req {
+ MT_VEND_DEV_MODE = 1,
+ MT_VEND_WRITE = 2,
@@ -59615,9 +62081,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/usb.h linux-rpi/driv
+ const u16 offset, const u32 val);
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/util.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/util.c
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/util.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/util.c 2015-08-26 10:26:08.721315886 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/util.c linux-rpi/drivers/net/wireless/mediatek/mt7601u/util.c
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/util.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/util.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org>
@@ -59661,9 +62127,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/util.c linux-rpi/dri
+ skb->data[len + 1] = 0;
+ return 0;
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/util.h linux-rpi/drivers/net/wireless/mediatek/mt7601u/util.h
---- linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/util.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/util.h 2015-08-26 10:26:08.721315886 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/util.h linux-rpi/drivers/net/wireless/mediatek/mt7601u/util.h
+--- linux-4.1.10/drivers/net/wireless/mediatek/mt7601u/util.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/mediatek/mt7601u/util.h 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org>
@@ -59742,650 +62208,18 @@ diff -Nur linux-4.1.6/drivers/net/wireless/mediatek/mt7601u/util.h linux-rpi/dri
+ })
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/Kconfig linux-rpi/drivers/net/wireless/rtl8192cu/Kconfig
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/Kconfig 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/Kconfig 2015-08-26 10:26:08.745316219 +0200
-@@ -0,0 +1,9 @@
-+config RTL8192CU
-+ tristate "Realtek 8192C USB WiFi"
-+ depends on MAC80211 && USB
-+ select CFG80211_WEXT
-+ select WIRELESS_EXT
-+ select WEXT_PRIV
-+ ---help---
-+ This option adds the Realtek RTL8192CU USB device such as Edimax EW-7811Un.
-+
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/Makefile linux-rpi/drivers/net/wireless/rtl8192cu/Makefile
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/Makefile 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/Makefile 2015-08-26 10:26:08.745316219 +0200
-@@ -0,0 +1,615 @@
-+EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS)
-+EXTRA_CFLAGS += -O1
-+#EXTRA_CFLAGS += -O3
-+#EXTRA_CFLAGS += -Wall
-+#EXTRA_CFLAGS += -Wextra
-+#EXTRA_CFLAGS += -Werror
-+#EXTRA_CFLAGS += -pedantic
-+#EXTRA_CFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes
-+
-+EXTRA_CFLAGS += -Wno-unused-variable
-+EXTRA_CFLAGS += -Wno-unused-value
-+EXTRA_CFLAGS += -Wno-unused-label
-+EXTRA_CFLAGS += -Wno-unused-parameter
-+EXTRA_CFLAGS += -Wno-unused-function
-+EXTRA_CFLAGS += -Wno-unused
-+
-+EXTRA_CFLAGS += -Wno-uninitialized
-+
-+EXTRA_CFLAGS += -I$(src)/include
-+
-+CONFIG_AUTOCFG_CP = n
-+
-+CONFIG_RTL8192C = y
-+CONFIG_RTL8192D = n
-+CONFIG_RTL8723A = n
-+
-+CONFIG_USB_HCI = y
-+CONFIG_PCI_HCI = n
-+CONFIG_SDIO_HCI = n
-+
-+CONFIG_MP_INCLUDED = n
-+CONFIG_POWER_SAVING = y
-+CONFIG_USB_AUTOSUSPEND = n
-+CONFIG_HW_PWRP_DETECTION = n
-+CONFIG_WIFI_TEST = n
-+CONFIG_BT_COEXISTENCE = n
-+CONFIG_RTL8192CU_REDEFINE_1X1 = n
-+CONFIG_INTEL_WIDI = n
-+CONFIG_WAKE_ON_WLAN = n
-+
-+CONFIG_PLATFORM_I386_PC = y
-+CONFIG_PLATFORM_TI_AM3517 = n
-+CONFIG_PLATFORM_ANDROID_X86 = n
-+CONFIG_PLATFORM_JB_X86 = n
-+CONFIG_PLATFORM_ARM_S3C2K4 = n
-+CONFIG_PLATFORM_ARM_PXA2XX = n
-+CONFIG_PLATFORM_ARM_S3C6K4 = n
-+CONFIG_PLATFORM_MIPS_RMI = n
-+CONFIG_PLATFORM_RTD2880B = n
-+CONFIG_PLATFORM_MIPS_AR9132 = n
-+CONFIG_PLATFORM_RTK_DMP = n
-+CONFIG_PLATFORM_MIPS_PLM = n
-+CONFIG_PLATFORM_MSTAR389 = n
-+CONFIG_PLATFORM_MT53XX = n
-+CONFIG_PLATFORM_ARM_MX51_241H = n
-+CONFIG_PLATFORM_FS_MX61 = n
-+CONFIG_PLATFORM_ACTIONS_ATJ227X = n
-+CONFIG_PLATFORM_TEGRA3_CARDHU = n
-+CONFIG_PLATFORM_TEGRA4_DALMORE = n
-+CONFIG_PLATFORM_ARM_TCC8900 = n
-+CONFIG_PLATFORM_ARM_TCC8920 = n
-+CONFIG_PLATFORM_ARM_TCC8920_JB42 = n
-+CONFIG_PLATFORM_ARM_RK2818 = n
-+CONFIG_PLATFORM_ARM_TI_PANDA = n
-+CONFIG_PLATFORM_MIPS_JZ4760 = n
-+CONFIG_PLATFORM_DMP_PHILIPS = n
-+CONFIG_PLATFORM_TI_DM365 = n
-+CONFIG_PLATFORM_MN10300 = n
-+CONFIG_PLATFORM_MSTAR_TITANIA12 = n
-+CONFIG_PLATFORM_MSTAR_A3 = n
-+CONFIG_PLATFORM_ARM_SUNxI = n
-+CONFIG_PLATFORM_ARM_SUN6I = n
-+
-+CONFIG_DRVEXT_MODULE = n
-+
-+export TopDIR ?= $(shell pwd)
-+
-+
-+ifeq ($(CONFIG_RTL8192C), y)
-+
-+RTL871X = rtl8192c
-+
-+ifeq ($(CONFIG_USB_HCI), y)
-+MODULE_NAME = 8192cu
-+FW_FILES := hal/$(RTL871X)/usb/Hal8192CUHWImg.o
-+ifneq ($(CONFIG_WAKE_ON_WLAN), n)
-+FW_FILES += hal/$(RTL871X)/usb/Hal8192CUHWImg_wowlan.o
-+endif
-+endif
-+ifeq ($(CONFIG_PCI_HCI), y)
-+MODULE_NAME = 8192ce
-+FW_FILES := hal/$(RTL871X)/pci/Hal8192CEHWImg.o
-+endif
-+
-+CHIP_FILES := \
-+ hal/$(RTL871X)/$(RTL871X)_sreset.o \
-+ hal/$(RTL871X)/$(RTL871X)_xmit.o
-+CHIP_FILES += $(FW_FILES)
-+endif
-+
-+ifeq ($(CONFIG_RTL8192D), y)
-+
-+RTL871X = rtl8192d
-+
-+ifeq ($(CONFIG_USB_HCI), y)
-+MODULE_NAME = 8192du
-+FW_FILES := hal/$(RTL871X)/usb/Hal8192DUHWImg.o
-+ifneq ($(CONFIG_WAKE_ON_WLAN), n)
-+FW_FILES += hal/$(RTL871X)/usb/Hal8192DUHWImg_wowlan.o
-+endif
-+endif
-+ifeq ($(CONFIG_PCI_HCI), y)
-+MODULE_NAME = 8192de
-+FW_FILES := hal/$(RTL871X)/pci/Hal8192DEHWImg.o
-+endif
-+
-+CHIP_FILES := \
-+ hal/$(RTL871X)/$(RTL871X)_xmit.o
-+CHIP_FILES += $(FW_FILES)
-+endif
-+
-+ifeq ($(CONFIG_RTL8723A), y)
-+
-+RTL871X = rtl8723a
-+
-+ifeq ($(CONFIG_SDIO_HCI), y)
-+MODULE_NAME = 8723as
-+FW_FILES := hal/$(RTL871X)/sdio/Hal8723SHWImg.o
-+endif
-+
-+ifeq ($(CONFIG_USB_HCI), y)
-+MODULE_NAME = 8723au
-+FW_FILES := hal/$(RTL871X)/usb/Hal8723UHWImg.o
-+endif
-+
-+ifeq ($(CONFIG_PCI_HCI), y)
-+MODULE_NAME = 8723ae
-+FW_FILES := hal/$(RTL871X)/pci/Hal8723EHWImg.o
-+endif
-+
-+PWRSEQ_FILES := hal/HalPwrSeqCmd.o \
-+ hal/$(RTL871X)/Hal8723PwrSeq.o
-+
-+CHIP_FILES += $(FW_FILES) $(PWRSEQ_FILES)
-+
-+endif
-+
-+ifeq ($(CONFIG_SDIO_HCI), y)
-+HCI_NAME = sdio
-+endif
-+
-+ifeq ($(CONFIG_USB_HCI), y)
-+HCI_NAME = usb
-+endif
-+
-+ifeq ($(CONFIG_PCI_HCI), y)
-+HCI_NAME = pci
-+endif
-+
-+
-+_OS_INTFS_FILES := os_dep/osdep_service.o \
-+ os_dep/linux/os_intfs.o \
-+ os_dep/linux/$(HCI_NAME)_intf.o \
-+ os_dep/linux/$(HCI_NAME)_ops_linux.o \
-+ os_dep/linux/ioctl_linux.o \
-+ os_dep/linux/xmit_linux.o \
-+ os_dep/linux/mlme_linux.o \
-+ os_dep/linux/recv_linux.o \
-+ os_dep/linux/ioctl_cfg80211.o \
-+ os_dep/linux/rtw_android.o
-+
-+
-+_HAL_INTFS_FILES := hal/hal_intf.o \
-+ hal/hal_com.o \
-+ hal/dm.o \
-+ hal/$(RTL871X)/$(RTL871X)_hal_init.o \
-+ hal/$(RTL871X)/$(RTL871X)_phycfg.o \
-+ hal/$(RTL871X)/$(RTL871X)_rf6052.o \
-+ hal/$(RTL871X)/$(RTL871X)_dm.o \
-+ hal/$(RTL871X)/$(RTL871X)_rxdesc.o \
-+ hal/$(RTL871X)/$(RTL871X)_cmd.o \
-+ hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_halinit.o \
-+ hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_NAME)_led.o \
-+ hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_NAME)_xmit.o \
-+ hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_NAME)_recv.o
-+
-+ifeq ($(CONFIG_SDIO_HCI), y)
-+_HAL_INTFS_FILES += hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_ops.o
-+else
-+_HAL_INTFS_FILES += hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_ops_linux.o
-+endif
-+
-+ifeq ($(CONFIG_MP_INCLUDED), y)
-+_HAL_INTFS_FILES += hal/$(RTL871X)/$(RTL871X)_mp.o
-+endif
-+
-+_HAL_INTFS_FILES += $(CHIP_FILES)
-+
-+
-+ifeq ($(CONFIG_AUTOCFG_CP), y)
-+$(shell cp $(TopDIR)/autoconf_$(RTL871X)_$(HCI_NAME)_linux.h $(TopDIR)/include/autoconf.h)
-+endif
-+
-+
-+ifeq ($(CONFIG_USB_HCI), y)
-+ifeq ($(CONFIG_USB_AUTOSUSPEND), y)
-+EXTRA_CFLAGS += -DCONFIG_USB_AUTOSUSPEND
-+endif
-+endif
-+
-+ifeq ($(CONFIG_POWER_SAVING), y)
-+EXTRA_CFLAGS += -DCONFIG_POWER_SAVING
-+endif
-+
-+ifeq ($(CONFIG_HW_PWRP_DETECTION), y)
-+EXTRA_CFLAGS += -DCONFIG_HW_PWRP_DETECTION
-+endif
-+
-+ifeq ($(CONFIG_WIFI_TEST), y)
-+EXTRA_CFLAGS += -DCONFIG_WIFI_TEST
-+endif
-+
-+ifeq ($(CONFIG_BT_COEXISTENCE), y)
-+EXTRA_CFLAGS += -DCONFIG_BT_COEXISTENCE
-+endif
-+
-+ifeq ($(CONFIG_RTL8192CU_REDEFINE_1X1), y)
-+EXTRA_CFLAGS += -DRTL8192C_RECONFIG_TO_1T1R
-+endif
-+
-+ifeq ($(CONFIG_WAKE_ON_WLAN), y)
-+EXTRA_CFLAGS += -DCONFIG_WAKE_ON_WLAN
-+endif
-+
-+ifeq ($(CONFIG_INTEL_WIDI), y)
-+EXTRA_CFLAGS += -DCONFIG_INTEL_WIDI
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_I386_PC), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
-+SUBARCH := $(shell uname -m | sed -e s/i.86/i386/)
-+ARCH ?= $(SUBARCH)
-+CROSS_COMPILE ?=
-+KVER := $(shell uname -r)
-+KSRC := /lib/modules/$(KVER)/build
-+MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/
-+INSTALL_PREFIX :=
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_TI_AM3517), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_SHUTTLE
-+CROSS_COMPILE := arm-eabi-
-+KSRC := $(shell pwd)/../../../Android/kernel
-+ARCH := arm
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_MSTAR_TITANIA12), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_MSTAR -DCONFIG_PLATFORM_MSTAR_TITANIA12
-+ARCH:=mips
-+CROSS_COMPILE:= /usr/src/Mstar_kernel/mips-4.3/bin/mips-linux-gnu-
-+KVER:= 2.6.28.9
-+KSRC:= /usr/src/Mstar_kernel/2.6.28.9/
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_MSTAR_A3), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_MSTAR -DCONFIG_PLATFORM_MSTAR_A3
-+ARCH:=arm
-+CROSS_COMPILE:= arm-none-linux-gnueabi-
-+KVER:= 2.6.35.11
-+KSRC:= /home/gary/PERFORCE/THEALE/RedLion/2.6.35.11/
-+MODULE_NAME = wlan
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_ANDROID_X86), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
-+SUBARCH := $(shell uname -m | sed -e s/i.86/i386/)
-+ARCH := $(SUBARCH)
-+CROSS_COMPILE := /media/DATA-2/android-x86/ics-x86_20120130/prebuilt/linux-x86/toolchain/i686-unknown-linux-gnu-4.2.1/bin/i686-unknown-linux-gnu-
-+KSRC := /media/DATA-2/android-x86/ics-x86_20120130/out/target/product/generic_x86/obj/kernel
-+MODULE_NAME :=wlan
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_JB_X86), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
-+EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
-+EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
-+EXTRA_CFLAGS += -DCONFIG_P2P_IPS
-+SUBARCH := $(shell uname -m | sed -e s/i.86/i386/)
-+ARCH := $(SUBARCH)
-+CROSS_COMPILE := /home/android_sdk/android-x86_JB/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7/bin/i686-linux-android-
-+KSRC := /home/android_sdk/android-x86_JB/out/target/product/x86/obj/kernel/
-+MODULE_NAME :=wlan
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_ARM_PXA2XX), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
-+ARCH := arm
-+CROSS_COMPILE := arm-none-linux-gnueabi-
-+KVER := 2.6.34.1
-+KSRC ?= /usr/src/linux-2.6.34.1
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_ARM_S3C2K4), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
-+ARCH := arm
-+CROSS_COMPILE := arm-linux-
-+KVER := 2.6.24.7_$(ARCH)
-+KSRC := /usr/src/kernels/linux-$(KVER)
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_ARM_S3C6K4), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
-+ARCH := arm
-+CROSS_COMPILE := arm-none-linux-gnueabi-
-+KVER := 2.6.34.1
-+KSRC ?= /usr/src/linux-2.6.34.1
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_RTD2880B), y)
-+EXTRA_CFLAGS += -DCONFIG_BIG_ENDIAN -DCONFIG_PLATFORM_RTD2880B
-+ARCH:=
-+CROSS_COMPILE:=
-+KVER:=
-+KSRC:=
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_MIPS_RMI), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
-+ARCH:=mips
-+CROSS_COMPILE:=mipsisa32r2-uclibc-
-+KVER:=
-+KSRC:= /root/work/kernel_realtek
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_MIPS_PLM), y)
-+EXTRA_CFLAGS += -DCONFIG_BIG_ENDIAN
-+ARCH:=mips
-+CROSS_COMPILE:=mipsisa32r2-uclibc-
-+KVER:=
-+KSRC:= /root/work/kernel_realtek
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_MSTAR389), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_MSTAR389
-+ARCH:=mips
-+CROSS_COMPILE:= mips-linux-gnu-
-+KVER:= 2.6.28.10
-+KSRC:= /home/mstar/mstar_linux/2.6.28.9/
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_MIPS_AR9132), y)
-+EXTRA_CFLAGS += -DCONFIG_BIG_ENDIAN
-+ARCH := mips
-+CROSS_COMPILE := mips-openwrt-linux-
-+KSRC := /home/alex/test_openwrt/tmp/linux-2.6.30.9
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_DMP_PHILIPS), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DRTK_DMP_PLATFORM
-+ARCH := mips
-+#CROSS_COMPILE:=/usr/local/msdk-4.3.6-mips-EL-2.6.12.6-0.9.30.3/bin/mipsel-linux-
-+CROSS_COMPILE:=/usr/local/toolchain_mipsel/bin/mipsel-linux-
-+KSRC ?=/usr/local/Jupiter/linux-2.6.12
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_RTK_DMP), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DRTK_DMP_PLATFORM
-+ARCH:=mips
-+CROSS_COMPILE:=mipsel-linux-
-+KVER:=
-+KSRC ?= /usr/src/DMP_Kernel/jupiter/linux-2.6.12
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_MT53XX), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_MT53XX
-+ARCH:= arm
-+CROSS_COMPILE:= arm11_mtk_le-
-+KVER:= 2.6.27
-+KSRC?= /proj/mtk00802/BD_Compare/BDP/Dev/BDP_V301/BDP_Linux/linux-2.6.27
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_ARM_MX51_241H), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_WISTRON_PLATFORM
-+ARCH := arm
-+CROSS_COMPILE := /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-
-+KVER := 2.6.31
-+KSRC ?= /lib/modules/2.6.31-770-g0e46b52/source
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_FS_MX61), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
-+ARCH := arm
-+CROSS_COMPILE := /home/share/CusEnv/FreeScale/arm-eabi-4.4.3/bin/arm-eabi-
-+KSRC ?= /home/share/CusEnv/FreeScale/FS_kernel_env
-+endif
-+
-+
-+
-+ifeq ($(CONFIG_PLATFORM_ACTIONS_ATJ227X), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ACTIONS_ATJ227X
-+ARCH := mips
-+CROSS_COMPILE := /home/cnsd4/project/actions/tools-2.6.27/bin/mipsel-linux-gnu-
-+KVER := 2.6.27
-+KSRC := /home/cnsd4/project/actions/linux-2.6.27.28
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_TI_DM365), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_TI_DM365
-+ARCH := arm
-+CROSS_COMPILE := /home/cnsd4/Appro/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/bin/arm_v5t_le-
-+KVER := 2.6.18
-+KSRC := /home/cnsd4/Appro/mv_pro_5.0/montavista/pro/devkit/lsp/ti-davinci/linux-dm365
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_TEGRA3_CARDHU), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
-+# default setting for Android 4.1, 4.2
-+EXTRA_CFLAGS += -DRTW_ENABLE_WIFI_CONTROL_FUNC
-+EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
-+EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
-+EXTRA_CFLAGS += -DCONFIG_P2P_IPS
-+ARCH := arm
-+CROSS_COMPILE := /home/android_sdk/nvidia/tegra-16r3-partner-android-4.1_20120723/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
-+KSRC := /home/android_sdk/nvidia/tegra-16r3-partner-android-4.1_20120723/out/target/product/cardhu/obj/KERNEL
-+MODULE_NAME := wlan
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_TEGRA4_DALMORE), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
-+# default setting for Android 4.1, 4.2
-+EXTRA_CFLAGS += -DRTW_ENABLE_WIFI_CONTROL_FUNC
-+EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
-+EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
-+EXTRA_CFLAGS += -DCONFIG_P2P_IPS
-+ARCH := arm
-+CROSS_COMPILE := /home/android_sdk/nvidia/tegra-17r9-partner-android-4.2-dalmore_20130131/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
-+KSRC := /home/android_sdk/nvidia/tegra-17r9-partner-android-4.2-dalmore_20130131/out/target/product/dalmore/obj/KERNEL
-+MODULE_NAME := wlan
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_ARM_TCC8900), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
-+ARCH := arm
-+CROSS_COMPILE := /home/android_sdk/Telechips/SDK_2304_20110613/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
-+KSRC := /home/android_sdk/Telechips/SDK_2304_20110613/kernel
-+MODULE_NAME := wlan
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_ARM_TCC8920), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
-+ARCH := arm
-+CROSS_COMPILE := /home/android_sdk/Telechips/v12.06_r1-tcc-android-4.0.4/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
-+KSRC := /home/android_sdk/Telechips/v12.06_r1-tcc-android-4.0.4/kernel
-+MODULE_NAME := wlan
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_ARM_TCC8920_JB42), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
-+# default setting for Android 4.1, 4.2
-+EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
-+EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
-+EXTRA_CFLAGS += -DCONFIG_P2P_IPS
-+ARCH := arm
-+CROSS_COMPILE := /home/android_sdk/Telechips/v13.03_r1-tcc-android-4.2.2_ds_patched/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
-+KSRC := /home/android_sdk/Telechips/v13.03_r1-tcc-android-4.2.2_ds_patched/kernel
-+MODULE_NAME := wlan
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_ARM_RK2818), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_ROCKCHIPS -DCONFIG_MINIMAL_MEMORY_USAGE
-+ARCH := arm
-+CROSS_COMPILE := /usr/src/release_fae_version/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
-+KSRC := /usr/src/release_fae_version/kernel25_A7_281x
-+MODULE_NAME := wlan
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_ARM_TI_PANDA), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN #-DCONFIG_MINIMAL_MEMORY_USAGE
-+ARCH := arm
-+#CROSS_COMPILE := /media/DATA-1/aosp/ics-aosp_20111227/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
-+#KSRC := /media/DATA-1/aosp/android-omap-panda-3.0_20120104
-+CROSS_COMPILE := /media/DATA-1/android-4.0/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
-+KSRC := /media/DATA-1/android-4.0/panda_kernel/omap
-+MODULE_NAME := wlan
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_MIPS_JZ4760), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_MINIMAL_MEMORY_USAGE
-+ARCH ?= mips
-+CROSS_COMPILE ?= /mnt/sdb5/Ingenic/Umido/mips-4.3/bin/mips-linux-gnu-
-+KSRC ?= /mnt/sdb5/Ingenic/Umido/kernel
-+endif
-+
-+#Add setting for MN10300
-+ifeq ($(CONFIG_PLATFORM_MN10300), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_MN10300
-+ARCH := mn10300
-+CROSS_COMPILE := mn10300-linux-
-+KVER := 2.6.32.2
-+KSRC := /home/winuser/work/Plat_sLD2T_V3010/usr/src/linux-2.6.32.2
-+INSTALL_PREFIX :=
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_ARM_SUNxI), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ARM_SUNxI
-+ARCH := arm
-+CROSS_COMPILE := arm-none-linux-gnueabi-
-+KVER := 3.0.8
-+#KSRC:= ../lichee/linux-3.0/
-+endif
-+
-+ifeq ($(CONFIG_PLATFORM_ARM_SUN6I), y)
-+EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
-+EXTRA_CFLAGS += -DCONFIG_PLATFORM_ARM_SUN6I
-+EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_TX
-+EXTRA_CFLAGS += -DCONFIG_TRAFFIC_PROTECT
-+# default setting for Android 4.1, 4.2
-+EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
-+EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
-+EXTRA_CFLAGS += -DCONFIG_P2P_IPS
-+ARCH := arm
-+CROSS_COMPILE := arm-none-linux-gnueabi-
-+KVER := 3.3.0
-+#KSRC:= ../lichee/linux-3.3/
-+endif
-+
-+ifneq ($(USER_MODULE_NAME),)
-+MODULE_NAME := $(USER_MODULE_NAME)
-+endif
-+
-+ifeq ($(CONFIG_MP_INCLUDED), y)
-+MODULE_NAME := $(MODULE_NAME)_mp
-+EXTRA_CFLAGS += -DCONFIG_MP_INCLUDED
-+endif
-+
-+
-+ifneq ($(KERNELRELEASE),)
-+
-+
-+rtk_core := core/rtw_cmd.o \
-+ core/rtw_security.o \
-+ core/rtw_debug.o \
-+ core/rtw_io.o \
-+ core/rtw_ioctl_query.o \
-+ core/rtw_ioctl_set.o \
-+ core/rtw_ieee80211.o \
-+ core/rtw_mlme.o \
-+ core/rtw_mlme_ext.o \
-+ core/rtw_wlan_util.o \
-+ core/rtw_pwrctrl.o \
-+ core/rtw_rf.o \
-+ core/rtw_recv.o \
-+ core/rtw_sta_mgt.o \
-+ core/rtw_ap.o \
-+ core/rtw_xmit.o \
-+ core/rtw_p2p.o \
-+ core/rtw_tdls.o \
-+ core/rtw_br_ext.o \
-+ core/rtw_iol.o \
-+ core/rtw_sreset.o
-+
-+$(MODULE_NAME)-y += $(rtk_core)
-+
-+$(MODULE_NAME)-$(CONFIG_INTEL_WIDI) += core/rtw_intel_widi.o
-+
-+$(MODULE_NAME)-y += core/efuse/rtw_efuse.o
-+
-+$(MODULE_NAME)-y += $(_HAL_INTFS_FILES)
-+
-+$(MODULE_NAME)-y += $(_OS_INTFS_FILES)
-+
-+$(MODULE_NAME)-$(CONFIG_MP_INCLUDED) += core/rtw_mp.o \
-+ core/rtw_mp_ioctl.o
-+
-+obj-$(CONFIG_RTL8192CU) := $(MODULE_NAME).o
-+
-+else
-+
-+export CONFIG_RTL8192CU = m
-+
-+all: modules
-+
-+modules:
-+ $(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KSRC) M=$(shell pwd) modules
-+
-+strip:
-+ $(CROSS_COMPILE)strip $(MODULE_NAME).ko --strip-unneeded
-+
-+install:
-+ install -p -m 644 $(MODULE_NAME).ko $(MODDESTDIR)
-+ /sbin/depmod -a ${KVER}
-+
-+uninstall:
-+ rm -f $(MODDESTDIR)/$(MODULE_NAME).ko
-+ /sbin/depmod -a ${KVER}
-+
-+
-+config_r:
-+ @echo "make config"
-+ /bin/bash script/Configure script/config.in
-+
-+.PHONY: modules clean
-+
-+clean:
-+ rm -fr *.mod.c *.mod *.o .*.cmd *.ko *~
-+ rm .tmp_versions -fr ; rm Module.symvers -fr
-+ rm -fr Module.markers ; rm -fr modules.order
-+ cd core/efuse ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
-+ cd core ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
-+ cd hal/$(RTL871X)/$(HCI_NAME) ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
-+ cd hal/$(RTL871X) ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
-+ cd hal ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
-+ cd os_dep/linux ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
-+ cd os_dep ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
-+endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/clean linux-rpi/drivers/net/wireless/rtl8192cu/clean
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/clean 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/clean 2015-08-26 10:26:08.745316219 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/clean linux-rpi/drivers/net/wireless/rtl8192cu/clean
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/clean 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/clean 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,5 @@
+#!/bin/bash
+rmmod 8192cu
+rmmod 8192ce
+rmmod 8192du
+rmmod 8192de
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/efuse/rtw_efuse.c linux-rpi/drivers/net/wireless/rtl8192cu/core/efuse/rtw_efuse.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/efuse/rtw_efuse.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/efuse/rtw_efuse.c 2015-08-26 10:26:08.745316219 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/efuse/rtw_efuse.c linux-rpi/drivers/net/wireless/rtl8192cu/core/efuse/rtw_efuse.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/efuse/rtw_efuse.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/efuse/rtw_efuse.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,1145 @@
+/******************************************************************************
+ *
@@ -61532,9 +63366,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/efuse/rtw_efuse.c linu
+}
+#endif //CONFIG_ADAPTOR_INFO_CACHING_FILE
+#endif //PLATFORM_LINUX
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_ap.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_ap.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_ap.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_ap.c 2015-08-26 10:26:08.745316219 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_ap.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_ap.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_ap.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_ap.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,2939 @@
+/******************************************************************************
+ *
@@ -64475,9 +66309,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_ap.c linux-rpi/dri
+
+#endif //CONFIG_NATIVEAP_MLME
+#endif //CONFIG_AP_MODE
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_br_ext.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_br_ext.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_br_ext.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_br_ext.c 2015-08-26 10:26:08.745316219 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_br_ext.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_br_ext.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_br_ext.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_br_ext.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,1699 @@
+/******************************************************************************
+ *
@@ -66178,9 +68012,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_br_ext.c linux-rpi
+}
+
+#endif // CONFIG_BR_EXT
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_cmd.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_cmd.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_cmd.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_cmd.c 2015-08-26 10:26:08.749316275 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_cmd.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_cmd.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_cmd.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_cmd.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,3034 @@
+/******************************************************************************
+ *
@@ -69216,9 +71050,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_cmd.c linux-rpi/dr
+_func_exit_;
+
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_debug.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_debug.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_debug.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_debug.c 2015-08-26 10:26:08.749316275 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_debug.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_debug.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_debug.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_debug.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,1336 @@
+/******************************************************************************
+ *
@@ -70556,9 +72390,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_debug.c linux-rpi/
+#endif /* CONFIG_DM_ADAPTIVITY */
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_eeprom.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_eeprom.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_eeprom.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_eeprom.c 2015-08-26 10:26:08.749316275 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_eeprom.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_eeprom.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_eeprom.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_eeprom.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,422 @@
+/******************************************************************************
+ *
@@ -70982,9 +72816,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_eeprom.c linux-rpi
+
+_func_exit_;
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_ieee80211.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_ieee80211.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_ieee80211.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_ieee80211.c 2015-08-26 10:26:08.749316275 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_ieee80211.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_ieee80211.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_ieee80211.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_ieee80211.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,1914 @@
+/******************************************************************************
+ *
@@ -72900,9 +74734,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_ieee80211.c linux-
+ action = (action >= ACT_PUBLIC_MAX) ? ACT_PUBLIC_MAX : action;
+ return _action_public_str[action];
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_io.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_io.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_io.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_io.c 2015-08-26 10:26:08.749316275 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_io.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_io.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_io.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_io.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,462 @@
+/******************************************************************************
+ *
@@ -73366,9 +75200,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_io.c linux-rpi/dri
+ return _rtw_writeN(adapter, addr, length, data);
+}
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_query.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_query.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_query.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_query.c 2015-08-26 10:26:08.749316275 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_query.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_query.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_query.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_query.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,195 @@
+/******************************************************************************
+ *
@@ -73565,9 +75399,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_query.c linu
+ return _TRUE;
+}
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_rtl.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_rtl.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_rtl.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_rtl.c 2015-08-26 10:26:08.749316275 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_rtl.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_rtl.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_rtl.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_rtl.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,1031 @@
+/******************************************************************************
+ *
@@ -74600,9 +76434,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_rtl.c linux-
+ return status;
+}
+//************** oid_rtl_seg_03_00 section end **************
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_set.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_set.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_set.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_set.c 2015-08-26 10:26:08.749316275 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_set.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_set.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_set.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_set.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,1493 @@
+/******************************************************************************
+ *
@@ -76097,9 +77931,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_set.c linux-
+ DBG_871X_LEVEL(_drv_always_, FUNC_ADPT_FMT" band:%d fail\n", FUNC_ADPT_ARG(adapter), band);
+ return _FAIL;
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_iol.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_iol.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_iol.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_iol.c 2015-08-26 10:26:08.749316275 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_iol.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_iol.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_iol.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_iol.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,262 @@
+/******************************************************************************
+ *
@@ -76363,9 +78197,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_iol.c linux-rpi/dr
+}
+
+#endif //CONFIG_IOL
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_mlme.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_mlme.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_mlme.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_mlme.c 2015-08-26 10:26:08.749316275 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_mlme.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_mlme.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_mlme.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_mlme.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,3966 @@
+/******************************************************************************
+ *
@@ -80333,9 +82167,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_mlme.c linux-rpi/d
+ return _FALSE;
+}
+#endif //CONFIG_CONCURRENT_MODE
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_mlme_ext.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_mlme_ext.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_mlme_ext.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_mlme_ext.c 2015-08-26 10:26:08.749316275 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_mlme_ext.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_mlme_ext.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_mlme_ext.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_mlme_ext.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,13599 @@
+/******************************************************************************
+ *
@@ -93936,9 +95770,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_mlme_ext.c linux-r
+#endif //CONFIG_TDLS
+
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_mp.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_mp.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_mp.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_mp.c 2015-08-26 10:26:08.749316275 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_mp.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_mp.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_mp.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_mp.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,1323 @@
+/******************************************************************************
+ *
@@ -95263,9 +97097,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_mp.c linux-rpi/dri
+}
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_mp_ioctl.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_mp_ioctl.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_mp_ioctl.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_mp_ioctl.c 2015-08-26 10:26:08.749316275 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_mp_ioctl.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_mp_ioctl.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_mp_ioctl.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_mp_ioctl.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,2953 @@
+/******************************************************************************
+ *
@@ -98220,9 +100054,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_mp_ioctl.c linux-r
+ return 0;
+#endif
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_p2p.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_p2p.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_p2p.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_p2p.c 2015-08-26 10:26:08.749316275 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_p2p.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_p2p.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_p2p.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_p2p.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,5293 @@
+/******************************************************************************
+ *
@@ -103517,9 +105351,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_p2p.c linux-rpi/dr
+}
+
+#endif //CONFIG_P2P
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_pwrctrl.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_pwrctrl.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_pwrctrl.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_pwrctrl.c 2015-08-26 10:26:08.749316275 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_pwrctrl.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_pwrctrl.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_pwrctrl.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_pwrctrl.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,1538 @@
+/******************************************************************************
+ *
@@ -105059,9 +106893,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_pwrctrl.c linux-rp
+ }
+ return 0;
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_recv.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_recv.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_recv.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_recv.c 2015-08-26 10:26:08.749316275 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_recv.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_recv.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_recv.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_recv.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,4286 @@
+/******************************************************************************
+ *
@@ -109349,9 +111183,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_recv.c linux-rpi/d
+
+}
+#endif //CONFIG_NEW_SIGNAL_STAT_PROCESS
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_rf.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_rf.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_rf.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_rf.c 2015-08-26 10:26:08.749316275 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_rf.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_rf.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_rf.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_rf.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,94 @@
+/******************************************************************************
+ *
@@ -109447,9 +111281,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_rf.c linux-rpi/dri
+
+ return ch;
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_security.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_security.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_security.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_security.c 2015-08-26 10:26:08.753316330 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_security.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_security.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_security.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_security.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,3114 @@
+/******************************************************************************
+ *
@@ -112565,9 +114399,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_security.c linux-r
+
+ return status;
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_sreset.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_sreset.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_sreset.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_sreset.c 2015-08-26 10:26:08.753316330 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_sreset.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_sreset.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_sreset.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_sreset.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,351 @@
+/******************************************************************************
+ *
@@ -112920,9 +114754,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_sreset.c linux-rpi
+ DBG_871X("%s done in %d ms\n", __FUNCTION__, rtw_get_passing_time_ms(start));
+#endif
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_sta_mgt.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_sta_mgt.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_sta_mgt.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_sta_mgt.c 2015-08-26 10:26:08.753316330 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_sta_mgt.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_sta_mgt.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_sta_mgt.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_sta_mgt.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,847 @@
+/******************************************************************************
+ *
@@ -113771,9 +115605,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_sta_mgt.c linux-rp
+ return res;
+
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_tdls.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_tdls.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_tdls.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_tdls.c 2015-08-26 10:26:08.753316330 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_tdls.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_tdls.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_tdls.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_tdls.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,2940 @@
+/******************************************************************************
+ *
@@ -116715,9 +118549,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_tdls.c linux-rpi/d
+}
+
+#endif //CONFIG_TDLS
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_wlan_util.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_wlan_util.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_wlan_util.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_wlan_util.c 2015-08-26 10:26:08.753316330 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_wlan_util.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_wlan_util.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_wlan_util.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_wlan_util.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,2304 @@
+/******************************************************************************
+ *
@@ -119023,9 +120857,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_wlan_util.c linux-
+exit:
+ return status;
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_xmit.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_xmit.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_xmit.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_xmit.c 2015-08-26 10:26:08.753316330 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_xmit.c linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_xmit.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/core/rtw_xmit.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/core/rtw_xmit.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,4155 @@
+/******************************************************************************
+ *
@@ -123182,188 +125016,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/core/rtw_xmit.c linux-rpi/d
+ }
+}
+#endif //CONFIG_XMIT_ACK
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/HalPwrSeqCmd.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/HalPwrSeqCmd.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/HalPwrSeqCmd.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/HalPwrSeqCmd.c 2015-08-26 10:26:08.753316330 +0200
-@@ -0,0 +1,175 @@
-+/******************************************************************************
-+ *
-+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of version 2 of the GNU General Public License as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-+ *
-+ *
-+ ******************************************************************************/
-+/*++
-+Copyright (c) Realtek Semiconductor Corp. All rights reserved.
-+
-+Module Name:
-+ HalPwrSeqCmd.c
-+
-+Abstract:
-+ Implement HW Power sequence configuration CMD handling routine for Realtek devices.
-+
-+Major Change History:
-+ When Who What
-+ ---------- --------------- -------------------------------
-+ 2011-10-26 Lucas Modify to be compatible with SD4-CE driver.
-+ 2011-07-07 Roger Create.
-+
-+--*/
-+#include <HalPwrSeqCmd.h>
-+#include <sdio_ops.h>
-+
-+
-+//
-+// Description:
-+// This routine deal with the Power Configuration CMDs parsing for RTL8723/RTL8188E Series IC.
-+//
-+// Assumption:
-+// We should follow specific format which was released from HW SD.
-+//
-+// 2011.07.07, added by Roger.
-+//
-+u8 HalPwrSeqCmdParsing(
-+ PADAPTER padapter,
-+ u8 CutVersion,
-+ u8 FabVersion,
-+ u8 InterfaceType,
-+ WLAN_PWR_CFG PwrSeqCmd[])
-+{
-+ WLAN_PWR_CFG PwrCfgCmd = {0};
-+ u8 bPollingBit = _FALSE;
-+ u32 AryIdx = 0;
-+ u8 value = 0;
-+ u32 offset = 0;
-+ u32 pollingCount = 0; // polling autoload done.
-+ u32 maxPollingCnt = 5000;
-+
-+ do {
-+ PwrCfgCmd = PwrSeqCmd[AryIdx];
-+
-+ RT_TRACE(_module_hal_init_c_ , _drv_info_,
-+ ("HalPwrSeqCmdParsing: offset(%#x) cut_msk(%#x) fab_msk(%#x) interface_msk(%#x) base(%#x) cmd(%#x) msk(%#x) value(%#x)\n",
-+ GET_PWR_CFG_OFFSET(PwrCfgCmd),
-+ GET_PWR_CFG_CUT_MASK(PwrCfgCmd),
-+ GET_PWR_CFG_FAB_MASK(PwrCfgCmd),
-+ GET_PWR_CFG_INTF_MASK(PwrCfgCmd),
-+ GET_PWR_CFG_BASE(PwrCfgCmd),
-+ GET_PWR_CFG_CMD(PwrCfgCmd),
-+ GET_PWR_CFG_MASK(PwrCfgCmd),
-+ GET_PWR_CFG_VALUE(PwrCfgCmd)));
-+
-+ //2 Only Handle the command whose FAB, CUT, and Interface are matched
-+ if ((GET_PWR_CFG_FAB_MASK(PwrCfgCmd) & FabVersion) &&
-+ (GET_PWR_CFG_CUT_MASK(PwrCfgCmd) & CutVersion) &&
-+ (GET_PWR_CFG_INTF_MASK(PwrCfgCmd) & InterfaceType))
-+ {
-+ switch (GET_PWR_CFG_CMD(PwrCfgCmd))
-+ {
-+ case PWR_CMD_READ:
-+ RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_READ\n"));
-+ break;
-+
-+ case PWR_CMD_WRITE:
-+ RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_WRITE\n"));
-+ offset = GET_PWR_CFG_OFFSET(PwrCfgCmd);
-+
-+#ifdef CONFIG_SDIO_HCI
-+ //
-+ // <Roger_Notes> We should deal with interface specific address mapping for some interfaces, e.g., SDIO interface
-+ // 2011.07.07.
-+ //
-+ if (GET_PWR_CFG_BASE(PwrCfgCmd) == PWR_BASEADDR_SDIO)
-+ {
-+ // Read Back SDIO Local value
-+ value = SdioLocalCmd52Read1Byte(padapter, offset);
-+
-+ value &= ~(GET_PWR_CFG_MASK(PwrCfgCmd));
-+ value |= (GET_PWR_CFG_VALUE(PwrCfgCmd) & GET_PWR_CFG_MASK(PwrCfgCmd));
-+
-+ // Write Back SDIO Local value
-+ SdioLocalCmd52Write1Byte(padapter, offset, value);
-+ }
-+ else
-+#endif
-+ {
-+ // Read the value from system register
-+ value = rtw_read8(padapter, offset);
-+
-+ value &= ~(GET_PWR_CFG_MASK(PwrCfgCmd));
-+ value |= (GET_PWR_CFG_VALUE(PwrCfgCmd) & GET_PWR_CFG_MASK(PwrCfgCmd));
-+
-+ // Write the value back to sytem register
-+ rtw_write8(padapter, offset, value);
-+ }
-+ break;
-+
-+ case PWR_CMD_POLLING:
-+ RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_POLLING\n"));
-+
-+ bPollingBit = _FALSE;
-+ offset = GET_PWR_CFG_OFFSET(PwrCfgCmd);
-+
-+ do {
-+#ifdef CONFIG_SDIO_HCI
-+ if (GET_PWR_CFG_BASE(PwrCfgCmd) == PWR_BASEADDR_SDIO)
-+ value = SdioLocalCmd52Read1Byte(padapter, offset);
-+ else
-+#endif
-+ value = rtw_read8(padapter, offset);
-+
-+ value &= GET_PWR_CFG_MASK(PwrCfgCmd);
-+ if (value == (GET_PWR_CFG_VALUE(PwrCfgCmd) & GET_PWR_CFG_MASK(PwrCfgCmd)))
-+ bPollingBit = _TRUE;
-+ else
-+ rtw_udelay_os(10);
-+
-+ if (pollingCount++ > maxPollingCnt) {
-+ RT_TRACE(_module_hal_init_c_ , _drv_err_, ("Fail to polling Offset[%#x]\n", offset));
-+ return _FALSE;
-+ }
-+ } while (!bPollingBit);
-+
-+ break;
-+
-+ case PWR_CMD_DELAY:
-+ RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_DELAY\n"));
-+ if (GET_PWR_CFG_VALUE(PwrCfgCmd) == PWRSEQ_DELAY_US)
-+ rtw_udelay_os(GET_PWR_CFG_OFFSET(PwrCfgCmd));
-+ else
-+ rtw_udelay_os(GET_PWR_CFG_OFFSET(PwrCfgCmd)*1000);
-+ break;
-+
-+ case PWR_CMD_END:
-+ // When this command is parsed, end the process
-+ RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_END\n"));
-+ return _TRUE;
-+ break;
-+
-+ default:
-+ RT_TRACE(_module_hal_init_c_ , _drv_err_, ("HalPwrSeqCmdParsing: Unknown CMD!!\n"));
-+ break;
-+ }
-+ }
-+
-+ AryIdx++;//Add Array Index
-+ }while(1);
-+
-+ return _TRUE;
-+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/dm.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/dm.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/dm.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/dm.c 2015-08-26 10:26:08.753316330 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/dm.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/dm.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/dm.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/dm.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,313 @@
+/******************************************************************************
+ *
@@ -123678,9 +125333,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/dm.c linux-rpi/drivers/
+ return;
+#endif /* CONFIG_DM_ADAPTIVITY */
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/dm.h linux-rpi/drivers/net/wireless/rtl8192cu/hal/dm.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/dm.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/dm.h 2015-08-26 10:26:08.753316330 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/dm.h linux-rpi/drivers/net/wireless/rtl8192cu/hal/dm.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/dm.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/dm.h 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,30 @@
+/******************************************************************************
+ *
@@ -123712,9 +125367,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/dm.h linux-rpi/drivers/
+void dm_adaptivity(_adapter *pAdapter);
+
+#endif /* __DM_H__ */
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/hal_com.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/hal_com.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/hal_com.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/hal_com.c 2015-08-26 10:26:08.753316330 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/hal_com.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/hal_com.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/hal_com.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/hal_com.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,370 @@
+/******************************************************************************
+ *
@@ -124086,9 +125741,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/hal_com.c linux-rpi/dri
+exit:
+ return ret;
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/hal_intf.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/hal_intf.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/hal_intf.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/hal_intf.c 2015-08-26 10:26:08.753316330 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/hal_intf.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/hal_intf.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/hal_intf.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/hal_intf.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,545 @@
+/******************************************************************************
+ *
@@ -124635,9 +126290,188 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/hal_intf.c linux-rpi/dr
+{
+ return adapter->HalFunc.c2h_id_filter_ccx;
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_cmd.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_cmd.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_cmd.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_cmd.c 2015-08-26 10:26:08.753316330 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/HalPwrSeqCmd.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/HalPwrSeqCmd.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/HalPwrSeqCmd.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/HalPwrSeqCmd.c 2015-10-07 16:40:50.000000000 +0200
+@@ -0,0 +1,175 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ *
++ ******************************************************************************/
++/*++
++Copyright (c) Realtek Semiconductor Corp. All rights reserved.
++
++Module Name:
++ HalPwrSeqCmd.c
++
++Abstract:
++ Implement HW Power sequence configuration CMD handling routine for Realtek devices.
++
++Major Change History:
++ When Who What
++ ---------- --------------- -------------------------------
++ 2011-10-26 Lucas Modify to be compatible with SD4-CE driver.
++ 2011-07-07 Roger Create.
++
++--*/
++#include <HalPwrSeqCmd.h>
++#include <sdio_ops.h>
++
++
++//
++// Description:
++// This routine deal with the Power Configuration CMDs parsing for RTL8723/RTL8188E Series IC.
++//
++// Assumption:
++// We should follow specific format which was released from HW SD.
++//
++// 2011.07.07, added by Roger.
++//
++u8 HalPwrSeqCmdParsing(
++ PADAPTER padapter,
++ u8 CutVersion,
++ u8 FabVersion,
++ u8 InterfaceType,
++ WLAN_PWR_CFG PwrSeqCmd[])
++{
++ WLAN_PWR_CFG PwrCfgCmd = {0};
++ u8 bPollingBit = _FALSE;
++ u32 AryIdx = 0;
++ u8 value = 0;
++ u32 offset = 0;
++ u32 pollingCount = 0; // polling autoload done.
++ u32 maxPollingCnt = 5000;
++
++ do {
++ PwrCfgCmd = PwrSeqCmd[AryIdx];
++
++ RT_TRACE(_module_hal_init_c_ , _drv_info_,
++ ("HalPwrSeqCmdParsing: offset(%#x) cut_msk(%#x) fab_msk(%#x) interface_msk(%#x) base(%#x) cmd(%#x) msk(%#x) value(%#x)\n",
++ GET_PWR_CFG_OFFSET(PwrCfgCmd),
++ GET_PWR_CFG_CUT_MASK(PwrCfgCmd),
++ GET_PWR_CFG_FAB_MASK(PwrCfgCmd),
++ GET_PWR_CFG_INTF_MASK(PwrCfgCmd),
++ GET_PWR_CFG_BASE(PwrCfgCmd),
++ GET_PWR_CFG_CMD(PwrCfgCmd),
++ GET_PWR_CFG_MASK(PwrCfgCmd),
++ GET_PWR_CFG_VALUE(PwrCfgCmd)));
++
++ //2 Only Handle the command whose FAB, CUT, and Interface are matched
++ if ((GET_PWR_CFG_FAB_MASK(PwrCfgCmd) & FabVersion) &&
++ (GET_PWR_CFG_CUT_MASK(PwrCfgCmd) & CutVersion) &&
++ (GET_PWR_CFG_INTF_MASK(PwrCfgCmd) & InterfaceType))
++ {
++ switch (GET_PWR_CFG_CMD(PwrCfgCmd))
++ {
++ case PWR_CMD_READ:
++ RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_READ\n"));
++ break;
++
++ case PWR_CMD_WRITE:
++ RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_WRITE\n"));
++ offset = GET_PWR_CFG_OFFSET(PwrCfgCmd);
++
++#ifdef CONFIG_SDIO_HCI
++ //
++ // <Roger_Notes> We should deal with interface specific address mapping for some interfaces, e.g., SDIO interface
++ // 2011.07.07.
++ //
++ if (GET_PWR_CFG_BASE(PwrCfgCmd) == PWR_BASEADDR_SDIO)
++ {
++ // Read Back SDIO Local value
++ value = SdioLocalCmd52Read1Byte(padapter, offset);
++
++ value &= ~(GET_PWR_CFG_MASK(PwrCfgCmd));
++ value |= (GET_PWR_CFG_VALUE(PwrCfgCmd) & GET_PWR_CFG_MASK(PwrCfgCmd));
++
++ // Write Back SDIO Local value
++ SdioLocalCmd52Write1Byte(padapter, offset, value);
++ }
++ else
++#endif
++ {
++ // Read the value from system register
++ value = rtw_read8(padapter, offset);
++
++ value &= ~(GET_PWR_CFG_MASK(PwrCfgCmd));
++ value |= (GET_PWR_CFG_VALUE(PwrCfgCmd) & GET_PWR_CFG_MASK(PwrCfgCmd));
++
++ // Write the value back to sytem register
++ rtw_write8(padapter, offset, value);
++ }
++ break;
++
++ case PWR_CMD_POLLING:
++ RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_POLLING\n"));
++
++ bPollingBit = _FALSE;
++ offset = GET_PWR_CFG_OFFSET(PwrCfgCmd);
++
++ do {
++#ifdef CONFIG_SDIO_HCI
++ if (GET_PWR_CFG_BASE(PwrCfgCmd) == PWR_BASEADDR_SDIO)
++ value = SdioLocalCmd52Read1Byte(padapter, offset);
++ else
++#endif
++ value = rtw_read8(padapter, offset);
++
++ value &= GET_PWR_CFG_MASK(PwrCfgCmd);
++ if (value == (GET_PWR_CFG_VALUE(PwrCfgCmd) & GET_PWR_CFG_MASK(PwrCfgCmd)))
++ bPollingBit = _TRUE;
++ else
++ rtw_udelay_os(10);
++
++ if (pollingCount++ > maxPollingCnt) {
++ RT_TRACE(_module_hal_init_c_ , _drv_err_, ("Fail to polling Offset[%#x]\n", offset));
++ return _FALSE;
++ }
++ } while (!bPollingBit);
++
++ break;
++
++ case PWR_CMD_DELAY:
++ RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_DELAY\n"));
++ if (GET_PWR_CFG_VALUE(PwrCfgCmd) == PWRSEQ_DELAY_US)
++ rtw_udelay_os(GET_PWR_CFG_OFFSET(PwrCfgCmd));
++ else
++ rtw_udelay_os(GET_PWR_CFG_OFFSET(PwrCfgCmd)*1000);
++ break;
++
++ case PWR_CMD_END:
++ // When this command is parsed, end the process
++ RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_END\n"));
++ return _TRUE;
++ break;
++
++ default:
++ RT_TRACE(_module_hal_init_c_ , _drv_err_, ("HalPwrSeqCmdParsing: Unknown CMD!!\n"));
++ break;
++ }
++ }
++
++ AryIdx++;//Add Array Index
++ }while(1);
++
++ return _TRUE;
++}
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_cmd.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_cmd.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_cmd.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_cmd.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,1154 @@
+/******************************************************************************
+ *
@@ -125793,9 +127627,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_cmd.c
+}
+
+#endif //CONFIG_WOWLAN
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_dm.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_dm.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_dm.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_dm.c 2015-08-26 10:26:08.753316330 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_dm.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_dm.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_dm.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_dm.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,5055 @@
+/******************************************************************************
+ *
@@ -130852,9 +132686,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_dm.c
+ }
+
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_hal_init.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_hal_init.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_hal_init.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_hal_init.c 2015-08-26 10:26:08.753316330 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_hal_init.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_hal_init.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_hal_init.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_hal_init.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,3627 @@
+/******************************************************************************
+ *
@@ -134483,9 +136317,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_hal_i
+ pHalFunc->c2h_handler = c2h_handler_8192c;
+ pHalFunc->c2h_id_filter_ccx = c2h_id_filter_ccx_8192c;
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_mp.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_mp.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_mp.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_mp.c 2015-08-26 10:26:08.753316330 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_mp.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_mp.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_mp.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_mp.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,1207 @@
+/******************************************************************************
+ *
@@ -135694,9 +137528,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_mp.c
+}
+
+#endif // CONFIG_MP_INCLUDE
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_phycfg.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_phycfg.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_phycfg.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_phycfg.c 2015-08-26 10:26:08.753316330 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_phycfg.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_phycfg.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_phycfg.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_phycfg.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,4840 @@
+/******************************************************************************
+ *
@@ -140538,9 +142372,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_phycf
+ _PHY_SetRFPathSwitch(pAdapter, bMain, _FALSE);
+ }
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rf6052.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rf6052.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rf6052.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rf6052.c 2015-08-26 10:26:08.753316330 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rf6052.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rf6052.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rf6052.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rf6052.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,1030 @@
+/******************************************************************************
+ *
@@ -141572,9 +143406,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rf605
+} /* PHY_RFShadowRead */
+
+/* End of HalRf6052.c */
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rxdesc.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rxdesc.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rxdesc.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rxdesc.c 2015-08-26 10:26:08.753316330 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rxdesc.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rxdesc.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rxdesc.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rxdesc.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,874 @@
+/******************************************************************************
+ *
@@ -142450,9 +144284,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rxdes
+ //Offset 20
+
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_sreset.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_sreset.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_sreset.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_sreset.c 2015-08-26 10:26:08.753316330 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_sreset.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_sreset.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_sreset.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_sreset.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,93 @@
+/******************************************************************************
+ *
@@ -142547,9 +144381,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_srese
+ }
+}
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_xmit.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_xmit.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_xmit.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_xmit.c 2015-08-26 10:26:08.753316330 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_xmit.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_xmit.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_xmit.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_xmit.c 2015-10-07 16:40:50.000000000 +0200
@@ -0,0 +1,62 @@
+/******************************************************************************
+ *
@@ -142613,9 +144447,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_xmit.
+ }
+}
+#endif //CONFIG_XMIT_ACK
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg.c 2015-08-26 10:26:08.757316386 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg.c 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,8757 @@
+/******************************************************************************
+ *
@@ -151374,9 +153208,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUH
+0xc78,0x621e001e,
+0xc78,0x621f001e,
+};
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg_wowlan.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg_wowlan.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg_wowlan.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg_wowlan.c 2015-08-26 10:26:08.757316386 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg_wowlan.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg_wowlan.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg_wowlan.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg_wowlan.c 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,2557 @@
+/******************************************************************************
+ *
@@ -153935,9 +155769,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUH
+0x94,0x01,0x40,0x1e,0x90,0xfd,0x11,0xe0,0xb5,0x05,0x14,0x90,0x01,0x17,0xe0,0xb5,
+0x05,0x07,0x90,0xfd,0x11,0xe4,0xf0,0x80,0x06,0xed,0x04,0x90,0xfd,0x11,0xf0,0xe4,
+0x2f,0xff,0x22,0x00,0x18,0x58,};
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_led.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_led.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_led.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_led.c 2015-08-26 10:26:08.757316386 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_led.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_led.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_led.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_led.c 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,2674 @@
+/******************************************************************************
+ *
@@ -156613,9 +158447,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_
+ DeInitLed871x( &(ledpriv->SwLed0) );
+ DeInitLed871x( &(ledpriv->SwLed1) );
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_recv.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_recv.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_recv.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_recv.c 2015-08-26 10:26:08.757316386 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_recv.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_recv.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_recv.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_recv.c 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,227 @@
+/******************************************************************************
+ *
@@ -156844,9 +158678,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_
+#endif
+
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_xmit.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_xmit.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_xmit.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_xmit.c 2015-08-26 10:26:08.757316386 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_xmit.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_xmit.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_xmit.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_xmit.c 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,1149 @@
+/******************************************************************************
+ *
@@ -157997,9 +159831,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_
+
+}
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_halinit.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_halinit.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_halinit.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_halinit.c 2015-08-26 10:26:08.757316386 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_halinit.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_halinit.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_halinit.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_halinit.c 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,6260 @@
+/******************************************************************************
+ *
@@ -164261,9 +166095,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_halini
+_func_exit_;
+
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_ce.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_ce.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_ce.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_ce.c 2015-08-26 10:26:08.757316386 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_ce.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_ce.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_ce.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_ce.c 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,1205 @@
+/******************************************************************************
+ *
@@ -165470,9 +167304,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_ce
+ return ret;
+
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_linux.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_linux.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_linux.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_linux.c 2015-08-26 10:26:08.757316386 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_linux.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_linux.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_linux.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_linux.c 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,1535 @@
+/******************************************************************************
+ *
@@ -167009,9 +168843,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_li
+ _func_exit_;
+
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_xp.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_xp.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_xp.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_xp.c 2015-08-26 10:26:08.757316386 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_xp.c linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_xp.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_xp.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_xp.c 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,1264 @@
+/******************************************************************************
+ *
@@ -168277,18 +170111,2581 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_xp
+ return ret;
+
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/ifcfg-wlan0 linux-rpi/drivers/net/wireless/rtl8192cu/ifcfg-wlan0
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/ifcfg-wlan0 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/ifcfg-wlan0 2015-08-26 10:26:08.757316386 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/ifcfg-wlan0 linux-rpi/drivers/net/wireless/rtl8192cu/ifcfg-wlan0
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/ifcfg-wlan0 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/ifcfg-wlan0 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,4 @@
+#DHCP client
+DEVICE=wlan0
+BOOTPROTO=dhcp
+ONBOOT=yes
\ No newline at end of file
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192CEHWImg.h linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192CEHWImg.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192CEHWImg.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192CEHWImg.h 2015-08-26 10:26:08.757316386 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/autoconf.h linux-rpi/drivers/net/wireless/rtl8192cu/include/autoconf.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/autoconf.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/autoconf.h 2015-10-07 16:40:51.000000000 +0200
+@@ -0,0 +1,336 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ *
++ ******************************************************************************/
++
++/*
++ * Public General Config
++ */
++#define AUTOCONF_INCLUDED
++#define RTL871X_MODULE_NAME "92CU"
++#define DRV_NAME "rtl8192cu"
++
++#define CONFIG_USB_HCI 1
++
++#define CONFIG_RTL8192C 1
++
++#define PLATFORM_LINUX 1
++
++//#define CONFIG_IOCTL_CFG80211 1
++#ifdef CONFIG_IOCTL_CFG80211
++ //#define RTW_USE_CFG80211_STA_EVENT /* Indecate new sta asoc through cfg80211_new_sta */
++ #define CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER
++ //#define CONFIG_DEBUG_CFG80211 1
++ //#define CONFIG_DRV_ISSUE_PROV_REQ // IOT FOR S2
++ #define CONFIG_SET_SCAN_DENY_TIMER
++#endif
++
++/*
++ * Internal General Config
++ */
++//#define CONFIG_PWRCTRL
++//#define CONFIG_H2CLBK
++
++#define CONFIG_EMBEDDED_FWIMG 1
++//#define CONFIG_FILE_FWIMG
++
++#ifdef CONFIG_WAKE_ON_WLAN
++#define CONFIG_WOWLAN 1
++#endif //CONFIG_WAKE_ON_WLAN
++
++#define CONFIG_R871X_TEST 1
++
++#define CONFIG_XMIT_ACK
++#ifdef CONFIG_XMIT_ACK
++ #define CONFIG_XMIT_ACK_POLLING
++ #define CONFIG_ACTIVE_KEEP_ALIVE_CHECK
++#endif
++
++#define CONFIG_80211N_HT 1
++
++#define CONFIG_RECV_REORDERING_CTRL 1
++
++//#define CONFIG_TCP_CSUM_OFFLOAD_RX 1
++
++//#define CONFIG_BEFORE_LINKED_DIG
++//#define CONFIG_DRVEXT_MODULE 1
++
++#ifndef CONFIG_MP_INCLUDED
++ #define CONFIG_IPS 1
++ #ifdef CONFIG_IPS
++ //#define CONFIG_IPS_LEVEL_2 1 //enable this to set default IPS mode to IPS_LEVEL_2
++ #endif
++
++ #define SUPPORT_HW_RFOFF_DETECTED 1
++
++ #define CONFIG_LPS 1
++ #define CONFIG_BT_COEXIST 1
++
++ //befor link
++ #define CONFIG_ANTENNA_DIVERSITY
++
++ //after link
++ #ifdef CONFIG_ANTENNA_DIVERSITY
++ #define CONFIG_SW_ANTENNA_DIVERSITY
++ //#define CONFIG_HW_ANTENNA_DIVERSITY
++ #endif
++
++ #define CONFIG_IOL
++#else //#ifndef CONFIG_MP_INCLUDED
++ #define CONFIG_MP_IWPRIV_SUPPORT 1
++#endif //#ifndef CONFIG_MP_INCLUDED
++
++#define CONFIG_AP_MODE 1
++#ifdef CONFIG_AP_MODE
++ #define CONFIG_NATIVEAP_MLME 1
++ #ifndef CONFIG_NATIVEAP_MLME
++ #define CONFIG_HOSTAPD_MLME 1
++ #endif
++ #define CONFIG_FIND_BEST_CHANNEL 1
++ //#define CONFIG_NO_WIRELESS_HANDLERS 1
++#endif
++
++// Added by Albert 20110314
++#define CONFIG_P2P 1
++#ifdef CONFIG_P2P
++ //Added by Albert 20110812
++ //The CONFIG_WFD is for supporting the Wi-Fi display
++ #define CONFIG_WFD
++
++ #ifndef CONFIG_WIFI_TEST
++ #define CONFIG_P2P_REMOVE_GROUP_INFO
++ #endif
++ //#define CONFIG_DBG_P2P
++
++ //#define CONFIG_P2P_PS
++ //#define CONFIG_P2P_IPS
++
++ #define P2P_OP_CHECK_SOCIAL_CH
++ // Added comment by Borg 2013/06/21
++ // Issue: Nexus 4 is hard to do miracast.
++ // Root Cause: After group formation,
++ // Nexus 4 is possible to be not at OP channel of Invitation Resp/Nego Confirm but at social channel.
++ // Patch: While scan OP channel,
++ // not only scan OP channel of Invitation Resp/Nego Confirm,
++ // but also scan social channel(1, 6, 11)
++#endif
++
++// Added by Kurt 20110511
++//#define CONFIG_TDLS 1
++#ifdef CONFIG_TDLS
++// #ifndef CONFIG_WFD
++// #define CONFIG_WFD 1
++// #endif
++// #define CONFIG_TDLS_AUTOSETUP 1
++// #define CONFIG_TDLS_AUTOCHECKALIVE 1
++#endif
++
++#define CONFIG_SKB_COPY 1//for amsdu
++
++#define CONFIG_LED
++#ifdef CONFIG_LED
++ #define CONFIG_SW_LED
++ #ifdef CONFIG_SW_LED
++ //#define CONFIG_LED_HANDLED_BY_CMD_THREAD
++ #endif
++#endif // CONFIG_LED
++
++
++
++#define USB_INTERFERENCE_ISSUE // this should be checked in all usb interface
++#define CONFIG_GLOBAL_UI_PID
++
++#define CONFIG_LAYER2_ROAMING
++#define CONFIG_LAYER2_ROAMING_RESUME
++//#define CONFIG_ADAPTOR_INFO_CACHING_FILE // now just applied on 8192cu only, should make it general...
++//#define CONFIG_RESUME_IN_WORKQUEUE
++//#define CONFIG_SET_SCAN_DENY_TIMER
++#define CONFIG_LONG_DELAY_ISSUE
++#define CONFIG_NEW_SIGNAL_STAT_PROCESS
++//#define CONFIG_SIGNAL_DISPLAY_DBM //display RX signal with dbm
++#define RTW_NOTCH_FILTER 0 /* 0:Disable, 1:Enable */
++#define CONFIG_DEAUTH_BEFORE_CONNECT
++
++#ifdef CONFIG_IOL
++ #define CONFIG_IOL_LLT
++ #define CONFIG_IOL_MAC
++ #define CONFIG_IOL_BB_PHY_REG
++ #define CONFIG_IOL_BB_AGC_TAB
++ #define CONFIG_IOL_RF_RF90_PATH_A
++ #define CONFIG_IOL_RF_RF90_PATH_B
++#endif
++
++#define CONFIG_BR_EXT 1 // Enable NAT2.5 support for STA mode interface with a L2 Bridge
++#ifdef CONFIG_BR_EXT
++#define CONFIG_BR_EXT_BRNAME "br0"
++#endif // CONFIG_BR_EXT
++
++#define CONFIG_TX_MCAST2UNI 1 // Support IP multicast->unicast
++//#define CONFIG_DM_ADAPTIVITY
++//#define CONFIG_CHECK_AC_LIFETIME 1 // Check packet lifetime of 4 ACs.
++
++//#define CONFIG_CONCURRENT_MODE 1
++#ifdef CONFIG_CONCURRENT_MODE
++ #define CONFIG_TSF_RESET_OFFLOAD 1 // For 2 PORT TSF SYNC.
++ //#define CONFIG_HWPORT_SWAP //Port0->Sec , Port1 -> Pri
++ //#define CONFIG_STA_MODE_SCAN_UNDER_AP_MODE
++ //#define CONFIG_MULTI_VIR_IFACES //besides primary&secondary interfaces, extend to support more interfaces
++#endif // CONFIG_CONCURRENT_MODE
++
++#define CONFIG_80211D
++
++/*
++ * Interface Related Config
++ */
++
++//#define CONFIG_USB_ONE_OUT_EP
++//#define CONFIG_USB_INTERRUPT_IN_PIPE 1
++
++#ifndef CONFIG_MINIMAL_MEMORY_USAGE
++ #define CONFIG_USB_TX_AGGREGATION 1
++ #define CONFIG_USB_RX_AGGREGATION 1
++#endif
++
++#define CONFIG_PREALLOC_RECV_SKB 1
++//#define CONFIG_REDUCE_USB_TX_INT 1 // Trade-off: Improve performance, but may cause TX URBs blocked by USB Host/Bus driver on few platforms.
++//#define CONFIG_EASY_REPLACEMENT 1
++
++/*
++ * CONFIG_USE_USB_BUFFER_ALLOC_XX uses Linux USB Buffer alloc API and is for Linux platform only now!
++ */
++//#define CONFIG_USE_USB_BUFFER_ALLOC_TX 1 // Trade-off: For TX path, improve stability on some platforms, but may cause performance degrade on other platforms.
++//#define CONFIG_USE_USB_BUFFER_ALLOC_RX 1 // For RX path
++#ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX
++#undef CONFIG_PREALLOC_RECV_SKB
++#endif
++
++/*
++ * USB VENDOR REQ BUFFER ALLOCATION METHOD
++ * if not set we'll use function local variable (stack memory)
++ */
++//#define CONFIG_USB_VENDOR_REQ_BUFFER_DYNAMIC_ALLOCATE
++#define CONFIG_USB_VENDOR_REQ_BUFFER_PREALLOC
++
++#define CONFIG_USB_VENDOR_REQ_MUTEX
++#define CONFIG_VENDOR_REQ_RETRY
++
++//#define CONFIG_USB_SUPPORT_ASYNC_VDN_REQ 1
++
++
++/*
++ * HAL Related Config
++ */
++
++#define RTL8192C_RX_PACKET_NO_INCLUDE_CRC 1
++
++#define SUPPORTED_BLOCK_IO
++
++
++
++#define RTL8192CU_FW_DOWNLOAD_ENABLE 1
++
++#define CONFIG_ONLY_ONE_OUT_EP_TO_LOW 0
++
++#define CONFIG_OUT_EP_WIFI_MODE 0
++
++#define ENABLE_USB_DROP_INCORRECT_OUT 0
++
++#define RTL8192CU_ASIC_VERIFICATION 0 // For ASIC verification.
++
++#define RTL8192CU_ADHOC_WORKAROUND_SETTING 1
++
++#define DISABLE_BB_RF 0
++
++#define RTL8191C_FPGA_NETWORKTYPE_ADHOC 0
++
++#ifdef CONFIG_MP_INCLUDED
++ #define MP_DRIVER 1
++ #undef CONFIG_USB_TX_AGGREGATION
++ #undef CONFIG_USB_RX_AGGREGATION
++#else
++ #define MP_DRIVER 0
++#endif
++
++
++/*
++ * Platform Related Config
++ */
++#ifdef CONFIG_PLATFORM_MN10300
++#define CONFIG_SPECIAL_SETTING_FOR_FUNAI_TV
++
++#if defined (CONFIG_SW_ANTENNA_DIVERSITY)
++ #undef CONFIG_SW_ANTENNA_DIVERSITY
++ #define CONFIG_HW_ANTENNA_DIVERSITY
++#endif
++
++#endif
++
++#ifdef CONFIG_WISTRON_PLATFORM
++
++#endif
++
++#ifdef CONFIG_PLATFORM_TI_DM365
++#define CONFIG_USE_USB_BUFFER_ALLOC_RX 1
++#endif
++
++#define CONFIG_ATTEMPT_TO_FIX_AP_BEACON_ERROR
++
++/*
++ * Debug Related Config
++ */
++//#define CONFIG_DEBUG_RTL871X
++
++#define DBG 0
++//#define CONFIG_DEBUG_RTL819X
++
++//#define CONFIG_PROC_DEBUG 1
++
++//#define DBG_IO
++//#define DBG_DELAY_OS
++//#define DBG_MEM_ALLOC
++//#define DBG_IOCTL
++
++//#define DBG_TX
++//#define DBG_XMIT_BUF
++//#define DBG_TX_DROP_FRAME
++
++//#define DBG_RX_DROP_FRAME
++//#define DBG_RX_SEQ
++//#define DBG_RX_SIGNAL_DISPLAY_PROCESSING
++//#define DBG_RX_SIGNAL_DISPLAY_SSID_MONITORED "jeff-ap"
++
++//#define DBG_EXPIRATION_CHK
++
++
++//#define DBG_SHOW_MCUFWDL_BEFORE_51_ENABLE
++//#define DBG_ROAMING_TEST
++
++//#define DBG_HAL_INIT_PROFILING
++
++//#define DBG_MEMORY_LEAK 1
++
++#define DBG_CONFIG_ERROR_DETECT
++//#define DBG_CONFIG_ERROR_RESET
++
++//TX use 1 urb
++//#define CONFIG_SINGLE_XMIT_BUF
++//RX use 1 urb
++//#define CONFIG_SINGLE_RECV_BUF
++
++//turn off power tracking when traffic is busy
++//#define CONFIG_BUSY_TRAFFIC_SKIP_PWR_TRACK
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/basic_types.h linux-rpi/drivers/net/wireless/rtl8192cu/include/basic_types.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/basic_types.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/basic_types.h 2015-10-07 16:40:51.000000000 +0200
+@@ -0,0 +1,320 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ *
++ ******************************************************************************/
++#ifndef __BASIC_TYPES_H__
++#define __BASIC_TYPES_H__
++
++#include <drv_conf.h>
++
++
++#define SUCCESS 0
++#define FAIL (-1)
++
++#ifndef TRUE
++ #define _TRUE 1
++#else
++ #define _TRUE TRUE
++#endif
++
++#ifndef FALSE
++ #define _FALSE 0
++#else
++ #define _FALSE FALSE
++#endif
++
++#ifdef PLATFORM_WINDOWS
++
++ typedef signed char s8;
++ typedef unsigned char u8;
++
++ typedef signed short s16;
++ typedef unsigned short u16;
++
++ typedef signed long s32;
++ typedef unsigned long u32;
++
++ typedef unsigned int uint;
++ typedef signed int sint;
++
++
++ typedef signed long long s64;
++ typedef unsigned long long u64;
++
++ #ifdef NDIS50_MINIPORT
++
++ #define NDIS_MAJOR_VERSION 5
++ #define NDIS_MINOR_VERSION 0
++
++ #endif
++
++ #ifdef NDIS51_MINIPORT
++
++ #define NDIS_MAJOR_VERSION 5
++ #define NDIS_MINOR_VERSION 1
++
++ #endif
++
++ typedef NDIS_PROC proc_t;
++
++ typedef LONG atomic_t;
++
++#endif
++
++
++#ifdef PLATFORM_LINUX
++
++ #include <linux/types.h>
++ #define IN
++ #define OUT
++ #define VOID void
++ #define NDIS_OID uint
++ #define NDIS_STATUS uint
++
++ typedef signed int sint;
++
++ #ifndef PVOID
++ typedef void * PVOID;
++ //#define PVOID (void *)
++ #endif
++
++ #define UCHAR u8
++ #define USHORT u16
++ #define UINT u32
++ #define ULONG u32
++
++ typedef void (*proc_t)(void*);
++
++ typedef __kernel_size_t SIZE_T;
++ typedef __kernel_ssize_t SSIZE_T;
++ #define FIELD_OFFSET(s,field) ((SSIZE_T)&((s*)(0))->field)
++
++#endif
++
++
++#ifdef PLATFORM_FREEBSD
++
++ typedef signed char s8;
++ typedef unsigned char u8;
++
++ typedef signed short s16;
++ typedef unsigned short u16;
++
++ typedef signed int s32;
++ typedef unsigned int u32;
++
++ typedef unsigned int uint;
++ typedef signed int sint;
++ typedef long atomic_t;
++
++ typedef signed long long s64;
++ typedef unsigned long long u64;
++ #define IN
++ #define OUT
++ #define VOID void
++ #define NDIS_OID uint
++ #define NDIS_STATUS uint
++
++ #ifndef PVOID
++ typedef void * PVOID;
++ //#define PVOID (void *)
++ #endif
++ typedef u32 dma_addr_t;
++ #define UCHAR u8
++ #define USHORT u16
++ #define UINT u32
++ #define ULONG u32
++
++ typedef void (*proc_t)(void*);
++
++ typedef unsigned int __kernel_size_t;
++ typedef int __kernel_ssize_t;
++
++ typedef __kernel_size_t SIZE_T;
++ typedef __kernel_ssize_t SSIZE_T;
++ #define FIELD_OFFSET(s,field) ((SSIZE_T)&((s*)(0))->field)
++
++#endif
++
++#define MEM_ALIGNMENT_OFFSET (sizeof (SIZE_T))
++#define MEM_ALIGNMENT_PADDING (sizeof(SIZE_T) - 1)
++
++#define SIZE_PTR SIZE_T
++#define SSIZE_PTR SSIZE_T
++
++//port from fw by thomas
++// TODO: Belows are Sync from SD7-Driver. It is necessary to check correctness
++
++/*
++ * Call endian free function when
++ * 1. Read/write packet content.
++ * 2. Before write integer to IO.
++ * 3. After read integer from IO.
++*/
++
++//
++// Byte Swapping routine.
++//
++#define EF1Byte
++#define EF2Byte le16_to_cpu
++#define EF4Byte le32_to_cpu
++
++//
++// Read LE format data from memory
++//
++#define ReadEF1Byte(_ptr) EF1Byte(*((u8 *)(_ptr)))
++#define ReadEF2Byte(_ptr) EF2Byte(*((u16 *)(_ptr)))
++#define ReadEF4Byte(_ptr) EF4Byte(*((u32 *)(_ptr)))
++
++//
++// Write LE data to memory
++//
++#define WriteEF1Byte(_ptr, _val) (*((u8 *)(_ptr)))=EF1Byte(_val)
++#define WriteEF2Byte(_ptr, _val) (*((u16 *)(_ptr)))=EF2Byte(_val)
++#define WriteEF4Byte(_ptr, _val) (*((u32 *)(_ptr)))=EF4Byte(_val)
++
++//
++// Example:
++// BIT_LEN_MASK_32(0) => 0x00000000
++// BIT_LEN_MASK_32(1) => 0x00000001
++// BIT_LEN_MASK_32(2) => 0x00000003
++// BIT_LEN_MASK_32(32) => 0xFFFFFFFF
++//
++#define BIT_LEN_MASK_32(__BitLen) \
++ (0xFFFFFFFF >> (32 - (__BitLen)))
++//
++// Example:
++// BIT_OFFSET_LEN_MASK_32(0, 2) => 0x00000003
++// BIT_OFFSET_LEN_MASK_32(16, 2) => 0x00030000
++//
++#define BIT_OFFSET_LEN_MASK_32(__BitOffset, __BitLen) \
++ (BIT_LEN_MASK_32(__BitLen) << (__BitOffset))
++
++//
++// Description:
++// Return 4-byte value in host byte ordering from
++// 4-byte pointer in litten-endian system.
++//
++#define LE_P4BYTE_TO_HOST_4BYTE(__pStart) \
++ (EF4Byte(*((u32 *)(__pStart))))
++
++//
++// Description:
++// Translate subfield (continuous bits in little-endian) of 4-byte value in litten byte to
++// 4-byte value in host byte ordering.
++//
++#define LE_BITS_TO_4BYTE(__pStart, __BitOffset, __BitLen) \
++ ( \
++ ( LE_P4BYTE_TO_HOST_4BYTE(__pStart) >> (__BitOffset) ) \
++ & \
++ BIT_LEN_MASK_32(__BitLen) \
++ )
++
++//
++// Description:
++// Mask subfield (continuous bits in little-endian) of 4-byte value in litten byte oredering
++// and return the result in 4-byte value in host byte ordering.
++//
++#define LE_BITS_CLEARED_TO_4BYTE(__pStart, __BitOffset, __BitLen) \
++ ( \
++ LE_P4BYTE_TO_HOST_4BYTE(__pStart) \
++ & \
++ ( ~BIT_OFFSET_LEN_MASK_32(__BitOffset, __BitLen) ) \
++ )
++
++//
++// Description:
++// Set subfield of little-endian 4-byte value to specified value.
++//
++#define SET_BITS_TO_LE_4BYTE(__pStart, __BitOffset, __BitLen, __Value) \
++ *((u32 *)(__pStart)) = \
++ EF4Byte( \
++ LE_BITS_CLEARED_TO_4BYTE(__pStart, __BitOffset, __BitLen) \
++ | \
++ ( (((u32)__Value) & BIT_LEN_MASK_32(__BitLen)) << (__BitOffset) ) \
++ );
++
++
++#define BIT_LEN_MASK_16(__BitLen) \
++ (0xFFFF >> (16 - (__BitLen)))
++
++#define BIT_OFFSET_LEN_MASK_16(__BitOffset, __BitLen) \
++ (BIT_LEN_MASK_16(__BitLen) << (__BitOffset))
++
++#define LE_P2BYTE_TO_HOST_2BYTE(__pStart) \
++ (EF2Byte(*((u16 *)(__pStart))))
++
++#define LE_BITS_TO_2BYTE(__pStart, __BitOffset, __BitLen) \
++ ( \
++ ( LE_P2BYTE_TO_HOST_2BYTE(__pStart) >> (__BitOffset) ) \
++ & \
++ BIT_LEN_MASK_16(__BitLen) \
++ )
++
++#define LE_BITS_CLEARED_TO_2BYTE(__pStart, __BitOffset, __BitLen) \
++ ( \
++ LE_P2BYTE_TO_HOST_2BYTE(__pStart) \
++ & \
++ ( ~BIT_OFFSET_LEN_MASK_16(__BitOffset, __BitLen) ) \
++ )
++
++#define SET_BITS_TO_LE_2BYTE(__pStart, __BitOffset, __BitLen, __Value) \
++ *((u16 *)(__pStart)) = \
++ EF2Byte( \
++ LE_BITS_CLEARED_TO_2BYTE(__pStart, __BitOffset, __BitLen) \
++ | \
++ ( (((u16)__Value) & BIT_LEN_MASK_16(__BitLen)) << (__BitOffset) ) \
++ );
++
++#define BIT_LEN_MASK_8(__BitLen) \
++ (0xFF >> (8 - (__BitLen)))
++
++#define BIT_OFFSET_LEN_MASK_8(__BitOffset, __BitLen) \
++ (BIT_LEN_MASK_8(__BitLen) << (__BitOffset))
++
++#define LE_P1BYTE_TO_HOST_1BYTE(__pStart) \
++ (EF1Byte(*((u8 *)(__pStart))))
++
++#define LE_BITS_TO_1BYTE(__pStart, __BitOffset, __BitLen) \
++ ( \
++ ( LE_P1BYTE_TO_HOST_1BYTE(__pStart) >> (__BitOffset) ) \
++ & \
++ BIT_LEN_MASK_8(__BitLen) \
++ )
++
++#define LE_BITS_CLEARED_TO_1BYTE(__pStart, __BitOffset, __BitLen) \
++ ( \
++ LE_P1BYTE_TO_HOST_1BYTE(__pStart) \
++ & \
++ ( ~BIT_OFFSET_LEN_MASK_8(__BitOffset, __BitLen) ) \
++ )
++
++#define SET_BITS_TO_LE_1BYTE(__pStart, __BitOffset, __BitLen, __Value) \
++ *((u8 *)(__pStart)) = \
++ EF1Byte( \
++ LE_BITS_CLEARED_TO_1BYTE(__pStart, __BitOffset, __BitLen) \
++ | \
++ ( (((u8)__Value) & BIT_LEN_MASK_8(__BitLen)) << (__BitOffset) ) \
++ );
++
++// Get the N-bytes aligment offset from the current length
++#define N_BYTE_ALIGMENT(__Value, __Aligment) ((__Aligment == 1) ? (__Value) : (((__Value + __Aligment - 1) / __Aligment) * __Aligment))
++
++typedef unsigned char BOOLEAN,*PBOOLEAN;
++
++#endif //__BASIC_TYPES_H__
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/byteorder/big_endian.h linux-rpi/drivers/net/wireless/rtl8192cu/include/byteorder/big_endian.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/byteorder/big_endian.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/byteorder/big_endian.h 2015-10-07 16:40:51.000000000 +0200
+@@ -0,0 +1,87 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ *
++ ******************************************************************************/
++#ifndef _LINUX_BYTEORDER_BIG_ENDIAN_H
++#define _LINUX_BYTEORDER_BIG_ENDIAN_H
++
++#ifndef __BIG_ENDIAN
++#define __BIG_ENDIAN 4321
++#endif
++#ifndef __BIG_ENDIAN_BITFIELD
++#define __BIG_ENDIAN_BITFIELD
++#endif
++
++#include <byteorder/swab.h>
++
++#define __constant_htonl(x) ((__u32)(x))
++#define __constant_ntohl(x) ((__u32)(x))
++#define __constant_htons(x) ((__u16)(x))
++#define __constant_ntohs(x) ((__u16)(x))
++#define __constant_cpu_to_le64(x) ___constant_swab64((x))
++#define __constant_le64_to_cpu(x) ___constant_swab64((x))
++#define __constant_cpu_to_le32(x) ___constant_swab32((x))
++#define __constant_le32_to_cpu(x) ___constant_swab32((x))
++#define __constant_cpu_to_le16(x) ___constant_swab16((x))
++#define __constant_le16_to_cpu(x) ___constant_swab16((x))
++#define __constant_cpu_to_be64(x) ((__u64)(x))
++#define __constant_be64_to_cpu(x) ((__u64)(x))
++#define __constant_cpu_to_be32(x) ((__u32)(x))
++#define __constant_be32_to_cpu(x) ((__u32)(x))
++#define __constant_cpu_to_be16(x) ((__u16)(x))
++#define __constant_be16_to_cpu(x) ((__u16)(x))
++#define __cpu_to_le64(x) __swab64((x))
++#define __le64_to_cpu(x) __swab64((x))
++#define __cpu_to_le32(x) __swab32((x))
++#define __le32_to_cpu(x) __swab32((x))
++#define __cpu_to_le16(x) __swab16((x))
++#define __le16_to_cpu(x) __swab16((x))
++#define __cpu_to_be64(x) ((__u64)(x))
++#define __be64_to_cpu(x) ((__u64)(x))
++#define __cpu_to_be32(x) ((__u32)(x))
++#define __be32_to_cpu(x) ((__u32)(x))
++#define __cpu_to_be16(x) ((__u16)(x))
++#define __be16_to_cpu(x) ((__u16)(x))
++#define __cpu_to_le64p(x) __swab64p((x))
++#define __le64_to_cpup(x) __swab64p((x))
++#define __cpu_to_le32p(x) __swab32p((x))
++#define __le32_to_cpup(x) __swab32p((x))
++#define __cpu_to_le16p(x) __swab16p((x))
++#define __le16_to_cpup(x) __swab16p((x))
++#define __cpu_to_be64p(x) (*(__u64*)(x))
++#define __be64_to_cpup(x) (*(__u64*)(x))
++#define __cpu_to_be32p(x) (*(__u32*)(x))
++#define __be32_to_cpup(x) (*(__u32*)(x))
++#define __cpu_to_be16p(x) (*(__u16*)(x))
++#define __be16_to_cpup(x) (*(__u16*)(x))
++#define __cpu_to_le64s(x) __swab64s((x))
++#define __le64_to_cpus(x) __swab64s((x))
++#define __cpu_to_le32s(x) __swab32s((x))
++#define __le32_to_cpus(x) __swab32s((x))
++#define __cpu_to_le16s(x) __swab16s((x))
++#define __le16_to_cpus(x) __swab16s((x))
++#define __cpu_to_be64s(x) do {} while (0)
++#define __be64_to_cpus(x) do {} while (0)
++#define __cpu_to_be32s(x) do {} while (0)
++#define __be32_to_cpus(x) do {} while (0)
++#define __cpu_to_be16s(x) do {} while (0)
++#define __be16_to_cpus(x) do {} while (0)
++
++#include <byteorder/generic.h>
++
++#endif /* _LINUX_BYTEORDER_BIG_ENDIAN_H */
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/byteorder/generic.h linux-rpi/drivers/net/wireless/rtl8192cu/include/byteorder/generic.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/byteorder/generic.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/byteorder/generic.h 2015-10-07 16:40:51.000000000 +0200
+@@ -0,0 +1,212 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ *
++ ******************************************************************************/
++#ifndef _LINUX_BYTEORDER_GENERIC_H
++#define _LINUX_BYTEORDER_GENERIC_H
++
++/*
++ * linux/byteorder_generic.h
++ * Generic Byte-reordering support
++ *
++ * Francois-Rene Rideau <fare@tunes.org> 19970707
++ * gathered all the good ideas from all asm-foo/byteorder.h into one file,
++ * cleaned them up.
++ * I hope it is compliant with non-GCC compilers.
++ * I decided to put __BYTEORDER_HAS_U64__ in byteorder.h,
++ * because I wasn't sure it would be ok to put it in types.h
++ * Upgraded it to 2.1.43
++ * Francois-Rene Rideau <fare@tunes.org> 19971012
++ * Upgraded it to 2.1.57
++ * to please Linus T., replaced huge #ifdef's between little/big endian
++ * by nestedly #include'd files.
++ * Francois-Rene Rideau <fare@tunes.org> 19971205
++ * Made it to 2.1.71; now a facelift:
++ * Put files under include/linux/byteorder/
++ * Split swab from generic support.
++ *
++ * TODO:
++ * = Regular kernel maintainers could also replace all these manual
++ * byteswap macros that remain, disseminated among drivers,
++ * after some grep or the sources...
++ * = Linus might want to rename all these macros and files to fit his taste,
++ * to fit his personal naming scheme.
++ * = it seems that a few drivers would also appreciate
++ * nybble swapping support...
++ * = every architecture could add their byteswap macro in asm/byteorder.h
++ * see how some architectures already do (i386, alpha, ppc, etc)
++ * = cpu_to_beXX and beXX_to_cpu might some day need to be well
++ * distinguished throughout the kernel. This is not the case currently,
++ * since little endian, big endian, and pdp endian machines needn't it.
++ * But this might be the case for, say, a port of Linux to 20/21 bit
++ * architectures (and F21 Linux addict around?).
++ */
++
++/*
++ * The following macros are to be defined by <asm/byteorder.h>:
++ *
++ * Conversion of long and short int between network and host format
++ * ntohl(__u32 x)
++ * ntohs(__u16 x)
++ * htonl(__u32 x)
++ * htons(__u16 x)
++ * It seems that some programs (which? where? or perhaps a standard? POSIX?)
++ * might like the above to be functions, not macros (why?).
++ * if that's true, then detect them, and take measures.
++ * Anyway, the measure is: define only ___ntohl as a macro instead,
++ * and in a separate file, have
++ * unsigned long inline ntohl(x){return ___ntohl(x);}
++ *
++ * The same for constant arguments
++ * __constant_ntohl(__u32 x)
++ * __constant_ntohs(__u16 x)
++ * __constant_htonl(__u32 x)
++ * __constant_htons(__u16 x)
++ *
++ * Conversion of XX-bit integers (16- 32- or 64-)
++ * between native CPU format and little/big endian format
++ * 64-bit stuff only defined for proper architectures
++ * cpu_to_[bl]eXX(__uXX x)
++ * [bl]eXX_to_cpu(__uXX x)
++ *
++ * The same, but takes a pointer to the value to convert
++ * cpu_to_[bl]eXXp(__uXX x)
++ * [bl]eXX_to_cpup(__uXX x)
++ *
++ * The same, but change in situ
++ * cpu_to_[bl]eXXs(__uXX x)
++ * [bl]eXX_to_cpus(__uXX x)
++ *
++ * See asm-foo/byteorder.h for examples of how to provide
++ * architecture-optimized versions
++ *
++ */
++
++
++#if defined(PLATFORM_LINUX) || defined(PLATFORM_WINDOWS) || defined(PLATFORM_MPIXEL) || defined(PLATFORM_FREEBSD)
++/*
++ * inside the kernel, we can use nicknames;
++ * outside of it, we must avoid POSIX namespace pollution...
++ */
++#define cpu_to_le64 __cpu_to_le64
++#define le64_to_cpu __le64_to_cpu
++#define cpu_to_le32 __cpu_to_le32
++#define le32_to_cpu __le32_to_cpu
++#define cpu_to_le16 __cpu_to_le16
++#define le16_to_cpu __le16_to_cpu
++#define cpu_to_be64 __cpu_to_be64
++#define be64_to_cpu __be64_to_cpu
++#define cpu_to_be32 __cpu_to_be32
++#define be32_to_cpu __be32_to_cpu
++#define cpu_to_be16 __cpu_to_be16
++#define be16_to_cpu __be16_to_cpu
++#define cpu_to_le64p __cpu_to_le64p
++#define le64_to_cpup __le64_to_cpup
++#define cpu_to_le32p __cpu_to_le32p
++#define le32_to_cpup __le32_to_cpup
++#define cpu_to_le16p __cpu_to_le16p
++#define le16_to_cpup __le16_to_cpup
++#define cpu_to_be64p __cpu_to_be64p
++#define be64_to_cpup __be64_to_cpup
++#define cpu_to_be32p __cpu_to_be32p
++#define be32_to_cpup __be32_to_cpup
++#define cpu_to_be16p __cpu_to_be16p
++#define be16_to_cpup __be16_to_cpup
++#define cpu_to_le64s __cpu_to_le64s
++#define le64_to_cpus __le64_to_cpus
++#define cpu_to_le32s __cpu_to_le32s
++#define le32_to_cpus __le32_to_cpus
++#define cpu_to_le16s __cpu_to_le16s
++#define le16_to_cpus __le16_to_cpus
++#define cpu_to_be64s __cpu_to_be64s
++#define be64_to_cpus __be64_to_cpus
++#define cpu_to_be32s __cpu_to_be32s
++#define be32_to_cpus __be32_to_cpus
++#define cpu_to_be16s __cpu_to_be16s
++#define be16_to_cpus __be16_to_cpus
++#endif
++
++
++/*
++ * Handle ntohl and suches. These have various compatibility
++ * issues - like we want to give the prototype even though we
++ * also have a macro for them in case some strange program
++ * wants to take the address of the thing or something..
++ *
++ * Note that these used to return a "long" in libc5, even though
++ * long is often 64-bit these days.. Thus the casts.
++ *
++ * They have to be macros in order to do the constant folding
++ * correctly - if the argument passed into a inline function
++ * it is no longer constant according to gcc..
++ */
++
++#undef ntohl
++#undef ntohs
++#undef htonl
++#undef htons
++
++/*
++ * Do the prototypes. Somebody might want to take the
++ * address or some such sick thing..
++ */
++#if defined(PLATFORM_LINUX) || (defined (__GLIBC__) && __GLIBC__ >= 2)
++extern __u32 ntohl(__u32);
++extern __u32 htonl(__u32);
++#else //defined(PLATFORM_LINUX) || (defined (__GLIBC__) && __GLIBC__ >= 2)
++#ifndef PLATFORM_FREEBSD
++extern unsigned long int ntohl(unsigned long int);
++extern unsigned long int htonl(unsigned long int);
++#endif
++#endif
++#ifndef PLATFORM_FREEBSD
++extern unsigned short int ntohs(unsigned short int);
++extern unsigned short int htons(unsigned short int);
++#endif
++
++#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__) || defined(PLATFORM_MPIXEL)
++
++#define ___htonl(x) __cpu_to_be32(x)
++#define ___htons(x) __cpu_to_be16(x)
++#define ___ntohl(x) __be32_to_cpu(x)
++#define ___ntohs(x) __be16_to_cpu(x)
++
++#if defined(PLATFORM_LINUX) || (defined (__GLIBC__) && __GLIBC__ >= 2)
++#define htonl(x) ___htonl(x)
++#define ntohl(x) ___ntohl(x)
++#else
++#define htonl(x) ((unsigned long)___htonl(x))
++#define ntohl(x) ((unsigned long)___ntohl(x))
++#endif
++#define htons(x) ___htons(x)
++#define ntohs(x) ___ntohs(x)
++
++#endif /* OPTIMIZE */
++
++
++#if defined (PLATFORM_WINDOWS)
++
++#define htonl(x) __cpu_to_be32(x)
++#define ntohl(x) __be32_to_cpu(x)
++#define htons(x) __cpu_to_be16(x)
++#define ntohs(x) __be16_to_cpu(x)
++
++
++#endif
++
++#endif /* _LINUX_BYTEORDER_GENERIC_H */
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/byteorder/little_endian.h linux-rpi/drivers/net/wireless/rtl8192cu/include/byteorder/little_endian.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/byteorder/little_endian.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/byteorder/little_endian.h 2015-10-07 16:40:51.000000000 +0200
+@@ -0,0 +1,89 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ *
++ ******************************************************************************/
++#ifndef _LINUX_BYTEORDER_LITTLE_ENDIAN_H
++#define _LINUX_BYTEORDER_LITTLE_ENDIAN_H
++
++#ifndef __LITTLE_ENDIAN
++#define __LITTLE_ENDIAN 1234
++#endif
++#ifndef __LITTLE_ENDIAN_BITFIELD
++#define __LITTLE_ENDIAN_BITFIELD
++#endif
++
++#include <byteorder/swab.h>
++
++#ifndef __constant_htonl
++#define __constant_htonl(x) ___constant_swab32((x))
++#define __constant_ntohl(x) ___constant_swab32((x))
++#define __constant_htons(x) ___constant_swab16((x))
++#define __constant_ntohs(x) ___constant_swab16((x))
++#define __constant_cpu_to_le64(x) ((__u64)(x))
++#define __constant_le64_to_cpu(x) ((__u64)(x))
++#define __constant_cpu_to_le32(x) ((__u32)(x))
++#define __constant_le32_to_cpu(x) ((__u32)(x))
++#define __constant_cpu_to_le16(x) ((__u16)(x))
++#define __constant_le16_to_cpu(x) ((__u16)(x))
++#define __constant_cpu_to_be64(x) ___constant_swab64((x))
++#define __constant_be64_to_cpu(x) ___constant_swab64((x))
++#define __constant_cpu_to_be32(x) ___constant_swab32((x))
++#define __constant_be32_to_cpu(x) ___constant_swab32((x))
++#define __constant_cpu_to_be16(x) ___constant_swab16((x))
++#define __constant_be16_to_cpu(x) ___constant_swab16((x))
++#define __cpu_to_le64(x) ((__u64)(x))
++#define __le64_to_cpu(x) ((__u64)(x))
++#define __cpu_to_le32(x) ((__u32)(x))
++#define __le32_to_cpu(x) ((__u32)(x))
++#define __cpu_to_le16(x) ((__u16)(x))
++#define __le16_to_cpu(x) ((__u16)(x))
++#define __cpu_to_be64(x) __swab64((x))
++#define __be64_to_cpu(x) __swab64((x))
++#define __cpu_to_be32(x) __swab32((x))
++#define __be32_to_cpu(x) __swab32((x))
++#define __cpu_to_be16(x) __swab16((x))
++#define __be16_to_cpu(x) __swab16((x))
++#define __cpu_to_le64p(x) (*(__u64*)(x))
++#define __le64_to_cpup(x) (*(__u64*)(x))
++#define __cpu_to_le32p(x) (*(__u32*)(x))
++#define __le32_to_cpup(x) (*(__u32*)(x))
++#define __cpu_to_le16p(x) (*(__u16*)(x))
++#define __le16_to_cpup(x) (*(__u16*)(x))
++#define __cpu_to_be64p(x) __swab64p((x))
++#define __be64_to_cpup(x) __swab64p((x))
++#define __cpu_to_be32p(x) __swab32p((x))
++#define __be32_to_cpup(x) __swab32p((x))
++#define __cpu_to_be16p(x) __swab16p((x))
++#define __be16_to_cpup(x) __swab16p((x))
++#define __cpu_to_le64s(x) do {} while (0)
++#define __le64_to_cpus(x) do {} while (0)
++#define __cpu_to_le32s(x) do {} while (0)
++#define __le32_to_cpus(x) do {} while (0)
++#define __cpu_to_le16s(x) do {} while (0)
++#define __le16_to_cpus(x) do {} while (0)
++#define __cpu_to_be64s(x) __swab64s((x))
++#define __be64_to_cpus(x) __swab64s((x))
++#define __cpu_to_be32s(x) __swab32s((x))
++#define __be32_to_cpus(x) __swab32s((x))
++#define __cpu_to_be16s(x) __swab16s((x))
++#define __be16_to_cpus(x) __swab16s((x))
++#endif // __constant_htonl
++
++#include <byteorder/generic.h>
++
++#endif /* _LINUX_BYTEORDER_LITTLE_ENDIAN_H */
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/byteorder/swabb.h linux-rpi/drivers/net/wireless/rtl8192cu/include/byteorder/swabb.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/byteorder/swabb.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/byteorder/swabb.h 2015-10-07 16:40:51.000000000 +0200
+@@ -0,0 +1,156 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ *
++ ******************************************************************************/
++#ifndef _LINUX_BYTEORDER_SWABB_H
++#define _LINUX_BYTEORDER_SWABB_H
++
++/*
++ * linux/byteorder/swabb.h
++ * SWAp Bytes Bizarrely
++ * swaHHXX[ps]?(foo)
++ *
++ * Support for obNUXIous pdp-endian and other bizarre architectures.
++ * Will Linux ever run on such ancient beasts? if not, this file
++ * will be but a programming pearl. Still, it's a reminder that we
++ * shouldn't be making too many assumptions when trying to be portable.
++ *
++ */
++
++/*
++ * Meaning of the names I chose (vaxlinux people feel free to correct them):
++ * swahw32 swap 16-bit half-words in a 32-bit word
++ * swahb32 swap 8-bit halves of each 16-bit half-word in a 32-bit word
++ *
++ * No 64-bit support yet. I don't know NUXI conventions for long longs.
++ * I guarantee it will be a mess when it's there, though :->
++ * It will be even worse if there are conflicting 64-bit conventions.
++ * Hopefully, no one ever used 64-bit objects on NUXI machines.
++ *
++ */
++
++#define ___swahw32(x) \
++({ \
++ __u32 __x = (x); \
++ ((__u32)( \
++ (((__u32)(__x) & (__u32)0x0000ffffUL) << 16) | \
++ (((__u32)(__x) & (__u32)0xffff0000UL) >> 16) )); \
++})
++#define ___swahb32(x) \
++({ \
++ __u32 __x = (x); \
++ ((__u32)( \
++ (((__u32)(__x) & (__u32)0x00ff00ffUL) << 8) | \
++ (((__u32)(__x) & (__u32)0xff00ff00UL) >> 8) )); \
++})
++
++#define ___constant_swahw32(x) \
++ ((__u32)( \
++ (((__u32)(x) & (__u32)0x0000ffffUL) << 16) | \
++ (((__u32)(x) & (__u32)0xffff0000UL) >> 16) ))
++#define ___constant_swahb32(x) \
++ ((__u32)( \
++ (((__u32)(x) & (__u32)0x00ff00ffUL) << 8) | \
++ (((__u32)(x) & (__u32)0xff00ff00UL) >> 8) ))
++
++/*
++ * provide defaults when no architecture-specific optimization is detected
++ */
++#ifndef __arch__swahw32
++# define __arch__swahw32(x) ___swahw32(x)
++#endif
++#ifndef __arch__swahb32
++# define __arch__swahb32(x) ___swahb32(x)
++#endif
++
++#ifndef __arch__swahw32p
++# define __arch__swahw32p(x) __swahw32(*(x))
++#endif
++#ifndef __arch__swahb32p
++# define __arch__swahb32p(x) __swahb32(*(x))
++#endif
++
++#ifndef __arch__swahw32s
++# define __arch__swahw32s(x) do { *(x) = __swahw32p((x)); } while (0)
++#endif
++#ifndef __arch__swahb32s
++# define __arch__swahb32s(x) do { *(x) = __swahb32p((x)); } while (0)
++#endif
++
++
++/*
++ * Allow constant folding
++ */
++#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__)
++# define __swahw32(x) \
++(__builtin_constant_p((__u32)(x)) ? \
++ ___swahw32((x)) : \
++ __fswahw32((x)))
++# define __swahb32(x) \
++(__builtin_constant_p((__u32)(x)) ? \
++ ___swahb32((x)) : \
++ __fswahb32((x)))
++#else
++# define __swahw32(x) __fswahw32(x)
++# define __swahb32(x) __fswahb32(x)
++#endif /* OPTIMIZE */
++
++
++__inline static__ __const__ __u32 __fswahw32(__u32 x)
++{
++ return __arch__swahw32(x);
++}
++__inline static__ __u32 __swahw32p(__u32 *x)
++{
++ return __arch__swahw32p(x);
++}
++__inline static__ void __swahw32s(__u32 *addr)
++{
++ __arch__swahw32s(addr);
++}
++
++
++__inline static__ __const__ __u32 __fswahb32(__u32 x)
++{
++ return __arch__swahb32(x);
++}
++__inline static__ __u32 __swahb32p(__u32 *x)
++{
++ return __arch__swahb32p(x);
++}
++__inline static__ void __swahb32s(__u32 *addr)
++{
++ __arch__swahb32s(addr);
++}
++
++#ifdef __BYTEORDER_HAS_U64__
++/*
++ * Not supported yet
++ */
++#endif /* __BYTEORDER_HAS_U64__ */
++
++#if defined(PLATFORM_LINUX)
++#define swahw32 __swahw32
++#define swahb32 __swahb32
++#define swahw32p __swahw32p
++#define swahb32p __swahb32p
++#define swahw32s __swahw32s
++#define swahb32s __swahb32s
++#endif
++
++#endif /* _LINUX_BYTEORDER_SWABB_H */
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/byteorder/swab.h linux-rpi/drivers/net/wireless/rtl8192cu/include/byteorder/swab.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/byteorder/swab.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/byteorder/swab.h 2015-10-07 16:40:51.000000000 +0200
+@@ -0,0 +1,140 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ *
++ ******************************************************************************/
++#ifndef _LINUX_BYTEORDER_SWAB_H
++#define _LINUX_BYTEORDER_SWAB_H
++
++#if !defined(CONFIG_PLATFORM_MSTAR)
++#ifndef __u16
++typedef unsigned short __u16;
++#endif
++
++#ifndef __u32
++typedef unsigned int __u32;
++#endif
++
++#ifndef __u8
++typedef unsigned char __u8;
++#endif
++
++#ifndef __u64
++typedef unsigned long long __u64;
++#endif
++
++
++__inline static __u16 ___swab16(__u16 x)
++{
++ __u16 __x = x;
++ return
++ ((__u16)(
++ (((__u16)(__x) & (__u16)0x00ffU) << 8) |
++ (((__u16)(__x) & (__u16)0xff00U) >> 8) ));
++
++}
++
++__inline static __u32 ___swab32(__u32 x)
++{
++ __u32 __x = (x);
++ return ((__u32)(
++ (((__u32)(__x) & (__u32)0x000000ffUL) << 24) |
++ (((__u32)(__x) & (__u32)0x0000ff00UL) << 8) |
++ (((__u32)(__x) & (__u32)0x00ff0000UL) >> 8) |
++ (((__u32)(__x) & (__u32)0xff000000UL) >> 24) ));
++}
++
++__inline static __u64 ___swab64(__u64 x)
++{
++ __u64 __x = (x);
++
++ return
++ ((__u64)( \
++ (__u64)(((__u64)(__x) & (__u64)0x00000000000000ffULL) << 56) | \
++ (__u64)(((__u64)(__x) & (__u64)0x000000000000ff00ULL) << 40) | \
++ (__u64)(((__u64)(__x) & (__u64)0x0000000000ff0000ULL) << 24) | \
++ (__u64)(((__u64)(__x) & (__u64)0x00000000ff000000ULL) << 8) | \
++ (__u64)(((__u64)(__x) & (__u64)0x000000ff00000000ULL) >> 8) | \
++ (__u64)(((__u64)(__x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
++ (__u64)(((__u64)(__x) & (__u64)0x00ff000000000000ULL) >> 40) | \
++ (__u64)(((__u64)(__x) & (__u64)0xff00000000000000ULL) >> 56) )); \
++}
++#endif // CONFIG_PLATFORM_MSTAR
++
++#ifndef __arch__swab16
++__inline static __u16 __arch__swab16(__u16 x)
++{
++ return ___swab16(x);
++}
++
++#endif
++
++#ifndef __arch__swab32
++__inline static __u32 __arch__swab32(__u32 x)
++{
++ __u32 __tmp = (x) ;
++ return ___swab32(__tmp);
++}
++#endif
++
++#ifndef __arch__swab64
++
++__inline static __u64 __arch__swab64(__u64 x)
++{
++ __u64 __tmp = (x) ;
++ return ___swab64(__tmp);
++}
++
++
++#endif
++
++#ifndef __swab16
++#define __swab16(x) __fswab16(x)
++#define __swab32(x) __fswab32(x)
++#define __swab64(x) __fswab64(x)
++#endif // __swab16
++
++#ifdef PLATFORM_FREEBSD
++__inline static __u16 __fswab16(__u16 x)
++#else
++__inline static const __u16 __fswab16(__u16 x)
++#endif //PLATFORM_FREEBSD
++{
++ return __arch__swab16(x);
++}
++#ifdef PLATFORM_FREEBSD
++__inline static __u32 __fswab32(__u32 x)
++#else
++__inline static const __u32 __fswab32(__u32 x)
++#endif //PLATFORM_FREEBSD
++{
++ return __arch__swab32(x);
++}
++
++#if defined(PLATFORM_LINUX) || defined(PLATFORM_WINDOWS)
++#define swab16 __swab16
++#define swab32 __swab32
++#define swab64 __swab64
++#define swab16p __swab16p
++#define swab32p __swab32p
++#define swab64p __swab64p
++#define swab16s __swab16s
++#define swab32s __swab32s
++#define swab64s __swab64s
++#endif
++
++#endif /* _LINUX_BYTEORDER_SWAB_H */
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/circ_buf.h linux-rpi/drivers/net/wireless/rtl8192cu/include/circ_buf.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/circ_buf.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/circ_buf.h 2015-10-07 16:40:51.000000000 +0200
+@@ -0,0 +1,27 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ *
++ ******************************************************************************/
++#ifndef __CIRC_BUF_H_
++#define __CIRC_BUF_H_ 1
++
++#define CIRC_CNT(head,tail,size) (((head) - (tail)) & ((size)-1))
++
++#define CIRC_SPACE(head,tail,size) CIRC_CNT((tail),((head)+1),(size))
++
++#endif //_CIRC_BUF_H_
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/cmd_osdep.h linux-rpi/drivers/net/wireless/rtl8192cu/include/cmd_osdep.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/cmd_osdep.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/cmd_osdep.h 2015-10-07 16:40:51.000000000 +0200
+@@ -0,0 +1,35 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ *
++ ******************************************************************************/
++#ifndef __CMD_OSDEP_H_
++#define __CMD_OSDEP_H_
++
++
++#include <drv_conf.h>
++#include <osdep_service.h>
++#include <drv_types.h>
++
++extern sint _rtw_init_cmd_priv (struct cmd_priv *pcmdpriv);
++extern sint _rtw_init_evt_priv(struct evt_priv *pevtpriv);
++extern void _rtw_free_evt_priv (struct evt_priv *pevtpriv);
++extern void _rtw_free_cmd_priv (struct cmd_priv *pcmdpriv);
++extern sint _rtw_enqueue_cmd(_queue *queue, struct cmd_obj *obj);
++extern struct cmd_obj *_rtw_dequeue_cmd(_queue *queue);
++
++#endif
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/drv_conf.h linux-rpi/drivers/net/wireless/rtl8192cu/include/drv_conf.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/drv_conf.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/drv_conf.h 2015-10-07 16:40:51.000000000 +0200
+@@ -0,0 +1,77 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ *
++ ******************************************************************************/
++#ifndef __DRV_CONF_H__
++#define __DRV_CONF_H__
++#include "autoconf.h"
++
++#if defined (PLATFORM_LINUX) && defined (PLATFORM_WINDOWS)
++
++#error "Shall be Linux or Windows, but not both!\n"
++
++#endif
++
++//Older Android kernel doesn't has CONFIG_ANDROID defined,
++//add this to force CONFIG_ANDROID defined
++#ifdef CONFIG_PLATFORM_ANDROID
++#define CONFIG_ANDROID
++#endif
++
++#ifdef CONFIG_ANDROID
++//Some Android build will restart the UI while non-printable ascii is passed
++//between java and c/c++ layer (JNI). We force CONFIG_VALIDATE_SSID
++//for Android here. If you are sure there is no risk on your system about this,
++//mask this macro define to support non-printable ascii ssid.
++//#define CONFIG_VALIDATE_SSID
++
++//Android expect dbm as the rx signal strength unit
++#define CONFIG_SIGNAL_DISPLAY_DBM
++#endif
++
++#if defined(CONFIG_HAS_EARLYSUSPEND) && defined (CONFIG_RESUME_IN_WORKQUEUE)
++ #warning "You have CONFIG_HAS_EARLYSUSPEND enabled in your system, we disable CONFIG_RESUME_IN_WORKQUEUE automatically"
++ #undef CONFIG_RESUME_IN_WORKQUEUE
++#endif
++
++#if defined(CONFIG_ANDROID_POWER) && defined (CONFIG_RESUME_IN_WORKQUEUE)
++ #warning "You have CONFIG_ANDROID_POWER enabled in your system, we disable CONFIG_RESUME_IN_WORKQUEUE automatically"
++ #undef CONFIG_RESUME_IN_WORKQUEUE
++#endif
++
++#ifdef CONFIG_RESUME_IN_WORKQUEUE //this can be removed, because there is no case for this...
++ #if !defined( CONFIG_WAKELOCK) && !defined(CONFIG_ANDROID_POWER)
++ #error "enable CONFIG_RESUME_IN_WORKQUEUE without CONFIG_WAKELOCK or CONFIG_ANDROID_POWER will suffer from the danger of wifi's unfunctionality..."
++ #error "If you still want to enable CONFIG_RESUME_IN_WORKQUEUE in this case, mask this preprossor checking and GOOD LUCK..."
++ #endif
++#endif
++
++//About USB VENDOR REQ
++#if defined(CONFIG_USB_VENDOR_REQ_BUFFER_PREALLOC) && !defined(CONFIG_USB_VENDOR_REQ_MUTEX)
++ #warning "define CONFIG_USB_VENDOR_REQ_MUTEX for CONFIG_USB_VENDOR_REQ_BUFFER_PREALLOC automatically"
++ #define CONFIG_USB_VENDOR_REQ_MUTEX
++#endif
++#if defined(CONFIG_VENDOR_REQ_RETRY) && !defined(CONFIG_USB_VENDOR_REQ_MUTEX)
++ #warning "define CONFIG_USB_VENDOR_REQ_MUTEX for CONFIG_VENDOR_REQ_RETRY automatically"
++ #define CONFIG_USB_VENDOR_REQ_MUTEX
++#endif
++
++
++//#include <rtl871x_byteorder.h>
++
++#endif // __DRV_CONF_H__
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/drv_types_ce.h linux-rpi/drivers/net/wireless/rtl8192cu/include/drv_types_ce.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/drv_types_ce.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/drv_types_ce.h 2015-10-07 16:40:51.000000000 +0200
+@@ -0,0 +1,92 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ *
++ ******************************************************************************/
++#ifndef __DRV_TYPES_CE_H__
++#define __DRV_TYPES_CE_H__
++
++#include <drv_conf.h>
++#include <osdep_service.h>
++
++#include <Sdcardddk.h>
++
++#define MAX_ACTIVE_REG_PATH 256
++
++#define MAX_MCAST_LIST_NUM 32
++
++
++
++//for ioctl
++#define MAKE_DRIVER_VERSION(_MainVer,_MinorVer) ((((u32)(_MainVer))<<16)+_MinorVer)
++
++#define NIC_HEADER_SIZE 14 //!< can be moved to typedef.h
++#define NIC_MAX_PACKET_SIZE 1514 //!< can be moved to typedef.h
++#define NIC_MAX_SEND_PACKETS 10 // max number of send packets the MiniportSendPackets function can accept, can be moved to typedef.h
++#define NIC_VENDOR_DRIVER_VERSION MAKE_DRIVER_VERSION(0,001) //!< can be moved to typedef.h
++#define NIC_MAX_PACKET_SIZE 1514 //!< can be moved to typedef.h
++
++typedef struct _MP_REG_ENTRY
++{
++
++ NDIS_STRING RegName; // variable name text
++ BOOLEAN bRequired; // 1 -> required, 0 -> optional
++
++ u8 Type; // NdisParameterInteger/NdisParameterHexInteger/NdisParameterStringle/NdisParameterMultiString
++ uint FieldOffset; // offset to MP_ADAPTER field
++ uint FieldSize; // size (in bytes) of the field
++
++#ifdef UNDER_AMD64
++ u64 Default;
++#else
++ u32 Default; // default value to use
++#endif
++
++ u32 Min; // minimum value allowed
++ u32 Max; // maximum value allowed
++} MP_REG_ENTRY, *PMP_REG_ENTRY;
++
++#ifdef CONFIG_USB_HCI
++typedef struct _USB_EXTENSION {
++ LPCUSB_FUNCS _lpUsbFuncs;
++ USB_HANDLE _hDevice;
++ PVOID pAdapter;
++
++#if 0
++ USB_ENDPOINT_DESCRIPTOR _endpACLIn;
++ USB_ENDPOINT_DESCRIPTOR _endpACLOutHigh;
++ USB_ENDPOINT_DESCRIPTOR _endpACLOutNormal;
++
++ USB_PIPE pPipeIn;
++ USB_PIPE pPipeOutNormal;
++ USB_PIPE pPipeOutHigh;
++#endif
++
++} USB_EXTENSION, *PUSB_EXTENSION;
++#endif
++
++
++typedef struct _OCTET_STRING{
++ u8 *Octet;
++ u16 Length;
++} OCTET_STRING, *POCTET_STRING;
++
++
++
++
++
++#endif
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/drv_types.h linux-rpi/drivers/net/wireless/rtl8192cu/include/drv_types.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/drv_types.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/drv_types.h 2015-10-07 16:40:51.000000000 +0200
+@@ -0,0 +1,661 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ *
++ ******************************************************************************/
++/*-------------------------------------------------------------------------------
++
++ For type defines and data structure defines
++
++--------------------------------------------------------------------------------*/
++
++
++#ifndef __DRV_TYPES_H__
++#define __DRV_TYPES_H__
++
++#include <drv_conf.h>
++#include <osdep_service.h>
++#include <wlan_bssdef.h>
++
++
++#ifdef PLATFORM_OS_XP
++#include <drv_types_xp.h>
++#endif
++
++#ifdef PLATFORM_OS_CE
++#include <drv_types_ce.h>
++#endif
++
++#ifdef PLATFORM_LINUX
++#include <drv_types_linux.h>
++#endif
++
++enum _NIC_VERSION {
++
++ RTL8711_NIC,
++ RTL8712_NIC,
++ RTL8713_NIC,
++ RTL8716_NIC
++
++};
++
++enum{
++ UP_LINK,
++ DOWN_LINK,
++};
++typedef struct _ADAPTER _adapter, ADAPTER,*PADAPTER;
++
++#ifdef CONFIG_80211N_HT
++#include <rtw_ht.h>
++#endif
++
++#include <rtw_cmd.h>
++#include <wlan_bssdef.h>
++#include <rtw_security.h>
++#include <rtw_xmit.h>
++#include <rtw_recv.h>
++#include <hal_intf.h>
++#include <hal_com.h>
++#include <rtw_qos.h>
++#include <rtw_pwrctrl.h>
++#include <rtw_io.h>
++#include <rtw_eeprom.h>
++#include <sta_info.h>
++#include <rtw_mlme.h>
++#include <rtw_debug.h>
++#include <rtw_rf.h>
++#include <rtw_event.h>
++#include <rtw_led.h>
++#include <rtw_mlme_ext.h>
++#include <rtw_p2p.h>
++#include <rtw_tdls.h>
++#include <rtw_ap.h>
++
++#ifdef CONFIG_DRVEXT_MODULE
++#include <drvext_api.h>
++#endif
++
++#ifdef CONFIG_MP_INCLUDED
++#include <rtw_mp.h>
++#endif
++
++#ifdef CONFIG_BR_EXT
++#include <rtw_br_ext.h>
++#endif // CONFIG_BR_EXT
++
++#ifdef CONFIG_IOCTL_CFG80211
++ #include "ioctl_cfg80211.h"
++#endif //CONFIG_IOCTL_CFG80211
++
++#define SPEC_DEV_ID_NONE BIT(0)
++#define SPEC_DEV_ID_DISABLE_HT BIT(1)
++#define SPEC_DEV_ID_ENABLE_PS BIT(2)
++#define SPEC_DEV_ID_RF_CONFIG_1T1R BIT(3)
++#define SPEC_DEV_ID_RF_CONFIG_2T2R BIT(4)
++#define SPEC_DEV_ID_ASSIGN_IFNAME BIT(5)
++
++struct specific_device_id{
++
++ u32 flags;
++
++ u16 idVendor;
++ u16 idProduct;
++
++};
++
++struct registry_priv
++{
++ u8 chip_version;
++ u8 rfintfs;
++ u8 lbkmode;
++ u8 hci;
++ NDIS_802_11_SSID ssid;
++ u8 network_mode; //infra, ad-hoc, auto
++ u8 channel;//ad-hoc support requirement
++ u8 wireless_mode;//A, B, G, auto
++ u8 scan_mode;//active, passive
++ u8 radio_enable;
++ u8 preamble;//long, short, auto
++ u8 vrtl_carrier_sense;//Enable, Disable, Auto
++ u8 vcs_type;//RTS/CTS, CTS-to-self
++ u16 rts_thresh;
++ u16 frag_thresh;
++ u8 adhoc_tx_pwr;
++ u8 soft_ap;
++ u8 power_mgnt;
++ u8 ips_mode;
++ u8 smart_ps;
++ u8 long_retry_lmt;
++ u8 short_retry_lmt;
++ u16 busy_thresh;
++ u8 ack_policy;
++ u8 mp_mode;
++ u8 software_encrypt;
++ u8 software_decrypt;
++
++ u8 acm_method;
++ //UAPSD
++ u8 wmm_enable;
++ u8 uapsd_enable;
++ u8 uapsd_max_sp;
++ u8 uapsd_acbk_en;
++ u8 uapsd_acbe_en;
++ u8 uapsd_acvi_en;
++ u8 uapsd_acvo_en;
++
++ WLAN_BSSID_EX dev_network;
++
++#ifdef CONFIG_80211N_HT
++ u8 ht_enable;
++ u8 cbw40_enable;
++ u8 ampdu_enable;//for tx
++ u8 rx_stbc;
++ u8 ampdu_amsdu;//A-MPDU Supports A-MSDU is permitted
++#endif
++ u8 lowrate_two_xmit;
++
++ u8 rf_config ;
++ u8 low_power ;
++
++ u8 wifi_spec;// !turbo_mode
++
++ u8 channel_plan;
++#ifdef CONFIG_BT_COEXIST
++ u8 bt_iso;
++ u8 bt_sco;
++ u8 bt_ampdu;
++#endif
++ BOOLEAN bAcceptAddbaReq;
++
++ u8 antdiv_cfg;
++
++ u8 usbss_enable;//0:disable,1:enable
++ u8 hwpdn_mode;//0:disable,1:enable,2:decide by EFUSE config
++ u8 hwpwrp_detect;//0:disable,1:enable
++
++ u8 hw_wps_pbc;//0:disable,1:enable
++
++#ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE
++ char adaptor_info_caching_file_path[PATH_LENGTH_MAX];
++#endif
++
++#ifdef CONFIG_LAYER2_ROAMING
++ u8 max_roaming_times; // the max number driver will try to roaming
++#endif
++
++#ifdef CONFIG_IOL
++ bool force_iol; //enable iol without other concern
++#endif
++ u8 special_rf_path; //0: 2T2R ,1: only turn on path A 1T1R, 2: only turn on path B 1T1R
++ u8 mac_phy_mode; //0:by efuse, 1:smsp, 2:dmdp, 3:dmsp.
++
++#ifdef CONFIG_80211D
++ u8 enable80211d;
++#endif
++
++ u8 ifname[16];
++ u8 if2name[16];
++
++ u8 notch_filter;
++
++#ifdef CONFIG_MULTI_VIR_IFACES
++ u8 ext_iface_num;//primary/secondary iface is excluded
++#endif
++};
++
++
++//For registry parameters
++#define RGTRY_OFT(field) ((ULONG)FIELD_OFFSET(struct registry_priv,field))
++#define RGTRY_SZ(field) sizeof(((struct registry_priv*) 0)->field)
++#define BSSID_OFT(field) ((ULONG)FIELD_OFFSET(WLAN_BSSID_EX,field))
++#define BSSID_SZ(field) sizeof(((PWLAN_BSSID_EX) 0)->field)
++
++#define MAX_CONTINUAL_URB_ERR 4
++
++#ifdef CONFIG_SDIO_HCI
++#include <drv_types_sdio.h>
++#define INTF_DATA SDIO_DATA
++#endif
++
++#define GET_PRIMARY_ADAPTER(padapter) (((_adapter *)padapter)->dvobj->if1)
++
++#define GET_IFACE_NUMS(padapter) (((_adapter *)padapter)->dvobj->iface_nums)
++#define GET_ADAPTER(padapter, iface_id) (((_adapter *)padapter)->dvobj->padapters[iface_id])
++
++enum _IFACE_ID {
++ IFACE_ID0, //maping to PRIMARY_ADAPTER
++ IFACE_ID1, //maping to SECONDARY_ADAPTER
++ IFACE_ID2,
++ IFACE_ID3,
++ IFACE_ID_MAX,
++};
++
++struct dvobj_priv
++{
++ _adapter *if1; //PRIMARY_ADAPTER
++ _adapter *if2; //SECONDARY_ADAPTER
++
++ s32 processing_dev_remove;
++
++ //for local/global synchronization
++ _mutex hw_init_mutex;
++ _mutex h2c_fwcmd_mutex;
++ _mutex setch_mutex;
++ _mutex setbw_mutex;
++
++ unsigned char oper_channel; //saved channel info when call set_channel_bw
++ unsigned char oper_bwmode;
++ unsigned char oper_ch_offset;//PRIME_CHNL_OFFSET
++ u32 on_oper_ch_time;
++
++ //extend to support mulitu interface
++ //padapters[IFACE_ID0] == if1
++ //padapters[IFACE_ID1] == if2
++ _adapter *padapters[IFACE_ID_MAX];
++ u8 iface_nums; // total number of ifaces used runtime
++
++ //For 92D, DMDP have 2 interface.
++ u8 InterfaceNumber;
++ u8 NumInterfaces;
++ u8 DualMacMode;
++ u8 irq_alloc;
++
++/*-------- below is for SDIO INTERFACE --------*/
++
++#ifdef INTF_DATA
++ INTF_DATA intf_data;
++#endif
++
++/*-------- below is for USB INTERFACE --------*/
++
++#ifdef CONFIG_USB_HCI
++
++ u8 nr_endpoint;
++ u8 ishighspeed;
++ u8 RtNumInPipes;
++ u8 RtNumOutPipes;
++ int ep_num[5]; //endpoint number
++
++ int RegUsbSS;
++
++ _sema usb_suspend_sema;
++
++#ifdef CONFIG_USB_VENDOR_REQ_MUTEX
++ _mutex usb_vendor_req_mutex;
++#endif
++
++#ifdef CONFIG_USB_VENDOR_REQ_BUFFER_PREALLOC
++ u8 * usb_alloc_vendor_req_buf;
++ u8 * usb_vendor_req_buf;
++#endif
++
++#ifdef PLATFORM_WINDOWS
++ //related device objects
++ PDEVICE_OBJECT pphysdevobj;//pPhysDevObj;
++ PDEVICE_OBJECT pfuncdevobj;//pFuncDevObj;
++ PDEVICE_OBJECT pnextdevobj;//pNextDevObj;
++
++ u8 nextdevstacksz;//unsigned char NextDeviceStackSize; //= (CHAR)CEdevice->pUsbDevObj->StackSize + 1;
++
++ //urb for control diescriptor request
++
++#ifdef PLATFORM_OS_XP
++ struct _URB_CONTROL_DESCRIPTOR_REQUEST descriptor_urb;
++ PUSB_CONFIGURATION_DESCRIPTOR pconfig_descriptor;//UsbConfigurationDescriptor;
++#endif
++
++#ifdef PLATFORM_OS_CE
++ WCHAR active_path[MAX_ACTIVE_REG_PATH]; // adapter regpath
++ USB_EXTENSION usb_extension;
++
++ _nic_hdl pipehdls_r8192c[0x10];
++#endif
++
++ u32 config_descriptor_len;//ULONG UsbConfigurationDescriptorLength;
++#endif//PLATFORM_WINDOWS
++
++#ifdef PLATFORM_LINUX
++ struct usb_interface *pusbintf;
++ struct usb_device *pusbdev;
++#endif//PLATFORM_LINUX
++
++#ifdef PLATFORM_FREEBSD
++ struct usb_interface *pusbintf;
++ struct usb_device *pusbdev;
++#endif//PLATFORM_FREEBSD
++ ATOMIC_T continual_urb_error;
++#endif//CONFIG_USB_HCI
++
++/*-------- below is for PCIE INTERFACE --------*/
++
++#ifdef CONFIG_PCI_HCI
++
++#ifdef PLATFORM_LINUX
++ struct pci_dev *ppcidev;
++
++ //PCI MEM map
++ unsigned long pci_mem_end; /* shared mem end */
++ unsigned long pci_mem_start; /* shared mem start */
++
++ //PCI IO map
++ unsigned long pci_base_addr; /* device I/O address */
++
++ //PciBridge
++ struct pci_priv pcipriv;
++
++ u16 irqline;
++ u8 irq_enabled;
++ RT_ISR_CONTENT isr_content;
++ _lock irq_th_lock;
++
++ //ASPM
++ u8 const_pci_aspm;
++ u8 const_amdpci_aspm;
++ u8 const_hwsw_rfoff_d3;
++ u8 const_support_pciaspm;
++ // pci-e bridge */
++ u8 const_hostpci_aspm_setting;
++ // pci-e device */
++ u8 const_devicepci_aspm_setting;
++ u8 b_support_aspm; // If it supports ASPM, Offset[560h] = 0x40, otherwise Offset[560h] = 0x00.
++ u8 b_support_backdoor;
++ u8 bdma64;
++#endif//PLATFORM_LINUX
++
++#endif//CONFIG_PCI_HCI
++};
++
++#ifdef PLATFORM_LINUX
++static struct device *dvobj_to_dev(struct dvobj_priv *dvobj)
++{
++ /* todo: get interface type from dvobj and the return the dev accordingly */
++#ifdef RTW_DVOBJ_CHIP_HW_TYPE
++#endif
++
++#ifdef CONFIG_USB_HCI
++ return &dvobj->pusbintf->dev;
++#endif
++#ifdef CONFIG_SDIO_HCI
++ return &dvobj->intf_data.func->dev;
++#endif
++#ifdef CONFIG_PCI_HCI
++ return &dvobj->ppcidev->dev;
++#endif
++}
++#endif
++
++
++enum _IFACE_TYPE {
++ IFACE_PORT0, //mapping to port0 for C/D series chips
++ IFACE_PORT1, //mapping to port1 for C/D series chip
++ MAX_IFACE_PORT,
++};
++
++enum _ADAPTER_TYPE {
++ PRIMARY_ADAPTER,
++ SECONDARY_ADAPTER,
++ MAX_ADAPTER = 0xFF,
++};
++
++typedef enum _DRIVER_STATE{
++ DRIVER_NORMAL = 0,
++ DRIVER_DISAPPEAR = 1,
++ DRIVER_REPLACE_DONGLE = 2,
++}DRIVER_STATE;
++
++#ifdef CONFIG_INTEL_PROXIM
++struct proxim {
++ bool proxim_support;
++ bool proxim_on;
++
++ void *proximity_priv;
++ int (*proxim_rx)(_adapter *padapter,
++ union recv_frame *precv_frame);
++ u8 (*proxim_get_var)(_adapter* padapter, u8 type);
++};
++#endif //CONFIG_INTEL_PROXIM
++
++#ifdef RTL8723A_SDIO_LOOPBACK
++typedef struct loopbackdata
++{
++ _sema sema;
++ _thread_hdl_ lbkthread;
++ u8 bstop;
++ u32 cnt;
++ u16 size;
++ u16 txsize;
++ u8 txbuf[0x8000];
++ u16 rxsize;
++ u8 rxbuf[0x8000];
++ u8 msg[100];
++
++}LOOPBACKDATA, *PLOOPBACKDATA;
++#endif
++
++struct _ADAPTER{
++ int DriverState;// for disable driver using module, use dongle to replace module.
++ int pid[3];//process id from UI, 0:wps, 1:hostapd, 2:dhcpcd
++ int bDongle;//build-in module or external dongle
++ u16 chip_type;
++ u16 HardwareType;
++ u16 interface_type;//USB,SDIO,PCI
++
++ struct dvobj_priv *dvobj;
++ struct mlme_priv mlmepriv;
++ struct mlme_ext_priv mlmeextpriv;
++ struct cmd_priv cmdpriv;
++ struct evt_priv evtpriv;
++ //struct io_queue *pio_queue;
++ struct io_priv iopriv;
++ struct xmit_priv xmitpriv;
++ struct recv_priv recvpriv;
++ struct sta_priv stapriv;
++ struct security_priv securitypriv;
++ _lock security_key_mutex; // add for CONFIG_IEEE80211W, none 11w also can use
++ struct registry_priv registrypriv;
++ struct pwrctrl_priv pwrctrlpriv;
++ struct eeprom_priv eeprompriv;
++ struct led_priv ledpriv;
++
++#ifdef CONFIG_MP_INCLUDED
++ struct mp_priv mppriv;
++#endif
++
++#ifdef CONFIG_DRVEXT_MODULE
++ struct drvext_priv drvextpriv;
++#endif
++
++#ifdef CONFIG_AP_MODE
++ struct hostapd_priv *phostapdpriv;
++#endif
++
++#ifdef CONFIG_IOCTL_CFG80211
++#ifdef CONFIG_P2P
++ struct cfg80211_wifidirect_info cfg80211_wdinfo;
++#endif //CONFIG_P2P
++#endif //CONFIG_IOCTL_CFG80211
++ u32 setband;
++#ifdef CONFIG_P2P
++ struct wifidirect_info wdinfo;
++#endif //CONFIG_P2P
++
++#ifdef CONFIG_TDLS
++ struct tdls_info tdlsinfo;
++#endif //CONFIG_TDLS
++
++#ifdef CONFIG_WFD
++ struct wifi_display_info wfd_info;
++#endif //CONFIG_WFD
++
++ PVOID HalData;
++ u32 hal_data_sz;
++ struct hal_ops HalFunc;
++
++#ifdef CONFIG_BT_COEXIST
++ //struct btcoexist_priv bt_coexist;
++#endif
++ s32 bDriverStopped;
++ s32 bSurpriseRemoved;
++ s32 bCardDisableWOHSM;
++
++ u32 IsrContent;
++ u32 ImrContent;
++
++ u8 EepromAddressSize;
++ u8 hw_init_completed;
++ u8 bDriverIsGoingToUnload;
++ u8 init_adpt_in_progress;
++ u8 bHaltInProgress;
++
++ _thread_hdl_ cmdThread;
++ _thread_hdl_ evtThread;
++ _thread_hdl_ xmitThread;
++ _thread_hdl_ recvThread;
++
++#ifndef PLATFORM_LINUX
++ NDIS_STATUS (*dvobj_init)(struct dvobj_priv *dvobj);
++ void (*dvobj_deinit)(struct dvobj_priv *dvobj);
++#endif
++
++ void (*intf_start)(_adapter * adapter);
++ void (*intf_stop)(_adapter * adapter);
++
++#ifdef PLATFORM_WINDOWS
++ _nic_hdl hndis_adapter;//hNdisAdapter(NDISMiniportAdapterHandle);
++ _nic_hdl hndis_config;//hNdisConfiguration;
++ NDIS_STRING fw_img;
++
++ u32 NdisPacketFilter;
++ u8 MCList[MAX_MCAST_LIST_NUM][6];
++ u32 MCAddrCount;
++#endif //end of PLATFORM_WINDOWS
++
++
++#ifdef PLATFORM_LINUX
++ _nic_hdl pnetdev;
++
++ // used by rtw_rereg_nd_name related function
++ struct rereg_nd_name_data {
++ _nic_hdl old_pnetdev;
++ char old_ifname[IFNAMSIZ];
++ u8 old_ips_mode;
++ u8 old_bRegUseLed;
++ } rereg_nd_name_priv;
++
++ int bup;
++ struct net_device_stats stats;
++ struct iw_statistics iwstats;
++ struct proc_dir_entry *dir_dev;// for proc directory
++
++#ifdef CONFIG_IOCTL_CFG80211
++ struct wireless_dev *rtw_wdev;
++#endif //CONFIG_IOCTL_CFG80211
++
++#endif //end of PLATFORM_LINUX
++
++#ifdef PLATFORM_FREEBSD
++ _nic_hdl pifp;
++ int bup;
++ _lock glock;
++#endif //PLATFORM_FREEBSD
++ int net_closed;
++
++ u8 bFWReady;
++ u8 bReadPortCancel;
++ u8 bWritePortCancel;
++ u8 bRxRSSIDisplay;
++ // Added by Albert 2012/07/26
++ // The driver will write the initial gain everytime when running in the DM_Write_DIG function.
++ u8 bForceWriteInitGain;
++ // Added by Albert 2012/10/26
++ // The driver will show up the desired channel number when this flag is 1.
++ u8 bNotifyChannelChange;
++#ifdef CONFIG_P2P
++ // Added by Albert 2012/12/06
++ // The driver will show the current P2P status when the upper application reads it.
++ u8 bShowGetP2PState;
++#endif
++#ifdef CONFIG_AUTOSUSPEND
++ u8 bDisableAutosuspend;
++#endif
++
++ //pbuddy_adapter is used only in two inteface case, (iface_nums=2 in struct dvobj_priv)
++ //PRIMARY_ADAPTER's buddy is SECONDARY_ADAPTER
++ //SECONDARY_ADAPTER's buddy is PRIMARY_ADAPTER
++ //for iface_id > SECONDARY_ADAPTER(IFACE_ID1), refer to padapters[iface_id] in struct dvobj_priv
++ //and their pbuddy_adapter is PRIMARY_ADAPTER.
++ //for PRIMARY_ADAPTER(IFACE_ID0) can directly refer to if1 in struct dvobj_priv
++ _adapter *pbuddy_adapter;
++
++#if defined(CONFIG_CONCURRENT_MODE) || defined(CONFIG_DUALMAC_CONCURRENT)
++ u8 isprimary; //is primary adapter or not
++ //notes:
++ // if isprimary is true, the adapter_type value is 0, iface_id is IFACE_ID0 for PRIMARY_ADAPTER
++ // if isprimary is false, the adapter_type value is 1, iface_id is IFACE_ID1 for SECONDARY_ADAPTER
++ // refer to iface_id if iface_nums>2 and isprimary is false and the adapter_type value is 0xff.
++ u8 adapter_type;//used only in two inteface case(PRIMARY_ADAPTER and SECONDARY_ADAPTER) .
++ u8 iface_type; //interface port type, it depends on HW port
++#endif
++
++ //extend to support multi interface
++ //IFACE_ID0 is equals to PRIMARY_ADAPTER
++ //IFACE_ID1 is equals to SECONDARY_ADAPTER
++ u8 iface_id;
++
++#ifdef CONFIG_DUALMAC_CONCURRENT
++ u8 DualMacConcurrent; // 1: DMSP 0:DMDP
++#endif
++
++#ifdef CONFIG_BR_EXT
++ _lock br_ext_lock;
++ //unsigned int macclone_completed;
++ struct nat25_network_db_entry *nethash[NAT25_HASH_SIZE];
++ int pppoe_connection_in_progress;
++ unsigned char pppoe_addr[MACADDRLEN];
++ unsigned char scdb_mac[MACADDRLEN];
++ unsigned char scdb_ip[4];
++ struct nat25_network_db_entry *scdb_entry;
++ unsigned char br_mac[MACADDRLEN];
++ unsigned char br_ip[4];
++
++ struct br_ext_info ethBrExtInfo;
++#endif // CONFIG_BR_EXT
++
++#ifdef CONFIG_INTEL_PROXIM
++ /* intel Proximity, should be alloc mem
++ * in intel Proximity module and can only
++ * be used in intel Proximity mode */
++ struct proxim proximity;
++#endif //CONFIG_INTEL_PROXIM
++
++#ifdef RTL8723A_SDIO_LOOPBACK
++ PLOOPBACKDATA ploopback;
++#endif
++
++};
++
++#define adapter_to_dvobj(adapter) (adapter->dvobj)
++
++int rtw_handle_dualmac(_adapter *adapter, bool init);
++
++__inline static u8 *myid(struct eeprom_priv *peepriv)
++{
++ return (peepriv->mac_addr);
++}
++
++
++#endif //__DRV_TYPES_H__
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/drv_types_linux.h linux-rpi/drivers/net/wireless/rtl8192cu/include/drv_types_linux.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/drv_types_linux.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/drv_types_linux.h 2015-10-07 16:40:51.000000000 +0200
+@@ -0,0 +1,24 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ *
++ ******************************************************************************/
++#ifndef __DRV_TYPES_LINUX_H__
++#define __DRV_TYPES_LINUX_H__
++
++
++#endif
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/drv_types_sdio.h linux-rpi/drivers/net/wireless/rtl8192cu/include/drv_types_sdio.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/drv_types_sdio.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/drv_types_sdio.h 2015-10-07 16:40:51.000000000 +0200
+@@ -0,0 +1,69 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ *
++ ******************************************************************************/
++#ifndef __DRV_TYPES_SDIO_H__
++#define __DRV_TYPES_SDIO_H__
++
++#include <drv_conf.h>
++#include <basic_types.h>
++
++// SDIO Header Files
++#ifdef PLATFORM_LINUX
++#include <linux/mmc/sdio_func.h>
++#endif
++#ifdef PLATFORM_OS_XP
++#include <wdm.h>
++#include <ntddsd.h>
++#endif
++#ifdef PLATFORM_OS_CE
++#include <sdcardddk.h>
++#endif
++
++
++typedef struct sdio_data
++{
++ u8 func_number;
++
++ u8 tx_block_mode;
++ u8 rx_block_mode;
++ u32 block_transfer_len;
++
++#ifdef PLATFORM_LINUX
++ struct sdio_func *func;
++#endif
++
++#ifdef PLATFORM_OS_XP
++ PDEVICE_OBJECT pphysdevobj;
++ PDEVICE_OBJECT pfuncdevobj;
++ PDEVICE_OBJECT pnextdevobj;
++ SDBUS_INTERFACE_STANDARD sdbusinft;
++ u8 nextdevstacksz;
++#endif
++
++#ifdef PLATFORM_OS_CE
++ SD_DEVICE_HANDLE hDevice;
++ SD_CARD_RCA sd_rca;
++ SD_CARD_INTERFACE card_intf;
++ BOOLEAN enableIsarWithStatus;
++ WCHAR active_path[MAX_ACTIVE_REG_PATH];
++ SD_HOST_BLOCK_CAPABILITY sd_host_blk_cap;
++#endif
++} SDIO_DATA, *PSDIO_DATA;
++
++#endif
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/drv_types_xp.h linux-rpi/drivers/net/wireless/rtl8192cu/include/drv_types_xp.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/drv_types_xp.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/drv_types_xp.h 2015-10-07 16:40:51.000000000 +0200
+@@ -0,0 +1,94 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ *
++ ******************************************************************************/
++#ifndef __DRV_TYPES_XP_H__
++#define __DRV_TYPES_XP_H__
++
++#include <drv_conf.h>
++#include <osdep_service.h>
++
++
++
++#define MAX_MCAST_LIST_NUM 32
++
++
++
++//for ioctl
++#define MAKE_DRIVER_VERSION(_MainVer,_MinorVer) ((((u32)(_MainVer))<<16)+_MinorVer)
++
++#define NIC_HEADER_SIZE 14 //!< can be moved to typedef.h
++#define NIC_MAX_PACKET_SIZE 1514 //!< can be moved to typedef.h
++#define NIC_MAX_SEND_PACKETS 10 // max number of send packets the MiniportSendPackets function can accept, can be moved to typedef.h
++#define NIC_VENDOR_DRIVER_VERSION MAKE_DRIVER_VERSION(0,001) //!< can be moved to typedef.h
++#define NIC_MAX_PACKET_SIZE 1514 //!< can be moved to typedef.h
++
++
++#undef ON_VISTA
++//added by Jackson
++#ifndef ON_VISTA
++//
++// Bus driver versions
++//
++
++#define SDBUS_DRIVER_VERSION_1 0x100
++#define SDBUS_DRIVER_VERSION_2 0x200
++
++#define SDP_FUNCTION_TYPE 4
++#define SDP_BUS_DRIVER_VERSION 5
++#define SDP_BUS_WIDTH 6
++#define SDP_BUS_CLOCK 7
++#define SDP_BUS_INTERFACE_CONTROL 8
++#define SDP_HOST_BLOCK_LENGTH 9
++#define SDP_FUNCTION_BLOCK_LENGTH 10
++#define SDP_FN0_BLOCK_LENGTH 11
++#define SDP_FUNCTION_INT_ENABLE 12
++#endif
++
++
++typedef struct _MP_REG_ENTRY
++{
++
++ NDIS_STRING RegName; // variable name text
++ BOOLEAN bRequired; // 1 -> required, 0 -> optional
++
++ u8 Type; // NdisParameterInteger/NdisParameterHexInteger/NdisParameterStringle/NdisParameterMultiString
++ uint FieldOffset; // offset to MP_ADAPTER field
++ uint FieldSize; // size (in bytes) of the field
++
++#ifdef UNDER_AMD64
++ u64 Default;
++#else
++ u32 Default; // default value to use
++#endif
++
++ u32 Min; // minimum value allowed
++ u32 Max; // maximum value allowed
++} MP_REG_ENTRY, *PMP_REG_ENTRY;
++
++
++typedef struct _OCTET_STRING{
++ u8 *Octet;
++ u16 Length;
++} OCTET_STRING, *POCTET_STRING;
++
++
++
++
++
++#endif
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/ethernet.h linux-rpi/drivers/net/wireless/rtl8192cu/include/ethernet.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/ethernet.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/ethernet.h 2015-10-07 16:40:51.000000000 +0200
+@@ -0,0 +1,41 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ *
++ ******************************************************************************/
++/*! \file */
++#ifndef __INC_ETHERNET_H
++#define __INC_ETHERNET_H
++
++#define ETHERNET_ADDRESS_LENGTH 6 //!< Ethernet Address Length
++#define ETHERNET_HEADER_SIZE 14 //!< Ethernet Header Length
++#define LLC_HEADER_SIZE 6 //!< LLC Header Length
++#define TYPE_LENGTH_FIELD_SIZE 2 //!< Type/Length Size
++#define MINIMUM_ETHERNET_PACKET_SIZE 60 //!< Minimum Ethernet Packet Size
++#define MAXIMUM_ETHERNET_PACKET_SIZE 1514 //!< Maximum Ethernet Packet Size
++
++#define RT_ETH_IS_MULTICAST(_pAddr) ((((UCHAR *)(_pAddr))[0]&0x01)!=0) //!< Is Multicast Address?
++#define RT_ETH_IS_BROADCAST(_pAddr) ( \
++ ((UCHAR *)(_pAddr))[0]==0xff && \
++ ((UCHAR *)(_pAddr))[1]==0xff && \
++ ((UCHAR *)(_pAddr))[2]==0xff && \
++ ((UCHAR *)(_pAddr))[3]==0xff && \
++ ((UCHAR *)(_pAddr))[4]==0xff && \
++ ((UCHAR *)(_pAddr))[5]==0xff ) //!< Is Broadcast Address?
++
++
++#endif // #ifndef __INC_ETHERNET_H
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/h2clbk.h linux-rpi/drivers/net/wireless/rtl8192cu/include/h2clbk.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/h2clbk.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/h2clbk.h 2015-10-07 16:40:51.000000000 +0200
+@@ -0,0 +1,35 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ *
++ ******************************************************************************/
++
++
++#define _H2CLBK_H_
++
++
++#include <rtl8711_spec.h>
++#include <TypeDef.h>
++
++
++void _lbk_cmd(PADAPTER Adapter);
++
++void _lbk_rsp(PADAPTER Adapter);
++
++void _lbk_evt(IN PADAPTER Adapter);
++
++void h2c_event_callback(unsigned char *dev, unsigned char *pbuf);
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/Hal8192CEHWImg.h linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192CEHWImg.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/Hal8192CEHWImg.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192CEHWImg.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,85 @@
+/******************************************************************************
+ *
@@ -168375,9 +172772,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192CEHWImg.h li
+extern u32 Rtl8192CEAGCTAB_1TArray[AGCTAB_1TArrayLength];
+
+#endif //__INC_HAL8192CE_FW_IMG_H
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyCfg.h linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyCfg.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyCfg.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyCfg.h 2015-08-26 10:26:08.757316386 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyCfg.h linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyCfg.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyCfg.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyCfg.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,427 @@
+/******************************************************************************
+ *
@@ -168806,9 +173203,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyCfg.h li
+#define PHY_SetMacReg PHY_SetBBReg
+
+#endif // __INC_HAL8192CPHYCFG_H
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyReg.h linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyReg.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyReg.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyReg.h 2015-08-26 10:26:08.757316386 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyReg.h linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyReg.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyReg.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyReg.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,1122 @@
+/******************************************************************************
+ *
@@ -169932,9 +174329,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyReg.h li
+
+
+#endif //__INC_HAL8192SPHYREG_H
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg.h linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg.h 2015-08-26 10:26:08.757316386 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg.h linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,105 @@
+/******************************************************************************
+ *
@@ -170041,9 +174438,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg.h li
+extern u32 Rtl8192CUAGCTAB_1T_HPArray[AGCTAB_1T_HPArrayLength];
+
+#endif //__INC_HAL8192CU_FW_IMG_H
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg_wowlan.h linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg_wowlan.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg_wowlan.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg_wowlan.h 2015-08-26 10:26:08.757316386 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg_wowlan.h linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg_wowlan.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg_wowlan.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg_wowlan.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,33 @@
+/******************************************************************************
+ *
@@ -170078,9 +174475,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg_wowl
+extern u8 Rtl8192CUFwUMCBCutWWImgArray[UMCBCutWWImgArrayLength];
+
+#endif //__INC_HAL8192CU_FW_IMG_WOWLAN_H
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192DEHWImg.h linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192DEHWImg.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192DEHWImg.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192DEHWImg.h 2015-08-26 10:26:08.757316386 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/Hal8192DEHWImg.h linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192DEHWImg.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/Hal8192DEHWImg.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192DEHWImg.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,66 @@
+/******************************************************************************
+ *
@@ -170148,9 +174545,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192DEHWImg.h li
+extern const u32 Rtl8192DEAGCTAB_1TArray[Rtl8192DEAGCTAB_1TArrayLength];
+
+#endif //__INC_HAL8192CU_FW_IMG_H
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyCfg.h linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyCfg.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyCfg.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyCfg.h 2015-08-26 10:26:08.757316386 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyCfg.h linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyCfg.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyCfg.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyCfg.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,527 @@
+/******************************************************************************
+ *
@@ -170679,9 +175076,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyCfg.h li
+#define PHY_SetMacReg PHY_SetBBReg
+
+#endif // __INC_HAL8192SPHYCFG_H
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyReg.h linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyReg.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyReg.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyReg.h 2015-08-26 10:26:08.757316386 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyReg.h linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyReg.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyReg.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyReg.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,1170 @@
+/******************************************************************************
+ *
@@ -171853,9 +176250,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyReg.h li
+
+
+#endif //__INC_HAL8192SPHYREG_H
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg.h linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg.h 2015-08-26 10:26:08.757316386 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg.h linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,66 @@
+/******************************************************************************
+ *
@@ -171923,9 +176320,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg.h li
+extern const u32 Rtl8192DUAGCTAB_1TArray[Rtl8192DUAGCTAB_1TArrayLength];
+
+#endif //__INC_HAL8192CU_FW_IMG_H
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg_wowlan.h linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg_wowlan.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg_wowlan.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg_wowlan.h 2015-08-26 10:26:08.757316386 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg_wowlan.h linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg_wowlan.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg_wowlan.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg_wowlan.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,29 @@
+/******************************************************************************
+ *
@@ -171956,2713 +176353,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg_wowl
+extern u8 Rtl8192DUFwWWImgArray[DUWWImgArrayLength];
+
+#endif //__INC_HAL8192DU_FW_IMG_WOWLAN_H
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/HalPwrSeqCmd.h linux-rpi/drivers/net/wireless/rtl8192cu/include/HalPwrSeqCmd.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/HalPwrSeqCmd.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/HalPwrSeqCmd.h 2015-08-26 10:26:08.757316386 +0200
-@@ -0,0 +1,137 @@
-+/******************************************************************************
-+ *
-+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of version 2 of the GNU General Public License as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-+ *
-+ *
-+ ******************************************************************************/
-+#ifndef __HALPWRSEQCMD_H__
-+#define __HALPWRSEQCMD_H__
-+
-+#include <drv_types.h>
-+
-+/*---------------------------------------------*/
-+//3 The value of cmd: 4 bits
-+/*---------------------------------------------*/
-+#define PWR_CMD_READ 0x00
-+ // offset: the read register offset
-+ // msk: the mask of the read value
-+ // value: N/A, left by 0
-+ // note: dirver shall implement this function by read & msk
-+
-+#define PWR_CMD_WRITE 0x01
-+ // offset: the read register offset
-+ // msk: the mask of the write bits
-+ // value: write value
-+ // note: driver shall implement this cmd by read & msk after write
-+
-+#define PWR_CMD_POLLING 0x02
-+ // offset: the read register offset
-+ // msk: the mask of the polled value
-+ // value: the value to be polled, masked by the msd field.
-+ // note: driver shall implement this cmd by
-+ // do{
-+ // if( (Read(offset) & msk) == (value & msk) )
-+ // break;
-+ // } while(not timeout);
-+
-+#define PWR_CMD_DELAY 0x03
-+ // offset: the value to delay
-+ // msk: N/A
-+ // value: the unit of delay, 0: us, 1: ms
-+
-+#define PWR_CMD_END 0x04
-+ // offset: N/A
-+ // msk: N/A
-+ // value: N/A
-+
-+/*---------------------------------------------*/
-+//3 The value of base: 4 bits
-+/*---------------------------------------------*/
-+ // define the base address of each block
-+#define PWR_BASEADDR_MAC 0x00
-+#define PWR_BASEADDR_USB 0x01
-+#define PWR_BASEADDR_PCIE 0x02
-+#define PWR_BASEADDR_SDIO 0x03
-+
-+/*---------------------------------------------*/
-+//3 The value of interface_msk: 4 bits
-+/*---------------------------------------------*/
-+#define PWR_INTF_SDIO_MSK BIT(0)
-+#define PWR_INTF_USB_MSK BIT(1)
-+#define PWR_INTF_PCI_MSK BIT(2)
-+#define PWR_INTF_ALL_MSK (BIT(0)|BIT(1)|BIT(2)|BIT(3))
-+
-+/*---------------------------------------------*/
-+//3 The value of fab_msk: 4 bits
-+/*---------------------------------------------*/
-+#define PWR_FAB_TSMC_MSK BIT(0)
-+#define PWR_FAB_UMC_MSK BIT(1)
-+#define PWR_FAB_ALL_MSK (BIT(0)|BIT(1)|BIT(2)|BIT(3))
-+
-+/*---------------------------------------------*/
-+//3 The value of cut_msk: 8 bits
-+/*---------------------------------------------*/
-+#define PWR_CUT_TESTCHIP_MSK BIT(0)
-+#define PWR_CUT_A_MSK BIT(1)
-+#define PWR_CUT_B_MSK BIT(2)
-+#define PWR_CUT_C_MSK BIT(3)
-+#define PWR_CUT_D_MSK BIT(4)
-+#define PWR_CUT_E_MSK BIT(5)
-+#define PWR_CUT_F_MSK BIT(6)
-+#define PWR_CUT_G_MSK BIT(7)
-+#define PWR_CUT_ALL_MSK 0xFF
-+
-+
-+typedef enum _PWRSEQ_CMD_DELAY_UNIT_
-+{
-+ PWRSEQ_DELAY_US,
-+ PWRSEQ_DELAY_MS,
-+} PWRSEQ_DELAY_UNIT;
-+
-+typedef struct _WL_PWR_CFG_
-+{
-+ u16 offset;
-+ u8 cut_msk;
-+ u8 fab_msk:4;
-+ u8 interface_msk:4;
-+ u8 base:4;
-+ u8 cmd:4;
-+ u8 msk;
-+ u8 value;
-+} WLAN_PWR_CFG, *PWLAN_PWR_CFG;
-+
-+
-+#define GET_PWR_CFG_OFFSET(__PWR_CMD) __PWR_CMD.offset
-+#define GET_PWR_CFG_CUT_MASK(__PWR_CMD) __PWR_CMD.cut_msk
-+#define GET_PWR_CFG_FAB_MASK(__PWR_CMD) __PWR_CMD.fab_msk
-+#define GET_PWR_CFG_INTF_MASK(__PWR_CMD) __PWR_CMD.interface_msk
-+#define GET_PWR_CFG_BASE(__PWR_CMD) __PWR_CMD.base
-+#define GET_PWR_CFG_CMD(__PWR_CMD) __PWR_CMD.cmd
-+#define GET_PWR_CFG_MASK(__PWR_CMD) __PWR_CMD.msk
-+#define GET_PWR_CFG_VALUE(__PWR_CMD) __PWR_CMD.value
-+
-+
-+//================================================================================
-+// Prototype of protected function.
-+//================================================================================
-+u8 HalPwrSeqCmdParsing(
-+ PADAPTER padapter,
-+ u8 CutVersion,
-+ u8 FabVersion,
-+ u8 InterfaceType,
-+ WLAN_PWR_CFG PwrCfgCmd[]);
-+
-+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/autoconf.h linux-rpi/drivers/net/wireless/rtl8192cu/include/autoconf.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/autoconf.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/autoconf.h 2015-08-26 10:26:08.757316386 +0200
-@@ -0,0 +1,336 @@
-+/******************************************************************************
-+ *
-+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of version 2 of the GNU General Public License as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-+ *
-+ *
-+ ******************************************************************************/
-+
-+/*
-+ * Public General Config
-+ */
-+#define AUTOCONF_INCLUDED
-+#define RTL871X_MODULE_NAME "92CU"
-+#define DRV_NAME "rtl8192cu"
-+
-+#define CONFIG_USB_HCI 1
-+
-+#define CONFIG_RTL8192C 1
-+
-+#define PLATFORM_LINUX 1
-+
-+//#define CONFIG_IOCTL_CFG80211 1
-+#ifdef CONFIG_IOCTL_CFG80211
-+ //#define RTW_USE_CFG80211_STA_EVENT /* Indecate new sta asoc through cfg80211_new_sta */
-+ #define CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER
-+ //#define CONFIG_DEBUG_CFG80211 1
-+ //#define CONFIG_DRV_ISSUE_PROV_REQ // IOT FOR S2
-+ #define CONFIG_SET_SCAN_DENY_TIMER
-+#endif
-+
-+/*
-+ * Internal General Config
-+ */
-+//#define CONFIG_PWRCTRL
-+//#define CONFIG_H2CLBK
-+
-+#define CONFIG_EMBEDDED_FWIMG 1
-+//#define CONFIG_FILE_FWIMG
-+
-+#ifdef CONFIG_WAKE_ON_WLAN
-+#define CONFIG_WOWLAN 1
-+#endif //CONFIG_WAKE_ON_WLAN
-+
-+#define CONFIG_R871X_TEST 1
-+
-+#define CONFIG_XMIT_ACK
-+#ifdef CONFIG_XMIT_ACK
-+ #define CONFIG_XMIT_ACK_POLLING
-+ #define CONFIG_ACTIVE_KEEP_ALIVE_CHECK
-+#endif
-+
-+#define CONFIG_80211N_HT 1
-+
-+#define CONFIG_RECV_REORDERING_CTRL 1
-+
-+//#define CONFIG_TCP_CSUM_OFFLOAD_RX 1
-+
-+//#define CONFIG_BEFORE_LINKED_DIG
-+//#define CONFIG_DRVEXT_MODULE 1
-+
-+#ifndef CONFIG_MP_INCLUDED
-+ #define CONFIG_IPS 1
-+ #ifdef CONFIG_IPS
-+ //#define CONFIG_IPS_LEVEL_2 1 //enable this to set default IPS mode to IPS_LEVEL_2
-+ #endif
-+
-+ #define SUPPORT_HW_RFOFF_DETECTED 1
-+
-+ #define CONFIG_LPS 1
-+ #define CONFIG_BT_COEXIST 1
-+
-+ //befor link
-+ #define CONFIG_ANTENNA_DIVERSITY
-+
-+ //after link
-+ #ifdef CONFIG_ANTENNA_DIVERSITY
-+ #define CONFIG_SW_ANTENNA_DIVERSITY
-+ //#define CONFIG_HW_ANTENNA_DIVERSITY
-+ #endif
-+
-+ #define CONFIG_IOL
-+#else //#ifndef CONFIG_MP_INCLUDED
-+ #define CONFIG_MP_IWPRIV_SUPPORT 1
-+#endif //#ifndef CONFIG_MP_INCLUDED
-+
-+#define CONFIG_AP_MODE 1
-+#ifdef CONFIG_AP_MODE
-+ #define CONFIG_NATIVEAP_MLME 1
-+ #ifndef CONFIG_NATIVEAP_MLME
-+ #define CONFIG_HOSTAPD_MLME 1
-+ #endif
-+ #define CONFIG_FIND_BEST_CHANNEL 1
-+ //#define CONFIG_NO_WIRELESS_HANDLERS 1
-+#endif
-+
-+// Added by Albert 20110314
-+#define CONFIG_P2P 1
-+#ifdef CONFIG_P2P
-+ //Added by Albert 20110812
-+ //The CONFIG_WFD is for supporting the Wi-Fi display
-+ #define CONFIG_WFD
-+
-+ #ifndef CONFIG_WIFI_TEST
-+ #define CONFIG_P2P_REMOVE_GROUP_INFO
-+ #endif
-+ //#define CONFIG_DBG_P2P
-+
-+ //#define CONFIG_P2P_PS
-+ //#define CONFIG_P2P_IPS
-+
-+ #define P2P_OP_CHECK_SOCIAL_CH
-+ // Added comment by Borg 2013/06/21
-+ // Issue: Nexus 4 is hard to do miracast.
-+ // Root Cause: After group formation,
-+ // Nexus 4 is possible to be not at OP channel of Invitation Resp/Nego Confirm but at social channel.
-+ // Patch: While scan OP channel,
-+ // not only scan OP channel of Invitation Resp/Nego Confirm,
-+ // but also scan social channel(1, 6, 11)
-+#endif
-+
-+// Added by Kurt 20110511
-+//#define CONFIG_TDLS 1
-+#ifdef CONFIG_TDLS
-+// #ifndef CONFIG_WFD
-+// #define CONFIG_WFD 1
-+// #endif
-+// #define CONFIG_TDLS_AUTOSETUP 1
-+// #define CONFIG_TDLS_AUTOCHECKALIVE 1
-+#endif
-+
-+#define CONFIG_SKB_COPY 1//for amsdu
-+
-+#define CONFIG_LED
-+#ifdef CONFIG_LED
-+ #define CONFIG_SW_LED
-+ #ifdef CONFIG_SW_LED
-+ //#define CONFIG_LED_HANDLED_BY_CMD_THREAD
-+ #endif
-+#endif // CONFIG_LED
-+
-+
-+
-+#define USB_INTERFERENCE_ISSUE // this should be checked in all usb interface
-+#define CONFIG_GLOBAL_UI_PID
-+
-+#define CONFIG_LAYER2_ROAMING
-+#define CONFIG_LAYER2_ROAMING_RESUME
-+//#define CONFIG_ADAPTOR_INFO_CACHING_FILE // now just applied on 8192cu only, should make it general...
-+//#define CONFIG_RESUME_IN_WORKQUEUE
-+//#define CONFIG_SET_SCAN_DENY_TIMER
-+#define CONFIG_LONG_DELAY_ISSUE
-+#define CONFIG_NEW_SIGNAL_STAT_PROCESS
-+//#define CONFIG_SIGNAL_DISPLAY_DBM //display RX signal with dbm
-+#define RTW_NOTCH_FILTER 0 /* 0:Disable, 1:Enable */
-+#define CONFIG_DEAUTH_BEFORE_CONNECT
-+
-+#ifdef CONFIG_IOL
-+ #define CONFIG_IOL_LLT
-+ #define CONFIG_IOL_MAC
-+ #define CONFIG_IOL_BB_PHY_REG
-+ #define CONFIG_IOL_BB_AGC_TAB
-+ #define CONFIG_IOL_RF_RF90_PATH_A
-+ #define CONFIG_IOL_RF_RF90_PATH_B
-+#endif
-+
-+#define CONFIG_BR_EXT 1 // Enable NAT2.5 support for STA mode interface with a L2 Bridge
-+#ifdef CONFIG_BR_EXT
-+#define CONFIG_BR_EXT_BRNAME "br0"
-+#endif // CONFIG_BR_EXT
-+
-+#define CONFIG_TX_MCAST2UNI 1 // Support IP multicast->unicast
-+//#define CONFIG_DM_ADAPTIVITY
-+//#define CONFIG_CHECK_AC_LIFETIME 1 // Check packet lifetime of 4 ACs.
-+
-+//#define CONFIG_CONCURRENT_MODE 1
-+#ifdef CONFIG_CONCURRENT_MODE
-+ #define CONFIG_TSF_RESET_OFFLOAD 1 // For 2 PORT TSF SYNC.
-+ //#define CONFIG_HWPORT_SWAP //Port0->Sec , Port1 -> Pri
-+ //#define CONFIG_STA_MODE_SCAN_UNDER_AP_MODE
-+ //#define CONFIG_MULTI_VIR_IFACES //besides primary&secondary interfaces, extend to support more interfaces
-+#endif // CONFIG_CONCURRENT_MODE
-+
-+#define CONFIG_80211D
-+
-+/*
-+ * Interface Related Config
-+ */
-+
-+//#define CONFIG_USB_ONE_OUT_EP
-+//#define CONFIG_USB_INTERRUPT_IN_PIPE 1
-+
-+#ifndef CONFIG_MINIMAL_MEMORY_USAGE
-+ #define CONFIG_USB_TX_AGGREGATION 1
-+ #define CONFIG_USB_RX_AGGREGATION 1
-+#endif
-+
-+#define CONFIG_PREALLOC_RECV_SKB 1
-+//#define CONFIG_REDUCE_USB_TX_INT 1 // Trade-off: Improve performance, but may cause TX URBs blocked by USB Host/Bus driver on few platforms.
-+//#define CONFIG_EASY_REPLACEMENT 1
-+
-+/*
-+ * CONFIG_USE_USB_BUFFER_ALLOC_XX uses Linux USB Buffer alloc API and is for Linux platform only now!
-+ */
-+//#define CONFIG_USE_USB_BUFFER_ALLOC_TX 1 // Trade-off: For TX path, improve stability on some platforms, but may cause performance degrade on other platforms.
-+//#define CONFIG_USE_USB_BUFFER_ALLOC_RX 1 // For RX path
-+#ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX
-+#undef CONFIG_PREALLOC_RECV_SKB
-+#endif
-+
-+/*
-+ * USB VENDOR REQ BUFFER ALLOCATION METHOD
-+ * if not set we'll use function local variable (stack memory)
-+ */
-+//#define CONFIG_USB_VENDOR_REQ_BUFFER_DYNAMIC_ALLOCATE
-+#define CONFIG_USB_VENDOR_REQ_BUFFER_PREALLOC
-+
-+#define CONFIG_USB_VENDOR_REQ_MUTEX
-+#define CONFIG_VENDOR_REQ_RETRY
-+
-+//#define CONFIG_USB_SUPPORT_ASYNC_VDN_REQ 1
-+
-+
-+/*
-+ * HAL Related Config
-+ */
-+
-+#define RTL8192C_RX_PACKET_NO_INCLUDE_CRC 1
-+
-+#define SUPPORTED_BLOCK_IO
-+
-+
-+
-+#define RTL8192CU_FW_DOWNLOAD_ENABLE 1
-+
-+#define CONFIG_ONLY_ONE_OUT_EP_TO_LOW 0
-+
-+#define CONFIG_OUT_EP_WIFI_MODE 0
-+
-+#define ENABLE_USB_DROP_INCORRECT_OUT 0
-+
-+#define RTL8192CU_ASIC_VERIFICATION 0 // For ASIC verification.
-+
-+#define RTL8192CU_ADHOC_WORKAROUND_SETTING 1
-+
-+#define DISABLE_BB_RF 0
-+
-+#define RTL8191C_FPGA_NETWORKTYPE_ADHOC 0
-+
-+#ifdef CONFIG_MP_INCLUDED
-+ #define MP_DRIVER 1
-+ #undef CONFIG_USB_TX_AGGREGATION
-+ #undef CONFIG_USB_RX_AGGREGATION
-+#else
-+ #define MP_DRIVER 0
-+#endif
-+
-+
-+/*
-+ * Platform Related Config
-+ */
-+#ifdef CONFIG_PLATFORM_MN10300
-+#define CONFIG_SPECIAL_SETTING_FOR_FUNAI_TV
-+
-+#if defined (CONFIG_SW_ANTENNA_DIVERSITY)
-+ #undef CONFIG_SW_ANTENNA_DIVERSITY
-+ #define CONFIG_HW_ANTENNA_DIVERSITY
-+#endif
-+
-+#endif
-+
-+#ifdef CONFIG_WISTRON_PLATFORM
-+
-+#endif
-+
-+#ifdef CONFIG_PLATFORM_TI_DM365
-+#define CONFIG_USE_USB_BUFFER_ALLOC_RX 1
-+#endif
-+
-+#define CONFIG_ATTEMPT_TO_FIX_AP_BEACON_ERROR
-+
-+/*
-+ * Debug Related Config
-+ */
-+//#define CONFIG_DEBUG_RTL871X
-+
-+#define DBG 0
-+//#define CONFIG_DEBUG_RTL819X
-+
-+//#define CONFIG_PROC_DEBUG 1
-+
-+//#define DBG_IO
-+//#define DBG_DELAY_OS
-+//#define DBG_MEM_ALLOC
-+//#define DBG_IOCTL
-+
-+//#define DBG_TX
-+//#define DBG_XMIT_BUF
-+//#define DBG_TX_DROP_FRAME
-+
-+//#define DBG_RX_DROP_FRAME
-+//#define DBG_RX_SEQ
-+//#define DBG_RX_SIGNAL_DISPLAY_PROCESSING
-+//#define DBG_RX_SIGNAL_DISPLAY_SSID_MONITORED "jeff-ap"
-+
-+//#define DBG_EXPIRATION_CHK
-+
-+
-+//#define DBG_SHOW_MCUFWDL_BEFORE_51_ENABLE
-+//#define DBG_ROAMING_TEST
-+
-+//#define DBG_HAL_INIT_PROFILING
-+
-+//#define DBG_MEMORY_LEAK 1
-+
-+#define DBG_CONFIG_ERROR_DETECT
-+//#define DBG_CONFIG_ERROR_RESET
-+
-+//TX use 1 urb
-+//#define CONFIG_SINGLE_XMIT_BUF
-+//RX use 1 urb
-+//#define CONFIG_SINGLE_RECV_BUF
-+
-+//turn off power tracking when traffic is busy
-+//#define CONFIG_BUSY_TRAFFIC_SKIP_PWR_TRACK
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/basic_types.h linux-rpi/drivers/net/wireless/rtl8192cu/include/basic_types.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/basic_types.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/basic_types.h 2015-08-26 10:26:08.757316386 +0200
-@@ -0,0 +1,320 @@
-+/******************************************************************************
-+ *
-+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of version 2 of the GNU General Public License as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-+ *
-+ *
-+ ******************************************************************************/
-+#ifndef __BASIC_TYPES_H__
-+#define __BASIC_TYPES_H__
-+
-+#include <drv_conf.h>
-+
-+
-+#define SUCCESS 0
-+#define FAIL (-1)
-+
-+#ifndef TRUE
-+ #define _TRUE 1
-+#else
-+ #define _TRUE TRUE
-+#endif
-+
-+#ifndef FALSE
-+ #define _FALSE 0
-+#else
-+ #define _FALSE FALSE
-+#endif
-+
-+#ifdef PLATFORM_WINDOWS
-+
-+ typedef signed char s8;
-+ typedef unsigned char u8;
-+
-+ typedef signed short s16;
-+ typedef unsigned short u16;
-+
-+ typedef signed long s32;
-+ typedef unsigned long u32;
-+
-+ typedef unsigned int uint;
-+ typedef signed int sint;
-+
-+
-+ typedef signed long long s64;
-+ typedef unsigned long long u64;
-+
-+ #ifdef NDIS50_MINIPORT
-+
-+ #define NDIS_MAJOR_VERSION 5
-+ #define NDIS_MINOR_VERSION 0
-+
-+ #endif
-+
-+ #ifdef NDIS51_MINIPORT
-+
-+ #define NDIS_MAJOR_VERSION 5
-+ #define NDIS_MINOR_VERSION 1
-+
-+ #endif
-+
-+ typedef NDIS_PROC proc_t;
-+
-+ typedef LONG atomic_t;
-+
-+#endif
-+
-+
-+#ifdef PLATFORM_LINUX
-+
-+ #include <linux/types.h>
-+ #define IN
-+ #define OUT
-+ #define VOID void
-+ #define NDIS_OID uint
-+ #define NDIS_STATUS uint
-+
-+ typedef signed int sint;
-+
-+ #ifndef PVOID
-+ typedef void * PVOID;
-+ //#define PVOID (void *)
-+ #endif
-+
-+ #define UCHAR u8
-+ #define USHORT u16
-+ #define UINT u32
-+ #define ULONG u32
-+
-+ typedef void (*proc_t)(void*);
-+
-+ typedef __kernel_size_t SIZE_T;
-+ typedef __kernel_ssize_t SSIZE_T;
-+ #define FIELD_OFFSET(s,field) ((SSIZE_T)&((s*)(0))->field)
-+
-+#endif
-+
-+
-+#ifdef PLATFORM_FREEBSD
-+
-+ typedef signed char s8;
-+ typedef unsigned char u8;
-+
-+ typedef signed short s16;
-+ typedef unsigned short u16;
-+
-+ typedef signed int s32;
-+ typedef unsigned int u32;
-+
-+ typedef unsigned int uint;
-+ typedef signed int sint;
-+ typedef long atomic_t;
-+
-+ typedef signed long long s64;
-+ typedef unsigned long long u64;
-+ #define IN
-+ #define OUT
-+ #define VOID void
-+ #define NDIS_OID uint
-+ #define NDIS_STATUS uint
-+
-+ #ifndef PVOID
-+ typedef void * PVOID;
-+ //#define PVOID (void *)
-+ #endif
-+ typedef u32 dma_addr_t;
-+ #define UCHAR u8
-+ #define USHORT u16
-+ #define UINT u32
-+ #define ULONG u32
-+
-+ typedef void (*proc_t)(void*);
-+
-+ typedef unsigned int __kernel_size_t;
-+ typedef int __kernel_ssize_t;
-+
-+ typedef __kernel_size_t SIZE_T;
-+ typedef __kernel_ssize_t SSIZE_T;
-+ #define FIELD_OFFSET(s,field) ((SSIZE_T)&((s*)(0))->field)
-+
-+#endif
-+
-+#define MEM_ALIGNMENT_OFFSET (sizeof (SIZE_T))
-+#define MEM_ALIGNMENT_PADDING (sizeof(SIZE_T) - 1)
-+
-+#define SIZE_PTR SIZE_T
-+#define SSIZE_PTR SSIZE_T
-+
-+//port from fw by thomas
-+// TODO: Belows are Sync from SD7-Driver. It is necessary to check correctness
-+
-+/*
-+ * Call endian free function when
-+ * 1. Read/write packet content.
-+ * 2. Before write integer to IO.
-+ * 3. After read integer from IO.
-+*/
-+
-+//
-+// Byte Swapping routine.
-+//
-+#define EF1Byte
-+#define EF2Byte le16_to_cpu
-+#define EF4Byte le32_to_cpu
-+
-+//
-+// Read LE format data from memory
-+//
-+#define ReadEF1Byte(_ptr) EF1Byte(*((u8 *)(_ptr)))
-+#define ReadEF2Byte(_ptr) EF2Byte(*((u16 *)(_ptr)))
-+#define ReadEF4Byte(_ptr) EF4Byte(*((u32 *)(_ptr)))
-+
-+//
-+// Write LE data to memory
-+//
-+#define WriteEF1Byte(_ptr, _val) (*((u8 *)(_ptr)))=EF1Byte(_val)
-+#define WriteEF2Byte(_ptr, _val) (*((u16 *)(_ptr)))=EF2Byte(_val)
-+#define WriteEF4Byte(_ptr, _val) (*((u32 *)(_ptr)))=EF4Byte(_val)
-+
-+//
-+// Example:
-+// BIT_LEN_MASK_32(0) => 0x00000000
-+// BIT_LEN_MASK_32(1) => 0x00000001
-+// BIT_LEN_MASK_32(2) => 0x00000003
-+// BIT_LEN_MASK_32(32) => 0xFFFFFFFF
-+//
-+#define BIT_LEN_MASK_32(__BitLen) \
-+ (0xFFFFFFFF >> (32 - (__BitLen)))
-+//
-+// Example:
-+// BIT_OFFSET_LEN_MASK_32(0, 2) => 0x00000003
-+// BIT_OFFSET_LEN_MASK_32(16, 2) => 0x00030000
-+//
-+#define BIT_OFFSET_LEN_MASK_32(__BitOffset, __BitLen) \
-+ (BIT_LEN_MASK_32(__BitLen) << (__BitOffset))
-+
-+//
-+// Description:
-+// Return 4-byte value in host byte ordering from
-+// 4-byte pointer in litten-endian system.
-+//
-+#define LE_P4BYTE_TO_HOST_4BYTE(__pStart) \
-+ (EF4Byte(*((u32 *)(__pStart))))
-+
-+//
-+// Description:
-+// Translate subfield (continuous bits in little-endian) of 4-byte value in litten byte to
-+// 4-byte value in host byte ordering.
-+//
-+#define LE_BITS_TO_4BYTE(__pStart, __BitOffset, __BitLen) \
-+ ( \
-+ ( LE_P4BYTE_TO_HOST_4BYTE(__pStart) >> (__BitOffset) ) \
-+ & \
-+ BIT_LEN_MASK_32(__BitLen) \
-+ )
-+
-+//
-+// Description:
-+// Mask subfield (continuous bits in little-endian) of 4-byte value in litten byte oredering
-+// and return the result in 4-byte value in host byte ordering.
-+//
-+#define LE_BITS_CLEARED_TO_4BYTE(__pStart, __BitOffset, __BitLen) \
-+ ( \
-+ LE_P4BYTE_TO_HOST_4BYTE(__pStart) \
-+ & \
-+ ( ~BIT_OFFSET_LEN_MASK_32(__BitOffset, __BitLen) ) \
-+ )
-+
-+//
-+// Description:
-+// Set subfield of little-endian 4-byte value to specified value.
-+//
-+#define SET_BITS_TO_LE_4BYTE(__pStart, __BitOffset, __BitLen, __Value) \
-+ *((u32 *)(__pStart)) = \
-+ EF4Byte( \
-+ LE_BITS_CLEARED_TO_4BYTE(__pStart, __BitOffset, __BitLen) \
-+ | \
-+ ( (((u32)__Value) & BIT_LEN_MASK_32(__BitLen)) << (__BitOffset) ) \
-+ );
-+
-+
-+#define BIT_LEN_MASK_16(__BitLen) \
-+ (0xFFFF >> (16 - (__BitLen)))
-+
-+#define BIT_OFFSET_LEN_MASK_16(__BitOffset, __BitLen) \
-+ (BIT_LEN_MASK_16(__BitLen) << (__BitOffset))
-+
-+#define LE_P2BYTE_TO_HOST_2BYTE(__pStart) \
-+ (EF2Byte(*((u16 *)(__pStart))))
-+
-+#define LE_BITS_TO_2BYTE(__pStart, __BitOffset, __BitLen) \
-+ ( \
-+ ( LE_P2BYTE_TO_HOST_2BYTE(__pStart) >> (__BitOffset) ) \
-+ & \
-+ BIT_LEN_MASK_16(__BitLen) \
-+ )
-+
-+#define LE_BITS_CLEARED_TO_2BYTE(__pStart, __BitOffset, __BitLen) \
-+ ( \
-+ LE_P2BYTE_TO_HOST_2BYTE(__pStart) \
-+ & \
-+ ( ~BIT_OFFSET_LEN_MASK_16(__BitOffset, __BitLen) ) \
-+ )
-+
-+#define SET_BITS_TO_LE_2BYTE(__pStart, __BitOffset, __BitLen, __Value) \
-+ *((u16 *)(__pStart)) = \
-+ EF2Byte( \
-+ LE_BITS_CLEARED_TO_2BYTE(__pStart, __BitOffset, __BitLen) \
-+ | \
-+ ( (((u16)__Value) & BIT_LEN_MASK_16(__BitLen)) << (__BitOffset) ) \
-+ );
-+
-+#define BIT_LEN_MASK_8(__BitLen) \
-+ (0xFF >> (8 - (__BitLen)))
-+
-+#define BIT_OFFSET_LEN_MASK_8(__BitOffset, __BitLen) \
-+ (BIT_LEN_MASK_8(__BitLen) << (__BitOffset))
-+
-+#define LE_P1BYTE_TO_HOST_1BYTE(__pStart) \
-+ (EF1Byte(*((u8 *)(__pStart))))
-+
-+#define LE_BITS_TO_1BYTE(__pStart, __BitOffset, __BitLen) \
-+ ( \
-+ ( LE_P1BYTE_TO_HOST_1BYTE(__pStart) >> (__BitOffset) ) \
-+ & \
-+ BIT_LEN_MASK_8(__BitLen) \
-+ )
-+
-+#define LE_BITS_CLEARED_TO_1BYTE(__pStart, __BitOffset, __BitLen) \
-+ ( \
-+ LE_P1BYTE_TO_HOST_1BYTE(__pStart) \
-+ & \
-+ ( ~BIT_OFFSET_LEN_MASK_8(__BitOffset, __BitLen) ) \
-+ )
-+
-+#define SET_BITS_TO_LE_1BYTE(__pStart, __BitOffset, __BitLen, __Value) \
-+ *((u8 *)(__pStart)) = \
-+ EF1Byte( \
-+ LE_BITS_CLEARED_TO_1BYTE(__pStart, __BitOffset, __BitLen) \
-+ | \
-+ ( (((u8)__Value) & BIT_LEN_MASK_8(__BitLen)) << (__BitOffset) ) \
-+ );
-+
-+// Get the N-bytes aligment offset from the current length
-+#define N_BYTE_ALIGMENT(__Value, __Aligment) ((__Aligment == 1) ? (__Value) : (((__Value + __Aligment - 1) / __Aligment) * __Aligment))
-+
-+typedef unsigned char BOOLEAN,*PBOOLEAN;
-+
-+#endif //__BASIC_TYPES_H__
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/byteorder/big_endian.h linux-rpi/drivers/net/wireless/rtl8192cu/include/byteorder/big_endian.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/byteorder/big_endian.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/byteorder/big_endian.h 2015-08-26 10:26:08.757316386 +0200
-@@ -0,0 +1,87 @@
-+/******************************************************************************
-+ *
-+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of version 2 of the GNU General Public License as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-+ *
-+ *
-+ ******************************************************************************/
-+#ifndef _LINUX_BYTEORDER_BIG_ENDIAN_H
-+#define _LINUX_BYTEORDER_BIG_ENDIAN_H
-+
-+#ifndef __BIG_ENDIAN
-+#define __BIG_ENDIAN 4321
-+#endif
-+#ifndef __BIG_ENDIAN_BITFIELD
-+#define __BIG_ENDIAN_BITFIELD
-+#endif
-+
-+#include <byteorder/swab.h>
-+
-+#define __constant_htonl(x) ((__u32)(x))
-+#define __constant_ntohl(x) ((__u32)(x))
-+#define __constant_htons(x) ((__u16)(x))
-+#define __constant_ntohs(x) ((__u16)(x))
-+#define __constant_cpu_to_le64(x) ___constant_swab64((x))
-+#define __constant_le64_to_cpu(x) ___constant_swab64((x))
-+#define __constant_cpu_to_le32(x) ___constant_swab32((x))
-+#define __constant_le32_to_cpu(x) ___constant_swab32((x))
-+#define __constant_cpu_to_le16(x) ___constant_swab16((x))
-+#define __constant_le16_to_cpu(x) ___constant_swab16((x))
-+#define __constant_cpu_to_be64(x) ((__u64)(x))
-+#define __constant_be64_to_cpu(x) ((__u64)(x))
-+#define __constant_cpu_to_be32(x) ((__u32)(x))
-+#define __constant_be32_to_cpu(x) ((__u32)(x))
-+#define __constant_cpu_to_be16(x) ((__u16)(x))
-+#define __constant_be16_to_cpu(x) ((__u16)(x))
-+#define __cpu_to_le64(x) __swab64((x))
-+#define __le64_to_cpu(x) __swab64((x))
-+#define __cpu_to_le32(x) __swab32((x))
-+#define __le32_to_cpu(x) __swab32((x))
-+#define __cpu_to_le16(x) __swab16((x))
-+#define __le16_to_cpu(x) __swab16((x))
-+#define __cpu_to_be64(x) ((__u64)(x))
-+#define __be64_to_cpu(x) ((__u64)(x))
-+#define __cpu_to_be32(x) ((__u32)(x))
-+#define __be32_to_cpu(x) ((__u32)(x))
-+#define __cpu_to_be16(x) ((__u16)(x))
-+#define __be16_to_cpu(x) ((__u16)(x))
-+#define __cpu_to_le64p(x) __swab64p((x))
-+#define __le64_to_cpup(x) __swab64p((x))
-+#define __cpu_to_le32p(x) __swab32p((x))
-+#define __le32_to_cpup(x) __swab32p((x))
-+#define __cpu_to_le16p(x) __swab16p((x))
-+#define __le16_to_cpup(x) __swab16p((x))
-+#define __cpu_to_be64p(x) (*(__u64*)(x))
-+#define __be64_to_cpup(x) (*(__u64*)(x))
-+#define __cpu_to_be32p(x) (*(__u32*)(x))
-+#define __be32_to_cpup(x) (*(__u32*)(x))
-+#define __cpu_to_be16p(x) (*(__u16*)(x))
-+#define __be16_to_cpup(x) (*(__u16*)(x))
-+#define __cpu_to_le64s(x) __swab64s((x))
-+#define __le64_to_cpus(x) __swab64s((x))
-+#define __cpu_to_le32s(x) __swab32s((x))
-+#define __le32_to_cpus(x) __swab32s((x))
-+#define __cpu_to_le16s(x) __swab16s((x))
-+#define __le16_to_cpus(x) __swab16s((x))
-+#define __cpu_to_be64s(x) do {} while (0)
-+#define __be64_to_cpus(x) do {} while (0)
-+#define __cpu_to_be32s(x) do {} while (0)
-+#define __be32_to_cpus(x) do {} while (0)
-+#define __cpu_to_be16s(x) do {} while (0)
-+#define __be16_to_cpus(x) do {} while (0)
-+
-+#include <byteorder/generic.h>
-+
-+#endif /* _LINUX_BYTEORDER_BIG_ENDIAN_H */
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/byteorder/generic.h linux-rpi/drivers/net/wireless/rtl8192cu/include/byteorder/generic.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/byteorder/generic.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/byteorder/generic.h 2015-08-26 10:26:08.757316386 +0200
-@@ -0,0 +1,212 @@
-+/******************************************************************************
-+ *
-+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of version 2 of the GNU General Public License as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-+ *
-+ *
-+ ******************************************************************************/
-+#ifndef _LINUX_BYTEORDER_GENERIC_H
-+#define _LINUX_BYTEORDER_GENERIC_H
-+
-+/*
-+ * linux/byteorder_generic.h
-+ * Generic Byte-reordering support
-+ *
-+ * Francois-Rene Rideau <fare@tunes.org> 19970707
-+ * gathered all the good ideas from all asm-foo/byteorder.h into one file,
-+ * cleaned them up.
-+ * I hope it is compliant with non-GCC compilers.
-+ * I decided to put __BYTEORDER_HAS_U64__ in byteorder.h,
-+ * because I wasn't sure it would be ok to put it in types.h
-+ * Upgraded it to 2.1.43
-+ * Francois-Rene Rideau <fare@tunes.org> 19971012
-+ * Upgraded it to 2.1.57
-+ * to please Linus T., replaced huge #ifdef's between little/big endian
-+ * by nestedly #include'd files.
-+ * Francois-Rene Rideau <fare@tunes.org> 19971205
-+ * Made it to 2.1.71; now a facelift:
-+ * Put files under include/linux/byteorder/
-+ * Split swab from generic support.
-+ *
-+ * TODO:
-+ * = Regular kernel maintainers could also replace all these manual
-+ * byteswap macros that remain, disseminated among drivers,
-+ * after some grep or the sources...
-+ * = Linus might want to rename all these macros and files to fit his taste,
-+ * to fit his personal naming scheme.
-+ * = it seems that a few drivers would also appreciate
-+ * nybble swapping support...
-+ * = every architecture could add their byteswap macro in asm/byteorder.h
-+ * see how some architectures already do (i386, alpha, ppc, etc)
-+ * = cpu_to_beXX and beXX_to_cpu might some day need to be well
-+ * distinguished throughout the kernel. This is not the case currently,
-+ * since little endian, big endian, and pdp endian machines needn't it.
-+ * But this might be the case for, say, a port of Linux to 20/21 bit
-+ * architectures (and F21 Linux addict around?).
-+ */
-+
-+/*
-+ * The following macros are to be defined by <asm/byteorder.h>:
-+ *
-+ * Conversion of long and short int between network and host format
-+ * ntohl(__u32 x)
-+ * ntohs(__u16 x)
-+ * htonl(__u32 x)
-+ * htons(__u16 x)
-+ * It seems that some programs (which? where? or perhaps a standard? POSIX?)
-+ * might like the above to be functions, not macros (why?).
-+ * if that's true, then detect them, and take measures.
-+ * Anyway, the measure is: define only ___ntohl as a macro instead,
-+ * and in a separate file, have
-+ * unsigned long inline ntohl(x){return ___ntohl(x);}
-+ *
-+ * The same for constant arguments
-+ * __constant_ntohl(__u32 x)
-+ * __constant_ntohs(__u16 x)
-+ * __constant_htonl(__u32 x)
-+ * __constant_htons(__u16 x)
-+ *
-+ * Conversion of XX-bit integers (16- 32- or 64-)
-+ * between native CPU format and little/big endian format
-+ * 64-bit stuff only defined for proper architectures
-+ * cpu_to_[bl]eXX(__uXX x)
-+ * [bl]eXX_to_cpu(__uXX x)
-+ *
-+ * The same, but takes a pointer to the value to convert
-+ * cpu_to_[bl]eXXp(__uXX x)
-+ * [bl]eXX_to_cpup(__uXX x)
-+ *
-+ * The same, but change in situ
-+ * cpu_to_[bl]eXXs(__uXX x)
-+ * [bl]eXX_to_cpus(__uXX x)
-+ *
-+ * See asm-foo/byteorder.h for examples of how to provide
-+ * architecture-optimized versions
-+ *
-+ */
-+
-+
-+#if defined(PLATFORM_LINUX) || defined(PLATFORM_WINDOWS) || defined(PLATFORM_MPIXEL) || defined(PLATFORM_FREEBSD)
-+/*
-+ * inside the kernel, we can use nicknames;
-+ * outside of it, we must avoid POSIX namespace pollution...
-+ */
-+#define cpu_to_le64 __cpu_to_le64
-+#define le64_to_cpu __le64_to_cpu
-+#define cpu_to_le32 __cpu_to_le32
-+#define le32_to_cpu __le32_to_cpu
-+#define cpu_to_le16 __cpu_to_le16
-+#define le16_to_cpu __le16_to_cpu
-+#define cpu_to_be64 __cpu_to_be64
-+#define be64_to_cpu __be64_to_cpu
-+#define cpu_to_be32 __cpu_to_be32
-+#define be32_to_cpu __be32_to_cpu
-+#define cpu_to_be16 __cpu_to_be16
-+#define be16_to_cpu __be16_to_cpu
-+#define cpu_to_le64p __cpu_to_le64p
-+#define le64_to_cpup __le64_to_cpup
-+#define cpu_to_le32p __cpu_to_le32p
-+#define le32_to_cpup __le32_to_cpup
-+#define cpu_to_le16p __cpu_to_le16p
-+#define le16_to_cpup __le16_to_cpup
-+#define cpu_to_be64p __cpu_to_be64p
-+#define be64_to_cpup __be64_to_cpup
-+#define cpu_to_be32p __cpu_to_be32p
-+#define be32_to_cpup __be32_to_cpup
-+#define cpu_to_be16p __cpu_to_be16p
-+#define be16_to_cpup __be16_to_cpup
-+#define cpu_to_le64s __cpu_to_le64s
-+#define le64_to_cpus __le64_to_cpus
-+#define cpu_to_le32s __cpu_to_le32s
-+#define le32_to_cpus __le32_to_cpus
-+#define cpu_to_le16s __cpu_to_le16s
-+#define le16_to_cpus __le16_to_cpus
-+#define cpu_to_be64s __cpu_to_be64s
-+#define be64_to_cpus __be64_to_cpus
-+#define cpu_to_be32s __cpu_to_be32s
-+#define be32_to_cpus __be32_to_cpus
-+#define cpu_to_be16s __cpu_to_be16s
-+#define be16_to_cpus __be16_to_cpus
-+#endif
-+
-+
-+/*
-+ * Handle ntohl and suches. These have various compatibility
-+ * issues - like we want to give the prototype even though we
-+ * also have a macro for them in case some strange program
-+ * wants to take the address of the thing or something..
-+ *
-+ * Note that these used to return a "long" in libc5, even though
-+ * long is often 64-bit these days.. Thus the casts.
-+ *
-+ * They have to be macros in order to do the constant folding
-+ * correctly - if the argument passed into a inline function
-+ * it is no longer constant according to gcc..
-+ */
-+
-+#undef ntohl
-+#undef ntohs
-+#undef htonl
-+#undef htons
-+
-+/*
-+ * Do the prototypes. Somebody might want to take the
-+ * address or some such sick thing..
-+ */
-+#if defined(PLATFORM_LINUX) || (defined (__GLIBC__) && __GLIBC__ >= 2)
-+extern __u32 ntohl(__u32);
-+extern __u32 htonl(__u32);
-+#else //defined(PLATFORM_LINUX) || (defined (__GLIBC__) && __GLIBC__ >= 2)
-+#ifndef PLATFORM_FREEBSD
-+extern unsigned long int ntohl(unsigned long int);
-+extern unsigned long int htonl(unsigned long int);
-+#endif
-+#endif
-+#ifndef PLATFORM_FREEBSD
-+extern unsigned short int ntohs(unsigned short int);
-+extern unsigned short int htons(unsigned short int);
-+#endif
-+
-+#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__) || defined(PLATFORM_MPIXEL)
-+
-+#define ___htonl(x) __cpu_to_be32(x)
-+#define ___htons(x) __cpu_to_be16(x)
-+#define ___ntohl(x) __be32_to_cpu(x)
-+#define ___ntohs(x) __be16_to_cpu(x)
-+
-+#if defined(PLATFORM_LINUX) || (defined (__GLIBC__) && __GLIBC__ >= 2)
-+#define htonl(x) ___htonl(x)
-+#define ntohl(x) ___ntohl(x)
-+#else
-+#define htonl(x) ((unsigned long)___htonl(x))
-+#define ntohl(x) ((unsigned long)___ntohl(x))
-+#endif
-+#define htons(x) ___htons(x)
-+#define ntohs(x) ___ntohs(x)
-+
-+#endif /* OPTIMIZE */
-+
-+
-+#if defined (PLATFORM_WINDOWS)
-+
-+#define htonl(x) __cpu_to_be32(x)
-+#define ntohl(x) __be32_to_cpu(x)
-+#define htons(x) __cpu_to_be16(x)
-+#define ntohs(x) __be16_to_cpu(x)
-+
-+
-+#endif
-+
-+#endif /* _LINUX_BYTEORDER_GENERIC_H */
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/byteorder/little_endian.h linux-rpi/drivers/net/wireless/rtl8192cu/include/byteorder/little_endian.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/byteorder/little_endian.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/byteorder/little_endian.h 2015-08-26 10:26:08.757316386 +0200
-@@ -0,0 +1,89 @@
-+/******************************************************************************
-+ *
-+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of version 2 of the GNU General Public License as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-+ *
-+ *
-+ ******************************************************************************/
-+#ifndef _LINUX_BYTEORDER_LITTLE_ENDIAN_H
-+#define _LINUX_BYTEORDER_LITTLE_ENDIAN_H
-+
-+#ifndef __LITTLE_ENDIAN
-+#define __LITTLE_ENDIAN 1234
-+#endif
-+#ifndef __LITTLE_ENDIAN_BITFIELD
-+#define __LITTLE_ENDIAN_BITFIELD
-+#endif
-+
-+#include <byteorder/swab.h>
-+
-+#ifndef __constant_htonl
-+#define __constant_htonl(x) ___constant_swab32((x))
-+#define __constant_ntohl(x) ___constant_swab32((x))
-+#define __constant_htons(x) ___constant_swab16((x))
-+#define __constant_ntohs(x) ___constant_swab16((x))
-+#define __constant_cpu_to_le64(x) ((__u64)(x))
-+#define __constant_le64_to_cpu(x) ((__u64)(x))
-+#define __constant_cpu_to_le32(x) ((__u32)(x))
-+#define __constant_le32_to_cpu(x) ((__u32)(x))
-+#define __constant_cpu_to_le16(x) ((__u16)(x))
-+#define __constant_le16_to_cpu(x) ((__u16)(x))
-+#define __constant_cpu_to_be64(x) ___constant_swab64((x))
-+#define __constant_be64_to_cpu(x) ___constant_swab64((x))
-+#define __constant_cpu_to_be32(x) ___constant_swab32((x))
-+#define __constant_be32_to_cpu(x) ___constant_swab32((x))
-+#define __constant_cpu_to_be16(x) ___constant_swab16((x))
-+#define __constant_be16_to_cpu(x) ___constant_swab16((x))
-+#define __cpu_to_le64(x) ((__u64)(x))
-+#define __le64_to_cpu(x) ((__u64)(x))
-+#define __cpu_to_le32(x) ((__u32)(x))
-+#define __le32_to_cpu(x) ((__u32)(x))
-+#define __cpu_to_le16(x) ((__u16)(x))
-+#define __le16_to_cpu(x) ((__u16)(x))
-+#define __cpu_to_be64(x) __swab64((x))
-+#define __be64_to_cpu(x) __swab64((x))
-+#define __cpu_to_be32(x) __swab32((x))
-+#define __be32_to_cpu(x) __swab32((x))
-+#define __cpu_to_be16(x) __swab16((x))
-+#define __be16_to_cpu(x) __swab16((x))
-+#define __cpu_to_le64p(x) (*(__u64*)(x))
-+#define __le64_to_cpup(x) (*(__u64*)(x))
-+#define __cpu_to_le32p(x) (*(__u32*)(x))
-+#define __le32_to_cpup(x) (*(__u32*)(x))
-+#define __cpu_to_le16p(x) (*(__u16*)(x))
-+#define __le16_to_cpup(x) (*(__u16*)(x))
-+#define __cpu_to_be64p(x) __swab64p((x))
-+#define __be64_to_cpup(x) __swab64p((x))
-+#define __cpu_to_be32p(x) __swab32p((x))
-+#define __be32_to_cpup(x) __swab32p((x))
-+#define __cpu_to_be16p(x) __swab16p((x))
-+#define __be16_to_cpup(x) __swab16p((x))
-+#define __cpu_to_le64s(x) do {} while (0)
-+#define __le64_to_cpus(x) do {} while (0)
-+#define __cpu_to_le32s(x) do {} while (0)
-+#define __le32_to_cpus(x) do {} while (0)
-+#define __cpu_to_le16s(x) do {} while (0)
-+#define __le16_to_cpus(x) do {} while (0)
-+#define __cpu_to_be64s(x) __swab64s((x))
-+#define __be64_to_cpus(x) __swab64s((x))
-+#define __cpu_to_be32s(x) __swab32s((x))
-+#define __be32_to_cpus(x) __swab32s((x))
-+#define __cpu_to_be16s(x) __swab16s((x))
-+#define __be16_to_cpus(x) __swab16s((x))
-+#endif // __constant_htonl
-+
-+#include <byteorder/generic.h>
-+
-+#endif /* _LINUX_BYTEORDER_LITTLE_ENDIAN_H */
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/byteorder/swab.h linux-rpi/drivers/net/wireless/rtl8192cu/include/byteorder/swab.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/byteorder/swab.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/byteorder/swab.h 2015-08-26 10:26:08.757316386 +0200
-@@ -0,0 +1,140 @@
-+/******************************************************************************
-+ *
-+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of version 2 of the GNU General Public License as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-+ *
-+ *
-+ ******************************************************************************/
-+#ifndef _LINUX_BYTEORDER_SWAB_H
-+#define _LINUX_BYTEORDER_SWAB_H
-+
-+#if !defined(CONFIG_PLATFORM_MSTAR)
-+#ifndef __u16
-+typedef unsigned short __u16;
-+#endif
-+
-+#ifndef __u32
-+typedef unsigned int __u32;
-+#endif
-+
-+#ifndef __u8
-+typedef unsigned char __u8;
-+#endif
-+
-+#ifndef __u64
-+typedef unsigned long long __u64;
-+#endif
-+
-+
-+__inline static __u16 ___swab16(__u16 x)
-+{
-+ __u16 __x = x;
-+ return
-+ ((__u16)(
-+ (((__u16)(__x) & (__u16)0x00ffU) << 8) |
-+ (((__u16)(__x) & (__u16)0xff00U) >> 8) ));
-+
-+}
-+
-+__inline static __u32 ___swab32(__u32 x)
-+{
-+ __u32 __x = (x);
-+ return ((__u32)(
-+ (((__u32)(__x) & (__u32)0x000000ffUL) << 24) |
-+ (((__u32)(__x) & (__u32)0x0000ff00UL) << 8) |
-+ (((__u32)(__x) & (__u32)0x00ff0000UL) >> 8) |
-+ (((__u32)(__x) & (__u32)0xff000000UL) >> 24) ));
-+}
-+
-+__inline static __u64 ___swab64(__u64 x)
-+{
-+ __u64 __x = (x);
-+
-+ return
-+ ((__u64)( \
-+ (__u64)(((__u64)(__x) & (__u64)0x00000000000000ffULL) << 56) | \
-+ (__u64)(((__u64)(__x) & (__u64)0x000000000000ff00ULL) << 40) | \
-+ (__u64)(((__u64)(__x) & (__u64)0x0000000000ff0000ULL) << 24) | \
-+ (__u64)(((__u64)(__x) & (__u64)0x00000000ff000000ULL) << 8) | \
-+ (__u64)(((__u64)(__x) & (__u64)0x000000ff00000000ULL) >> 8) | \
-+ (__u64)(((__u64)(__x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
-+ (__u64)(((__u64)(__x) & (__u64)0x00ff000000000000ULL) >> 40) | \
-+ (__u64)(((__u64)(__x) & (__u64)0xff00000000000000ULL) >> 56) )); \
-+}
-+#endif // CONFIG_PLATFORM_MSTAR
-+
-+#ifndef __arch__swab16
-+__inline static __u16 __arch__swab16(__u16 x)
-+{
-+ return ___swab16(x);
-+}
-+
-+#endif
-+
-+#ifndef __arch__swab32
-+__inline static __u32 __arch__swab32(__u32 x)
-+{
-+ __u32 __tmp = (x) ;
-+ return ___swab32(__tmp);
-+}
-+#endif
-+
-+#ifndef __arch__swab64
-+
-+__inline static __u64 __arch__swab64(__u64 x)
-+{
-+ __u64 __tmp = (x) ;
-+ return ___swab64(__tmp);
-+}
-+
-+
-+#endif
-+
-+#ifndef __swab16
-+#define __swab16(x) __fswab16(x)
-+#define __swab32(x) __fswab32(x)
-+#define __swab64(x) __fswab64(x)
-+#endif // __swab16
-+
-+#ifdef PLATFORM_FREEBSD
-+__inline static __u16 __fswab16(__u16 x)
-+#else
-+__inline static const __u16 __fswab16(__u16 x)
-+#endif //PLATFORM_FREEBSD
-+{
-+ return __arch__swab16(x);
-+}
-+#ifdef PLATFORM_FREEBSD
-+__inline static __u32 __fswab32(__u32 x)
-+#else
-+__inline static const __u32 __fswab32(__u32 x)
-+#endif //PLATFORM_FREEBSD
-+{
-+ return __arch__swab32(x);
-+}
-+
-+#if defined(PLATFORM_LINUX) || defined(PLATFORM_WINDOWS)
-+#define swab16 __swab16
-+#define swab32 __swab32
-+#define swab64 __swab64
-+#define swab16p __swab16p
-+#define swab32p __swab32p
-+#define swab64p __swab64p
-+#define swab16s __swab16s
-+#define swab32s __swab32s
-+#define swab64s __swab64s
-+#endif
-+
-+#endif /* _LINUX_BYTEORDER_SWAB_H */
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/byteorder/swabb.h linux-rpi/drivers/net/wireless/rtl8192cu/include/byteorder/swabb.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/byteorder/swabb.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/byteorder/swabb.h 2015-08-26 10:26:08.757316386 +0200
-@@ -0,0 +1,156 @@
-+/******************************************************************************
-+ *
-+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of version 2 of the GNU General Public License as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-+ *
-+ *
-+ ******************************************************************************/
-+#ifndef _LINUX_BYTEORDER_SWABB_H
-+#define _LINUX_BYTEORDER_SWABB_H
-+
-+/*
-+ * linux/byteorder/swabb.h
-+ * SWAp Bytes Bizarrely
-+ * swaHHXX[ps]?(foo)
-+ *
-+ * Support for obNUXIous pdp-endian and other bizarre architectures.
-+ * Will Linux ever run on such ancient beasts? if not, this file
-+ * will be but a programming pearl. Still, it's a reminder that we
-+ * shouldn't be making too many assumptions when trying to be portable.
-+ *
-+ */
-+
-+/*
-+ * Meaning of the names I chose (vaxlinux people feel free to correct them):
-+ * swahw32 swap 16-bit half-words in a 32-bit word
-+ * swahb32 swap 8-bit halves of each 16-bit half-word in a 32-bit word
-+ *
-+ * No 64-bit support yet. I don't know NUXI conventions for long longs.
-+ * I guarantee it will be a mess when it's there, though :->
-+ * It will be even worse if there are conflicting 64-bit conventions.
-+ * Hopefully, no one ever used 64-bit objects on NUXI machines.
-+ *
-+ */
-+
-+#define ___swahw32(x) \
-+({ \
-+ __u32 __x = (x); \
-+ ((__u32)( \
-+ (((__u32)(__x) & (__u32)0x0000ffffUL) << 16) | \
-+ (((__u32)(__x) & (__u32)0xffff0000UL) >> 16) )); \
-+})
-+#define ___swahb32(x) \
-+({ \
-+ __u32 __x = (x); \
-+ ((__u32)( \
-+ (((__u32)(__x) & (__u32)0x00ff00ffUL) << 8) | \
-+ (((__u32)(__x) & (__u32)0xff00ff00UL) >> 8) )); \
-+})
-+
-+#define ___constant_swahw32(x) \
-+ ((__u32)( \
-+ (((__u32)(x) & (__u32)0x0000ffffUL) << 16) | \
-+ (((__u32)(x) & (__u32)0xffff0000UL) >> 16) ))
-+#define ___constant_swahb32(x) \
-+ ((__u32)( \
-+ (((__u32)(x) & (__u32)0x00ff00ffUL) << 8) | \
-+ (((__u32)(x) & (__u32)0xff00ff00UL) >> 8) ))
-+
-+/*
-+ * provide defaults when no architecture-specific optimization is detected
-+ */
-+#ifndef __arch__swahw32
-+# define __arch__swahw32(x) ___swahw32(x)
-+#endif
-+#ifndef __arch__swahb32
-+# define __arch__swahb32(x) ___swahb32(x)
-+#endif
-+
-+#ifndef __arch__swahw32p
-+# define __arch__swahw32p(x) __swahw32(*(x))
-+#endif
-+#ifndef __arch__swahb32p
-+# define __arch__swahb32p(x) __swahb32(*(x))
-+#endif
-+
-+#ifndef __arch__swahw32s
-+# define __arch__swahw32s(x) do { *(x) = __swahw32p((x)); } while (0)
-+#endif
-+#ifndef __arch__swahb32s
-+# define __arch__swahb32s(x) do { *(x) = __swahb32p((x)); } while (0)
-+#endif
-+
-+
-+/*
-+ * Allow constant folding
-+ */
-+#if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__)
-+# define __swahw32(x) \
-+(__builtin_constant_p((__u32)(x)) ? \
-+ ___swahw32((x)) : \
-+ __fswahw32((x)))
-+# define __swahb32(x) \
-+(__builtin_constant_p((__u32)(x)) ? \
-+ ___swahb32((x)) : \
-+ __fswahb32((x)))
-+#else
-+# define __swahw32(x) __fswahw32(x)
-+# define __swahb32(x) __fswahb32(x)
-+#endif /* OPTIMIZE */
-+
-+
-+__inline static__ __const__ __u32 __fswahw32(__u32 x)
-+{
-+ return __arch__swahw32(x);
-+}
-+__inline static__ __u32 __swahw32p(__u32 *x)
-+{
-+ return __arch__swahw32p(x);
-+}
-+__inline static__ void __swahw32s(__u32 *addr)
-+{
-+ __arch__swahw32s(addr);
-+}
-+
-+
-+__inline static__ __const__ __u32 __fswahb32(__u32 x)
-+{
-+ return __arch__swahb32(x);
-+}
-+__inline static__ __u32 __swahb32p(__u32 *x)
-+{
-+ return __arch__swahb32p(x);
-+}
-+__inline static__ void __swahb32s(__u32 *addr)
-+{
-+ __arch__swahb32s(addr);
-+}
-+
-+#ifdef __BYTEORDER_HAS_U64__
-+/*
-+ * Not supported yet
-+ */
-+#endif /* __BYTEORDER_HAS_U64__ */
-+
-+#if defined(PLATFORM_LINUX)
-+#define swahw32 __swahw32
-+#define swahb32 __swahb32
-+#define swahw32p __swahw32p
-+#define swahb32p __swahb32p
-+#define swahw32s __swahw32s
-+#define swahb32s __swahb32s
-+#endif
-+
-+#endif /* _LINUX_BYTEORDER_SWABB_H */
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/circ_buf.h linux-rpi/drivers/net/wireless/rtl8192cu/include/circ_buf.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/circ_buf.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/circ_buf.h 2015-08-26 10:26:08.757316386 +0200
-@@ -0,0 +1,27 @@
-+/******************************************************************************
-+ *
-+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of version 2 of the GNU General Public License as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-+ *
-+ *
-+ ******************************************************************************/
-+#ifndef __CIRC_BUF_H_
-+#define __CIRC_BUF_H_ 1
-+
-+#define CIRC_CNT(head,tail,size) (((head) - (tail)) & ((size)-1))
-+
-+#define CIRC_SPACE(head,tail,size) CIRC_CNT((tail),((head)+1),(size))
-+
-+#endif //_CIRC_BUF_H_
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/cmd_osdep.h linux-rpi/drivers/net/wireless/rtl8192cu/include/cmd_osdep.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/cmd_osdep.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/cmd_osdep.h 2015-08-26 10:26:08.757316386 +0200
-@@ -0,0 +1,35 @@
-+/******************************************************************************
-+ *
-+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of version 2 of the GNU General Public License as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-+ *
-+ *
-+ ******************************************************************************/
-+#ifndef __CMD_OSDEP_H_
-+#define __CMD_OSDEP_H_
-+
-+
-+#include <drv_conf.h>
-+#include <osdep_service.h>
-+#include <drv_types.h>
-+
-+extern sint _rtw_init_cmd_priv (struct cmd_priv *pcmdpriv);
-+extern sint _rtw_init_evt_priv(struct evt_priv *pevtpriv);
-+extern void _rtw_free_evt_priv (struct evt_priv *pevtpriv);
-+extern void _rtw_free_cmd_priv (struct cmd_priv *pcmdpriv);
-+extern sint _rtw_enqueue_cmd(_queue *queue, struct cmd_obj *obj);
-+extern struct cmd_obj *_rtw_dequeue_cmd(_queue *queue);
-+
-+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/drv_conf.h linux-rpi/drivers/net/wireless/rtl8192cu/include/drv_conf.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/drv_conf.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/drv_conf.h 2015-08-26 10:26:08.757316386 +0200
-@@ -0,0 +1,77 @@
-+/******************************************************************************
-+ *
-+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of version 2 of the GNU General Public License as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-+ *
-+ *
-+ ******************************************************************************/
-+#ifndef __DRV_CONF_H__
-+#define __DRV_CONF_H__
-+#include "autoconf.h"
-+
-+#if defined (PLATFORM_LINUX) && defined (PLATFORM_WINDOWS)
-+
-+#error "Shall be Linux or Windows, but not both!\n"
-+
-+#endif
-+
-+//Older Android kernel doesn't has CONFIG_ANDROID defined,
-+//add this to force CONFIG_ANDROID defined
-+#ifdef CONFIG_PLATFORM_ANDROID
-+#define CONFIG_ANDROID
-+#endif
-+
-+#ifdef CONFIG_ANDROID
-+//Some Android build will restart the UI while non-printable ascii is passed
-+//between java and c/c++ layer (JNI). We force CONFIG_VALIDATE_SSID
-+//for Android here. If you are sure there is no risk on your system about this,
-+//mask this macro define to support non-printable ascii ssid.
-+//#define CONFIG_VALIDATE_SSID
-+
-+//Android expect dbm as the rx signal strength unit
-+#define CONFIG_SIGNAL_DISPLAY_DBM
-+#endif
-+
-+#if defined(CONFIG_HAS_EARLYSUSPEND) && defined (CONFIG_RESUME_IN_WORKQUEUE)
-+ #warning "You have CONFIG_HAS_EARLYSUSPEND enabled in your system, we disable CONFIG_RESUME_IN_WORKQUEUE automatically"
-+ #undef CONFIG_RESUME_IN_WORKQUEUE
-+#endif
-+
-+#if defined(CONFIG_ANDROID_POWER) && defined (CONFIG_RESUME_IN_WORKQUEUE)
-+ #warning "You have CONFIG_ANDROID_POWER enabled in your system, we disable CONFIG_RESUME_IN_WORKQUEUE automatically"
-+ #undef CONFIG_RESUME_IN_WORKQUEUE
-+#endif
-+
-+#ifdef CONFIG_RESUME_IN_WORKQUEUE //this can be removed, because there is no case for this...
-+ #if !defined( CONFIG_WAKELOCK) && !defined(CONFIG_ANDROID_POWER)
-+ #error "enable CONFIG_RESUME_IN_WORKQUEUE without CONFIG_WAKELOCK or CONFIG_ANDROID_POWER will suffer from the danger of wifi's unfunctionality..."
-+ #error "If you still want to enable CONFIG_RESUME_IN_WORKQUEUE in this case, mask this preprossor checking and GOOD LUCK..."
-+ #endif
-+#endif
-+
-+//About USB VENDOR REQ
-+#if defined(CONFIG_USB_VENDOR_REQ_BUFFER_PREALLOC) && !defined(CONFIG_USB_VENDOR_REQ_MUTEX)
-+ #warning "define CONFIG_USB_VENDOR_REQ_MUTEX for CONFIG_USB_VENDOR_REQ_BUFFER_PREALLOC automatically"
-+ #define CONFIG_USB_VENDOR_REQ_MUTEX
-+#endif
-+#if defined(CONFIG_VENDOR_REQ_RETRY) && !defined(CONFIG_USB_VENDOR_REQ_MUTEX)
-+ #warning "define CONFIG_USB_VENDOR_REQ_MUTEX for CONFIG_VENDOR_REQ_RETRY automatically"
-+ #define CONFIG_USB_VENDOR_REQ_MUTEX
-+#endif
-+
-+
-+//#include <rtl871x_byteorder.h>
-+
-+#endif // __DRV_CONF_H__
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/drv_types.h linux-rpi/drivers/net/wireless/rtl8192cu/include/drv_types.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/drv_types.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/drv_types.h 2015-08-26 10:26:08.757316386 +0200
-@@ -0,0 +1,661 @@
-+/******************************************************************************
-+ *
-+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of version 2 of the GNU General Public License as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-+ *
-+ *
-+ ******************************************************************************/
-+/*-------------------------------------------------------------------------------
-+
-+ For type defines and data structure defines
-+
-+--------------------------------------------------------------------------------*/
-+
-+
-+#ifndef __DRV_TYPES_H__
-+#define __DRV_TYPES_H__
-+
-+#include <drv_conf.h>
-+#include <osdep_service.h>
-+#include <wlan_bssdef.h>
-+
-+
-+#ifdef PLATFORM_OS_XP
-+#include <drv_types_xp.h>
-+#endif
-+
-+#ifdef PLATFORM_OS_CE
-+#include <drv_types_ce.h>
-+#endif
-+
-+#ifdef PLATFORM_LINUX
-+#include <drv_types_linux.h>
-+#endif
-+
-+enum _NIC_VERSION {
-+
-+ RTL8711_NIC,
-+ RTL8712_NIC,
-+ RTL8713_NIC,
-+ RTL8716_NIC
-+
-+};
-+
-+enum{
-+ UP_LINK,
-+ DOWN_LINK,
-+};
-+typedef struct _ADAPTER _adapter, ADAPTER,*PADAPTER;
-+
-+#ifdef CONFIG_80211N_HT
-+#include <rtw_ht.h>
-+#endif
-+
-+#include <rtw_cmd.h>
-+#include <wlan_bssdef.h>
-+#include <rtw_security.h>
-+#include <rtw_xmit.h>
-+#include <rtw_recv.h>
-+#include <hal_intf.h>
-+#include <hal_com.h>
-+#include <rtw_qos.h>
-+#include <rtw_pwrctrl.h>
-+#include <rtw_io.h>
-+#include <rtw_eeprom.h>
-+#include <sta_info.h>
-+#include <rtw_mlme.h>
-+#include <rtw_debug.h>
-+#include <rtw_rf.h>
-+#include <rtw_event.h>
-+#include <rtw_led.h>
-+#include <rtw_mlme_ext.h>
-+#include <rtw_p2p.h>
-+#include <rtw_tdls.h>
-+#include <rtw_ap.h>
-+
-+#ifdef CONFIG_DRVEXT_MODULE
-+#include <drvext_api.h>
-+#endif
-+
-+#ifdef CONFIG_MP_INCLUDED
-+#include <rtw_mp.h>
-+#endif
-+
-+#ifdef CONFIG_BR_EXT
-+#include <rtw_br_ext.h>
-+#endif // CONFIG_BR_EXT
-+
-+#ifdef CONFIG_IOCTL_CFG80211
-+ #include "ioctl_cfg80211.h"
-+#endif //CONFIG_IOCTL_CFG80211
-+
-+#define SPEC_DEV_ID_NONE BIT(0)
-+#define SPEC_DEV_ID_DISABLE_HT BIT(1)
-+#define SPEC_DEV_ID_ENABLE_PS BIT(2)
-+#define SPEC_DEV_ID_RF_CONFIG_1T1R BIT(3)
-+#define SPEC_DEV_ID_RF_CONFIG_2T2R BIT(4)
-+#define SPEC_DEV_ID_ASSIGN_IFNAME BIT(5)
-+
-+struct specific_device_id{
-+
-+ u32 flags;
-+
-+ u16 idVendor;
-+ u16 idProduct;
-+
-+};
-+
-+struct registry_priv
-+{
-+ u8 chip_version;
-+ u8 rfintfs;
-+ u8 lbkmode;
-+ u8 hci;
-+ NDIS_802_11_SSID ssid;
-+ u8 network_mode; //infra, ad-hoc, auto
-+ u8 channel;//ad-hoc support requirement
-+ u8 wireless_mode;//A, B, G, auto
-+ u8 scan_mode;//active, passive
-+ u8 radio_enable;
-+ u8 preamble;//long, short, auto
-+ u8 vrtl_carrier_sense;//Enable, Disable, Auto
-+ u8 vcs_type;//RTS/CTS, CTS-to-self
-+ u16 rts_thresh;
-+ u16 frag_thresh;
-+ u8 adhoc_tx_pwr;
-+ u8 soft_ap;
-+ u8 power_mgnt;
-+ u8 ips_mode;
-+ u8 smart_ps;
-+ u8 long_retry_lmt;
-+ u8 short_retry_lmt;
-+ u16 busy_thresh;
-+ u8 ack_policy;
-+ u8 mp_mode;
-+ u8 software_encrypt;
-+ u8 software_decrypt;
-+
-+ u8 acm_method;
-+ //UAPSD
-+ u8 wmm_enable;
-+ u8 uapsd_enable;
-+ u8 uapsd_max_sp;
-+ u8 uapsd_acbk_en;
-+ u8 uapsd_acbe_en;
-+ u8 uapsd_acvi_en;
-+ u8 uapsd_acvo_en;
-+
-+ WLAN_BSSID_EX dev_network;
-+
-+#ifdef CONFIG_80211N_HT
-+ u8 ht_enable;
-+ u8 cbw40_enable;
-+ u8 ampdu_enable;//for tx
-+ u8 rx_stbc;
-+ u8 ampdu_amsdu;//A-MPDU Supports A-MSDU is permitted
-+#endif
-+ u8 lowrate_two_xmit;
-+
-+ u8 rf_config ;
-+ u8 low_power ;
-+
-+ u8 wifi_spec;// !turbo_mode
-+
-+ u8 channel_plan;
-+#ifdef CONFIG_BT_COEXIST
-+ u8 bt_iso;
-+ u8 bt_sco;
-+ u8 bt_ampdu;
-+#endif
-+ BOOLEAN bAcceptAddbaReq;
-+
-+ u8 antdiv_cfg;
-+
-+ u8 usbss_enable;//0:disable,1:enable
-+ u8 hwpdn_mode;//0:disable,1:enable,2:decide by EFUSE config
-+ u8 hwpwrp_detect;//0:disable,1:enable
-+
-+ u8 hw_wps_pbc;//0:disable,1:enable
-+
-+#ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE
-+ char adaptor_info_caching_file_path[PATH_LENGTH_MAX];
-+#endif
-+
-+#ifdef CONFIG_LAYER2_ROAMING
-+ u8 max_roaming_times; // the max number driver will try to roaming
-+#endif
-+
-+#ifdef CONFIG_IOL
-+ bool force_iol; //enable iol without other concern
-+#endif
-+ u8 special_rf_path; //0: 2T2R ,1: only turn on path A 1T1R, 2: only turn on path B 1T1R
-+ u8 mac_phy_mode; //0:by efuse, 1:smsp, 2:dmdp, 3:dmsp.
-+
-+#ifdef CONFIG_80211D
-+ u8 enable80211d;
-+#endif
-+
-+ u8 ifname[16];
-+ u8 if2name[16];
-+
-+ u8 notch_filter;
-+
-+#ifdef CONFIG_MULTI_VIR_IFACES
-+ u8 ext_iface_num;//primary/secondary iface is excluded
-+#endif
-+};
-+
-+
-+//For registry parameters
-+#define RGTRY_OFT(field) ((ULONG)FIELD_OFFSET(struct registry_priv,field))
-+#define RGTRY_SZ(field) sizeof(((struct registry_priv*) 0)->field)
-+#define BSSID_OFT(field) ((ULONG)FIELD_OFFSET(WLAN_BSSID_EX,field))
-+#define BSSID_SZ(field) sizeof(((PWLAN_BSSID_EX) 0)->field)
-+
-+#define MAX_CONTINUAL_URB_ERR 4
-+
-+#ifdef CONFIG_SDIO_HCI
-+#include <drv_types_sdio.h>
-+#define INTF_DATA SDIO_DATA
-+#endif
-+
-+#define GET_PRIMARY_ADAPTER(padapter) (((_adapter *)padapter)->dvobj->if1)
-+
-+#define GET_IFACE_NUMS(padapter) (((_adapter *)padapter)->dvobj->iface_nums)
-+#define GET_ADAPTER(padapter, iface_id) (((_adapter *)padapter)->dvobj->padapters[iface_id])
-+
-+enum _IFACE_ID {
-+ IFACE_ID0, //maping to PRIMARY_ADAPTER
-+ IFACE_ID1, //maping to SECONDARY_ADAPTER
-+ IFACE_ID2,
-+ IFACE_ID3,
-+ IFACE_ID_MAX,
-+};
-+
-+struct dvobj_priv
-+{
-+ _adapter *if1; //PRIMARY_ADAPTER
-+ _adapter *if2; //SECONDARY_ADAPTER
-+
-+ s32 processing_dev_remove;
-+
-+ //for local/global synchronization
-+ _mutex hw_init_mutex;
-+ _mutex h2c_fwcmd_mutex;
-+ _mutex setch_mutex;
-+ _mutex setbw_mutex;
-+
-+ unsigned char oper_channel; //saved channel info when call set_channel_bw
-+ unsigned char oper_bwmode;
-+ unsigned char oper_ch_offset;//PRIME_CHNL_OFFSET
-+ u32 on_oper_ch_time;
-+
-+ //extend to support mulitu interface
-+ //padapters[IFACE_ID0] == if1
-+ //padapters[IFACE_ID1] == if2
-+ _adapter *padapters[IFACE_ID_MAX];
-+ u8 iface_nums; // total number of ifaces used runtime
-+
-+ //For 92D, DMDP have 2 interface.
-+ u8 InterfaceNumber;
-+ u8 NumInterfaces;
-+ u8 DualMacMode;
-+ u8 irq_alloc;
-+
-+/*-------- below is for SDIO INTERFACE --------*/
-+
-+#ifdef INTF_DATA
-+ INTF_DATA intf_data;
-+#endif
-+
-+/*-------- below is for USB INTERFACE --------*/
-+
-+#ifdef CONFIG_USB_HCI
-+
-+ u8 nr_endpoint;
-+ u8 ishighspeed;
-+ u8 RtNumInPipes;
-+ u8 RtNumOutPipes;
-+ int ep_num[5]; //endpoint number
-+
-+ int RegUsbSS;
-+
-+ _sema usb_suspend_sema;
-+
-+#ifdef CONFIG_USB_VENDOR_REQ_MUTEX
-+ _mutex usb_vendor_req_mutex;
-+#endif
-+
-+#ifdef CONFIG_USB_VENDOR_REQ_BUFFER_PREALLOC
-+ u8 * usb_alloc_vendor_req_buf;
-+ u8 * usb_vendor_req_buf;
-+#endif
-+
-+#ifdef PLATFORM_WINDOWS
-+ //related device objects
-+ PDEVICE_OBJECT pphysdevobj;//pPhysDevObj;
-+ PDEVICE_OBJECT pfuncdevobj;//pFuncDevObj;
-+ PDEVICE_OBJECT pnextdevobj;//pNextDevObj;
-+
-+ u8 nextdevstacksz;//unsigned char NextDeviceStackSize; //= (CHAR)CEdevice->pUsbDevObj->StackSize + 1;
-+
-+ //urb for control diescriptor request
-+
-+#ifdef PLATFORM_OS_XP
-+ struct _URB_CONTROL_DESCRIPTOR_REQUEST descriptor_urb;
-+ PUSB_CONFIGURATION_DESCRIPTOR pconfig_descriptor;//UsbConfigurationDescriptor;
-+#endif
-+
-+#ifdef PLATFORM_OS_CE
-+ WCHAR active_path[MAX_ACTIVE_REG_PATH]; // adapter regpath
-+ USB_EXTENSION usb_extension;
-+
-+ _nic_hdl pipehdls_r8192c[0x10];
-+#endif
-+
-+ u32 config_descriptor_len;//ULONG UsbConfigurationDescriptorLength;
-+#endif//PLATFORM_WINDOWS
-+
-+#ifdef PLATFORM_LINUX
-+ struct usb_interface *pusbintf;
-+ struct usb_device *pusbdev;
-+#endif//PLATFORM_LINUX
-+
-+#ifdef PLATFORM_FREEBSD
-+ struct usb_interface *pusbintf;
-+ struct usb_device *pusbdev;
-+#endif//PLATFORM_FREEBSD
-+ ATOMIC_T continual_urb_error;
-+#endif//CONFIG_USB_HCI
-+
-+/*-------- below is for PCIE INTERFACE --------*/
-+
-+#ifdef CONFIG_PCI_HCI
-+
-+#ifdef PLATFORM_LINUX
-+ struct pci_dev *ppcidev;
-+
-+ //PCI MEM map
-+ unsigned long pci_mem_end; /* shared mem end */
-+ unsigned long pci_mem_start; /* shared mem start */
-+
-+ //PCI IO map
-+ unsigned long pci_base_addr; /* device I/O address */
-+
-+ //PciBridge
-+ struct pci_priv pcipriv;
-+
-+ u16 irqline;
-+ u8 irq_enabled;
-+ RT_ISR_CONTENT isr_content;
-+ _lock irq_th_lock;
-+
-+ //ASPM
-+ u8 const_pci_aspm;
-+ u8 const_amdpci_aspm;
-+ u8 const_hwsw_rfoff_d3;
-+ u8 const_support_pciaspm;
-+ // pci-e bridge */
-+ u8 const_hostpci_aspm_setting;
-+ // pci-e device */
-+ u8 const_devicepci_aspm_setting;
-+ u8 b_support_aspm; // If it supports ASPM, Offset[560h] = 0x40, otherwise Offset[560h] = 0x00.
-+ u8 b_support_backdoor;
-+ u8 bdma64;
-+#endif//PLATFORM_LINUX
-+
-+#endif//CONFIG_PCI_HCI
-+};
-+
-+#ifdef PLATFORM_LINUX
-+static struct device *dvobj_to_dev(struct dvobj_priv *dvobj)
-+{
-+ /* todo: get interface type from dvobj and the return the dev accordingly */
-+#ifdef RTW_DVOBJ_CHIP_HW_TYPE
-+#endif
-+
-+#ifdef CONFIG_USB_HCI
-+ return &dvobj->pusbintf->dev;
-+#endif
-+#ifdef CONFIG_SDIO_HCI
-+ return &dvobj->intf_data.func->dev;
-+#endif
-+#ifdef CONFIG_PCI_HCI
-+ return &dvobj->ppcidev->dev;
-+#endif
-+}
-+#endif
-+
-+
-+enum _IFACE_TYPE {
-+ IFACE_PORT0, //mapping to port0 for C/D series chips
-+ IFACE_PORT1, //mapping to port1 for C/D series chip
-+ MAX_IFACE_PORT,
-+};
-+
-+enum _ADAPTER_TYPE {
-+ PRIMARY_ADAPTER,
-+ SECONDARY_ADAPTER,
-+ MAX_ADAPTER = 0xFF,
-+};
-+
-+typedef enum _DRIVER_STATE{
-+ DRIVER_NORMAL = 0,
-+ DRIVER_DISAPPEAR = 1,
-+ DRIVER_REPLACE_DONGLE = 2,
-+}DRIVER_STATE;
-+
-+#ifdef CONFIG_INTEL_PROXIM
-+struct proxim {
-+ bool proxim_support;
-+ bool proxim_on;
-+
-+ void *proximity_priv;
-+ int (*proxim_rx)(_adapter *padapter,
-+ union recv_frame *precv_frame);
-+ u8 (*proxim_get_var)(_adapter* padapter, u8 type);
-+};
-+#endif //CONFIG_INTEL_PROXIM
-+
-+#ifdef RTL8723A_SDIO_LOOPBACK
-+typedef struct loopbackdata
-+{
-+ _sema sema;
-+ _thread_hdl_ lbkthread;
-+ u8 bstop;
-+ u32 cnt;
-+ u16 size;
-+ u16 txsize;
-+ u8 txbuf[0x8000];
-+ u16 rxsize;
-+ u8 rxbuf[0x8000];
-+ u8 msg[100];
-+
-+}LOOPBACKDATA, *PLOOPBACKDATA;
-+#endif
-+
-+struct _ADAPTER{
-+ int DriverState;// for disable driver using module, use dongle to replace module.
-+ int pid[3];//process id from UI, 0:wps, 1:hostapd, 2:dhcpcd
-+ int bDongle;//build-in module or external dongle
-+ u16 chip_type;
-+ u16 HardwareType;
-+ u16 interface_type;//USB,SDIO,PCI
-+
-+ struct dvobj_priv *dvobj;
-+ struct mlme_priv mlmepriv;
-+ struct mlme_ext_priv mlmeextpriv;
-+ struct cmd_priv cmdpriv;
-+ struct evt_priv evtpriv;
-+ //struct io_queue *pio_queue;
-+ struct io_priv iopriv;
-+ struct xmit_priv xmitpriv;
-+ struct recv_priv recvpriv;
-+ struct sta_priv stapriv;
-+ struct security_priv securitypriv;
-+ _lock security_key_mutex; // add for CONFIG_IEEE80211W, none 11w also can use
-+ struct registry_priv registrypriv;
-+ struct pwrctrl_priv pwrctrlpriv;
-+ struct eeprom_priv eeprompriv;
-+ struct led_priv ledpriv;
-+
-+#ifdef CONFIG_MP_INCLUDED
-+ struct mp_priv mppriv;
-+#endif
-+
-+#ifdef CONFIG_DRVEXT_MODULE
-+ struct drvext_priv drvextpriv;
-+#endif
-+
-+#ifdef CONFIG_AP_MODE
-+ struct hostapd_priv *phostapdpriv;
-+#endif
-+
-+#ifdef CONFIG_IOCTL_CFG80211
-+#ifdef CONFIG_P2P
-+ struct cfg80211_wifidirect_info cfg80211_wdinfo;
-+#endif //CONFIG_P2P
-+#endif //CONFIG_IOCTL_CFG80211
-+ u32 setband;
-+#ifdef CONFIG_P2P
-+ struct wifidirect_info wdinfo;
-+#endif //CONFIG_P2P
-+
-+#ifdef CONFIG_TDLS
-+ struct tdls_info tdlsinfo;
-+#endif //CONFIG_TDLS
-+
-+#ifdef CONFIG_WFD
-+ struct wifi_display_info wfd_info;
-+#endif //CONFIG_WFD
-+
-+ PVOID HalData;
-+ u32 hal_data_sz;
-+ struct hal_ops HalFunc;
-+
-+#ifdef CONFIG_BT_COEXIST
-+ //struct btcoexist_priv bt_coexist;
-+#endif
-+ s32 bDriverStopped;
-+ s32 bSurpriseRemoved;
-+ s32 bCardDisableWOHSM;
-+
-+ u32 IsrContent;
-+ u32 ImrContent;
-+
-+ u8 EepromAddressSize;
-+ u8 hw_init_completed;
-+ u8 bDriverIsGoingToUnload;
-+ u8 init_adpt_in_progress;
-+ u8 bHaltInProgress;
-+
-+ _thread_hdl_ cmdThread;
-+ _thread_hdl_ evtThread;
-+ _thread_hdl_ xmitThread;
-+ _thread_hdl_ recvThread;
-+
-+#ifndef PLATFORM_LINUX
-+ NDIS_STATUS (*dvobj_init)(struct dvobj_priv *dvobj);
-+ void (*dvobj_deinit)(struct dvobj_priv *dvobj);
-+#endif
-+
-+ void (*intf_start)(_adapter * adapter);
-+ void (*intf_stop)(_adapter * adapter);
-+
-+#ifdef PLATFORM_WINDOWS
-+ _nic_hdl hndis_adapter;//hNdisAdapter(NDISMiniportAdapterHandle);
-+ _nic_hdl hndis_config;//hNdisConfiguration;
-+ NDIS_STRING fw_img;
-+
-+ u32 NdisPacketFilter;
-+ u8 MCList[MAX_MCAST_LIST_NUM][6];
-+ u32 MCAddrCount;
-+#endif //end of PLATFORM_WINDOWS
-+
-+
-+#ifdef PLATFORM_LINUX
-+ _nic_hdl pnetdev;
-+
-+ // used by rtw_rereg_nd_name related function
-+ struct rereg_nd_name_data {
-+ _nic_hdl old_pnetdev;
-+ char old_ifname[IFNAMSIZ];
-+ u8 old_ips_mode;
-+ u8 old_bRegUseLed;
-+ } rereg_nd_name_priv;
-+
-+ int bup;
-+ struct net_device_stats stats;
-+ struct iw_statistics iwstats;
-+ struct proc_dir_entry *dir_dev;// for proc directory
-+
-+#ifdef CONFIG_IOCTL_CFG80211
-+ struct wireless_dev *rtw_wdev;
-+#endif //CONFIG_IOCTL_CFG80211
-+
-+#endif //end of PLATFORM_LINUX
-+
-+#ifdef PLATFORM_FREEBSD
-+ _nic_hdl pifp;
-+ int bup;
-+ _lock glock;
-+#endif //PLATFORM_FREEBSD
-+ int net_closed;
-+
-+ u8 bFWReady;
-+ u8 bReadPortCancel;
-+ u8 bWritePortCancel;
-+ u8 bRxRSSIDisplay;
-+ // Added by Albert 2012/07/26
-+ // The driver will write the initial gain everytime when running in the DM_Write_DIG function.
-+ u8 bForceWriteInitGain;
-+ // Added by Albert 2012/10/26
-+ // The driver will show up the desired channel number when this flag is 1.
-+ u8 bNotifyChannelChange;
-+#ifdef CONFIG_P2P
-+ // Added by Albert 2012/12/06
-+ // The driver will show the current P2P status when the upper application reads it.
-+ u8 bShowGetP2PState;
-+#endif
-+#ifdef CONFIG_AUTOSUSPEND
-+ u8 bDisableAutosuspend;
-+#endif
-+
-+ //pbuddy_adapter is used only in two inteface case, (iface_nums=2 in struct dvobj_priv)
-+ //PRIMARY_ADAPTER's buddy is SECONDARY_ADAPTER
-+ //SECONDARY_ADAPTER's buddy is PRIMARY_ADAPTER
-+ //for iface_id > SECONDARY_ADAPTER(IFACE_ID1), refer to padapters[iface_id] in struct dvobj_priv
-+ //and their pbuddy_adapter is PRIMARY_ADAPTER.
-+ //for PRIMARY_ADAPTER(IFACE_ID0) can directly refer to if1 in struct dvobj_priv
-+ _adapter *pbuddy_adapter;
-+
-+#if defined(CONFIG_CONCURRENT_MODE) || defined(CONFIG_DUALMAC_CONCURRENT)
-+ u8 isprimary; //is primary adapter or not
-+ //notes:
-+ // if isprimary is true, the adapter_type value is 0, iface_id is IFACE_ID0 for PRIMARY_ADAPTER
-+ // if isprimary is false, the adapter_type value is 1, iface_id is IFACE_ID1 for SECONDARY_ADAPTER
-+ // refer to iface_id if iface_nums>2 and isprimary is false and the adapter_type value is 0xff.
-+ u8 adapter_type;//used only in two inteface case(PRIMARY_ADAPTER and SECONDARY_ADAPTER) .
-+ u8 iface_type; //interface port type, it depends on HW port
-+#endif
-+
-+ //extend to support multi interface
-+ //IFACE_ID0 is equals to PRIMARY_ADAPTER
-+ //IFACE_ID1 is equals to SECONDARY_ADAPTER
-+ u8 iface_id;
-+
-+#ifdef CONFIG_DUALMAC_CONCURRENT
-+ u8 DualMacConcurrent; // 1: DMSP 0:DMDP
-+#endif
-+
-+#ifdef CONFIG_BR_EXT
-+ _lock br_ext_lock;
-+ //unsigned int macclone_completed;
-+ struct nat25_network_db_entry *nethash[NAT25_HASH_SIZE];
-+ int pppoe_connection_in_progress;
-+ unsigned char pppoe_addr[MACADDRLEN];
-+ unsigned char scdb_mac[MACADDRLEN];
-+ unsigned char scdb_ip[4];
-+ struct nat25_network_db_entry *scdb_entry;
-+ unsigned char br_mac[MACADDRLEN];
-+ unsigned char br_ip[4];
-+
-+ struct br_ext_info ethBrExtInfo;
-+#endif // CONFIG_BR_EXT
-+
-+#ifdef CONFIG_INTEL_PROXIM
-+ /* intel Proximity, should be alloc mem
-+ * in intel Proximity module and can only
-+ * be used in intel Proximity mode */
-+ struct proxim proximity;
-+#endif //CONFIG_INTEL_PROXIM
-+
-+#ifdef RTL8723A_SDIO_LOOPBACK
-+ PLOOPBACKDATA ploopback;
-+#endif
-+
-+};
-+
-+#define adapter_to_dvobj(adapter) (adapter->dvobj)
-+
-+int rtw_handle_dualmac(_adapter *adapter, bool init);
-+
-+__inline static u8 *myid(struct eeprom_priv *peepriv)
-+{
-+ return (peepriv->mac_addr);
-+}
-+
-+
-+#endif //__DRV_TYPES_H__
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/drv_types_ce.h linux-rpi/drivers/net/wireless/rtl8192cu/include/drv_types_ce.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/drv_types_ce.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/drv_types_ce.h 2015-08-26 10:26:08.757316386 +0200
-@@ -0,0 +1,92 @@
-+/******************************************************************************
-+ *
-+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of version 2 of the GNU General Public License as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-+ *
-+ *
-+ ******************************************************************************/
-+#ifndef __DRV_TYPES_CE_H__
-+#define __DRV_TYPES_CE_H__
-+
-+#include <drv_conf.h>
-+#include <osdep_service.h>
-+
-+#include <Sdcardddk.h>
-+
-+#define MAX_ACTIVE_REG_PATH 256
-+
-+#define MAX_MCAST_LIST_NUM 32
-+
-+
-+
-+//for ioctl
-+#define MAKE_DRIVER_VERSION(_MainVer,_MinorVer) ((((u32)(_MainVer))<<16)+_MinorVer)
-+
-+#define NIC_HEADER_SIZE 14 //!< can be moved to typedef.h
-+#define NIC_MAX_PACKET_SIZE 1514 //!< can be moved to typedef.h
-+#define NIC_MAX_SEND_PACKETS 10 // max number of send packets the MiniportSendPackets function can accept, can be moved to typedef.h
-+#define NIC_VENDOR_DRIVER_VERSION MAKE_DRIVER_VERSION(0,001) //!< can be moved to typedef.h
-+#define NIC_MAX_PACKET_SIZE 1514 //!< can be moved to typedef.h
-+
-+typedef struct _MP_REG_ENTRY
-+{
-+
-+ NDIS_STRING RegName; // variable name text
-+ BOOLEAN bRequired; // 1 -> required, 0 -> optional
-+
-+ u8 Type; // NdisParameterInteger/NdisParameterHexInteger/NdisParameterStringle/NdisParameterMultiString
-+ uint FieldOffset; // offset to MP_ADAPTER field
-+ uint FieldSize; // size (in bytes) of the field
-+
-+#ifdef UNDER_AMD64
-+ u64 Default;
-+#else
-+ u32 Default; // default value to use
-+#endif
-+
-+ u32 Min; // minimum value allowed
-+ u32 Max; // maximum value allowed
-+} MP_REG_ENTRY, *PMP_REG_ENTRY;
-+
-+#ifdef CONFIG_USB_HCI
-+typedef struct _USB_EXTENSION {
-+ LPCUSB_FUNCS _lpUsbFuncs;
-+ USB_HANDLE _hDevice;
-+ PVOID pAdapter;
-+
-+#if 0
-+ USB_ENDPOINT_DESCRIPTOR _endpACLIn;
-+ USB_ENDPOINT_DESCRIPTOR _endpACLOutHigh;
-+ USB_ENDPOINT_DESCRIPTOR _endpACLOutNormal;
-+
-+ USB_PIPE pPipeIn;
-+ USB_PIPE pPipeOutNormal;
-+ USB_PIPE pPipeOutHigh;
-+#endif
-+
-+} USB_EXTENSION, *PUSB_EXTENSION;
-+#endif
-+
-+
-+typedef struct _OCTET_STRING{
-+ u8 *Octet;
-+ u16 Length;
-+} OCTET_STRING, *POCTET_STRING;
-+
-+
-+
-+
-+
-+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/drv_types_linux.h linux-rpi/drivers/net/wireless/rtl8192cu/include/drv_types_linux.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/drv_types_linux.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/drv_types_linux.h 2015-08-26 10:26:08.757316386 +0200
-@@ -0,0 +1,24 @@
-+/******************************************************************************
-+ *
-+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of version 2 of the GNU General Public License as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-+ *
-+ *
-+ ******************************************************************************/
-+#ifndef __DRV_TYPES_LINUX_H__
-+#define __DRV_TYPES_LINUX_H__
-+
-+
-+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/drv_types_sdio.h linux-rpi/drivers/net/wireless/rtl8192cu/include/drv_types_sdio.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/drv_types_sdio.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/drv_types_sdio.h 2015-08-26 10:26:08.757316386 +0200
-@@ -0,0 +1,69 @@
-+/******************************************************************************
-+ *
-+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of version 2 of the GNU General Public License as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-+ *
-+ *
-+ ******************************************************************************/
-+#ifndef __DRV_TYPES_SDIO_H__
-+#define __DRV_TYPES_SDIO_H__
-+
-+#include <drv_conf.h>
-+#include <basic_types.h>
-+
-+// SDIO Header Files
-+#ifdef PLATFORM_LINUX
-+#include <linux/mmc/sdio_func.h>
-+#endif
-+#ifdef PLATFORM_OS_XP
-+#include <wdm.h>
-+#include <ntddsd.h>
-+#endif
-+#ifdef PLATFORM_OS_CE
-+#include <sdcardddk.h>
-+#endif
-+
-+
-+typedef struct sdio_data
-+{
-+ u8 func_number;
-+
-+ u8 tx_block_mode;
-+ u8 rx_block_mode;
-+ u32 block_transfer_len;
-+
-+#ifdef PLATFORM_LINUX
-+ struct sdio_func *func;
-+#endif
-+
-+#ifdef PLATFORM_OS_XP
-+ PDEVICE_OBJECT pphysdevobj;
-+ PDEVICE_OBJECT pfuncdevobj;
-+ PDEVICE_OBJECT pnextdevobj;
-+ SDBUS_INTERFACE_STANDARD sdbusinft;
-+ u8 nextdevstacksz;
-+#endif
-+
-+#ifdef PLATFORM_OS_CE
-+ SD_DEVICE_HANDLE hDevice;
-+ SD_CARD_RCA sd_rca;
-+ SD_CARD_INTERFACE card_intf;
-+ BOOLEAN enableIsarWithStatus;
-+ WCHAR active_path[MAX_ACTIVE_REG_PATH];
-+ SD_HOST_BLOCK_CAPABILITY sd_host_blk_cap;
-+#endif
-+} SDIO_DATA, *PSDIO_DATA;
-+
-+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/drv_types_xp.h linux-rpi/drivers/net/wireless/rtl8192cu/include/drv_types_xp.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/drv_types_xp.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/drv_types_xp.h 2015-08-26 10:26:08.757316386 +0200
-@@ -0,0 +1,94 @@
-+/******************************************************************************
-+ *
-+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of version 2 of the GNU General Public License as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-+ *
-+ *
-+ ******************************************************************************/
-+#ifndef __DRV_TYPES_XP_H__
-+#define __DRV_TYPES_XP_H__
-+
-+#include <drv_conf.h>
-+#include <osdep_service.h>
-+
-+
-+
-+#define MAX_MCAST_LIST_NUM 32
-+
-+
-+
-+//for ioctl
-+#define MAKE_DRIVER_VERSION(_MainVer,_MinorVer) ((((u32)(_MainVer))<<16)+_MinorVer)
-+
-+#define NIC_HEADER_SIZE 14 //!< can be moved to typedef.h
-+#define NIC_MAX_PACKET_SIZE 1514 //!< can be moved to typedef.h
-+#define NIC_MAX_SEND_PACKETS 10 // max number of send packets the MiniportSendPackets function can accept, can be moved to typedef.h
-+#define NIC_VENDOR_DRIVER_VERSION MAKE_DRIVER_VERSION(0,001) //!< can be moved to typedef.h
-+#define NIC_MAX_PACKET_SIZE 1514 //!< can be moved to typedef.h
-+
-+
-+#undef ON_VISTA
-+//added by Jackson
-+#ifndef ON_VISTA
-+//
-+// Bus driver versions
-+//
-+
-+#define SDBUS_DRIVER_VERSION_1 0x100
-+#define SDBUS_DRIVER_VERSION_2 0x200
-+
-+#define SDP_FUNCTION_TYPE 4
-+#define SDP_BUS_DRIVER_VERSION 5
-+#define SDP_BUS_WIDTH 6
-+#define SDP_BUS_CLOCK 7
-+#define SDP_BUS_INTERFACE_CONTROL 8
-+#define SDP_HOST_BLOCK_LENGTH 9
-+#define SDP_FUNCTION_BLOCK_LENGTH 10
-+#define SDP_FN0_BLOCK_LENGTH 11
-+#define SDP_FUNCTION_INT_ENABLE 12
-+#endif
-+
-+
-+typedef struct _MP_REG_ENTRY
-+{
-+
-+ NDIS_STRING RegName; // variable name text
-+ BOOLEAN bRequired; // 1 -> required, 0 -> optional
-+
-+ u8 Type; // NdisParameterInteger/NdisParameterHexInteger/NdisParameterStringle/NdisParameterMultiString
-+ uint FieldOffset; // offset to MP_ADAPTER field
-+ uint FieldSize; // size (in bytes) of the field
-+
-+#ifdef UNDER_AMD64
-+ u64 Default;
-+#else
-+ u32 Default; // default value to use
-+#endif
-+
-+ u32 Min; // minimum value allowed
-+ u32 Max; // maximum value allowed
-+} MP_REG_ENTRY, *PMP_REG_ENTRY;
-+
-+
-+typedef struct _OCTET_STRING{
-+ u8 *Octet;
-+ u16 Length;
-+} OCTET_STRING, *POCTET_STRING;
-+
-+
-+
-+
-+
-+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/ethernet.h linux-rpi/drivers/net/wireless/rtl8192cu/include/ethernet.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/ethernet.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/ethernet.h 2015-08-26 10:26:08.761316441 +0200
-@@ -0,0 +1,41 @@
-+/******************************************************************************
-+ *
-+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of version 2 of the GNU General Public License as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-+ *
-+ *
-+ ******************************************************************************/
-+/*! \file */
-+#ifndef __INC_ETHERNET_H
-+#define __INC_ETHERNET_H
-+
-+#define ETHERNET_ADDRESS_LENGTH 6 //!< Ethernet Address Length
-+#define ETHERNET_HEADER_SIZE 14 //!< Ethernet Header Length
-+#define LLC_HEADER_SIZE 6 //!< LLC Header Length
-+#define TYPE_LENGTH_FIELD_SIZE 2 //!< Type/Length Size
-+#define MINIMUM_ETHERNET_PACKET_SIZE 60 //!< Minimum Ethernet Packet Size
-+#define MAXIMUM_ETHERNET_PACKET_SIZE 1514 //!< Maximum Ethernet Packet Size
-+
-+#define RT_ETH_IS_MULTICAST(_pAddr) ((((UCHAR *)(_pAddr))[0]&0x01)!=0) //!< Is Multicast Address?
-+#define RT_ETH_IS_BROADCAST(_pAddr) ( \
-+ ((UCHAR *)(_pAddr))[0]==0xff && \
-+ ((UCHAR *)(_pAddr))[1]==0xff && \
-+ ((UCHAR *)(_pAddr))[2]==0xff && \
-+ ((UCHAR *)(_pAddr))[3]==0xff && \
-+ ((UCHAR *)(_pAddr))[4]==0xff && \
-+ ((UCHAR *)(_pAddr))[5]==0xff ) //!< Is Broadcast Address?
-+
-+
-+#endif // #ifndef __INC_ETHERNET_H
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/h2clbk.h linux-rpi/drivers/net/wireless/rtl8192cu/include/h2clbk.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/h2clbk.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/h2clbk.h 2015-08-26 10:26:08.761316441 +0200
-@@ -0,0 +1,35 @@
-+/******************************************************************************
-+ *
-+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of version 2 of the GNU General Public License as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-+ *
-+ *
-+ ******************************************************************************/
-+
-+
-+#define _H2CLBK_H_
-+
-+
-+#include <rtl8711_spec.h>
-+#include <TypeDef.h>
-+
-+
-+void _lbk_cmd(PADAPTER Adapter);
-+
-+void _lbk_rsp(PADAPTER Adapter);
-+
-+void _lbk_evt(IN PADAPTER Adapter);
-+
-+void h2c_event_callback(unsigned char *dev, unsigned char *pbuf);
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/hal_com.h linux-rpi/drivers/net/wireless/rtl8192cu/include/hal_com.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/hal_com.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/hal_com.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/hal_com.h linux-rpi/drivers/net/wireless/rtl8192cu/include/hal_com.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/hal_com.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/hal_com.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,145 @@
+/******************************************************************************
+ *
@@ -174809,9 +176502,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/hal_com.h linux-rpi
+s32 c2h_evt_read(_adapter *adapter, u8 *buf);
+
+#endif //__HAL_COMMON_H__
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/hal_intf.h linux-rpi/drivers/net/wireless/rtl8192cu/include/hal_intf.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/hal_intf.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/hal_intf.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/hal_intf.h linux-rpi/drivers/net/wireless/rtl8192cu/include/hal_intf.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/hal_intf.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/hal_intf.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,431 @@
+/******************************************************************************
+ *
@@ -175244,9 +176937,630 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/hal_intf.h linux-rp
+c2h_id_filter rtw_hal_c2h_id_filter_ccx(_adapter *adapter);
+
+#endif //__HAL_INTF_H__
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/ieee80211.h linux-rpi/drivers/net/wireless/rtl8192cu/include/ieee80211.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/ieee80211.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/ieee80211.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/HalPwrSeqCmd.h linux-rpi/drivers/net/wireless/rtl8192cu/include/HalPwrSeqCmd.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/HalPwrSeqCmd.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/HalPwrSeqCmd.h 2015-10-07 16:40:51.000000000 +0200
+@@ -0,0 +1,137 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ *
++ ******************************************************************************/
++#ifndef __HALPWRSEQCMD_H__
++#define __HALPWRSEQCMD_H__
++
++#include <drv_types.h>
++
++/*---------------------------------------------*/
++//3 The value of cmd: 4 bits
++/*---------------------------------------------*/
++#define PWR_CMD_READ 0x00
++ // offset: the read register offset
++ // msk: the mask of the read value
++ // value: N/A, left by 0
++ // note: dirver shall implement this function by read & msk
++
++#define PWR_CMD_WRITE 0x01
++ // offset: the read register offset
++ // msk: the mask of the write bits
++ // value: write value
++ // note: driver shall implement this cmd by read & msk after write
++
++#define PWR_CMD_POLLING 0x02
++ // offset: the read register offset
++ // msk: the mask of the polled value
++ // value: the value to be polled, masked by the msd field.
++ // note: driver shall implement this cmd by
++ // do{
++ // if( (Read(offset) & msk) == (value & msk) )
++ // break;
++ // } while(not timeout);
++
++#define PWR_CMD_DELAY 0x03
++ // offset: the value to delay
++ // msk: N/A
++ // value: the unit of delay, 0: us, 1: ms
++
++#define PWR_CMD_END 0x04
++ // offset: N/A
++ // msk: N/A
++ // value: N/A
++
++/*---------------------------------------------*/
++//3 The value of base: 4 bits
++/*---------------------------------------------*/
++ // define the base address of each block
++#define PWR_BASEADDR_MAC 0x00
++#define PWR_BASEADDR_USB 0x01
++#define PWR_BASEADDR_PCIE 0x02
++#define PWR_BASEADDR_SDIO 0x03
++
++/*---------------------------------------------*/
++//3 The value of interface_msk: 4 bits
++/*---------------------------------------------*/
++#define PWR_INTF_SDIO_MSK BIT(0)
++#define PWR_INTF_USB_MSK BIT(1)
++#define PWR_INTF_PCI_MSK BIT(2)
++#define PWR_INTF_ALL_MSK (BIT(0)|BIT(1)|BIT(2)|BIT(3))
++
++/*---------------------------------------------*/
++//3 The value of fab_msk: 4 bits
++/*---------------------------------------------*/
++#define PWR_FAB_TSMC_MSK BIT(0)
++#define PWR_FAB_UMC_MSK BIT(1)
++#define PWR_FAB_ALL_MSK (BIT(0)|BIT(1)|BIT(2)|BIT(3))
++
++/*---------------------------------------------*/
++//3 The value of cut_msk: 8 bits
++/*---------------------------------------------*/
++#define PWR_CUT_TESTCHIP_MSK BIT(0)
++#define PWR_CUT_A_MSK BIT(1)
++#define PWR_CUT_B_MSK BIT(2)
++#define PWR_CUT_C_MSK BIT(3)
++#define PWR_CUT_D_MSK BIT(4)
++#define PWR_CUT_E_MSK BIT(5)
++#define PWR_CUT_F_MSK BIT(6)
++#define PWR_CUT_G_MSK BIT(7)
++#define PWR_CUT_ALL_MSK 0xFF
++
++
++typedef enum _PWRSEQ_CMD_DELAY_UNIT_
++{
++ PWRSEQ_DELAY_US,
++ PWRSEQ_DELAY_MS,
++} PWRSEQ_DELAY_UNIT;
++
++typedef struct _WL_PWR_CFG_
++{
++ u16 offset;
++ u8 cut_msk;
++ u8 fab_msk:4;
++ u8 interface_msk:4;
++ u8 base:4;
++ u8 cmd:4;
++ u8 msk;
++ u8 value;
++} WLAN_PWR_CFG, *PWLAN_PWR_CFG;
++
++
++#define GET_PWR_CFG_OFFSET(__PWR_CMD) __PWR_CMD.offset
++#define GET_PWR_CFG_CUT_MASK(__PWR_CMD) __PWR_CMD.cut_msk
++#define GET_PWR_CFG_FAB_MASK(__PWR_CMD) __PWR_CMD.fab_msk
++#define GET_PWR_CFG_INTF_MASK(__PWR_CMD) __PWR_CMD.interface_msk
++#define GET_PWR_CFG_BASE(__PWR_CMD) __PWR_CMD.base
++#define GET_PWR_CFG_CMD(__PWR_CMD) __PWR_CMD.cmd
++#define GET_PWR_CFG_MASK(__PWR_CMD) __PWR_CMD.msk
++#define GET_PWR_CFG_VALUE(__PWR_CMD) __PWR_CMD.value
++
++
++//================================================================================
++// Prototype of protected function.
++//================================================================================
++u8 HalPwrSeqCmdParsing(
++ PADAPTER padapter,
++ u8 CutVersion,
++ u8 FabVersion,
++ u8 InterfaceType,
++ WLAN_PWR_CFG PwrCfgCmd[]);
++
++#endif
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/ieee80211_ext.h linux-rpi/drivers/net/wireless/rtl8192cu/include/ieee80211_ext.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/ieee80211_ext.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/ieee80211_ext.h 2015-10-07 16:40:51.000000000 +0200
+@@ -0,0 +1,476 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ *
++ ******************************************************************************/
++#ifndef __IEEE80211_EXT_H
++#define __IEEE80211_EXT_H
++
++#include <drv_conf.h>
++#include <osdep_service.h>
++#include <drv_types.h>
++
++#define WMM_OUI_TYPE 2
++#define WMM_OUI_SUBTYPE_INFORMATION_ELEMENT 0
++#define WMM_OUI_SUBTYPE_PARAMETER_ELEMENT 1
++#define WMM_OUI_SUBTYPE_TSPEC_ELEMENT 2
++#define WMM_VERSION 1
++
++#define WPA_PROTO_WPA BIT(0)
++#define WPA_PROTO_RSN BIT(1)
++
++#define WPA_KEY_MGMT_IEEE8021X BIT(0)
++#define WPA_KEY_MGMT_PSK BIT(1)
++#define WPA_KEY_MGMT_NONE BIT(2)
++#define WPA_KEY_MGMT_IEEE8021X_NO_WPA BIT(3)
++#define WPA_KEY_MGMT_WPA_NONE BIT(4)
++
++
++#define WPA_CAPABILITY_PREAUTH BIT(0)
++#define WPA_CAPABILITY_MGMT_FRAME_PROTECTION BIT(6)
++#define WPA_CAPABILITY_PEERKEY_ENABLED BIT(9)
++
++
++#define PMKID_LEN 16
++
++
++#ifdef PLATFORM_LINUX
++struct wpa_ie_hdr {
++ u8 elem_id;
++ u8 len;
++ u8 oui[4]; /* 24-bit OUI followed by 8-bit OUI type */
++ u8 version[2]; /* little endian */
++}__attribute__ ((packed));
++
++struct rsn_ie_hdr {
++ u8 elem_id; /* WLAN_EID_RSN */
++ u8 len;
++ u8 version[2]; /* little endian */
++}__attribute__ ((packed));
++
++struct wme_ac_parameter {
++#if defined(CONFIG_LITTLE_ENDIAN)
++ /* byte 1 */
++ u8 aifsn:4,
++ acm:1,
++ aci:2,
++ reserved:1;
++
++ /* byte 2 */
++ u8 eCWmin:4,
++ eCWmax:4;
++#elif defined(CONFIG_BIG_ENDIAN)
++ /* byte 1 */
++ u8 reserved:1,
++ aci:2,
++ acm:1,
++ aifsn:4;
++
++ /* byte 2 */
++ u8 eCWmax:4,
++ eCWmin:4;
++#else
++#error "Please fix <endian.h>"
++#endif
++
++ /* bytes 3 & 4 */
++ u16 txopLimit;
++} __attribute__ ((packed));
++
++struct wme_parameter_element {
++ /* required fields for WME version 1 */
++ u8 oui[3];
++ u8 oui_type;
++ u8 oui_subtype;
++ u8 version;
++ u8 acInfo;
++ u8 reserved;
++ struct wme_ac_parameter ac[4];
++
++} __attribute__ ((packed));
++
++#endif
++
++#ifdef PLATFORM_WINDOWS
++
++#pragma pack(1)
++
++struct wpa_ie_hdr {
++ u8 elem_id;
++ u8 len;
++ u8 oui[4]; /* 24-bit OUI followed by 8-bit OUI type */
++ u8 version[2]; /* little endian */
++};
++
++struct rsn_ie_hdr {
++ u8 elem_id; /* WLAN_EID_RSN */
++ u8 len;
++ u8 version[2]; /* little endian */
++};
++
++#pragma pack()
++
++#endif
++
++#define WPA_PUT_LE16(a, val) \
++ do { \
++ (a)[1] = ((u16) (val)) >> 8; \
++ (a)[0] = ((u16) (val)) & 0xff; \
++ } while (0)
++
++#define WPA_PUT_BE32(a, val) \
++ do { \
++ (a)[0] = (u8) ((((u32) (val)) >> 24) & 0xff); \
++ (a)[1] = (u8) ((((u32) (val)) >> 16) & 0xff); \
++ (a)[2] = (u8) ((((u32) (val)) >> 8) & 0xff); \
++ (a)[3] = (u8) (((u32) (val)) & 0xff); \
++ } while (0)
++
++#define WPA_PUT_LE32(a, val) \
++ do { \
++ (a)[3] = (u8) ((((u32) (val)) >> 24) & 0xff); \
++ (a)[2] = (u8) ((((u32) (val)) >> 16) & 0xff); \
++ (a)[1] = (u8) ((((u32) (val)) >> 8) & 0xff); \
++ (a)[0] = (u8) (((u32) (val)) & 0xff); \
++ } while (0)
++
++#define RSN_SELECTOR_PUT(a, val) WPA_PUT_BE32((u8 *) (a), (val))
++//#define RSN_SELECTOR_PUT(a, val) WPA_PUT_LE32((u8 *) (a), (val))
++
++
++
++/* Action category code */
++enum ieee80211_category {
++ WLAN_CATEGORY_SPECTRUM_MGMT = 0,
++ WLAN_CATEGORY_QOS = 1,
++ WLAN_CATEGORY_DLS = 2,
++ WLAN_CATEGORY_BACK = 3,
++ WLAN_CATEGORY_HT = 7,
++ WLAN_CATEGORY_WMM = 17,
++};
++
++/* SPECTRUM_MGMT action code */
++enum ieee80211_spectrum_mgmt_actioncode {
++ WLAN_ACTION_SPCT_MSR_REQ = 0,
++ WLAN_ACTION_SPCT_MSR_RPRT = 1,
++ WLAN_ACTION_SPCT_TPC_REQ = 2,
++ WLAN_ACTION_SPCT_TPC_RPRT = 3,
++ WLAN_ACTION_SPCT_CHL_SWITCH = 4,
++ WLAN_ACTION_SPCT_EXT_CHL_SWITCH = 5,
++};
++
++/* BACK action code */
++enum ieee80211_back_actioncode {
++ WLAN_ACTION_ADDBA_REQ = 0,
++ WLAN_ACTION_ADDBA_RESP = 1,
++ WLAN_ACTION_DELBA = 2,
++};
++
++/* HT features action code */
++enum ieee80211_ht_actioncode {
++ WLAN_ACTION_NOTIFY_CH_WIDTH = 0,
++ WLAN_ACTION_SM_PS = 1,
++ WLAN_ACTION_PSPM = 2,
++ WLAN_ACTION_PCO_PHASE = 3,
++ WLAN_ACTION_MIMO_CSI_MX = 4,
++ WLAN_ACTION_MIMO_NONCP_BF = 5,
++ WLAN_ACTION_MIMP_CP_BF = 6,
++ WLAN_ACTION_ASEL_INDICATES_FB = 7,
++ WLAN_ACTION_HI_INFO_EXCHG = 8,
++};
++
++/* BACK (block-ack) parties */
++enum ieee80211_back_parties {
++ WLAN_BACK_RECIPIENT = 0,
++ WLAN_BACK_INITIATOR = 1,
++ WLAN_BACK_TIMER = 2,
++};
++
++#ifdef PLATFORM_LINUX
++
++struct ieee80211_mgmt {
++ u16 frame_control;
++ u16 duration;
++ u8 da[6];
++ u8 sa[6];
++ u8 bssid[6];
++ u16 seq_ctrl;
++ union {
++ struct {
++ u16 auth_alg;
++ u16 auth_transaction;
++ u16 status_code;
++ /* possibly followed by Challenge text */
++ u8 variable[0];
++ } __attribute__ ((packed)) auth;
++ struct {
++ u16 reason_code;
++ } __attribute__ ((packed)) deauth;
++ struct {
++ u16 capab_info;
++ u16 listen_interval;
++ /* followed by SSID and Supported rates */
++ u8 variable[0];
++ } __attribute__ ((packed)) assoc_req;
++ struct {
++ u16 capab_info;
++ u16 status_code;
++ u16 aid;
++ /* followed by Supported rates */
++ u8 variable[0];
++ } __attribute__ ((packed)) assoc_resp, reassoc_resp;
++ struct {
++ u16 capab_info;
++ u16 listen_interval;
++ u8 current_ap[6];
++ /* followed by SSID and Supported rates */
++ u8 variable[0];
++ } __attribute__ ((packed)) reassoc_req;
++ struct {
++ u16 reason_code;
++ } __attribute__ ((packed)) disassoc;
++ struct {
++ __le64 timestamp;
++ u16 beacon_int;
++ u16 capab_info;
++ /* followed by some of SSID, Supported rates,
++ * FH Params, DS Params, CF Params, IBSS Params, TIM */
++ u8 variable[0];
++ } __attribute__ ((packed)) beacon;
++ struct {
++ /* only variable items: SSID, Supported rates */
++ u8 variable[0];
++ } __attribute__ ((packed)) probe_req;
++ struct {
++ __le64 timestamp;
++ u16 beacon_int;
++ u16 capab_info;
++ /* followed by some of SSID, Supported rates,
++ * FH Params, DS Params, CF Params, IBSS Params */
++ u8 variable[0];
++ } __attribute__ ((packed)) probe_resp;
++ struct {
++ u8 category;
++ union {
++ struct {
++ u8 action_code;
++ u8 dialog_token;
++ u8 status_code;
++ u8 variable[0];
++ } __attribute__ ((packed)) wme_action;
++#if 0
++ struct{
++ u8 action_code;
++ u8 element_id;
++ u8 length;
++ struct ieee80211_channel_sw_ie sw_elem;
++ } __attribute__ ((packed)) chan_switch;
++ struct{
++ u8 action_code;
++ u8 dialog_token;
++ u8 element_id;
++ u8 length;
++ struct ieee80211_msrment_ie msr_elem;
++ } __attribute__ ((packed)) measurement;
++#endif
++ struct{
++ u8 action_code;
++ u8 dialog_token;
++ u16 capab;
++ u16 timeout;
++ u16 start_seq_num;
++ } __attribute__ ((packed)) addba_req;
++ struct{
++ u8 action_code;
++ u8 dialog_token;
++ u16 status;
++ u16 capab;
++ u16 timeout;
++ } __attribute__ ((packed)) addba_resp;
++ struct{
++ u8 action_code;
++ u16 params;
++ u16 reason_code;
++ } __attribute__ ((packed)) delba;
++ struct{
++ u8 action_code;
++ /* capab_info for open and confirm,
++ * reason for close
++ */
++ u16 aux;
++ /* Followed in plink_confirm by status
++ * code, AID and supported rates,
++ * and directly by supported rates in
++ * plink_open and plink_close
++ */
++ u8 variable[0];
++ } __attribute__ ((packed)) plink_action;
++ struct{
++ u8 action_code;
++ u8 variable[0];
++ } __attribute__ ((packed)) mesh_action;
++ } __attribute__ ((packed)) u;
++ } __attribute__ ((packed)) action;
++ } __attribute__ ((packed)) u;
++}__attribute__ ((packed));
++
++#endif
++
++
++#ifdef PLATFORM_WINDOWS
++
++#pragma pack(1)
++
++struct ieee80211_mgmt {
++ u16 frame_control;
++ u16 duration;
++ u8 da[6];
++ u8 sa[6];
++ u8 bssid[6];
++ u16 seq_ctrl;
++ union {
++ struct {
++ u16 auth_alg;
++ u16 auth_transaction;
++ u16 status_code;
++ /* possibly followed by Challenge text */
++ u8 variable[0];
++ } auth;
++ struct {
++ u16 reason_code;
++ } deauth;
++ struct {
++ u16 capab_info;
++ u16 listen_interval;
++ /* followed by SSID and Supported rates */
++ u8 variable[0];
++ } assoc_req;
++ struct {
++ u16 capab_info;
++ u16 status_code;
++ u16 aid;
++ /* followed by Supported rates */
++ u8 variable[0];
++ } assoc_resp, reassoc_resp;
++ struct {
++ u16 capab_info;
++ u16 listen_interval;
++ u8 current_ap[6];
++ /* followed by SSID and Supported rates */
++ u8 variable[0];
++ } reassoc_req;
++ struct {
++ u16 reason_code;
++ } disassoc;
++#if 0
++ struct {
++ __le64 timestamp;
++ u16 beacon_int;
++ u16 capab_info;
++ /* followed by some of SSID, Supported rates,
++ * FH Params, DS Params, CF Params, IBSS Params, TIM */
++ u8 variable[0];
++ } beacon;
++ struct {
++ /* only variable items: SSID, Supported rates */
++ u8 variable[0];
++ } probe_req;
++
++ struct {
++ __le64 timestamp;
++ u16 beacon_int;
++ u16 capab_info;
++ /* followed by some of SSID, Supported rates,
++ * FH Params, DS Params, CF Params, IBSS Params */
++ u8 variable[0];
++ } probe_resp;
++#endif
++ struct {
++ u8 category;
++ union {
++ struct {
++ u8 action_code;
++ u8 dialog_token;
++ u8 status_code;
++ u8 variable[0];
++ } wme_action;
++/*
++ struct{
++ u8 action_code;
++ u8 element_id;
++ u8 length;
++ struct ieee80211_channel_sw_ie sw_elem;
++ } chan_switch;
++ struct{
++ u8 action_code;
++ u8 dialog_token;
++ u8 element_id;
++ u8 length;
++ struct ieee80211_msrment_ie msr_elem;
++ } measurement;
++*/
++ struct{
++ u8 action_code;
++ u8 dialog_token;
++ u16 capab;
++ u16 timeout;
++ u16 start_seq_num;
++ } addba_req;
++ struct{
++ u8 action_code;
++ u8 dialog_token;
++ u16 status;
++ u16 capab;
++ u16 timeout;
++ } addba_resp;
++ struct{
++ u8 action_code;
++ u16 params;
++ u16 reason_code;
++ } delba;
++ struct{
++ u8 action_code;
++ /* capab_info for open and confirm,
++ * reason for close
++ */
++ u16 aux;
++ /* Followed in plink_confirm by status
++ * code, AID and supported rates,
++ * and directly by supported rates in
++ * plink_open and plink_close
++ */
++ u8 variable[0];
++ } plink_action;
++ struct{
++ u8 action_code;
++ u8 variable[0];
++ } mesh_action;
++ } u;
++ } action;
++ } u;
++} ;
++
++#pragma pack()
++
++#endif
++
++/* mgmt header + 1 byte category code */
++#define IEEE80211_MIN_ACTION_SIZE FIELD_OFFSET(struct ieee80211_mgmt, u.action.u)
++
++
++
++#endif
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/ieee80211.h linux-rpi/drivers/net/wireless/rtl8192cu/include/ieee80211.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/ieee80211.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/ieee80211.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,1579 @@
+/******************************************************************************
+ *
@@ -176827,489 +179141,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/ieee80211.h linux-r
+const char *action_public_str(u8 action);
+
+#endif /* IEEE80211_H */
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/ieee80211_ext.h linux-rpi/drivers/net/wireless/rtl8192cu/include/ieee80211_ext.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/ieee80211_ext.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/ieee80211_ext.h 2015-08-26 10:26:08.761316441 +0200
-@@ -0,0 +1,476 @@
-+/******************************************************************************
-+ *
-+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of version 2 of the GNU General Public License as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-+ *
-+ *
-+ ******************************************************************************/
-+#ifndef __IEEE80211_EXT_H
-+#define __IEEE80211_EXT_H
-+
-+#include <drv_conf.h>
-+#include <osdep_service.h>
-+#include <drv_types.h>
-+
-+#define WMM_OUI_TYPE 2
-+#define WMM_OUI_SUBTYPE_INFORMATION_ELEMENT 0
-+#define WMM_OUI_SUBTYPE_PARAMETER_ELEMENT 1
-+#define WMM_OUI_SUBTYPE_TSPEC_ELEMENT 2
-+#define WMM_VERSION 1
-+
-+#define WPA_PROTO_WPA BIT(0)
-+#define WPA_PROTO_RSN BIT(1)
-+
-+#define WPA_KEY_MGMT_IEEE8021X BIT(0)
-+#define WPA_KEY_MGMT_PSK BIT(1)
-+#define WPA_KEY_MGMT_NONE BIT(2)
-+#define WPA_KEY_MGMT_IEEE8021X_NO_WPA BIT(3)
-+#define WPA_KEY_MGMT_WPA_NONE BIT(4)
-+
-+
-+#define WPA_CAPABILITY_PREAUTH BIT(0)
-+#define WPA_CAPABILITY_MGMT_FRAME_PROTECTION BIT(6)
-+#define WPA_CAPABILITY_PEERKEY_ENABLED BIT(9)
-+
-+
-+#define PMKID_LEN 16
-+
-+
-+#ifdef PLATFORM_LINUX
-+struct wpa_ie_hdr {
-+ u8 elem_id;
-+ u8 len;
-+ u8 oui[4]; /* 24-bit OUI followed by 8-bit OUI type */
-+ u8 version[2]; /* little endian */
-+}__attribute__ ((packed));
-+
-+struct rsn_ie_hdr {
-+ u8 elem_id; /* WLAN_EID_RSN */
-+ u8 len;
-+ u8 version[2]; /* little endian */
-+}__attribute__ ((packed));
-+
-+struct wme_ac_parameter {
-+#if defined(CONFIG_LITTLE_ENDIAN)
-+ /* byte 1 */
-+ u8 aifsn:4,
-+ acm:1,
-+ aci:2,
-+ reserved:1;
-+
-+ /* byte 2 */
-+ u8 eCWmin:4,
-+ eCWmax:4;
-+#elif defined(CONFIG_BIG_ENDIAN)
-+ /* byte 1 */
-+ u8 reserved:1,
-+ aci:2,
-+ acm:1,
-+ aifsn:4;
-+
-+ /* byte 2 */
-+ u8 eCWmax:4,
-+ eCWmin:4;
-+#else
-+#error "Please fix <endian.h>"
-+#endif
-+
-+ /* bytes 3 & 4 */
-+ u16 txopLimit;
-+} __attribute__ ((packed));
-+
-+struct wme_parameter_element {
-+ /* required fields for WME version 1 */
-+ u8 oui[3];
-+ u8 oui_type;
-+ u8 oui_subtype;
-+ u8 version;
-+ u8 acInfo;
-+ u8 reserved;
-+ struct wme_ac_parameter ac[4];
-+
-+} __attribute__ ((packed));
-+
-+#endif
-+
-+#ifdef PLATFORM_WINDOWS
-+
-+#pragma pack(1)
-+
-+struct wpa_ie_hdr {
-+ u8 elem_id;
-+ u8 len;
-+ u8 oui[4]; /* 24-bit OUI followed by 8-bit OUI type */
-+ u8 version[2]; /* little endian */
-+};
-+
-+struct rsn_ie_hdr {
-+ u8 elem_id; /* WLAN_EID_RSN */
-+ u8 len;
-+ u8 version[2]; /* little endian */
-+};
-+
-+#pragma pack()
-+
-+#endif
-+
-+#define WPA_PUT_LE16(a, val) \
-+ do { \
-+ (a)[1] = ((u16) (val)) >> 8; \
-+ (a)[0] = ((u16) (val)) & 0xff; \
-+ } while (0)
-+
-+#define WPA_PUT_BE32(a, val) \
-+ do { \
-+ (a)[0] = (u8) ((((u32) (val)) >> 24) & 0xff); \
-+ (a)[1] = (u8) ((((u32) (val)) >> 16) & 0xff); \
-+ (a)[2] = (u8) ((((u32) (val)) >> 8) & 0xff); \
-+ (a)[3] = (u8) (((u32) (val)) & 0xff); \
-+ } while (0)
-+
-+#define WPA_PUT_LE32(a, val) \
-+ do { \
-+ (a)[3] = (u8) ((((u32) (val)) >> 24) & 0xff); \
-+ (a)[2] = (u8) ((((u32) (val)) >> 16) & 0xff); \
-+ (a)[1] = (u8) ((((u32) (val)) >> 8) & 0xff); \
-+ (a)[0] = (u8) (((u32) (val)) & 0xff); \
-+ } while (0)
-+
-+#define RSN_SELECTOR_PUT(a, val) WPA_PUT_BE32((u8 *) (a), (val))
-+//#define RSN_SELECTOR_PUT(a, val) WPA_PUT_LE32((u8 *) (a), (val))
-+
-+
-+
-+/* Action category code */
-+enum ieee80211_category {
-+ WLAN_CATEGORY_SPECTRUM_MGMT = 0,
-+ WLAN_CATEGORY_QOS = 1,
-+ WLAN_CATEGORY_DLS = 2,
-+ WLAN_CATEGORY_BACK = 3,
-+ WLAN_CATEGORY_HT = 7,
-+ WLAN_CATEGORY_WMM = 17,
-+};
-+
-+/* SPECTRUM_MGMT action code */
-+enum ieee80211_spectrum_mgmt_actioncode {
-+ WLAN_ACTION_SPCT_MSR_REQ = 0,
-+ WLAN_ACTION_SPCT_MSR_RPRT = 1,
-+ WLAN_ACTION_SPCT_TPC_REQ = 2,
-+ WLAN_ACTION_SPCT_TPC_RPRT = 3,
-+ WLAN_ACTION_SPCT_CHL_SWITCH = 4,
-+ WLAN_ACTION_SPCT_EXT_CHL_SWITCH = 5,
-+};
-+
-+/* BACK action code */
-+enum ieee80211_back_actioncode {
-+ WLAN_ACTION_ADDBA_REQ = 0,
-+ WLAN_ACTION_ADDBA_RESP = 1,
-+ WLAN_ACTION_DELBA = 2,
-+};
-+
-+/* HT features action code */
-+enum ieee80211_ht_actioncode {
-+ WLAN_ACTION_NOTIFY_CH_WIDTH = 0,
-+ WLAN_ACTION_SM_PS = 1,
-+ WLAN_ACTION_PSPM = 2,
-+ WLAN_ACTION_PCO_PHASE = 3,
-+ WLAN_ACTION_MIMO_CSI_MX = 4,
-+ WLAN_ACTION_MIMO_NONCP_BF = 5,
-+ WLAN_ACTION_MIMP_CP_BF = 6,
-+ WLAN_ACTION_ASEL_INDICATES_FB = 7,
-+ WLAN_ACTION_HI_INFO_EXCHG = 8,
-+};
-+
-+/* BACK (block-ack) parties */
-+enum ieee80211_back_parties {
-+ WLAN_BACK_RECIPIENT = 0,
-+ WLAN_BACK_INITIATOR = 1,
-+ WLAN_BACK_TIMER = 2,
-+};
-+
-+#ifdef PLATFORM_LINUX
-+
-+struct ieee80211_mgmt {
-+ u16 frame_control;
-+ u16 duration;
-+ u8 da[6];
-+ u8 sa[6];
-+ u8 bssid[6];
-+ u16 seq_ctrl;
-+ union {
-+ struct {
-+ u16 auth_alg;
-+ u16 auth_transaction;
-+ u16 status_code;
-+ /* possibly followed by Challenge text */
-+ u8 variable[0];
-+ } __attribute__ ((packed)) auth;
-+ struct {
-+ u16 reason_code;
-+ } __attribute__ ((packed)) deauth;
-+ struct {
-+ u16 capab_info;
-+ u16 listen_interval;
-+ /* followed by SSID and Supported rates */
-+ u8 variable[0];
-+ } __attribute__ ((packed)) assoc_req;
-+ struct {
-+ u16 capab_info;
-+ u16 status_code;
-+ u16 aid;
-+ /* followed by Supported rates */
-+ u8 variable[0];
-+ } __attribute__ ((packed)) assoc_resp, reassoc_resp;
-+ struct {
-+ u16 capab_info;
-+ u16 listen_interval;
-+ u8 current_ap[6];
-+ /* followed by SSID and Supported rates */
-+ u8 variable[0];
-+ } __attribute__ ((packed)) reassoc_req;
-+ struct {
-+ u16 reason_code;
-+ } __attribute__ ((packed)) disassoc;
-+ struct {
-+ __le64 timestamp;
-+ u16 beacon_int;
-+ u16 capab_info;
-+ /* followed by some of SSID, Supported rates,
-+ * FH Params, DS Params, CF Params, IBSS Params, TIM */
-+ u8 variable[0];
-+ } __attribute__ ((packed)) beacon;
-+ struct {
-+ /* only variable items: SSID, Supported rates */
-+ u8 variable[0];
-+ } __attribute__ ((packed)) probe_req;
-+ struct {
-+ __le64 timestamp;
-+ u16 beacon_int;
-+ u16 capab_info;
-+ /* followed by some of SSID, Supported rates,
-+ * FH Params, DS Params, CF Params, IBSS Params */
-+ u8 variable[0];
-+ } __attribute__ ((packed)) probe_resp;
-+ struct {
-+ u8 category;
-+ union {
-+ struct {
-+ u8 action_code;
-+ u8 dialog_token;
-+ u8 status_code;
-+ u8 variable[0];
-+ } __attribute__ ((packed)) wme_action;
-+#if 0
-+ struct{
-+ u8 action_code;
-+ u8 element_id;
-+ u8 length;
-+ struct ieee80211_channel_sw_ie sw_elem;
-+ } __attribute__ ((packed)) chan_switch;
-+ struct{
-+ u8 action_code;
-+ u8 dialog_token;
-+ u8 element_id;
-+ u8 length;
-+ struct ieee80211_msrment_ie msr_elem;
-+ } __attribute__ ((packed)) measurement;
-+#endif
-+ struct{
-+ u8 action_code;
-+ u8 dialog_token;
-+ u16 capab;
-+ u16 timeout;
-+ u16 start_seq_num;
-+ } __attribute__ ((packed)) addba_req;
-+ struct{
-+ u8 action_code;
-+ u8 dialog_token;
-+ u16 status;
-+ u16 capab;
-+ u16 timeout;
-+ } __attribute__ ((packed)) addba_resp;
-+ struct{
-+ u8 action_code;
-+ u16 params;
-+ u16 reason_code;
-+ } __attribute__ ((packed)) delba;
-+ struct{
-+ u8 action_code;
-+ /* capab_info for open and confirm,
-+ * reason for close
-+ */
-+ u16 aux;
-+ /* Followed in plink_confirm by status
-+ * code, AID and supported rates,
-+ * and directly by supported rates in
-+ * plink_open and plink_close
-+ */
-+ u8 variable[0];
-+ } __attribute__ ((packed)) plink_action;
-+ struct{
-+ u8 action_code;
-+ u8 variable[0];
-+ } __attribute__ ((packed)) mesh_action;
-+ } __attribute__ ((packed)) u;
-+ } __attribute__ ((packed)) action;
-+ } __attribute__ ((packed)) u;
-+}__attribute__ ((packed));
-+
-+#endif
-+
-+
-+#ifdef PLATFORM_WINDOWS
-+
-+#pragma pack(1)
-+
-+struct ieee80211_mgmt {
-+ u16 frame_control;
-+ u16 duration;
-+ u8 da[6];
-+ u8 sa[6];
-+ u8 bssid[6];
-+ u16 seq_ctrl;
-+ union {
-+ struct {
-+ u16 auth_alg;
-+ u16 auth_transaction;
-+ u16 status_code;
-+ /* possibly followed by Challenge text */
-+ u8 variable[0];
-+ } auth;
-+ struct {
-+ u16 reason_code;
-+ } deauth;
-+ struct {
-+ u16 capab_info;
-+ u16 listen_interval;
-+ /* followed by SSID and Supported rates */
-+ u8 variable[0];
-+ } assoc_req;
-+ struct {
-+ u16 capab_info;
-+ u16 status_code;
-+ u16 aid;
-+ /* followed by Supported rates */
-+ u8 variable[0];
-+ } assoc_resp, reassoc_resp;
-+ struct {
-+ u16 capab_info;
-+ u16 listen_interval;
-+ u8 current_ap[6];
-+ /* followed by SSID and Supported rates */
-+ u8 variable[0];
-+ } reassoc_req;
-+ struct {
-+ u16 reason_code;
-+ } disassoc;
-+#if 0
-+ struct {
-+ __le64 timestamp;
-+ u16 beacon_int;
-+ u16 capab_info;
-+ /* followed by some of SSID, Supported rates,
-+ * FH Params, DS Params, CF Params, IBSS Params, TIM */
-+ u8 variable[0];
-+ } beacon;
-+ struct {
-+ /* only variable items: SSID, Supported rates */
-+ u8 variable[0];
-+ } probe_req;
-+
-+ struct {
-+ __le64 timestamp;
-+ u16 beacon_int;
-+ u16 capab_info;
-+ /* followed by some of SSID, Supported rates,
-+ * FH Params, DS Params, CF Params, IBSS Params */
-+ u8 variable[0];
-+ } probe_resp;
-+#endif
-+ struct {
-+ u8 category;
-+ union {
-+ struct {
-+ u8 action_code;
-+ u8 dialog_token;
-+ u8 status_code;
-+ u8 variable[0];
-+ } wme_action;
-+/*
-+ struct{
-+ u8 action_code;
-+ u8 element_id;
-+ u8 length;
-+ struct ieee80211_channel_sw_ie sw_elem;
-+ } chan_switch;
-+ struct{
-+ u8 action_code;
-+ u8 dialog_token;
-+ u8 element_id;
-+ u8 length;
-+ struct ieee80211_msrment_ie msr_elem;
-+ } measurement;
-+*/
-+ struct{
-+ u8 action_code;
-+ u8 dialog_token;
-+ u16 capab;
-+ u16 timeout;
-+ u16 start_seq_num;
-+ } addba_req;
-+ struct{
-+ u8 action_code;
-+ u8 dialog_token;
-+ u16 status;
-+ u16 capab;
-+ u16 timeout;
-+ } addba_resp;
-+ struct{
-+ u8 action_code;
-+ u16 params;
-+ u16 reason_code;
-+ } delba;
-+ struct{
-+ u8 action_code;
-+ /* capab_info for open and confirm,
-+ * reason for close
-+ */
-+ u16 aux;
-+ /* Followed in plink_confirm by status
-+ * code, AID and supported rates,
-+ * and directly by supported rates in
-+ * plink_open and plink_close
-+ */
-+ u8 variable[0];
-+ } plink_action;
-+ struct{
-+ u8 action_code;
-+ u8 variable[0];
-+ } mesh_action;
-+ } u;
-+ } action;
-+ } u;
-+} ;
-+
-+#pragma pack()
-+
-+#endif
-+
-+/* mgmt header + 1 byte category code */
-+#define IEEE80211_MIN_ACTION_SIZE FIELD_OFFSET(struct ieee80211_mgmt, u.action.u)
-+
-+
-+
-+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/if_ether.h linux-rpi/drivers/net/wireless/rtl8192cu/include/if_ether.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/if_ether.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/if_ether.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/if_ether.h linux-rpi/drivers/net/wireless/rtl8192cu/include/if_ether.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/if_ether.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/if_ether.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,112 @@
+/******************************************************************************
+ *
@@ -177423,9 +179257,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/if_ether.h linux-rp
+
+
+#endif /* _LINUX_IF_ETHER_H */
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/ioctl_cfg80211.h linux-rpi/drivers/net/wireless/rtl8192cu/include/ioctl_cfg80211.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/ioctl_cfg80211.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/ioctl_cfg80211.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/ioctl_cfg80211.h linux-rpi/drivers/net/wireless/rtl8192cu/include/ioctl_cfg80211.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/ioctl_cfg80211.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/ioctl_cfg80211.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,179 @@
+/******************************************************************************
+ *
@@ -177606,9 +179440,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/ioctl_cfg80211.h li
+#endif
+
+#endif //__IOCTL_CFG80211_H__
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/ip.h linux-rpi/drivers/net/wireless/rtl8192cu/include/ip.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/ip.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/ip.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/ip.h linux-rpi/drivers/net/wireless/rtl8192cu/include/ip.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/ip.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/ip.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,141 @@
+/******************************************************************************
+ *
@@ -177751,9 +179585,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/ip.h linux-rpi/driv
+};
+
+#endif /* _LINUX_IP_H */
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/linux/wireless.h linux-rpi/drivers/net/wireless/rtl8192cu/include/linux/wireless.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/linux/wireless.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/linux/wireless.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/linux/wireless.h linux-rpi/drivers/net/wireless/rtl8192cu/include/linux/wireless.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/linux/wireless.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/linux/wireless.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,90 @@
+/******************************************************************************
+ *
@@ -177845,9 +179679,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/linux/wireless.h li
+};
+
+#endif /* _LINUX_WIRELESS_H */
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/mlme_osdep.h linux-rpi/drivers/net/wireless/rtl8192cu/include/mlme_osdep.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/mlme_osdep.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/mlme_osdep.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/mlme_osdep.h linux-rpi/drivers/net/wireless/rtl8192cu/include/mlme_osdep.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/mlme_osdep.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/mlme_osdep.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,39 @@
+/******************************************************************************
+ *
@@ -177888,9 +179722,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/mlme_osdep.h linux-
+void rtw_reset_securitypriv( _adapter *adapter );
+
+#endif //_MLME_OSDEP_H_
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/mp_custom_oid.h linux-rpi/drivers/net/wireless/rtl8192cu/include/mp_custom_oid.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/mp_custom_oid.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/mp_custom_oid.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/mp_custom_oid.h linux-rpi/drivers/net/wireless/rtl8192cu/include/mp_custom_oid.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/mp_custom_oid.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/mp_custom_oid.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,353 @@
+/******************************************************************************
+ *
@@ -178245,9 +180079,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/mp_custom_oid.h lin
+#define OID_RT_PRO_EFUSE_MAP 0xFF871217 //Q, S
+
+#endif //#ifndef __CUSTOM_OID_H
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/nic_spec.h linux-rpi/drivers/net/wireless/rtl8192cu/include/nic_spec.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/nic_spec.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/nic_spec.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/nic_spec.h linux-rpi/drivers/net/wireless/rtl8192cu/include/nic_spec.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/nic_spec.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/nic_spec.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,46 @@
+/******************************************************************************
+ *
@@ -178295,9 +180129,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/nic_spec.h linux-rp
+
+
+#endif // __RTL8711_SPEC_H__
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/osdep_ce_service.h linux-rpi/drivers/net/wireless/rtl8192cu/include/osdep_ce_service.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/osdep_ce_service.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/osdep_ce_service.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/osdep_ce_service.h linux-rpi/drivers/net/wireless/rtl8192cu/include/osdep_ce_service.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/osdep_ce_service.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/osdep_ce_service.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,170 @@
+/******************************************************************************
+ *
@@ -178469,9 +180303,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/osdep_ce_service.h
+ NdisInterlockedDecrement((PULONG)&(_MutexCounter)); \
+}
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/osdep_intf.h linux-rpi/drivers/net/wireless/rtl8192cu/include/osdep_intf.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/osdep_intf.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/osdep_intf.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/osdep_intf.h linux-rpi/drivers/net/wireless/rtl8192cu/include/osdep_intf.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/osdep_intf.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/osdep_intf.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,154 @@
+/******************************************************************************
+ *
@@ -178627,9 +180461,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/osdep_intf.h linux-
+void rtw_ndev_destructor(_nic_hdl ndev);
+
+#endif //_OSDEP_INTF_H_
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/osdep_service.h linux-rpi/drivers/net/wireless/rtl8192cu/include/osdep_service.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/osdep_service.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/osdep_service.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/osdep_service.h linux-rpi/drivers/net/wireless/rtl8192cu/include/osdep_service.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/osdep_service.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/osdep_service.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,1813 @@
+/******************************************************************************
+ *
@@ -180444,9 +182278,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/osdep_service.h lin
+void rtw_cbuf_free(struct rtw_cbuf *cbuf);
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/pci_hal.h linux-rpi/drivers/net/wireless/rtl8192cu/include/pci_hal.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/pci_hal.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/pci_hal.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/pci_hal.h linux-rpi/drivers/net/wireless/rtl8192cu/include/pci_hal.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/pci_hal.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/pci_hal.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,167 @@
+/******************************************************************************
+ *
@@ -180615,9 +182449,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/pci_hal.h linux-rpi
+#endif
+
+#endif //__PCIE_HAL_H__
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/pci_ops.h linux-rpi/drivers/net/wireless/rtl8192cu/include/pci_ops.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/pci_ops.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/pci_ops.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/pci_ops.h linux-rpi/drivers/net/wireless/rtl8192cu/include/pci_ops.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/pci_ops.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/pci_ops.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,60 @@
+/******************************************************************************
+ *
@@ -180679,9 +182513,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/pci_ops.h linux-rpi
+#endif
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/pci_osintf.h linux-rpi/drivers/net/wireless/rtl8192cu/include/pci_osintf.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/pci_osintf.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/pci_osintf.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/pci_osintf.h linux-rpi/drivers/net/wireless/rtl8192cu/include/pci_osintf.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/pci_osintf.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/pci_osintf.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,32 @@
+/******************************************************************************
+ *
@@ -180715,9 +182549,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/pci_osintf.h linux-
+
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/recv_osdep.h linux-rpi/drivers/net/wireless/rtl8192cu/include/recv_osdep.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/recv_osdep.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/recv_osdep.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/recv_osdep.h linux-rpi/drivers/net/wireless/rtl8192cu/include/recv_osdep.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/recv_osdep.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/recv_osdep.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,57 @@
+/******************************************************************************
+ *
@@ -180776,9 +182610,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/recv_osdep.h linux-
+
+
+#endif //
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_cmd.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_cmd.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_cmd.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_cmd.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192c_cmd.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_cmd.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192c_cmd.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_cmd.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,152 @@
+/******************************************************************************
+ *
@@ -180932,9 +182766,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_cmd.h linu
+#endif // CONFIG_WOWLAN
+
+#endif // __RTL8192C_CMD_H_
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_dm.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_dm.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_dm.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_dm.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192c_dm.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_dm.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192c_dm.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_dm.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,515 @@
+/******************************************************************************
+ *
@@ -181451,9 +183285,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_dm.h linux
+#endif
+
+#endif //__HAL8190PCIDM_H__
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_event.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_event.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_event.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_event.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192c_event.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_event.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192c_event.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_event.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,26 @@
+/******************************************************************************
+ *
@@ -181481,9 +183315,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_event.h li
+
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_hal.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_hal.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_hal.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_hal.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192c_hal.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_hal.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192c_hal.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_hal.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,934 @@
+/******************************************************************************
+ *
@@ -182419,9 +184253,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_hal.h linu
+extern void Hal_SetOFDMContinuousTx(PADAPTER pAdapter, u8 bStart);
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_led.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_led.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_led.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_led.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192c_led.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_led.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192c_led.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_led.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,41 @@
+/******************************************************************************
+ *
@@ -182464,9 +184298,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_led.h linu
+#endif
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_recv.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_recv.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_recv.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_recv.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192c_recv.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_recv.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192c_recv.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_recv.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,183 @@
+/******************************************************************************
+ *
@@ -182651,9 +184485,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_recv.h lin
+void rtl8192c_query_rx_desc_status(union recv_frame *precvframe, struct recv_stat *pdesc);
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_rf.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_rf.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_rf.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_rf.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192c_rf.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_rf.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192c_rf.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_rf.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,91 @@
+/******************************************************************************
+ *
@@ -182746,9 +184580,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_rf.h linux
+
+
+#endif/* End of HalRf.h */
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_spec.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_spec.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_spec.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_spec.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192c_spec.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_spec.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192c_spec.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_spec.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,1864 @@
+/******************************************************************************
+ *
@@ -184614,9 +186448,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_spec.h lin
+#include "basic_types.h"
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_sreset.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_sreset.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_sreset.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_sreset.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192c_sreset.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_sreset.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192c_sreset.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_sreset.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,32 @@
+/******************************************************************************
+ *
@@ -184650,9 +186484,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_sreset.h l
+extern void rtl8192c_sreset_linked_status_check(_adapter *padapter);
+#endif
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_xmit.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_xmit.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_xmit.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_xmit.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192c_xmit.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_xmit.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192c_xmit.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192c_xmit.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,128 @@
+/******************************************************************************
+ *
@@ -184782,9 +186616,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192c_xmit.h lin
+#endif
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192d_cmd.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_cmd.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192d_cmd.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_cmd.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192d_cmd.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_cmd.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192d_cmd.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_cmd.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,140 @@
+/******************************************************************************
+ *
@@ -184926,9 +186760,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192d_cmd.h linu
+#endif // CONFIG_WOWLAN
+
+#endif // __RTL8192D_CMD_H_
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192d_dm.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_dm.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192d_dm.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_dm.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192d_dm.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_dm.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192d_dm.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_dm.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,420 @@
+/******************************************************************************
+ *
@@ -185350,9 +187184,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192d_dm.h linux
+VOID rtl8192d_dm_CheckTXPowerTracking(IN PADAPTER Adapter);
+
+#endif //__HAL8190PCIDM_H__
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192d_hal.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_hal.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192d_hal.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_hal.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192d_hal.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_hal.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192d_hal.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_hal.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,1125 @@
+/******************************************************************************
+ *
@@ -186479,9 +188313,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192d_hal.h linu
+
+
+#endif //end CONFIG_MP_INCLUDED
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192d_led.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_led.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192d_led.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_led.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192d_led.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_led.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192d_led.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_led.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,42 @@
+/******************************************************************************
+ *
@@ -186525,9 +188359,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192d_led.h linu
+#endif
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192d_recv.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_recv.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192d_recv.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_recv.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192d_recv.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_recv.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192d_recv.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_recv.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,186 @@
+/******************************************************************************
+ *
@@ -186715,9 +188549,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192d_recv.h lin
+void rtl8192d_query_rx_desc_status(union recv_frame *precvframe, struct recv_stat *pdesc);
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192d_rf.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_rf.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192d_rf.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_rf.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192d_rf.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_rf.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192d_rf.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_rf.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,96 @@
+/******************************************************************************
+ *
@@ -186815,9 +188649,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192d_rf.h linux
+
+
+#endif/* End of HalRf.h */
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192d_spec.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_spec.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192d_spec.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_spec.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192d_spec.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_spec.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192d_spec.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_spec.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,1840 @@
+/******************************************************************************
+ *
@@ -188659,9 +190493,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192d_spec.h lin
+#include "basic_types.h"
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192d_xmit.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_xmit.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192d_xmit.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_xmit.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192d_xmit.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_xmit.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtl8192d_xmit.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtl8192d_xmit.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,144 @@
+/******************************************************************************
+ *
@@ -188807,9 +190641,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtl8192d_xmit.h lin
+
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_android.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_android.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_android.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_android.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_android.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_android.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_android.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_android.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,89 @@
+/******************************************************************************
+ *
@@ -188900,9 +190734,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_android.h linux
+#endif /* defined(RTW_ENABLE_WIFI_CONTROL_FUNC) */
+
+#endif //__RTW_ANDROID_H__
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_ap.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_ap.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_ap.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_ap.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_ap.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_ap.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_ap.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_ap.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,63 @@
+/******************************************************************************
+ *
@@ -188967,9 +190801,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_ap.h linux-rpi/
+#endif //end of CONFIG_AP_MODE
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_br_ext.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_br_ext.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_br_ext.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_br_ext.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_br_ext.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_br_ext.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_br_ext.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_br_ext.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,75 @@
+/******************************************************************************
+ *
@@ -189046,9 +190880,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_br_ext.h linux-
+void nat25_db_cleanup(_adapter *priv);
+
+#endif // _RTW_BR_EXT_H_
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_byteorder.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_byteorder.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_byteorder.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_byteorder.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_byteorder.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_byteorder.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_byteorder.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_byteorder.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,39 @@
+/******************************************************************************
+ *
@@ -189089,9 +190923,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_byteorder.h lin
+#endif
+
+#endif /* _RTL871X_BYTEORDER_H_ */
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_cmd.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_cmd.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_cmd.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_cmd.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_cmd.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_cmd.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_cmd.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_cmd.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,1166 @@
+/******************************************************************************
+ *
@@ -190259,9 +192093,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_cmd.h linux-rpi
+#endif
+
+#endif // _CMD_H_
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_debug.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_debug.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_debug.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_debug.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_debug.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_debug.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_debug.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_debug.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,537 @@
+/******************************************************************************
+ *
@@ -190800,9 +192634,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_debug.h linux-r
+#endif //CONFIG_PROC_DEBUG
+
+#endif //__RTW_DEBUG_H__
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_eeprom.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_eeprom.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_eeprom.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_eeprom.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_eeprom.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_eeprom.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_eeprom.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_eeprom.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,152 @@
+/******************************************************************************
+ *
@@ -190956,9 +192790,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_eeprom.h linux-
+#endif //PLATFORM_LINUX
+
+#endif //__RTL871X_EEPROM_H__
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_efuse.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_efuse.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_efuse.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_efuse.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_efuse.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_efuse.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_efuse.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_efuse.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,123 @@
+/******************************************************************************
+ *
@@ -191083,9 +192917,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_efuse.h linux-r
+void EFUSE_ShadowRead(PADAPTER pAdapter, u8 Type, u16 Offset, u32 *Value);
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_event.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_event.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_event.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_event.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_event.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_event.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_event.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_event.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,153 @@
+/******************************************************************************
+ *
@@ -191240,9 +193074,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_event.h linux-r
+
+
+#endif // _WLANEVENT_H_
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_ht.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_ht.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_ht.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_ht.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_ht.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_ht.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_ht.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_ht.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,49 @@
+/******************************************************************************
+ *
@@ -191293,9 +193127,489 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_ht.h linux-rpi/
+};
+
+#endif //_RTL871X_HT_H_
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_io.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_io.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_io.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_io.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_ioctl.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_ioctl.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_ioctl.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_ioctl.h 2015-10-07 16:40:51.000000000 +0200
+@@ -0,0 +1,268 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ *
++ ******************************************************************************/
++#ifndef _RTW_IOCTL_H_
++#define _RTW_IOCTL_H_
++
++#include <drv_conf.h>
++#include <osdep_service.h>
++#include <drv_types.h>
++
++#ifndef OID_802_11_CAPABILITY
++ #define OID_802_11_CAPABILITY 0x0d010122
++#endif
++
++#ifndef OID_802_11_PMKID
++ #define OID_802_11_PMKID 0x0d010123
++#endif
++
++
++// For DDK-defined OIDs
++#define OID_NDIS_SEG1 0x00010100
++#define OID_NDIS_SEG2 0x00010200
++#define OID_NDIS_SEG3 0x00020100
++#define OID_NDIS_SEG4 0x01010100
++#define OID_NDIS_SEG5 0x01020100
++#define OID_NDIS_SEG6 0x01020200
++#define OID_NDIS_SEG7 0xFD010100
++#define OID_NDIS_SEG8 0x0D010100
++#define OID_NDIS_SEG9 0x0D010200
++#define OID_NDIS_SEG10 0x0D020200
++
++#define SZ_OID_NDIS_SEG1 23
++#define SZ_OID_NDIS_SEG2 3
++#define SZ_OID_NDIS_SEG3 6
++#define SZ_OID_NDIS_SEG4 6
++#define SZ_OID_NDIS_SEG5 4
++#define SZ_OID_NDIS_SEG6 8
++#define SZ_OID_NDIS_SEG7 7
++#define SZ_OID_NDIS_SEG8 36
++#define SZ_OID_NDIS_SEG9 24
++#define SZ_OID_NDIS_SEG10 19
++
++// For Realtek-defined OIDs
++#define OID_MP_SEG1 0xFF871100
++#define OID_MP_SEG2 0xFF818000
++
++#define OID_MP_SEG3 0xFF818700
++#define OID_MP_SEG4 0xFF011100
++
++#define DEBUG_OID(dbg, str) \
++ if((!dbg)) \
++ { \
++ RT_TRACE(_module_rtl871x_ioctl_c_,_drv_info_,("%s(%d): %s", __FUNCTION__, __LINE__, str)); \
++ }
++
++
++enum oid_type
++{
++ QUERY_OID,
++ SET_OID
++};
++
++struct oid_funs_node {
++ unsigned int oid_start; //the starting number for OID
++ unsigned int oid_end; //the ending number for OID
++ struct oid_obj_priv *node_array;
++ unsigned int array_sz; //the size of node_array
++ int query_counter; //count the number of query hits for this segment
++ int set_counter; //count the number of set hits for this segment
++};
++
++struct oid_par_priv
++{
++ void *adapter_context;
++ NDIS_OID oid;
++ void *information_buf;
++ u32 information_buf_len;
++ u32 *bytes_rw;
++ u32 *bytes_needed;
++ enum oid_type type_of_oid;
++ u32 dbg;
++};
++
++struct oid_obj_priv {
++ unsigned char dbg; // 0: without OID debug message 1: with OID debug message
++ NDIS_STATUS (*oidfuns)(struct oid_par_priv *poid_par_priv);
++};
++
++#if (defined(CONFIG_MP_INCLUDED) && defined(_RTW_MP_IOCTL_C_)) || \
++ (defined(PLATFORM_WINDOWS) && defined(_RTW_IOCTL_RTL_C_))
++static NDIS_STATUS oid_null_function(struct oid_par_priv* poid_par_priv)
++{
++ _func_enter_;
++ _func_exit_;
++ return NDIS_STATUS_SUCCESS;
++}
++#endif
++
++#ifdef PLATFORM_WINDOWS
++
++int TranslateNdisPsToRtPs(IN NDIS_802_11_POWER_MODE ndisPsMode);
++
++//OID Handler for Segment 1
++NDIS_STATUS oid_gen_supported_list_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_gen_hardware_status_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_gen_media_supported_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_gen_media_in_use_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_gen_maximum_lookahead_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_gen_maximum_frame_size_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_gen_link_speed_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_gen_transmit_buffer_space_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_gen_receive_buffer_space_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_gen_transmit_block_size_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_gen_receive_block_size_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_gen_vendor_id_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_gen_vendor_description_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_gen_current_packet_filter_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_gen_current_lookahead_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_gen_driver_version_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_gen_maximum_total_size_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_gen_protocol_options_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_gen_mac_options_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_gen_media_connect_status_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_gen_maximum_send_packets_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_gen_vendor_driver_version_hdl(struct oid_par_priv* poid_par_priv);
++
++
++//OID Handler for Segment 2
++NDIS_STATUS oid_gen_physical_medium_hdl(struct oid_par_priv* poid_par_priv);
++
++//OID Handler for Segment 3
++NDIS_STATUS oid_gen_xmit_ok_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_gen_rcv_ok_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_gen_xmit_error_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_gen_rcv_error_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_gen_rcv_no_buffer_hdl(struct oid_par_priv* poid_par_priv);
++
++
++//OID Handler for Segment 4
++NDIS_STATUS oid_802_3_permanent_address_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_3_current_address_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_3_multicast_list_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_3_maximum_list_size_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_3_mac_options_hdl(struct oid_par_priv* poid_par_priv);
++
++
++
++//OID Handler for Segment 5
++NDIS_STATUS oid_802_3_rcv_error_alignment_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_3_xmit_one_collision_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_3_xmit_more_collisions_hdl(struct oid_par_priv* poid_par_priv);
++
++
++//OID Handler for Segment 6
++NDIS_STATUS oid_802_3_xmit_deferred_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_3_xmit_max_collisions_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_3_rcv_overrun_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_3_xmit_underrun_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_3_xmit_heartbeat_failure_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_3_xmit_times_crs_lost_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_3_xmit_late_collisions_hdl(struct oid_par_priv* poid_par_priv);
++
++
++
++//OID Handler for Segment 7
++NDIS_STATUS oid_pnp_capabilities_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_pnp_set_power_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_pnp_query_power_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_pnp_add_wake_up_pattern_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_pnp_remove_wake_up_pattern_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_pnp_wake_up_pattern_list_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_pnp_enable_wake_up_hdl(struct oid_par_priv* poid_par_priv);
++
++
++
++//OID Handler for Segment 8
++NDIS_STATUS oid_802_11_bssid_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_ssid_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_infrastructure_mode_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_add_wep_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_remove_wep_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_disassociate_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_authentication_mode_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_privacy_filter_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_bssid_list_scan_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_encryption_status_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_reload_defaults_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_add_key_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_remove_key_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_association_information_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_test_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_media_stream_mode_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_capability_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_pmkid_hdl(struct oid_par_priv* poid_par_priv);
++
++
++
++
++
++//OID Handler for Segment 9
++NDIS_STATUS oid_802_11_network_types_supported_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_network_type_in_use_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_tx_power_level_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_rssi_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_rssi_trigger_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_fragmentation_threshold_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_rts_threshold_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_number_of_antennas_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_rx_antenna_selected_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_tx_antenna_selected_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_supported_rates_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_desired_rates_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_configuration_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_power_mode_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_802_11_bssid_list_hdl(struct oid_par_priv* poid_par_priv);
++
++
++//OID Handler for Segment 10
++NDIS_STATUS oid_802_11_statistics_hdl(struct oid_par_priv* poid_par_priv);
++
++
++//OID Handler for Segment ED
++NDIS_STATUS oid_rt_mh_vender_id_hdl(struct oid_par_priv* poid_par_priv);
++
++void Set_802_3_MULTICAST_LIST(ADAPTER *pAdapter, UCHAR *MCListbuf, ULONG MCListlen, BOOLEAN bAcceptAllMulticast);
++
++#endif// end of PLATFORM_WINDOWS
++
++
++#if defined(PLATFORM_LINUX) && defined(CONFIG_WIRELESS_EXT)
++extern struct iw_handler_def rtw_handlers_def;
++#endif
++
++extern NDIS_STATUS drv_query_info(
++ IN _nic_hdl MiniportAdapterContext,
++ IN NDIS_OID Oid,
++ IN void * InformationBuffer,
++ IN u32 InformationBufferLength,
++ OUT u32* BytesWritten,
++ OUT u32* BytesNeeded
++ );
++
++extern NDIS_STATUS drv_set_info(
++ IN _nic_hdl MiniportAdapterContext,
++ IN NDIS_OID Oid,
++ IN void * InformationBuffer,
++ IN u32 InformationBufferLength,
++ OUT u32* BytesRead,
++ OUT u32* BytesNeeded
++ );
++
++#endif // #ifndef __INC_CEINFO_
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_query.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_query.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_query.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_query.h 2015-10-07 16:40:51.000000000 +0200
+@@ -0,0 +1,35 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ *
++ ******************************************************************************/
++#ifndef _RTW_IOCTL_QUERY_H_
++#define _RTW_IOCTL_QUERY_H_
++
++#include <drv_conf.h>
++#include <drv_types.h>
++
++
++#ifdef PLATFORM_WINDOWS
++
++u8 query_802_11_capability(_adapter* padapter,u8* pucBuf,u32 * pulOutLen);
++u8 query_802_11_association_information (_adapter * padapter, PNDIS_802_11_ASSOCIATION_INFORMATION pAssocInfo);
++
++#endif
++
++
++#endif
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_rtl.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_rtl.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_rtl.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_rtl.h 2015-10-07 16:40:51.000000000 +0200
+@@ -0,0 +1,83 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ *
++ ******************************************************************************/
++#ifndef _RTW_IOCTL_RTL_H_
++#define _RTW_IOCTL_RTL_H_
++
++#include <drv_conf.h>
++#include <osdep_service.h>
++#include <drv_types.h>
++
++//************** oid_rtl_seg_01_01 **************
++NDIS_STATUS oid_rt_get_signal_quality_hdl(struct oid_par_priv* poid_par_priv);//84
++NDIS_STATUS oid_rt_get_small_packet_crc_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_get_middle_packet_crc_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_get_large_packet_crc_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_get_tx_retry_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_get_rx_retry_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_get_rx_total_packet_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_get_tx_beacon_ok_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_get_tx_beacon_err_hdl(struct oid_par_priv* poid_par_priv);
++
++NDIS_STATUS oid_rt_pro_set_fw_dig_state_hdl(struct oid_par_priv* poid_par_priv); //8a
++NDIS_STATUS oid_rt_pro_set_fw_ra_state_hdl(struct oid_par_priv* poid_par_priv); //8b
++
++NDIS_STATUS oid_rt_get_rx_icv_err_hdl(struct oid_par_priv* poid_par_priv);//93
++NDIS_STATUS oid_rt_set_encryption_algorithm_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_get_preamble_mode_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_get_ap_ip_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_get_channelplan_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_set_channelplan_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_set_preamble_mode_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_set_bcn_intvl_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_dedicate_probe_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_get_total_tx_bytes_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_get_total_rx_bytes_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_current_tx_power_level_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_get_enc_key_mismatch_count_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_get_enc_key_match_count_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_get_channel_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_get_hardware_radio_off_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_get_key_mismatch_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_supported_wireless_mode_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_get_channel_list_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_get_scan_in_progress_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_forced_data_rate_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_wireless_mode_for_scan_list_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_get_bss_wireless_mode_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_scan_with_magic_packet_hdl(struct oid_par_priv* poid_par_priv);
++
++//************** oid_rtl_seg_01_03 section start **************
++NDIS_STATUS oid_rt_ap_get_associated_station_list_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_ap_switch_into_ap_mode_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_ap_supported_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_ap_set_passphrase_hdl(struct oid_par_priv* poid_par_priv);
++
++// oid_rtl_seg_01_11
++NDIS_STATUS oid_rt_pro_rf_write_registry_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_pro_rf_read_registry_hdl(struct oid_par_priv* poid_par_priv);
++
++//************** oid_rtl_seg_03_00 section start **************
++NDIS_STATUS oid_rt_get_connect_state_hdl(struct oid_par_priv* poid_par_priv);
++NDIS_STATUS oid_rt_set_default_key_id_hdl(struct oid_par_priv* poid_par_priv);
++
++
++
++
++#endif
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_set.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_set.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_set.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_set.h 2015-10-07 16:40:51.000000000 +0200
+@@ -0,0 +1,78 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ *
++ ******************************************************************************/
++#ifndef __RTW_IOCTL_SET_H_
++#define __RTW_IOCTL_SET_H_
++
++#include <drv_conf.h>
++#include <drv_types.h>
++
++
++typedef u8 NDIS_802_11_PMKID_VALUE[16];
++
++typedef struct _BSSIDInfo {
++ NDIS_802_11_MAC_ADDRESS BSSID;
++ NDIS_802_11_PMKID_VALUE PMKID;
++} BSSIDInfo, *PBSSIDInfo;
++
++
++#ifdef PLATFORM_OS_XP
++typedef struct _NDIS_802_11_PMKID {
++ u32 Length;
++ u32 BSSIDInfoCount;
++ BSSIDInfo BSSIDInfo[1];
++} NDIS_802_11_PMKID, *PNDIS_802_11_PMKID;
++#endif
++
++
++#ifdef PLATFORM_WINDOWS
++u8 rtw_set_802_11_reload_defaults(_adapter * padapter, NDIS_802_11_RELOAD_DEFAULTS reloadDefaults);
++u8 rtw_set_802_11_test(_adapter * padapter, NDIS_802_11_TEST * test);
++u8 rtw_set_802_11_pmkid(_adapter *pdapter, NDIS_802_11_PMKID *pmkid);
++
++u8 rtw_pnp_set_power_sleep(_adapter* padapter);
++u8 rtw_pnp_set_power_wakeup(_adapter* padapter);
++
++void rtw_pnp_resume_wk(void *context);
++void rtw_pnp_sleep_wk(void * context);
++
++#endif
++
++u8 rtw_set_802_11_add_key(_adapter * padapter, NDIS_802_11_KEY * key);
++u8 rtw_set_802_11_authentication_mode(_adapter *pdapter, NDIS_802_11_AUTHENTICATION_MODE authmode);
++u8 rtw_set_802_11_bssid(_adapter* padapter, u8 *bssid);
++u8 rtw_set_802_11_add_wep(_adapter * padapter, NDIS_802_11_WEP * wep);
++u8 rtw_set_802_11_disassociate(_adapter * padapter);
++u8 rtw_set_802_11_bssid_list_scan(_adapter* padapter, NDIS_802_11_SSID *pssid, int ssid_max_num);
++u8 rtw_set_802_11_infrastructure_mode(_adapter * padapter, NDIS_802_11_NETWORK_INFRASTRUCTURE networktype);
++u8 rtw_set_802_11_remove_wep(_adapter * padapter, u32 keyindex);
++u8 rtw_set_802_11_ssid(_adapter * padapter, NDIS_802_11_SSID * ssid);
++u8 rtw_set_802_11_connect(_adapter* padapter, u8 *bssid, NDIS_802_11_SSID *ssid);
++u8 rtw_set_802_11_remove_key(_adapter * padapter, NDIS_802_11_REMOVE_KEY * key);
++
++u8 rtw_validate_bssid(u8 *bssid);
++u8 rtw_validate_ssid(NDIS_802_11_SSID *ssid);
++
++u16 rtw_get_cur_max_rate(_adapter *adapter);
++int rtw_set_scan_mode(_adapter *adapter, RT_SCAN_TYPE scan_mode);
++int rtw_set_channel_plan(_adapter *adapter, u8 channel_plan);
++int rtw_set_country(_adapter *adapter, const char *country_code);
++int rtw_set_band(_adapter *adapter, enum _BAND band);
++
++#endif
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_io.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_io.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_io.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_io.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,504 @@
+/******************************************************************************
+ *
@@ -191801,489 +194115,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_io.h linux-rpi/
+*/
+
+#endif //_RTL8711_IO_H_
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_ioctl.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_ioctl.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_ioctl.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_ioctl.h 2015-08-26 10:26:08.761316441 +0200
-@@ -0,0 +1,268 @@
-+/******************************************************************************
-+ *
-+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of version 2 of the GNU General Public License as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-+ *
-+ *
-+ ******************************************************************************/
-+#ifndef _RTW_IOCTL_H_
-+#define _RTW_IOCTL_H_
-+
-+#include <drv_conf.h>
-+#include <osdep_service.h>
-+#include <drv_types.h>
-+
-+#ifndef OID_802_11_CAPABILITY
-+ #define OID_802_11_CAPABILITY 0x0d010122
-+#endif
-+
-+#ifndef OID_802_11_PMKID
-+ #define OID_802_11_PMKID 0x0d010123
-+#endif
-+
-+
-+// For DDK-defined OIDs
-+#define OID_NDIS_SEG1 0x00010100
-+#define OID_NDIS_SEG2 0x00010200
-+#define OID_NDIS_SEG3 0x00020100
-+#define OID_NDIS_SEG4 0x01010100
-+#define OID_NDIS_SEG5 0x01020100
-+#define OID_NDIS_SEG6 0x01020200
-+#define OID_NDIS_SEG7 0xFD010100
-+#define OID_NDIS_SEG8 0x0D010100
-+#define OID_NDIS_SEG9 0x0D010200
-+#define OID_NDIS_SEG10 0x0D020200
-+
-+#define SZ_OID_NDIS_SEG1 23
-+#define SZ_OID_NDIS_SEG2 3
-+#define SZ_OID_NDIS_SEG3 6
-+#define SZ_OID_NDIS_SEG4 6
-+#define SZ_OID_NDIS_SEG5 4
-+#define SZ_OID_NDIS_SEG6 8
-+#define SZ_OID_NDIS_SEG7 7
-+#define SZ_OID_NDIS_SEG8 36
-+#define SZ_OID_NDIS_SEG9 24
-+#define SZ_OID_NDIS_SEG10 19
-+
-+// For Realtek-defined OIDs
-+#define OID_MP_SEG1 0xFF871100
-+#define OID_MP_SEG2 0xFF818000
-+
-+#define OID_MP_SEG3 0xFF818700
-+#define OID_MP_SEG4 0xFF011100
-+
-+#define DEBUG_OID(dbg, str) \
-+ if((!dbg)) \
-+ { \
-+ RT_TRACE(_module_rtl871x_ioctl_c_,_drv_info_,("%s(%d): %s", __FUNCTION__, __LINE__, str)); \
-+ }
-+
-+
-+enum oid_type
-+{
-+ QUERY_OID,
-+ SET_OID
-+};
-+
-+struct oid_funs_node {
-+ unsigned int oid_start; //the starting number for OID
-+ unsigned int oid_end; //the ending number for OID
-+ struct oid_obj_priv *node_array;
-+ unsigned int array_sz; //the size of node_array
-+ int query_counter; //count the number of query hits for this segment
-+ int set_counter; //count the number of set hits for this segment
-+};
-+
-+struct oid_par_priv
-+{
-+ void *adapter_context;
-+ NDIS_OID oid;
-+ void *information_buf;
-+ u32 information_buf_len;
-+ u32 *bytes_rw;
-+ u32 *bytes_needed;
-+ enum oid_type type_of_oid;
-+ u32 dbg;
-+};
-+
-+struct oid_obj_priv {
-+ unsigned char dbg; // 0: without OID debug message 1: with OID debug message
-+ NDIS_STATUS (*oidfuns)(struct oid_par_priv *poid_par_priv);
-+};
-+
-+#if (defined(CONFIG_MP_INCLUDED) && defined(_RTW_MP_IOCTL_C_)) || \
-+ (defined(PLATFORM_WINDOWS) && defined(_RTW_IOCTL_RTL_C_))
-+static NDIS_STATUS oid_null_function(struct oid_par_priv* poid_par_priv)
-+{
-+ _func_enter_;
-+ _func_exit_;
-+ return NDIS_STATUS_SUCCESS;
-+}
-+#endif
-+
-+#ifdef PLATFORM_WINDOWS
-+
-+int TranslateNdisPsToRtPs(IN NDIS_802_11_POWER_MODE ndisPsMode);
-+
-+//OID Handler for Segment 1
-+NDIS_STATUS oid_gen_supported_list_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_gen_hardware_status_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_gen_media_supported_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_gen_media_in_use_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_gen_maximum_lookahead_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_gen_maximum_frame_size_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_gen_link_speed_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_gen_transmit_buffer_space_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_gen_receive_buffer_space_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_gen_transmit_block_size_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_gen_receive_block_size_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_gen_vendor_id_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_gen_vendor_description_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_gen_current_packet_filter_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_gen_current_lookahead_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_gen_driver_version_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_gen_maximum_total_size_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_gen_protocol_options_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_gen_mac_options_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_gen_media_connect_status_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_gen_maximum_send_packets_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_gen_vendor_driver_version_hdl(struct oid_par_priv* poid_par_priv);
-+
-+
-+//OID Handler for Segment 2
-+NDIS_STATUS oid_gen_physical_medium_hdl(struct oid_par_priv* poid_par_priv);
-+
-+//OID Handler for Segment 3
-+NDIS_STATUS oid_gen_xmit_ok_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_gen_rcv_ok_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_gen_xmit_error_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_gen_rcv_error_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_gen_rcv_no_buffer_hdl(struct oid_par_priv* poid_par_priv);
-+
-+
-+//OID Handler for Segment 4
-+NDIS_STATUS oid_802_3_permanent_address_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_3_current_address_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_3_multicast_list_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_3_maximum_list_size_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_3_mac_options_hdl(struct oid_par_priv* poid_par_priv);
-+
-+
-+
-+//OID Handler for Segment 5
-+NDIS_STATUS oid_802_3_rcv_error_alignment_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_3_xmit_one_collision_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_3_xmit_more_collisions_hdl(struct oid_par_priv* poid_par_priv);
-+
-+
-+//OID Handler for Segment 6
-+NDIS_STATUS oid_802_3_xmit_deferred_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_3_xmit_max_collisions_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_3_rcv_overrun_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_3_xmit_underrun_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_3_xmit_heartbeat_failure_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_3_xmit_times_crs_lost_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_3_xmit_late_collisions_hdl(struct oid_par_priv* poid_par_priv);
-+
-+
-+
-+//OID Handler for Segment 7
-+NDIS_STATUS oid_pnp_capabilities_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_pnp_set_power_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_pnp_query_power_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_pnp_add_wake_up_pattern_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_pnp_remove_wake_up_pattern_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_pnp_wake_up_pattern_list_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_pnp_enable_wake_up_hdl(struct oid_par_priv* poid_par_priv);
-+
-+
-+
-+//OID Handler for Segment 8
-+NDIS_STATUS oid_802_11_bssid_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_ssid_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_infrastructure_mode_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_add_wep_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_remove_wep_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_disassociate_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_authentication_mode_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_privacy_filter_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_bssid_list_scan_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_encryption_status_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_reload_defaults_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_add_key_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_remove_key_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_association_information_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_test_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_media_stream_mode_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_capability_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_pmkid_hdl(struct oid_par_priv* poid_par_priv);
-+
-+
-+
-+
-+
-+//OID Handler for Segment 9
-+NDIS_STATUS oid_802_11_network_types_supported_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_network_type_in_use_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_tx_power_level_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_rssi_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_rssi_trigger_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_fragmentation_threshold_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_rts_threshold_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_number_of_antennas_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_rx_antenna_selected_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_tx_antenna_selected_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_supported_rates_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_desired_rates_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_configuration_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_power_mode_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_802_11_bssid_list_hdl(struct oid_par_priv* poid_par_priv);
-+
-+
-+//OID Handler for Segment 10
-+NDIS_STATUS oid_802_11_statistics_hdl(struct oid_par_priv* poid_par_priv);
-+
-+
-+//OID Handler for Segment ED
-+NDIS_STATUS oid_rt_mh_vender_id_hdl(struct oid_par_priv* poid_par_priv);
-+
-+void Set_802_3_MULTICAST_LIST(ADAPTER *pAdapter, UCHAR *MCListbuf, ULONG MCListlen, BOOLEAN bAcceptAllMulticast);
-+
-+#endif// end of PLATFORM_WINDOWS
-+
-+
-+#if defined(PLATFORM_LINUX) && defined(CONFIG_WIRELESS_EXT)
-+extern struct iw_handler_def rtw_handlers_def;
-+#endif
-+
-+extern NDIS_STATUS drv_query_info(
-+ IN _nic_hdl MiniportAdapterContext,
-+ IN NDIS_OID Oid,
-+ IN void * InformationBuffer,
-+ IN u32 InformationBufferLength,
-+ OUT u32* BytesWritten,
-+ OUT u32* BytesNeeded
-+ );
-+
-+extern NDIS_STATUS drv_set_info(
-+ IN _nic_hdl MiniportAdapterContext,
-+ IN NDIS_OID Oid,
-+ IN void * InformationBuffer,
-+ IN u32 InformationBufferLength,
-+ OUT u32* BytesRead,
-+ OUT u32* BytesNeeded
-+ );
-+
-+#endif // #ifndef __INC_CEINFO_
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_query.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_query.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_query.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_query.h 2015-08-26 10:26:08.761316441 +0200
-@@ -0,0 +1,35 @@
-+/******************************************************************************
-+ *
-+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of version 2 of the GNU General Public License as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-+ *
-+ *
-+ ******************************************************************************/
-+#ifndef _RTW_IOCTL_QUERY_H_
-+#define _RTW_IOCTL_QUERY_H_
-+
-+#include <drv_conf.h>
-+#include <drv_types.h>
-+
-+
-+#ifdef PLATFORM_WINDOWS
-+
-+u8 query_802_11_capability(_adapter* padapter,u8* pucBuf,u32 * pulOutLen);
-+u8 query_802_11_association_information (_adapter * padapter, PNDIS_802_11_ASSOCIATION_INFORMATION pAssocInfo);
-+
-+#endif
-+
-+
-+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_rtl.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_rtl.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_rtl.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_rtl.h 2015-08-26 10:26:08.761316441 +0200
-@@ -0,0 +1,83 @@
-+/******************************************************************************
-+ *
-+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of version 2 of the GNU General Public License as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-+ *
-+ *
-+ ******************************************************************************/
-+#ifndef _RTW_IOCTL_RTL_H_
-+#define _RTW_IOCTL_RTL_H_
-+
-+#include <drv_conf.h>
-+#include <osdep_service.h>
-+#include <drv_types.h>
-+
-+//************** oid_rtl_seg_01_01 **************
-+NDIS_STATUS oid_rt_get_signal_quality_hdl(struct oid_par_priv* poid_par_priv);//84
-+NDIS_STATUS oid_rt_get_small_packet_crc_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_get_middle_packet_crc_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_get_large_packet_crc_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_get_tx_retry_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_get_rx_retry_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_get_rx_total_packet_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_get_tx_beacon_ok_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_get_tx_beacon_err_hdl(struct oid_par_priv* poid_par_priv);
-+
-+NDIS_STATUS oid_rt_pro_set_fw_dig_state_hdl(struct oid_par_priv* poid_par_priv); //8a
-+NDIS_STATUS oid_rt_pro_set_fw_ra_state_hdl(struct oid_par_priv* poid_par_priv); //8b
-+
-+NDIS_STATUS oid_rt_get_rx_icv_err_hdl(struct oid_par_priv* poid_par_priv);//93
-+NDIS_STATUS oid_rt_set_encryption_algorithm_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_get_preamble_mode_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_get_ap_ip_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_get_channelplan_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_set_channelplan_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_set_preamble_mode_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_set_bcn_intvl_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_dedicate_probe_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_get_total_tx_bytes_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_get_total_rx_bytes_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_current_tx_power_level_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_get_enc_key_mismatch_count_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_get_enc_key_match_count_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_get_channel_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_get_hardware_radio_off_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_get_key_mismatch_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_supported_wireless_mode_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_get_channel_list_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_get_scan_in_progress_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_forced_data_rate_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_wireless_mode_for_scan_list_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_get_bss_wireless_mode_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_scan_with_magic_packet_hdl(struct oid_par_priv* poid_par_priv);
-+
-+//************** oid_rtl_seg_01_03 section start **************
-+NDIS_STATUS oid_rt_ap_get_associated_station_list_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_ap_switch_into_ap_mode_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_ap_supported_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_ap_set_passphrase_hdl(struct oid_par_priv* poid_par_priv);
-+
-+// oid_rtl_seg_01_11
-+NDIS_STATUS oid_rt_pro_rf_write_registry_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_pro_rf_read_registry_hdl(struct oid_par_priv* poid_par_priv);
-+
-+//************** oid_rtl_seg_03_00 section start **************
-+NDIS_STATUS oid_rt_get_connect_state_hdl(struct oid_par_priv* poid_par_priv);
-+NDIS_STATUS oid_rt_set_default_key_id_hdl(struct oid_par_priv* poid_par_priv);
-+
-+
-+
-+
-+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_set.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_set.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_set.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_set.h 2015-08-26 10:26:08.761316441 +0200
-@@ -0,0 +1,78 @@
-+/******************************************************************************
-+ *
-+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of version 2 of the GNU General Public License as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-+ *
-+ *
-+ ******************************************************************************/
-+#ifndef __RTW_IOCTL_SET_H_
-+#define __RTW_IOCTL_SET_H_
-+
-+#include <drv_conf.h>
-+#include <drv_types.h>
-+
-+
-+typedef u8 NDIS_802_11_PMKID_VALUE[16];
-+
-+typedef struct _BSSIDInfo {
-+ NDIS_802_11_MAC_ADDRESS BSSID;
-+ NDIS_802_11_PMKID_VALUE PMKID;
-+} BSSIDInfo, *PBSSIDInfo;
-+
-+
-+#ifdef PLATFORM_OS_XP
-+typedef struct _NDIS_802_11_PMKID {
-+ u32 Length;
-+ u32 BSSIDInfoCount;
-+ BSSIDInfo BSSIDInfo[1];
-+} NDIS_802_11_PMKID, *PNDIS_802_11_PMKID;
-+#endif
-+
-+
-+#ifdef PLATFORM_WINDOWS
-+u8 rtw_set_802_11_reload_defaults(_adapter * padapter, NDIS_802_11_RELOAD_DEFAULTS reloadDefaults);
-+u8 rtw_set_802_11_test(_adapter * padapter, NDIS_802_11_TEST * test);
-+u8 rtw_set_802_11_pmkid(_adapter *pdapter, NDIS_802_11_PMKID *pmkid);
-+
-+u8 rtw_pnp_set_power_sleep(_adapter* padapter);
-+u8 rtw_pnp_set_power_wakeup(_adapter* padapter);
-+
-+void rtw_pnp_resume_wk(void *context);
-+void rtw_pnp_sleep_wk(void * context);
-+
-+#endif
-+
-+u8 rtw_set_802_11_add_key(_adapter * padapter, NDIS_802_11_KEY * key);
-+u8 rtw_set_802_11_authentication_mode(_adapter *pdapter, NDIS_802_11_AUTHENTICATION_MODE authmode);
-+u8 rtw_set_802_11_bssid(_adapter* padapter, u8 *bssid);
-+u8 rtw_set_802_11_add_wep(_adapter * padapter, NDIS_802_11_WEP * wep);
-+u8 rtw_set_802_11_disassociate(_adapter * padapter);
-+u8 rtw_set_802_11_bssid_list_scan(_adapter* padapter, NDIS_802_11_SSID *pssid, int ssid_max_num);
-+u8 rtw_set_802_11_infrastructure_mode(_adapter * padapter, NDIS_802_11_NETWORK_INFRASTRUCTURE networktype);
-+u8 rtw_set_802_11_remove_wep(_adapter * padapter, u32 keyindex);
-+u8 rtw_set_802_11_ssid(_adapter * padapter, NDIS_802_11_SSID * ssid);
-+u8 rtw_set_802_11_connect(_adapter* padapter, u8 *bssid, NDIS_802_11_SSID *ssid);
-+u8 rtw_set_802_11_remove_key(_adapter * padapter, NDIS_802_11_REMOVE_KEY * key);
-+
-+u8 rtw_validate_bssid(u8 *bssid);
-+u8 rtw_validate_ssid(NDIS_802_11_SSID *ssid);
-+
-+u16 rtw_get_cur_max_rate(_adapter *adapter);
-+int rtw_set_scan_mode(_adapter *adapter, RT_SCAN_TYPE scan_mode);
-+int rtw_set_channel_plan(_adapter *adapter, u8 channel_plan);
-+int rtw_set_country(_adapter *adapter, const char *country_code);
-+int rtw_set_band(_adapter *adapter, enum _BAND band);
-+
-+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_iol.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_iol.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_iol.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_iol.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_iol.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_iol.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_iol.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_iol.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,89 @@
+/******************************************************************************
+ *
@@ -192374,9 +194208,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_iol.h linux-rpi
+bool rtw_IOL_applied(ADAPTER *adapter);
+
+#endif //__RTW_IOL_H_
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_led.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_led.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_led.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_led.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_led.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_led.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_led.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_led.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,216 @@
+/******************************************************************************
+ *
@@ -192594,856 +194428,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_led.h linux-rpi
+extern void BlinkHandler(PLED_871x pLed);
+
+#endif //__RTW_LED_H_
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_mlme.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_mlme.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_mlme.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_mlme.h 2015-08-26 10:26:08.761316441 +0200
-@@ -0,0 +1,843 @@
-+/******************************************************************************
-+ *
-+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of version 2 of the GNU General Public License as
-+ * published by the Free Software Foundation.
-+ *
-+ * This program is distributed in the hope that it will be useful, but WITHOUT
-+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along with
-+ * this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-+ *
-+ *
-+ ******************************************************************************/
-+#ifndef __RTW_MLME_H_
-+#define __RTW_MLME_H_
-+
-+#include <drv_conf.h>
-+#include <osdep_service.h>
-+#include <mlme_osdep.h>
-+#include <drv_types.h>
-+#include <wlan_bssdef.h>
-+
-+#ifdef CONFIG_INTEL_WIDI
-+#include <rtw_intel_widi.h>
-+#endif
-+
-+#define MAX_BSS_CNT 128
-+//#define MAX_JOIN_TIMEOUT 2000
-+//#define MAX_JOIN_TIMEOUT 2500
-+#define MAX_JOIN_TIMEOUT 6500
-+
-+// Commented by Albert 20101105
-+// Increase the scanning timeout because of increasing the SURVEY_TO value.
-+
-+#define SCANNING_TIMEOUT 8000
-+
-+#define SCAN_INTERVAL (30) // unit:2sec, 30*2=60sec
-+
-+#ifdef PALTFORM_OS_WINCE
-+#define SCANQUEUE_LIFETIME 12000000 // unit:us
-+#else
-+#define SCANQUEUE_LIFETIME 20 // unit:sec
-+#endif
-+
-+#define WIFI_NULL_STATE 0x00000000
-+
-+#define WIFI_ASOC_STATE 0x00000001 // Under Linked state...
-+#define WIFI_REASOC_STATE 0x00000002
-+#define WIFI_SLEEP_STATE 0x00000004
-+#define WIFI_STATION_STATE 0x00000008
-+
-+#define WIFI_AP_STATE 0x00000010
-+#define WIFI_ADHOC_STATE 0x00000020
-+#define WIFI_ADHOC_MASTER_STATE 0x00000040
-+#define WIFI_UNDER_LINKING 0x00000080
-+
-+#define WIFI_UNDER_WPS 0x00000100
-+//#define WIFI_UNDER_CMD 0x00000200
-+//#define WIFI_UNDER_P2P 0x00000400
-+#define WIFI_STA_ALIVE_CHK_STATE 0x00000400
-+#define WIFI_SITE_MONITOR 0x00000800 //to indicate the station is under site surveying
-+
-+#ifdef WDS
-+#define WIFI_WDS 0x00001000
-+#define WIFI_WDS_RX_BEACON 0x00002000 // already rx WDS AP beacon
-+#endif
-+#ifdef AUTO_CONFIG
-+#define WIFI_AUTOCONF 0x00004000
-+#define WIFI_AUTOCONF_IND 0x00008000
-+#endif
-+
-+/*
-+// ========== P2P Section Start ===============
-+#define WIFI_P2P_LISTEN_STATE 0x00010000
-+#define WIFI_P2P_GROUP_FORMATION_STATE 0x00020000
-+// ========== P2P Section End ===============
-+*/
-+
-+//#ifdef UNDER_MPTEST
-+#define WIFI_MP_STATE 0x00010000
-+#define WIFI_MP_CTX_BACKGROUND 0x00020000 // in continous tx background
-+#define WIFI_MP_CTX_ST 0x00040000 // in continous tx with single-tone
-+#define WIFI_MP_CTX_BACKGROUND_PENDING 0x00080000 // pending in continous tx background due to out of skb
-+#define WIFI_MP_CTX_CCK_HW 0x00100000 // in continous tx
-+#define WIFI_MP_CTX_CCK_CS 0x00200000 // in continous tx with carrier suppression
-+#define WIFI_MP_LPBK_STATE 0x00400000
-+//#endif
-+
-+//#define _FW_UNDER_CMD WIFI_UNDER_CMD
-+#define _FW_UNDER_LINKING WIFI_UNDER_LINKING
-+#define _FW_LINKED WIFI_ASOC_STATE
-+#define _FW_UNDER_SURVEY WIFI_SITE_MONITOR
-+
-+
-+enum dot11AuthAlgrthmNum {
-+ dot11AuthAlgrthm_Open = 0,
-+ dot11AuthAlgrthm_Shared,
-+ dot11AuthAlgrthm_8021X,
-+ dot11AuthAlgrthm_Auto,
-+ dot11AuthAlgrthm_MaxNum
-+};
-+
-+// Scan type including active and passive scan.
-+typedef enum _RT_SCAN_TYPE
-+{
-+ SCAN_PASSIVE,
-+ SCAN_ACTIVE,
-+ SCAN_MIX,
-+}RT_SCAN_TYPE, *PRT_SCAN_TYPE;
-+
-+enum DriverInterface {
-+ DRIVER_WEXT = 1,
-+ DRIVER_CFG80211 = 2
-+};
-+
-+enum _BAND
-+{
-+ GHZ24_50 = 0,
-+ GHZ_50,
-+ GHZ_24,
-+ GHZ_MAX,
-+};
-+
-+#define rtw_band_valid(band) ((band) >= GHZ24_50 && (band) < GHZ_MAX)
-+
-+enum SCAN_RESULT_TYPE
-+{
-+ SCAN_RESULT_P2P_ONLY = 0, // Will return all the P2P devices.
-+ SCAN_RESULT_ALL = 1, // Will return all the scanned device, include AP.
-+ SCAN_RESULT_WFD_TYPE = 2 // Will just return the correct WFD device.
-+ // If this device is Miracast sink device, it will just return all the Miracast source devices.
-+};
-+
-+/*
-+
-+there are several "locks" in mlme_priv,
-+since mlme_priv is a shared resource between many threads,
-+like ISR/Call-Back functions, the OID handlers, and even timer functions.
-+
-+
-+Each _queue has its own locks, already.
-+Other items are protected by mlme_priv.lock.
-+
-+To avoid possible dead lock, any thread trying to modifiying mlme_priv
-+SHALL not lock up more than one locks at a time!
-+
-+*/
-+
-+
-+#define traffic_threshold 10
-+#define traffic_scan_period 500
-+
-+struct sitesurvey_ctrl {
-+ u64 last_tx_pkts;
-+ uint last_rx_pkts;
-+ sint traffic_busy;
-+ _timer sitesurvey_ctrl_timer;
-+};
-+
-+typedef struct _RT_LINK_DETECT_T{
-+ u32 NumTxOkInPeriod;
-+ u32 NumRxOkInPeriod;
-+ u32 NumRxUnicastOkInPeriod;
-+ BOOLEAN bBusyTraffic;
-+ BOOLEAN bTxBusyTraffic;
-+ BOOLEAN bRxBusyTraffic;
-+ BOOLEAN bHigherBusyTraffic; // For interrupt migration purpose.
-+ BOOLEAN bHigherBusyRxTraffic; // We may disable Tx interrupt according as Rx traffic.
-+ BOOLEAN bHigherBusyTxTraffic; // We may disable Tx interrupt according as Tx traffic.
-+}RT_LINK_DETECT_T, *PRT_LINK_DETECT_T;
-+
-+struct profile_info {
-+ u8 ssidlen;
-+ u8 ssid[ WLAN_SSID_MAXLEN ];
-+ u8 peermac[ ETH_ALEN ];
-+};
-+
-+struct tx_invite_req_info{
-+ u8 token;
-+ u8 benable;
-+ u8 go_ssid[ WLAN_SSID_MAXLEN ];
-+ u8 ssidlen;
-+ u8 go_bssid[ ETH_ALEN ];
-+ u8 peer_macaddr[ ETH_ALEN ];
-+ u8 operating_ch; // This information will be set by using the p2p_set op_ch=x
-+ u8 peer_ch; // The listen channel for peer P2P device
-+
-+};
-+
-+struct tx_invite_resp_info{
-+ u8 token; // Used to record the dialog token of p2p invitation request frame.
-+};
-+
-+#ifdef CONFIG_WFD
-+
-+struct wifi_display_info{
-+ u16 wfd_enable; // Eanble/Disable the WFD function.
-+ u16 rtsp_ctrlport; // TCP port number at which the this WFD device listens for RTSP messages
-+ u16 peer_rtsp_ctrlport; // TCP port number at which the peer WFD device listens for RTSP messages
-+ // This filed should be filled when receiving the gropu negotiation request
-+
-+ u8 peer_session_avail; // WFD session is available or not for the peer wfd device.
-+ // This variable will be set when sending the provisioning discovery request to peer WFD device.
-+ // And this variable will be reset when it is read by using the iwpriv p2p_get wfd_sa command.
-+
-+ u8 ip_address[4];
-+ u8 peer_ip_address[4];
-+ u8 wfd_pc; // WFD preferred connection
-+ // 0 -> Prefer to use the P2P for WFD connection on peer side.
-+ // 1 -> Prefer to use the TDLS for WFD connection on peer side.
-+
-+ u8 wfd_device_type; // WFD Device Type
-+ // 0 -> WFD Source Device
-+ // 1 -> WFD Primary Sink Device
-+ enum SCAN_RESULT_TYPE scan_result_type; // Used when P2P is enable. This parameter will impact the scan result.
-+};
-+#endif //CONFIG_WFD
-+
-+struct tx_provdisc_req_info{
-+ u16 wps_config_method_request; // Used when sending the provisioning request frame
-+ u16 peer_channel_num[2]; // The channel number which the receiver stands.
-+ NDIS_802_11_SSID ssid;
-+ u8 peerDevAddr[ ETH_ALEN ]; // Peer device address
-+ u8 peerIFAddr[ ETH_ALEN ]; // Peer interface address
-+ u8 benable; // This provision discovery request frame is trigger to send or not
-+};
-+
-+struct rx_provdisc_req_info{ //When peer device issue prov_disc_req first, we should store the following informations
-+ u8 peerDevAddr[ ETH_ALEN ]; // Peer device address
-+ u8 strconfig_method_desc_of_prov_disc_req[4]; // description for the config method located in the provisioning discovery request frame.
-+ // The UI must know this information to know which config method the remote p2p device is requiring.
-+};
-+
-+struct tx_nego_req_info{
-+ u16 peer_channel_num[2]; // The channel number which the receiver stands.
-+ u8 peerDevAddr[ ETH_ALEN ]; // Peer device address
-+ u8 benable; // This negoitation request frame is trigger to send or not
-+};
-+
-+struct group_id_info{
-+ u8 go_device_addr[ ETH_ALEN ]; // The GO's device address of this P2P group
-+ u8 ssid[ WLAN_SSID_MAXLEN ]; // The SSID of this P2P group
-+};
-+
-+struct scan_limit_info{
-+ u8 scan_op_ch_only; // When this flag is set, the driver should just scan the operation channel
-+#ifndef P2P_OP_CHECK_SOCIAL_CH
-+ u8 operation_ch[2]; // Store the operation channel of invitation request frame
-+#else
-+ u8 operation_ch[5]; // Store additional channel 1,6,11 for Android 4.2 IOT & Nexus 4
-+#endif //P2P_OP_CHECK_SOCIAL_CH
-+};
-+
-+#ifdef CONFIG_IOCTL_CFG80211
-+struct cfg80211_wifidirect_info{
-+ _timer remain_on_ch_timer;
-+ u8 restore_channel;
-+ struct ieee80211_channel remain_on_ch_channel;
-+ enum nl80211_channel_type remain_on_ch_type;
-+ u64 remain_on_ch_cookie;
-+ bool is_ro_ch;
-+};
-+#endif //CONFIG_IOCTL_CFG80211
-+
-+struct wifidirect_info{
-+ _adapter* padapter;
-+ _timer find_phase_timer;
-+ _timer restore_p2p_state_timer;
-+
-+ // Used to do the scanning. After confirming the peer is availalble, the driver transmits the P2P frame to peer.
-+ _timer pre_tx_scan_timer;
-+ _timer reset_ch_sitesurvey;
-+ _timer reset_ch_sitesurvey2; // Just for resetting the scan limit function by using p2p nego
-+#ifdef CONFIG_CONCURRENT_MODE
-+ // Used to switch the channel between legacy AP and listen state.
-+ _timer ap_p2p_switch_timer;
-+#endif
-+ struct tx_provdisc_req_info tx_prov_disc_info;
-+ struct rx_provdisc_req_info rx_prov_disc_info;
-+ struct tx_invite_req_info invitereq_info;
-+ struct profile_info profileinfo[ P2P_MAX_PERSISTENT_GROUP_NUM ]; // Store the profile information of persistent group
-+ struct tx_invite_resp_info inviteresp_info;
-+ struct tx_nego_req_info nego_req_info;
-+ struct group_id_info groupid_info; // Store the group id information when doing the group negotiation handshake.
-+ struct scan_limit_info rx_invitereq_info; // Used for get the limit scan channel from the Invitation procedure
-+ struct scan_limit_info p2p_info; // Used for get the limit scan channel from the P2P negotiation handshake
-+#ifdef CONFIG_WFD
-+ struct wifi_display_info *wfd_info;
-+#endif
-+ enum P2P_ROLE role;
-+ enum P2P_STATE pre_p2p_state;
-+ enum P2P_STATE p2p_state;
-+ u8 device_addr[ETH_ALEN]; // The device address should be the mac address of this device.
-+ u8 interface_addr[ETH_ALEN];
-+ u8 social_chan[4];
-+ u8 listen_channel;
-+ u8 operating_channel;
-+ u8 listen_dwell; // This value should be between 1 and 3
-+ u8 support_rate[8];
-+ u8 p2p_wildcard_ssid[P2P_WILDCARD_SSID_LEN];
-+ u8 intent; // should only include the intent value.
-+ u8 p2p_peer_interface_addr[ ETH_ALEN ];
-+ u8 p2p_peer_device_addr[ ETH_ALEN ];
-+ u8 peer_intent; // Included the intent value and tie breaker value.
-+ u8 device_name[ WPS_MAX_DEVICE_NAME_LEN ]; // Device name for displaying on searching device screen
-+ u8 device_name_len;
-+ u8 profileindex; // Used to point to the index of profileinfo array
-+ u8 peer_operating_ch;
-+ u8 find_phase_state_exchange_cnt;
-+ u16 device_password_id_for_nego; // The device password ID for group negotation
-+ u8 negotiation_dialog_token;
-+ u8 nego_ssid[ WLAN_SSID_MAXLEN ]; // SSID information for group negotitation
-+ u8 nego_ssidlen;
-+ u8 p2p_group_ssid[WLAN_SSID_MAXLEN];
-+ u8 p2p_group_ssid_len;
-+ u8 persistent_supported; // Flag to know the persistent function should be supported or not.
-+ // In the Sigma test, the Sigma will provide this enable from the sta_set_p2p CAPI.
-+ // 0: disable
-+ // 1: enable
-+ u8 session_available; // Flag to set the WFD session available to enable or disable "by Sigma"
-+ // In the Sigma test, the Sigma will disable the session available by using the sta_preset CAPI.
-+ // 0: disable
-+ // 1: enable
-+ u8 wfd_tdls_enable; // Flag to enable or disable the TDLS by WFD Sigma
-+ // 0: disable
-+ // 1: enable
-+ u8 wfd_tdls_weaksec; // Flag to enable or disable the weak security function for TDLS by WFD Sigma
-+ // 0: disable
-+ // In this case, the driver can't issue the tdsl setup request frame.
-+ // 1: enable
-+ // In this case, the driver can issue the tdls setup request frame
-+ // even the current security is weak security.
-+
-+ enum P2P_WPSINFO ui_got_wps_info; // This field will store the WPS value (PIN value or PBC) that UI had got from the user.
-+ u16 supported_wps_cm; // This field describes the WPS config method which this driver supported.
-+ // The value should be the combination of config method defined in page104 of WPS v2.0 spec.
-+ u8 external_uuid; // UUID flag
-+ u8 uuid[16]; // UUID
-+ uint channel_list_attr_len; // This field will contain the length of body of P2P Channel List attribute of group negotitation response frame.
-+ u8 channel_list_attr[100]; // This field will contain the body of P2P Channel List attribute of group negotitation response frame.
-+ // We will use the channel_cnt and channel_list fields when constructing the group negotitation confirm frame.
-+ u8 driver_interface; // Indicate DRIVER_WEXT or DRIVER_CFG80211
-+
-+#ifdef CONFIG_CONCURRENT_MODE
-+ u16 ext_listen_interval; // The interval to be available with legacy AP (ms)
-+ u16 ext_listen_period; // The time period to be available for P2P listen state (ms)
-+#endif
-+#ifdef CONFIG_P2P_PS
-+ enum P2P_PS_MODE p2p_ps_mode; // indicate p2p ps mode
-+ enum P2P_PS_STATE p2p_ps_state; // indicate p2p ps state
-+ u8 noa_index; // Identifies and instance of Notice of Absence timing.
-+ u8 ctwindow; // Client traffic window. A period of time in TU after TBTT.
-+ u8 opp_ps; // opportunistic power save.
-+ u8 noa_num; // number of NoA descriptor in P2P IE.
-+ u8 noa_count[P2P_MAX_NOA_NUM]; // Count for owner, Type of client.
-+ u32 noa_duration[P2P_MAX_NOA_NUM]; // Max duration for owner, preferred or min acceptable duration for client.
-+ u32 noa_interval[P2P_MAX_NOA_NUM]; // Length of interval for owner, preferred or max acceptable interval of client.
-+ u32 noa_start_time[P2P_MAX_NOA_NUM]; // schedule expressed in terms of the lower 4 bytes of the TSF timer.
-+#endif // CONFIG_P2P_PS
-+};
-+
-+struct tdls_ss_record{ //signal strength record; recording the tdls sta with lowerest ss
-+ u8 macaddr[ETH_ALEN];
-+ u8 RxPWDBAll;
-+ u8 is_tdls_sta; // _TRUE: direct link sta, _FALSE: else
-+};
-+
-+struct tdls_info{
-+ u8 ap_prohibited;
-+ uint setup_state;
-+ u8 sta_cnt;
-+ u8 sta_maximum; // 1:tdls sta is equal (NUM_STA-1), reach max direct link number; 0: else;
-+ struct tdls_ss_record ss_record;
-+ u8 macid_index; //macid entry that is ready to write
-+ u8 clear_cam; //cam entry that is trying to clear, using it in direct link teardown
-+ u8 ch_sensing;
-+ u8 cur_channel;
-+ u8 candidate_ch;
-+ u8 collect_pkt_num[MAX_CHANNEL_NUM];
-+ _lock cmd_lock;
-+ _lock hdl_lock;
-+ u8 watchdog_count;
-+ u8 dev_discovered; //WFD_TDLS: for sigma test
-+ u8 enable;
-+#ifdef CONFIG_WFD
-+ struct wifi_display_info *wfd_info;
-+#endif
-+};
-+
-+struct mlme_priv {
-+
-+ _lock lock;
-+ sint fw_state; //shall we protect this variable? maybe not necessarily...
-+
-+ u8 to_join; //flag
-+ #ifdef CONFIG_LAYER2_ROAMING
-+ u8 to_roaming; // roaming trying times
-+ #endif
-+
-+ u8 *nic_hdl;
-+
-+ u8 not_indic_disco;
-+ _list *pscanned;
-+ _queue free_bss_pool;
-+ _queue scanned_queue;
-+ u8 *free_bss_buf;
-+ u32 num_of_scanned;
-+
-+ NDIS_802_11_SSID assoc_ssid;
-+ u8 assoc_bssid[6];
-+
-+ struct wlan_network cur_network;
-+
-+ //uint wireless_mode; no used, remove it
-+
-+ u32 scan_interval;
-+
-+ _timer assoc_timer;
-+
-+ uint assoc_by_bssid;
-+ uint assoc_by_rssi;
-+
-+ _timer scan_to_timer; // driver itself handles scan_timeout status.
-+ u32 scan_start_time; // used to evaluate the time spent in scanning
-+
-+ #ifdef CONFIG_SET_SCAN_DENY_TIMER
-+ _timer set_scan_deny_timer;
-+ ATOMIC_T set_scan_deny; //0: allowed, 1: deny
-+ #endif
-+
-+ struct qos_priv qospriv;
-+
-+#ifdef CONFIG_80211N_HT
-+
-+ /* Number of non-HT AP/stations */
-+ int num_sta_no_ht;
-+
-+ /* Number of HT AP/stations 20 MHz */
-+ //int num_sta_ht_20mhz;
-+
-+
-+ int num_FortyMHzIntolerant;
-+
-+ struct ht_priv htpriv;
-+
-+#endif
-+
-+ RT_LINK_DETECT_T LinkDetectInfo;
-+ _timer dynamic_chk_timer; //dynamic/periodic check timer
-+
-+ u8 acm_mask; // for wmm acm mask
-+ u8 ChannelPlan;
-+ RT_SCAN_TYPE scan_mode; // active: 1, passive: 0
-+
-+ //u8 probereq_wpsie[MAX_WPS_IE_LEN];//added in probe req
-+ //int probereq_wpsie_len;
-+ u8 *wps_probe_req_ie;
-+ u32 wps_probe_req_ie_len;
-+
-+#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME)
-+ /* Number of associated Non-ERP stations (i.e., stations using 802.11b
-+ * in 802.11g BSS) */
-+ int num_sta_non_erp;
-+
-+ /* Number of associated stations that do not support Short Slot Time */
-+ int num_sta_no_short_slot_time;
-+
-+ /* Number of associated stations that do not support Short Preamble */
-+ int num_sta_no_short_preamble;
-+
-+ int olbc; /* Overlapping Legacy BSS Condition */
-+
-+ /* Number of HT associated stations that do not support greenfield */
-+ int num_sta_ht_no_gf;
-+
-+ /* Number of associated non-HT stations */
-+ //int num_sta_no_ht;
-+
-+ /* Number of HT associated stations 20 MHz */
-+ int num_sta_ht_20mhz;
-+
-+ /* Overlapping BSS information */
-+ int olbc_ht;
-+
-+#ifdef CONFIG_80211N_HT
-+ u16 ht_op_mode;
-+#endif /* CONFIG_80211N_HT */
-+
-+ u8 *assoc_req;
-+ u32 assoc_req_len;
-+ u8 *assoc_rsp;
-+ u32 assoc_rsp_len;
-+
-+ u8 *wps_beacon_ie;
-+ //u8 *wps_probe_req_ie;
-+ u8 *wps_probe_resp_ie;
-+ u8 *wps_assoc_resp_ie; // for CONFIG_IOCTL_CFG80211, this IE could include p2p ie / wfd ie
-+
-+ u32 wps_beacon_ie_len;
-+ //u32 wps_probe_req_ie_len;
-+ u32 wps_probe_resp_ie_len;
-+ u32 wps_assoc_resp_ie_len; // for CONFIG_IOCTL_CFG80211, this IE len could include p2p ie / wfd ie
-+
-+ u8 *p2p_beacon_ie;
-+ u8 *p2p_probe_req_ie;
-+ u8 *p2p_probe_resp_ie;
-+ u8 *p2p_go_probe_resp_ie; //for GO
-+ u8 *p2p_assoc_req_ie;
-+
-+ u32 p2p_beacon_ie_len;
-+ u32 p2p_probe_req_ie_len;
-+ u32 p2p_probe_resp_ie_len;
-+ u32 p2p_go_probe_resp_ie_len; //for GO
-+ u32 p2p_assoc_req_ie_len;
-+/*
-+#if defined(CONFIG_P2P) && defined(CONFIG_IOCTL_CFG80211)
-+ //u8 *wps_p2p_beacon_ie;
-+ u8 *p2p_beacon_ie;
-+ u8 *wps_p2p_probe_resp_ie;
-+ u8 *wps_p2p_assoc_resp_ie;
-+ //u32 wps_p2p_beacon_ie_len;
-+ u32 p2p_beacon_ie_len;
-+ u32 wps_p2p_probe_resp_ie_len;
-+ u32 wps_p2p_assoc_resp_ie_len;
-+#endif
-+*/
-+
-+ _lock bcn_update_lock;
-+ u8 update_bcn;
-+
-+
-+#endif //#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME)
-+
-+#if defined(CONFIG_WFD) && defined(CONFIG_IOCTL_CFG80211)
-+
-+ u8 *wfd_beacon_ie;
-+ u8 *wfd_probe_req_ie;
-+ u8 *wfd_probe_resp_ie;
-+ u8 *wfd_go_probe_resp_ie; //for GO
-+ u8 *wfd_assoc_req_ie;
-+
-+ u32 wfd_beacon_ie_len;
-+ u32 wfd_probe_req_ie_len;
-+ u32 wfd_probe_resp_ie_len;
-+ u32 wfd_go_probe_resp_ie_len; //for GO
-+ u32 wfd_assoc_req_ie_len;
-+
-+#endif
-+
-+#ifdef RTK_DMP_PLATFORM
-+ // DMP kobject_hotplug function signal need in passive level
-+ _workitem Linkup_workitem;
-+ _workitem Linkdown_workitem;
-+#endif
-+
-+#ifdef CONFIG_INTEL_WIDI
-+ int widi_state;
-+ int listen_state;
-+ _timer listen_timer;
-+ ATOMIC_T rx_probe_rsp; // 1:receive probe respone from RDS source.
-+ u8 *l2sdTaBuffer;
-+ u8 channel_idx;
-+ s8 group_cnt; //For WiDi 3.5, they specified another scan algo. for WFD/RDS co-existed
-+ u8 sa_ext[L2SDTA_SERVICE_VE_LEN];
-+
-+ u8 widi_enable;
-+ /**
-+ * For WiDi 4; upper layer would set
-+ * p2p_primary_device_type_category_id
-+ * p2p_primary_device_type_sub_category_id
-+ * p2p_secondary_device_type_category_id
-+ * p2p_secondary_device_type_sub_category_id
-+ */
-+ u16 p2p_pdt_cid;
-+ u16 p2p_pdt_scid;
-+ u8 num_p2p_sdt;
-+ u16 p2p_sdt_cid[MAX_NUM_P2P_SDT];
-+ u16 p2p_sdt_scid[MAX_NUM_P2P_SDT];
-+ u8 p2p_reject_disable; //When starting NL80211 wpa_supplicant/hostapd, it will call netdev_close
-+ //such that it will cause p2p disabled. Use this flag to reject.
-+#endif // CONFIG_INTEL_WIDI
-+
-+#ifdef CONFIG_CONCURRENT_MODE
-+ u8 scanning_via_buddy_intf;
-+#endif
-+};
-+
-+#ifdef CONFIG_AP_MODE
-+
-+struct hostapd_priv
-+{
-+ _adapter *padapter;
-+
-+#ifdef CONFIG_HOSTAPD_MLME
-+ struct net_device *pmgnt_netdev;
-+ struct usb_anchor anchored;
-+#endif
-+
-+};
-+
-+extern int hostapd_mode_init(_adapter *padapter);
-+extern void hostapd_mode_unload(_adapter *padapter);
-+#endif
-+
-+
-+extern void rtw_joinbss_event_prehandle(_adapter *adapter, u8 *pbuf);
-+extern void rtw_survey_event_callback(_adapter *adapter, u8 *pbuf);
-+extern void rtw_surveydone_event_callback(_adapter *adapter, u8 *pbuf);
-+extern void rtw_joinbss_event_callback(_adapter *adapter, u8 *pbuf);
-+extern void rtw_stassoc_event_callback(_adapter *adapter, u8 *pbuf);
-+extern void rtw_stadel_event_callback(_adapter *adapter, u8 *pbuf);
-+extern void rtw_atimdone_event_callback(_adapter *adapter, u8 *pbuf);
-+extern void rtw_cpwm_event_callback(_adapter *adapter, u8 *pbuf);
-+
-+#ifdef PLATFORM_WINDOWS
-+extern thread_return event_thread(void *context);
-+
-+extern void rtw_join_timeout_handler (
-+ IN PVOID SystemSpecific1,
-+ IN PVOID FunctionContext,
-+ IN PVOID SystemSpecific2,
-+ IN PVOID SystemSpecific3
-+ );
-+
-+extern void _rtw_scan_timeout_handler (
-+ IN PVOID SystemSpecific1,
-+ IN PVOID FunctionContext,
-+ IN PVOID SystemSpecific2,
-+ IN PVOID SystemSpecific3
-+ );
-+
-+#endif
-+
-+#if defined (PLATFORM_LINUX)|| defined (PLATFORM_FREEBSD)
-+extern int event_thread(void *context);
-+extern void rtw_join_timeout_handler(void* FunctionContext);
-+extern void _rtw_scan_timeout_handler(void* FunctionContext);
-+#endif
-+
-+extern void rtw_free_network_queue(_adapter *adapter,u8 isfreeall);
-+extern int rtw_init_mlme_priv(_adapter *adapter);// (struct mlme_priv *pmlmepriv);
-+
-+extern void rtw_free_mlme_priv (struct mlme_priv *pmlmepriv);
-+
-+
-+extern sint rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv);
-+extern sint rtw_set_key(_adapter *adapter,struct security_priv *psecuritypriv,sint keyid, u8 set_tx);
-+extern sint rtw_set_auth(_adapter *adapter,struct security_priv *psecuritypriv);
-+
-+__inline static u8 *get_bssid(struct mlme_priv *pmlmepriv)
-+{ //if sta_mode:pmlmepriv->cur_network.network.MacAddress=> bssid
-+ // if adhoc_mode:pmlmepriv->cur_network.network.MacAddress=> ibss mac address
-+ return pmlmepriv->cur_network.network.MacAddress;
-+}
-+
-+__inline static sint check_fwstate(struct mlme_priv *pmlmepriv, sint state)
-+{
-+ if (pmlmepriv->fw_state & state)
-+ return _TRUE;
-+
-+ return _FALSE;
-+}
-+
-+__inline static sint get_fwstate(struct mlme_priv *pmlmepriv)
-+{
-+ return pmlmepriv->fw_state;
-+}
-+
-+/*
-+ * No Limit on the calling context,
-+ * therefore set it to be the critical section...
-+ *
-+ * ### NOTE:#### (!!!!)
-+ * MUST TAKE CARE THAT BEFORE CALLING THIS FUNC, YOU SHOULD HAVE LOCKED pmlmepriv->lock
-+ */
-+__inline static void set_fwstate(struct mlme_priv *pmlmepriv, sint state)
-+{
-+ pmlmepriv->fw_state |= state;
-+}
-+
-+__inline static void _clr_fwstate_(struct mlme_priv *pmlmepriv, sint state)
-+{
-+ pmlmepriv->fw_state &= ~state;
-+}
-+
-+/*
-+ * No Limit on the calling context,
-+ * therefore set it to be the critical section...
-+ */
-+__inline static void clr_fwstate(struct mlme_priv *pmlmepriv, sint state)
-+{
-+ _irqL irqL;
-+
-+ _enter_critical_bh(&pmlmepriv->lock, &irqL);
-+ if (check_fwstate(pmlmepriv, state) == _TRUE)
-+ pmlmepriv->fw_state ^= state;
-+ _exit_critical_bh(&pmlmepriv->lock, &irqL);
-+}
-+
-+__inline static void clr_fwstate_ex(struct mlme_priv *pmlmepriv, sint state)
-+{
-+ _irqL irqL;
-+
-+ _enter_critical_bh(&pmlmepriv->lock, &irqL);
-+ _clr_fwstate_(pmlmepriv, state);
-+ _exit_critical_bh(&pmlmepriv->lock, &irqL);
-+}
-+
-+__inline static void up_scanned_network(struct mlme_priv *pmlmepriv)
-+{
-+ _irqL irqL;
-+
-+ _enter_critical_bh(&pmlmepriv->lock, &irqL);
-+ pmlmepriv->num_of_scanned++;
-+ _exit_critical_bh(&pmlmepriv->lock, &irqL);
-+}
-+
-+#ifdef CONFIG_CONCURRENT_MODE
-+sint rtw_buddy_adapter_up(_adapter *padapter);
-+sint check_buddy_fwstate(_adapter *padapter, sint state);
-+#endif //CONFIG_CONCURRENT_MODE
-+
-+__inline static void down_scanned_network(struct mlme_priv *pmlmepriv)
-+{
-+ _irqL irqL;
-+
-+ _enter_critical_bh(&pmlmepriv->lock, &irqL);
-+ pmlmepriv->num_of_scanned--;
-+ _exit_critical_bh(&pmlmepriv->lock, &irqL);
-+}
-+
-+__inline static void set_scanned_network_val(struct mlme_priv *pmlmepriv, sint val)
-+{
-+ _irqL irqL;
-+
-+ _enter_critical_bh(&pmlmepriv->lock, &irqL);
-+ pmlmepriv->num_of_scanned = val;
-+ _exit_critical_bh(&pmlmepriv->lock, &irqL);
-+}
-+
-+extern u16 rtw_get_capability(WLAN_BSSID_EX *bss);
-+extern void rtw_update_scanned_network(_adapter *adapter, WLAN_BSSID_EX *target);
-+extern void rtw_disconnect_hdl_under_linked(_adapter* adapter, struct sta_info *psta, u8 free_assoc);
-+extern void rtw_generate_random_ibss(u8 *pibss);
-+extern struct wlan_network* rtw_find_network(_queue *scanned_queue, u8 *addr);
-+extern struct wlan_network* rtw_get_oldest_wlan_network(_queue *scanned_queue);
-+
-+extern void rtw_free_assoc_resources(_adapter* adapter, int lock_scanned_queue);
-+extern void rtw_indicate_disconnect(_adapter* adapter);
-+extern void rtw_indicate_connect(_adapter* adapter);
-+void rtw_indicate_scan_done( _adapter *padapter, bool aborted);
-+void rtw_scan_abort(_adapter *adapter);
-+
-+extern int rtw_restruct_sec_ie(_adapter *adapter,u8 *in_ie,u8 *out_ie,uint in_len);
-+extern int rtw_restruct_wmm_ie(_adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_len, uint initial_out_len);
-+extern void rtw_init_registrypriv_dev_network(_adapter *adapter);
-+
-+extern void rtw_update_registrypriv_dev_network(_adapter *adapter);
-+
-+extern void rtw_get_encrypt_decrypt_from_registrypriv(_adapter *adapter);
-+
-+extern void _rtw_join_timeout_handler(_adapter *adapter);
-+extern void rtw_scan_timeout_handler(_adapter *adapter);
-+
-+extern void rtw_dynamic_check_timer_handlder(_adapter *adapter);
-+#ifdef CONFIG_SET_SCAN_DENY_TIMER
-+bool rtw_is_scan_deny(_adapter *adapter);
-+void rtw_clear_scan_deny(_adapter *adapter);
-+void rtw_set_scan_deny_timer_hdl(_adapter *adapter);
-+void rtw_set_scan_deny(_adapter *adapter, u32 ms);
-+#else
-+#define rtw_is_scan_deny(adapter) _FALSE
-+#define rtw_clear_scan_deny(adapter) do {} while (0)
-+#define rtw_set_scan_deny_timer_hdl(adapter) do {} while (0)
-+#define rtw_set_scan_deny(adapter, ms) do {} while (0)
-+#endif
-+
-+
-+extern int _rtw_init_mlme_priv(_adapter *padapter);
-+
-+void rtw_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv);
-+
-+extern void _rtw_free_mlme_priv(struct mlme_priv *pmlmepriv);
-+
-+extern int _rtw_enqueue_network(_queue *queue, struct wlan_network *pnetwork);
-+
-+extern struct wlan_network* _rtw_dequeue_network(_queue *queue);
-+
-+extern struct wlan_network* _rtw_alloc_network(struct mlme_priv *pmlmepriv);
-+
-+
-+extern void _rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork, u8 isfreeall);
-+extern void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork);
-+
-+
-+extern struct wlan_network* _rtw_find_network(_queue *scanned_queue, u8 *addr);
-+
-+extern void _rtw_free_network_queue(_adapter* padapter, u8 isfreeall);
-+
-+extern sint rtw_if_up(_adapter *padapter);
-+
-+
-+u8 *rtw_get_capability_from_ie(u8 *ie);
-+u8 *rtw_get_timestampe_from_ie(u8 *ie);
-+u8 *rtw_get_beacon_interval_from_ie(u8 *ie);
-+
-+
-+void rtw_joinbss_reset(_adapter *padapter);
-+
-+#ifdef CONFIG_80211N_HT
-+unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, uint in_len, uint *pout_len, u8 channel);
-+void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len, u8 channel);
-+void rtw_issue_addbareq_cmd(_adapter *padapter, struct xmit_frame *pxmitframe);
-+#endif
-+
-+int rtw_is_same_ibss(_adapter *adapter, struct wlan_network *pnetwork);
-+int is_same_network(WLAN_BSSID_EX *src, WLAN_BSSID_EX *dst);
-+
-+#ifdef CONFIG_LAYER2_ROAMING
-+void _rtw_roaming(_adapter *adapter, struct wlan_network *tgt_network);
-+void rtw_roaming(_adapter *adapter, struct wlan_network *tgt_network);
-+void rtw_set_roaming(_adapter *adapter, u8 to_roaming);
-+u8 rtw_to_roaming(_adapter *adapter);
-+#else
-+#define _rtw_roaming(adapter, tgt_network) do {} while(0)
-+#define rtw_roaming(adapter, tgt_network) do {} while(0)
-+#define rtw_set_roaming(adapter, to_roaming) do {} while(0)
-+#define rtw_to_roaming(adapter) 0
-+#endif
-+
-+
-+#ifdef CONFIG_INTEL_PROXIM
-+void rtw_proxim_enable(_adapter *padapter);
-+void rtw_proxim_disable(_adapter *padapter);
-+void rtw_proxim_send_packet(_adapter *padapter,u8 *pbuf,u16 len,u8 hw_rate);
-+#endif //CONFIG_INTEL_PROXIM
-+#endif //__RTL871X_MLME_H_
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_mlme_ext.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_mlme_ext.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_mlme_ext.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_mlme_ext.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_mlme_ext.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_mlme_ext.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_mlme_ext.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_mlme_ext.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,962 @@
+/******************************************************************************
+ *
@@ -194407,9 +195394,856 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_mlme_ext.h linu
+#endif//_RTL8192C_CMD_C_
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_mp.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_mp.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_mp.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_mp.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_mlme.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_mlme.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_mlme.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_mlme.h 2015-10-07 16:40:51.000000000 +0200
+@@ -0,0 +1,843 @@
++/******************************************************************************
++ *
++ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of version 2 of the GNU General Public License as
++ * published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
++ *
++ *
++ ******************************************************************************/
++#ifndef __RTW_MLME_H_
++#define __RTW_MLME_H_
++
++#include <drv_conf.h>
++#include <osdep_service.h>
++#include <mlme_osdep.h>
++#include <drv_types.h>
++#include <wlan_bssdef.h>
++
++#ifdef CONFIG_INTEL_WIDI
++#include <rtw_intel_widi.h>
++#endif
++
++#define MAX_BSS_CNT 128
++//#define MAX_JOIN_TIMEOUT 2000
++//#define MAX_JOIN_TIMEOUT 2500
++#define MAX_JOIN_TIMEOUT 6500
++
++// Commented by Albert 20101105
++// Increase the scanning timeout because of increasing the SURVEY_TO value.
++
++#define SCANNING_TIMEOUT 8000
++
++#define SCAN_INTERVAL (30) // unit:2sec, 30*2=60sec
++
++#ifdef PALTFORM_OS_WINCE
++#define SCANQUEUE_LIFETIME 12000000 // unit:us
++#else
++#define SCANQUEUE_LIFETIME 20 // unit:sec
++#endif
++
++#define WIFI_NULL_STATE 0x00000000
++
++#define WIFI_ASOC_STATE 0x00000001 // Under Linked state...
++#define WIFI_REASOC_STATE 0x00000002
++#define WIFI_SLEEP_STATE 0x00000004
++#define WIFI_STATION_STATE 0x00000008
++
++#define WIFI_AP_STATE 0x00000010
++#define WIFI_ADHOC_STATE 0x00000020
++#define WIFI_ADHOC_MASTER_STATE 0x00000040
++#define WIFI_UNDER_LINKING 0x00000080
++
++#define WIFI_UNDER_WPS 0x00000100
++//#define WIFI_UNDER_CMD 0x00000200
++//#define WIFI_UNDER_P2P 0x00000400
++#define WIFI_STA_ALIVE_CHK_STATE 0x00000400
++#define WIFI_SITE_MONITOR 0x00000800 //to indicate the station is under site surveying
++
++#ifdef WDS
++#define WIFI_WDS 0x00001000
++#define WIFI_WDS_RX_BEACON 0x00002000 // already rx WDS AP beacon
++#endif
++#ifdef AUTO_CONFIG
++#define WIFI_AUTOCONF 0x00004000
++#define WIFI_AUTOCONF_IND 0x00008000
++#endif
++
++/*
++// ========== P2P Section Start ===============
++#define WIFI_P2P_LISTEN_STATE 0x00010000
++#define WIFI_P2P_GROUP_FORMATION_STATE 0x00020000
++// ========== P2P Section End ===============
++*/
++
++//#ifdef UNDER_MPTEST
++#define WIFI_MP_STATE 0x00010000
++#define WIFI_MP_CTX_BACKGROUND 0x00020000 // in continous tx background
++#define WIFI_MP_CTX_ST 0x00040000 // in continous tx with single-tone
++#define WIFI_MP_CTX_BACKGROUND_PENDING 0x00080000 // pending in continous tx background due to out of skb
++#define WIFI_MP_CTX_CCK_HW 0x00100000 // in continous tx
++#define WIFI_MP_CTX_CCK_CS 0x00200000 // in continous tx with carrier suppression
++#define WIFI_MP_LPBK_STATE 0x00400000
++//#endif
++
++//#define _FW_UNDER_CMD WIFI_UNDER_CMD
++#define _FW_UNDER_LINKING WIFI_UNDER_LINKING
++#define _FW_LINKED WIFI_ASOC_STATE
++#define _FW_UNDER_SURVEY WIFI_SITE_MONITOR
++
++
++enum dot11AuthAlgrthmNum {
++ dot11AuthAlgrthm_Open = 0,
++ dot11AuthAlgrthm_Shared,
++ dot11AuthAlgrthm_8021X,
++ dot11AuthAlgrthm_Auto,
++ dot11AuthAlgrthm_MaxNum
++};
++
++// Scan type including active and passive scan.
++typedef enum _RT_SCAN_TYPE
++{
++ SCAN_PASSIVE,
++ SCAN_ACTIVE,
++ SCAN_MIX,
++}RT_SCAN_TYPE, *PRT_SCAN_TYPE;
++
++enum DriverInterface {
++ DRIVER_WEXT = 1,
++ DRIVER_CFG80211 = 2
++};
++
++enum _BAND
++{
++ GHZ24_50 = 0,
++ GHZ_50,
++ GHZ_24,
++ GHZ_MAX,
++};
++
++#define rtw_band_valid(band) ((band) >= GHZ24_50 && (band) < GHZ_MAX)
++
++enum SCAN_RESULT_TYPE
++{
++ SCAN_RESULT_P2P_ONLY = 0, // Will return all the P2P devices.
++ SCAN_RESULT_ALL = 1, // Will return all the scanned device, include AP.
++ SCAN_RESULT_WFD_TYPE = 2 // Will just return the correct WFD device.
++ // If this device is Miracast sink device, it will just return all the Miracast source devices.
++};
++
++/*
++
++there are several "locks" in mlme_priv,
++since mlme_priv is a shared resource between many threads,
++like ISR/Call-Back functions, the OID handlers, and even timer functions.
++
++
++Each _queue has its own locks, already.
++Other items are protected by mlme_priv.lock.
++
++To avoid possible dead lock, any thread trying to modifiying mlme_priv
++SHALL not lock up more than one locks at a time!
++
++*/
++
++
++#define traffic_threshold 10
++#define traffic_scan_period 500
++
++struct sitesurvey_ctrl {
++ u64 last_tx_pkts;
++ uint last_rx_pkts;
++ sint traffic_busy;
++ _timer sitesurvey_ctrl_timer;
++};
++
++typedef struct _RT_LINK_DETECT_T{
++ u32 NumTxOkInPeriod;
++ u32 NumRxOkInPeriod;
++ u32 NumRxUnicastOkInPeriod;
++ BOOLEAN bBusyTraffic;
++ BOOLEAN bTxBusyTraffic;
++ BOOLEAN bRxBusyTraffic;
++ BOOLEAN bHigherBusyTraffic; // For interrupt migration purpose.
++ BOOLEAN bHigherBusyRxTraffic; // We may disable Tx interrupt according as Rx traffic.
++ BOOLEAN bHigherBusyTxTraffic; // We may disable Tx interrupt according as Tx traffic.
++}RT_LINK_DETECT_T, *PRT_LINK_DETECT_T;
++
++struct profile_info {
++ u8 ssidlen;
++ u8 ssid[ WLAN_SSID_MAXLEN ];
++ u8 peermac[ ETH_ALEN ];
++};
++
++struct tx_invite_req_info{
++ u8 token;
++ u8 benable;
++ u8 go_ssid[ WLAN_SSID_MAXLEN ];
++ u8 ssidlen;
++ u8 go_bssid[ ETH_ALEN ];
++ u8 peer_macaddr[ ETH_ALEN ];
++ u8 operating_ch; // This information will be set by using the p2p_set op_ch=x
++ u8 peer_ch; // The listen channel for peer P2P device
++
++};
++
++struct tx_invite_resp_info{
++ u8 token; // Used to record the dialog token of p2p invitation request frame.
++};
++
++#ifdef CONFIG_WFD
++
++struct wifi_display_info{
++ u16 wfd_enable; // Eanble/Disable the WFD function.
++ u16 rtsp_ctrlport; // TCP port number at which the this WFD device listens for RTSP messages
++ u16 peer_rtsp_ctrlport; // TCP port number at which the peer WFD device listens for RTSP messages
++ // This filed should be filled when receiving the gropu negotiation request
++
++ u8 peer_session_avail; // WFD session is available or not for the peer wfd device.
++ // This variable will be set when sending the provisioning discovery request to peer WFD device.
++ // And this variable will be reset when it is read by using the iwpriv p2p_get wfd_sa command.
++
++ u8 ip_address[4];
++ u8 peer_ip_address[4];
++ u8 wfd_pc; // WFD preferred connection
++ // 0 -> Prefer to use the P2P for WFD connection on peer side.
++ // 1 -> Prefer to use the TDLS for WFD connection on peer side.
++
++ u8 wfd_device_type; // WFD Device Type
++ // 0 -> WFD Source Device
++ // 1 -> WFD Primary Sink Device
++ enum SCAN_RESULT_TYPE scan_result_type; // Used when P2P is enable. This parameter will impact the scan result.
++};
++#endif //CONFIG_WFD
++
++struct tx_provdisc_req_info{
++ u16 wps_config_method_request; // Used when sending the provisioning request frame
++ u16 peer_channel_num[2]; // The channel number which the receiver stands.
++ NDIS_802_11_SSID ssid;
++ u8 peerDevAddr[ ETH_ALEN ]; // Peer device address
++ u8 peerIFAddr[ ETH_ALEN ]; // Peer interface address
++ u8 benable; // This provision discovery request frame is trigger to send or not
++};
++
++struct rx_provdisc_req_info{ //When peer device issue prov_disc_req first, we should store the following informations
++ u8 peerDevAddr[ ETH_ALEN ]; // Peer device address
++ u8 strconfig_method_desc_of_prov_disc_req[4]; // description for the config method located in the provisioning discovery request frame.
++ // The UI must know this information to know which config method the remote p2p device is requiring.
++};
++
++struct tx_nego_req_info{
++ u16 peer_channel_num[2]; // The channel number which the receiver stands.
++ u8 peerDevAddr[ ETH_ALEN ]; // Peer device address
++ u8 benable; // This negoitation request frame is trigger to send or not
++};
++
++struct group_id_info{
++ u8 go_device_addr[ ETH_ALEN ]; // The GO's device address of this P2P group
++ u8 ssid[ WLAN_SSID_MAXLEN ]; // The SSID of this P2P group
++};
++
++struct scan_limit_info{
++ u8 scan_op_ch_only; // When this flag is set, the driver should just scan the operation channel
++#ifndef P2P_OP_CHECK_SOCIAL_CH
++ u8 operation_ch[2]; // Store the operation channel of invitation request frame
++#else
++ u8 operation_ch[5]; // Store additional channel 1,6,11 for Android 4.2 IOT & Nexus 4
++#endif //P2P_OP_CHECK_SOCIAL_CH
++};
++
++#ifdef CONFIG_IOCTL_CFG80211
++struct cfg80211_wifidirect_info{
++ _timer remain_on_ch_timer;
++ u8 restore_channel;
++ struct ieee80211_channel remain_on_ch_channel;
++ enum nl80211_channel_type remain_on_ch_type;
++ u64 remain_on_ch_cookie;
++ bool is_ro_ch;
++};
++#endif //CONFIG_IOCTL_CFG80211
++
++struct wifidirect_info{
++ _adapter* padapter;
++ _timer find_phase_timer;
++ _timer restore_p2p_state_timer;
++
++ // Used to do the scanning. After confirming the peer is availalble, the driver transmits the P2P frame to peer.
++ _timer pre_tx_scan_timer;
++ _timer reset_ch_sitesurvey;
++ _timer reset_ch_sitesurvey2; // Just for resetting the scan limit function by using p2p nego
++#ifdef CONFIG_CONCURRENT_MODE
++ // Used to switch the channel between legacy AP and listen state.
++ _timer ap_p2p_switch_timer;
++#endif
++ struct tx_provdisc_req_info tx_prov_disc_info;
++ struct rx_provdisc_req_info rx_prov_disc_info;
++ struct tx_invite_req_info invitereq_info;
++ struct profile_info profileinfo[ P2P_MAX_PERSISTENT_GROUP_NUM ]; // Store the profile information of persistent group
++ struct tx_invite_resp_info inviteresp_info;
++ struct tx_nego_req_info nego_req_info;
++ struct group_id_info groupid_info; // Store the group id information when doing the group negotiation handshake.
++ struct scan_limit_info rx_invitereq_info; // Used for get the limit scan channel from the Invitation procedure
++ struct scan_limit_info p2p_info; // Used for get the limit scan channel from the P2P negotiation handshake
++#ifdef CONFIG_WFD
++ struct wifi_display_info *wfd_info;
++#endif
++ enum P2P_ROLE role;
++ enum P2P_STATE pre_p2p_state;
++ enum P2P_STATE p2p_state;
++ u8 device_addr[ETH_ALEN]; // The device address should be the mac address of this device.
++ u8 interface_addr[ETH_ALEN];
++ u8 social_chan[4];
++ u8 listen_channel;
++ u8 operating_channel;
++ u8 listen_dwell; // This value should be between 1 and 3
++ u8 support_rate[8];
++ u8 p2p_wildcard_ssid[P2P_WILDCARD_SSID_LEN];
++ u8 intent; // should only include the intent value.
++ u8 p2p_peer_interface_addr[ ETH_ALEN ];
++ u8 p2p_peer_device_addr[ ETH_ALEN ];
++ u8 peer_intent; // Included the intent value and tie breaker value.
++ u8 device_name[ WPS_MAX_DEVICE_NAME_LEN ]; // Device name for displaying on searching device screen
++ u8 device_name_len;
++ u8 profileindex; // Used to point to the index of profileinfo array
++ u8 peer_operating_ch;
++ u8 find_phase_state_exchange_cnt;
++ u16 device_password_id_for_nego; // The device password ID for group negotation
++ u8 negotiation_dialog_token;
++ u8 nego_ssid[ WLAN_SSID_MAXLEN ]; // SSID information for group negotitation
++ u8 nego_ssidlen;
++ u8 p2p_group_ssid[WLAN_SSID_MAXLEN];
++ u8 p2p_group_ssid_len;
++ u8 persistent_supported; // Flag to know the persistent function should be supported or not.
++ // In the Sigma test, the Sigma will provide this enable from the sta_set_p2p CAPI.
++ // 0: disable
++ // 1: enable
++ u8 session_available; // Flag to set the WFD session available to enable or disable "by Sigma"
++ // In the Sigma test, the Sigma will disable the session available by using the sta_preset CAPI.
++ // 0: disable
++ // 1: enable
++ u8 wfd_tdls_enable; // Flag to enable or disable the TDLS by WFD Sigma
++ // 0: disable
++ // 1: enable
++ u8 wfd_tdls_weaksec; // Flag to enable or disable the weak security function for TDLS by WFD Sigma
++ // 0: disable
++ // In this case, the driver can't issue the tdsl setup request frame.
++ // 1: enable
++ // In this case, the driver can issue the tdls setup request frame
++ // even the current security is weak security.
++
++ enum P2P_WPSINFO ui_got_wps_info; // This field will store the WPS value (PIN value or PBC) that UI had got from the user.
++ u16 supported_wps_cm; // This field describes the WPS config method which this driver supported.
++ // The value should be the combination of config method defined in page104 of WPS v2.0 spec.
++ u8 external_uuid; // UUID flag
++ u8 uuid[16]; // UUID
++ uint channel_list_attr_len; // This field will contain the length of body of P2P Channel List attribute of group negotitation response frame.
++ u8 channel_list_attr[100]; // This field will contain the body of P2P Channel List attribute of group negotitation response frame.
++ // We will use the channel_cnt and channel_list fields when constructing the group negotitation confirm frame.
++ u8 driver_interface; // Indicate DRIVER_WEXT or DRIVER_CFG80211
++
++#ifdef CONFIG_CONCURRENT_MODE
++ u16 ext_listen_interval; // The interval to be available with legacy AP (ms)
++ u16 ext_listen_period; // The time period to be available for P2P listen state (ms)
++#endif
++#ifdef CONFIG_P2P_PS
++ enum P2P_PS_MODE p2p_ps_mode; // indicate p2p ps mode
++ enum P2P_PS_STATE p2p_ps_state; // indicate p2p ps state
++ u8 noa_index; // Identifies and instance of Notice of Absence timing.
++ u8 ctwindow; // Client traffic window. A period of time in TU after TBTT.
++ u8 opp_ps; // opportunistic power save.
++ u8 noa_num; // number of NoA descriptor in P2P IE.
++ u8 noa_count[P2P_MAX_NOA_NUM]; // Count for owner, Type of client.
++ u32 noa_duration[P2P_MAX_NOA_NUM]; // Max duration for owner, preferred or min acceptable duration for client.
++ u32 noa_interval[P2P_MAX_NOA_NUM]; // Length of interval for owner, preferred or max acceptable interval of client.
++ u32 noa_start_time[P2P_MAX_NOA_NUM]; // schedule expressed in terms of the lower 4 bytes of the TSF timer.
++#endif // CONFIG_P2P_PS
++};
++
++struct tdls_ss_record{ //signal strength record; recording the tdls sta with lowerest ss
++ u8 macaddr[ETH_ALEN];
++ u8 RxPWDBAll;
++ u8 is_tdls_sta; // _TRUE: direct link sta, _FALSE: else
++};
++
++struct tdls_info{
++ u8 ap_prohibited;
++ uint setup_state;
++ u8 sta_cnt;
++ u8 sta_maximum; // 1:tdls sta is equal (NUM_STA-1), reach max direct link number; 0: else;
++ struct tdls_ss_record ss_record;
++ u8 macid_index; //macid entry that is ready to write
++ u8 clear_cam; //cam entry that is trying to clear, using it in direct link teardown
++ u8 ch_sensing;
++ u8 cur_channel;
++ u8 candidate_ch;
++ u8 collect_pkt_num[MAX_CHANNEL_NUM];
++ _lock cmd_lock;
++ _lock hdl_lock;
++ u8 watchdog_count;
++ u8 dev_discovered; //WFD_TDLS: for sigma test
++ u8 enable;
++#ifdef CONFIG_WFD
++ struct wifi_display_info *wfd_info;
++#endif
++};
++
++struct mlme_priv {
++
++ _lock lock;
++ sint fw_state; //shall we protect this variable? maybe not necessarily...
++
++ u8 to_join; //flag
++ #ifdef CONFIG_LAYER2_ROAMING
++ u8 to_roaming; // roaming trying times
++ #endif
++
++ u8 *nic_hdl;
++
++ u8 not_indic_disco;
++ _list *pscanned;
++ _queue free_bss_pool;
++ _queue scanned_queue;
++ u8 *free_bss_buf;
++ u32 num_of_scanned;
++
++ NDIS_802_11_SSID assoc_ssid;
++ u8 assoc_bssid[6];
++
++ struct wlan_network cur_network;
++
++ //uint wireless_mode; no used, remove it
++
++ u32 scan_interval;
++
++ _timer assoc_timer;
++
++ uint assoc_by_bssid;
++ uint assoc_by_rssi;
++
++ _timer scan_to_timer; // driver itself handles scan_timeout status.
++ u32 scan_start_time; // used to evaluate the time spent in scanning
++
++ #ifdef CONFIG_SET_SCAN_DENY_TIMER
++ _timer set_scan_deny_timer;
++ ATOMIC_T set_scan_deny; //0: allowed, 1: deny
++ #endif
++
++ struct qos_priv qospriv;
++
++#ifdef CONFIG_80211N_HT
++
++ /* Number of non-HT AP/stations */
++ int num_sta_no_ht;
++
++ /* Number of HT AP/stations 20 MHz */
++ //int num_sta_ht_20mhz;
++
++
++ int num_FortyMHzIntolerant;
++
++ struct ht_priv htpriv;
++
++#endif
++
++ RT_LINK_DETECT_T LinkDetectInfo;
++ _timer dynamic_chk_timer; //dynamic/periodic check timer
++
++ u8 acm_mask; // for wmm acm mask
++ u8 ChannelPlan;
++ RT_SCAN_TYPE scan_mode; // active: 1, passive: 0
++
++ //u8 probereq_wpsie[MAX_WPS_IE_LEN];//added in probe req
++ //int probereq_wpsie_len;
++ u8 *wps_probe_req_ie;
++ u32 wps_probe_req_ie_len;
++
++#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME)
++ /* Number of associated Non-ERP stations (i.e., stations using 802.11b
++ * in 802.11g BSS) */
++ int num_sta_non_erp;
++
++ /* Number of associated stations that do not support Short Slot Time */
++ int num_sta_no_short_slot_time;
++
++ /* Number of associated stations that do not support Short Preamble */
++ int num_sta_no_short_preamble;
++
++ int olbc; /* Overlapping Legacy BSS Condition */
++
++ /* Number of HT associated stations that do not support greenfield */
++ int num_sta_ht_no_gf;
++
++ /* Number of associated non-HT stations */
++ //int num_sta_no_ht;
++
++ /* Number of HT associated stations 20 MHz */
++ int num_sta_ht_20mhz;
++
++ /* Overlapping BSS information */
++ int olbc_ht;
++
++#ifdef CONFIG_80211N_HT
++ u16 ht_op_mode;
++#endif /* CONFIG_80211N_HT */
++
++ u8 *assoc_req;
++ u32 assoc_req_len;
++ u8 *assoc_rsp;
++ u32 assoc_rsp_len;
++
++ u8 *wps_beacon_ie;
++ //u8 *wps_probe_req_ie;
++ u8 *wps_probe_resp_ie;
++ u8 *wps_assoc_resp_ie; // for CONFIG_IOCTL_CFG80211, this IE could include p2p ie / wfd ie
++
++ u32 wps_beacon_ie_len;
++ //u32 wps_probe_req_ie_len;
++ u32 wps_probe_resp_ie_len;
++ u32 wps_assoc_resp_ie_len; // for CONFIG_IOCTL_CFG80211, this IE len could include p2p ie / wfd ie
++
++ u8 *p2p_beacon_ie;
++ u8 *p2p_probe_req_ie;
++ u8 *p2p_probe_resp_ie;
++ u8 *p2p_go_probe_resp_ie; //for GO
++ u8 *p2p_assoc_req_ie;
++
++ u32 p2p_beacon_ie_len;
++ u32 p2p_probe_req_ie_len;
++ u32 p2p_probe_resp_ie_len;
++ u32 p2p_go_probe_resp_ie_len; //for GO
++ u32 p2p_assoc_req_ie_len;
++/*
++#if defined(CONFIG_P2P) && defined(CONFIG_IOCTL_CFG80211)
++ //u8 *wps_p2p_beacon_ie;
++ u8 *p2p_beacon_ie;
++ u8 *wps_p2p_probe_resp_ie;
++ u8 *wps_p2p_assoc_resp_ie;
++ //u32 wps_p2p_beacon_ie_len;
++ u32 p2p_beacon_ie_len;
++ u32 wps_p2p_probe_resp_ie_len;
++ u32 wps_p2p_assoc_resp_ie_len;
++#endif
++*/
++
++ _lock bcn_update_lock;
++ u8 update_bcn;
++
++
++#endif //#if defined (CONFIG_AP_MODE) && defined (CONFIG_NATIVEAP_MLME)
++
++#if defined(CONFIG_WFD) && defined(CONFIG_IOCTL_CFG80211)
++
++ u8 *wfd_beacon_ie;
++ u8 *wfd_probe_req_ie;
++ u8 *wfd_probe_resp_ie;
++ u8 *wfd_go_probe_resp_ie; //for GO
++ u8 *wfd_assoc_req_ie;
++
++ u32 wfd_beacon_ie_len;
++ u32 wfd_probe_req_ie_len;
++ u32 wfd_probe_resp_ie_len;
++ u32 wfd_go_probe_resp_ie_len; //for GO
++ u32 wfd_assoc_req_ie_len;
++
++#endif
++
++#ifdef RTK_DMP_PLATFORM
++ // DMP kobject_hotplug function signal need in passive level
++ _workitem Linkup_workitem;
++ _workitem Linkdown_workitem;
++#endif
++
++#ifdef CONFIG_INTEL_WIDI
++ int widi_state;
++ int listen_state;
++ _timer listen_timer;
++ ATOMIC_T rx_probe_rsp; // 1:receive probe respone from RDS source.
++ u8 *l2sdTaBuffer;
++ u8 channel_idx;
++ s8 group_cnt; //For WiDi 3.5, they specified another scan algo. for WFD/RDS co-existed
++ u8 sa_ext[L2SDTA_SERVICE_VE_LEN];
++
++ u8 widi_enable;
++ /**
++ * For WiDi 4; upper layer would set
++ * p2p_primary_device_type_category_id
++ * p2p_primary_device_type_sub_category_id
++ * p2p_secondary_device_type_category_id
++ * p2p_secondary_device_type_sub_category_id
++ */
++ u16 p2p_pdt_cid;
++ u16 p2p_pdt_scid;
++ u8 num_p2p_sdt;
++ u16 p2p_sdt_cid[MAX_NUM_P2P_SDT];
++ u16 p2p_sdt_scid[MAX_NUM_P2P_SDT];
++ u8 p2p_reject_disable; //When starting NL80211 wpa_supplicant/hostapd, it will call netdev_close
++ //such that it will cause p2p disabled. Use this flag to reject.
++#endif // CONFIG_INTEL_WIDI
++
++#ifdef CONFIG_CONCURRENT_MODE
++ u8 scanning_via_buddy_intf;
++#endif
++};
++
++#ifdef CONFIG_AP_MODE
++
++struct hostapd_priv
++{
++ _adapter *padapter;
++
++#ifdef CONFIG_HOSTAPD_MLME
++ struct net_device *pmgnt_netdev;
++ struct usb_anchor anchored;
++#endif
++
++};
++
++extern int hostapd_mode_init(_adapter *padapter);
++extern void hostapd_mode_unload(_adapter *padapter);
++#endif
++
++
++extern void rtw_joinbss_event_prehandle(_adapter *adapter, u8 *pbuf);
++extern void rtw_survey_event_callback(_adapter *adapter, u8 *pbuf);
++extern void rtw_surveydone_event_callback(_adapter *adapter, u8 *pbuf);
++extern void rtw_joinbss_event_callback(_adapter *adapter, u8 *pbuf);
++extern void rtw_stassoc_event_callback(_adapter *adapter, u8 *pbuf);
++extern void rtw_stadel_event_callback(_adapter *adapter, u8 *pbuf);
++extern void rtw_atimdone_event_callback(_adapter *adapter, u8 *pbuf);
++extern void rtw_cpwm_event_callback(_adapter *adapter, u8 *pbuf);
++
++#ifdef PLATFORM_WINDOWS
++extern thread_return event_thread(void *context);
++
++extern void rtw_join_timeout_handler (
++ IN PVOID SystemSpecific1,
++ IN PVOID FunctionContext,
++ IN PVOID SystemSpecific2,
++ IN PVOID SystemSpecific3
++ );
++
++extern void _rtw_scan_timeout_handler (
++ IN PVOID SystemSpecific1,
++ IN PVOID FunctionContext,
++ IN PVOID SystemSpecific2,
++ IN PVOID SystemSpecific3
++ );
++
++#endif
++
++#if defined (PLATFORM_LINUX)|| defined (PLATFORM_FREEBSD)
++extern int event_thread(void *context);
++extern void rtw_join_timeout_handler(void* FunctionContext);
++extern void _rtw_scan_timeout_handler(void* FunctionContext);
++#endif
++
++extern void rtw_free_network_queue(_adapter *adapter,u8 isfreeall);
++extern int rtw_init_mlme_priv(_adapter *adapter);// (struct mlme_priv *pmlmepriv);
++
++extern void rtw_free_mlme_priv (struct mlme_priv *pmlmepriv);
++
++
++extern sint rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv);
++extern sint rtw_set_key(_adapter *adapter,struct security_priv *psecuritypriv,sint keyid, u8 set_tx);
++extern sint rtw_set_auth(_adapter *adapter,struct security_priv *psecuritypriv);
++
++__inline static u8 *get_bssid(struct mlme_priv *pmlmepriv)
++{ //if sta_mode:pmlmepriv->cur_network.network.MacAddress=> bssid
++ // if adhoc_mode:pmlmepriv->cur_network.network.MacAddress=> ibss mac address
++ return pmlmepriv->cur_network.network.MacAddress;
++}
++
++__inline static sint check_fwstate(struct mlme_priv *pmlmepriv, sint state)
++{
++ if (pmlmepriv->fw_state & state)
++ return _TRUE;
++
++ return _FALSE;
++}
++
++__inline static sint get_fwstate(struct mlme_priv *pmlmepriv)
++{
++ return pmlmepriv->fw_state;
++}
++
++/*
++ * No Limit on the calling context,
++ * therefore set it to be the critical section...
++ *
++ * ### NOTE:#### (!!!!)
++ * MUST TAKE CARE THAT BEFORE CALLING THIS FUNC, YOU SHOULD HAVE LOCKED pmlmepriv->lock
++ */
++__inline static void set_fwstate(struct mlme_priv *pmlmepriv, sint state)
++{
++ pmlmepriv->fw_state |= state;
++}
++
++__inline static void _clr_fwstate_(struct mlme_priv *pmlmepriv, sint state)
++{
++ pmlmepriv->fw_state &= ~state;
++}
++
++/*
++ * No Limit on the calling context,
++ * therefore set it to be the critical section...
++ */
++__inline static void clr_fwstate(struct mlme_priv *pmlmepriv, sint state)
++{
++ _irqL irqL;
++
++ _enter_critical_bh(&pmlmepriv->lock, &irqL);
++ if (check_fwstate(pmlmepriv, state) == _TRUE)
++ pmlmepriv->fw_state ^= state;
++ _exit_critical_bh(&pmlmepriv->lock, &irqL);
++}
++
++__inline static void clr_fwstate_ex(struct mlme_priv *pmlmepriv, sint state)
++{
++ _irqL irqL;
++
++ _enter_critical_bh(&pmlmepriv->lock, &irqL);
++ _clr_fwstate_(pmlmepriv, state);
++ _exit_critical_bh(&pmlmepriv->lock, &irqL);
++}
++
++__inline static void up_scanned_network(struct mlme_priv *pmlmepriv)
++{
++ _irqL irqL;
++
++ _enter_critical_bh(&pmlmepriv->lock, &irqL);
++ pmlmepriv->num_of_scanned++;
++ _exit_critical_bh(&pmlmepriv->lock, &irqL);
++}
++
++#ifdef CONFIG_CONCURRENT_MODE
++sint rtw_buddy_adapter_up(_adapter *padapter);
++sint check_buddy_fwstate(_adapter *padapter, sint state);
++#endif //CONFIG_CONCURRENT_MODE
++
++__inline static void down_scanned_network(struct mlme_priv *pmlmepriv)
++{
++ _irqL irqL;
++
++ _enter_critical_bh(&pmlmepriv->lock, &irqL);
++ pmlmepriv->num_of_scanned--;
++ _exit_critical_bh(&pmlmepriv->lock, &irqL);
++}
++
++__inline static void set_scanned_network_val(struct mlme_priv *pmlmepriv, sint val)
++{
++ _irqL irqL;
++
++ _enter_critical_bh(&pmlmepriv->lock, &irqL);
++ pmlmepriv->num_of_scanned = val;
++ _exit_critical_bh(&pmlmepriv->lock, &irqL);
++}
++
++extern u16 rtw_get_capability(WLAN_BSSID_EX *bss);
++extern void rtw_update_scanned_network(_adapter *adapter, WLAN_BSSID_EX *target);
++extern void rtw_disconnect_hdl_under_linked(_adapter* adapter, struct sta_info *psta, u8 free_assoc);
++extern void rtw_generate_random_ibss(u8 *pibss);
++extern struct wlan_network* rtw_find_network(_queue *scanned_queue, u8 *addr);
++extern struct wlan_network* rtw_get_oldest_wlan_network(_queue *scanned_queue);
++
++extern void rtw_free_assoc_resources(_adapter* adapter, int lock_scanned_queue);
++extern void rtw_indicate_disconnect(_adapter* adapter);
++extern void rtw_indicate_connect(_adapter* adapter);
++void rtw_indicate_scan_done( _adapter *padapter, bool aborted);
++void rtw_scan_abort(_adapter *adapter);
++
++extern int rtw_restruct_sec_ie(_adapter *adapter,u8 *in_ie,u8 *out_ie,uint in_len);
++extern int rtw_restruct_wmm_ie(_adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_len, uint initial_out_len);
++extern void rtw_init_registrypriv_dev_network(_adapter *adapter);
++
++extern void rtw_update_registrypriv_dev_network(_adapter *adapter);
++
++extern void rtw_get_encrypt_decrypt_from_registrypriv(_adapter *adapter);
++
++extern void _rtw_join_timeout_handler(_adapter *adapter);
++extern void rtw_scan_timeout_handler(_adapter *adapter);
++
++extern void rtw_dynamic_check_timer_handlder(_adapter *adapter);
++#ifdef CONFIG_SET_SCAN_DENY_TIMER
++bool rtw_is_scan_deny(_adapter *adapter);
++void rtw_clear_scan_deny(_adapter *adapter);
++void rtw_set_scan_deny_timer_hdl(_adapter *adapter);
++void rtw_set_scan_deny(_adapter *adapter, u32 ms);
++#else
++#define rtw_is_scan_deny(adapter) _FALSE
++#define rtw_clear_scan_deny(adapter) do {} while (0)
++#define rtw_set_scan_deny_timer_hdl(adapter) do {} while (0)
++#define rtw_set_scan_deny(adapter, ms) do {} while (0)
++#endif
++
++
++extern int _rtw_init_mlme_priv(_adapter *padapter);
++
++void rtw_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv);
++
++extern void _rtw_free_mlme_priv(struct mlme_priv *pmlmepriv);
++
++extern int _rtw_enqueue_network(_queue *queue, struct wlan_network *pnetwork);
++
++extern struct wlan_network* _rtw_dequeue_network(_queue *queue);
++
++extern struct wlan_network* _rtw_alloc_network(struct mlme_priv *pmlmepriv);
++
++
++extern void _rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork, u8 isfreeall);
++extern void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork);
++
++
++extern struct wlan_network* _rtw_find_network(_queue *scanned_queue, u8 *addr);
++
++extern void _rtw_free_network_queue(_adapter* padapter, u8 isfreeall);
++
++extern sint rtw_if_up(_adapter *padapter);
++
++
++u8 *rtw_get_capability_from_ie(u8 *ie);
++u8 *rtw_get_timestampe_from_ie(u8 *ie);
++u8 *rtw_get_beacon_interval_from_ie(u8 *ie);
++
++
++void rtw_joinbss_reset(_adapter *padapter);
++
++#ifdef CONFIG_80211N_HT
++unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, uint in_len, uint *pout_len, u8 channel);
++void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len, u8 channel);
++void rtw_issue_addbareq_cmd(_adapter *padapter, struct xmit_frame *pxmitframe);
++#endif
++
++int rtw_is_same_ibss(_adapter *adapter, struct wlan_network *pnetwork);
++int is_same_network(WLAN_BSSID_EX *src, WLAN_BSSID_EX *dst);
++
++#ifdef CONFIG_LAYER2_ROAMING
++void _rtw_roaming(_adapter *adapter, struct wlan_network *tgt_network);
++void rtw_roaming(_adapter *adapter, struct wlan_network *tgt_network);
++void rtw_set_roaming(_adapter *adapter, u8 to_roaming);
++u8 rtw_to_roaming(_adapter *adapter);
++#else
++#define _rtw_roaming(adapter, tgt_network) do {} while(0)
++#define rtw_roaming(adapter, tgt_network) do {} while(0)
++#define rtw_set_roaming(adapter, to_roaming) do {} while(0)
++#define rtw_to_roaming(adapter) 0
++#endif
++
++
++#ifdef CONFIG_INTEL_PROXIM
++void rtw_proxim_enable(_adapter *padapter);
++void rtw_proxim_disable(_adapter *padapter);
++void rtw_proxim_send_packet(_adapter *padapter,u8 *pbuf,u16 len,u8 hw_rate);
++#endif //CONFIG_INTEL_PROXIM
++#endif //__RTL871X_MLME_H_
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_mp.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_mp.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_mp.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_mp.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,711 @@
+/******************************************************************************
+ *
@@ -195122,9 +196956,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_mp.h linux-rpi/
+extern void Hal_ProSetCrystalCap (PADAPTER pAdapter , u32 CrystalCapVal);
+
+#endif //_RTW_MP_H_
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_mp_ioctl.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_mp_ioctl.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_mp_ioctl.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_mp_ioctl.h 2015-08-26 10:26:08.761316441 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_mp_ioctl.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_mp_ioctl.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_mp_ioctl.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_mp_ioctl.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,595 @@
+/******************************************************************************
+ *
@@ -195721,9 +197555,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_mp_ioctl.h linu
+#endif /* _RTW_MP_IOCTL_C_ */
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_mp_phy_regdef.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_mp_phy_regdef.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_mp_phy_regdef.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_mp_phy_regdef.h 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_mp_phy_regdef.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_mp_phy_regdef.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_mp_phy_regdef.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_mp_phy_regdef.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,1096 @@
+/******************************************************************************
+ *
@@ -196821,9 +198655,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_mp_phy_regdef.h
+
+
+#endif //__INC_HAL8192SPHYREG_H
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_p2p.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_p2p.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_p2p.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_p2p.h 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_p2p.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_p2p.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_p2p.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_p2p.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,160 @@
+/******************************************************************************
+ *
@@ -196985,9 +198819,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_p2p.h linux-rpi
+ (wdinfo)->find_phase_state_exchange_cnt != P2P_FINDPHASE_EX_NONE)
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_pwrctrl.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_pwrctrl.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_pwrctrl.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_pwrctrl.h 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_pwrctrl.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_pwrctrl.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_pwrctrl.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_pwrctrl.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,362 @@
+/******************************************************************************
+ *
@@ -197351,9 +199185,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_pwrctrl.h linux
+int rtw_pm_set_lps(_adapter *padapter, u8 mode);
+
+#endif //__RTL871X_PWRCTRL_H_
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_qos.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_qos.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_qos.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_qos.h 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_qos.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_qos.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_qos.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_qos.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,39 @@
+/******************************************************************************
+ *
@@ -197394,9 +199228,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_qos.h linux-rpi
+
+
+#endif //_RTL871X_QOS_H_
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_recv.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_recv.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_recv.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_recv.h 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_recv.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_recv.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_recv.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_recv.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,730 @@
+/******************************************************************************
+ *
@@ -198128,9 +199962,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_recv.h linux-rp
+extern void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame);
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_rf.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_rf.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_rf.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_rf.h 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_rf.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_rf.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_rf.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_rf.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,151 @@
+/******************************************************************************
+ *
@@ -198283,9 +200117,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_rf.h linux-rpi/
+
+
+#endif //_RTL8711_RF_H_
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_security.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_security.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_security.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_security.h 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_security.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_security.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_security.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_security.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,446 @@
+/******************************************************************************
+ *
@@ -198733,9 +200567,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_security.h linu
+u8 rtw_handle_tkip_countermeasure(_adapter* adapter, const char *caller);
+
+#endif //__RTL871X_SECURITY_H_
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_sreset.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_sreset.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_sreset.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_sreset.h 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_sreset.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_sreset.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_sreset.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_sreset.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,73 @@
+/******************************************************************************
+ *
@@ -198810,9 +200644,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_sreset.h linux-
+void sreset_reset(_adapter *padapter);
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_tdls.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_tdls.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_tdls.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_tdls.h 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_tdls.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_tdls.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_tdls.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_tdls.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,142 @@
+/******************************************************************************
+ *
@@ -198956,14 +200790,14 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_tdls.h linux-rp
+#endif //CONFIG_TDLS
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_version.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_version.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_version.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_version.h 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_version.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_version.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_version.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_version.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1 @@
+#define DRIVERVERSION "v4.0.2_9000.20130911"
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_xmit.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_xmit.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_xmit.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_xmit.h 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_xmit.h linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_xmit.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/rtw_xmit.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/rtw_xmit.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,753 @@
+/******************************************************************************
+ *
@@ -199718,9 +201552,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/rtw_xmit.h linux-rp
+#include <xmit_osdep.h>
+
+#endif //_RTL871X_XMIT_H_
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/sta_info.h linux-rpi/drivers/net/wireless/rtl8192cu/include/sta_info.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/sta_info.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/sta_info.h 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/sta_info.h linux-rpi/drivers/net/wireless/rtl8192cu/include/sta_info.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/sta_info.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/sta_info.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,431 @@
+/******************************************************************************
+ *
@@ -200153,9 +201987,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/sta_info.h linux-rp
+extern u8 rtw_access_ctrl(_adapter *padapter, u8 *mac_addr);
+
+#endif //_STA_INFO_H_
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/usb_hal.h linux-rpi/drivers/net/wireless/rtl8192cu/include/usb_hal.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/usb_hal.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/usb_hal.h 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/usb_hal.h linux-rpi/drivers/net/wireless/rtl8192cu/include/usb_hal.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/usb_hal.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/usb_hal.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,36 @@
+/******************************************************************************
+ *
@@ -200193,9 +202027,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/usb_hal.h linux-rpi
+#endif // CONFIG_WOWLAN_MANUAL
+#endif //CONFIG_WOWLAN
+#endif //__USB_HAL_H__
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/usb_ops.h linux-rpi/drivers/net/wireless/rtl8192cu/include/usb_ops.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/usb_ops.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/usb_ops.h 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/usb_ops.h linux-rpi/drivers/net/wireless/rtl8192cu/include/usb_ops.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/usb_ops.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/usb_ops.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,109 @@
+/******************************************************************************
+ *
@@ -200306,9 +202140,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/usb_ops.h linux-rpi
+}
+
+#endif //__USB_OPS_H_
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/usb_ops_linux.h linux-rpi/drivers/net/wireless/rtl8192cu/include/usb_ops_linux.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/usb_ops_linux.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/usb_ops_linux.h 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/usb_ops_linux.h linux-rpi/drivers/net/wireless/rtl8192cu/include/usb_ops_linux.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/usb_ops_linux.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/usb_ops_linux.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,62 @@
+/******************************************************************************
+ *
@@ -200372,9 +202206,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/usb_ops_linux.h lin
+void usb_write_port_cancel(struct intf_hdl *pintfhdl);
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/usb_osintf.h linux-rpi/drivers/net/wireless/rtl8192cu/include/usb_osintf.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/usb_osintf.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/usb_osintf.h 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/usb_osintf.h linux-rpi/drivers/net/wireless/rtl8192cu/include/usb_osintf.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/usb_osintf.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/usb_osintf.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,37 @@
+/******************************************************************************
+ *
@@ -200413,9 +202247,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/usb_osintf.h linux-
+
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/usb_vendor_req.h linux-rpi/drivers/net/wireless/rtl8192cu/include/usb_vendor_req.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/usb_vendor_req.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/usb_vendor_req.h 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/usb_vendor_req.h linux-rpi/drivers/net/wireless/rtl8192cu/include/usb_vendor_req.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/usb_vendor_req.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/usb_vendor_req.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,59 @@
+/******************************************************************************
+ *
@@ -200476,9 +202310,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/usb_vendor_req.h li
+//BOOLEAN CEusbGetDescriptorRequest(PCE_USB_DEVICE CEdevice, IN short urbLength, IN UCHAR DescriptorType, IN UCHAR Index, IN USHORT LanguageId, IN PVOID TransferBuffer, IN ULONG TransferBufferLength);
+
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/wifi.h linux-rpi/drivers/net/wireless/rtl8192cu/include/wifi.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/wifi.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/wifi.h 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/wifi.h linux-rpi/drivers/net/wireless/rtl8192cu/include/wifi.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/wifi.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/wifi.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,1245 @@
+/******************************************************************************
+ *
@@ -201725,9 +203559,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/wifi.h linux-rpi/dr
+
+
+#endif // _WIFI_H_
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/wlan_bssdef.h linux-rpi/drivers/net/wireless/rtl8192cu/include/wlan_bssdef.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/wlan_bssdef.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/wlan_bssdef.h 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/wlan_bssdef.h linux-rpi/drivers/net/wireless/rtl8192cu/include/wlan_bssdef.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/wlan_bssdef.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/wlan_bssdef.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,702 @@
+/******************************************************************************
+ *
@@ -202431,9 +204265,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/wlan_bssdef.h linux
+
+
+#endif //#ifndef WLAN_BSSDEF_H_
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/xmit_osdep.h linux-rpi/drivers/net/wireless/rtl8192cu/include/xmit_osdep.h
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/include/xmit_osdep.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/include/xmit_osdep.h 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/include/xmit_osdep.h linux-rpi/drivers/net/wireless/rtl8192cu/include/xmit_osdep.h
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/include/xmit_osdep.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/include/xmit_osdep.h 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,94 @@
+/******************************************************************************
+ *
@@ -202529,9 +204363,641 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/include/xmit_osdep.h linux-
+extern void rtw_os_xmit_complete(_adapter *padapter, struct xmit_frame *pxframe);
+
+#endif //__XMIT_OSDEP_H_
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_cfg80211.c linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_cfg80211.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_cfg80211.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_cfg80211.c 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/Kconfig linux-rpi/drivers/net/wireless/rtl8192cu/Kconfig
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/Kconfig 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/Kconfig 2015-10-07 16:40:50.000000000 +0200
+@@ -0,0 +1,9 @@
++config RTL8192CU
++ tristate "Realtek 8192C USB WiFi"
++ depends on MAC80211 && USB
++ select CFG80211_WEXT
++ select WIRELESS_EXT
++ select WEXT_PRIV
++ ---help---
++ This option adds the Realtek RTL8192CU USB device such as Edimax EW-7811Un.
++
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/Makefile linux-rpi/drivers/net/wireless/rtl8192cu/Makefile
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/Makefile 2015-10-07 16:40:50.000000000 +0200
+@@ -0,0 +1,615 @@
++EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS)
++EXTRA_CFLAGS += -O1
++#EXTRA_CFLAGS += -O3
++#EXTRA_CFLAGS += -Wall
++#EXTRA_CFLAGS += -Wextra
++#EXTRA_CFLAGS += -Werror
++#EXTRA_CFLAGS += -pedantic
++#EXTRA_CFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes
++
++EXTRA_CFLAGS += -Wno-unused-variable
++EXTRA_CFLAGS += -Wno-unused-value
++EXTRA_CFLAGS += -Wno-unused-label
++EXTRA_CFLAGS += -Wno-unused-parameter
++EXTRA_CFLAGS += -Wno-unused-function
++EXTRA_CFLAGS += -Wno-unused
++
++EXTRA_CFLAGS += -Wno-uninitialized
++
++EXTRA_CFLAGS += -I$(src)/include
++
++CONFIG_AUTOCFG_CP = n
++
++CONFIG_RTL8192C = y
++CONFIG_RTL8192D = n
++CONFIG_RTL8723A = n
++
++CONFIG_USB_HCI = y
++CONFIG_PCI_HCI = n
++CONFIG_SDIO_HCI = n
++
++CONFIG_MP_INCLUDED = n
++CONFIG_POWER_SAVING = y
++CONFIG_USB_AUTOSUSPEND = n
++CONFIG_HW_PWRP_DETECTION = n
++CONFIG_WIFI_TEST = n
++CONFIG_BT_COEXISTENCE = n
++CONFIG_RTL8192CU_REDEFINE_1X1 = n
++CONFIG_INTEL_WIDI = n
++CONFIG_WAKE_ON_WLAN = n
++
++CONFIG_PLATFORM_I386_PC = y
++CONFIG_PLATFORM_TI_AM3517 = n
++CONFIG_PLATFORM_ANDROID_X86 = n
++CONFIG_PLATFORM_JB_X86 = n
++CONFIG_PLATFORM_ARM_S3C2K4 = n
++CONFIG_PLATFORM_ARM_PXA2XX = n
++CONFIG_PLATFORM_ARM_S3C6K4 = n
++CONFIG_PLATFORM_MIPS_RMI = n
++CONFIG_PLATFORM_RTD2880B = n
++CONFIG_PLATFORM_MIPS_AR9132 = n
++CONFIG_PLATFORM_RTK_DMP = n
++CONFIG_PLATFORM_MIPS_PLM = n
++CONFIG_PLATFORM_MSTAR389 = n
++CONFIG_PLATFORM_MT53XX = n
++CONFIG_PLATFORM_ARM_MX51_241H = n
++CONFIG_PLATFORM_FS_MX61 = n
++CONFIG_PLATFORM_ACTIONS_ATJ227X = n
++CONFIG_PLATFORM_TEGRA3_CARDHU = n
++CONFIG_PLATFORM_TEGRA4_DALMORE = n
++CONFIG_PLATFORM_ARM_TCC8900 = n
++CONFIG_PLATFORM_ARM_TCC8920 = n
++CONFIG_PLATFORM_ARM_TCC8920_JB42 = n
++CONFIG_PLATFORM_ARM_RK2818 = n
++CONFIG_PLATFORM_ARM_TI_PANDA = n
++CONFIG_PLATFORM_MIPS_JZ4760 = n
++CONFIG_PLATFORM_DMP_PHILIPS = n
++CONFIG_PLATFORM_TI_DM365 = n
++CONFIG_PLATFORM_MN10300 = n
++CONFIG_PLATFORM_MSTAR_TITANIA12 = n
++CONFIG_PLATFORM_MSTAR_A3 = n
++CONFIG_PLATFORM_ARM_SUNxI = n
++CONFIG_PLATFORM_ARM_SUN6I = n
++
++CONFIG_DRVEXT_MODULE = n
++
++export TopDIR ?= $(shell pwd)
++
++
++ifeq ($(CONFIG_RTL8192C), y)
++
++RTL871X = rtl8192c
++
++ifeq ($(CONFIG_USB_HCI), y)
++MODULE_NAME = 8192cu
++FW_FILES := hal/$(RTL871X)/usb/Hal8192CUHWImg.o
++ifneq ($(CONFIG_WAKE_ON_WLAN), n)
++FW_FILES += hal/$(RTL871X)/usb/Hal8192CUHWImg_wowlan.o
++endif
++endif
++ifeq ($(CONFIG_PCI_HCI), y)
++MODULE_NAME = 8192ce
++FW_FILES := hal/$(RTL871X)/pci/Hal8192CEHWImg.o
++endif
++
++CHIP_FILES := \
++ hal/$(RTL871X)/$(RTL871X)_sreset.o \
++ hal/$(RTL871X)/$(RTL871X)_xmit.o
++CHIP_FILES += $(FW_FILES)
++endif
++
++ifeq ($(CONFIG_RTL8192D), y)
++
++RTL871X = rtl8192d
++
++ifeq ($(CONFIG_USB_HCI), y)
++MODULE_NAME = 8192du
++FW_FILES := hal/$(RTL871X)/usb/Hal8192DUHWImg.o
++ifneq ($(CONFIG_WAKE_ON_WLAN), n)
++FW_FILES += hal/$(RTL871X)/usb/Hal8192DUHWImg_wowlan.o
++endif
++endif
++ifeq ($(CONFIG_PCI_HCI), y)
++MODULE_NAME = 8192de
++FW_FILES := hal/$(RTL871X)/pci/Hal8192DEHWImg.o
++endif
++
++CHIP_FILES := \
++ hal/$(RTL871X)/$(RTL871X)_xmit.o
++CHIP_FILES += $(FW_FILES)
++endif
++
++ifeq ($(CONFIG_RTL8723A), y)
++
++RTL871X = rtl8723a
++
++ifeq ($(CONFIG_SDIO_HCI), y)
++MODULE_NAME = 8723as
++FW_FILES := hal/$(RTL871X)/sdio/Hal8723SHWImg.o
++endif
++
++ifeq ($(CONFIG_USB_HCI), y)
++MODULE_NAME = 8723au
++FW_FILES := hal/$(RTL871X)/usb/Hal8723UHWImg.o
++endif
++
++ifeq ($(CONFIG_PCI_HCI), y)
++MODULE_NAME = 8723ae
++FW_FILES := hal/$(RTL871X)/pci/Hal8723EHWImg.o
++endif
++
++PWRSEQ_FILES := hal/HalPwrSeqCmd.o \
++ hal/$(RTL871X)/Hal8723PwrSeq.o
++
++CHIP_FILES += $(FW_FILES) $(PWRSEQ_FILES)
++
++endif
++
++ifeq ($(CONFIG_SDIO_HCI), y)
++HCI_NAME = sdio
++endif
++
++ifeq ($(CONFIG_USB_HCI), y)
++HCI_NAME = usb
++endif
++
++ifeq ($(CONFIG_PCI_HCI), y)
++HCI_NAME = pci
++endif
++
++
++_OS_INTFS_FILES := os_dep/osdep_service.o \
++ os_dep/linux/os_intfs.o \
++ os_dep/linux/$(HCI_NAME)_intf.o \
++ os_dep/linux/$(HCI_NAME)_ops_linux.o \
++ os_dep/linux/ioctl_linux.o \
++ os_dep/linux/xmit_linux.o \
++ os_dep/linux/mlme_linux.o \
++ os_dep/linux/recv_linux.o \
++ os_dep/linux/ioctl_cfg80211.o \
++ os_dep/linux/rtw_android.o
++
++
++_HAL_INTFS_FILES := hal/hal_intf.o \
++ hal/hal_com.o \
++ hal/dm.o \
++ hal/$(RTL871X)/$(RTL871X)_hal_init.o \
++ hal/$(RTL871X)/$(RTL871X)_phycfg.o \
++ hal/$(RTL871X)/$(RTL871X)_rf6052.o \
++ hal/$(RTL871X)/$(RTL871X)_dm.o \
++ hal/$(RTL871X)/$(RTL871X)_rxdesc.o \
++ hal/$(RTL871X)/$(RTL871X)_cmd.o \
++ hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_halinit.o \
++ hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_NAME)_led.o \
++ hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_NAME)_xmit.o \
++ hal/$(RTL871X)/$(HCI_NAME)/rtl$(MODULE_NAME)_recv.o
++
++ifeq ($(CONFIG_SDIO_HCI), y)
++_HAL_INTFS_FILES += hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_ops.o
++else
++_HAL_INTFS_FILES += hal/$(RTL871X)/$(HCI_NAME)/$(HCI_NAME)_ops_linux.o
++endif
++
++ifeq ($(CONFIG_MP_INCLUDED), y)
++_HAL_INTFS_FILES += hal/$(RTL871X)/$(RTL871X)_mp.o
++endif
++
++_HAL_INTFS_FILES += $(CHIP_FILES)
++
++
++ifeq ($(CONFIG_AUTOCFG_CP), y)
++$(shell cp $(TopDIR)/autoconf_$(RTL871X)_$(HCI_NAME)_linux.h $(TopDIR)/include/autoconf.h)
++endif
++
++
++ifeq ($(CONFIG_USB_HCI), y)
++ifeq ($(CONFIG_USB_AUTOSUSPEND), y)
++EXTRA_CFLAGS += -DCONFIG_USB_AUTOSUSPEND
++endif
++endif
++
++ifeq ($(CONFIG_POWER_SAVING), y)
++EXTRA_CFLAGS += -DCONFIG_POWER_SAVING
++endif
++
++ifeq ($(CONFIG_HW_PWRP_DETECTION), y)
++EXTRA_CFLAGS += -DCONFIG_HW_PWRP_DETECTION
++endif
++
++ifeq ($(CONFIG_WIFI_TEST), y)
++EXTRA_CFLAGS += -DCONFIG_WIFI_TEST
++endif
++
++ifeq ($(CONFIG_BT_COEXISTENCE), y)
++EXTRA_CFLAGS += -DCONFIG_BT_COEXISTENCE
++endif
++
++ifeq ($(CONFIG_RTL8192CU_REDEFINE_1X1), y)
++EXTRA_CFLAGS += -DRTL8192C_RECONFIG_TO_1T1R
++endif
++
++ifeq ($(CONFIG_WAKE_ON_WLAN), y)
++EXTRA_CFLAGS += -DCONFIG_WAKE_ON_WLAN
++endif
++
++ifeq ($(CONFIG_INTEL_WIDI), y)
++EXTRA_CFLAGS += -DCONFIG_INTEL_WIDI
++endif
++
++ifeq ($(CONFIG_PLATFORM_I386_PC), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
++SUBARCH := $(shell uname -m | sed -e s/i.86/i386/)
++ARCH ?= $(SUBARCH)
++CROSS_COMPILE ?=
++KVER := $(shell uname -r)
++KSRC := /lib/modules/$(KVER)/build
++MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/
++INSTALL_PREFIX :=
++endif
++
++ifeq ($(CONFIG_PLATFORM_TI_AM3517), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_SHUTTLE
++CROSS_COMPILE := arm-eabi-
++KSRC := $(shell pwd)/../../../Android/kernel
++ARCH := arm
++endif
++
++ifeq ($(CONFIG_PLATFORM_MSTAR_TITANIA12), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_MSTAR -DCONFIG_PLATFORM_MSTAR_TITANIA12
++ARCH:=mips
++CROSS_COMPILE:= /usr/src/Mstar_kernel/mips-4.3/bin/mips-linux-gnu-
++KVER:= 2.6.28.9
++KSRC:= /usr/src/Mstar_kernel/2.6.28.9/
++endif
++
++ifeq ($(CONFIG_PLATFORM_MSTAR_A3), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_MSTAR -DCONFIG_PLATFORM_MSTAR_A3
++ARCH:=arm
++CROSS_COMPILE:= arm-none-linux-gnueabi-
++KVER:= 2.6.35.11
++KSRC:= /home/gary/PERFORCE/THEALE/RedLion/2.6.35.11/
++MODULE_NAME = wlan
++endif
++
++ifeq ($(CONFIG_PLATFORM_ANDROID_X86), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
++SUBARCH := $(shell uname -m | sed -e s/i.86/i386/)
++ARCH := $(SUBARCH)
++CROSS_COMPILE := /media/DATA-2/android-x86/ics-x86_20120130/prebuilt/linux-x86/toolchain/i686-unknown-linux-gnu-4.2.1/bin/i686-unknown-linux-gnu-
++KSRC := /media/DATA-2/android-x86/ics-x86_20120130/out/target/product/generic_x86/obj/kernel
++MODULE_NAME :=wlan
++endif
++
++ifeq ($(CONFIG_PLATFORM_JB_X86), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
++EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
++EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
++EXTRA_CFLAGS += -DCONFIG_P2P_IPS
++SUBARCH := $(shell uname -m | sed -e s/i.86/i386/)
++ARCH := $(SUBARCH)
++CROSS_COMPILE := /home/android_sdk/android-x86_JB/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7/bin/i686-linux-android-
++KSRC := /home/android_sdk/android-x86_JB/out/target/product/x86/obj/kernel/
++MODULE_NAME :=wlan
++endif
++
++ifeq ($(CONFIG_PLATFORM_ARM_PXA2XX), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
++ARCH := arm
++CROSS_COMPILE := arm-none-linux-gnueabi-
++KVER := 2.6.34.1
++KSRC ?= /usr/src/linux-2.6.34.1
++endif
++
++ifeq ($(CONFIG_PLATFORM_ARM_S3C2K4), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
++ARCH := arm
++CROSS_COMPILE := arm-linux-
++KVER := 2.6.24.7_$(ARCH)
++KSRC := /usr/src/kernels/linux-$(KVER)
++endif
++
++ifeq ($(CONFIG_PLATFORM_ARM_S3C6K4), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
++ARCH := arm
++CROSS_COMPILE := arm-none-linux-gnueabi-
++KVER := 2.6.34.1
++KSRC ?= /usr/src/linux-2.6.34.1
++endif
++
++ifeq ($(CONFIG_PLATFORM_RTD2880B), y)
++EXTRA_CFLAGS += -DCONFIG_BIG_ENDIAN -DCONFIG_PLATFORM_RTD2880B
++ARCH:=
++CROSS_COMPILE:=
++KVER:=
++KSRC:=
++endif
++
++ifeq ($(CONFIG_PLATFORM_MIPS_RMI), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
++ARCH:=mips
++CROSS_COMPILE:=mipsisa32r2-uclibc-
++KVER:=
++KSRC:= /root/work/kernel_realtek
++endif
++
++ifeq ($(CONFIG_PLATFORM_MIPS_PLM), y)
++EXTRA_CFLAGS += -DCONFIG_BIG_ENDIAN
++ARCH:=mips
++CROSS_COMPILE:=mipsisa32r2-uclibc-
++KVER:=
++KSRC:= /root/work/kernel_realtek
++endif
++
++ifeq ($(CONFIG_PLATFORM_MSTAR389), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_MSTAR389
++ARCH:=mips
++CROSS_COMPILE:= mips-linux-gnu-
++KVER:= 2.6.28.10
++KSRC:= /home/mstar/mstar_linux/2.6.28.9/
++endif
++
++ifeq ($(CONFIG_PLATFORM_MIPS_AR9132), y)
++EXTRA_CFLAGS += -DCONFIG_BIG_ENDIAN
++ARCH := mips
++CROSS_COMPILE := mips-openwrt-linux-
++KSRC := /home/alex/test_openwrt/tmp/linux-2.6.30.9
++endif
++
++ifeq ($(CONFIG_PLATFORM_DMP_PHILIPS), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DRTK_DMP_PLATFORM
++ARCH := mips
++#CROSS_COMPILE:=/usr/local/msdk-4.3.6-mips-EL-2.6.12.6-0.9.30.3/bin/mipsel-linux-
++CROSS_COMPILE:=/usr/local/toolchain_mipsel/bin/mipsel-linux-
++KSRC ?=/usr/local/Jupiter/linux-2.6.12
++endif
++
++ifeq ($(CONFIG_PLATFORM_RTK_DMP), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DRTK_DMP_PLATFORM
++ARCH:=mips
++CROSS_COMPILE:=mipsel-linux-
++KVER:=
++KSRC ?= /usr/src/DMP_Kernel/jupiter/linux-2.6.12
++endif
++
++ifeq ($(CONFIG_PLATFORM_MT53XX), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_MT53XX
++ARCH:= arm
++CROSS_COMPILE:= arm11_mtk_le-
++KVER:= 2.6.27
++KSRC?= /proj/mtk00802/BD_Compare/BDP/Dev/BDP_V301/BDP_Linux/linux-2.6.27
++endif
++
++ifeq ($(CONFIG_PLATFORM_ARM_MX51_241H), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_WISTRON_PLATFORM
++ARCH := arm
++CROSS_COMPILE := /opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-
++KVER := 2.6.31
++KSRC ?= /lib/modules/2.6.31-770-g0e46b52/source
++endif
++
++ifeq ($(CONFIG_PLATFORM_FS_MX61), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
++ARCH := arm
++CROSS_COMPILE := /home/share/CusEnv/FreeScale/arm-eabi-4.4.3/bin/arm-eabi-
++KSRC ?= /home/share/CusEnv/FreeScale/FS_kernel_env
++endif
++
++
++
++ifeq ($(CONFIG_PLATFORM_ACTIONS_ATJ227X), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ACTIONS_ATJ227X
++ARCH := mips
++CROSS_COMPILE := /home/cnsd4/project/actions/tools-2.6.27/bin/mipsel-linux-gnu-
++KVER := 2.6.27
++KSRC := /home/cnsd4/project/actions/linux-2.6.27.28
++endif
++
++ifeq ($(CONFIG_PLATFORM_TI_DM365), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_TI_DM365
++ARCH := arm
++CROSS_COMPILE := /home/cnsd4/Appro/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/bin/arm_v5t_le-
++KVER := 2.6.18
++KSRC := /home/cnsd4/Appro/mv_pro_5.0/montavista/pro/devkit/lsp/ti-davinci/linux-dm365
++endif
++
++ifeq ($(CONFIG_PLATFORM_TEGRA3_CARDHU), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
++# default setting for Android 4.1, 4.2
++EXTRA_CFLAGS += -DRTW_ENABLE_WIFI_CONTROL_FUNC
++EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
++EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
++EXTRA_CFLAGS += -DCONFIG_P2P_IPS
++ARCH := arm
++CROSS_COMPILE := /home/android_sdk/nvidia/tegra-16r3-partner-android-4.1_20120723/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
++KSRC := /home/android_sdk/nvidia/tegra-16r3-partner-android-4.1_20120723/out/target/product/cardhu/obj/KERNEL
++MODULE_NAME := wlan
++endif
++
++ifeq ($(CONFIG_PLATFORM_TEGRA4_DALMORE), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
++# default setting for Android 4.1, 4.2
++EXTRA_CFLAGS += -DRTW_ENABLE_WIFI_CONTROL_FUNC
++EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
++EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
++EXTRA_CFLAGS += -DCONFIG_P2P_IPS
++ARCH := arm
++CROSS_COMPILE := /home/android_sdk/nvidia/tegra-17r9-partner-android-4.2-dalmore_20130131/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
++KSRC := /home/android_sdk/nvidia/tegra-17r9-partner-android-4.2-dalmore_20130131/out/target/product/dalmore/obj/KERNEL
++MODULE_NAME := wlan
++endif
++
++ifeq ($(CONFIG_PLATFORM_ARM_TCC8900), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
++ARCH := arm
++CROSS_COMPILE := /home/android_sdk/Telechips/SDK_2304_20110613/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
++KSRC := /home/android_sdk/Telechips/SDK_2304_20110613/kernel
++MODULE_NAME := wlan
++endif
++
++ifeq ($(CONFIG_PLATFORM_ARM_TCC8920), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
++ARCH := arm
++CROSS_COMPILE := /home/android_sdk/Telechips/v12.06_r1-tcc-android-4.0.4/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
++KSRC := /home/android_sdk/Telechips/v12.06_r1-tcc-android-4.0.4/kernel
++MODULE_NAME := wlan
++endif
++
++ifeq ($(CONFIG_PLATFORM_ARM_TCC8920_JB42), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
++# default setting for Android 4.1, 4.2
++EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
++EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
++EXTRA_CFLAGS += -DCONFIG_P2P_IPS
++ARCH := arm
++CROSS_COMPILE := /home/android_sdk/Telechips/v13.03_r1-tcc-android-4.2.2_ds_patched/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
++KSRC := /home/android_sdk/Telechips/v13.03_r1-tcc-android-4.2.2_ds_patched/kernel
++MODULE_NAME := wlan
++endif
++
++ifeq ($(CONFIG_PLATFORM_ARM_RK2818), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ANDROID -DCONFIG_PLATFORM_ROCKCHIPS -DCONFIG_MINIMAL_MEMORY_USAGE
++ARCH := arm
++CROSS_COMPILE := /usr/src/release_fae_version/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
++KSRC := /usr/src/release_fae_version/kernel25_A7_281x
++MODULE_NAME := wlan
++endif
++
++ifeq ($(CONFIG_PLATFORM_ARM_TI_PANDA), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN #-DCONFIG_MINIMAL_MEMORY_USAGE
++ARCH := arm
++#CROSS_COMPILE := /media/DATA-1/aosp/ics-aosp_20111227/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
++#KSRC := /media/DATA-1/aosp/android-omap-panda-3.0_20120104
++CROSS_COMPILE := /media/DATA-1/android-4.0/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
++KSRC := /media/DATA-1/android-4.0/panda_kernel/omap
++MODULE_NAME := wlan
++endif
++
++ifeq ($(CONFIG_PLATFORM_MIPS_JZ4760), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_MINIMAL_MEMORY_USAGE
++ARCH ?= mips
++CROSS_COMPILE ?= /mnt/sdb5/Ingenic/Umido/mips-4.3/bin/mips-linux-gnu-
++KSRC ?= /mnt/sdb5/Ingenic/Umido/kernel
++endif
++
++#Add setting for MN10300
++ifeq ($(CONFIG_PLATFORM_MN10300), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_MN10300
++ARCH := mn10300
++CROSS_COMPILE := mn10300-linux-
++KVER := 2.6.32.2
++KSRC := /home/winuser/work/Plat_sLD2T_V3010/usr/src/linux-2.6.32.2
++INSTALL_PREFIX :=
++endif
++
++ifeq ($(CONFIG_PLATFORM_ARM_SUNxI), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_ARM_SUNxI
++ARCH := arm
++CROSS_COMPILE := arm-none-linux-gnueabi-
++KVER := 3.0.8
++#KSRC:= ../lichee/linux-3.0/
++endif
++
++ifeq ($(CONFIG_PLATFORM_ARM_SUN6I), y)
++EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
++EXTRA_CFLAGS += -DCONFIG_PLATFORM_ARM_SUN6I
++EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_TX
++EXTRA_CFLAGS += -DCONFIG_TRAFFIC_PROTECT
++# default setting for Android 4.1, 4.2
++EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE
++EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
++EXTRA_CFLAGS += -DCONFIG_P2P_IPS
++ARCH := arm
++CROSS_COMPILE := arm-none-linux-gnueabi-
++KVER := 3.3.0
++#KSRC:= ../lichee/linux-3.3/
++endif
++
++ifneq ($(USER_MODULE_NAME),)
++MODULE_NAME := $(USER_MODULE_NAME)
++endif
++
++ifeq ($(CONFIG_MP_INCLUDED), y)
++MODULE_NAME := $(MODULE_NAME)_mp
++EXTRA_CFLAGS += -DCONFIG_MP_INCLUDED
++endif
++
++
++ifneq ($(KERNELRELEASE),)
++
++
++rtk_core := core/rtw_cmd.o \
++ core/rtw_security.o \
++ core/rtw_debug.o \
++ core/rtw_io.o \
++ core/rtw_ioctl_query.o \
++ core/rtw_ioctl_set.o \
++ core/rtw_ieee80211.o \
++ core/rtw_mlme.o \
++ core/rtw_mlme_ext.o \
++ core/rtw_wlan_util.o \
++ core/rtw_pwrctrl.o \
++ core/rtw_rf.o \
++ core/rtw_recv.o \
++ core/rtw_sta_mgt.o \
++ core/rtw_ap.o \
++ core/rtw_xmit.o \
++ core/rtw_p2p.o \
++ core/rtw_tdls.o \
++ core/rtw_br_ext.o \
++ core/rtw_iol.o \
++ core/rtw_sreset.o
++
++$(MODULE_NAME)-y += $(rtk_core)
++
++$(MODULE_NAME)-$(CONFIG_INTEL_WIDI) += core/rtw_intel_widi.o
++
++$(MODULE_NAME)-y += core/efuse/rtw_efuse.o
++
++$(MODULE_NAME)-y += $(_HAL_INTFS_FILES)
++
++$(MODULE_NAME)-y += $(_OS_INTFS_FILES)
++
++$(MODULE_NAME)-$(CONFIG_MP_INCLUDED) += core/rtw_mp.o \
++ core/rtw_mp_ioctl.o
++
++obj-$(CONFIG_RTL8192CU) := $(MODULE_NAME).o
++
++else
++
++export CONFIG_RTL8192CU = m
++
++all: modules
++
++modules:
++ $(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KSRC) M=$(shell pwd) modules
++
++strip:
++ $(CROSS_COMPILE)strip $(MODULE_NAME).ko --strip-unneeded
++
++install:
++ install -p -m 644 $(MODULE_NAME).ko $(MODDESTDIR)
++ /sbin/depmod -a ${KVER}
++
++uninstall:
++ rm -f $(MODDESTDIR)/$(MODULE_NAME).ko
++ /sbin/depmod -a ${KVER}
++
++
++config_r:
++ @echo "make config"
++ /bin/bash script/Configure script/config.in
++
++.PHONY: modules clean
++
++clean:
++ rm -fr *.mod.c *.mod *.o .*.cmd *.ko *~
++ rm .tmp_versions -fr ; rm Module.symvers -fr
++ rm -fr Module.markers ; rm -fr modules.order
++ cd core/efuse ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
++ cd core ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
++ cd hal/$(RTL871X)/$(HCI_NAME) ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
++ cd hal/$(RTL871X) ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
++ cd hal ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
++ cd os_dep/linux ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
++ cd os_dep ; rm -fr *.mod.c *.mod *.o .*.cmd *.ko
++endif
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_cfg80211.c linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_cfg80211.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_cfg80211.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_cfg80211.c 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,5488 @@
+/******************************************************************************
+ *
@@ -208021,9 +210487,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_cfg80211
+}
+
+#endif //CONFIG_IOCTL_CFG80211
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_linux.c linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_linux.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_linux.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_linux.c 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_linux.c linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_linux.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_linux.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_linux.c 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,11908 @@
+/******************************************************************************
+ *
@@ -219933,9 +222399,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_linux.c
+#endif
+};
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/mlme_linux.c linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/mlme_linux.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/mlme_linux.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/mlme_linux.c 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/os_dep/linux/mlme_linux.c linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/mlme_linux.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/os_dep/linux/mlme_linux.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/mlme_linux.c 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,585 @@
+/******************************************************************************
+ *
@@ -220522,9 +222988,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/mlme_linux.c l
+
+#endif
+#endif
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/os_intfs.c linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/os_intfs.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/os_intfs.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/os_intfs.c 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/os_dep/linux/os_intfs.c linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/os_intfs.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/os_dep/linux/os_intfs.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/os_intfs.c 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,2748 @@
+/******************************************************************************
+ *
@@ -223274,9 +225740,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/os_intfs.c lin
+#endif
+ free_netdev(ndev);
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_intf.c linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_intf.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_intf.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_intf.c 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_intf.c linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_intf.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_intf.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_intf.c 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,1996 @@
+/******************************************************************************
+ *
@@ -225274,9 +227740,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_intf.c lin
+
+module_init(rtw_drv_entry);
+module_exit(rtw_drv_halt);
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_ops_linux.c linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_ops_linux.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_ops_linux.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_ops_linux.c 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_ops_linux.c linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_ops_linux.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_ops_linux.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_ops_linux.c 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,21 @@
+/******************************************************************************
+ *
@@ -225299,9 +227765,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_ops_linux.
+#define _PCI_OPS_LINUX_C_
+
+#include <drv_types.h>
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/recv_linux.c linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/recv_linux.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/recv_linux.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/recv_linux.c 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/os_dep/linux/recv_linux.c linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/recv_linux.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/os_dep/linux/recv_linux.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/recv_linux.c 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,447 @@
+/******************************************************************************
+ *
@@ -225750,9 +228216,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/recv_linux.c l
+ _init_timer(&(preorder_ctrl->reordering_ctrl_timer), padapter->pnetdev, _rtw_reordering_ctrl_timeout_handler, preorder_ctrl);
+
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/rtw_android.c linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/rtw_android.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/rtw_android.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/rtw_android.c 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/os_dep/linux/rtw_android.c linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/rtw_android.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/os_dep/linux/rtw_android.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/rtw_android.c 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,838 @@
+/******************************************************************************
+ *
@@ -226592,9 +229058,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/rtw_android.c
+ platform_driver_unregister(&wifi_device_legacy);
+}
+#endif /* defined(RTW_ENABLE_WIFI_CONTROL_FUNC) */
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_intf.c linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_intf.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_intf.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_intf.c 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_intf.c linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_intf.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_intf.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_intf.c 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,1655 @@
+/******************************************************************************
+ *
@@ -228251,9 +230717,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_intf.c lin
+}
+EXPORT_SYMBOL(rtw_usb_get_sw_pointer);
+#endif //CONFIG_INTEL_PROXIM
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_ops_linux.c linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_ops_linux.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_ops_linux.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_ops_linux.c 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_ops_linux.c linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_ops_linux.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_ops_linux.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_ops_linux.c 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,648 @@
+/******************************************************************************
+ *
@@ -228903,9 +231369,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_ops_linux.
+ pxmitbuf++;
+ }
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/xmit_linux.c linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/xmit_linux.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/xmit_linux.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/xmit_linux.c 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/os_dep/linux/xmit_linux.c linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/xmit_linux.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/os_dep/linux/xmit_linux.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/linux/xmit_linux.c 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,420 @@
+/******************************************************************************
+ *
@@ -229327,9 +231793,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/linux/xmit_linux.c l
+ rtw_mstat_update(MSTAT_TYPE_SKB, MSTAT_ALLOC_SUCCESS, pkt->truesize);
+ return _rtw_xmit_entry(pkt, pnetdev);
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/osdep_service.c linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/osdep_service.c
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/osdep_service.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/osdep_service.c 2015-08-26 10:26:08.765316497 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/os_dep/osdep_service.c linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/osdep_service.c
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/os_dep/osdep_service.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/os_dep/osdep_service.c 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,2299 @@
+/******************************************************************************
+ *
@@ -231630,9 +234096,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/os_dep/osdep_service.c linu
+{
+ rtw_mfree((u8*)cbuf, sizeof(*cbuf) + sizeof(void*)*cbuf->size);
+}
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/runwpa linux-rpi/drivers/net/wireless/rtl8192cu/runwpa
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/runwpa 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/runwpa 2015-08-26 10:26:08.769316552 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/runwpa linux-rpi/drivers/net/wireless/rtl8192cu/runwpa
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/runwpa 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/runwpa 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,18 @@
+#!/bin/bash
+
@@ -231652,9 +234118,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/runwpa linux-rpi/drivers/ne
+
+ fi
+fi
-diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/wlan0dhcp linux-rpi/drivers/net/wireless/rtl8192cu/wlan0dhcp
---- linux-4.1.6/drivers/net/wireless/rtl8192cu/wlan0dhcp 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/net/wireless/rtl8192cu/wlan0dhcp 2015-08-26 10:26:08.769316552 +0200
+diff -Nur linux-4.1.10/drivers/net/wireless/rtl8192cu/wlan0dhcp linux-rpi/drivers/net/wireless/rtl8192cu/wlan0dhcp
+--- linux-4.1.10/drivers/net/wireless/rtl8192cu/wlan0dhcp 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/net/wireless/rtl8192cu/wlan0dhcp 2015-10-07 16:40:51.000000000 +0200
@@ -0,0 +1,15 @@
+#!/bin/bash
+
@@ -231671,9 +234137,9 @@ diff -Nur linux-4.1.6/drivers/net/wireless/rtl8192cu/wlan0dhcp linux-rpi/drivers
+rm -f /etc/sysconfig/network-scripts/ifcfg-wlan0
+
+echo "get ip: $var1"
-diff -Nur linux-4.1.6/drivers/of/fdt.c linux-rpi/drivers/of/fdt.c
---- linux-4.1.6/drivers/of/fdt.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/of/fdt.c 2015-08-26 10:26:08.809317108 +0200
+diff -Nur linux-4.1.10/drivers/of/fdt.c linux-rpi/drivers/of/fdt.c
+--- linux-4.1.10/drivers/of/fdt.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/of/fdt.c 2015-10-07 16:40:51.000000000 +0200
@@ -933,19 +933,38 @@
/* Retrieve command line */
@@ -231718,20 +234184,9 @@ diff -Nur linux-4.1.6/drivers/of/fdt.c linux-rpi/drivers/of/fdt.c
#endif /* CONFIG_CMDLINE */
pr_debug("Command line is: %s\n", (char*)data);
-diff -Nur linux-4.1.6/drivers/pinctrl/Makefile linux-rpi/drivers/pinctrl/Makefile
---- linux-4.1.6/drivers/pinctrl/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/pinctrl/Makefile 2015-08-26 10:26:08.837317497 +0200
-@@ -38,6 +38,7 @@
- obj-$(CONFIG_PINCTRL_ST) += pinctrl-st.o
- obj-$(CONFIG_PINCTRL_ZYNQ) += pinctrl-zynq.o
-
-+obj-$(CONFIG_ARCH_BCM2708)$(CONFIG_ARCH_BCM2709) += bcm/
- obj-$(CONFIG_ARCH_BCM) += bcm/
- obj-$(CONFIG_ARCH_BERLIN) += berlin/
- obj-y += freescale/
-diff -Nur linux-4.1.6/drivers/pinctrl/bcm/pinctrl-bcm2835.c linux-rpi/drivers/pinctrl/bcm/pinctrl-bcm2835.c
---- linux-4.1.6/drivers/pinctrl/bcm/pinctrl-bcm2835.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/pinctrl/bcm/pinctrl-bcm2835.c 2015-08-26 10:26:08.837317497 +0200
+diff -Nur linux-4.1.10/drivers/pinctrl/bcm/pinctrl-bcm2835.c linux-rpi/drivers/pinctrl/bcm/pinctrl-bcm2835.c
+--- linux-4.1.10/drivers/pinctrl/bcm/pinctrl-bcm2835.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/pinctrl/bcm/pinctrl-bcm2835.c 2015-10-07 16:40:51.000000000 +0200
@@ -47,6 +47,7 @@
#define MODULE_NAME "pinctrl-bcm2835"
#define BCM2835_NUM_GPIOS 54
@@ -231886,9 +234341,20 @@ diff -Nur linux-4.1.6/drivers/pinctrl/bcm/pinctrl-bcm2835.c linux-rpi/drivers/pi
.of_match_table = bcm2835_pinctrl_match,
},
};
-diff -Nur linux-4.1.6/drivers/power/reset/gpio-poweroff.c linux-rpi/drivers/power/reset/gpio-poweroff.c
---- linux-4.1.6/drivers/power/reset/gpio-poweroff.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/power/reset/gpio-poweroff.c 2015-08-26 10:26:08.881318109 +0200
+diff -Nur linux-4.1.10/drivers/pinctrl/Makefile linux-rpi/drivers/pinctrl/Makefile
+--- linux-4.1.10/drivers/pinctrl/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/pinctrl/Makefile 2015-10-07 16:40:51.000000000 +0200
+@@ -38,6 +38,7 @@
+ obj-$(CONFIG_PINCTRL_ST) += pinctrl-st.o
+ obj-$(CONFIG_PINCTRL_ZYNQ) += pinctrl-zynq.o
+
++obj-$(CONFIG_ARCH_BCM2708)$(CONFIG_ARCH_BCM2709) += bcm/
+ obj-$(CONFIG_ARCH_BCM) += bcm/
+ obj-$(CONFIG_ARCH_BERLIN) += berlin/
+ obj-y += freescale/
+diff -Nur linux-4.1.10/drivers/power/reset/gpio-poweroff.c linux-rpi/drivers/power/reset/gpio-poweroff.c
+--- linux-4.1.10/drivers/power/reset/gpio-poweroff.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/power/reset/gpio-poweroff.c 2015-10-07 16:40:51.000000000 +0200
@@ -48,9 +48,11 @@
static int gpio_poweroff_probe(struct platform_device *pdev)
{
@@ -231902,9 +234368,9 @@ diff -Nur linux-4.1.6/drivers/power/reset/gpio-poweroff.c linux-rpi/drivers/powe
dev_err(&pdev->dev,
"%s: pm_power_off function already registered",
__func__);
-diff -Nur linux-4.1.6/drivers/pwm/Kconfig linux-rpi/drivers/pwm/Kconfig
---- linux-4.1.6/drivers/pwm/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/pwm/Kconfig 2015-08-26 10:26:08.885318164 +0200
+diff -Nur linux-4.1.10/drivers/pwm/Kconfig linux-rpi/drivers/pwm/Kconfig
+--- linux-4.1.10/drivers/pwm/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/pwm/Kconfig 2015-10-07 16:40:51.000000000 +0200
@@ -85,7 +85,7 @@
config PWM_BCM2835
@@ -231914,9 +234380,9 @@ diff -Nur linux-4.1.6/drivers/pwm/Kconfig linux-rpi/drivers/pwm/Kconfig
help
PWM framework driver for BCM2835 controller (Raspberry Pi)
-diff -Nur linux-4.1.6/drivers/rtc/rtc-ds1307.c linux-rpi/drivers/rtc/rtc-ds1307.c
---- linux-4.1.6/drivers/rtc/rtc-ds1307.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/rtc/rtc-ds1307.c 2015-08-26 10:26:08.905318442 +0200
+diff -Nur linux-4.1.10/drivers/rtc/rtc-ds1307.c linux-rpi/drivers/rtc/rtc-ds1307.c
+--- linux-4.1.10/drivers/rtc/rtc-ds1307.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/rtc/rtc-ds1307.c 2015-10-07 16:40:51.000000000 +0200
@@ -1242,6 +1242,14 @@
return 0;
}
@@ -231932,9 +234398,9 @@ diff -Nur linux-4.1.6/drivers/rtc/rtc-ds1307.c linux-rpi/drivers/rtc/rtc-ds1307.
static struct i2c_driver ds1307_driver = {
.driver = {
.name = "rtc-ds1307",
-diff -Nur linux-4.1.6/drivers/spi/Kconfig linux-rpi/drivers/spi/Kconfig
---- linux-4.1.6/drivers/spi/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/spi/Kconfig 2015-08-26 10:26:09.069320718 +0200
+diff -Nur linux-4.1.10/drivers/spi/Kconfig linux-rpi/drivers/spi/Kconfig
+--- linux-4.1.10/drivers/spi/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/spi/Kconfig 2015-10-07 16:40:53.000000000 +0200
@@ -77,7 +77,7 @@
config SPI_BCM2835
@@ -231959,9 +234425,9 @@ diff -Nur linux-4.1.6/drivers/spi/Kconfig linux-rpi/drivers/spi/Kconfig
config SPI_BFIN5XX
tristate "SPI controller driver for ADI Blackfin5xx"
depends on BLACKFIN && !BF60x
-diff -Nur linux-4.1.6/drivers/spi/Makefile linux-rpi/drivers/spi/Makefile
---- linux-4.1.6/drivers/spi/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/spi/Makefile 2015-08-26 10:26:09.069320718 +0200
+diff -Nur linux-4.1.10/drivers/spi/Makefile linux-rpi/drivers/spi/Makefile
+--- linux-4.1.10/drivers/spi/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/spi/Makefile 2015-10-07 16:40:53.000000000 +0200
@@ -20,6 +20,7 @@
obj-$(CONFIG_SPI_BCM63XX_HSSPI) += spi-bcm63xx-hsspi.o
obj-$(CONFIG_SPI_BFIN5XX) += spi-bfin5xx.o
@@ -231970,9 +234436,9 @@ diff -Nur linux-4.1.6/drivers/spi/Makefile linux-rpi/drivers/spi/Makefile
obj-$(CONFIG_SPI_BFIN_SPORT) += spi-bfin-sport.o
obj-$(CONFIG_SPI_BITBANG) += spi-bitbang.o
obj-$(CONFIG_SPI_BUTTERFLY) += spi-butterfly.o
-diff -Nur linux-4.1.6/drivers/spi/spi-bcm2708.c linux-rpi/drivers/spi/spi-bcm2708.c
---- linux-4.1.6/drivers/spi/spi-bcm2708.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/spi/spi-bcm2708.c 2015-08-26 10:26:09.069320718 +0200
+diff -Nur linux-4.1.10/drivers/spi/spi-bcm2708.c linux-rpi/drivers/spi/spi-bcm2708.c
+--- linux-4.1.10/drivers/spi/spi-bcm2708.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/spi/spi-bcm2708.c 2015-10-07 16:40:53.000000000 +0200
@@ -0,0 +1,628 @@
+/*
+ * Driver for Broadcom BCM2708 SPI Controllers
@@ -232602,9 +235068,9 @@ diff -Nur linux-4.1.6/drivers/spi/spi-bcm2708.c linux-rpi/drivers/spi/spi-bcm270
+MODULE_AUTHOR("Chris Boot <bootc@bootc.net>");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:" DRV_NAME);
-diff -Nur linux-4.1.6/drivers/spi/spi-bcm2835.c linux-rpi/drivers/spi/spi-bcm2835.c
---- linux-4.1.6/drivers/spi/spi-bcm2835.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/spi/spi-bcm2835.c 2015-08-26 10:26:09.069320718 +0200
+diff -Nur linux-4.1.10/drivers/spi/spi-bcm2835.c linux-rpi/drivers/spi/spi-bcm2835.c
+--- linux-4.1.10/drivers/spi/spi-bcm2835.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/spi/spi-bcm2835.c 2015-10-07 16:40:53.000000000 +0200
@@ -20,18 +20,22 @@
* GNU General Public License for more details.
*/
@@ -232707,7 +235173,7 @@ diff -Nur linux-4.1.6/drivers/spi/spi-bcm2835.c linux-rpi/drivers/spi/spi-bcm283
static int bcm2835_spi_transfer_one_irq(struct spi_master *master,
struct spi_device *spi,
struct spi_transfer *tfr,
-@@ -229,6 +202,329 @@
+@@ -229,13 +202,337 @@
return 1;
}
@@ -232895,14 +235361,14 @@ diff -Nur linux-4.1.6/drivers/spi/spi-bcm2835.c linux-rpi/drivers/spi/spi-bcm283
+ /* otherwise we only allow transfers within the same page
+ * to avoid wasting time on dma_mapping when it is not practical
+ */
-+ if (((size_t)tfr->tx_buf & PAGE_MASK) + tfr->len > PAGE_SIZE) {
++ if (((size_t)tfr->tx_buf & (PAGE_SIZE - 1)) + tfr->len > PAGE_SIZE) {
+ dev_warn_once(&spi->dev,
+ "Unaligned spi tx-transfer bridging page\n");
+ return false;
+ }
-+ if (((size_t)tfr->rx_buf & PAGE_MASK) + tfr->len > PAGE_SIZE) {
++ if (((size_t)tfr->rx_buf & (PAGE_SIZE - 1)) + tfr->len > PAGE_SIZE) {
+ dev_warn_once(&spi->dev,
-+ "Unaligned spi tx-transfer bridging page\n");
++ "Unaligned spi rx-transfer bridging page\n");
+ return false;
+ }
+
@@ -232989,7 +235455,7 @@ diff -Nur linux-4.1.6/drivers/spi/spi-bcm2835.c linux-rpi/drivers/spi/spi-bcm283
+ struct spi_device *spi,
+ struct spi_transfer *tfr,
+ u32 cs,
-+ unsigned long xfer_time_us)
++ unsigned long long xfer_time_us)
+{
+ struct bcm2835_spi *bs = spi_master_get_devdata(master);
+ unsigned long timeout;
@@ -233037,7 +235503,28 @@ diff -Nur linux-4.1.6/drivers/spi/spi-bcm2835.c linux-rpi/drivers/spi/spi-bcm283
static int bcm2835_spi_transfer_one(struct spi_master *master,
struct spi_device *spi,
struct spi_transfer *tfr)
-@@ -288,12 +584,26 @@
+ {
+ struct bcm2835_spi *bs = spi_master_get_devdata(master);
+ unsigned long spi_hz, clk_hz, cdiv;
+- unsigned long spi_used_hz, xfer_time_us;
++ unsigned long spi_used_hz;
++ unsigned long long xfer_time_us;
+ u32 cs = bcm2835_rd(bs, BCM2835_SPI_CS);
+
+ /* set clock */
+@@ -277,15 +574,21 @@
+ bs->rx_len = tfr->len;
+
+ /* calculate the estimated time in us the transfer runs */
+- xfer_time_us = tfr->len
++ xfer_time_us = (unsigned long long)tfr->len
+ * 9 /* clocks/byte - SPI-HW waits 1 clock after each byte */
+- * 1000000 / spi_used_hz;
++ * 1000000;
++ do_div(xfer_time_us, spi_used_hz);
+
+ /* for short requests run polling*/
+ if (xfer_time_us <= BCM2835_SPI_POLLING_LIMIT_US)
return bcm2835_spi_transfer_one_poll(master, spi, tfr,
cs, xfer_time_us);
@@ -233049,6 +235536,7 @@ diff -Nur linux-4.1.6/drivers/spi/spi-bcm2835.c linux-rpi/drivers/spi/spi-bcm283
return bcm2835_spi_transfer_one_irq(master, spi, tfr, cs);
}
+@@ -311,6 +614,15 @@
static void bcm2835_spi_handle_err(struct spi_master *master,
struct spi_message *msg)
{
@@ -233064,7 +235552,7 @@ diff -Nur linux-4.1.6/drivers/spi/spi-bcm2835.c linux-rpi/drivers/spi/spi-bcm283
bcm2835_spi_reset_hw(master);
}
-@@ -359,6 +669,8 @@
+@@ -376,6 +688,8 @@
{
int err;
struct gpio_chip *chip;
@@ -233073,7 +235561,7 @@ diff -Nur linux-4.1.6/drivers/spi/spi-bcm2835.c linux-rpi/drivers/spi/spi-bcm283
/*
* sanity checking the native-chipselects
*/
-@@ -375,15 +687,42 @@
+@@ -392,15 +706,42 @@
"setup: only two native chip-selects are supported\n");
return -EINVAL;
}
@@ -233123,7 +235611,7 @@ diff -Nur linux-4.1.6/drivers/spi/spi-bcm2835.c linux-rpi/drivers/spi/spi-bcm283
/* and set up the "mode" and level */
dev_info(&spi->dev, "setting up native-CS%i as GPIO %i\n",
-@@ -463,6 +802,8 @@
+@@ -481,6 +822,8 @@
goto out_clk_disable;
}
@@ -233132,7 +235620,7 @@ diff -Nur linux-4.1.6/drivers/spi/spi-bcm2835.c linux-rpi/drivers/spi/spi-bcm283
/* initialise the hardware with the default polarities */
bcm2835_wr(bs, BCM2835_SPI_CS,
BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX);
-@@ -493,6 +834,8 @@
+@@ -511,6 +854,8 @@
clk_disable_unprepare(bs->clk);
@@ -233141,9 +235629,9 @@ diff -Nur linux-4.1.6/drivers/spi/spi-bcm2835.c linux-rpi/drivers/spi/spi-bcm283
return 0;
}
-diff -Nur linux-4.1.6/drivers/spi/spidev.c linux-rpi/drivers/spi/spidev.c
---- linux-4.1.6/drivers/spi/spidev.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/spi/spidev.c 2015-08-26 10:26:09.077320829 +0200
+diff -Nur linux-4.1.10/drivers/spi/spidev.c linux-rpi/drivers/spi/spidev.c
+--- linux-4.1.10/drivers/spi/spidev.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/spi/spidev.c 2015-10-07 16:40:53.000000000 +0200
@@ -706,6 +706,7 @@
#ifdef CONFIG_OF
static const struct of_device_id spidev_dt_ids[] = {
@@ -233152,9 +235640,9 @@ diff -Nur linux-4.1.6/drivers/spi/spidev.c linux-rpi/drivers/spi/spidev.c
{},
};
MODULE_DEVICE_TABLE(of, spidev_dt_ids);
-diff -Nur linux-4.1.6/drivers/staging/fbtft/fbtft-core.c linux-rpi/drivers/staging/fbtft/fbtft-core.c
---- linux-4.1.6/drivers/staging/fbtft/fbtft-core.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/staging/fbtft/fbtft-core.c 2015-08-26 10:26:09.109321272 +0200
+diff -Nur linux-4.1.10/drivers/staging/fbtft/fbtft-core.c linux-rpi/drivers/staging/fbtft/fbtft-core.c
+--- linux-4.1.10/drivers/staging/fbtft/fbtft-core.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/staging/fbtft/fbtft-core.c 2015-10-07 16:40:53.000000000 +0200
@@ -1074,6 +1074,11 @@
p = of_prop_next_u32(prop, NULL, &val);
if (!p)
@@ -233167,9 +235655,9 @@ diff -Nur linux-4.1.6/drivers/staging/fbtft/fbtft-core.c linux-rpi/drivers/stagi
while (p) {
if (val & FBTFT_OF_INIT_CMD) {
val &= 0xFFFF;
-diff -Nur linux-4.1.6/drivers/staging/media/lirc/Kconfig linux-rpi/drivers/staging/media/lirc/Kconfig
---- linux-4.1.6/drivers/staging/media/lirc/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/staging/media/lirc/Kconfig 2015-08-26 10:26:09.169322103 +0200
+diff -Nur linux-4.1.10/drivers/staging/media/lirc/Kconfig linux-rpi/drivers/staging/media/lirc/Kconfig
+--- linux-4.1.10/drivers/staging/media/lirc/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/staging/media/lirc/Kconfig 2015-10-07 16:40:54.000000000 +0200
@@ -32,6 +32,12 @@
help
Driver for Homebrew Parallel Port Receivers
@@ -233183,20 +235671,9 @@ diff -Nur linux-4.1.6/drivers/staging/media/lirc/Kconfig linux-rpi/drivers/stagi
config LIRC_SASEM
tristate "Sasem USB IR Remote"
depends on LIRC && USB
-diff -Nur linux-4.1.6/drivers/staging/media/lirc/Makefile linux-rpi/drivers/staging/media/lirc/Makefile
---- linux-4.1.6/drivers/staging/media/lirc/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/staging/media/lirc/Makefile 2015-08-26 10:26:09.169322103 +0200
-@@ -6,6 +6,7 @@
- obj-$(CONFIG_LIRC_BT829) += lirc_bt829.o
- obj-$(CONFIG_LIRC_IMON) += lirc_imon.o
- obj-$(CONFIG_LIRC_PARALLEL) += lirc_parallel.o
-+obj-$(CONFIG_LIRC_RPI) += lirc_rpi.o
- obj-$(CONFIG_LIRC_SASEM) += lirc_sasem.o
- obj-$(CONFIG_LIRC_SERIAL) += lirc_serial.o
- obj-$(CONFIG_LIRC_SIR) += lirc_sir.o
-diff -Nur linux-4.1.6/drivers/staging/media/lirc/lirc_rpi.c linux-rpi/drivers/staging/media/lirc/lirc_rpi.c
---- linux-4.1.6/drivers/staging/media/lirc/lirc_rpi.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/staging/media/lirc/lirc_rpi.c 2015-08-26 10:26:09.169322103 +0200
+diff -Nur linux-4.1.10/drivers/staging/media/lirc/lirc_rpi.c linux-rpi/drivers/staging/media/lirc/lirc_rpi.c
+--- linux-4.1.10/drivers/staging/media/lirc/lirc_rpi.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/staging/media/lirc/lirc_rpi.c 2015-10-07 16:40:54.000000000 +0200
@@ -0,0 +1,765 @@
+/*
+ * lirc_rpi.c
@@ -233963,37 +236440,20 @@ diff -Nur linux-4.1.6/drivers/staging/media/lirc/lirc_rpi.c linux-rpi/drivers/st
+
+module_param(debug, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(debug, "Enable debugging messages");
-diff -Nur linux-4.1.6/drivers/thermal/Kconfig linux-rpi/drivers/thermal/Kconfig
---- linux-4.1.6/drivers/thermal/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/thermal/Kconfig 2015-08-26 10:26:11.733357477 +0200
-@@ -238,6 +238,13 @@
- enforce idle time which results in more package C-state residency. The
- user interface is exposed via generic thermal framework.
-
-+config THERMAL_BCM2835
-+ depends on RASPBERRYPI_FIRMWARE
-+ tristate "BCM2835 Thermal Driver"
-+ help
-+ This will enable temperature monitoring for the Broadcom BCM2835
-+ chip. If built as a module, it will be called 'bcm2835-thermal'.
-+
- config X86_PKG_TEMP_THERMAL
- tristate "X86 package temperature thermal driver"
- depends on X86_THERMAL_VECTOR
-diff -Nur linux-4.1.6/drivers/thermal/Makefile linux-rpi/drivers/thermal/Makefile
---- linux-4.1.6/drivers/thermal/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/thermal/Makefile 2015-08-26 10:26:11.733357477 +0200
-@@ -33,6 +33,7 @@
- obj-$(CONFIG_IMX_THERMAL) += imx_thermal.o
- obj-$(CONFIG_DB8500_CPUFREQ_COOLING) += db8500_cpufreq_cooling.o
- obj-$(CONFIG_INTEL_POWERCLAMP) += intel_powerclamp.o
-+obj-$(CONFIG_THERMAL_BCM2835) += bcm2835-thermal.o
- obj-$(CONFIG_X86_PKG_TEMP_THERMAL) += x86_pkg_temp_thermal.o
- obj-$(CONFIG_INTEL_SOC_DTS_THERMAL) += intel_soc_dts_thermal.o
- obj-$(CONFIG_TI_SOC_THERMAL) += ti-soc-thermal/
-diff -Nur linux-4.1.6/drivers/thermal/bcm2835-thermal.c linux-rpi/drivers/thermal/bcm2835-thermal.c
---- linux-4.1.6/drivers/thermal/bcm2835-thermal.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/thermal/bcm2835-thermal.c 2015-08-26 10:26:11.733357477 +0200
+diff -Nur linux-4.1.10/drivers/staging/media/lirc/Makefile linux-rpi/drivers/staging/media/lirc/Makefile
+--- linux-4.1.10/drivers/staging/media/lirc/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/staging/media/lirc/Makefile 2015-10-07 16:40:54.000000000 +0200
+@@ -6,6 +6,7 @@
+ obj-$(CONFIG_LIRC_BT829) += lirc_bt829.o
+ obj-$(CONFIG_LIRC_IMON) += lirc_imon.o
+ obj-$(CONFIG_LIRC_PARALLEL) += lirc_parallel.o
++obj-$(CONFIG_LIRC_RPI) += lirc_rpi.o
+ obj-$(CONFIG_LIRC_SASEM) += lirc_sasem.o
+ obj-$(CONFIG_LIRC_SERIAL) += lirc_serial.o
+ obj-$(CONFIG_LIRC_SIR) += lirc_sir.o
+diff -Nur linux-4.1.10/drivers/thermal/bcm2835-thermal.c linux-rpi/drivers/thermal/bcm2835-thermal.c
+--- linux-4.1.10/drivers/thermal/bcm2835-thermal.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/thermal/bcm2835-thermal.c 2015-10-07 16:40:55.000000000 +0200
@@ -0,0 +1,141 @@
+/*****************************************************************************
+* Copyright 2011 Broadcom Corporation. All rights reserved.
@@ -234136,9 +236596,37 @@ diff -Nur linux-4.1.6/drivers/thermal/bcm2835-thermal.c linux-rpi/drivers/therma
+MODULE_AUTHOR("Noralf Trønnes");
+MODULE_DESCRIPTION("Thermal driver for bcm2835 chip");
+MODULE_LICENSE("GPL");
-diff -Nur linux-4.1.6/drivers/tty/serial/8250/8250_core.c linux-rpi/drivers/tty/serial/8250/8250_core.c
---- linux-4.1.6/drivers/tty/serial/8250/8250_core.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/tty/serial/8250/8250_core.c 2015-08-26 10:26:11.745357642 +0200
+diff -Nur linux-4.1.10/drivers/thermal/Kconfig linux-rpi/drivers/thermal/Kconfig
+--- linux-4.1.10/drivers/thermal/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/thermal/Kconfig 2015-10-07 16:40:55.000000000 +0200
+@@ -238,6 +238,13 @@
+ enforce idle time which results in more package C-state residency. The
+ user interface is exposed via generic thermal framework.
+
++config THERMAL_BCM2835
++ depends on RASPBERRYPI_FIRMWARE
++ tristate "BCM2835 Thermal Driver"
++ help
++ This will enable temperature monitoring for the Broadcom BCM2835
++ chip. If built as a module, it will be called 'bcm2835-thermal'.
++
+ config X86_PKG_TEMP_THERMAL
+ tristate "X86 package temperature thermal driver"
+ depends on X86_THERMAL_VECTOR
+diff -Nur linux-4.1.10/drivers/thermal/Makefile linux-rpi/drivers/thermal/Makefile
+--- linux-4.1.10/drivers/thermal/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/thermal/Makefile 2015-10-07 16:40:55.000000000 +0200
+@@ -33,6 +33,7 @@
+ obj-$(CONFIG_IMX_THERMAL) += imx_thermal.o
+ obj-$(CONFIG_DB8500_CPUFREQ_COOLING) += db8500_cpufreq_cooling.o
+ obj-$(CONFIG_INTEL_POWERCLAMP) += intel_powerclamp.o
++obj-$(CONFIG_THERMAL_BCM2835) += bcm2835-thermal.o
+ obj-$(CONFIG_X86_PKG_TEMP_THERMAL) += x86_pkg_temp_thermal.o
+ obj-$(CONFIG_INTEL_SOC_DTS_THERMAL) += intel_soc_dts_thermal.o
+ obj-$(CONFIG_TI_SOC_THERMAL) += ti-soc-thermal/
+diff -Nur linux-4.1.10/drivers/tty/serial/8250/8250_core.c linux-rpi/drivers/tty/serial/8250/8250_core.c
+--- linux-4.1.10/drivers/tty/serial/8250/8250_core.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/tty/serial/8250/8250_core.c 2015-10-07 16:40:55.000000000 +0200
@@ -3262,6 +3262,8 @@
if (nr_uarts > UART_NR)
@@ -234148,9 +236636,9 @@ diff -Nur linux-4.1.6/drivers/tty/serial/8250/8250_core.c linux-rpi/drivers/tty/
for (i = 0; i < nr_uarts; i++) {
struct uart_8250_port *up = &serial8250_ports[i];
-diff -Nur linux-4.1.6/drivers/tty/serial/amba-pl011.c linux-rpi/drivers/tty/serial/amba-pl011.c
---- linux-4.1.6/drivers/tty/serial/amba-pl011.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/tty/serial/amba-pl011.c 2015-08-26 10:26:11.745357642 +0200
+diff -Nur linux-4.1.10/drivers/tty/serial/amba-pl011.c linux-rpi/drivers/tty/serial/amba-pl011.c
+--- linux-4.1.10/drivers/tty/serial/amba-pl011.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/tty/serial/amba-pl011.c 2015-10-07 16:40:55.000000000 +0200
@@ -85,7 +85,7 @@
static unsigned int get_fifosize_arm(struct amba_device *dev)
@@ -234160,20 +236648,9 @@ diff -Nur linux-4.1.6/drivers/tty/serial/amba-pl011.c linux-rpi/drivers/tty/seri
}
static struct vendor_data vendor_arm = {
-diff -Nur linux-4.1.6/drivers/usb/Makefile linux-rpi/drivers/usb/Makefile
---- linux-4.1.6/drivers/usb/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/usb/Makefile 2015-08-26 10:26:11.769357972 +0200
-@@ -7,6 +7,7 @@
- obj-$(CONFIG_USB) += core/
- obj-$(CONFIG_USB_SUPPORT) += phy/
-
-+obj-$(CONFIG_USB_DWCOTG) += host/
- obj-$(CONFIG_USB_DWC3) += dwc3/
- obj-$(CONFIG_USB_DWC2) += dwc2/
- obj-$(CONFIG_USB_ISP1760) += isp1760/
-diff -Nur linux-4.1.6/drivers/usb/core/generic.c linux-rpi/drivers/usb/core/generic.c
---- linux-4.1.6/drivers/usb/core/generic.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/usb/core/generic.c 2015-08-26 10:26:11.773358027 +0200
+diff -Nur linux-4.1.10/drivers/usb/core/generic.c linux-rpi/drivers/usb/core/generic.c
+--- linux-4.1.10/drivers/usb/core/generic.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/usb/core/generic.c 2015-10-07 16:40:56.000000000 +0200
@@ -152,6 +152,7 @@
dev_warn(&udev->dev,
"no configuration chosen from %d choice%s\n",
@@ -234182,9 +236659,9 @@ diff -Nur linux-4.1.6/drivers/usb/core/generic.c linux-rpi/drivers/usb/core/gene
}
return i;
}
-diff -Nur linux-4.1.6/drivers/usb/core/hub.c linux-rpi/drivers/usb/core/hub.c
---- linux-4.1.6/drivers/usb/core/hub.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/usb/core/hub.c 2015-08-26 10:26:11.777358082 +0200
+diff -Nur linux-4.1.10/drivers/usb/core/hub.c linux-rpi/drivers/usb/core/hub.c
+--- linux-4.1.10/drivers/usb/core/hub.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/usb/core/hub.c 2015-10-07 16:40:56.000000000 +0200
@@ -4906,7 +4906,7 @@
if (portchange & USB_PORT_STAT_C_OVERCURRENT) {
u16 status = 0, unused;
@@ -234194,9 +236671,9 @@ diff -Nur linux-4.1.6/drivers/usb/core/hub.c linux-rpi/drivers/usb/core/hub.c
usb_clear_port_feature(hdev, port1,
USB_PORT_FEAT_C_OVER_CURRENT);
msleep(100); /* Cool down */
-diff -Nur linux-4.1.6/drivers/usb/core/message.c linux-rpi/drivers/usb/core/message.c
---- linux-4.1.6/drivers/usb/core/message.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/usb/core/message.c 2015-08-26 10:26:11.777358082 +0200
+diff -Nur linux-4.1.10/drivers/usb/core/message.c linux-rpi/drivers/usb/core/message.c
+--- linux-4.1.10/drivers/usb/core/message.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/usb/core/message.c 2015-10-07 16:40:56.000000000 +0200
@@ -1872,6 +1872,85 @@
if (cp->string == NULL &&
!(dev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS))
@@ -234283,9 +236760,9 @@ diff -Nur linux-4.1.6/drivers/usb/core/message.c linux-rpi/drivers/usb/core/mess
/* Now that the interfaces are installed, re-enable LPM. */
usb_unlocked_enable_lpm(dev);
-diff -Nur linux-4.1.6/drivers/usb/core/otg_whitelist.h linux-rpi/drivers/usb/core/otg_whitelist.h
---- linux-4.1.6/drivers/usb/core/otg_whitelist.h 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/usb/core/otg_whitelist.h 2015-08-26 10:26:11.777358082 +0200
+diff -Nur linux-4.1.10/drivers/usb/core/otg_whitelist.h linux-rpi/drivers/usb/core/otg_whitelist.h
+--- linux-4.1.10/drivers/usb/core/otg_whitelist.h 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/usb/core/otg_whitelist.h 2015-10-07 16:40:56.000000000 +0200
@@ -19,33 +19,82 @@
static struct usb_device_id whitelist_table [] = {
@@ -234439,9 +236916,9 @@ diff -Nur linux-4.1.6/drivers/usb/core/otg_whitelist.h linux-rpi/drivers/usb/cor
return 0;
}
-diff -Nur linux-4.1.6/drivers/usb/gadget/file_storage.c linux-rpi/drivers/usb/gadget/file_storage.c
---- linux-4.1.6/drivers/usb/gadget/file_storage.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/gadget/file_storage.c 2015-08-26 10:26:11.785358192 +0200
+diff -Nur linux-4.1.10/drivers/usb/gadget/file_storage.c linux-rpi/drivers/usb/gadget/file_storage.c
+--- linux-4.1.10/drivers/usb/gadget/file_storage.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/gadget/file_storage.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,3676 @@
+/*
+ * file_storage.c -- File-backed USB Storage Gadget, for USB development
@@ -238119,180 +240596,9 @@ diff -Nur linux-4.1.6/drivers/usb/gadget/file_storage.c linux-rpi/drivers/usb/ga
+ kref_put(&fsg->ref, fsg_release);
+}
+module_exit(fsg_cleanup);
-diff -Nur linux-4.1.6/drivers/usb/host/Kconfig linux-rpi/drivers/usb/host/Kconfig
---- linux-4.1.6/drivers/usb/host/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/usb/host/Kconfig 2015-08-26 10:26:11.801358412 +0200
-@@ -738,6 +738,19 @@
- To compile this driver a module, choose M here: the module
- will be called "hwa-hc".
-
-+config USB_DWCOTG
-+ tristate "Synopsis DWC host support"
-+ depends on USB
-+ help
-+ The Synopsis DWC controller is a dual-role
-+ host/peripheral/OTG ("On The Go") USB controllers.
-+
-+ Enable this option to support this IP in host controller mode.
-+ If unsure, say N.
-+
-+ To compile this driver as a module, choose M here: the
-+ modules built will be called dwc_otg and dwc_common_port.
-+
- config USB_IMX21_HCD
- tristate "i.MX21 HCD support"
- depends on ARM && ARCH_MXC
-diff -Nur linux-4.1.6/drivers/usb/host/Makefile linux-rpi/drivers/usb/host/Makefile
---- linux-4.1.6/drivers/usb/host/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/usb/host/Makefile 2015-08-26 10:26:11.801358412 +0200
-@@ -68,6 +68,8 @@
- obj-$(CONFIG_USB_U132_HCD) += u132-hcd.o
- obj-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o
- obj-$(CONFIG_USB_HWA_HCD) += hwa-hc.o
-+
-+obj-$(CONFIG_USB_DWCOTG) += dwc_otg/ dwc_common_port/
- obj-$(CONFIG_USB_IMX21_HCD) += imx21-hcd.o
- obj-$(CONFIG_USB_FSL_MPH_DR_OF) += fsl-mph-dr-of.o
- obj-$(CONFIG_USB_HCD_BCMA) += bcma-hcd.o
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/Makefile linux-rpi/drivers/usb/host/dwc_common_port/Makefile
---- linux-4.1.6/drivers/usb/host/dwc_common_port/Makefile 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_common_port/Makefile 2015-08-26 10:26:11.801358412 +0200
-@@ -0,0 +1,58 @@
-+#
-+# Makefile for DWC_common library
-+#
-+
-+ifneq ($(KERNELRELEASE),)
-+
-+ccflags-y += -DDWC_LINUX
-+#ccflags-y += -DDEBUG
-+#ccflags-y += -DDWC_DEBUG_REGS
-+#ccflags-y += -DDWC_DEBUG_MEMORY
-+
-+ccflags-y += -DDWC_LIBMODULE
-+ccflags-y += -DDWC_CCLIB
-+#ccflags-y += -DDWC_CRYPTOLIB
-+ccflags-y += -DDWC_NOTIFYLIB
-+ccflags-y += -DDWC_UTFLIB
-+
-+obj-$(CONFIG_USB_DWCOTG) += dwc_common_port_lib.o
-+dwc_common_port_lib-objs := dwc_cc.o dwc_modpow.o dwc_dh.o \
-+ dwc_crypto.o dwc_notifier.o \
-+ dwc_common_linux.o dwc_mem.o
-+
-+kernrelwd := $(subst ., ,$(KERNELRELEASE))
-+kernrel3 := $(word 1,$(kernrelwd)).$(word 2,$(kernrelwd)).$(word 3,$(kernrelwd))
-+
-+ifneq ($(kernrel3),2.6.20)
-+# grayg - I only know that we use ccflags-y in 2.6.31 actually
-+ccflags-y += $(CPPFLAGS)
-+endif
-+
-+else
-+
-+#ifeq ($(KDIR),)
-+#$(error Must give "KDIR=/path/to/kernel/source" on command line or in environment)
-+#endif
-+
-+ifeq ($(ARCH),)
-+$(error Must give "ARCH=<arch>" on command line or in environment. Also, if \
-+ cross-compiling, must give "CROSS_COMPILE=/path/to/compiler/plus/tool-prefix-")
-+endif
-+
-+ifeq ($(DOXYGEN),)
-+DOXYGEN := doxygen
-+endif
-+
-+default:
-+ $(MAKE) -C$(KDIR) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules
-+
-+docs: $(wildcard *.[hc]) doc/doxygen.cfg
-+ $(DOXYGEN) doc/doxygen.cfg
-+
-+tags: $(wildcard *.[hc])
-+ $(CTAGS) -e $(wildcard *.[hc]) $(wildcard linux/*.[hc]) $(wildcard $(KDIR)/include/linux/usb*.h)
-+
-+endif
-+
-+clean:
-+ rm -rf *.o *.ko .*.cmd *.mod.c .*.o.d .*.o.tmp modules.order Module.markers Module.symvers .tmp_versions/
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/Makefile.fbsd linux-rpi/drivers/usb/host/dwc_common_port/Makefile.fbsd
---- linux-4.1.6/drivers/usb/host/dwc_common_port/Makefile.fbsd 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_common_port/Makefile.fbsd 2015-08-26 10:26:11.801358412 +0200
-@@ -0,0 +1,17 @@
-+CFLAGS += -I/sys/i386/compile/GENERIC -I/sys/i386/include -I/usr/include
-+CFLAGS += -DDWC_FREEBSD
-+CFLAGS += -DDEBUG
-+#CFLAGS += -DDWC_DEBUG_REGS
-+#CFLAGS += -DDWC_DEBUG_MEMORY
-+
-+#CFLAGS += -DDWC_LIBMODULE
-+#CFLAGS += -DDWC_CCLIB
-+#CFLAGS += -DDWC_CRYPTOLIB
-+#CFLAGS += -DDWC_NOTIFYLIB
-+#CFLAGS += -DDWC_UTFLIB
-+
-+KMOD = dwc_common_port_lib
-+SRCS = dwc_cc.c dwc_modpow.c dwc_dh.c dwc_crypto.c dwc_notifier.c \
-+ dwc_common_fbsd.c dwc_mem.c
-+
-+.include <bsd.kmod.mk>
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/Makefile.linux linux-rpi/drivers/usb/host/dwc_common_port/Makefile.linux
---- linux-4.1.6/drivers/usb/host/dwc_common_port/Makefile.linux 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_common_port/Makefile.linux 2015-08-26 10:26:11.801358412 +0200
-@@ -0,0 +1,49 @@
-+#
-+# Makefile for DWC_common library
-+#
-+ifneq ($(KERNELRELEASE),)
-+
-+ccflags-y += -DDWC_LINUX
-+#ccflags-y += -DDEBUG
-+#ccflags-y += -DDWC_DEBUG_REGS
-+#ccflags-y += -DDWC_DEBUG_MEMORY
-+
-+ccflags-y += -DDWC_LIBMODULE
-+ccflags-y += -DDWC_CCLIB
-+ccflags-y += -DDWC_CRYPTOLIB
-+ccflags-y += -DDWC_NOTIFYLIB
-+ccflags-y += -DDWC_UTFLIB
-+
-+obj-m := dwc_common_port_lib.o
-+dwc_common_port_lib-objs := dwc_cc.o dwc_modpow.o dwc_dh.o \
-+ dwc_crypto.o dwc_notifier.o \
-+ dwc_common_linux.o dwc_mem.o
-+
-+else
-+
-+ifeq ($(KDIR),)
-+$(error Must give "KDIR=/path/to/kernel/source" on command line or in environment)
-+endif
-+
-+ifeq ($(ARCH),)
-+$(error Must give "ARCH=<arch>" on command line or in environment. Also, if \
-+ cross-compiling, must give "CROSS_COMPILE=/path/to/compiler/plus/tool-prefix-")
-+endif
-+
-+ifeq ($(DOXYGEN),)
-+DOXYGEN := doxygen
-+endif
-+
-+default:
-+ $(MAKE) -C$(KDIR) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules
-+
-+docs: $(wildcard *.[hc]) doc/doxygen.cfg
-+ $(DOXYGEN) doc/doxygen.cfg
-+
-+tags: $(wildcard *.[hc])
-+ $(CTAGS) -e $(wildcard *.[hc]) $(wildcard linux/*.[hc]) $(wildcard $(KDIR)/include/linux/usb*.h)
-+
-+endif
-+
-+clean:
-+ rm -rf *.o *.ko .*.cmd *.mod.c .*.o.d .*.o.tmp modules.order Module.markers Module.symvers .tmp_versions/
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/changes.txt linux-rpi/drivers/usb/host/dwc_common_port/changes.txt
---- linux-4.1.6/drivers/usb/host/dwc_common_port/changes.txt 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_common_port/changes.txt 2015-08-26 10:26:11.801358412 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_common_port/changes.txt linux-rpi/drivers/usb/host/dwc_common_port/changes.txt
+--- linux-4.1.10/drivers/usb/host/dwc_common_port/changes.txt 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_common_port/changes.txt 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,174 @@
+
+dwc_read_reg32() and friends now take an additional parameter, a pointer to an
@@ -238468,9 +240774,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/changes.txt linux-rpi/dri
+A DWC_LIBMODULE #define has also been added. If this is not defined, then the
+module code in dwc_common_linux.c is not compiled in. This allows linking the
+library code directly into a driver module, instead of as a standalone module.
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/doc/doxygen.cfg linux-rpi/drivers/usb/host/dwc_common_port/doc/doxygen.cfg
---- linux-4.1.6/drivers/usb/host/dwc_common_port/doc/doxygen.cfg 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_common_port/doc/doxygen.cfg 2015-08-26 10:26:11.801358412 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_common_port/doc/doxygen.cfg linux-rpi/drivers/usb/host/dwc_common_port/doc/doxygen.cfg
+--- linux-4.1.10/drivers/usb/host/dwc_common_port/doc/doxygen.cfg 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_common_port/doc/doxygen.cfg 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,270 @@
+# Doxyfile 1.4.5
+
@@ -238742,9 +241048,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/doc/doxygen.cfg linux-rpi
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+SEARCHENGINE = NO
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_cc.c linux-rpi/drivers/usb/host/dwc_common_port/dwc_cc.c
---- linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_cc.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_cc.c 2015-08-26 10:26:11.801358412 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_cc.c linux-rpi/drivers/usb/host/dwc_common_port/dwc_cc.c
+--- linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_cc.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_cc.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,532 @@
+/* =========================================================================
+ * $File: //dwh/usb_iip/dev/software/dwc_common_port_2/dwc_cc.c $
@@ -239278,9 +241584,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_cc.c linux-rpi/driver
+}
+
+#endif /* DWC_CCLIB */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_cc.h linux-rpi/drivers/usb/host/dwc_common_port/dwc_cc.h
---- linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_cc.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_cc.h 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_cc.h linux-rpi/drivers/usb/host/dwc_common_port/dwc_cc.h
+--- linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_cc.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_cc.h 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,224 @@
+/* =========================================================================
+ * $File: //dwh/usb_iip/dev/software/dwc_common_port_2/dwc_cc.h $
@@ -239506,9 +241812,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_cc.h linux-rpi/driver
+#endif
+
+#endif /* _DWC_CC_H_ */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_common_fbsd.c linux-rpi/drivers/usb/host/dwc_common_port/dwc_common_fbsd.c
---- linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_common_fbsd.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_common_fbsd.c 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_common_fbsd.c linux-rpi/drivers/usb/host/dwc_common_port/dwc_common_fbsd.c
+--- linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_common_fbsd.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_common_fbsd.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,1308 @@
+#include "dwc_os.h"
+#include "dwc_list.h"
@@ -240818,9 +243124,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_common_fbsd.c linux-r
+{
+ return wq->pending;
+}
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_common_linux.c linux-rpi/drivers/usb/host/dwc_common_port/dwc_common_linux.c
---- linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_common_linux.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_common_linux.c 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_common_linux.c linux-rpi/drivers/usb/host/dwc_common_port/dwc_common_linux.c
+--- linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_common_linux.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_common_linux.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,1434 @@
+#include <linux/kernel.h>
+#include <linux/init.h>
@@ -242256,9 +244562,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_common_linux.c linux-
+MODULE_LICENSE ("GPL");
+
+#endif /* DWC_LIBMODULE */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_common_nbsd.c linux-rpi/drivers/usb/host/dwc_common_port/dwc_common_nbsd.c
---- linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_common_nbsd.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_common_nbsd.c 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_common_nbsd.c linux-rpi/drivers/usb/host/dwc_common_port/dwc_common_nbsd.c
+--- linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_common_nbsd.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_common_nbsd.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,1275 @@
+#include "dwc_os.h"
+#include "dwc_list.h"
@@ -243535,9 +245841,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_common_nbsd.c linux-r
+{
+ return wq->pending;
+}
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_crypto.c linux-rpi/drivers/usb/host/dwc_common_port/dwc_crypto.c
---- linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_crypto.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_crypto.c 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_crypto.c linux-rpi/drivers/usb/host/dwc_common_port/dwc_crypto.c
+--- linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_crypto.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_crypto.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,308 @@
+/* =========================================================================
+ * $File: //dwh/usb_iip/dev/software/dwc_common_port_2/dwc_crypto.c $
@@ -243847,9 +246153,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_crypto.c linux-rpi/dr
+}
+
+#endif /* DWC_CRYPTOLIB */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_crypto.h linux-rpi/drivers/usb/host/dwc_common_port/dwc_crypto.h
---- linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_crypto.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_crypto.h 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_crypto.h linux-rpi/drivers/usb/host/dwc_common_port/dwc_crypto.h
+--- linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_crypto.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_crypto.h 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,111 @@
+/* =========================================================================
+ * $File: //dwh/usb_iip/dev/software/dwc_common_port_2/dwc_crypto.h $
@@ -243962,9 +246268,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_crypto.h linux-rpi/dr
+#endif
+
+#endif /* _DWC_CRYPTO_H_ */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_dh.c linux-rpi/drivers/usb/host/dwc_common_port/dwc_dh.c
---- linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_dh.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_dh.c 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_dh.c linux-rpi/drivers/usb/host/dwc_common_port/dwc_dh.c
+--- linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_dh.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_dh.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,291 @@
+/* =========================================================================
+ * $File: //dwh/usb_iip/dev/software/dwc_common_port_2/dwc_dh.c $
@@ -244257,9 +246563,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_dh.c linux-rpi/driver
+#endif /* !CONFIG_MACH_IPMATE */
+
+#endif /* DWC_CRYPTOLIB */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_dh.h linux-rpi/drivers/usb/host/dwc_common_port/dwc_dh.h
---- linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_dh.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_dh.h 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_dh.h linux-rpi/drivers/usb/host/dwc_common_port/dwc_dh.h
+--- linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_dh.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_dh.h 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,106 @@
+/* =========================================================================
+ * $File: //dwh/usb_iip/dev/software/dwc_common_port_2/dwc_dh.h $
@@ -244367,9 +246673,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_dh.h linux-rpi/driver
+#endif
+
+#endif /* _DWC_DH_H_ */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_list.h linux-rpi/drivers/usb/host/dwc_common_port/dwc_list.h
---- linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_list.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_list.h 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_list.h linux-rpi/drivers/usb/host/dwc_common_port/dwc_list.h
+--- linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_list.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_list.h 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,594 @@
+/* $OpenBSD: queue.h,v 1.26 2004/05/04 16:59:32 grange Exp $ */
+/* $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $ */
@@ -244965,9 +247271,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_list.h linux-rpi/driv
+#endif
+
+#endif /* _DWC_LIST_H_ */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_mem.c linux-rpi/drivers/usb/host/dwc_common_port/dwc_mem.c
---- linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_mem.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_mem.c 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_mem.c linux-rpi/drivers/usb/host/dwc_common_port/dwc_mem.c
+--- linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_mem.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_mem.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,245 @@
+/* Memory Debugging */
+#ifdef DWC_DEBUG_MEMORY
@@ -245214,9 +247520,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_mem.c linux-rpi/drive
+}
+
+#endif /* DWC_DEBUG_MEMORY */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_modpow.c linux-rpi/drivers/usb/host/dwc_common_port/dwc_modpow.c
---- linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_modpow.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_modpow.c 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_modpow.c linux-rpi/drivers/usb/host/dwc_common_port/dwc_modpow.c
+--- linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_modpow.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_modpow.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,636 @@
+/* Bignum routines adapted from PUTTY sources. PuTTY copyright notice follows.
+ *
@@ -245854,9 +248160,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_modpow.c linux-rpi/dr
+#endif /* CONFIG_MACH_IPMATE */
+
+#endif /*DWC_CRYPTOLIB */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_modpow.h linux-rpi/drivers/usb/host/dwc_common_port/dwc_modpow.h
---- linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_modpow.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_modpow.h 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_modpow.h linux-rpi/drivers/usb/host/dwc_common_port/dwc_modpow.h
+--- linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_modpow.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_modpow.h 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,34 @@
+/*
+ * dwc_modpow.h
@@ -245892,9 +248198,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_modpow.h linux-rpi/dr
+#endif
+
+#endif /* _LINUX_BIGNUM_H */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_notifier.c linux-rpi/drivers/usb/host/dwc_common_port/dwc_notifier.c
---- linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_notifier.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_notifier.c 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_notifier.c linux-rpi/drivers/usb/host/dwc_common_port/dwc_notifier.c
+--- linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_notifier.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_notifier.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,319 @@
+#ifdef DWC_NOTIFYLIB
+
@@ -246215,9 +248521,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_notifier.c linux-rpi/
+}
+
+#endif /* DWC_NOTIFYLIB */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_notifier.h linux-rpi/drivers/usb/host/dwc_common_port/dwc_notifier.h
---- linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_notifier.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_notifier.h 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_notifier.h linux-rpi/drivers/usb/host/dwc_common_port/dwc_notifier.h
+--- linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_notifier.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_notifier.h 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,122 @@
+
+#ifndef __DWC_NOTIFIER_H__
@@ -246341,9 +248647,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_notifier.h linux-rpi/
+#endif
+
+#endif /* __DWC_NOTIFIER_H__ */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_os.h linux-rpi/drivers/usb/host/dwc_common_port/dwc_os.h
---- linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_os.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_os.h 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_os.h linux-rpi/drivers/usb/host/dwc_common_port/dwc_os.h
+--- linux-4.1.10/drivers/usb/host/dwc_common_port/dwc_os.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_common_port/dwc_os.h 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,1276 @@
+/* =========================================================================
+ * $File: //dwh/usb_iip/dev/software/dwc_common_port_2/dwc_os.h $
@@ -247621,9 +249927,145 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/dwc_os.h linux-rpi/driver
+#endif
+
+#endif /* _DWC_OS_H_ */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/usb.h linux-rpi/drivers/usb/host/dwc_common_port/usb.h
---- linux-4.1.6/drivers/usb/host/dwc_common_port/usb.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_common_port/usb.h 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_common_port/Makefile linux-rpi/drivers/usb/host/dwc_common_port/Makefile
+--- linux-4.1.10/drivers/usb/host/dwc_common_port/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_common_port/Makefile 2015-10-07 16:40:56.000000000 +0200
+@@ -0,0 +1,58 @@
++#
++# Makefile for DWC_common library
++#
++
++ifneq ($(KERNELRELEASE),)
++
++ccflags-y += -DDWC_LINUX
++#ccflags-y += -DDEBUG
++#ccflags-y += -DDWC_DEBUG_REGS
++#ccflags-y += -DDWC_DEBUG_MEMORY
++
++ccflags-y += -DDWC_LIBMODULE
++ccflags-y += -DDWC_CCLIB
++#ccflags-y += -DDWC_CRYPTOLIB
++ccflags-y += -DDWC_NOTIFYLIB
++ccflags-y += -DDWC_UTFLIB
++
++obj-$(CONFIG_USB_DWCOTG) += dwc_common_port_lib.o
++dwc_common_port_lib-objs := dwc_cc.o dwc_modpow.o dwc_dh.o \
++ dwc_crypto.o dwc_notifier.o \
++ dwc_common_linux.o dwc_mem.o
++
++kernrelwd := $(subst ., ,$(KERNELRELEASE))
++kernrel3 := $(word 1,$(kernrelwd)).$(word 2,$(kernrelwd)).$(word 3,$(kernrelwd))
++
++ifneq ($(kernrel3),2.6.20)
++# grayg - I only know that we use ccflags-y in 2.6.31 actually
++ccflags-y += $(CPPFLAGS)
++endif
++
++else
++
++#ifeq ($(KDIR),)
++#$(error Must give "KDIR=/path/to/kernel/source" on command line or in environment)
++#endif
++
++ifeq ($(ARCH),)
++$(error Must give "ARCH=<arch>" on command line or in environment. Also, if \
++ cross-compiling, must give "CROSS_COMPILE=/path/to/compiler/plus/tool-prefix-")
++endif
++
++ifeq ($(DOXYGEN),)
++DOXYGEN := doxygen
++endif
++
++default:
++ $(MAKE) -C$(KDIR) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules
++
++docs: $(wildcard *.[hc]) doc/doxygen.cfg
++ $(DOXYGEN) doc/doxygen.cfg
++
++tags: $(wildcard *.[hc])
++ $(CTAGS) -e $(wildcard *.[hc]) $(wildcard linux/*.[hc]) $(wildcard $(KDIR)/include/linux/usb*.h)
++
++endif
++
++clean:
++ rm -rf *.o *.ko .*.cmd *.mod.c .*.o.d .*.o.tmp modules.order Module.markers Module.symvers .tmp_versions/
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_common_port/Makefile.fbsd linux-rpi/drivers/usb/host/dwc_common_port/Makefile.fbsd
+--- linux-4.1.10/drivers/usb/host/dwc_common_port/Makefile.fbsd 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_common_port/Makefile.fbsd 2015-10-07 16:40:56.000000000 +0200
+@@ -0,0 +1,17 @@
++CFLAGS += -I/sys/i386/compile/GENERIC -I/sys/i386/include -I/usr/include
++CFLAGS += -DDWC_FREEBSD
++CFLAGS += -DDEBUG
++#CFLAGS += -DDWC_DEBUG_REGS
++#CFLAGS += -DDWC_DEBUG_MEMORY
++
++#CFLAGS += -DDWC_LIBMODULE
++#CFLAGS += -DDWC_CCLIB
++#CFLAGS += -DDWC_CRYPTOLIB
++#CFLAGS += -DDWC_NOTIFYLIB
++#CFLAGS += -DDWC_UTFLIB
++
++KMOD = dwc_common_port_lib
++SRCS = dwc_cc.c dwc_modpow.c dwc_dh.c dwc_crypto.c dwc_notifier.c \
++ dwc_common_fbsd.c dwc_mem.c
++
++.include <bsd.kmod.mk>
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_common_port/Makefile.linux linux-rpi/drivers/usb/host/dwc_common_port/Makefile.linux
+--- linux-4.1.10/drivers/usb/host/dwc_common_port/Makefile.linux 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_common_port/Makefile.linux 2015-10-07 16:40:56.000000000 +0200
+@@ -0,0 +1,49 @@
++#
++# Makefile for DWC_common library
++#
++ifneq ($(KERNELRELEASE),)
++
++ccflags-y += -DDWC_LINUX
++#ccflags-y += -DDEBUG
++#ccflags-y += -DDWC_DEBUG_REGS
++#ccflags-y += -DDWC_DEBUG_MEMORY
++
++ccflags-y += -DDWC_LIBMODULE
++ccflags-y += -DDWC_CCLIB
++ccflags-y += -DDWC_CRYPTOLIB
++ccflags-y += -DDWC_NOTIFYLIB
++ccflags-y += -DDWC_UTFLIB
++
++obj-m := dwc_common_port_lib.o
++dwc_common_port_lib-objs := dwc_cc.o dwc_modpow.o dwc_dh.o \
++ dwc_crypto.o dwc_notifier.o \
++ dwc_common_linux.o dwc_mem.o
++
++else
++
++ifeq ($(KDIR),)
++$(error Must give "KDIR=/path/to/kernel/source" on command line or in environment)
++endif
++
++ifeq ($(ARCH),)
++$(error Must give "ARCH=<arch>" on command line or in environment. Also, if \
++ cross-compiling, must give "CROSS_COMPILE=/path/to/compiler/plus/tool-prefix-")
++endif
++
++ifeq ($(DOXYGEN),)
++DOXYGEN := doxygen
++endif
++
++default:
++ $(MAKE) -C$(KDIR) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules
++
++docs: $(wildcard *.[hc]) doc/doxygen.cfg
++ $(DOXYGEN) doc/doxygen.cfg
++
++tags: $(wildcard *.[hc])
++ $(CTAGS) -e $(wildcard *.[hc]) $(wildcard linux/*.[hc]) $(wildcard $(KDIR)/include/linux/usb*.h)
++
++endif
++
++clean:
++ rm -rf *.o *.ko .*.cmd *.mod.c .*.o.d .*.o.tmp modules.order Module.markers Module.symvers .tmp_versions/
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_common_port/usb.h linux-rpi/drivers/usb/host/dwc_common_port/usb.h
+--- linux-4.1.10/drivers/usb/host/dwc_common_port/usb.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_common_port/usb.h 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,946 @@
+/*
+ * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -248571,95 +251013,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_common_port/usb.h linux-rpi/drivers/u
+#endif
+
+#endif /* _USB_H_ */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/Makefile linux-rpi/drivers/usb/host/dwc_otg/Makefile
---- linux-4.1.6/drivers/usb/host/dwc_otg/Makefile 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/Makefile 2015-08-26 10:26:11.805358467 +0200
-@@ -0,0 +1,82 @@
-+#
-+# Makefile for DWC_otg Highspeed USB controller driver
-+#
-+
-+ifneq ($(KERNELRELEASE),)
-+
-+# Use the BUS_INTERFACE variable to compile the software for either
-+# PCI(PCI_INTERFACE) or LM(LM_INTERFACE) bus.
-+ifeq ($(BUS_INTERFACE),)
-+# BUS_INTERFACE = -DPCI_INTERFACE
-+# BUS_INTERFACE = -DLM_INTERFACE
-+ BUS_INTERFACE = -DPLATFORM_INTERFACE
-+endif
-+
-+#ccflags-y += -DDEBUG
-+#ccflags-y += -DDWC_OTG_DEBUGLEV=1 # reduce common debug msgs
-+
-+# Use one of the following flags to compile the software in host-only or
-+# device-only mode.
-+#ccflags-y += -DDWC_HOST_ONLY
-+#ccflags-y += -DDWC_DEVICE_ONLY
-+
-+ccflags-y += -Dlinux -DDWC_HS_ELECT_TST
-+#ccflags-y += -DDWC_EN_ISOC
-+ccflags-y += -I$(obj)/../dwc_common_port
-+#ccflags-y += -I$(PORTLIB)
-+ccflags-y += -DDWC_LINUX
-+ccflags-y += $(CFI)
-+ccflags-y += $(BUS_INTERFACE)
-+#ccflags-y += -DDWC_DEV_SRPCAP
-+
-+obj-$(CONFIG_USB_DWCOTG) += dwc_otg.o
-+
-+dwc_otg-objs := dwc_otg_driver.o dwc_otg_attr.o
-+dwc_otg-objs += dwc_otg_cil.o dwc_otg_cil_intr.o
-+dwc_otg-objs += dwc_otg_pcd_linux.o dwc_otg_pcd.o dwc_otg_pcd_intr.o
-+dwc_otg-objs += dwc_otg_hcd.o dwc_otg_hcd_linux.o dwc_otg_hcd_intr.o dwc_otg_hcd_queue.o dwc_otg_hcd_ddma.o
-+dwc_otg-objs += dwc_otg_adp.o
-+dwc_otg-objs += dwc_otg_fiq_fsm.o
-+dwc_otg-objs += dwc_otg_fiq_stub.o
-+ifneq ($(CFI),)
-+dwc_otg-objs += dwc_otg_cfi.o
-+endif
-+
-+kernrelwd := $(subst ., ,$(KERNELRELEASE))
-+kernrel3 := $(word 1,$(kernrelwd)).$(word 2,$(kernrelwd)).$(word 3,$(kernrelwd))
-+
-+ifneq ($(kernrel3),2.6.20)
-+ccflags-y += $(CPPFLAGS)
-+endif
-+
-+else
-+
-+PWD := $(shell pwd)
-+PORTLIB := $(PWD)/../dwc_common_port
-+
-+# Command paths
-+CTAGS := $(CTAGS)
-+DOXYGEN := $(DOXYGEN)
-+
-+default: portlib
-+ $(MAKE) -C$(KDIR) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules
-+
-+install: default
-+ $(MAKE) -C$(KDIR) M=$(PORTLIB) modules_install
-+ $(MAKE) -C$(KDIR) M=$(PWD) modules_install
-+
-+portlib:
-+ $(MAKE) -C$(KDIR) M=$(PORTLIB) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules
-+ cp $(PORTLIB)/Module.symvers $(PWD)/
-+
-+docs: $(wildcard *.[hc]) doc/doxygen.cfg
-+ $(DOXYGEN) doc/doxygen.cfg
-+
-+tags: $(wildcard *.[hc])
-+ $(CTAGS) -e $(wildcard *.[hc]) $(wildcard linux/*.[hc]) $(wildcard $(KDIR)/include/linux/usb*.h)
-+
-+
-+clean:
-+ rm -rf *.o *.ko .*cmd *.mod.c .tmp_versions Module.symvers
-+
-+endif
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/doc/doxygen.cfg linux-rpi/drivers/usb/host/dwc_otg/doc/doxygen.cfg
---- linux-4.1.6/drivers/usb/host/dwc_otg/doc/doxygen.cfg 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/doc/doxygen.cfg 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/doc/doxygen.cfg linux-rpi/drivers/usb/host/dwc_otg/doc/doxygen.cfg
+--- linux-4.1.10/drivers/usb/host/dwc_otg/doc/doxygen.cfg 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/doc/doxygen.cfg 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,224 @@
+# Doxyfile 1.3.9.1
+
@@ -248885,9 +251241,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/doc/doxygen.cfg linux-rpi/drivers
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+SEARCHENGINE = NO
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dummy_audio.c linux-rpi/drivers/usb/host/dwc_otg/dummy_audio.c
---- linux-4.1.6/drivers/usb/host/dwc_otg/dummy_audio.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dummy_audio.c 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dummy_audio.c linux-rpi/drivers/usb/host/dwc_otg/dummy_audio.c
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dummy_audio.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dummy_audio.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,1575 @@
+/*
+ * zero.c -- Gadget Zero, for USB development
@@ -250464,9 +252820,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dummy_audio.c linux-rpi/drivers/u
+ remove_proc_entry("isoc_test", NULL);
+}
+module_exit (cleanup);
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_cfi_common.h linux-rpi/drivers/usb/host/dwc_otg/dwc_cfi_common.h
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_cfi_common.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_cfi_common.h 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_cfi_common.h linux-rpi/drivers/usb/host/dwc_otg/dwc_cfi_common.h
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_cfi_common.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_cfi_common.h 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,142 @@
+/* ==========================================================================
+ * Synopsys HS OTG Linux Software Driver and documentation (hereinafter,
@@ -250610,9 +252966,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_cfi_common.h linux-rpi/driver
+typedef struct cfi_string cfi_string_t;
+
+#endif
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_adp.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_adp.c
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_adp.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_adp.c 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_adp.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_adp.c
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_adp.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_adp.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,854 @@
+/* ==========================================================================
+ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_adp.c $
@@ -251468,9 +253824,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_adp.c linux-rpi/drivers/u
+#endif
+ return 1;
+}
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_adp.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_adp.h
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_adp.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_adp.h 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_adp.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_adp.h
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_adp.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_adp.h 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,80 @@
+/* ==========================================================================
+ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_adp.h $
@@ -251552,9 +253908,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_adp.h linux-rpi/drivers/u
+extern int32_t dwc_otg_adp_handle_srp_intr(dwc_otg_core_if_t * core_if);
+
+#endif //__DWC_OTG_ADP_H__
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_attr.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_attr.c
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_attr.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_attr.c 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_attr.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_attr.c
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_attr.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_attr.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,1210 @@
+/* ==========================================================================
+ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_attr.c $
@@ -252766,9 +255122,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_attr.c linux-rpi/drivers/
+ device_remove_file(&dev->dev, &dev_attr_sleep_status);
+#endif
+}
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_attr.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_attr.h
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_attr.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_attr.h 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_attr.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_attr.h
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_attr.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_attr.h 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,89 @@
+/* ==========================================================================
+ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_attr.h $
@@ -252859,9 +255215,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_attr.h linux-rpi/drivers/
+#endif
+ );
+#endif
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_cfi.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_cfi.c
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_cfi.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_cfi.c 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_cfi.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_cfi.c
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_cfi.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_cfi.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,1876 @@
+/* ==========================================================================
+ * Synopsys HS OTG Linux Software Driver and documentation (hereinafter,
@@ -254739,9 +257095,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_cfi.c linux-rpi/drivers/u
+}
+
+#endif //DWC_UTE_CFI
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_cfi.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_cfi.h
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_cfi.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_cfi.h 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_cfi.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_cfi.h
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_cfi.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_cfi.h 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,320 @@
+/* ==========================================================================
+ * Synopsys HS OTG Linux Software Driver and documentation (hereinafter,
@@ -255063,9 +257419,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_cfi.h linux-rpi/drivers/u
+int cfi_setup(struct dwc_otg_pcd *pcd, struct cfi_usb_ctrlrequest *ctrl);
+
+#endif /* (__DWC_OTG_CFI_H__) */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_cil.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_cil.c
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_cil.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_cil.c 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_cil.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_cil.c
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_cil.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_cil.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,7141 @@
+/* ==========================================================================
+ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_cil.c $
@@ -255261,7 +257617,7 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_cil.c linux-rpi/drivers/u
+ core_if->hptxfsiz.d32 =
+ DWC_READ_REG32(&core_if->core_global_regs->hptxfsiz);
+ gusbcfg.d32 = DWC_READ_REG32(&core_if->core_global_regs->gusbcfg);
-+ gusbcfg.b.force_host_mode = 0;
++ gusbcfg.b.force_host_mode = 1;
+ DWC_WRITE_REG32(&core_if->core_global_regs->gusbcfg, gusbcfg.d32);
+ dwc_mdelay(100);
+ }
@@ -262208,9 +264564,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_cil.c linux-rpi/drivers/u
+ dwc_otg_pcd_start_srp_timer(core_if);
+ return;
+}
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_cil.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_cil.h
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_cil.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_cil.h 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_cil.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_cil.h
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_cil.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_cil.h 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,1464 @@
+/* ==========================================================================
+ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_cil.h $
@@ -263676,9 +266032,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_cil.h linux-rpi/drivers/u
+//////////////////////////////////////////////////////////////////////
+
+#endif
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,1594 @@
+/* ==========================================================================
+ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_cil_intr.c $
@@ -265274,9 +267630,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c linux-rpi/driv
+ DWC_SPINUNLOCK(core_if->lock);
+ return retval;
+}
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_core_if.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_core_if.h
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_core_if.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_core_if.h 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_core_if.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_core_if.h
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_core_if.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_core_if.h 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,705 @@
+/* ==========================================================================
+ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_core_if.h $
@@ -265983,9 +268339,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_core_if.h linux-rpi/drive
+/** @} */
+
+#endif /* __DWC_CORE_IF_H__ */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_dbg.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_dbg.h
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_dbg.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_dbg.h 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_dbg.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_dbg.h
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_dbg.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_dbg.h 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,117 @@
+/* ==========================================================================
+ *
@@ -266104,9 +268460,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_dbg.h linux-rpi/drivers/u
+
+#endif /*DEBUG*/
+#endif
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_driver.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_driver.c
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_driver.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_driver.c 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_driver.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_driver.c
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_driver.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_driver.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,1757 @@
+/* ==========================================================================
+ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_driver.c $
@@ -267865,9 +270221,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_driver.c linux-rpi/driver
+ </td></tr>
+
+*/
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_driver.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_driver.h
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_driver.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_driver.h 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_driver.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_driver.h
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_driver.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_driver.h 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,86 @@
+/* ==========================================================================
+ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_driver.h $
@@ -267955,9 +270311,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_driver.h linux-rpi/driver
+#endif
+
+#endif
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,1355 @@
+/*
+ * dwc_otg_fiq_fsm.c - The finite state machine FIQ
@@ -269314,9 +271670,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c linux-rpi/drive
+ mb();
+ fiq_fsm_spin_unlock(&state->lock);
+}
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h 2015-08-26 10:26:11.805358467 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,370 @@
+/*
+ * dwc_otg_fiq_fsm.h - Finite state machine FIQ header definitions
@@ -269688,9 +272044,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h linux-rpi/drive
+extern void dwc_otg_fiq_nop(struct fiq_state *state);
+
+#endif /* DWC_OTG_FIQ_FSM_H_ */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_fiq_stub.S linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_fiq_stub.S
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_fiq_stub.S 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_fiq_stub.S 2015-08-26 10:26:11.809358522 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_fiq_stub.S linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_fiq_stub.S
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_fiq_stub.S 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_fiq_stub.S 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,80 @@
+/*
+ * dwc_otg_fiq_fsm.S - assembly stub for the FSM FIQ
@@ -269772,9 +272128,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_fiq_stub.S linux-rpi/driv
+ subs pc, lr, #4;
+_dwc_otg_fiq_stub_end:
+END(_dwc_otg_fiq_stub)
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_hcd.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd.c
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_hcd.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd.c 2015-08-26 10:26:11.809358522 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd.c
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,4257 @@
+
+/* ==========================================================================
@@ -274033,875 +276389,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_hcd.c linux-rpi/drivers/u
+}
+
+#endif /* DWC_DEVICE_ONLY */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_hcd.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd.h
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_hcd.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd.h 2015-08-26 10:26:11.809358522 +0200
-@@ -0,0 +1,862 @@
-+/* ==========================================================================
-+ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd.h $
-+ * $Revision: #58 $
-+ * $Date: 2011/09/15 $
-+ * $Change: 1846647 $
-+ *
-+ * Synopsys HS OTG Linux Software Driver and documentation (hereinafter,
-+ * "Software") is an Unsupported proprietary work of Synopsys, Inc. unless
-+ * otherwise expressly agreed to in writing between Synopsys and you.
-+ *
-+ * The Software IS NOT an item of Licensed Software or Licensed Product under
-+ * any End User Software License Agreement or Agreement for Licensed Product
-+ * with Synopsys or any supplement thereto. You are permitted to use and
-+ * redistribute this Software in source and binary forms, with or without
-+ * modification, provided that redistributions of source code must retain this
-+ * notice. You may not view, use, disclose, copy or distribute this file or
-+ * any information contained herein except pursuant to this license grant from
-+ * Synopsys. If you do not agree with this notice, including the disclaimer
-+ * below, then you are not authorized to use the Software.
-+ *
-+ * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS
-+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS BE LIABLE FOR ANY DIRECT,
-+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-+ * DAMAGE.
-+ * ========================================================================== */
-+#ifndef DWC_DEVICE_ONLY
-+#ifndef __DWC_HCD_H__
-+#define __DWC_HCD_H__
-+
-+#include "dwc_otg_os_dep.h"
-+#include "usb.h"
-+#include "dwc_otg_hcd_if.h"
-+#include "dwc_otg_core_if.h"
-+#include "dwc_list.h"
-+#include "dwc_otg_cil.h"
-+#include "dwc_otg_fiq_fsm.h"
-+
-+
-+/**
-+ * @file
-+ *
-+ * This file contains the structures, constants, and interfaces for
-+ * the Host Contoller Driver (HCD).
-+ *
-+ * The Host Controller Driver (HCD) is responsible for translating requests
-+ * from the USB Driver into the appropriate actions on the DWC_otg controller.
-+ * It isolates the USBD from the specifics of the controller by providing an
-+ * API to the USBD.
-+ */
-+
-+struct dwc_otg_hcd_pipe_info {
-+ uint8_t dev_addr;
-+ uint8_t ep_num;
-+ uint8_t pipe_type;
-+ uint8_t pipe_dir;
-+ uint16_t mps;
-+};
-+
-+struct dwc_otg_hcd_iso_packet_desc {
-+ uint32_t offset;
-+ uint32_t length;
-+ uint32_t actual_length;
-+ uint32_t status;
-+};
-+
-+struct dwc_otg_qtd;
-+
-+struct dwc_otg_hcd_urb {
-+ void *priv;
-+ struct dwc_otg_qtd *qtd;
-+ void *buf;
-+ dwc_dma_t dma;
-+ void *setup_packet;
-+ dwc_dma_t setup_dma;
-+ uint32_t length;
-+ uint32_t actual_length;
-+ uint32_t status;
-+ uint32_t error_count;
-+ uint32_t packet_count;
-+ uint32_t flags;
-+ uint16_t interval;
-+ struct dwc_otg_hcd_pipe_info pipe_info;
-+ struct dwc_otg_hcd_iso_packet_desc iso_descs[0];
-+};
-+
-+static inline uint8_t dwc_otg_hcd_get_ep_num(struct dwc_otg_hcd_pipe_info *pipe)
-+{
-+ return pipe->ep_num;
-+}
-+
-+static inline uint8_t dwc_otg_hcd_get_pipe_type(struct dwc_otg_hcd_pipe_info
-+ *pipe)
-+{
-+ return pipe->pipe_type;
-+}
-+
-+static inline uint16_t dwc_otg_hcd_get_mps(struct dwc_otg_hcd_pipe_info *pipe)
-+{
-+ return pipe->mps;
-+}
-+
-+static inline uint8_t dwc_otg_hcd_get_dev_addr(struct dwc_otg_hcd_pipe_info
-+ *pipe)
-+{
-+ return pipe->dev_addr;
-+}
-+
-+static inline uint8_t dwc_otg_hcd_is_pipe_isoc(struct dwc_otg_hcd_pipe_info
-+ *pipe)
-+{
-+ return (pipe->pipe_type == UE_ISOCHRONOUS);
-+}
-+
-+static inline uint8_t dwc_otg_hcd_is_pipe_int(struct dwc_otg_hcd_pipe_info
-+ *pipe)
-+{
-+ return (pipe->pipe_type == UE_INTERRUPT);
-+}
-+
-+static inline uint8_t dwc_otg_hcd_is_pipe_bulk(struct dwc_otg_hcd_pipe_info
-+ *pipe)
-+{
-+ return (pipe->pipe_type == UE_BULK);
-+}
-+
-+static inline uint8_t dwc_otg_hcd_is_pipe_control(struct dwc_otg_hcd_pipe_info
-+ *pipe)
-+{
-+ return (pipe->pipe_type == UE_CONTROL);
-+}
-+
-+static inline uint8_t dwc_otg_hcd_is_pipe_in(struct dwc_otg_hcd_pipe_info *pipe)
-+{
-+ return (pipe->pipe_dir == UE_DIR_IN);
-+}
-+
-+static inline uint8_t dwc_otg_hcd_is_pipe_out(struct dwc_otg_hcd_pipe_info
-+ *pipe)
-+{
-+ return (!dwc_otg_hcd_is_pipe_in(pipe));
-+}
-+
-+static inline void dwc_otg_hcd_fill_pipe(struct dwc_otg_hcd_pipe_info *pipe,
-+ uint8_t devaddr, uint8_t ep_num,
-+ uint8_t pipe_type, uint8_t pipe_dir,
-+ uint16_t mps)
-+{
-+ pipe->dev_addr = devaddr;
-+ pipe->ep_num = ep_num;
-+ pipe->pipe_type = pipe_type;
-+ pipe->pipe_dir = pipe_dir;
-+ pipe->mps = mps;
-+}
-+
-+/**
-+ * Phases for control transfers.
-+ */
-+typedef enum dwc_otg_control_phase {
-+ DWC_OTG_CONTROL_SETUP,
-+ DWC_OTG_CONTROL_DATA,
-+ DWC_OTG_CONTROL_STATUS
-+} dwc_otg_control_phase_e;
-+
-+/** Transaction types. */
-+typedef enum dwc_otg_transaction_type {
-+ DWC_OTG_TRANSACTION_NONE = 0,
-+ DWC_OTG_TRANSACTION_PERIODIC = 1,
-+ DWC_OTG_TRANSACTION_NON_PERIODIC = 2,
-+ DWC_OTG_TRANSACTION_ALL = DWC_OTG_TRANSACTION_PERIODIC + DWC_OTG_TRANSACTION_NON_PERIODIC
-+} dwc_otg_transaction_type_e;
-+
-+struct dwc_otg_qh;
-+
-+/**
-+ * A Queue Transfer Descriptor (QTD) holds the state of a bulk, control,
-+ * interrupt, or isochronous transfer. A single QTD is created for each URB
-+ * (of one of these types) submitted to the HCD. The transfer associated with
-+ * a QTD may require one or multiple transactions.
-+ *
-+ * A QTD is linked to a Queue Head, which is entered in either the
-+ * non-periodic or periodic schedule for execution. When a QTD is chosen for
-+ * execution, some or all of its transactions may be executed. After
-+ * execution, the state of the QTD is updated. The QTD may be retired if all
-+ * its transactions are complete or if an error occurred. Otherwise, it
-+ * remains in the schedule so more transactions can be executed later.
-+ */
-+typedef struct dwc_otg_qtd {
-+ /**
-+ * Determines the PID of the next data packet for the data phase of
-+ * control transfers. Ignored for other transfer types.<br>
-+ * One of the following values:
-+ * - DWC_OTG_HC_PID_DATA0
-+ * - DWC_OTG_HC_PID_DATA1
-+ */
-+ uint8_t data_toggle;
-+
-+ /** Current phase for control transfers (Setup, Data, or Status). */
-+ dwc_otg_control_phase_e control_phase;
-+
-+ /** Keep track of the current split type
-+ * for FS/LS endpoints on a HS Hub */
-+ uint8_t complete_split;
-+
-+ /** How many bytes transferred during SSPLIT OUT */
-+ uint32_t ssplit_out_xfer_count;
-+
-+ /**
-+ * Holds the number of bus errors that have occurred for a transaction
-+ * within this transfer.
-+ */
-+ uint8_t error_count;
-+
-+ /**
-+ * Index of the next frame descriptor for an isochronous transfer. A
-+ * frame descriptor describes the buffer position and length of the
-+ * data to be transferred in the next scheduled (micro)frame of an
-+ * isochronous transfer. It also holds status for that transaction.
-+ * The frame index starts at 0.
-+ */
-+ uint16_t isoc_frame_index;
-+
-+ /** Position of the ISOC split on full/low speed */
-+ uint8_t isoc_split_pos;
-+
-+ /** Position of the ISOC split in the buffer for the current frame */
-+ uint16_t isoc_split_offset;
-+
-+ /** URB for this transfer */
-+ struct dwc_otg_hcd_urb *urb;
-+
-+ struct dwc_otg_qh *qh;
-+
-+ /** This list of QTDs */
-+ DWC_CIRCLEQ_ENTRY(dwc_otg_qtd) qtd_list_entry;
-+
-+ /** Indicates if this QTD is currently processed by HW. */
-+ uint8_t in_process;
-+
-+ /** Number of DMA descriptors for this QTD */
-+ uint8_t n_desc;
-+
-+ /**
-+ * Last activated frame(packet) index.
-+ * Used in Descriptor DMA mode only.
-+ */
-+ uint16_t isoc_frame_index_last;
-+
-+} dwc_otg_qtd_t;
-+
-+DWC_CIRCLEQ_HEAD(dwc_otg_qtd_list, dwc_otg_qtd);
-+
-+/**
-+ * A Queue Head (QH) holds the static characteristics of an endpoint and
-+ * maintains a list of transfers (QTDs) for that endpoint. A QH structure may
-+ * be entered in either the non-periodic or periodic schedule.
-+ */
-+typedef struct dwc_otg_qh {
-+ /**
-+ * Endpoint type.
-+ * One of the following values:
-+ * - UE_CONTROL
-+ * - UE_BULK
-+ * - UE_INTERRUPT
-+ * - UE_ISOCHRONOUS
-+ */
-+ uint8_t ep_type;
-+ uint8_t ep_is_in;
-+
-+ /** wMaxPacketSize Field of Endpoint Descriptor. */
-+ uint16_t maxp;
-+
-+ /**
-+ * Device speed.
-+ * One of the following values:
-+ * - DWC_OTG_EP_SPEED_LOW
-+ * - DWC_OTG_EP_SPEED_FULL
-+ * - DWC_OTG_EP_SPEED_HIGH
-+ */
-+ uint8_t dev_speed;
-+
-+ /**
-+ * Determines the PID of the next data packet for non-control
-+ * transfers. Ignored for control transfers.<br>
-+ * One of the following values:
-+ * - DWC_OTG_HC_PID_DATA0
-+ * - DWC_OTG_HC_PID_DATA1
-+ */
-+ uint8_t data_toggle;
-+
-+ /** Ping state if 1. */
-+ uint8_t ping_state;
-+
-+ /**
-+ * List of QTDs for this QH.
-+ */
-+ struct dwc_otg_qtd_list qtd_list;
-+
-+ /** Host channel currently processing transfers for this QH. */
-+ struct dwc_hc *channel;
-+
-+ /** Full/low speed endpoint on high-speed hub requires split. */
-+ uint8_t do_split;
-+
-+ /** @name Periodic schedule information */
-+ /** @{ */
-+
-+ /** Bandwidth in microseconds per (micro)frame. */
-+ uint16_t usecs;
-+
-+ /** Interval between transfers in (micro)frames. */
-+ uint16_t interval;
-+
-+ /**
-+ * (micro)frame to initialize a periodic transfer. The transfer
-+ * executes in the following (micro)frame.
-+ */
-+ uint16_t sched_frame;
-+
-+ /*
-+ ** Frame a NAK was received on this queue head, used to minimise NAK retransmission
-+ */
-+ uint16_t nak_frame;
-+
-+ /** (micro)frame at which last start split was initialized. */
-+ uint16_t start_split_frame;
-+
-+ /** @} */
-+
-+ /**
-+ * Used instead of original buffer if
-+ * it(physical address) is not dword-aligned.
-+ */
-+ uint8_t *dw_align_buf;
-+ dwc_dma_t dw_align_buf_dma;
-+
-+ /** Entry for QH in either the periodic or non-periodic schedule. */
-+ dwc_list_link_t qh_list_entry;
-+
-+ /** @name Descriptor DMA support */
-+ /** @{ */
-+
-+ /** Descriptor List. */
-+ dwc_otg_host_dma_desc_t *desc_list;
-+
-+ /** Descriptor List physical address. */
-+ dwc_dma_t desc_list_dma;
-+
-+ /**
-+ * Xfer Bytes array.
-+ * Each element corresponds to a descriptor and indicates
-+ * original XferSize size value for the descriptor.
-+ */
-+ uint32_t *n_bytes;
-+
-+ /** Actual number of transfer descriptors in a list. */
-+ uint16_t ntd;
-+
-+ /** First activated isochronous transfer descriptor index. */
-+ uint8_t td_first;
-+ /** Last activated isochronous transfer descriptor index. */
-+ uint8_t td_last;
-+
-+ /** @} */
-+
-+
-+ uint16_t speed;
-+ uint16_t frame_usecs[8];
-+
-+ uint32_t skip_count;
-+} dwc_otg_qh_t;
-+
-+DWC_CIRCLEQ_HEAD(hc_list, dwc_hc);
-+
-+typedef struct urb_tq_entry {
-+ struct urb *urb;
-+ DWC_TAILQ_ENTRY(urb_tq_entry) urb_tq_entries;
-+} urb_tq_entry_t;
-+
-+DWC_TAILQ_HEAD(urb_list, urb_tq_entry);
-+
-+/**
-+ * This structure holds the state of the HCD, including the non-periodic and
-+ * periodic schedules.
-+ */
-+struct dwc_otg_hcd {
-+ /** The DWC otg device pointer */
-+ struct dwc_otg_device *otg_dev;
-+ /** DWC OTG Core Interface Layer */
-+ dwc_otg_core_if_t *core_if;
-+
-+ /** Function HCD driver callbacks */
-+ struct dwc_otg_hcd_function_ops *fops;
-+
-+ /** Internal DWC HCD Flags */
-+ volatile union dwc_otg_hcd_internal_flags {
-+ uint32_t d32;
-+ struct {
-+ unsigned port_connect_status_change:1;
-+ unsigned port_connect_status:1;
-+ unsigned port_reset_change:1;
-+ unsigned port_enable_change:1;
-+ unsigned port_suspend_change:1;
-+ unsigned port_over_current_change:1;
-+ unsigned port_l1_change:1;
-+ unsigned reserved:26;
-+ } b;
-+ } flags;
-+
-+ /**
-+ * Inactive items in the non-periodic schedule. This is a list of
-+ * Queue Heads. Transfers associated with these Queue Heads are not
-+ * currently assigned to a host channel.
-+ */
-+ dwc_list_link_t non_periodic_sched_inactive;
-+
-+ /**
-+ * Active items in the non-periodic schedule. This is a list of
-+ * Queue Heads. Transfers associated with these Queue Heads are
-+ * currently assigned to a host channel.
-+ */
-+ dwc_list_link_t non_periodic_sched_active;
-+
-+ /**
-+ * Pointer to the next Queue Head to process in the active
-+ * non-periodic schedule.
-+ */
-+ dwc_list_link_t *non_periodic_qh_ptr;
-+
-+ /**
-+ * Inactive items in the periodic schedule. This is a list of QHs for
-+ * periodic transfers that are _not_ scheduled for the next frame.
-+ * Each QH in the list has an interval counter that determines when it
-+ * needs to be scheduled for execution. This scheduling mechanism
-+ * allows only a simple calculation for periodic bandwidth used (i.e.
-+ * must assume that all periodic transfers may need to execute in the
-+ * same frame). However, it greatly simplifies scheduling and should
-+ * be sufficient for the vast majority of OTG hosts, which need to
-+ * connect to a small number of peripherals at one time.
-+ *
-+ * Items move from this list to periodic_sched_ready when the QH
-+ * interval counter is 0 at SOF.
-+ */
-+ dwc_list_link_t periodic_sched_inactive;
-+
-+ /**
-+ * List of periodic QHs that are ready for execution in the next
-+ * frame, but have not yet been assigned to host channels.
-+ *
-+ * Items move from this list to periodic_sched_assigned as host
-+ * channels become available during the current frame.
-+ */
-+ dwc_list_link_t periodic_sched_ready;
-+
-+ /**
-+ * List of periodic QHs to be executed in the next frame that are
-+ * assigned to host channels.
-+ *
-+ * Items move from this list to periodic_sched_queued as the
-+ * transactions for the QH are queued to the DWC_otg controller.
-+ */
-+ dwc_list_link_t periodic_sched_assigned;
-+
-+ /**
-+ * List of periodic QHs that have been queued for execution.
-+ *
-+ * Items move from this list to either periodic_sched_inactive or
-+ * periodic_sched_ready when the channel associated with the transfer
-+ * is released. If the interval for the QH is 1, the item moves to
-+ * periodic_sched_ready because it must be rescheduled for the next
-+ * frame. Otherwise, the item moves to periodic_sched_inactive.
-+ */
-+ dwc_list_link_t periodic_sched_queued;
-+
-+ /**
-+ * Total bandwidth claimed so far for periodic transfers. This value
-+ * is in microseconds per (micro)frame. The assumption is that all
-+ * periodic transfers may occur in the same (micro)frame.
-+ */
-+ uint16_t periodic_usecs;
-+
-+ /**
-+ * Total bandwidth claimed so far for all periodic transfers
-+ * in a frame.
-+ * This will include a mixture of HS and FS transfers.
-+ * Units are microseconds per (micro)frame.
-+ * We have a budget per frame and have to schedule
-+ * transactions accordingly.
-+ * Watch out for the fact that things are actually scheduled for the
-+ * "next frame".
-+ */
-+ uint16_t frame_usecs[8];
-+
-+
-+ /**
-+ * Frame number read from the core at SOF. The value ranges from 0 to
-+ * DWC_HFNUM_MAX_FRNUM.
-+ */
-+ uint16_t frame_number;
-+
-+ /**
-+ * Count of periodic QHs, if using several eps. For SOF enable/disable.
-+ */
-+ uint16_t periodic_qh_count;
-+
-+ /**
-+ * Free host channels in the controller. This is a list of
-+ * dwc_hc_t items.
-+ */
-+ struct hc_list free_hc_list;
-+ /**
-+ * Number of host channels assigned to periodic transfers. Currently
-+ * assuming that there is a dedicated host channel for each periodic
-+ * transaction and at least one host channel available for
-+ * non-periodic transactions.
-+ */
-+ int periodic_channels; /* microframe_schedule==0 */
-+
-+ /**
-+ * Number of host channels assigned to non-periodic transfers.
-+ */
-+ int non_periodic_channels; /* microframe_schedule==0 */
-+
-+ /**
-+ * Number of host channels assigned to non-periodic transfers.
-+ */
-+ int available_host_channels;
-+
-+ /**
-+ * Array of pointers to the host channel descriptors. Allows accessing
-+ * a host channel descriptor given the host channel number. This is
-+ * useful in interrupt handlers.
-+ */
-+ struct dwc_hc *hc_ptr_array[MAX_EPS_CHANNELS];
-+
-+ /**
-+ * Buffer to use for any data received during the status phase of a
-+ * control transfer. Normally no data is transferred during the status
-+ * phase. This buffer is used as a bit bucket.
-+ */
-+ uint8_t *status_buf;
-+
-+ /**
-+ * DMA address for status_buf.
-+ */
-+ dma_addr_t status_buf_dma;
-+#define DWC_OTG_HCD_STATUS_BUF_SIZE 64
-+
-+ /**
-+ * Connection timer. An OTG host must display a message if the device
-+ * does not connect. Started when the VBus power is turned on via
-+ * sysfs attribute "buspower".
-+ */
-+ dwc_timer_t *conn_timer;
-+
-+ /* Tasket to do a reset */
-+ dwc_tasklet_t *reset_tasklet;
-+
-+ dwc_tasklet_t *completion_tasklet;
-+ struct urb_list completed_urb_list;
-+
-+ /* */
-+ dwc_spinlock_t *lock;
-+ dwc_spinlock_t *channel_lock;
-+ /**
-+ * Private data that could be used by OS wrapper.
-+ */
-+ void *priv;
-+
-+ uint8_t otg_port;
-+
-+ /** Frame List */
-+ uint32_t *frame_list;
-+
-+ /** Hub - Port assignment */
-+ int hub_port[128];
-+#ifdef FIQ_DEBUG
-+ int hub_port_alloc[2048];
-+#endif
-+
-+ /** Frame List DMA address */
-+ dma_addr_t frame_list_dma;
-+
-+ struct fiq_stack *fiq_stack;
-+ struct fiq_state *fiq_state;
-+
-+ /** Virtual address for split transaction DMA bounce buffers */
-+ struct fiq_dma_blob *fiq_dmab;
-+
-+#ifdef DEBUG
-+ uint32_t frrem_samples;
-+ uint64_t frrem_accum;
-+
-+ uint32_t hfnum_7_samples_a;
-+ uint64_t hfnum_7_frrem_accum_a;
-+ uint32_t hfnum_0_samples_a;
-+ uint64_t hfnum_0_frrem_accum_a;
-+ uint32_t hfnum_other_samples_a;
-+ uint64_t hfnum_other_frrem_accum_a;
-+
-+ uint32_t hfnum_7_samples_b;
-+ uint64_t hfnum_7_frrem_accum_b;
-+ uint32_t hfnum_0_samples_b;
-+ uint64_t hfnum_0_frrem_accum_b;
-+ uint32_t hfnum_other_samples_b;
-+ uint64_t hfnum_other_frrem_accum_b;
-+#endif
-+};
-+
-+/** @name Transaction Execution Functions */
-+/** @{ */
-+extern dwc_otg_transaction_type_e dwc_otg_hcd_select_transactions(dwc_otg_hcd_t
-+ * hcd);
-+extern void dwc_otg_hcd_queue_transactions(dwc_otg_hcd_t * hcd,
-+ dwc_otg_transaction_type_e tr_type);
-+
-+int dwc_otg_hcd_allocate_port(dwc_otg_hcd_t * hcd, dwc_otg_qh_t *qh);
-+void dwc_otg_hcd_release_port(dwc_otg_hcd_t * dwc_otg_hcd, dwc_otg_qh_t *qh);
-+
-+extern int fiq_fsm_queue_transaction(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh);
-+extern int fiq_fsm_transaction_suitable(dwc_otg_qh_t *qh);
-+extern void dwc_otg_cleanup_fiq_channel(dwc_otg_hcd_t *hcd, uint32_t num);
-+
-+/** @} */
-+
-+/** @name Interrupt Handler Functions */
-+/** @{ */
-+extern int32_t dwc_otg_hcd_handle_intr(dwc_otg_hcd_t * dwc_otg_hcd);
-+extern int32_t dwc_otg_hcd_handle_sof_intr(dwc_otg_hcd_t * dwc_otg_hcd);
-+extern int32_t dwc_otg_hcd_handle_rx_status_q_level_intr(dwc_otg_hcd_t *
-+ dwc_otg_hcd);
-+extern int32_t dwc_otg_hcd_handle_np_tx_fifo_empty_intr(dwc_otg_hcd_t *
-+ dwc_otg_hcd);
-+extern int32_t dwc_otg_hcd_handle_perio_tx_fifo_empty_intr(dwc_otg_hcd_t *
-+ dwc_otg_hcd);
-+extern int32_t dwc_otg_hcd_handle_incomplete_periodic_intr(dwc_otg_hcd_t *
-+ dwc_otg_hcd);
-+extern int32_t dwc_otg_hcd_handle_port_intr(dwc_otg_hcd_t * dwc_otg_hcd);
-+extern int32_t dwc_otg_hcd_handle_conn_id_status_change_intr(dwc_otg_hcd_t *
-+ dwc_otg_hcd);
-+extern int32_t dwc_otg_hcd_handle_disconnect_intr(dwc_otg_hcd_t * dwc_otg_hcd);
-+extern int32_t dwc_otg_hcd_handle_hc_intr(dwc_otg_hcd_t * dwc_otg_hcd);
-+extern int32_t dwc_otg_hcd_handle_hc_n_intr(dwc_otg_hcd_t * dwc_otg_hcd,
-+ uint32_t num);
-+extern int32_t dwc_otg_hcd_handle_session_req_intr(dwc_otg_hcd_t * dwc_otg_hcd);
-+extern int32_t dwc_otg_hcd_handle_wakeup_detected_intr(dwc_otg_hcd_t *
-+ dwc_otg_hcd);
-+/** @} */
-+
-+/** @name Schedule Queue Functions */
-+/** @{ */
-+
-+/* Implemented in dwc_otg_hcd_queue.c */
-+extern dwc_otg_qh_t *dwc_otg_hcd_qh_create(dwc_otg_hcd_t * hcd,
-+ dwc_otg_hcd_urb_t * urb, int atomic_alloc);
-+extern void dwc_otg_hcd_qh_free(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh);
-+extern int dwc_otg_hcd_qh_add(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh);
-+extern void dwc_otg_hcd_qh_remove(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh);
-+extern void dwc_otg_hcd_qh_deactivate(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh,
-+ int sched_csplit);
-+
-+/** Remove and free a QH */
-+static inline void dwc_otg_hcd_qh_remove_and_free(dwc_otg_hcd_t * hcd,
-+ dwc_otg_qh_t * qh)
-+{
-+ dwc_irqflags_t flags;
-+ DWC_SPINLOCK_IRQSAVE(hcd->lock, &flags);
-+ dwc_otg_hcd_qh_remove(hcd, qh);
-+ DWC_SPINUNLOCK_IRQRESTORE(hcd->lock, flags);
-+ dwc_otg_hcd_qh_free(hcd, qh);
-+}
-+
-+/** Allocates memory for a QH structure.
-+ * @return Returns the memory allocate or NULL on error. */
-+static inline dwc_otg_qh_t *dwc_otg_hcd_qh_alloc(int atomic_alloc)
-+{
-+ if (atomic_alloc)
-+ return (dwc_otg_qh_t *) DWC_ALLOC_ATOMIC(sizeof(dwc_otg_qh_t));
-+ else
-+ return (dwc_otg_qh_t *) DWC_ALLOC(sizeof(dwc_otg_qh_t));
-+}
-+
-+extern dwc_otg_qtd_t *dwc_otg_hcd_qtd_create(dwc_otg_hcd_urb_t * urb,
-+ int atomic_alloc);
-+extern void dwc_otg_hcd_qtd_init(dwc_otg_qtd_t * qtd, dwc_otg_hcd_urb_t * urb);
-+extern int dwc_otg_hcd_qtd_add(dwc_otg_qtd_t * qtd, dwc_otg_hcd_t * dwc_otg_hcd,
-+ dwc_otg_qh_t ** qh, int atomic_alloc);
-+
-+/** Allocates memory for a QTD structure.
-+ * @return Returns the memory allocate or NULL on error. */
-+static inline dwc_otg_qtd_t *dwc_otg_hcd_qtd_alloc(int atomic_alloc)
-+{
-+ if (atomic_alloc)
-+ return (dwc_otg_qtd_t *) DWC_ALLOC_ATOMIC(sizeof(dwc_otg_qtd_t));
-+ else
-+ return (dwc_otg_qtd_t *) DWC_ALLOC(sizeof(dwc_otg_qtd_t));
-+}
-+
-+/** Frees the memory for a QTD structure. QTD should already be removed from
-+ * list.
-+ * @param qtd QTD to free.*/
-+static inline void dwc_otg_hcd_qtd_free(dwc_otg_qtd_t * qtd)
-+{
-+ DWC_FREE(qtd);
-+}
-+
-+/** Removes a QTD from list.
-+ * @param hcd HCD instance.
-+ * @param qtd QTD to remove from list.
-+ * @param qh QTD belongs to.
-+ */
-+static inline void dwc_otg_hcd_qtd_remove(dwc_otg_hcd_t * hcd,
-+ dwc_otg_qtd_t * qtd,
-+ dwc_otg_qh_t * qh)
-+{
-+ DWC_CIRCLEQ_REMOVE(&qh->qtd_list, qtd, qtd_list_entry);
-+}
-+
-+/** Remove and free a QTD
-+ * Need to disable IRQ and hold hcd lock while calling this function out of
-+ * interrupt servicing chain */
-+static inline void dwc_otg_hcd_qtd_remove_and_free(dwc_otg_hcd_t * hcd,
-+ dwc_otg_qtd_t * qtd,
-+ dwc_otg_qh_t * qh)
-+{
-+ dwc_otg_hcd_qtd_remove(hcd, qtd, qh);
-+ dwc_otg_hcd_qtd_free(qtd);
-+}
-+
-+/** @} */
-+
-+/** @name Descriptor DMA Supporting Functions */
-+/** @{ */
-+
-+extern void dwc_otg_hcd_start_xfer_ddma(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh);
-+extern void dwc_otg_hcd_complete_xfer_ddma(dwc_otg_hcd_t * hcd,
-+ dwc_hc_t * hc,
-+ dwc_otg_hc_regs_t * hc_regs,
-+ dwc_otg_halt_status_e halt_status);
-+
-+extern int dwc_otg_hcd_qh_init_ddma(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh);
-+extern void dwc_otg_hcd_qh_free_ddma(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh);
-+
-+/** @} */
-+
-+/** @name Internal Functions */
-+/** @{ */
-+dwc_otg_qh_t *dwc_urb_to_qh(dwc_otg_hcd_urb_t * urb);
-+/** @} */
-+
-+#ifdef CONFIG_USB_DWC_OTG_LPM
-+extern int dwc_otg_hcd_get_hc_for_lpm_tran(dwc_otg_hcd_t * hcd,
-+ uint8_t devaddr);
-+extern void dwc_otg_hcd_free_hc_from_lpm(dwc_otg_hcd_t * hcd);
-+#endif
-+
-+/** Gets the QH that contains the list_head */
-+#define dwc_list_to_qh(_list_head_ptr_) container_of(_list_head_ptr_, dwc_otg_qh_t, qh_list_entry)
-+
-+/** Gets the QTD that contains the list_head */
-+#define dwc_list_to_qtd(_list_head_ptr_) container_of(_list_head_ptr_, dwc_otg_qtd_t, qtd_list_entry)
-+
-+/** Check if QH is non-periodic */
-+#define dwc_qh_is_non_per(_qh_ptr_) ((_qh_ptr_->ep_type == UE_BULK) || \
-+ (_qh_ptr_->ep_type == UE_CONTROL))
-+
-+/** High bandwidth multiplier as encoded in highspeed endpoint descriptors */
-+#define dwc_hb_mult(wMaxPacketSize) (1 + (((wMaxPacketSize) >> 11) & 0x03))
-+
-+/** Packet size for any kind of endpoint descriptor */
-+#define dwc_max_packet(wMaxPacketSize) ((wMaxPacketSize) & 0x07ff)
-+
-+/**
-+ * Returns true if _frame1 is less than or equal to _frame2. The comparison is
-+ * done modulo DWC_HFNUM_MAX_FRNUM. This accounts for the rollover of the
-+ * frame number when the max frame number is reached.
-+ */
-+static inline int dwc_frame_num_le(uint16_t frame1, uint16_t frame2)
-+{
-+ return ((frame2 - frame1) & DWC_HFNUM_MAX_FRNUM) <=
-+ (DWC_HFNUM_MAX_FRNUM >> 1);
-+}
-+
-+/**
-+ * Returns true if _frame1 is greater than _frame2. The comparison is done
-+ * modulo DWC_HFNUM_MAX_FRNUM. This accounts for the rollover of the frame
-+ * number when the max frame number is reached.
-+ */
-+static inline int dwc_frame_num_gt(uint16_t frame1, uint16_t frame2)
-+{
-+ return (frame1 != frame2) &&
-+ (((frame1 - frame2) & DWC_HFNUM_MAX_FRNUM) <
-+ (DWC_HFNUM_MAX_FRNUM >> 1));
-+}
-+
-+/**
-+ * Increments _frame by the amount specified by _inc. The addition is done
-+ * modulo DWC_HFNUM_MAX_FRNUM. Returns the incremented value.
-+ */
-+static inline uint16_t dwc_frame_num_inc(uint16_t frame, uint16_t inc)
-+{
-+ return (frame + inc) & DWC_HFNUM_MAX_FRNUM;
-+}
-+
-+static inline uint16_t dwc_full_frame_num(uint16_t frame)
-+{
-+ return (frame & DWC_HFNUM_MAX_FRNUM) >> 3;
-+}
-+
-+static inline uint16_t dwc_micro_frame_num(uint16_t frame)
-+{
-+ return frame & 0x7;
-+}
-+
-+void dwc_otg_hcd_save_data_toggle(dwc_hc_t * hc,
-+ dwc_otg_hc_regs_t * hc_regs,
-+ dwc_otg_qtd_t * qtd);
-+
-+#ifdef DEBUG
-+/**
-+ * Macro to sample the remaining PHY clocks left in the current frame. This
-+ * may be used during debugging to determine the average time it takes to
-+ * execute sections of code. There are two possible sample points, "a" and
-+ * "b", so the _letter argument must be one of these values.
-+ *
-+ * To dump the average sample times, read the "hcd_frrem" sysfs attribute. For
-+ * example, "cat /sys/devices/lm0/hcd_frrem".
-+ */
-+#define dwc_sample_frrem(_hcd, _qh, _letter) \
-+{ \
-+ hfnum_data_t hfnum; \
-+ dwc_otg_qtd_t *qtd; \
-+ qtd = list_entry(_qh->qtd_list.next, dwc_otg_qtd_t, qtd_list_entry); \
-+ if (usb_pipeint(qtd->urb->pipe) && _qh->start_split_frame != 0 && !qtd->complete_split) { \
-+ hfnum.d32 = DWC_READ_REG32(&_hcd->core_if->host_if->host_global_regs->hfnum); \
-+ switch (hfnum.b.frnum & 0x7) { \
-+ case 7: \
-+ _hcd->hfnum_7_samples_##_letter++; \
-+ _hcd->hfnum_7_frrem_accum_##_letter += hfnum.b.frrem; \
-+ break; \
-+ case 0: \
-+ _hcd->hfnum_0_samples_##_letter++; \
-+ _hcd->hfnum_0_frrem_accum_##_letter += hfnum.b.frrem; \
-+ break; \
-+ default: \
-+ _hcd->hfnum_other_samples_##_letter++; \
-+ _hcd->hfnum_other_frrem_accum_##_letter += hfnum.b.frrem; \
-+ break; \
-+ } \
-+ } \
-+}
-+#else
-+#define dwc_sample_frrem(_hcd, _qh, _letter)
-+#endif
-+#endif
-+#endif /* DWC_DEVICE_ONLY */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c 2015-08-26 10:26:11.809358522 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,1132 @@
+/*==========================================================================
+ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd_ddma.c $
@@ -276035,9 +277525,875 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c linux-rpi/driv
+}
+
+#endif /* DWC_DEVICE_ONLY */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h 2015-08-26 10:26:11.809358522 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd.h
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd.h 2015-10-07 16:40:56.000000000 +0200
+@@ -0,0 +1,862 @@
++/* ==========================================================================
++ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd.h $
++ * $Revision: #58 $
++ * $Date: 2011/09/15 $
++ * $Change: 1846647 $
++ *
++ * Synopsys HS OTG Linux Software Driver and documentation (hereinafter,
++ * "Software") is an Unsupported proprietary work of Synopsys, Inc. unless
++ * otherwise expressly agreed to in writing between Synopsys and you.
++ *
++ * The Software IS NOT an item of Licensed Software or Licensed Product under
++ * any End User Software License Agreement or Agreement for Licensed Product
++ * with Synopsys or any supplement thereto. You are permitted to use and
++ * redistribute this Software in source and binary forms, with or without
++ * modification, provided that redistributions of source code must retain this
++ * notice. You may not view, use, disclose, copy or distribute this file or
++ * any information contained herein except pursuant to this license grant from
++ * Synopsys. If you do not agree with this notice, including the disclaimer
++ * below, then you are not authorized to use the Software.
++ *
++ * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS BE LIABLE FOR ANY DIRECT,
++ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
++ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
++ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
++ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
++ * DAMAGE.
++ * ========================================================================== */
++#ifndef DWC_DEVICE_ONLY
++#ifndef __DWC_HCD_H__
++#define __DWC_HCD_H__
++
++#include "dwc_otg_os_dep.h"
++#include "usb.h"
++#include "dwc_otg_hcd_if.h"
++#include "dwc_otg_core_if.h"
++#include "dwc_list.h"
++#include "dwc_otg_cil.h"
++#include "dwc_otg_fiq_fsm.h"
++
++
++/**
++ * @file
++ *
++ * This file contains the structures, constants, and interfaces for
++ * the Host Contoller Driver (HCD).
++ *
++ * The Host Controller Driver (HCD) is responsible for translating requests
++ * from the USB Driver into the appropriate actions on the DWC_otg controller.
++ * It isolates the USBD from the specifics of the controller by providing an
++ * API to the USBD.
++ */
++
++struct dwc_otg_hcd_pipe_info {
++ uint8_t dev_addr;
++ uint8_t ep_num;
++ uint8_t pipe_type;
++ uint8_t pipe_dir;
++ uint16_t mps;
++};
++
++struct dwc_otg_hcd_iso_packet_desc {
++ uint32_t offset;
++ uint32_t length;
++ uint32_t actual_length;
++ uint32_t status;
++};
++
++struct dwc_otg_qtd;
++
++struct dwc_otg_hcd_urb {
++ void *priv;
++ struct dwc_otg_qtd *qtd;
++ void *buf;
++ dwc_dma_t dma;
++ void *setup_packet;
++ dwc_dma_t setup_dma;
++ uint32_t length;
++ uint32_t actual_length;
++ uint32_t status;
++ uint32_t error_count;
++ uint32_t packet_count;
++ uint32_t flags;
++ uint16_t interval;
++ struct dwc_otg_hcd_pipe_info pipe_info;
++ struct dwc_otg_hcd_iso_packet_desc iso_descs[0];
++};
++
++static inline uint8_t dwc_otg_hcd_get_ep_num(struct dwc_otg_hcd_pipe_info *pipe)
++{
++ return pipe->ep_num;
++}
++
++static inline uint8_t dwc_otg_hcd_get_pipe_type(struct dwc_otg_hcd_pipe_info
++ *pipe)
++{
++ return pipe->pipe_type;
++}
++
++static inline uint16_t dwc_otg_hcd_get_mps(struct dwc_otg_hcd_pipe_info *pipe)
++{
++ return pipe->mps;
++}
++
++static inline uint8_t dwc_otg_hcd_get_dev_addr(struct dwc_otg_hcd_pipe_info
++ *pipe)
++{
++ return pipe->dev_addr;
++}
++
++static inline uint8_t dwc_otg_hcd_is_pipe_isoc(struct dwc_otg_hcd_pipe_info
++ *pipe)
++{
++ return (pipe->pipe_type == UE_ISOCHRONOUS);
++}
++
++static inline uint8_t dwc_otg_hcd_is_pipe_int(struct dwc_otg_hcd_pipe_info
++ *pipe)
++{
++ return (pipe->pipe_type == UE_INTERRUPT);
++}
++
++static inline uint8_t dwc_otg_hcd_is_pipe_bulk(struct dwc_otg_hcd_pipe_info
++ *pipe)
++{
++ return (pipe->pipe_type == UE_BULK);
++}
++
++static inline uint8_t dwc_otg_hcd_is_pipe_control(struct dwc_otg_hcd_pipe_info
++ *pipe)
++{
++ return (pipe->pipe_type == UE_CONTROL);
++}
++
++static inline uint8_t dwc_otg_hcd_is_pipe_in(struct dwc_otg_hcd_pipe_info *pipe)
++{
++ return (pipe->pipe_dir == UE_DIR_IN);
++}
++
++static inline uint8_t dwc_otg_hcd_is_pipe_out(struct dwc_otg_hcd_pipe_info
++ *pipe)
++{
++ return (!dwc_otg_hcd_is_pipe_in(pipe));
++}
++
++static inline void dwc_otg_hcd_fill_pipe(struct dwc_otg_hcd_pipe_info *pipe,
++ uint8_t devaddr, uint8_t ep_num,
++ uint8_t pipe_type, uint8_t pipe_dir,
++ uint16_t mps)
++{
++ pipe->dev_addr = devaddr;
++ pipe->ep_num = ep_num;
++ pipe->pipe_type = pipe_type;
++ pipe->pipe_dir = pipe_dir;
++ pipe->mps = mps;
++}
++
++/**
++ * Phases for control transfers.
++ */
++typedef enum dwc_otg_control_phase {
++ DWC_OTG_CONTROL_SETUP,
++ DWC_OTG_CONTROL_DATA,
++ DWC_OTG_CONTROL_STATUS
++} dwc_otg_control_phase_e;
++
++/** Transaction types. */
++typedef enum dwc_otg_transaction_type {
++ DWC_OTG_TRANSACTION_NONE = 0,
++ DWC_OTG_TRANSACTION_PERIODIC = 1,
++ DWC_OTG_TRANSACTION_NON_PERIODIC = 2,
++ DWC_OTG_TRANSACTION_ALL = DWC_OTG_TRANSACTION_PERIODIC + DWC_OTG_TRANSACTION_NON_PERIODIC
++} dwc_otg_transaction_type_e;
++
++struct dwc_otg_qh;
++
++/**
++ * A Queue Transfer Descriptor (QTD) holds the state of a bulk, control,
++ * interrupt, or isochronous transfer. A single QTD is created for each URB
++ * (of one of these types) submitted to the HCD. The transfer associated with
++ * a QTD may require one or multiple transactions.
++ *
++ * A QTD is linked to a Queue Head, which is entered in either the
++ * non-periodic or periodic schedule for execution. When a QTD is chosen for
++ * execution, some or all of its transactions may be executed. After
++ * execution, the state of the QTD is updated. The QTD may be retired if all
++ * its transactions are complete or if an error occurred. Otherwise, it
++ * remains in the schedule so more transactions can be executed later.
++ */
++typedef struct dwc_otg_qtd {
++ /**
++ * Determines the PID of the next data packet for the data phase of
++ * control transfers. Ignored for other transfer types.<br>
++ * One of the following values:
++ * - DWC_OTG_HC_PID_DATA0
++ * - DWC_OTG_HC_PID_DATA1
++ */
++ uint8_t data_toggle;
++
++ /** Current phase for control transfers (Setup, Data, or Status). */
++ dwc_otg_control_phase_e control_phase;
++
++ /** Keep track of the current split type
++ * for FS/LS endpoints on a HS Hub */
++ uint8_t complete_split;
++
++ /** How many bytes transferred during SSPLIT OUT */
++ uint32_t ssplit_out_xfer_count;
++
++ /**
++ * Holds the number of bus errors that have occurred for a transaction
++ * within this transfer.
++ */
++ uint8_t error_count;
++
++ /**
++ * Index of the next frame descriptor for an isochronous transfer. A
++ * frame descriptor describes the buffer position and length of the
++ * data to be transferred in the next scheduled (micro)frame of an
++ * isochronous transfer. It also holds status for that transaction.
++ * The frame index starts at 0.
++ */
++ uint16_t isoc_frame_index;
++
++ /** Position of the ISOC split on full/low speed */
++ uint8_t isoc_split_pos;
++
++ /** Position of the ISOC split in the buffer for the current frame */
++ uint16_t isoc_split_offset;
++
++ /** URB for this transfer */
++ struct dwc_otg_hcd_urb *urb;
++
++ struct dwc_otg_qh *qh;
++
++ /** This list of QTDs */
++ DWC_CIRCLEQ_ENTRY(dwc_otg_qtd) qtd_list_entry;
++
++ /** Indicates if this QTD is currently processed by HW. */
++ uint8_t in_process;
++
++ /** Number of DMA descriptors for this QTD */
++ uint8_t n_desc;
++
++ /**
++ * Last activated frame(packet) index.
++ * Used in Descriptor DMA mode only.
++ */
++ uint16_t isoc_frame_index_last;
++
++} dwc_otg_qtd_t;
++
++DWC_CIRCLEQ_HEAD(dwc_otg_qtd_list, dwc_otg_qtd);
++
++/**
++ * A Queue Head (QH) holds the static characteristics of an endpoint and
++ * maintains a list of transfers (QTDs) for that endpoint. A QH structure may
++ * be entered in either the non-periodic or periodic schedule.
++ */
++typedef struct dwc_otg_qh {
++ /**
++ * Endpoint type.
++ * One of the following values:
++ * - UE_CONTROL
++ * - UE_BULK
++ * - UE_INTERRUPT
++ * - UE_ISOCHRONOUS
++ */
++ uint8_t ep_type;
++ uint8_t ep_is_in;
++
++ /** wMaxPacketSize Field of Endpoint Descriptor. */
++ uint16_t maxp;
++
++ /**
++ * Device speed.
++ * One of the following values:
++ * - DWC_OTG_EP_SPEED_LOW
++ * - DWC_OTG_EP_SPEED_FULL
++ * - DWC_OTG_EP_SPEED_HIGH
++ */
++ uint8_t dev_speed;
++
++ /**
++ * Determines the PID of the next data packet for non-control
++ * transfers. Ignored for control transfers.<br>
++ * One of the following values:
++ * - DWC_OTG_HC_PID_DATA0
++ * - DWC_OTG_HC_PID_DATA1
++ */
++ uint8_t data_toggle;
++
++ /** Ping state if 1. */
++ uint8_t ping_state;
++
++ /**
++ * List of QTDs for this QH.
++ */
++ struct dwc_otg_qtd_list qtd_list;
++
++ /** Host channel currently processing transfers for this QH. */
++ struct dwc_hc *channel;
++
++ /** Full/low speed endpoint on high-speed hub requires split. */
++ uint8_t do_split;
++
++ /** @name Periodic schedule information */
++ /** @{ */
++
++ /** Bandwidth in microseconds per (micro)frame. */
++ uint16_t usecs;
++
++ /** Interval between transfers in (micro)frames. */
++ uint16_t interval;
++
++ /**
++ * (micro)frame to initialize a periodic transfer. The transfer
++ * executes in the following (micro)frame.
++ */
++ uint16_t sched_frame;
++
++ /*
++ ** Frame a NAK was received on this queue head, used to minimise NAK retransmission
++ */
++ uint16_t nak_frame;
++
++ /** (micro)frame at which last start split was initialized. */
++ uint16_t start_split_frame;
++
++ /** @} */
++
++ /**
++ * Used instead of original buffer if
++ * it(physical address) is not dword-aligned.
++ */
++ uint8_t *dw_align_buf;
++ dwc_dma_t dw_align_buf_dma;
++
++ /** Entry for QH in either the periodic or non-periodic schedule. */
++ dwc_list_link_t qh_list_entry;
++
++ /** @name Descriptor DMA support */
++ /** @{ */
++
++ /** Descriptor List. */
++ dwc_otg_host_dma_desc_t *desc_list;
++
++ /** Descriptor List physical address. */
++ dwc_dma_t desc_list_dma;
++
++ /**
++ * Xfer Bytes array.
++ * Each element corresponds to a descriptor and indicates
++ * original XferSize size value for the descriptor.
++ */
++ uint32_t *n_bytes;
++
++ /** Actual number of transfer descriptors in a list. */
++ uint16_t ntd;
++
++ /** First activated isochronous transfer descriptor index. */
++ uint8_t td_first;
++ /** Last activated isochronous transfer descriptor index. */
++ uint8_t td_last;
++
++ /** @} */
++
++
++ uint16_t speed;
++ uint16_t frame_usecs[8];
++
++ uint32_t skip_count;
++} dwc_otg_qh_t;
++
++DWC_CIRCLEQ_HEAD(hc_list, dwc_hc);
++
++typedef struct urb_tq_entry {
++ struct urb *urb;
++ DWC_TAILQ_ENTRY(urb_tq_entry) urb_tq_entries;
++} urb_tq_entry_t;
++
++DWC_TAILQ_HEAD(urb_list, urb_tq_entry);
++
++/**
++ * This structure holds the state of the HCD, including the non-periodic and
++ * periodic schedules.
++ */
++struct dwc_otg_hcd {
++ /** The DWC otg device pointer */
++ struct dwc_otg_device *otg_dev;
++ /** DWC OTG Core Interface Layer */
++ dwc_otg_core_if_t *core_if;
++
++ /** Function HCD driver callbacks */
++ struct dwc_otg_hcd_function_ops *fops;
++
++ /** Internal DWC HCD Flags */
++ volatile union dwc_otg_hcd_internal_flags {
++ uint32_t d32;
++ struct {
++ unsigned port_connect_status_change:1;
++ unsigned port_connect_status:1;
++ unsigned port_reset_change:1;
++ unsigned port_enable_change:1;
++ unsigned port_suspend_change:1;
++ unsigned port_over_current_change:1;
++ unsigned port_l1_change:1;
++ unsigned reserved:26;
++ } b;
++ } flags;
++
++ /**
++ * Inactive items in the non-periodic schedule. This is a list of
++ * Queue Heads. Transfers associated with these Queue Heads are not
++ * currently assigned to a host channel.
++ */
++ dwc_list_link_t non_periodic_sched_inactive;
++
++ /**
++ * Active items in the non-periodic schedule. This is a list of
++ * Queue Heads. Transfers associated with these Queue Heads are
++ * currently assigned to a host channel.
++ */
++ dwc_list_link_t non_periodic_sched_active;
++
++ /**
++ * Pointer to the next Queue Head to process in the active
++ * non-periodic schedule.
++ */
++ dwc_list_link_t *non_periodic_qh_ptr;
++
++ /**
++ * Inactive items in the periodic schedule. This is a list of QHs for
++ * periodic transfers that are _not_ scheduled for the next frame.
++ * Each QH in the list has an interval counter that determines when it
++ * needs to be scheduled for execution. This scheduling mechanism
++ * allows only a simple calculation for periodic bandwidth used (i.e.
++ * must assume that all periodic transfers may need to execute in the
++ * same frame). However, it greatly simplifies scheduling and should
++ * be sufficient for the vast majority of OTG hosts, which need to
++ * connect to a small number of peripherals at one time.
++ *
++ * Items move from this list to periodic_sched_ready when the QH
++ * interval counter is 0 at SOF.
++ */
++ dwc_list_link_t periodic_sched_inactive;
++
++ /**
++ * List of periodic QHs that are ready for execution in the next
++ * frame, but have not yet been assigned to host channels.
++ *
++ * Items move from this list to periodic_sched_assigned as host
++ * channels become available during the current frame.
++ */
++ dwc_list_link_t periodic_sched_ready;
++
++ /**
++ * List of periodic QHs to be executed in the next frame that are
++ * assigned to host channels.
++ *
++ * Items move from this list to periodic_sched_queued as the
++ * transactions for the QH are queued to the DWC_otg controller.
++ */
++ dwc_list_link_t periodic_sched_assigned;
++
++ /**
++ * List of periodic QHs that have been queued for execution.
++ *
++ * Items move from this list to either periodic_sched_inactive or
++ * periodic_sched_ready when the channel associated with the transfer
++ * is released. If the interval for the QH is 1, the item moves to
++ * periodic_sched_ready because it must be rescheduled for the next
++ * frame. Otherwise, the item moves to periodic_sched_inactive.
++ */
++ dwc_list_link_t periodic_sched_queued;
++
++ /**
++ * Total bandwidth claimed so far for periodic transfers. This value
++ * is in microseconds per (micro)frame. The assumption is that all
++ * periodic transfers may occur in the same (micro)frame.
++ */
++ uint16_t periodic_usecs;
++
++ /**
++ * Total bandwidth claimed so far for all periodic transfers
++ * in a frame.
++ * This will include a mixture of HS and FS transfers.
++ * Units are microseconds per (micro)frame.
++ * We have a budget per frame and have to schedule
++ * transactions accordingly.
++ * Watch out for the fact that things are actually scheduled for the
++ * "next frame".
++ */
++ uint16_t frame_usecs[8];
++
++
++ /**
++ * Frame number read from the core at SOF. The value ranges from 0 to
++ * DWC_HFNUM_MAX_FRNUM.
++ */
++ uint16_t frame_number;
++
++ /**
++ * Count of periodic QHs, if using several eps. For SOF enable/disable.
++ */
++ uint16_t periodic_qh_count;
++
++ /**
++ * Free host channels in the controller. This is a list of
++ * dwc_hc_t items.
++ */
++ struct hc_list free_hc_list;
++ /**
++ * Number of host channels assigned to periodic transfers. Currently
++ * assuming that there is a dedicated host channel for each periodic
++ * transaction and at least one host channel available for
++ * non-periodic transactions.
++ */
++ int periodic_channels; /* microframe_schedule==0 */
++
++ /**
++ * Number of host channels assigned to non-periodic transfers.
++ */
++ int non_periodic_channels; /* microframe_schedule==0 */
++
++ /**
++ * Number of host channels assigned to non-periodic transfers.
++ */
++ int available_host_channels;
++
++ /**
++ * Array of pointers to the host channel descriptors. Allows accessing
++ * a host channel descriptor given the host channel number. This is
++ * useful in interrupt handlers.
++ */
++ struct dwc_hc *hc_ptr_array[MAX_EPS_CHANNELS];
++
++ /**
++ * Buffer to use for any data received during the status phase of a
++ * control transfer. Normally no data is transferred during the status
++ * phase. This buffer is used as a bit bucket.
++ */
++ uint8_t *status_buf;
++
++ /**
++ * DMA address for status_buf.
++ */
++ dma_addr_t status_buf_dma;
++#define DWC_OTG_HCD_STATUS_BUF_SIZE 64
++
++ /**
++ * Connection timer. An OTG host must display a message if the device
++ * does not connect. Started when the VBus power is turned on via
++ * sysfs attribute "buspower".
++ */
++ dwc_timer_t *conn_timer;
++
++ /* Tasket to do a reset */
++ dwc_tasklet_t *reset_tasklet;
++
++ dwc_tasklet_t *completion_tasklet;
++ struct urb_list completed_urb_list;
++
++ /* */
++ dwc_spinlock_t *lock;
++ dwc_spinlock_t *channel_lock;
++ /**
++ * Private data that could be used by OS wrapper.
++ */
++ void *priv;
++
++ uint8_t otg_port;
++
++ /** Frame List */
++ uint32_t *frame_list;
++
++ /** Hub - Port assignment */
++ int hub_port[128];
++#ifdef FIQ_DEBUG
++ int hub_port_alloc[2048];
++#endif
++
++ /** Frame List DMA address */
++ dma_addr_t frame_list_dma;
++
++ struct fiq_stack *fiq_stack;
++ struct fiq_state *fiq_state;
++
++ /** Virtual address for split transaction DMA bounce buffers */
++ struct fiq_dma_blob *fiq_dmab;
++
++#ifdef DEBUG
++ uint32_t frrem_samples;
++ uint64_t frrem_accum;
++
++ uint32_t hfnum_7_samples_a;
++ uint64_t hfnum_7_frrem_accum_a;
++ uint32_t hfnum_0_samples_a;
++ uint64_t hfnum_0_frrem_accum_a;
++ uint32_t hfnum_other_samples_a;
++ uint64_t hfnum_other_frrem_accum_a;
++
++ uint32_t hfnum_7_samples_b;
++ uint64_t hfnum_7_frrem_accum_b;
++ uint32_t hfnum_0_samples_b;
++ uint64_t hfnum_0_frrem_accum_b;
++ uint32_t hfnum_other_samples_b;
++ uint64_t hfnum_other_frrem_accum_b;
++#endif
++};
++
++/** @name Transaction Execution Functions */
++/** @{ */
++extern dwc_otg_transaction_type_e dwc_otg_hcd_select_transactions(dwc_otg_hcd_t
++ * hcd);
++extern void dwc_otg_hcd_queue_transactions(dwc_otg_hcd_t * hcd,
++ dwc_otg_transaction_type_e tr_type);
++
++int dwc_otg_hcd_allocate_port(dwc_otg_hcd_t * hcd, dwc_otg_qh_t *qh);
++void dwc_otg_hcd_release_port(dwc_otg_hcd_t * dwc_otg_hcd, dwc_otg_qh_t *qh);
++
++extern int fiq_fsm_queue_transaction(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh);
++extern int fiq_fsm_transaction_suitable(dwc_otg_qh_t *qh);
++extern void dwc_otg_cleanup_fiq_channel(dwc_otg_hcd_t *hcd, uint32_t num);
++
++/** @} */
++
++/** @name Interrupt Handler Functions */
++/** @{ */
++extern int32_t dwc_otg_hcd_handle_intr(dwc_otg_hcd_t * dwc_otg_hcd);
++extern int32_t dwc_otg_hcd_handle_sof_intr(dwc_otg_hcd_t * dwc_otg_hcd);
++extern int32_t dwc_otg_hcd_handle_rx_status_q_level_intr(dwc_otg_hcd_t *
++ dwc_otg_hcd);
++extern int32_t dwc_otg_hcd_handle_np_tx_fifo_empty_intr(dwc_otg_hcd_t *
++ dwc_otg_hcd);
++extern int32_t dwc_otg_hcd_handle_perio_tx_fifo_empty_intr(dwc_otg_hcd_t *
++ dwc_otg_hcd);
++extern int32_t dwc_otg_hcd_handle_incomplete_periodic_intr(dwc_otg_hcd_t *
++ dwc_otg_hcd);
++extern int32_t dwc_otg_hcd_handle_port_intr(dwc_otg_hcd_t * dwc_otg_hcd);
++extern int32_t dwc_otg_hcd_handle_conn_id_status_change_intr(dwc_otg_hcd_t *
++ dwc_otg_hcd);
++extern int32_t dwc_otg_hcd_handle_disconnect_intr(dwc_otg_hcd_t * dwc_otg_hcd);
++extern int32_t dwc_otg_hcd_handle_hc_intr(dwc_otg_hcd_t * dwc_otg_hcd);
++extern int32_t dwc_otg_hcd_handle_hc_n_intr(dwc_otg_hcd_t * dwc_otg_hcd,
++ uint32_t num);
++extern int32_t dwc_otg_hcd_handle_session_req_intr(dwc_otg_hcd_t * dwc_otg_hcd);
++extern int32_t dwc_otg_hcd_handle_wakeup_detected_intr(dwc_otg_hcd_t *
++ dwc_otg_hcd);
++/** @} */
++
++/** @name Schedule Queue Functions */
++/** @{ */
++
++/* Implemented in dwc_otg_hcd_queue.c */
++extern dwc_otg_qh_t *dwc_otg_hcd_qh_create(dwc_otg_hcd_t * hcd,
++ dwc_otg_hcd_urb_t * urb, int atomic_alloc);
++extern void dwc_otg_hcd_qh_free(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh);
++extern int dwc_otg_hcd_qh_add(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh);
++extern void dwc_otg_hcd_qh_remove(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh);
++extern void dwc_otg_hcd_qh_deactivate(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh,
++ int sched_csplit);
++
++/** Remove and free a QH */
++static inline void dwc_otg_hcd_qh_remove_and_free(dwc_otg_hcd_t * hcd,
++ dwc_otg_qh_t * qh)
++{
++ dwc_irqflags_t flags;
++ DWC_SPINLOCK_IRQSAVE(hcd->lock, &flags);
++ dwc_otg_hcd_qh_remove(hcd, qh);
++ DWC_SPINUNLOCK_IRQRESTORE(hcd->lock, flags);
++ dwc_otg_hcd_qh_free(hcd, qh);
++}
++
++/** Allocates memory for a QH structure.
++ * @return Returns the memory allocate or NULL on error. */
++static inline dwc_otg_qh_t *dwc_otg_hcd_qh_alloc(int atomic_alloc)
++{
++ if (atomic_alloc)
++ return (dwc_otg_qh_t *) DWC_ALLOC_ATOMIC(sizeof(dwc_otg_qh_t));
++ else
++ return (dwc_otg_qh_t *) DWC_ALLOC(sizeof(dwc_otg_qh_t));
++}
++
++extern dwc_otg_qtd_t *dwc_otg_hcd_qtd_create(dwc_otg_hcd_urb_t * urb,
++ int atomic_alloc);
++extern void dwc_otg_hcd_qtd_init(dwc_otg_qtd_t * qtd, dwc_otg_hcd_urb_t * urb);
++extern int dwc_otg_hcd_qtd_add(dwc_otg_qtd_t * qtd, dwc_otg_hcd_t * dwc_otg_hcd,
++ dwc_otg_qh_t ** qh, int atomic_alloc);
++
++/** Allocates memory for a QTD structure.
++ * @return Returns the memory allocate or NULL on error. */
++static inline dwc_otg_qtd_t *dwc_otg_hcd_qtd_alloc(int atomic_alloc)
++{
++ if (atomic_alloc)
++ return (dwc_otg_qtd_t *) DWC_ALLOC_ATOMIC(sizeof(dwc_otg_qtd_t));
++ else
++ return (dwc_otg_qtd_t *) DWC_ALLOC(sizeof(dwc_otg_qtd_t));
++}
++
++/** Frees the memory for a QTD structure. QTD should already be removed from
++ * list.
++ * @param qtd QTD to free.*/
++static inline void dwc_otg_hcd_qtd_free(dwc_otg_qtd_t * qtd)
++{
++ DWC_FREE(qtd);
++}
++
++/** Removes a QTD from list.
++ * @param hcd HCD instance.
++ * @param qtd QTD to remove from list.
++ * @param qh QTD belongs to.
++ */
++static inline void dwc_otg_hcd_qtd_remove(dwc_otg_hcd_t * hcd,
++ dwc_otg_qtd_t * qtd,
++ dwc_otg_qh_t * qh)
++{
++ DWC_CIRCLEQ_REMOVE(&qh->qtd_list, qtd, qtd_list_entry);
++}
++
++/** Remove and free a QTD
++ * Need to disable IRQ and hold hcd lock while calling this function out of
++ * interrupt servicing chain */
++static inline void dwc_otg_hcd_qtd_remove_and_free(dwc_otg_hcd_t * hcd,
++ dwc_otg_qtd_t * qtd,
++ dwc_otg_qh_t * qh)
++{
++ dwc_otg_hcd_qtd_remove(hcd, qtd, qh);
++ dwc_otg_hcd_qtd_free(qtd);
++}
++
++/** @} */
++
++/** @name Descriptor DMA Supporting Functions */
++/** @{ */
++
++extern void dwc_otg_hcd_start_xfer_ddma(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh);
++extern void dwc_otg_hcd_complete_xfer_ddma(dwc_otg_hcd_t * hcd,
++ dwc_hc_t * hc,
++ dwc_otg_hc_regs_t * hc_regs,
++ dwc_otg_halt_status_e halt_status);
++
++extern int dwc_otg_hcd_qh_init_ddma(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh);
++extern void dwc_otg_hcd_qh_free_ddma(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh);
++
++/** @} */
++
++/** @name Internal Functions */
++/** @{ */
++dwc_otg_qh_t *dwc_urb_to_qh(dwc_otg_hcd_urb_t * urb);
++/** @} */
++
++#ifdef CONFIG_USB_DWC_OTG_LPM
++extern int dwc_otg_hcd_get_hc_for_lpm_tran(dwc_otg_hcd_t * hcd,
++ uint8_t devaddr);
++extern void dwc_otg_hcd_free_hc_from_lpm(dwc_otg_hcd_t * hcd);
++#endif
++
++/** Gets the QH that contains the list_head */
++#define dwc_list_to_qh(_list_head_ptr_) container_of(_list_head_ptr_, dwc_otg_qh_t, qh_list_entry)
++
++/** Gets the QTD that contains the list_head */
++#define dwc_list_to_qtd(_list_head_ptr_) container_of(_list_head_ptr_, dwc_otg_qtd_t, qtd_list_entry)
++
++/** Check if QH is non-periodic */
++#define dwc_qh_is_non_per(_qh_ptr_) ((_qh_ptr_->ep_type == UE_BULK) || \
++ (_qh_ptr_->ep_type == UE_CONTROL))
++
++/** High bandwidth multiplier as encoded in highspeed endpoint descriptors */
++#define dwc_hb_mult(wMaxPacketSize) (1 + (((wMaxPacketSize) >> 11) & 0x03))
++
++/** Packet size for any kind of endpoint descriptor */
++#define dwc_max_packet(wMaxPacketSize) ((wMaxPacketSize) & 0x07ff)
++
++/**
++ * Returns true if _frame1 is less than or equal to _frame2. The comparison is
++ * done modulo DWC_HFNUM_MAX_FRNUM. This accounts for the rollover of the
++ * frame number when the max frame number is reached.
++ */
++static inline int dwc_frame_num_le(uint16_t frame1, uint16_t frame2)
++{
++ return ((frame2 - frame1) & DWC_HFNUM_MAX_FRNUM) <=
++ (DWC_HFNUM_MAX_FRNUM >> 1);
++}
++
++/**
++ * Returns true if _frame1 is greater than _frame2. The comparison is done
++ * modulo DWC_HFNUM_MAX_FRNUM. This accounts for the rollover of the frame
++ * number when the max frame number is reached.
++ */
++static inline int dwc_frame_num_gt(uint16_t frame1, uint16_t frame2)
++{
++ return (frame1 != frame2) &&
++ (((frame1 - frame2) & DWC_HFNUM_MAX_FRNUM) <
++ (DWC_HFNUM_MAX_FRNUM >> 1));
++}
++
++/**
++ * Increments _frame by the amount specified by _inc. The addition is done
++ * modulo DWC_HFNUM_MAX_FRNUM. Returns the incremented value.
++ */
++static inline uint16_t dwc_frame_num_inc(uint16_t frame, uint16_t inc)
++{
++ return (frame + inc) & DWC_HFNUM_MAX_FRNUM;
++}
++
++static inline uint16_t dwc_full_frame_num(uint16_t frame)
++{
++ return (frame & DWC_HFNUM_MAX_FRNUM) >> 3;
++}
++
++static inline uint16_t dwc_micro_frame_num(uint16_t frame)
++{
++ return frame & 0x7;
++}
++
++void dwc_otg_hcd_save_data_toggle(dwc_hc_t * hc,
++ dwc_otg_hc_regs_t * hc_regs,
++ dwc_otg_qtd_t * qtd);
++
++#ifdef DEBUG
++/**
++ * Macro to sample the remaining PHY clocks left in the current frame. This
++ * may be used during debugging to determine the average time it takes to
++ * execute sections of code. There are two possible sample points, "a" and
++ * "b", so the _letter argument must be one of these values.
++ *
++ * To dump the average sample times, read the "hcd_frrem" sysfs attribute. For
++ * example, "cat /sys/devices/lm0/hcd_frrem".
++ */
++#define dwc_sample_frrem(_hcd, _qh, _letter) \
++{ \
++ hfnum_data_t hfnum; \
++ dwc_otg_qtd_t *qtd; \
++ qtd = list_entry(_qh->qtd_list.next, dwc_otg_qtd_t, qtd_list_entry); \
++ if (usb_pipeint(qtd->urb->pipe) && _qh->start_split_frame != 0 && !qtd->complete_split) { \
++ hfnum.d32 = DWC_READ_REG32(&_hcd->core_if->host_if->host_global_regs->hfnum); \
++ switch (hfnum.b.frnum & 0x7) { \
++ case 7: \
++ _hcd->hfnum_7_samples_##_letter++; \
++ _hcd->hfnum_7_frrem_accum_##_letter += hfnum.b.frrem; \
++ break; \
++ case 0: \
++ _hcd->hfnum_0_samples_##_letter++; \
++ _hcd->hfnum_0_frrem_accum_##_letter += hfnum.b.frrem; \
++ break; \
++ default: \
++ _hcd->hfnum_other_samples_##_letter++; \
++ _hcd->hfnum_other_frrem_accum_##_letter += hfnum.b.frrem; \
++ break; \
++ } \
++ } \
++}
++#else
++#define dwc_sample_frrem(_hcd, _qh, _letter)
++#endif
++#endif
++#endif /* DWC_DEVICE_ONLY */
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,417 @@
+/* ==========================================================================
+ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd_if.h $
@@ -276456,9 +278812,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h linux-rpi/driver
+
+#endif /* __DWC_HCD_IF_H__ */
+#endif /* DWC_DEVICE_ONLY */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c 2015-08-26 10:26:11.809358522 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,2714 @@
+/* ==========================================================================
+ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd_intr.c $
@@ -279174,9 +281530,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c linux-rpi/driv
+ return retval;
+}
+#endif /* DWC_DEVICE_ONLY */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c 2015-08-26 10:26:11.809358522 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,999 @@
+
+/* ==========================================================================
@@ -280177,9 +282533,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c linux-rpi/dri
+}
+
+#endif /* DWC_DEVICE_ONLY */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c 2015-08-26 10:26:11.809358522 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,957 @@
+/* ==========================================================================
+ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd_queue.c $
@@ -281138,9 +283494,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c linux-rpi/dri
+}
+
+#endif /* DWC_DEVICE_ONLY */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_os_dep.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_os_dep.h
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_os_dep.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_os_dep.h 2015-08-26 10:26:11.809358522 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_os_dep.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_os_dep.h
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_os_dep.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_os_dep.h 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,188 @@
+#ifndef _DWC_OS_DEP_H_
+#define _DWC_OS_DEP_H_
@@ -281330,9 +283686,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_os_dep.h linux-rpi/driver
+
+
+#endif /* _DWC_OS_DEP_H_ */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_pcd.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_pcd.c
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_pcd.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_pcd.c 2015-08-26 10:26:11.809358522 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_pcd.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_pcd.c
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_pcd.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_pcd.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,2712 @@
+/* ==========================================================================
+ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_pcd.c $
@@ -284046,9 +286402,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_pcd.c linux-rpi/drivers/u
+}
+
+#endif /* DWC_HOST_ONLY */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_pcd.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_pcd.h
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_pcd.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_pcd.h 2015-08-26 10:26:11.809358522 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_pcd.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_pcd.h
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_pcd.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_pcd.h 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,266 @@
+/* ==========================================================================
+ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_pcd.h $
@@ -284316,9 +286672,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_pcd.h linux-rpi/drivers/u
+extern void do_test_mode(void *data);
+#endif
+#endif /* DWC_HOST_ONLY */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h 2015-08-26 10:26:11.809358522 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,360 @@
+/* ==========================================================================
+ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_pcd_if.h $
@@ -284680,9 +287036,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h linux-rpi/driver
+#endif /* __DWC_PCD_IF_H__ */
+
+#endif /* DWC_HOST_ONLY */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c 2015-08-26 10:26:11.809358522 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,5147 @@
+/* ==========================================================================
+ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_pcd_intr.c $
@@ -289831,9 +292187,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c linux-rpi/driv
+}
+
+#endif /* DWC_HOST_ONLY */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c 2015-08-26 10:26:11.809358522 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,1360 @@
+ /* ==========================================================================
+ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_pcd_linux.c $
@@ -291195,9 +293551,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c linux-rpi/dri
+EXPORT_SYMBOL(usb_gadget_unregister_driver);
+
+#endif /* DWC_HOST_ONLY */
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_regs.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_regs.h
---- linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_regs.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_regs.h 2015-08-26 10:26:11.809358522 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_regs.h linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_regs.h
+--- linux-4.1.10/drivers/usb/host/dwc_otg/dwc_otg_regs.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/dwc_otg_regs.h 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,2550 @@
+/* ==========================================================================
+ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_regs.h $
@@ -293749,29 +296105,95 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/dwc_otg_regs.h linux-rpi/drivers/
+} gpwrdn_data_t;
+
+#endif
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/test/Makefile linux-rpi/drivers/usb/host/dwc_otg/test/Makefile
---- linux-4.1.6/drivers/usb/host/dwc_otg/test/Makefile 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/test/Makefile 2015-08-26 10:26:11.809358522 +0200
-@@ -0,0 +1,16 @@
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/Makefile linux-rpi/drivers/usb/host/dwc_otg/Makefile
+--- linux-4.1.10/drivers/usb/host/dwc_otg/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/Makefile 2015-10-07 16:40:56.000000000 +0200
+@@ -0,0 +1,82 @@
++#
++# Makefile for DWC_otg Highspeed USB controller driver
++#
+
-+PERL=/usr/bin/perl
-+PL_TESTS=test_sysfs.pl test_mod_param.pl
++ifneq ($(KERNELRELEASE),)
+
-+.PHONY : test
-+test : perl_tests
++# Use the BUS_INTERFACE variable to compile the software for either
++# PCI(PCI_INTERFACE) or LM(LM_INTERFACE) bus.
++ifeq ($(BUS_INTERFACE),)
++# BUS_INTERFACE = -DPCI_INTERFACE
++# BUS_INTERFACE = -DLM_INTERFACE
++ BUS_INTERFACE = -DPLATFORM_INTERFACE
++endif
+
-+perl_tests :
-+ @echo
-+ @echo Running perl tests
-+ @for test in $(PL_TESTS); do \
-+ if $(PERL) ./$$test ; then \
-+ echo "=======> $$test, PASSED" ; \
-+ else echo "=======> $$test, FAILED" ; \
-+ fi \
-+ done
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/test/dwc_otg_test.pm linux-rpi/drivers/usb/host/dwc_otg/test/dwc_otg_test.pm
---- linux-4.1.6/drivers/usb/host/dwc_otg/test/dwc_otg_test.pm 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/test/dwc_otg_test.pm 2015-08-26 10:26:11.809358522 +0200
++#ccflags-y += -DDEBUG
++#ccflags-y += -DDWC_OTG_DEBUGLEV=1 # reduce common debug msgs
++
++# Use one of the following flags to compile the software in host-only or
++# device-only mode.
++#ccflags-y += -DDWC_HOST_ONLY
++#ccflags-y += -DDWC_DEVICE_ONLY
++
++ccflags-y += -Dlinux -DDWC_HS_ELECT_TST
++#ccflags-y += -DDWC_EN_ISOC
++ccflags-y += -I$(obj)/../dwc_common_port
++#ccflags-y += -I$(PORTLIB)
++ccflags-y += -DDWC_LINUX
++ccflags-y += $(CFI)
++ccflags-y += $(BUS_INTERFACE)
++#ccflags-y += -DDWC_DEV_SRPCAP
++
++obj-$(CONFIG_USB_DWCOTG) += dwc_otg.o
++
++dwc_otg-objs := dwc_otg_driver.o dwc_otg_attr.o
++dwc_otg-objs += dwc_otg_cil.o dwc_otg_cil_intr.o
++dwc_otg-objs += dwc_otg_pcd_linux.o dwc_otg_pcd.o dwc_otg_pcd_intr.o
++dwc_otg-objs += dwc_otg_hcd.o dwc_otg_hcd_linux.o dwc_otg_hcd_intr.o dwc_otg_hcd_queue.o dwc_otg_hcd_ddma.o
++dwc_otg-objs += dwc_otg_adp.o
++dwc_otg-objs += dwc_otg_fiq_fsm.o
++dwc_otg-objs += dwc_otg_fiq_stub.o
++ifneq ($(CFI),)
++dwc_otg-objs += dwc_otg_cfi.o
++endif
++
++kernrelwd := $(subst ., ,$(KERNELRELEASE))
++kernrel3 := $(word 1,$(kernrelwd)).$(word 2,$(kernrelwd)).$(word 3,$(kernrelwd))
++
++ifneq ($(kernrel3),2.6.20)
++ccflags-y += $(CPPFLAGS)
++endif
++
++else
++
++PWD := $(shell pwd)
++PORTLIB := $(PWD)/../dwc_common_port
++
++# Command paths
++CTAGS := $(CTAGS)
++DOXYGEN := $(DOXYGEN)
++
++default: portlib
++ $(MAKE) -C$(KDIR) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules
++
++install: default
++ $(MAKE) -C$(KDIR) M=$(PORTLIB) modules_install
++ $(MAKE) -C$(KDIR) M=$(PWD) modules_install
++
++portlib:
++ $(MAKE) -C$(KDIR) M=$(PORTLIB) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules
++ cp $(PORTLIB)/Module.symvers $(PWD)/
++
++docs: $(wildcard *.[hc]) doc/doxygen.cfg
++ $(DOXYGEN) doc/doxygen.cfg
++
++tags: $(wildcard *.[hc])
++ $(CTAGS) -e $(wildcard *.[hc]) $(wildcard linux/*.[hc]) $(wildcard $(KDIR)/include/linux/usb*.h)
++
++
++clean:
++ rm -rf *.o *.ko .*cmd *.mod.c .tmp_versions Module.symvers
++
++endif
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/test/dwc_otg_test.pm linux-rpi/drivers/usb/host/dwc_otg/test/dwc_otg_test.pm
+--- linux-4.1.10/drivers/usb/host/dwc_otg/test/dwc_otg_test.pm 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/test/dwc_otg_test.pm 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,337 @@
+package dwc_otg_test;
+
@@ -294110,9 +296532,29 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/test/dwc_otg_test.pm linux-rpi/dr
+);
+
+1;
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/test/test_mod_param.pl linux-rpi/drivers/usb/host/dwc_otg/test/test_mod_param.pl
---- linux-4.1.6/drivers/usb/host/dwc_otg/test/test_mod_param.pl 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/test/test_mod_param.pl 2015-08-26 10:26:11.809358522 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/test/Makefile linux-rpi/drivers/usb/host/dwc_otg/test/Makefile
+--- linux-4.1.10/drivers/usb/host/dwc_otg/test/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/test/Makefile 2015-10-07 16:40:56.000000000 +0200
+@@ -0,0 +1,16 @@
++
++PERL=/usr/bin/perl
++PL_TESTS=test_sysfs.pl test_mod_param.pl
++
++.PHONY : test
++test : perl_tests
++
++perl_tests :
++ @echo
++ @echo Running perl tests
++ @for test in $(PL_TESTS); do \
++ if $(PERL) ./$$test ; then \
++ echo "=======> $$test, PASSED" ; \
++ else echo "=======> $$test, FAILED" ; \
++ fi \
++ done
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/test/test_mod_param.pl linux-rpi/drivers/usb/host/dwc_otg/test/test_mod_param.pl
+--- linux-4.1.10/drivers/usb/host/dwc_otg/test/test_mod_param.pl 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/test/test_mod_param.pl 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,133 @@
+#!/usr/bin/perl -w
+#
@@ -294247,9 +296689,9 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/test/test_mod_param.pl linux-rpi/
+
+test_main();
+0;
-diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/test/test_sysfs.pl linux-rpi/drivers/usb/host/dwc_otg/test/test_sysfs.pl
---- linux-4.1.6/drivers/usb/host/dwc_otg/test/test_sysfs.pl 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/usb/host/dwc_otg/test/test_sysfs.pl 2015-08-26 10:26:11.809358522 +0200
+diff -Nur linux-4.1.10/drivers/usb/host/dwc_otg/test/test_sysfs.pl linux-rpi/drivers/usb/host/dwc_otg/test/test_sysfs.pl
+--- linux-4.1.10/drivers/usb/host/dwc_otg/test/test_sysfs.pl 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/usb/host/dwc_otg/test/test_sysfs.pl 2015-10-07 16:40:56.000000000 +0200
@@ -0,0 +1,193 @@
+#!/usr/bin/perl -w
+#
@@ -294444,70 +296886,56 @@ diff -Nur linux-4.1.6/drivers/usb/host/dwc_otg/test/test_sysfs.pl linux-rpi/driv
+
+test_main();
+0;
-diff -Nur linux-4.1.6/drivers/video/fbdev/Kconfig linux-rpi/drivers/video/fbdev/Kconfig
---- linux-4.1.6/drivers/video/fbdev/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/video/fbdev/Kconfig 2015-08-26 10:26:11.873359401 +0200
-@@ -224,6 +224,20 @@
- comment "Frame buffer hardware drivers"
- depends on FB
+diff -Nur linux-4.1.10/drivers/usb/host/Kconfig linux-rpi/drivers/usb/host/Kconfig
+--- linux-4.1.10/drivers/usb/host/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/usb/host/Kconfig 2015-10-07 16:40:56.000000000 +0200
+@@ -738,6 +738,19 @@
+ To compile this driver a module, choose M here: the module
+ will be called "hwa-hc".
-+config FB_BCM2708
-+ tristate "BCM2708 framebuffer support"
-+ depends on FB && RASPBERRYPI_FIRMWARE
-+ select FB_CFB_FILLRECT
-+ select FB_CFB_COPYAREA
-+ select FB_CFB_IMAGEBLIT
++config USB_DWCOTG
++ tristate "Synopsis DWC host support"
++ depends on USB
+ help
-+ This framebuffer device driver is for the BCM2708 framebuffer.
++ The Synopsis DWC controller is a dual-role
++ host/peripheral/OTG ("On The Go") USB controllers.
+
-+ If you want to compile this as a module (=code which can be
-+ inserted into and removed from the running kernel), say M
-+ here and read <file:Documentation/kbuild/modules.txt>. The module
-+ will be called bcm2708_fb.
++ Enable this option to support this IP in host controller mode.
++ If unsure, say N.
+
- config FB_GRVGA
- tristate "Aeroflex Gaisler framebuffer support"
- depends on FB && SPARC
-@@ -2481,3 +2495,16 @@
- help
- This driver implements support for the Solomon SSD1307
- OLED controller over I2C.
++ To compile this driver as a module, choose M here: the
++ modules built will be called dwc_otg and dwc_common_port.
+
-+config FB_RPISENSE
-+ tristate "Raspberry Pi Sense HAT framebuffer"
-+ depends on FB
-+ select MFD_RPISENSE_CORE
-+ select FB_SYS_FOPS
-+ select FB_SYS_FILLRECT
-+ select FB_SYS_COPYAREA
-+ select FB_SYS_IMAGEBLIT
-+ select FB_DEFERRED_IO
+ config USB_IMX21_HCD
+ tristate "i.MX21 HCD support"
+ depends on ARM && ARCH_MXC
+diff -Nur linux-4.1.10/drivers/usb/host/Makefile linux-rpi/drivers/usb/host/Makefile
+--- linux-4.1.10/drivers/usb/host/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/usb/host/Makefile 2015-10-07 16:40:56.000000000 +0200
+@@ -68,6 +68,8 @@
+ obj-$(CONFIG_USB_U132_HCD) += u132-hcd.o
+ obj-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o
+ obj-$(CONFIG_USB_HWA_HCD) += hwa-hc.o
+
-+ help
-+ This is the framebuffer driver for the Raspberry Pi Sense HAT
-diff -Nur linux-4.1.6/drivers/video/fbdev/Makefile linux-rpi/drivers/video/fbdev/Makefile
---- linux-4.1.6/drivers/video/fbdev/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/video/fbdev/Makefile 2015-08-26 10:26:11.873359401 +0200
-@@ -12,6 +12,7 @@
- obj-$(CONFIG_FB_WMT_GE_ROPS) += wmt_ge_rops.o
-
- # Hardware specific drivers go first
-+obj-$(CONFIG_FB_BCM2708) += bcm2708_fb.o
- obj-$(CONFIG_FB_AMIGA) += amifb.o c2p_planar.o
- obj-$(CONFIG_FB_ARC) += arcfb.o
- obj-$(CONFIG_FB_CLPS711X) += clps711x-fb.o
-@@ -149,6 +150,7 @@
- obj-$(CONFIG_FB_MXS) += mxsfb.o
- obj-$(CONFIG_FB_SSD1307) += ssd1307fb.o
- obj-$(CONFIG_FB_SIMPLE) += simplefb.o
-+obj-$(CONFIG_FB_RPISENSE) += rpisense-fb.o
++obj-$(CONFIG_USB_DWCOTG) += dwc_otg/ dwc_common_port/
+ obj-$(CONFIG_USB_IMX21_HCD) += imx21-hcd.o
+ obj-$(CONFIG_USB_FSL_MPH_DR_OF) += fsl-mph-dr-of.o
+ obj-$(CONFIG_USB_HCD_BCMA) += bcma-hcd.o
+diff -Nur linux-4.1.10/drivers/usb/Makefile linux-rpi/drivers/usb/Makefile
+--- linux-4.1.10/drivers/usb/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/usb/Makefile 2015-10-07 16:40:56.000000000 +0200
+@@ -7,6 +7,7 @@
+ obj-$(CONFIG_USB) += core/
+ obj-$(CONFIG_USB_SUPPORT) += phy/
- # the test framebuffer is last
- obj-$(CONFIG_FB_VIRTUAL) += vfb.o
-diff -Nur linux-4.1.6/drivers/video/fbdev/bcm2708_fb.c linux-rpi/drivers/video/fbdev/bcm2708_fb.c
---- linux-4.1.6/drivers/video/fbdev/bcm2708_fb.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/video/fbdev/bcm2708_fb.c 2015-08-26 10:26:11.877359456 +0200
-@@ -0,0 +1,853 @@
++obj-$(CONFIG_USB_DWCOTG) += host/
+ obj-$(CONFIG_USB_DWC3) += dwc3/
+ obj-$(CONFIG_USB_DWC2) += dwc2/
+ obj-$(CONFIG_USB_ISP1760) += isp1760/
+diff -Nur linux-4.1.10/drivers/video/fbdev/bcm2708_fb.c linux-rpi/drivers/video/fbdev/bcm2708_fb.c
+--- linux-4.1.10/drivers/video/fbdev/bcm2708_fb.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/video/fbdev/bcm2708_fb.c 2015-10-07 16:40:57.000000000 +0200
+@@ -0,0 +1,847 @@
+/*
+ * linux/drivers/video/bcm2708_fb.c
+ *
@@ -294773,12 +297201,6 @@ diff -Nur linux-4.1.6/drivers/video/fbdev/bcm2708_fb.c linux-rpi/drivers/video/f
+ if (var->yoffset > var->yres_virtual - var->yres)
+ var->yoffset = var->yres_virtual - var->yres - 1;
+
-+ yres = var->yres;
-+ if (var->vmode & FB_VMODE_DOUBLE)
-+ yres *= 2;
-+ else if (var->vmode & FB_VMODE_INTERLACED)
-+ yres = (yres + 1) / 2;
-+
+ return 0;
+}
+
@@ -294936,7 +297358,7 @@ diff -Nur linux-4.1.6/drivers/video/fbdev/bcm2708_fb.c linux-rpi/drivers/video/f
+
+static int bcm2708_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
+{
-+ s32 result = -1;
++ s32 result;
+ info->var.xoffset = var->xoffset;
+ info->var.yoffset = var->yoffset;
+ result = bcm2708_fb_set_par(info);
@@ -295361,9 +297783,9 @@ diff -Nur linux-4.1.6/drivers/video/fbdev/bcm2708_fb.c linux-rpi/drivers/video/f
+MODULE_PARM_DESC(fbheight, "Height of ARM Framebuffer");
+MODULE_PARM_DESC(fbdepth, "Bit depth of ARM Framebuffer");
+MODULE_PARM_DESC(fbswap, "Swap order of red and blue in 24 and 32 bit modes");
-diff -Nur linux-4.1.6/drivers/video/fbdev/core/cfbimgblt.c linux-rpi/drivers/video/fbdev/core/cfbimgblt.c
---- linux-4.1.6/drivers/video/fbdev/core/cfbimgblt.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/video/fbdev/core/cfbimgblt.c 2015-08-26 10:26:11.881359511 +0200
+diff -Nur linux-4.1.10/drivers/video/fbdev/core/cfbimgblt.c linux-rpi/drivers/video/fbdev/core/cfbimgblt.c
+--- linux-4.1.10/drivers/video/fbdev/core/cfbimgblt.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/video/fbdev/core/cfbimgblt.c 2015-10-07 16:40:57.000000000 +0200
@@ -28,6 +28,11 @@
*
* Also need to add code to deal with cards endians that are different than
@@ -295537,9 +297959,9 @@ diff -Nur linux-4.1.6/drivers/video/fbdev/core/cfbimgblt.c linux-rpi/drivers/vid
slow_imageblit(image, p, dst1, fgcolor, bgcolor,
start_index, pitch_index);
} else
-diff -Nur linux-4.1.6/drivers/video/fbdev/core/fbmem.c linux-rpi/drivers/video/fbdev/core/fbmem.c
---- linux-4.1.6/drivers/video/fbdev/core/fbmem.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/video/fbdev/core/fbmem.c 2015-08-26 10:26:11.881359511 +0200
+diff -Nur linux-4.1.10/drivers/video/fbdev/core/fbmem.c linux-rpi/drivers/video/fbdev/core/fbmem.c
+--- linux-4.1.10/drivers/video/fbdev/core/fbmem.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/video/fbdev/core/fbmem.c 2015-10-07 16:40:57.000000000 +0200
@@ -1084,6 +1084,25 @@
}
EXPORT_SYMBOL(fb_blank);
@@ -295598,9 +298020,69 @@ diff -Nur linux-4.1.6/drivers/video/fbdev/core/fbmem.c linux-rpi/drivers/video/f
arg = (unsigned long) compat_ptr(arg);
case FBIOBLANK:
ret = do_fb_ioctl(info, cmd, arg);
-diff -Nur linux-4.1.6/drivers/video/fbdev/rpisense-fb.c linux-rpi/drivers/video/fbdev/rpisense-fb.c
---- linux-4.1.6/drivers/video/fbdev/rpisense-fb.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/video/fbdev/rpisense-fb.c 2015-08-26 10:26:11.905359841 +0200
+diff -Nur linux-4.1.10/drivers/video/fbdev/Kconfig linux-rpi/drivers/video/fbdev/Kconfig
+--- linux-4.1.10/drivers/video/fbdev/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/video/fbdev/Kconfig 2015-10-07 16:40:57.000000000 +0200
+@@ -224,6 +224,20 @@
+ comment "Frame buffer hardware drivers"
+ depends on FB
+
++config FB_BCM2708
++ tristate "BCM2708 framebuffer support"
++ depends on FB && RASPBERRYPI_FIRMWARE
++ select FB_CFB_FILLRECT
++ select FB_CFB_COPYAREA
++ select FB_CFB_IMAGEBLIT
++ help
++ This framebuffer device driver is for the BCM2708 framebuffer.
++
++ If you want to compile this as a module (=code which can be
++ inserted into and removed from the running kernel), say M
++ here and read <file:Documentation/kbuild/modules.txt>. The module
++ will be called bcm2708_fb.
++
+ config FB_GRVGA
+ tristate "Aeroflex Gaisler framebuffer support"
+ depends on FB && SPARC
+@@ -2481,3 +2495,16 @@
+ help
+ This driver implements support for the Solomon SSD1307
+ OLED controller over I2C.
++
++config FB_RPISENSE
++ tristate "Raspberry Pi Sense HAT framebuffer"
++ depends on FB
++ select MFD_RPISENSE_CORE
++ select FB_SYS_FOPS
++ select FB_SYS_FILLRECT
++ select FB_SYS_COPYAREA
++ select FB_SYS_IMAGEBLIT
++ select FB_DEFERRED_IO
++
++ help
++ This is the framebuffer driver for the Raspberry Pi Sense HAT
+diff -Nur linux-4.1.10/drivers/video/fbdev/Makefile linux-rpi/drivers/video/fbdev/Makefile
+--- linux-4.1.10/drivers/video/fbdev/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/video/fbdev/Makefile 2015-10-07 16:40:57.000000000 +0200
+@@ -12,6 +12,7 @@
+ obj-$(CONFIG_FB_WMT_GE_ROPS) += wmt_ge_rops.o
+
+ # Hardware specific drivers go first
++obj-$(CONFIG_FB_BCM2708) += bcm2708_fb.o
+ obj-$(CONFIG_FB_AMIGA) += amifb.o c2p_planar.o
+ obj-$(CONFIG_FB_ARC) += arcfb.o
+ obj-$(CONFIG_FB_CLPS711X) += clps711x-fb.o
+@@ -149,6 +150,7 @@
+ obj-$(CONFIG_FB_MXS) += mxsfb.o
+ obj-$(CONFIG_FB_SSD1307) += ssd1307fb.o
+ obj-$(CONFIG_FB_SIMPLE) += simplefb.o
++obj-$(CONFIG_FB_RPISENSE) += rpisense-fb.o
+
+ # the test framebuffer is last
+ obj-$(CONFIG_FB_VIRTUAL) += vfb.o
+diff -Nur linux-4.1.10/drivers/video/fbdev/rpisense-fb.c linux-rpi/drivers/video/fbdev/rpisense-fb.c
+--- linux-4.1.10/drivers/video/fbdev/rpisense-fb.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/video/fbdev/rpisense-fb.c 2015-10-07 16:40:58.000000000 +0200
@@ -0,0 +1,293 @@
+/*
+ * Raspberry Pi Sense HAT framebuffer driver
@@ -295895,9 +298377,9 @@ diff -Nur linux-4.1.6/drivers/video/fbdev/rpisense-fb.c linux-rpi/drivers/video/
+MODULE_AUTHOR("Serge Schneider <serge@raspberrypi.org>");
+MODULE_LICENSE("GPL");
+
-diff -Nur linux-4.1.6/drivers/video/logo/logo_linux_clut224.ppm linux-rpi/drivers/video/logo/logo_linux_clut224.ppm
---- linux-4.1.6/drivers/video/logo/logo_linux_clut224.ppm 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/video/logo/logo_linux_clut224.ppm 2015-08-26 10:26:11.921360061 +0200
+diff -Nur linux-4.1.10/drivers/video/logo/logo_linux_clut224.ppm linux-rpi/drivers/video/logo/logo_linux_clut224.ppm
+--- linux-4.1.10/drivers/video/logo/logo_linux_clut224.ppm 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/video/logo/logo_linux_clut224.ppm 2015-10-07 16:40:59.000000000 +0200
@@ -1,1604 +1,883 @@
P3
-# Standard 224-color Linux logo
@@ -298384,9 +300866,9 @@ diff -Nur linux-4.1.6/drivers/video/logo/logo_linux_clut224.ppm linux-rpi/driver
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+0 0 0 0 0 0 0 0 0
-diff -Nur linux-4.1.6/drivers/w1/masters/w1-gpio.c linux-rpi/drivers/w1/masters/w1-gpio.c
---- linux-4.1.6/drivers/w1/masters/w1-gpio.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/w1/masters/w1-gpio.c 2015-08-26 10:26:11.929360171 +0200
+diff -Nur linux-4.1.10/drivers/w1/masters/w1-gpio.c linux-rpi/drivers/w1/masters/w1-gpio.c
+--- linux-4.1.10/drivers/w1/masters/w1-gpio.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/w1/masters/w1-gpio.c 2015-10-07 16:40:59.000000000 +0200
@@ -23,6 +23,19 @@
#include "../w1.h"
#include "../w1_int.h"
@@ -298521,9 +301003,9 @@ diff -Nur linux-4.1.6/drivers/w1/masters/w1-gpio.c linux-rpi/drivers/w1/masters/
return 0;
}
-diff -Nur linux-4.1.6/drivers/w1/slaves/w1_therm.c linux-rpi/drivers/w1/slaves/w1_therm.c
---- linux-4.1.6/drivers/w1/slaves/w1_therm.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/w1/slaves/w1_therm.c 2015-08-26 10:26:11.929360171 +0200
+diff -Nur linux-4.1.10/drivers/w1/slaves/w1_therm.c linux-rpi/drivers/w1/slaves/w1_therm.c
+--- linux-4.1.10/drivers/w1/slaves/w1_therm.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/w1/slaves/w1_therm.c 2015-10-07 16:41:00.000000000 +0200
@@ -92,13 +92,24 @@
static ssize_t w1_slave_show(struct device *device,
struct device_attribute *attr, char *buf);
@@ -298661,9 +301143,9 @@ diff -Nur linux-4.1.6/drivers/w1/slaves/w1_therm.c linux-rpi/drivers/w1/slaves/w
static int __init w1_therm_init(void)
{
int err, i;
-diff -Nur linux-4.1.6/drivers/w1/w1.h linux-rpi/drivers/w1/w1.h
---- linux-4.1.6/drivers/w1/w1.h 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/w1/w1.h 2015-08-26 10:26:11.929360171 +0200
+diff -Nur linux-4.1.10/drivers/w1/w1.h linux-rpi/drivers/w1/w1.h
+--- linux-4.1.10/drivers/w1/w1.h 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/w1/w1.h 2015-10-07 16:41:00.000000000 +0200
@@ -171,6 +171,12 @@
u8 (*set_pullup)(void *, int);
@@ -298677,9 +301159,9 @@ diff -Nur linux-4.1.6/drivers/w1/w1.h linux-rpi/drivers/w1/w1.h
void (*search)(void *, struct w1_master *,
u8, w1_slave_found_callback);
};
-diff -Nur linux-4.1.6/drivers/w1/w1_int.c linux-rpi/drivers/w1/w1_int.c
---- linux-4.1.6/drivers/w1/w1_int.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/w1/w1_int.c 2015-08-26 10:26:11.929360171 +0200
+diff -Nur linux-4.1.10/drivers/w1/w1_int.c linux-rpi/drivers/w1/w1_int.c
+--- linux-4.1.10/drivers/w1/w1_int.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/w1/w1_int.c 2015-10-07 16:41:00.000000000 +0200
@@ -123,6 +123,20 @@
return(-EINVAL);
}
@@ -298701,9 +301183,9 @@ diff -Nur linux-4.1.6/drivers/w1/w1_int.c linux-rpi/drivers/w1/w1_int.c
/* Lock until the device is added (or not) to w1_masters. */
mutex_lock(&w1_mlock);
/* Search for the first available id (starting at 1). */
-diff -Nur linux-4.1.6/drivers/w1/w1_io.c linux-rpi/drivers/w1/w1_io.c
---- linux-4.1.6/drivers/w1/w1_io.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/w1/w1_io.c 2015-08-26 10:26:11.929360171 +0200
+diff -Nur linux-4.1.10/drivers/w1/w1_io.c linux-rpi/drivers/w1/w1_io.c
+--- linux-4.1.10/drivers/w1/w1_io.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/w1/w1_io.c 2015-10-07 16:41:00.000000000 +0200
@@ -134,10 +134,22 @@
static void w1_post_write(struct w1_master *dev)
{
@@ -298730,45 +301212,9 @@ diff -Nur linux-4.1.6/drivers/w1/w1_io.c linux-rpi/drivers/w1/w1_io.c
dev->pullup_duration = 0;
}
}
-diff -Nur linux-4.1.6/drivers/watchdog/Kconfig linux-rpi/drivers/watchdog/Kconfig
---- linux-4.1.6/drivers/watchdog/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/watchdog/Kconfig 2015-08-26 10:26:11.929360171 +0200
-@@ -451,6 +451,12 @@
- To compile this driver as a module, choose M here: the
- module will be called retu_wdt.
-
-+config BCM2708_WDT
-+ tristate "BCM2708 Watchdog"
-+ depends on ARCH_BCM2708 || ARCH_BCM2709
-+ help
-+ Enables BCM2708 watchdog support.
-+
- config MOXART_WDT
- tristate "MOXART watchdog"
- depends on ARCH_MOXART
-@@ -1216,7 +1222,7 @@
-
- config BCM2835_WDT
- tristate "Broadcom BCM2835 hardware watchdog"
-- depends on ARCH_BCM2835
-+ depends on ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709
- select WATCHDOG_CORE
- help
- Watchdog driver for the built in watchdog hardware in Broadcom
-diff -Nur linux-4.1.6/drivers/watchdog/Makefile linux-rpi/drivers/watchdog/Makefile
---- linux-4.1.6/drivers/watchdog/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/drivers/watchdog/Makefile 2015-08-26 10:26:11.929360171 +0200
-@@ -56,6 +56,7 @@
- obj-$(CONFIG_IMX2_WDT) += imx2_wdt.o
- obj-$(CONFIG_UX500_WATCHDOG) += ux500_wdt.o
- obj-$(CONFIG_RETU_WATCHDOG) += retu_wdt.o
-+obj-$(CONFIG_BCM2708_WDT) += bcm2708_wdog.o
- obj-$(CONFIG_BCM2835_WDT) += bcm2835_wdt.o
- obj-$(CONFIG_MOXART_WDT) += moxart_wdt.o
- obj-$(CONFIG_SIRFSOC_WATCHDOG) += sirfsoc_wdt.o
-diff -Nur linux-4.1.6/drivers/watchdog/bcm2708_wdog.c linux-rpi/drivers/watchdog/bcm2708_wdog.c
---- linux-4.1.6/drivers/watchdog/bcm2708_wdog.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/drivers/watchdog/bcm2708_wdog.c 2015-08-26 10:26:11.929360171 +0200
+diff -Nur linux-4.1.10/drivers/watchdog/bcm2708_wdog.c linux-rpi/drivers/watchdog/bcm2708_wdog.c
+--- linux-4.1.10/drivers/watchdog/bcm2708_wdog.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/drivers/watchdog/bcm2708_wdog.c 2015-10-07 16:41:00.000000000 +0200
@@ -0,0 +1,382 @@
+/*
+ * Broadcom BCM2708 watchdog driver.
@@ -299152,9 +301598,440 @@ diff -Nur linux-4.1.6/drivers/watchdog/bcm2708_wdog.c linux-rpi/drivers/watchdog
+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+MODULE_ALIAS_MISCDEV(TEMP_MINOR);
+MODULE_LICENSE("GPL");
-diff -Nur linux-4.1.6/include/linux/broadcom/vc_cma.h linux-rpi/include/linux/broadcom/vc_cma.h
---- linux-4.1.6/include/linux/broadcom/vc_cma.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/include/linux/broadcom/vc_cma.h 2015-08-26 10:26:12.201363899 +0200
+diff -Nur linux-4.1.10/drivers/watchdog/Kconfig linux-rpi/drivers/watchdog/Kconfig
+--- linux-4.1.10/drivers/watchdog/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/watchdog/Kconfig 2015-10-07 16:41:00.000000000 +0200
+@@ -451,6 +451,12 @@
+ To compile this driver as a module, choose M here: the
+ module will be called retu_wdt.
+
++config BCM2708_WDT
++ tristate "BCM2708 Watchdog"
++ depends on ARCH_BCM2708 || ARCH_BCM2709
++ help
++ Enables BCM2708 watchdog support.
++
+ config MOXART_WDT
+ tristate "MOXART watchdog"
+ depends on ARCH_MOXART
+@@ -1216,7 +1222,7 @@
+
+ config BCM2835_WDT
+ tristate "Broadcom BCM2835 hardware watchdog"
+- depends on ARCH_BCM2835
++ depends on ARCH_BCM2835 || ARCH_BCM2708 || ARCH_BCM2709
+ select WATCHDOG_CORE
+ help
+ Watchdog driver for the built in watchdog hardware in Broadcom
+diff -Nur linux-4.1.10/drivers/watchdog/Makefile linux-rpi/drivers/watchdog/Makefile
+--- linux-4.1.10/drivers/watchdog/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/drivers/watchdog/Makefile 2015-10-07 16:41:00.000000000 +0200
+@@ -56,6 +56,7 @@
+ obj-$(CONFIG_IMX2_WDT) += imx2_wdt.o
+ obj-$(CONFIG_UX500_WATCHDOG) += ux500_wdt.o
+ obj-$(CONFIG_RETU_WATCHDOG) += retu_wdt.o
++obj-$(CONFIG_BCM2708_WDT) += bcm2708_wdog.o
+ obj-$(CONFIG_BCM2835_WDT) += bcm2835_wdt.o
+ obj-$(CONFIG_MOXART_WDT) += moxart_wdt.o
+ obj-$(CONFIG_SIRFSOC_WATCHDOG) += sirfsoc_wdt.o
+diff -Nur linux-4.1.10/include/linux/broadcom/bcm2835_smi.h linux-rpi/include/linux/broadcom/bcm2835_smi.h
+--- linux-4.1.10/include/linux/broadcom/bcm2835_smi.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/include/linux/broadcom/bcm2835_smi.h 2015-10-07 16:41:05.000000000 +0200
+@@ -0,0 +1,391 @@
++/**
++ * Declarations and definitions for Broadcom's Secondary Memory Interface
++ *
++ * Written by Luke Wren <luke@raspberrypi.org>
++ * Copyright (c) 2015, Raspberry Pi (Trading) Ltd.
++ * Copyright (c) 2010-2012 Broadcom. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions, and the following disclaimer,
++ * without modification.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution.
++ * 3. The names of the above-listed copyright holders may not be used
++ * to endorse or promote products derived from this software without
++ * specific prior written permission.
++ *
++ * ALTERNATIVELY, this software may be distributed under the terms of the
++ * GNU General Public License ("GPL") version 2, as published by the Free
++ * Software Foundation.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
++ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
++ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ */
++
++#ifndef BCM2835_SMI_H
++#define BCM2835_SMI_H
++
++#include <linux/ioctl.h>
++
++#ifndef __KERNEL__
++#include <stdint.h>
++#include <stdbool.h>
++#endif
++
++#define BCM2835_SMI_IOC_MAGIC 0x1
++#define BCM2835_SMI_INVALID_HANDLE (~0)
++
++/* IOCTLs 0x100...0x1ff are not device-specific - we can use them */
++#define BCM2835_SMI_IOC_GET_SETTINGS _IO(BCM2835_SMI_IOC_MAGIC, 0)
++#define BCM2835_SMI_IOC_WRITE_SETTINGS _IO(BCM2835_SMI_IOC_MAGIC, 1)
++#define BCM2835_SMI_IOC_ADDRESS _IO(BCM2835_SMI_IOC_MAGIC, 2)
++#define BCM2835_SMI_IOC_MAX 2
++
++#define SMI_WIDTH_8BIT 0
++#define SMI_WIDTH_16BIT 1
++#define SMI_WIDTH_9BIT 2
++#define SMI_WIDTH_18BIT 3
++
++/* max number of bytes where DMA will not be used */
++#define DMA_THRESHOLD_BYTES 128
++#define DMA_BOUNCE_BUFFER_SIZE (1024 * 1024 / 2)
++#define DMA_BOUNCE_BUFFER_COUNT 3
++
++
++struct smi_settings {
++ int data_width;
++ /* Whether or not to pack multiple SMI transfers into a
++ single 32 bit FIFO word */
++ bool pack_data;
++
++ /* Timing for reads (writes the same but for WE)
++ *
++ * OE ----------+ +--------------------
++ * | |
++ * +----------+
++ * SD -<==============================>-----------
++ * SA -<=========================================>-
++ * <-setup-> <-strobe -> <-hold -> <- pace ->
++ */
++
++ int read_setup_time;
++ int read_hold_time;
++ int read_pace_time;
++ int read_strobe_time;
++
++ int write_setup_time;
++ int write_hold_time;
++ int write_pace_time;
++ int write_strobe_time;
++
++ bool dma_enable; /* DREQs */
++ bool dma_passthrough_enable; /* External DREQs */
++ int dma_read_thresh;
++ int dma_write_thresh;
++ int dma_panic_read_thresh;
++ int dma_panic_write_thresh;
++};
++
++/****************************************************************************
++*
++* Declare exported SMI functions
++*
++***************************************************************************/
++
++#ifdef __KERNEL__
++
++#include <linux/dmaengine.h> /* for enum dma_transfer_direction */
++#include <linux/of.h>
++#include <linux/semaphore.h>
++
++struct bcm2835_smi_instance;
++
++struct bcm2835_smi_bounce_info {
++ struct semaphore callback_sem;
++ void *buffer[DMA_BOUNCE_BUFFER_COUNT];
++ dma_addr_t phys[DMA_BOUNCE_BUFFER_COUNT];
++ struct scatterlist sgl[DMA_BOUNCE_BUFFER_COUNT];
++};
++
++
++void bcm2835_smi_set_regs_from_settings(struct bcm2835_smi_instance *);
++
++struct smi_settings *bcm2835_smi_get_settings_from_regs(
++ struct bcm2835_smi_instance *inst);
++
++void bcm2835_smi_write_buf(
++ struct bcm2835_smi_instance *inst,
++ const void *buf,
++ size_t n_bytes);
++
++void bcm2835_smi_read_buf(
++ struct bcm2835_smi_instance *inst,
++ void *buf,
++ size_t n_bytes);
++
++void bcm2835_smi_set_address(struct bcm2835_smi_instance *inst,
++ unsigned int address);
++
++ssize_t bcm2835_smi_user_dma(
++ struct bcm2835_smi_instance *inst,
++ enum dma_transfer_direction dma_dir,
++ char __user *user_ptr,
++ size_t count,
++ struct bcm2835_smi_bounce_info **bounce);
++
++struct bcm2835_smi_instance *bcm2835_smi_get(struct device_node *node);
++
++#endif /* __KERNEL__ */
++
++/****************************************************************
++*
++* Implementation-only declarations
++*
++****************************************************************/
++
++#ifdef BCM2835_SMI_IMPLEMENTATION
++
++/* Clock manager registers for SMI clock: */
++#define CM_SMI_BASE_ADDRESS ((BCM2708_PERI_BASE) + 0x1010b0)
++/* Clock manager "password" to protect registers from spurious writes */
++#define CM_PWD (0x5a << 24)
++
++#define CM_SMI_CTL 0x00
++#define CM_SMI_DIV 0x04
++
++#define CM_SMI_CTL_FLIP (1 << 8)
++#define CM_SMI_CTL_BUSY (1 << 7)
++#define CM_SMI_CTL_KILL (1 << 5)
++#define CM_SMI_CTL_ENAB (1 << 4)
++#define CM_SMI_CTL_SRC_MASK (0xf)
++#define CM_SMI_CTL_SRC_OFFS (0)
++
++#define CM_SMI_DIV_DIVI_MASK (0xf << 12)
++#define CM_SMI_DIV_DIVI_OFFS (12)
++#define CM_SMI_DIV_DIVF_MASK (0xff << 4)
++#define CM_SMI_DIV_DIVF_OFFS (4)
++
++/* SMI register mapping:*/
++#define SMI_BASE_ADDRESS ((BCM2708_PERI_BASE) + 0x600000)
++
++#define SMICS 0x00 /* control + status register */
++#define SMIL 0x04 /* length/count (n external txfers) */
++#define SMIA 0x08 /* address register */
++#define SMID 0x0c /* data register */
++#define SMIDSR0 0x10 /* device 0 read settings */
++#define SMIDSW0 0x14 /* device 0 write settings */
++#define SMIDSR1 0x18 /* device 1 read settings */
++#define SMIDSW1 0x1c /* device 1 write settings */
++#define SMIDSR2 0x20 /* device 2 read settings */
++#define SMIDSW2 0x24 /* device 2 write settings */
++#define SMIDSR3 0x28 /* device 3 read settings */
++#define SMIDSW3 0x2c /* device 3 write settings */
++#define SMIDC 0x30 /* DMA control registers */
++#define SMIDCS 0x34 /* direct control/status register */
++#define SMIDA 0x38 /* direct address register */
++#define SMIDD 0x3c /* direct data registers */
++#define SMIFD 0x40 /* FIFO debug register */
++
++
++
++/* Control and Status register bits:
++ * SMICS_RXF : RX fifo full: 1 when RX fifo is full
++ * SMICS_TXE : TX fifo empty: 1 when empty.
++ * SMICS_RXD : RX fifo contains data: 1 when there is data.
++ * SMICS_TXD : TX fifo can accept data: 1 when true.
++ * SMICS_RXR : RX fifo needs reading: 1 when fifo more than 3/4 full, or
++ * when "DONE" and fifo not emptied.
++ * SMICS_TXW : TX fifo needs writing: 1 when less than 1/4 full.
++ * SMICS_AFERR : AXI FIFO error: 1 when fifo read when empty or written
++ * when full. Write 1 to clear.
++ * SMICS_EDREQ : 1 when external DREQ received.
++ * SMICS_PXLDAT : Pixel data: write 1 to enable pixel transfer modes.
++ * SMICS_SETERR : 1 if there was an error writing to setup regs (e.g.
++ * tx was in progress). Write 1 to clear.
++ * SMICS_PVMODE : Set to 1 to enable pixel valve mode.
++ * SMICS_INTR : Set to 1 to enable interrupt on RX.
++ * SMICS_INTT : Set to 1 to enable interrupt on TX.
++ * SMICS_INTD : Set to 1 to enable interrupt on DONE condition.
++ * SMICS_TEEN : Tear effect mode enabled: Programmed transfers will wait
++ * for a TE trigger before writing.
++ * SMICS_PAD1 : Padding settings for external transfers. For writes: the
++ * number of bytes initially written to the TX fifo that
++ * SMICS_PAD0 : should be ignored. For reads: the number of bytes that will
++ * be read before the data, and should be dropped.
++ * SMICS_WRITE : Transfer direction: 1 = write to external device, 0 = read
++ * SMICS_CLEAR : Write 1 to clear the FIFOs.
++ * SMICS_START : Write 1 to start the programmed transfer.
++ * SMICS_ACTIVE : Reads as 1 when a programmed transfer is underway.
++ * SMICS_DONE : Reads as 1 when transfer finished. For RX, not set until
++ * FIFO emptied.
++ * SMICS_ENABLE : Set to 1 to enable the SMI peripheral, 0 to disable.
++ */
++
++#define SMICS_RXF (1 << 31)
++#define SMICS_TXE (1 << 30)
++#define SMICS_RXD (1 << 29)
++#define SMICS_TXD (1 << 28)
++#define SMICS_RXR (1 << 27)
++#define SMICS_TXW (1 << 26)
++#define SMICS_AFERR (1 << 25)
++#define SMICS_EDREQ (1 << 15)
++#define SMICS_PXLDAT (1 << 14)
++#define SMICS_SETERR (1 << 13)
++#define SMICS_PVMODE (1 << 12)
++#define SMICS_INTR (1 << 11)
++#define SMICS_INTT (1 << 10)
++#define SMICS_INTD (1 << 9)
++#define SMICS_TEEN (1 << 8)
++#define SMICS_PAD1 (1 << 7)
++#define SMICS_PAD0 (1 << 6)
++#define SMICS_WRITE (1 << 5)
++#define SMICS_CLEAR (1 << 4)
++#define SMICS_START (1 << 3)
++#define SMICS_ACTIVE (1 << 2)
++#define SMICS_DONE (1 << 1)
++#define SMICS_ENABLE (1 << 0)
++
++/* Address register bits: */
++
++#define SMIA_DEVICE_MASK ((1 << 9) | (1 << 8))
++#define SMIA_DEVICE_OFFS (8)
++#define SMIA_ADDR_MASK (0x3f) /* bits 5 -> 0 */
++#define SMIA_ADDR_OFFS (0)
++
++/* DMA control register bits:
++ * SMIDC_DMAEN : DMA enable: set 1: DMA requests will be issued.
++ * SMIDC_DMAP : DMA passthrough: when set to 0, top two data pins are used by
++ * SMI as usual. When set to 1, the top two pins are used for
++ * external DREQs: pin 16 read request, 17 write.
++ * SMIDC_PANIC* : Threshold at which DMA will panic during read/write.
++ * SMIDC_REQ* : Threshold at which DMA will generate a DREQ.
++ */
++
++#define SMIDC_DMAEN (1 << 28)
++#define SMIDC_DMAP (1 << 24)
++#define SMIDC_PANICR_MASK (0x3f << 18)
++#define SMIDC_PANICR_OFFS (18)
++#define SMIDC_PANICW_MASK (0x3f << 12)
++#define SMIDC_PANICW_OFFS (12)
++#define SMIDC_REQR_MASK (0x3f << 6)
++#define SMIDC_REQR_OFFS (6)
++#define SMIDC_REQW_MASK (0x3f)
++#define SMIDC_REQW_OFFS (0)
++
++/* Device settings register bits: same for all 4 (or 3?) device register sets.
++ * Device read settings:
++ * SMIDSR_RWIDTH : Read transfer width. 00 = 8bit, 01 = 16bit,
++ * 10 = 18bit, 11 = 9bit.
++ * SMIDSR_RSETUP : Read setup time: number of core cycles between chip
++ * select/address and read strobe. Min 1, max 64.
++ * SMIDSR_MODE68 : 1 for System 68 mode (i.e. enable + direction pins,
++ * rather than OE + WE pin)
++ * SMIDSR_FSETUP : If set to 1, setup time only applies to first
++ * transfer after address change.
++ * SMIDSR_RHOLD : Number of core cycles between read strobe going
++ * inactive and CS/address going inactive. Min 1, max 64
++ * SMIDSR_RPACEALL : When set to 1, this device's RPACE value will always
++ * be used for the next transaction, even if it is not
++ * to this device.
++ * SMIDSR_RPACE : Number of core cycles spent waiting between CS
++ * deassert and start of next transfer. Min 1, max 128
++ * SMIDSR_RDREQ : 1 = use external DMA request on SD16 to pace reads
++ * from device. Must also set DMAP in SMICS.
++ * SMIDSR_RSTROBE : Number of cycles to assert the read strobe.
++ * min 1, max 128.
++ */
++#define SMIDSR_RWIDTH_MASK ((1<<31)|(1<<30))
++#define SMIDSR_RWIDTH_OFFS (30)
++#define SMIDSR_RSETUP_MASK (0x3f << 24)
++#define SMIDSR_RSETUP_OFFS (24)
++#define SMIDSR_MODE68 (1 << 23)
++#define SMIDSR_FSETUP (1 << 22)
++#define SMIDSR_RHOLD_MASK (0x3f << 16)
++#define SMIDSR_RHOLD_OFFS (16)
++#define SMIDSR_RPACEALL (1 << 15)
++#define SMIDSR_RPACE_MASK (0x7f << 8)
++#define SMIDSR_RPACE_OFFS (8)
++#define SMIDSR_RDREQ (1 << 7)
++#define SMIDSR_RSTROBE_MASK (0x7f)
++#define SMIDSR_RSTROBE_OFFS (0)
++
++/* Device write settings:
++ * SMIDSW_WWIDTH : Write transfer width. 00 = 8bit, 01 = 16bit,
++ * 10= 18bit, 11 = 9bit.
++ * SMIDSW_WSETUP : Number of cycles between CS assert and write strobe.
++ * Min 1, max 64.
++ * SMIDSW_WFORMAT : Pixel format of input. 0 = 16bit RGB 565,
++ * 1 = 32bit RGBA 8888
++ * SMIDSW_WSWAP : 1 = swap pixel data bits. (Use with SMICS_PXLDAT)
++ * SMIDSW_WHOLD : Time between WE deassert and CS deassert. 1 to 64
++ * SMIDSW_WPACEALL : 1: this device's WPACE will be used for the next
++ * transfer, regardless of that transfer's device.
++ * SMIDSW_WPACE : Cycles between CS deassert and next CS assert.
++ * Min 1, max 128
++ * SMIDSW_WDREQ : Use external DREQ on pin 17 to pace writes. DMAP must
++ * be set in SMICS.
++ * SMIDSW_WSTROBE : Number of cycles to assert the write strobe.
++ * Min 1, max 128
++ */
++#define SMIDSW_WWIDTH_MASK ((1<<31)|(1<<30))
++#define SMIDSW_WWIDTH_OFFS (30)
++#define SMIDSW_WSETUP_MASK (0x3f << 24)
++#define SMIDSW_WSETUP_OFFS (24)
++#define SMIDSW_WFORMAT (1 << 23)
++#define SMIDSW_WSWAP (1 << 22)
++#define SMIDSW_WHOLD_MASK (0x3f << 16)
++#define SMIDSW_WHOLD_OFFS (16)
++#define SMIDSW_WPACEALL (1 << 15)
++#define SMIDSW_WPACE_MASK (0x7f << 8)
++#define SMIDSW_WPACE_OFFS (8)
++#define SMIDSW_WDREQ (1 << 7)
++#define SMIDSW_WSTROBE_MASK (0x7f)
++#define SMIDSW_WSTROBE_OFFS (0)
++
++/* Direct transfer control + status register
++ * SMIDCS_WRITE : Direction of transfer: 1 -> write, 0 -> read
++ * SMIDCS_DONE : 1 when a transfer has finished. Write 1 to clear.
++ * SMIDCS_START : Write 1 to start a transfer, if one is not already underway.
++ * SMIDCE_ENABLE: Write 1 to enable SMI in direct mode.
++ */
++
++#define SMIDCS_WRITE (1 << 3)
++#define SMIDCS_DONE (1 << 2)
++#define SMIDCS_START (1 << 1)
++#define SMIDCS_ENABLE (1 << 0)
++
++/* Direct transfer address register
++ * SMIDA_DEVICE : Indicates which of the device settings banks should be used.
++ * SMIDA_ADDR : The value to be asserted on the address pins.
++ */
++
++#define SMIDA_DEVICE_MASK ((1<<9)|(1<<8))
++#define SMIDA_DEVICE_OFFS (8)
++#define SMIDA_ADDR_MASK (0x3f)
++#define SMIDA_ADDR_OFFS (0)
++
++/* FIFO debug register
++ * SMIFD_FLVL : The high-tide mark of FIFO count during the most recent txfer
++ * SMIFD_FCNT : The current FIFO count.
++ */
++#define SMIFD_FLVL_MASK (0x3f << 8)
++#define SMIFD_FLVL_OFFS (8)
++#define SMIFD_FCNT_MASK (0x3f)
++#define SMIFD_FCNT_OFFS (0)
++
++#endif /* BCM2835_SMI_IMPLEMENTATION */
++
++#endif /* BCM2835_SMI_H */
+diff -Nur linux-4.1.10/include/linux/broadcom/vc_cma.h linux-rpi/include/linux/broadcom/vc_cma.h
+--- linux-4.1.10/include/linux/broadcom/vc_cma.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/include/linux/broadcom/vc_cma.h 2015-10-07 16:41:05.000000000 +0200
@@ -0,0 +1,29 @@
+/*****************************************************************************
+* Copyright 2012 Broadcom Corporation. All rights reserved.
@@ -299185,9 +302062,9 @@ diff -Nur linux-4.1.6/include/linux/broadcom/vc_cma.h linux-rpi/include/linux/br
+#endif
+
+#endif /* VC_CMA_H */
-diff -Nur linux-4.1.6/include/linux/broadcom/vc_mem.h linux-rpi/include/linux/broadcom/vc_mem.h
---- linux-4.1.6/include/linux/broadcom/vc_mem.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/include/linux/broadcom/vc_mem.h 2015-08-26 10:26:12.201363899 +0200
+diff -Nur linux-4.1.10/include/linux/broadcom/vc_mem.h linux-rpi/include/linux/broadcom/vc_mem.h
+--- linux-4.1.10/include/linux/broadcom/vc_mem.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/include/linux/broadcom/vc_mem.h 2015-10-07 16:41:05.000000000 +0200
@@ -0,0 +1,35 @@
+/*****************************************************************************
+* Copyright 2010 - 2011 Broadcom Corporation. All rights reserved.
@@ -299224,9 +302101,9 @@ diff -Nur linux-4.1.6/include/linux/broadcom/vc_mem.h linux-rpi/include/linux/br
+#endif
+
+#endif /* _VC_MEM_H */
-diff -Nur linux-4.1.6/include/linux/leds.h linux-rpi/include/linux/leds.h
---- linux-4.1.6/include/linux/leds.h 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/include/linux/leds.h 2015-08-26 10:26:12.233364337 +0200
+diff -Nur linux-4.1.10/include/linux/leds.h linux-rpi/include/linux/leds.h
+--- linux-4.1.10/include/linux/leds.h 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/include/linux/leds.h 2015-10-07 16:41:06.000000000 +0200
@@ -47,6 +47,9 @@
#define SET_BRIGHTNESS_ASYNC (1 << 21)
#define SET_BRIGHTNESS_SYNC (1 << 22)
@@ -299237,9 +302114,9 @@ diff -Nur linux-4.1.6/include/linux/leds.h linux-rpi/include/linux/leds.h
/* Set LED brightness level */
/* Must not sleep, use a workqueue if needed */
-diff -Nur linux-4.1.6/include/linux/mfd/rpisense/core.h linux-rpi/include/linux/mfd/rpisense/core.h
---- linux-4.1.6/include/linux/mfd/rpisense/core.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/include/linux/mfd/rpisense/core.h 2015-08-26 10:26:12.241364447 +0200
+diff -Nur linux-4.1.10/include/linux/mfd/rpisense/core.h linux-rpi/include/linux/mfd/rpisense/core.h
+--- linux-4.1.10/include/linux/mfd/rpisense/core.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/include/linux/mfd/rpisense/core.h 2015-10-07 16:41:06.000000000 +0200
@@ -0,0 +1,47 @@
+/*
+ * Raspberry Pi Sense HAT core driver
@@ -299288,9 +302165,9 @@ diff -Nur linux-4.1.6/include/linux/mfd/rpisense/core.h linux-rpi/include/linux/
+int rpisense_block_write(struct rpisense *rpisense, const char *buf, int count);
+
+#endif
-diff -Nur linux-4.1.6/include/linux/mfd/rpisense/framebuffer.h linux-rpi/include/linux/mfd/rpisense/framebuffer.h
---- linux-4.1.6/include/linux/mfd/rpisense/framebuffer.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/include/linux/mfd/rpisense/framebuffer.h 2015-08-26 10:26:12.241364447 +0200
+diff -Nur linux-4.1.10/include/linux/mfd/rpisense/framebuffer.h linux-rpi/include/linux/mfd/rpisense/framebuffer.h
+--- linux-4.1.10/include/linux/mfd/rpisense/framebuffer.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/include/linux/mfd/rpisense/framebuffer.h 2015-10-07 16:41:06.000000000 +0200
@@ -0,0 +1,32 @@
+/*
+ * Raspberry Pi Sense HAT framebuffer driver
@@ -299324,9 +302201,9 @@ diff -Nur linux-4.1.6/include/linux/mfd/rpisense/framebuffer.h linux-rpi/include
+};
+
+#endif
-diff -Nur linux-4.1.6/include/linux/mfd/rpisense/joystick.h linux-rpi/include/linux/mfd/rpisense/joystick.h
---- linux-4.1.6/include/linux/mfd/rpisense/joystick.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/include/linux/mfd/rpisense/joystick.h 2015-08-26 10:26:12.241364447 +0200
+diff -Nur linux-4.1.10/include/linux/mfd/rpisense/joystick.h linux-rpi/include/linux/mfd/rpisense/joystick.h
+--- linux-4.1.10/include/linux/mfd/rpisense/joystick.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/include/linux/mfd/rpisense/joystick.h 2015-10-07 16:41:06.000000000 +0200
@@ -0,0 +1,35 @@
+/*
+ * Raspberry Pi Sense HAT joystick driver
@@ -299363,9 +302240,9 @@ diff -Nur linux-4.1.6/include/linux/mfd/rpisense/joystick.h linux-rpi/include/li
+
+
+#endif
-diff -Nur linux-4.1.6/include/linux/mmc/host.h linux-rpi/include/linux/mmc/host.h
---- linux-4.1.6/include/linux/mmc/host.h 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/include/linux/mmc/host.h 2015-08-26 10:26:12.249364556 +0200
+diff -Nur linux-4.1.10/include/linux/mmc/host.h linux-rpi/include/linux/mmc/host.h
+--- linux-4.1.10/include/linux/mmc/host.h 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/include/linux/mmc/host.h 2015-10-07 16:41:06.000000000 +0200
@@ -140,7 +140,9 @@
* I/O. Returns the number of supported blocks for the request.
*/
@@ -299385,9 +302262,9 @@ diff -Nur linux-4.1.6/include/linux/mmc/host.h linux-rpi/include/linux/mmc/host.
mmc_pm_flag_t pm_caps; /* supported pm features */
-diff -Nur linux-4.1.6/include/linux/platform_data/bcm2708.h linux-rpi/include/linux/platform_data/bcm2708.h
---- linux-4.1.6/include/linux/platform_data/bcm2708.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/include/linux/platform_data/bcm2708.h 2015-08-26 10:26:12.265364775 +0200
+diff -Nur linux-4.1.10/include/linux/platform_data/bcm2708.h linux-rpi/include/linux/platform_data/bcm2708.h
+--- linux-4.1.10/include/linux/platform_data/bcm2708.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/include/linux/platform_data/bcm2708.h 2015-10-07 16:41:06.000000000 +0200
@@ -0,0 +1,23 @@
+/*
+ * include/linux/platform_data/bcm2708.h
@@ -299412,9 +302289,9 @@ diff -Nur linux-4.1.6/include/linux/platform_data/bcm2708.h linux-rpi/include/li
+ bcm2708_gpio_pull_t value);
+
+#endif
-diff -Nur linux-4.1.6/include/linux/platform_data/dma-bcm2708.h linux-rpi/include/linux/platform_data/dma-bcm2708.h
---- linux-4.1.6/include/linux/platform_data/dma-bcm2708.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/include/linux/platform_data/dma-bcm2708.h 2015-08-26 10:26:12.265364775 +0200
+diff -Nur linux-4.1.10/include/linux/platform_data/dma-bcm2708.h linux-rpi/include/linux/platform_data/dma-bcm2708.h
+--- linux-4.1.10/include/linux/platform_data/dma-bcm2708.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/include/linux/platform_data/dma-bcm2708.h 2015-10-07 16:41:06.000000000 +0200
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 2010 Broadcom
@@ -299543,9 +302420,9 @@ diff -Nur linux-4.1.6/include/linux/platform_data/dma-bcm2708.h linux-rpi/includ
+#endif /* CONFIG_DMA_BCM2708_LEGACY */
+
+#endif /* _PLAT_BCM2708_DMA_H */
-diff -Nur linux-4.1.6/include/linux/vmstat.h linux-rpi/include/linux/vmstat.h
---- linux-4.1.6/include/linux/vmstat.h 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/include/linux/vmstat.h 2015-08-26 10:26:12.301365268 +0200
+diff -Nur linux-4.1.10/include/linux/vmstat.h linux-rpi/include/linux/vmstat.h
+--- linux-4.1.10/include/linux/vmstat.h 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/include/linux/vmstat.h 2015-10-07 16:41:07.000000000 +0200
@@ -241,7 +241,11 @@
static inline void __dec_zone_state(struct zone *zone, enum zone_stat_item item)
{
@@ -299558,9 +302435,9 @@ diff -Nur linux-4.1.6/include/linux/vmstat.h linux-rpi/include/linux/vmstat.h
}
static inline void __inc_zone_page_state(struct page *page,
-diff -Nur linux-4.1.6/include/linux/w1-gpio.h linux-rpi/include/linux/w1-gpio.h
---- linux-4.1.6/include/linux/w1-gpio.h 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/include/linux/w1-gpio.h 2015-08-26 10:26:12.301365268 +0200
+diff -Nur linux-4.1.10/include/linux/w1-gpio.h linux-rpi/include/linux/w1-gpio.h
+--- linux-4.1.10/include/linux/w1-gpio.h 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/include/linux/w1-gpio.h 2015-10-07 16:41:07.000000000 +0200
@@ -18,6 +18,7 @@
struct w1_gpio_platform_data {
unsigned int pin;
@@ -299569,9 +302446,9 @@ diff -Nur linux-4.1.6/include/linux/w1-gpio.h linux-rpi/include/linux/w1-gpio.h
void (*enable_external_pullup)(int enable);
unsigned int ext_pullup_enable_pin;
unsigned int pullup_duration;
-diff -Nur linux-4.1.6/include/soc/bcm2835/raspberrypi-firmware.h linux-rpi/include/soc/bcm2835/raspberrypi-firmware.h
---- linux-4.1.6/include/soc/bcm2835/raspberrypi-firmware.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/include/soc/bcm2835/raspberrypi-firmware.h 2015-08-26 10:26:12.333365706 +0200
+diff -Nur linux-4.1.10/include/soc/bcm2835/raspberrypi-firmware.h linux-rpi/include/soc/bcm2835/raspberrypi-firmware.h
+--- linux-4.1.10/include/soc/bcm2835/raspberrypi-firmware.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/include/soc/bcm2835/raspberrypi-firmware.h 2015-10-07 16:41:08.000000000 +0200
@@ -0,0 +1,123 @@
+/*
+ * Copyright © 2015 Broadcom
@@ -299696,9 +302573,9 @@ diff -Nur linux-4.1.6/include/soc/bcm2835/raspberrypi-firmware.h linux-rpi/inclu
+int rpi_firmware_property_list(struct rpi_firmware *fw,
+ void *data, size_t tag_size);
+struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node);
-diff -Nur linux-4.1.6/include/uapi/linux/fb.h linux-rpi/include/uapi/linux/fb.h
---- linux-4.1.6/include/uapi/linux/fb.h 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/include/uapi/linux/fb.h 2015-08-26 10:26:12.985374634 +0200
+diff -Nur linux-4.1.10/include/uapi/linux/fb.h linux-rpi/include/uapi/linux/fb.h
+--- linux-4.1.10/include/uapi/linux/fb.h 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/include/uapi/linux/fb.h 2015-10-07 16:41:09.000000000 +0200
@@ -34,6 +34,11 @@
#define FBIOPUT_MODEINFO 0x4617
#define FBIOGET_DISPINFO 0x4618
@@ -299711,10 +302588,10 @@ diff -Nur linux-4.1.6/include/uapi/linux/fb.h linux-rpi/include/uapi/linux/fb.h
#define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */
#define FB_TYPE_PLANES 1 /* Non interleaved planes */
-diff -Nur linux-4.1.6/kernel/cgroup.c linux-rpi/kernel/cgroup.c
---- linux-4.1.6/kernel/cgroup.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/kernel/cgroup.c 2015-08-26 10:26:13.025375180 +0200
-@@ -5393,6 +5393,29 @@
+diff -Nur linux-4.1.10/kernel/cgroup.c linux-rpi/kernel/cgroup.c
+--- linux-4.1.10/kernel/cgroup.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/kernel/cgroup.c 2015-10-07 16:41:09.000000000 +0200
+@@ -5394,6 +5394,29 @@
}
__setup("cgroup_disable=", cgroup_disable);
@@ -299744,9 +302621,9 @@ diff -Nur linux-4.1.6/kernel/cgroup.c linux-rpi/kernel/cgroup.c
static int __init cgroup_set_legacy_files_on_dfl(char *str)
{
printk("cgroup: using legacy files on the default hierarchy\n");
-diff -Nur linux-4.1.6/mm/memcontrol.c linux-rpi/mm/memcontrol.c
---- linux-4.1.6/mm/memcontrol.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/mm/memcontrol.c 2015-08-26 10:26:13.085375999 +0200
+diff -Nur linux-4.1.10/mm/memcontrol.c linux-rpi/mm/memcontrol.c
+--- linux-4.1.10/mm/memcontrol.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/mm/memcontrol.c 2015-10-07 16:41:10.000000000 +0200
@@ -5388,6 +5388,7 @@
.dfl_cftypes = memory_files,
.legacy_cftypes = mem_cgroup_legacy_files,
@@ -299755,9 +302632,9 @@ diff -Nur linux-4.1.6/mm/memcontrol.c linux-rpi/mm/memcontrol.c
};
/**
-diff -Nur linux-4.1.6/scripts/dtc/checks.c linux-rpi/scripts/dtc/checks.c
---- linux-4.1.6/scripts/dtc/checks.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/scripts/dtc/checks.c 2015-08-26 10:26:13.257378345 +0200
+diff -Nur linux-4.1.10/scripts/dtc/checks.c linux-rpi/scripts/dtc/checks.c
+--- linux-4.1.10/scripts/dtc/checks.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/scripts/dtc/checks.c 2015-10-07 16:41:12.000000000 +0200
@@ -53,7 +53,7 @@
void *data;
bool warn, error;
@@ -300010,9 +302887,9 @@ diff -Nur linux-4.1.6/scripts/dtc/checks.c linux-rpi/scripts/dtc/checks.c
{
struct node *dt = bi->dt;
int i;
-diff -Nur linux-4.1.6/scripts/dtc/data.c linux-rpi/scripts/dtc/data.c
---- linux-4.1.6/scripts/dtc/data.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/scripts/dtc/data.c 2015-08-26 10:26:13.257378345 +0200
+diff -Nur linux-4.1.10/scripts/dtc/data.c linux-rpi/scripts/dtc/data.c
+--- linux-4.1.10/scripts/dtc/data.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/scripts/dtc/data.c 2015-10-07 16:41:12.000000000 +0200
@@ -74,7 +74,7 @@
struct data d;
char *q;
@@ -300048,9 +302925,235 @@ diff -Nur linux-4.1.6/scripts/dtc/data.c linux-rpi/scripts/dtc/data.c
- return 1;
+ return true;
}
-diff -Nur linux-4.1.6/scripts/dtc/dtc-lexer.l linux-rpi/scripts/dtc/dtc-lexer.l
---- linux-4.1.6/scripts/dtc/dtc-lexer.l 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/scripts/dtc/dtc-lexer.l 2015-08-26 10:26:13.257378345 +0200
+diff -Nur linux-4.1.10/scripts/dtc/dtc.c linux-rpi/scripts/dtc/dtc.c
+--- linux-4.1.10/scripts/dtc/dtc.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/scripts/dtc/dtc.c 2015-10-07 16:41:12.000000000 +0200
+@@ -29,6 +29,7 @@
+ int minsize; /* Minimum blob size */
+ int padsize; /* Additional padding to blob */
+ int phandle_format = PHANDLE_BOTH; /* Use linux,phandle or phandle properties */
++int symbol_fixup_support = 0;
+
+ static void fill_fullpaths(struct node *tree, const char *prefix)
+ {
+@@ -48,8 +49,10 @@
+ }
+
+ /* Usage related data. */
++#define FDT_VERSION(version) _FDT_VERSION(version)
++#define _FDT_VERSION(version) #version
+ static const char usage_synopsis[] = "dtc [options] <input file>";
+-static const char usage_short_opts[] = "qI:O:o:V:d:R:S:p:fb:i:H:sW:E:hv";
++static const char usage_short_opts[] = "qI:O:o:V:d:R:S:p:fb:i:H:sW:E:hv@";
+ static struct option const usage_long_opts[] = {
+ {"quiet", no_argument, NULL, 'q'},
+ {"in-format", a_argument, NULL, 'I'},
+@@ -67,6 +70,7 @@
+ {"phandle", a_argument, NULL, 'H'},
+ {"warning", a_argument, NULL, 'W'},
+ {"error", a_argument, NULL, 'E'},
++ {"symbols", a_argument, NULL, '@'},
+ {"help", no_argument, NULL, 'h'},
+ {"version", no_argument, NULL, 'v'},
+ {NULL, no_argument, NULL, 0x0},
+@@ -82,9 +86,9 @@
+ "\t\tdts - device tree source text\n"
+ "\t\tdtb - device tree blob\n"
+ "\t\tasm - assembler source",
+- "\n\tBlob version to produce, defaults to %d (for dtb and asm output)", //, DEFAULT_FDT_VERSION);
++ "\n\tBlob version to produce, defaults to "FDT_VERSION(DEFAULT_FDT_VERSION)" (for dtb and asm output)",
+ "\n\tOutput dependency file",
+- "\n\ttMake space for <number> reserve map entries (for dtb and asm output)",
++ "\n\tMake space for <number> reserve map entries (for dtb and asm output)",
+ "\n\tMake the blob at least <bytes> long (extra space)",
+ "\n\tAdd padding to the blob of <bytes> long (extra space)",
+ "\n\tSet the physical boot cpu",
+@@ -97,6 +101,7 @@
+ "\t\tboth - Both \"linux,phandle\" and \"phandle\" properties",
+ "\n\tEnable/disable warnings (prefix with \"no-\")",
+ "\n\tEnable/disable errors (prefix with \"no-\")",
++ "\n\tSymbols and Fixups support",
+ "\n\tPrint this help and exit",
+ "\n\tPrint version and exit",
+ NULL,
+@@ -109,7 +114,7 @@
+ const char *outform = "dts";
+ const char *outname = "-";
+ const char *depname = NULL;
+- int force = 0, sort = 0;
++ bool force = false, sort = false;
+ const char *arg;
+ int opt;
+ FILE *outf = NULL;
+@@ -148,7 +153,7 @@
+ padsize = strtol(optarg, NULL, 0);
+ break;
+ case 'f':
+- force = 1;
++ force = true;
+ break;
+ case 'q':
+ quiet++;
+@@ -174,7 +179,7 @@
+ break;
+
+ case 's':
+- sort = 1;
++ sort = true;
+ break;
+
+ case 'W':
+@@ -184,7 +189,9 @@
+ case 'E':
+ parse_checks_option(false, true, optarg);
+ break;
+-
++ case '@':
++ symbol_fixup_support = 1;
++ break;
+ case 'h':
+ usage(NULL);
+ default:
+@@ -237,7 +244,7 @@
+ if (streq(outname, "-")) {
+ outf = stdout;
+ } else {
+- outf = fopen(outname, "w");
++ outf = fopen(outname, "wb");
+ if (! outf)
+ die("Couldn't open output file %s: %s\n",
+ outname, strerror(errno));
+diff -Nur linux-4.1.10/scripts/dtc/dtc.h linux-rpi/scripts/dtc/dtc.h
+--- linux-4.1.10/scripts/dtc/dtc.h 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/scripts/dtc/dtc.h 2015-10-07 16:41:12.000000000 +0200
+@@ -38,9 +38,9 @@
+ #include "util.h"
+
+ #ifdef DEBUG
+-#define debug(fmt,args...) printf(fmt, ##args)
++#define debug(...) printf(__VA_ARGS__)
+ #else
+-#define debug(fmt,args...)
++#define debug(...)
+ #endif
+
+
+@@ -54,6 +54,7 @@
+ extern int minsize; /* Minimum blob size */
+ extern int padsize; /* Additional padding to blob */
+ extern int phandle_format; /* Use linux,phandle or phandle properties */
++extern int symbol_fixup_support;/* enable symbols & fixup support */
+
+ #define PHANDLE_LEGACY 0x1
+ #define PHANDLE_EPAPR 0x2
+@@ -88,7 +89,7 @@
+ };
+
+
+-#define empty_data ((struct data){ /* all .members = 0 or NULL */ })
++#define empty_data ((struct data){ 0 /* all .members = 0 or NULL */ })
+
+ #define for_each_marker(m) \
+ for (; (m); (m) = (m)->next)
+@@ -118,7 +119,7 @@
+
+ struct data data_add_marker(struct data d, enum markertype type, char *ref);
+
+-int data_is_one_string(struct data d);
++bool data_is_one_string(struct data d);
+
+ /* DT constraints */
+
+@@ -127,13 +128,32 @@
+
+ /* Live trees */
+ struct label {
+- int deleted;
++ bool deleted;
+ char *label;
+ struct label *next;
+ };
+
++struct fixup_entry {
++ int offset;
++ struct node *node;
++ struct property *prop;
++ struct fixup_entry *next;
++};
++
++struct fixup {
++ char *ref;
++ struct fixup_entry *entries;
++ struct fixup *next;
++};
++
++struct symbol {
++ struct label *label;
++ struct node *node;
++ struct symbol *next;
++};
++
+ struct property {
+- int deleted;
++ bool deleted;
+ char *name;
+ struct data val;
+
+@@ -143,7 +163,7 @@
+ };
+
+ struct node {
+- int deleted;
++ bool deleted;
+ char *name;
+ struct property *proplist;
+ struct node *children;
+@@ -158,6 +178,12 @@
+ int addr_cells, size_cells;
+
+ struct label *labels;
++
++ int is_root;
++ int is_plugin;
++ struct fixup *fixups;
++ struct symbol *symbols;
++ struct fixup_entry *local_fixups;
+ };
+
+ #define for_each_label_withdel(l0, l) \
+@@ -181,6 +207,18 @@
+ for_each_child_withdel(n, c) \
+ if (!(c)->deleted)
+
++#define for_each_fixup(n, f) \
++ for ((f) = (n)->fixups; (f); (f) = (f)->next)
++
++#define for_each_fixup_entry(f, fe) \
++ for ((fe) = (f)->entries; (fe); (fe) = (fe)->next)
++
++#define for_each_symbol(n, s) \
++ for ((s) = (n)->symbols; (s); (s) = (s)->next)
++
++#define for_each_local_fixup_entry(n, fe) \
++ for ((fe) = (n)->local_fixups; (fe); (fe) = (fe)->next)
++
+ void add_label(struct label **labels, char *label);
+ void delete_labels(struct label **labels);
+
+@@ -247,8 +285,8 @@
+
+ /* Checks */
+
+-void parse_checks_option(bool warn, bool error, const char *optarg);
+-void process_checks(int force, struct boot_info *bi);
++void parse_checks_option(bool warn, bool error, const char *arg);
++void process_checks(bool force, struct boot_info *bi);
+
+ /* Flattened trees */
+
+diff -Nur linux-4.1.10/scripts/dtc/dtc-lexer.l linux-rpi/scripts/dtc/dtc-lexer.l
+--- linux-4.1.10/scripts/dtc/dtc-lexer.l 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/scripts/dtc/dtc-lexer.l 2015-10-07 16:41:12.000000000 +0200
@@ -20,7 +20,6 @@
%option noyywrap nounput noinput never-interactive
@@ -300188,9 +303291,9 @@ diff -Nur linux-4.1.6/scripts/dtc/dtc-lexer.l linux-rpi/scripts/dtc/dtc-lexer.l
+
+ treesource_error = true;
}
-diff -Nur linux-4.1.6/scripts/dtc/dtc-lexer.lex.c_shipped linux-rpi/scripts/dtc/dtc-lexer.lex.c_shipped
---- linux-4.1.6/scripts/dtc/dtc-lexer.lex.c_shipped 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/scripts/dtc/dtc-lexer.lex.c_shipped 2015-08-26 10:26:13.257378345 +0200
+diff -Nur linux-4.1.10/scripts/dtc/dtc-lexer.lex.c_shipped linux-rpi/scripts/dtc/dtc-lexer.lex.c_shipped
+--- linux-4.1.10/scripts/dtc/dtc-lexer.lex.c_shipped 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/scripts/dtc/dtc-lexer.lex.c_shipped 2015-10-07 16:41:12.000000000 +0200
@@ -372,8 +372,8 @@
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
@@ -301045,9 +304148,9 @@ diff -Nur linux-4.1.6/scripts/dtc/dtc-lexer.lex.c_shipped linux-rpi/scripts/dtc/
+ treesource_error = true;
}
-diff -Nur linux-4.1.6/scripts/dtc/dtc-parser.tab.c_shipped linux-rpi/scripts/dtc/dtc-parser.tab.c_shipped
---- linux-4.1.6/scripts/dtc/dtc-parser.tab.c_shipped 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/scripts/dtc/dtc-parser.tab.c_shipped 2015-08-26 10:26:13.257378345 +0200
+diff -Nur linux-4.1.10/scripts/dtc/dtc-parser.tab.c_shipped linux-rpi/scripts/dtc/dtc-parser.tab.c_shipped
+--- linux-4.1.10/scripts/dtc/dtc-parser.tab.c_shipped 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/scripts/dtc/dtc-parser.tab.c_shipped 2015-10-07 16:41:12.000000000 +0200
@@ -1,19 +1,19 @@
-/* A Bison parser, made by GNU Bison 2.7.12-4996. */
+/* A Bison parser, made by GNU Bison 3.0.2. */
@@ -303717,9 +306820,9 @@ diff -Nur linux-4.1.6/scripts/dtc/dtc-parser.tab.c_shipped linux-rpi/scripts/dtc
- return c;
+ ERROR(&yylloc, "%s", s);
}
-diff -Nur linux-4.1.6/scripts/dtc/dtc-parser.tab.h_shipped linux-rpi/scripts/dtc/dtc-parser.tab.h_shipped
---- linux-4.1.6/scripts/dtc/dtc-parser.tab.h_shipped 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/scripts/dtc/dtc-parser.tab.h_shipped 2015-08-26 10:26:13.257378345 +0200
+diff -Nur linux-4.1.10/scripts/dtc/dtc-parser.tab.h_shipped linux-rpi/scripts/dtc/dtc-parser.tab.h_shipped
+--- linux-4.1.10/scripts/dtc/dtc-parser.tab.h_shipped 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/scripts/dtc/dtc-parser.tab.h_shipped 2015-10-07 16:41:12.000000000 +0200
@@ -1,19 +1,19 @@
-/* A Bison parser, made by GNU Bison 2.7.12-4996. */
+/* A Bison parser, made by GNU Bison 3.0.2. */
@@ -303891,9 +306994,9 @@ diff -Nur linux-4.1.6/scripts/dtc/dtc-parser.tab.h_shipped linux-rpi/scripts/dtc
-#endif /* ! YYPARSE_PARAM */
#endif /* !YY_YY_DTC_PARSER_TAB_H_INCLUDED */
-diff -Nur linux-4.1.6/scripts/dtc/dtc-parser.y linux-rpi/scripts/dtc/dtc-parser.y
---- linux-4.1.6/scripts/dtc/dtc-parser.y 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/scripts/dtc/dtc-parser.y 2015-08-26 10:26:13.257378345 +0200
+diff -Nur linux-4.1.10/scripts/dtc/dtc-parser.y linux-rpi/scripts/dtc/dtc-parser.y
+--- linux-4.1.10/scripts/dtc/dtc-parser.y 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/scripts/dtc/dtc-parser.y 2015-10-07 16:41:12.000000000 +0200
@@ -17,31 +17,28 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
@@ -304168,235 +307271,9 @@ diff -Nur linux-4.1.6/scripts/dtc/dtc-parser.y linux-rpi/scripts/dtc/dtc-parser.
- return c;
+ ERROR(&yylloc, "%s", s);
}
-diff -Nur linux-4.1.6/scripts/dtc/dtc.c linux-rpi/scripts/dtc/dtc.c
---- linux-4.1.6/scripts/dtc/dtc.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/scripts/dtc/dtc.c 2015-08-26 10:26:13.257378345 +0200
-@@ -29,6 +29,7 @@
- int minsize; /* Minimum blob size */
- int padsize; /* Additional padding to blob */
- int phandle_format = PHANDLE_BOTH; /* Use linux,phandle or phandle properties */
-+int symbol_fixup_support = 0;
-
- static void fill_fullpaths(struct node *tree, const char *prefix)
- {
-@@ -48,8 +49,10 @@
- }
-
- /* Usage related data. */
-+#define FDT_VERSION(version) _FDT_VERSION(version)
-+#define _FDT_VERSION(version) #version
- static const char usage_synopsis[] = "dtc [options] <input file>";
--static const char usage_short_opts[] = "qI:O:o:V:d:R:S:p:fb:i:H:sW:E:hv";
-+static const char usage_short_opts[] = "qI:O:o:V:d:R:S:p:fb:i:H:sW:E:hv@";
- static struct option const usage_long_opts[] = {
- {"quiet", no_argument, NULL, 'q'},
- {"in-format", a_argument, NULL, 'I'},
-@@ -67,6 +70,7 @@
- {"phandle", a_argument, NULL, 'H'},
- {"warning", a_argument, NULL, 'W'},
- {"error", a_argument, NULL, 'E'},
-+ {"symbols", a_argument, NULL, '@'},
- {"help", no_argument, NULL, 'h'},
- {"version", no_argument, NULL, 'v'},
- {NULL, no_argument, NULL, 0x0},
-@@ -82,9 +86,9 @@
- "\t\tdts - device tree source text\n"
- "\t\tdtb - device tree blob\n"
- "\t\tasm - assembler source",
-- "\n\tBlob version to produce, defaults to %d (for dtb and asm output)", //, DEFAULT_FDT_VERSION);
-+ "\n\tBlob version to produce, defaults to "FDT_VERSION(DEFAULT_FDT_VERSION)" (for dtb and asm output)",
- "\n\tOutput dependency file",
-- "\n\ttMake space for <number> reserve map entries (for dtb and asm output)",
-+ "\n\tMake space for <number> reserve map entries (for dtb and asm output)",
- "\n\tMake the blob at least <bytes> long (extra space)",
- "\n\tAdd padding to the blob of <bytes> long (extra space)",
- "\n\tSet the physical boot cpu",
-@@ -97,6 +101,7 @@
- "\t\tboth - Both \"linux,phandle\" and \"phandle\" properties",
- "\n\tEnable/disable warnings (prefix with \"no-\")",
- "\n\tEnable/disable errors (prefix with \"no-\")",
-+ "\n\tSymbols and Fixups support",
- "\n\tPrint this help and exit",
- "\n\tPrint version and exit",
- NULL,
-@@ -109,7 +114,7 @@
- const char *outform = "dts";
- const char *outname = "-";
- const char *depname = NULL;
-- int force = 0, sort = 0;
-+ bool force = false, sort = false;
- const char *arg;
- int opt;
- FILE *outf = NULL;
-@@ -148,7 +153,7 @@
- padsize = strtol(optarg, NULL, 0);
- break;
- case 'f':
-- force = 1;
-+ force = true;
- break;
- case 'q':
- quiet++;
-@@ -174,7 +179,7 @@
- break;
-
- case 's':
-- sort = 1;
-+ sort = true;
- break;
-
- case 'W':
-@@ -184,7 +189,9 @@
- case 'E':
- parse_checks_option(false, true, optarg);
- break;
--
-+ case '@':
-+ symbol_fixup_support = 1;
-+ break;
- case 'h':
- usage(NULL);
- default:
-@@ -237,7 +244,7 @@
- if (streq(outname, "-")) {
- outf = stdout;
- } else {
-- outf = fopen(outname, "w");
-+ outf = fopen(outname, "wb");
- if (! outf)
- die("Couldn't open output file %s: %s\n",
- outname, strerror(errno));
-diff -Nur linux-4.1.6/scripts/dtc/dtc.h linux-rpi/scripts/dtc/dtc.h
---- linux-4.1.6/scripts/dtc/dtc.h 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/scripts/dtc/dtc.h 2015-08-26 10:26:13.257378345 +0200
-@@ -38,9 +38,9 @@
- #include "util.h"
-
- #ifdef DEBUG
--#define debug(fmt,args...) printf(fmt, ##args)
-+#define debug(...) printf(__VA_ARGS__)
- #else
--#define debug(fmt,args...)
-+#define debug(...)
- #endif
-
-
-@@ -54,6 +54,7 @@
- extern int minsize; /* Minimum blob size */
- extern int padsize; /* Additional padding to blob */
- extern int phandle_format; /* Use linux,phandle or phandle properties */
-+extern int symbol_fixup_support;/* enable symbols & fixup support */
-
- #define PHANDLE_LEGACY 0x1
- #define PHANDLE_EPAPR 0x2
-@@ -88,7 +89,7 @@
- };
-
-
--#define empty_data ((struct data){ /* all .members = 0 or NULL */ })
-+#define empty_data ((struct data){ 0 /* all .members = 0 or NULL */ })
-
- #define for_each_marker(m) \
- for (; (m); (m) = (m)->next)
-@@ -118,7 +119,7 @@
-
- struct data data_add_marker(struct data d, enum markertype type, char *ref);
-
--int data_is_one_string(struct data d);
-+bool data_is_one_string(struct data d);
-
- /* DT constraints */
-
-@@ -127,13 +128,32 @@
-
- /* Live trees */
- struct label {
-- int deleted;
-+ bool deleted;
- char *label;
- struct label *next;
- };
-
-+struct fixup_entry {
-+ int offset;
-+ struct node *node;
-+ struct property *prop;
-+ struct fixup_entry *next;
-+};
-+
-+struct fixup {
-+ char *ref;
-+ struct fixup_entry *entries;
-+ struct fixup *next;
-+};
-+
-+struct symbol {
-+ struct label *label;
-+ struct node *node;
-+ struct symbol *next;
-+};
-+
- struct property {
-- int deleted;
-+ bool deleted;
- char *name;
- struct data val;
-
-@@ -143,7 +163,7 @@
- };
-
- struct node {
-- int deleted;
-+ bool deleted;
- char *name;
- struct property *proplist;
- struct node *children;
-@@ -158,6 +178,12 @@
- int addr_cells, size_cells;
-
- struct label *labels;
-+
-+ int is_root;
-+ int is_plugin;
-+ struct fixup *fixups;
-+ struct symbol *symbols;
-+ struct fixup_entry *local_fixups;
- };
-
- #define for_each_label_withdel(l0, l) \
-@@ -181,6 +207,18 @@
- for_each_child_withdel(n, c) \
- if (!(c)->deleted)
-
-+#define for_each_fixup(n, f) \
-+ for ((f) = (n)->fixups; (f); (f) = (f)->next)
-+
-+#define for_each_fixup_entry(f, fe) \
-+ for ((fe) = (f)->entries; (fe); (fe) = (fe)->next)
-+
-+#define for_each_symbol(n, s) \
-+ for ((s) = (n)->symbols; (s); (s) = (s)->next)
-+
-+#define for_each_local_fixup_entry(n, fe) \
-+ for ((fe) = (n)->local_fixups; (fe); (fe) = (fe)->next)
-+
- void add_label(struct label **labels, char *label);
- void delete_labels(struct label **labels);
-
-@@ -247,8 +285,8 @@
-
- /* Checks */
-
--void parse_checks_option(bool warn, bool error, const char *optarg);
--void process_checks(int force, struct boot_info *bi);
-+void parse_checks_option(bool warn, bool error, const char *arg);
-+void process_checks(bool force, struct boot_info *bi);
-
- /* Flattened trees */
-
-diff -Nur linux-4.1.6/scripts/dtc/flattree.c linux-rpi/scripts/dtc/flattree.c
---- linux-4.1.6/scripts/dtc/flattree.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/scripts/dtc/flattree.c 2015-08-26 10:26:13.257378345 +0200
+diff -Nur linux-4.1.10/scripts/dtc/flattree.c linux-rpi/scripts/dtc/flattree.c
+--- linux-4.1.10/scripts/dtc/flattree.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/scripts/dtc/flattree.c 2015-10-07 16:41:12.000000000 +0200
@@ -261,7 +261,13 @@
{
struct property *prop;
@@ -304564,9 +307441,9 @@ diff -Nur linux-4.1.6/scripts/dtc/flattree.c linux-rpi/scripts/dtc/flattree.c
emit->endnode(etarget, tree->labels);
}
-diff -Nur linux-4.1.6/scripts/dtc/fstree.c linux-rpi/scripts/dtc/fstree.c
---- linux-4.1.6/scripts/dtc/fstree.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/scripts/dtc/fstree.c 2015-08-26 10:26:13.257378345 +0200
+diff -Nur linux-4.1.10/scripts/dtc/fstree.c linux-rpi/scripts/dtc/fstree.c
+--- linux-4.1.10/scripts/dtc/fstree.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/scripts/dtc/fstree.c 2015-10-07 16:41:12.000000000 +0200
@@ -37,26 +37,26 @@
tree = build_node(NULL, NULL);
@@ -304615,9 +307492,9 @@ diff -Nur linux-4.1.6/scripts/dtc/fstree.c linux-rpi/scripts/dtc/fstree.c
}
closedir(d);
-diff -Nur linux-4.1.6/scripts/dtc/livetree.c linux-rpi/scripts/dtc/livetree.c
---- linux-4.1.6/scripts/dtc/livetree.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/scripts/dtc/livetree.c 2015-08-26 10:26:13.257378345 +0200
+diff -Nur linux-4.1.10/scripts/dtc/livetree.c linux-rpi/scripts/dtc/livetree.c
+--- linux-4.1.10/scripts/dtc/livetree.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/scripts/dtc/livetree.c 2015-10-07 16:41:12.000000000 +0200
@@ -511,7 +511,9 @@
struct node *get_node_by_ref(struct node *tree, const char *ref)
@@ -304629,9 +307506,9 @@ diff -Nur linux-4.1.6/scripts/dtc/livetree.c linux-rpi/scripts/dtc/livetree.c
return get_node_by_path(tree, ref);
else
return get_node_by_label(tree, ref);
-diff -Nur linux-4.1.6/scripts/dtc/srcpos.c linux-rpi/scripts/dtc/srcpos.c
---- linux-4.1.6/scripts/dtc/srcpos.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/scripts/dtc/srcpos.c 2015-08-26 10:26:13.257378345 +0200
+diff -Nur linux-4.1.10/scripts/dtc/srcpos.c linux-rpi/scripts/dtc/srcpos.c
+--- linux-4.1.10/scripts/dtc/srcpos.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/scripts/dtc/srcpos.c 2015-10-07 16:41:12.000000000 +0200
@@ -34,7 +34,7 @@
static struct search_path *search_path_head, **search_path_tail;
@@ -304732,9 +307609,9 @@ diff -Nur linux-4.1.6/scripts/dtc/srcpos.c linux-rpi/scripts/dtc/srcpos.c
va_end(va);
}
-diff -Nur linux-4.1.6/scripts/dtc/srcpos.h linux-rpi/scripts/dtc/srcpos.h
---- linux-4.1.6/scripts/dtc/srcpos.h 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/scripts/dtc/srcpos.h 2015-08-26 10:26:13.257378345 +0200
+diff -Nur linux-4.1.10/scripts/dtc/srcpos.h linux-rpi/scripts/dtc/srcpos.h
+--- linux-4.1.10/scripts/dtc/srcpos.h 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/scripts/dtc/srcpos.h 2015-10-07 16:41:12.000000000 +0200
@@ -21,6 +21,7 @@
#define _SRCPOS_H_
@@ -304771,9 +307648,9 @@ diff -Nur linux-4.1.6/scripts/dtc/srcpos.h linux-rpi/scripts/dtc/srcpos.h
extern void srcpos_set_line(char *f, int l);
-diff -Nur linux-4.1.6/scripts/dtc/treesource.c linux-rpi/scripts/dtc/treesource.c
---- linux-4.1.6/scripts/dtc/treesource.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/scripts/dtc/treesource.c 2015-08-26 10:26:13.257378345 +0200
+diff -Nur linux-4.1.10/scripts/dtc/treesource.c linux-rpi/scripts/dtc/treesource.c
+--- linux-4.1.10/scripts/dtc/treesource.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/scripts/dtc/treesource.c 2015-10-07 16:41:12.000000000 +0200
@@ -26,12 +26,12 @@
extern YYLTYPE yylloc;
@@ -304828,9 +307705,9 @@ diff -Nur linux-4.1.6/scripts/dtc/treesource.c linux-rpi/scripts/dtc/treesource.
if ((const void *)bp >= propend)
break;
fprintf(f, " ");
-diff -Nur linux-4.1.6/scripts/dtc/util.c linux-rpi/scripts/dtc/util.c
---- linux-4.1.6/scripts/dtc/util.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/scripts/dtc/util.c 2015-08-26 10:26:13.261378400 +0200
+diff -Nur linux-4.1.10/scripts/dtc/util.c linux-rpi/scripts/dtc/util.c
+--- linux-4.1.10/scripts/dtc/util.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/scripts/dtc/util.c 2015-10-07 16:41:12.000000000 +0200
@@ -39,11 +39,11 @@
char *xstrdup(const char *s)
{
@@ -304887,9 +307764,9 @@ diff -Nur linux-4.1.6/scripts/dtc/util.c linux-rpi/scripts/dtc/util.c
printf(">");
} else {
printf(" = [");
-diff -Nur linux-4.1.6/scripts/dtc/util.h linux-rpi/scripts/dtc/util.h
---- linux-4.1.6/scripts/dtc/util.h 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/scripts/dtc/util.h 2015-08-26 10:26:13.261378400 +0200
+diff -Nur linux-4.1.10/scripts/dtc/util.h linux-rpi/scripts/dtc/util.h
+--- linux-4.1.10/scripts/dtc/util.h 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/scripts/dtc/util.h 2015-10-07 16:41:12.000000000 +0200
@@ -2,6 +2,7 @@
#define _UTIL_H
@@ -304915,15 +307792,15 @@ diff -Nur linux-4.1.6/scripts/dtc/util.h linux-rpi/scripts/dtc/util.h
/*
* Parse an escaped character starting at index i in string s. The resulting
-diff -Nur linux-4.1.6/scripts/dtc/version_gen.h linux-rpi/scripts/dtc/version_gen.h
---- linux-4.1.6/scripts/dtc/version_gen.h 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/scripts/dtc/version_gen.h 2015-08-26 10:26:13.261378400 +0200
+diff -Nur linux-4.1.10/scripts/dtc/version_gen.h linux-rpi/scripts/dtc/version_gen.h
+--- linux-4.1.10/scripts/dtc/version_gen.h 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/scripts/dtc/version_gen.h 2015-10-07 16:41:12.000000000 +0200
@@ -1 +1 @@
-#define DTC_VERSION "DTC 1.4.0-dirty"
+#define DTC_VERSION "DTC 1.4.1-g36c70742"
-diff -Nur linux-4.1.6/scripts/knlinfo linux-rpi/scripts/knlinfo
---- linux-4.1.6/scripts/knlinfo 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/scripts/knlinfo 2015-08-26 10:26:13.265378454 +0200
+diff -Nur linux-4.1.10/scripts/knlinfo linux-rpi/scripts/knlinfo
+--- linux-4.1.10/scripts/knlinfo 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/scripts/knlinfo 2015-10-07 16:41:12.000000000 +0200
@@ -0,0 +1,168 @@
+#!/usr/bin/env perl
+# ----------------------------------------------------------------------
@@ -305093,9 +307970,9 @@ diff -Nur linux-4.1.6/scripts/knlinfo linux-rpi/scripts/knlinfo
+ my ($data) = @_;
+ return unpack('H*', $data);
+}
-diff -Nur linux-4.1.6/scripts/mkknlimg linux-rpi/scripts/mkknlimg
---- linux-4.1.6/scripts/mkknlimg 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/scripts/mkknlimg 2015-08-26 10:26:13.265378454 +0200
+diff -Nur linux-4.1.10/scripts/mkknlimg linux-rpi/scripts/mkknlimg
+--- linux-4.1.10/scripts/mkknlimg 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/scripts/mkknlimg 2015-10-07 16:41:13.000000000 +0200
@@ -0,0 +1,275 @@
+#!/usr/bin/env perl
+# ----------------------------------------------------------------------
@@ -305372,38 +308249,524 @@ diff -Nur linux-4.1.6/scripts/mkknlimg linux-rpi/scripts/mkknlimg
+ my $val = $configs->{$wanted} || 'n';
+ return (($val eq 'y') || ($val eq '1'));
+}
-diff -Nur linux-4.1.6/sound/arm/Kconfig linux-rpi/sound/arm/Kconfig
---- linux-4.1.6/sound/arm/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/sound/arm/Kconfig 2015-08-26 10:26:13.285378727 +0200
-@@ -39,5 +39,13 @@
- Say Y or M if you want to support any AC97 codec attached to
- the PXA2xx AC97 interface.
-
-+config SND_BCM2835
-+ tristate "BCM2835 ALSA driver"
-+ depends on (ARCH_BCM2708 || ARCH_BCM2709 || ARCH_BCM2835) \
-+ && BCM2708_VCHIQ && SND
-+ select SND_PCM
-+ help
-+ Say Y or M if you want to support BCM2835 Alsa pcm card driver
+diff -Nur linux-4.1.10/sound/arm/bcm2835.c linux-rpi/sound/arm/bcm2835.c
+--- linux-4.1.10/sound/arm/bcm2835.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/sound/arm/bcm2835.c 2015-10-07 16:41:13.000000000 +0200
+@@ -0,0 +1,511 @@
++/*****************************************************************************
++* Copyright 2011 Broadcom Corporation. All rights reserved.
++*
++* Unless you and Broadcom execute a separate written software license
++* agreement governing use of this software, this software is licensed to you
++* under the terms of the GNU General Public License version 2, available at
++* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
++*
++* Notwithstanding the above, under no circumstances may you combine this
++* software in any way with any other Broadcom software provided under a
++* license other than the GPL, without Broadcom's express prior written
++* consent.
++*****************************************************************************/
+
- endif # SND_ARM
-
-diff -Nur linux-4.1.6/sound/arm/Makefile linux-rpi/sound/arm/Makefile
---- linux-4.1.6/sound/arm/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/sound/arm/Makefile 2015-08-26 10:26:13.285378727 +0200
-@@ -14,3 +14,8 @@
-
- obj-$(CONFIG_SND_PXA2XX_AC97) += snd-pxa2xx-ac97.o
- snd-pxa2xx-ac97-objs := pxa2xx-ac97.o
++#include <linux/platform_device.h>
+
-+obj-$(CONFIG_SND_BCM2835) += snd-bcm2835.o
-+snd-bcm2835-objs := bcm2835.o bcm2835-ctl.o bcm2835-pcm.o bcm2835-vchiq.o
++#include <linux/init.h>
++#include <linux/slab.h>
++#include <linux/module.h>
++#include <linux/of.h>
+
-+ccflags-y += -Idrivers/misc/vc04_services -Idrivers/misc/vc04_services/interface/vcos/linuxkernel -D__VCCOREVER__=0x04000000
-diff -Nur linux-4.1.6/sound/arm/bcm2835-ctl.c linux-rpi/sound/arm/bcm2835-ctl.c
---- linux-4.1.6/sound/arm/bcm2835-ctl.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/sound/arm/bcm2835-ctl.c 2015-08-26 10:26:13.285378727 +0200
++#include "bcm2835.h"
++
++/* module parameters (see "Module Parameters") */
++/* SNDRV_CARDS: maximum number of cards supported by this module */
++static int index[MAX_SUBSTREAMS] = {[0 ... (MAX_SUBSTREAMS - 1)] = -1 };
++static char *id[MAX_SUBSTREAMS] = {[0 ... (MAX_SUBSTREAMS - 1)] = NULL };
++static int enable[MAX_SUBSTREAMS] = {[0 ... (MAX_SUBSTREAMS - 1)] = 1 };
++
++/* HACKY global pointers needed for successive probes to work : ssp
++ * But compared against the changes we will have to do in VC audio_ipc code
++ * to export 8 audio_ipc devices as a single IPC device and then monitor all
++ * four devices in a thread, this gets things done quickly and should be easier
++ * to debug if we run into issues
++ */
++
++static struct snd_card *g_card = NULL;
++static bcm2835_chip_t *g_chip = NULL;
++
++static int snd_bcm2835_free(bcm2835_chip_t * chip)
++{
++ kfree(chip);
++ return 0;
++}
++
++/* component-destructor
++ * (see "Management of Cards and Components")
++ */
++static int snd_bcm2835_dev_free(struct snd_device *device)
++{
++ return snd_bcm2835_free(device->device_data);
++}
++
++/* chip-specific constructor
++ * (see "Management of Cards and Components")
++ */
++static int snd_bcm2835_create(struct snd_card *card,
++ struct platform_device *pdev,
++ bcm2835_chip_t ** rchip)
++{
++ bcm2835_chip_t *chip;
++ int err;
++ static struct snd_device_ops ops = {
++ .dev_free = snd_bcm2835_dev_free,
++ };
++
++ *rchip = NULL;
++
++ chip = kzalloc(sizeof(*chip), GFP_KERNEL);
++ if (chip == NULL)
++ return -ENOMEM;
++
++ chip->card = card;
++
++ err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
++ if (err < 0) {
++ snd_bcm2835_free(chip);
++ return err;
++ }
++
++ *rchip = chip;
++ return 0;
++}
++
++static int snd_bcm2835_alsa_probe_dt(struct platform_device *pdev)
++{
++ struct device *dev = &pdev->dev;
++ bcm2835_chip_t *chip;
++ struct snd_card *card;
++ u32 numchans;
++ int err, i;
++
++ err = of_property_read_u32(dev->of_node, "brcm,pwm-channels",
++ &numchans);
++ if (err) {
++ dev_err(dev, "Failed to get DT property 'brcm,pwm-channels'");
++ return err;
++ }
++
++ if (numchans == 0 || numchans > MAX_SUBSTREAMS) {
++ numchans = MAX_SUBSTREAMS;
++ dev_warn(dev, "Illegal 'brcm,pwm-channels' value, will use %u\n",
++ numchans);
++ }
++
++ err = snd_card_new(NULL, -1, NULL, THIS_MODULE, 0, &card);
++ if (err) {
++ dev_err(dev, "Failed to create soundcard structure\n");
++ return err;
++ }
++
++ snd_card_set_dev(card, dev);
++ strcpy(card->driver, "bcm2835");
++ strcpy(card->shortname, "bcm2835 ALSA");
++ sprintf(card->longname, "%s", card->shortname);
++
++ err = snd_bcm2835_create(card, pdev, &chip);
++ if (err < 0) {
++ dev_err(dev, "Failed to create bcm2835 chip\n");
++ goto err_free;
++ }
++
++ err = snd_bcm2835_new_pcm(chip);
++ if (err < 0) {
++ dev_err(dev, "Failed to create new bcm2835 pcm device\n");
++ goto err_free;
++ }
++
++ err = snd_bcm2835_new_spdif_pcm(chip);
++ if (err < 0) {
++ dev_err(dev, "Failed to create new bcm2835 spdif pcm device\n");
++ goto err_free;
++ }
++
++ err = snd_bcm2835_new_ctl(chip);
++ if (err < 0) {
++ dev_err(dev, "Failed to create new bcm2835 ctl\n");
++ goto err_free;
++ }
++
++ for (i = 0; i < numchans; i++) {
++ chip->avail_substreams |= (1 << i);
++ chip->pdev[i] = pdev;
++ }
++
++ err = snd_card_register(card);
++ if (err) {
++ dev_err(dev, "Failed to register bcm2835 ALSA card \n");
++ goto err_free;
++ }
++
++ g_card = card;
++ g_chip = chip;
++ platform_set_drvdata(pdev, card);
++ audio_info("bcm2835 ALSA card created with %u channels\n", numchans);
++
++ return 0;
++
++err_free:
++ snd_card_free(card);
++
++ return err;
++}
++
++static int snd_bcm2835_alsa_probe(struct platform_device *pdev)
++{
++ static int dev;
++ bcm2835_chip_t *chip;
++ struct snd_card *card;
++ int err;
++
++ if (pdev->dev.of_node)
++ return snd_bcm2835_alsa_probe_dt(pdev);
++
++ if (dev >= MAX_SUBSTREAMS)
++ return -ENODEV;
++
++ if (!enable[dev]) {
++ dev++;
++ return -ENOENT;
++ }
++
++ if (dev > 0)
++ goto add_register_map;
++
++ err = snd_card_new(NULL, index[dev], id[dev], THIS_MODULE, 0, &g_card);
++ if (err < 0)
++ goto out;
++
++ snd_card_set_dev(g_card, &pdev->dev);
++ strcpy(g_card->driver, "bcm2835");
++ strcpy(g_card->shortname, "bcm2835 ALSA");
++ sprintf(g_card->longname, "%s", g_card->shortname);
++
++ err = snd_bcm2835_create(g_card, pdev, &chip);
++ if (err < 0) {
++ dev_err(&pdev->dev, "Failed to create bcm2835 chip\n");
++ goto out_bcm2835_create;
++ }
++
++ g_chip = chip;
++ err = snd_bcm2835_new_pcm(chip);
++ if (err < 0) {
++ dev_err(&pdev->dev, "Failed to create new BCM2835 pcm device\n");
++ goto out_bcm2835_new_pcm;
++ }
++
++ err = snd_bcm2835_new_spdif_pcm(chip);
++ if (err < 0) {
++ dev_err(&pdev->dev, "Failed to create new BCM2835 spdif pcm device\n");
++ goto out_bcm2835_new_spdif;
++ }
++
++ err = snd_bcm2835_new_ctl(chip);
++ if (err < 0) {
++ dev_err(&pdev->dev, "Failed to create new BCM2835 ctl\n");
++ goto out_bcm2835_new_ctl;
++ }
++
++add_register_map:
++ card = g_card;
++ chip = g_chip;
++
++ BUG_ON(!(card && chip));
++
++ chip->avail_substreams |= (1 << dev);
++ chip->pdev[dev] = pdev;
++
++ if (dev == 0) {
++ err = snd_card_register(card);
++ if (err < 0) {
++ dev_err(&pdev->dev,
++ "Failed to register bcm2835 ALSA card \n");
++ goto out_card_register;
++ }
++ platform_set_drvdata(pdev, card);
++ audio_info("bcm2835 ALSA card created!\n");
++ } else {
++ audio_info("bcm2835 ALSA chip created!\n");
++ platform_set_drvdata(pdev, (void *)dev);
++ }
++
++ dev++;
++
++ return 0;
++
++out_card_register:
++out_bcm2835_new_ctl:
++out_bcm2835_new_spdif:
++out_bcm2835_new_pcm:
++out_bcm2835_create:
++ BUG_ON(!g_card);
++ if (snd_card_free(g_card))
++ dev_err(&pdev->dev, "Failed to free Registered alsa card\n");
++ g_card = NULL;
++out:
++ dev = SNDRV_CARDS; /* stop more avail_substreams from being probed */
++ dev_err(&pdev->dev, "BCM2835 ALSA Probe failed !!\n");
++ return err;
++}
++
++static int snd_bcm2835_alsa_remove(struct platform_device *pdev)
++{
++ uint32_t idx;
++ void *drv_data;
++
++ drv_data = platform_get_drvdata(pdev);
++
++ if (drv_data == (void *)g_card) {
++ /* This is the card device */
++ snd_card_free((struct snd_card *)drv_data);
++ g_card = NULL;
++ g_chip = NULL;
++ } else {
++ idx = (uint32_t) drv_data;
++ if (g_card != NULL) {
++ BUG_ON(!g_chip);
++ /* We pass chip device numbers in audio ipc devices
++ * other than the one we registered our card with
++ */
++ idx = (uint32_t) drv_data;
++ BUG_ON(!idx || idx > MAX_SUBSTREAMS);
++ g_chip->avail_substreams &= ~(1 << idx);
++ /* There should be atleast one substream registered
++ * after we are done here, as it wil be removed when
++ * the *remove* is called for the card device
++ */
++ BUG_ON(!g_chip->avail_substreams);
++ }
++ }
++
++ platform_set_drvdata(pdev, NULL);
++
++ return 0;
++}
++
++#ifdef CONFIG_PM
++static int snd_bcm2835_alsa_suspend(struct platform_device *pdev,
++ pm_message_t state)
++{
++ return 0;
++}
++
++static int snd_bcm2835_alsa_resume(struct platform_device *pdev)
++{
++ return 0;
++}
++
++#endif
++
++static const struct of_device_id snd_bcm2835_of_match_table[] = {
++ { .compatible = "brcm,bcm2835-audio", },
++ {},
++};
++MODULE_DEVICE_TABLE(of, snd_bcm2835_of_match_table);
++
++static struct platform_driver bcm2835_alsa0_driver = {
++ .probe = snd_bcm2835_alsa_probe,
++ .remove = snd_bcm2835_alsa_remove,
++#ifdef CONFIG_PM
++ .suspend = snd_bcm2835_alsa_suspend,
++ .resume = snd_bcm2835_alsa_resume,
++#endif
++ .driver = {
++ .name = "bcm2835_AUD0",
++ .owner = THIS_MODULE,
++ .of_match_table = snd_bcm2835_of_match_table,
++ },
++};
++
++static struct platform_driver bcm2835_alsa1_driver = {
++ .probe = snd_bcm2835_alsa_probe,
++ .remove = snd_bcm2835_alsa_remove,
++#ifdef CONFIG_PM
++ .suspend = snd_bcm2835_alsa_suspend,
++ .resume = snd_bcm2835_alsa_resume,
++#endif
++ .driver = {
++ .name = "bcm2835_AUD1",
++ .owner = THIS_MODULE,
++ },
++};
++
++static struct platform_driver bcm2835_alsa2_driver = {
++ .probe = snd_bcm2835_alsa_probe,
++ .remove = snd_bcm2835_alsa_remove,
++#ifdef CONFIG_PM
++ .suspend = snd_bcm2835_alsa_suspend,
++ .resume = snd_bcm2835_alsa_resume,
++#endif
++ .driver = {
++ .name = "bcm2835_AUD2",
++ .owner = THIS_MODULE,
++ },
++};
++
++static struct platform_driver bcm2835_alsa3_driver = {
++ .probe = snd_bcm2835_alsa_probe,
++ .remove = snd_bcm2835_alsa_remove,
++#ifdef CONFIG_PM
++ .suspend = snd_bcm2835_alsa_suspend,
++ .resume = snd_bcm2835_alsa_resume,
++#endif
++ .driver = {
++ .name = "bcm2835_AUD3",
++ .owner = THIS_MODULE,
++ },
++};
++
++static struct platform_driver bcm2835_alsa4_driver = {
++ .probe = snd_bcm2835_alsa_probe,
++ .remove = snd_bcm2835_alsa_remove,
++#ifdef CONFIG_PM
++ .suspend = snd_bcm2835_alsa_suspend,
++ .resume = snd_bcm2835_alsa_resume,
++#endif
++ .driver = {
++ .name = "bcm2835_AUD4",
++ .owner = THIS_MODULE,
++ },
++};
++
++static struct platform_driver bcm2835_alsa5_driver = {
++ .probe = snd_bcm2835_alsa_probe,
++ .remove = snd_bcm2835_alsa_remove,
++#ifdef CONFIG_PM
++ .suspend = snd_bcm2835_alsa_suspend,
++ .resume = snd_bcm2835_alsa_resume,
++#endif
++ .driver = {
++ .name = "bcm2835_AUD5",
++ .owner = THIS_MODULE,
++ },
++};
++
++static struct platform_driver bcm2835_alsa6_driver = {
++ .probe = snd_bcm2835_alsa_probe,
++ .remove = snd_bcm2835_alsa_remove,
++#ifdef CONFIG_PM
++ .suspend = snd_bcm2835_alsa_suspend,
++ .resume = snd_bcm2835_alsa_resume,
++#endif
++ .driver = {
++ .name = "bcm2835_AUD6",
++ .owner = THIS_MODULE,
++ },
++};
++
++static struct platform_driver bcm2835_alsa7_driver = {
++ .probe = snd_bcm2835_alsa_probe,
++ .remove = snd_bcm2835_alsa_remove,
++#ifdef CONFIG_PM
++ .suspend = snd_bcm2835_alsa_suspend,
++ .resume = snd_bcm2835_alsa_resume,
++#endif
++ .driver = {
++ .name = "bcm2835_AUD7",
++ .owner = THIS_MODULE,
++ },
++};
++
++static int bcm2835_alsa_device_init(void)
++{
++ int err;
++ err = platform_driver_register(&bcm2835_alsa0_driver);
++ if (err) {
++ pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
++ goto out;
++ }
++
++ err = platform_driver_register(&bcm2835_alsa1_driver);
++ if (err) {
++ pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
++ goto unregister_0;
++ }
++
++ err = platform_driver_register(&bcm2835_alsa2_driver);
++ if (err) {
++ pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
++ goto unregister_1;
++ }
++
++ err = platform_driver_register(&bcm2835_alsa3_driver);
++ if (err) {
++ pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
++ goto unregister_2;
++ }
++
++ err = platform_driver_register(&bcm2835_alsa4_driver);
++ if (err) {
++ pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
++ goto unregister_3;
++ }
++
++ err = platform_driver_register(&bcm2835_alsa5_driver);
++ if (err) {
++ pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
++ goto unregister_4;
++ }
++
++ err = platform_driver_register(&bcm2835_alsa6_driver);
++ if (err) {
++ pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
++ goto unregister_5;
++ }
++
++ err = platform_driver_register(&bcm2835_alsa7_driver);
++ if (err) {
++ pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
++ goto unregister_6;
++ }
++
++ return 0;
++
++unregister_6:
++ platform_driver_unregister(&bcm2835_alsa6_driver);
++unregister_5:
++ platform_driver_unregister(&bcm2835_alsa5_driver);
++unregister_4:
++ platform_driver_unregister(&bcm2835_alsa4_driver);
++unregister_3:
++ platform_driver_unregister(&bcm2835_alsa3_driver);
++unregister_2:
++ platform_driver_unregister(&bcm2835_alsa2_driver);
++unregister_1:
++ platform_driver_unregister(&bcm2835_alsa1_driver);
++unregister_0:
++ platform_driver_unregister(&bcm2835_alsa0_driver);
++out:
++ return err;
++}
++
++static void bcm2835_alsa_device_exit(void)
++{
++ platform_driver_unregister(&bcm2835_alsa0_driver);
++ platform_driver_unregister(&bcm2835_alsa1_driver);
++ platform_driver_unregister(&bcm2835_alsa2_driver);
++ platform_driver_unregister(&bcm2835_alsa3_driver);
++ platform_driver_unregister(&bcm2835_alsa4_driver);
++ platform_driver_unregister(&bcm2835_alsa5_driver);
++ platform_driver_unregister(&bcm2835_alsa6_driver);
++ platform_driver_unregister(&bcm2835_alsa7_driver);
++}
++
++late_initcall(bcm2835_alsa_device_init);
++module_exit(bcm2835_alsa_device_exit);
++
++MODULE_AUTHOR("Dom Cobley");
++MODULE_DESCRIPTION("Alsa driver for BCM2835 chip");
++MODULE_LICENSE("GPL");
++MODULE_ALIAS("platform:bcm2835_alsa");
+diff -Nur linux-4.1.10/sound/arm/bcm2835-ctl.c linux-rpi/sound/arm/bcm2835-ctl.c
+--- linux-4.1.10/sound/arm/bcm2835-ctl.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/sound/arm/bcm2835-ctl.c 2015-10-07 16:41:13.000000000 +0200
@@ -0,0 +1,323 @@
+/*****************************************************************************
+* Copyright 2011 Broadcom Corporation. All rights reserved.
@@ -305728,9 +309091,180 @@ diff -Nur linux-4.1.6/sound/arm/bcm2835-ctl.c linux-rpi/sound/arm/bcm2835-ctl.c
+ }
+ return 0;
+}
-diff -Nur linux-4.1.6/sound/arm/bcm2835-pcm.c linux-rpi/sound/arm/bcm2835-pcm.c
---- linux-4.1.6/sound/arm/bcm2835-pcm.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/sound/arm/bcm2835-pcm.c 2015-08-26 10:26:13.285378727 +0200
+diff -Nur linux-4.1.10/sound/arm/bcm2835.h linux-rpi/sound/arm/bcm2835.h
+--- linux-4.1.10/sound/arm/bcm2835.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/sound/arm/bcm2835.h 2015-10-07 16:41:13.000000000 +0200
+@@ -0,0 +1,167 @@
++/*****************************************************************************
++* Copyright 2011 Broadcom Corporation. All rights reserved.
++*
++* Unless you and Broadcom execute a separate written software license
++* agreement governing use of this software, this software is licensed to you
++* under the terms of the GNU General Public License version 2, available at
++* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
++*
++* Notwithstanding the above, under no circumstances may you combine this
++* software in any way with any other Broadcom software provided under a
++* license other than the GPL, without Broadcom's express prior written
++* consent.
++*****************************************************************************/
++
++#ifndef __SOUND_ARM_BCM2835_H
++#define __SOUND_ARM_BCM2835_H
++
++#include <linux/device.h>
++#include <linux/list.h>
++#include <linux/interrupt.h>
++#include <linux/wait.h>
++#include <sound/core.h>
++#include <sound/initval.h>
++#include <sound/pcm.h>
++#include <sound/pcm_params.h>
++#include <sound/pcm-indirect.h>
++#include <linux/workqueue.h>
++
++/*
++#define AUDIO_DEBUG_ENABLE
++#define AUDIO_VERBOSE_DEBUG_ENABLE
++*/
++
++/* Debug macros */
++
++#ifdef AUDIO_DEBUG_ENABLE
++#ifdef AUDIO_VERBOSE_DEBUG_ENABLE
++
++#define audio_debug(fmt, arg...) \
++ printk(KERN_INFO"%s:%d " fmt, __func__, __LINE__, ##arg)
++
++#define audio_info(fmt, arg...) \
++ printk(KERN_INFO"%s:%d " fmt, __func__, __LINE__, ##arg)
++
++#else
++
++#define audio_debug(fmt, arg...)
++
++#define audio_info(fmt, arg...)
++
++#endif /* AUDIO_VERBOSE_DEBUG_ENABLE */
++
++#else
++
++#define audio_debug(fmt, arg...)
++
++#define audio_info(fmt, arg...)
++
++#endif /* AUDIO_DEBUG_ENABLE */
++
++#define audio_error(fmt, arg...) \
++ printk(KERN_ERR"%s:%d " fmt, __func__, __LINE__, ##arg)
++
++#define audio_warning(fmt, arg...) \
++ printk(KERN_WARNING"%s:%d " fmt, __func__, __LINE__, ##arg)
++
++#define audio_alert(fmt, arg...) \
++ printk(KERN_ALERT"%s:%d " fmt, __func__, __LINE__, ##arg)
++
++#define MAX_SUBSTREAMS (8)
++#define AVAIL_SUBSTREAMS_MASK (0xff)
++enum {
++ CTRL_VOL_MUTE,
++ CTRL_VOL_UNMUTE
++};
++
++/* macros for alsa2chip and chip2alsa, instead of functions */
++
++#define alsa2chip(vol) (uint)(-((vol << 8) / 100)) /* convert alsa to chip volume (defined as macro rather than function call) */
++#define chip2alsa(vol) -((vol * 100) >> 8) /* convert chip to alsa volume */
++
++/* Some constants for values .. */
++typedef enum {
++ AUDIO_DEST_AUTO = 0,
++ AUDIO_DEST_HEADPHONES = 1,
++ AUDIO_DEST_HDMI = 2,
++ AUDIO_DEST_MAX,
++} SND_BCM2835_ROUTE_T;
++
++typedef enum {
++ PCM_PLAYBACK_VOLUME,
++ PCM_PLAYBACK_MUTE,
++ PCM_PLAYBACK_DEVICE,
++} SND_BCM2835_CTRL_T;
++
++/* definition of the chip-specific record */
++typedef struct bcm2835_chip {
++ struct snd_card *card;
++ struct snd_pcm *pcm;
++ struct snd_pcm *pcm_spdif;
++ /* Bitmat for valid reg_base and irq numbers */
++ uint32_t avail_substreams;
++ struct platform_device *pdev[MAX_SUBSTREAMS];
++ struct bcm2835_alsa_stream *alsa_stream[MAX_SUBSTREAMS];
++
++ int volume;
++ int old_volume; /* stores the volume value whist muted */
++ int dest;
++ int mute;
++
++ unsigned int opened;
++ unsigned int spdif_status;
++ struct mutex audio_mutex;
++} bcm2835_chip_t;
++
++typedef struct bcm2835_alsa_stream {
++ bcm2835_chip_t *chip;
++ struct snd_pcm_substream *substream;
++ struct snd_pcm_indirect pcm_indirect;
++
++ struct semaphore buffers_update_sem;
++ struct semaphore control_sem;
++ spinlock_t lock;
++ volatile uint32_t control;
++ volatile uint32_t status;
++
++ int open;
++ int running;
++ int draining;
++
++ int channels;
++ int params_rate;
++ int pcm_format_width;
++
++ unsigned int pos;
++ unsigned int buffer_size;
++ unsigned int period_size;
++
++ uint32_t enable_fifo_irq;
++ irq_handler_t fifo_irq_handler;
++
++ atomic_t retrieved;
++ struct opaque_AUDIO_INSTANCE_T *instance;
++ struct workqueue_struct *my_wq;
++ int idx;
++} bcm2835_alsa_stream_t;
++
++int snd_bcm2835_new_ctl(bcm2835_chip_t * chip);
++int snd_bcm2835_new_pcm(bcm2835_chip_t * chip);
++int snd_bcm2835_new_spdif_pcm(bcm2835_chip_t * chip);
++
++int bcm2835_audio_open(bcm2835_alsa_stream_t * alsa_stream);
++int bcm2835_audio_close(bcm2835_alsa_stream_t * alsa_stream);
++int bcm2835_audio_set_params(bcm2835_alsa_stream_t * alsa_stream,
++ uint32_t channels, uint32_t samplerate,
++ uint32_t bps);
++int bcm2835_audio_setup(bcm2835_alsa_stream_t * alsa_stream);
++int bcm2835_audio_start(bcm2835_alsa_stream_t * alsa_stream);
++int bcm2835_audio_stop(bcm2835_alsa_stream_t * alsa_stream);
++int bcm2835_audio_set_ctls(bcm2835_chip_t * chip);
++int bcm2835_audio_write(bcm2835_alsa_stream_t * alsa_stream, uint32_t count,
++ void *src);
++uint32_t bcm2835_audio_retrieve_buffers(bcm2835_alsa_stream_t * alsa_stream);
++void bcm2835_audio_flush_buffers(bcm2835_alsa_stream_t * alsa_stream);
++void bcm2835_audio_flush_playback_buffers(bcm2835_alsa_stream_t * alsa_stream);
++
++#endif /* __SOUND_ARM_BCM2835_H */
+diff -Nur linux-4.1.10/sound/arm/bcm2835-pcm.c linux-rpi/sound/arm/bcm2835-pcm.c
+--- linux-4.1.10/sound/arm/bcm2835-pcm.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/sound/arm/bcm2835-pcm.c 2015-10-07 16:41:13.000000000 +0200
@@ -0,0 +1,557 @@
+/*****************************************************************************
+* Copyright 2011 Broadcom Corporation. All rights reserved.
@@ -306289,9 +309823,9 @@ diff -Nur linux-4.1.6/sound/arm/bcm2835-pcm.c linux-rpi/sound/arm/bcm2835-pcm.c
+
+ return 0;
+}
-diff -Nur linux-4.1.6/sound/arm/bcm2835-vchiq.c linux-rpi/sound/arm/bcm2835-vchiq.c
---- linux-4.1.6/sound/arm/bcm2835-vchiq.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/sound/arm/bcm2835-vchiq.c 2015-08-26 10:26:13.285378727 +0200
+diff -Nur linux-4.1.10/sound/arm/bcm2835-vchiq.c linux-rpi/sound/arm/bcm2835-vchiq.c
+--- linux-4.1.10/sound/arm/bcm2835-vchiq.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/sound/arm/bcm2835-vchiq.c 2015-10-07 16:41:13.000000000 +0200
@@ -0,0 +1,902 @@
+/*****************************************************************************
+* Copyright 2011 Broadcom Corporation. All rights reserved.
@@ -307195,695 +310729,38 @@ diff -Nur linux-4.1.6/sound/arm/bcm2835-vchiq.c linux-rpi/sound/arm/bcm2835-vchi
+
+module_param(force_bulk, bool, 0444);
+MODULE_PARM_DESC(force_bulk, "Force use of vchiq bulk for audio");
-diff -Nur linux-4.1.6/sound/arm/bcm2835.c linux-rpi/sound/arm/bcm2835.c
---- linux-4.1.6/sound/arm/bcm2835.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/sound/arm/bcm2835.c 2015-08-26 10:26:13.285378727 +0200
-@@ -0,0 +1,511 @@
-+/*****************************************************************************
-+* Copyright 2011 Broadcom Corporation. All rights reserved.
-+*
-+* Unless you and Broadcom execute a separate written software license
-+* agreement governing use of this software, this software is licensed to you
-+* under the terms of the GNU General Public License version 2, available at
-+* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
-+*
-+* Notwithstanding the above, under no circumstances may you combine this
-+* software in any way with any other Broadcom software provided under a
-+* license other than the GPL, without Broadcom's express prior written
-+* consent.
-+*****************************************************************************/
-+
-+#include <linux/platform_device.h>
-+
-+#include <linux/init.h>
-+#include <linux/slab.h>
-+#include <linux/module.h>
-+#include <linux/of.h>
-+
-+#include "bcm2835.h"
-+
-+/* module parameters (see "Module Parameters") */
-+/* SNDRV_CARDS: maximum number of cards supported by this module */
-+static int index[MAX_SUBSTREAMS] = {[0 ... (MAX_SUBSTREAMS - 1)] = -1 };
-+static char *id[MAX_SUBSTREAMS] = {[0 ... (MAX_SUBSTREAMS - 1)] = NULL };
-+static int enable[MAX_SUBSTREAMS] = {[0 ... (MAX_SUBSTREAMS - 1)] = 1 };
-+
-+/* HACKY global pointers needed for successive probes to work : ssp
-+ * But compared against the changes we will have to do in VC audio_ipc code
-+ * to export 8 audio_ipc devices as a single IPC device and then monitor all
-+ * four devices in a thread, this gets things done quickly and should be easier
-+ * to debug if we run into issues
-+ */
-+
-+static struct snd_card *g_card = NULL;
-+static bcm2835_chip_t *g_chip = NULL;
-+
-+static int snd_bcm2835_free(bcm2835_chip_t * chip)
-+{
-+ kfree(chip);
-+ return 0;
-+}
-+
-+/* component-destructor
-+ * (see "Management of Cards and Components")
-+ */
-+static int snd_bcm2835_dev_free(struct snd_device *device)
-+{
-+ return snd_bcm2835_free(device->device_data);
-+}
-+
-+/* chip-specific constructor
-+ * (see "Management of Cards and Components")
-+ */
-+static int snd_bcm2835_create(struct snd_card *card,
-+ struct platform_device *pdev,
-+ bcm2835_chip_t ** rchip)
-+{
-+ bcm2835_chip_t *chip;
-+ int err;
-+ static struct snd_device_ops ops = {
-+ .dev_free = snd_bcm2835_dev_free,
-+ };
-+
-+ *rchip = NULL;
-+
-+ chip = kzalloc(sizeof(*chip), GFP_KERNEL);
-+ if (chip == NULL)
-+ return -ENOMEM;
-+
-+ chip->card = card;
-+
-+ err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
-+ if (err < 0) {
-+ snd_bcm2835_free(chip);
-+ return err;
-+ }
-+
-+ *rchip = chip;
-+ return 0;
-+}
-+
-+static int snd_bcm2835_alsa_probe_dt(struct platform_device *pdev)
-+{
-+ struct device *dev = &pdev->dev;
-+ bcm2835_chip_t *chip;
-+ struct snd_card *card;
-+ u32 numchans;
-+ int err, i;
-+
-+ err = of_property_read_u32(dev->of_node, "brcm,pwm-channels",
-+ &numchans);
-+ if (err) {
-+ dev_err(dev, "Failed to get DT property 'brcm,pwm-channels'");
-+ return err;
-+ }
-+
-+ if (numchans == 0 || numchans > MAX_SUBSTREAMS) {
-+ numchans = MAX_SUBSTREAMS;
-+ dev_warn(dev, "Illegal 'brcm,pwm-channels' value, will use %u\n",
-+ numchans);
-+ }
-+
-+ err = snd_card_new(NULL, -1, NULL, THIS_MODULE, 0, &card);
-+ if (err) {
-+ dev_err(dev, "Failed to create soundcard structure\n");
-+ return err;
-+ }
-+
-+ snd_card_set_dev(card, dev);
-+ strcpy(card->driver, "bcm2835");
-+ strcpy(card->shortname, "bcm2835 ALSA");
-+ sprintf(card->longname, "%s", card->shortname);
-+
-+ err = snd_bcm2835_create(card, pdev, &chip);
-+ if (err < 0) {
-+ dev_err(dev, "Failed to create bcm2835 chip\n");
-+ goto err_free;
-+ }
-+
-+ err = snd_bcm2835_new_pcm(chip);
-+ if (err < 0) {
-+ dev_err(dev, "Failed to create new bcm2835 pcm device\n");
-+ goto err_free;
-+ }
-+
-+ err = snd_bcm2835_new_spdif_pcm(chip);
-+ if (err < 0) {
-+ dev_err(dev, "Failed to create new bcm2835 spdif pcm device\n");
-+ goto err_free;
-+ }
-+
-+ err = snd_bcm2835_new_ctl(chip);
-+ if (err < 0) {
-+ dev_err(dev, "Failed to create new bcm2835 ctl\n");
-+ goto err_free;
-+ }
-+
-+ for (i = 0; i < numchans; i++) {
-+ chip->avail_substreams |= (1 << i);
-+ chip->pdev[i] = pdev;
-+ }
-+
-+ err = snd_card_register(card);
-+ if (err) {
-+ dev_err(dev, "Failed to register bcm2835 ALSA card \n");
-+ goto err_free;
-+ }
-+
-+ g_card = card;
-+ g_chip = chip;
-+ platform_set_drvdata(pdev, card);
-+ audio_info("bcm2835 ALSA card created with %u channels\n", numchans);
-+
-+ return 0;
-+
-+err_free:
-+ snd_card_free(card);
-+
-+ return err;
-+}
-+
-+static int snd_bcm2835_alsa_probe(struct platform_device *pdev)
-+{
-+ static int dev;
-+ bcm2835_chip_t *chip;
-+ struct snd_card *card;
-+ int err;
-+
-+ if (pdev->dev.of_node)
-+ return snd_bcm2835_alsa_probe_dt(pdev);
-+
-+ if (dev >= MAX_SUBSTREAMS)
-+ return -ENODEV;
-+
-+ if (!enable[dev]) {
-+ dev++;
-+ return -ENOENT;
-+ }
-+
-+ if (dev > 0)
-+ goto add_register_map;
-+
-+ err = snd_card_new(NULL, index[dev], id[dev], THIS_MODULE, 0, &g_card);
-+ if (err < 0)
-+ goto out;
-+
-+ snd_card_set_dev(g_card, &pdev->dev);
-+ strcpy(g_card->driver, "bcm2835");
-+ strcpy(g_card->shortname, "bcm2835 ALSA");
-+ sprintf(g_card->longname, "%s", g_card->shortname);
-+
-+ err = snd_bcm2835_create(g_card, pdev, &chip);
-+ if (err < 0) {
-+ dev_err(&pdev->dev, "Failed to create bcm2835 chip\n");
-+ goto out_bcm2835_create;
-+ }
-+
-+ g_chip = chip;
-+ err = snd_bcm2835_new_pcm(chip);
-+ if (err < 0) {
-+ dev_err(&pdev->dev, "Failed to create new BCM2835 pcm device\n");
-+ goto out_bcm2835_new_pcm;
-+ }
-+
-+ err = snd_bcm2835_new_spdif_pcm(chip);
-+ if (err < 0) {
-+ dev_err(&pdev->dev, "Failed to create new BCM2835 spdif pcm device\n");
-+ goto out_bcm2835_new_spdif;
-+ }
-+
-+ err = snd_bcm2835_new_ctl(chip);
-+ if (err < 0) {
-+ dev_err(&pdev->dev, "Failed to create new BCM2835 ctl\n");
-+ goto out_bcm2835_new_ctl;
-+ }
-+
-+add_register_map:
-+ card = g_card;
-+ chip = g_chip;
-+
-+ BUG_ON(!(card && chip));
-+
-+ chip->avail_substreams |= (1 << dev);
-+ chip->pdev[dev] = pdev;
-+
-+ if (dev == 0) {
-+ err = snd_card_register(card);
-+ if (err < 0) {
-+ dev_err(&pdev->dev,
-+ "Failed to register bcm2835 ALSA card \n");
-+ goto out_card_register;
-+ }
-+ platform_set_drvdata(pdev, card);
-+ audio_info("bcm2835 ALSA card created!\n");
-+ } else {
-+ audio_info("bcm2835 ALSA chip created!\n");
-+ platform_set_drvdata(pdev, (void *)dev);
-+ }
-+
-+ dev++;
-+
-+ return 0;
-+
-+out_card_register:
-+out_bcm2835_new_ctl:
-+out_bcm2835_new_spdif:
-+out_bcm2835_new_pcm:
-+out_bcm2835_create:
-+ BUG_ON(!g_card);
-+ if (snd_card_free(g_card))
-+ dev_err(&pdev->dev, "Failed to free Registered alsa card\n");
-+ g_card = NULL;
-+out:
-+ dev = SNDRV_CARDS; /* stop more avail_substreams from being probed */
-+ dev_err(&pdev->dev, "BCM2835 ALSA Probe failed !!\n");
-+ return err;
-+}
-+
-+static int snd_bcm2835_alsa_remove(struct platform_device *pdev)
-+{
-+ uint32_t idx;
-+ void *drv_data;
-+
-+ drv_data = platform_get_drvdata(pdev);
-+
-+ if (drv_data == (void *)g_card) {
-+ /* This is the card device */
-+ snd_card_free((struct snd_card *)drv_data);
-+ g_card = NULL;
-+ g_chip = NULL;
-+ } else {
-+ idx = (uint32_t) drv_data;
-+ if (g_card != NULL) {
-+ BUG_ON(!g_chip);
-+ /* We pass chip device numbers in audio ipc devices
-+ * other than the one we registered our card with
-+ */
-+ idx = (uint32_t) drv_data;
-+ BUG_ON(!idx || idx > MAX_SUBSTREAMS);
-+ g_chip->avail_substreams &= ~(1 << idx);
-+ /* There should be atleast one substream registered
-+ * after we are done here, as it wil be removed when
-+ * the *remove* is called for the card device
-+ */
-+ BUG_ON(!g_chip->avail_substreams);
-+ }
-+ }
-+
-+ platform_set_drvdata(pdev, NULL);
-+
-+ return 0;
-+}
-+
-+#ifdef CONFIG_PM
-+static int snd_bcm2835_alsa_suspend(struct platform_device *pdev,
-+ pm_message_t state)
-+{
-+ return 0;
-+}
-+
-+static int snd_bcm2835_alsa_resume(struct platform_device *pdev)
-+{
-+ return 0;
-+}
-+
-+#endif
-+
-+static const struct of_device_id snd_bcm2835_of_match_table[] = {
-+ { .compatible = "brcm,bcm2835-audio", },
-+ {},
-+};
-+MODULE_DEVICE_TABLE(of, snd_bcm2835_of_match_table);
-+
-+static struct platform_driver bcm2835_alsa0_driver = {
-+ .probe = snd_bcm2835_alsa_probe,
-+ .remove = snd_bcm2835_alsa_remove,
-+#ifdef CONFIG_PM
-+ .suspend = snd_bcm2835_alsa_suspend,
-+ .resume = snd_bcm2835_alsa_resume,
-+#endif
-+ .driver = {
-+ .name = "bcm2835_AUD0",
-+ .owner = THIS_MODULE,
-+ .of_match_table = snd_bcm2835_of_match_table,
-+ },
-+};
-+
-+static struct platform_driver bcm2835_alsa1_driver = {
-+ .probe = snd_bcm2835_alsa_probe,
-+ .remove = snd_bcm2835_alsa_remove,
-+#ifdef CONFIG_PM
-+ .suspend = snd_bcm2835_alsa_suspend,
-+ .resume = snd_bcm2835_alsa_resume,
-+#endif
-+ .driver = {
-+ .name = "bcm2835_AUD1",
-+ .owner = THIS_MODULE,
-+ },
-+};
-+
-+static struct platform_driver bcm2835_alsa2_driver = {
-+ .probe = snd_bcm2835_alsa_probe,
-+ .remove = snd_bcm2835_alsa_remove,
-+#ifdef CONFIG_PM
-+ .suspend = snd_bcm2835_alsa_suspend,
-+ .resume = snd_bcm2835_alsa_resume,
-+#endif
-+ .driver = {
-+ .name = "bcm2835_AUD2",
-+ .owner = THIS_MODULE,
-+ },
-+};
-+
-+static struct platform_driver bcm2835_alsa3_driver = {
-+ .probe = snd_bcm2835_alsa_probe,
-+ .remove = snd_bcm2835_alsa_remove,
-+#ifdef CONFIG_PM
-+ .suspend = snd_bcm2835_alsa_suspend,
-+ .resume = snd_bcm2835_alsa_resume,
-+#endif
-+ .driver = {
-+ .name = "bcm2835_AUD3",
-+ .owner = THIS_MODULE,
-+ },
-+};
-+
-+static struct platform_driver bcm2835_alsa4_driver = {
-+ .probe = snd_bcm2835_alsa_probe,
-+ .remove = snd_bcm2835_alsa_remove,
-+#ifdef CONFIG_PM
-+ .suspend = snd_bcm2835_alsa_suspend,
-+ .resume = snd_bcm2835_alsa_resume,
-+#endif
-+ .driver = {
-+ .name = "bcm2835_AUD4",
-+ .owner = THIS_MODULE,
-+ },
-+};
-+
-+static struct platform_driver bcm2835_alsa5_driver = {
-+ .probe = snd_bcm2835_alsa_probe,
-+ .remove = snd_bcm2835_alsa_remove,
-+#ifdef CONFIG_PM
-+ .suspend = snd_bcm2835_alsa_suspend,
-+ .resume = snd_bcm2835_alsa_resume,
-+#endif
-+ .driver = {
-+ .name = "bcm2835_AUD5",
-+ .owner = THIS_MODULE,
-+ },
-+};
-+
-+static struct platform_driver bcm2835_alsa6_driver = {
-+ .probe = snd_bcm2835_alsa_probe,
-+ .remove = snd_bcm2835_alsa_remove,
-+#ifdef CONFIG_PM
-+ .suspend = snd_bcm2835_alsa_suspend,
-+ .resume = snd_bcm2835_alsa_resume,
-+#endif
-+ .driver = {
-+ .name = "bcm2835_AUD6",
-+ .owner = THIS_MODULE,
-+ },
-+};
-+
-+static struct platform_driver bcm2835_alsa7_driver = {
-+ .probe = snd_bcm2835_alsa_probe,
-+ .remove = snd_bcm2835_alsa_remove,
-+#ifdef CONFIG_PM
-+ .suspend = snd_bcm2835_alsa_suspend,
-+ .resume = snd_bcm2835_alsa_resume,
-+#endif
-+ .driver = {
-+ .name = "bcm2835_AUD7",
-+ .owner = THIS_MODULE,
-+ },
-+};
-+
-+static int bcm2835_alsa_device_init(void)
-+{
-+ int err;
-+ err = platform_driver_register(&bcm2835_alsa0_driver);
-+ if (err) {
-+ pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
-+ goto out;
-+ }
-+
-+ err = platform_driver_register(&bcm2835_alsa1_driver);
-+ if (err) {
-+ pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
-+ goto unregister_0;
-+ }
-+
-+ err = platform_driver_register(&bcm2835_alsa2_driver);
-+ if (err) {
-+ pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
-+ goto unregister_1;
-+ }
-+
-+ err = platform_driver_register(&bcm2835_alsa3_driver);
-+ if (err) {
-+ pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
-+ goto unregister_2;
-+ }
-+
-+ err = platform_driver_register(&bcm2835_alsa4_driver);
-+ if (err) {
-+ pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
-+ goto unregister_3;
-+ }
-+
-+ err = platform_driver_register(&bcm2835_alsa5_driver);
-+ if (err) {
-+ pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
-+ goto unregister_4;
-+ }
-+
-+ err = platform_driver_register(&bcm2835_alsa6_driver);
-+ if (err) {
-+ pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
-+ goto unregister_5;
-+ }
-+
-+ err = platform_driver_register(&bcm2835_alsa7_driver);
-+ if (err) {
-+ pr_err("Error registering bcm2835_alsa0_driver %d .\n", err);
-+ goto unregister_6;
-+ }
-+
-+ return 0;
-+
-+unregister_6:
-+ platform_driver_unregister(&bcm2835_alsa6_driver);
-+unregister_5:
-+ platform_driver_unregister(&bcm2835_alsa5_driver);
-+unregister_4:
-+ platform_driver_unregister(&bcm2835_alsa4_driver);
-+unregister_3:
-+ platform_driver_unregister(&bcm2835_alsa3_driver);
-+unregister_2:
-+ platform_driver_unregister(&bcm2835_alsa2_driver);
-+unregister_1:
-+ platform_driver_unregister(&bcm2835_alsa1_driver);
-+unregister_0:
-+ platform_driver_unregister(&bcm2835_alsa0_driver);
-+out:
-+ return err;
-+}
-+
-+static void bcm2835_alsa_device_exit(void)
-+{
-+ platform_driver_unregister(&bcm2835_alsa0_driver);
-+ platform_driver_unregister(&bcm2835_alsa1_driver);
-+ platform_driver_unregister(&bcm2835_alsa2_driver);
-+ platform_driver_unregister(&bcm2835_alsa3_driver);
-+ platform_driver_unregister(&bcm2835_alsa4_driver);
-+ platform_driver_unregister(&bcm2835_alsa5_driver);
-+ platform_driver_unregister(&bcm2835_alsa6_driver);
-+ platform_driver_unregister(&bcm2835_alsa7_driver);
-+}
-+
-+late_initcall(bcm2835_alsa_device_init);
-+module_exit(bcm2835_alsa_device_exit);
-+
-+MODULE_AUTHOR("Dom Cobley");
-+MODULE_DESCRIPTION("Alsa driver for BCM2835 chip");
-+MODULE_LICENSE("GPL");
-+MODULE_ALIAS("platform:bcm2835_alsa");
-diff -Nur linux-4.1.6/sound/arm/bcm2835.h linux-rpi/sound/arm/bcm2835.h
---- linux-4.1.6/sound/arm/bcm2835.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/sound/arm/bcm2835.h 2015-08-26 10:26:13.285378727 +0200
-@@ -0,0 +1,167 @@
-+/*****************************************************************************
-+* Copyright 2011 Broadcom Corporation. All rights reserved.
-+*
-+* Unless you and Broadcom execute a separate written software license
-+* agreement governing use of this software, this software is licensed to you
-+* under the terms of the GNU General Public License version 2, available at
-+* http://www.broadcom.com/licenses/GPLv2.php (the "GPL").
-+*
-+* Notwithstanding the above, under no circumstances may you combine this
-+* software in any way with any other Broadcom software provided under a
-+* license other than the GPL, without Broadcom's express prior written
-+* consent.
-+*****************************************************************************/
-+
-+#ifndef __SOUND_ARM_BCM2835_H
-+#define __SOUND_ARM_BCM2835_H
-+
-+#include <linux/device.h>
-+#include <linux/list.h>
-+#include <linux/interrupt.h>
-+#include <linux/wait.h>
-+#include <sound/core.h>
-+#include <sound/initval.h>
-+#include <sound/pcm.h>
-+#include <sound/pcm_params.h>
-+#include <sound/pcm-indirect.h>
-+#include <linux/workqueue.h>
-+
-+/*
-+#define AUDIO_DEBUG_ENABLE
-+#define AUDIO_VERBOSE_DEBUG_ENABLE
-+*/
-+
-+/* Debug macros */
-+
-+#ifdef AUDIO_DEBUG_ENABLE
-+#ifdef AUDIO_VERBOSE_DEBUG_ENABLE
-+
-+#define audio_debug(fmt, arg...) \
-+ printk(KERN_INFO"%s:%d " fmt, __func__, __LINE__, ##arg)
-+
-+#define audio_info(fmt, arg...) \
-+ printk(KERN_INFO"%s:%d " fmt, __func__, __LINE__, ##arg)
-+
-+#else
-+
-+#define audio_debug(fmt, arg...)
-+
-+#define audio_info(fmt, arg...)
-+
-+#endif /* AUDIO_VERBOSE_DEBUG_ENABLE */
-+
-+#else
-+
-+#define audio_debug(fmt, arg...)
-+
-+#define audio_info(fmt, arg...)
-+
-+#endif /* AUDIO_DEBUG_ENABLE */
-+
-+#define audio_error(fmt, arg...) \
-+ printk(KERN_ERR"%s:%d " fmt, __func__, __LINE__, ##arg)
-+
-+#define audio_warning(fmt, arg...) \
-+ printk(KERN_WARNING"%s:%d " fmt, __func__, __LINE__, ##arg)
-+
-+#define audio_alert(fmt, arg...) \
-+ printk(KERN_ALERT"%s:%d " fmt, __func__, __LINE__, ##arg)
-+
-+#define MAX_SUBSTREAMS (8)
-+#define AVAIL_SUBSTREAMS_MASK (0xff)
-+enum {
-+ CTRL_VOL_MUTE,
-+ CTRL_VOL_UNMUTE
-+};
-+
-+/* macros for alsa2chip and chip2alsa, instead of functions */
-+
-+#define alsa2chip(vol) (uint)(-((vol << 8) / 100)) /* convert alsa to chip volume (defined as macro rather than function call) */
-+#define chip2alsa(vol) -((vol * 100) >> 8) /* convert chip to alsa volume */
-+
-+/* Some constants for values .. */
-+typedef enum {
-+ AUDIO_DEST_AUTO = 0,
-+ AUDIO_DEST_HEADPHONES = 1,
-+ AUDIO_DEST_HDMI = 2,
-+ AUDIO_DEST_MAX,
-+} SND_BCM2835_ROUTE_T;
-+
-+typedef enum {
-+ PCM_PLAYBACK_VOLUME,
-+ PCM_PLAYBACK_MUTE,
-+ PCM_PLAYBACK_DEVICE,
-+} SND_BCM2835_CTRL_T;
-+
-+/* definition of the chip-specific record */
-+typedef struct bcm2835_chip {
-+ struct snd_card *card;
-+ struct snd_pcm *pcm;
-+ struct snd_pcm *pcm_spdif;
-+ /* Bitmat for valid reg_base and irq numbers */
-+ uint32_t avail_substreams;
-+ struct platform_device *pdev[MAX_SUBSTREAMS];
-+ struct bcm2835_alsa_stream *alsa_stream[MAX_SUBSTREAMS];
-+
-+ int volume;
-+ int old_volume; /* stores the volume value whist muted */
-+ int dest;
-+ int mute;
-+
-+ unsigned int opened;
-+ unsigned int spdif_status;
-+ struct mutex audio_mutex;
-+} bcm2835_chip_t;
-+
-+typedef struct bcm2835_alsa_stream {
-+ bcm2835_chip_t *chip;
-+ struct snd_pcm_substream *substream;
-+ struct snd_pcm_indirect pcm_indirect;
-+
-+ struct semaphore buffers_update_sem;
-+ struct semaphore control_sem;
-+ spinlock_t lock;
-+ volatile uint32_t control;
-+ volatile uint32_t status;
-+
-+ int open;
-+ int running;
-+ int draining;
-+
-+ int channels;
-+ int params_rate;
-+ int pcm_format_width;
-+
-+ unsigned int pos;
-+ unsigned int buffer_size;
-+ unsigned int period_size;
-+
-+ uint32_t enable_fifo_irq;
-+ irq_handler_t fifo_irq_handler;
-+
-+ atomic_t retrieved;
-+ struct opaque_AUDIO_INSTANCE_T *instance;
-+ struct workqueue_struct *my_wq;
-+ int idx;
-+} bcm2835_alsa_stream_t;
+diff -Nur linux-4.1.10/sound/arm/Kconfig linux-rpi/sound/arm/Kconfig
+--- linux-4.1.10/sound/arm/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/sound/arm/Kconfig 2015-10-07 16:41:13.000000000 +0200
+@@ -39,5 +39,13 @@
+ Say Y or M if you want to support any AC97 codec attached to
+ the PXA2xx AC97 interface.
+
++config SND_BCM2835
++ tristate "BCM2835 ALSA driver"
++ depends on (ARCH_BCM2708 || ARCH_BCM2709 || ARCH_BCM2835) \
++ && BCM2708_VCHIQ && SND
++ select SND_PCM
++ help
++ Say Y or M if you want to support BCM2835 Alsa pcm card driver
+
-+int snd_bcm2835_new_ctl(bcm2835_chip_t * chip);
-+int snd_bcm2835_new_pcm(bcm2835_chip_t * chip);
-+int snd_bcm2835_new_spdif_pcm(bcm2835_chip_t * chip);
+ endif # SND_ARM
+
+diff -Nur linux-4.1.10/sound/arm/Makefile linux-rpi/sound/arm/Makefile
+--- linux-4.1.10/sound/arm/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/sound/arm/Makefile 2015-10-07 16:41:13.000000000 +0200
+@@ -14,3 +14,8 @@
+
+ obj-$(CONFIG_SND_PXA2XX_AC97) += snd-pxa2xx-ac97.o
+ snd-pxa2xx-ac97-objs := pxa2xx-ac97.o
+
-+int bcm2835_audio_open(bcm2835_alsa_stream_t * alsa_stream);
-+int bcm2835_audio_close(bcm2835_alsa_stream_t * alsa_stream);
-+int bcm2835_audio_set_params(bcm2835_alsa_stream_t * alsa_stream,
-+ uint32_t channels, uint32_t samplerate,
-+ uint32_t bps);
-+int bcm2835_audio_setup(bcm2835_alsa_stream_t * alsa_stream);
-+int bcm2835_audio_start(bcm2835_alsa_stream_t * alsa_stream);
-+int bcm2835_audio_stop(bcm2835_alsa_stream_t * alsa_stream);
-+int bcm2835_audio_set_ctls(bcm2835_chip_t * chip);
-+int bcm2835_audio_write(bcm2835_alsa_stream_t * alsa_stream, uint32_t count,
-+ void *src);
-+uint32_t bcm2835_audio_retrieve_buffers(bcm2835_alsa_stream_t * alsa_stream);
-+void bcm2835_audio_flush_buffers(bcm2835_alsa_stream_t * alsa_stream);
-+void bcm2835_audio_flush_playback_buffers(bcm2835_alsa_stream_t * alsa_stream);
++obj-$(CONFIG_SND_BCM2835) += snd-bcm2835.o
++snd-bcm2835-objs := bcm2835.o bcm2835-ctl.o bcm2835-pcm.o bcm2835-vchiq.o
+
-+#endif /* __SOUND_ARM_BCM2835_H */
-diff -Nur linux-4.1.6/sound/arm/vc_vchi_audioserv_defs.h linux-rpi/sound/arm/vc_vchi_audioserv_defs.h
---- linux-4.1.6/sound/arm/vc_vchi_audioserv_defs.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/sound/arm/vc_vchi_audioserv_defs.h 2015-08-26 10:26:13.285378727 +0200
++ccflags-y += -Idrivers/misc/vc04_services -Idrivers/misc/vc04_services/interface/vcos/linuxkernel -D__VCCOREVER__=0x04000000
+diff -Nur linux-4.1.10/sound/arm/vc_vchi_audioserv_defs.h linux-rpi/sound/arm/vc_vchi_audioserv_defs.h
+--- linux-4.1.10/sound/arm/vc_vchi_audioserv_defs.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/sound/arm/vc_vchi_audioserv_defs.h 2015-10-07 16:41:13.000000000 +0200
@@ -0,0 +1,116 @@
+/*****************************************************************************
+* Copyright 2011 Broadcom Corporation. All rights reserved.
@@ -308001,104 +310878,9 @@ diff -Nur linux-4.1.6/sound/arm/vc_vchi_audioserv_defs.h linux-rpi/sound/arm/vc_
+} VC_AUDIO_MSG_T;
+
+#endif // _VC_AUDIO_DEFS_H_
-diff -Nur linux-4.1.6/sound/soc/bcm/Kconfig linux-rpi/sound/soc/bcm/Kconfig
---- linux-4.1.6/sound/soc/bcm/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/sound/soc/bcm/Kconfig 2015-08-26 10:26:13.365379818 +0200
-@@ -7,3 +7,63 @@
- Say Y or M if you want to add support for codecs attached to
- the BCM2835 I2S interface. You will also need
- to select the audio interfaces to support below.
-+
-+config SND_BCM2708_SOC_I2S
-+ tristate "SoC Audio support for the Broadcom BCM2708 I2S module"
-+ depends on MACH_BCM2708 || MACH_BCM2709
-+ select REGMAP_MMIO
-+ select SND_SOC_DMAENGINE_PCM
-+ select SND_SOC_GENERIC_DMAENGINE_PCM
-+ help
-+ Say Y or M if you want to add support for codecs attached to
-+ the BCM2708 I2S interface. You will also need
-+ to select the audio interfaces to support below.
-+
-+config SND_BCM2708_SOC_HIFIBERRY_DAC
-+ tristate "Support for HifiBerry DAC"
-+ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S
-+ select SND_SOC_PCM5102A
-+ help
-+ Say Y or M if you want to add support for HifiBerry DAC.
-+
-+config SND_BCM2708_SOC_HIFIBERRY_DACPLUS
-+ tristate "Support for HifiBerry DAC+"
-+ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S
-+ select SND_SOC_PCM512x
-+ help
-+ Say Y or M if you want to add support for HifiBerry DAC+.
-+
-+config SND_BCM2708_SOC_HIFIBERRY_DIGI
-+ tristate "Support for HifiBerry Digi"
-+ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S
-+ select SND_SOC_WM8804
-+ help
-+ Say Y or M if you want to add support for HifiBerry Digi S/PDIF output board.
-+
-+config SND_BCM2708_SOC_HIFIBERRY_AMP
-+ tristate "Support for the HifiBerry Amp"
-+ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S
-+ select SND_SOC_TAS5713
-+ help
-+ Say Y or M if you want to add support for the HifiBerry Amp amplifier board.
-+
-+config SND_BCM2708_SOC_RPI_DAC
-+ tristate "Support for RPi-DAC"
-+ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S
-+ select SND_SOC_PCM1794A
-+ help
-+ Say Y or M if you want to add support for RPi-DAC.
-+
-+config SND_BCM2708_SOC_RPI_PROTO
-+ tristate "Support for Rpi-PROTO"
-+ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S
-+ select SND_SOC_WM8731
-+ help
-+ Say Y or M if you want to add support for Audio Codec Board PROTO (WM8731).
-+
-+config SND_BCM2708_SOC_IQAUDIO_DAC
-+ tristate "Support for IQaudIO-DAC"
-+ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S
-+ select SND_SOC_PCM512x_I2C
-+ help
-+ Say Y or M if you want to add support for IQaudIO-DAC.
-diff -Nur linux-4.1.6/sound/soc/bcm/Makefile linux-rpi/sound/soc/bcm/Makefile
---- linux-4.1.6/sound/soc/bcm/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/sound/soc/bcm/Makefile 2015-08-26 10:26:13.365379818 +0200
-@@ -3,3 +3,24 @@
-
- obj-$(CONFIG_SND_BCM2835_SOC_I2S) += snd-soc-bcm2835-i2s.o
-
-+# BCM2708 Platform Support
-+snd-soc-bcm2708-i2s-objs := bcm2708-i2s.o
-+
-+obj-$(CONFIG_SND_BCM2708_SOC_I2S) += snd-soc-bcm2708-i2s.o
-+
-+# BCM2708 Machine Support
-+snd-soc-hifiberry-dac-objs := hifiberry_dac.o
-+snd-soc-hifiberry-dacplus-objs := hifiberry_dacplus.o
-+snd-soc-hifiberry-digi-objs := hifiberry_digi.o
-+snd-soc-hifiberry-amp-objs := hifiberry_amp.o
-+snd-soc-rpi-dac-objs := rpi-dac.o
-+snd-soc-rpi-proto-objs := rpi-proto.o
-+snd-soc-iqaudio-dac-objs := iqaudio-dac.o
-+
-+obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC) += snd-soc-hifiberry-dac.o
-+obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS) += snd-soc-hifiberry-dacplus.o
-+obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI) += snd-soc-hifiberry-digi.o
-+obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP) += snd-soc-hifiberry-amp.o
-+obj-$(CONFIG_SND_BCM2708_SOC_RPI_DAC) += snd-soc-rpi-dac.o
-+obj-$(CONFIG_SND_BCM2708_SOC_RPI_PROTO) += snd-soc-rpi-proto.o
-+obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC) += snd-soc-iqaudio-dac.o
-diff -Nur linux-4.1.6/sound/soc/bcm/bcm2708-i2s.c linux-rpi/sound/soc/bcm/bcm2708-i2s.c
---- linux-4.1.6/sound/soc/bcm/bcm2708-i2s.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/sound/soc/bcm/bcm2708-i2s.c 2015-08-26 10:26:13.365379818 +0200
+diff -Nur linux-4.1.10/sound/soc/bcm/bcm2708-i2s.c linux-rpi/sound/soc/bcm/bcm2708-i2s.c
+--- linux-4.1.10/sound/soc/bcm/bcm2708-i2s.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/sound/soc/bcm/bcm2708-i2s.c 2015-10-07 16:41:15.000000000 +0200
@@ -0,0 +1,1014 @@
+/*
+ * ALSA SoC I2S Audio Layer for Broadcom BCM2708 SoC
@@ -309114,9 +311896,9 @@ diff -Nur linux-4.1.6/sound/soc/bcm/bcm2708-i2s.c linux-rpi/sound/soc/bcm/bcm270
+MODULE_DESCRIPTION("BCM2708 I2S interface");
+MODULE_AUTHOR("Florian Meier <florian.meier@koalo.de>");
+MODULE_LICENSE("GPL v2");
-diff -Nur linux-4.1.6/sound/soc/bcm/bcm2708-i2s.h linux-rpi/sound/soc/bcm/bcm2708-i2s.h
---- linux-4.1.6/sound/soc/bcm/bcm2708-i2s.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/sound/soc/bcm/bcm2708-i2s.h 2015-08-26 10:26:13.365379818 +0200
+diff -Nur linux-4.1.10/sound/soc/bcm/bcm2708-i2s.h linux-rpi/sound/soc/bcm/bcm2708-i2s.h
+--- linux-4.1.10/sound/soc/bcm/bcm2708-i2s.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/sound/soc/bcm/bcm2708-i2s.h 2015-10-07 16:41:15.000000000 +0200
@@ -0,0 +1,35 @@
+/*
+ * I2S configuration for sound cards.
@@ -309153,9 +311935,9 @@ diff -Nur linux-4.1.6/sound/soc/bcm/bcm2708-i2s.h linux-rpi/sound/soc/bcm/bcm270
+extern void bcm2708_i2s_set_gpio(int gpio);
+
+#endif
-diff -Nur linux-4.1.6/sound/soc/bcm/bcm2835-i2s.c linux-rpi/sound/soc/bcm/bcm2835-i2s.c
---- linux-4.1.6/sound/soc/bcm/bcm2835-i2s.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/sound/soc/bcm/bcm2835-i2s.c 2015-08-26 10:26:13.365379818 +0200
+diff -Nur linux-4.1.10/sound/soc/bcm/bcm2835-i2s.c linux-rpi/sound/soc/bcm/bcm2835-i2s.c
+--- linux-4.1.10/sound/soc/bcm/bcm2835-i2s.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/sound/soc/bcm/bcm2835-i2s.c 2015-10-07 16:41:15.000000000 +0200
@@ -861,6 +861,7 @@
{ .compatible = "brcm,bcm2835-i2s", },
{},
@@ -309164,9 +311946,9 @@ diff -Nur linux-4.1.6/sound/soc/bcm/bcm2835-i2s.c linux-rpi/sound/soc/bcm/bcm283
static struct platform_driver bcm2835_i2s_driver = {
.probe = bcm2835_i2s_probe,
-diff -Nur linux-4.1.6/sound/soc/bcm/hifiberry_amp.c linux-rpi/sound/soc/bcm/hifiberry_amp.c
---- linux-4.1.6/sound/soc/bcm/hifiberry_amp.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/sound/soc/bcm/hifiberry_amp.c 2015-08-26 10:26:13.365379818 +0200
+diff -Nur linux-4.1.10/sound/soc/bcm/hifiberry_amp.c linux-rpi/sound/soc/bcm/hifiberry_amp.c
+--- linux-4.1.10/sound/soc/bcm/hifiberry_amp.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/sound/soc/bcm/hifiberry_amp.c 2015-10-07 16:41:15.000000000 +0200
@@ -0,0 +1,127 @@
+/*
+ * ASoC Driver for HifiBerry AMP
@@ -309295,9 +312077,9 @@ diff -Nur linux-4.1.6/sound/soc/bcm/hifiberry_amp.c linux-rpi/sound/soc/bcm/hifi
+MODULE_AUTHOR("Sebastian Eickhoff <basti.eickhoff@googlemail.com>");
+MODULE_DESCRIPTION("ASoC driver for HiFiBerry-AMP");
+MODULE_LICENSE("GPL v2");
-diff -Nur linux-4.1.6/sound/soc/bcm/hifiberry_dac.c linux-rpi/sound/soc/bcm/hifiberry_dac.c
---- linux-4.1.6/sound/soc/bcm/hifiberry_dac.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/sound/soc/bcm/hifiberry_dac.c 2015-08-26 10:26:13.365379818 +0200
+diff -Nur linux-4.1.10/sound/soc/bcm/hifiberry_dac.c linux-rpi/sound/soc/bcm/hifiberry_dac.c
+--- linux-4.1.10/sound/soc/bcm/hifiberry_dac.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/sound/soc/bcm/hifiberry_dac.c 2015-10-07 16:41:15.000000000 +0200
@@ -0,0 +1,122 @@
+/*
+ * ASoC Driver for HifiBerry DAC
@@ -309421,15 +312203,15 @@ diff -Nur linux-4.1.6/sound/soc/bcm/hifiberry_dac.c linux-rpi/sound/soc/bcm/hifi
+MODULE_AUTHOR("Florian Meier <florian.meier@koalo.de>");
+MODULE_DESCRIPTION("ASoC Driver for HifiBerry DAC");
+MODULE_LICENSE("GPL v2");
-diff -Nur linux-4.1.6/sound/soc/bcm/hifiberry_dacplus.c linux-rpi/sound/soc/bcm/hifiberry_dacplus.c
---- linux-4.1.6/sound/soc/bcm/hifiberry_dacplus.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/sound/soc/bcm/hifiberry_dacplus.c 2015-08-26 10:26:13.365379818 +0200
-@@ -0,0 +1,141 @@
+diff -Nur linux-4.1.10/sound/soc/bcm/hifiberry_dacplus.c linux-rpi/sound/soc/bcm/hifiberry_dacplus.c
+--- linux-4.1.10/sound/soc/bcm/hifiberry_dacplus.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/sound/soc/bcm/hifiberry_dacplus.c 2015-10-07 16:41:15.000000000 +0200
+@@ -0,0 +1,337 @@
+/*
-+ * ASoC Driver for HiFiBerry DAC+
++ * ASoC Driver for HiFiBerry DAC+ / DAC Pro
+ *
-+ * Author: Daniel Matuschek
-+ * Copyright 2014
++ * Author: Daniel Matuschek, Stuart MacLean <stuart@hifiberry.com>
++ * Copyright 2014-2015
+ * based on code by Florian Meier <florian.meier@koalo.de>
+ *
+ * This program is free software; you can redistribute it and/or
@@ -309444,6 +312226,13 @@ diff -Nur linux-4.1.6/sound/soc/bcm/hifiberry_dacplus.c linux-rpi/sound/soc/bcm/
+
+#include <linux/module.h>
+#include <linux/platform_device.h>
++#include <linux/kernel.h>
++#include <linux/clk.h>
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/of.h>
++#include <linux/slab.h>
++#include <linux/delay.h>
+
+#include <sound/core.h>
+#include <sound/pcm.h>
@@ -309453,34 +312242,222 @@ diff -Nur linux-4.1.6/sound/soc/bcm/hifiberry_dacplus.c linux-rpi/sound/soc/bcm/
+
+#include "../codecs/pcm512x.h"
+
++#define HIFIBERRY_DACPRO_NOCLOCK 0
++#define HIFIBERRY_DACPRO_CLK44EN 1
++#define HIFIBERRY_DACPRO_CLK48EN 2
++
++struct pcm512x_priv {
++ struct regmap *regmap;
++ struct clk *sclk;
++};
++
++/* Clock rate of CLK44EN attached to GPIO6 pin */
++#define CLK_44EN_RATE 22579200UL
++/* Clock rate of CLK48EN attached to GPIO3 pin */
++#define CLK_48EN_RATE 24576000UL
++
++static bool snd_rpi_hifiberry_is_dacpro;
++
++static void snd_rpi_hifiberry_dacplus_select_clk(struct snd_soc_codec *codec,
++ int clk_id)
++{
++ switch (clk_id) {
++ case HIFIBERRY_DACPRO_NOCLOCK:
++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x24, 0x00);
++ break;
++ case HIFIBERRY_DACPRO_CLK44EN:
++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x24, 0x20);
++ break;
++ case HIFIBERRY_DACPRO_CLK48EN:
++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x24, 0x04);
++ break;
++ }
++}
++
++static void snd_rpi_hifiberry_dacplus_clk_gpio(struct snd_soc_codec *codec)
++{
++ snd_soc_update_bits(codec, PCM512x_GPIO_EN, 0x24, 0x24);
++ snd_soc_update_bits(codec, PCM512x_GPIO_OUTPUT_3, 0x0f, 0x02);
++ snd_soc_update_bits(codec, PCM512x_GPIO_OUTPUT_6, 0x0f, 0x02);
++}
++
++static bool snd_rpi_hifiberry_dacplus_is_sclk(struct snd_soc_codec *codec)
++{
++ int sck;
++
++ sck = snd_soc_read(codec, PCM512x_RATE_DET_4);
++ return (!(sck & 0x40));
++}
++
++static bool snd_rpi_hifiberry_dacplus_is_sclk_sleep(
++ struct snd_soc_codec *codec)
++{
++ msleep(2);
++ return snd_rpi_hifiberry_dacplus_is_sclk(codec);
++}
++
++static bool snd_rpi_hifiberry_dacplus_is_pro_card(struct snd_soc_codec *codec)
++{
++ bool isClk44EN, isClk48En, isNoClk;
++
++ snd_rpi_hifiberry_dacplus_clk_gpio(codec);
++
++ snd_rpi_hifiberry_dacplus_select_clk(codec, HIFIBERRY_DACPRO_CLK44EN);
++ isClk44EN = snd_rpi_hifiberry_dacplus_is_sclk_sleep(codec);
++
++ snd_rpi_hifiberry_dacplus_select_clk(codec, HIFIBERRY_DACPRO_NOCLOCK);
++ isNoClk = snd_rpi_hifiberry_dacplus_is_sclk_sleep(codec);
++
++ snd_rpi_hifiberry_dacplus_select_clk(codec, HIFIBERRY_DACPRO_CLK48EN);
++ isClk48En = snd_rpi_hifiberry_dacplus_is_sclk_sleep(codec);
++
++ return (isClk44EN && isClk48En && !isNoClk);
++}
++
++static int snd_rpi_hifiberry_dacplus_clk_for_rate(int sample_rate)
++{
++ int type;
++
++ switch (sample_rate) {
++ case 11025:
++ case 22050:
++ case 44100:
++ case 88200:
++ case 176400:
++ type = HIFIBERRY_DACPRO_CLK44EN;
++ break;
++ default:
++ type = HIFIBERRY_DACPRO_CLK48EN;
++ break;
++ }
++ return type;
++}
++
++static void snd_rpi_hifiberry_dacplus_set_sclk(struct snd_soc_codec *codec,
++ int sample_rate)
++{
++ struct pcm512x_priv *pcm512x = snd_soc_codec_get_drvdata(codec);
++
++ if (!IS_ERR(pcm512x->sclk)) {
++ int ctype;
++
++ ctype = snd_rpi_hifiberry_dacplus_clk_for_rate(sample_rate);
++ clk_set_rate(pcm512x->sclk, (ctype == HIFIBERRY_DACPRO_CLK44EN)
++ ? CLK_44EN_RATE : CLK_48EN_RATE);
++ snd_rpi_hifiberry_dacplus_select_clk(codec, ctype);
++ }
++}
++
+static int snd_rpi_hifiberry_dacplus_init(struct snd_soc_pcm_runtime *rtd)
+{
+ struct snd_soc_codec *codec = rtd->codec;
++ struct pcm512x_priv *priv;
++
++ snd_rpi_hifiberry_is_dacpro
++ = snd_rpi_hifiberry_dacplus_is_pro_card(codec);
++
++ if (snd_rpi_hifiberry_is_dacpro) {
++ struct snd_soc_dai_link *dai = rtd->dai_link;
++
++ dai->name = "HiFiBerry DAC+ Pro";
++ dai->stream_name = "HiFiBerry DAC+ Pro HiFi";
++ dai->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
++ | SND_SOC_DAIFMT_CBM_CFM;
++
++ snd_soc_update_bits(codec, PCM512x_BCLK_LRCLK_CFG, 0x31, 0x11);
++ snd_soc_update_bits(codec, PCM512x_MASTER_MODE, 0x03, 0x03);
++ snd_soc_update_bits(codec, PCM512x_MASTER_CLKDIV_2, 0x7f, 63);
++ } else {
++ priv = snd_soc_codec_get_drvdata(codec);
++ priv->sclk = ERR_PTR(-ENOENT);
++ }
++
+ snd_soc_update_bits(codec, PCM512x_GPIO_EN, 0x08, 0x08);
-+ snd_soc_update_bits(codec, PCM512x_GPIO_OUTPUT_4, 0xf, 0x02);
-+ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x08);
++ snd_soc_update_bits(codec, PCM512x_GPIO_OUTPUT_4, 0x0f, 0x02);
++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08, 0x08);
++
+ return 0;
+}
+
-+static int snd_rpi_hifiberry_dacplus_hw_params(struct snd_pcm_substream *substream,
-+ struct snd_pcm_hw_params *params)
++static int snd_rpi_hifiberry_dacplus_update_rate_den(
++ struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
++ struct snd_soc_codec *codec = rtd->codec;
++ struct pcm512x_priv *pcm512x = snd_soc_codec_get_drvdata(codec);
++ struct snd_ratnum *rats_no_pll;
++ unsigned int num = 0, den = 0;
++ int err;
++
++ rats_no_pll = devm_kzalloc(rtd->dev, sizeof(*rats_no_pll), GFP_KERNEL);
++ if (!rats_no_pll)
++ return -ENOMEM;
++
++ rats_no_pll->num = clk_get_rate(pcm512x->sclk) / 64;
++ rats_no_pll->den_min = 1;
++ rats_no_pll->den_max = 128;
++ rats_no_pll->den_step = 1;
++
++ err = snd_interval_ratnum(hw_param_interval(params,
++ SNDRV_PCM_HW_PARAM_RATE), 1, rats_no_pll, &num, &den);
++ if (err >= 0 && den) {
++ params->rate_num = num;
++ params->rate_den = den;
++ }
++
++ devm_kfree(rtd->dev, rats_no_pll);
++ return 0;
++}
++
++static int snd_rpi_hifiberry_dacplus_set_bclk_ratio_pro(
++ struct snd_soc_dai *cpu_dai, struct snd_pcm_hw_params *params)
++{
++ int bratio = snd_pcm_format_physical_width(params_format(params))
++ * params_channels(params);
++ return snd_soc_dai_set_bclk_ratio(cpu_dai, bratio);
++}
++
++static int snd_rpi_hifiberry_dacplus_hw_params(
++ struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params)
++{
++ int ret;
++ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-+ return snd_soc_dai_set_bclk_ratio(cpu_dai, 64);
++
++ if (snd_rpi_hifiberry_is_dacpro) {
++ struct snd_soc_codec *codec = rtd->codec;
++
++ snd_rpi_hifiberry_dacplus_set_sclk(codec,
++ params_rate(params));
++
++ ret = snd_rpi_hifiberry_dacplus_set_bclk_ratio_pro(cpu_dai,
++ params);
++ if (!ret)
++ ret = snd_rpi_hifiberry_dacplus_update_rate_den(
++ substream, params);
++ } else {
++ ret = snd_soc_dai_set_bclk_ratio(cpu_dai, 64);
++ }
++ return ret;
+}
+
-+static int snd_rpi_hifiberry_dacplus_startup(struct snd_pcm_substream *substream) {
++static int snd_rpi_hifiberry_dacplus_startup(
++ struct snd_pcm_substream *substream)
++{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_codec *codec = rtd->codec;
-+ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x08);
++
++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08, 0x08);
+ return 0;
+}
+
-+static void snd_rpi_hifiberry_dacplus_shutdown(struct snd_pcm_substream *substream) {
++static void snd_rpi_hifiberry_dacplus_shutdown(
++ struct snd_pcm_substream *substream)
++{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_codec *codec = rtd->codec;
-+ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x00);
++
++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08, 0x00);
+}
+
+/* machine stream operations */
@@ -309517,19 +312494,20 @@ diff -Nur linux-4.1.6/sound/soc/bcm/hifiberry_dacplus.c linux-rpi/sound/soc/bcm/
+ int ret = 0;
+
+ snd_rpi_hifiberry_dacplus.dev = &pdev->dev;
-+
+ if (pdev->dev.of_node) {
-+ struct device_node *i2s_node;
-+ struct snd_soc_dai_link *dai = &snd_rpi_hifiberry_dacplus_dai[0];
-+ i2s_node = of_parse_phandle(pdev->dev.of_node,
-+ "i2s-controller", 0);
++ struct device_node *i2s_node;
++ struct snd_soc_dai_link *dai;
+
-+ if (i2s_node) {
-+ dai->cpu_dai_name = NULL;
-+ dai->cpu_of_node = i2s_node;
-+ dai->platform_name = NULL;
-+ dai->platform_of_node = i2s_node;
-+ }
++ dai = &snd_rpi_hifiberry_dacplus_dai[0];
++ i2s_node = of_parse_phandle(pdev->dev.of_node,
++ "i2s-controller", 0);
++
++ if (i2s_node) {
++ dai->cpu_dai_name = NULL;
++ dai->cpu_of_node = i2s_node;
++ dai->platform_name = NULL;
++ dai->platform_of_node = i2s_node;
++ }
+ }
+
+ ret = snd_soc_register_card(&snd_rpi_hifiberry_dacplus);
@@ -309566,9 +312544,9 @@ diff -Nur linux-4.1.6/sound/soc/bcm/hifiberry_dacplus.c linux-rpi/sound/soc/bcm/
+MODULE_AUTHOR("Daniel Matuschek <daniel@hifiberry.com>");
+MODULE_DESCRIPTION("ASoC Driver for HiFiBerry DAC+");
+MODULE_LICENSE("GPL v2");
-diff -Nur linux-4.1.6/sound/soc/bcm/hifiberry_digi.c linux-rpi/sound/soc/bcm/hifiberry_digi.c
---- linux-4.1.6/sound/soc/bcm/hifiberry_digi.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/sound/soc/bcm/hifiberry_digi.c 2015-08-26 10:26:13.365379818 +0200
+diff -Nur linux-4.1.10/sound/soc/bcm/hifiberry_digi.c linux-rpi/sound/soc/bcm/hifiberry_digi.c
+--- linux-4.1.10/sound/soc/bcm/hifiberry_digi.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/sound/soc/bcm/hifiberry_digi.c 2015-10-07 16:41:15.000000000 +0200
@@ -0,0 +1,223 @@
+/*
+ * ASoC Driver for HifiBerry Digi
@@ -309793,9 +312771,9 @@ diff -Nur linux-4.1.6/sound/soc/bcm/hifiberry_digi.c linux-rpi/sound/soc/bcm/hif
+MODULE_AUTHOR("Daniel Matuschek <info@crazy-audio.com>");
+MODULE_DESCRIPTION("ASoC Driver for HifiBerry Digi");
+MODULE_LICENSE("GPL v2");
-diff -Nur linux-4.1.6/sound/soc/bcm/iqaudio-dac.c linux-rpi/sound/soc/bcm/iqaudio-dac.c
---- linux-4.1.6/sound/soc/bcm/iqaudio-dac.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/sound/soc/bcm/iqaudio-dac.c 2015-08-26 10:26:13.365379818 +0200
+diff -Nur linux-4.1.10/sound/soc/bcm/iqaudio-dac.c linux-rpi/sound/soc/bcm/iqaudio-dac.c
+--- linux-4.1.10/sound/soc/bcm/iqaudio-dac.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/sound/soc/bcm/iqaudio-dac.c 2015-10-07 16:41:15.000000000 +0200
@@ -0,0 +1,133 @@
+/*
+ * ASoC Driver for IQaudIO DAC
@@ -309930,9 +312908,309 @@ diff -Nur linux-4.1.6/sound/soc/bcm/iqaudio-dac.c linux-rpi/sound/soc/bcm/iqaudi
+MODULE_AUTHOR("Florian Meier <florian.meier@koalo.de>");
+MODULE_DESCRIPTION("ASoC Driver for IQAudio DAC");
+MODULE_LICENSE("GPL v2");
-diff -Nur linux-4.1.6/sound/soc/bcm/rpi-dac.c linux-rpi/sound/soc/bcm/rpi-dac.c
---- linux-4.1.6/sound/soc/bcm/rpi-dac.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/sound/soc/bcm/rpi-dac.c 2015-08-26 10:26:13.365379818 +0200
+diff -Nur linux-4.1.10/sound/soc/bcm/Kconfig linux-rpi/sound/soc/bcm/Kconfig
+--- linux-4.1.10/sound/soc/bcm/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/sound/soc/bcm/Kconfig 2015-10-07 16:41:15.000000000 +0200
+@@ -7,3 +7,71 @@
+ Say Y or M if you want to add support for codecs attached to
+ the BCM2835 I2S interface. You will also need
+ to select the audio interfaces to support below.
++
++config SND_BCM2708_SOC_I2S
++ tristate "SoC Audio support for the Broadcom BCM2708 I2S module"
++ depends on MACH_BCM2708 || MACH_BCM2709
++ select REGMAP_MMIO
++ select SND_SOC_DMAENGINE_PCM
++ select SND_SOC_GENERIC_DMAENGINE_PCM
++ help
++ Say Y or M if you want to add support for codecs attached to
++ the BCM2708 I2S interface. You will also need
++ to select the audio interfaces to support below.
++
++config SND_BCM2708_SOC_HIFIBERRY_DAC
++ tristate "Support for HifiBerry DAC"
++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S
++ select SND_SOC_PCM5102A
++ help
++ Say Y or M if you want to add support for HifiBerry DAC.
++
++config SND_BCM2708_SOC_HIFIBERRY_DACPLUS
++ tristate "Support for HifiBerry DAC+"
++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S
++ select SND_SOC_PCM512x
++ help
++ Say Y or M if you want to add support for HifiBerry DAC+.
++
++config SND_BCM2708_SOC_HIFIBERRY_DIGI
++ tristate "Support for HifiBerry Digi"
++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S
++ select SND_SOC_WM8804
++ help
++ Say Y or M if you want to add support for HifiBerry Digi S/PDIF output board.
++
++config SND_BCM2708_SOC_HIFIBERRY_AMP
++ tristate "Support for the HifiBerry Amp"
++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S
++ select SND_SOC_TAS5713
++ help
++ Say Y or M if you want to add support for the HifiBerry Amp amplifier board.
++
++config SND_BCM2708_SOC_RPI_DAC
++ tristate "Support for RPi-DAC"
++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S
++ select SND_SOC_PCM1794A
++ help
++ Say Y or M if you want to add support for RPi-DAC.
++
++config SND_BCM2708_SOC_RPI_PROTO
++ tristate "Support for Rpi-PROTO"
++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S
++ select SND_SOC_WM8731
++ help
++ Say Y or M if you want to add support for Audio Codec Board PROTO (WM8731).
++
++config SND_BCM2708_SOC_IQAUDIO_DAC
++ tristate "Support for IQaudIO-DAC"
++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S
++ select SND_SOC_PCM512x_I2C
++ help
++ Say Y or M if you want to add support for IQaudIO-DAC.
++
++config SND_BCM2708_SOC_RASPIDAC3
++ tristate "Support for RaspiDAC Rev.3x"
++ depends on SND_BCM2708_SOC_I2S
++ select SND_SOC_PCM512x_I2C
++ select SND_SOC_TPA6130A2
++ help
++ Say Y or M if you want to add support for RaspiDAC Rev.3x.
+diff -Nur linux-4.1.10/sound/soc/bcm/Makefile linux-rpi/sound/soc/bcm/Makefile
+--- linux-4.1.10/sound/soc/bcm/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/sound/soc/bcm/Makefile 2015-10-07 16:41:15.000000000 +0200
+@@ -3,3 +3,26 @@
+
+ obj-$(CONFIG_SND_BCM2835_SOC_I2S) += snd-soc-bcm2835-i2s.o
+
++# BCM2708 Platform Support
++snd-soc-bcm2708-i2s-objs := bcm2708-i2s.o
++
++obj-$(CONFIG_SND_BCM2708_SOC_I2S) += snd-soc-bcm2708-i2s.o
++
++# BCM2708 Machine Support
++snd-soc-hifiberry-dac-objs := hifiberry_dac.o
++snd-soc-hifiberry-dacplus-objs := hifiberry_dacplus.o
++snd-soc-hifiberry-digi-objs := hifiberry_digi.o
++snd-soc-hifiberry-amp-objs := hifiberry_amp.o
++snd-soc-rpi-dac-objs := rpi-dac.o
++snd-soc-rpi-proto-objs := rpi-proto.o
++snd-soc-iqaudio-dac-objs := iqaudio-dac.o
++snd-soc-raspidac3-objs := raspidac3.o
++
++obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC) += snd-soc-hifiberry-dac.o
++obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS) += snd-soc-hifiberry-dacplus.o
++obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI) += snd-soc-hifiberry-digi.o
++obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP) += snd-soc-hifiberry-amp.o
++obj-$(CONFIG_SND_BCM2708_SOC_RPI_DAC) += snd-soc-rpi-dac.o
++obj-$(CONFIG_SND_BCM2708_SOC_RPI_PROTO) += snd-soc-rpi-proto.o
++obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC) += snd-soc-iqaudio-dac.o
++obj-$(CONFIG_SND_BCM2708_SOC_RASPIDAC3) += snd-soc-raspidac3.o
+diff -Nur linux-4.1.10/sound/soc/bcm/raspidac3.c linux-rpi/sound/soc/bcm/raspidac3.c
+--- linux-4.1.10/sound/soc/bcm/raspidac3.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/sound/soc/bcm/raspidac3.c 2015-10-07 16:41:15.000000000 +0200
+@@ -0,0 +1,191 @@
++/*
++ * ASoC Driver for RaspiDAC v3
++ *
++ * Author: Jan Grulich <jan@grulich.eu>
++ * Copyright 2015
++ * based on code by Daniel Matuschek <daniel@hifiberry.com>
++ * based on code by Florian Meier <florian.meier@koalo.de>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * version 2 as published by the Free Software Foundation.
++ *
++ * 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.
++ */
++
++#include <linux/module.h>
++#include <linux/platform_device.h>
++
++#include <sound/core.h>
++#include <sound/pcm.h>
++#include <sound/pcm_params.h>
++#include <sound/soc.h>
++#include <sound/jack.h>
++#include <sound/soc-dapm.h>
++
++#include "../codecs/pcm512x.h"
++#include "../codecs/tpa6130a2.h"
++
++/* sound card init */
++static int snd_rpi_raspidac3_init(struct snd_soc_pcm_runtime *rtd)
++{
++ int ret;
++ struct snd_soc_card *card = rtd->card;
++ struct snd_soc_codec *codec = rtd->codec;
++ snd_soc_update_bits(codec, PCM512x_GPIO_EN, 0x08, 0x08);
++ snd_soc_update_bits(codec, PCM512x_GPIO_OUTPUT_4, 0xf, 0x02);
++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x00);
++
++ ret = snd_soc_limit_volume(codec, "Digital Playback Volume", 207);
++ if (ret < 0)
++ dev_warn(card->dev, "Failed to set volume limit: %d\n", ret);
++ else {
++ struct snd_kcontrol *kctl;
++
++ ret = tpa6130a2_add_controls(codec);
++ if (ret < 0)
++ dev_warn(card->dev, "Failed to add TPA6130A2 controls: %d\n",
++ ret);
++ ret = snd_soc_limit_volume(codec,
++ "TPA6130A2 Headphone Playback Volume",
++ 54);
++ if (ret < 0)
++ dev_warn(card->dev, "Failed to set TPA6130A2 volume limit: %d\n",
++ ret);
++ kctl = snd_soc_card_get_kcontrol(card,
++ "TPA6130A2 Headphone Playback Volume");
++ if (kctl) {
++ strcpy(kctl->id.name, "Headphones Playback Volume");
++ /* disable the volume dB scale so alsamixer works */
++ kctl->vd[0].access = SNDRV_CTL_ELEM_ACCESS_READWRITE;
++ }
++
++ kctl = snd_soc_card_get_kcontrol(card,
++ "TPA6130A2 Headphone Playback Switch");
++ if (kctl)
++ strcpy(kctl->id.name, "Headphones Playback Switch");
++ }
++
++ return 0;
++}
++
++/* set hw parameters */
++static int snd_rpi_raspidac3_hw_params(struct snd_pcm_substream *substream,
++ struct snd_pcm_hw_params *params)
++{
++ struct snd_soc_pcm_runtime *rtd = substream->private_data;
++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
++
++ unsigned int sample_bits =
++ snd_pcm_format_physical_width(params_format(params));
++
++ return snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2);
++}
++
++/* startup */
++static int snd_rpi_raspidac3_startup(struct snd_pcm_substream *substream) {
++ struct snd_soc_pcm_runtime *rtd = substream->private_data;
++ struct snd_soc_codec *codec = rtd->codec;
++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x08);
++ tpa6130a2_stereo_enable(codec, 1);
++ return 0;
++}
++
++/* shutdown */
++static void snd_rpi_raspidac3_shutdown(struct snd_pcm_substream *substream) {
++ struct snd_soc_pcm_runtime *rtd = substream->private_data;
++ struct snd_soc_codec *codec = rtd->codec;
++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08,0x00);
++ tpa6130a2_stereo_enable(codec, 0);
++}
++
++/* machine stream operations */
++static struct snd_soc_ops snd_rpi_raspidac3_ops = {
++ .hw_params = snd_rpi_raspidac3_hw_params,
++ .startup = snd_rpi_raspidac3_startup,
++ .shutdown = snd_rpi_raspidac3_shutdown,
++};
++
++/* interface setup */
++static struct snd_soc_dai_link snd_rpi_raspidac3_dai[] = {
++{
++ .name = "RaspiDAC Rev.3x",
++ .stream_name = "RaspiDAC HiFi",
++ .cpu_dai_name = "bcm2708-i2s.0",
++ .codec_dai_name = "pcm512x-hifi",
++ .platform_name = "bcm2708-i2s.0",
++ .codec_name = "pcm512x.1-004c",
++ .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
++ SND_SOC_DAIFMT_CBS_CFS,
++ .ops = &snd_rpi_raspidac3_ops,
++ .init = snd_rpi_raspidac3_init,
++},
++};
++
++/* audio machine driver */
++static struct snd_soc_card snd_rpi_raspidac3 = {
++ .name = "RaspiDAC Rev.3x HiFi Audio Card",
++ .dai_link = snd_rpi_raspidac3_dai,
++ .num_links = ARRAY_SIZE(snd_rpi_raspidac3_dai),
++};
++
++/* sound card test */
++static int snd_rpi_raspidac3_probe(struct platform_device *pdev)
++{
++ int ret = 0;
++
++ snd_rpi_raspidac3.dev = &pdev->dev;
++
++ if (pdev->dev.of_node) {
++ struct device_node *i2s_node;
++ struct snd_soc_dai_link *dai = &snd_rpi_raspidac3_dai[0];
++ i2s_node = of_parse_phandle(pdev->dev.of_node,
++ "i2s-controller", 0);
++
++ if (i2s_node) {
++ dai->cpu_dai_name = NULL;
++ dai->cpu_of_node = i2s_node;
++ dai->platform_name = NULL;
++ dai->platform_of_node = i2s_node;
++ }
++ }
++
++ ret = snd_soc_register_card(&snd_rpi_raspidac3);
++ if (ret)
++ dev_err(&pdev->dev,
++ "snd_soc_register_card() failed: %d\n", ret);
++
++ return ret;
++}
++
++/* sound card disconnect */
++static int snd_rpi_raspidac3_remove(struct platform_device *pdev)
++{
++ return snd_soc_unregister_card(&snd_rpi_raspidac3);
++}
++
++static const struct of_device_id raspidac3_of_match[] = {
++ { .compatible = "jg,raspidacv3", },
++ {},
++};
++MODULE_DEVICE_TABLE(of, raspidac3_of_match);
++
++/* sound card platform driver */
++static struct platform_driver snd_rpi_raspidac3_driver = {
++ .driver = {
++ .name = "snd-rpi-raspidac3",
++ .owner = THIS_MODULE,
++ .of_match_table = raspidac3_of_match,
++ },
++ .probe = snd_rpi_raspidac3_probe,
++ .remove = snd_rpi_raspidac3_remove,
++};
++
++module_platform_driver(snd_rpi_raspidac3_driver);
++
++MODULE_AUTHOR("Jan Grulich <jan@grulich.eu>");
++MODULE_DESCRIPTION("ASoC Driver for RaspiDAC Rev.3x");
++MODULE_LICENSE("GPL v2");
+diff -Nur linux-4.1.10/sound/soc/bcm/rpi-dac.c linux-rpi/sound/soc/bcm/rpi-dac.c
+--- linux-4.1.10/sound/soc/bcm/rpi-dac.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/sound/soc/bcm/rpi-dac.c 2015-10-07 16:41:15.000000000 +0200
@@ -0,0 +1,118 @@
+/*
+ * ASoC Driver for RPi-DAC.
@@ -310052,9 +313330,9 @@ diff -Nur linux-4.1.6/sound/soc/bcm/rpi-dac.c linux-rpi/sound/soc/bcm/rpi-dac.c
+MODULE_AUTHOR("Florian Meier <florian.meier@koalo.de>");
+MODULE_DESCRIPTION("ASoC Driver for RPi-DAC");
+MODULE_LICENSE("GPL v2");
-diff -Nur linux-4.1.6/sound/soc/bcm/rpi-proto.c linux-rpi/sound/soc/bcm/rpi-proto.c
---- linux-4.1.6/sound/soc/bcm/rpi-proto.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/sound/soc/bcm/rpi-proto.c 2015-08-26 10:26:13.365379818 +0200
+diff -Nur linux-4.1.10/sound/soc/bcm/rpi-proto.c linux-rpi/sound/soc/bcm/rpi-proto.c
+--- linux-4.1.10/sound/soc/bcm/rpi-proto.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/sound/soc/bcm/rpi-proto.c 2015-10-07 16:41:15.000000000 +0200
@@ -0,0 +1,153 @@
+/*
+ * ASoC driver for PROTO AudioCODEC (with a WM8731)
@@ -310209,9 +313487,9 @@ diff -Nur linux-4.1.6/sound/soc/bcm/rpi-proto.c linux-rpi/sound/soc/bcm/rpi-prot
+MODULE_AUTHOR("Florian Meier");
+MODULE_DESCRIPTION("ASoC Driver for Raspberry Pi connected to PROTO board (WM8731)");
+MODULE_LICENSE("GPL");
-diff -Nur linux-4.1.6/sound/soc/codecs/Kconfig linux-rpi/sound/soc/codecs/Kconfig
---- linux-4.1.6/sound/soc/codecs/Kconfig 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/sound/soc/codecs/Kconfig 2015-08-26 10:26:13.365379818 +0200
+diff -Nur linux-4.1.10/sound/soc/codecs/Kconfig linux-rpi/sound/soc/codecs/Kconfig
+--- linux-4.1.10/sound/soc/codecs/Kconfig 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/sound/soc/codecs/Kconfig 2015-10-07 16:41:15.000000000 +0200
@@ -83,6 +83,8 @@
select SND_SOC_PCM512x_I2C if I2C
select SND_SOC_PCM512x_SPI if SPI_MASTER
@@ -310252,9 +313530,9 @@ diff -Nur linux-4.1.6/sound/soc/codecs/Kconfig linux-rpi/sound/soc/codecs/Kconfi
config SND_SOC_TLV320AIC23
tristate
-diff -Nur linux-4.1.6/sound/soc/codecs/Makefile linux-rpi/sound/soc/codecs/Makefile
---- linux-4.1.6/sound/soc/codecs/Makefile 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/sound/soc/codecs/Makefile 2015-08-26 10:26:13.365379818 +0200
+diff -Nur linux-4.1.10/sound/soc/codecs/Makefile linux-rpi/sound/soc/codecs/Makefile
+--- linux-4.1.10/sound/soc/codecs/Makefile 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/sound/soc/codecs/Makefile 2015-10-07 16:41:15.000000000 +0200
@@ -78,6 +78,8 @@
snd-soc-pcm512x-spi-objs := pcm512x-spi.o
snd-soc-rl6231-objs := rl6231.o
@@ -310289,9 +313567,9 @@ diff -Nur linux-4.1.6/sound/soc/codecs/Makefile linux-rpi/sound/soc/codecs/Makef
obj-$(CONFIG_SND_SOC_TLV320AIC23) += snd-soc-tlv320aic23.o
obj-$(CONFIG_SND_SOC_TLV320AIC23_I2C) += snd-soc-tlv320aic23-i2c.o
obj-$(CONFIG_SND_SOC_TLV320AIC23_SPI) += snd-soc-tlv320aic23-spi.o
-diff -Nur linux-4.1.6/sound/soc/codecs/pcm1794a.c linux-rpi/sound/soc/codecs/pcm1794a.c
---- linux-4.1.6/sound/soc/codecs/pcm1794a.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/sound/soc/codecs/pcm1794a.c 2015-08-26 10:26:13.377379983 +0200
+diff -Nur linux-4.1.10/sound/soc/codecs/pcm1794a.c linux-rpi/sound/soc/codecs/pcm1794a.c
+--- linux-4.1.10/sound/soc/codecs/pcm1794a.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/sound/soc/codecs/pcm1794a.c 2015-10-07 16:41:15.000000000 +0200
@@ -0,0 +1,69 @@
+/*
+ * Driver for the PCM1794A codec
@@ -310362,9 +313640,9 @@ diff -Nur linux-4.1.6/sound/soc/codecs/pcm1794a.c linux-rpi/sound/soc/codecs/pcm
+MODULE_DESCRIPTION("ASoC PCM1794A codec driver");
+MODULE_AUTHOR("Florian Meier <florian.meier@koalo.de>");
+MODULE_LICENSE("GPL v2");
-diff -Nur linux-4.1.6/sound/soc/codecs/pcm5102a.c linux-rpi/sound/soc/codecs/pcm5102a.c
---- linux-4.1.6/sound/soc/codecs/pcm5102a.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/sound/soc/codecs/pcm5102a.c 2015-08-26 10:26:13.377379983 +0200
+diff -Nur linux-4.1.10/sound/soc/codecs/pcm5102a.c linux-rpi/sound/soc/codecs/pcm5102a.c
+--- linux-4.1.10/sound/soc/codecs/pcm5102a.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/sound/soc/codecs/pcm5102a.c 2015-10-07 16:41:15.000000000 +0200
@@ -0,0 +1,70 @@
+/*
+ * Driver for the PCM5102A codec
@@ -310436,9 +313714,22 @@ diff -Nur linux-4.1.6/sound/soc/codecs/pcm5102a.c linux-rpi/sound/soc/codecs/pcm
+MODULE_DESCRIPTION("ASoC PCM5102A codec driver");
+MODULE_AUTHOR("Florian Meier <florian.meier@koalo.de>");
+MODULE_LICENSE("GPL v2");
-diff -Nur linux-4.1.6/sound/soc/codecs/tas5713.c linux-rpi/sound/soc/codecs/tas5713.c
---- linux-4.1.6/sound/soc/codecs/tas5713.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/sound/soc/codecs/tas5713.c 2015-08-26 10:26:13.385380091 +0200
+diff -Nur linux-4.1.10/sound/soc/codecs/pcm512x.c linux-rpi/sound/soc/codecs/pcm512x.c
+--- linux-4.1.10/sound/soc/codecs/pcm512x.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/sound/soc/codecs/pcm512x.c 2015-10-07 16:41:15.000000000 +0200
+@@ -856,7 +856,8 @@
+ int fssp;
+ int gpio;
+
+- lrclk_div = snd_soc_params_to_frame_size(params);
++ lrclk_div = snd_pcm_format_physical_width(params_format(params))
++ * params_channels(params);
+ if (lrclk_div == 0) {
+ dev_err(dev, "No LRCLK?\n");
+ return -EINVAL;
+diff -Nur linux-4.1.10/sound/soc/codecs/tas5713.c linux-rpi/sound/soc/codecs/tas5713.c
+--- linux-4.1.10/sound/soc/codecs/tas5713.c 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/sound/soc/codecs/tas5713.c 2015-10-07 16:41:15.000000000 +0200
@@ -0,0 +1,369 @@
+/*
+ * ASoC Driver for TAS5713
@@ -310809,9 +314100,9 @@ diff -Nur linux-4.1.6/sound/soc/codecs/tas5713.c linux-rpi/sound/soc/codecs/tas5
+MODULE_AUTHOR("Sebastian Eickhoff <basti.eickhoff@googlemail.com>");
+MODULE_DESCRIPTION("ASoC driver for TAS5713");
+MODULE_LICENSE("GPL v2");
-diff -Nur linux-4.1.6/sound/soc/codecs/tas5713.h linux-rpi/sound/soc/codecs/tas5713.h
---- linux-4.1.6/sound/soc/codecs/tas5713.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-rpi/sound/soc/codecs/tas5713.h 2015-08-26 10:26:13.385380091 +0200
+diff -Nur linux-4.1.10/sound/soc/codecs/tas5713.h linux-rpi/sound/soc/codecs/tas5713.h
+--- linux-4.1.10/sound/soc/codecs/tas5713.h 1970-01-01 01:00:00.000000000 +0100
++++ linux-rpi/sound/soc/codecs/tas5713.h 2015-10-07 16:41:15.000000000 +0200
@@ -0,0 +1,210 @@
+/*
+ * ASoC Driver for TAS5713
@@ -311023,9 +314314,91 @@ diff -Nur linux-4.1.6/sound/soc/codecs/tas5713.h linux-rpi/sound/soc/codecs/tas5
+
+
+#endif /* _TAS5713_H */
-diff -Nur linux-4.1.6/sound/soc/codecs/wm8804.c linux-rpi/sound/soc/codecs/wm8804.c
---- linux-4.1.6/sound/soc/codecs/wm8804.c 2015-08-17 05:52:51.000000000 +0200
-+++ linux-rpi/sound/soc/codecs/wm8804.c 2015-08-26 10:26:13.393380200 +0200
+diff -Nur linux-4.1.10/sound/soc/codecs/tpa6130a2.c linux-rpi/sound/soc/codecs/tpa6130a2.c
+--- linux-4.1.10/sound/soc/codecs/tpa6130a2.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/sound/soc/codecs/tpa6130a2.c 2015-10-07 16:41:15.000000000 +0200
+@@ -4,6 +4,7 @@
+ * Copyright (C) Nokia Corporation
+ *
+ * Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
++ * Modified: Jan Grulich <jan@grulich.eu>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+@@ -52,6 +53,8 @@
+ enum tpa_model id;
+ };
+
++static void tpa6130a2_channel_enable(u8 channel, int enable);
++
+ static int tpa6130a2_i2c_read(int reg)
+ {
+ struct tpa6130a2_data *data;
+@@ -189,7 +192,7 @@
+ }
+
+ static int tpa6130a2_get_volsw(struct snd_kcontrol *kcontrol,
+- struct snd_ctl_elem_value *ucontrol)
++ struct snd_ctl_elem_value *ucontrol)
+ {
+ struct soc_mixer_control *mc =
+ (struct soc_mixer_control *)kcontrol->private_value;
+@@ -218,7 +221,7 @@
+ }
+
+ static int tpa6130a2_put_volsw(struct snd_kcontrol *kcontrol,
+- struct snd_ctl_elem_value *ucontrol)
++ struct snd_ctl_elem_value *ucontrol)
+ {
+ struct soc_mixer_control *mc =
+ (struct soc_mixer_control *)kcontrol->private_value;
+@@ -255,8 +258,22 @@
+ return 1;
+ }
+
++static int tpa6130a2_put_hp_sw(struct snd_kcontrol *kcontrol,
++ struct snd_ctl_elem_value *ucontrol)
++{
++ int enable = ucontrol->value.integer.value[0];
++ unsigned int state;
++
++ state = (tpa6130a2_read(TPA6130A2_REG_VOL_MUTE) & 0x80) == 0;
++ if (state == enable)
++ return 0; /* No change */
++
++ tpa6130a2_channel_enable(TPA6130A2_HP_EN_R | TPA6130A2_HP_EN_L, enable);
++ return 1; /* Changed */
++}
++
+ /*
+- * TPA6130 volume. From -59.5 to 4 dB with increasing step size when going
++ * TPA6130 volume. From -59.5 to +4.0 dB with increasing step size when going
+ * down in gain.
+ */
+ static const unsigned int tpa6130_tlv[] = {
+@@ -278,6 +295,9 @@
+ TPA6130A2_REG_VOL_MUTE, 0, 0x3f, 0,
+ tpa6130a2_get_volsw, tpa6130a2_put_volsw,
+ tpa6130_tlv),
++ SOC_SINGLE_EXT("TPA6130A2 Headphone Playback Switch",
++ TPA6130A2_REG_VOL_MUTE, 7, 1, 1,
++ tpa6130a2_get_volsw, tpa6130a2_put_hp_sw),
+ };
+
+ static const unsigned int tpa6140_tlv[] = {
+@@ -292,6 +312,9 @@
+ TPA6130A2_REG_VOL_MUTE, 1, 0x1f, 0,
+ tpa6130a2_get_volsw, tpa6130a2_put_volsw,
+ tpa6140_tlv),
++ SOC_SINGLE_EXT("TPA6140A2 Headphone Playback Switch",
++ TPA6130A2_REG_VOL_MUTE, 7, 1, 1,
++ tpa6130a2_get_volsw, tpa6130a2_put_hp_sw),
+ };
+
+ /*
+diff -Nur linux-4.1.10/sound/soc/codecs/wm8804.c linux-rpi/sound/soc/codecs/wm8804.c
+--- linux-4.1.10/sound/soc/codecs/wm8804.c 2015-10-03 13:49:38.000000000 +0200
++++ linux-rpi/sound/soc/codecs/wm8804.c 2015-10-07 16:41:15.000000000 +0200
@@ -304,6 +304,7 @@
blen = 0x1;
break;