From 2175fb410ce63d997b99b8c310a0206cdfaa73b9 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Mon, 23 Oct 2017 13:10:30 +0800 Subject: [PATCH 01/22] add init support for Asus RT-ACRH17 --- .../arm/boot/dts/qcom-ipq4019-rt-acrh17.dts | 271 +++++++++++ .../arm/boot/dts/qcom-ipq8064-wxr-2533dhp.dts | 448 ++++++++++++++++++ target/linux/ipq806x/image/Makefile | 22 +- 3 files changed, 739 insertions(+), 2 deletions(-) create mode 100644 target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts create mode 100644 target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8064-wxr-2533dhp.dts diff --git a/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts new file mode 100644 index 000000000..1eb4b2e6f --- /dev/null +++ b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts @@ -0,0 +1,271 @@ +/* Copyright (c) 2015, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +#include "qcom-ipq4019-ap.dk01.1.dtsi" +#include "qcom-ipq4019-bus.dtsi" +#include +#include +#include + +/ { + model = "ASUS RT-ACRH17"; + compatible = "asus,rt-acrh17", "qcom,ipq4019"; + + memory { + device_type = "memory"; + reg = <0x80000000 0x10000000>; + }; + + aliases { + led-boot = &power; + led-failsafe = &power; + led-running = &power; + led-upgrade = &power; + }; + + reserved-memory { + #address-cells = <0x1>; + #size-cells = <0x1>; + ranges; + + rsvd1@87E00000 { + reg = <0x87e00000 0x200000>; + no-map; + }; + }; + + soc { + + tcsr@194b000 { + /* select hostmode */ + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + status = "ok"; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + counter@4a1000 { + compatible = "qcom,qca-gcnt"; + reg = <0x4a1000 0x4>; + }; + + mdio@90000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + }; + + wifi@a000000 { + status = "okay"; + }; + + wifi@a800000 { + status = "okay"; + }; + + cryptobam: dma@8e04000 { + status = "okay"; + }; + + crypto@8e3a000 { + status = "okay"; + }; + }; + + gpio-keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 4 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + power: status { + label = "rt-ac58u:blue:status"; + gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + }; + + wan { + label = "rt-ac58u:blue:wan"; + gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; + }; + + wlan2G { + label = "rt-ac58u:blue:wlan2G"; + gpios = <&tlmm 58 GPIO_ACTIVE_HIGH>; + }; + + wan5G { + label = "rt-ac58u:blue:wlan5G"; + gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>; + }; + + usb { + label = "rt-ac58u:blue:usb"; + gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; + }; + + lan { + label = "rt-ac58u:blue:lan"; + gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&spi_0_pins { + pinmux_cs { + function = "gpio"; + pins = "gpio54", "gpio59"; + }; + pinconf_cs { + pins = "gpio54", "gpio59"; + drive-strength = <2>; + bias-disable; + output-high; + }; +}; + + +&spi_0 { /* BLSP1 QUP1 */ + status = "ok"; + cs-gpios = <&tlmm 54 0>, + <&tlmm 59 0>; + + mx25l25635e@0 { + status = "disabled"; + }; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <0>; + /* + * U-boot looks for "n25q128a11" node, + * if we don't have it, it will spit out the following warning: + * "ipq: fdt fixup unable to find compatible node". + */ + compatible = "mx25l1606e", "n25q128a11", "jedec,spi-nor"; + reg = <0>; + linux,modalias = "m25p80", "mx25l1606e", "n25q128a11"; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition0@0 { + label = "SBL1"; + reg = <0x00000000 0x00040000>; + read-only; + }; + partition1@40000 { + label = "MIBIB"; + reg = <0x00040000 0x00020000>; + read-only; + }; + partition2@60000 { + label = "QSEE"; + reg = <0x00060000 0x00060000>; + read-only; + }; + partition3@c0000 { + label = "CDT"; + reg = <0x000c0000 0x00010000>; + read-only; + }; + partition4@d0000 { + label = "DDRPARAMS"; + reg = <0x000d0000 0x00010000>; + read-only; + }; + partition5@e0000 { + label = "APPSBLENV"; /* uboot env*/ + reg = <0x000e0000 0x00010000>; + read-only; + }; + partition5@f0000 { + label = "APPSBL"; /* uboot */ + reg = <0x000f0000 0x00080000>; + read-only; + }; + partition5@170000 { + label = "ART"; + reg = <0x00170000 0x00010000>; + read-only; + }; + /* 0x00180000 - 0x00200000 unused */ + }; + }; + + mt29f@1 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "spinand,mt29f", "w25n01gv"; + reg = <1>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition0@0 { + label = "ubi"; + reg = <0x00000000 0x08000000>; + }; + }; + }; +}; diff --git a/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8064-wxr-2533dhp.dts b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8064-wxr-2533dhp.dts new file mode 100644 index 000000000..2d6957e56 --- /dev/null +++ b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq8064-wxr-2533dhp.dts @@ -0,0 +1,448 @@ +#include "qcom-ipq8064-v1.0.dtsi" + +#include + +/ { + model = "Buffalo WXR-2533DHP"; + compatible = "buffalo,wxr-2533dhp", "qcom,ipq8064"; + + memory@0 { + reg = <0x42000000 0x1e000000>; + device_type = "memory"; + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + rsvd@41200000 { + reg = <0x41200000 0x300000>; + no-map; + }; + }; + + aliases { + serial0 = &uart4; + mdio-gpio0 = &mdio0; + + led-boot = &power_white; + led-failsafe = &power_orange; + led-running = &power_white; + led-upgrade = &power_orange; + }; + + chosen { + bootargs = "console=ttyMSM0,115200n8 ubi.mtd=0 ubi.block=0,1 root=/dev/ubiblock0_1 rootfstype=squashfs"; + linux,stdout-path = "serial0:115200n8"; + }; + + soc { + pinmux@800000 { + i2c4_pins: i2c4_pinmux { + mux { + pins = "gpio12", "gpio13"; + function = "gsbi4"; + drive-strength = <12>; + bias-disable; + }; + }; + + spi_pins: spi_pins { + mux { + pins = "gpio18", "gpio19", "gpio21"; + function = "gsbi5"; + drive-strength = <10>; + bias-none; + }; + }; + + nand_pins: nand_pins { + mux { + pins = "gpio34", "gpio35", "gpio36", + "gpio37", "gpio38", "gpio39", + "gpio40", "gpio41", "gpio42", + "gpio43", "gpio44", "gpio45", + "gpio46", "gpio47"; + function = "nand"; + drive-strength = <10>; + bias-disable; + }; + pullups { + pins = "gpio39"; + bias-pull-up; + }; + hold { + pins = "gpio40", "gpio41", "gpio42", + "gpio43", "gpio44", "gpio45", + "gpio46", "gpio47"; + bias-bus-hold; + }; + }; + + mdio0_pins: mdio0_pins { + mux { + pins = "gpio0", "gpio1"; + function = "gpio"; + drive-strength = <8>; + bias-disable; + }; + }; + + rgmii2_pins: rgmii2_pins { + mux { + pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32", + "gpio51", "gpio52", "gpio59", "gpio60", "gpio61", "gpio62" ; + function = "rgmii2"; + drive-strength = <8>; + bias-disable; + }; + }; + + led_pins: led_pins { + mux { + pins = "gpio7", "gpio8", "gpio9", "gpio16", "gpio22", "gpio23", + "gpio24", "gpio25", "gpio26", "gpio53"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; + }; + + button_pins: button_pins { + mux { + pins = "gpio54", "gpio65"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; + }; + + }; + + nand@1ac00000 { + status = "ok"; + + pinctrl-0 = <&nand_pins>; + pinctrl-names = "default"; + + cs0 { + reg = <0>; + compatible = "qcom,nandcs"; + + nand-ecc-strength = <4>; + nand-bus-width = <8>; + nand-ecc-step-size = <512>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + rootfs@0000000 { + label = "rootfs"; + reg = <0x0000000 0x4000000>; + }; + + rootfs_1@4000000 { + label = "rootfs_1"; + reg = <0x4000000 0x4000000>; + }; + }; + }; + }; + + gsbi@16300000 { + qcom,mode = ; + status = "ok"; + + uart4: serial@16340000 { + status = "ok"; + }; + /* + * The i2c device on gsbi4 should not be enabled. + * On ipq806x designs gsbi4 i2c is meant for exclusive + * RPM usage. Turning this on in kernel manifests as + * i2c failure for the RPM. + */ + }; + + gsbi5: gsbi@1a200000 { + qcom,mode = ; + status = "ok"; + + spi5: spi@1a280000 { + status = "ok"; + + pinctrl-0 = <&spi_pins>; + pinctrl-names = "default"; + + cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>; + + flash: m25p80@0 { + compatible = "jedec,spi-nor"; + #address-cells = <1>; + #size-cells = <1>; + spi-max-frequency = <50000000>; + reg = <0>; + + SBL1@0 { + label = "SBL1"; + reg = <0x0 0x10000>; + read-only; + }; + + MIBIB@10000 { + label = "MIBIB"; + reg = <0x10000 0x20000>; + read-only; + }; + + SBL2@30000 { + label = "SBL2"; + reg = <0x30000 0x30000>; + read-only; + }; + + SBL3@60000 { + label = "SBL3"; + reg = <0x60000 0x30000>; + read-only; + }; + + DDRCONFIG@90000 { + label = "DDRCONFIG"; + reg = <0x90000 0x10000>; + read-only; + }; + + SSD@a0000 { + label = "SSD"; + reg = <0xa0000 0x10000>; + read-only; + }; + + TZ@b0000 { + label = "TZ"; + reg = <0xb0000 0x30000>; + read-only; + }; + + RPM@e0000 { + label = "RPM"; + reg = <0xe0000 0x20000>; + read-only; + }; + + APPSBL@100000 { + label = "APPSBL"; + reg = <0x100000 0x70000>; + read-only; + }; + + APPSBLENV@170000 { + label = "APPSBLENV"; + reg = <0x170000 0x10000>; + read-only; + }; + + ART: ART@180000 { + label = "ART"; + reg = <0x180000 0x40000>; + read-only; + }; + + BOOTCONFIG@1c0000 { + label = "OLDART"; + reg = <0x1c0000 0x10000>; + read-only; + }; + + APPSBL_1@1d0000 { + label = "APPSBL_1"; + reg = <0x1d0000 0x70000>; + }; + }; + }; + }; + + phy@100f8800 { /* USB3 port 1 HS phy */ + status = "ok"; + }; + + phy@100f8830 { /* USB3 port 1 SS phy */ + status = "ok"; + }; + + phy@110f8800 { /* USB3 port 0 HS phy */ + status = "ok"; + }; + + phy@110f8830 { /* USB3 port 0 SS phy */ + status = "ok"; + }; + + usb30@0 { + status = "ok"; + }; + + usb30@1 { + status = "ok"; + }; + + pcie0: pci@1b500000 { + status = "ok"; + phy-tx0-term-offset = <7>; + }; + + pcie1: pci@1b700000 { + status = "ok"; + phy-tx0-term-offset = <7>; + }; + + mdio0: mdio { + compatible = "virtual,mdio-gpio"; + #address-cells = <1>; + #size-cells = <0>; + gpios = <&qcom_pinmux 1 GPIO_ACTIVE_HIGH &qcom_pinmux 0 GPIO_ACTIVE_HIGH>; + pinctrl-0 = <&mdio0_pins>; + pinctrl-names = "default"; + + phy0: ethernet-phy@0 { + device_type = "ethernet-phy"; + reg = <0>; + qca,ar8327-initvals = < + 0x00004 0x7600000 /* PAD0_MODE */ + 0x00008 0x1000000 /* PAD5_MODE */ + 0x0000c 0x80 /* PAD6_MODE */ + 0x000e4 0x6a545 /* MAC_POWER_SEL */ + 0x000e0 0xc74164de /* SGMII_CTRL */ + 0x0007c 0x4e /* PORT0_STATUS */ + 0x00094 0x4e /* PORT6_STATUS */ + >; + }; + + phy4: ethernet-phy@4 { + device_type = "ethernet-phy"; + reg = <4>; + }; + }; + + gmac1: ethernet@37200000 { + status = "ok"; + phy-mode = "rgmii"; + qcom,id = <1>; + qcom,phy_mdio_addr = <4>; + qcom,poll_required = <1>; + qcom,rgmii_delay = <0>; + qcom,emulation = <0>; + pinctrl-0 = <&rgmii2_pins>; + pinctrl-names = "default"; + mtd-mac-address = <&ART 6>; + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + //lan + gmac2: ethernet@37400000 { + status = "ok"; + phy-mode = "sgmii"; + qcom,id = <2>; + qcom,phy_mdio_addr = <0>; /* none */ + qcom,poll_required = <0>; /* no polling */ + qcom,rgmii_delay = <0>; + qcom,emulation = <0>; + mtd-mac-address = <&ART 0>; + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + + rpm@108000 { + pinctrl-0 = <&i2c4_pins>; + pinctrl-names = "default"; + }; + }; + + gpio-keys { + compatible = "gpio-keys"; + pinctrl-0 = <&button_pins>; + pinctrl-names = "default"; + + reset { + label = "reset"; + gpios = <&qcom_pinmux 54 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + aoss { + label = "aoss"; + gpios = <&qcom_pinmux 65 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + }; + + gpio-leds { + compatible = "gpio-leds"; + pinctrl-0 = <&led_pins>; + pinctrl-names = "default"; + + power_white: power_white { + label = "wxr-2533dhp:white:power"; + gpios = <&qcom_pinmux 53 GPIO_ACTIVE_HIGH>; + default-state = "keep"; + }; + + power_orange: power_orange { + label = "wxr-2533dhp:orange:power"; + gpios = <&qcom_pinmux 9 GPIO_ACTIVE_HIGH>; + default-state = "keep"; + }; + + wireless_white: wireless_white { + label = "wxr-2533dhp:white:wireless"; + gpios = <&qcom_pinmux 24 GPIO_ACTIVE_HIGH>; + }; + + wireless_orange: wireless_orange { + label = "wxr-2533dhp:orange:wireless"; + gpios = <&qcom_pinmux 23 GPIO_ACTIVE_HIGH>; + }; + + internet_white: internet_white { + label = "wxr-2533dhp:white:internet"; + gpios = <&qcom_pinmux 22 GPIO_ACTIVE_HIGH>; + }; + + internet_orange: internet_orange { + label = "wxr-2533dhp:orange:internet"; + gpios = <&qcom_pinmux 16 GPIO_ACTIVE_HIGH>; + }; + + router_white: router_white { + label = "wxr-2533dhp:white:router"; + gpios = <&qcom_pinmux 26 GPIO_ACTIVE_LOW>; + }; + + router_orange: router_orange { + label = "wxr-2533dhp:orange:router"; + gpios = <&qcom_pinmux 25 GPIO_ACTIVE_HIGH>; + }; + + usb_green: usb_green { + label = "wxr-2533dhp:green:usb"; + gpios = <&qcom_pinmux 7 GPIO_ACTIVE_HIGH>; + }; + + guest_green: guest_green { + label = "wxr-2533dhp:green:guest"; + gpios = <&qcom_pinmux 8 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&adm_dma { + status = "ok"; +}; diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile index d0a22242b..09ce82b93 100644 --- a/target/linux/ipq806x/image/Makefile +++ b/target/linux/ipq806x/image/Makefile @@ -252,6 +252,24 @@ define Device/RT-AC58U DEVICE_PACKAGES := kmod-usb-phy-qcom-ipq4019 ipq-wifi-rt-ac58u endef +define Device/RT-ACRH17 + $(call Device/FitImageLzma) + DEVICE_DTS := qcom-ipq4019-rt-acrh17 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DTB_SIZE := 65536 + BOARD_NAME := rt-acrh17 + KERNEL_LOADADDR := 0x80208000 + DEVICE_TITLE := Asus RT-ACRH17 + IMAGE_SIZE := 20439364 + FILESYSTEMS := squashfs + UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-ACRH17') + IMAGES = sysupgrade.tar flash-factory.trx + IMAGE/flash-factory.trx := copy-file $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE) | uImage none + IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata + DEVICE_PACKAGES := kmod-usb-phy-qcom-ipq4019 ipq-wifi-rt-ac58u ath10k-firmware-qca9984 +endef + define Device/NBG6817 DEVICE_DTS := qcom-ipq8065-nbg6817 KERNEL_SIZE := 4096k @@ -293,8 +311,8 @@ define Device/AP-DK04.1-C1 endef TARGET_DEVICES += AP148 AP148-legacy C2600 D7800 DB149 EA8500 FRITZ4040 R7500 \ - R7500v2 R7800 RT-AC58U NBG6817 VR2600v AP-DK04.1-C1 + R7500v2 R7800 RT-AC58U RT-ACRH17 NBG6817 VR2600v AP-DK04.1-C1 .NOTPARALLEL: -$(eval $(call BuildImage)) +$(eval $(call BuildImage)) \ No newline at end of file From 140a51482d00f5a88554c8e72b2e4a9e9e97c78f Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 24 Oct 2017 23:12:44 +0800 Subject: [PATCH 02/22] update kernel to 4.9.58 --- include/kernel-version.mk | 4 +- ...vert-to-current-get_user_pages-argum.patch | 2 +- ...ate-for-rename-of-page_cache_release.patch | 4 +- ...90-net-generalize-napi_complete_done.patch | 2 +- .../hack-4.9/904-debloat_dma_buf.patch | 2 +- .../pending-4.9/920-mangle_bootargs.patch | 4 +- ...Mangle-bootloader-s-kernel-arguments.patch | 4 +- .../601-net-support-layerscape.patch | 4 +- .../patches-4.9/0052-stmmac-form-4-12.patch | 464 +++++++++--------- 9 files changed, 234 insertions(+), 256 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 21e0c1f48..2bddc8710 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -4,11 +4,11 @@ LINUX_RELEASE?=1 LINUX_VERSION-3.18 = .71 LINUX_VERSION-4.4 = .93 -LINUX_VERSION-4.9 = .57 +LINUX_VERSION-4.9 = .58 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240 LINUX_KERNEL_HASH-4.4.93 = ed349314f16e78a6571b5f8884f6452782aef6c26b81bcc7ccdac44ecd917c36 -LINUX_KERNEL_HASH-4.9.57 = 09230554ec6a34a12e2d2a6b32733aed3c9bc90b1662cc1b06dd67bf726c96a6 +LINUX_KERNEL_HASH-4.9.58 = 748f12a28689644b6a9102c67f8fa7938ca73823a949ba6f65024aecf2f221a7 ifdef KERNEL_PATCHVER LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER))) diff --git a/target/linux/brcm2708/patches-4.9/950-0100-staging-vchi-Convert-to-current-get_user_pages-argum.patch b/target/linux/brcm2708/patches-4.9/950-0100-staging-vchi-Convert-to-current-get_user_pages-argum.patch index e80c41463..e5038ab64 100644 --- a/target/linux/brcm2708/patches-4.9/950-0100-staging-vchi-Convert-to-current-get_user_pages-argum.patch +++ b/target/linux/brcm2708/patches-4.9/950-0100-staging-vchi-Convert-to-current-get_user_pages-argum.patch @@ -11,7 +11,7 @@ Signed-off-by: Eric Anholt --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c -@@ -420,7 +420,7 @@ create_pagelist(char __user *buf, size_t +@@ -426,7 +426,7 @@ create_pagelist(char __user *buf, size_t *need_release = 0; /* do not try and release vmalloc pages */ } else { down_read(&task->mm->mmap_sem); diff --git a/target/linux/brcm2708/patches-4.9/950-0101-staging-vchi-Update-for-rename-of-page_cache_release.patch b/target/linux/brcm2708/patches-4.9/950-0101-staging-vchi-Update-for-rename-of-page_cache_release.patch index 8979bc2f6..5cc5ff165 100644 --- a/target/linux/brcm2708/patches-4.9/950-0101-staging-vchi-Update-for-rename-of-page_cache_release.patch +++ b/target/linux/brcm2708/patches-4.9/950-0101-staging-vchi-Update-for-rename-of-page_cache_release.patch @@ -12,7 +12,7 @@ Signed-off-by: Eric Anholt --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c -@@ -438,7 +438,7 @@ create_pagelist(char __user *buf, size_t +@@ -444,7 +444,7 @@ create_pagelist(char __user *buf, size_t while (actual_pages > 0) { actual_pages--; @@ -21,7 +21,7 @@ Signed-off-by: Eric Anholt } kfree(pagelist); if (actual_pages == 0) -@@ -579,7 +579,7 @@ free_pagelist(PAGELIST_T *pagelist, int +@@ -585,7 +585,7 @@ free_pagelist(PAGELIST_T *pagelist, int offset = 0; set_page_dirty(pg); } diff --git a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch index e1541e90a..d7b7b4897 100644 --- a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch +++ b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch @@ -819,7 +819,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/marvell/mvpp2.c +++ b/drivers/net/ethernet/marvell/mvpp2.c -@@ -5405,7 +5405,7 @@ static int mvpp2_poll(struct napi_struct +@@ -5404,7 +5404,7 @@ static int mvpp2_poll(struct napi_struct if (budget > 0) { cause_rx = 0; diff --git a/target/linux/generic/hack-4.9/904-debloat_dma_buf.patch b/target/linux/generic/hack-4.9/904-debloat_dma_buf.patch index 4f432c356..b9a5c1dca 100644 --- a/target/linux/generic/hack-4.9/904-debloat_dma_buf.patch +++ b/target/linux/generic/hack-4.9/904-debloat_dma_buf.patch @@ -54,7 +54,7 @@ Signed-off-by: Felix Fietkau +MODULE_LICENSE("GPL"); --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -2170,6 +2170,7 @@ int wake_up_state(struct task_struct *p, +@@ -2171,6 +2171,7 @@ int wake_up_state(struct task_struct *p, { return try_to_wake_up(p, state, 0); } diff --git a/target/linux/generic/pending-4.9/920-mangle_bootargs.patch b/target/linux/generic/pending-4.9/920-mangle_bootargs.patch index dc996808d..a985a7c95 100644 --- a/target/linux/generic/pending-4.9/920-mangle_bootargs.patch +++ b/target/linux/generic/pending-4.9/920-mangle_bootargs.patch @@ -31,7 +31,7 @@ Signed-off-by: Imre Kaloz help --- a/init/main.c +++ b/init/main.c -@@ -352,6 +352,29 @@ static inline void setup_nr_cpu_ids(void +@@ -351,6 +351,29 @@ static inline void setup_nr_cpu_ids(void static inline void smp_prepare_cpus(unsigned int maxcpus) { } #endif @@ -61,7 +61,7 @@ Signed-off-by: Imre Kaloz /* * We need to store the untouched command line for future reference. * We also need to store the touched command line since the parameter -@@ -504,6 +527,7 @@ asmlinkage __visible void __init start_k +@@ -503,6 +526,7 @@ asmlinkage __visible void __init start_k pr_notice("%s", linux_banner); setup_arch(&command_line); mm_init_cpumask(&init_mm); diff --git a/target/linux/ipq806x/patches-4.9/0067-generic-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/ipq806x/patches-4.9/0067-generic-Mangle-bootloader-s-kernel-arguments.patch index d34e08ff6..467ffbf22 100644 --- a/target/linux/ipq806x/patches-4.9/0067-generic-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/ipq806x/patches-4.9/0067-generic-Mangle-bootloader-s-kernel-arguments.patch @@ -157,7 +157,7 @@ Signed-off-by: Adrian Panella } --- a/init/main.c +++ b/init/main.c -@@ -88,6 +88,10 @@ +@@ -87,6 +87,10 @@ #include #include @@ -168,7 +168,7 @@ Signed-off-by: Adrian Panella static int kernel_init(void *); extern void init_IRQ(void); -@@ -538,6 +542,18 @@ asmlinkage __visible void __init start_k +@@ -537,6 +541,18 @@ asmlinkage __visible void __init start_k page_alloc_init(); pr_notice("Kernel command line: %s\n", boot_command_line); diff --git a/target/linux/layerscape/patches-4.9/601-net-support-layerscape.patch b/target/linux/layerscape/patches-4.9/601-net-support-layerscape.patch index 7f9477674..9db40dc2f 100644 --- a/target/linux/layerscape/patches-4.9/601-net-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/601-net-support-layerscape.patch @@ -962,7 +962,7 @@ Signed-off-by: Yangbo Lu /* Rx descriptors helper methods */ --- a/drivers/net/ethernet/marvell/mvpp2.c +++ b/drivers/net/ethernet/marvell/mvpp2.c -@@ -5762,7 +5762,7 @@ error: +@@ -5761,7 +5761,7 @@ error: return err; } @@ -971,7 +971,7 @@ Signed-off-by: Yangbo Lu mvpp2_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) { struct mvpp2_port *port = netdev_priv(dev); -@@ -5794,8 +5794,6 @@ mvpp2_get_stats64(struct net_device *dev +@@ -5793,8 +5793,6 @@ mvpp2_get_stats64(struct net_device *dev stats->rx_errors = dev->stats.rx_errors; stats->rx_dropped = dev->stats.rx_dropped; stats->tx_dropped = dev->stats.tx_dropped; diff --git a/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch b/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch index a5cdec552..285e4d276 100644 --- a/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch +++ b/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch @@ -2887,7 +2887,7 @@ + + /* Display RX ring */ + priv->hw->desc->display_ring(head_rx, DMA_RX_SIZE, true); -+ } + } +} + +static void stmmac_display_tx_rings(struct stmmac_priv *priv) @@ -2906,15 +2906,15 @@ + head_tx = (void *)tx_q->dma_etx; + else + head_tx = (void *)tx_q->dma_tx; -+ -+ priv->hw->desc->display_ring(head_tx, DMA_TX_SIZE, false); - } -+} - /* Display Rx ring */ - priv->hw->desc->display_ring(head_rx, DMA_RX_SIZE, true); - /* Display Tx ring */ - priv->hw->desc->display_ring(head_tx, DMA_TX_SIZE, false); ++ priv->hw->desc->display_ring(head_tx, DMA_TX_SIZE, false); ++ } ++} ++ +static void stmmac_display_rings(struct stmmac_priv *priv) +{ + /* Display RX ring */ @@ -3131,7 +3131,7 @@ if (priv->hw->mode->set_16kib_bfsize) bfsize = priv->hw->mode->set_16kib_bfsize(dev->mtu); -@@ -1018,257 +1228,516 @@ static int init_dma_desc_rings(struct ne +@@ -1018,235 +1228,409 @@ static int init_dma_desc_rings(struct ne priv->dma_buf_sz = bfsize; @@ -3163,10 +3163,7 @@ + p = &((rx_q->dma_erx + i)->basic); + else + p = rx_q->dma_rx + i; - -- ret = stmmac_init_rx_buffers(priv, p, i, flags); -- if (ret) -- goto err_init_rx_buffers; ++ + ret = stmmac_init_rx_buffers(priv, p, i, flags, + queue); + if (ret) @@ -3176,15 +3173,18 @@ + rx_q->rx_skbuff[i], rx_q->rx_skbuff[i]->data, + (unsigned int)rx_q->rx_skbuff_dma[i]); + } -+ + +- ret = stmmac_init_rx_buffers(priv, p, i, flags); +- if (ret) +- goto err_init_rx_buffers; + rx_q->cur_rx = 0; + rx_q->dirty_rx = (unsigned int)(i - DMA_RX_SIZE); -+ -+ stmmac_clear_rx_descriptors(priv, queue); - netif_dbg(priv, probe, priv->dev, "[%p]\t[%p]\t[%x]\n", - priv->rx_skbuff[i], priv->rx_skbuff[i]->data, - (unsigned int)priv->rx_skbuff_dma[i]); ++ stmmac_clear_rx_descriptors(priv, queue); ++ + /* Setup the chained descriptor addresses */ + if (priv->mode == STMMAC_CHAIN_MODE) { + if (priv->extend_desc) @@ -3277,13 +3277,8 @@ + priv->hw->mode->init(tx_q->dma_tx, + tx_q->dma_tx_phy, + DMA_TX_SIZE, 0); - } - -- priv->tx_skbuff_dma[i].buf = 0; -- priv->tx_skbuff_dma[i].map_as_page = false; -- priv->tx_skbuff_dma[i].len = 0; -- priv->tx_skbuff_dma[i].last_segment = false; -- priv->tx_skbuff[i] = NULL; ++ } ++ + for (i = 0; i < DMA_TX_SIZE; i++) { + struct dma_desc *p; + if (priv->extend_desc) @@ -3305,8 +3300,13 @@ + tx_q->tx_skbuff_dma[i].len = 0; + tx_q->tx_skbuff_dma[i].last_segment = false; + tx_q->tx_skbuff[i] = NULL; -+ } -+ + } + +- priv->tx_skbuff_dma[i].buf = 0; +- priv->tx_skbuff_dma[i].map_as_page = false; +- priv->tx_skbuff_dma[i].len = 0; +- priv->tx_skbuff_dma[i].last_segment = false; +- priv->tx_skbuff[i] = NULL; + tx_q->dirty_tx = 0; + tx_q->cur_tx = 0; + @@ -3387,10 +3387,17 @@ - priv->tx_skbuff_dma[i].buf, - priv->tx_skbuff_dma[i].len, - DMA_TO_DEVICE); +- } + for (i = 0; i < DMA_TX_SIZE; i++) + stmmac_free_tx_buffer(priv, queue, i); +} -+ + +- if (priv->tx_skbuff[i]) { +- dev_kfree_skb_any(priv->tx_skbuff[i]); +- priv->tx_skbuff[i] = NULL; +- priv->tx_skbuff_dma[i].buf = 0; +- priv->tx_skbuff_dma[i].map_as_page = false; +- } +/** + * free_dma_rx_desc_resources - free RX dma desc resources + * @priv: private structure @@ -3419,10 +3426,11 @@ + + kfree(rx_q->rx_skbuff_dma); + kfree(rx_q->rx_skbuff); -+ } -+} -+ -+/** + } + } + + /** +- * alloc_dma_desc_resources - alloc TX/RX resources. + * free_dma_tx_desc_resources - free TX dma desc resources + * @priv: private structure + */ @@ -3455,36 +3463,90 @@ + +/** + * alloc_dma_rx_desc_resources - alloc RX resources. -+ * @priv: private structure -+ * Description: according to which descriptor can be used (extend or basic) -+ * this function allocates the resources for TX and RX paths. In case of -+ * reception, for example, it pre-allocated the RX socket buffer in order to -+ * allow zero-copy mechanism. -+ */ + * @priv: private structure + * Description: according to which descriptor can be used (extend or basic) + * this function allocates the resources for TX and RX paths. In case of + * reception, for example, it pre-allocated the RX socket buffer in order to + * allow zero-copy mechanism. + */ +-static int alloc_dma_desc_resources(struct stmmac_priv *priv) +static int alloc_dma_rx_desc_resources(struct stmmac_priv *priv) -+{ + { + u32 rx_count = priv->plat->rx_queues_to_use; -+ int ret = -ENOMEM; + int ret = -ENOMEM; + u32 queue; -+ + +- priv->rx_skbuff_dma = kmalloc_array(DMA_RX_SIZE, sizeof(dma_addr_t), +- GFP_KERNEL); +- if (!priv->rx_skbuff_dma) +- return -ENOMEM; + /* RX queues buffers and DMA */ + for (queue = 0; queue < rx_count; queue++) { + struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; -+ + +- priv->rx_skbuff = kmalloc_array(DMA_RX_SIZE, sizeof(struct sk_buff *), +- GFP_KERNEL); +- if (!priv->rx_skbuff) +- goto err_rx_skbuff; +- +- priv->tx_skbuff_dma = kmalloc_array(DMA_TX_SIZE, +- sizeof(*priv->tx_skbuff_dma), +- GFP_KERNEL); +- if (!priv->tx_skbuff_dma) +- goto err_tx_skbuff_dma; +- +- priv->tx_skbuff = kmalloc_array(DMA_TX_SIZE, sizeof(struct sk_buff *), +- GFP_KERNEL); +- if (!priv->tx_skbuff) +- goto err_tx_skbuff; +- +- if (priv->extend_desc) { +- priv->dma_erx = dma_zalloc_coherent(priv->device, DMA_RX_SIZE * +- sizeof(struct +- dma_extended_desc), +- &priv->dma_rx_phy, +- GFP_KERNEL); +- if (!priv->dma_erx) +- goto err_dma; + rx_q->queue_index = queue; + rx_q->priv_data = priv; -+ + +- priv->dma_etx = dma_zalloc_coherent(priv->device, DMA_TX_SIZE * +- sizeof(struct +- dma_extended_desc), +- &priv->dma_tx_phy, + rx_q->rx_skbuff_dma = kmalloc_array(DMA_RX_SIZE, + sizeof(dma_addr_t), -+ GFP_KERNEL); + GFP_KERNEL); +- if (!priv->dma_etx) { +- dma_free_coherent(priv->device, DMA_RX_SIZE * +- sizeof(struct dma_extended_desc), +- priv->dma_erx, priv->dma_rx_phy); +- goto err_dma; +- } +- } else { +- priv->dma_rx = dma_zalloc_coherent(priv->device, DMA_RX_SIZE * +- sizeof(struct dma_desc), +- &priv->dma_rx_phy, +- GFP_KERNEL); +- if (!priv->dma_rx) +- goto err_dma; + if (!rx_q->rx_skbuff_dma) + return -ENOMEM; -+ + +- priv->dma_tx = dma_zalloc_coherent(priv->device, DMA_TX_SIZE * +- sizeof(struct dma_desc), +- &priv->dma_tx_phy, +- GFP_KERNEL); +- if (!priv->dma_tx) { +- dma_free_coherent(priv->device, DMA_RX_SIZE * +- sizeof(struct dma_desc), +- priv->dma_rx, priv->dma_rx_phy); + rx_q->rx_skbuff = kmalloc_array(DMA_RX_SIZE, + sizeof(struct sk_buff *), + GFP_KERNEL); + if (!rx_q->rx_skbuff) -+ goto err_dma; + goto err_dma; + + if (priv->extend_desc) { + rx_q->dma_erx = dma_zalloc_coherent(priv->device, @@ -3505,12 +3567,19 @@ + GFP_KERNEL); + if (!rx_q->dma_rx) + goto err_dma; -+ } -+ } -+ -+ return 0; -+ -+err_dma: + } + } + + return 0; + + err_dma: +- kfree(priv->tx_skbuff); +-err_tx_skbuff: +- kfree(priv->tx_skbuff_dma); +-err_tx_skbuff_dma: +- kfree(priv->rx_skbuff); +-err_rx_skbuff: +- kfree(priv->rx_skbuff_dma); + free_dma_rx_desc_resources(priv); + + return ret; @@ -3567,7 +3636,7 @@ + GFP_KERNEL); + if (!tx_q->dma_tx) + goto err_dma_buffers; - } ++ } + } + + return 0; @@ -3575,9 +3644,9 @@ +err_dma_buffers: + free_dma_tx_desc_resources(priv); + -+ return ret; -+} -+ + return ret; + } + +/** + * alloc_dma_desc_resources - alloc TX/RX resources. + * @priv: private structure @@ -3603,176 +3672,7 @@ + * free_dma_desc_resources - free dma desc resources + * @priv: private structure + */ -+static void free_dma_desc_resources(struct stmmac_priv *priv) -+{ -+ /* Release the DMA RX socket buffers */ -+ free_dma_rx_desc_resources(priv); -+ -+ /* Release the DMA TX socket buffers */ -+ free_dma_tx_desc_resources(priv); -+} -+ -+/** -+ * stmmac_mac_enable_rx_queues - Enable MAC rx queues -+ * @priv: driver private structure -+ * Description: It is used for enabling the rx queues in the MAC -+ */ -+static void stmmac_mac_enable_rx_queues(struct stmmac_priv *priv) -+{ -+ u32 rx_queues_count = priv->plat->rx_queues_to_use; -+ int queue; -+ u8 mode; - -- if (priv->tx_skbuff[i]) { -- dev_kfree_skb_any(priv->tx_skbuff[i]); -- priv->tx_skbuff[i] = NULL; -- priv->tx_skbuff_dma[i].buf = 0; -- priv->tx_skbuff_dma[i].map_as_page = false; -- } -+ for (queue = 0; queue < rx_queues_count; queue++) { -+ mode = priv->plat->rx_queues_cfg[queue].mode_to_use; -+ priv->hw->mac->rx_queue_enable(priv->hw, mode, queue); - } - } - - /** -- * alloc_dma_desc_resources - alloc TX/RX resources. -- * @priv: private structure -- * Description: according to which descriptor can be used (extend or basic) -- * this function allocates the resources for TX and RX paths. In case of -- * reception, for example, it pre-allocated the RX socket buffer in order to -- * allow zero-copy mechanism. -+ * stmmac_start_rx_dma - start RX DMA channel -+ * @priv: driver private structure -+ * @chan: RX channel index -+ * Description: -+ * This starts a RX DMA channel - */ --static int alloc_dma_desc_resources(struct stmmac_priv *priv) -+static void stmmac_start_rx_dma(struct stmmac_priv *priv, u32 chan) - { -- int ret = -ENOMEM; -- -- priv->rx_skbuff_dma = kmalloc_array(DMA_RX_SIZE, sizeof(dma_addr_t), -- GFP_KERNEL); -- if (!priv->rx_skbuff_dma) -- return -ENOMEM; -- -- priv->rx_skbuff = kmalloc_array(DMA_RX_SIZE, sizeof(struct sk_buff *), -- GFP_KERNEL); -- if (!priv->rx_skbuff) -- goto err_rx_skbuff; -- -- priv->tx_skbuff_dma = kmalloc_array(DMA_TX_SIZE, -- sizeof(*priv->tx_skbuff_dma), -- GFP_KERNEL); -- if (!priv->tx_skbuff_dma) -- goto err_tx_skbuff_dma; -- -- priv->tx_skbuff = kmalloc_array(DMA_TX_SIZE, sizeof(struct sk_buff *), -- GFP_KERNEL); -- if (!priv->tx_skbuff) -- goto err_tx_skbuff; -- -- if (priv->extend_desc) { -- priv->dma_erx = dma_zalloc_coherent(priv->device, DMA_RX_SIZE * -- sizeof(struct -- dma_extended_desc), -- &priv->dma_rx_phy, -- GFP_KERNEL); -- if (!priv->dma_erx) -- goto err_dma; -- -- priv->dma_etx = dma_zalloc_coherent(priv->device, DMA_TX_SIZE * -- sizeof(struct -- dma_extended_desc), -- &priv->dma_tx_phy, -- GFP_KERNEL); -- if (!priv->dma_etx) { -- dma_free_coherent(priv->device, DMA_RX_SIZE * -- sizeof(struct dma_extended_desc), -- priv->dma_erx, priv->dma_rx_phy); -- goto err_dma; -- } -- } else { -- priv->dma_rx = dma_zalloc_coherent(priv->device, DMA_RX_SIZE * -- sizeof(struct dma_desc), -- &priv->dma_rx_phy, -- GFP_KERNEL); -- if (!priv->dma_rx) -- goto err_dma; -+ netdev_dbg(priv->dev, "DMA RX processes started in channel %d\n", chan); -+ priv->hw->dma->start_rx(priv->ioaddr, chan); -+} - -- priv->dma_tx = dma_zalloc_coherent(priv->device, DMA_TX_SIZE * -- sizeof(struct dma_desc), -- &priv->dma_tx_phy, -- GFP_KERNEL); -- if (!priv->dma_tx) { -- dma_free_coherent(priv->device, DMA_RX_SIZE * -- sizeof(struct dma_desc), -- priv->dma_rx, priv->dma_rx_phy); -- goto err_dma; -- } -- } -+/** -+ * stmmac_start_tx_dma - start TX DMA channel -+ * @priv: driver private structure -+ * @chan: TX channel index -+ * Description: -+ * This starts a TX DMA channel -+ */ -+static void stmmac_start_tx_dma(struct stmmac_priv *priv, u32 chan) -+{ -+ netdev_dbg(priv->dev, "DMA TX processes started in channel %d\n", chan); -+ priv->hw->dma->start_tx(priv->ioaddr, chan); -+} - -- return 0; -+/** -+ * stmmac_stop_rx_dma - stop RX DMA channel -+ * @priv: driver private structure -+ * @chan: RX channel index -+ * Description: -+ * This stops a RX DMA channel -+ */ -+static void stmmac_stop_rx_dma(struct stmmac_priv *priv, u32 chan) -+{ -+ netdev_dbg(priv->dev, "DMA RX processes stopped in channel %d\n", chan); -+ priv->hw->dma->stop_rx(priv->ioaddr, chan); -+} - --err_dma: -- kfree(priv->tx_skbuff); --err_tx_skbuff: -- kfree(priv->tx_skbuff_dma); --err_tx_skbuff_dma: -- kfree(priv->rx_skbuff); --err_rx_skbuff: -- kfree(priv->rx_skbuff_dma); -- return ret; -+/** -+ * stmmac_stop_tx_dma - stop TX DMA channel -+ * @priv: driver private structure -+ * @chan: TX channel index -+ * Description: -+ * This stops a TX DMA channel -+ */ -+static void stmmac_stop_tx_dma(struct stmmac_priv *priv, u32 chan) -+{ -+ netdev_dbg(priv->dev, "DMA TX processes stopped in channel %d\n", chan); -+ priv->hw->dma->stop_tx(priv->ioaddr, chan); - } - --static void free_dma_desc_resources(struct stmmac_priv *priv) -+/** -+ * stmmac_start_all_dma - start all RX and TX DMA channels -+ * @priv: driver private structure -+ * Description: -+ * This starts all the RX and TX DMA channels -+ */ -+static void stmmac_start_all_dma(struct stmmac_priv *priv) + static void free_dma_desc_resources(struct stmmac_priv *priv) { - /* Release the DMA TX/RX socket buffers */ - dma_free_rx_skbufs(priv); @@ -3798,6 +3698,99 @@ - kfree(priv->rx_skbuff); - kfree(priv->tx_skbuff_dma); - kfree(priv->tx_skbuff); ++ /* Release the DMA RX socket buffers */ ++ free_dma_rx_desc_resources(priv); ++ ++ /* Release the DMA TX socket buffers */ ++ free_dma_tx_desc_resources(priv); + } + + /** +@@ -1256,19 +1640,104 @@ static void free_dma_desc_resources(stru + */ + static void stmmac_mac_enable_rx_queues(struct stmmac_priv *priv) + { +- int rx_count = priv->dma_cap.number_rx_queues; +- int queue = 0; ++ u32 rx_queues_count = priv->plat->rx_queues_to_use; ++ int queue; ++ u8 mode; + +- /* If GMAC does not have multiple queues, then this is not necessary*/ +- if (rx_count == 1) +- return; ++ for (queue = 0; queue < rx_queues_count; queue++) { ++ mode = priv->plat->rx_queues_cfg[queue].mode_to_use; ++ priv->hw->mac->rx_queue_enable(priv->hw, mode, queue); ++ } ++} + +- /** +- * If the core is synthesized with multiple rx queues / multiple +- * dma channels, then rx queues will be disabled by default. +- * For now only rx queue 0 is enabled. +- */ +- priv->hw->mac->rx_queue_enable(priv->hw, queue); ++/** ++ * stmmac_start_rx_dma - start RX DMA channel ++ * @priv: driver private structure ++ * @chan: RX channel index ++ * Description: ++ * This starts a RX DMA channel ++ */ ++static void stmmac_start_rx_dma(struct stmmac_priv *priv, u32 chan) ++{ ++ netdev_dbg(priv->dev, "DMA RX processes started in channel %d\n", chan); ++ priv->hw->dma->start_rx(priv->ioaddr, chan); ++} ++ ++/** ++ * stmmac_start_tx_dma - start TX DMA channel ++ * @priv: driver private structure ++ * @chan: TX channel index ++ * Description: ++ * This starts a TX DMA channel ++ */ ++static void stmmac_start_tx_dma(struct stmmac_priv *priv, u32 chan) ++{ ++ netdev_dbg(priv->dev, "DMA TX processes started in channel %d\n", chan); ++ priv->hw->dma->start_tx(priv->ioaddr, chan); ++} ++ ++/** ++ * stmmac_stop_rx_dma - stop RX DMA channel ++ * @priv: driver private structure ++ * @chan: RX channel index ++ * Description: ++ * This stops a RX DMA channel ++ */ ++static void stmmac_stop_rx_dma(struct stmmac_priv *priv, u32 chan) ++{ ++ netdev_dbg(priv->dev, "DMA RX processes stopped in channel %d\n", chan); ++ priv->hw->dma->stop_rx(priv->ioaddr, chan); ++} ++ ++/** ++ * stmmac_stop_tx_dma - stop TX DMA channel ++ * @priv: driver private structure ++ * @chan: TX channel index ++ * Description: ++ * This stops a TX DMA channel ++ */ ++static void stmmac_stop_tx_dma(struct stmmac_priv *priv, u32 chan) ++{ ++ netdev_dbg(priv->dev, "DMA TX processes stopped in channel %d\n", chan); ++ priv->hw->dma->stop_tx(priv->ioaddr, chan); ++} ++ ++/** ++ * stmmac_start_all_dma - start all RX and TX DMA channels ++ * @priv: driver private structure ++ * Description: ++ * This starts all the RX and TX DMA channels ++ */ ++static void stmmac_start_all_dma(struct stmmac_priv *priv) ++{ + u32 rx_channels_count = priv->plat->rx_queues_to_use; + u32 tx_channels_count = priv->plat->tx_queues_to_use; + u32 chan = 0; @@ -3807,38 +3800,23 @@ + + for (chan = 0; chan < tx_channels_count; chan++) + stmmac_start_tx_dma(priv, chan); - } - - /** -- * stmmac_mac_enable_rx_queues - Enable MAC rx queues -- * @priv: driver private structure -- * Description: It is used for enabling the rx queues in the MAC ++} ++ ++/** + * stmmac_stop_all_dma - stop all RX and TX DMA channels + * @priv: driver private structure + * Description: + * This stops the RX and TX DMA channels - */ --static void stmmac_mac_enable_rx_queues(struct stmmac_priv *priv) ++ */ +static void stmmac_stop_all_dma(struct stmmac_priv *priv) - { -- int rx_count = priv->dma_cap.number_rx_queues; -- int queue = 0; ++{ + u32 rx_channels_count = priv->plat->rx_queues_to_use; + u32 tx_channels_count = priv->plat->tx_queues_to_use; + u32 chan = 0; - -- /* If GMAC does not have multiple queues, then this is not necessary*/ -- if (rx_count == 1) -- return; ++ + for (chan = 0; chan < rx_channels_count; chan++) + stmmac_stop_rx_dma(priv, chan); - -- /** -- * If the core is synthesized with multiple rx queues / multiple -- * dma channels, then rx queues will be disabled by default. -- * For now only rx queue 0 is enabled. -- */ -- priv->hw->mac->rx_queue_enable(priv->hw, queue); ++ + for (chan = 0; chan < tx_channels_count; chan++) + stmmac_stop_tx_dma(priv, chan); } From 903264764508dfceb4f73020afc7dc723dbea617 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 24 Oct 2017 23:15:26 +0800 Subject: [PATCH 03/22] update ar71xx to kernel 4.9 again --- target/linux/ar71xx/Makefile | 2 +- target/linux/ar71xx/config-4.4 | 3 +- .../arch/mips/ath79/mach-archer-c25-v1.c | 18 +++---- .../arch/mips/ath79/mach-archer-c59-v1.c | 18 +++---- .../files/arch/mips/ath79/mach-archer-c7-v4.c | 2 +- .../ar71xx/files/arch/mips/ath79/mach-rb91x.c | 2 +- .../files/arch/mips/ath79/mach-tl-wr942n-v1.c | 18 +++---- .../files/drivers/mtd/nand/rb4xx_nand.c | 48 +++++++++++++++---- .../files/drivers/mtd/nand/rb750_nand.c | 43 +++++++++++++---- .../files/drivers/mtd/nand/rb91x_nand.c | 44 +++++++++++++---- target/linux/ar71xx/image/generic.mk | 1 - .../ar71xx/image/lzma-loader/src/Makefile | 8 ++-- .../linux/ar71xx/image/lzma-loader/src/head.S | 13 +++++ target/linux/ar71xx/image/tp-link.mk | 5 +- target/linux/ar71xx/image/ubnt.mk | 1 - target/linux/ar71xx/mikrotik/config-default | 1 + 16 files changed, 160 insertions(+), 67 deletions(-) diff --git a/target/linux/ar71xx/Makefile b/target/linux/ar71xx/Makefile index 3f5bc6724..6d5b4c52b 100644 --- a/target/linux/ar71xx/Makefile +++ b/target/linux/ar71xx/Makefile @@ -13,7 +13,7 @@ FEATURES:=usbgadget CPU_TYPE:=24kc SUBTARGETS:=generic nand mikrotik -KERNEL_PATCHVER:=4.4 +KERNEL_PATCHVER:=4.9 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4 index 1f4d9f4c3..4793bf4de 100644 --- a/target/linux/ar71xx/config-4.4 +++ b/target/linux/ar71xx/config-4.4 @@ -223,8 +223,8 @@ CONFIG_ATH79_MACH_UBNT=y CONFIG_ATH79_MACH_UBNT_UNIFIAC=y CONFIG_ATH79_MACH_UBNT_XM=y CONFIG_ATH79_MACH_WEIO=y -CONFIG_ATH79_MACH_WHR_HP_G300N=y # CONFIG_ATH79_MACH_WI2A_AC200I is not set +CONFIG_ATH79_MACH_WHR_HP_G300N=y CONFIG_ATH79_MACH_WLAE_AG300N=y CONFIG_ATH79_MACH_WLR8100=y CONFIG_ATH79_MACH_WNDAP360=y @@ -374,7 +374,6 @@ CONFIG_MIPS_CLOCK_VSYSCALL=y CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y # CONFIG_MIPS_CMDLINE_FROM_DTB is not set # CONFIG_MIPS_ELF_APPENDED_DTB is not set -CONFIG_MIPS_FPU_EMULATOR=y # CONFIG_MIPS_HUGE_TLB_SUPPORT is not set CONFIG_MIPS_L1_CACHE_SHIFT=5 CONFIG_MIPS_MACHINE=y diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c25-v1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c25-v1.c index 9e08c157e..c6c646322 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c25-v1.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c25-v1.c @@ -35,15 +35,15 @@ #define ARCHER_C25_GPIO_SHIFT_SRCLR 19 /* MR, Master Reset */ #define ARCHER_C25_GPIO_SHIFT_RCLK 16 /* STCP, Storage Reg Clock Input */ -#define ARCHER_C25_74HC_GPIO_BASE QCA956X_GPIO_COUNT -#define ARCHER_C25_74HC_GPIO_LED_WAN_AMBER 27 -#define ARCHER_C25_74HC_GPIO_LED_WAN_GREEN 28 -#define ARCHER_C25_74HC_GPIO_LED_WLAN2 29 -#define ARCHER_C25_74HC_GPIO_LED_WLAN5 30 -#define ARCHER_C25_74HC_GPIO_LED_LAN1 23 -#define ARCHER_C25_74HC_GPIO_LED_LAN2 24 -#define ARCHER_C25_74HC_GPIO_LED_LAN3 25 -#define ARCHER_C25_74HC_GPIO_LED_LAN4 26 +#define ARCHER_C25_74HC_GPIO_BASE 32 +#define ARCHER_C25_74HC_GPIO_LED_WAN_AMBER (ARCHER_C25_74HC_GPIO_BASE + 4) +#define ARCHER_C25_74HC_GPIO_LED_WAN_GREEN (ARCHER_C25_74HC_GPIO_BASE + 5) +#define ARCHER_C25_74HC_GPIO_LED_WLAN2 (ARCHER_C25_74HC_GPIO_BASE + 6) +#define ARCHER_C25_74HC_GPIO_LED_WLAN5 (ARCHER_C25_74HC_GPIO_BASE + 7) +#define ARCHER_C25_74HC_GPIO_LED_LAN1 (ARCHER_C25_74HC_GPIO_BASE + 0) +#define ARCHER_C25_74HC_GPIO_LED_LAN2 (ARCHER_C25_74HC_GPIO_BASE + 1) +#define ARCHER_C25_74HC_GPIO_LED_LAN3 (ARCHER_C25_74HC_GPIO_BASE + 2) +#define ARCHER_C25_74HC_GPIO_LED_LAN4 (ARCHER_C25_74HC_GPIO_BASE + 3) #define ARCHER_C25_V1_SSR_BIT_0 0 #define ARCHER_C25_V1_SSR_BIT_1 1 diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c59-v1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c59-v1.c index da15919a5..3c85a2055 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c59-v1.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c59-v1.c @@ -43,15 +43,15 @@ #define ARCHER_C59_GPIO_SHIFT_SRCLR 19 #define ARCHER_C59_GPIO_SHIFT_RCLK 20 -#define ARCHER_C59_74HC_GPIO_BASE QCA956X_GPIO_COUNT -#define ARCHER_C59_74HC_GPIO_LED_POWER 23 -#define ARCHER_C59_74HC_GPIO_LED_WLAN2 24 -#define ARCHER_C59_74HC_GPIO_LED_WLAN5 25 -#define ARCHER_C59_74HC_GPIO_LED_LAN 26 -#define ARCHER_C59_74HC_GPIO_LED_WAN_GREEN 27 -#define ARCHER_C59_74HC_GPIO_LED_WAN_AMBER 28 -#define ARCHER_C59_74HC_GPIO_LED_WPS 29 -#define ARCHER_C59_74HC_GPIO_LED_USB 30 +#define ARCHER_C59_74HC_GPIO_BASE 32 +#define ARCHER_C59_74HC_GPIO_LED_POWER (ARCHER_C59_74HC_GPIO_BASE + 0) +#define ARCHER_C59_74HC_GPIO_LED_WLAN2 (ARCHER_C59_74HC_GPIO_BASE + 1) +#define ARCHER_C59_74HC_GPIO_LED_WLAN5 (ARCHER_C59_74HC_GPIO_BASE + 2) +#define ARCHER_C59_74HC_GPIO_LED_LAN (ARCHER_C59_74HC_GPIO_BASE + 3) +#define ARCHER_C59_74HC_GPIO_LED_WAN_GREEN (ARCHER_C59_74HC_GPIO_BASE + 4) +#define ARCHER_C59_74HC_GPIO_LED_WAN_AMBER (ARCHER_C59_74HC_GPIO_BASE + 5) +#define ARCHER_C59_74HC_GPIO_LED_WPS (ARCHER_C59_74HC_GPIO_BASE + 6) +#define ARCHER_C59_74HC_GPIO_LED_USB (ARCHER_C59_74HC_GPIO_BASE + 7) #define ARCHER_C59_V1_SSR_BIT_0 0 #define ARCHER_C59_V1_SSR_BIT_1 1 diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7-v4.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7-v4.c index 64955c799..21b8e8cf8 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7-v4.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7-v4.c @@ -56,7 +56,7 @@ #define ARCHER_C7_GPIO_LED_USB1 7 #define ARCHER_C7_GPIO_LED_USB2 8 -#define ARCHER_C7_74HC_GPIO_BASE QCA956X_GPIO_COUNT +#define ARCHER_C7_74HC_GPIO_BASE 32 #define ARCHER_C7_GPIO_LED_WPS (ARCHER_C7_74HC_GPIO_BASE + 0) #define ARCHER_C7_GPIO_LED_LAN1 (ARCHER_C7_74HC_GPIO_BASE + 1) #define ARCHER_C7_GPIO_LED_LAN2 (ARCHER_C7_74HC_GPIO_BASE + 2) diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c index 64f927dc6..691566fa8 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c @@ -53,7 +53,7 @@ #define RB91X_FLAG_USB BIT(0) #define RB91X_FLAG_PCIE BIT(1) -#define RB91X_LATCH_GPIO_BASE AR934X_GPIO_COUNT +#define RB91X_LATCH_GPIO_BASE 32 #define RB91X_LATCH_GPIO(_x) (RB91X_LATCH_GPIO_BASE + (_x)) #define RB91X_SSR_GPIO_BASE (RB91X_LATCH_GPIO_BASE + AR934X_GPIO_COUNT) diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr942n-v1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr942n-v1.c index 76f6a0759..32e2bc952 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr942n-v1.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr942n-v1.c @@ -49,15 +49,15 @@ #define TL_WR942N_V1_GPIO_LED_WPS 21 #define TL_WR942N_V1_GPIO_LED_STATUS 22 -#define TL_WR942N_V1_74HC_GPIO_BASE QCA956X_GPIO_COUNT -#define TL_WR942N_V1_74HC_GPIO_LED_LAN4 23 -#define TL_WR942N_V1_74HC_GPIO_LED_LAN3 24 -#define TL_WR942N_V1_74HC_GPIO_LED_LAN2 25 -#define TL_WR942N_V1_74HC_GPIO_LED_LAN1 26 -#define TL_WR942N_V1_74HC_GPIO_LED_WAN_GREEN 27 -#define TL_WR942N_V1_74HC_GPIO_LED_WAN_AMBER 28 -#define TL_WR942N_V1_74HC_GPIO_LED_WLAN 29 -#define TL_WR942N_V1_74HC_GPIO_HUB_RESET 30 /* from u-boot sources */ +#define TL_WR942N_V1_74HC_GPIO_BASE 32 +#define TL_WR942N_V1_74HC_GPIO_LED_LAN4 (TL_WR942N_V1_74HC_GPIO_BASE + 0) +#define TL_WR942N_V1_74HC_GPIO_LED_LAN3 (TL_WR942N_V1_74HC_GPIO_BASE + 1) +#define TL_WR942N_V1_74HC_GPIO_LED_LAN2 (TL_WR942N_V1_74HC_GPIO_BASE + 2) +#define TL_WR942N_V1_74HC_GPIO_LED_LAN1 (TL_WR942N_V1_74HC_GPIO_BASE + 3) +#define TL_WR942N_V1_74HC_GPIO_LED_WAN_GREEN (TL_WR942N_V1_74HC_GPIO_BASE + 4) +#define TL_WR942N_V1_74HC_GPIO_LED_WAN_AMBER (TL_WR942N_V1_74HC_GPIO_BASE + 5) +#define TL_WR942N_V1_74HC_GPIO_LED_WLAN (TL_WR942N_V1_74HC_GPIO_BASE + 6) +#define TL_WR942N_V1_74HC_GPIO_HUB_RESET (TL_WR942N_V1_74HC_GPIO_BASE + 7) /* from u-boot sources */ #define TL_WR942N_V1_SSR_BIT_0 0 #define TL_WR942N_V1_SSR_BIT_1 1 diff --git a/target/linux/ar71xx/files/drivers/mtd/nand/rb4xx_nand.c b/target/linux/ar71xx/files/drivers/mtd/nand/rb4xx_nand.c index b397575f7..5bbe9789f 100644 --- a/target/linux/ar71xx/files/drivers/mtd/nand/rb4xx_nand.c +++ b/target/linux/ar71xx/files/drivers/mtd/nand/rb4xx_nand.c @@ -39,9 +39,31 @@ struct rb4xx_nand_info { struct nand_chip chip; +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) struct mtd_info mtd; +#endif }; +static inline struct rb4xx_nand_info *mtd_to_rbinfo(struct mtd_info *mtd) +{ +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) + return container_of(mtd, struct rb4xx_nand_info, mtd); +#else + struct nand_chip *chip = mtd_to_nand(mtd); + + return container_of(chip, struct rb4xx_nand_info, chip); +#endif +} + +static struct mtd_info *rbinfo_to_mtd(struct rb4xx_nand_info *nfc) +{ +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) + return &nfc->mtd; +#else + return nand_to_mtd(&nfc->chip); +#endif +} + #if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) /* * We need to use the OLD Yaffs-1 OOB layout, otherwise the RB bootloader @@ -191,6 +213,7 @@ static void rb4xx_nand_read_buf(struct mtd_info *mtd, unsigned char *buf, static int rb4xx_nand_probe(struct platform_device *pdev) { struct rb4xx_nand_info *info; + struct mtd_info *mtd; int ret; printk(KERN_INFO DRV_DESC " version " DRV_VERSION "\n"); @@ -259,8 +282,12 @@ static int rb4xx_nand_probe(struct platform_device *pdev) } info->chip.priv = &info; - info->mtd.priv = &info->chip; - info->mtd.owner = THIS_MODULE; + mtd = rbinfo_to_mtd(info); + +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) + mtd->priv = &info->chip; +#endif + mtd->owner = THIS_MODULE; info->chip.cmd_ctrl = rb4xx_nand_cmd_ctrl; info->chip.dev_ready = rb4xx_nand_dev_ready; @@ -270,30 +297,33 @@ static int rb4xx_nand_probe(struct platform_device *pdev) info->chip.chip_delay = 25; info->chip.ecc.mode = NAND_ECC_SOFT; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0) + info->chip.ecc.algo = NAND_ECC_HAMMING; +#endif info->chip.options = NAND_NO_SUBPAGE_WRITE; platform_set_drvdata(pdev, info); - ret = nand_scan_ident(&info->mtd, 1, NULL); + ret = nand_scan_ident(mtd, 1, NULL); if (ret) { ret = -ENXIO; goto err_free_info; } - if (info->mtd.writesize == 512) + if (mtd->writesize == 512) #if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) info->chip.ecc.layout = &rb4xx_nand_ecclayout; #else - mtd_set_ooblayout(&info->mtd, &rb4xx_nand_ecclayout_ops); + mtd_set_ooblayout(mtd, &rb4xx_nand_ecclayout_ops); #endif - ret = nand_scan_tail(&info->mtd); + ret = nand_scan_tail(mtd); if (ret) { return -ENXIO; goto err_set_drvdata; } - mtd_device_register(&info->mtd, rb4xx_nand_partitions, + mtd_device_register(mtd, rb4xx_nand_partitions, ARRAY_SIZE(rb4xx_nand_partitions)); if (ret) goto err_release_nand; @@ -301,7 +331,7 @@ static int rb4xx_nand_probe(struct platform_device *pdev) return 0; err_release_nand: - nand_release(&info->mtd); + nand_release(mtd); err_set_drvdata: platform_set_drvdata(pdev, NULL); err_free_info: @@ -322,7 +352,7 @@ static int rb4xx_nand_remove(struct platform_device *pdev) { struct rb4xx_nand_info *info = platform_get_drvdata(pdev); - nand_release(&info->mtd); + nand_release(rbinfo_to_mtd(info)); platform_set_drvdata(pdev, NULL); kfree(info); gpio_free(RB4XX_NAND_GPIO_NCE); diff --git a/target/linux/ar71xx/files/drivers/mtd/nand/rb750_nand.c b/target/linux/ar71xx/files/drivers/mtd/nand/rb750_nand.c index f8a6722cb..dbada68dd 100644 --- a/target/linux/ar71xx/files/drivers/mtd/nand/rb750_nand.c +++ b/target/linux/ar71xx/files/drivers/mtd/nand/rb750_nand.c @@ -41,13 +41,30 @@ struct rb750_nand_info { struct nand_chip chip; +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) struct mtd_info mtd; +#endif struct rb7xx_nand_platform_data *pdata; }; static inline struct rb750_nand_info *mtd_to_rbinfo(struct mtd_info *mtd) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) return container_of(mtd, struct rb750_nand_info, mtd); +#else + struct nand_chip *chip = mtd_to_nand(mtd); + + return container_of(chip, struct rb750_nand_info, chip); +#endif +} + +static struct mtd_info *rbinfo_to_mtd(struct rb750_nand_info *nfc) +{ +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) + return &nfc->mtd; +#else + return nand_to_mtd(&nfc->chip); +#endif } #if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) @@ -304,6 +321,7 @@ static int rb750_nand_probe(struct platform_device *pdev) { struct rb750_nand_info *info; struct rb7xx_nand_platform_data *pdata; + struct mtd_info *mtd; int ret; printk(KERN_INFO DRV_DESC " version " DRV_VERSION "\n"); @@ -317,8 +335,12 @@ static int rb750_nand_probe(struct platform_device *pdev) return -ENOMEM; info->chip.priv = &info; - info->mtd.priv = &info->chip; - info->mtd.owner = THIS_MODULE; + + mtd = rbinfo_to_mtd(info); +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) + mtd->priv = &info->chip; +#endif + mtd->owner = THIS_MODULE; info->chip.select_chip = rb750_nand_select_chip; info->chip.cmd_ctrl = rb750_nand_cmd_ctrl; @@ -329,6 +351,9 @@ static int rb750_nand_probe(struct platform_device *pdev) info->chip.chip_delay = 25; info->chip.ecc.mode = NAND_ECC_SOFT; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0) + info->chip.ecc.algo = NAND_ECC_HAMMING; +#endif info->chip.options = NAND_NO_SUBPAGE_WRITE; info->pdata = pdata; @@ -337,26 +362,26 @@ static int rb750_nand_probe(struct platform_device *pdev) rb750_nand_gpio_init(info); - ret = nand_scan_ident(&info->mtd, 1, NULL); + ret = nand_scan_ident(mtd, 1, NULL); if (ret) { ret = -ENXIO; goto err_free_info; } - if (info->mtd.writesize == 512) + if (mtd->writesize == 512) #if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) info->chip.ecc.layout = &rb750_nand_ecclayout; #else - mtd_set_ooblayout(&info->mtd, &rb750_nand_ecclayout_ops); + mtd_set_ooblayout(mtd, &rb750_nand_ecclayout_ops); #endif - ret = nand_scan_tail(&info->mtd); + ret = nand_scan_tail(mtd); if (ret) { return -ENXIO; goto err_set_drvdata; } - ret = mtd_device_register(&info->mtd, rb750_nand_partitions, + ret = mtd_device_register(mtd, rb750_nand_partitions, ARRAY_SIZE(rb750_nand_partitions)); if (ret) goto err_release_nand; @@ -364,7 +389,7 @@ static int rb750_nand_probe(struct platform_device *pdev) return 0; err_release_nand: - nand_release(&info->mtd); + nand_release(mtd); err_set_drvdata: platform_set_drvdata(pdev, NULL); err_free_info: @@ -376,7 +401,7 @@ static int rb750_nand_remove(struct platform_device *pdev) { struct rb750_nand_info *info = platform_get_drvdata(pdev); - nand_release(&info->mtd); + nand_release(rbinfo_to_mtd(info)); platform_set_drvdata(pdev, NULL); kfree(info); diff --git a/target/linux/ar71xx/files/drivers/mtd/nand/rb91x_nand.c b/target/linux/ar71xx/files/drivers/mtd/nand/rb91x_nand.c index 15b1816ae..c808f3998 100644 --- a/target/linux/ar71xx/files/drivers/mtd/nand/rb91x_nand.c +++ b/target/linux/ar71xx/files/drivers/mtd/nand/rb91x_nand.c @@ -40,7 +40,9 @@ struct rb91x_nand_info { struct nand_chip chip; +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) struct mtd_info mtd; +#endif struct device *dev; int gpio_nce; @@ -54,9 +56,25 @@ struct rb91x_nand_info { static inline struct rb91x_nand_info *mtd_to_rbinfo(struct mtd_info *mtd) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) return container_of(mtd, struct rb91x_nand_info, mtd); +#else + struct nand_chip *chip = mtd_to_nand(mtd); + + return container_of(chip, struct rb91x_nand_info, chip); +#endif } +static struct mtd_info *rbinfo_to_mtd(struct rb91x_nand_info *nfc) +{ +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) + return &nfc->mtd; +#else + return nand_to_mtd(&nfc->chip); +#endif +} + + #if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) /* * We need to use the OLD Yaffs-1 OOB layout, otherwise the RB bootloader @@ -340,6 +358,7 @@ static int rb91x_nand_probe(struct platform_device *pdev) { struct rb91x_nand_info *rbni; struct rb91x_nand_platform_data *pdata; + struct mtd_info *mtd; int ret; pr_info(DRV_DESC "\n"); @@ -362,8 +381,12 @@ static int rb91x_nand_probe(struct platform_device *pdev) rbni->gpio_nle = pdata->gpio_nle; rbni->chip.priv = &rbni; - rbni->mtd.priv = &rbni->chip; - rbni->mtd.owner = THIS_MODULE; + mtd = rbinfo_to_mtd(rbni); + +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) + mtd->priv = &rbni->chip; +#endif + mtd->owner = THIS_MODULE; rbni->chip.cmd_ctrl = rb91x_nand_cmd_ctrl; rbni->chip.dev_ready = rb91x_nand_dev_ready; @@ -373,6 +396,9 @@ static int rb91x_nand_probe(struct platform_device *pdev) rbni->chip.chip_delay = 25; rbni->chip.ecc.mode = NAND_ECC_SOFT; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,6,0) + rbni->chip.ecc.algo = NAND_ECC_HAMMING; +#endif rbni->chip.options = NAND_NO_SUBPAGE_WRITE; platform_set_drvdata(pdev, rbni); @@ -381,22 +407,22 @@ static int rb91x_nand_probe(struct platform_device *pdev) if (ret) return ret; - ret = nand_scan_ident(&rbni->mtd, 1, NULL); + ret = nand_scan_ident(mtd, 1, NULL); if (ret) return ret; - if (rbni->mtd.writesize == 512) + if (mtd->writesize == 512) #if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) rbni->chip.ecc.layout = &rb91x_nand_ecclayout; #else - mtd_set_ooblayout(&rbni->mtd, &rb91x_nand_ecclayout_ops); + mtd_set_ooblayout(mtd, &rb91x_nand_ecclayout_ops); #endif - ret = nand_scan_tail(&rbni->mtd); + ret = nand_scan_tail(mtd); if (ret) return ret; - ret = mtd_device_register(&rbni->mtd, rb91x_nand_partitions, + ret = mtd_device_register(mtd, rb91x_nand_partitions, ARRAY_SIZE(rb91x_nand_partitions)); if (ret) goto err_release_nand; @@ -404,7 +430,7 @@ static int rb91x_nand_probe(struct platform_device *pdev) return 0; err_release_nand: - nand_release(&rbni->mtd); + nand_release(mtd); return ret; } @@ -412,7 +438,7 @@ static int rb91x_nand_remove(struct platform_device *pdev) { struct rb91x_nand_info *info = platform_get_drvdata(pdev); - nand_release(&info->mtd); + nand_release(rbinfo_to_mtd(info)); return 0; } diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk index 6f5a7016e..3c5fcc3f3 100644 --- a/target/linux/ar71xx/image/generic.mk +++ b/target/linux/ar71xx/image/generic.mk @@ -358,7 +358,6 @@ define Device/dr344 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6336k(rootfs),1408k(kernel),64k(nvram),64k(art)ro,7744k@0x50000(firmware) IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to $$$$(ROOTFS_SIZE) | append-kernel | check-size $$$$(IMAGE_SIZE) endef -TARGET_DEVICES += dr344 define Device/dr531 DEVICE_TITLE := Wallys DR531 diff --git a/target/linux/ar71xx/image/lzma-loader/src/Makefile b/target/linux/ar71xx/image/lzma-loader/src/Makefile index 5f10bdb8f..682b31fe8 100644 --- a/target/linux/ar71xx/image/lzma-loader/src/Makefile +++ b/target/linux/ar71xx/image/lzma-loader/src/Makefile @@ -37,11 +37,13 @@ CFLAGS = -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-trigraphs -Os \ -mabi=32 -march=mips32r2 \ -Wa,-32 -Wa,-march=mips32r2 -Wa,-mips32r2 -Wa,--trap CFLAGS += -D_LZMA_PROB32 +CFLAGS += -flto ASFLAGS = $(CFLAGS) -D__ASSEMBLY__ -LDFLAGS = -static --gc-sections -no-warn-mismatch -LDFLAGS += -e startup -T loader.lds -Ttext $(LZMA_TEXT_START) +LDFLAGS = -static -Wl,--gc-sections -Wl,-no-warn-mismatch +LDFLAGS += -Wl,-e,startup -T loader.lds -Wl,-Ttext,$(LZMA_TEXT_START) +LDFLAGS += -flto -fwhole-program O_FORMAT = $(shell $(OBJDUMP) -i | head -2 | grep elf32) @@ -86,7 +88,7 @@ data.o: $(LOADER_DATA) $(LD) -r -b binary --oformat $(O_FORMAT) -T lzma-data.lds -o $@ $< loader: $(OBJECTS) - $(LD) $(LDFLAGS) -o $@ $(OBJECTS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) loader.bin: loader $(OBJCOPY) $(BIN_FLAGS) $< $@ diff --git a/target/linux/ar71xx/image/lzma-loader/src/head.S b/target/linux/ar71xx/image/lzma-loader/src/head.S index 47a7c9bd6..d414b14d1 100644 --- a/target/linux/ar71xx/image/lzma-loader/src/head.S +++ b/target/linux/ar71xx/image/lzma-loader/src/head.S @@ -42,6 +42,19 @@ LEAF(startup) mtc0 t0, CP0_STATUS ehb + /* + * Some bootloaders set the 'Kseg0 coherency algorithm' to + * 'Cacheable, noncoherent, write-through, no write allocate' + * and this cause performance issues. Let's go and change it to + * 'Cacheable, noncoherent, write-back, write allocate' + */ + mfc0 t0, CP0_CONFIG + li t1, ~7 #~CONF_CM_CMASK + and t0, t1 + ori t0, 3 #CONF_CM_CACHABLE_NONCOHERENT + mtc0 t0, CP0_CONFIG + nop + mtc0 zero, CP0_COUNT mtc0 zero, CP0_COMPARE ehb diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk index 4e81251d0..6d5b0fe8d 100644 --- a/target/linux/ar71xx/image/tp-link.mk +++ b/target/linux/ar71xx/image/tp-link.mk @@ -150,7 +150,7 @@ define Device/archer-c60-v1 MTDPARTS := spi0.0:64k(u-boot)ro,64k(mac)ro,1344k(kernel),6592k(rootfs),64k(tplink)ro,64k(art)ro,7936k@0x20000(firmware) SUPPORTED_DEVICES := archer-c60-v1 endef -TARGET_DEVICES += archer-c25-v1 archer-c58-v1 archer-c59-v1 archer-c60-v1 +TARGET_DEVICES += archer-c25-v1 archer-c59-v1 define Device/archer-c5-v1 $(Device/tplink-16mlzma) @@ -1043,7 +1043,6 @@ define Device/tl-wr902ac-v1 append-metadata | check-size $$$$(IMAGE_SIZE) MTDPARTS := spi0.0:128k(u-boot)ro,7360k(firmware),640k(tplink)ro,64k(art)ro endef -TARGET_DEVICES += tl-wr902ac-v1 define Device/tl-wr940n-v4 $(Device/tplink-8mlzma) @@ -1118,4 +1117,4 @@ define Device/tl-wr942n-v1 MTDPARTS := spi0.0:128k(u-boot)ro,1344k(kernel),13120k(rootfs),64k(product-info)ro,64k(partition-table)ro,256k(oem-config)ro,1344k(oem-vars)ro,64k(ART)ro,14464k@0x20000(firmware) SUPPORTED_DEVICES := tl-wr942n-v1 endef -TARGET_DEVICES += tl-wr940n-v4 tl-wr941nd-v2 tl-wr941nd-v3 tl-wr941nd-v4 tl-wr941nd-v5 tl-wr941nd-v6 tl-wr941nd-v6-cn tl-wr942n-v1 +TARGET_DEVICES += tl-wr940n-v4 tl-wr941nd-v2 tl-wr941nd-v3 tl-wr941nd-v4 tl-wr941nd-v5 tl-wr941nd-v6 tl-wr941nd-v6-cn diff --git a/target/linux/ar71xx/image/ubnt.mk b/target/linux/ar71xx/image/ubnt.mk index f80f2f1b3..dfc795bb2 100644 --- a/target/linux/ar71xx/image/ubnt.mk +++ b/target/linux/ar71xx/image/ubnt.mk @@ -256,4 +256,3 @@ define Device/ubnt-unifi-outdoor-plus BOARDNAME := UBNT-UOP DEVICE_PROFILE := UBNT endef -TARGET_DEVICES += ubnt-uap-pro ubnt-unifi-outdoor-plus diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default index e333166e9..42f9882bb 100644 --- a/target/linux/ar71xx/mikrotik/config-default +++ b/target/linux/ar71xx/mikrotik/config-default @@ -231,6 +231,7 @@ CONFIG_MTD_NAND_RB4XX=y CONFIG_MTD_NAND_RB750=y CONFIG_MTD_NAND_RB91X=y # CONFIG_MTD_REDBOOT_PARTS is not set +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y # CONFIG_MTD_SPLIT_EVA_FW is not set # CONFIG_MTD_SPLIT_TPLINK_FW is not set # CONFIG_MTD_TPLINK_PARTS is not set From 4cb2f96c71e7995c99c2d3fc26991aa76e630c64 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 24 Oct 2017 23:21:06 +0800 Subject: [PATCH 04/22] include: Include new location for DT bindings in kernel 4.12 --- include/image.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/include/image.mk b/include/image.mk index 3f5b4544e..fc6bf06e9 100644 --- a/include/image.mk +++ b/include/image.mk @@ -161,6 +161,7 @@ define Image/BuildDTB $(TARGET_CROSS)cpp -nostdinc -x assembler-with-cpp \ -I$(DTS_DIR) \ -I$(DTS_DIR)/include \ + -I$(LINUX_DIR)/include/ \ -undef -D__DTS__ $(3) \ -o $(2).tmp $(1) $(LINUX_DIR)/scripts/dtc/dtc -O dtb \ From 5d1a43f7829e76cc81bac0dada4a9b7343db06fd Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 24 Oct 2017 23:23:45 +0800 Subject: [PATCH 05/22] squashfs: use host cflags and fix for x86/x64 vmware firstboot --- package/libs/lzo/Makefile | 4 ---- tools/squashfs/Makefile | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/package/libs/lzo/Makefile b/package/libs/lzo/Makefile index 8d85e4652..ef33619d8 100644 --- a/package/libs/lzo/Makefile +++ b/package/libs/lzo/Makefile @@ -42,10 +42,6 @@ CONFIGURE_ARGS += \ TARGET_CFLAGS += $(FPIC) MAKE_FLAGS += CFLAGS_O="$(TARGET_CFLAGS)" -ifeq ($(CONFIG_i386)$(CONFIG_x86_64),) - TARGET_CFLAGS += -DLZO_CFG_NO_UNALIGNED=1 -endif - define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/include/lzo $(1)/usr/include/ diff --git a/tools/squashfs/Makefile b/tools/squashfs/Makefile index 27adca1d7..87f6e8fd9 100644 --- a/tools/squashfs/Makefile +++ b/tools/squashfs/Makefile @@ -21,6 +21,7 @@ include $(INCLUDE_DIR)/host-build.mk define Host/Compile $(MAKE) -C $(HOST_BUILD_DIR)/squashfs-tools \ CC="$(HOSTCC)" \ + CFLAGS="$(HOST_CFLAGS) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I." \ CXX="$(CXX)" \ LZMAPATH=$(STAGING_DIR_HOST)/lib \ mksquashfs-lzma unsquashfs-lzma From 193672160ae826312b607efb02313d590978fd44 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Wed, 25 Oct 2017 00:34:46 +0800 Subject: [PATCH 06/22] update full support for Asus RT-ACRH17 --- target/linux/ipq806x/base-files/etc/board.d/01_leds | 1 + .../linux/ipq806x/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 2 ++ target/linux/ipq806x/base-files/lib/ipq806x.sh | 3 +++ .../linux/ipq806x/base-files/lib/upgrade/platform.sh | 1 + .../arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts | 12 ++++++------ .../patches-4.9/0069-arm-boot-add-dts-files.patch | 7 ++++--- 7 files changed, 18 insertions(+), 9 deletions(-) diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds b/target/linux/ipq806x/base-files/etc/board.d/01_leds index 224cabf14..a5b6bfc03 100755 --- a/target/linux/ipq806x/base-files/etc/board.d/01_leds +++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds @@ -35,6 +35,7 @@ nbg6817) ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:amber:wifi5g" "phy0tpt" ucidef_set_led_netdev "wan" "WAN" "$board:white:internet" "eth1" ;; +rt-acrh17 |\ rt-ac58u) ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:blue:wlan2G" "phy0tpt" ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:blue:wlan5G" "phy1tpt" diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network index fd6a253f1..9d5ba2d68 100755 --- a/target/linux/ipq806x/base-files/etc/board.d/02_network +++ b/target/linux/ipq806x/base-files/etc/board.d/02_network @@ -53,6 +53,7 @@ nbg6817) ucidef_set_interface_macaddr "lan" "$hw_mac_addr" ucidef_set_interface_macaddr "wan" "$(macaddr_add $hw_mac_addr 1)" ;; +rt-acrh17 |\ rt-ac58u) CI_UBIPART=UBI_DEV wan_mac_addr=$(mtd_get_mac_binary_ubi Factory 20486) diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 6ee403f7f..9557b539a 100644 --- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -62,6 +62,7 @@ board=$(board_name) case "$FIRMWARE" in "ath10k/pre-cal-ahb-a000000.wifi.bin") case "$board" in + rt-acrh17 |\ rt-ac58u) . /lib/upgrade/nand.sh @@ -75,6 +76,7 @@ case "$FIRMWARE" in ;; "ath10k/pre-cal-ahb-a800000.wifi.bin") case "$board" in + rt-acrh17 |\ rt-ac58u) . /lib/upgrade/nand.sh diff --git a/target/linux/ipq806x/base-files/lib/ipq806x.sh b/target/linux/ipq806x/base-files/lib/ipq806x.sh index a46c1bd56..c4af88b00 100644 --- a/target/linux/ipq806x/base-files/lib/ipq806x.sh +++ b/target/linux/ipq806x/base-files/lib/ipq806x.sh @@ -44,6 +44,9 @@ ipq806x_board_detect() { *"R7800") name="r7800" ;; + *"RT-ACRH17") + name="rt-acrh17" + ;; *"RT-AC58U") name="rt-ac58u" ;; diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh index d13c0b1ad..cf046800d 100644 --- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh @@ -8,6 +8,7 @@ platform_check_image() { local board=$(board_name) case "$board" in + rt-acrh17 |\ rt-ac58u) CI_UBIPART="UBI_DEV" local ubidev=$(nand_find_ubi $CI_UBIPART) diff --git a/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts index 1eb4b2e6f..c68cc0e9e 100644 --- a/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts +++ b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts @@ -134,32 +134,32 @@ compatible = "gpio-leds"; power: status { - label = "rt-ac58u:blue:status"; + label = "rt-acrh17:blue:status"; gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; }; wan { - label = "rt-ac58u:blue:wan"; + label = "rt-acrh17:blue:wan"; gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; }; wlan2G { - label = "rt-ac58u:blue:wlan2G"; + label = "rt-acrh17:blue:wlan2G"; gpios = <&tlmm 58 GPIO_ACTIVE_HIGH>; }; wan5G { - label = "rt-ac58u:blue:wlan5G"; + label = "rt-acrh17:blue:wlan5G"; gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>; }; usb { - label = "rt-ac58u:blue:usb"; + label = "rt-acrh17:blue:usb"; gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; }; lan { - label = "rt-ac58u:blue:lan"; + label = "rt-acrh17:blue:lan"; gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>; }; }; diff --git a/target/linux/ipq806x/patches-4.9/0069-arm-boot-add-dts-files.patch b/target/linux/ipq806x/patches-4.9/0069-arm-boot-add-dts-files.patch index bab280878..ea9e67278 100644 --- a/target/linux/ipq806x/patches-4.9/0069-arm-boot-add-dts-files.patch +++ b/target/linux/ipq806x/patches-4.9/0069-arm-boot-add-dts-files.patch @@ -5,18 +5,19 @@ Subject: [PATCH 69/69] arm: boot: add dts files Signed-off-by: John Crispin --- - arch/arm/boot/dts/Makefile | 8 ++++++++ - 1 file changed, 8 insertions(+) + arch/arm/boot/dts/Makefile | 9 ++++++++ + 1 file changed, 9 insertions(+) --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -618,7 +618,18 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -618,7 +618,19 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8084-mtp.dtb \ qcom-ipq4019-ap.dk01.1-c1.dtb \ qcom-ipq4019-ap.dk04.1-c1.dtb \ + qcom-ipq4019-fritz4040.dtb \ + qcom-ipq4019-nbg6617.dtb \ + qcom-ipq4019-rt-ac58u.dtb \ ++ qcom-ipq4019-rt-acrh17.dtb \ qcom-ipq8064-ap148.dtb \ + qcom-ipq8064-c2600.dtb \ + qcom-ipq8064-d7800.dtb \ From a39431b329320520109dc75a48ef44b00c5bb15a Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Wed, 25 Oct 2017 00:40:21 +0800 Subject: [PATCH 07/22] add FPU Emu support in ar71xx both kenerl 4.4 and 4.9 --- target/linux/ar71xx/config-4.4 | 1 + target/linux/ar71xx/config-4.9 | 1 + 2 files changed, 2 insertions(+) diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4 index 4793bf4de..abfb127ff 100644 --- a/target/linux/ar71xx/config-4.4 +++ b/target/linux/ar71xx/config-4.4 @@ -478,3 +478,4 @@ CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_USB_SUPPORT=y CONFIG_USE_OF=y CONFIG_ZONE_DMA_FLAG=0 +CONFIG_MIPS_FPU_EMULATOR=y diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9 index 84b2a0b72..190d07df2 100644 --- a/target/linux/ar71xx/config-4.9 +++ b/target/linux/ar71xx/config-4.9 @@ -484,3 +484,4 @@ CONFIG_SYS_SUPPORTS_ZBOOT_UART_PROM=y CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_USB_SUPPORT=y CONFIG_USE_OF=y +CONFIG_MIPS_FPU_EMULATOR=y From 791acd01bb132ab6ee538afb22c88d3b3e31c975 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 27 Oct 2017 11:23:03 +0800 Subject: [PATCH 08/22] hostapd: fix up ubus support --- .../hostapd/patches/600-ubus_support.patch | 62 +++++++++++++------ .../services/hostapd/src/src/ap/ubus.c | 6 +- 2 files changed, 45 insertions(+), 23 deletions(-) diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch index 31e3e7999..b63d99a57 100644 --- a/package/network/services/hostapd/patches/600-ubus_support.patch +++ b/package/network/services/hostapd/patches/600-ubus_support.patch @@ -1,5 +1,7 @@ ---- a/hostapd/Makefile -+++ b/hostapd/Makefile +Index: hostapd-2017-08-24-c2d4f2eb/hostapd/Makefile +=================================================================== +--- hostapd-2017-08-24-c2d4f2eb.orig/hostapd/Makefile ++++ hostapd-2017-08-24-c2d4f2eb/hostapd/Makefile @@ -165,6 +165,11 @@ OBJS += ../src/common/hw_features_common OBJS += ../src/eapol_auth/eapol_auth_sm.o @@ -12,8 +14,10 @@ ifdef CONFIG_CODE_COVERAGE CFLAGS += -O0 -fprofile-arcs -ftest-coverage ---- a/src/ap/hostapd.h -+++ b/src/ap/hostapd.h +Index: hostapd-2017-08-24-c2d4f2eb/src/ap/hostapd.h +=================================================================== +--- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/hostapd.h ++++ hostapd-2017-08-24-c2d4f2eb/src/ap/hostapd.h @@ -13,6 +13,7 @@ #include "utils/list.h" #include "ap_config.h" @@ -39,8 +43,10 @@ enum hostapd_iface_state { HAPD_IFACE_UNINITIALIZED, HAPD_IFACE_DISABLED, ---- a/src/ap/hostapd.c -+++ b/src/ap/hostapd.c +Index: hostapd-2017-08-24-c2d4f2eb/src/ap/hostapd.c +=================================================================== +--- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/hostapd.c ++++ hostapd-2017-08-24-c2d4f2eb/src/ap/hostapd.c @@ -309,6 +309,7 @@ static void hostapd_free_hapd_data(struc hapd->started = 0; @@ -82,8 +88,10 @@ hostapd_interface_deinit(iface); wpa_printf(MSG_DEBUG, "%s: driver=%p drv_priv=%p -> hapd_deinit", __func__, driver, drv_priv); ---- a/src/ap/ieee802_11.c -+++ b/src/ap/ieee802_11.c +Index: hostapd-2017-08-24-c2d4f2eb/src/ap/ieee802_11.c +=================================================================== +--- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/ieee802_11.c ++++ hostapd-2017-08-24-c2d4f2eb/src/ap/ieee802_11.c @@ -1587,7 +1587,8 @@ ieee802_11_set_radius_info(struct hostap @@ -201,8 +209,10 @@ ret = 1; break; case WLAN_FC_STYPE_DISASSOC: ---- a/src/ap/beacon.c -+++ b/src/ap/beacon.c +Index: hostapd-2017-08-24-c2d4f2eb/src/ap/beacon.c +=================================================================== +--- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/beacon.c ++++ hostapd-2017-08-24-c2d4f2eb/src/ap/beacon.c @@ -716,7 +716,7 @@ void sta_track_claim_taxonomy_info(struc void handle_probe_req(struct hostapd_data *hapd, @@ -241,8 +251,10 @@ /* TODO: verify that supp_rates contains at least one matching rate * with AP configuration */ ---- a/src/ap/beacon.h -+++ b/src/ap/beacon.h +Index: hostapd-2017-08-24-c2d4f2eb/src/ap/beacon.h +=================================================================== +--- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/beacon.h ++++ hostapd-2017-08-24-c2d4f2eb/src/ap/beacon.h @@ -14,7 +14,7 @@ struct ieee80211_mgmt; void handle_probe_req(struct hostapd_data *hapd, @@ -252,8 +264,10 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd); int ieee802_11_set_beacons(struct hostapd_iface *iface); int ieee802_11_update_beacons(struct hostapd_iface *iface); ---- a/src/ap/drv_callbacks.c -+++ b/src/ap/drv_callbacks.c +Index: hostapd-2017-08-24-c2d4f2eb/src/ap/drv_callbacks.c +=================================================================== +--- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/drv_callbacks.c ++++ hostapd-2017-08-24-c2d4f2eb/src/ap/drv_callbacks.c @@ -116,6 +116,10 @@ int hostapd_notif_assoc(struct hostapd_d u16 reason = WLAN_REASON_UNSPECIFIED; u16 status = WLAN_STATUS_SUCCESS; @@ -278,8 +292,10 @@ #ifdef CONFIG_P2P if (elems.p2p) { wpabuf_free(sta->p2p_ie); ---- a/src/ap/sta_info.c -+++ b/src/ap/sta_info.c +Index: hostapd-2017-08-24-c2d4f2eb/src/ap/sta_info.c +=================================================================== +--- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/sta_info.c ++++ hostapd-2017-08-24-c2d4f2eb/src/ap/sta_info.c @@ -404,6 +404,7 @@ void ap_handle_timer(void *eloop_ctx, vo HOSTAPD_LEVEL_INFO, "deauthenticated due to " "local deauth request"); @@ -296,8 +312,18 @@ break; } } ---- a/src/ap/wpa_auth_glue.c -+++ b/src/ap/wpa_auth_glue.c +@@ -1212,6 +1214,7 @@ void ap_sta_set_authorized(struct hostap + buf, ip_addr); + } else { + wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_DISCONNECTED "%s", buf); ++ hostapd_ubus_notify(hapd, "disassoc", sta->addr); + + if (hapd->msg_ctx_parent && + hapd->msg_ctx_parent != hapd->msg_ctx) +Index: hostapd-2017-08-24-c2d4f2eb/src/ap/wpa_auth_glue.c +=================================================================== +--- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/wpa_auth_glue.c ++++ hostapd-2017-08-24-c2d4f2eb/src/ap/wpa_auth_glue.c @@ -175,6 +175,7 @@ static void hostapd_wpa_auth_psk_failure struct hostapd_data *hapd = ctx; wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_POSSIBLE_PSK_MISMATCH MACSTR, diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c index bc773930d..beb4388f7 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.c +++ b/package/network/services/hostapd/src/src/ap/ubus.c @@ -743,18 +743,14 @@ int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_req void hostapd_ubus_notify(struct hostapd_data *hapd, const char *type, const u8 *addr) { - char mac[18]; - if (!hapd->ubus.obj.has_subscribers) return; if (!addr) return; - snprintf(mac, sizeof(mac), MACSTR, MAC2STR(addr)); - blob_buf_init(&b, 0); - blobmsg_add_macaddr(&b, "address", mac); + blobmsg_add_macaddr(&b, "address", addr); ubus_notify(ctx, &hapd->ubus.obj, type, b.head, -1); } From 457fcc005a39302178fda8907a8429f326d681bd Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 27 Oct 2017 11:25:49 +0800 Subject: [PATCH 09/22] mac80211: backport fixes for fix for CVE-2017-13080 --- package/kernel/mac80211/Makefile | 49 +++- .../mac80211/files/lib/wifi/mac80211.sh | 1 + ...key-reinstall-without-changing-anyth.patch | 81 ++++++ ...e-constant-time-comparison-with-keys.patch | 33 +++ ...compare-TKIP-TX-MIC-key-in-reinstall.patch | 73 ++++++ .../mac80211/patches/999-ccmp-crypto.patch | 234 ------------------ 6 files changed, 235 insertions(+), 236 deletions(-) create mode 100644 package/kernel/mac80211/patches/327-mac80211-accept-key-reinstall-without-changing-anyth.patch create mode 100644 package/kernel/mac80211/patches/328-mac80211-use-constant-time-comparison-with-keys.patch create mode 100644 package/kernel/mac80211/patches/329-mac80211-don-t-compare-TKIP-TX-MIC-key-in-reinstall.patch delete mode 100644 package/kernel/mac80211/patches/999-ccmp-crypto.patch diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index 424b2ca50..7e9b5ad61 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -24,7 +24,7 @@ PKG_MAINTAINER:=Felix Fietkau PKG_DRIVERS = \ adm8211 \ airo \ - ath ath5k ath9k ath9k-common ath9k-htc ath10k \ + ath ath5k ath6kl ath6kl-sdio ath6kl-usb ath9k ath9k-common ath9k-htc ath10k \ b43 b43legacy \ carl9170 \ hermes hermes-pci hermes-pcmcia hermes-plx\ @@ -217,6 +217,43 @@ define KernelPackage/ath5k/description Atheros 5xxx chipset. endef +define KernelPackage/ath6kl + $(call KernelPackage/mac80211/Default) + TITLE:=Atheros FullMAC wireless devices (common code for ath6kl_sdio and ath6kl_usb) + URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath6kl + HIDDEN:=1 + DEPENDS+= +kmod-ath +@DRIVER_11N_SUPPORT +@KERNEL_RELAY + FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath6kl/ath6kl_core.ko +endef + +define KernelPackage/ath6kl-sdio + $(call KernelPackage/mac80211/Default) + TITLE:=Atheros 802.11n SDIO wireless cards support + URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath6kl + DEPENDS+= +kmod-mmc +kmod-ath6kl + FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath6kl/ath6kl_sdio.ko + AUTOLOAD:=$(call AutoProbe,ath6kl_sdio) +endef + +define KernelPackage/ath6kl-sdio/description +This module adds support for wireless adapters based on +Atheros IEEE 802.11n AR6003 and AR6004 family of chipsets. +endef + +define KernelPackage/ath6kl-usb + $(call KernelPackage/mac80211/Default) + TITLE:=Atheros 802.11n USB wireless cards support + URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath6kl + DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-ath6kl + FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath6kl/ath6kl_usb.ko + AUTOLOAD:=$(call AutoProbe,ath6kl_usb) +endef + +define KernelPackage/ath6kl-usb/description +This module adds support for wireless adapters based on the +Atheros IEEE 802.11n AR6004 chipset. +endef + define KernelPackage/ath9k-common $(call KernelPackage/mac80211/Default) TITLE:=Atheros 802.11n wireless devices (common code for ath9k and ath9k_htc) @@ -1513,7 +1550,8 @@ ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS ATH9K_HTC_DEBUGFS \ ATH10K_DEBUGFS \ CARL9170_DEBUGFS \ - ATH5K_DEBUG + ATH5K_DEBUG \ + ATH6KL_DEBUG endif ifdef CONFIG_PACKAGE_MAC80211_TRACING @@ -1554,6 +1592,10 @@ else config-y += ATH5K_PCI endif +config-$(call config_package,ath6kl) += ATH6KL +config-$(call config_package,ath6kl-sdio) += ATH6KL_SDIO +config-$(call config_package,ath6kl-usb) += ATH6KL_USB + config-$(call config_package,carl9170) += CARL9170 config-$(call config_package,b43) += B43 @@ -1795,6 +1837,9 @@ $(eval $(call KernelPackage,airo)) $(eval $(call KernelPackage,ath)) $(eval $(call KernelPackage,ath10k)) $(eval $(call KernelPackage,ath5k)) +$(eval $(call KernelPackage,ath6kl)) +$(eval $(call KernelPackage,ath6kl-sdio)) +$(eval $(call KernelPackage,ath6kl-usb)) $(eval $(call KernelPackage,ath9k)) $(eval $(call KernelPackage,ath9k-common)) $(eval $(call KernelPackage,ath9k-htc)) diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh index ad2af3b29..467392f75 100644 --- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh +++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh @@ -116,6 +116,7 @@ detect_mac80211() { set wireless.radio${devidx}.hwmode=11${mode_band} ${dev_id} ${ht_capab} + set wireless.radio${devidx}.disabled=0 set wireless.default_radio${devidx}=wifi-iface set wireless.default_radio${devidx}.device=radio${devidx} diff --git a/package/kernel/mac80211/patches/327-mac80211-accept-key-reinstall-without-changing-anyth.patch b/package/kernel/mac80211/patches/327-mac80211-accept-key-reinstall-without-changing-anyth.patch new file mode 100644 index 000000000..7d0be0395 --- /dev/null +++ b/package/kernel/mac80211/patches/327-mac80211-accept-key-reinstall-without-changing-anyth.patch @@ -0,0 +1,81 @@ +From fdf7cb4185b60c68e1a75e61691c4afdc15dea0e Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Tue, 5 Sep 2017 14:54:54 +0200 +Subject: [PATCH] mac80211: accept key reinstall without changing anything + +When a key is reinstalled we can reset the replay counters +etc. which can lead to nonce reuse and/or replay detection +being impossible, breaking security properties, as described +in the "KRACK attacks". + +In particular, CVE-2017-13080 applies to GTK rekeying that +happened in firmware while the host is in D3, with the second +part of the attack being done after the host wakes up. In +this case, the wpa_supplicant mitigation isn't sufficient +since wpa_supplicant doesn't know the GTK material. + +In case this happens, simply silently accept the new key +coming from userspace but don't take any action on it since +it's the same key; this keeps the PN replay counters intact. + +Signed-off-by: Johannes Berg +--- + net/mac80211/key.c | 21 +++++++++++++++++---- + 1 file changed, 17 insertions(+), 4 deletions(-) + +diff --git a/net/mac80211/key.c b/net/mac80211/key.c +index a98fc2b5e0dc..ae995c8480db 100644 +--- a/net/mac80211/key.c ++++ b/net/mac80211/key.c +@@ -4,7 +4,7 @@ + * Copyright 2006-2007 Jiri Benc + * Copyright 2007-2008 Johannes Berg + * Copyright 2013-2014 Intel Mobile Communications GmbH +- * Copyright 2015 Intel Deutschland GmbH ++ * Copyright 2015-2017 Intel Deutschland GmbH + * + * 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 +@@ -620,9 +620,6 @@ int ieee80211_key_link(struct ieee80211_key *key, + + pairwise = key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE; + idx = key->conf.keyidx; +- key->local = sdata->local; +- key->sdata = sdata; +- key->sta = sta; + + mutex_lock(&sdata->local->key_mtx); + +@@ -633,6 +630,21 @@ int ieee80211_key_link(struct ieee80211_key *key, + else + old_key = key_mtx_dereference(sdata->local, sdata->keys[idx]); + ++ /* ++ * Silently accept key re-installation without really installing the ++ * new version of the key to avoid nonce reuse or replay issues. ++ */ ++ if (old_key && key->conf.keylen == old_key->conf.keylen && ++ !memcmp(key->conf.key, old_key->conf.key, key->conf.keylen)) { ++ ieee80211_key_free_unused(key); ++ ret = 0; ++ goto out; ++ } ++ ++ key->local = sdata->local; ++ key->sdata = sdata; ++ key->sta = sta; ++ + increment_tailroom_need_count(sdata); + + ieee80211_key_replace(sdata, sta, pairwise, old_key, key); +@@ -648,6 +660,7 @@ int ieee80211_key_link(struct ieee80211_key *key, + ret = 0; + } + ++ out: + mutex_unlock(&sdata->local->key_mtx); + + return ret; +-- +2.13.6 + diff --git a/package/kernel/mac80211/patches/328-mac80211-use-constant-time-comparison-with-keys.patch b/package/kernel/mac80211/patches/328-mac80211-use-constant-time-comparison-with-keys.patch new file mode 100644 index 000000000..03e820190 --- /dev/null +++ b/package/kernel/mac80211/patches/328-mac80211-use-constant-time-comparison-with-keys.patch @@ -0,0 +1,33 @@ +From 2bdd713b92a9cade239d3c7d15205a09f556624d Mon Sep 17 00:00:00 2001 +From: "Jason A. Donenfeld" +Date: Tue, 17 Oct 2017 20:32:07 +0200 +Subject: [PATCH] mac80211: use constant time comparison with keys + +Otherwise we risk leaking information via timing side channel. + +Fixes: fdf7cb4185b6 ("mac80211: accept key reinstall without changing anything") +Signed-off-by: Jason A. Donenfeld +Signed-off-by: Johannes Berg +--- + net/mac80211/key.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/net/mac80211/key.c ++++ b/net/mac80211/key.c +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + #include + #include "ieee80211_i.h" + #include "driver-ops.h" +@@ -635,7 +636,7 @@ int ieee80211_key_link(struct ieee80211_ + * new version of the key to avoid nonce reuse or replay issues. + */ + if (old_key && key->conf.keylen == old_key->conf.keylen && +- !memcmp(key->conf.key, old_key->conf.key, key->conf.keylen)) { ++ !crypto_memneq(key->conf.key, old_key->conf.key, key->conf.keylen)) { + ieee80211_key_free_unused(key); + ret = 0; + goto out; diff --git a/package/kernel/mac80211/patches/329-mac80211-don-t-compare-TKIP-TX-MIC-key-in-reinstall.patch b/package/kernel/mac80211/patches/329-mac80211-don-t-compare-TKIP-TX-MIC-key-in-reinstall.patch new file mode 100644 index 000000000..1eaf51de7 --- /dev/null +++ b/package/kernel/mac80211/patches/329-mac80211-don-t-compare-TKIP-TX-MIC-key-in-reinstall.patch @@ -0,0 +1,73 @@ +From cfbb0d90a7abb289edc91833d0905931f8805f12 Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Tue, 24 Oct 2017 21:12:13 +0200 +Subject: [PATCH] mac80211: don't compare TKIP TX MIC key in reinstall prevention + +For the reinstall prevention, the code I had added compares the +whole key. It turns out though that iwlwifi firmware doesn't +provide the TKIP TX MIC key as it's not needed in client mode, +and thus the comparison will always return false. + +For client mode, thus always zero out the TX MIC key part before +doing the comparison in order to avoid accepting the reinstall +of the key with identical encryption and RX MIC key, but not the +same TX MIC key (since the supplicant provides the real one.) + +Fixes: fdf7cb4185b6 ("mac80211: accept key reinstall without changing anything") +Signed-off-by: Johannes Berg +--- + net/mac80211/key.c | 36 ++++++++++++++++++++++++++++++++++-- + 1 file changed, 34 insertions(+), 2 deletions(-) + +--- a/net/mac80211/key.c ++++ b/net/mac80211/key.c +@@ -610,6 +610,39 @@ void ieee80211_key_free_unused(struct ie + ieee80211_key_free_common(key); + } + ++static bool ieee80211_key_identical(struct ieee80211_sub_if_data *sdata, ++ struct ieee80211_key *old, ++ struct ieee80211_key *new) ++{ ++ u8 tkip_old[WLAN_KEY_LEN_TKIP], tkip_new[WLAN_KEY_LEN_TKIP]; ++ u8 *tk_old, *tk_new; ++ ++ if (!old || new->conf.keylen != old->conf.keylen) ++ return false; ++ ++ tk_old = old->conf.key; ++ tk_new = new->conf.key; ++ ++ /* ++ * In station mode, don't compare the TX MIC key, as it's never used ++ * and offloaded rekeying may not care to send it to the host. This ++ * is the case in iwlwifi, for example. ++ */ ++ if (sdata->vif.type == NL80211_IFTYPE_STATION && ++ new->conf.cipher == WLAN_CIPHER_SUITE_TKIP && ++ new->conf.keylen == WLAN_KEY_LEN_TKIP && ++ !(new->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE)) { ++ memcpy(tkip_old, tk_old, WLAN_KEY_LEN_TKIP); ++ memcpy(tkip_new, tk_new, WLAN_KEY_LEN_TKIP); ++ memset(tkip_old + NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY, 0, 8); ++ memset(tkip_new + NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY, 0, 8); ++ tk_old = tkip_old; ++ tk_new = tkip_new; ++ } ++ ++ return !crypto_memneq(tk_old, tk_new, new->conf.keylen); ++} ++ + int ieee80211_key_link(struct ieee80211_key *key, + struct ieee80211_sub_if_data *sdata, + struct sta_info *sta) +@@ -635,8 +668,7 @@ int ieee80211_key_link(struct ieee80211_ + * Silently accept key re-installation without really installing the + * new version of the key to avoid nonce reuse or replay issues. + */ +- if (old_key && key->conf.keylen == old_key->conf.keylen && +- !crypto_memneq(key->conf.key, old_key->conf.key, key->conf.keylen)) { ++ if (ieee80211_key_identical(sdata, old_key, key)) { + ieee80211_key_free_unused(key); + ret = 0; + goto out; diff --git a/package/kernel/mac80211/patches/999-ccmp-crypto.patch b/package/kernel/mac80211/patches/999-ccmp-crypto.patch deleted file mode 100644 index db2379b0d..000000000 --- a/package/kernel/mac80211/patches/999-ccmp-crypto.patch +++ /dev/null @@ -1,234 +0,0 @@ -From patchwork Mon Sep 25 22:29:41 2017 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [v2] ath10k: add new cipher suite support -From: Rajkumar Manoharan -X-Patchwork-Id: 9970615 -Message-Id: <1506378581-13598-1-git-send-email-rmanohar@qti.qualcomm.com> -To: -Cc: Jouni Malinen , linux-wireless@vger.kernel.org, - Rajkumar Manoharan , rmanohar@codeaurora.org -Date: Mon, 25 Sep 2017 15:29:41 -0700 - -QCA99x0 and QCA4019 family chips support CCMP-256, GCMP-128, and -GCMP-256 ciphers in hardware, so advertise support for these. As -firmware does not support group management frame ciphers (BIP), -handle them in software (mac80211). - -Reviewed-by: Sebastian Gottschall -Cc: Jouni Malinen -Signed-off-by: Rajkumar Manoharan ---- -v2: fix a bug in assigning n_cipher_suites. fill hw_param n_cipher_suites - for all chips. - - drivers/net/wireless/ath/ath10k/core.c | 12 ++++++++++ - drivers/net/wireless/ath/ath10k/hw.h | 3 +++ - drivers/net/wireless/ath/ath10k/mac.c | 43 ++++++++++++++++++++++++++++++++-- - drivers/net/wireless/ath/ath10k/wmi.h | 1 + - 4 files changed, 57 insertions(+), 2 deletions(-) - -diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c -index a4f635820f35..71de3a28b59c 100644 ---- a/drivers/net/wireless/ath/ath10k/core.c -+++ b/drivers/net/wireless/ath/ath10k/core.c -@@ -74,6 +74,7 @@ - .spectral_bin_discard = 0, - .vht160_mcs_rx_highest = 0, - .vht160_mcs_tx_highest = 0, -+ .n_cipher_suites = 8, - }, - { - .id = QCA9887_HW_1_0_VERSION, -@@ -97,6 +98,7 @@ - .spectral_bin_discard = 0, - .vht160_mcs_rx_highest = 0, - .vht160_mcs_tx_highest = 0, -+ .n_cipher_suites = 8, - }, - { - .id = QCA6174_HW_2_1_VERSION, -@@ -119,6 +121,7 @@ - .spectral_bin_discard = 0, - .vht160_mcs_rx_highest = 0, - .vht160_mcs_tx_highest = 0, -+ .n_cipher_suites = 8, - }, - { - .id = QCA6174_HW_2_1_VERSION, -@@ -141,6 +144,7 @@ - .spectral_bin_discard = 0, - .vht160_mcs_rx_highest = 0, - .vht160_mcs_tx_highest = 0, -+ .n_cipher_suites = 8, - }, - { - .id = QCA6174_HW_3_0_VERSION, -@@ -163,6 +167,7 @@ - .spectral_bin_discard = 0, - .vht160_mcs_rx_highest = 0, - .vht160_mcs_tx_highest = 0, -+ .n_cipher_suites = 8, - }, - { - .id = QCA6174_HW_3_2_VERSION, -@@ -188,6 +193,7 @@ - .spectral_bin_discard = 0, - .vht160_mcs_rx_highest = 0, - .vht160_mcs_tx_highest = 0, -+ .n_cipher_suites = 8, - }, - { - .id = QCA99X0_HW_2_0_DEV_VERSION, -@@ -216,6 +222,7 @@ - .spectral_bin_discard = 4, - .vht160_mcs_rx_highest = 0, - .vht160_mcs_tx_highest = 0, -+ .n_cipher_suites = 11, - }, - { - .id = QCA9984_HW_1_0_DEV_VERSION, -@@ -249,6 +256,7 @@ - */ - .vht160_mcs_rx_highest = 1560, - .vht160_mcs_tx_highest = 1560, -+ .n_cipher_suites = 11, - }, - { - .id = QCA9888_HW_2_0_DEV_VERSION, -@@ -281,6 +289,7 @@ - */ - .vht160_mcs_rx_highest = 780, - .vht160_mcs_tx_highest = 780, -+ .n_cipher_suites = 11, - }, - { - .id = QCA9377_HW_1_0_DEV_VERSION, -@@ -303,6 +312,7 @@ - .spectral_bin_discard = 0, - .vht160_mcs_rx_highest = 0, - .vht160_mcs_tx_highest = 0, -+ .n_cipher_suites = 8, - }, - { - .id = QCA9377_HW_1_1_DEV_VERSION, -@@ -327,6 +337,7 @@ - .spectral_bin_discard = 0, - .vht160_mcs_rx_highest = 0, - .vht160_mcs_tx_highest = 0, -+ .n_cipher_suites = 8, - }, - { - .id = QCA4019_HW_1_0_DEV_VERSION, -@@ -356,6 +367,7 @@ - .spectral_bin_discard = 4, - .vht160_mcs_rx_highest = 0, - .vht160_mcs_tx_highest = 0, -+ .n_cipher_suites = 11, - }, - }; - -diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h -index 0c089f6dd3d9..ed30d5b6cd0e 100644 ---- a/drivers/net/wireless/ath/ath10k/hw.h -+++ b/drivers/net/wireless/ath/ath10k/hw.h -@@ -550,6 +550,9 @@ struct ath10k_hw_params { - */ - int vht160_mcs_rx_highest; - int vht160_mcs_tx_highest; -+ -+ /* Number of ciphers supported (i.e First N) in cipher_suites array */ -+ int n_cipher_suites; - }; - - struct htt_rx_desc; -diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c -index 5683f1a5330e..89455231754c 100644 ---- a/drivers/net/wireless/ath/ath10k/mac.c -+++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -242,6 +242,16 @@ static int ath10k_send_key(struct ath10k_vif *arvif, - case WLAN_CIPHER_SUITE_WEP104: - arg.key_cipher = WMI_CIPHER_WEP; - break; -+ case WLAN_CIPHER_SUITE_CCMP_256: -+ arg.key_cipher = WMI_CIPHER_AES_CCM; -+ break; -+ case WLAN_CIPHER_SUITE_GCMP: -+ case WLAN_CIPHER_SUITE_GCMP_256: -+ arg.key_cipher = WMI_CIPHER_AES_GCM; -+ break; -+ case WLAN_CIPHER_SUITE_BIP_GMAC_128: -+ case WLAN_CIPHER_SUITE_BIP_GMAC_256: -+ case WLAN_CIPHER_SUITE_BIP_CMAC_256: - case WLAN_CIPHER_SUITE_AES_CMAC: - WARN_ON(1); - return -EINVAL; -@@ -5723,7 +5733,10 @@ static int ath10k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, - u32 flags2; - - /* this one needs to be done in software */ -- if (key->cipher == WLAN_CIPHER_SUITE_AES_CMAC) -+ if (key->cipher == WLAN_CIPHER_SUITE_AES_CMAC || -+ key->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 || -+ key->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256 || -+ key->cipher == WLAN_CIPHER_SUITE_BIP_CMAC_256) - return 1; - - if (arvif->nohwcrypt) -@@ -8074,7 +8087,22 @@ int ath10k_mac_register(struct ath10k *ar) - WLAN_CIPHER_SUITE_WEP104, - WLAN_CIPHER_SUITE_TKIP, - WLAN_CIPHER_SUITE_CCMP, -+ -+ /* Do not add hardware supported ciphers before this line. -+ * Allow software encryption for all chips. Don't forget to -+ * update n_cipher_suites below. -+ */ - WLAN_CIPHER_SUITE_AES_CMAC, -+ WLAN_CIPHER_SUITE_BIP_CMAC_256, -+ WLAN_CIPHER_SUITE_BIP_GMAC_128, -+ WLAN_CIPHER_SUITE_BIP_GMAC_256, -+ -+ /* Only QCA99x0 and QCA4019 varients support GCMP-128, GCMP-256 -+ * and CCMP-256 in hardware. -+ */ -+ WLAN_CIPHER_SUITE_GCMP, -+ WLAN_CIPHER_SUITE_GCMP_256, -+ WLAN_CIPHER_SUITE_CCMP_256, - }; - struct ieee80211_supported_band *band; - void *channels; -@@ -8313,7 +8341,18 @@ int ath10k_mac_register(struct ath10k *ar) - } - - ar->hw->wiphy->cipher_suites = cipher_suites; -- ar->hw->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); -+ -+ /* QCA988x and QCA6174 family chips do not support CCMP-256, GCMP-128 -+ * and GCMP-256 ciphers in hardware. Fetch number of ciphers supported -+ * from chip specific hw_param table. -+ */ -+ if (!ar->hw_params.n_cipher_suites || -+ ar->hw_params.n_cipher_suites > ARRAY_SIZE(cipher_suites)) { -+ ath10k_err(ar, "invalid hw_params.n_cipher_suites %d\n", -+ ar->hw_params.n_cipher_suites); -+ ar->hw_params.n_cipher_suites = 8; -+ } -+ ar->hw->wiphy->n_cipher_suites = ar->hw_params.n_cipher_suites; - - wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST); - -diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h -index 7a3606dde227..c02b21cff38d 100644 ---- a/drivers/net/wireless/ath/ath10k/wmi.h -+++ b/drivers/net/wireless/ath/ath10k/wmi.h -@@ -4751,6 +4751,7 @@ struct wmi_key_seq_counter { - #define WMI_CIPHER_WAPI 0x5 - #define WMI_CIPHER_CKIP 0x6 - #define WMI_CIPHER_AES_CMAC 0x7 -+#define WMI_CIPHER_AES_GCM 0x8 - - struct wmi_vdev_install_key_cmd { - __le32 vdev_id; - From f364ed43600092202bd19d883b8b502de8e6fbfa Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 27 Oct 2017 11:32:38 +0800 Subject: [PATCH 10/22] netfilter match bypass default check: fix in kernel 3.18 4.4 4.9 --- ...etfilter_match_bypass_default_checks.patch | 25 ++++++++++++++++--- ...etfilter_match_bypass_default_checks.patch | 25 ++++++++++++++++--- ...etfilter_match_bypass_default_checks.patch | 25 ++++++++++++++++--- 3 files changed, 63 insertions(+), 12 deletions(-) diff --git a/target/linux/generic/pending-3.18/610-netfilter_match_bypass_default_checks.patch b/target/linux/generic/pending-3.18/610-netfilter_match_bypass_default_checks.patch index 74be42504..e5c7a77b4 100644 --- a/target/linux/generic/pending-3.18/610-netfilter_match_bypass_default_checks.patch +++ b/target/linux/generic/pending-3.18/610-netfilter_match_bypass_default_checks.patch @@ -67,11 +67,10 @@ counters = alloc_counters(table); if (IS_ERR(counters)) -@@ -972,6 +1001,14 @@ copy_entries_to_user(unsigned int total_ - ret = -EFAULT; +@@ -973,6 +1002,14 @@ copy_entries_to_user(unsigned int total_ goto free_counters; } -+ + + flags = e->ip.flags & IPT_F_MASK; + if (copy_to_user(userptr + off + + offsetof(struct ipt_entry, ip.flags), @@ -79,6 +78,24 @@ + ret = -EFAULT; + goto free_counters; + } - ++ for (i = sizeof(struct ipt_entry); i < e->target_offset; + i += m->u.match_size) { +@@ -1379,12 +1416,15 @@ compat_copy_entry_to_user(struct ipt_ent + compat_uint_t origsize; + const struct xt_entry_match *ematch; + int ret = 0; ++ u8 flags = e->ip.flags & IPT_F_MASK; + + origsize = *size; + ce = (struct compat_ipt_entry __user *)*dstptr; + if (copy_to_user(ce, e, sizeof(struct ipt_entry)) != 0 || + copy_to_user(&ce->counters, &counters[i], +- sizeof(counters[i])) != 0) ++ sizeof(counters[i])) != 0 || ++ copy_to_user(&ce->ip.flags, &flags, ++ sizeof(flags)) != 0) + return -EFAULT; + + *dstptr += sizeof(struct compat_ipt_entry); diff --git a/target/linux/generic/pending-4.4/610-netfilter_match_bypass_default_checks.patch b/target/linux/generic/pending-4.4/610-netfilter_match_bypass_default_checks.patch index ea9558fcc..8b96639c7 100644 --- a/target/linux/generic/pending-4.4/610-netfilter_match_bypass_default_checks.patch +++ b/target/linux/generic/pending-4.4/610-netfilter_match_bypass_default_checks.patch @@ -67,11 +67,10 @@ counters = alloc_counters(table); if (IS_ERR(counters)) -@@ -974,6 +1003,14 @@ copy_entries_to_user(unsigned int total_ - ret = -EFAULT; +@@ -975,6 +1004,14 @@ copy_entries_to_user(unsigned int total_ goto free_counters; } -+ + + flags = e->ip.flags & IPT_F_MASK; + if (copy_to_user(userptr + off + + offsetof(struct ipt_entry, ip.flags), @@ -79,6 +78,24 @@ + ret = -EFAULT; + goto free_counters; + } - ++ for (i = sizeof(struct ipt_entry); i < e->target_offset; + i += m->u.match_size) { +@@ -1380,12 +1417,15 @@ compat_copy_entry_to_user(struct ipt_ent + compat_uint_t origsize; + const struct xt_entry_match *ematch; + int ret = 0; ++ u8 flags = e->ip.flags & IPT_F_MASK; + + origsize = *size; + ce = (struct compat_ipt_entry __user *)*dstptr; + if (copy_to_user(ce, e, sizeof(struct ipt_entry)) != 0 || + copy_to_user(&ce->counters, &counters[i], +- sizeof(counters[i])) != 0) ++ sizeof(counters[i])) != 0 || ++ copy_to_user(&ce->ip.flags, &flags, ++ sizeof(flags)) != 0) + return -EFAULT; + + *dstptr += sizeof(struct compat_ipt_entry); diff --git a/target/linux/generic/pending-4.9/610-netfilter_match_bypass_default_checks.patch b/target/linux/generic/pending-4.9/610-netfilter_match_bypass_default_checks.patch index de1707401..6e653ef88 100644 --- a/target/linux/generic/pending-4.9/610-netfilter_match_bypass_default_checks.patch +++ b/target/linux/generic/pending-4.9/610-netfilter_match_bypass_default_checks.patch @@ -76,11 +76,10 @@ Signed-off-by: Felix Fietkau counters = alloc_counters(table); if (IS_ERR(counters)) -@@ -850,6 +879,14 @@ copy_entries_to_user(unsigned int total_ - ret = -EFAULT; +@@ -851,6 +880,14 @@ copy_entries_to_user(unsigned int total_ goto free_counters; } -+ + + flags = e->ip.flags & IPT_F_MASK; + if (copy_to_user(userptr + off + + offsetof(struct ipt_entry, ip.flags), @@ -88,6 +87,24 @@ Signed-off-by: Felix Fietkau + ret = -EFAULT; + goto free_counters; + } - ++ for (i = sizeof(struct ipt_entry); i < e->target_offset; + i += m->u.match_size) { +@@ -1240,12 +1277,15 @@ compat_copy_entry_to_user(struct ipt_ent + compat_uint_t origsize; + const struct xt_entry_match *ematch; + int ret = 0; ++ u8 flags = e->ip.flags & IPT_F_MASK; + + origsize = *size; + ce = (struct compat_ipt_entry __user *)*dstptr; + if (copy_to_user(ce, e, sizeof(struct ipt_entry)) != 0 || + copy_to_user(&ce->counters, &counters[i], +- sizeof(counters[i])) != 0) ++ sizeof(counters[i])) != 0 || ++ copy_to_user(&ce->ip.flags, &flags, ++ sizeof(flags)) != 0) + return -EFAULT; + + *dstptr += sizeof(struct compat_ipt_entry); From d27dad8d2b7c71cf580baf42a00565d8f2294996 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 27 Oct 2017 11:47:42 +0800 Subject: [PATCH 11/22] add lucii-app-oscam and oscam for SATV --- package/lean/luci-app-oscam/Makefile | 19 ++ .../luasrc/controller/admin/sattv.lua | 16 ++ .../luasrc/model/cbi/sattv/epg.lua | 50 +++++ .../luasrc/model/cbi/sattv/oscam.lua | 67 ++++++ .../lean/luci-app-oscam/root/etc/config/epg | 13 ++ .../lean/luci-app-oscam/root/etc/config/oscam | 4 + .../lean/luci-app-oscam/root/etc/init.d/epg | 23 ++ .../lean/luci-app-oscam/root/etc/init.d/oscam | 70 ++++++ .../luci-app-oscam/root/etc/oscam/oscam.conf | 39 ++++ .../root/etc/oscam/oscam.server | 28 +++ .../luci-app-oscam/root/etc/oscam/oscam.user | 6 + .../root/etc/uci-defaults/luci-sattv | 14 ++ package/lean/luci-app-oscam/root/usr/bin/epg | 199 ++++++++++++++++++ .../luci-app-oscam/root/usr/oscam/oscam.conf | 37 ++++ package/lean/oscam/Makefile | 71 +++++++ 15 files changed, 656 insertions(+) create mode 100644 package/lean/luci-app-oscam/Makefile create mode 100644 package/lean/luci-app-oscam/luasrc/controller/admin/sattv.lua create mode 100644 package/lean/luci-app-oscam/luasrc/model/cbi/sattv/epg.lua create mode 100644 package/lean/luci-app-oscam/luasrc/model/cbi/sattv/oscam.lua create mode 100644 package/lean/luci-app-oscam/root/etc/config/epg create mode 100644 package/lean/luci-app-oscam/root/etc/config/oscam create mode 100755 package/lean/luci-app-oscam/root/etc/init.d/epg create mode 100755 package/lean/luci-app-oscam/root/etc/init.d/oscam create mode 100644 package/lean/luci-app-oscam/root/etc/oscam/oscam.conf create mode 100644 package/lean/luci-app-oscam/root/etc/oscam/oscam.server create mode 100644 package/lean/luci-app-oscam/root/etc/oscam/oscam.user create mode 100644 package/lean/luci-app-oscam/root/etc/uci-defaults/luci-sattv create mode 100755 package/lean/luci-app-oscam/root/usr/bin/epg create mode 100644 package/lean/luci-app-oscam/root/usr/oscam/oscam.conf create mode 100644 package/lean/oscam/Makefile diff --git a/package/lean/luci-app-oscam/Makefile b/package/lean/luci-app-oscam/Makefile new file mode 100644 index 000000000..70a12e865 --- /dev/null +++ b/package/lean/luci-app-oscam/Makefile @@ -0,0 +1,19 @@ +# +# Copyright (C) 2008-2014 The LuCI Team +# +# This is free software, licensed under the Apache License, Version 2.0 . +# + +include $(TOPDIR)/rules.mk + +LUCI_TITLE:=LuCI for OSCAM +LUCI_DEPENDS:=+oscam +LUCI_PKGARCH:=all +PKG_VERSION:=1.0 +PKG_RELEASE:=1 + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot signature + + diff --git a/package/lean/luci-app-oscam/luasrc/controller/admin/sattv.lua b/package/lean/luci-app-oscam/luasrc/controller/admin/sattv.lua new file mode 100644 index 000000000..03f2b172f --- /dev/null +++ b/package/lean/luci-app-oscam/luasrc/controller/admin/sattv.lua @@ -0,0 +1,16 @@ +module("luci.controller.admin.sattv", package.seeall) + +function index() + +-- entry({"admin", "Others"}, cbi("sattv/epg"), i18n("Others"), 70) + + if nixio.fs.access("/etc/config/epg") then + entry({"admin", "Others"}, cbi("sattv/epg"), _("sattv"), 66).index = true + entry({"admin", "Others", "epg"}, cbi("sattv/epg"), _("EPG"), 1).i18n = "diskapply" + end + + if nixio.fs.access("/etc/config/oscam") then + entry({"admin", "Others", "oscam"}, cbi("sattv/oscam"), _("OSCAM"), 12).i18n = "diskapply" + end + +end diff --git a/package/lean/luci-app-oscam/luasrc/model/cbi/sattv/epg.lua b/package/lean/luci-app-oscam/luasrc/model/cbi/sattv/epg.lua new file mode 100644 index 000000000..da46cad90 --- /dev/null +++ b/package/lean/luci-app-oscam/luasrc/model/cbi/sattv/epg.lua @@ -0,0 +1,50 @@ +require("luci.tools.webadmin") + +--[[ +config epg_set + option enable 1 + option time 30 + option src_url http://dm.epg.net.cn/a/epg.xml + option src_url1 http://dm1.epg.net.cn/a/epg.xml + option src_url2 http://epg.xltvrobbs.net/atmosphere/epg/epg.xml + option src_url3 http://epg1.xltvrobbs.net/atmosphere/epg/epg.xml + +]]-- + + +m = Map("epg", translate("epg_title","Set epg download address"),translate("epg_desc", +"Set epg auto download for dm500 atmosphere")) + +s = m:section(TypedSection, "epg_set", translate("epgset","settings")) +s.anonymous = true +s.addremove = false + +enable = s:option(Flag, "enable", translate("enable", "enable")) +enable.default = false +enable.optional = false +enable.rmempty = false + +interval = s:option(Value, "interval", translate("interval","interval")) +interval.default = 30 +interval.optional = false +interval.rmempty = false + + +s = m:section(TypedSection, "downaddress", translate("downaddress","downaddress")) +s.template = "cbi/tblsection" +s.anonymous = false +s.addremove = true + +enable = s:option(Flag, "addr_enable", translate("enable", "enable")) +enable.default = false +enable.optional = false +enable.rmempty = false + + +url = s:option(Value, "address", translate("dowload address","dowload address")) +url.optional = false +url.rmempty = false + + +return m + diff --git a/package/lean/luci-app-oscam/luasrc/model/cbi/sattv/oscam.lua b/package/lean/luci-app-oscam/luasrc/model/cbi/sattv/oscam.lua new file mode 100644 index 000000000..44a19fcfd --- /dev/null +++ b/package/lean/luci-app-oscam/luasrc/model/cbi/sattv/oscam.lua @@ -0,0 +1,67 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2011 flyzjhz + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +]]-- + + +local fs = require "nixio.fs" +local uci = require "luci.model.uci".cursor() +local lanipaddr = uci:get("network", "lan", "ipaddr") or "192.168.1.1" +--- Retrieves the output of the "get_oscam_port" command. +-- @return String containing the current get_oscam_port +function get_oscam_port() + + local oscam_conf= fs.readfile("/usr/oscam/oscam.conf") + local oscam_conf_port = tonumber(oscam_conf:match("[Hh]ttppor[Tt].-= ([^\n]+)")) or "8899" + return oscam_conf_port +end + +local oscamport = get_oscam_port() + +m = Map("oscam", translate("OSCAM","OSCAM"),translate("oscam desc", +"oscam for openwrt")) + +s = m:section(TypedSection, "setting", translate("set","settings")) +s.anonymous = true +s.addremove = false + +enable = s:option(Flag, "enable", translate("enable", "enable")) +enable.default = false +enable.optional = false +enable.rmempty = false + +interval = s:option(Value, "interval", translate("interval","interval"), +translate("interval_desc","interval_desc")) +interval.optional = false +interval.rmempty = false +interval.default = 30 + +s:option(DummyValue,"oscamweb" ,translate("OSCAM Web Intelface "),translate("Open the oscam Web")) + +tmpl = s:option(Value, "_tmpl", + translate("Edit oscam configuration."), + translate("This is the content of the file '/usr/oscam/oscam.conf'")) + +tmpl.template = "cbi/tvalue" +tmpl.rows = 20 + +function tmpl.cfgvalue(self, section) + return nixio.fs.readfile("/usr/oscam/oscam.conf") +end + +function tmpl.write(self, section, value) + value = value:gsub("\r\n?", "\n") + nixio.fs.writefile("//usr/oscam/oscam.conf", value) +end + +return m + + diff --git a/package/lean/luci-app-oscam/root/etc/config/epg b/package/lean/luci-app-oscam/root/etc/config/epg new file mode 100644 index 000000000..9c2791f68 --- /dev/null +++ b/package/lean/luci-app-oscam/root/etc/config/epg @@ -0,0 +1,13 @@ + +config 'epg_set' + option 'enable' '0' + option 'interval' '30' + +config 'downaddress' 'epg1' + option 'addr_enable' '1' + option 'address' 'http://dm.epg.net.cn/a/epg.xml' + +config 'downaddress' 'epg2' + option 'addr_enable' '1' + option 'address' 'http://epg.xltvrobbs.net/atmosphere/epg/epg.xml' + diff --git a/package/lean/luci-app-oscam/root/etc/config/oscam b/package/lean/luci-app-oscam/root/etc/config/oscam new file mode 100644 index 000000000..795ea4e3c --- /dev/null +++ b/package/lean/luci-app-oscam/root/etc/config/oscam @@ -0,0 +1,4 @@ + +config 'setting' + option 'enable' '0' + diff --git a/package/lean/luci-app-oscam/root/etc/init.d/epg b/package/lean/luci-app-oscam/root/etc/init.d/epg new file mode 100755 index 000000000..9b9014cdd --- /dev/null +++ b/package/lean/luci-app-oscam/root/etc/init.d/epg @@ -0,0 +1,23 @@ +#!/bin/sh /etc/rc.common +# copyrights +# (1)epg dowload Script VER 0.10for openwrt by zjhzzyf + + + +START=96 + + + +start(){ + + + /usr/bin/epg start +} + +stop() { + echo "not implemented yet!" +} + +restart() { + start +} \ No newline at end of file diff --git a/package/lean/luci-app-oscam/root/etc/init.d/oscam b/package/lean/luci-app-oscam/root/etc/init.d/oscam new file mode 100755 index 000000000..ca40a3608 --- /dev/null +++ b/package/lean/luci-app-oscam/root/etc/init.d/oscam @@ -0,0 +1,70 @@ +#!/bin/sh /etc/rc.common +# oscam Script VER 0.10 for openwrt by zjhzzyf + +START=94 + +. /etc/functions.sh +path="/usr/oscam/" + + +kill_oscam() +{ +local otherpids +local execute +otherpids=$(ps -a 2>&1 | grep "/usr/bin/oscam" | grep -v $$ | awk -F " " '{print $1}') +echo "$otherpids" | while read execute +do +kill -9 ${execute} +done +} + + + +oscam_start() +{ + + /usr/bin/oscam -b -c $path + echo "readdy go....." + +} + + + +start(){ +echo "game start....." + enable=$(uci get oscam.@setting[0].enable) + if [ "$enable" == "" ];then + enable=0 + fi + + [ "$enable" == "1" ]&&oscam_start + +interval=$(uci get oscam.@setting[0].interval) +oscam_cron=`cat /etc/crontabs/root | grep "/etc/init.d/oscam restart"` +if [ "$enable" == "1" -a "$interval" != "0" ]; then + oscam_new="*/${interval} * * * * /etc/init.d/oscam restart" + if [ "z${oscam_cron}" != "z${oscam_new}" ] ; then + cat /etc/crontabs/root | grep -v "/etc/init.d/oscam restart" > /tmp/crontabs_oscam + echo "" >> /tmp/crontabs_oscam + echo "*/${interval} * * * * /etc/init.d/oscam restart" >> /tmp/crontabs_oscam + cat /tmp/crontabs_oscam | grep -v ^$ > /etc/crontabs/root + /etc/init.d/cron restart + fi +else + if [ "z${oscam_cron}" != "z" ] ; then + cat /etc/crontabs/root | grep -v "/etc/init.d/oscam restart" > /tmp/crontabs_oscam + cat /tmp/crontabs_oscam | grep -v ^$ > /etc/crontabs/root + /etc/init.d/cron restart + fi + +fi +rm -f /tmp/crontabs_oscam + +} + +stop() { + kill_oscam + echo "oscam stopped" +} + + diff --git a/package/lean/luci-app-oscam/root/etc/oscam/oscam.conf b/package/lean/luci-app-oscam/root/etc/oscam/oscam.conf new file mode 100644 index 000000000..51abc783f --- /dev/null +++ b/package/lean/luci-app-oscam/root/etc/oscam/oscam.conf @@ -0,0 +1,39 @@ +# oscam.conf generated automatically by Streamboard OSCAM 1.00-unstable_svn build #r4503 +# Read more: http://streamboard.gmc.to/oscam/browser/trunk/Distribution/doc/txt/oscam.conf.txt + +[global] +logfile = /dev/shm/oscam.log +disablelog = 1 +clientmaxidle = 36000 +bindwait = 5 +netprio = 9 +nice = 9 +waitforcards = 0 +lb_mode = 1 + +[monitor] +port = 9988 +nocrypt = +aulow = 120 +hideclient_to = 0 +monlevel = 255 +appendchaninfo = 0 + +[dvbapi] +enabled = 1 +au = 1 +boxtype = none +user = user1 +pmt_mode = 0 +request_mode = 0 + +[webif] +httpport = 8899 +httpuser = oscam +httppwd = oscam +httprefresh = 0 +httpallowed = 1.0.0.0-255.255.0.0 +httphideidleclients = 0 +httpreadonly = 0 +httpsavefullcfg = 0 + diff --git a/package/lean/luci-app-oscam/root/etc/oscam/oscam.server b/package/lean/luci-app-oscam/root/etc/oscam/oscam.server new file mode 100644 index 000000000..876103ba0 --- /dev/null +++ b/package/lean/luci-app-oscam/root/etc/oscam/oscam.server @@ -0,0 +1,28 @@ +# oscam.server generated automatically by Streamboard OSCAM 1.00-unstable_svn build #r4503 +# Read more: http://streamboard.gmc.to/oscam/browser/trunk/Distribution/doc/txt/oscam.server.txt + +[reader] +label = reshare1 +enable = 0 +protocol = cccam +device = oscam.3322.org,13111 +user = test01 +password = test01 +inactivitytimeout = 1 +reconnecttimeout = 3 +group = 1 +blockemm-unknown = 1 +blockemm-u = 1 +blockemm-s = 1 +blockemm-g = 1 +lb_weight = 100 +cccversion = 2.1.2 +cccmaxhops = 12 +ccckeepalive = 1 +audisabled = 1 +cccdisableautoblock = 1 + + + + + diff --git a/package/lean/luci-app-oscam/root/etc/oscam/oscam.user b/package/lean/luci-app-oscam/root/etc/oscam/oscam.user new file mode 100644 index 000000000..f02c1bc84 --- /dev/null +++ b/package/lean/luci-app-oscam/root/etc/oscam/oscam.user @@ -0,0 +1,6 @@ +[account] +user = 001 +pwd = 001 +group = 1 +keepalive = 1 +uniq = 0 diff --git a/package/lean/luci-app-oscam/root/etc/uci-defaults/luci-sattv b/package/lean/luci-app-oscam/root/etc/uci-defaults/luci-sattv new file mode 100644 index 000000000..a9e759580 --- /dev/null +++ b/package/lean/luci-app-oscam/root/etc/uci-defaults/luci-sattv @@ -0,0 +1,14 @@ +#!/bin/sh + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@epg[-1] + add ucitrack epg + set ucitrack.@epg[-1].init=epg + delete ucitrack.@oscam[-1] + add ucitrack oscam + set ucitrack.@oscam[-1].init=oscam + add_list ucitrack.@oscam[-1].affects=cron + commit ucitrack +EOF +rm -f /tmp/luci-indexcache +exit 0 diff --git a/package/lean/luci-app-oscam/root/usr/bin/epg b/package/lean/luci-app-oscam/root/usr/bin/epg new file mode 100755 index 000000000..e51b91fc4 --- /dev/null +++ b/package/lean/luci-app-oscam/root/usr/bin/epg @@ -0,0 +1,199 @@ +#!/bin/sh +# copyrights +# (1)epg dowload Script VER 0.10for openwrt by zjhzzyf + + +. /lib/functions.sh + + +epg_down() +{ + bsuc=1 + echo "File Path:"$path + filename="epg.xml" + echo "Setup FileName:"$filename + sfullfilename=`echo $path$filename` + echo "sFullFileName:"$sfullfilename + + index=0 + echo "Try Times Max:"$trytimes + while [ "$index" -lt "$trytimes" ] + do + echo "Try Times:"$index + if wget -qO- -t3 $url > $sfullfilename;then + break + fi + index=`expr $index + 1` + done + if [ "$index" -eq "$trytimes" ]; then + ErrMsg=`date` + ErrMsg=$ErrMsg" 下载配置文件失败" + bsuc=0 + return + fi + echo "down $filename completed" +mfullfilename=`echo ${path}store/${filename}.md5` + echo "MD5 File Name:"$mfullfilename + md5old=`cat $mfullfilename` + md5old=`echo $md5old|awk '{print $1}'|tr "[a-z]" "[A-Z]"` + echo "Old File MD5:"$md5old + md5new=`/usr/bin/md5sum $sfullfilename` + md5new=`echo $md5new|awk '{print $1}'|tr "[a-z]" "[A-Z]"` + echo "New File MD5:"$md5new + if [ "$md5old" = "$md5new" ]; then + ErrMsg=`date` + ErrMsg=$ErrMsg" 数据不需要更新" + bsuc=1 + return + else + + counttimes=0 + suctimes=0 + counttimes=`expr $counttimes + 1` + url=$(grep -m 1 "URL" $sfullfilename |awk -F "" '{print $2}'|awk -F "" '{print $1}') + echo "Down Data URL:" $url + +filename=`echo ${url##*/}` + echo "Down File Name:"$filename + + echo "=====" +echo $url + replaces=`echo ${url%/*}` + +replaces=`echo ${replaces#*//}` + + echo replaces: $replaces + echo -e `sed -e "s#$replaces#$replaced#g" $sfullfilename` > `echo $sfullfilename` + echo "=====" + + dfullfilename=`echo $path$filename` + echo "Down Data Save File Name:"$dfullfilename + + index=0 + while [ "$index" -lt "$trytimes" ] + do + echo "Try Times:"$index + if wget -t3 -T120 -qO- $url > $dfullfilename;then + suctimes=`expr $suctimes + 1` + + break + fi + index=`expr $index + 1` + + done + + if [ "$index" -eq "$trytimes" ]; then + bsuc=0 + ErrMsg=`date` + ErrMsg=$ErrMsg" 下载"$url"失败" + + fi + + + if [ "$counttimes" -eq "$suctimes" ]; then + echo $md5new > `echo $mfullfilename` + +mount -o bind /tmp/epg/ /www/atmosphere + rm -rf ${path}/epg/* + +cp ${path}$filename ${path}/epg +cp ${path}epg.xml ${path}/epg + rm -rf ${path}$filename + rm -rf ${path}epg.xml + ErrMsg=`date` + ErrMsg=$ErrMsg" 下载EPG数据成功" + echo $ErrMsg + exit 0 + else + ErrMsg=`date` + ErrMsg= $ErrMsg " 未知原因失败" + fi + fi +} + + +epg_start() { + +config_get enable $1 enable +config_get interval $1 interval +[ "$enable" = "" ]&&enable=0 + +#make scheduler + +epg_cron=`cat /etc/crontabs/root | grep "/usr/bin/epg scheduler"` +if [ "$enable" == "1" -a "${interval}" != "0" ]; then + mkdir -p /tmp/epg/ + mkdir -p /tmp/epg/store + mkdir -p /tmp/epg/epg + mkdir -p /www/atmosphere + epg_new="*/${interval} * * * * /usr/bin/epg scheduler" + if [ "z${epg_cron}" != "z${epg_new}" ] ; then + cat /etc/crontabs/root | grep -v "/etc/init.d/epg scheduler" > /tmp/crontabs_epg + echo "*/${interval} * * * * /etc/init.d/epg scheduler" >> /tmp/crontabs_epg + echo "" >> /tmp/crontabs_epg + cat /tmp/crontabs_epg | grep -v ^$ > /etc/crontabs/root + /etc/init.d/cron restart + fi +else + if [ "z${epg_cron}" != "z" ] ; then + cat /etc/crontabs/root | grep -v "/etc/init.d/epg scheduler" > /tmp/crontabs_epg + cat /tmp/crontabs_epg | grep -v ^$ > /etc/crontabs/root + /etc/init.d/cron restart + fi +rm -f /tmp/crontabs_epg + +fi + +/etc/init.d/cron restart + +} + + +con_get_addr(){ + + config_get addr_enable $1 addr_enable + config_get address $1 address + +[ "$addr_enable" == "1" ]&&{ +url=$address +echo $url +ErrMsg=`date` +ErrMsg=$ErrMsg" 开始从"$url"下载" +echo $ErrMsg >> `echo /tmp/epglog.txt` +rm `echo $path"*"` +epg_down +echo $ErrMsg >> `echo /tmp/epglog.txt` +echo $bsuc +echo "******************************************************************" >> `echo /tmp/epglog.txt` +} +} + + + +epg_scheduler(){ + +path="/tmp/epg/" +trytimes=3 +bsuc=1 +ErrMsg="" +lan_ipaddr=$(uci get network.lan.ipaddr) +replaced="${lan_ipaddr}/atmosphere/epg" + + +} + + +config_load epg +case "$1" in + start) + config_foreach epg_start epg_set + ;; + stop) + echo "stop test " + ;; + scheduler) + epg_scheduler + config_foreach con_get_addr downaddress +;; +esac + diff --git a/package/lean/luci-app-oscam/root/usr/oscam/oscam.conf b/package/lean/luci-app-oscam/root/usr/oscam/oscam.conf new file mode 100644 index 000000000..a552326fe --- /dev/null +++ b/package/lean/luci-app-oscam/root/usr/oscam/oscam.conf @@ -0,0 +1,37 @@ +[global] +# Prozess +nice = -10 +pidfile = /tmp/oscam.pid +# Logging +logfile = /tmp/oscam.log +disablelog = 0 +maxlogsize = 256 +usrfile = /tmp/oscam_user.log +disableuserfile = 0 +usrfileflag = 1 +# Timeouts - If you have problems adjust or remove rows! +clienttimeout = 2000 +fallbacktimeout = 1000 +serialreadertimeout = 800 +# Sonstiges +clientdyndns = 0 +unlockparental = 1 +saveinithistory = 1 + +[monitor] +port = 15990 +nocrypt = 127.0.0.1,192.168.1.1-192.168.1.255 # "No entry for other IP's!" +aulow = 30 +hideclient_to = 0 +monlevel = 4 +appendchaninfo = 0 + +[camd35] +port = 15991 + +[webif] +httpport = 16000 +httprefresh = 0 +httpallowed = 127.0.0.1,192.168.1.1-192.168.1.255 # "No entry for other IP's!" +httphideidleclients = 0 +httpreadonly = 0 diff --git a/package/lean/oscam/Makefile b/package/lean/oscam/Makefile new file mode 100644 index 000000000..6a1d1c44c --- /dev/null +++ b/package/lean/oscam/Makefile @@ -0,0 +1,71 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# maz-1 + +include $(TOPDIR)/rules.mk + +PKG_BRANCH:=trunk +PKG_SOURCE_URL:=http://www.streamboard.tv/svn/oscam/trunk +#PKG_REV:=$(shell LC_ALL=C svn info ${PKG_SOURCE_URL} | sed -ne's/^Last Changed Rev: //p') +PKG_REV:=10777 + +PKG_NAME:=oscam +PKG_VERSION:=svn$(PKG_REV) +PKG_RELEASE:=1 + +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz +PKG_SOURCE_PROTO:=svn +PKG_SOURCE_VERSION:=$(PKG_REV) + +PKG_BUILD_DEPENDS:= + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_INSTALL_DIR:=$(PKG_BUILD_DIR) + + + +include $(INCLUDE_DIR)/package.mk + +define Package/oscam + DEPENDS:=+libopenssl +libpthread +libusb-1.0 + TITLE:=Open Source Conditional Access Module software + URL:=http://streamboard.gmc.to/oscam/ + SUBMENU:= +endef + +define Package/oscam/description + An Open Source Conditional Access Module software, +based on the very good MpCS version 0.9d created by dukat. +endef + +CONFIGURE_ARGS += --with-ssl=openssl + +define Build/Prepare + $(call Build/Prepare/Default) + mkdir -p $(PKG_BUILD_DIR)/build + cd $(PKG_BUILD_DIR)/build; +endef + +define Package/oscam/conffiles +endef + +define Build/Compile + echo 'set (OSCAM_SYSTEM_NAME wrt350nv2)' > $(PKG_BUILD_DIR)/toolchain.cmake + echo 'set (CMAKE_SYSTEM_NAME Linux)' >> $(PKG_BUILD_DIR)/toolchain.cmake + echo 'set (CMAKE_C_COMPILER $(TARGET_CROSS)gcc)' >> $(PKG_BUILD_DIR)/toolchain.cmake + echo 'set (CMAKE_SYSTEM_PROCESSOR $(ARCH))' >> $(PKG_BUILD_DIR)/toolchain.cmake + cd $(PKG_BUILD_DIR)/build;cmake -DCMAKE_TOOLCHAIN_FILE=$(PKG_BUILD_DIR)/toolchain.cmake ..;make +endef + + +define Package/oscam/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/oscam $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,oscam)) From 73db9ba2f8ba1e27a0233a707a7f1b24cf7ab7d8 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 27 Oct 2017 12:05:15 +0800 Subject: [PATCH 12/22] add luci-app-dogcom --- package/lean/luci-app-dogcom/LICENSE | 661 ++++++++++++++++++ package/lean/luci-app-dogcom/Makefile | 68 ++ package/lean/luci-app-dogcom/README.md | 2 + .../files/luci/controller/dogcom.lua | 14 + .../files/luci/i18n/dogcom_zh-cn.lmo | Bin 0 -> 500 bytes .../files/luci/i18n/dogcom_zh-cn.po | 46 ++ .../files/luci/model/cbi/dogcom.lua | 72 ++ .../files/luci/view/dogcom/auto_configure.htm | 167 +++++ .../files/root/etc/config/dogcom | 3 + .../files/root/etc/init.d/dogcom | 34 + .../root/etc/uci-defaults/40_luci-dogcom | 11 + 11 files changed, 1078 insertions(+) create mode 100644 package/lean/luci-app-dogcom/LICENSE create mode 100644 package/lean/luci-app-dogcom/Makefile create mode 100644 package/lean/luci-app-dogcom/README.md create mode 100644 package/lean/luci-app-dogcom/files/luci/controller/dogcom.lua create mode 100644 package/lean/luci-app-dogcom/files/luci/i18n/dogcom_zh-cn.lmo create mode 100644 package/lean/luci-app-dogcom/files/luci/i18n/dogcom_zh-cn.po create mode 100644 package/lean/luci-app-dogcom/files/luci/model/cbi/dogcom.lua create mode 100644 package/lean/luci-app-dogcom/files/luci/view/dogcom/auto_configure.htm create mode 100644 package/lean/luci-app-dogcom/files/root/etc/config/dogcom create mode 100644 package/lean/luci-app-dogcom/files/root/etc/init.d/dogcom create mode 100644 package/lean/luci-app-dogcom/files/root/etc/uci-defaults/40_luci-dogcom diff --git a/package/lean/luci-app-dogcom/LICENSE b/package/lean/luci-app-dogcom/LICENSE new file mode 100644 index 000000000..dbbe35581 --- /dev/null +++ b/package/lean/luci-app-dogcom/LICENSE @@ -0,0 +1,661 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 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 Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/package/lean/luci-app-dogcom/Makefile b/package/lean/luci-app-dogcom/Makefile new file mode 100644 index 000000000..a75234392 --- /dev/null +++ b/package/lean/luci-app-dogcom/Makefile @@ -0,0 +1,68 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=luci-app-dogcom +PKG_VERSION:=1.0.2 +PKG_RELEASE:=1 + +PKG_MAINTAINER:=fuyumi <280604399@qq.com> +PKG_LICENSE:=AGPLv3 +PKG_LICENSE_FILES:=LICENSE + +PKG_SOURCE_SUBDIR:=$(PKG_NAME) +PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR) +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/luci-app-dogcom + SECTION:=luci + CATEGORY:=LuCI + SUBMENU:=3. Applications + TITLE:=LuCI app for openwrt-dogcom + DEPENDS:=+dogcom + PKGARCH:=all + MAINTAINER:=fuyumi +endef + +define Package/luci-app-dogcom/description + This package contains LuCI configuration pages for openwrt-dogcom. +endef + +define Build/Prepare +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/luci-app-dogcom/postinst +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + ( . /etc/uci-defaults/luci-app-dogcom ) && rm -f /etc/uci-defaults/luci-app-dogcom + rm -f /tmp/luci-indexcache +fi +exit 0 +endef + +define Package/luci-app-dogcom/install + $(INSTALL_DIR) $(1)/etc/uci-defaults + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/view/dogcom + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DIR) $(1)/etc/init.d + + $(INSTALL_BIN) ./files/root/etc/uci-defaults/40_luci-dogcom $(1)/etc/uci-defaults/luci-app-dogcom + $(INSTALL_DATA) ./files/luci/controller/dogcom.lua $(1)/usr/lib/lua/luci/controller/dogcom.lua + $(INSTALL_DATA) ./files/luci/model/cbi/dogcom.lua $(1)/usr/lib/lua/luci/model/cbi/dogcom.lua + $(INSTALL_DATA) ./files/luci/view/dogcom/auto_configure.htm $(1)/usr/lib/lua/luci/view/dogcom/auto_configure.htm + $(INSTALL_DATA) ./files/luci/i18n/dogcom_zh-cn.lmo $(1)/usr/lib/lua/luci/i18n/dogcom.zh-cn.lmo + $(INSTALL_CONF) ./files/root/etc/config/dogcom $(1)/etc/config/dogcom + $(INSTALL_BIN) ./files/root/etc/init.d/dogcom $(1)/etc/init.d/dogcom +endef + +$(eval $(call BuildPackage,luci-app-dogcom)) diff --git a/package/lean/luci-app-dogcom/README.md b/package/lean/luci-app-dogcom/README.md new file mode 100644 index 000000000..3ae6ffae9 --- /dev/null +++ b/package/lean/luci-app-dogcom/README.md @@ -0,0 +1,2 @@ +# luci-app-dogcom +LuCI app for [openwrt-dogcom](https://github.com/mchome/openwrt-dogcom "") \ No newline at end of file diff --git a/package/lean/luci-app-dogcom/files/luci/controller/dogcom.lua b/package/lean/luci-app-dogcom/files/luci/controller/dogcom.lua new file mode 100644 index 000000000..397101118 --- /dev/null +++ b/package/lean/luci-app-dogcom/files/luci/controller/dogcom.lua @@ -0,0 +1,14 @@ +-- Copyright (C) 2017 fuyumi <280604399@qq.com> +-- Licensed to the public under the GNU Affero General Public License v3. + +module("luci.controller.dogcom", package.seeall) + +function index() + if not nixio.fs.access("/etc/config/dogcom") then + return + end + local page + page = entry({"admin", "network", "dogcom"}, cbi("dogcom"), _("dogcom"), 100) + page.i18n = "dogcom" + page.dependent = true +end \ No newline at end of file diff --git a/package/lean/luci-app-dogcom/files/luci/i18n/dogcom_zh-cn.lmo b/package/lean/luci-app-dogcom/files/luci/i18n/dogcom_zh-cn.lmo new file mode 100644 index 0000000000000000000000000000000000000000..0b5549bb8b5254b5e5c8eed2288ec87d0103ad83 GIT binary patch literal 500 zcmZ?CPfyOzRd}&(-}Ale7#J8_p#1$4UM%c+vSaPzh9;QUvpK6?fQ3O~Pv`G?HfIe) z+tUf_pHErA!0^1Y11QG8kdl#H@P1E+3y}YQPbULIK|w)&Do`K*DgdHi>|OI@XXn$k z)1R+d_G01ECp#J$7+$va0v+*eTKkjT+g|LS`DDi`2>aQL_4=tL$@(c^x9KJ4=cR$1 z!0>#^{AV2#Ai7?x-~MDr*ONU9p6p%ld{)b|sT-d4u6x?k`hHK(^OkK-C-gnpzwX(T zoln=dJzvoHbmz9GOM0JnYd>AiD&J#eyns+P*C+3jnfvfS9NB*o>yrP5CE)><}R4t2iVOy_a3Z z4#;)^VzxRqlf&Ciy4nEQ7C_9?;jt{;MY4bm$Oh>NpT%yIcgt$7J&^4K#B7VYPSvgq z;kyQ8s{pa^q9fL^rmJ_H1G4u3G0)b*3$o_HvsVGxAU6v?eG((pv}VP7AR7dD85kH9 E09~i&l>h($ literal 0 HcmV?d00001 diff --git a/package/lean/luci-app-dogcom/files/luci/i18n/dogcom_zh-cn.po b/package/lean/luci-app-dogcom/files/luci/i18n/dogcom_zh-cn.po new file mode 100644 index 000000000..29fde2647 --- /dev/null +++ b/package/lean/luci-app-dogcom/files/luci/i18n/dogcom_zh-cn.po @@ -0,0 +1,46 @@ +msgid "" +msgstr "" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +msgid "Dogcom config" +msgstr "Dogcom 设置" + +msgid "Dogcom is running." +msgstr "Dogcom 运行中。" + +msgid "Dogcom is not running." +msgstr "Dogcom 未运行。" + +msgid "Basic Settings" +msgstr "基本设置" + +msgid "Enable" +msgstr "启用" + +msgid "Version" +msgstr "版本" + +msgid "dhcp" +msgstr "dhcp(D版)" + +msgid "pppoe" +msgstr "pppoe(P版)" + +msgid "Patch the escape problem" +msgstr "P版转义字符补丁" + +msgid "configfile" +msgstr "配置文件" + +msgid "This file is /etc/dogcom.conf." +msgstr "这个文件是/etc/dogcom.conf。" + +msgid "Generate Configuration" +msgstr "生成配置" + +msgid "Please upload your packet file. Then change password and copy to basic settings." +msgstr "请上传你的数据包,然后修改密码并复制到基本设置配置文件中。" \ No newline at end of file diff --git a/package/lean/luci-app-dogcom/files/luci/model/cbi/dogcom.lua b/package/lean/luci-app-dogcom/files/luci/model/cbi/dogcom.lua new file mode 100644 index 000000000..002fa2cd2 --- /dev/null +++ b/package/lean/luci-app-dogcom/files/luci/model/cbi/dogcom.lua @@ -0,0 +1,72 @@ +-- Copyright (C) 2017 fuyumi <280604399@qq.com> +-- Licensed to the public under the GNU Affero General Public License v3. + +local m, s + +local running = (luci.sys.call("pidof dogcom > /dev/null") == 0) +if running then + m = Map("dogcom", translate("Dogcom config"), translate("Dogcom is running.")) +else + m = Map("dogcom", translate("Dogcom config"), translate("Dogcom is not running.")) +end + +s = m:section(TypedSection, "dogcom", "") +s.addremove = false +s.anonymous = true + +-- Basic Settings -- +s:tab("basic", translate("Basic Settings")) + +enable = s:taboption("basic", Flag, "enabled", translate("Enable")) +enable.rmempty = false +function enable.cfgvalue(self, section) + return luci.sys.init.enabled("dogcom") and self.enabled or self.disabled +end + +version = s:taboption("basic", ListValue, "version", translate("Version")) +version:value("dhcp", translate("dhcp")) +version:value("pppoe", translate("pppoe")) +version.value = "dhcp" + +escpatch = s:taboption("basic", Button, "esc", translate("Patch the escape problem")) +function escpatch.write() + luci.sys.call("sed -i '/proto_run_command/i username=`echo -e \"$username\"`' /lib/netifd/proto/ppp.sh") + luci.sys.call("sed -i '/proto_run_command/i password=`echo -e \"$password\"`' /lib/netifd/proto/ppp.sh") +end + +config = s:taboption("basic", Value, "config", translate("configfile"), translate("This file is /etc/dogcom.conf."), "") +config.template = "cbi/tvalue" +config.rows = 15 +config.wrap = "off" + +function config.cfgvalue(self, section) + return nixio.fs.readfile("/etc/dogcom.conf") +end + +function config.write(self, section, value) + value = value:gsub("\r\n?", "\n") + nixio.fs.writefile("/etc/dogcom.conf", value) +end + +-- Generate Configuration -- +s:tab("generator", translate("Generate Configuration")) + +msg = s:taboption("generator", DummyValue, "", translate(""), +translate("Please upload your packet file. Then change password and copy to basic settings.")) + +autoconfig = s:taboption("generator", DummyValue, "autoconfig") +autoconfig.template = "dogcom/auto_configure" + +-- Save Configuration -- +function enable.write(self, section, value) + if value == "1" then + luci.sys.call("/etc/init.d/dogcom enable >/dev/null") + luci.sys.call("/etc/init.d/dogcom start >/dev/null") + else + luci.sys.call("/etc/init.d/dogcom stop >/dev/null") + luci.sys.call("/etc/init.d/dogcom disable >/dev/null") + end + Flag.write(self, section, value) +end + +return m \ No newline at end of file diff --git a/package/lean/luci-app-dogcom/files/luci/view/dogcom/auto_configure.htm b/package/lean/luci-app-dogcom/files/luci/view/dogcom/auto_configure.htm new file mode 100644 index 000000000..f02995f37 --- /dev/null +++ b/package/lean/luci-app-dogcom/files/luci/view/dogcom/auto_configure.htm @@ -0,0 +1,167 @@ +<%# +Copyright (C) 2017 fuyumi <280604399@qq.com> +Licensed to the public under the GNU Affero General Public License v3. +%> + +<%+cbi/valueheader%> + + +
+ + + +
+ + + +<%+cbi/valuefooter%> diff --git a/package/lean/luci-app-dogcom/files/root/etc/config/dogcom b/package/lean/luci-app-dogcom/files/root/etc/config/dogcom new file mode 100644 index 000000000..6630300cc --- /dev/null +++ b/package/lean/luci-app-dogcom/files/root/etc/config/dogcom @@ -0,0 +1,3 @@ +config dogcom 'config' + option enabled '0' + option version 'dhcp' \ No newline at end of file diff --git a/package/lean/luci-app-dogcom/files/root/etc/init.d/dogcom b/package/lean/luci-app-dogcom/files/root/etc/init.d/dogcom new file mode 100644 index 000000000..8a32d48eb --- /dev/null +++ b/package/lean/luci-app-dogcom/files/root/etc/init.d/dogcom @@ -0,0 +1,34 @@ +#!/bin/sh /etc/rc.common +# Copyright (c) 2011-2017 OpenWrt.org + +START=90 + +start(){ + config_load dogcom + config_get version config version + if [ "$version" == "dhcp" ]; then + /usr/bin/dogcom -m dhcp -c /etc/dogcom.conf -d -e + echo "Dogcom version dhcp has been started." + else + /usr/bin/dogcom -m pppoe -c /etc/dogcom.conf -d -e + echo "Dogcom version pppoe has been started." + fi +} + +stop(){ + if [ ! -f "/tmp/dogcom.pid" ]; then + echo "Dogcom is not running." + else + pid=`cat /tmp/dogcom.pid` + kill $pid + rm -f /tmp/dogcom.pid + echo "Dogcom has been stopped." + fi +} + +restart(){ + stop + sleep 1 + start + echo "Dogcom has been restarted." +} diff --git a/package/lean/luci-app-dogcom/files/root/etc/uci-defaults/40_luci-dogcom b/package/lean/luci-app-dogcom/files/root/etc/uci-defaults/40_luci-dogcom new file mode 100644 index 000000000..ca9b75b1d --- /dev/null +++ b/package/lean/luci-app-dogcom/files/root/etc/uci-defaults/40_luci-dogcom @@ -0,0 +1,11 @@ +#!/bin/sh + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@dogcom[-1] + add ucitrack dogcom + set ucitrack.@dogcom[-1].init=dogcom + commit ucitrack +EOF + +rm -f /tmp/luci-indexcache +exit 0 \ No newline at end of file From 0c8f0c8cb3535974132c9cac18c5f5792c8db841 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 27 Oct 2017 12:45:45 +0800 Subject: [PATCH 13/22] disable KERNEL_KALLSYMS to reduce kernel size to fit DW33D --- config/Config-kernel.in | 2 +- target/linux/ar71xx/config-4.9 | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config/Config-kernel.in b/config/Config-kernel.in index 3468899ad..d7cb2d9fc 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -62,7 +62,7 @@ config KERNEL_PROFILING config KERNEL_KALLSYMS bool "Compile the kernel with symbol table information" - default y if !SMALL_FLASH + default n help This will give you more information in stack traces from kernel oopses. diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9 index 190d07df2..6359b3ca2 100644 --- a/target/linux/ar71xx/config-4.9 +++ b/target/linux/ar71xx/config-4.9 @@ -221,8 +221,8 @@ CONFIG_ATH79_MACH_UBNT=y CONFIG_ATH79_MACH_UBNT_UNIFIAC=y CONFIG_ATH79_MACH_UBNT_XM=y CONFIG_ATH79_MACH_WEIO=y -# CONFIG_ATH79_MACH_WI2A_AC200I is not set CONFIG_ATH79_MACH_WHR_HP_G300N=y +# CONFIG_ATH79_MACH_WI2A_AC200I is not set CONFIG_ATH79_MACH_WLAE_AG300N=y CONFIG_ATH79_MACH_WLR8100=y CONFIG_ATH79_MACH_WNDAP360=y @@ -362,6 +362,7 @@ CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_FORCED_THREADING=y CONFIG_IRQ_MIPS_CPU=y CONFIG_IRQ_WORK=y +# CONFIG_KERNEL_KALLSYMS is not set CONFIG_LEDS_GPIO=y # CONFIG_LEDS_WNDR3700_USB is not set CONFIG_LIBFDT=y @@ -379,6 +380,7 @@ CONFIG_MIPS_CLOCK_VSYSCALL=y CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y # CONFIG_MIPS_CMDLINE_FROM_DTB is not set # CONFIG_MIPS_ELF_APPENDED_DTB is not set +CONFIG_MIPS_FPU_EMULATOR=y # CONFIG_MIPS_HUGE_TLB_SUPPORT is not set CONFIG_MIPS_L1_CACHE_SHIFT=5 CONFIG_MIPS_MACHINE=y @@ -484,4 +486,3 @@ CONFIG_SYS_SUPPORTS_ZBOOT_UART_PROM=y CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_USB_SUPPORT=y CONFIG_USE_OF=y -CONFIG_MIPS_FPU_EMULATOR=y From 769f5163dba244989aa1e26d23bd94472b1acc82 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sun, 29 Oct 2017 10:44:17 +0800 Subject: [PATCH 14/22] add MMC/SDIO/SDHC support for x86/x64 EFI boot --- target/linux/x86/config-4.9 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/target/linux/x86/config-4.9 b/target/linux/x86/config-4.9 index 5fe8a6400..7cca9ade7 100644 --- a/target/linux/x86/config-4.9 +++ b/target/linux/x86/config-4.9 @@ -302,7 +302,8 @@ CONFIG_INTEL_MEI_WDT=y # CONFIG_INTEL_SOC_DTS_THERMAL is not set CONFIG_IOMMU_HELPER=y # CONFIG_IOMMU_STRESS is not set -# CONFIG_IOSF_MBI is not set +CONFIG_IOSF_MBI=y +# CONFIG_IOSF_MBI_DEBUG is not set CONFIG_IO_DELAY_0X80=y # CONFIG_IO_DELAY_0XED is not set # CONFIG_IO_DELAY_NONE is not set @@ -349,6 +350,15 @@ CONFIG_M586MMX=y # CONFIG_MK6 is not set # CONFIG_MK7 is not set # CONFIG_MK8 is not set +CONFIG_MMC=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_RICOH_MMC=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_ACPI=y +CONFIG_MMC_SDHCI_PCI=y +CONFIG_MMC_SDHCI_PLTFM=y +# CONFIG_MMC_TIFM_SD is not set +# CONFIG_MMC_WBSD is not set # CONFIG_MODIFY_LDT_SYSCALL is not set CONFIG_MODULES_TREE_LOOKUP=y CONFIG_MODULES_USE_ELF_REL=y @@ -461,6 +471,7 @@ CONFIG_SCx200=y CONFIG_SCx200HR_TIMER=y # CONFIG_SCx200_GPIO is not set # CONFIG_SCx200_WDT is not set +CONFIG_SDIO_UART=y CONFIG_SENSORS_CORETEMP=y CONFIG_SENSORS_FAM15H_POWER=y CONFIG_SENSORS_K10TEMP=y From 2f1ab8245312c0bb81ee761210a7dc8c9d0730e1 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sun, 29 Oct 2017 11:00:48 +0800 Subject: [PATCH 15/22] add usb net for x86 by default --- target/linux/x86/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/linux/x86/Makefile b/target/linux/x86/Makefile index 1af29cfdb..058edd1a3 100644 --- a/target/linux/x86/Makefile +++ b/target/linux/x86/Makefile @@ -19,10 +19,11 @@ KERNELNAME:=bzImage include $(INCLUDE_DIR)/target.mk -DEFAULT_PACKAGES += partx-utils mkf2fs fdisk e2fsprogs wpad kmod-usb-hid kmod-usb-net-asix kmod-usb-net-asix-ax88179 \ +DEFAULT_PACKAGES += partx-utils mkf2fs fdisk e2fsprogs wpad kmod-usb-hid \ kmod-ath5k kmod-ath9k kmod-ath10k kmod-rt2800-usb kmod-e1000e kmod-igb kmod-igbvf kmod-ixgbe kmod-vmxnet3 htop lm-sensors \ autocore automount autosamba ath10k-firmware-qca988x brcmfmac-firmware-43602a1-pcie \ -alsa-utils kmod-ac97 kmod-sound-hda-core kmod-sound-hda-codec-realtek kmod-sound-hda-intel kmod-sound-hda-codec-via kmod-sound-via82xx kmod-usb-audio +alsa-utils kmod-ac97 kmod-sound-hda-core kmod-sound-hda-codec-realtek kmod-sound-hda-intel kmod-sound-hda-codec-via kmod-sound-via82xx kmod-usb-audio \ +kmod-usb-net kmod-usb-net-asix kmod-usb-net-asix-ax88179 kmod-usb-net-rtl8150 kmod-usb-net-rtl8152 $(eval $(call BuildTarget)) From e028790b060d2c12d0c092db24b379916607be4a Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sun, 29 Oct 2017 11:11:58 +0800 Subject: [PATCH 16/22] add power idle driver for Intel Atom Z SOC --- target/linux/x86/config-4.9 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/target/linux/x86/config-4.9 b/target/linux/x86/config-4.9 index 7cca9ade7..1c10e57f6 100644 --- a/target/linux/x86/config-4.9 +++ b/target/linux/x86/config-4.9 @@ -298,8 +298,9 @@ CONFIG_INTEL_MEI_WDT=y # CONFIG_INTEL_MENLOW is not set # CONFIG_INTEL_PCH_THERMAL is not set # CONFIG_INTEL_PMC_IPC is not set -# CONFIG_INTEL_POWERCLAMP is not set -# CONFIG_INTEL_SOC_DTS_THERMAL is not set +CONFIG_INTEL_POWERCLAMP=y +CONFIG_INTEL_SOC_DTS_IOSF_CORE=y +CONFIG_INTEL_SOC_DTS_THERMAL=y CONFIG_IOMMU_HELPER=y # CONFIG_IOMMU_STRESS is not set CONFIG_IOSF_MBI=y @@ -528,7 +529,9 @@ CONFIG_SYSCTL_EXCEPTION_TRACE=y # CONFIG_TELCLOCK is not set CONFIG_THERMAL=y CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y +CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y CONFIG_THERMAL_GOV_STEP_WISE=y +CONFIG_THERMAL_WRITABLE_TRIPS=y CONFIG_THREAD_INFO_IN_TASK=y CONFIG_TICK_CPU_ACCOUNTING=y # CONFIG_TOSHIBA is not set From 3645684b8c8cb44a1f4c086c80addf755cb4fcba Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Mon, 30 Oct 2017 00:45:26 +0800 Subject: [PATCH 17/22] update oscam support for API/CardReaders,change source to git --- package/lean/oscam/Config.in | 240 ++++++++++++++++++++++++++++ package/lean/oscam/Makefile | 217 ++++++++++++++++++++----- package/lean/oscam/files/oscam.init | 12 ++ 3 files changed, 427 insertions(+), 42 deletions(-) create mode 100644 package/lean/oscam/Config.in create mode 100644 package/lean/oscam/files/oscam.init diff --git a/package/lean/oscam/Config.in b/package/lean/oscam/Config.in new file mode 100644 index 000000000..2a23f71c6 --- /dev/null +++ b/package/lean/oscam/Config.in @@ -0,0 +1,240 @@ +menu "OSCam build options" + depends on PACKAGE_oscam + + +config OSCAM_USE_LIBCRYPTO + bool "Build with OpenSSL libcrypto" + help + "Use OpenSSL libcrypto instead of OSCam internal crypto functions" + default n + +config OSCAM_USE_LIBUSB + bool "Build with libusb" + default n + + + menu "Protocols" + depends on PACKAGE_oscam + + config OSCAM_MODULE_CAMD33 + bool "camd 3.3" + default n + + config OSCAM_MODULE_CAMD35 + bool "camd 3.5 UDP" + default n + + config OSCAM_MODULE_CAMD35_TCP + bool "camd 3.5 TCP" + default n + + config OSCAM_MODULE_NEWCAMD + bool "newcamd" + default n + + config OSCAM_MODULE_CCCAM + bool "CCcam" + default n + + config OSCAM_MODULE_CCCSHARE + bool "CCcam share" + default n + + config OSCAM_MODULE_GBOX + bool "gbox" + default n + + config OSCAM_MODULE_RADEGAST + bool "radegast" + default n + + config OSCAM_MODULE_SERIAL + bool "Serial" + default n + + config OSCAM_MODULE_CONSTCW + bool "constant CW" + default n + + config OSCAM_MODULE_PANDORA + bool "Pandora" + default n + + config OSCAM_MODULE_GHTTP + bool "Ghttp" + default n + + config OSCAM_MODULE_SCAM + bool "scam" + default n + + endmenu + + menu "Readers" + depends on PACKAGE_oscam + + config OSCAM_READER_NAGRA + bool "Nagravision" + default n + + config OSCAM_READER_IRDETO + bool "Irdeto" + default n + + config OSCAM_READER_CONAX + bool "Conax" + default n + + config OSCAM_READER_CRYPTOWORKS + bool "Cryptoworks" + default n + + config OSCAM_READER_SECA + bool "Seca" + default n + + config OSCAM_READER_VIACCESS + bool "Viaccess" + default n + + config OSCAM_READER_VIDEOGUARD + bool "NDS Videoguard" + default n + + config OSCAM_READER_DRE + bool "DRE Crypt" + default n + + config OSCAM_READER_TONGFANG + bool "Tongfang" + default n + + config OSCAM_READER_BULCRYPT + bool "Bulcrypt" + default n + + config OSCAM_READER_GRIFFIN + bool "Griffin" + default n + + config OSCAM_READER_DGCRYPT + bool "DGCrypt" + default n + + endmenu + + menu "Card readers" + depends on PACKAGE_oscam + + config OSCAM_USE_PCSC + bool "PCSC" + select OSCAM_USE_LIBUSB + default n + + config OSCAM_CARDREADER_PHOENIX + bool "Phoenix/mouse" + select OSCAM_USE_LIBUSB + default n + + config OSCAM_CARDREADER_SC8IN1 + bool "SC8in1" + select OSCAM_USE_LIBUSB + default n + + config OSCAM_CARDREADER_MP35 + bool "AD-Teknik MP 3.6/USB Phoenix" + select OSCAM_USE_LIBUSB + default n + + config OSCAM_CARDREADER_SMARGO + bool "Argolis Smargo Smartreader" + select OSCAM_USE_LIBUSB + default n + + config OSCAM_CARDREADER_STINGER + bool "STINGER" + select OSCAM_USE_LIBUSB + default n + + endmenu + +comment "Addons" +config OSCAM_HAVE_DVBAPI + bool "DVB API" + default y + +config OSCAM_READ_SDT_CHARSETS + bool "DVB API read-sdt charsets" + default y + +config OSCAM_IRDETO_GUESSING + bool "Irdeto guessing" + default n + +config OSCAM_CS_ANTICASC + bool "Anti cascading" + default y + +config OSCAM_WITH_DEBUG + bool "Debug messages" + default n + +config OSCAM_MODULE_MONITOR + bool "Monitor" + default n + +config OSCAM_WITH_LB + bool "Loadbalancing" + default y + +config OSCAM_S_CACHEEX + bool "Cache exchange" + default y + +config OSCAM_CW_CYCLE_CHECK + bool "CW Cycle Check" + default y + +config OSCAM_LCDSUPPORT + bool "LCD support" + default n + +config OSCAM_LEDSUPPORT + bool "LED support" + default n + +config OSCAM_CLOCKFIX + bool "Clockfix (disable on old systems!)" + default y + +config OSCAM_IPV6SUPPORT + bool "IPv6 support (experimental)" + default n + + +config OSCAM_WEBIF + bool "Web Interface" + default n + + config OSCAM_WEBIF_LIVELOG + bool "LiveLog" + depends on OSCAM_WEBIF + default n + + config OSCAM_WEBIF_JQUERY + bool "Jquery onboard (if disabled webload)" + depends on OSCAM_WEBIF + default n + + config OSCAM_TOUCH + bool "Touch Web Interface" + depends on OSCAM_WEBIF + default n + + config OSCAM_WITH_SSL + bool "SSL support" + depends on OSCAM_WEBIF + select OSCAM_USE_LIBCRYPTO + default n + +endmenu diff --git a/package/lean/oscam/Makefile b/package/lean/oscam/Makefile index 6a1d1c44c..15b795244 100644 --- a/package/lean/oscam/Makefile +++ b/package/lean/oscam/Makefile @@ -1,71 +1,204 @@ -# -# Copyright (C) 2010 OpenWrt.org +# +# Copyright (C) 2016 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # -# maz-1 +# $Id$ include $(TOPDIR)/rules.mk -PKG_BRANCH:=trunk -PKG_SOURCE_URL:=http://www.streamboard.tv/svn/oscam/trunk -#PKG_REV:=$(shell LC_ALL=C svn info ${PKG_SOURCE_URL} | sed -ne's/^Last Changed Rev: //p') -PKG_REV:=10777 - PKG_NAME:=oscam -PKG_VERSION:=svn$(PKG_REV) +PKG_VERSION:=1.20-$(PKG_REV) PKG_RELEASE:=1 +PKG_REV:=2780c48789c8e1427df4078ea9b06e0b51594bbc -PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz -PKG_SOURCE_PROTO:=svn + +PKG_SOURCE_PROTO:=git PKG_SOURCE_VERSION:=$(PKG_REV) - -PKG_BUILD_DEPENDS:= - +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_URL:=https://github.com/coolsnowwolf/oscam.git +PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.bz2 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) -PKG_INSTALL_DIR:=$(PKG_BUILD_DIR) +PKG_LICENSE:=GPLv3 +PKG_LICENSE_FILES:=COPYING +PKG_MAINTAINER:=tmn505 +PKG_CONFIG_DEPENDS := \ + OSCAM_USE_LIBCRYPTO \ + OSCAM_USE_LIBUSB \ + OSCAM_USE_PCSC \ + OSCAM_WEBIF \ + OSCAM_WEBIF_LIVELOG \ + OSCAM_WEBIF_JQUERY \ + OSCAM_TOUCH \ + OSCAM_WITH_SSL \ + OSCAM_HAVE_DVBAPI \ + OSCAM_READ_SDT_CHARSETS \ + OSCAM_IRDETO_GUESSING \ + OSCAM_CS_ANTICASC \ + OSCAM_WITH_DEBUG \ + OSCAM_MODULE_MONITOR \ + OSCAM_WITH_LB \ + OSCAM_CS_CACHEEX \ + OSCAM_CW_CYCLE_CHECK \ + OSCAM_LCDSUPPORT \ + OSCAM_LEDSUPPORT \ + OSCAM_CLOCKFIX \ + OSCAM_IPV6SUPPORT \ + OSCAM_MODULE_CAMD33 \ + OSCAM_MODULE_CAMD35 \ + OSCAM_MODULE_CAMD35_TCP \ + OSCAM_MODULE_NEWCAMD \ + OSCAM_MODULE_CCCAM \ + OSCAM_MODULE_CCCSHARE \ + OSCAM_MODULE_GBOX \ + OSCAM_MODULE_RADEGAST \ + OSCAM_MODULE_SCAM \ + OSCAM_MODULE_SERIAL \ + OSCAM_MODULE_CONSTCW \ + OSCAM_MODULE_PANDORA \ + OSCAM_MODULE_GHTTP \ + OSCAM_READER_NAGRA \ + OSCAM_READER_IRDETO \ + OSCAM_READER_CONAX \ + OSCAM_READER_CRYPTOWORKS \ + OSCAM_READER_SECA \ + OSCAM_READER_VIACCESS \ + OSCAM_READER_VIDEOGUARD \ + OSCAM_READER_DRE \ + OSCAM_READER_TONGFANG \ + OSCAM_READER_BULCRYPT \ + OSCAM_READER_GRIFFIN \ + OSCAM_READER_DGCRYPT \ + OSCAM_CARDREADER_PHOENIX \ + OSCAM_CARDREADER_SC8IN1 \ + OSCAM_CARDREADER_MP35 \ + OSCAM_CARDREADER_SMARGO \ + OSCAM_CARDREADER_STINGER include $(INCLUDE_DIR)/package.mk -define Package/oscam - DEPENDS:=+libopenssl +libpthread +libusb-1.0 - TITLE:=Open Source Conditional Access Module software - URL:=http://streamboard.gmc.to/oscam/ - SUBMENU:= +define Package/oscam/config + source "$(SOURCE)/Config.in" endef -define Package/oscam/description - An Open Source Conditional Access Module software, -based on the very good MpCS version 0.9d created by dukat. -endef - -CONFIGURE_ARGS += --with-ssl=openssl - -define Build/Prepare - $(call Build/Prepare/Default) - mkdir -p $(PKG_BUILD_DIR)/build - cd $(PKG_BUILD_DIR)/build; -endef +config_files=oscam.ac oscam.cacheex oscam.cert oscam.conf oscam.dvbapi oscam.guess oscam.ird oscam.provid oscam.server oscam.services oscam.srvid oscam.tiers oscam.user oscam.whitelist define Package/oscam/conffiles +/etc/oscam/ endef -define Build/Compile - echo 'set (OSCAM_SYSTEM_NAME wrt350nv2)' > $(PKG_BUILD_DIR)/toolchain.cmake - echo 'set (CMAKE_SYSTEM_NAME Linux)' >> $(PKG_BUILD_DIR)/toolchain.cmake - echo 'set (CMAKE_C_COMPILER $(TARGET_CROSS)gcc)' >> $(PKG_BUILD_DIR)/toolchain.cmake - echo 'set (CMAKE_SYSTEM_PROCESSOR $(ARCH))' >> $(PKG_BUILD_DIR)/toolchain.cmake - cd $(PKG_BUILD_DIR)/build;cmake -DCMAKE_TOOLCHAIN_FILE=$(PKG_BUILD_DIR)/toolchain.cmake ..;make +define Package/oscam + SECTION:=net + CATEGORY:=Network + TITLE:=Open Source Conditional Access Modul + URL:=http://www.streamboard.tv/oscam + DEPENDS:=+OSCAM_USE_LIBCRYPTO:libopenssl +OSCAM_USE_LIBUSB:libusb-1.0 +OSCAM_USE_PCSC:pcscd endef +define Package/list-smargo + $(call Package/oscam) + TITLE:=List smargo readers + DEPENDS:=oscam +endef + +CONFIGURE_CMD = ./config.sh +CONFIGURE_ARGS = \ + --restore \ + $(if $(CONFIG_OSCAM_WEBIF),--enable,--disable) WEBIF \ + $(if $(CONFIG_OSCAM_WEBIF_LIVELOG),--enable,--disable) WEBIF_LIVELOG \ + $(if $(CONFIG_OSCAM_WEBIF_JQUERY),--enable,--disable) WEBIF_JQUERY \ + $(if $(CONFIG_OSCAM_TOUCH),--enable,--disable) TOUCH \ + $(if $(CONFIG_OSCAM_WITH_SSL),--enable,--disable) WITH_SSL \ + $(if $(CONFIG_OSCAM_HAVE_DVBAPI),--enable,--disable) HAVE_DVBAPI \ + $(if $(CONFIG_OSCAM_READ_SDT_CHARSETS),--enable,--disable) READ_SDT_CHARSETS \ + $(if $(CONFIG_OSCAM_IRDETO_GUESSING),--enable,--disable) IRDETO_GUESSING \ + $(if $(CONFIG_OSCAM_CS_ANTICASC),--enable,--disable) CS_ANTICASC \ + $(if $(CONFIG_OSCAM_WITH_DEBUG),--enable,--disable) WITH_DEBUG \ + $(if $(CONFIG_OSCAM_MODULE_MONITOR),--enable,--disable) MODULE_MONITOR \ + $(if $(CONFIG_OSCAM_WITH_LB),--enable,--disable) WITH_LB \ + $(if $(CONFIG_OSCAM_CS_CACHEEX),--enable,--disable) CS_CACHEEX \ + $(if $(CONFIG_OSCAM_CW_CYCLE_CHECK),--enable,--disable) CW_CYCLE_CHECK \ + $(if $(CONFIG_OSCAM_LCDSUPPORT),--enable,--disable) LCDSUPPORT \ + $(if $(CONFIG_OSCAM_LEDSUPPORT),--enable,--disable) LEDSUPPORT \ + $(if $(CONFIG_OSCAM_CLOCKFIX),--enable,--disable) CLOCKFIX \ + $(if $(CONFIG_OSCAM_IPV6SUPPORT),--enable,--disable) IPV6SUPPORT \ + $(if $(CONFIG_OSCAM_MODULE_CAMD33),--enable,--disable) MODULE_CAMD33 \ + $(if $(CONFIG_OSCAM_MODULE_CAMD35),--enable,--disable) MODULE_CAMD35 \ + $(if $(CONFIG_OSCAM_MODULE_CAMD35_TCP),--enable,--disable) MODULE_CAMD35_TCP \ + $(if $(CONFIG_OSCAM_MODULE_NEWCAMD),--enable,--disable) MODULE_NEWCAMD \ + $(if $(CONFIG_OSCAM_MODULE_CCCAM),--enable,--disable) MODULE_CCCAM \ + $(if $(CONFIG_OSCAM_MODULE_CCCSHARE),--enable,--disable) MODULE_CCCSHARE \ + $(if $(CONFIG_OSCAM_MODULE_GBOX),--enable,--disable) MODULE_GBOX \ + $(if $(CONFIG_OSCAM_MODULE_RADEGAST),--enable,--disable) MODULE_RADEGAST \ + $(if $(CONFIG_OSCAM_MODULE_SCAM),--enable,--disable) MODULE_SCAM \ + $(if $(CONFIG_OSCAM_MODULE_SERIAL),--enable,--disable) MODULE_SERIAL \ + $(if $(CONFIG_OSCAM_MODULE_CONSTCW),--enable,--disable) MODULE_CONSTCW \ + $(if $(CONFIG_OSCAM_MODULE_PANDORA),--enable,--disable) MODULE_PANDORA \ + $(if $(CONFIG_OSCAM_MODULE_GHTTP),--enable,--disable) MODULE_GHTTP \ + $(if $(CONFIG_OSCAM_READER_NAGRA),--enable,--disable) READER_NAGRA \ + $(if $(CONFIG_OSCAM_READER_IRDETO),--enable,--disable) READER_IRDETO \ + $(if $(CONFIG_OSCAM_READER_CONAX),--enable,--disable) READER_CONAX \ + $(if $(CONFIG_OSCAM_READER_CRYPTOWORKS),--enable,--disable) READER_CRYPTOWORKS \ + $(if $(CONFIG_OSCAM_READER_SECA),--enable,--disable) READER_SECA \ + $(if $(CONFIG_OSCAM_READER_VIACCESS),--enable,--disable) READER_VIACCESS \ + $(if $(CONFIG_OSCAM_READER_VIDEOGUARD),--enable,--disable) READER_VIDEOGUARD \ + $(if $(CONFIG_OSCAM_READER_DRE),--enable,--disable) READER_DRE \ + $(if $(CONFIG_OSCAM_READER_TONGFANG),--enable,--disable) READER_TONGFANG \ + $(if $(CONFIG_OSCAM_READER_BULCRYPT),--enable,--disable) READER_BULCRYPT \ + $(if $(CONFIG_OSCAM_READER_GRIFFIN),--enable,--disable) READER_GRIFFIN \ + $(if $(CONFIG_OSCAM_READER_DGCRYPT),--enable,--disable) READER_DGCRYPT \ + $(if $(CONFIG_OSCAM_CARDREADER_PHOENIX),--enable,--disable) CARDREADER_PHOENIX \ + $(if $(CONFIG_OSCAM_CARDREADER_SC8IN1),--enable,--disable) CARDREADER_SC8IN1 \ + $(if $(CONFIG_OSCAM_CARDREADER_MP35),--enable,--disable) CARDREADER_MP35 \ + $(if $(CONFIG_OSCAM_CARDREADER_SMARGO),--enable,--disable) CARDREADER_SMARGO \ + $(if $(CONFIG_OSCAM_CARDREADER_STINGER),--enable,--disable) CARDREADER_STINGER \ + --disable CARDREADER_INTERNAL_AZBOX \ + --disable CARDREADER_INTERNAL_COOLAPI \ + --disable CARDREADER_INTERNAL_COOLAPI2 \ + --disable CARDREADER_INTERNAL_SCI \ + --disable CARDREADER_DB2COM \ + --disable CARDREADER_STAPI \ + --disable CARDREADER_STAPI5 + +MAKE_FLAGS += + +ifeq ($(CONFIG_OSCAM_USE_LIBUSB),y) + MAKE_FLAGS += USE_LIBUSB=1 +endif + +ifeq ($(CONFIG_OSCAM_USE_PCSC),y) + MAKE_FLAGS += USE_PCSC=1 +endif + +ifeq ($(CONFIG_OSCAM_USE_LIBCRYPTO),y) + MAKE_FLAGS += USE_LIBCRYPTO=1 +endif + +ifeq ($(CONFIG_OSCAM_WITH_SSL),y) + MAKE_FLAGS += USE_SSL=1 +endif + +MAKE_FLAGS += CONF_DIR=/etc/oscam +MAKE_FLAGS += OSCAM_BIN=Distribution/oscam +MAKE_FLAGS += LIST_SMARGO_BIN=Distribution/list-smargo + define Package/oscam/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/oscam $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/Distribution/oscam $(1)/usr/sbin/oscam + $(INSTALL_DIR) $(1)/etc/oscam + $(INSTALL_DATA) $(addprefix $(PKG_BUILD_DIR)/Distribution/doc/example/,$(config_files)) $(1)/etc/oscam/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/oscam.init $(1)/etc/init.d/oscam endef -$(eval $(call BuildPackage,oscam)) +define Package/list-smargo/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/Distribution/list-smargo $(1)/usr/bin/list-smargo +endef + +$(eval $(call BuildPackage,oscam)) +$(eval $(call BuildPackage,list-smargo)) diff --git a/package/lean/oscam/files/oscam.init b/package/lean/oscam/files/oscam.init new file mode 100644 index 000000000..b0bf41dc5 --- /dev/null +++ b/package/lean/oscam/files/oscam.init @@ -0,0 +1,12 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2016 OpenWrt.org + +START=50 +USE_PROCD=1 + +start_service() { + procd_open_instance + procd_set_param command /usr/sbin/oscam + procd_set_param respawn + procd_close_instance +} From 1c205c086690f036ea6eb19ef40868567be367a6 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Mon, 30 Oct 2017 00:47:16 +0800 Subject: [PATCH 18/22] revert busybox ip command support for MWAN3 --- package/utils/busybox/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index 35f63d9a7..941e82835 100644 --- a/package/utils/busybox/Makefile +++ b/package/utils/busybox/Makefile @@ -47,7 +47,6 @@ define Package/busybox URL:=http://busybox.net/ DEPENDS:=+BUSYBOX_USE_LIBRPC:librpc +BUSYBOX_CONFIG_PAM:libpam +BUSYBOX_CONFIG_NTPD:jsonfilter MENU:=1 - PROVIDES:=ip ALTERNATIVES:=\ $(call BUSYBOX_IF_ENABLED,KILL, 100:/bin/kill:/bin/busybox) \ $(call BUSYBOX_IF_ENABLED,PS, 100:/bin/ps:/bin/busybox) \ From 1b64bd2477ab98b2b53469d7788a801404d962f5 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Mon, 30 Oct 2017 01:31:21 +0800 Subject: [PATCH 19/22] fix luci-app-haproxy-tcp running issue --- .../lean/luci-app-haproxy-tcp/files/etc/haproxy_init.sh | 4 ++-- .../files/etc/uci-defaults/z99-haproxy | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100755 package/lean/luci-app-haproxy-tcp/files/etc/uci-defaults/z99-haproxy diff --git a/package/lean/luci-app-haproxy-tcp/files/etc/haproxy_init.sh b/package/lean/luci-app-haproxy-tcp/files/etc/haproxy_init.sh index d40e52da5..cab4d1f82 100755 --- a/package/lean/luci-app-haproxy-tcp/files/etc/haproxy_init.sh +++ b/package/lean/luci-app-haproxy-tcp/files/etc/haproxy_init.sh @@ -16,7 +16,7 @@ stop(){ } start(){ echo "starting haproxy" - logger -t alex restarting haproxy + logger -t restarting haproxy echo global > $CFG_FILE cat >> $CFG_FILE </dev/null` - logger -t alex !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!haproxy is initializing enabled is $vt_enabled + logger -t haproxy is initializing enabled is $vt_enabled echo $vt_enabled if [ "$vt_enabled" = 1 ]; then [ -f /etc/haproxy_backup ] && { diff --git a/package/lean/luci-app-haproxy-tcp/files/etc/uci-defaults/z99-haproxy b/package/lean/luci-app-haproxy-tcp/files/etc/uci-defaults/z99-haproxy new file mode 100755 index 000000000..72913f935 --- /dev/null +++ b/package/lean/luci-app-haproxy-tcp/files/etc/uci-defaults/z99-haproxy @@ -0,0 +1,7 @@ +#!/bin/sh + +/etc/init.d/haproxy disable +/etc/init.d/haproxy stop + +rm -f /tmp/luci-indexcache +exit 0 From 506faec99a6a3d77e1d1a34d4f0ffb2d68d0cc02 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 31 Oct 2017 15:23:13 +0800 Subject: [PATCH 20/22] openssl: Enable assembler optimizations for x64/arm8 --- package/libs/openssl/Makefile | 4 +++- package/libs/openssl/patches/110-optimize-for-size.patch | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index 8303bc0fb..37dae96fe 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -11,7 +11,7 @@ PKG_NAME:=openssl PKG_BASE:=1.0.2 PKG_BUGFIX:=l PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX) -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_USE_MIPS16:=0 PKG_BUILD_PARALLEL:=0 @@ -168,6 +168,8 @@ else OPENSSL_OPTIONS+=no-sse2 ifeq ($(CONFIG_mips)$(CONFIG_mipsel),y) OPENSSL_TARGET:=linux-mips-openwrt + else ifeq ($(CONFIG_aarch64),y) + OPENSSL_TARGET:=linux-aarch64-openwrt else ifeq ($(CONFIG_arm)$(CONFIG_armeb),y) OPENSSL_TARGET:=linux-armv4-openwrt else diff --git a/package/libs/openssl/patches/110-optimize-for-size.patch b/package/libs/openssl/patches/110-optimize-for-size.patch index 0f174a346..d6d4a2111 100644 --- a/package/libs/openssl/patches/110-optimize-for-size.patch +++ b/package/libs/openssl/patches/110-optimize-for-size.patch @@ -1,11 +1,12 @@ --- a/Configure +++ b/Configure -@@ -470,6 +470,12 @@ my %table=( +@@ -470,6 +470,13 @@ my %table=( "linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}", "linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}", +# OpenWrt targets +"linux-armv4-openwrt","gcc:-DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"linux-aarch64-openwrt","gcc:-DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${aarch64_asm}:linux64:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"linux-x86_64-openwrt", "gcc:-m64 -DL_ENDIAN -DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", +"linux-mips-openwrt","gcc:-DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips32_asm}:o32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"linux-generic-openwrt","gcc:-DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", From 0e5bebdfd86ea3d9b05ca0858b5851c5d65b2517 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Thu, 2 Nov 2017 21:38:33 +0800 Subject: [PATCH 21/22] min fix update script error in adbyby plus --- package/lean/luci-app-adbyby-plus/Makefile | 2 +- package/lean/luci-app-adbyby-plus/root/etc/config/adbyby | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package/lean/luci-app-adbyby-plus/Makefile b/package/lean/luci-app-adbyby-plus/Makefile index 3a3b78b2f..e9047bab3 100644 --- a/package/lean/luci-app-adbyby-plus/Makefile +++ b/package/lean/luci-app-adbyby-plus/Makefile @@ -10,7 +10,7 @@ LUCI_DEPENDS:=+adbyby +wget +ipset +coreutils +coreutils-nohup +dnsmasq-full LUCI_PKGARCH:=all PKG_NAME:=luci-app-adbyby-plus PKG_VERSION:=2.0 -PKG_RELEASE:=23 +PKG_RELEASE:=24 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/package/lean/luci-app-adbyby-plus/root/etc/config/adbyby b/package/lean/luci-app-adbyby-plus/root/etc/config/adbyby index c928a7577..7a11e0d77 100644 --- a/package/lean/luci-app-adbyby-plus/root/etc/config/adbyby +++ b/package/lean/luci-app-adbyby-plus/root/etc/config/adbyby @@ -7,4 +7,5 @@ config adbyby option enable '1' option wan_mode '1' option mem_mode '1' + option update_source '0' From 80fa1493bf766f3914ebdb9caa43ea9d2e742e13 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Thu, 2 Nov 2017 22:07:40 +0800 Subject: [PATCH 22/22] fix web flash for RT-ACRH17 --- target/linux/ipq806x/image/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile index 09ce82b93..c79afb9d7 100644 --- a/target/linux/ipq806x/image/Makefile +++ b/target/linux/ipq806x/image/Makefile @@ -263,7 +263,7 @@ define Device/RT-ACRH17 DEVICE_TITLE := Asus RT-ACRH17 IMAGE_SIZE := 20439364 FILESYSTEMS := squashfs - UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-ACRH17') + UIMAGE_NAME:=$(shell echo -e '\03\01\01\01RT-AC82U') IMAGES = sysupgrade.tar flash-factory.trx IMAGE/flash-factory.trx := copy-file $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE) | uImage none IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata