Merge remote-tracking branch 'upstream/master'

Conflicts:
	package/kernel/mac80211/files/lib/wifi/mac80211.sh
This commit is contained in:
aooom 2017-11-02 22:53:42 +08:00
commit 595ebacd6d
87 changed files with 3653 additions and 616 deletions

View File

@ -62,7 +62,7 @@ config KERNEL_PROFILING
config KERNEL_KALLSYMS config KERNEL_KALLSYMS
bool "Compile the kernel with symbol table information" bool "Compile the kernel with symbol table information"
default y if !SMALL_FLASH default n
help help
This will give you more information in stack traces from kernel oopses. This will give you more information in stack traces from kernel oopses.

View File

@ -161,6 +161,7 @@ define Image/BuildDTB
$(TARGET_CROSS)cpp -nostdinc -x assembler-with-cpp \ $(TARGET_CROSS)cpp -nostdinc -x assembler-with-cpp \
-I$(DTS_DIR) \ -I$(DTS_DIR) \
-I$(DTS_DIR)/include \ -I$(DTS_DIR)/include \
-I$(LINUX_DIR)/include/ \
-undef -D__DTS__ $(3) \ -undef -D__DTS__ $(3) \
-o $(2).tmp $(1) -o $(2).tmp $(1)
$(LINUX_DIR)/scripts/dtc/dtc -O dtb \ $(LINUX_DIR)/scripts/dtc/dtc -O dtb \

View File

@ -4,11 +4,11 @@ LINUX_RELEASE?=1
LINUX_VERSION-3.18 = .71 LINUX_VERSION-3.18 = .71
LINUX_VERSION-4.4 = .93 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-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240
LINUX_KERNEL_HASH-4.4.93 = ed349314f16e78a6571b5f8884f6452782aef6c26b81bcc7ccdac44ecd917c36 LINUX_KERNEL_HASH-4.4.93 = ed349314f16e78a6571b5f8884f6452782aef6c26b81bcc7ccdac44ecd917c36
LINUX_KERNEL_HASH-4.9.57 = 09230554ec6a34a12e2d2a6b32733aed3c9bc90b1662cc1b06dd67bf726c96a6 LINUX_KERNEL_HASH-4.9.58 = 748f12a28689644b6a9102c67f8fa7938ca73823a949ba6f65024aecf2f221a7
ifdef KERNEL_PATCHVER ifdef KERNEL_PATCHVER
LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER))) LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER)))

View File

@ -24,7 +24,7 @@ PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_DRIVERS = \ PKG_DRIVERS = \
adm8211 \ adm8211 \
airo \ airo \
ath ath5k ath9k ath9k-common ath9k-htc ath10k \ ath ath5k ath6kl ath6kl-sdio ath6kl-usb ath9k ath9k-common ath9k-htc ath10k \
b43 b43legacy \ b43 b43legacy \
carl9170 \ carl9170 \
hermes hermes-pci hermes-pcmcia hermes-plx\ hermes hermes-pci hermes-pcmcia hermes-plx\
@ -217,6 +217,43 @@ define KernelPackage/ath5k/description
Atheros 5xxx chipset. Atheros 5xxx chipset.
endef 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 define KernelPackage/ath9k-common
$(call KernelPackage/mac80211/Default) $(call KernelPackage/mac80211/Default)
TITLE:=Atheros 802.11n wireless devices (common code for ath9k and ath9k_htc) 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 \ ATH9K_HTC_DEBUGFS \
ATH10K_DEBUGFS \ ATH10K_DEBUGFS \
CARL9170_DEBUGFS \ CARL9170_DEBUGFS \
ATH5K_DEBUG ATH5K_DEBUG \
ATH6KL_DEBUG
endif endif
ifdef CONFIG_PACKAGE_MAC80211_TRACING ifdef CONFIG_PACKAGE_MAC80211_TRACING
@ -1554,6 +1592,10 @@ else
config-y += ATH5K_PCI config-y += ATH5K_PCI
endif 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,carl9170) += CARL9170
config-$(call config_package,b43) += B43 config-$(call config_package,b43) += B43
@ -1795,6 +1837,9 @@ $(eval $(call KernelPackage,airo))
$(eval $(call KernelPackage,ath)) $(eval $(call KernelPackage,ath))
$(eval $(call KernelPackage,ath10k)) $(eval $(call KernelPackage,ath10k))
$(eval $(call KernelPackage,ath5k)) $(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))
$(eval $(call KernelPackage,ath9k-common)) $(eval $(call KernelPackage,ath9k-common))
$(eval $(call KernelPackage,ath9k-htc)) $(eval $(call KernelPackage,ath9k-htc))

View File

@ -127,7 +127,11 @@ detect_mac80211() {
set wireless.radio${devidx}.hwmode=11${mode_band} set wireless.radio${devidx}.hwmode=11${mode_band}
${dev_id} ${dev_id}
${ht_capab} ${ht_capab}
<<<<<<< HEAD
set wireless.radio${devidx}.noscan=1 set wireless.radio${devidx}.noscan=1
=======
set wireless.radio${devidx}.disabled=0
>>>>>>> upstream/master
set wireless.default_radio${devidx}=wifi-iface set wireless.default_radio${devidx}=wifi-iface
set wireless.default_radio${devidx}.device=radio${devidx} set wireless.default_radio${devidx}.device=radio${devidx}

View File

@ -0,0 +1,81 @@
From fdf7cb4185b60c68e1a75e61691c4afdc15dea0e Mon Sep 17 00:00:00 2001
From: Johannes Berg <johannes.berg@intel.com>
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 <johannes.berg@intel.com>
---
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 <jbenc@suse.cz>
* Copyright 2007-2008 Johannes Berg <johannes@sipsolutions.net>
* 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

View File

@ -0,0 +1,33 @@
From 2bdd713b92a9cade239d3c7d15205a09f556624d Mon Sep 17 00:00:00 2001
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
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 <Jason@zx2c4.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
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 <linux/slab.h>
#include <linux/export.h>
#include <net/mac80211.h>
+#include <crypto/algapi.h>
#include <asm/unaligned.h>
#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;

View File

@ -0,0 +1,73 @@
From cfbb0d90a7abb289edc91833d0905931f8805f12 Mon Sep 17 00:00:00 2001
From: Johannes Berg <johannes.berg@intel.com>
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 <johannes.berg@intel.com>
---
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;

View File

@ -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 <rmanohar@qti.qualcomm.com>
X-Patchwork-Id: 9970615
Message-Id: <1506378581-13598-1-git-send-email-rmanohar@qti.qualcomm.com>
To: <ath10k@lists.infradead.org>
Cc: Jouni Malinen <jouni@qca.qualcomm.com>, linux-wireless@vger.kernel.org,
Rajkumar Manoharan <rmanohar@qti.qualcomm.com>, 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 <s.gottschall@dd-wrt.com>
Cc: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
---
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;

View File

@ -10,7 +10,7 @@ LUCI_DEPENDS:=+adbyby +wget +ipset +coreutils +coreutils-nohup +dnsmasq-full
LUCI_PKGARCH:=all LUCI_PKGARCH:=all
PKG_NAME:=luci-app-adbyby-plus PKG_NAME:=luci-app-adbyby-plus
PKG_VERSION:=2.0 PKG_VERSION:=2.0
PKG_RELEASE:=23 PKG_RELEASE:=24
include $(TOPDIR)/feeds/luci/luci.mk include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -7,4 +7,5 @@ config adbyby
option enable '1' option enable '1'
option wan_mode '1' option wan_mode '1'
option mem_mode '1' option mem_mode '1'
option update_source '0'

View File

@ -0,0 +1,661 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
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.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU 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 <http://www.gnu.org/licenses/>.
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
<http://www.gnu.org/licenses/>.

View File

@ -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))

View File

@ -0,0 +1,2 @@
# luci-app-dogcom
LuCI app for [openwrt-dogcom](https://github.com/mchome/openwrt-dogcom "")

View File

@ -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

View File

@ -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 "dhcpD版"
msgid "pppoe"
msgstr "pppoeP版"
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 "请上传你的数据包,然后修改密码并复制到基本设置配置文件中。"

View File

@ -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

View File

@ -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%>
<style>
.generator textarea {
display: block;
width: auto;
font-family: Arial;
}
.lb {
display: inline-block;
background-color: #ddd;
padding: 4px 11px;
font-size: 16px;
font-family: Arial;
}
.generator input {
display: inline-block;
visibility: hidden;
width: 0 !important;
margin: 1rem;
}
</style>
<div class="generator">
<input class="file-upload" type="file" id="file-upload-d" accept=".pcapng"><label class="lb" for="file-upload-d">Version D</label>
<input class="file-upload" type="file" id="file-upload-p" accept=".pcapng"><label class="lb" for="file-upload-p">Version P</label>
<textarea id="display" rows="15" style="min-width: 300px;">
</textarea>
</div>
<script type="text/javascript">
var params;
window.onload = function () {
var el = document.querySelectorAll(".file-upload");
for (var i = 0, len = el.length; i < len; i++) {
el[i].addEventListener('click', function () {
fileupload(function (file, method) {
if (file) {
var reader = new FileReader();
reader.onload = function (e) {
var data = e.target.result;
if (method === 'd') {
params = re_d(data);
display();
} else if (method === 'p') {
params = re_p(data);
display();
};
}
reader.readAsArrayBuffer(file);
}
}, '.pcapng', this);
})
}
};
function fileupload (callback, accept, fileSelector) {
var method = fileSelector.getAttribute('id').slice(-1);
fileSelector.addEventListener('change', function () {
var files = fileSelector.files;
if (files.length) {
callback(files[0], method);
} else {
callback(null, null);
}
});
}
function display() {
var print = '';
for (var i = 0; i < params[0].length; i++) {
if (params[0][i] == 'mac' || params[0][i] == 'ror_version'){
print += (params[0][i] + ' = ' + params[1][i] + '\'\n');
} else {
print += (params[0][i] + ' = \'' + params[1][i] + '\'\n');
}
};
print = print.slice(0, -1);
document.querySelector("#display").value = print;
}
function hexEncode(array) {
return array.map(function (byte) {
return ('0' + (byte & 0xFF).toString(16)).slice(-2);
}).join('')
}
String.prototype.hex2a = function () {
var str = '';
for (var i = 0; i < this.length; i += 2)
str += String.fromCharCode(parseInt(this.substr(i, 2), 16));
return str
}
String.prototype.hex2o = function () {
var str = '';
for (var i = 0; i < this.length; i += 2)
str += (parseInt(this.substr(i, 2), 16) + '.');
return str
}
function re_d (text) {
var int8array = new Uint8Array(text);
var textarray = Array.from(int8array);
text = hexEncode(textarray);
var re1 = /f000f000[00-ff]{8}0[37]01/;
var r1 = text.match(re1);
var offset = text.indexOf(r1) + 16;
var re2 = /0000[00-ff]{4}/;
var r2 = text.substring(offset + 668, offset + 676).match(re2);
if (r2 !== null) {
var ror_version = true;
} else {
var ror_version = false;
}
var username_len = (parseInt(text.substring(offset + 6, offset + 8), 16) - 20)*2;
var username = text.substring(offset + 40, offset + 40 + username_len).hex2a();
var server = text.substring(offset - 24, offset -16).hex2o().slice(0, -1);
var password = 'CHANGEME!!!';
var CONTROLCHECKSTATUS = '\\x' + text.substring(offset + 112, offset + 114);
var ADAPTERNUM = '\\x' + text.substring(offset + 114, offset + 116);
var host_ip = text.substring(offset + 162, offset + 170).hex2o().slice(0, -1);
var IPDOG = '\\x' + text.substring(offset + 210, offset + 212);
var host_name = 'fuyumi';
var PRIMARY_DNS = text.substring(offset + 284, offset + 292).hex2o().slice(0, -1);
var dhcp_server = text.substring(offset + 292, offset + 300).hex2o().slice(0, -1);
var AUTH_VERSION = '\\x' + text.substring(offset + 620, offset + 622) + '\\x' + text.substring(offset + 622, offset + 624);
if (ror_version) {
var mac = '0x' + text.substring(offset + 656, offset + 668);
} else {
var mac = '0x' + text.substring(offset + 640, offset + 652);
}
var host_os = 'Windows 10';
var re3 = /f000f000.{8}07..28000b01..../g;
var r3 = text.match(re3);
for (var i = r3.length - 1; i >= 0; i--) {
if(r3[i].slice(-4)!='0f27')
var KEEP_ALIVE_VERSION = r3[i].slice(-4).replace(/../ig, function (s) {return '\\x' + s});
};
var params1 = ['server','username','password','CONTROLCHECKSTATUS','ADAPTERNUM','host_ip','IPDOG','host_name','PRIMARY_DNS','dhcp_server','AUTH_VERSION','mac','host_os','KEEP_ALIVE_VERSION', 'ror_version']
var params2 = [server,username,password,CONTROLCHECKSTATUS,ADAPTERNUM,host_ip,IPDOG,host_name,PRIMARY_DNS,dhcp_server,AUTH_VERSION,mac,host_os,KEEP_ALIVE_VERSION, String(ror_version).charAt(0).toUpperCase() + String(ror_version).slice(1)]
return [params1, params2]
}
function re_p (text) {
var int8array = new Uint8Array(text);
var textarray = Array.from(int8array);
text = hexEncode(textarray);
var re1 = /07[00-ff]{2}60000300/;
var r1 = text.match(re1);
var offset = text.indexOf(r1);
var server = text.substring(offset - 24, offset -16).hex2o().slice(0, -1);
var pppoe_flag = '\\x' + text.substring(offset + 38, offset + 40);
var re2 = /07.{2}28000b..(..)02/;
var keep_alive2_flag = '\\x' + text.match(re2)[1];
var params1 = ['server','pppoe_flag','keep_alive2_flag'];
var params2 = [server,pppoe_flag,keep_alive2_flag]
return [params1,params2]
}
</script>
<%+cbi/valuefooter%>

View File

@ -0,0 +1,3 @@
config dogcom 'config'
option enabled '0'
option version 'dhcp'

View File

@ -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."
}

View File

@ -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

View File

@ -16,7 +16,7 @@ stop(){
} }
start(){ start(){
echo "starting haproxy" echo "starting haproxy"
logger -t alex restarting haproxy logger -t restarting haproxy
echo global > $CFG_FILE echo global > $CFG_FILE
cat >> $CFG_FILE <<EOF cat >> $CFG_FILE <<EOF
log 127.0.0.1 local0 #[日志输出配置所有日志都记录在本机通过local0输出] log 127.0.0.1 local0 #[日志输出配置所有日志都记录在本机通过local0输出]
@ -112,7 +112,7 @@ restart(){
echo luci for haproxy echo luci for haproxy
sleep 1s sleep 1s
local vt_enabled=`uci get haproxy.@arguments[0].enabled 2>/dev/null` local vt_enabled=`uci get haproxy.@arguments[0].enabled 2>/dev/null`
logger -t alex !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!haproxy is initializing enabled is $vt_enabled logger -t haproxy is initializing enabled is $vt_enabled
echo $vt_enabled echo $vt_enabled
if [ "$vt_enabled" = 1 ]; then if [ "$vt_enabled" = 1 ]; then
[ -f /etc/haproxy_backup ] && { [ -f /etc/haproxy_backup ] && {

View File

@ -0,0 +1,7 @@
#!/bin/sh
/etc/init.d/haproxy disable
/etc/init.d/haproxy stop
rm -f /tmp/luci-indexcache
exit 0

View File

@ -0,0 +1,19 @@
#
# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
#
# 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

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,67 @@
--[[
LuCI - Lua Configuration Interface
Copyright 2011 flyzjhz <flyzjhz@gmail.com>
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("<a target=\"_blank\" href='http://"..lanipaddr..":"..oscamport.."'>OSCAM Web Intelface</a> "),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

View File

@ -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'

View File

@ -0,0 +1,4 @@
config 'setting'
option 'enable' '0'

View File

@ -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
}

View File

@ -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"
}

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,6 @@
[account]
user = 001
pwd = 001
group = 1
keepalive = 1
uniq = 0

View File

@ -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

View File

@ -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 "<URL>" '{print $2}'|awk -F "</URL>" '{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

View File

@ -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

View File

@ -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

204
package/lean/oscam/Makefile Normal file
View File

@ -0,0 +1,204 @@
#
# Copyright (C) 2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# $Id$
include $(TOPDIR)/rules.mk
PKG_NAME:=oscam
PKG_VERSION:=1.20-$(PKG_REV)
PKG_RELEASE:=1
PKG_REV:=2780c48789c8e1427df4078ea9b06e0b51594bbc
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=$(PKG_REV)
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_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/config
source "$(SOURCE)/Config.in"
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 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/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
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))

View File

@ -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
}

View File

@ -42,10 +42,6 @@ CONFIGURE_ARGS += \
TARGET_CFLAGS += $(FPIC) TARGET_CFLAGS += $(FPIC)
MAKE_FLAGS += CFLAGS_O="$(TARGET_CFLAGS)" MAKE_FLAGS += CFLAGS_O="$(TARGET_CFLAGS)"
ifeq ($(CONFIG_i386)$(CONFIG_x86_64),)
TARGET_CFLAGS += -DLZO_CFG_NO_UNALIGNED=1
endif
define Build/InstallDev define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/include/lzo $(1)/usr/include/ $(CP) $(PKG_INSTALL_DIR)/usr/include/lzo $(1)/usr/include/

View File

@ -11,7 +11,7 @@ PKG_NAME:=openssl
PKG_BASE:=1.0.2 PKG_BASE:=1.0.2
PKG_BUGFIX:=l PKG_BUGFIX:=l
PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX) PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX)
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_USE_MIPS16:=0 PKG_USE_MIPS16:=0
PKG_BUILD_PARALLEL:=0 PKG_BUILD_PARALLEL:=0
@ -168,6 +168,8 @@ else
OPENSSL_OPTIONS+=no-sse2 OPENSSL_OPTIONS+=no-sse2
ifeq ($(CONFIG_mips)$(CONFIG_mipsel),y) ifeq ($(CONFIG_mips)$(CONFIG_mipsel),y)
OPENSSL_TARGET:=linux-mips-openwrt OPENSSL_TARGET:=linux-mips-openwrt
else ifeq ($(CONFIG_aarch64),y)
OPENSSL_TARGET:=linux-aarch64-openwrt
else ifeq ($(CONFIG_arm)$(CONFIG_armeb),y) else ifeq ($(CONFIG_arm)$(CONFIG_armeb),y)
OPENSSL_TARGET:=linux-armv4-openwrt OPENSSL_TARGET:=linux-armv4-openwrt
else else

View File

@ -1,11 +1,12 @@
--- a/Configure --- a/Configure
+++ b/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-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}", "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 +# 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-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-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-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)", +"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)",

View File

@ -1,5 +1,7 @@
--- a/hostapd/Makefile Index: hostapd-2017-08-24-c2d4f2eb/hostapd/Makefile
+++ b/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 @@ -165,6 +165,11 @@ OBJS += ../src/common/hw_features_common
OBJS += ../src/eapol_auth/eapol_auth_sm.o OBJS += ../src/eapol_auth/eapol_auth_sm.o
@ -12,8 +14,10 @@
ifdef CONFIG_CODE_COVERAGE ifdef CONFIG_CODE_COVERAGE
CFLAGS += -O0 -fprofile-arcs -ftest-coverage CFLAGS += -O0 -fprofile-arcs -ftest-coverage
--- a/src/ap/hostapd.h Index: hostapd-2017-08-24-c2d4f2eb/src/ap/hostapd.h
+++ b/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 @@ @@ -13,6 +13,7 @@
#include "utils/list.h" #include "utils/list.h"
#include "ap_config.h" #include "ap_config.h"
@ -39,8 +43,10 @@
enum hostapd_iface_state { enum hostapd_iface_state {
HAPD_IFACE_UNINITIALIZED, HAPD_IFACE_UNINITIALIZED,
HAPD_IFACE_DISABLED, HAPD_IFACE_DISABLED,
--- a/src/ap/hostapd.c Index: hostapd-2017-08-24-c2d4f2eb/src/ap/hostapd.c
+++ b/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 @@ -309,6 +309,7 @@ static void hostapd_free_hapd_data(struc
hapd->started = 0; hapd->started = 0;
@ -82,8 +88,10 @@
hostapd_interface_deinit(iface); hostapd_interface_deinit(iface);
wpa_printf(MSG_DEBUG, "%s: driver=%p drv_priv=%p -> hapd_deinit", wpa_printf(MSG_DEBUG, "%s: driver=%p drv_priv=%p -> hapd_deinit",
__func__, driver, drv_priv); __func__, driver, drv_priv);
--- a/src/ap/ieee802_11.c Index: hostapd-2017-08-24-c2d4f2eb/src/ap/ieee802_11.c
+++ b/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 @@ -1587,7 +1587,8 @@ ieee802_11_set_radius_info(struct hostap
@ -201,8 +209,10 @@
ret = 1; ret = 1;
break; break;
case WLAN_FC_STYPE_DISASSOC: case WLAN_FC_STYPE_DISASSOC:
--- a/src/ap/beacon.c Index: hostapd-2017-08-24-c2d4f2eb/src/ap/beacon.c
+++ b/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 @@ -716,7 +716,7 @@ void sta_track_claim_taxonomy_info(struc
void handle_probe_req(struct hostapd_data *hapd, void handle_probe_req(struct hostapd_data *hapd,
@ -241,8 +251,10 @@
/* TODO: verify that supp_rates contains at least one matching rate /* TODO: verify that supp_rates contains at least one matching rate
* with AP configuration */ * with AP configuration */
--- a/src/ap/beacon.h Index: hostapd-2017-08-24-c2d4f2eb/src/ap/beacon.h
+++ b/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; @@ -14,7 +14,7 @@ struct ieee80211_mgmt;
void handle_probe_req(struct hostapd_data *hapd, 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_beacon(struct hostapd_data *hapd);
int ieee802_11_set_beacons(struct hostapd_iface *iface); int ieee802_11_set_beacons(struct hostapd_iface *iface);
int ieee802_11_update_beacons(struct hostapd_iface *iface); int ieee802_11_update_beacons(struct hostapd_iface *iface);
--- a/src/ap/drv_callbacks.c Index: hostapd-2017-08-24-c2d4f2eb/src/ap/drv_callbacks.c
+++ b/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 @@ -116,6 +116,10 @@ int hostapd_notif_assoc(struct hostapd_d
u16 reason = WLAN_REASON_UNSPECIFIED; u16 reason = WLAN_REASON_UNSPECIFIED;
u16 status = WLAN_STATUS_SUCCESS; u16 status = WLAN_STATUS_SUCCESS;
@ -278,8 +292,10 @@
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
if (elems.p2p) { if (elems.p2p) {
wpabuf_free(sta->p2p_ie); wpabuf_free(sta->p2p_ie);
--- a/src/ap/sta_info.c Index: hostapd-2017-08-24-c2d4f2eb/src/ap/sta_info.c
+++ b/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 @@ -404,6 +404,7 @@ void ap_handle_timer(void *eloop_ctx, vo
HOSTAPD_LEVEL_INFO, "deauthenticated due to " HOSTAPD_LEVEL_INFO, "deauthenticated due to "
"local deauth request"); "local deauth request");
@ -296,8 +312,18 @@
break; break;
} }
} }
--- a/src/ap/wpa_auth_glue.c @@ -1212,6 +1214,7 @@ void ap_sta_set_authorized(struct hostap
+++ b/src/ap/wpa_auth_glue.c 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 @@ -175,6 +175,7 @@ static void hostapd_wpa_auth_psk_failure
struct hostapd_data *hapd = ctx; struct hostapd_data *hapd = ctx;
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_POSSIBLE_PSK_MISMATCH MACSTR, wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_POSSIBLE_PSK_MISMATCH MACSTR,

View File

@ -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) void hostapd_ubus_notify(struct hostapd_data *hapd, const char *type, const u8 *addr)
{ {
char mac[18];
if (!hapd->ubus.obj.has_subscribers) if (!hapd->ubus.obj.has_subscribers)
return; return;
if (!addr) if (!addr)
return; return;
snprintf(mac, sizeof(mac), MACSTR, MAC2STR(addr));
blob_buf_init(&b, 0); 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); ubus_notify(ctx, &hapd->ubus.obj, type, b.head, -1);
} }

View File

@ -47,7 +47,6 @@ define Package/busybox
URL:=http://busybox.net/ URL:=http://busybox.net/
DEPENDS:=+BUSYBOX_USE_LIBRPC:librpc +BUSYBOX_CONFIG_PAM:libpam +BUSYBOX_CONFIG_NTPD:jsonfilter DEPENDS:=+BUSYBOX_USE_LIBRPC:librpc +BUSYBOX_CONFIG_PAM:libpam +BUSYBOX_CONFIG_NTPD:jsonfilter
MENU:=1 MENU:=1
PROVIDES:=ip
ALTERNATIVES:=\ ALTERNATIVES:=\
$(call BUSYBOX_IF_ENABLED,KILL, 100:/bin/kill:/bin/busybox) \ $(call BUSYBOX_IF_ENABLED,KILL, 100:/bin/kill:/bin/busybox) \
$(call BUSYBOX_IF_ENABLED,PS, 100:/bin/ps:/bin/busybox) \ $(call BUSYBOX_IF_ENABLED,PS, 100:/bin/ps:/bin/busybox) \

View File

@ -13,7 +13,7 @@ FEATURES:=usbgadget
CPU_TYPE:=24kc CPU_TYPE:=24kc
SUBTARGETS:=generic nand mikrotik SUBTARGETS:=generic nand mikrotik
KERNEL_PATCHVER:=4.4 KERNEL_PATCHVER:=4.9
include $(INCLUDE_DIR)/target.mk include $(INCLUDE_DIR)/target.mk

View File

@ -223,8 +223,8 @@ CONFIG_ATH79_MACH_UBNT=y
CONFIG_ATH79_MACH_UBNT_UNIFIAC=y CONFIG_ATH79_MACH_UBNT_UNIFIAC=y
CONFIG_ATH79_MACH_UBNT_XM=y CONFIG_ATH79_MACH_UBNT_XM=y
CONFIG_ATH79_MACH_WEIO=y CONFIG_ATH79_MACH_WEIO=y
CONFIG_ATH79_MACH_WHR_HP_G300N=y
# CONFIG_ATH79_MACH_WI2A_AC200I is not set # CONFIG_ATH79_MACH_WI2A_AC200I is not set
CONFIG_ATH79_MACH_WHR_HP_G300N=y
CONFIG_ATH79_MACH_WLAE_AG300N=y CONFIG_ATH79_MACH_WLAE_AG300N=y
CONFIG_ATH79_MACH_WLR8100=y CONFIG_ATH79_MACH_WLR8100=y
CONFIG_ATH79_MACH_WNDAP360=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_BOOTLOADER=y
# CONFIG_MIPS_CMDLINE_FROM_DTB is not set # CONFIG_MIPS_CMDLINE_FROM_DTB is not set
# CONFIG_MIPS_ELF_APPENDED_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_HUGE_TLB_SUPPORT is not set
CONFIG_MIPS_L1_CACHE_SHIFT=5 CONFIG_MIPS_L1_CACHE_SHIFT=5
CONFIG_MIPS_MACHINE=y CONFIG_MIPS_MACHINE=y
@ -479,3 +478,4 @@ CONFIG_TICK_CPU_ACCOUNTING=y
CONFIG_USB_SUPPORT=y CONFIG_USB_SUPPORT=y
CONFIG_USE_OF=y CONFIG_USE_OF=y
CONFIG_ZONE_DMA_FLAG=0 CONFIG_ZONE_DMA_FLAG=0
CONFIG_MIPS_FPU_EMULATOR=y

View File

@ -221,8 +221,8 @@ CONFIG_ATH79_MACH_UBNT=y
CONFIG_ATH79_MACH_UBNT_UNIFIAC=y CONFIG_ATH79_MACH_UBNT_UNIFIAC=y
CONFIG_ATH79_MACH_UBNT_XM=y CONFIG_ATH79_MACH_UBNT_XM=y
CONFIG_ATH79_MACH_WEIO=y CONFIG_ATH79_MACH_WEIO=y
# CONFIG_ATH79_MACH_WI2A_AC200I is not set
CONFIG_ATH79_MACH_WHR_HP_G300N=y CONFIG_ATH79_MACH_WHR_HP_G300N=y
# CONFIG_ATH79_MACH_WI2A_AC200I is not set
CONFIG_ATH79_MACH_WLAE_AG300N=y CONFIG_ATH79_MACH_WLAE_AG300N=y
CONFIG_ATH79_MACH_WLR8100=y CONFIG_ATH79_MACH_WLR8100=y
CONFIG_ATH79_MACH_WNDAP360=y CONFIG_ATH79_MACH_WNDAP360=y
@ -362,6 +362,7 @@ CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_FORCED_THREADING=y CONFIG_IRQ_FORCED_THREADING=y
CONFIG_IRQ_MIPS_CPU=y CONFIG_IRQ_MIPS_CPU=y
CONFIG_IRQ_WORK=y CONFIG_IRQ_WORK=y
# CONFIG_KERNEL_KALLSYMS is not set
CONFIG_LEDS_GPIO=y CONFIG_LEDS_GPIO=y
# CONFIG_LEDS_WNDR3700_USB is not set # CONFIG_LEDS_WNDR3700_USB is not set
CONFIG_LIBFDT=y CONFIG_LIBFDT=y
@ -379,6 +380,7 @@ CONFIG_MIPS_CLOCK_VSYSCALL=y
CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y
# CONFIG_MIPS_CMDLINE_FROM_DTB is not set # CONFIG_MIPS_CMDLINE_FROM_DTB is not set
# CONFIG_MIPS_ELF_APPENDED_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_HUGE_TLB_SUPPORT is not set
CONFIG_MIPS_L1_CACHE_SHIFT=5 CONFIG_MIPS_L1_CACHE_SHIFT=5
CONFIG_MIPS_MACHINE=y CONFIG_MIPS_MACHINE=y

View File

@ -35,15 +35,15 @@
#define ARCHER_C25_GPIO_SHIFT_SRCLR 19 /* MR, Master Reset */ #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_GPIO_SHIFT_RCLK 16 /* STCP, Storage Reg Clock Input */
#define ARCHER_C25_74HC_GPIO_BASE QCA956X_GPIO_COUNT #define ARCHER_C25_74HC_GPIO_BASE 32
#define ARCHER_C25_74HC_GPIO_LED_WAN_AMBER 27 #define ARCHER_C25_74HC_GPIO_LED_WAN_AMBER (ARCHER_C25_74HC_GPIO_BASE + 4)
#define ARCHER_C25_74HC_GPIO_LED_WAN_GREEN 28 #define ARCHER_C25_74HC_GPIO_LED_WAN_GREEN (ARCHER_C25_74HC_GPIO_BASE + 5)
#define ARCHER_C25_74HC_GPIO_LED_WLAN2 29 #define ARCHER_C25_74HC_GPIO_LED_WLAN2 (ARCHER_C25_74HC_GPIO_BASE + 6)
#define ARCHER_C25_74HC_GPIO_LED_WLAN5 30 #define ARCHER_C25_74HC_GPIO_LED_WLAN5 (ARCHER_C25_74HC_GPIO_BASE + 7)
#define ARCHER_C25_74HC_GPIO_LED_LAN1 23 #define ARCHER_C25_74HC_GPIO_LED_LAN1 (ARCHER_C25_74HC_GPIO_BASE + 0)
#define ARCHER_C25_74HC_GPIO_LED_LAN2 24 #define ARCHER_C25_74HC_GPIO_LED_LAN2 (ARCHER_C25_74HC_GPIO_BASE + 1)
#define ARCHER_C25_74HC_GPIO_LED_LAN3 25 #define ARCHER_C25_74HC_GPIO_LED_LAN3 (ARCHER_C25_74HC_GPIO_BASE + 2)
#define ARCHER_C25_74HC_GPIO_LED_LAN4 26 #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_0 0
#define ARCHER_C25_V1_SSR_BIT_1 1 #define ARCHER_C25_V1_SSR_BIT_1 1

View File

@ -43,15 +43,15 @@
#define ARCHER_C59_GPIO_SHIFT_SRCLR 19 #define ARCHER_C59_GPIO_SHIFT_SRCLR 19
#define ARCHER_C59_GPIO_SHIFT_RCLK 20 #define ARCHER_C59_GPIO_SHIFT_RCLK 20
#define ARCHER_C59_74HC_GPIO_BASE QCA956X_GPIO_COUNT #define ARCHER_C59_74HC_GPIO_BASE 32
#define ARCHER_C59_74HC_GPIO_LED_POWER 23 #define ARCHER_C59_74HC_GPIO_LED_POWER (ARCHER_C59_74HC_GPIO_BASE + 0)
#define ARCHER_C59_74HC_GPIO_LED_WLAN2 24 #define ARCHER_C59_74HC_GPIO_LED_WLAN2 (ARCHER_C59_74HC_GPIO_BASE + 1)
#define ARCHER_C59_74HC_GPIO_LED_WLAN5 25 #define ARCHER_C59_74HC_GPIO_LED_WLAN5 (ARCHER_C59_74HC_GPIO_BASE + 2)
#define ARCHER_C59_74HC_GPIO_LED_LAN 26 #define ARCHER_C59_74HC_GPIO_LED_LAN (ARCHER_C59_74HC_GPIO_BASE + 3)
#define ARCHER_C59_74HC_GPIO_LED_WAN_GREEN 27 #define ARCHER_C59_74HC_GPIO_LED_WAN_GREEN (ARCHER_C59_74HC_GPIO_BASE + 4)
#define ARCHER_C59_74HC_GPIO_LED_WAN_AMBER 28 #define ARCHER_C59_74HC_GPIO_LED_WAN_AMBER (ARCHER_C59_74HC_GPIO_BASE + 5)
#define ARCHER_C59_74HC_GPIO_LED_WPS 29 #define ARCHER_C59_74HC_GPIO_LED_WPS (ARCHER_C59_74HC_GPIO_BASE + 6)
#define ARCHER_C59_74HC_GPIO_LED_USB 30 #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_0 0
#define ARCHER_C59_V1_SSR_BIT_1 1 #define ARCHER_C59_V1_SSR_BIT_1 1

View File

@ -56,7 +56,7 @@
#define ARCHER_C7_GPIO_LED_USB1 7 #define ARCHER_C7_GPIO_LED_USB1 7
#define ARCHER_C7_GPIO_LED_USB2 8 #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_WPS (ARCHER_C7_74HC_GPIO_BASE + 0)
#define ARCHER_C7_GPIO_LED_LAN1 (ARCHER_C7_74HC_GPIO_BASE + 1) #define ARCHER_C7_GPIO_LED_LAN1 (ARCHER_C7_74HC_GPIO_BASE + 1)
#define ARCHER_C7_GPIO_LED_LAN2 (ARCHER_C7_74HC_GPIO_BASE + 2) #define ARCHER_C7_GPIO_LED_LAN2 (ARCHER_C7_74HC_GPIO_BASE + 2)

View File

@ -53,7 +53,7 @@
#define RB91X_FLAG_USB BIT(0) #define RB91X_FLAG_USB BIT(0)
#define RB91X_FLAG_PCIE BIT(1) #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_LATCH_GPIO(_x) (RB91X_LATCH_GPIO_BASE + (_x))
#define RB91X_SSR_GPIO_BASE (RB91X_LATCH_GPIO_BASE + AR934X_GPIO_COUNT) #define RB91X_SSR_GPIO_BASE (RB91X_LATCH_GPIO_BASE + AR934X_GPIO_COUNT)

View File

@ -49,15 +49,15 @@
#define TL_WR942N_V1_GPIO_LED_WPS 21 #define TL_WR942N_V1_GPIO_LED_WPS 21
#define TL_WR942N_V1_GPIO_LED_STATUS 22 #define TL_WR942N_V1_GPIO_LED_STATUS 22
#define TL_WR942N_V1_74HC_GPIO_BASE QCA956X_GPIO_COUNT #define TL_WR942N_V1_74HC_GPIO_BASE 32
#define TL_WR942N_V1_74HC_GPIO_LED_LAN4 23 #define TL_WR942N_V1_74HC_GPIO_LED_LAN4 (TL_WR942N_V1_74HC_GPIO_BASE + 0)
#define TL_WR942N_V1_74HC_GPIO_LED_LAN3 24 #define TL_WR942N_V1_74HC_GPIO_LED_LAN3 (TL_WR942N_V1_74HC_GPIO_BASE + 1)
#define TL_WR942N_V1_74HC_GPIO_LED_LAN2 25 #define TL_WR942N_V1_74HC_GPIO_LED_LAN2 (TL_WR942N_V1_74HC_GPIO_BASE + 2)
#define TL_WR942N_V1_74HC_GPIO_LED_LAN1 26 #define TL_WR942N_V1_74HC_GPIO_LED_LAN1 (TL_WR942N_V1_74HC_GPIO_BASE + 3)
#define TL_WR942N_V1_74HC_GPIO_LED_WAN_GREEN 27 #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 28 #define TL_WR942N_V1_74HC_GPIO_LED_WAN_AMBER (TL_WR942N_V1_74HC_GPIO_BASE + 5)
#define TL_WR942N_V1_74HC_GPIO_LED_WLAN 29 #define TL_WR942N_V1_74HC_GPIO_LED_WLAN (TL_WR942N_V1_74HC_GPIO_BASE + 6)
#define TL_WR942N_V1_74HC_GPIO_HUB_RESET 30 /* from u-boot sources */ #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_0 0
#define TL_WR942N_V1_SSR_BIT_1 1 #define TL_WR942N_V1_SSR_BIT_1 1

View File

@ -39,9 +39,31 @@
struct rb4xx_nand_info { struct rb4xx_nand_info {
struct nand_chip chip; struct nand_chip chip;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
struct mtd_info mtd; 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) #if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
/* /*
* We need to use the OLD Yaffs-1 OOB layout, otherwise the RB bootloader * 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) static int rb4xx_nand_probe(struct platform_device *pdev)
{ {
struct rb4xx_nand_info *info; struct rb4xx_nand_info *info;
struct mtd_info *mtd;
int ret; int ret;
printk(KERN_INFO DRV_DESC " version " DRV_VERSION "\n"); 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->chip.priv = &info;
info->mtd.priv = &info->chip; mtd = rbinfo_to_mtd(info);
info->mtd.owner = THIS_MODULE;
#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.cmd_ctrl = rb4xx_nand_cmd_ctrl;
info->chip.dev_ready = rb4xx_nand_dev_ready; 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.chip_delay = 25;
info->chip.ecc.mode = NAND_ECC_SOFT; 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->chip.options = NAND_NO_SUBPAGE_WRITE;
platform_set_drvdata(pdev, info); platform_set_drvdata(pdev, info);
ret = nand_scan_ident(&info->mtd, 1, NULL); ret = nand_scan_ident(mtd, 1, NULL);
if (ret) { if (ret) {
ret = -ENXIO; ret = -ENXIO;
goto err_free_info; goto err_free_info;
} }
if (info->mtd.writesize == 512) if (mtd->writesize == 512)
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) #if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
info->chip.ecc.layout = &rb4xx_nand_ecclayout; info->chip.ecc.layout = &rb4xx_nand_ecclayout;
#else #else
mtd_set_ooblayout(&info->mtd, &rb4xx_nand_ecclayout_ops); mtd_set_ooblayout(mtd, &rb4xx_nand_ecclayout_ops);
#endif #endif
ret = nand_scan_tail(&info->mtd); ret = nand_scan_tail(mtd);
if (ret) { if (ret) {
return -ENXIO; return -ENXIO;
goto err_set_drvdata; goto err_set_drvdata;
} }
mtd_device_register(&info->mtd, rb4xx_nand_partitions, mtd_device_register(mtd, rb4xx_nand_partitions,
ARRAY_SIZE(rb4xx_nand_partitions)); ARRAY_SIZE(rb4xx_nand_partitions));
if (ret) if (ret)
goto err_release_nand; goto err_release_nand;
@ -301,7 +331,7 @@ static int rb4xx_nand_probe(struct platform_device *pdev)
return 0; return 0;
err_release_nand: err_release_nand:
nand_release(&info->mtd); nand_release(mtd);
err_set_drvdata: err_set_drvdata:
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
err_free_info: 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); struct rb4xx_nand_info *info = platform_get_drvdata(pdev);
nand_release(&info->mtd); nand_release(rbinfo_to_mtd(info));
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
kfree(info); kfree(info);
gpio_free(RB4XX_NAND_GPIO_NCE); gpio_free(RB4XX_NAND_GPIO_NCE);

View File

@ -41,13 +41,30 @@
struct rb750_nand_info { struct rb750_nand_info {
struct nand_chip chip; struct nand_chip chip;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
struct mtd_info mtd; struct mtd_info mtd;
#endif
struct rb7xx_nand_platform_data *pdata; struct rb7xx_nand_platform_data *pdata;
}; };
static inline struct rb750_nand_info *mtd_to_rbinfo(struct mtd_info *mtd) 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); 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) #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 rb750_nand_info *info;
struct rb7xx_nand_platform_data *pdata; struct rb7xx_nand_platform_data *pdata;
struct mtd_info *mtd;
int ret; int ret;
printk(KERN_INFO DRV_DESC " version " DRV_VERSION "\n"); printk(KERN_INFO DRV_DESC " version " DRV_VERSION "\n");
@ -317,8 +335,12 @@ static int rb750_nand_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
info->chip.priv = &info; 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.select_chip = rb750_nand_select_chip;
info->chip.cmd_ctrl = rb750_nand_cmd_ctrl; 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.chip_delay = 25;
info->chip.ecc.mode = NAND_ECC_SOFT; 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->chip.options = NAND_NO_SUBPAGE_WRITE;
info->pdata = pdata; info->pdata = pdata;
@ -337,26 +362,26 @@ static int rb750_nand_probe(struct platform_device *pdev)
rb750_nand_gpio_init(info); rb750_nand_gpio_init(info);
ret = nand_scan_ident(&info->mtd, 1, NULL); ret = nand_scan_ident(mtd, 1, NULL);
if (ret) { if (ret) {
ret = -ENXIO; ret = -ENXIO;
goto err_free_info; goto err_free_info;
} }
if (info->mtd.writesize == 512) if (mtd->writesize == 512)
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) #if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
info->chip.ecc.layout = &rb750_nand_ecclayout; info->chip.ecc.layout = &rb750_nand_ecclayout;
#else #else
mtd_set_ooblayout(&info->mtd, &rb750_nand_ecclayout_ops); mtd_set_ooblayout(mtd, &rb750_nand_ecclayout_ops);
#endif #endif
ret = nand_scan_tail(&info->mtd); ret = nand_scan_tail(mtd);
if (ret) { if (ret) {
return -ENXIO; return -ENXIO;
goto err_set_drvdata; 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)); ARRAY_SIZE(rb750_nand_partitions));
if (ret) if (ret)
goto err_release_nand; goto err_release_nand;
@ -364,7 +389,7 @@ static int rb750_nand_probe(struct platform_device *pdev)
return 0; return 0;
err_release_nand: err_release_nand:
nand_release(&info->mtd); nand_release(mtd);
err_set_drvdata: err_set_drvdata:
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
err_free_info: 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); struct rb750_nand_info *info = platform_get_drvdata(pdev);
nand_release(&info->mtd); nand_release(rbinfo_to_mtd(info));
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
kfree(info); kfree(info);

View File

@ -40,7 +40,9 @@
struct rb91x_nand_info { struct rb91x_nand_info {
struct nand_chip chip; struct nand_chip chip;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
struct mtd_info mtd; struct mtd_info mtd;
#endif
struct device *dev; struct device *dev;
int gpio_nce; int gpio_nce;
@ -54,9 +56,25 @@ struct rb91x_nand_info {
static inline struct rb91x_nand_info *mtd_to_rbinfo(struct mtd_info *mtd) 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); 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) #if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
/* /*
* We need to use the OLD Yaffs-1 OOB layout, otherwise the RB bootloader * 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_info *rbni;
struct rb91x_nand_platform_data *pdata; struct rb91x_nand_platform_data *pdata;
struct mtd_info *mtd;
int ret; int ret;
pr_info(DRV_DESC "\n"); 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->gpio_nle = pdata->gpio_nle;
rbni->chip.priv = &rbni; rbni->chip.priv = &rbni;
rbni->mtd.priv = &rbni->chip; mtd = rbinfo_to_mtd(rbni);
rbni->mtd.owner = THIS_MODULE;
#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.cmd_ctrl = rb91x_nand_cmd_ctrl;
rbni->chip.dev_ready = rb91x_nand_dev_ready; 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.chip_delay = 25;
rbni->chip.ecc.mode = NAND_ECC_SOFT; 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; rbni->chip.options = NAND_NO_SUBPAGE_WRITE;
platform_set_drvdata(pdev, rbni); platform_set_drvdata(pdev, rbni);
@ -381,22 +407,22 @@ static int rb91x_nand_probe(struct platform_device *pdev)
if (ret) if (ret)
return ret; return ret;
ret = nand_scan_ident(&rbni->mtd, 1, NULL); ret = nand_scan_ident(mtd, 1, NULL);
if (ret) if (ret)
return ret; return ret;
if (rbni->mtd.writesize == 512) if (mtd->writesize == 512)
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) #if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
rbni->chip.ecc.layout = &rb91x_nand_ecclayout; rbni->chip.ecc.layout = &rb91x_nand_ecclayout;
#else #else
mtd_set_ooblayout(&rbni->mtd, &rb91x_nand_ecclayout_ops); mtd_set_ooblayout(mtd, &rb91x_nand_ecclayout_ops);
#endif #endif
ret = nand_scan_tail(&rbni->mtd); ret = nand_scan_tail(mtd);
if (ret) if (ret)
return 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)); ARRAY_SIZE(rb91x_nand_partitions));
if (ret) if (ret)
goto err_release_nand; goto err_release_nand;
@ -404,7 +430,7 @@ static int rb91x_nand_probe(struct platform_device *pdev)
return 0; return 0;
err_release_nand: err_release_nand:
nand_release(&rbni->mtd); nand_release(mtd);
return ret; return ret;
} }
@ -412,7 +438,7 @@ static int rb91x_nand_remove(struct platform_device *pdev)
{ {
struct rb91x_nand_info *info = platform_get_drvdata(pdev); struct rb91x_nand_info *info = platform_get_drvdata(pdev);
nand_release(&info->mtd); nand_release(rbinfo_to_mtd(info));
return 0; return 0;
} }

View File

@ -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) 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) IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to $$$$(ROOTFS_SIZE) | append-kernel | check-size $$$$(IMAGE_SIZE)
endef endef
TARGET_DEVICES += dr344
define Device/dr531 define Device/dr531
DEVICE_TITLE := Wallys DR531 DEVICE_TITLE := Wallys DR531

View File

@ -37,11 +37,13 @@ CFLAGS = -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-trigraphs -Os \
-mabi=32 -march=mips32r2 \ -mabi=32 -march=mips32r2 \
-Wa,-32 -Wa,-march=mips32r2 -Wa,-mips32r2 -Wa,--trap -Wa,-32 -Wa,-march=mips32r2 -Wa,-mips32r2 -Wa,--trap
CFLAGS += -D_LZMA_PROB32 CFLAGS += -D_LZMA_PROB32
CFLAGS += -flto
ASFLAGS = $(CFLAGS) -D__ASSEMBLY__ ASFLAGS = $(CFLAGS) -D__ASSEMBLY__
LDFLAGS = -static --gc-sections -no-warn-mismatch LDFLAGS = -static -Wl,--gc-sections -Wl,-no-warn-mismatch
LDFLAGS += -e startup -T loader.lds -Ttext $(LZMA_TEXT_START) 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) 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 $@ $< $(LD) -r -b binary --oformat $(O_FORMAT) -T lzma-data.lds -o $@ $<
loader: $(OBJECTS) loader: $(OBJECTS)
$(LD) $(LDFLAGS) -o $@ $(OBJECTS) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJECTS)
loader.bin: loader loader.bin: loader
$(OBJCOPY) $(BIN_FLAGS) $< $@ $(OBJCOPY) $(BIN_FLAGS) $< $@

View File

@ -42,6 +42,19 @@ LEAF(startup)
mtc0 t0, CP0_STATUS mtc0 t0, CP0_STATUS
ehb 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_COUNT
mtc0 zero, CP0_COMPARE mtc0 zero, CP0_COMPARE
ehb ehb

View File

@ -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) 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 SUPPORTED_DEVICES := archer-c60-v1
endef 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 define Device/archer-c5-v1
$(Device/tplink-16mlzma) $(Device/tplink-16mlzma)
@ -1043,7 +1043,6 @@ define Device/tl-wr902ac-v1
append-metadata | check-size $$$$(IMAGE_SIZE) append-metadata | check-size $$$$(IMAGE_SIZE)
MTDPARTS := spi0.0:128k(u-boot)ro,7360k(firmware),640k(tplink)ro,64k(art)ro MTDPARTS := spi0.0:128k(u-boot)ro,7360k(firmware),640k(tplink)ro,64k(art)ro
endef endef
TARGET_DEVICES += tl-wr902ac-v1
define Device/tl-wr940n-v4 define Device/tl-wr940n-v4
$(Device/tplink-8mlzma) $(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) 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 SUPPORTED_DEVICES := tl-wr942n-v1
endef 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

View File

@ -256,4 +256,3 @@ define Device/ubnt-unifi-outdoor-plus
BOARDNAME := UBNT-UOP BOARDNAME := UBNT-UOP
DEVICE_PROFILE := UBNT DEVICE_PROFILE := UBNT
endef endef
TARGET_DEVICES += ubnt-uap-pro ubnt-unifi-outdoor-plus

View File

@ -231,6 +231,7 @@ CONFIG_MTD_NAND_RB4XX=y
CONFIG_MTD_NAND_RB750=y CONFIG_MTD_NAND_RB750=y
CONFIG_MTD_NAND_RB91X=y CONFIG_MTD_NAND_RB91X=y
# CONFIG_MTD_REDBOOT_PARTS is not set # 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_EVA_FW is not set
# CONFIG_MTD_SPLIT_TPLINK_FW is not set # CONFIG_MTD_SPLIT_TPLINK_FW is not set
# CONFIG_MTD_TPLINK_PARTS is not set # CONFIG_MTD_TPLINK_PARTS is not set

View File

@ -11,7 +11,7 @@ Signed-off-by: Eric Anholt <eric@anholt.net>
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
+++ b/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 */ *need_release = 0; /* do not try and release vmalloc pages */
} else { } else {
down_read(&task->mm->mmap_sem); down_read(&task->mm->mmap_sem);

View File

@ -12,7 +12,7 @@ Signed-off-by: Eric Anholt <eric@anholt.net>
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
+++ b/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) while (actual_pages > 0)
{ {
actual_pages--; actual_pages--;
@ -21,7 +21,7 @@ Signed-off-by: Eric Anholt <eric@anholt.net>
} }
kfree(pagelist); kfree(pagelist);
if (actual_pages == 0) 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; offset = 0;
set_page_dirty(pg); set_page_dirty(pg);
} }

View File

@ -819,7 +819,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/marvell/mvpp2.c --- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/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) { if (budget > 0) {
cause_rx = 0; cause_rx = 0;

View File

@ -54,7 +54,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+MODULE_LICENSE("GPL"); +MODULE_LICENSE("GPL");
--- a/kernel/sched/core.c --- a/kernel/sched/core.c
+++ b/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); return try_to_wake_up(p, state, 0);
} }

View File

@ -67,11 +67,10 @@
counters = alloc_counters(table); counters = alloc_counters(table);
if (IS_ERR(counters)) if (IS_ERR(counters))
@@ -972,6 +1001,14 @@ copy_entries_to_user(unsigned int total_ @@ -973,6 +1002,14 @@ copy_entries_to_user(unsigned int total_
ret = -EFAULT;
goto free_counters; goto free_counters;
} }
+
+ flags = e->ip.flags & IPT_F_MASK; + flags = e->ip.flags & IPT_F_MASK;
+ if (copy_to_user(userptr + off + if (copy_to_user(userptr + off
+ + offsetof(struct ipt_entry, ip.flags), + + offsetof(struct ipt_entry, ip.flags),
@ -79,6 +78,24 @@
+ ret = -EFAULT; + ret = -EFAULT;
+ goto free_counters; + goto free_counters;
+ } + }
+
for (i = sizeof(struct ipt_entry); for (i = sizeof(struct ipt_entry);
i < e->target_offset; 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);

View File

@ -67,11 +67,10 @@
counters = alloc_counters(table); counters = alloc_counters(table);
if (IS_ERR(counters)) if (IS_ERR(counters))
@@ -974,6 +1003,14 @@ copy_entries_to_user(unsigned int total_ @@ -975,6 +1004,14 @@ copy_entries_to_user(unsigned int total_
ret = -EFAULT;
goto free_counters; goto free_counters;
} }
+
+ flags = e->ip.flags & IPT_F_MASK; + flags = e->ip.flags & IPT_F_MASK;
+ if (copy_to_user(userptr + off + if (copy_to_user(userptr + off
+ + offsetof(struct ipt_entry, ip.flags), + + offsetof(struct ipt_entry, ip.flags),
@ -79,6 +78,24 @@
+ ret = -EFAULT; + ret = -EFAULT;
+ goto free_counters; + goto free_counters;
+ } + }
+
for (i = sizeof(struct ipt_entry); for (i = sizeof(struct ipt_entry);
i < e->target_offset; 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);

View File

@ -76,11 +76,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
counters = alloc_counters(table); counters = alloc_counters(table);
if (IS_ERR(counters)) if (IS_ERR(counters))
@@ -850,6 +879,14 @@ copy_entries_to_user(unsigned int total_ @@ -851,6 +880,14 @@ copy_entries_to_user(unsigned int total_
ret = -EFAULT;
goto free_counters; goto free_counters;
} }
+
+ flags = e->ip.flags & IPT_F_MASK; + flags = e->ip.flags & IPT_F_MASK;
+ if (copy_to_user(userptr + off + if (copy_to_user(userptr + off
+ + offsetof(struct ipt_entry, ip.flags), + + offsetof(struct ipt_entry, ip.flags),
@ -88,6 +87,24 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+ ret = -EFAULT; + ret = -EFAULT;
+ goto free_counters; + goto free_counters;
+ } + }
+
for (i = sizeof(struct ipt_entry); for (i = sizeof(struct ipt_entry);
i < e->target_offset; 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);

View File

@ -31,7 +31,7 @@ Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
help help
--- a/init/main.c --- a/init/main.c
+++ b/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) { } static inline void smp_prepare_cpus(unsigned int maxcpus) { }
#endif #endif
@ -61,7 +61,7 @@ Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
/* /*
* We need to store the untouched command line for future reference. * We need to store the untouched command line for future reference.
* We also need to store the touched command line since the parameter * 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); pr_notice("%s", linux_banner);
setup_arch(&command_line); setup_arch(&command_line);
mm_init_cpumask(&init_mm); mm_init_cpumask(&init_mm);

View File

@ -35,6 +35,7 @@ nbg6817)
ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:amber:wifi5g" "phy0tpt" ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:amber:wifi5g" "phy0tpt"
ucidef_set_led_netdev "wan" "WAN" "$board:white:internet" "eth1" ucidef_set_led_netdev "wan" "WAN" "$board:white:internet" "eth1"
;; ;;
rt-acrh17 |\
rt-ac58u) rt-ac58u)
ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:blue:wlan2G" "phy0tpt" ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:blue:wlan2G" "phy0tpt"
ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:blue:wlan5G" "phy1tpt" ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:blue:wlan5G" "phy1tpt"

View File

@ -53,6 +53,7 @@ nbg6817)
ucidef_set_interface_macaddr "lan" "$hw_mac_addr" ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
ucidef_set_interface_macaddr "wan" "$(macaddr_add $hw_mac_addr 1)" ucidef_set_interface_macaddr "wan" "$(macaddr_add $hw_mac_addr 1)"
;; ;;
rt-acrh17 |\
rt-ac58u) rt-ac58u)
CI_UBIPART=UBI_DEV CI_UBIPART=UBI_DEV
wan_mac_addr=$(mtd_get_mac_binary_ubi Factory 20486) wan_mac_addr=$(mtd_get_mac_binary_ubi Factory 20486)

View File

@ -62,6 +62,7 @@ board=$(board_name)
case "$FIRMWARE" in case "$FIRMWARE" in
"ath10k/pre-cal-ahb-a000000.wifi.bin") "ath10k/pre-cal-ahb-a000000.wifi.bin")
case "$board" in case "$board" in
rt-acrh17 |\
rt-ac58u) rt-ac58u)
. /lib/upgrade/nand.sh . /lib/upgrade/nand.sh
@ -75,6 +76,7 @@ case "$FIRMWARE" in
;; ;;
"ath10k/pre-cal-ahb-a800000.wifi.bin") "ath10k/pre-cal-ahb-a800000.wifi.bin")
case "$board" in case "$board" in
rt-acrh17 |\
rt-ac58u) rt-ac58u)
. /lib/upgrade/nand.sh . /lib/upgrade/nand.sh

View File

@ -44,6 +44,9 @@ ipq806x_board_detect() {
*"R7800") *"R7800")
name="r7800" name="r7800"
;; ;;
*"RT-ACRH17")
name="rt-acrh17"
;;
*"RT-AC58U") *"RT-AC58U")
name="rt-ac58u" name="rt-ac58u"
;; ;;

View File

@ -8,6 +8,7 @@ platform_check_image() {
local board=$(board_name) local board=$(board_name)
case "$board" in case "$board" in
rt-acrh17 |\
rt-ac58u) rt-ac58u)
CI_UBIPART="UBI_DEV" CI_UBIPART="UBI_DEV"
local ubidev=$(nand_find_ubi $CI_UBIPART) local ubidev=$(nand_find_ubi $CI_UBIPART)

View File

@ -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 <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/soc/qcom,tcsr.h>
/ {
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 = <TCSR_USB_HSPHY_HOST_MODE>;
status = "ok";
};
ess_tcsr@1953000 {
compatible = "qcom,tcsr";
reg = <0x1953000 0x1000>;
qcom,ess-interface-select = <TCSR_ESS_PSGMII>;
};
tcsr@1949000 {
compatible = "qcom,tcsr";
reg = <0x1949000 0x100>;
qcom,wifi_glb_cfg = <TCSR_WIFI_GLB_CFG>;
};
tcsr@1957000 {
compatible = "qcom,tcsr";
reg = <0x1957000 0x100>;
qcom,wifi_noc_memtype_m0_m2 = <TCSR_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 = <KEY_RESTART>;
};
wps {
label = "wps";
gpios = <&tlmm 63 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
};
gpio-leds {
compatible = "gpio-leds";
power: status {
label = "rt-acrh17:blue:status";
gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>;
};
wan {
label = "rt-acrh17:blue:wan";
gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>;
};
wlan2G {
label = "rt-acrh17:blue:wlan2G";
gpios = <&tlmm 58 GPIO_ACTIVE_HIGH>;
};
wan5G {
label = "rt-acrh17:blue:wlan5G";
gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>;
};
usb {
label = "rt-acrh17:blue:usb";
gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>;
};
lan {
label = "rt-acrh17: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>;
};
};
};
};

View File

@ -0,0 +1,448 @@
#include "qcom-ipq8064-v1.0.dtsi"
#include <dt-bindings/input/input.h>
/ {
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 = <GSBI_PROT_I2C_UART>;
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 = <GSBI_PROT_SPI>;
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 = <KEY_RESTART>;
};
aoss {
label = "aoss";
gpios = <&qcom_pinmux 65 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RFKILL>;
};
};
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";
};

View File

@ -252,6 +252,24 @@ define Device/RT-AC58U
DEVICE_PACKAGES := kmod-usb-phy-qcom-ipq4019 ipq-wifi-rt-ac58u DEVICE_PACKAGES := kmod-usb-phy-qcom-ipq4019 ipq-wifi-rt-ac58u
endef 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-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
DEVICE_PACKAGES := kmod-usb-phy-qcom-ipq4019 ipq-wifi-rt-ac58u ath10k-firmware-qca9984
endef
define Device/NBG6817 define Device/NBG6817
DEVICE_DTS := qcom-ipq8065-nbg6817 DEVICE_DTS := qcom-ipq8065-nbg6817
KERNEL_SIZE := 4096k KERNEL_SIZE := 4096k
@ -293,8 +311,8 @@ define Device/AP-DK04.1-C1
endef endef
TARGET_DEVICES += AP148 AP148-legacy C2600 D7800 DB149 EA8500 FRITZ4040 R7500 \ 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: .NOTPARALLEL:
$(eval $(call BuildImage)) $(eval $(call BuildImage))

View File

@ -157,7 +157,7 @@ Signed-off-by: Adrian Panella <ianchi74@outlook.com>
} }
--- a/init/main.c --- a/init/main.c
+++ b/init/main.c +++ b/init/main.c
@@ -88,6 +88,10 @@ @@ -87,6 +87,10 @@
#include <asm/sections.h> #include <asm/sections.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
@ -168,7 +168,7 @@ Signed-off-by: Adrian Panella <ianchi74@outlook.com>
static int kernel_init(void *); static int kernel_init(void *);
extern void init_IRQ(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(); page_alloc_init();
pr_notice("Kernel command line: %s\n", boot_command_line); pr_notice("Kernel command line: %s\n", boot_command_line);

View File

@ -5,18 +5,19 @@ Subject: [PATCH 69/69] arm: boot: add dts files
Signed-off-by: John Crispin <john@phrozen.org> Signed-off-by: John Crispin <john@phrozen.org>
--- ---
arch/arm/boot/dts/Makefile | 8 ++++++++ arch/arm/boot/dts/Makefile | 9 ++++++++
1 file changed, 8 insertions(+) 1 file changed, 9 insertions(+)
--- a/arch/arm/boot/dts/Makefile --- a/arch/arm/boot/dts/Makefile
+++ b/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-apq8084-mtp.dtb \
qcom-ipq4019-ap.dk01.1-c1.dtb \ qcom-ipq4019-ap.dk01.1-c1.dtb \
qcom-ipq4019-ap.dk04.1-c1.dtb \ qcom-ipq4019-ap.dk04.1-c1.dtb \
+ qcom-ipq4019-fritz4040.dtb \ + qcom-ipq4019-fritz4040.dtb \
+ qcom-ipq4019-nbg6617.dtb \ + qcom-ipq4019-nbg6617.dtb \
+ qcom-ipq4019-rt-ac58u.dtb \ + qcom-ipq4019-rt-ac58u.dtb \
+ qcom-ipq4019-rt-acrh17.dtb \
qcom-ipq8064-ap148.dtb \ qcom-ipq8064-ap148.dtb \
+ qcom-ipq8064-c2600.dtb \ + qcom-ipq8064-c2600.dtb \
+ qcom-ipq8064-d7800.dtb \ + qcom-ipq8064-d7800.dtb \

View File

@ -962,7 +962,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
/* Rx descriptors helper methods */ /* Rx descriptors helper methods */
--- a/drivers/net/ethernet/marvell/mvpp2.c --- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/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; return err;
} }
@ -971,7 +971,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
mvpp2_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) mvpp2_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
{ {
struct mvpp2_port *port = netdev_priv(dev); 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_errors = dev->stats.rx_errors;
stats->rx_dropped = dev->stats.rx_dropped; stats->rx_dropped = dev->stats.rx_dropped;
stats->tx_dropped = dev->stats.tx_dropped; stats->tx_dropped = dev->stats.tx_dropped;

View File

@ -2887,7 +2887,7 @@
+ +
+ /* Display RX ring */ + /* Display RX ring */
+ priv->hw->desc->display_ring(head_rx, DMA_RX_SIZE, true); + priv->hw->desc->display_ring(head_rx, DMA_RX_SIZE, true);
+ } }
+} +}
+ +
+static void stmmac_display_tx_rings(struct stmmac_priv *priv) +static void stmmac_display_tx_rings(struct stmmac_priv *priv)
@ -2906,15 +2906,15 @@
+ head_tx = (void *)tx_q->dma_etx; + head_tx = (void *)tx_q->dma_etx;
+ else + else
+ head_tx = (void *)tx_q->dma_tx; + head_tx = (void *)tx_q->dma_tx;
+
+ priv->hw->desc->display_ring(head_tx, DMA_TX_SIZE, false);
}
+}
- /* Display Rx ring */ - /* Display Rx ring */
- priv->hw->desc->display_ring(head_rx, DMA_RX_SIZE, true); - priv->hw->desc->display_ring(head_rx, DMA_RX_SIZE, true);
- /* Display Tx ring */ - /* 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);
+ priv->hw->desc->display_ring(head_tx, DMA_TX_SIZE, false);
+ }
+}
+
+static void stmmac_display_rings(struct stmmac_priv *priv) +static void stmmac_display_rings(struct stmmac_priv *priv)
+{ +{
+ /* Display RX ring */ + /* Display RX ring */
@ -3131,7 +3131,7 @@
if (priv->hw->mode->set_16kib_bfsize) if (priv->hw->mode->set_16kib_bfsize)
bfsize = priv->hw->mode->set_16kib_bfsize(dev->mtu); 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; priv->dma_buf_sz = bfsize;
@ -3163,10 +3163,7 @@
+ p = &((rx_q->dma_erx + i)->basic); + p = &((rx_q->dma_erx + i)->basic);
+ else + else
+ p = rx_q->dma_rx + i; + 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, + ret = stmmac_init_rx_buffers(priv, p, i, flags,
+ queue); + queue);
+ if (ret) + if (ret)
@ -3176,15 +3173,18 @@
+ rx_q->rx_skbuff[i], rx_q->rx_skbuff[i]->data, + rx_q->rx_skbuff[i], rx_q->rx_skbuff[i]->data,
+ (unsigned int)rx_q->rx_skbuff_dma[i]); + (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->cur_rx = 0;
+ rx_q->dirty_rx = (unsigned int)(i - DMA_RX_SIZE); + 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", - netif_dbg(priv, probe, priv->dev, "[%p]\t[%p]\t[%x]\n",
- priv->rx_skbuff[i], priv->rx_skbuff[i]->data, - priv->rx_skbuff[i], priv->rx_skbuff[i]->data,
- (unsigned int)priv->rx_skbuff_dma[i]); - (unsigned int)priv->rx_skbuff_dma[i]);
+ stmmac_clear_rx_descriptors(priv, queue);
+
+ /* Setup the chained descriptor addresses */ + /* Setup the chained descriptor addresses */
+ if (priv->mode == STMMAC_CHAIN_MODE) { + if (priv->mode == STMMAC_CHAIN_MODE) {
+ if (priv->extend_desc) + if (priv->extend_desc)
@ -3277,13 +3277,8 @@
+ priv->hw->mode->init(tx_q->dma_tx, + priv->hw->mode->init(tx_q->dma_tx,
+ tx_q->dma_tx_phy, + tx_q->dma_tx_phy,
+ DMA_TX_SIZE, 0); + 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++) { + for (i = 0; i < DMA_TX_SIZE; i++) {
+ struct dma_desc *p; + struct dma_desc *p;
+ if (priv->extend_desc) + if (priv->extend_desc)
@ -3305,8 +3300,13 @@
+ tx_q->tx_skbuff_dma[i].len = 0; + tx_q->tx_skbuff_dma[i].len = 0;
+ tx_q->tx_skbuff_dma[i].last_segment = false; + tx_q->tx_skbuff_dma[i].last_segment = false;
+ tx_q->tx_skbuff[i] = NULL; + 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->dirty_tx = 0;
+ tx_q->cur_tx = 0; + tx_q->cur_tx = 0;
+ +
@ -3387,10 +3387,17 @@
- priv->tx_skbuff_dma[i].buf, - priv->tx_skbuff_dma[i].buf,
- priv->tx_skbuff_dma[i].len, - priv->tx_skbuff_dma[i].len,
- DMA_TO_DEVICE); - DMA_TO_DEVICE);
- }
+ for (i = 0; i < DMA_TX_SIZE; i++) + for (i = 0; i < DMA_TX_SIZE; i++)
+ stmmac_free_tx_buffer(priv, queue, 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 + * free_dma_rx_desc_resources - free RX dma desc resources
+ * @priv: private structure + * @priv: private structure
@ -3419,10 +3426,11 @@
+ +
+ kfree(rx_q->rx_skbuff_dma); + kfree(rx_q->rx_skbuff_dma);
+ kfree(rx_q->rx_skbuff); + kfree(rx_q->rx_skbuff);
+ } }
+} }
+
+/** /**
- * alloc_dma_desc_resources - alloc TX/RX resources.
+ * free_dma_tx_desc_resources - free TX dma desc resources + * free_dma_tx_desc_resources - free TX dma desc resources
+ * @priv: private structure + * @priv: private structure
+ */ + */
@ -3455,36 +3463,90 @@
+ +
+/** +/**
+ * alloc_dma_rx_desc_resources - alloc RX resources. + * alloc_dma_rx_desc_resources - alloc RX resources.
+ * @priv: private structure * @priv: private structure
+ * Description: according to which descriptor can be used (extend or basic) * Description: according to which descriptor can be used (extend or basic)
+ * this function allocates the resources for TX and RX paths. In case of * 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 * reception, for example, it pre-allocated the RX socket buffer in order to
+ * allow zero-copy mechanism. * 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) +static int alloc_dma_rx_desc_resources(struct stmmac_priv *priv)
+{ {
+ u32 rx_count = priv->plat->rx_queues_to_use; + u32 rx_count = priv->plat->rx_queues_to_use;
+ int ret = -ENOMEM; int ret = -ENOMEM;
+ u32 queue; + 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 */ + /* RX queues buffers and DMA */
+ for (queue = 0; queue < rx_count; queue++) { + for (queue = 0; queue < rx_count; queue++) {
+ struct stmmac_rx_queue *rx_q = &priv->rx_queue[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->queue_index = queue;
+ rx_q->priv_data = priv; + 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, + rx_q->rx_skbuff_dma = kmalloc_array(DMA_RX_SIZE,
+ sizeof(dma_addr_t), + 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) + if (!rx_q->rx_skbuff_dma)
+ return -ENOMEM; + 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, + rx_q->rx_skbuff = kmalloc_array(DMA_RX_SIZE,
+ sizeof(struct sk_buff *), + sizeof(struct sk_buff *),
+ GFP_KERNEL); + GFP_KERNEL);
+ if (!rx_q->rx_skbuff) + if (!rx_q->rx_skbuff)
+ goto err_dma; goto err_dma;
+ +
+ if (priv->extend_desc) { + if (priv->extend_desc) {
+ rx_q->dma_erx = dma_zalloc_coherent(priv->device, + rx_q->dma_erx = dma_zalloc_coherent(priv->device,
@ -3505,12 +3567,19 @@
+ GFP_KERNEL); + GFP_KERNEL);
+ if (!rx_q->dma_rx) + if (!rx_q->dma_rx)
+ goto err_dma; + goto err_dma;
+ } }
+ } }
+
+ return 0; return 0;
+
+err_dma: 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); + free_dma_rx_desc_resources(priv);
+ +
+ return ret; + return ret;
@ -3567,7 +3636,7 @@
+ GFP_KERNEL); + GFP_KERNEL);
+ if (!tx_q->dma_tx) + if (!tx_q->dma_tx)
+ goto err_dma_buffers; + goto err_dma_buffers;
} + }
+ } + }
+ +
+ return 0; + return 0;
@ -3575,9 +3644,9 @@
+err_dma_buffers: +err_dma_buffers:
+ free_dma_tx_desc_resources(priv); + free_dma_tx_desc_resources(priv);
+ +
+ return ret; return ret;
+} }
+
+/** +/**
+ * alloc_dma_desc_resources - alloc TX/RX resources. + * alloc_dma_desc_resources - alloc TX/RX resources.
+ * @priv: private structure + * @priv: private structure
@ -3603,176 +3672,7 @@
+ * free_dma_desc_resources - free dma desc resources + * free_dma_desc_resources - free dma desc resources
+ * @priv: private structure + * @priv: private structure
+ */ + */
+static void free_dma_desc_resources(struct stmmac_priv *priv) 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)
{ {
- /* Release the DMA TX/RX socket buffers */ - /* Release the DMA TX/RX socket buffers */
- dma_free_rx_skbufs(priv); - dma_free_rx_skbufs(priv);
@ -3798,6 +3698,99 @@
- kfree(priv->rx_skbuff); - kfree(priv->rx_skbuff);
- kfree(priv->tx_skbuff_dma); - kfree(priv->tx_skbuff_dma);
- kfree(priv->tx_skbuff); - 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 rx_channels_count = priv->plat->rx_queues_to_use;
+ u32 tx_channels_count = priv->plat->tx_queues_to_use; + u32 tx_channels_count = priv->plat->tx_queues_to_use;
+ u32 chan = 0; + u32 chan = 0;
@ -3807,38 +3800,23 @@
+ +
+ for (chan = 0; chan < tx_channels_count; chan++) + for (chan = 0; chan < tx_channels_count; chan++)
+ stmmac_start_tx_dma(priv, 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 + * stmmac_stop_all_dma - stop all RX and TX DMA channels
+ * @priv: driver private structure + * @priv: driver private structure
+ * Description: + * Description:
+ * This stops the RX and TX DMA channels + * 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) +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 rx_channels_count = priv->plat->rx_queues_to_use;
+ u32 tx_channels_count = priv->plat->tx_queues_to_use; + u32 tx_channels_count = priv->plat->tx_queues_to_use;
+ u32 chan = 0; + 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++) + for (chan = 0; chan < rx_channels_count; chan++)
+ stmmac_stop_rx_dma(priv, 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++) + for (chan = 0; chan < tx_channels_count; chan++)
+ stmmac_stop_tx_dma(priv, chan); + stmmac_stop_tx_dma(priv, chan);
} }

