Merge Official Source

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2021-11-09 21:22:46 +08:00
commit c418a6b451
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
218 changed files with 1668 additions and 1899 deletions

View File

@ -114,6 +114,16 @@ config KERNEL_UBSAN_ALIGNMENT
Enabling this option on architectures that support unaligned
accesses may produce a lot of false positives.
config KERNEL_UBSAN_BOUNDS
bool "Perform array index bounds checking"
depends on KERNEL_UBSAN
help
This option enables detection of directly indexed out of bounds array
accesses, where the array size is known at compile time. Note that
this does not protect array overflows via bad calls to the
{str,mem}*cpy() family of functions (that is addressed by
FORTIFY_SOURCE).
config KERNEL_UBSAN_NULL
bool "Enable checking of null pointers"
depends on KERNEL_UBSAN
@ -121,6 +131,19 @@ config KERNEL_UBSAN_NULL
This option enables detection of memory accesses via a
null pointer.
config KERNEL_UBSAN_TRAP
bool "On Sanitizer warnings, abort the running kernel code"
depends on KERNEL_UBSAN
help
Building kernels with Sanitizer features enabled tends to grow the
kernel size by around 5%, due to adding all the debugging text on
failure paths. To avoid this, Sanitizer instrumentation can just
issue a trap. This reduces the kernel size overhead but turns all
warnings (including potentially harmless conditions) into full
exceptions that abort the running kernel code (regardless of context,
locks held, etc), which may destabilize the system. For some system
builders this is an acceptable trade-off.
config KERNEL_KASAN
bool "Compile the kernel with KASan: runtime memory debugger"
select KERNEL_SLUB_DEBUG
@ -147,6 +170,30 @@ config KERNEL_KASAN_EXTRA
compile time.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 has more
config KERNEL_KASAN_VMALLOC
bool "Back mappings in vmalloc space with real shadow memory"
depends on KERNEL_KASAN
help
By default, the shadow region for vmalloc space is the read-only
zero page. This means that KASAN cannot detect errors involving
vmalloc space.
Enabling this option will hook in to vmap/vmalloc and back those
mappings with real shadow memory allocated on demand. This allows
for KASAN to detect more sorts of errors (and to support vmapped
stacks), but at the cost of higher memory usage.
This option depends on HAVE_ARCH_KASAN_VMALLOC, but we can't
depend on that in here, so it is possible that enabling this
will have no effect.
if KERNEL_KASAN
config KERNEL_KASAN_GENERIC
def_bool y
config KERNEL_KASAN_SW_TAGS
def_bool n
endif
choice
prompt "Instrumentation type"

View File

@ -6,11 +6,11 @@ ifdef CONFIG_TESTING_KERNEL
KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
endif
LINUX_VERSION-5.4 = .155
LINUX_VERSION-5.10 = .76
LINUX_VERSION-5.4 = .158
LINUX_VERSION-5.10 = .78
LINUX_KERNEL_HASH-5.4.155 = cc0c0f902748d251cb22d0e69e3b8d260c447eb0072ef853da15da6cce775038
LINUX_KERNEL_HASH-5.10.76 = 480a09ba1962862ff18df9453fa0df6ba11cbe19eefedeab81bf2c84f49e1890
LINUX_KERNEL_HASH-5.4.158 = 6e018fecdc8fc24553756e582d83b82d65b10a6b03ef36262a24911f839b8d59
LINUX_KERNEL_HASH-5.10.78 = be806c98e222ea581530727a8e83b0b96fcd678afd12944eb530e58776a6050f
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))

View File

@ -26,14 +26,14 @@ include $(INCLUDE_DIR)/nls.mk
define Package/gdb/Default
SECTION:=devel
CATEGORY:=Development
DEPENDS:=+!USE_MUSL:libthread-db $(ICONV_DEPENDS) $(INTL_DEPENDS) +libgmp
DEPENDS:=+!USE_MUSL:libthread-db $(ICONV_DEPENDS) $(INTL_DEPENDS)
URL:=https://www.gnu.org/software/gdb/
endef
define Package/gdb
$(call Package/gdb/Default)
TITLE:=GNU Debugger
DEPENDS+=+libreadline +libncurses +zlib
DEPENDS+=+libreadline +libncurses +zlib +libgmp
endef
define Package/gdb/description
@ -62,7 +62,11 @@ CONFIGURE_ARGS+= \
--disable-ubsan \
--disable-sim \
--disable-werror \
--disable-source-highlight
--disable-source-highlight \
--without-mpc \
--without-mpfr \
--without-isl \
--with-libgmp-prefix=$(STAGING_DIR)/usr
CONFIGURE_VARS+= \
ac_cv_search_tgetent="$(TARGET_LDFLAGS) -lncurses -lreadline"

View File

@ -243,7 +243,7 @@ define KernelPackage/sound-soc-imx-sgtl5000
$(LINUX_DIR)/sound/soc/codecs/snd-soc-sgtl5000.ko \
$(LINUX_DIR)/sound/soc/fsl/snd-soc-imx-sgtl5000.ko
AUTOLOAD:=$(call AutoLoad,57,snd-soc-sgtl5000 snd-soc-imx-sgtl5000)
DEPENDS:=@TARGET_imx +kmod-sound-soc-imx
DEPENDS:=@TARGET_imx +kmod-sound-soc-imx +kmod-regmap-i2c
$(call AddDepends/sound)
endef

View File

@ -17,7 +17,7 @@ Link: https://lore.kernel.org/r/20211009212847.1781986-1-chunkeey@gmail.com
---
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -1094,6 +1094,8 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc,
@@ -1038,6 +1038,8 @@ int ath9k_init_device(u16 devid, struct
ARRAY_SIZE(ath9k_tpt_blink));
#endif
@ -26,4 +26,3 @@ Link: https://lore.kernel.org/r/20211009212847.1781986-1-chunkeey@gmail.com
/* Register with mac80211 */
error = ieee80211_register_hw(hw);
if (error)

View File

@ -1,6 +1,6 @@
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -1120,25 +1120,25 @@ static int __init ath9k_init(void)
@@ -1122,25 +1122,25 @@ static int __init ath9k_init(void)
{
int error;

View File

@ -84,9 +84,9 @@
int ath9k_init_device(u16 devid, struct ath_softc *sc,
const struct ath_bus_ops *bus_ops)
{
@@ -1037,6 +1050,8 @@ int ath9k_init_device(u16 devid, struct
ARRAY_SIZE(ath9k_tpt_blink));
#endif
@@ -1039,6 +1052,8 @@ int ath9k_init_device(u16 devid, struct
wiphy_read_of_freq_limits(hw->wiphy);
+ ath_get_initial_entropy(sc);
+

View File

@ -253,7 +253,7 @@
static int ath_ahb_probe(struct platform_device *pdev)
{
void __iomem *mem;
@@ -80,6 +324,17 @@ static int ath_ahb_probe(struct platform
@@ -80,6 +318,17 @@ static int ath_ahb_probe(struct platform
int ret = 0;
struct ath_hw *ah;
char hw_name[64];
@ -271,7 +271,7 @@
if (!dev_get_platdata(&pdev->dev)) {
dev_err(&pdev->dev, "no platform data specified\n");
@@ -122,13 +377,16 @@ static int ath_ahb_probe(struct platform
@@ -122,13 +371,16 @@ static int ath_ahb_probe(struct platform
sc->mem = mem;
sc->irq = irq;
@ -289,7 +289,7 @@
if (ret) {
dev_err(&pdev->dev, "failed to initialize device\n");
goto err_irq;
@@ -159,6 +417,9 @@ static int ath_ahb_remove(struct platfor
@@ -159,6 +411,9 @@ static int ath_ahb_remove(struct platfor
free_irq(sc->irq, sc);
ieee80211_free_hw(sc->hw);
}
@ -299,7 +299,7 @@
return 0;
}
@@ -168,6 +429,9 @@ static struct platform_driver ath_ahb_dr
@@ -168,6 +423,9 @@ static struct platform_driver ath_ahb_dr
.remove = ath_ahb_remove,
.driver = {
.name = "ath9k",

View File

@ -1,6 +1,6 @@
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -650,6 +650,12 @@ static int ath9k_of_init(struct ath_soft
@@ -644,6 +644,12 @@ static int ath9k_of_init(struct ath_soft
return 0;
}
@ -13,7 +13,7 @@
static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
const struct ath_bus_ops *bus_ops)
{
@@ -753,6 +759,9 @@ static int ath9k_init_softc(u16 devid, s
@@ -747,6 +753,9 @@ static int ath9k_init_softc(u16 devid, s
if (ret)
goto err_hw;

View File

@ -0,0 +1,154 @@
From dab16ef495dbb3cabb355b6c80f0771a4a25e35d Mon Sep 17 00:00:00 2001
From: Christian Lamparter <chunkeey@gmail.com>
Date: Fri, 20 Aug 2021 22:44:52 +0200
Subject: [PATCH] ath9k: fetch calibration data via nvmem subsystem
On most embedded ath9k devices (like range extenders,
routers, accesspoints, ...) the calibration data is
stored in a MTD partitions named "ART", or "caldata"/
"calibration".
Ever since commit
4b361cfa8624 ("mtd: core: add OTP nvmem provider support")
all MTD partitions are all automatically available through
the nvmem subsystem. This allows drivers like ath9k to read
the necessary data without needing any userspace helpers
that would do this extraction.
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
---
includes:
From 57671351379b2051cfb07fc14e0bead9916a0880 Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Mon, 11 Oct 2021 18:18:01 +0300
Subject: ath9k: fix an IS_ERR() vs NULL check
The devm_kmemdup() function doesn't return error pointers, it returns
NULL on error.
Fixes: eb3a97a69be8 ("ath9k: fetch calibration data via nvmem subsystem")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211011123533.GA15188@kili
---
--- a/drivers/net/wireless/ath/ath9k/eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom.c
@@ -135,13 +135,23 @@ static bool ath9k_hw_nvram_read_firmware
offset, data);
}
+static bool ath9k_hw_nvram_read_nvmem(struct ath_hw *ah, off_t offset,
+ u16 *data)
+{
+ return ath9k_hw_nvram_read_array(ah->nvmem_blob,
+ ah->nvmem_blob_len / sizeof(u16),
+ offset, data);
+}
+
bool ath9k_hw_nvram_read(struct ath_hw *ah, u32 off, u16 *data)
{
struct ath_common *common = ath9k_hw_common(ah);
struct ath9k_platform_data *pdata = ah->dev->platform_data;
bool ret;
- if (ah->eeprom_blob)
+ if (ah->nvmem_blob)
+ ret = ath9k_hw_nvram_read_nvmem(ah, off, data);
+ else if (ah->eeprom_blob)
ret = ath9k_hw_nvram_read_firmware(ah->eeprom_blob, off, data);
else if (pdata && !pdata->use_eeprom)
ret = ath9k_hw_nvram_read_pdata(pdata, off, data);
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -988,6 +988,8 @@ struct ath_hw {
bool disable_5ghz;
const struct firmware *eeprom_blob;
+ u16 *nvmem_blob; /* devres managed */
+ size_t nvmem_blob_len;
struct ath_dynack dynack;
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -22,6 +22,7 @@
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_net.h>
+#include <linux/nvmem-consumer.h>
#include <linux/relay.h>
#include <linux/dmi.h>
#include <net/ieee80211_radiotap.h>
@@ -568,6 +569,57 @@ static void ath9k_eeprom_release(struct
release_firmware(sc->sc_ah->eeprom_blob);
}
+static int ath9k_nvmem_request_eeprom(struct ath_softc *sc)
+{
+ struct ath_hw *ah = sc->sc_ah;
+ struct nvmem_cell *cell;
+ void *buf;
+ size_t len;
+ int err;
+
+ cell = devm_nvmem_cell_get(sc->dev, "calibration");
+ if (IS_ERR(cell)) {
+ err = PTR_ERR(cell);
+
+ /* nvmem cell might not be defined, or the nvmem
+ * subsystem isn't included. In this case, follow
+ * the established "just return 0;" convention of
+ * ath9k_init_platform to say:
+ * "All good. Nothing to see here. Please go on."
+ */
+ if (err == -ENOENT || err == -EOPNOTSUPP)
+ return 0;
+
+ return err;
+ }
+
+ buf = nvmem_cell_read(cell, &len);
+ if (IS_ERR(buf))
+ return PTR_ERR(buf);
+
+ /* run basic sanity checks on the returned nvram cell length.
+ * That length has to be a multiple of a "u16" (i.e.: & 1).
+ * Furthermore, it has to be more than "let's say" 512 bytes
+ * but less than the maximum of AR9300_EEPROM_SIZE (16kb).
+ */
+ if (((len & 1) == 1) || (len < 512) || (len >= AR9300_EEPROM_SIZE)) {
+ kfree(buf);
+ return -EINVAL;
+ }
+
+ /* devres manages the calibration values release on shutdown */
+ ah->nvmem_blob = (u16 *)devm_kmemdup(sc->dev, buf, len, GFP_KERNEL);
+ kfree(buf);
+ if (!ah->nvmem_blob)
+ return -ENOMEM;
+
+ ah->nvmem_blob_len = len;
+ ah->ah_flags &= ~AH_USE_EEPROM;
+ ah->ah_flags |= AH_NO_EEP_SWAP;
+
+ return 0;
+}
+
static int ath9k_init_platform(struct ath_softc *sc)
{
struct ath9k_platform_data *pdata = sc->dev->platform_data;
@@ -710,6 +762,10 @@ static int ath9k_init_softc(u16 devid, s
if (ret)
return ret;
+ ret = ath9k_nvmem_request_eeprom(sc);
+ if (ret)
+ return ret;
+
if (ath9k_led_active_high != -1)
ah->config.led_active_high = ath9k_led_active_high == 1;

View File

@ -0,0 +1,181 @@
From 9bf31835f11aa3c4fe5a9c1f7462c199c5d8e7ca Mon Sep 17 00:00:00 2001
From: Christian Lamparter <chunkeey@gmail.com>
Date: Sat, 21 Aug 2021 00:22:39 +0200
Subject: [PATCH] ath9k: owl-loader: fetch pci init values through nvmem
extends the owl loader to fetch important pci initialization
values - which are stored together with the calibration data -
through the nvmem subsystem.
This allows for much faster WIFI/ath9k initializations on devices
that do not require to perform any post-processing (like XOR'ing/
reversal or unpacking) since no userspace helper is required.
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
---
.../wireless/ath/ath9k/ath9k_pci_owl_loader.c | 105 +++++++++++++-----
1 file changed, 76 insertions(+), 29 deletions(-)
--- a/drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c
+++ b/drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c
@@ -19,9 +19,14 @@
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/ath9k_platform.h>
+#include <linux/nvmem-consumer.h>
+#include <linux/workqueue.h>
struct owl_ctx {
+ struct pci_dev *pdev;
struct completion eeprom_load;
+ struct work_struct work;
+ struct nvmem_cell *cell;
};
#define EEPROM_FILENAME_LEN 100
@@ -42,6 +47,12 @@ static int ath9k_pci_fixup(struct pci_de
u32 bar0;
bool swap_needed = false;
+ /* also note that we are doing *u16 operations on the file */
+ if (cal_len > 4096 || cal_len < 0x200 || (cal_len & 1) == 1) {
+ dev_err(&pdev->dev, "eeprom has an invalid size.\n");
+ return -EINVAL;
+ }
+
if (*cal_data != AR5416_EEPROM_MAGIC) {
if (*cal_data != swab16(AR5416_EEPROM_MAGIC)) {
dev_err(&pdev->dev, "invalid calibration data\n");
@@ -99,38 +110,31 @@ static int ath9k_pci_fixup(struct pci_de
return 0;
}
-static void owl_fw_cb(const struct firmware *fw, void *context)
+static void owl_rescan(struct pci_dev *pdev)
{
- struct pci_dev *pdev = (struct pci_dev *)context;
- struct owl_ctx *ctx = (struct owl_ctx *)pci_get_drvdata(pdev);
- struct pci_bus *bus;
-
- complete(&ctx->eeprom_load);
-
- if (!fw) {
- dev_err(&pdev->dev, "no eeprom data received.\n");
- goto release;
- }
-
- /* also note that we are doing *u16 operations on the file */
- if (fw->size > 4096 || fw->size < 0x200 || (fw->size & 1) == 1) {
- dev_err(&pdev->dev, "eeprom file has an invalid size.\n");
- goto release;
- }
-
- if (ath9k_pci_fixup(pdev, (const u16 *)fw->data, fw->size))
- goto release;
+ struct pci_bus *bus = pdev->bus;
pci_lock_rescan_remove();
- bus = pdev->bus;
pci_stop_and_remove_bus_device(pdev);
/* the device should come back with the proper
* ProductId. But we have to initiate a rescan.
*/
pci_rescan_bus(bus);
pci_unlock_rescan_remove();
+}
+
+static void owl_fw_cb(const struct firmware *fw, void *context)
+{
+ struct owl_ctx *ctx = (struct owl_ctx *)context;
+
+ complete(&ctx->eeprom_load);
-release:
+ if (fw) {
+ ath9k_pci_fixup(ctx->pdev, (const u16 *)fw->data, fw->size);
+ owl_rescan(ctx->pdev);
+ } else {
+ dev_err(&ctx->pdev->dev, "no eeprom data received.\n");
+ }
release_firmware(fw);
}
@@ -152,6 +156,43 @@ static const char *owl_get_eeprom_name(s
return eeprom_name;
}
+static void owl_nvmem_work(struct work_struct *work)
+{
+ struct owl_ctx *ctx = container_of(work, struct owl_ctx, work);
+ void *buf;
+ size_t len;
+
+ complete(&ctx->eeprom_load);
+
+ buf = nvmem_cell_read(ctx->cell, &len);
+ if (!IS_ERR(buf)) {
+ ath9k_pci_fixup(ctx->pdev, buf, len);
+ kfree(buf);
+ owl_rescan(ctx->pdev);
+ } else {
+ dev_err(&ctx->pdev->dev, "no nvmem data received.\n");
+ }
+}
+
+static int owl_nvmem_probe(struct owl_ctx *ctx)
+{
+ int err;
+
+ ctx->cell = devm_nvmem_cell_get(&ctx->pdev->dev, "calibration");
+ if (IS_ERR(ctx->cell)) {
+ err = PTR_ERR(ctx->cell);
+ if (err == -ENOENT || err == -EOPNOTSUPP)
+ return 1; /* not present, try firmware_request */
+
+ return err;
+ }
+
+ INIT_WORK(&ctx->work, owl_nvmem_work);
+ schedule_work(&ctx->work);
+
+ return 0;
+}
+
static int owl_probe(struct pci_dev *pdev,
const struct pci_device_id *id)
{
@@ -164,21 +205,27 @@ static int owl_probe(struct pci_dev *pde
pcim_pin_device(pdev);
- eeprom_name = owl_get_eeprom_name(pdev);
- if (!eeprom_name) {
- dev_err(&pdev->dev, "no eeprom filename found.\n");
- return -ENODEV;
- }
-
ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
if (!ctx)
return -ENOMEM;
init_completion(&ctx->eeprom_load);
+ ctx->pdev = pdev;
pci_set_drvdata(pdev, ctx);
+
+ err = owl_nvmem_probe(ctx);
+ if (err <= 0)
+ return err;
+
+ eeprom_name = owl_get_eeprom_name(pdev);
+ if (!eeprom_name) {
+ dev_err(&pdev->dev, "no eeprom filename found.\n");
+ return -ENODEV;
+ }
+
err = request_firmware_nowait(THIS_MODULE, true, eeprom_name,
- &pdev->dev, GFP_KERNEL, pdev, owl_fw_cb);
+ &pdev->dev, GFP_KERNEL, ctx, owl_fw_cb);
if (err)
dev_err(&pdev->dev, "failed to request caldata (%d).\n", err);

View File

@ -11,14 +11,15 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=qosify
PKG_SOURCE_URL=$(PROJECT_GIT)/project/qosify.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2021-11-01
PKG_SOURCE_VERSION:=52a57bf0e4eb2c6419be304981c5c94adb32d037
PKG_MIRROR_HASH:=11a5f2650cf9c4979455ca230eb9ceddb035e6914bda78cf75b8dd7ebaff65d3
PKG_SOURCE_DATE:=2021-11-08.1
PKG_SOURCE_VERSION:=3a420e272c187885120b964059abdf3e06f10199
PKG_MIRROR_HASH:=49a6bbb0801b790ce603aa8e3dfa73e681dc3f58fb9cbd524956bffe4c36eb7e
PKG_LICENSE:=GPL-2.0
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_BUILD_DEPENDS:=bpf-headers
PKG_FLAGS:=nonshared
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
@ -29,7 +30,7 @@ define Package/qosify
SECTION:=net
CATEGORY:=Network
TITLE:=A simple QoS solution based eBPF + CAKE
DEPENDS:=+libbpf +libubox +libubus +kmod-sched-cake +kmod-sched-bpf +tc-full $(BPF_DEPENDS)
DEPENDS:=+libbpf +libubox +libubus +kmod-sched-cake +kmod-sched-bpf +kmod-ifb +tc-full $(BPF_DEPENDS)
endef
define Build/Compile
@ -39,15 +40,15 @@ endef
define Package/qosify/conffiles
/etc/config/qosify
/etc/qosify-defaults.conf
/etc/qosify/00-defaults.conf
endef
define Package/qosify/install
$(INSTALL_DIR) $(1)/lib/bpf $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config $(1)/etc/hotplug.d/net
$(INSTALL_DIR) $(1)/lib/bpf $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config $(1)/etc/hotplug.d/net $(1)/etc/qosify
$(INSTALL_DATA) $(PKG_BUILD_DIR)/qosify-bpf.o $(1)/lib/bpf
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/qosify $(1)/usr/sbin/
$(INSTALL_BIN) ./files/qosify.init $(1)/etc/init.d/qosify
$(INSTALL_DATA) ./files/qosify-defaults.conf $(1)/etc/qosify-defaults.conf
$(INSTALL_DATA) ./files/qosify-defaults.conf $(1)/etc/qosify/00-defaults.conf
$(INSTALL_DATA) ./files/qosify.conf $(1)/etc/config/qosify
$(INSTALL_DATA) ./files/qosify.hotplug $(1)/etc/hotplug.d/net/10-qosify
endef

View File

@ -1,5 +1,5 @@
config defaults
list defaults /etc/qosify-defaults.conf
list defaults /etc/qosify/*.conf
option dscp_prio CS5
option dscp_icmp CS6
option dscp_bulk CS0

View File

@ -0,0 +1,270 @@
--- a/src/dnsmasq.h
+++ b/src/dnsmasq.h
@@ -1564,14 +1564,26 @@ void emit_dbus_signal(int action, struct
/* ubus.c */
#ifdef HAVE_UBUS
+struct blob_attr;
+typedef void (*ubus_dns_notify_cb)(struct blob_attr *msg, void *priv);
+
char *ubus_init(void);
void set_ubus_listeners(void);
void check_ubus_listeners(void);
+void drop_ubus_listeners(void);
+struct blob_buf *ubus_dns_notify_prepare(void);
+int ubus_dns_notify(const char *type, ubus_dns_notify_cb cb, void *priv);
void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name, const char *interface);
# ifdef HAVE_CONNTRACK
void ubus_event_bcast_connmark_allowlist_refused(u32 mark, const char *name);
void ubus_event_bcast_connmark_allowlist_resolved(u32 mark, const char *pattern, const char *ip, u32 ttl);
# endif
+#else
+struct blob_buf;
+static inline struct blob_buf *ubus_dns_notify_prepare(void)
+{
+ return NULL;
+}
#endif
/* ipset.c */
--- a/src/rfc1035.c
+++ b/src/rfc1035.c
@@ -13,8 +13,10 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
#include "dnsmasq.h"
+#ifdef HAVE_UBUS
+#include <libubox/blobmsg.h>
+#endif
int extract_name(struct dns_header *header, size_t plen, unsigned char **pp,
char *name, int isExtract, int extrabytes)
@@ -394,9 +396,64 @@ static int private_net6(struct in6_addr
((u32 *)a)[0] == htonl(0x20010db8); /* RFC 6303 4.6 */
}
+#ifdef HAVE_UBUS
+static void ubus_dns_doctor_cb(struct blob_attr *msg, void *priv)
+{
+ static const struct blobmsg_policy policy = {
+ .name = "address",
+ .type = BLOBMSG_TYPE_STRING,
+ };
+ struct blob_attr *val;
+ char **dest = priv;
+
+ blobmsg_parse(&policy, 1, &val, blobmsg_data(msg), blobmsg_data_len(msg));
+ if (val)
+ *dest = blobmsg_get_string(val);
+}
+
+static bool ubus_dns_doctor(const char *name, int ttl, void *p, int af)
+{
+ struct blob_buf *b;
+ char *addr;
+
+ if (!name)
+ return false;
+
+ b = ubus_dns_notify_prepare();
+ if (!b)
+ return false;
+
+ blobmsg_add_string(b, "name", name);
+
+ blobmsg_add_u32(b, "ttl", ttl);
+
+ blobmsg_add_string(b, "type", af == AF_INET6 ? "AAAA" : "A");
+
+ addr = blobmsg_alloc_string_buffer(b, "address", INET6_ADDRSTRLEN);
+ if (!addr)
+ return false;
+
+ inet_ntop(af, p, addr, INET6_ADDRSTRLEN);
+ blobmsg_add_string_buffer(b);
+
+ addr = NULL;
+ ubus_dns_notify("dns_result", ubus_dns_doctor_cb, &addr);
+
+ if (!addr)
+ return false;
+
+ return inet_pton(af, addr, p) == 1;
+}
+#else
+static bool ubus_dns_doctor(const char *name, int ttl, void *p, int af)
+{
+ return false;
+}
+#endif
+
static unsigned char *do_doctor(unsigned char *p, int count, struct dns_header *header, size_t qlen, int *doctored)
{
- int i, qtype, qclass, rdlen;
+ int i, qtype, qclass, rdlen, ttl;
for (i = count; i != 0; i--)
{
@@ -405,7 +462,7 @@ static unsigned char *do_doctor(unsigned
GETSHORT(qtype, p);
GETSHORT(qclass, p);
- p += 4; /* ttl */
+ GETLONG(ttl, p); /* ttl */
GETSHORT(rdlen, p);
if (qclass == C_IN && qtype == T_A)
@@ -416,6 +473,9 @@ static unsigned char *do_doctor(unsigned
if (!CHECK_LEN(header, p, qlen, INADDRSZ))
return 0;
+ if (ubus_dns_doctor(daemon->namebuff, ttl, p, AF_INET))
+ *doctored = 1;
+
/* alignment */
memcpy(&addr, p, INADDRSZ);
@@ -433,13 +493,22 @@ static unsigned char *do_doctor(unsigned
addr.s_addr &= ~doctor->mask.s_addr;
addr.s_addr |= (doctor->out.s_addr & doctor->mask.s_addr);
/* Since we munged the data, the server it came from is no longer authoritative */
- header->hb3 &= ~HB3_AA;
*doctored = 1;
memcpy(p, &addr, INADDRSZ);
break;
}
}
-
+ else if (qclass == C_IN && qtype == T_AAAA)
+ {
+ if (!CHECK_LEN(header, p, qlen, IN6ADDRSZ))
+ return 0;
+
+ if (ubus_dns_doctor(daemon->namebuff, ttl, p, AF_INET6))
+ *doctored = 1;
+ }
+
+ if (*doctored)
+ header->hb3 &= ~HB3_AA;
if (!ADD_RDLEN(header, p, qlen, rdlen))
return 0; /* bad packet */
}
@@ -563,7 +632,7 @@ int extract_addresses(struct dns_header
cache_start_insert();
/* find_soa is needed for dns_doctor side effects, so don't call it lazily if there are any. */
- if (daemon->doctors || option_bool(OPT_DNSSEC_VALID))
+ if (daemon->doctors || option_bool(OPT_DNSSEC_VALID) || ubus_dns_notify_prepare())
{
searched_soa = 1;
ttl = find_soa(header, qlen, doctored);
--- a/src/ubus.c
+++ b/src/ubus.c
@@ -72,6 +72,14 @@ static struct ubus_object ubus_object =
.subscribe_cb = ubus_subscribe_cb,
};
+static struct ubus_object_type ubus_dns_object_type =
+ { .name = "dnsmasq.dns" };
+
+static struct ubus_object ubus_dns_object = {
+ .name = "dnsmasq.dns",
+ .type = &ubus_dns_object_type,
+};
+
static void ubus_subscribe_cb(struct ubus_context *ctx, struct ubus_object *obj)
{
(void)ctx;
@@ -112,6 +120,8 @@ char *ubus_init()
ubus_object.name = daemon->ubus_name;
ret = ubus_add_object(ubus, &ubus_object);
+ if (!ret)
+ ret = ubus_add_object(ubus, &ubus_dns_object);
if (ret)
{
ubus_destroy(ubus);
@@ -181,6 +191,17 @@ void check_ubus_listeners()
} \
} while (0)
+void drop_ubus_listeners()
+{
+ struct ubus_context *ubus = (struct ubus_context *)daemon->ubus;
+
+ if (!ubus)
+ return;
+
+ ubus_free(ubus);
+ ubus = NULL;
+}
+
static int ubus_handle_metrics(struct ubus_context *ctx, struct ubus_object *obj,
struct ubus_request_data *req, const char *method,
struct blob_attr *msg)
@@ -328,6 +349,50 @@ fail:
} \
} while (0)
+struct blob_buf *ubus_dns_notify_prepare(void)
+{
+ struct ubus_context *ubus = (struct ubus_context *)daemon->ubus;
+
+ if (!ubus || !ubus_dns_object.has_subscribers)
+ return NULL;
+
+ blob_buf_init(&b, 0);
+ return &b;
+}
+
+struct ubus_dns_notify_req {
+ struct ubus_notify_request req;
+ ubus_dns_notify_cb cb;
+ void *priv;
+};
+
+static void dns_notify_cb(struct ubus_notify_request *req, int type, struct blob_attr *msg)
+{
+ struct ubus_dns_notify_req *dreq = container_of(req, struct ubus_dns_notify_req, req);
+
+ dreq->cb(msg, dreq->priv);
+}
+
+int ubus_dns_notify(const char *type, ubus_dns_notify_cb cb, void *priv)
+{
+ struct ubus_context *ubus = (struct ubus_context *)daemon->ubus;
+ struct ubus_dns_notify_req dreq;
+ int ret;
+
+ if (!ubus || !ubus_dns_object.has_subscribers)
+ return 0;
+
+ ret = ubus_notify_async(ubus, &ubus_dns_object, type, b.head, &dreq.req);
+ if (ret)
+ return ret;
+
+ dreq.req.data_cb = dns_notify_cb;
+ dreq.cb = cb;
+ dreq.priv = priv;
+
+ return ubus_complete_request(ubus, &dreq.req.req, 100);
+}
+
void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name, const char *interface)
{
struct ubus_context *ubus = (struct ubus_context *)daemon->ubus;
--- a/src/dnsmasq.c
+++ b/src/dnsmasq.c
@@ -1972,6 +1972,10 @@ static void check_dns_listeners(time_t n
daemon->pipe_to_parent = pipefd[1];
}
+#ifdef HAVE_UBUS
+ drop_ubus_listeners();
+#endif
+
/* start with no upstream connections. */
for (s = daemon->servers; s; s = s->next)
s->tcpfd = -1;

View File

@ -1,13 +1,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=uqmi
PKG_RELEASE:=3
PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/uqmi.git
PKG_SOURCE_DATE:=2020-11-22
PKG_SOURCE_VERSION:=0a19b5b77140465c29e2afa7d611fe93abc9672f
PKG_MIRROR_HASH:=0a6641f8e167efd21d464b0b2aeb1fec5f974dddcdb8822fbd5d7190d0b741b4
PKG_SOURCE_DATE:=2021-11-06
PKG_SOURCE_VERSION:=6f956265167945267d676c99f123a8c822f0a77b
PKG_MIRROR_HASH:=1dbe14a28ec59b364dbde5dea9e10ed1c5c3eda274b6c7690c793a06643acf3e
PKG_MAINTAINER:=Matti Laakso <malaakso@elisanet.fi>
PKG_LICENSE:=GPL-2.0

View File

@ -94,7 +94,8 @@ proto_qmi_setup() {
fi
done
if uqmi -s -d "$device" --get-pin-status | grep '"Not supported"\|"Invalid QMI command"' > /dev/null; then
if uqmi -s -d "$device" --uim-get-sim-state | grep -q '"Not supported"\|"Invalid QMI command"' &&
uqmi -s -d "$device" --get-pin-status | grep -q '"Not supported"\|"Invalid QMI command"' ; then
[ -n "$pincode" ] && {
uqmi -s -d "$device" --verify-pin1 "$pincode" > /dev/null || uqmi -s -d "$device" --uim-verify-pin1 "$pincode" > /dev/null || {
echo "Unable to verify PIN"
@ -105,7 +106,8 @@ proto_qmi_setup() {
}
else
. /usr/share/libubox/jshn.sh
json_load "$(uqmi -s -d "$device" --get-pin-status)"
json_load "$(uqmi -s -d "$device" --get-pin-status)" 2>&1 | grep -q Failed &&
json_load "$(uqmi -s -d "$device" --uim-get-sim-state)"
json_get_var pin1_status pin1_status
json_get_var pin1_verify_tries pin1_verify_tries
@ -144,7 +146,7 @@ proto_qmi_setup() {
echo "PIN already verified"
;;
*)
echo "PIN status failed ($pin1_status)"
echo "PIN status failed (${pin1_status:-sim_not_present})"
proto_notify_error "$interface" PIN_STATUS_FAILED
proto_block_restart "$interface"
return 1

View File

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=rpcd
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/rpcd.git
@ -84,6 +84,11 @@ define BuildPlugin
$(3)
endef
define Package/rpcd-mod-$(1)/postinst
#!/bin/sh
[ -n "$$$${IPKG_INSTROOT}" ] || /etc/init.d/rpcd reload
endef
define Package/rpcd-mod-$(1)/install
$(INSTALL_DIR) $$(1)/usr/lib/rpcd
$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(1).so $$(1)/usr/lib/rpcd/

View File

@ -46,12 +46,16 @@ ifeq ($(CONFIG_IB_STANDALONE),)
$(VERSION_SED_SCRIPT) $(PKG_BUILD_DIR)/repositories.conf
endif
ifeq ($(CONFIG_BUILDBOT),)
$(INSTALL_DIR) $(PKG_BUILD_DIR)/packages
# create an empty package index so `opkg` doesn't report an error
touch $(PKG_BUILD_DIR)/packages/Packages
$(INSTALL_DATA) ./files/README.md $(PKG_BUILD_DIR)/packages/
echo '' >> $(PKG_BUILD_DIR)/repositories.conf
echo '## This is the local package repository, do not remove!' >> $(PKG_BUILD_DIR)/repositories.conf
echo 'src imagebuilder file:packages' >> $(PKG_BUILD_DIR)/repositories.conf
ifeq ($(CONFIG_BUILDBOT),)
ifeq ($(CONFIG_IB_STANDALONE),)
$(FIND) $(call FeedPackageDir,libc) -type f \
\( -name 'libc_*.ipk' -or -name 'kernel_*.ipk' -or -name 'kmod-*.ipk' \) \

View File

@ -0,0 +1,11 @@
# ./packages folder
Add `.ipk` packages to this folder will allow the ImageBuilder to install them.
For more complex setups consider adding a custom feed containing packages.
src custom file:///path/to/packages
Whenever the ImageBuilder builds a firmware image this folder will be reloaded
and a new package index created. In case signature checks are enabled the
`./packages/Packages` index will be signed with a locally generated key pair.

View File

@ -10,7 +10,7 @@ BOARD:=archs38
BOARDNAME:=Synopsys DesignWare ARC HS38
SUBTARGETS:=generic
KERNEL_PATCHVER:=5.4
KERNEL_PATCHVER:=5.10
DEVICE_TYPE:=basic

View File

@ -0,0 +1,286 @@
# CONFIG_16KSTACKS is not set
CONFIG_ARC=y
CONFIG_ARCH_32BIT_OFF_T=y
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_ARCH_HAS_DMA_COHERENT_TO_PFN=y
CONFIG_ARCH_HAS_DMA_PREP_COHERENT=y
CONFIG_ARCH_HAS_PTE_SPECIAL=y
CONFIG_ARCH_HAS_SETUP_DMA_OPS=y
CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU=y
CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE=y
CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
CONFIG_ARC_BUILTIN_DTB_NAME=""
CONFIG_ARC_CACHE=y
CONFIG_ARC_CACHE_LINE_SHIFT=6
CONFIG_ARC_CACHE_PAGES=y
CONFIG_ARC_CPU_HS=y
CONFIG_ARC_CURR_IN_REG=y
CONFIG_ARC_DBG=y
# CONFIG_ARC_DBG_TLB_PARANOIA is not set
CONFIG_ARC_DW2_UNWIND=y
CONFIG_ARC_HAS_ACCL_REGS=y
CONFIG_ARC_HAS_DCACHE=y
# CONFIG_ARC_HAS_DCCM is not set
CONFIG_ARC_HAS_DIV_REM=y
CONFIG_ARC_HAS_ICACHE=y
# CONFIG_ARC_HAS_ICCM is not set
CONFIG_ARC_HAS_LL64=y
CONFIG_ARC_HAS_LLSC=y
# CONFIG_ARC_HAS_PAE40 is not set
CONFIG_ARC_HAS_SWAPE=y
CONFIG_ARC_IRQ_NO_AUTOSAVE=y
CONFIG_ARC_KVADDR_SIZE=256
CONFIG_ARC_MCIP=y
# CONFIG_ARC_METAWARE_HLINK is not set
CONFIG_ARC_MMU_V4=y
# CONFIG_ARC_PAGE_SIZE_16K is not set
# CONFIG_ARC_PAGE_SIZE_4K is not set
CONFIG_ARC_PAGE_SIZE_8K=y
CONFIG_ARC_PLAT_AXS10X=y
# CONFIG_ARC_PLAT_EZNPS is not set
# CONFIG_ARC_PLAT_TB10X is not set
# CONFIG_ARC_SMP_HALT_ON_RESET is not set
CONFIG_ARC_SOC_HSDK=y
CONFIG_ARC_TIMERS=y
CONFIG_ARC_TIMERS_64BIT=y
CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS=y
CONFIG_AXS103=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=4096
CONFIG_BLK_DEV_SD=y
CONFIG_BLK_SCSI_REQUEST=y
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
CONFIG_CC_DISABLE_WARN_MAYBE_UNINITIALIZED=y
CONFIG_CC_HAS_KASAN_GENERIC=y
CONFIG_CLKDEV_LOOKUP=y
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
CONFIG_CLK_HSDK=y
CONFIG_ARC_TUNE_MCPU=""
CONFIG_ARC_DSP_NONE=y
# CONFIG_ARC_FPU_SAVE_RESTORE is not set
# CONFIG_ARC_DSP_KERNEL is not set
# CONFIG_ARC_DSP_USERSPACE is not set
# CONFIG_ARC_DSP_AGU_USERSPACE is not set
# CONFIG_ARC_LPB_DISABLE is not set
# CONFIG_SPI_DW_DMA is not set
CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y
# CONFIG_HARDENED_USERCOPY is not set
CONFIG_CLONE_BACKWARDS=y
CONFIG_COMMON_CLK=y
CONFIG_COMPAT_32BIT_TIME=y
CONFIG_CPU_RMAP=y
CONFIG_CRC16=y
CONFIG_CRYPTO_AEAD=y
CONFIG_CRYPTO_AEAD2=y
CONFIG_CRYPTO_CRC32C=y
CONFIG_CRYPTO_DRBG=y
CONFIG_CRYPTO_DRBG_HMAC=y
CONFIG_CRYPTO_DRBG_MENU=y
CONFIG_CRYPTO_ECHAINIV=y
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_HMAC=y
CONFIG_CRYPTO_JITTERENTROPY=y
CONFIG_CRYPTO_LIB_SHA256=y
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_MANAGER2=y
CONFIG_CRYPTO_NULL=y
CONFIG_CRYPTO_NULL2=y
CONFIG_CRYPTO_RNG=y
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_RNG_DEFAULT=y
CONFIG_CRYPTO_SHA256=y
CONFIG_DEVTMPFS=y
CONFIG_DMADEVICES=y
CONFIG_DMA_DIRECT_REMAP=y
CONFIG_DMA_ENGINE=y
CONFIG_DMA_OF=y
CONFIG_DMA_REMAP=y
CONFIG_DMA_VIRTUAL_CHANNELS=y
CONFIG_DTC=y
CONFIG_DWMAC_ANARION=y
CONFIG_DWMAC_GENERIC=y
CONFIG_DW_APB_ICTL=y
CONFIG_DW_AXI_DMAC=y
CONFIG_EXT4_FS=y
# CONFIG_EZNPS_GIC is not set
CONFIG_FAT_FS=y
CONFIG_FB=y
CONFIG_FB_CMDLINE=y
CONFIG_FIXED_PHY=y
CONFIG_FS_IOMAP=y
CONFIG_FS_MBCACHE=y
CONFIG_FS_POSIX_ACL=y
CONFIG_FW_LOADER_PAGED_BUF=y
CONFIG_GENERIC_ALLOCATOR=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CSUM=y
CONFIG_GENERIC_FIND_FIRST_BIT=y
CONFIG_GENERIC_IRQ_CHIP=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_GENERIC_PENDING_IRQ=y
CONFIG_GENERIC_SCHED_CLOCK=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_GPIOLIB=y
CONFIG_GPIO_DWAPB=y
CONFIG_GPIO_GENERIC=y
CONFIG_GPIO_SNPS_CREG=y
CONFIG_GRACE_PERIOD=y
CONFIG_HANDLE_DOMAIN_IRQ=y
CONFIG_HAS_DMA=y
CONFIG_HAS_IOMEM=y
CONFIG_HAVE_ARCH_KGDB=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
CONFIG_HAVE_CLK=y
CONFIG_HAVE_CLK_PREPARE=y
CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
CONFIG_HAVE_FUTEX_CMPXCHG=y
CONFIG_HAVE_IOREMAP_PROT=y
CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
CONFIG_HAVE_NET_DSA=y
CONFIG_HAVE_OPROFILE=y
CONFIG_HAVE_PCI=y
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_HZ_PERIODIC=y
CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
CONFIG_IIO=y
CONFIG_IIO_BUFFER=y
CONFIG_IIO_KFIFO_BUF=y
CONFIG_IIO_ST_PRESS=y
CONFIG_IIO_ST_PRESS_I2C=y
CONFIG_IIO_ST_PRESS_SPI=y
CONFIG_IIO_ST_SENSORS_CORE=y
CONFIG_IIO_ST_SENSORS_I2C=y
CONFIG_IIO_ST_SENSORS_SPI=y
CONFIG_IIO_TRIGGER=y
CONFIG_IIO_TRIGGERED_BUFFER=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_IRQCHIP=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_WORK=y
# CONFIG_ISA_ARCOMPACT is not set
CONFIG_ISA_ARCV2=y
CONFIG_JBD2=y
CONFIG_KALLSYMS=y
CONFIG_KERNEL_GZIP=y
CONFIG_LIBFDT=y
CONFIG_LINUX_LINK_BASE=0x90000000
CONFIG_LINUX_RAM_BASE=0x80000000
CONFIG_LOCKD=y
CONFIG_LOCKUP_DETECTOR=y
CONFIG_LOCK_DEBUGGING_SUPPORT=y
CONFIG_LOCK_SPIN_ON_OWNER=y
CONFIG_MDIO_BUS=y
CONFIG_MDIO_DEVICE=y
CONFIG_MEMFD_CREATE=y
CONFIG_MFD_SYSCON=y
CONFIG_MICREL_PHY=y
CONFIG_MIGRATION=y
CONFIG_MMC=y
CONFIG_MMC_BLOCK=y
CONFIG_MMC_DW=y
# CONFIG_MMC_DW_BLUEFIELD is not set
# CONFIG_MMC_DW_EXYNOS is not set
# CONFIG_MMC_DW_HI3798CV200 is not set
# CONFIG_MMC_DW_K3 is not set
CONFIG_MMC_DW_PLTFM=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_PLTFM=y
CONFIG_MODULES_TREE_LOOKUP=y
CONFIG_MODULES_USE_ELF_RELA=y
CONFIG_MTD_SPI_NOR=y
CONFIG_MUTEX_SPIN_ON_OWNER=y
CONFIG_NAMESPACES=y
CONFIG_NATIONAL_PHY=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NET_FLOW_LIMIT=y
CONFIG_NET_NS=y
CONFIG_NET_PTP_CLASSIFY=y
CONFIG_NFS_ACL_SUPPORT=y
CONFIG_NFS_FS=y
CONFIG_NFS_V3_ACL=y
CONFIG_NLS=y
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y
CONFIG_NO_IOPORT_MAP=y
CONFIG_NR_CPUS=4
CONFIG_OF=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_EARLY_FLATTREE=y
CONFIG_OF_FLATTREE=y
CONFIG_OF_GPIO=y
CONFIG_OF_IRQ=y
CONFIG_OF_KOBJ=y
CONFIG_OF_MDIO=y
CONFIG_OF_NET=y
CONFIG_PADATA=y
CONFIG_PAGE_POOL=y
CONFIG_PGTABLE_LEVELS=2
CONFIG_PHYLIB=y
CONFIG_PHYLINK=y
CONFIG_PPS=y
CONFIG_PREEMPT=y
CONFIG_PREEMPTION=y
CONFIG_PREEMPT_COUNT=y
# CONFIG_PREEMPT_NONE is not set
CONFIG_PREEMPT_RCU=y
# CONFIG_PREVENT_FIRMWARE_BUILD is not set
CONFIG_PTP_1588_CLOCK=y
CONFIG_RATIONAL=y
CONFIG_REGMAP=y
CONFIG_REGMAP_I2C=y
CONFIG_REGMAP_MMIO=y
CONFIG_REGMAP_SPI=y
CONFIG_RESET_AXS10X=y
CONFIG_RESET_CONTROLLER=y
CONFIG_RESET_HSDK=y
CONFIG_RESET_SIMPLE=y
CONFIG_RFS_ACCEL=y
CONFIG_RPS=y
CONFIG_RWSEM_SPIN_ON_OWNER=y
CONFIG_SCSI=y
CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y
CONFIG_SERIAL_8250_DW=y
CONFIG_SERIAL_8250_DWLIB=y
CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
CONFIG_SERIAL_ARC=y
CONFIG_SERIAL_ARC_CONSOLE=y
CONFIG_SERIAL_ARC_NR_PORTS=1
CONFIG_SERIAL_MCTRL_GPIO=y
CONFIG_SERIAL_OF_PLATFORM=y
CONFIG_SG_POOL=y
CONFIG_SMP=y
CONFIG_SOFTLOCKUP_DETECTOR=y
CONFIG_SPI=y
CONFIG_SPI_DESIGNWARE=y
CONFIG_SPI_DW_MMIO=y
CONFIG_SPI_MASTER=y
CONFIG_SPI_MEM=y
CONFIG_SRCU=y
CONFIG_STACKTRACE=y
# CONFIG_STANDALONE is not set
CONFIG_STMMAC_ETH=y
CONFIG_STMMAC_PLATFORM=y
# CONFIG_STMMAC_SELFTESTS is not set
CONFIG_SUNRPC=y
CONFIG_SWPHY=y
CONFIG_TASKS_RCU=y
CONFIG_TICK_CPU_ACCOUNTING=y
CONFIG_TIMER_OF=y
CONFIG_TIMER_PROBE=y
CONFIG_TI_ADC108S102=y
CONFIG_TREE_SRCU=y
CONFIG_UNINLINE_SPIN_UNLOCK=y
CONFIG_USB_SUPPORT=y
# CONFIG_USER_NS is not set
CONFIG_VFAT_FS=y
CONFIG_WATCHDOG_CORE=y
CONFIG_XPS=y

View File

@ -27,14 +27,14 @@ define Device/nsim_hs
DEVICE_VENDOR := Synopsys
DEVICE_MODEL := nSIM HS
DEVICE_PROFILE := nsim_hs
DEVICE_DTS := nsim_hs_idu
DEVICE_DTS := haps_hs
endef
TARGET_DEVICES += nsim_hs
endif
# Root FS on SD-card
KERNEL_LOADADDR := 0x90000000
DEVICE_DTS_LIST:= axs103_idu nsim_hs_idu hsdk
DEVICE_DTS_LIST:= axs103_idu haps_hs hsdk
FAT32_BLOCK_SIZE=1024
FAT32_BLOCKS=$(shell echo $$(($(CONFIG_AXS10X_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE))))

View File

@ -153,7 +153,6 @@
compatible = "pci168c,0029";
reg = <0x8800 0 0 0 0>;
qca,no-eeprom;
#gpio-cells = <2>;
gpio-controller;
@ -181,7 +180,6 @@
compatible = "pci168c,0029";
reg = <0x9000 0 0 0 0>;
qca,no-eeprom;
#gpio-cells = <2>;
gpio-controller;
};

View File

@ -39,13 +39,13 @@
};
&ath9k0 {
nvmem-cells = <&macaddr_art_c>;
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_art_c>, <&cal_art_1000>;
nvmem-cell-names = "mac-address", "calibration";
};
&ath9k1 {
nvmem-cells = <&macaddr_art_0>;
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_art_0>, <&cal_art_5000>;
nvmem-cell-names = "mac-address", "calibration";
};
&eth0 {
@ -74,4 +74,12 @@
macaddr_art_c: macaddr@c {
reg = <0xc 0x6>;
};
cal_art_1000: cal@1000 {
reg = <0x1000 0xeb8>;
};
cal_art_5000: cal@5000 {
reg = <0x5000 0xeb8>;
};
};

View File

@ -39,13 +39,13 @@
};
&ath9k0 {
nvmem-cells = <&macaddr_art_c>;
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_art_c>, <&cal_art_1000>;
nvmem-cell-names = "mac-address", "calibration";
};
&ath9k1 {
nvmem-cells = <&macaddr_art_0>;
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_art_0>, <&cal_art_5000>;
nvmem-cell-names = "mac-address", "calibration";
/* The original WNDR3700(v1) variant have four antennae dedicated
* to the 5GHz radio as well. Again, two antennae are available for
@ -93,4 +93,12 @@
macaddr_art_c: macaddr@c {
reg = <0xc 0x6>;
};
cal_art_1000: cal@1000 {
reg = <0x1000 0xeb8>;
};
cal_art_5000: cal@5000 {
reg = <0x5000 0xeb8>;
};
};

View File

@ -40,13 +40,13 @@
};
&ath9k0 {
nvmem-cells = <&macaddr_art_c>;
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_art_c>, <&cal_art_1000>;
nvmem-cell-names = "mac-address", "calibration";
};
&ath9k1 {
nvmem-cells = <&macaddr_art_0>;
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_art_0>, <&cal_art_5000>;
nvmem-cell-names = "mac-address", "calibration";
};
&eth0 {
@ -75,4 +75,12 @@
macaddr_art_c: macaddr@c {
reg = <0xc 0x6>;
};
cal_art_1000: cal@1000 {
reg = <0x1000 0xeb8>;
};
cal_art_5000: cal@5000 {
reg = <0x5000 0xeb8>;
};
};

View File

@ -40,13 +40,13 @@
};
&ath9k0 {
nvmem-cells = <&macaddr_art_c>;
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_art_c>, <&cal_art_1000>;
nvmem-cell-names = "mac-address", "calibration";
};
&ath9k1 {
nvmem-cells = <&macaddr_art_0>;
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_art_0>, <&cal_art_5000>;
nvmem-cell-names = "mac-address", "calibration";
};
&eth0 {
@ -75,4 +75,12 @@
macaddr_art_c: macaddr@c {
reg = <0xc 0x6>;
};
cal_art_1000: cal@1000 {
reg = <0x1000 0xeb8>;
};
cal_art_5000: cal@5000 {
reg = <0x5000 0xeb8>;
};
};

View File

@ -39,13 +39,13 @@
};
&ath9k0 {
nvmem-cells = <&macaddr_art_c>;
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_art_c>, <&cal_art_1000>;
nvmem-cell-names = "mac-address", "calibration";
};
&ath9k1 {
nvmem-cells = <&macaddr_art_0>;
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_art_0>, <&cal_art_5000>;
nvmem-cell-names = "mac-address", "calibration";
};
&eth0 {
@ -74,4 +74,12 @@
macaddr_art_c: macaddr@c {
reg = <0xc 0x6>;
};
cal_art_1000: cal@1000 {
reg = <0x1000 0xeb8>;
};
cal_art_5000: cal@5000 {
reg = <0x5000 0xeb8>;
};
};

View File

@ -40,13 +40,13 @@
};
&ath9k0 {
nvmem-cells = <&macaddr_art_c>;
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_art_c>, <&cal_art_1000>;
nvmem-cell-names = "mac-address", "calibration";
};
&ath9k1 {
nvmem-cells = <&macaddr_art_0>;
nvmem-cell-names = "mac-address";
nvmem-cells = <&macaddr_art_0>, <&cal_art_5000>;
nvmem-cell-names = "mac-address", "calibration";
};
&eth0 {
@ -75,4 +75,12 @@
macaddr_art_c: macaddr@c {
reg = <0xc 0x6>;
};
cal_art_1000: cal@1000 {
reg = <0x1000 0xeb8>;
};
cal_art_5000: cal@5000 {
reg = <0x5000 0xeb8>;
};
};

View File

@ -146,13 +146,7 @@ case "$FIRMWARE" in
"ath9k-eeprom-pci-0000:00:11.0.bin")
case $board in
buffalo,wzr-600dhp|\
buffalo,wzr-hp-ag300h|\
netgear,wndr3700|\
netgear,wndr3700-v2|\
netgear,wndr3800|\
netgear,wndr3800ch|\
netgear,wndrmac-v1|\
netgear,wndrmac-v2)
buffalo,wzr-hp-ag300h)
caldata_extract "art" 0x1000 0xeb8
;;
dlink,dir-825-b1)
@ -170,13 +164,7 @@ case "$FIRMWARE" in
"ath9k-eeprom-pci-0000:00:12.0.bin")
case $board in
buffalo,wzr-600dhp|\
buffalo,wzr-hp-ag300h|\
netgear,wndr3700|\
netgear,wndr3700-v2|\
netgear,wndr3800|\
netgear,wndr3800ch|\
netgear,wndrmac-v1|\
netgear,wndrmac-v2)
buffalo,wzr-hp-ag300h)
caldata_extract "art" 0x5000 0xeb8
;;
dlink,dir-825-b1)

View File

@ -76,7 +76,7 @@ Signed-off-by: Christopher Blake <chrisrblake93@gmail.com>
#endif
--- a/arch/arm/include/asm/uaccess.h
+++ b/arch/arm/include/asm/uaccess.h
@@ -516,6 +516,9 @@ do { \
@@ -518,6 +518,9 @@ do { \
extern unsigned long __must_check
arm_copy_from_user(void *to, const void __user *from, unsigned long n);

View File

@ -81,7 +81,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
extern int usb_driver_set_configuration(struct usb_device *udev, int config);
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -384,6 +384,11 @@ struct hc_driver {
@@ -382,6 +382,11 @@ struct hc_driver {
* or bandwidth constraints.
*/
void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *);
@ -93,7 +93,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
/* Returns the hardware-chosen device address */
int (*address_device)(struct usb_hcd *, struct usb_device *udev);
/* prepares the hardware to send commands to the device */
@@ -445,6 +450,8 @@ extern void usb_hcd_unmap_urb_setup_for_
@@ -443,6 +448,8 @@ extern void usb_hcd_unmap_urb_setup_for_
extern void usb_hcd_unmap_urb_for_dma(struct usb_hcd *, struct urb *);
extern void usb_hcd_flush_endpoint(struct usb_device *udev,
struct usb_host_endpoint *ep);

View File

@ -15,7 +15,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1468,6 +1468,103 @@ command_cleanup:
@@ -1467,6 +1467,103 @@ command_cleanup:
}
/*
@ -119,7 +119,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
* non-error returns are a promise to giveback() the urb later
* we drop ownership so next owner (or urb unlink) can get it
*/
@@ -5367,6 +5464,7 @@ static const struct hc_driver xhci_hc_dr
@@ -5366,6 +5463,7 @@ static const struct hc_driver xhci_hc_dr
.endpoint_reset = xhci_endpoint_reset,
.check_bandwidth = xhci_check_bandwidth,
.reset_bandwidth = xhci_reset_bandwidth,

View File

@ -22,7 +22,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
#define MAX_TUNING_LOOP 40
@@ -3127,7 +3127,7 @@ static void sdhci_timeout_timer(struct t
@@ -3133,7 +3133,7 @@ static void sdhci_timeout_timer(struct t
spin_lock_irqsave(&host->lock, flags);
if (host->cmd && !sdhci_data_line_cmd(host->cmd)) {
@ -31,7 +31,7 @@ Signed-off-by: Maxime Ripard <maxime@cerno.tech>
mmc_hostname(host->mmc));
sdhci_dumpregs(host);
@@ -3149,7 +3149,7 @@ static void sdhci_timeout_data_timer(str
@@ -3155,7 +3155,7 @@ static void sdhci_timeout_data_timer(str
if (host->data || host->data_cmd ||
(host->cmd && sdhci_data_line_cmd(host->cmd))) {

View File

@ -27,7 +27,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -898,6 +898,7 @@ struct fw_header {
@@ -899,6 +899,7 @@ struct fw_header {
* struct fw_mac - a firmware block used by RTL_FW_PLA and RTL_FW_USB.
* The layout of the firmware block is:
* <struct fw_mac> + <info> + <firmware data>.
@ -35,7 +35,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
* @fw_offset: offset of the firmware binary data. The start address of
* the data would be the address of struct fw_mac + @fw_offset.
* @fw_reg: the register to load the firmware. Depends on chip.
@@ -911,6 +912,7 @@ struct fw_header {
@@ -912,6 +913,7 @@ struct fw_header {
* @bp_num: the break point number which needs to be set for this firmware.
* Depends on the firmware.
* @bp: break points. Depends on firmware.
@ -43,7 +43,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
* @fw_ver_reg: the register to store the fw version.
* @fw_ver_data: the firmware version of the current type.
* @info: additional information for debugging, and is followed by the
@@ -936,8 +938,10 @@ struct fw_mac {
@@ -937,8 +939,10 @@ struct fw_mac {
/**
* struct fw_phy_patch_key - a firmware block used by RTL_FW_PHY_START.
* This is used to set patch key when loading the firmware of PHY.
@ -54,7 +54,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
*/
struct fw_phy_patch_key {
struct fw_block blk_hdr;
@@ -950,6 +954,7 @@ struct fw_phy_patch_key {
@@ -951,6 +955,7 @@ struct fw_phy_patch_key {
* struct fw_phy_nc - a firmware block used by RTL_FW_PHY_NC.
* The layout of the firmware block is:
* <struct fw_phy_nc> + <info> + <firmware data>.
@ -62,7 +62,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
* @fw_offset: offset of the firmware binary data. The start address of
* the data would be the address of struct fw_phy_nc + @fw_offset.
* @fw_reg: the register to load the firmware. Depends on chip.
@@ -960,6 +965,7 @@ struct fw_phy_patch_key {
@@ -961,6 +966,7 @@ struct fw_phy_patch_key {
* @mode_reg: the regitster of switching the mode.
* @mod_pre: the mode needing to be set before loading the firmware.
* @mod_post: the mode to be set when finishing to load the firmware.

View File

@ -21,7 +21,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -963,8 +963,8 @@ struct fw_phy_patch_key {
@@ -964,8 +964,8 @@ struct fw_phy_patch_key {
* @patch_en_addr: the register of enabling patch mode. Depends on chip.
* @patch_en_value: patch mode enabled mask. Depends on the firmware.
* @mode_reg: the regitster of switching the mode.

View File

@ -40,7 +40,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
obj-$(CONFIG_USB_NET_SR9700) += sr9700.o
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -26,6 +26,7 @@
@@ -27,6 +27,7 @@
#include <linux/acpi.h>
#include <linux/firmware.h>
#include <crypto/hash.h>
@ -48,7 +48,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* Information for net-next */
#define NETNEXT_VERSION "11"
@@ -653,18 +654,6 @@ enum rtl_register_content {
@@ -654,18 +655,6 @@ enum rtl_register_content {
#define INTR_LINK 0x0004
@ -67,7 +67,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
#define RTL8153_MAX_PACKET 9216 /* 9K */
#define RTL8153_MAX_MTU (RTL8153_MAX_PACKET - VLAN_ETH_HLEN - \
ETH_FCS_LEN)
@@ -689,21 +678,9 @@ enum rtl8152_flags {
@@ -690,21 +679,9 @@ enum rtl8152_flags {
LENOVO_MACPASSTHRU,
};
@ -89,7 +89,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct tally_counter {
__le64 tx_packets;
__le64 rx_packets;
@@ -6602,7 +6579,7 @@ static int rtl_fw_init(struct r8152 *tp)
@@ -6625,7 +6602,7 @@ static int rtl_fw_init(struct r8152 *tp)
return 0;
}
@ -98,7 +98,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
{
struct usb_device *udev = interface_to_usbdev(intf);
u32 ocp_data = 0;
@@ -6660,12 +6637,13 @@ static u8 rtl_get_version(struct usb_int
@@ -6683,12 +6660,13 @@ static u8 rtl_get_version(struct usb_int
return version;
}

View File

@ -16,7 +16,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -2393,11 +2393,9 @@ static void tx_bottom(struct r8152 *tp)
@@ -2394,11 +2394,9 @@ static void tx_bottom(struct r8152 *tp)
} while (res == 0);
}
@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (test_bit(RTL8152_UNPLUG, &tp->flags))
return;
@@ -6695,7 +6693,7 @@ static int rtl8152_probe(struct usb_inte
@@ -6718,7 +6716,7 @@ static int rtl8152_probe(struct usb_inte
mutex_init(&tp->control);
INIT_DELAYED_WORK(&tp->schedule, rtl_work_func_t);
INIT_DELAYED_WORK(&tp->hw_phy_work, rtl_hw_phy_work_func_t);

View File

@ -25,7 +25,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -3443,59 +3443,76 @@ static void rtl_clear_bp(struct r8152 *t
@@ -3444,59 +3444,76 @@ static void rtl_clear_bp(struct r8152 *t
ocp_write_word(tp, type, PLA_BP_BA, 0);
}
@ -127,7 +127,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
ocp_write_word(tp, MCU_TYPE_PLA, PLA_OCP_GPHY_BASE, tp->ocp_base);
@@ -3980,7 +3997,7 @@ static void rtl8152_fw_mac_apply(struct
@@ -3981,7 +3998,7 @@ static void rtl8152_fw_mac_apply(struct
dev_dbg(&tp->intf->dev, "successfully applied %s\n", mac->info);
}
@ -136,7 +136,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
{
struct rtl_fw *rtl_fw = &tp->rtl_fw;
const struct firmware *fw;
@@ -4011,12 +4028,11 @@ static void rtl8152_apply_firmware(struc
@@ -4012,12 +4029,11 @@ static void rtl8152_apply_firmware(struc
case RTL_FW_PHY_START:
key = (struct fw_phy_patch_key *)block;
key_addr = __le16_to_cpu(key->key_reg);
@ -151,7 +151,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
break;
case RTL_FW_PHY_NC:
rtl8152_fw_phy_nc_apply(tp, (struct fw_phy_nc *)block);
@@ -4221,7 +4237,7 @@ static void rtl8152_disable(struct r8152
@@ -4222,7 +4238,7 @@ static void rtl8152_disable(struct r8152
static void r8152b_hw_phy_cfg(struct r8152 *tp)
{
@ -160,7 +160,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
rtl_eee_enable(tp, tp->eee_en);
r8152_aldps_en(tp, true);
r8152b_enable_fc(tp);
@@ -4503,7 +4519,7 @@ static void r8153_hw_phy_cfg(struct r815
@@ -4504,7 +4520,7 @@ static void r8153_hw_phy_cfg(struct r815
/* disable EEE before updating the PHY parameters */
rtl_eee_enable(tp, false);
@ -169,7 +169,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (tp->version == RTL_VER_03) {
data = ocp_reg_read(tp, OCP_EEE_CFG);
@@ -4577,7 +4593,7 @@ static void r8153b_hw_phy_cfg(struct r81
@@ -4578,7 +4594,7 @@ static void r8153b_hw_phy_cfg(struct r81
/* disable EEE before updating the PHY parameters */
rtl_eee_enable(tp, false);
@ -178,7 +178,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
r8153b_green_en(tp, test_bit(GREEN_ETHERNET, &tp->flags));
@@ -4618,7 +4634,7 @@ static void r8153b_hw_phy_cfg(struct r81
@@ -4619,7 +4635,7 @@ static void r8153b_hw_phy_cfg(struct r81
ocp_write_word(tp, MCU_TYPE_PLA, PLA_PHY_PWR, ocp_data);
/* Advnace EEE */
@ -187,7 +187,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
data = ocp_reg_read(tp, OCP_POWER_CFG);
data |= EEE_CLKDIV_EN;
ocp_reg_write(tp, OCP_POWER_CFG, data);
@@ -4635,7 +4651,7 @@ static void r8153b_hw_phy_cfg(struct r81
@@ -4636,7 +4652,7 @@ static void r8153b_hw_phy_cfg(struct r81
ocp_reg_write(tp, OCP_SYSCLK_CFG, clk_div_expo(5));
tp->ups_info._250m_ckdiv = true;

View File

@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -1371,6 +1371,10 @@ void write_mii_word(struct net_device *n
@@ -1372,6 +1372,10 @@ void write_mii_word(struct net_device *n
static int
r8152_submit_rx(struct r8152 *tp, struct rx_agg *agg, gfp_t mem_flags);
@ -31,7 +31,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
static int rtl8152_set_mac_address(struct net_device *netdev, void *p)
{
struct r8152 *tp = netdev_priv(netdev);
@@ -3182,8 +3186,6 @@ static void r8153b_ups_en(struct r8152 *
@@ -3183,8 +3187,6 @@ static void r8153b_ups_en(struct r8152 *
ocp_data |= BIT(0);
ocp_write_byte(tp, MCU_TYPE_USB, 0xcfff, ocp_data);
} else {
@ -40,7 +40,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
ocp_data &= ~(UPS_EN | USP_PREWAKE);
ocp_write_byte(tp, MCU_TYPE_USB, USB_POWER_CUT, ocp_data);
@@ -3191,31 +3193,20 @@ static void r8153b_ups_en(struct r8152 *
@@ -3192,31 +3194,20 @@ static void r8153b_ups_en(struct r8152 *
ocp_data &= ~BIT(0);
ocp_write_byte(tp, MCU_TYPE_USB, 0xcfff, ocp_data);
@ -83,7 +83,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
}
}
@@ -4587,13 +4578,37 @@ static void r8153b_hw_phy_cfg(struct r81
@@ -4588,13 +4579,37 @@ static void r8153b_hw_phy_cfg(struct r81
u32 ocp_data;
u16 data;
@ -122,7 +122,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
r8153b_green_en(tp, test_bit(GREEN_ETHERNET, &tp->flags));
@@ -5522,9 +5537,6 @@ static void r8153b_init(struct r8152 *tp
@@ -5543,9 +5558,6 @@ static void r8153b_init(struct r8152 *tp
/* MSC timer = 0xfff * 8ms = 32760 ms */
ocp_write_word(tp, MCU_TYPE_USB, USB_MSC_TIMER, 0x0fff);

View File

@ -16,7 +16,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -3335,7 +3335,7 @@ static void rtl8153b_runtime_enable(stru
@@ -3336,7 +3336,7 @@ static void rtl8153b_runtime_enable(stru
r8153b_ups_en(tp, false);
r8153_queue_wake(tp, false);
rtl_runtime_suspend_enable(tp, false);
@ -25,7 +25,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
r8153b_u1u2en(tp, true);
}
}
@@ -5028,7 +5028,7 @@ static void rtl8153b_up(struct r8152 *tp
@@ -5029,7 +5029,7 @@ static void rtl8153b_up(struct r8152 *tp
r8153_aldps_en(tp, true);
@ -34,7 +34,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
r8153b_u1u2en(tp, true);
}
@@ -5550,8 +5550,9 @@ static void r8153b_init(struct r8152 *tp
@@ -5571,8 +5571,9 @@ static void r8153b_init(struct r8152 *tp
ocp_data |= POLL_LINK_CHG;
ocp_write_word(tp, MCU_TYPE_PLA, PLA_EXTRA_STATUS, ocp_data);

View File

@ -15,7 +15,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -5735,6 +5735,9 @@ static int rtl8152_runtime_suspend(struc
@@ -5758,6 +5758,9 @@ static int rtl8152_runtime_suspend(struc
struct net_device *netdev = tp->netdev;
int ret = 0;
@ -25,7 +25,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
set_bit(SELECTIVE_SUSPEND, &tp->flags);
smp_mb__after_atomic();
@@ -6134,6 +6137,11 @@ rtl_ethtool_get_eee(struct net_device *n
@@ -6157,6 +6160,11 @@ rtl_ethtool_get_eee(struct net_device *n
struct r8152 *tp = netdev_priv(net);
int ret;
@ -37,7 +37,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
ret = usb_autopm_get_interface(tp->intf);
if (ret < 0)
goto out;
@@ -6156,6 +6164,11 @@ rtl_ethtool_set_eee(struct net_device *n
@@ -6179,6 +6187,11 @@ rtl_ethtool_set_eee(struct net_device *n
struct r8152 *tp = netdev_priv(net);
int ret;

View File

@ -16,7 +16,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -6571,7 +6571,7 @@ static int rtl_ops_init(struct r8152 *tp
@@ -6594,7 +6594,7 @@ static int rtl_ops_init(struct r8152 *tp
default:
ret = -ENODEV;
@ -25,7 +25,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
break;
}
@@ -6828,7 +6828,7 @@ static int rtl8152_probe(struct usb_inte
@@ -6851,7 +6851,7 @@ static int rtl8152_probe(struct usb_inte
ret = register_netdev(netdev);
if (ret != 0) {

View File

@ -15,7 +15,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -2632,21 +2632,24 @@ static inline u8 rtl8152_get_speed(struc
@@ -2633,21 +2633,24 @@ static inline u8 rtl8152_get_speed(struc
return ocp_read_byte(tp, MCU_TYPE_PLA, PLA_PHYSTATUS);
}
@ -50,7 +50,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
static void rxdy_gated_en(struct r8152 *tp, bool enable)
@@ -3127,10 +3130,22 @@ static void r8153b_ups_flags(struct r815
@@ -3128,10 +3131,22 @@ static void r8153b_ups_flags(struct r815
ocp_write_dword(tp, MCU_TYPE_USB, USB_UPS_FLAGS, ups_flags);
}
@ -74,7 +74,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (enable) {
sram_write(tp, 0x8045, 0); /* 10M abiq&ldvbias */
sram_write(tp, 0x804d, 0x1222); /* 100M short abiq&ldvbias */
@@ -3141,11 +3156,7 @@ static void r8153b_green_en(struct r8152
@@ -3142,11 +3157,7 @@ static void r8153b_green_en(struct r8152
sram_write(tp, 0x805d, 0x2444); /* 1000M short abiq&ldvbias */
}

View File

@ -24,7 +24,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -249,6 +249,9 @@
@@ -250,6 +250,9 @@
/* PLA_TCR1 */
#define VERSION_MASK 0x7cf0
@ -34,7 +34,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* PLA_MTPS */
#define MTPS_JUMBO (12 * 1024 / 64)
@@ -2747,6 +2750,29 @@ static int rtl_stop_rx(struct r8152 *tp)
@@ -2748,6 +2751,29 @@ static int rtl_stop_rx(struct r8152 *tp)
return 0;
}
@ -64,7 +64,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static inline void r8153b_rx_agg_chg_indicate(struct r8152 *tp)
{
ocp_write_byte(tp, MCU_TYPE_USB, USB_UPT_RXDMA_OWN,
@@ -2850,6 +2876,8 @@ static int rtl8153_enable(struct r8152 *
@@ -2851,6 +2877,8 @@ static int rtl8153_enable(struct r8152 *
r8153_set_rx_early_timeout(tp);
r8153_set_rx_early_size(tp);

View File

@ -15,7 +15,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -874,6 +874,14 @@ struct fw_header {
@@ -875,6 +875,14 @@ struct fw_header {
struct fw_block blocks[];
} __packed;
@ -30,7 +30,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/**
* struct fw_mac - a firmware block used by RTL_FW_PLA and RTL_FW_USB.
* The layout of the firmware block is:
@@ -3800,10 +3808,7 @@ static long rtl8152_check_firmware(struc
@@ -3801,10 +3809,7 @@ static long rtl8152_check_firmware(struc
{
const struct firmware *fw = rtl_fw->fw;
struct fw_header *fw_hdr = (struct fw_header *)fw->data;
@ -42,7 +42,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
long ret = -EFAULT;
int i;
@@ -3832,50 +3837,52 @@ static long rtl8152_check_firmware(struc
@@ -3833,50 +3838,52 @@ static long rtl8152_check_firmware(struc
goto fail;
goto fw_end;
case RTL_FW_PLA:
@ -106,7 +106,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
dev_err(&tp->intf->dev,
"Check PHY_STOP fail\n");
goto fail;
@@ -3886,28 +3893,28 @@ static long rtl8152_check_firmware(struc
@@ -3887,28 +3894,28 @@ static long rtl8152_check_firmware(struc
"Invalid length for PHY_STOP\n");
goto fail;
}
@ -141,7 +141,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
break;
default:
@@ -3921,7 +3928,7 @@ static long rtl8152_check_firmware(struc
@@ -3922,7 +3929,7 @@ static long rtl8152_check_firmware(struc
}
fw_end:

View File

@ -20,7 +20,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -657,15 +657,13 @@ enum rtl_register_content {
@@ -658,15 +658,13 @@ enum rtl_register_content {
#define INTR_LINK 0x0004
@ -39,7 +39,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* rtl8152 flags */
enum rtl8152_flags {
@@ -795,6 +793,7 @@ struct r8152 {
@@ -796,6 +794,7 @@ struct r8152 {
bool (*in_nway)(struct r8152 *tp);
void (*hw_phy_cfg)(struct r8152 *tp);
void (*autosuspend_en)(struct r8152 *tp, bool enable);
@ -47,7 +47,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
} rtl_ops;
struct ups_info {
@@ -1021,8 +1020,7 @@ enum tx_csum_stat {
@@ -1022,8 +1021,7 @@ enum tx_csum_stat {
static const int multicast_filter_limit = 32;
static unsigned int agg_buf_sz = 16384;
@ -57,7 +57,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static
int get_registers(struct r8152 *tp, u16 value, u16 index, u16 size, void *data)
@@ -2632,10 +2630,7 @@ static void rtl8152_nic_reset(struct r81
@@ -2633,10 +2631,7 @@ static void rtl8152_nic_reset(struct r81
static void set_tx_qlen(struct r8152 *tp)
{
@ -69,7 +69,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
static inline u8 rtl8152_get_speed(struct r8152 *tp)
@@ -4724,6 +4719,12 @@ static void r8153b_hw_phy_cfg(struct r81
@@ -4725,6 +4720,12 @@ static void r8153b_hw_phy_cfg(struct r81
set_bit(PHY_RESET, &tp->flags);
}
@ -82,7 +82,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static void r8153_first_init(struct r8152 *tp)
{
u32 ocp_data;
@@ -4756,9 +4757,7 @@ static void r8153_first_init(struct r815
@@ -4757,9 +4758,7 @@ static void r8153_first_init(struct r815
rtl_rx_vlan_en(tp, tp->netdev->features & NETIF_F_HW_VLAN_CTAG_RX);
@ -93,7 +93,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_TCR0);
ocp_data |= TCR0_AUTO_FIFO;
@@ -4793,8 +4792,7 @@ static void r8153_enter_oob(struct r8152
@@ -4794,8 +4793,7 @@ static void r8153_enter_oob(struct r8152
wait_oob_link_list_ready(tp);
@ -103,7 +103,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
switch (tp->version) {
case RTL_VER_03:
@@ -6495,12 +6493,21 @@ static int rtl8152_change_mtu(struct net
@@ -6518,12 +6516,21 @@ static int rtl8152_change_mtu(struct net
dev->mtu = new_mtu;
if (netif_running(dev)) {
@ -130,7 +130,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
mutex_unlock(&tp->control);
@@ -6589,6 +6596,7 @@ static int rtl_ops_init(struct r8152 *tp
@@ -6612,6 +6619,7 @@ static int rtl_ops_init(struct r8152 *tp
ops->in_nway = rtl8153_in_nway;
ops->hw_phy_cfg = r8153_hw_phy_cfg;
ops->autosuspend_en = rtl8153_runtime_enable;
@ -138,7 +138,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (tp->udev->speed < USB_SPEED_SUPER)
tp->rx_buf_sz = 16 * 1024;
else
@@ -6610,6 +6618,7 @@ static int rtl_ops_init(struct r8152 *tp
@@ -6633,6 +6641,7 @@ static int rtl_ops_init(struct r8152 *tp
ops->in_nway = rtl8153_in_nway;
ops->hw_phy_cfg = r8153b_hw_phy_cfg;
ops->autosuspend_en = rtl8153b_runtime_enable;
@ -146,7 +146,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
tp->rx_buf_sz = 32 * 1024;
tp->eee_en = true;
tp->eee_adv = MDIO_EEE_1000T | MDIO_EEE_100TX;
@@ -6830,7 +6839,7 @@ static int rtl8152_probe(struct usb_inte
@@ -6853,7 +6862,7 @@ static int rtl8152_probe(struct usb_inte
netdev->max_mtu = ETH_DATA_LEN;
break;
default:

View File

@ -16,7 +16,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -43,10 +43,14 @@
@@ -44,10 +44,14 @@
#define PLA_IDR 0xc000
#define PLA_RCR 0xc010
@ -31,7 +31,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#define PLA_DMY_REG0 0xc0b0
#define PLA_FMC 0xc0b4
#define PLA_CFG_WOL 0xc0b6
@@ -63,6 +67,8 @@
@@ -64,6 +68,8 @@
#define PLA_MACDBG_PRE 0xd38c /* RTL_VER_04 only */
#define PLA_MACDBG_POST 0xd38e /* RTL_VER_04 only */
#define PLA_EXTRA_STATUS 0xd398
@ -40,7 +40,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#define PLA_EFUSE_DATA 0xdd00
#define PLA_EFUSE_CMD 0xdd02
#define PLA_LEDSEL 0xdd90
@@ -72,6 +78,8 @@
@@ -73,6 +79,8 @@
#define PLA_LWAKE_CTRL_REG 0xe007
#define PLA_GPHY_INTR_IMR 0xe022
#define PLA_EEE_CR 0xe040
@ -49,7 +49,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#define PLA_EEEP_CR 0xe080
#define PLA_MAC_PWR_CTRL 0xe0c0
#define PLA_MAC_PWR_CTRL2 0xe0ca
@@ -82,6 +90,7 @@
@@ -83,6 +91,7 @@
#define PLA_TCR1 0xe612
#define PLA_MTPS 0xe615
#define PLA_TXFIFO_CTRL 0xe618
@ -57,7 +57,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#define PLA_RSTTALLY 0xe800
#define PLA_CR 0xe813
#define PLA_CRWECR 0xe81c
@@ -98,6 +107,7 @@
@@ -99,6 +108,7 @@
#define PLA_SFF_STS_7 0xe8de
#define PLA_PHYSTATUS 0xe908
#define PLA_CONFIG6 0xe90a /* CONFIG6 */
@ -65,7 +65,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#define PLA_BP_BA 0xfc26
#define PLA_BP_0 0xfc28
#define PLA_BP_1 0xfc2a
@@ -112,6 +122,7 @@
@@ -113,6 +123,7 @@
#define USB_USB2PHY 0xb41e
#define USB_SSPHYLINK1 0xb426
#define USB_SSPHYLINK2 0xb428
@ -73,7 +73,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#define USB_U2P3_CTRL 0xb460
#define USB_CSR_DUMMY1 0xb464
#define USB_CSR_DUMMY2 0xb466
@@ -122,7 +133,12 @@
@@ -123,7 +134,12 @@
#define USB_FW_FIX_EN0 0xcfca
#define USB_FW_FIX_EN1 0xcfcc
#define USB_LPM_CONFIG 0xcfd8
@ -86,7 +86,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#define USB_FW_CTRL 0xd334 /* RTL8153B */
#define USB_FC_TIMER 0xd340
#define USB_USB_CTRL 0xd406
@@ -136,16 +152,20 @@
@@ -137,16 +153,20 @@
#define USB_RX_EXTRA_AGGR_TMR 0xd432 /* RTL8153B */
#define USB_TX_DMA 0xd434
#define USB_UPT_RXDMA_OWN 0xd437
@ -107,7 +107,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#define USB_UPS_CFG 0xd842
#define USB_UPS_FLAGS 0xd848
#define USB_WDT1_CTRL 0xe404
@@ -188,6 +208,9 @@
@@ -189,6 +209,9 @@
#define OCP_EEE_ABLE 0xa5c4
#define OCP_EEE_ADV 0xa5d0
#define OCP_EEE_LPABLE 0xa5d2
@ -117,7 +117,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#define OCP_PHY_STATE 0xa708 /* nway state for 8153 */
#define OCP_PHY_PATCH_STAT 0xb800
#define OCP_PHY_PATCH_CMD 0xb820
@@ -199,6 +222,7 @@
@@ -200,6 +223,7 @@
/* SRAM Register */
#define SRAM_GREEN_CFG 0x8011
#define SRAM_LPF_CFG 0x8012
@ -125,7 +125,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#define SRAM_10M_AMP1 0x8080
#define SRAM_10M_AMP2 0x8082
#define SRAM_IMPEDANCE 0x8084
@@ -210,11 +234,19 @@
@@ -211,11 +235,19 @@
#define RCR_AM 0x00000004
#define RCR_AB 0x00000008
#define RCR_ACPT_ALL (RCR_AAP | RCR_APM | RCR_AM | RCR_AB)
@ -145,7 +145,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* PLA_RXFIFO_CTRL1 */
#define RXFIFO_THR2_FULL 0x00000060
#define RXFIFO_THR2_HIGH 0x00000038
@@ -285,6 +317,7 @@
@@ -286,6 +318,7 @@
#define MCU_BORW_EN 0x4000
/* PLA_CPCR */
@ -153,7 +153,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#define CPCR_RX_VLAN 0x0040
/* PLA_CFG_WOL */
@@ -310,6 +343,10 @@
@@ -311,6 +344,10 @@
/* PLA_CONFIG6 */
#define LANWAKE_CLR_EN BIT(0)
@ -164,7 +164,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* PLA_CONFIG5 */
#define BWF_EN 0x0040
#define MWF_EN 0x0020
@@ -333,6 +370,7 @@
@@ -334,6 +371,7 @@
/* PLA_MAC_PWR_CTRL2 */
#define EEE_SPDWN_RATIO 0x8007
#define MAC_CLK_SPDWN_EN BIT(15)
@ -172,7 +172,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* PLA_MAC_PWR_CTRL3 */
#define PLA_MCU_SPDWN_EN BIT(14)
@@ -345,6 +383,7 @@
@@ -346,6 +384,7 @@
#define PWRSAVE_SPDWN_EN 0x1000
#define RXDV_SPDWN_EN 0x0800
#define TX10MIDLE_EN 0x0100
@ -180,7 +180,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#define TP100_SPDWN_EN 0x0020
#define TP500_SPDWN_EN 0x0010
#define TP1000_SPDWN_EN 0x0008
@@ -385,6 +424,13 @@
@@ -386,6 +425,13 @@
#define LINK_CHANGE_FLAG BIT(8)
#define POLL_LINK_CHG BIT(0)
@ -194,7 +194,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* USB_USB2PHY */
#define USB2PHY_SUSPEND 0x0001
#define USB2PHY_L1 0x0002
@@ -433,6 +479,9 @@
@@ -434,6 +480,9 @@
#define BMU_RESET_EP_IN 0x01
#define BMU_RESET_EP_OUT 0x02
@ -204,7 +204,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* USB_UPT_RXDMA_OWN */
#define OWN_UPDATE BIT(0)
#define OWN_CLEAR BIT(1)
@@ -440,27 +489,52 @@
@@ -441,27 +490,52 @@
/* USB_FW_TASK */
#define FC_PATCH_TASK BIT(1)
@ -257,7 +257,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* USB_POWER_CUT */
#define PWR_EN 0x0001
@@ -496,8 +570,12 @@
@@ -497,8 +571,12 @@
#define SEN_VAL_NORMAL 0xa000
#define SEL_RXIDLE 0x0100
@ -270,7 +270,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* USB_UPS_FLAGS */
#define UPS_FLAGS_R_TUNE BIT(0)
@@ -505,6 +583,7 @@
@@ -506,6 +584,7 @@
#define UPS_FLAGS_250M_CKDIV BIT(2)
#define UPS_FLAGS_EN_ALDPS BIT(3)
#define UPS_FLAGS_CTAP_SHORT_DIS BIT(4)
@ -278,7 +278,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#define ups_flags_speed(x) ((x) << 16)
#define UPS_FLAGS_EN_EEE BIT(20)
#define UPS_FLAGS_EN_500M_EEE BIT(21)
@@ -525,6 +604,8 @@ enum spd_duplex {
@@ -526,6 +605,8 @@ enum spd_duplex {
FORCE_10M_FULL,
FORCE_100M_HALF,
FORCE_100M_FULL,
@ -287,7 +287,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
/* OCP_ALDPS_CONFIG */
@@ -589,6 +670,9 @@ enum spd_duplex {
@@ -590,6 +671,9 @@ enum spd_duplex {
#define EN_10M_CLKDIV BIT(11)
#define EN_10M_BGOFF 0x0080
@ -297,7 +297,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* OCP_PHY_STATE */
#define TXDIS_STATE 0x01
#define ABD_STATE 0x02
@@ -608,7 +692,8 @@ enum spd_duplex {
@@ -609,7 +693,8 @@ enum spd_duplex {
#define EN_EMI_L 0x0040
/* OCP_SYSCLK_CFG */
@ -307,7 +307,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* SRAM_GREEN_CFG */
#define GREEN_ETH_EN BIT(15)
@@ -639,6 +724,11 @@ enum spd_duplex {
@@ -640,6 +725,11 @@ enum spd_duplex {
#define BP4_SUPER_ONLY 0x1578 /* RTL_VER_04 only */
enum rtl_register_content {
@ -319,7 +319,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
_1000bps = 0x10,
_100bps = 0x08,
_10bps = 0x04,
@@ -646,6 +736,9 @@ enum rtl_register_content {
@@ -647,6 +737,9 @@ enum rtl_register_content {
FULL_DUP = 0x01,
};
@ -329,7 +329,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#define RTL8152_MAX_TX 4
#define RTL8152_MAX_RX 10
#define INTBUFSIZE 2
@@ -660,7 +753,6 @@ enum rtl_register_content {
@@ -661,7 +754,6 @@ enum rtl_register_content {
#define RTL8152_RMS (VLAN_ETH_FRAME_LEN + ETH_FCS_LEN)
#define RTL8153_RMS RTL8153_MAX_PACKET
#define RTL8152_TX_TIMEOUT (5 * HZ)
@ -337,7 +337,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
#define mtu_to_size(m) ((m) + VLAN_ETH_HLEN + ETH_FCS_LEN)
#define size_to_mtu(s) ((s) - VLAN_ETH_HLEN - ETH_FCS_LEN)
#define rx_reserved_size(x) (mtu_to_size(x) + sizeof(struct rx_desc) + RX_ALIGN)
@@ -797,6 +889,7 @@ struct r8152 {
@@ -798,6 +890,7 @@ struct r8152 {
} rtl_ops;
struct ups_info {
@ -345,7 +345,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
u32 _10m_ckdiv:1;
u32 _250m_ckdiv:1;
u32 aldps:1;
@@ -838,7 +931,9 @@ struct r8152 {
@@ -839,7 +932,9 @@ struct r8152 {
u32 rx_buf_sz;
u32 rx_copybreak;
u32 rx_pending;
@ -355,7 +355,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
u16 ocp_base;
u16 speed;
u16 eee_adv;
@@ -998,6 +1093,15 @@ enum rtl_version {
@@ -999,6 +1094,15 @@ enum rtl_version {
RTL_VER_07,
RTL_VER_08,
RTL_VER_09,
@ -371,7 +371,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
RTL_VER_MAX
};
@@ -1013,6 +1117,7 @@ enum tx_csum_stat {
@@ -1014,6 +1118,7 @@ enum tx_csum_stat {
#define RTL_ADVERTISED_100_FULL BIT(3)
#define RTL_ADVERTISED_1000_HALF BIT(4)
#define RTL_ADVERTISED_1000_FULL BIT(5)
@ -379,7 +379,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
* The RTL chips use a 64 element hash table based on the Ethernet CRC.
@@ -2606,7 +2711,7 @@ static netdev_tx_t rtl8152_start_xmit(st
@@ -2607,7 +2712,7 @@ static netdev_tx_t rtl8152_start_xmit(st
static void r8152b_reset_packet_filter(struct r8152 *tp)
{
@ -388,7 +388,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_FMC);
ocp_data &= ~FMC_FCR_MCU_EN;
@@ -2617,14 +2722,47 @@ static void r8152b_reset_packet_filter(s
@@ -2618,14 +2723,47 @@ static void r8152b_reset_packet_filter(s
static void rtl8152_nic_reset(struct r8152 *tp)
{
@ -442,7 +442,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
}
@@ -2633,9 +2771,9 @@ static void set_tx_qlen(struct r8152 *tp
@@ -2634,9 +2772,9 @@ static void set_tx_qlen(struct r8152 *tp
tp->tx_qlen = agg_buf_sz / (mtu_to_size(tp->netdev->mtu) + sizeof(struct tx_desc));
}
@ -454,7 +454,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
static void rtl_eee_plus_en(struct r8152 *tp, bool enable)
@@ -2795,6 +2933,7 @@ static int rtl_enable(struct r8152 *tp)
@@ -2796,6 +2934,7 @@ static int rtl_enable(struct r8152 *tp)
switch (tp->version) {
case RTL_VER_08:
case RTL_VER_09:
@ -462,7 +462,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
r8153b_rx_agg_chg_indicate(tp);
break;
default:
@@ -2832,6 +2971,7 @@ static void r8153_set_rx_early_timeout(s
@@ -2833,6 +2972,7 @@ static void r8153_set_rx_early_timeout(s
case RTL_VER_08:
case RTL_VER_09:
@ -470,7 +470,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* The RTL8153B uses USB_RX_EXTRA_AGGR_TMR for rx timeout
* primarily. For USB_RX_EARLY_TIMEOUT, we fix it to 128ns.
*/
@@ -2841,6 +2981,18 @@ static void r8153_set_rx_early_timeout(s
@@ -2842,6 +2982,18 @@ static void r8153_set_rx_early_timeout(s
ocp_data);
break;
@ -489,7 +489,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
default:
break;
}
@@ -2860,8 +3012,19 @@ static void r8153_set_rx_early_size(stru
@@ -2861,8 +3013,19 @@ static void r8153_set_rx_early_size(stru
break;
case RTL_VER_08:
case RTL_VER_09:
@ -509,7 +509,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
break;
default:
WARN_ON_ONCE(1);
@@ -2871,6 +3034,8 @@ static void r8153_set_rx_early_size(stru
@@ -2872,6 +3035,8 @@ static void r8153_set_rx_early_size(stru
static int rtl8153_enable(struct r8152 *tp)
{
@ -518,7 +518,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (test_bit(RTL8152_UNPLUG, &tp->flags))
return -ENODEV;
@@ -2881,15 +3046,18 @@ static int rtl8153_enable(struct r8152 *
@@ -2882,15 +3047,18 @@ static int rtl8153_enable(struct r8152 *
rtl_set_ifg(tp, rtl8152_get_speed(tp));
@ -540,7 +540,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
return rtl_enable(tp);
@@ -2954,12 +3122,40 @@ static void rtl_rx_vlan_en(struct r8152
@@ -2955,12 +3123,40 @@ static void rtl_rx_vlan_en(struct r8152
{
u32 ocp_data;
@ -587,7 +587,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
static int rtl8152_set_features(struct net_device *dev,
@@ -3052,6 +3248,40 @@ static void __rtl_set_wol(struct r8152 *
@@ -3053,6 +3249,40 @@ static void __rtl_set_wol(struct r8152 *
device_set_wakeup_enable(&tp->udev->dev, false);
}
@ -628,7 +628,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static void r8153_u1u2en(struct r8152 *tp, bool enable)
{
u8 u1u2[8];
@@ -3111,6 +3341,9 @@ static void r8153b_ups_flags(struct r815
@@ -3112,6 +3342,9 @@ static void r8153b_ups_flags(struct r815
if (tp->ups_info.eee_cmod_lv)
ups_flags |= UPS_FLAGS_EEE_CMOD_LV_EN;
@ -638,7 +638,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (tp->ups_info._10m_ckdiv)
ups_flags |= UPS_FLAGS_EN_10M_CKDIV;
@@ -3161,6 +3394,88 @@ static void r8153b_ups_flags(struct r815
@@ -3162,6 +3395,88 @@ static void r8153b_ups_flags(struct r815
ocp_write_dword(tp, MCU_TYPE_USB, USB_UPS_FLAGS, ups_flags);
}
@ -727,7 +727,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static void rtl_green_en(struct r8152 *tp, bool enable)
{
u16 data;
@@ -3224,16 +3539,16 @@ static void r8153b_ups_en(struct r8152 *
@@ -3225,16 +3540,16 @@ static void r8153b_ups_en(struct r8152 *
ocp_data |= UPS_EN | USP_PREWAKE | PHASE2_EN;
ocp_write_byte(tp, MCU_TYPE_USB, USB_POWER_CUT, ocp_data);
@ -750,7 +750,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (ocp_read_word(tp, MCU_TYPE_USB, USB_MISC_0) & PCUT_STATUS) {
int i;
@@ -3253,6 +3568,95 @@ static void r8153b_ups_en(struct r8152 *
@@ -3254,6 +3569,95 @@ static void r8153b_ups_en(struct r8152 *
}
}
@ -846,7 +846,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static void r8153_power_cut_en(struct r8152 *tp, bool enable)
{
u32 ocp_data;
@@ -3382,6 +3786,38 @@ static void rtl8153b_runtime_enable(stru
@@ -3383,6 +3787,38 @@ static void rtl8153b_runtime_enable(stru
}
}
@ -885,7 +885,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static void r8153_teredo_off(struct r8152 *tp)
{
u32 ocp_data;
@@ -3402,14 +3838,19 @@ static void r8153_teredo_off(struct r815
@@ -3403,14 +3839,19 @@ static void r8153_teredo_off(struct r815
case RTL_VER_08:
case RTL_VER_09:
@ -908,7 +908,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
ocp_write_word(tp, MCU_TYPE_PLA, PLA_WDT6_CTRL, WDT6_SET_MODE);
@@ -3444,6 +3885,12 @@ static void rtl_clear_bp(struct r8152 *t
@@ -3445,6 +3886,12 @@ static void rtl_clear_bp(struct r8152 *t
break;
case RTL_VER_08:
case RTL_VER_09:
@ -921,7 +921,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
default:
if (type == MCU_TYPE_USB) {
ocp_write_word(tp, MCU_TYPE_USB, USB_BP2_EN, 0);
@@ -3653,6 +4100,11 @@ static bool rtl8152_is_fw_mac_ok(struct
@@ -3654,6 +4101,11 @@ static bool rtl8152_is_fw_mac_ok(struct
case RTL_VER_06:
case RTL_VER_08:
case RTL_VER_09:
@ -933,7 +933,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
fw_reg = 0xf800;
bp_ba_addr = PLA_BP_BA;
bp_en_addr = PLA_BP_EN;
@@ -3676,6 +4128,11 @@ static bool rtl8152_is_fw_mac_ok(struct
@@ -3677,6 +4129,11 @@ static bool rtl8152_is_fw_mac_ok(struct
break;
case RTL_VER_08:
case RTL_VER_09:
@ -945,7 +945,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
fw_reg = 0xe600;
bp_ba_addr = USB_BP_BA;
bp_en_addr = USB_BP2_EN;
@@ -4215,6 +4672,22 @@ static void r8153_eee_en(struct r8152 *t
@@ -4216,6 +4673,22 @@ static void r8153_eee_en(struct r8152 *t
tp->ups_info.eee = enable;
}
@ -968,7 +968,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static void rtl_eee_enable(struct r8152 *tp, bool enable)
{
switch (tp->version) {
@@ -4236,6 +4709,7 @@ static void rtl_eee_enable(struct r8152
@@ -4237,6 +4710,7 @@ static void rtl_eee_enable(struct r8152
case RTL_VER_06:
case RTL_VER_08:
case RTL_VER_09:
@ -976,7 +976,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (enable) {
r8153_eee_en(tp, true);
ocp_reg_write(tp, OCP_EEE_ADV, tp->eee_adv);
@@ -4244,6 +4718,19 @@ static void rtl_eee_enable(struct r8152
@@ -4245,6 +4719,19 @@ static void rtl_eee_enable(struct r8152
ocp_reg_write(tp, OCP_EEE_ADV, 0);
}
break;
@ -996,7 +996,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
default:
break;
}
@@ -4290,6 +4777,20 @@ static void wait_oob_link_list_ready(str
@@ -4291,6 +4778,20 @@ static void wait_oob_link_list_ready(str
}
}
@ -1017,7 +1017,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static void r8152b_exit_oob(struct r8152 *tp)
{
u32 ocp_data;
@@ -4340,7 +4841,7 @@ static void r8152b_exit_oob(struct r8152
@@ -4341,7 +4842,7 @@ static void r8152b_exit_oob(struct r8152
}
/* TX share fifo free credit full threshold */
@ -1026,7 +1026,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ocp_write_byte(tp, MCU_TYPE_USB, USB_TX_AGG, TX_AGG_MAX_THRESHOLD);
ocp_write_dword(tp, MCU_TYPE_USB, USB_RX_BUF_TH, RX_THR_HIGH);
@@ -4517,6 +5018,21 @@ static int r8153b_post_firmware_1(struct
@@ -4518,6 +5019,21 @@ static int r8153b_post_firmware_1(struct
return 0;
}
@ -1048,7 +1048,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static void r8153_aldps_en(struct r8152 *tp, bool enable)
{
u16 data;
@@ -4719,6 +5235,13 @@ static void r8153b_hw_phy_cfg(struct r81
@@ -4720,6 +5236,13 @@ static void r8153b_hw_phy_cfg(struct r81
set_bit(PHY_RESET, &tp->flags);
}
@ -1062,7 +1062,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static void rtl8153_change_mtu(struct r8152 *tp)
{
ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, mtu_to_size(tp->netdev->mtu));
@@ -4806,6 +5329,7 @@ static void r8153_enter_oob(struct r8152
@@ -4807,6 +5330,7 @@ static void r8153_enter_oob(struct r8152
case RTL_VER_08:
case RTL_VER_09:
@ -1070,7 +1070,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* Clear teredo wake event. bit[15:8] is the teredo wakeup
* type. Set it to zero. bits[7:0] are the W1C bits about
* the events. Set them to all 1 to clear them.
@@ -4842,6 +5366,96 @@ static void rtl8153_disable(struct r8152
@@ -4843,6 +5367,96 @@ static void rtl8153_disable(struct r8152
r8153_aldps_en(tp, true);
}
@ -1167,7 +1167,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static int rtl8152_set_speed(struct r8152 *tp, u8 autoneg, u32 speed, u8 duplex,
u32 advertising)
{
@@ -4890,58 +5504,73 @@ static int rtl8152_set_speed(struct r815
@@ -4891,58 +5505,73 @@ static int rtl8152_set_speed(struct r815
tp->mii.force_media = 1;
} else {
@ -1259,7 +1259,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
bmcr = BMCR_ANENABLE | BMCR_ANRESTART;
@@ -5097,6 +5726,253 @@ static void rtl8153b_down(struct r8152 *
@@ -5098,6 +5727,253 @@ static void rtl8153b_down(struct r8152 *
r8153_aldps_en(tp, true);
}
@ -1513,7 +1513,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static bool rtl8152_in_nway(struct r8152 *tp)
{
u16 nway_state;
@@ -5127,7 +6003,7 @@ static void set_carrier(struct r8152 *tp
@@ -5128,7 +6004,7 @@ static void set_carrier(struct r8152 *tp
{
struct net_device *netdev = tp->netdev;
struct napi_struct *napi = &tp->napi;
@ -1522,7 +1522,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
speed = rtl8152_get_speed(tp);
@@ -5140,7 +6016,7 @@ static void set_carrier(struct r8152 *tp
@@ -5141,7 +6017,7 @@ static void set_carrier(struct r8152 *tp
rtl_start_rx(tp);
clear_bit(RTL8152_SET_RX_MODE, &tp->flags);
_rtl8152_set_rx_mode(netdev);
@ -1531,7 +1531,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
netif_wake_queue(netdev);
netif_info(tp, link, netdev, "carrier on\n");
} else if (netif_queue_stopped(netdev) &&
@@ -5502,14 +6378,9 @@ static void r8153_init(struct r8152 *tp)
@@ -5521,14 +6397,9 @@ static void r8153_init(struct r8152 *tp)
ocp_write_word(tp, MCU_TYPE_USB, USB_CONNECT_TIMER, 0x0001);
@ -1547,7 +1547,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
r8153_u1u2en(tp, true);
usb_enable_lpm(tp->udev);
@@ -5600,9 +6471,7 @@ static void r8153b_init(struct r8152 *tp
@@ -5621,9 +6492,7 @@ static void r8153b_init(struct r8152 *tp
usb_enable_lpm(tp->udev);
/* MAC clock speed down */
@ -1558,8 +1558,8 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3);
ocp_data &= ~PLA_MCU_SPDWN_EN;
@@ -5629,6 +6498,1069 @@ static void r8153b_init(struct r8152 *tp
tp->coalesce = 15000; /* 15 us */
@@ -5652,6 +6521,1069 @@ static void r8153b_init(struct r8152 *tp
r8152_led_configuration(tp);
}
+static void r8153c_init(struct r8152 *tp)
@ -2628,7 +2628,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static int rtl8152_pre_reset(struct usb_interface *intf)
{
struct r8152 *tp = usb_get_intfdata(intf);
@@ -5992,6 +7924,22 @@ int rtl8152_get_link_ksettings(struct ne
@@ -6015,6 +7947,22 @@ int rtl8152_get_link_ksettings(struct ne
mii_ethtool_get_link_ksettings(&tp->mii, cmd);
@ -2651,7 +2651,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mutex_unlock(&tp->control);
usb_autopm_put_interface(tp->intf);
@@ -6035,6 +7983,10 @@ static int rtl8152_set_link_ksettings(st
@@ -6058,6 +8006,10 @@ static int rtl8152_set_link_ksettings(st
cmd->link_modes.advertising))
advertising |= RTL_ADVERTISED_1000_FULL;
@ -2662,7 +2662,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mutex_lock(&tp->control);
ret = rtl8152_set_speed(tp, cmd->base.autoneg, cmd->base.speed,
@@ -6624,6 +8576,67 @@ static int rtl_ops_init(struct r8152 *tp
@@ -6647,6 +8599,67 @@ static int rtl_ops_init(struct r8152 *tp
tp->eee_adv = MDIO_EEE_1000T | MDIO_EEE_100TX;
break;
@ -2730,7 +2730,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
default:
ret = -ENODEV;
dev_err(&tp->intf->dev, "Unknown Device\n");
@@ -6637,11 +8650,13 @@ static int rtl_ops_init(struct r8152 *tp
@@ -6660,11 +8673,13 @@ static int rtl_ops_init(struct r8152 *tp
#define FIRMWARE_8153A_3 "rtl_nic/rtl8153a-3.fw"
#define FIRMWARE_8153A_4 "rtl_nic/rtl8153a-4.fw"
#define FIRMWARE_8153B_2 "rtl_nic/rtl8153b-2.fw"
@ -2744,7 +2744,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static int rtl_fw_init(struct r8152 *tp)
{
@@ -6667,6 +8682,11 @@ static int rtl_fw_init(struct r8152 *tp)
@@ -6690,6 +8705,11 @@ static int rtl_fw_init(struct r8152 *tp)
rtl_fw->pre_fw = r8153b_pre_firmware_1;
rtl_fw->post_fw = r8153b_post_firmware_1;
break;
@ -2756,7 +2756,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
default:
break;
}
@@ -6722,6 +8742,27 @@ u8 rtl8152_get_version(struct usb_interf
@@ -6745,6 +8765,27 @@ u8 rtl8152_get_version(struct usb_interf
case 0x6010:
version = RTL_VER_09;
break;
@ -2784,7 +2784,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
default:
version = RTL_VER_UNKNOWN;
dev_info(&intf->dev, "Unknown version 0x%04x\n", ocp_data);
@@ -6834,12 +8875,29 @@ static int rtl8152_probe(struct usb_inte
@@ -6857,12 +8898,29 @@ static int rtl8152_probe(struct usb_inte
/* MTU range: 68 - 1500 or 9194 */
netdev->min_mtu = ETH_MIN_MTU;
switch (tp->version) {
@ -2817,7 +2817,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
break;
}
@@ -6855,7 +8913,13 @@ static int rtl8152_probe(struct usb_inte
@@ -6878,7 +8936,13 @@ static int rtl8152_probe(struct usb_inte
tp->advertising = RTL_ADVERTISED_10_HALF | RTL_ADVERTISED_10_FULL |
RTL_ADVERTISED_100_HALF | RTL_ADVERTISED_100_FULL;
if (tp->mii.supports_gmii) {
@ -2832,7 +2832,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
tp->advertising |= RTL_ADVERTISED_1000_FULL;
}
tp->duplex = DUPLEX_FULL;
@@ -6879,7 +8943,11 @@ static int rtl8152_probe(struct usb_inte
@@ -6902,7 +8966,11 @@ static int rtl8152_probe(struct usb_inte
set_ethernet_addr(tp);
usb_set_intfdata(intf, tp);
@ -2845,7 +2845,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
ret = register_netdev(netdev);
if (ret != 0) {
@@ -6915,7 +8983,8 @@ static void rtl8152_disconnect(struct us
@@ -6938,7 +9006,8 @@ static void rtl8152_disconnect(struct us
unregister_netdev(tp->netdev);
tasklet_kill(&tp->tx_tl);
cancel_delayed_work_sync(&tp->hw_phy_work);
@ -2855,7 +2855,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
rtl8152_release_firmware(tp);
free_netdev(tp->netdev);
}
@@ -6935,13 +9004,28 @@ static void rtl8152_disconnect(struct us
@@ -6958,13 +9027,28 @@ static void rtl8152_disconnect(struct us
.idProduct = (prod), \
.bInterfaceClass = USB_CLASS_COMM, \
.bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, \

View File

@ -15,7 +15,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -974,8 +974,60 @@ enum rtl8152_fw_flags {
@@ -975,8 +975,60 @@ enum rtl8152_fw_flags {
FW_FLAGS_START,
FW_FLAGS_STOP,
FW_FLAGS_NC,
@ -76,7 +76,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/**
* struct fw_mac - a firmware block used by RTL_FW_PLA and RTL_FW_USB.
* The layout of the firmware block is:
@@ -1080,6 +1132,15 @@ enum rtl_fw_type {
@@ -1081,6 +1133,15 @@ enum rtl_fw_type {
RTL_FW_PHY_START,
RTL_FW_PHY_STOP,
RTL_FW_PHY_NC,
@ -92,7 +92,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
enum rtl_version {
@@ -3999,6 +4060,162 @@ static int rtl_post_ram_code(struct r815
@@ -4000,6 +4061,162 @@ static int rtl_post_ram_code(struct r815
return 0;
}
@ -255,7 +255,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static bool rtl8152_is_fw_phy_nc_ok(struct r8152 *tp, struct fw_phy_nc *phy)
{
u32 length;
@@ -4319,6 +4536,10 @@ static long rtl8152_check_firmware(struc
@@ -4320,6 +4537,10 @@ static long rtl8152_check_firmware(struc
case RTL_FW_PHY_START:
if (test_bit(FW_FLAGS_START, &fw_flags) ||
test_bit(FW_FLAGS_NC, &fw_flags) ||
@ -266,7 +266,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
test_bit(FW_FLAGS_STOP, &fw_flags)) {
dev_err(&tp->intf->dev,
"check PHY_START fail\n");
@@ -4367,7 +4588,153 @@ static long rtl8152_check_firmware(struc
@@ -4368,7 +4589,153 @@ static long rtl8152_check_firmware(struc
goto fail;
}
__set_bit(FW_FLAGS_NC, &fw_flags);
@ -420,7 +420,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
break;
default:
dev_warn(&tp->intf->dev, "Unknown type %u is found\n",
@@ -4390,6 +4757,143 @@ fail:
@@ -4391,6 +4758,143 @@ fail:
return ret;
}
@ -564,7 +564,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static void rtl8152_fw_phy_nc_apply(struct r8152 *tp, struct fw_phy_nc *phy)
{
u16 mode_reg, bp_index;
@@ -4443,6 +4947,12 @@ static void rtl8152_fw_mac_apply(struct
@@ -4444,6 +4948,12 @@ static void rtl8152_fw_mac_apply(struct
return;
}
@ -577,7 +577,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
rtl_clear_bp(tp, type);
/* Enable backup/restore of MACDBG. This is required after clearing PLA
@@ -4478,7 +4988,6 @@ static void rtl8152_fw_mac_apply(struct
@@ -4479,7 +4989,6 @@ static void rtl8152_fw_mac_apply(struct
ocp_write_word(tp, type, bp_en_addr,
__le16_to_cpu(mac->bp_en_value));
@ -585,7 +585,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (fw_ver_reg)
ocp_write_byte(tp, MCU_TYPE_USB, fw_ver_reg,
mac->fw_ver_data);
@@ -4493,7 +5002,7 @@ static void rtl8152_apply_firmware(struc
@@ -4494,7 +5003,7 @@ static void rtl8152_apply_firmware(struc
struct fw_header *fw_hdr;
struct fw_phy_patch_key *key;
u16 key_addr = 0;
@ -594,7 +594,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (IS_ERR_OR_NULL(rtl_fw->fw))
return;
@@ -4515,17 +5024,40 @@ static void rtl8152_apply_firmware(struc
@@ -4516,17 +5025,40 @@ static void rtl8152_apply_firmware(struc
rtl8152_fw_mac_apply(tp, (struct fw_mac *)block);
break;
case RTL_FW_PHY_START:
@ -635,7 +635,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
default:
break;
}
@@ -5033,6 +5565,21 @@ static int r8153c_post_firmware_1(struct
@@ -5034,6 +5566,21 @@ static int r8153c_post_firmware_1(struct
return 0;
}
@ -657,7 +657,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static void r8153_aldps_en(struct r8152 *tp, bool enable)
{
u16 data;
@@ -8651,12 +9198,16 @@ static int rtl_ops_init(struct r8152 *tp
@@ -8674,12 +9221,16 @@ static int rtl_ops_init(struct r8152 *tp
#define FIRMWARE_8153A_4 "rtl_nic/rtl8153a-4.fw"
#define FIRMWARE_8153B_2 "rtl_nic/rtl8153b-2.fw"
#define FIRMWARE_8153C_1 "rtl_nic/rtl8153c-1.fw"
@ -674,7 +674,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static int rtl_fw_init(struct r8152 *tp)
{
@@ -8682,6 +9233,14 @@ static int rtl_fw_init(struct r8152 *tp)
@@ -8705,6 +9256,14 @@ static int rtl_fw_init(struct r8152 *tp)
rtl_fw->pre_fw = r8153b_pre_firmware_1;
rtl_fw->post_fw = r8153b_post_firmware_1;
break;

View File

@ -16,7 +16,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -29,7 +29,7 @@
@@ -30,7 +30,7 @@
#include <linux/usb/r8152.h>
/* Information for net-next */
@ -25,7 +25,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* Information for net */
#define NET_VERSION "11"
@@ -8108,6 +8108,39 @@ static void r8156b_init(struct r8152 *tp
@@ -8131,6 +8131,39 @@ static void r8156b_init(struct r8152 *tp
tp->coalesce = 15000; /* 15 us */
}
@ -65,7 +65,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static int rtl8152_pre_reset(struct usb_interface *intf)
{
struct r8152 *tp = usb_get_intfdata(intf);
@@ -9346,10 +9379,8 @@ static int rtl8152_probe(struct usb_inte
@@ -9369,10 +9402,8 @@ static int rtl8152_probe(struct usb_inte
if (version == RTL_VER_UNKNOWN)
return -ENODEV;

View File

@ -17,7 +17,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -5665,6 +5665,9 @@ int __init cgroup_init_early(void)
@@ -5667,6 +5667,9 @@ int __init cgroup_init_early(void)
return 0;
}
@ -27,7 +27,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
/**
* cgroup_init - cgroup initialization
*
@@ -5703,6 +5706,12 @@ int __init cgroup_init(void)
@@ -5705,6 +5708,12 @@ int __init cgroup_init(void)
mutex_unlock(&cgroup_mutex);
@ -40,7 +40,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
for_each_subsys(ss, ssid) {
if (ss->early_init) {
struct cgroup_subsys_state *css =
@@ -6240,6 +6249,10 @@ static int __init cgroup_disable(char *s
@@ -6242,6 +6251,10 @@ static int __init cgroup_disable(char *s
strcmp(token, ss->legacy_name))
continue;
@ -51,7 +51,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
static_branch_disable(cgroup_subsys_enabled_key[i]);
pr_info("Disabling %s control group subsystem\n",
ss->name);
@@ -6249,6 +6262,31 @@ static int __init cgroup_disable(char *s
@@ -6251,6 +6264,31 @@ static int __init cgroup_disable(char *s
}
__setup("cgroup_disable=", cgroup_disable);

View File

@ -10,8 +10,7 @@ BOARDNAME:=Broadcom BCM47xx/53xx (MIPS)
FEATURES:=squashfs usb
SUBTARGETS:=generic mips74k legacy
KERNEL_PATCHVER:=5.4
KERNEL_TESTING_PATCHVER:=5.10
KERNEL_PATCHVER:=5.10
define Target/Description
Build firmware images for Broadcom based BCM47xx/53xx routers with MIPS CPU, *not* ARM.

View File

@ -18,8 +18,8 @@
#
TEXT_START := 0x80001000
BZ_TEXT_START := 0x80600000
BZ_STACK_START := 0x80700000
BZ_TEXT_START := 0x80700000
BZ_STACK_START := 0x80800000
OBJCOPY := $(CROSS_COMPILE)objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S

View File

@ -0,0 +1,42 @@
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
Date: Sun, 7 Nov 2021 14:20:40 +0100
Subject: [PATCH] net: bgmac: connect to PHY even if it is BGMAC_PHY_NOREGS
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Recent bgmac change was meant to just fix a race between "Generic PHY"
and "bcm53xx" drivers after -EPROBE_DEFER. It modified bgmac to use
phy_connect() only if there is a real PHY device connected.
That change broke bgmac on bcm47xx. bcma_phy_connect() now registers a
fixed PHY with the bgmac_phy_connect_direct(). That fails as another
fixed PHY (also using address 0) is already registered - by bcm47xx arch
code bcm47xx_register_bus_complete().
This change brings origial behaviour. It connects Ethernet interface
with pseudo-PHY (switch device) and adjusts Ethernet interface link to
match connected switch.
This fixes:
[ 2.548098] bgmac_bcma bcma0:1: Failed to register fixed PHY device
[ 2.554584] bgmac_bcma bcma0:1: Cannot connect to phy
Fixes: b5375509184d ("net: bgmac: improve handling PHY")
Link: https://lore.kernel.org/netdev/3639116e-9292-03ca-b9d9-d741118a4541@gmail.com/T/#u
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
drivers/net/ethernet/broadcom/bgmac-bcma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/net/ethernet/broadcom/bgmac-bcma.c
+++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c
@@ -94,7 +94,7 @@ static int bcma_phy_connect(struct bgmac
return 0;
/* Connect to the PHY */
- if (bgmac->mii_bus && bgmac->phyaddr != BGMAC_PHY_NOREGS) {
+ if (bgmac->mii_bus) {
snprintf(bus_id, sizeof(bus_id), PHY_ID_FMT, bgmac->mii_bus->id,
bgmac->phyaddr);
phy_dev = phy_connect(bgmac->net_dev, bus_id, bgmac_adjust_link,

View File

@ -9,8 +9,7 @@ FEATURES:=squashfs nand usb pci pcie gpio
CPU_TYPE:=cortex-a53
SUBTARGETS:=generic
KERNEL_PATCHVER:=5.4
KERNEL_TESTING_PATCHVER:=5.10
KERNEL_PATCHVER:=5.10
define Target/Description
Build firmware images for Broadcom BCM4908 SoC family routers.

View File

@ -1,6 +1,5 @@
CONFIG_64BIT=y
CONFIG_ARCH_BCM4908=y
CONFIG_ARCH_CLOCKSOURCE_DATA=y
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
CONFIG_ARCH_KEEP_MEMBLOCK=y
CONFIG_ARCH_MMAP_RND_BITS=18
@ -11,20 +10,18 @@ CONFIG_ARCH_PROC_KCORE_TEXT=y
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
CONFIG_ARCH_SPARSEMEM_DEFAULT=y
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_STACKWALK=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ARM64=y
CONFIG_ARM64_4K_PAGES=y
CONFIG_ARM64_CONT_SHIFT=4
CONFIG_ARM64_PAGE_SHIFT=12
CONFIG_ARM64_PA_BITS=48
CONFIG_ARM64_PA_BITS_48=y
CONFIG_ARM64_PTR_AUTH=y
CONFIG_ARM64_SSBD=y
CONFIG_ARM64_SVE=y
CONFIG_ARM64_TAGGED_ADDR_ABI=y
CONFIG_ARM64_VA_BITS=39
CONFIG_ARM64_VA_BITS_39=y
CONFIG_ARM64_WORKAROUND_REPEAT_TLBI=y
CONFIG_ARM_AMBA=y
CONFIG_ARM_ARCH_TIMER=y
CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
@ -37,14 +34,15 @@ CONFIG_B53=y
# CONFIG_B53_MDIO_DRIVER is not set
# CONFIG_B53_MMAP_DRIVER is not set
# CONFIG_B53_SERDES is not set
# CONFIG_B53_SPI_DRIVER is not set
# CONFIG_B53_SRAB_DRIVER is not set
CONFIG_BCM4908_ENET=y
CONFIG_BCM7038_WDT=y
CONFIG_BCM7XXX_PHY=y
CONFIG_BCM_NET_PHYLIB=y
CONFIG_BCM_PMB=y
# CONFIG_BLK_DEV_INITRD is not set
CONFIG_BLK_PM=y
CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y
CONFIG_CLKDEV_LOOKUP=y
CONFIG_CLONE_BACKWARDS=y
CONFIG_CMDLINE="earlycon=bcm63xx_uart,0xff800640 console=ttyS0,115200"
@ -53,22 +51,16 @@ CONFIG_COMMON_CLK=y
# CONFIG_COMPAT_32BIT_TIME is not set
CONFIG_CPU_RMAP=y
CONFIG_CRC16=y
CONFIG_CRYPTO_ACOMP2=y
CONFIG_CRYPTO_AEAD=y
CONFIG_CRYPTO_AEAD2=y
CONFIG_CRYPTO_DEFLATE=y
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_GF128MUL=y
CONFIG_CRYPTO_HASH_INFO=y
CONFIG_CRYPTO_LZO=y
CONFIG_CRYPTO_MANAGER=y
CONFIG_CRYPTO_MANAGER2=y
CONFIG_CRYPTO_NULL2=y
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_ZSTD=y
CONFIG_DCACHE_WORD_ACCESS=y
CONFIG_DMA_DIRECT_REMAP=y
CONFIG_DMA_REMAP=y
CONFIG_DRM_RCAR_WRITEBACK=y
CONFIG_DTC=y
CONFIG_EDAC_SUPPORT=y
CONFIG_FIXED_PHY=y
@ -105,7 +97,6 @@ CONFIG_GPIO_GENERIC=y
CONFIG_GPIO_GENERIC_PLATFORM=y
CONFIG_GRO_CELLS=y
CONFIG_HANDLE_DOMAIN_IRQ=y
CONFIG_HARDEN_BRANCH_PREDICTOR=y
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_HAS_DMA=y
CONFIG_HAS_IOMEM=y
@ -119,6 +110,7 @@ CONFIG_IRQ_FORCED_THREADING=y
CONFIG_IRQ_WORK=y
CONFIG_LEDS_GPIO=y
CONFIG_LIBFDT=y
CONFIG_LLD_VERSION=0
CONFIG_LOCK_DEBUGGING_SUPPORT=y
CONFIG_LOCK_SPIN_ON_OWNER=y
CONFIG_LZO_COMPRESS=y
@ -126,12 +118,14 @@ CONFIG_LZO_DECOMPRESS=y
CONFIG_MDIO_BCM_UNIMAC=y
CONFIG_MDIO_BUS=y
CONFIG_MDIO_DEVICE=y
CONFIG_MDIO_DEVRES=y
CONFIG_MEMFD_CREATE=y
CONFIG_MFD_SYSCON=y
CONFIG_MIGRATION=y
CONFIG_MODULES_USE_ELF_RELA=y
CONFIG_MTD_NAND_BRCMNAND=y
CONFIG_MTD_NAND_CORE=y
CONFIG_MTD_NAND_ECC=y
CONFIG_MTD_NAND_ECC_SW_HAMMING=y
CONFIG_MTD_OF_PARTS_BCM4908=y
# CONFIG_MTD_OF_PARTS_LINKSYS_NS is not set
@ -150,6 +144,7 @@ CONFIG_NET_DSA=y
CONFIG_NET_DSA_BCM_SF2=y
CONFIG_NET_DSA_TAG_BRCM=y
CONFIG_NET_DSA_TAG_BRCM_COMMON=y
CONFIG_NET_DSA_TAG_BRCM_LEGACY=y
CONFIG_NET_DSA_TAG_BRCM_PREPEND=y
CONFIG_NET_FLOW_LIMIT=y
CONFIG_NET_SWITCHDEV=y
@ -181,7 +176,6 @@ CONFIG_POWER_SUPPLY=y
CONFIG_QUEUED_RWLOCKS=y
CONFIG_QUEUED_SPINLOCKS=y
CONFIG_RATIONAL=y
CONFIG_REFCOUNT_FULL=y
CONFIG_REGMAP=y
CONFIG_REGMAP_MMIO=y
CONFIG_RELOCATABLE=y
@ -211,6 +205,7 @@ CONFIG_UBIFS_FS=y
CONFIG_UNMAP_KERNEL_AT_EL0=y
CONFIG_USB_SUPPORT=y
CONFIG_VMAP_STACK=y
CONFIG_WATCHDOG_CORE=y
CONFIG_XPS=y
CONFIG_XXHASH=y
CONFIG_ZLIB_DEFLATE=y

View File

@ -24,7 +24,6 @@ CONFIG_ARM64_SVE=y
CONFIG_ARM64_TAGGED_ADDR_ABI=y
CONFIG_ARM64_VA_BITS=39
CONFIG_ARM64_VA_BITS_39=y
CONFIG_ARM64_WORKAROUND_REPEAT_TLBI=y
CONFIG_ARM_AMBA=y
CONFIG_ARM_ARCH_TIMER=y
CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
@ -37,14 +36,15 @@ CONFIG_B53=y
# CONFIG_B53_MDIO_DRIVER is not set
# CONFIG_B53_MMAP_DRIVER is not set
# CONFIG_B53_SERDES is not set
# CONFIG_B53_SPI_DRIVER is not set
# CONFIG_B53_SRAB_DRIVER is not set
CONFIG_BCM4908_ENET=y
CONFIG_BCM7038_WDT=y
CONFIG_BCM7XXX_PHY=y
CONFIG_BCM_NET_PHYLIB=y
CONFIG_BCM_PMB=y
# CONFIG_BLK_DEV_INITRD is not set
CONFIG_BLK_PM=y
CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y
CONFIG_CLKDEV_LOOKUP=y
CONFIG_CLONE_BACKWARDS=y
CONFIG_CMDLINE="earlycon=bcm63xx_uart,0xff800640 console=ttyS0,115200"
@ -209,6 +209,7 @@ CONFIG_UBIFS_FS=y
CONFIG_UNMAP_KERNEL_AT_EL0=y
CONFIG_USB_SUPPORT=y
CONFIG_VMAP_STACK=y
CONFIG_WATCHDOG_CORE=y
CONFIG_XPS=y
CONFIG_XXHASH=y
CONFIG_ZLIB_DEFLATE=y

View File

@ -6,6 +6,17 @@ include $(INCLUDE_DIR)/image.mk
DEVICE_VARS += ASUS_PRODUCTID ASUS_BUILD_NO ASUS_FW_REV ASUS_EXT_NO
DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_REGION
define Image/Prepare
cp bootfs-generic.its $(KDIR)/
endef
define Build/bootfs
cat $@ | $(STAGING_DIR_HOST)/bin/lzma e -eos -si -so > $@.tmp
mv $@.tmp $@
sed -i "s=\$${kernel}=$@=" $(KDIR)/bootfs-generic.its
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $(KDIR)/bootfs-generic.its $(KDIR)/bootfs-generic.itb
endef
define Build/bcm4908asus
$(STAGING_DIR_HOST)/bin/bcm4908asus create -i $@ \
-p $(ASUS_PRODUCTID) -b $(ASUS_BUILD_NO) -f $(ASUS_FW_REV) \

View File

@ -0,0 +1,25 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
/ {
description = "OpenWrt bootfs image";
#address-cells = <1>;
images {
kernel {
description = "Linux kernel";
data = /incbin/("${kernel}");
type = "kernel";
os = "linux";
arch = "arm64";
compression = "lzma";
load = <0x80000>;
entry = <0x80000>;
hash-1 {
algo = "sha256";
};
};
};
};

View File

@ -33,7 +33,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
break;
default:
switch (port) {
@@ -1223,9 +1228,7 @@ static const u16 bcm_sf2_4908_reg_offset
@@ -1227,9 +1232,7 @@ static const u16 bcm_sf2_4908_reg_offset
[REG_PHY_REVISION] = 0x14,
[REG_SPHY_CNTRL] = 0x24,
[REG_CROSSBAR] = 0xc8,

View File

@ -0,0 +1,46 @@
From fc516d3a6aa2c6ffe27d0da8818d13839e023e7e Mon Sep 17 00:00:00 2001
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Fri, 21 May 2021 10:46:14 -0700
Subject: [PATCH] net: dsa: bcm_sf2: Fix bcm_sf2_reg_rgmii_cntrl() call for
non-RGMII port
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
We cannot call bcm_sf2_reg_rgmii_cntrl() for a port that is not RGMII,
yet we do that in bcm_sf2_sw_mac_link_up() irrespective of the port's
interface. Move that read until we have properly qualified the PHY
interface mode. This avoids triggering a warning on 7278 platforms that
have GMII ports.
Fixes: 55cfeb396965 ("net: dsa: bcm_sf2: add function finding RGMII register")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/dsa/bcm_sf2.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -821,11 +821,9 @@ static void bcm_sf2_sw_mac_link_up(struc
bcm_sf2_sw_mac_link_set(ds, port, interface, true);
if (port != core_readl(priv, CORE_IMP0_PRT_ID)) {
- u32 reg_rgmii_ctrl;
+ u32 reg_rgmii_ctrl = 0;
u32 reg, offset;
- reg_rgmii_ctrl = bcm_sf2_reg_rgmii_cntrl(priv, port);
-
if (priv->type == BCM4908_DEVICE_ID ||
priv->type == BCM7445_DEVICE_ID)
offset = CORE_STS_OVERRIDE_GMIIP_PORT(port);
@@ -836,6 +834,7 @@ static void bcm_sf2_sw_mac_link_up(struc
interface == PHY_INTERFACE_MODE_RGMII_TXID ||
interface == PHY_INTERFACE_MODE_MII ||
interface == PHY_INTERFACE_MODE_REVMII) {
+ reg_rgmii_ctrl = bcm_sf2_reg_rgmii_cntrl(priv, port);
reg = reg_readl(priv, reg_rgmii_ctrl);
reg &= ~(RX_PAUSE_EN | TX_PAUSE_EN);

View File

@ -0,0 +1,50 @@
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
Date: Tue, 9 Nov 2021 11:39:42 +0100
Subject: [PATCH] arm64: dts: broadcom: bcm4908: add TWD block
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
BCM4908 contains TWD block that provides few functions:
1. Timers
2. Wathchdog
3. Software reset
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
.../boot/dts/broadcom/bcm4908/bcm4908.dtsi | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
@@ -273,9 +273,18 @@
#size-cells = <1>;
ranges = <0x00 0x00 0xff800000 0x3000>;
- timer: timer@400 {
- compatible = "brcm,bcm6328-timer", "syscon";
- reg = <0x400 0x3c>;
+ twd: timer-mfd@400 {
+ compatible = "brcm,bcm4908-twd", "brcm,twd", "simple-mfd", "syscon";
+ reg = <0x400 0x4c>;
+ ranges = <0x0 0x400 0x4c>;
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ watchdog@28 {
+ compatible = "brcm,bcm7038-wdt";
+ reg = <0x28 0x8>;
+ };
};
gpio0: gpio-controller@500 {
@@ -329,7 +338,7 @@
reboot {
compatible = "syscon-reboot";
- regmap = <&timer>;
+ regmap = <&twd>;
offset = <0x34>;
mask = <1>;
};

View File

@ -29,7 +29,7 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -1484,10 +1484,14 @@ static int bcm_sf2_sw_probe(struct platf
@@ -1487,10 +1487,14 @@ static int bcm_sf2_sw_probe(struct platf
rev = reg_readl(priv, REG_PHY_REVISION);
priv->hw_params.gphy_rev = rev & PHY_REVISION_MASK;

View File

@ -15,7 +15,7 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -1498,6 +1498,12 @@ static int bcm_sf2_sw_probe(struct platf
@@ -1501,6 +1501,12 @@ static int bcm_sf2_sw_probe(struct platf
priv->hw_params.core_rev >> 8, priv->hw_params.core_rev & 0xff,
priv->irq0, priv->irq1);

View File

@ -0,0 +1,25 @@
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
Date: Tue, 9 Nov 2021 11:34:28 +0100
Subject: [PATCH] watchdog: bcm7038_wdt: allow building on ARCH_BCM4908
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The same hardware block is present on BCM4908 SoCs family.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
drivers/watchdog/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -1800,7 +1800,7 @@ config BCM7038_WDT
tristate "BCM7038 Watchdog"
select WATCHDOG_CORE
depends on HAS_IOMEM
- depends on ARCH_BRCMSTB || BMIPS_GENERIC || COMPILE_TEST
+ depends on ARCH_BCM4908 || ARCH_BRCMSTB || BMIPS_GENERIC || COMPILE_TEST
help
Watchdog driver for the built-in hardware in Broadcom 7038 and
later SoCs used in set-top boxes. BCM7038 was made public

View File

@ -0,0 +1,50 @@
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
Date: Tue, 9 Nov 2021 11:39:42 +0100
Subject: [PATCH] arm64: dts: broadcom: bcm4908: add TWD block
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
BCM4908 contains TWD block that provides few functions:
1. Timers
2. Wathchdog
3. Software reset
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
.../boot/dts/broadcom/bcm4908/bcm4908.dtsi | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
--- a/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
+++ b/arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi
@@ -273,9 +273,18 @@
#size-cells = <1>;
ranges = <0x00 0x00 0xff800000 0x3000>;
- timer: timer@400 {
- compatible = "brcm,bcm6328-timer", "syscon";
- reg = <0x400 0x3c>;
+ twd: timer-mfd@400 {
+ compatible = "brcm,bcm4908-twd", "brcm,twd", "simple-mfd", "syscon";
+ reg = <0x400 0x4c>;
+ ranges = <0x0 0x400 0x4c>;
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ watchdog@28 {
+ compatible = "brcm,bcm7038-wdt";
+ reg = <0x28 0x8>;
+ };
};
gpio0: gpio-controller@500 {
@@ -329,7 +338,7 @@
reboot {
compatible = "syscon-reboot";
- regmap = <&timer>;
+ regmap = <&twd>;
offset = <0x34>;
mask = <1>;
};

View File

@ -0,0 +1,25 @@
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
Date: Tue, 9 Nov 2021 11:34:28 +0100
Subject: [PATCH] watchdog: bcm7038_wdt: allow building on ARCH_BCM4908
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The same hardware block is present on BCM4908 SoCs family.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
drivers/watchdog/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -1759,7 +1759,7 @@ config BCM7038_WDT
tristate "BCM7038 Watchdog"
select WATCHDOG_CORE
depends on HAS_IOMEM
- depends on ARCH_BRCMSTB || BMIPS_GENERIC || COMPILE_TEST
+ depends on ARCH_BCM4908 || ARCH_BRCMSTB || BMIPS_GENERIC || COMPILE_TEST
help
Watchdog driver for the built-in hardware in Broadcom 7038 and
later SoCs used in set-top boxes. BCM7038 was made public

View File

@ -1,106 +0,0 @@
From 6dba4bdfd7a30e77b848a45404b224588bf989e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
Date: Fri, 8 Oct 2021 22:59:38 +0200
Subject: [PATCH] Revert "pinctrl: bcm: ns: support updated DT binding as
syscon subnode"
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This reverts commit a49d784d5a8272d0f63c448fe8dc69e589db006e.
The updated binding was wrong / invalid and has been reverted. There
isn't any upstream kernel DTS using it and Broadcom isn't known to use
it neither. There is close to zero chance this will cause regression for
anyone.
Actually in-kernel bcm5301x.dtsi still uses the old good binding and so
it's broken since the driver update. This revert fixes it.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Link: https://lore.kernel.org/r/20211008205938.29925-3-zajec5@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/pinctrl/bcm/pinctrl-ns.c | 29 ++++++++++-------------------
1 file changed, 10 insertions(+), 19 deletions(-)
--- a/drivers/pinctrl/bcm/pinctrl-ns.c
+++ b/drivers/pinctrl/bcm/pinctrl-ns.c
@@ -5,7 +5,6 @@
#include <linux/err.h>
#include <linux/io.h>
-#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
@@ -13,7 +12,6 @@
#include <linux/pinctrl/pinctrl.h>
#include <linux/pinctrl/pinmux.h>
#include <linux/platform_device.h>
-#include <linux/regmap.h>
#include <linux/slab.h>
#define FLAG_BCM4708 BIT(1)
@@ -24,8 +22,7 @@ struct ns_pinctrl {
struct device *dev;
unsigned int chipset_flag;
struct pinctrl_dev *pctldev;
- struct regmap *regmap;
- u32 offset;
+ void __iomem *base;
struct pinctrl_desc pctldesc;
struct ns_pinctrl_group *groups;
@@ -232,9 +229,9 @@ static int ns_pinctrl_set_mux(struct pin
unset |= BIT(pin_number);
}
- regmap_read(ns_pinctrl->regmap, ns_pinctrl->offset, &tmp);
+ tmp = readl(ns_pinctrl->base);
tmp &= ~unset;
- regmap_write(ns_pinctrl->regmap, ns_pinctrl->offset, tmp);
+ writel(tmp, ns_pinctrl->base);
return 0;
}
@@ -266,13 +263,13 @@ static const struct of_device_id ns_pinc
static int ns_pinctrl_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
- struct device_node *np = dev->of_node;
const struct of_device_id *of_id;
struct ns_pinctrl *ns_pinctrl;
struct pinctrl_desc *pctldesc;
struct pinctrl_pin_desc *pin;
struct ns_pinctrl_group *group;
struct ns_pinctrl_function *function;
+ struct resource *res;
int i;
ns_pinctrl = devm_kzalloc(dev, sizeof(*ns_pinctrl), GFP_KERNEL);
@@ -290,18 +287,12 @@ static int ns_pinctrl_probe(struct platf
return -EINVAL;
ns_pinctrl->chipset_flag = (uintptr_t)of_id->data;
- ns_pinctrl->regmap = syscon_node_to_regmap(of_get_parent(np));
- if (IS_ERR(ns_pinctrl->regmap)) {
- int err = PTR_ERR(ns_pinctrl->regmap);
-
- dev_err(dev, "Failed to map pinctrl regs: %d\n", err);
-
- return err;
- }
-
- if (of_property_read_u32(np, "offset", &ns_pinctrl->offset)) {
- dev_err(dev, "Failed to get register offset\n");
- return -ENOENT;
+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
+ "cru_gpio_control");
+ ns_pinctrl->base = devm_ioremap_resource(dev, res);
+ if (IS_ERR(ns_pinctrl->base)) {
+ dev_err(dev, "Failed to map pinctrl regs\n");
+ return PTR_ERR(ns_pinctrl->base);
}
memcpy(pctldesc, &ns_pinctrl_desc, sizeof(*pctldesc));

View File

@ -1,20 +0,0 @@
From: Felix Fietkau <nbd@nbd.name>
Subject: [PATCH] ARM: BCM5301X: Add power button for Buffalo WZR-1750DHP
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts
+++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts
@@ -100,6 +100,12 @@
gpio-keys {
compatible = "gpio-keys";
+ power {
+ label = "Power";
+ linux,code = <KEY_POWER>;
+ gpios = <&chipcommon 1 GPIO_ACTIVE_LOW>;
+ };
+
restart {
label = "Reset";
linux,code = <KEY_RESTART>;

View File

@ -1,53 +0,0 @@
From 4abdde3ad6bc0b3b157c4bf6ec0bf139d11d07e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
Date: Wed, 13 May 2015 14:13:28 +0200
Subject: [PATCH] b53: add hacky CPU port fixes for devices not using port 5
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
---
drivers/net/phy/b53/b53_common.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/drivers/net/phy/b53/b53_common.c
+++ b/drivers/net/phy/b53/b53_common.c
@@ -28,6 +28,7 @@
#include <linux/of.h>
#include <linux/of_net.h>
#include <linux/platform_data/b53.h>
+#include <linux/of.h>
#include "b53_regs.h"
#include "b53_priv.h"
@@ -1587,6 +1588,29 @@ static int b53_switch_init(struct b53_de
return ret;
}
+ /* Set correct CPU port */
+ if (of_machine_is_compatible("asus,rt-ac87u"))
+ sw_dev->cpu_port = 7;
+ else if (of_machine_is_compatible("netgear,r7900"))
+ sw_dev->cpu_port = 8;
+ else if (of_machine_is_compatible("netgear,r8000"))
+ sw_dev->cpu_port = 8;
+ else if (of_machine_is_compatible("netgear,r8500"))
+ sw_dev->cpu_port = 8;
+
+ /* Enable extra ports */
+ if (of_machine_is_compatible("tenda,ac9"))
+ dev->enabled_ports |= BIT(5);
+
+ /*
+ * Workaround for devices using port 8 (connected to the 3rd iface).
+ * For some reason it doesn't work (no packets on eth2).
+ */
+ if (of_machine_is_compatible("netgear,r7900") ||
+ of_machine_is_compatible("netgear,r8000") ||
+ (of_machine_is_compatible("linksys,panamera") && dev->chip_id == BCM53012_DEVICE_ID))
+ sw_dev->cpu_port = 5;
+
dev->enabled_ports |= BIT(sw_dev->cpu_port);
sw_dev->ports = fls(dev->enabled_ports);

View File

@ -18,7 +18,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6793,15 +6793,10 @@ void __netif_napi_del(struct napi_struct
@@ -6799,15 +6799,10 @@ void __netif_napi_del(struct napi_struct
}
EXPORT_SYMBOL(__netif_napi_del);
@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
weight = n->weight;
/* This NAPI_STATE_SCHED test is for avoiding a race
@@ -6821,7 +6816,7 @@ static int napi_poll(struct napi_struct
@@ -6827,7 +6822,7 @@ static int napi_poll(struct napi_struct
n->poll, work, weight);
if (likely(work < weight))
@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* Drivers must not modify the NAPI state if they
* consume the entire weight. In such cases this code
@@ -6830,7 +6825,7 @@ static int napi_poll(struct napi_struct
@@ -6836,7 +6831,7 @@ static int napi_poll(struct napi_struct
*/
if (unlikely(napi_disable_pending(n))) {
napi_complete(n);
@ -53,7 +53,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
if (n->gro_bitmask) {
@@ -6848,12 +6843,29 @@ static int napi_poll(struct napi_struct
@@ -6854,12 +6849,29 @@ static int napi_poll(struct napi_struct
if (unlikely(!list_empty(&n->poll_list))) {
pr_warn_once("%s: Budget exhausted after napi rescheduled\n",
n->dev ? n->dev->name : "backlog");

View File

@ -131,7 +131,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static int __dev_open(struct net_device *dev, struct netlink_ext_ack *extack)
{
const struct net_device_ops *ops = dev->netdev_ops;
@@ -4255,6 +4277,21 @@ int gro_normal_batch __read_mostly = 8;
@@ -4261,6 +4283,21 @@ int gro_normal_batch __read_mostly = 8;
static inline void ____napi_schedule(struct softnet_data *sd,
struct napi_struct *napi)
{
@ -153,7 +153,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
list_add_tail(&napi->poll_list, &sd->poll_list);
__raise_softirq_irqoff(NET_RX_SOFTIRQ);
}
@@ -6746,6 +6783,12 @@ void netif_napi_add(struct net_device *d
@@ -6752,6 +6789,12 @@ void netif_napi_add(struct net_device *d
set_bit(NAPI_STATE_NPSVC, &napi->state);
list_add_rcu(&napi->dev_list, &dev->napi_list);
napi_hash_add(napi);
@ -166,7 +166,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
EXPORT_SYMBOL(netif_napi_add);
@@ -6762,9 +6805,28 @@ void napi_disable(struct napi_struct *n)
@@ -6768,9 +6811,28 @@ void napi_disable(struct napi_struct *n)
hrtimer_cancel(&n->timer);
clear_bit(NAPI_STATE_DISABLE, &n->state);
@ -195,7 +195,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static void flush_gro_hash(struct napi_struct *napi)
{
int i;
@@ -6790,6 +6852,11 @@ void __netif_napi_del(struct napi_struct
@@ -6796,6 +6858,11 @@ void __netif_napi_del(struct napi_struct
flush_gro_hash(napi);
napi->gro_bitmask = 0;
@ -207,7 +207,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
EXPORT_SYMBOL(__netif_napi_del);
@@ -6871,6 +6938,51 @@ static int napi_poll(struct napi_struct
@@ -6877,6 +6944,51 @@ static int napi_poll(struct napi_struct
return work;
}

View File

@ -57,7 +57,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
* @n: NAPI context
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4281,8 +4281,9 @@ static inline void ____napi_schedule(str
@@ -4287,8 +4287,9 @@ static inline void ____napi_schedule(str
if (test_bit(NAPI_STATE_THREADED, &napi->state)) {
/* Paired with smp_mb__before_atomic() in
@ -69,7 +69,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
* wake_up_process() when it's not NULL.
*/
thread = READ_ONCE(napi->thread);
@@ -6756,6 +6757,49 @@ static void init_gro_hash(struct napi_st
@@ -6762,6 +6763,49 @@ static void init_gro_hash(struct napi_st
napi->gro_bitmask = 0;
}

View File

@ -45,7 +45,7 @@ Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
enum gro_result {
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4288,6 +4288,8 @@ static inline void ____napi_schedule(str
@@ -4294,6 +4294,8 @@ static inline void ____napi_schedule(str
*/
thread = READ_ONCE(napi->thread);
if (thread) {
@ -54,7 +54,7 @@ Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
wake_up_process(thread);
return;
}
@@ -6548,7 +6550,8 @@ bool napi_complete_done(struct napi_stru
@@ -6554,7 +6556,8 @@ bool napi_complete_done(struct napi_stru
WARN_ON_ONCE(!(val & NAPIF_STATE_SCHED));
@ -64,7 +64,7 @@ Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
/* If STATE_MISSED was set, leave STATE_SCHED set,
* because we will call napi->poll() one more time.
@@ -6984,16 +6987,25 @@ static int napi_poll(struct napi_struct
@@ -6990,16 +6993,25 @@ static int napi_poll(struct napi_struct
static int napi_thread_wait(struct napi_struct *napi)
{

View File

@ -34,7 +34,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6991,7 +6991,7 @@ static int napi_thread_wait(struct napi_
@@ -6997,7 +6997,7 @@ static int napi_thread_wait(struct napi_
set_current_state(TASK_INTERRUPTIBLE);
@ -43,7 +43,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* Testing SCHED_THREADED bit here to make sure the current
* kthread owns this napi and could poll on this napi.
* Testing SCHED bit is not enough because SCHED bit might be
@@ -7009,6 +7009,7 @@ static int napi_thread_wait(struct napi_
@@ -7015,6 +7015,7 @@ static int napi_thread_wait(struct napi_
set_current_state(TASK_INTERRUPTIBLE);
}
__set_current_state(TASK_RUNNING);

View File

@ -933,7 +933,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
}
--- a/drivers/net/ethernet/microchip/lan743x_main.c
+++ b/drivers/net/ethernet/microchip/lan743x_main.c
@@ -2815,7 +2815,6 @@ static int lan743x_pcidev_probe(struct p
@@ -2837,7 +2837,6 @@ static int lan743x_pcidev_probe(struct p
{
struct lan743x_adapter *adapter = NULL;
struct net_device *netdev = NULL;
@ -941,7 +941,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int ret = -ENODEV;
netdev = devm_alloc_etherdev(&pdev->dev,
@@ -2832,9 +2831,7 @@ static int lan743x_pcidev_probe(struct p
@@ -2854,9 +2853,7 @@ static int lan743x_pcidev_probe(struct p
NETIF_MSG_IFDOWN | NETIF_MSG_TX_QUEUED;
netdev->max_mtu = LAN743X_MAX_FRAME_SIZE;
@ -954,7 +954,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (ret)
--- a/drivers/net/ethernet/nxp/lpc_eth.c
+++ b/drivers/net/ethernet/nxp/lpc_eth.c
@@ -1348,9 +1348,7 @@ static int lpc_eth_drv_probe(struct plat
@@ -1347,9 +1347,7 @@ static int lpc_eth_drv_probe(struct plat
__lpc_get_mac(pldat, ndev->dev_addr);
if (!is_valid_ether_addr(ndev->dev_addr)) {

Some files were not shown because too many files have changed in this diff Show More