aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/patches-3.10/310-lib-add-rle-decompression.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-07-09 12:52:18 +0000
committerFelix Fietkau <nbd@openwrt.org>2013-07-09 12:52:18 +0000
commit64dde7d981cf3350ee06d1aa431bb2bf6f4397a3 (patch)
tree928f0fb86897f11fe6d7e364bb97e0906303a547 /target/linux/ar71xx/patches-3.10/310-lib-add-rle-decompression.patch
parent40b3db713d1a4163ca6ff2c179b9b0d92d905351 (diff)
downloadupstream-64dde7d981cf3350ee06d1aa431bb2bf6f4397a3.tar.gz
upstream-64dde7d981cf3350ee06d1aa431bb2bf6f4397a3.tar.bz2
upstream-64dde7d981cf3350ee06d1aa431bb2bf6f4397a3.zip
ar71xx: add linux 3.10
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 37214
Diffstat (limited to 'target/linux/ar71xx/patches-3.10/310-lib-add-rle-decompression.patch')
-rw-r--r--target/linux/ar71xx/patches-3.10/310-lib-add-rle-decompression.patch114
1 files changed, 114 insertions, 0 deletions
diff --git a/target/linux/ar71xx/patches-3.10/310-lib-add-rle-decompression.patch b/target/linux/ar71xx/patches-3.10/310-lib-add-rle-decompression.patch
new file mode 100644
index 0000000000..5c43ae2576
--- /dev/null
+++ b/target/linux/ar71xx/patches-3.10/310-lib-add-rle-decompression.patch
@@ -0,0 +1,114 @@
+--- a/lib/Kconfig
++++ b/lib/Kconfig
+@@ -197,6 +197,9 @@ config LZMA_COMPRESS
+ config LZMA_DECOMPRESS
+ tristate
+
++config RLE_DECOMPRESS
++ tristate
++
+ #
+ # These all provide a common interface (hence the apparent duplication with
+ # ZLIB_INFLATE; DECOMPRESS_GZIP is just a wrapper.)
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -89,6 +89,7 @@ obj-$(CONFIG_XZ_DEC) += xz/
+ obj-$(CONFIG_RAID6_PQ) += raid6/
+ obj-$(CONFIG_LZMA_COMPRESS) += lzma/
+ obj-$(CONFIG_LZMA_DECOMPRESS) += lzma/
++obj-$(CONFIG_RLE_DECOMPRESS) += rle.o
+
+ lib-$(CONFIG_DECOMPRESS_GZIP) += decompress_inflate.o
+ lib-$(CONFIG_DECOMPRESS_BZIP2) += decompress_bunzip2.o
+--- /dev/null
++++ b/include/linux/rle.h
+@@ -0,0 +1,8 @@
++#ifndef _RLE_H_
++#define _RLE_H_
++
++int rle_decode(const unsigned char *src, size_t srclen,
++ unsigned char *dst, size_t dstlen,
++ size_t *src_done, size_t *dst_done);
++
++#endif /* _RLE_H_ */
+--- /dev/null
++++ b/lib/rle.c
+@@ -0,0 +1,78 @@
++/*
++ * RLE decoding routine
++ *
++ * Copyright (C) 2012 Gabor Juhos <juhosg@openwrt.org>
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms of the GNU General Public License version 2 as published
++ * by the Free Software Foundation.
++ */
++
++#include <linux/kernel.h>
++#include <linux/module.h>
++#include <linux/rle.h>
++
++int rle_decode(const unsigned char *src, size_t srclen,
++ unsigned char *dst, size_t dstlen,
++ size_t *src_done, size_t *dst_done)
++{
++ size_t srcpos, dstpos;
++ int ret;
++
++ srcpos = 0;
++ dstpos = 0;
++ ret = -EINVAL;
++
++ /* sanity checks */
++ if (!src || !srclen || !dst || !dstlen)
++ goto out;
++
++ while (1) {
++ char count;
++
++ if (srcpos >= srclen)
++ break;
++
++ count = (char) src[srcpos++];
++ if (count == 0) {
++ ret = 0;
++ break;
++ }
++
++ if (count > 0) {
++ unsigned char c;
++
++ if (srcpos >= srclen)
++ break;
++
++ c = src[srcpos++];
++
++ while (count--) {
++ if (dstpos >= dstlen)
++ break;
++
++ dst[dstpos++] = c;
++ }
++ } else {
++ count *= -1;
++
++ while (count--) {
++ if (srcpos >= srclen)
++ break;
++ if (dstpos >= dstlen)
++ break;
++ dst[dstpos++] = src[srcpos++];
++ }
++ }
++ }
++
++out:
++ if (src_done)
++ *src_done = srcpos;
++ if (dst_done)
++ *dst_done = dstpos;
++
++ return ret;
++}
++
++EXPORT_SYMBOL_GPL(rle_decode);
"qca956x.dtsi" #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/input/input.h> #include <dt-bindings/leds/common.h> / { model = "ASUS RP-AC66"; compatible = "asus,rp-ac66", "qca,qca9563"; aliases { led-boot = &led_orange; led-failsafe = &led_orange; led-running = &led_power; led-upgrade = &led_orange; label-mac-device = &eth0; }; leds { compatible = "gpio-leds"; led_power: power { label = "green:power"; gpios = <&gpio 6 GPIO_ACTIVE_HIGH>; }; led_orange: wps { label = "orange:wps"; gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; }; rssilow-wlan0 { label = "blue:rssilow-wlan0"; gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; }; rssimedium-wlan0 { label = "red:rssimedium-wlan0"; gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; }; rssihigh-wlan0 { label = "green:rssihigh-wlan0"; gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; }; rssilow-wlan1 { label = "blue:rssilow-wlan1"; gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; }; rssimedium-wlan1 { label = "red:rssimedium-wlan1"; gpios = <&gpio 9 GPIO_ACTIVE_HIGH>; }; rssihigh-wlan1 { label = "green:rssihigh-wlan1"; gpios = <&gpio 8 GPIO_ACTIVE_HIGH>; }; }; keys { compatible = "gpio-keys"; wps { linux,code = <KEY_WPS_BUTTON>; gpios = <&gpio 5 GPIO_ACTIVE_LOW>; debounce-interval = <60>; }; reset { linux,code = <KEY_RESTART>; gpios = <&gpio 2 GPIO_ACTIVE_LOW>; debounce-interval = <60>; }; }; }; &pcie { status = "okay"; }; &spi { status = "okay"; flash@0 { compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <50000000>; partitions { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; partition@0 { label = "u-boot"; reg = <0x000000 0x40000>; read-only; }; partition@40000 { label = "u-boot-env"; reg = <0x040000 0x10000>; read-only; }; art: partition@50000 { label = "art"; reg = <0x050000 0x10000>; read-only; compatible = "nvmem-cells"; #address-cells = <1>; #size-cells = <1>; macaddr_art_1002: macaddr@1002 { reg = <0x1002 0x6>; }; }; partition@60000 { compatible = "denx,uimage"; label = "firmware"; reg = <0x060000 0xfa0000>; }; }; }; }; &mdio0 { status = "okay"; phy-mask = <0>; phy0: ethernet-phy@3 { reg = <0x3>; phy-mode = "sgmii"; qca,mib-poll-interval = <500>; }; }; &eth0 { status = "okay"; phy-mode = "sgmii"; nvmem-cells = <&macaddr_art_1002>; nvmem-cell-names = "mac-address"; phy-handle = <&phy0>; }; &wmac { status = "okay"; qca,no-eeprom; };