View File

@ -19,10 +19,11 @@ KERNELNAME:=bzImage
include $(INCLUDE_DIR)/target.mk 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 \ 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 \ 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)) $(eval $(call BuildTarget))

View File

@ -298,11 +298,13 @@ CONFIG_INTEL_MEI_WDT=y
# CONFIG_INTEL_MENLOW is not set # CONFIG_INTEL_MENLOW is not set
# CONFIG_INTEL_PCH_THERMAL is not set # CONFIG_INTEL_PCH_THERMAL is not set
# CONFIG_INTEL_PMC_IPC is not set # CONFIG_INTEL_PMC_IPC is not set
# CONFIG_INTEL_POWERCLAMP is not set CONFIG_INTEL_POWERCLAMP=y
# CONFIG_INTEL_SOC_DTS_THERMAL is not set CONFIG_INTEL_SOC_DTS_IOSF_CORE=y
CONFIG_INTEL_SOC_DTS_THERMAL=y
CONFIG_IOMMU_HELPER=y CONFIG_IOMMU_HELPER=y
# CONFIG_IOMMU_STRESS is not set # 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_0X80=y
# CONFIG_IO_DELAY_0XED is not set # CONFIG_IO_DELAY_0XED is not set
# CONFIG_IO_DELAY_NONE is not set # CONFIG_IO_DELAY_NONE is not set
@ -349,6 +351,15 @@ CONFIG_M586MMX=y
# CONFIG_MK6 is not set # CONFIG_MK6 is not set
# CONFIG_MK7 is not set # CONFIG_MK7 is not set
# CONFIG_MK8 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_MODIFY_LDT_SYSCALL is not set
CONFIG_MODULES_TREE_LOOKUP=y CONFIG_MODULES_TREE_LOOKUP=y
CONFIG_MODULES_USE_ELF_REL=y CONFIG_MODULES_USE_ELF_REL=y
@ -461,6 +472,7 @@ CONFIG_SCx200=y
CONFIG_SCx200HR_TIMER=y CONFIG_SCx200HR_TIMER=y
# CONFIG_SCx200_GPIO is not set # CONFIG_SCx200_GPIO is not set
# CONFIG_SCx200_WDT is not set # CONFIG_SCx200_WDT is not set
CONFIG_SDIO_UART=y
CONFIG_SENSORS_CORETEMP=y CONFIG_SENSORS_CORETEMP=y
CONFIG_SENSORS_FAM15H_POWER=y CONFIG_SENSORS_FAM15H_POWER=y
CONFIG_SENSORS_K10TEMP=y CONFIG_SENSORS_K10TEMP=y
@ -517,7 +529,9 @@ CONFIG_SYSCTL_EXCEPTION_TRACE=y
# CONFIG_TELCLOCK is not set # CONFIG_TELCLOCK is not set
CONFIG_THERMAL=y CONFIG_THERMAL=y
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y
CONFIG_THERMAL_GOV_STEP_WISE=y CONFIG_THERMAL_GOV_STEP_WISE=y
CONFIG_THERMAL_WRITABLE_TRIPS=y
CONFIG_THREAD_INFO_IN_TASK=y CONFIG_THREAD_INFO_IN_TASK=y
CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_TICK_CPU_ACCOUNTING=y
# CONFIG_TOSHIBA is not set # CONFIG_TOSHIBA is not set

View File

@ -21,6 +21,7 @@ include $(INCLUDE_DIR)/host-build.mk
define Host/Compile define Host/Compile
$(MAKE) -C $(HOST_BUILD_DIR)/squashfs-tools \ $(MAKE) -C $(HOST_BUILD_DIR)/squashfs-tools \
CC="$(HOSTCC)" \ CC="$(HOSTCC)" \
CFLAGS="$(HOST_CFLAGS) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I." \
CXX="$(CXX)" \ CXX="$(CXX)" \
LZMAPATH=$(STAGING_DIR_HOST)/lib \ LZMAPATH=$(STAGING_DIR_HOST)/lib \
mksquashfs-lzma unsquashfs-lzma mksquashfs-lzma unsquashfs-lzma