mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 01:13:00 +02:00
Upgrade Linux kernel to 6.12.66
This commit is contained in:
@@ -29,7 +29,7 @@ BR2_ROOTFS_POST_BUILD_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-build
|
||||
BR2_ROOTFS_POST_IMAGE_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-image.sh"
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.18.5"
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.66"
|
||||
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="${BR2_EXTERNAL_INFIX_PATH}/board/aarch32/linux_defconfig"
|
||||
BR2_LINUX_KERNEL_INSTALL_TARGET=y
|
||||
|
||||
@@ -29,7 +29,7 @@ BR2_ROOTFS_POST_BUILD_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-build
|
||||
BR2_ROOTFS_POST_IMAGE_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-image.sh"
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.18.5"
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.66"
|
||||
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="${BR2_EXTERNAL_INFIX_PATH}/board/aarch32/linux_defconfig"
|
||||
BR2_LINUX_KERNEL_INSTALL_TARGET=y
|
||||
|
||||
@@ -27,7 +27,7 @@ BR2_ROOTFS_OVERLAY="${BR2_EXTERNAL_INFIX_PATH}/board/common/rootfs ${BR2_EXTERNA
|
||||
BR2_ROOTFS_POST_BUILD_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-build.sh"
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.18.5"
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.66"
|
||||
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="${BR2_EXTERNAL_INFIX_PATH}/board/aarch64/linux_defconfig"
|
||||
BR2_LINUX_KERNEL_INSTALL_TARGET=y
|
||||
|
||||
@@ -26,7 +26,7 @@ BR2_ROOTFS_OVERLAY="${BR2_EXTERNAL_INFIX_PATH}/board/common/rootfs ${BR2_EXTERNA
|
||||
BR2_ROOTFS_POST_BUILD_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-build.sh"
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.18.5"
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.66"
|
||||
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="${BR2_EXTERNAL_INFIX_PATH}/board/aarch64/linux_defconfig"
|
||||
BR2_LINUX_KERNEL_INSTALL_TARGET=y
|
||||
|
||||
@@ -26,7 +26,7 @@ BR2_ROOTFS_OVERLAY="${BR2_EXTERNAL_INFIX_PATH}/board/common/rootfs ${BR2_EXTERNA
|
||||
BR2_ROOTFS_POST_BUILD_SCRIPT="board/qemu/x86_64/post-build.sh ${BR2_EXTERNAL_INFIX_PATH}/board/common/post-build.sh"
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.18.5"
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.66"
|
||||
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="${BR2_EXTERNAL_INFIX_PATH}/board/x86_64/linux_defconfig"
|
||||
BR2_LINUX_KERNEL_INSTALL_TARGET=y
|
||||
|
||||
@@ -26,7 +26,7 @@ BR2_ROOTFS_OVERLAY="${BR2_EXTERNAL_INFIX_PATH}/board/common/rootfs ${BR2_EXTERNA
|
||||
BR2_ROOTFS_POST_BUILD_SCRIPT="board/qemu/x86_64/post-build.sh ${BR2_EXTERNAL_INFIX_PATH}/board/common/post-build.sh"
|
||||
BR2_LINUX_KERNEL=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.18.5"
|
||||
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.66"
|
||||
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
||||
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="${BR2_EXTERNAL_INFIX_PATH}/board/x86_64/linux_defconfig"
|
||||
BR2_LINUX_KERNEL_INSTALL_TARGET=y
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ All notable changes to the project are documented in this file.
|
||||
|
||||
### Changes
|
||||
|
||||
- Upgrade Linux kernel to 6.18.5 (LTS)
|
||||
- Upgrade Linux kernel to 6.12.66 (LTS)
|
||||
- Upgrade libyang to 4.2.2
|
||||
- Upgrade sysrepo to 4.2.10
|
||||
- Upgrade netopeer2 (NETCONF) to 2.7.0
|
||||
|
||||
+4
-13
@@ -1,27 +1,21 @@
|
||||
From 4ef0fd107eae67ef12cb2d38ab11882e0f2a3776 Mon Sep 17 00:00:00 2001
|
||||
From b87df45eb45efe09438f1d8de0bff8bc9ebf8cc1 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Tue, 12 Mar 2024 10:27:24 +0100
|
||||
Subject: [PATCH 15/29] [FIX] net: dsa: mv88e6xxx: Fix timeout on waiting for
|
||||
Subject: [PATCH 01/30] [FIX] net: dsa: mv88e6xxx: Fix timeout on waiting for
|
||||
PPU on 6393X
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
|
||||
In a multi-chip setup, delays of up to 750ms are observed before the
|
||||
device (6393X) signals completion of PPU initialization (Global 1,
|
||||
register 0, bit 15). Therefore, increase the timeout threshold to 1s.
|
||||
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
index b4d48997bf46..73264c1c1565 100644
|
||||
index 211c219dd52d..d64c3eef4447 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
@@ -87,7 +87,7 @@ int mv88e6xxx_write(struct mv88e6xxx_chip *chip, int addr, int reg, u16 val)
|
||||
@@ -86,7 +86,7 @@ int mv88e6xxx_write(struct mv88e6xxx_chip *chip, int addr, int reg, u16 val)
|
||||
int mv88e6xxx_wait_mask(struct mv88e6xxx_chip *chip, int addr, int reg,
|
||||
u16 mask, u16 val)
|
||||
{
|
||||
@@ -30,6 +24,3 @@ index b4d48997bf46..73264c1c1565 100644
|
||||
u16 data;
|
||||
int err;
|
||||
int i;
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+4
-13
@@ -1,12 +1,8 @@
|
||||
From b2be28e5956e3d7547acb591da968f4f64d812cb Mon Sep 17 00:00:00 2001
|
||||
From 7b3d70f27fa7e80148589592bef03f154acdabee Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Wed, 27 Mar 2024 15:52:43 +0100
|
||||
Subject: [PATCH 16/29] net: dsa: mv88e6xxx: Improve indirect register access
|
||||
Subject: [PATCH 02/30] net: dsa: mv88e6xxx: Improve indirect register access
|
||||
perf on 6393
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
|
||||
When operating in multi-chip mode, the 6393 family maps a subset of
|
||||
commonly used global registers to the outermost address space (in
|
||||
@@ -16,8 +12,6 @@ previous families).
|
||||
Therefore, add a new set of SMI operations which remaps accesses to
|
||||
such registers to the corresponding directly addressable register. All
|
||||
other accesses use the regular indirect interface.
|
||||
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 7 +++
|
||||
drivers/net/dsa/mv88e6xxx/global1.h | 3 ++
|
||||
@@ -27,10 +21,10 @@ Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
5 files changed, 119 insertions(+)
|
||||
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
index 73264c1c1565..2a27e41a2dea 100644
|
||||
index d64c3eef4447..47138492885e 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
@@ -6566,6 +6566,13 @@ static int mv88e6xxx_detect(struct mv88e6xxx_chip *chip)
|
||||
@@ -6539,6 +6539,13 @@ static int mv88e6xxx_detect(struct mv88e6xxx_chip *chip)
|
||||
/* Update the compatible info with the probed one */
|
||||
chip->info = info;
|
||||
|
||||
@@ -214,6 +208,3 @@ index c6c71d5757f5..788cf68b7b33 100644
|
||||
int mv88e6xxx_smi_init(struct mv88e6xxx_chip *chip,
|
||||
struct mii_bus *bus, int sw_addr);
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+5
-14
@@ -1,12 +1,8 @@
|
||||
From 582aea58b399dd70bab23a8313bc640096ca7c9d Mon Sep 17 00:00:00 2001
|
||||
From 6c5ed862c7b329b407bba3622b749393cb585abc Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Mon, 22 Apr 2024 23:18:01 +0200
|
||||
Subject: [PATCH 17/29] net: dsa: mv88e6xxx: Honor ports being managed via
|
||||
Subject: [PATCH 03/30] net: dsa: mv88e6xxx: Honor ports being managed via
|
||||
in-band-status
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
|
||||
Keep all link parameters in their unforced states when the port is
|
||||
declared as being managed via in-band-status, and let the MAC
|
||||
@@ -16,17 +12,15 @@ USXGMII autoneg)
|
||||
This state is the default set up by mv88e6xxx_port_setup_mac(), so all
|
||||
we have to do is to make the phylink MAC callbacks no-ops in cases
|
||||
when in-band-status is being used.
|
||||
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
index 2a27e41a2dea..7da618978ba7 100644
|
||||
index 47138492885e..b96bc12dc6a8 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
@@ -965,6 +965,9 @@ static void mv88e6xxx_mac_link_down(struct phylink_config *config,
|
||||
@@ -964,6 +964,9 @@ static void mv88e6xxx_mac_link_down(struct phylink_config *config,
|
||||
int port = dp->index;
|
||||
int err = 0;
|
||||
|
||||
@@ -36,7 +30,7 @@ index 2a27e41a2dea..7da618978ba7 100644
|
||||
ops = chip->info->ops;
|
||||
|
||||
mv88e6xxx_reg_lock(chip);
|
||||
@@ -997,6 +1000,9 @@ static void mv88e6xxx_mac_link_up(struct phylink_config *config,
|
||||
@@ -996,6 +999,9 @@ static void mv88e6xxx_mac_link_up(struct phylink_config *config,
|
||||
int port = dp->index;
|
||||
int err = 0;
|
||||
|
||||
@@ -46,6 +40,3 @@ index 2a27e41a2dea..7da618978ba7 100644
|
||||
ops = chip->info->ops;
|
||||
|
||||
mv88e6xxx_reg_lock(chip);
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+5
-14
@@ -1,12 +1,8 @@
|
||||
From 8b1ed160c587b517fb6bcb803b78842aa9ab9488 Mon Sep 17 00:00:00 2001
|
||||
From d0e9e4d1d020386e2f5ae95f55b8c8f4cb54bdb9 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Wed, 24 Apr 2024 22:41:04 +0200
|
||||
Subject: [PATCH 18/29] net: dsa: mv88e6xxx: Limit rsvd2cpu policy to user
|
||||
Subject: [PATCH 04/30] net: dsa: mv88e6xxx: Limit rsvd2cpu policy to user
|
||||
ports on 6393X
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
|
||||
For packets with a DA in the IEEE reserved L2 group range, originating
|
||||
from a CPU, forward it as normal, rather than classifying it as
|
||||
@@ -32,17 +28,15 @@ Before this change, due to rsvd2cpu being enabled on the CPU port, the
|
||||
switch would try to trap it back to the CPU. Given that the CPU is
|
||||
trusted, instead assume that it indeed meant for the packet to be
|
||||
forwarded like any other.
|
||||
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/port.c | 31 +++++++++++++++++++++++++------
|
||||
1 file changed, 25 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c
|
||||
index 66b1b7277281..df19dfa5cc3d 100644
|
||||
index 04053fdc6489..f25fb3214acb 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/port.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/port.c
|
||||
@@ -1434,6 +1434,23 @@ static int mv88e6393x_port_policy_write_all(struct mv88e6xxx_chip *chip,
|
||||
@@ -1432,6 +1432,23 @@ static int mv88e6393x_port_policy_write_all(struct mv88e6xxx_chip *chip,
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -66,7 +60,7 @@ index 66b1b7277281..df19dfa5cc3d 100644
|
||||
int mv88e6393x_set_egress_port(struct mv88e6xxx_chip *chip,
|
||||
enum mv88e6xxx_egress_direction direction,
|
||||
int port)
|
||||
@@ -1475,26 +1492,28 @@ int mv88e6393x_port_mgmt_rsvd2cpu(struct mv88e6xxx_chip *chip)
|
||||
@@ -1473,26 +1490,28 @@ int mv88e6393x_port_mgmt_rsvd2cpu(struct mv88e6xxx_chip *chip)
|
||||
int err;
|
||||
|
||||
/* Consider the frames with reserved multicast destination
|
||||
@@ -101,6 +95,3 @@ index 66b1b7277281..df19dfa5cc3d 100644
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -0,0 +1,310 @@
|
||||
From d096db5ffef40d946204127bd249dafa06d0de26 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Thu, 16 Nov 2023 19:44:32 +0100
|
||||
Subject: [PATCH 05/30] net: dsa: mv88e6xxx: Add LED infrastructure
|
||||
|
||||
Parse DT for LEDs and register them for devices that support it,
|
||||
though no actual implementations exist yet.
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/Makefile | 1 +
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 5 +-
|
||||
drivers/net/dsa/mv88e6xxx/chip.h | 16 +++
|
||||
drivers/net/dsa/mv88e6xxx/leds.c | 185 +++++++++++++++++++++++++++++
|
||||
drivers/net/dsa/mv88e6xxx/leds.h | 12 ++
|
||||
5 files changed, 218 insertions(+), 1 deletion(-)
|
||||
create mode 100644 drivers/net/dsa/mv88e6xxx/leds.c
|
||||
create mode 100644 drivers/net/dsa/mv88e6xxx/leds.h
|
||||
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/Makefile b/drivers/net/dsa/mv88e6xxx/Makefile
|
||||
index a9a9651187db..6720d9303914 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/Makefile
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/Makefile
|
||||
@@ -9,6 +9,7 @@ mv88e6xxx-objs += global2.o
|
||||
mv88e6xxx-objs += global2_avb.o
|
||||
mv88e6xxx-objs += global2_scratch.o
|
||||
mv88e6xxx-$(CONFIG_NET_DSA_MV88E6XXX_PTP) += hwtstamp.o
|
||||
+mv88e6xxx-objs += leds.o
|
||||
mv88e6xxx-objs += pcs-6185.o
|
||||
mv88e6xxx-objs += pcs-6352.o
|
||||
mv88e6xxx-objs += pcs-639x.o
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
index b96bc12dc6a8..f92b7d7d5780 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "global1.h"
|
||||
#include "global2.h"
|
||||
#include "hwtstamp.h"
|
||||
+#include "leds.h"
|
||||
#include "phy.h"
|
||||
#include "port.h"
|
||||
#include "ptp.h"
|
||||
@@ -4171,7 +4172,9 @@ static int mv88e6xxx_port_setup(struct dsa_switch *ds, int port)
|
||||
return err;
|
||||
}
|
||||
|
||||
- return mv88e6xxx_setup_devlink_regions_port(ds, port);
|
||||
+ err = err ? : mv88e6xxx_setup_devlink_regions_port(ds, port);
|
||||
+ err = err ? : mv88e6xxx_port_setup_leds(ds, port);
|
||||
+ return err;
|
||||
}
|
||||
|
||||
static void mv88e6xxx_port_teardown(struct dsa_switch *ds, int port)
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h
|
||||
index a54682240839..32c87ab754d1 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.h
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.h
|
||||
@@ -207,6 +207,7 @@ struct mv88e6xxx_avb_ops;
|
||||
struct mv88e6xxx_ptp_ops;
|
||||
struct mv88e6xxx_pcs_ops;
|
||||
struct mv88e6xxx_cc_coeffs;
|
||||
+struct mv88e6xxx_led_ops;
|
||||
|
||||
struct mv88e6xxx_irq {
|
||||
u16 masked;
|
||||
@@ -330,6 +331,8 @@ struct mv88e6xxx_hw_stat {
|
||||
int type;
|
||||
};
|
||||
|
||||
+struct mv88e6xxx_led;
|
||||
+
|
||||
struct mv88e6xxx_chip {
|
||||
const struct mv88e6xxx_info *info;
|
||||
|
||||
@@ -661,6 +664,9 @@ struct mv88e6xxx_ops {
|
||||
/* Precision Time Protocol operations */
|
||||
const struct mv88e6xxx_ptp_ops *ptp_ops;
|
||||
|
||||
+ /* LED operations */
|
||||
+ const struct mv88e6xxx_led_ops *led_ops;
|
||||
+
|
||||
/* Phylink */
|
||||
void (*phylink_get_caps)(struct mv88e6xxx_chip *chip, int port,
|
||||
struct phylink_config *config);
|
||||
@@ -740,7 +746,17 @@ struct mv88e6xxx_pcs_ops {
|
||||
void (*pcs_teardown)(struct mv88e6xxx_chip *chip, int port);
|
||||
struct phylink_pcs *(*pcs_select)(struct mv88e6xxx_chip *chip, int port,
|
||||
phy_interface_t mode);
|
||||
+};
|
||||
|
||||
+struct mv88e6xxx_led_ops {
|
||||
+ int (*brightness_set)(struct mv88e6xxx_led *led,
|
||||
+ enum led_brightness brightness);
|
||||
+ int (*blink_set)(struct mv88e6xxx_led *led,
|
||||
+ unsigned long *delay_on, unsigned long *delay_off);
|
||||
+ int (*hw_control_is_supported)(struct mv88e6xxx_led *led,
|
||||
+ unsigned long flags);
|
||||
+ int (*hw_control_set)(struct mv88e6xxx_led *led, unsigned long flags);
|
||||
+ int (*hw_control_get)(struct mv88e6xxx_led *led, unsigned long *flags);
|
||||
};
|
||||
|
||||
static inline bool mv88e6xxx_has_stu(struct mv88e6xxx_chip *chip)
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/leds.c b/drivers/net/dsa/mv88e6xxx/leds.c
|
||||
new file mode 100644
|
||||
index 000000000000..e3de10991f29
|
||||
--- /dev/null
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/leds.c
|
||||
@@ -0,0 +1,185 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
+#include <net/dsa.h>
|
||||
+
|
||||
+#include "chip.h"
|
||||
+#include "leds.h"
|
||||
+#include "port.h"
|
||||
+
|
||||
+struct mv88e6xxx_led {
|
||||
+ struct mv88e6xxx_chip *chip;
|
||||
+ int port;
|
||||
+ u8 index;
|
||||
+
|
||||
+ struct led_classdev ldev;
|
||||
+};
|
||||
+
|
||||
+static int mv88e6xxx_led_brightness_set(struct led_classdev *ldev,
|
||||
+ enum led_brightness brightness)
|
||||
+{
|
||||
+ const struct mv88e6xxx_led_ops *ops;
|
||||
+ struct mv88e6xxx_led *led;
|
||||
+
|
||||
+ led = container_of(ldev, struct mv88e6xxx_led, ldev);
|
||||
+ ops = led->chip->info->ops->led_ops;
|
||||
+
|
||||
+ if (!ops->brightness_set)
|
||||
+ return -EOPNOTSUPP;
|
||||
+
|
||||
+ return ops->brightness_set(led, brightness);
|
||||
+}
|
||||
+
|
||||
+static int mv88e6xxx_led_blink_set(struct led_classdev *ldev,
|
||||
+ unsigned long *delay_on,
|
||||
+ unsigned long *delay_off)
|
||||
+{
|
||||
+ const struct mv88e6xxx_led_ops *ops;
|
||||
+ struct mv88e6xxx_led *led;
|
||||
+
|
||||
+ led = container_of(ldev, struct mv88e6xxx_led, ldev);
|
||||
+ ops = led->chip->info->ops->led_ops;
|
||||
+
|
||||
+ if (!ops->blink_set)
|
||||
+ return -EOPNOTSUPP;
|
||||
+
|
||||
+ return ops->blink_set(led, delay_on, delay_off);
|
||||
+}
|
||||
+
|
||||
+static int mv88e6xxx_led_hw_control_is_supported(struct led_classdev *ldev,
|
||||
+ unsigned long flags)
|
||||
+{
|
||||
+ const struct mv88e6xxx_led_ops *ops;
|
||||
+ struct mv88e6xxx_led *led;
|
||||
+
|
||||
+ led = container_of(ldev, struct mv88e6xxx_led, ldev);
|
||||
+ ops = led->chip->info->ops->led_ops;
|
||||
+
|
||||
+ if (!ops->hw_control_is_supported)
|
||||
+ return -EOPNOTSUPP;
|
||||
+
|
||||
+ return ops->hw_control_is_supported(led, flags);
|
||||
+}
|
||||
+
|
||||
+static int mv88e6xxx_led_hw_control_set(struct led_classdev *ldev,
|
||||
+ unsigned long flags)
|
||||
+{
|
||||
+ const struct mv88e6xxx_led_ops *ops;
|
||||
+ struct mv88e6xxx_led *led;
|
||||
+
|
||||
+ led = container_of(ldev, struct mv88e6xxx_led, ldev);
|
||||
+ ops = led->chip->info->ops->led_ops;
|
||||
+
|
||||
+ if (!ops->hw_control_set)
|
||||
+ return -EOPNOTSUPP;
|
||||
+
|
||||
+ return ops->hw_control_set(led, flags);
|
||||
+}
|
||||
+
|
||||
+static int mv88e6xxx_led_hw_control_get(struct led_classdev *ldev,
|
||||
+ unsigned long *flags)
|
||||
+{
|
||||
+ const struct mv88e6xxx_led_ops *ops;
|
||||
+ struct mv88e6xxx_led *led;
|
||||
+
|
||||
+ led = container_of(ldev, struct mv88e6xxx_led, ldev);
|
||||
+ ops = led->chip->info->ops->led_ops;
|
||||
+
|
||||
+ if (!ops->hw_control_get)
|
||||
+ return -EOPNOTSUPP;
|
||||
+
|
||||
+ return ops->hw_control_get(led, flags);
|
||||
+}
|
||||
+
|
||||
+static struct device *mv88e6xxx_led_hw_control_get_device(struct led_classdev *ldev)
|
||||
+{
|
||||
+ struct mv88e6xxx_led *led;
|
||||
+ struct dsa_port *dp;
|
||||
+
|
||||
+ led = container_of(ldev, struct mv88e6xxx_led, ldev);
|
||||
+ dp = dsa_to_port(led->chip->ds, led->port);
|
||||
+
|
||||
+ if (dp && dp->user)
|
||||
+ return &dp->user->dev;
|
||||
+
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+static int mv88e6xxx_port_setup_led(struct mv88e6xxx_chip *chip, int port,
|
||||
+ struct device_node *np)
|
||||
+{
|
||||
+ struct led_init_data init_data = {};
|
||||
+ struct mv88e6xxx_led *led;
|
||||
+ char *devname;
|
||||
+ u32 index;
|
||||
+ int err;
|
||||
+
|
||||
+ err = of_property_read_u32(np, "reg", &index);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ if (index >= 2)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ led = devm_kzalloc(chip->dev, sizeof(*led), GFP_KERNEL);
|
||||
+ if (!led)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ *led = (struct mv88e6xxx_led) {
|
||||
+ .chip = chip,
|
||||
+ .port = port,
|
||||
+ .index = index,
|
||||
+
|
||||
+ .ldev = {
|
||||
+ .max_brightness = 1,
|
||||
+ .brightness_set_blocking = mv88e6xxx_led_brightness_set,
|
||||
+ .blink_set = mv88e6xxx_led_blink_set,
|
||||
+
|
||||
+#ifdef CONFIG_LEDS_TRIGGERS
|
||||
+ .hw_control_trigger = "netdev",
|
||||
+ .hw_control_get_device = mv88e6xxx_led_hw_control_get_device,
|
||||
+
|
||||
+ .hw_control_is_supported = mv88e6xxx_led_hw_control_is_supported,
|
||||
+ .hw_control_set = mv88e6xxx_led_hw_control_set,
|
||||
+ .hw_control_get = mv88e6xxx_led_hw_control_get,
|
||||
+#endif
|
||||
+ },
|
||||
+ };
|
||||
+
|
||||
+ devname = devm_kasprintf(chip->dev, GFP_KERNEL, "%s.%d",
|
||||
+ dev_name(chip->dev), port);
|
||||
+ if (!devname)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ init_data = (struct led_init_data) {
|
||||
+ .fwnode = of_fwnode_handle(np),
|
||||
+ .devname_mandatory = true,
|
||||
+ .devicename = devname,
|
||||
+ };
|
||||
+
|
||||
+ return devm_led_classdev_register_ext(chip->dev, &led->ldev, &init_data);
|
||||
+}
|
||||
+
|
||||
+int mv88e6xxx_port_setup_leds(struct dsa_switch *ds, int port)
|
||||
+{
|
||||
+ struct dsa_port *dp = dsa_to_port(ds, port);
|
||||
+ struct mv88e6xxx_chip *chip = ds->priv;
|
||||
+ struct device_node *pnp, *np;
|
||||
+ int err;
|
||||
+
|
||||
+ if (!chip->info->ops->led_ops)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (!dp->dn)
|
||||
+ return 0;
|
||||
+
|
||||
+ pnp = of_get_child_by_name(dp->dn, "leds");
|
||||
+ if (!pnp)
|
||||
+ return 0;
|
||||
+
|
||||
+ for_each_available_child_of_node(pnp, np) {
|
||||
+ err = mv88e6xxx_port_setup_led(chip, port, np);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/leds.h b/drivers/net/dsa/mv88e6xxx/leds.h
|
||||
new file mode 100644
|
||||
index 000000000000..8afa2a0c0527
|
||||
--- /dev/null
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/leds.h
|
||||
@@ -0,0 +1,12 @@
|
||||
+/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
+
|
||||
+/* Marvell 88E6xxx Switch leds support. */
|
||||
+
|
||||
+#ifndef _MV88E6XXX_LEDS_H
|
||||
+#define _MV88E6XXX_LEDS_H
|
||||
+
|
||||
+#include "chip.h"
|
||||
+
|
||||
+int mv88e6xxx_port_setup_leds(struct dsa_switch *ds, int port);
|
||||
+
|
||||
+#endif /* _MV88E6XXX_LEDS_H */
|
||||
@@ -0,0 +1,358 @@
|
||||
From 2c5cb284bece2d8cbbb4dbf23fb5285eced27f81 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Thu, 16 Nov 2023 21:59:35 +0100
|
||||
Subject: [PATCH 06/30] net: dsa: mv88e6xxx: Add LED support for 6393X
|
||||
|
||||
Trigger support:
|
||||
- "none"
|
||||
- "timer"
|
||||
- "netdev"
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 1 +
|
||||
drivers/net/dsa/mv88e6xxx/leds.c | 229 +++++++++++++++++++++++++++++++
|
||||
drivers/net/dsa/mv88e6xxx/leds.h | 2 +
|
||||
drivers/net/dsa/mv88e6xxx/port.c | 33 +++++
|
||||
drivers/net/dsa/mv88e6xxx/port.h | 7 +
|
||||
5 files changed, 272 insertions(+)
|
||||
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
index f92b7d7d5780..c833b7e44d8b 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
@@ -5691,6 +5691,7 @@ static const struct mv88e6xxx_ops mv88e6393x_ops = {
|
||||
.gpio_ops = &mv88e6352_gpio_ops,
|
||||
.avb_ops = &mv88e6390_avb_ops,
|
||||
.ptp_ops = &mv88e6352_ptp_ops,
|
||||
+ .led_ops = &mv88e6393x_led_ops,
|
||||
.phylink_get_caps = mv88e6393x_phylink_get_caps,
|
||||
.pcs_ops = &mv88e6393x_pcs_ops,
|
||||
};
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/leds.c b/drivers/net/dsa/mv88e6xxx/leds.c
|
||||
index e3de10991f29..acdb5eca6647 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/leds.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/leds.c
|
||||
@@ -5,6 +5,13 @@
|
||||
#include "leds.h"
|
||||
#include "port.h"
|
||||
|
||||
+#define FLAG_ACT (BIT(TRIGGER_NETDEV_RX) | BIT(TRIGGER_NETDEV_TX))
|
||||
+#define FLAG_LINK BIT(TRIGGER_NETDEV_LINK)
|
||||
+#define FLAG_LINK_10 BIT(TRIGGER_NETDEV_LINK_10)
|
||||
+#define FLAG_LINK_100 BIT(TRIGGER_NETDEV_LINK_100)
|
||||
+#define FLAG_LINK_1G BIT(TRIGGER_NETDEV_LINK_1000)
|
||||
+#define FLAG_FULL BIT(TRIGGER_NETDEV_FULL_DUPLEX)
|
||||
+
|
||||
struct mv88e6xxx_led {
|
||||
struct mv88e6xxx_chip *chip;
|
||||
int port;
|
||||
@@ -13,6 +20,228 @@ struct mv88e6xxx_led {
|
||||
struct led_classdev ldev;
|
||||
};
|
||||
|
||||
+enum mv88e6393x_led_mode {
|
||||
+ MV88E6393X_LED_MODE_BLINK = 0xd,
|
||||
+ MV88E6393X_LED_MODE_OFF = 0xe,
|
||||
+ MV88E6393X_LED_MODE_ON = 0xf,
|
||||
+
|
||||
+ MV88E6393X_LED_MODES = 0x10
|
||||
+};
|
||||
+
|
||||
+static const unsigned long mv88e6393x_led_map_p1_p8[2][MV88E6393X_LED_MODES] = {
|
||||
+ {
|
||||
+ [0x1] = FLAG_ACT | FLAG_LINK_100 | FLAG_LINK_1G,
|
||||
+ [0x2] = FLAG_ACT | FLAG_LINK_1G,
|
||||
+ [0x3] = FLAG_ACT | FLAG_LINK,
|
||||
+ [0x6] = FLAG_FULL,
|
||||
+ [0x7] = FLAG_ACT | FLAG_LINK_10 | FLAG_LINK_1G,
|
||||
+ [0x8] = FLAG_LINK,
|
||||
+ [0x9] = FLAG_LINK_10,
|
||||
+ [0xa] = FLAG_ACT | FLAG_LINK_10,
|
||||
+ [0xb] = FLAG_LINK_100 | FLAG_LINK_1G,
|
||||
+ },
|
||||
+ {
|
||||
+ [0x1] = FLAG_ACT,
|
||||
+ [0x2] = FLAG_ACT | FLAG_LINK_10 | FLAG_LINK_100,
|
||||
+ [0x3] = FLAG_LINK_1G,
|
||||
+ [0x5] = FLAG_ACT | FLAG_LINK,
|
||||
+ [0x6] = FLAG_ACT | FLAG_LINK_10 | FLAG_LINK_1G,
|
||||
+ [0x7] = FLAG_LINK_10 | FLAG_LINK_1G,
|
||||
+ [0x9] = FLAG_LINK_100,
|
||||
+ [0xa] = FLAG_ACT | FLAG_LINK_100,
|
||||
+ [0xb] = FLAG_LINK_10 | FLAG_LINK_100,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+static const unsigned long mv88e6393x_led_map_p9_p10[2][MV88E6393X_LED_MODES] = {
|
||||
+ {
|
||||
+ [0x1] = FLAG_ACT | FLAG_LINK,
|
||||
+ },
|
||||
+ {
|
||||
+ [0x6] = FLAG_FULL,
|
||||
+ [0x7] = FLAG_ACT | FLAG_LINK,
|
||||
+ [0x8] = FLAG_LINK,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+static const unsigned long *mv88e6393x_led_map(struct mv88e6xxx_led *led)
|
||||
+{
|
||||
+ switch (led->port) {
|
||||
+ case 1:
|
||||
+ case 2:
|
||||
+ case 3:
|
||||
+ case 4:
|
||||
+ case 5:
|
||||
+ case 6:
|
||||
+ case 7:
|
||||
+ case 8:
|
||||
+ return mv88e6393x_led_map_p1_p8[led->index];
|
||||
+ case 9:
|
||||
+ case 10:
|
||||
+ return mv88e6393x_led_map_p9_p10[led->index];
|
||||
+ }
|
||||
+
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+static int mv88e6393x_led_flags_to_mode(struct mv88e6xxx_led *led, unsigned long flags)
|
||||
+{
|
||||
+ const unsigned long *map = mv88e6393x_led_map(led);
|
||||
+ int i;
|
||||
+
|
||||
+ if (!map)
|
||||
+ return -ENODEV;
|
||||
+
|
||||
+ if (!flags)
|
||||
+ return MV88E6393X_LED_MODE_OFF;
|
||||
+
|
||||
+ for (i = 0; i < MV88E6393X_LED_MODES; i++) {
|
||||
+ if (map[i] == flags)
|
||||
+ return i;
|
||||
+ }
|
||||
+
|
||||
+ return -EOPNOTSUPP;
|
||||
+}
|
||||
+
|
||||
+static int mv88e6393x_led_mode_to_flags(struct mv88e6xxx_led *led, u8 mode,
|
||||
+ unsigned long *flags)
|
||||
+{
|
||||
+ const unsigned long *map = mv88e6393x_led_map(led);
|
||||
+
|
||||
+ if (!map)
|
||||
+ return -ENODEV;
|
||||
+
|
||||
+ if (mode == MV88E6393X_LED_MODE_OFF) {
|
||||
+ *flags = 0;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ if (map[mode]) {
|
||||
+ *flags = map[mode];
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ return -EINVAL;
|
||||
+}
|
||||
+
|
||||
+static int mv88e6393x_led_set(struct mv88e6xxx_led *led, int mode)
|
||||
+{
|
||||
+ u16 ctrl;
|
||||
+ int err;
|
||||
+
|
||||
+ if (mode < 0)
|
||||
+ return mode;
|
||||
+
|
||||
+ mv88e6xxx_reg_lock(led->chip);
|
||||
+
|
||||
+ err = mv88e6393x_port_led_read(led->chip, led->port, 0, &ctrl);
|
||||
+ if (err)
|
||||
+ goto out;
|
||||
+
|
||||
+ switch (led->index) {
|
||||
+ case 0:
|
||||
+ ctrl &= ~0x0f;
|
||||
+ ctrl |= mode;
|
||||
+ break;
|
||||
+ case 1:
|
||||
+ ctrl &= ~0xf0;
|
||||
+ ctrl |= mode << 4;
|
||||
+ }
|
||||
+
|
||||
+ err = mv88e6393x_port_led_write(led->chip, led->port, 0, ctrl);
|
||||
+out:
|
||||
+ mv88e6xxx_reg_unlock(led->chip);
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+static int mv88e6393x_led_get(struct mv88e6xxx_led *led)
|
||||
+{
|
||||
+ u16 ctrl;
|
||||
+ int err;
|
||||
+
|
||||
+ mv88e6xxx_reg_lock(led->chip);
|
||||
+ err = mv88e6393x_port_led_read(led->chip, led->port, 0, &ctrl);
|
||||
+ mv88e6xxx_reg_unlock(led->chip);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ switch (led->index) {
|
||||
+ case 0:
|
||||
+ return ctrl & 0xf;
|
||||
+ case 1:
|
||||
+ return (ctrl >> 4) & 0xf;
|
||||
+ }
|
||||
+
|
||||
+ return -EINVAL;
|
||||
+}
|
||||
+
|
||||
+static int mv88e6393x_led_brightness_set(struct mv88e6xxx_led *led,
|
||||
+ enum led_brightness brightness)
|
||||
+{
|
||||
+ if (brightness == LED_OFF)
|
||||
+ return mv88e6393x_led_set(led, MV88E6393X_LED_MODE_OFF);
|
||||
+
|
||||
+ return mv88e6393x_led_set(led, MV88E6393X_LED_MODE_ON);
|
||||
+}
|
||||
+static int mv88e6393x_led_blink_set(struct mv88e6xxx_led *led,
|
||||
+ unsigned long *delay_on,
|
||||
+ unsigned long *delay_off)
|
||||
+{
|
||||
+ int err;
|
||||
+
|
||||
+ /* Defer anything other than 50% duty cycles to software */
|
||||
+ if (*delay_on != *delay_off)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ /* Reject values outside ~20% of our default rate (84ms) */
|
||||
+ if (*delay_on && ((*delay_on < 30) || (*delay_on > 50)))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ err = mv88e6393x_led_set(led, MV88E6393X_LED_MODE_BLINK);
|
||||
+ if (!err)
|
||||
+ *delay_on = *delay_off = 42;
|
||||
+
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+static int mv88e6393x_led_hw_control_is_supported(struct mv88e6xxx_led *led,
|
||||
+ unsigned long flags)
|
||||
+{
|
||||
+ int mode = mv88e6393x_led_flags_to_mode(led, flags);
|
||||
+
|
||||
+ return (mode < 0) ? mode : 0;
|
||||
+}
|
||||
+
|
||||
+static int mv88e6393x_led_hw_control_set(struct mv88e6xxx_led *led,
|
||||
+ unsigned long flags)
|
||||
+{
|
||||
+ int mode = mv88e6393x_led_flags_to_mode(led, flags);
|
||||
+
|
||||
+ if (mode < 0)
|
||||
+ return mode;
|
||||
+
|
||||
+ return mv88e6393x_led_set(led, mode);
|
||||
+}
|
||||
+
|
||||
+static int mv88e6393x_led_hw_control_get(struct mv88e6xxx_led *led,
|
||||
+ unsigned long *flags)
|
||||
+{
|
||||
+ int mode = mv88e6393x_led_get(led);
|
||||
+
|
||||
+ if (mode < 0)
|
||||
+ return mode;
|
||||
+
|
||||
+ return mv88e6393x_led_mode_to_flags(led, mode, flags);
|
||||
+}
|
||||
+
|
||||
+const struct mv88e6xxx_led_ops mv88e6393x_led_ops = {
|
||||
+ .brightness_set = mv88e6393x_led_brightness_set,
|
||||
+ .blink_set = mv88e6393x_led_blink_set,
|
||||
+ .hw_control_is_supported = mv88e6393x_led_hw_control_is_supported,
|
||||
+ .hw_control_set = mv88e6393x_led_hw_control_set,
|
||||
+ .hw_control_get = mv88e6393x_led_hw_control_get,
|
||||
+};
|
||||
+
|
||||
static int mv88e6xxx_led_brightness_set(struct led_classdev *ldev,
|
||||
enum led_brightness brightness)
|
||||
{
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/leds.h b/drivers/net/dsa/mv88e6xxx/leds.h
|
||||
index 8afa2a0c0527..542345d23dc5 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/leds.h
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/leds.h
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#include "chip.h"
|
||||
|
||||
+extern const struct mv88e6xxx_led_ops mv88e6393x_led_ops;
|
||||
+
|
||||
int mv88e6xxx_port_setup_leds(struct dsa_switch *ds, int port);
|
||||
|
||||
#endif /* _MV88E6XXX_LEDS_H */
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c
|
||||
index f25fb3214acb..aa5d312d8aa5 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/port.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/port.c
|
||||
@@ -1558,6 +1558,39 @@ int mv88e6351_port_set_ether_type(struct mv88e6xxx_chip *chip, int port,
|
||||
return mv88e6xxx_port_write(chip, port, MV88E6XXX_PORT_ETH_TYPE, etype);
|
||||
}
|
||||
|
||||
+/* Offset 0x16: LED Control Register */
|
||||
+
|
||||
+int mv88e6393x_port_led_write(struct mv88e6xxx_chip *chip, int port,
|
||||
+ unsigned int pointer, u16 data)
|
||||
+{
|
||||
+ u16 cmd = BIT(15) | ((pointer & 0x7) << 12) | (data & 0x7ff);
|
||||
+ int err;
|
||||
+
|
||||
+ err = mv88e6xxx_port_write(chip, port, MV88E6393X_PORT_LED_CONTROL, cmd);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ return mv88e6xxx_port_wait_bit(chip, port, MV88E6393X_PORT_LED_CONTROL, 15, 0);
|
||||
+}
|
||||
+
|
||||
+int mv88e6393x_port_led_read(struct mv88e6xxx_chip *chip, int port,
|
||||
+ unsigned int pointer, u16 *data)
|
||||
+{
|
||||
+ u16 cmd = (pointer & 0x7) << 12;
|
||||
+ int err;
|
||||
+
|
||||
+ err = mv88e6xxx_port_write(chip, port, MV88E6393X_PORT_LED_CONTROL, cmd);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ err = mv88e6xxx_port_read(chip, port, MV88E6393X_PORT_LED_CONTROL, &cmd);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ *data = cmd & 0x7ff;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
/* Offset 0x18: Port IEEE Priority Remapping Registers [0-3]
|
||||
* Offset 0x19: Port IEEE Priority Remapping Registers [4-7]
|
||||
*/
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/port.h b/drivers/net/dsa/mv88e6xxx/port.h
|
||||
index ddadeb9bfdae..7157864dc20f 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/port.h
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/port.h
|
||||
@@ -309,6 +309,9 @@
|
||||
/* Offset 0x13: OutFiltered Counter */
|
||||
#define MV88E6XXX_PORT_OUT_FILTERED 0x13
|
||||
|
||||
+/* Offset 0x16: LED Control Register */
|
||||
+#define MV88E6393X_PORT_LED_CONTROL 0x16
|
||||
+
|
||||
/* Offset 0x18: IEEE Priority Mapping Table */
|
||||
#define MV88E6390_PORT_IEEE_PRIO_MAP_TABLE 0x18
|
||||
#define MV88E6390_PORT_IEEE_PRIO_MAP_TABLE_UPDATE 0x8000
|
||||
@@ -425,6 +428,10 @@ int mv88e6393x_port_set_policy(struct mv88e6xxx_chip *chip, int port,
|
||||
enum mv88e6xxx_policy_action action);
|
||||
int mv88e6351_port_set_ether_type(struct mv88e6xxx_chip *chip, int port,
|
||||
u16 etype);
|
||||
+int mv88e6393x_port_led_write(struct mv88e6xxx_chip *chip, int port,
|
||||
+ unsigned int pointer, u16 data);
|
||||
+int mv88e6393x_port_led_read(struct mv88e6xxx_chip *chip, int port,
|
||||
+ unsigned int pointer, u16 *data);
|
||||
int mv88e6393x_set_egress_port(struct mv88e6xxx_chip *chip,
|
||||
enum mv88e6xxx_egress_direction direction,
|
||||
int port);
|
||||
+2
-11
@@ -1,12 +1,8 @@
|
||||
From d57c5a250f32f99dc58aeb642b02a706e1f7ed32 Mon Sep 17 00:00:00 2001
|
||||
From 96423b3760f9aeb2a134b4663fb231fa933f3b3d Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Tue, 28 May 2024 10:38:42 +0200
|
||||
Subject: [PATCH 19/29] net: dsa: tag_dsa: Use tag priority as initial
|
||||
Subject: [PATCH 07/30] net: dsa: tag_dsa: Use tag priority as initial
|
||||
skb->priority
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
|
||||
Use the 3-bit priority field from the DSA tag as the initial packet
|
||||
priority on ingress to the CPU.
|
||||
@@ -22,8 +18,6 @@ Ideally we could then map this priority to an internal one, like we
|
||||
can do with an "ingress-qos-map" on VLAN interfaces. Until that is
|
||||
implemented, support the setup that is likely to be the most common; a
|
||||
1:1 mapping from FPri to skb->priority.
|
||||
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
net/dsa/tag_dsa.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
@@ -46,6 +40,3 @@ index 2a2c4fb61a65..a00ae6bf2971 100644
|
||||
return skb;
|
||||
}
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+2
-11
@@ -1,12 +1,8 @@
|
||||
From 1ddc69f6f28652c29a8cbee0170cebc44b3cb4d9 Mon Sep 17 00:00:00 2001
|
||||
From f2c3ffdd21db40d95a593c5b81b1ab5380291f63 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Tue, 16 Jan 2024 16:00:55 +0100
|
||||
Subject: [PATCH 20/29] net: dsa: Support MDB memberships whose L2 addresses
|
||||
Subject: [PATCH 08/30] net: dsa: Support MDB memberships whose L2 addresses
|
||||
overlap
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
|
||||
Multiple IP multicast groups (32 for v4, 2^80 for v6) map to the same
|
||||
L2 address. This means that switchdev drivers may receive multiple MDB
|
||||
@@ -32,8 +28,6 @@ as long as the count is positive. Fortunately, all the infrastructure
|
||||
needed to do this is already in place, since it is also needed on CPU
|
||||
and DSA ports. Thus, "implement" this by simply removing the guards
|
||||
which previously skipped reference countung on user ports.
|
||||
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
net/dsa/switch.c | 16 ----------------
|
||||
1 file changed, 16 deletions(-)
|
||||
@@ -72,6 +66,3 @@ index 3d2feeea897b..628e8a884dde 100644
|
||||
mutex_lock(&dp->addr_lists_lock);
|
||||
|
||||
a = dsa_mac_addr_find(&dp->mdbs, mdb->addr, mdb->vid, db);
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+9
-17
@@ -1,23 +1,18 @@
|
||||
From f38ee70d9df5f42679937910f34068edc8c4e16a Mon Sep 17 00:00:00 2001
|
||||
From 750fd7b15032786b6dba40861b6ffe54bab4a028 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Thu, 21 Mar 2024 19:12:15 +0100
|
||||
Subject: [PATCH 21/29] net: dsa: Support EtherType based priority overrides
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
Subject: [PATCH 09/30] net: dsa: Support EtherType based priority overrides
|
||||
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
include/net/dsa.h | 4 ++++
|
||||
net/dsa/user.c | 56 +++++++++++++++++++++++++++++++++++++++++++++--
|
||||
2 files changed, 58 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/include/net/dsa.h b/include/net/dsa.h
|
||||
index 5cb456bf4639..c31d4e910f07 100644
|
||||
index 877f9b270cf6..d86698e0e12c 100644
|
||||
--- a/include/net/dsa.h
|
||||
+++ b/include/net/dsa.h
|
||||
@@ -958,6 +958,10 @@ struct dsa_switch_ops {
|
||||
@@ -968,6 +968,10 @@ struct dsa_switch_ops {
|
||||
const u8 *sel, int nsel);
|
||||
int (*port_get_apptrust)(struct dsa_switch *ds, int port, u8 *sel,
|
||||
int *nsel);
|
||||
@@ -29,10 +24,10 @@ index 5cb456bf4639..c31d4e910f07 100644
|
||||
/*
|
||||
* Suspend and resume
|
||||
diff --git a/net/dsa/user.c b/net/dsa/user.c
|
||||
index f59d66f0975d..58174ad612d2 100644
|
||||
index 06267c526dc4..ee0e5cf3f6d8 100644
|
||||
--- a/net/dsa/user.c
|
||||
+++ b/net/dsa/user.c
|
||||
@@ -2336,6 +2336,34 @@ dsa_user_dcbnl_add_dscp_prio(struct net_device *dev, struct dcb_app *app)
|
||||
@@ -2302,6 +2302,34 @@ dsa_user_dcbnl_add_dscp_prio(struct net_device *dev, struct dcb_app *app)
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -67,7 +62,7 @@ index f59d66f0975d..58174ad612d2 100644
|
||||
static int __maybe_unused dsa_user_dcbnl_ieee_setapp(struct net_device *dev,
|
||||
struct dcb_app *app)
|
||||
{
|
||||
@@ -2345,7 +2373,7 @@ static int __maybe_unused dsa_user_dcbnl_ieee_setapp(struct net_device *dev,
|
||||
@@ -2311,7 +2339,7 @@ static int __maybe_unused dsa_user_dcbnl_ieee_setapp(struct net_device *dev,
|
||||
case 0:
|
||||
return dsa_user_dcbnl_set_default_prio(dev, app);
|
||||
default:
|
||||
@@ -76,7 +71,7 @@ index f59d66f0975d..58174ad612d2 100644
|
||||
}
|
||||
break;
|
||||
case IEEE_8021QAZ_APP_SEL_DSCP:
|
||||
@@ -2418,6 +2446,30 @@ dsa_user_dcbnl_del_dscp_prio(struct net_device *dev, struct dcb_app *app)
|
||||
@@ -2384,6 +2412,30 @@ dsa_user_dcbnl_del_dscp_prio(struct net_device *dev, struct dcb_app *app)
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -107,7 +102,7 @@ index f59d66f0975d..58174ad612d2 100644
|
||||
static int __maybe_unused dsa_user_dcbnl_ieee_delapp(struct net_device *dev,
|
||||
struct dcb_app *app)
|
||||
{
|
||||
@@ -2427,7 +2479,7 @@ static int __maybe_unused dsa_user_dcbnl_ieee_delapp(struct net_device *dev,
|
||||
@@ -2393,7 +2445,7 @@ static int __maybe_unused dsa_user_dcbnl_ieee_delapp(struct net_device *dev,
|
||||
case 0:
|
||||
return dsa_user_dcbnl_del_default_prio(dev, app);
|
||||
default:
|
||||
@@ -116,6 +111,3 @@ index f59d66f0975d..58174ad612d2 100644
|
||||
}
|
||||
break;
|
||||
case IEEE_8021QAZ_APP_SEL_DSCP:
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+35
-42
@@ -1,14 +1,9 @@
|
||||
From c196348fb4b2023a26aacad062a18fa68a178a63 Mon Sep 17 00:00:00 2001
|
||||
From 7804eeb397e708d0793d0e20dcb43a5e8c76a18f Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Fri, 22 Mar 2024 16:15:43 +0100
|
||||
Subject: [PATCH 22/29] net: dsa: mv88e6xxx: Support EtherType based priority
|
||||
Subject: [PATCH 10/30] net: dsa: mv88e6xxx: Support EtherType based priority
|
||||
overrides
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 64 +++++++++++++++++++++++++++++
|
||||
drivers/net/dsa/mv88e6xxx/chip.h | 21 ++++++++++
|
||||
@@ -19,10 +14,10 @@ Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
6 files changed, 207 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
index 7da618978ba7..a7e9c141e053 100644
|
||||
index c833b7e44d8b..c48369663425 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
@@ -1688,6 +1688,11 @@ static int mv88e6xxx_rmu_setup(struct mv88e6xxx_chip *chip)
|
||||
@@ -1715,6 +1715,11 @@ static int mv88e6xxx_rmu_setup(struct mv88e6xxx_chip *chip)
|
||||
|
||||
static int mv88e6xxx_pot_setup(struct mv88e6xxx_chip *chip)
|
||||
{
|
||||
@@ -34,15 +29,15 @@ index 7da618978ba7..a7e9c141e053 100644
|
||||
if (chip->info->ops->pot_clear)
|
||||
return chip->info->ops->pot_clear(chip);
|
||||
|
||||
@@ -3384,6 +3389,7 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
|
||||
p = &chip->ports[port];
|
||||
p->chip = chip;
|
||||
p->port = port;
|
||||
+ refcount_set(&p->etype.refcnt, 0);
|
||||
@@ -3427,6 +3432,7 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
|
||||
|
||||
/* Look up corresponding fwnode if any */
|
||||
ports_fwnode = device_get_named_child_node(chip->dev, "ethernet-ports");
|
||||
@@ -6622,6 +6628,7 @@ static struct mv88e6xxx_chip *mv88e6xxx_alloc_chip(struct device *dev)
|
||||
chip->ports[port].chip = chip;
|
||||
chip->ports[port].port = port;
|
||||
+ refcount_set(&chip->ports[port].etype.refcnt, 0);
|
||||
|
||||
err = mv88e6xxx_port_setup_mac(chip, port, LINK_UNFORCED,
|
||||
SPEED_UNFORCED, DUPLEX_UNFORCED,
|
||||
@@ -6599,6 +6605,7 @@ static struct mv88e6xxx_chip *mv88e6xxx_alloc_chip(struct device *dev)
|
||||
chip->dev = dev;
|
||||
|
||||
mutex_init(&chip->reg_lock);
|
||||
@@ -50,7 +45,7 @@ index 7da618978ba7..a7e9c141e053 100644
|
||||
INIT_LIST_HEAD(&chip->mdios);
|
||||
idr_init(&chip->policies);
|
||||
INIT_LIST_HEAD(&chip->msts);
|
||||
@@ -7161,6 +7168,61 @@ static int mv88e6xxx_crosschip_lag_leave(struct dsa_switch *ds, int sw_index,
|
||||
@@ -7138,6 +7145,61 @@ static int mv88e6xxx_crosschip_lag_leave(struct dsa_switch *ds, int sw_index,
|
||||
return err_sync ? : err_pvt;
|
||||
}
|
||||
|
||||
@@ -112,7 +107,7 @@ index 7da618978ba7..a7e9c141e053 100644
|
||||
static const struct phylink_mac_ops mv88e6xxx_phylink_mac_ops = {
|
||||
.mac_select_pcs = mv88e6xxx_mac_select_pcs,
|
||||
.mac_prepare = mv88e6xxx_mac_prepare,
|
||||
@@ -7230,6 +7292,8 @@ static const struct dsa_switch_ops mv88e6xxx_switch_ops = {
|
||||
@@ -7207,6 +7269,8 @@ static const struct dsa_switch_ops mv88e6xxx_switch_ops = {
|
||||
.crosschip_lag_change = mv88e6xxx_crosschip_lag_change,
|
||||
.crosschip_lag_join = mv88e6xxx_crosschip_lag_join,
|
||||
.crosschip_lag_leave = mv88e6xxx_crosschip_lag_leave,
|
||||
@@ -122,10 +117,10 @@ index 7da618978ba7..a7e9c141e053 100644
|
||||
|
||||
static int mv88e6xxx_register_switch(struct mv88e6xxx_chip *chip)
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h
|
||||
index 2f211e55cb47..d66380eef2b0 100644
|
||||
index 32c87ab754d1..25edc2534979 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.h
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.h
|
||||
@@ -301,6 +301,11 @@ struct mv88e6xxx_port {
|
||||
@@ -293,6 +293,11 @@ struct mv88e6xxx_port {
|
||||
|
||||
/* MacAuth Bypass control flag */
|
||||
bool mab;
|
||||
@@ -137,7 +132,7 @@ index 2f211e55cb47..d66380eef2b0 100644
|
||||
};
|
||||
|
||||
enum mv88e6xxx_region_id {
|
||||
@@ -339,6 +344,11 @@ struct mv88e6xxx_hw_stat {
|
||||
@@ -331,6 +336,11 @@ struct mv88e6xxx_hw_stat {
|
||||
int type;
|
||||
};
|
||||
|
||||
@@ -146,10 +141,10 @@ index 2f211e55cb47..d66380eef2b0 100644
|
||||
+ u8 pri;
|
||||
+};
|
||||
+
|
||||
struct mv88e6xxx_chip {
|
||||
const struct mv88e6xxx_info *info;
|
||||
struct mv88e6xxx_led;
|
||||
|
||||
@@ -354,6 +364,14 @@ struct mv88e6xxx_chip {
|
||||
struct mv88e6xxx_chip {
|
||||
@@ -348,6 +358,14 @@ struct mv88e6xxx_chip {
|
||||
/* This mutex protects the access to the switch registers */
|
||||
struct mutex reg_lock;
|
||||
|
||||
@@ -164,10 +159,10 @@ index 2f211e55cb47..d66380eef2b0 100644
|
||||
/* The MII bus and the address on the bus that is used to
|
||||
* communication with the switch
|
||||
*/
|
||||
@@ -444,6 +462,9 @@ struct mv88e6xxx_chip {
|
||||
@@ -437,6 +455,9 @@ struct mv88e6xxx_chip {
|
||||
|
||||
/* FID map */
|
||||
DECLARE_BITMAP(fid_bitmap, MV88E6XXX_N_FID);
|
||||
/* Bridge MST to SID mappings */
|
||||
struct list_head msts;
|
||||
+
|
||||
+ /* Queue priority overrides */
|
||||
+ struct mv88e6xxx_po qpri_po[16];
|
||||
@@ -175,7 +170,7 @@ index 2f211e55cb47..d66380eef2b0 100644
|
||||
|
||||
struct mv88e6xxx_bus_ops {
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/global2.c b/drivers/net/dsa/mv88e6xxx/global2.c
|
||||
index 30a6ffa7817b..3f16a7ef3fa2 100644
|
||||
index b2b5f6ba438f..2c52903e8992 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/global2.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/global2.c
|
||||
@@ -315,7 +315,7 @@ int mv88e6xxx_g2_atu_stats_get(struct mv88e6xxx_chip *chip, u16 *stats)
|
||||
@@ -271,10 +266,10 @@ index 3663645621c9..496269c26c50 100644
|
||||
int mv88e6xxx_g2_trunk_mask_write(struct mv88e6xxx_chip *chip, int num,
|
||||
bool hash, u16 mask);
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c
|
||||
index df19dfa5cc3d..e1fee09eae2f 100644
|
||||
index aa5d312d8aa5..84900814c456 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/port.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/port.c
|
||||
@@ -1560,6 +1560,52 @@ int mv88e6351_port_set_ether_type(struct mv88e6xxx_chip *chip, int port,
|
||||
@@ -1558,6 +1558,52 @@ int mv88e6351_port_set_ether_type(struct mv88e6xxx_chip *chip, int port,
|
||||
return mv88e6xxx_port_write(chip, port, MV88E6XXX_PORT_ETH_TYPE, etype);
|
||||
}
|
||||
|
||||
@@ -324,11 +319,11 @@ index df19dfa5cc3d..e1fee09eae2f 100644
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
/* Offset 0x18: Port IEEE Priority Remapping Registers [0-3]
|
||||
* Offset 0x19: Port IEEE Priority Remapping Registers [4-7]
|
||||
*/
|
||||
/* Offset 0x16: LED Control Register */
|
||||
|
||||
int mv88e6393x_port_led_write(struct mv88e6xxx_chip *chip, int port,
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/port.h b/drivers/net/dsa/mv88e6xxx/port.h
|
||||
index c1d2f99efb1c..d2ba9ed1f23e 100644
|
||||
index 7157864dc20f..7edb04c41ac8 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/port.h
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/port.h
|
||||
@@ -286,7 +286,18 @@
|
||||
@@ -351,7 +346,7 @@ index c1d2f99efb1c..d2ba9ed1f23e 100644
|
||||
|
||||
/* Offset 0x10: InDiscards Low Counter */
|
||||
#define MV88E6XXX_PORT_IN_DISCARD_LO 0x10
|
||||
@@ -547,16 +558,19 @@ int mv88e6352_port_set_policy(struct mv88e6xxx_chip *chip, int port,
|
||||
@@ -426,8 +437,13 @@ int mv88e6352_port_set_policy(struct mv88e6xxx_chip *chip, int port,
|
||||
int mv88e6393x_port_set_policy(struct mv88e6xxx_chip *chip, int port,
|
||||
enum mv88e6xxx_policy_mapping mapping,
|
||||
enum mv88e6xxx_policy_action action);
|
||||
@@ -362,9 +357,10 @@ index c1d2f99efb1c..d2ba9ed1f23e 100644
|
||||
+int mv88e6xxx_port_claim_ether_type(struct mv88e6xxx_chip *chip, int port,
|
||||
+ u16 etype);
|
||||
+int mv88e6xxx_port_relinquish_ether_type(struct mv88e6xxx_chip *chip, int port);
|
||||
int mv88e6393x_set_egress_port(struct mv88e6xxx_chip *chip,
|
||||
enum mv88e6xxx_egress_direction direction,
|
||||
int port);
|
||||
int mv88e6393x_port_led_write(struct mv88e6xxx_chip *chip, int port,
|
||||
unsigned int pointer, u16 data);
|
||||
int mv88e6393x_port_led_read(struct mv88e6xxx_chip *chip, int port,
|
||||
@@ -438,8 +454,6 @@ int mv88e6393x_set_egress_port(struct mv88e6xxx_chip *chip,
|
||||
int mv88e6393x_port_set_upstream_port(struct mv88e6xxx_chip *chip, int port,
|
||||
int upstream_port);
|
||||
int mv88e6393x_port_mgmt_rsvd2cpu(struct mv88e6xxx_chip *chip);
|
||||
@@ -373,6 +369,3 @@ index c1d2f99efb1c..d2ba9ed1f23e 100644
|
||||
int mv88e6xxx_port_set_message_port(struct mv88e6xxx_chip *chip, int port,
|
||||
bool message_port);
|
||||
int mv88e6xxx_port_set_trunk(struct mv88e6xxx_chip *chip, int port,
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+7
-16
@@ -1,11 +1,7 @@
|
||||
From 0bdbde2ac4f2028725db158623f3baecc1f81813 Mon Sep 17 00:00:00 2001
|
||||
From d5c9c2f1a648bc229cd2fed59e4ab0b320239d41 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Tue, 28 May 2024 11:04:22 +0200
|
||||
Subject: [PATCH 23/29] net: dsa: mv88e6xxx: Add mqprio qdisc support
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
Subject: [PATCH 11/30] net: dsa: mv88e6xxx: Add mqprio qdisc support
|
||||
|
||||
Add support for attaching mqprio qdisc's to mv88e6xxx ports and use
|
||||
the packet's traffic class as the outgoing priority when no PCP bits
|
||||
@@ -27,18 +23,16 @@ are effectively only specifying the QPri.
|
||||
Since FPri is always a 3-bit field, even on older chips with only 4
|
||||
physical queues, always report 8 queues and let the chip's policy
|
||||
handle the mapping down to the "real" number.
|
||||
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 70 ++++++++++++++++++++++++++++++++
|
||||
net/dsa/tag_dsa.c | 4 +-
|
||||
2 files changed, 73 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
index a7e9c141e053..20bdc3e106e7 100644
|
||||
index c48369663425..050a89c1b7e1 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
@@ -32,6 +32,7 @@
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <linux/gpio/consumer.h>
|
||||
#include <linux/phylink.h>
|
||||
#include <net/dsa.h>
|
||||
@@ -46,7 +40,7 @@ index a7e9c141e053..20bdc3e106e7 100644
|
||||
|
||||
#include "chip.h"
|
||||
#include "devlink.h"
|
||||
@@ -7223,6 +7224,68 @@ static int mv88e6xxx_port_del_etype_prio(struct dsa_switch *ds, int port,
|
||||
@@ -7200,6 +7201,68 @@ static int mv88e6xxx_port_del_etype_prio(struct dsa_switch *ds, int port,
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -115,7 +109,7 @@ index a7e9c141e053..20bdc3e106e7 100644
|
||||
static const struct phylink_mac_ops mv88e6xxx_phylink_mac_ops = {
|
||||
.mac_select_pcs = mv88e6xxx_mac_select_pcs,
|
||||
.mac_prepare = mv88e6xxx_mac_prepare,
|
||||
@@ -7294,6 +7357,7 @@ static const struct dsa_switch_ops mv88e6xxx_switch_ops = {
|
||||
@@ -7271,6 +7334,7 @@ static const struct dsa_switch_ops mv88e6xxx_switch_ops = {
|
||||
.crosschip_lag_leave = mv88e6xxx_crosschip_lag_leave,
|
||||
.port_add_etype_prio = mv88e6xxx_port_add_etype_prio,
|
||||
.port_del_etype_prio = mv88e6xxx_port_del_etype_prio,
|
||||
@@ -123,7 +117,7 @@ index a7e9c141e053..20bdc3e106e7 100644
|
||||
};
|
||||
|
||||
static int mv88e6xxx_register_switch(struct mv88e6xxx_chip *chip)
|
||||
@@ -7320,6 +7384,12 @@ static int mv88e6xxx_register_switch(struct mv88e6xxx_chip *chip)
|
||||
@@ -7297,6 +7361,12 @@ static int mv88e6xxx_register_switch(struct mv88e6xxx_chip *chip)
|
||||
*/
|
||||
ds->num_lag_ids = mv88e6xxx_has_lag(chip) ? 16 : 0;
|
||||
|
||||
@@ -160,6 +154,3 @@ index a00ae6bf2971..55c296e0b5b0 100644
|
||||
dsa_header[3] = vid & 0xff;
|
||||
}
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+5
-14
@@ -1,12 +1,8 @@
|
||||
From 343b13988e5428e41899392021bee32383988e0d Mon Sep 17 00:00:00 2001
|
||||
From 76a50394636e4dc75d5b3f3d3047b03559defacd Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Wed, 29 May 2024 13:20:41 +0200
|
||||
Subject: [PATCH 24/29] net: dsa: mv88e6xxx: Use VLAN prio over IP when both
|
||||
Subject: [PATCH 12/30] net: dsa: mv88e6xxx: Use VLAN prio over IP when both
|
||||
are available
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
|
||||
Switch the priority sourcing precdence to prefer VLAN PCP over IP
|
||||
DSCP, when both are available.
|
||||
@@ -25,17 +21,15 @@ main reasons for choosing the new default:
|
||||
packet's priority. As the packet then moves through the network
|
||||
core over trusted VLAN trunks, the packet should keep its original
|
||||
priority, independent of what inner protocol fields may indicate.
|
||||
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 11 ++++++++---
|
||||
1 file changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
index 20bdc3e106e7..d199a1c67aaa 100644
|
||||
index 050a89c1b7e1..1888ddd9bfa4 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
@@ -3425,9 +3425,13 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
|
||||
@@ -3443,9 +3443,13 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
|
||||
|
||||
/* Port Control: disable Drop-on-Unlock, disable Drop-on-Lock,
|
||||
* disable Header mode, enable IGMP/MLD snooping, disable VLAN
|
||||
@@ -52,7 +46,7 @@ index 20bdc3e106e7..d199a1c67aaa 100644
|
||||
*
|
||||
* If this is the CPU link, use DSA or EDSA tagging depending
|
||||
* on which tagging mode was configured.
|
||||
@@ -3438,6 +3442,7 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
|
||||
@@ -3456,6 +3460,7 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
|
||||
* forwarding of unknown unicasts and multicasts.
|
||||
*/
|
||||
reg = MV88E6185_PORT_CTL0_USE_TAG | MV88E6185_PORT_CTL0_USE_IP |
|
||||
@@ -60,6 +54,3 @@ index 20bdc3e106e7..d199a1c67aaa 100644
|
||||
MV88E6XXX_PORT_CTL0_STATE_FORWARDING;
|
||||
/* Forward any IPv4 IGMP or IPv6 MLD frames received
|
||||
* by a USER port to the CPU port to allow snooping.
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+13
-22
@@ -1,12 +1,8 @@
|
||||
From ee53e8d8b2c5e6f29f14953dfe051b9995c95931 Mon Sep 17 00:00:00 2001
|
||||
From 1967ea3f67eb7a29da6be8e1b292f3e4b1361703 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Tue, 26 Nov 2024 19:45:59 +0100
|
||||
Subject: [PATCH 25/29] [FIX] net: dsa: mv88e6xxx: Trap locally terminated
|
||||
Subject: [PATCH 13/30] [FIX] net: dsa: mv88e6xxx: Trap locally terminated
|
||||
VLANs
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
|
||||
Before this change, in a setup like the following, packets assigned to
|
||||
VLAN 10 were forwarded between the switch ports, even though the
|
||||
@@ -27,8 +23,6 @@ a VLAN upper interface, rather than to offload bridge VLANs, are
|
||||
marked as policy entries. As the VTU policy of user ports is already
|
||||
set to TRAP (to ensure proper standalone port operation), this will
|
||||
cause all packets assigned to these VLANs to properly terminated.
|
||||
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 33 ++++++++++++++++++--------------
|
||||
include/net/switchdev.h | 4 ++++
|
||||
@@ -36,10 +30,10 @@ Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
3 files changed, 27 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
index d199a1c67aaa..141a3105be9f 100644
|
||||
index 1888ddd9bfa4..70eefc1b2140 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
@@ -2611,7 +2611,7 @@ static int mv88e6xxx_port_broadcast_sync(struct mv88e6xxx_chip *chip, int port,
|
||||
@@ -2665,7 +2665,7 @@ static int mv88e6xxx_port_broadcast_sync(struct mv88e6xxx_chip *chip, int port,
|
||||
}
|
||||
|
||||
static int mv88e6xxx_port_vlan_join(struct mv88e6xxx_chip *chip, int port,
|
||||
@@ -48,7 +42,7 @@ index d199a1c67aaa..141a3105be9f 100644
|
||||
{
|
||||
const u8 non_member = MV88E6XXX_G1_VTU_DATA_MEMBER_TAG_NON_MEMBER;
|
||||
struct mv88e6xxx_vtu_entry vlan;
|
||||
@@ -2623,9 +2623,7 @@ static int mv88e6xxx_port_vlan_join(struct mv88e6xxx_chip *chip, int port,
|
||||
@@ -2677,9 +2677,7 @@ static int mv88e6xxx_port_vlan_join(struct mv88e6xxx_chip *chip, int port,
|
||||
|
||||
if (!vlan.valid) {
|
||||
memset(&vlan, 0, sizeof(vlan));
|
||||
@@ -59,7 +53,7 @@ index d199a1c67aaa..141a3105be9f 100644
|
||||
|
||||
err = mv88e6xxx_atu_new(chip, &vlan.fid);
|
||||
if (err)
|
||||
@@ -2648,6 +2646,9 @@ static int mv88e6xxx_port_vlan_join(struct mv88e6xxx_chip *chip, int port,
|
||||
@@ -2702,6 +2700,9 @@ static int mv88e6xxx_port_vlan_join(struct mv88e6xxx_chip *chip, int port,
|
||||
if (err)
|
||||
return err;
|
||||
} else if (vlan.member[port] != member) {
|
||||
@@ -69,7 +63,7 @@ index d199a1c67aaa..141a3105be9f 100644
|
||||
vlan.member[port] = member;
|
||||
|
||||
err = mv88e6xxx_vtu_loadpurge(chip, &vlan);
|
||||
@@ -2697,7 +2698,8 @@ static int mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port,
|
||||
@@ -2748,7 +2749,8 @@ static int mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port,
|
||||
|
||||
mv88e6xxx_reg_lock(chip);
|
||||
|
||||
@@ -79,7 +73,7 @@ index d199a1c67aaa..141a3105be9f 100644
|
||||
if (err) {
|
||||
dev_err(ds->dev, "p%d: failed to add VLAN %d%c\n", port,
|
||||
vlan->vid, untagged ? 'u' : 't');
|
||||
@@ -3477,14 +3479,17 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
|
||||
@@ -3495,14 +3497,17 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -104,7 +98,7 @@ index d199a1c67aaa..141a3105be9f 100644
|
||||
chip->info->ops->port_set_policy) {
|
||||
err = chip->info->ops->port_set_policy(chip, port,
|
||||
MV88E6XXX_POLICY_MAPPING_VTU,
|
||||
@@ -3514,7 +3519,7 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
|
||||
@@ -3532,7 +3537,7 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
|
||||
*/
|
||||
err = mv88e6xxx_port_vlan_join(chip, port, MV88E6XXX_VID_STANDALONE,
|
||||
MV88E6XXX_G1_VTU_DATA_MEMBER_TAG_UNMODIFIED,
|
||||
@@ -113,7 +107,7 @@ index d199a1c67aaa..141a3105be9f 100644
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
@@ -3528,7 +3533,7 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
|
||||
@@ -3546,7 +3551,7 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
|
||||
*/
|
||||
err = mv88e6xxx_port_vlan_join(chip, port, MV88E6XXX_VID_BRIDGED,
|
||||
MV88E6XXX_G1_VTU_DATA_MEMBER_TAG_UNMODIFIED,
|
||||
@@ -138,10 +132,10 @@ index 8346b0d29542..764cd3dd4645 100644
|
||||
|
||||
#define SWITCHDEV_OBJ_PORT_VLAN(OBJ) \
|
||||
diff --git a/net/dsa/user.c b/net/dsa/user.c
|
||||
index 58174ad612d2..c0019d0c1172 100644
|
||||
index ee0e5cf3f6d8..6f81658598e5 100644
|
||||
--- a/net/dsa/user.c
|
||||
+++ b/net/dsa/user.c
|
||||
@@ -1796,6 +1796,8 @@ static int dsa_user_vlan_rx_add_vid(struct net_device *dev, __be16 proto,
|
||||
@@ -1762,6 +1762,8 @@ static int dsa_user_vlan_rx_add_vid(struct net_device *dev, __be16 proto,
|
||||
.vid = vid,
|
||||
/* This API only allows programming tagged, non-PVID VIDs */
|
||||
.flags = 0,
|
||||
@@ -150,7 +144,7 @@ index 58174ad612d2..c0019d0c1172 100644
|
||||
};
|
||||
struct netlink_ext_ack extack = {0};
|
||||
struct dsa_switch *ds = dp->ds;
|
||||
@@ -1870,6 +1872,8 @@ static int dsa_user_vlan_rx_kill_vid(struct net_device *dev, __be16 proto,
|
||||
@@ -1836,6 +1838,8 @@ static int dsa_user_vlan_rx_kill_vid(struct net_device *dev, __be16 proto,
|
||||
.vid = vid,
|
||||
/* This API only allows programming tagged, non-PVID VIDs */
|
||||
.flags = 0,
|
||||
@@ -159,6 +153,3 @@ index 58174ad612d2..c0019d0c1172 100644
|
||||
};
|
||||
struct dsa_switch *ds = dp->ds;
|
||||
struct netdev_hw_addr *ha;
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+7
-16
@@ -1,12 +1,8 @@
|
||||
From 2cda5240aa8504deefb0a1758b2088136183cde4 Mon Sep 17 00:00:00 2001
|
||||
From 608bb0d64009c75b4dd261aa4870b1945bcb9634 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Tue, 19 Sep 2023 18:38:10 +0200
|
||||
Subject: [PATCH 01/29] net: phy: marvell10g: Support firmware loading on
|
||||
Subject: [PATCH 14/30] net: phy: marvell10g: Support firmware loading on
|
||||
88X3310
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
|
||||
When probing, if a device is waiting for firmware to be loaded into
|
||||
its RAM, ask userspace for the binary and load it over XMDIO.
|
||||
@@ -14,14 +10,12 @@ its RAM, ask userspace for the binary and load it over XMDIO.
|
||||
We have no choice but to bail out of the probe if firmware is not
|
||||
available, as the device does not have any built-in image on which to
|
||||
fall back.
|
||||
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
drivers/net/phy/marvell10g.c | 161 +++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 161 insertions(+)
|
||||
|
||||
diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
|
||||
index 8fd42131cdbf..44294519231e 100644
|
||||
index 6642eb642d4b..79d9483419c0 100644
|
||||
--- a/drivers/net/phy/marvell10g.c
|
||||
+++ b/drivers/net/phy/marvell10g.c
|
||||
@@ -25,6 +25,7 @@
|
||||
@@ -65,7 +59,7 @@ index 8fd42131cdbf..44294519231e 100644
|
||||
#ifdef CONFIG_HWMON
|
||||
int (*hwmon_read_temp_reg)(struct phy_device *phydev);
|
||||
#endif
|
||||
@@ -487,6 +500,145 @@ static const struct sfp_upstream_ops mv3310_sfp_ops = {
|
||||
@@ -508,6 +521,145 @@ static const struct sfp_upstream_ops mv3310_sfp_ops = {
|
||||
.module_insert = mv3310_sfp_insert,
|
||||
};
|
||||
|
||||
@@ -211,7 +205,7 @@ index 8fd42131cdbf..44294519231e 100644
|
||||
static int mv3310_probe(struct phy_device *phydev)
|
||||
{
|
||||
const struct mv3310_chip *chip = to_mv3310_chip(phydev);
|
||||
@@ -508,6 +660,12 @@ static int mv3310_probe(struct phy_device *phydev)
|
||||
@@ -529,6 +681,12 @@ static int mv3310_probe(struct phy_device *phydev)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
@@ -224,7 +218,7 @@ index 8fd42131cdbf..44294519231e 100644
|
||||
priv = devm_kzalloc(&phydev->mdio.dev, sizeof(*priv), GFP_KERNEL);
|
||||
if (!priv)
|
||||
return -ENOMEM;
|
||||
@@ -1201,6 +1359,8 @@ static const struct mv3310_chip mv3310_type = {
|
||||
@@ -1222,6 +1380,8 @@ static const struct mv3310_chip mv3310_type = {
|
||||
.mactypes = mv3310_mactypes,
|
||||
.n_mactypes = ARRAY_SIZE(mv3310_mactypes),
|
||||
|
||||
@@ -233,12 +227,9 @@ index 8fd42131cdbf..44294519231e 100644
|
||||
#ifdef CONFIG_HWMON
|
||||
.hwmon_read_temp_reg = mv3310_hwmon_read_temp_reg,
|
||||
#endif
|
||||
@@ -1474,4 +1634,5 @@ static const struct mdio_device_id __maybe_unused mv3310_tbl[] = {
|
||||
@@ -1491,4 +1651,5 @@ static struct mdio_device_id __maybe_unused mv3310_tbl[] = {
|
||||
};
|
||||
MODULE_DEVICE_TABLE(mdio, mv3310_tbl);
|
||||
MODULE_DESCRIPTION("Marvell Alaska X/M multi-gigabit Ethernet PHY driver");
|
||||
+MODULE_FIRMWARE("mrvl/x3310fw.hdr");
|
||||
MODULE_LICENSE("GPL");
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+4
-13
@@ -1,27 +1,21 @@
|
||||
From 65ce7e078d94e739a2255f07f697215ba5172e03 Mon Sep 17 00:00:00 2001
|
||||
From 45db0b0d39dccebe83ffd441dc4670826147f594 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Tue, 21 Nov 2023 20:15:24 +0100
|
||||
Subject: [PATCH 02/29] net: phy: marvell10g: Fix power-up when strapped to
|
||||
Subject: [PATCH 15/30] net: phy: marvell10g: Fix power-up when strapped to
|
||||
start powered down
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
|
||||
On devices which are hardware strapped to start powered down (PDSTATE
|
||||
== 1), make sure that we clear the power-down bit on all units
|
||||
affected by this setting.
|
||||
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
drivers/net/phy/marvell10g.c | 18 +++++++++++++++---
|
||||
1 file changed, 15 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
|
||||
index 44294519231e..40439db49601 100644
|
||||
index 79d9483419c0..268484092776 100644
|
||||
--- a/drivers/net/phy/marvell10g.c
|
||||
+++ b/drivers/net/phy/marvell10g.c
|
||||
@@ -322,11 +322,23 @@ static int mv3310_power_down(struct phy_device *phydev)
|
||||
@@ -342,11 +342,23 @@ static int mv3310_power_down(struct phy_device *phydev)
|
||||
|
||||
static int mv3310_power_up(struct phy_device *phydev)
|
||||
{
|
||||
@@ -48,6 +42,3 @@ index 44294519231e..40439db49601 100644
|
||||
|
||||
/* Sometimes, the power down bit doesn't clear immediately, and
|
||||
* a read of this register causes the bit not to clear. Delay
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+6
-15
@@ -1,11 +1,7 @@
|
||||
From 19c9739b06feceb9df4142fa7323a51fc8782113 Mon Sep 17 00:00:00 2001
|
||||
From a5cb25fce0a83160aaccc3071d95bd2e1a202b8f Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Wed, 15 Nov 2023 20:58:42 +0100
|
||||
Subject: [PATCH 03/29] net: phy: marvell10g: Add LED support for 88X3310
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
Subject: [PATCH 16/30] net: phy: marvell10g: Add LED support for 88X3310
|
||||
|
||||
Pickup the LEDs from the state in which the hardware reset or
|
||||
bootloader left them, but also support further configuration via
|
||||
@@ -20,14 +16,12 @@ Trigger support:
|
||||
software blinking
|
||||
- "netdev": Offload link or duplex information to the solid behavior;
|
||||
tx and/or rx activity to blink behavior.
|
||||
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
drivers/net/phy/marvell10g.c | 422 +++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 422 insertions(+)
|
||||
|
||||
diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
|
||||
index 40439db49601..7ae4744f147b 100644
|
||||
index 268484092776..9f8475b67ef7 100644
|
||||
--- a/drivers/net/phy/marvell10g.c
|
||||
+++ b/drivers/net/phy/marvell10g.c
|
||||
@@ -28,6 +28,7 @@
|
||||
@@ -483,7 +477,7 @@ index 40439db49601..7ae4744f147b 100644
|
||||
#ifdef CONFIG_HWMON
|
||||
static umode_t mv3310_hwmon_is_visible(const void *data,
|
||||
enum hwmon_sensor_types type,
|
||||
@@ -712,6 +1123,10 @@ static int mv3310_probe(struct phy_device *phydev)
|
||||
@@ -733,6 +1144,10 @@ static int mv3310_probe(struct phy_device *phydev)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -494,7 +488,7 @@ index 40439db49601..7ae4744f147b 100644
|
||||
chip->init_supported_interfaces(priv->supported_interfaces);
|
||||
|
||||
return phy_sfp_probe(phydev, &mv3310_sfp_ops);
|
||||
@@ -1364,6 +1779,7 @@ static void mv2111_init_supported_interfaces(unsigned long *mask)
|
||||
@@ -1385,6 +1800,7 @@ static void mv2111_init_supported_interfaces(unsigned long *mask)
|
||||
static const struct mv3310_chip mv3310_type = {
|
||||
.has_downshift = mv3310_has_downshift,
|
||||
.init_supported_interfaces = mv3310_init_supported_interfaces,
|
||||
@@ -502,7 +496,7 @@ index 40439db49601..7ae4744f147b 100644
|
||||
.get_mactype = mv3310_get_mactype,
|
||||
.set_mactype = mv3310_set_mactype,
|
||||
.select_mactype = mv3310_select_mactype,
|
||||
@@ -1577,6 +1993,12 @@ static struct phy_driver mv3310_drivers[] = {
|
||||
@@ -1594,6 +2010,12 @@ static struct phy_driver mv3310_drivers[] = {
|
||||
.set_loopback = genphy_c45_loopback,
|
||||
.get_wol = mv3110_get_wol,
|
||||
.set_wol = mv3110_set_wol,
|
||||
@@ -515,6 +509,3 @@ index 40439db49601..7ae4744f147b 100644
|
||||
},
|
||||
{
|
||||
.phy_id = MARVELL_PHY_ID_88X3310,
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+3
-12
@@ -1,12 +1,8 @@
|
||||
From aeed21718ad95ea9e4cb668d47fe5c4c9ca7d383 Mon Sep 17 00:00:00 2001
|
||||
From b3305b4836aaaced2821fd7c49c5667cf22b2170 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Tue, 12 Dec 2023 09:51:05 +0100
|
||||
Subject: [PATCH 04/29] net: phy: marvell10g: Support LEDs tied to a single
|
||||
Subject: [PATCH 17/30] net: phy: marvell10g: Support LEDs tied to a single
|
||||
media side
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
|
||||
In a combo-port setup, i.e. where both the copper and fiber interface
|
||||
are available to the user, the LEDs may be physically located either
|
||||
@@ -17,14 +13,12 @@ tied to a particular media side, and use that information to refine
|
||||
the offloading of the "netdev" trigger, such that LEDs attached to the
|
||||
RJ45 jack only lights up when a copper link is established, and vice
|
||||
versa for the SFP cage.
|
||||
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
drivers/net/phy/marvell10g.c | 23 ++++++++++++++++++++++-
|
||||
1 file changed, 22 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
|
||||
index 7ae4744f147b..5e48355ffcef 100644
|
||||
index 9f8475b67ef7..82b2e9b55b67 100644
|
||||
--- a/drivers/net/phy/marvell10g.c
|
||||
+++ b/drivers/net/phy/marvell10g.c
|
||||
@@ -192,6 +192,9 @@ struct mv3310_chip {
|
||||
@@ -78,6 +72,3 @@ index 7ae4744f147b..5e48355ffcef 100644
|
||||
/* mv3310_led_polarity_set() will not be called unless the
|
||||
* device tree specifies a mode that of_phy_led() considers to
|
||||
* be a non-default configuration. I.e., something other than
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+4
-13
@@ -1,11 +1,7 @@
|
||||
From 1df613d51cd26250219870cd175324652adde99e Mon Sep 17 00:00:00 2001
|
||||
From 6f67eb48522bfbe3569f2504ce14fdef21f7beb5 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Wed, 27 Mar 2024 10:10:19 +0100
|
||||
Subject: [PATCH 05/29] net: phy: Do not resume PHY when attaching
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
Subject: [PATCH 18/30] net: phy: Do not resume PHY when attaching
|
||||
|
||||
The PHY should not start negotiating with its link-partner until
|
||||
explicitly instructed to do so.
|
||||
@@ -18,17 +14,15 @@ Otherwise, drivers that attached to their PHYs during
|
||||
probing (e.g. DSA) would end up with a physical link being
|
||||
established, even though the corresponding interface was still
|
||||
administratively down.
|
||||
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
drivers/net/phy/phy_device.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
|
||||
index 7a67c900e79a..5c61faf4b10a 100644
|
||||
index 834624a61060..d09872e1ac4e 100644
|
||||
--- a/drivers/net/phy/phy_device.c
|
||||
+++ b/drivers/net/phy/phy_device.c
|
||||
@@ -1750,7 +1750,6 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
|
||||
@@ -1661,7 +1661,6 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
|
||||
if (err)
|
||||
goto error;
|
||||
|
||||
@@ -36,6 +30,3 @@ index 7a67c900e79a..5c61faf4b10a 100644
|
||||
if (!phydev->is_on_sfp_module)
|
||||
phy_led_triggers_register(phydev);
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+35
-61
@@ -1,12 +1,8 @@
|
||||
From 499093fbb2cc3d4db2e60e1d07908acf2c0d857a Mon Sep 17 00:00:00 2001
|
||||
From 22d135ca0d8434f1883032cb2d0afa3b49508a89 Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Mon, 4 Mar 2024 16:47:28 +0100
|
||||
Subject: [PATCH 06/29] net: bridge: avoid classifying unknown multicast as
|
||||
Subject: [PATCH 19/30] net: bridge: avoid classifying unknown multicast as
|
||||
mrouters_only
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
|
||||
Unknown multicast, MAC/IPv4/IPv6, should always be flooded according to
|
||||
the per-port mcast_flood setting, as well as to detected and configured
|
||||
@@ -19,36 +15,35 @@ Because a multicast router should always receive both known and unknown
|
||||
multicast.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
include/uapi/linux/if_bridge.h | 1 +
|
||||
net/bridge/br.c | 5 +++++
|
||||
net/bridge/br_device.c | 10 ++++++----
|
||||
net/bridge/br_forward.c | 14 ++++++++++++--
|
||||
net/bridge/br_input.c | 12 ++++++++----
|
||||
net/bridge/br_input.c | 2 +-
|
||||
net/bridge/br_multicast.c | 11 +++++++++--
|
||||
net/bridge/br_private.h | 18 ++++++++++++++++--
|
||||
7 files changed, 57 insertions(+), 14 deletions(-)
|
||||
7 files changed, 50 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h
|
||||
index e52f8207ab27..306fa8a94c81 100644
|
||||
index a5b743a2f775..3bffc39d7800 100644
|
||||
--- a/include/uapi/linux/if_bridge.h
|
||||
+++ b/include/uapi/linux/if_bridge.h
|
||||
@@ -835,6 +835,7 @@ enum br_boolopt_id {
|
||||
@@ -830,6 +830,7 @@ enum br_boolopt_id {
|
||||
BR_BOOLOPT_NO_LL_LEARN,
|
||||
BR_BOOLOPT_MCAST_VLAN_SNOOPING,
|
||||
BR_BOOLOPT_MST_ENABLE,
|
||||
BR_BOOLOPT_MDB_OFFLOAD_FAIL_NOTIFICATION,
|
||||
BR_BOOLOPT_FDB_LOCAL_VLAN_0,
|
||||
+ BR_BOOLOPT_MCAST_FLOOD_ALWAYS,
|
||||
BR_BOOLOPT_MAX
|
||||
};
|
||||
|
||||
diff --git a/net/bridge/br.c b/net/bridge/br.c
|
||||
index c37e52e2f29a..0759bc37d6f0 100644
|
||||
index 35e9842f4203..921781a83589 100644
|
||||
--- a/net/bridge/br.c
|
||||
+++ b/net/bridge/br.c
|
||||
@@ -312,6 +312,9 @@ int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id opt, bool on,
|
||||
case BR_BOOLOPT_FDB_LOCAL_VLAN_0:
|
||||
err = br_toggle_fdb_local_vlan_0(br, on, extack);
|
||||
@@ -282,6 +282,9 @@ int br_boolopt_toggle(struct net_bridge *br, enum br_boolopt_id opt, bool on,
|
||||
case BR_BOOLOPT_MST_ENABLE:
|
||||
err = br_mst_set_enabled(br, on, extack);
|
||||
break;
|
||||
+ case BR_BOOLOPT_MCAST_FLOOD_ALWAYS:
|
||||
+ br_opt_toggle(br, BROPT_MCAST_FLOOD_ALWAYS, on);
|
||||
@@ -56,20 +51,20 @@ index c37e52e2f29a..0759bc37d6f0 100644
|
||||
default:
|
||||
/* shouldn't be called with unsupported options */
|
||||
WARN_ON(1);
|
||||
@@ -334,6 +337,8 @@ int br_boolopt_get(const struct net_bridge *br, enum br_boolopt_id opt)
|
||||
return br_opt_get(br, BROPT_MDB_OFFLOAD_FAIL_NOTIFICATION);
|
||||
case BR_BOOLOPT_FDB_LOCAL_VLAN_0:
|
||||
return br_opt_get(br, BROPT_FDB_LOCAL_VLAN_0);
|
||||
@@ -300,6 +303,8 @@ int br_boolopt_get(const struct net_bridge *br, enum br_boolopt_id opt)
|
||||
return br_opt_get(br, BROPT_MCAST_VLAN_SNOOPING_ENABLED);
|
||||
case BR_BOOLOPT_MST_ENABLE:
|
||||
return br_opt_get(br, BROPT_MST_ENABLED);
|
||||
+ case BR_BOOLOPT_MCAST_FLOOD_ALWAYS:
|
||||
+ return br_opt_get(br, BROPT_MCAST_FLOOD_ALWAYS);
|
||||
default:
|
||||
/* shouldn't be called with unsupported options */
|
||||
WARN_ON(1);
|
||||
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
|
||||
index a818fdc22da9..3cdb97ded410 100644
|
||||
index 26b79feb385d..f3ecc70a47dc 100644
|
||||
--- a/net/bridge/br_device.c
|
||||
+++ b/net/bridge/br_device.c
|
||||
@@ -89,10 +89,10 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
@@ -87,10 +87,10 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
|
||||
dest = eth_hdr(skb)->h_dest;
|
||||
if (is_broadcast_ether_addr(dest)) {
|
||||
@@ -82,7 +77,7 @@ index a818fdc22da9..3cdb97ded410 100644
|
||||
goto out;
|
||||
}
|
||||
if (br_multicast_rcv(&brmctx, &pmctx_null, vlan, skb, vid)) {
|
||||
@@ -105,11 +105,11 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
@@ -103,11 +103,11 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
br_multicast_querier_exists(brmctx, eth_hdr(skb), mdst))
|
||||
br_multicast_flood(mdst, skb, brmctx, false, true);
|
||||
else
|
||||
@@ -96,7 +91,7 @@ index a818fdc22da9..3cdb97ded410 100644
|
||||
}
|
||||
out:
|
||||
rcu_read_unlock();
|
||||
@@ -528,6 +528,8 @@ void br_dev_setup(struct net_device *dev)
|
||||
@@ -526,6 +526,8 @@ void br_dev_setup(struct net_device *dev)
|
||||
br->bridge_ageing_time = br->ageing_time = BR_DEFAULT_AGEING_TIME;
|
||||
dev->max_mtu = ETH_MAX_MTU;
|
||||
|
||||
@@ -106,10 +101,10 @@ index a818fdc22da9..3cdb97ded410 100644
|
||||
br_stp_timer_init(br);
|
||||
br_multicast_init(br);
|
||||
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
|
||||
index dea09096ad0f..f0a613238e0d 100644
|
||||
index e9f09cdb9848..acca5cabec15 100644
|
||||
--- a/net/bridge/br_forward.c
|
||||
+++ b/net/bridge/br_forward.c
|
||||
@@ -199,15 +199,20 @@ static struct net_bridge_port *maybe_deliver(
|
||||
@@ -199,14 +199,19 @@ static struct net_bridge_port *maybe_deliver(
|
||||
|
||||
/* called under rcu_read_lock */
|
||||
void br_flood(struct net_bridge *br, struct sk_buff *skb,
|
||||
@@ -118,7 +113,6 @@ index dea09096ad0f..f0a613238e0d 100644
|
||||
+ struct net_bridge_mcast *brmctx, enum br_pkt_type pkt_type,
|
||||
+ bool local_rcv, bool local_orig, u16 vid)
|
||||
{
|
||||
enum skb_drop_reason reason = SKB_DROP_REASON_NO_TX_TARGET;
|
||||
+ struct net_bridge_port *rport = NULL;
|
||||
struct net_bridge_port *prev = NULL;
|
||||
+ struct hlist_node *rp = NULL;
|
||||
@@ -132,7 +126,7 @@ index dea09096ad0f..f0a613238e0d 100644
|
||||
list_for_each_entry_rcu(p, &br->port_list, list) {
|
||||
/* Do not flood unicast traffic to ports that turn it off, nor
|
||||
* other traffic if flood off, except for traffic we originate
|
||||
@@ -218,6 +223,11 @@ void br_flood(struct net_bridge *br, struct sk_buff *skb,
|
||||
@@ -217,6 +222,11 @@ void br_flood(struct net_bridge *br, struct sk_buff *skb,
|
||||
continue;
|
||||
break;
|
||||
case BR_PKT_MULTICAST:
|
||||
@@ -145,27 +139,10 @@ index dea09096ad0f..f0a613238e0d 100644
|
||||
continue;
|
||||
break;
|
||||
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
|
||||
index 777fa869c1a1..924d41c62395 100644
|
||||
index 2eb2bb664388..dd6a5d2c1351 100644
|
||||
--- a/net/bridge/br_input.c
|
||||
+++ b/net/bridge/br_input.c
|
||||
@@ -186,9 +186,13 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb
|
||||
switch (pkt_type) {
|
||||
case BR_PKT_MULTICAST:
|
||||
mdst = br_mdb_entry_skb_get(brmctx, skb, vid);
|
||||
- if ((mdst || BR_INPUT_SKB_CB_MROUTERS_ONLY(skb)) &&
|
||||
- br_multicast_querier_exists(brmctx, eth_hdr(skb), mdst)) {
|
||||
- if ((mdst && mdst->host_joined) ||
|
||||
+ /* Only use strict multicast filtering when:
|
||||
+ * 1. There's an MDB entry (someone joined this group), AND
|
||||
+ * 2. A querier exists (we can rely on IGMP/MLD)
|
||||
+ * Unknown multicast (no MDB entry) is always flooded.
|
||||
+ */
|
||||
+ if (mdst && br_multicast_querier_exists(brmctx, eth_hdr(skb), mdst)) {
|
||||
+ if (mdst->host_joined ||
|
||||
br_multicast_is_router(brmctx, skb) ||
|
||||
br->dev->flags & IFF_ALLMULTI) {
|
||||
local_rcv = true;
|
||||
@@ -226,7 +230,7 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb
|
||||
@@ -212,7 +212,7 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb
|
||||
br_forward(dst->dst, skb, local_rcv, false);
|
||||
} else {
|
||||
if (!mcast_hit)
|
||||
@@ -175,10 +152,10 @@ index 777fa869c1a1..924d41c62395 100644
|
||||
br_multicast_flood(mdst, skb, brmctx, local_rcv, false);
|
||||
}
|
||||
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
|
||||
index 22d12e545966..06b729ed2d03 100644
|
||||
index 0a00c3f57815..1ae021be0a7b 100644
|
||||
--- a/net/bridge/br_multicast.c
|
||||
+++ b/net/bridge/br_multicast.c
|
||||
@@ -3845,6 +3845,11 @@ static void br_multicast_err_count(const struct net_bridge *br,
|
||||
@@ -3835,6 +3835,11 @@ static void br_multicast_err_count(const struct net_bridge *br,
|
||||
u64_stats_update_end(&pstats->syncp);
|
||||
}
|
||||
|
||||
@@ -190,7 +167,7 @@ index 22d12e545966..06b729ed2d03 100644
|
||||
static void br_multicast_pim(struct net_bridge_mcast *brmctx,
|
||||
struct net_bridge_mcast_port *pmctx,
|
||||
const struct sk_buff *skb)
|
||||
@@ -3891,7 +3896,8 @@ static int br_multicast_ipv4_rcv(struct net_bridge_mcast *brmctx,
|
||||
@@ -3881,7 +3886,8 @@ static int br_multicast_ipv4_rcv(struct net_bridge_mcast *brmctx,
|
||||
|
||||
if (err == -ENOMSG) {
|
||||
if (!ipv4_is_local_multicast(ip_hdr(skb)->daddr)) {
|
||||
@@ -200,7 +177,7 @@ index 22d12e545966..06b729ed2d03 100644
|
||||
} else if (pim_ipv4_all_pim_routers(ip_hdr(skb)->daddr)) {
|
||||
if (ip_hdr(skb)->protocol == IPPROTO_PIM)
|
||||
br_multicast_pim(brmctx, pmctx, skb);
|
||||
@@ -3960,7 +3966,8 @@ static int br_multicast_ipv6_rcv(struct net_bridge_mcast *brmctx,
|
||||
@@ -3950,7 +3956,8 @@ static int br_multicast_ipv6_rcv(struct net_bridge_mcast *brmctx,
|
||||
|
||||
if (err == -ENOMSG || err == -ENODATA) {
|
||||
if (!ipv6_addr_is_ll_all_nodes(&ipv6_hdr(skb)->daddr))
|
||||
@@ -211,18 +188,18 @@ index 22d12e545966..06b729ed2d03 100644
|
||||
ipv6_addr_is_all_snoopers(&ipv6_hdr(skb)->daddr))
|
||||
br_ip6_multicast_mrd_rcv(brmctx, pmctx, skb);
|
||||
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
|
||||
index b9b2981c4841..ccbaaa96f7c7 100644
|
||||
index b2e4e2d04f02..60e4a0e4dd63 100644
|
||||
--- a/net/bridge/br_private.h
|
||||
+++ b/net/bridge/br_private.h
|
||||
@@ -489,6 +489,7 @@ enum net_bridge_opts {
|
||||
@@ -486,6 +486,7 @@ enum net_bridge_opts {
|
||||
BROPT_VLAN_BRIDGE_BINDING,
|
||||
BROPT_MCAST_VLAN_SNOOPING_ENABLED,
|
||||
BROPT_MST_ENABLED,
|
||||
BROPT_MDB_OFFLOAD_FAIL_NOTIFICATION,
|
||||
BROPT_FDB_LOCAL_VLAN_0,
|
||||
+ BROPT_MCAST_FLOOD_ALWAYS,
|
||||
};
|
||||
|
||||
struct net_bridge {
|
||||
@@ -895,8 +896,8 @@ void br_forward(const struct net_bridge_port *to, struct sk_buff *skb,
|
||||
@@ -890,8 +891,8 @@ void br_forward(const struct net_bridge_port *to, struct sk_buff *skb,
|
||||
bool local_rcv, bool local_orig);
|
||||
int br_forward_finish(struct net *net, struct sock *sk, struct sk_buff *skb);
|
||||
void br_flood(struct net_bridge *br, struct sk_buff *skb,
|
||||
@@ -233,7 +210,7 @@ index b9b2981c4841..ccbaaa96f7c7 100644
|
||||
|
||||
/* return true if both source port and dest port are isolated */
|
||||
static inline bool br_skb_isolated(const struct net_bridge_port *to,
|
||||
@@ -1435,6 +1436,19 @@ static inline void br_multicast_flood(struct net_bridge_mdb_entry *mdst,
|
||||
@@ -1412,6 +1413,19 @@ static inline void br_multicast_flood(struct net_bridge_mdb_entry *mdst,
|
||||
{
|
||||
}
|
||||
|
||||
@@ -253,6 +230,3 @@ index b9b2981c4841..ccbaaa96f7c7 100644
|
||||
static inline bool br_multicast_is_router(struct net_bridge_mcast *brmctx,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+4
-12
@@ -1,12 +1,8 @@
|
||||
From 4b0261a3a65f5f28b2d6e356b7a4740b939984fa Mon Sep 17 00:00:00 2001
|
||||
From 0dd434fe200c7a22799c06359b55ff79c372e53a Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Tue, 5 Mar 2024 06:44:41 +0100
|
||||
Subject: [PATCH 07/29] net: bridge: Ignore router ports when forwarding L2
|
||||
Subject: [PATCH 20/30] net: bridge: Ignore router ports when forwarding L2
|
||||
multicast
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
|
||||
Multicast router ports are either statically configured or learned from
|
||||
control protocol traffic (IGMP/MLD/PIM). These protocols regulate IP
|
||||
@@ -15,16 +11,15 @@ of unknown multicast or using permanent MDB entries.
|
||||
|
||||
Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
net/bridge/br_private.h | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
|
||||
index ccbaaa96f7c7..d7187bead496 100644
|
||||
index 60e4a0e4dd63..76a0fb2c2941 100644
|
||||
--- a/net/bridge/br_private.h
|
||||
+++ b/net/bridge/br_private.h
|
||||
@@ -1097,7 +1097,10 @@ br_multicast_get_first_rport_node(struct net_bridge_mcast *brmctx,
|
||||
@@ -1090,7 +1090,10 @@ br_multicast_get_first_rport_node(struct net_bridge_mcast *brmctx,
|
||||
if (skb->protocol == htons(ETH_P_IPV6))
|
||||
return rcu_dereference(hlist_first_rcu(&brmctx->ip6_mc_router_list));
|
||||
#endif
|
||||
@@ -36,6 +31,3 @@ index ccbaaa96f7c7..d7187bead496 100644
|
||||
}
|
||||
|
||||
static inline struct net_bridge_port *
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+23
-31
@@ -1,12 +1,8 @@
|
||||
From af297677c0ac5ab96eca7ca1e837d621404015e1 Mon Sep 17 00:00:00 2001
|
||||
From faed56e32dc877474ef30a545e631b05a9cb99e2 Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Thu, 4 Apr 2024 16:36:30 +0200
|
||||
Subject: [PATCH 08/29] net: bridge: drop delay for applying strict multicast
|
||||
Subject: [PATCH 21/30] net: bridge: drop delay for applying strict multicast
|
||||
filtering
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
|
||||
This *local* patch drops the initial delay before applying strict multicast
|
||||
filtering, introduced in [1] and recently updated in [2].
|
||||
@@ -22,14 +18,13 @@ A proper fix for upstreaming could be to add a knob to disable the delay.
|
||||
[2]: https://lore.kernel.org/netdev/20240127175033.9640-1-linus.luessing@c0d3.blue/
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
net/bridge/br_multicast.c | 42 +++++++--------------------------------
|
||||
net/bridge/br_private.h | 4 +---
|
||||
2 files changed, 8 insertions(+), 38 deletions(-)
|
||||
|
||||
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
|
||||
index 06b729ed2d03..66d709f6b19d 100644
|
||||
index 1ae021be0a7b..dd815b0fa8f8 100644
|
||||
--- a/net/bridge/br_multicast.c
|
||||
+++ b/net/bridge/br_multicast.c
|
||||
@@ -1762,10 +1762,6 @@ static void br_ip6_multicast_querier_expired(struct timer_list *t)
|
||||
@@ -43,7 +38,7 @@ index 06b729ed2d03..66d709f6b19d 100644
|
||||
static void br_multicast_select_own_querier(struct net_bridge_mcast *brmctx,
|
||||
struct br_ip *ip,
|
||||
struct sk_buff *skb)
|
||||
@@ -3267,12 +3263,8 @@ int br_multicast_dump_querier_state(struct sk_buff *skb,
|
||||
@@ -3257,12 +3253,8 @@ int br_multicast_dump_querier_state(struct sk_buff *skb,
|
||||
|
||||
static void
|
||||
br_multicast_update_query_timer(struct net_bridge_mcast *brmctx,
|
||||
@@ -57,7 +52,7 @@ index 06b729ed2d03..66d709f6b19d 100644
|
||||
mod_timer(&query->timer, jiffies + brmctx->multicast_querier_interval);
|
||||
}
|
||||
|
||||
@@ -3463,13 +3455,12 @@ static void
|
||||
@@ -3453,13 +3445,12 @@ static void
|
||||
br_ip4_multicast_query_received(struct net_bridge_mcast *brmctx,
|
||||
struct net_bridge_mcast_port *pmctx,
|
||||
struct bridge_mcast_other_query *query,
|
||||
@@ -73,7 +68,7 @@ index 06b729ed2d03..66d709f6b19d 100644
|
||||
br_ip4_multicast_mark_router(brmctx, pmctx);
|
||||
}
|
||||
|
||||
@@ -3478,13 +3469,12 @@ static void
|
||||
@@ -3468,13 +3459,12 @@ static void
|
||||
br_ip6_multicast_query_received(struct net_bridge_mcast *brmctx,
|
||||
struct net_bridge_mcast_port *pmctx,
|
||||
struct bridge_mcast_other_query *query,
|
||||
@@ -89,7 +84,7 @@ index 06b729ed2d03..66d709f6b19d 100644
|
||||
br_ip6_multicast_mark_router(brmctx, pmctx);
|
||||
}
|
||||
#endif
|
||||
@@ -3538,7 +3528,7 @@ static void br_ip4_multicast_query(struct net_bridge_mcast *brmctx,
|
||||
@@ -3528,7 +3518,7 @@ static void br_ip4_multicast_query(struct net_bridge_mcast *brmctx,
|
||||
|
||||
br_ip4_multicast_query_received(brmctx, pmctx,
|
||||
&brmctx->ip4_other_query,
|
||||
@@ -98,7 +93,7 @@ index 06b729ed2d03..66d709f6b19d 100644
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -3626,7 +3616,7 @@ static int br_ip6_multicast_query(struct net_bridge_mcast *brmctx,
|
||||
@@ -3616,7 +3606,7 @@ static int br_ip6_multicast_query(struct net_bridge_mcast *brmctx,
|
||||
|
||||
br_ip6_multicast_query_received(brmctx, pmctx,
|
||||
&brmctx->ip6_other_query,
|
||||
@@ -107,7 +102,7 @@ index 06b729ed2d03..66d709f6b19d 100644
|
||||
goto out;
|
||||
} else if (!group) {
|
||||
goto out;
|
||||
@@ -4131,8 +4121,6 @@ void br_multicast_ctx_init(struct net_bridge *br,
|
||||
@@ -4124,8 +4114,6 @@ void br_multicast_ctx_init(struct net_bridge *br,
|
||||
br_ip4_multicast_local_router_expired, 0);
|
||||
timer_setup(&brmctx->ip4_other_query.timer,
|
||||
br_ip4_multicast_querier_expired, 0);
|
||||
@@ -116,7 +111,7 @@ index 06b729ed2d03..66d709f6b19d 100644
|
||||
timer_setup(&brmctx->ip4_own_query.timer,
|
||||
br_ip4_multicast_query_expired, 0);
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
@@ -4140,8 +4128,6 @@ void br_multicast_ctx_init(struct net_bridge *br,
|
||||
@@ -4133,8 +4121,6 @@ void br_multicast_ctx_init(struct net_bridge *br,
|
||||
br_ip6_multicast_local_router_expired, 0);
|
||||
timer_setup(&brmctx->ip6_other_query.timer,
|
||||
br_ip6_multicast_querier_expired, 0);
|
||||
@@ -125,20 +120,20 @@ index 06b729ed2d03..66d709f6b19d 100644
|
||||
timer_setup(&brmctx->ip6_own_query.timer,
|
||||
br_ip6_multicast_query_expired, 0);
|
||||
#endif
|
||||
@@ -4276,12 +4262,10 @@ static void __br_multicast_stop(struct net_bridge_mcast *brmctx)
|
||||
@@ -4269,12 +4255,10 @@ static void __br_multicast_stop(struct net_bridge_mcast *brmctx)
|
||||
{
|
||||
timer_delete_sync(&brmctx->ip4_mc_router_timer);
|
||||
timer_delete_sync(&brmctx->ip4_other_query.timer);
|
||||
- timer_delete_sync(&brmctx->ip4_other_query.delay_timer);
|
||||
timer_delete_sync(&brmctx->ip4_own_query.timer);
|
||||
del_timer_sync(&brmctx->ip4_mc_router_timer);
|
||||
del_timer_sync(&brmctx->ip4_other_query.timer);
|
||||
- del_timer_sync(&brmctx->ip4_other_query.delay_timer);
|
||||
del_timer_sync(&brmctx->ip4_own_query.timer);
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
timer_delete_sync(&brmctx->ip6_mc_router_timer);
|
||||
timer_delete_sync(&brmctx->ip6_other_query.timer);
|
||||
- timer_delete_sync(&brmctx->ip6_other_query.delay_timer);
|
||||
timer_delete_sync(&brmctx->ip6_own_query.timer);
|
||||
del_timer_sync(&brmctx->ip6_mc_router_timer);
|
||||
del_timer_sync(&brmctx->ip6_other_query.timer);
|
||||
- del_timer_sync(&brmctx->ip6_other_query.delay_timer);
|
||||
del_timer_sync(&brmctx->ip6_own_query.timer);
|
||||
#endif
|
||||
}
|
||||
@@ -4735,8 +4719,6 @@ EXPORT_SYMBOL_GPL(br_multicast_router);
|
||||
@@ -4728,8 +4712,6 @@ EXPORT_SYMBOL_GPL(br_multicast_router);
|
||||
|
||||
int br_multicast_set_querier(struct net_bridge_mcast *brmctx, unsigned long val)
|
||||
{
|
||||
@@ -147,7 +142,7 @@ index 06b729ed2d03..66d709f6b19d 100644
|
||||
val = !!val;
|
||||
|
||||
spin_lock_bh(&brmctx->br->multicast_lock);
|
||||
@@ -4747,19 +4729,9 @@ int br_multicast_set_querier(struct net_bridge_mcast *brmctx, unsigned long val)
|
||||
@@ -4740,19 +4722,9 @@ int br_multicast_set_querier(struct net_bridge_mcast *brmctx, unsigned long val)
|
||||
if (!val)
|
||||
goto unlock;
|
||||
|
||||
@@ -168,7 +163,7 @@ index 06b729ed2d03..66d709f6b19d 100644
|
||||
#endif
|
||||
|
||||
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
|
||||
index d7187bead496..83dc15fdcefd 100644
|
||||
index 76a0fb2c2941..dd36afeaa1a0 100644
|
||||
--- a/net/bridge/br_private.h
|
||||
+++ b/net/bridge/br_private.h
|
||||
@@ -80,7 +80,6 @@ struct bridge_mcast_own_query {
|
||||
@@ -179,7 +174,7 @@ index d7187bead496..83dc15fdcefd 100644
|
||||
};
|
||||
|
||||
/* selected querier */
|
||||
@@ -1175,8 +1174,7 @@ __br_multicast_querier_exists(struct net_bridge_mcast *brmctx,
|
||||
@@ -1168,8 +1167,7 @@ __br_multicast_querier_exists(struct net_bridge_mcast *brmctx,
|
||||
own_querier_enabled = false;
|
||||
}
|
||||
|
||||
@@ -189,6 +184,3 @@ index d7187bead496..83dc15fdcefd 100644
|
||||
}
|
||||
|
||||
static inline bool br_multicast_querier_exists(struct net_bridge_mcast *brmctx,
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+12
-21
@@ -1,12 +1,8 @@
|
||||
From 2543c1537f5554d5467975e96f9a5ac1f48c1b9e Mon Sep 17 00:00:00 2001
|
||||
From d4a0fb4552b2a4db65e1e594f2d35b3ef4ea22b4 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Thu, 16 May 2024 14:51:54 +0200
|
||||
Subject: [PATCH 09/29] net: bridge: Differentiate MDB additions from
|
||||
Subject: [PATCH 22/30] net: bridge: Differentiate MDB additions from
|
||||
modifications
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
|
||||
Before this change, the reception of an IGMPv3 report (and analogously
|
||||
for MLDv2) that adds a new group, would trigger two MDB RTM_NEWMDB
|
||||
@@ -24,8 +20,6 @@ generated.
|
||||
|
||||
Therefore, discriminate new groups from changes to existing groups by
|
||||
introducing a RTM_SETMDB events to be used in the latter scenario.
|
||||
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
include/uapi/linux/rtnetlink.h | 2 ++
|
||||
net/bridge/br_mdb.c | 4 ++--
|
||||
@@ -33,10 +27,10 @@ Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
3 files changed, 8 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
|
||||
index dab9493c791b..40a3534f0f1d 100644
|
||||
index db7254d52d93..63508279df47 100644
|
||||
--- a/include/uapi/linux/rtnetlink.h
|
||||
+++ b/include/uapi/linux/rtnetlink.h
|
||||
@@ -142,6 +142,8 @@ enum {
|
||||
@@ -134,6 +134,8 @@ enum {
|
||||
#define RTM_DELMDB RTM_DELMDB
|
||||
RTM_GETMDB = 86,
|
||||
#define RTM_GETMDB RTM_GETMDB
|
||||
@@ -46,21 +40,21 @@ index dab9493c791b..40a3534f0f1d 100644
|
||||
RTM_NEWNSID = 88,
|
||||
#define RTM_NEWNSID RTM_NEWNSID
|
||||
diff --git a/net/bridge/br_mdb.c b/net/bridge/br_mdb.c
|
||||
index 400eb872b403..cd7a2cd0911a 100644
|
||||
index 7e1ad229e133..3b1873e7c499 100644
|
||||
--- a/net/bridge/br_mdb.c
|
||||
+++ b/net/bridge/br_mdb.c
|
||||
@@ -752,7 +752,7 @@ static int br_mdb_replace_group_sg(const struct br_mdb_config *cfg,
|
||||
@@ -734,7 +734,7 @@ static int br_mdb_replace_group_sg(const struct br_mdb_config *cfg,
|
||||
else
|
||||
timer_delete(&pg->timer);
|
||||
del_timer(&pg->timer);
|
||||
|
||||
- br_mdb_notify(cfg->br->dev, mp, pg, RTM_NEWMDB);
|
||||
+ br_mdb_notify(cfg->br->dev, mp, pg, RTM_SETMDB);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -973,7 +973,7 @@ static int br_mdb_replace_group_star_g(const struct br_mdb_config *cfg,
|
||||
@@ -955,7 +955,7 @@ static int br_mdb_replace_group_star_g(const struct br_mdb_config *cfg,
|
||||
else
|
||||
timer_delete(&pg->timer);
|
||||
del_timer(&pg->timer);
|
||||
|
||||
- br_mdb_notify(cfg->br->dev, mp, pg, RTM_NEWMDB);
|
||||
+ br_mdb_notify(cfg->br->dev, mp, pg, RTM_SETMDB);
|
||||
@@ -68,7 +62,7 @@ index 400eb872b403..cd7a2cd0911a 100644
|
||||
if (br_multicast_should_handle_mode(brmctx, cfg->group.proto))
|
||||
br_multicast_star_g_handle_mode(pg, cfg->filter_mode);
|
||||
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
|
||||
index 66d709f6b19d..4d1b27d2cdbc 100644
|
||||
index dd815b0fa8f8..41ab527953da 100644
|
||||
--- a/net/bridge/br_multicast.c
|
||||
+++ b/net/bridge/br_multicast.c
|
||||
@@ -619,7 +619,7 @@ static void br_multicast_fwd_src_handle(struct net_bridge_group_src *src)
|
||||
@@ -89,7 +83,7 @@ index 66d709f6b19d..4d1b27d2cdbc 100644
|
||||
}
|
||||
out:
|
||||
spin_unlock(&br->multicast_lock);
|
||||
@@ -2958,7 +2958,7 @@ static int br_ip4_multicast_igmp3_report(struct net_bridge_mcast *brmctx,
|
||||
@@ -2948,7 +2948,7 @@ static int br_ip4_multicast_igmp3_report(struct net_bridge_mcast *brmctx,
|
||||
break;
|
||||
}
|
||||
if (changed)
|
||||
@@ -98,7 +92,7 @@ index 66d709f6b19d..4d1b27d2cdbc 100644
|
||||
unlock_continue:
|
||||
spin_unlock(&brmctx->br->multicast_lock);
|
||||
}
|
||||
@@ -3100,7 +3100,7 @@ static int br_ip6_multicast_mld2_report(struct net_bridge_mcast *brmctx,
|
||||
@@ -3090,7 +3090,7 @@ static int br_ip6_multicast_mld2_report(struct net_bridge_mcast *brmctx,
|
||||
break;
|
||||
}
|
||||
if (changed)
|
||||
@@ -107,6 +101,3 @@ index 66d709f6b19d..4d1b27d2cdbc 100644
|
||||
unlock_continue:
|
||||
spin_unlock(&brmctx->br->multicast_lock);
|
||||
}
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+2
-11
@@ -1,12 +1,8 @@
|
||||
From 6ebc47bbd15263a24d06c1200ee85e425385a9e1 Mon Sep 17 00:00:00 2001
|
||||
From 18639061a3dc92e879ddf96c31604fe18c000fb4 Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Fri, 24 Nov 2023 23:29:55 +0100
|
||||
Subject: [PATCH 10/29] nvmem: layouts: onie-tlv: Let device probe even when
|
||||
Subject: [PATCH 23/30] nvmem: layouts: onie-tlv: Let device probe even when
|
||||
TLV is invalid
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
|
||||
Before this change, probing an NVMEM device, expected to contain a
|
||||
valid TLV, would fail if it had not been provisioned yet. But an
|
||||
@@ -16,8 +12,6 @@ be successfully probed.
|
||||
|
||||
Therefore, settle for reporting data corruption issues in the log, and
|
||||
simply refrain from registering any cells in those cases.
|
||||
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
drivers/nvmem/layouts/onie-tlv.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
@@ -53,6 +47,3 @@ index 0967a32319a2..48547d5bb502 100644
|
||||
|
||||
data = table + hdr_len;
|
||||
ret = onie_tlv_add_cells(dev, nvmem, data_len, data);
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
From ba5bc5a2d86de4e49febbc7d0c8b86d245c31bbc Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Mon, 29 Apr 2024 15:14:51 +0200
|
||||
Subject: [PATCH 24/30] usb: core: adjust log level for unauthorized devices
|
||||
|
||||
The fact that a USB device currently is not authorized is not an error,
|
||||
so let's adjust the log level so these messages slip below radar for the
|
||||
commonly used 'quiet' log level.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
---
|
||||
drivers/usb/core/driver.c | 4 ++--
|
||||
drivers/usb/core/generic.c | 2 +-
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
|
||||
index 0c3f12daac79..037f03aace9f 100644
|
||||
--- a/drivers/usb/core/driver.c
|
||||
+++ b/drivers/usb/core/driver.c
|
||||
@@ -335,10 +335,10 @@ static int usb_probe_interface(struct device *dev)
|
||||
return error;
|
||||
|
||||
if (udev->authorized == 0) {
|
||||
- dev_err(&intf->dev, "Device is not authorized for usage\n");
|
||||
+ dev_warn(&intf->dev, "Device is not authorized for usage\n");
|
||||
return error;
|
||||
} else if (intf->authorized == 0) {
|
||||
- dev_err(&intf->dev, "Interface %d is not authorized for usage\n",
|
||||
+ dev_warn(&intf->dev, "Interface %d is not authorized for usage\n",
|
||||
intf->altsetting->desc.bInterfaceNumber);
|
||||
return error;
|
||||
}
|
||||
diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c
|
||||
index b134bff5c3fe..60575a01a810 100644
|
||||
--- a/drivers/usb/core/generic.c
|
||||
+++ b/drivers/usb/core/generic.c
|
||||
@@ -247,7 +247,7 @@ int usb_generic_driver_probe(struct usb_device *udev)
|
||||
* with the driver core and lets interface drivers bind to them.
|
||||
*/
|
||||
if (udev->authorized == 0)
|
||||
- dev_err(&udev->dev, "Device is not authorized for usage\n");
|
||||
+ dev_warn(&udev->dev, "Device is not authorized for usage\n");
|
||||
else {
|
||||
c = usb_choose_configuration(udev);
|
||||
if (c >= 0) {
|
||||
+4
-12
@@ -1,12 +1,8 @@
|
||||
From 741a311f8a905ca53c5a60863a05b8ce074ad1bb Mon Sep 17 00:00:00 2001
|
||||
From c612bed9a2a8b36a53e00405ef6d031f1a649a07 Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Thu, 16 Jan 2025 12:35:12 +0100
|
||||
Subject: [PATCH 26/29] net: dsa: mv88e6xxx: collapse disabled state into
|
||||
Subject: [PATCH 25/30] net: dsa: mv88e6xxx: collapse disabled state into
|
||||
blocking
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
|
||||
This patch changes the behavior of switchcore ports wrt. the port state.
|
||||
Instead of disabling the port, the driver now treats the disabled state
|
||||
@@ -21,16 +17,15 @@ each member port, preventing LACPDUs from passing through to qualify the
|
||||
link and become active.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/port.c | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c
|
||||
index e1fee09eae2f..e28fdd21de38 100644
|
||||
index 84900814c456..91e58297594c 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/port.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/port.c
|
||||
@@ -793,8 +793,6 @@ int mv88e6xxx_port_set_state(struct mv88e6xxx_chip *chip, int port, u8 state)
|
||||
@@ -791,8 +791,6 @@ int mv88e6xxx_port_set_state(struct mv88e6xxx_chip *chip, int port, u8 state)
|
||||
|
||||
switch (state) {
|
||||
case BR_STATE_DISABLED:
|
||||
@@ -39,6 +34,3 @@ index e1fee09eae2f..e28fdd21de38 100644
|
||||
case BR_STATE_BLOCKING:
|
||||
case BR_STATE_LISTENING:
|
||||
state = MV88E6XXX_PORT_CTL0_STATE_BLOCKING;
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+8
-17
@@ -1,12 +1,8 @@
|
||||
From 3b1fd215706810d155e37e29a4ff9d8c8125d853 Mon Sep 17 00:00:00 2001
|
||||
From 5bbc755b029360fb3d64a1f02771ebc3524c920a Mon Sep 17 00:00:00 2001
|
||||
From: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Wed, 12 Feb 2025 22:03:14 +0100
|
||||
Subject: [PATCH 27/29] net: dsa: mv88e6xxx: Only activate LAG offloading when
|
||||
Subject: [PATCH 26/30] net: dsa: mv88e6xxx: Only activate LAG offloading when
|
||||
bridged
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
|
||||
The current port isolation scheme for mv88e6xxx is detailed here:
|
||||
https://lore.kernel.org/netdev/20220203101657.990241-1-tobias@waldekranz.com/
|
||||
@@ -49,17 +45,15 @@ existing port isolation to work as intended.
|
||||
Before joining a bridge, the offload does not offer any performance
|
||||
benefit anyway. All ingressing packet will always have to go to the
|
||||
CPU; egress traffic always relies on software hashing.
|
||||
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 42 +++++++++++++++-----------------
|
||||
1 file changed, 20 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
index 141a3105be9f..2014a0958380 100644
|
||||
index 70eefc1b2140..e0db6333e418 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
@@ -3058,6 +3058,7 @@ static int mv88e6xxx_port_bridge_join(struct dsa_switch *ds, int port,
|
||||
@@ -3106,6 +3106,7 @@ static int mv88e6xxx_port_bridge_join(struct dsa_switch *ds, int port,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct mv88e6xxx_chip *chip = ds->priv;
|
||||
@@ -67,7 +61,7 @@ index 141a3105be9f..2014a0958380 100644
|
||||
int err;
|
||||
|
||||
mv88e6xxx_reg_lock(chip);
|
||||
@@ -3066,6 +3067,13 @@ static int mv88e6xxx_port_bridge_join(struct dsa_switch *ds, int port,
|
||||
@@ -3114,6 +3115,13 @@ static int mv88e6xxx_port_bridge_join(struct dsa_switch *ds, int port,
|
||||
if (err)
|
||||
goto unlock;
|
||||
|
||||
@@ -81,7 +75,7 @@ index 141a3105be9f..2014a0958380 100644
|
||||
err = mv88e6xxx_port_set_map_da(chip, port, true);
|
||||
if (err)
|
||||
goto unlock;
|
||||
@@ -3110,6 +3118,14 @@ static void mv88e6xxx_port_bridge_leave(struct dsa_switch *ds, int port,
|
||||
@@ -3158,6 +3166,14 @@ static void mv88e6xxx_port_bridge_leave(struct dsa_switch *ds, int port,
|
||||
"port %d failed to restore map-DA: %pe\n",
|
||||
port, ERR_PTR(err));
|
||||
|
||||
@@ -96,7 +90,7 @@ index 141a3105be9f..2014a0958380 100644
|
||||
err = mv88e6xxx_port_commit_pvid(chip, port);
|
||||
if (err)
|
||||
dev_err(ds->dev,
|
||||
@@ -7089,30 +7105,13 @@ static int mv88e6xxx_port_lag_join(struct dsa_switch *ds, int port,
|
||||
@@ -7066,30 +7082,13 @@ static int mv88e6xxx_port_lag_join(struct dsa_switch *ds, int port,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct mv88e6xxx_chip *chip = ds->priv;
|
||||
@@ -128,7 +122,7 @@ index 141a3105be9f..2014a0958380 100644
|
||||
mv88e6xxx_reg_unlock(chip);
|
||||
return err;
|
||||
}
|
||||
@@ -7121,13 +7120,12 @@ static int mv88e6xxx_port_lag_leave(struct dsa_switch *ds, int port,
|
||||
@@ -7098,13 +7097,12 @@ static int mv88e6xxx_port_lag_leave(struct dsa_switch *ds, int port,
|
||||
struct dsa_lag lag)
|
||||
{
|
||||
struct mv88e6xxx_chip *chip = ds->priv;
|
||||
@@ -145,6 +139,3 @@ index 141a3105be9f..2014a0958380 100644
|
||||
}
|
||||
|
||||
static int mv88e6xxx_crosschip_lag_change(struct dsa_switch *ds, int sw_index,
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+4
-12
@@ -1,12 +1,8 @@
|
||||
From 28d1887a75ae6b46e96111a6cddc5efbd7d0e3b7 Mon Sep 17 00:00:00 2001
|
||||
From d39e7f591969c4005fad2c595e025053c5eae3c3 Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Sun, 11 Aug 2024 11:27:35 +0200
|
||||
Subject: [PATCH 11/29] net: usb: r8152: add r8153b support for link/activity
|
||||
Subject: [PATCH 27/30] net: usb: r8152: add r8153b support for link/activity
|
||||
LEDs
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
|
||||
This patch adds support for the link/activity LEDs on the NanoPi R2S
|
||||
and OrangePi R1 Plus.
|
||||
@@ -17,13 +13,12 @@ https://github.com/friendlyarm/kernel-rockchip/
|
||||
Specifically commit be0b1939b271c307ab1fef5fb1478beaafc6de17
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
drivers/net/usb/r8152.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
|
||||
index a22d4bb2cf3b..ae89323ade06 100644
|
||||
index 3fcd2b736c5e..531712943118 100644
|
||||
--- a/drivers/net/usb/r8152.c
|
||||
+++ b/drivers/net/usb/r8152.c
|
||||
@@ -41,6 +41,11 @@
|
||||
@@ -38,7 +33,7 @@ index a22d4bb2cf3b..ae89323ade06 100644
|
||||
#define R8152_PHY_ID 32
|
||||
|
||||
#define PLA_IDR 0xc000
|
||||
@@ -7277,6 +7282,9 @@ static void r8153b_init(struct r8152 *tp)
|
||||
@@ -7307,6 +7312,9 @@ static void r8153b_init(struct r8152 *tp)
|
||||
ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN);
|
||||
ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data);
|
||||
|
||||
@@ -48,6 +43,3 @@ index a22d4bb2cf3b..ae89323ade06 100644
|
||||
rtl_tally_reset(tp);
|
||||
|
||||
tp->coalesce = 15000; /* 15 us */
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+5
-13
@@ -1,12 +1,8 @@
|
||||
From 71b2cad84f563649512a1753ffd48e57c1cb0dab Mon Sep 17 00:00:00 2001
|
||||
From c8a22befda5de27a07a6456ab7e35ba8e5463d22 Mon Sep 17 00:00:00 2001
|
||||
From: Joachim Wiberg <troglobit@gmail.com>
|
||||
Date: Sun, 10 Aug 2025 18:52:54 +0200
|
||||
Subject: [PATCH 12/29] arm64: dts: mediatek: mt7986a: rename BPi R3 ports to
|
||||
Subject: [PATCH 28/30] arm64: dts: mediatek: mt7986a: rename BPi R3 ports to
|
||||
match case
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
|
||||
For ref. see: https://wiki.banana-pi.org/File:Bpi-r3_Metal_case.jpg
|
||||
|
||||
@@ -14,13 +10,12 @@ Also, comment out gpio-keys (reset and wps) since they clash with with
|
||||
the PCIe controller.
|
||||
|
||||
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
.../boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 14 +++++++-------
|
||||
1 file changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
|
||||
index e7654dc9a1c9..4cc6aff07225 100644
|
||||
index ed79ad1ae871..1c7c666e3173 100644
|
||||
--- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
|
||||
+++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
|
||||
@@ -46,7 +46,7 @@ fan: pwm-fan {
|
||||
@@ -39,9 +34,9 @@ index e7654dc9a1c9..4cc6aff07225 100644
|
||||
-
|
||||
+*/
|
||||
/* i2c of the left SFP cage (wan) */
|
||||
i2c_sfp1: i2c-0 {
|
||||
i2c_sfp1: i2c-gpio-0 {
|
||||
compatible = "i2c-gpio";
|
||||
@@ -415,27 +415,27 @@ port@0 {
|
||||
@@ -418,27 +418,27 @@ port@0 {
|
||||
|
||||
port@1 {
|
||||
reg = <1>;
|
||||
@@ -74,6 +69,3 @@ index e7654dc9a1c9..4cc6aff07225 100644
|
||||
phy-mode = "2500base-x";
|
||||
sfp = <&sfp2>;
|
||||
managed = "in-band-status";
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+7
-15
@@ -1,12 +1,8 @@
|
||||
From 673f624878aae8e2718995baf693ac352ea91a70 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= <lazzer@gmail.com>
|
||||
From 98fe2a91d9b613119ba1850c7134af4f5ad45f68 Mon Sep 17 00:00:00 2001
|
||||
From: Mattias Walström <lazzer@gmail.com>
|
||||
Date: Wed, 20 Aug 2025 21:38:24 +0200
|
||||
Subject: [PATCH 13/29] drm/panel-simple: Add a timing for the Raspberry Pi 7"
|
||||
Subject: [PATCH 29/30] drm/panel-simple: Add a timing for the Raspberry Pi 7"
|
||||
panel
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
|
||||
The Raspberry Pi 7" 800x480 panel uses a Toshiba TC358762 DSI
|
||||
to DPI bridge chip, so there is a requirement for the timings
|
||||
@@ -45,16 +41,15 @@ on Pi4.
|
||||
parent PLL).
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
drivers/gpu/drm/panel/panel-simple.c | 31 +++++++++++++++++++++++++++-
|
||||
1 file changed, 30 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
|
||||
index 0019de93be1b..3cddde5733ca 100644
|
||||
index 82db3daf4f81..3699cef24ea6 100644
|
||||
--- a/drivers/gpu/drm/panel/panel-simple.c
|
||||
+++ b/drivers/gpu/drm/panel/panel-simple.c
|
||||
@@ -400,7 +400,8 @@ static int panel_simple_get_modes(struct drm_panel *panel,
|
||||
@@ -391,7 +391,8 @@ static int panel_simple_get_modes(struct drm_panel *panel,
|
||||
* TODO: Remove once all drm drivers call
|
||||
* drm_connector_set_orientation_from_panel()
|
||||
*/
|
||||
@@ -64,7 +59,7 @@ index 0019de93be1b..3cddde5733ca 100644
|
||||
|
||||
return num;
|
||||
}
|
||||
@@ -4074,6 +4075,31 @@ static const struct panel_desc qishenglong_gopher2b_lcd = {
|
||||
@@ -3829,6 +3830,31 @@ static const struct panel_desc qishenglong_gopher2b_lcd = {
|
||||
.connector_type = DRM_MODE_CONNECTOR_DPI,
|
||||
};
|
||||
|
||||
@@ -96,7 +91,7 @@ index 0019de93be1b..3cddde5733ca 100644
|
||||
static const struct display_timing rocktech_rk043fn48h_timing = {
|
||||
.pixelclock = { 6000000, 9000000, 12000000 },
|
||||
.hactive = { 480, 480, 480 },
|
||||
@@ -5344,6 +5370,9 @@ static const struct of_device_id platform_of_match[] = {
|
||||
@@ -4977,6 +5003,9 @@ static const struct of_device_id platform_of_match[] = {
|
||||
.compatible = "qishenglong,gopher2b-lcd",
|
||||
.data = &qishenglong_gopher2b_lcd,
|
||||
}, {
|
||||
@@ -106,6 +101,3 @@ index 0019de93be1b..3cddde5733ca 100644
|
||||
.compatible = "rocktech,rk043fn48h",
|
||||
.data = &rocktech_rk043fn48h,
|
||||
}, {
|
||||
--
|
||||
2.43.0
|
||||
|
||||
+15
-24
@@ -1,22 +1,16 @@
|
||||
From 8c468f604841179197c32a467e81050e98e96d03 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= <lazzer@gmail.com>
|
||||
From ade7ba171a5d35923261d4111fe69b2b42421429 Mon Sep 17 00:00:00 2001
|
||||
From: Mattias Walström <lazzer@gmail.com>
|
||||
Date: Thu, 21 Aug 2025 11:20:23 +0200
|
||||
Subject: [PATCH 14/29] input:touchscreen:edt-ft5x06: Add polled mode
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
Subject: [PATCH 30/30] input:touchscreen:edt-ft5x06: Add polled mode
|
||||
|
||||
Not all hardware has interrupts therefore we need
|
||||
to poll the touchscreen.
|
||||
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
drivers/input/touchscreen/edt-ft5x06.c | 74 ++++++++++++++++++++------
|
||||
1 file changed, 58 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
|
||||
index bf498bd4dea9..30308d840935 100644
|
||||
index 85c6d8ce003f..e61519915137 100644
|
||||
--- a/drivers/input/touchscreen/edt-ft5x06.c
|
||||
+++ b/drivers/input/touchscreen/edt-ft5x06.c
|
||||
@@ -77,6 +77,9 @@
|
||||
@@ -29,7 +23,7 @@ index bf498bd4dea9..30308d840935 100644
|
||||
#define M06_REG_CMD(factory) ((factory) ? 0xf3 : 0xfc)
|
||||
#define M06_REG_ADDR(factory, addr) ((factory) ? (addr) & 0x7f : (addr) & 0x3f)
|
||||
|
||||
@@ -138,6 +141,7 @@ struct edt_ft5x06_ts_data {
|
||||
@@ -139,6 +142,7 @@ struct edt_ft5x06_ts_data {
|
||||
u8 tdata_cmd;
|
||||
int tdata_len;
|
||||
int tdata_offset;
|
||||
@@ -37,7 +31,7 @@ index bf498bd4dea9..30308d840935 100644
|
||||
|
||||
char name[EDT_NAME_LEN];
|
||||
char fw_version[EDT_NAME_LEN];
|
||||
@@ -146,6 +150,9 @@ struct edt_ft5x06_ts_data {
|
||||
@@ -147,6 +151,9 @@ struct edt_ft5x06_ts_data {
|
||||
enum edt_ver version;
|
||||
unsigned int crc_errors;
|
||||
unsigned int header_errors;
|
||||
@@ -47,13 +41,13 @@ index bf498bd4dea9..30308d840935 100644
|
||||
};
|
||||
|
||||
struct edt_i2c_chip_data {
|
||||
@@ -581,6 +588,22 @@ static struct attribute *edt_ft5x06_attrs[] = {
|
||||
@@ -582,6 +589,22 @@ static struct attribute *edt_ft5x06_attrs[] = {
|
||||
};
|
||||
ATTRIBUTE_GROUPS(edt_ft5x06);
|
||||
|
||||
+static void edt_ft5x06_ts_irq_poll_timer(struct timer_list *t)
|
||||
+{
|
||||
+ struct edt_ft5x06_ts_data *tsdata = timer_container_of(tsdata, t, timer);
|
||||
+ struct edt_ft5x06_ts_data *tsdata = from_timer(tsdata, t, timer);
|
||||
+
|
||||
+ schedule_work(&tsdata->work_i2c_poll);
|
||||
+ mod_timer(&tsdata->timer, jiffies + msecs_to_jiffies(POLL_INTERVAL_MS));
|
||||
@@ -70,7 +64,7 @@ index bf498bd4dea9..30308d840935 100644
|
||||
static void edt_ft5x06_restore_reg_parameters(struct edt_ft5x06_ts_data *tsdata)
|
||||
{
|
||||
struct edt_reg_addr *reg_addr = &tsdata->reg_addr;
|
||||
@@ -613,7 +636,9 @@ static int edt_ft5x06_factory_mode(struct edt_ft5x06_ts_data *tsdata)
|
||||
@@ -614,7 +637,9 @@ static int edt_ft5x06_factory_mode(struct edt_ft5x06_ts_data *tsdata)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -81,7 +75,7 @@ index bf498bd4dea9..30308d840935 100644
|
||||
|
||||
if (!tsdata->raw_buffer) {
|
||||
tsdata->raw_bufsize = tsdata->num_x * tsdata->num_y *
|
||||
@@ -656,7 +681,8 @@ static int edt_ft5x06_factory_mode(struct edt_ft5x06_ts_data *tsdata)
|
||||
@@ -657,7 +682,8 @@ static int edt_ft5x06_factory_mode(struct edt_ft5x06_ts_data *tsdata)
|
||||
kfree(tsdata->raw_buffer);
|
||||
tsdata->raw_buffer = NULL;
|
||||
tsdata->factory_mode = false;
|
||||
@@ -91,7 +85,7 @@ index bf498bd4dea9..30308d840935 100644
|
||||
|
||||
return error;
|
||||
}
|
||||
@@ -697,7 +723,8 @@ static int edt_ft5x06_work_mode(struct edt_ft5x06_ts_data *tsdata)
|
||||
@@ -698,7 +724,8 @@ static int edt_ft5x06_work_mode(struct edt_ft5x06_ts_data *tsdata)
|
||||
tsdata->raw_buffer = NULL;
|
||||
|
||||
edt_ft5x06_restore_reg_parameters(tsdata);
|
||||
@@ -101,7 +95,7 @@ index bf498bd4dea9..30308d840935 100644
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1327,18 +1354,27 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client)
|
||||
@@ -1331,18 +1358,27 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client)
|
||||
dev_err(&client->dev, "Unable to init MT slots.\n");
|
||||
return error;
|
||||
}
|
||||
@@ -141,19 +135,19 @@ index bf498bd4dea9..30308d840935 100644
|
||||
}
|
||||
|
||||
error = input_register_device(input);
|
||||
@@ -1360,6 +1396,11 @@ static void edt_ft5x06_ts_remove(struct i2c_client *client)
|
||||
@@ -1364,6 +1400,11 @@ static void edt_ft5x06_ts_remove(struct i2c_client *client)
|
||||
{
|
||||
struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client);
|
||||
|
||||
+ if (!client->irq) {
|
||||
+ timer_delete(&tsdata->timer);
|
||||
+ del_timer(&tsdata->timer);
|
||||
+ cancel_work_sync(&tsdata->work_i2c_poll);
|
||||
+ }
|
||||
+
|
||||
edt_ft5x06_ts_teardown_debugfs(tsdata);
|
||||
}
|
||||
|
||||
@@ -1391,7 +1432,8 @@ static int edt_ft5x06_ts_suspend(struct device *dev)
|
||||
@@ -1395,7 +1436,8 @@ static int edt_ft5x06_ts_suspend(struct device *dev)
|
||||
* settings. Disable the irq to avoid adjusting each host till the
|
||||
* device is back in a full functional state.
|
||||
*/
|
||||
@@ -163,6 +157,3 @@ index bf498bd4dea9..30308d840935 100644
|
||||
|
||||
gpiod_set_value_cansleep(reset_gpio, 1);
|
||||
usleep_range(1000, 2000);
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -1,550 +0,0 @@
|
||||
From 12212af51b5e14c53c473426eba96d87c0bfb9b6 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= <lazzer@gmail.com>
|
||||
Date: Wed, 14 Jan 2026 18:22:41 +0100
|
||||
Subject: [PATCH 28/29] net: dsa: mv88e6xxx: Add LED support for 6393X
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
|
||||
Original commit:
|
||||
commit 462277b926140ee2d231317e92afb6cabf640268
|
||||
Author: Tobias Waldekranz <tobias@waldekranz.com>
|
||||
Date: Thu Nov 16 21:59:35 2023 +0100
|
||||
|
||||
net: dsa: mv88e6xxx: Add LED support for 6393X
|
||||
|
||||
Trigger support:
|
||||
- "none"
|
||||
- "timer"
|
||||
- "netdev"
|
||||
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
drivers/net/dsa/mv88e6xxx/chip.c | 1 +
|
||||
drivers/net/dsa/mv88e6xxx/leds.c | 403 +++++++++++++++++++++++++++++++
|
||||
drivers/net/dsa/mv88e6xxx/port.c | 33 +++
|
||||
drivers/net/dsa/mv88e6xxx/port.h | 13 +
|
||||
4 files changed, 450 insertions(+)
|
||||
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
index 2014a0958380..2e9737c5eb7d 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
|
||||
@@ -5681,6 +5681,7 @@ static const struct mv88e6xxx_ops mv88e6393x_ops = {
|
||||
.port_disable_pri_override = mv88e6xxx_port_disable_pri_override,
|
||||
.port_get_cmode = mv88e6352_port_get_cmode,
|
||||
.port_set_cmode = mv88e6393x_port_set_cmode,
|
||||
+ .port_setup_leds = mv88e6393x_port_setup_leds,
|
||||
.port_setup_message_port = mv88e6xxx_setup_message_port,
|
||||
.port_set_upstream_port = mv88e6393x_port_set_upstream_port,
|
||||
.stats_snapshot = mv88e6390_g1_stats_snapshot,
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/leds.c b/drivers/net/dsa/mv88e6xxx/leds.c
|
||||
index ab3bc645da56..aa539df21f8d 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/leds.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/leds.c
|
||||
@@ -102,6 +102,58 @@ struct mv88e6xxx_led_hwconfig {
|
||||
u16 selector;
|
||||
};
|
||||
|
||||
+/* 6393X LED mode flags */
|
||||
+#define MV88E6393X_FLAG_ACT (BIT(TRIGGER_NETDEV_RX) | BIT(TRIGGER_NETDEV_TX))
|
||||
+#define MV88E6393X_FLAG_LINK BIT(TRIGGER_NETDEV_LINK)
|
||||
+#define MV88E6393X_FLAG_LINK_10 BIT(TRIGGER_NETDEV_LINK_10)
|
||||
+#define MV88E6393X_FLAG_LINK_100 BIT(TRIGGER_NETDEV_LINK_100)
|
||||
+#define MV88E6393X_FLAG_LINK_1G BIT(TRIGGER_NETDEV_LINK_1000)
|
||||
+#define MV88E6393X_FLAG_FULL BIT(TRIGGER_NETDEV_FULL_DUPLEX)
|
||||
+
|
||||
+/* 6393X LED modes */
|
||||
+#define MV88E6393X_LED_MODE_BLINK 0xd
|
||||
+#define MV88E6393X_LED_MODE_OFF 0xe
|
||||
+#define MV88E6393X_LED_MODE_ON 0xf
|
||||
+#define MV88E6393X_LED_MODES 0x10
|
||||
+
|
||||
+/* 6393X LED mode to flags mapping for ports 1-8 */
|
||||
+static const unsigned long mv88e6393x_led_map_p1_p8[2][MV88E6393X_LED_MODES] = {
|
||||
+ [0] = {
|
||||
+ [0x1] = MV88E6393X_FLAG_ACT | MV88E6393X_FLAG_LINK_100 | MV88E6393X_FLAG_LINK_1G,
|
||||
+ [0x2] = MV88E6393X_FLAG_ACT | MV88E6393X_FLAG_LINK_1G,
|
||||
+ [0x3] = MV88E6393X_FLAG_ACT | MV88E6393X_FLAG_LINK,
|
||||
+ [0x6] = MV88E6393X_FLAG_FULL,
|
||||
+ [0x7] = MV88E6393X_FLAG_ACT | MV88E6393X_FLAG_LINK_10 | MV88E6393X_FLAG_LINK_1G,
|
||||
+ [0x8] = MV88E6393X_FLAG_LINK,
|
||||
+ [0x9] = MV88E6393X_FLAG_LINK_10,
|
||||
+ [0xa] = MV88E6393X_FLAG_ACT | MV88E6393X_FLAG_LINK_10,
|
||||
+ [0xb] = MV88E6393X_FLAG_LINK_100 | MV88E6393X_FLAG_LINK_1G,
|
||||
+ },
|
||||
+ [1] = {
|
||||
+ [0x1] = MV88E6393X_FLAG_ACT,
|
||||
+ [0x2] = MV88E6393X_FLAG_ACT | MV88E6393X_FLAG_LINK_10 | MV88E6393X_FLAG_LINK_100,
|
||||
+ [0x3] = MV88E6393X_FLAG_LINK_1G,
|
||||
+ [0x5] = MV88E6393X_FLAG_ACT | MV88E6393X_FLAG_LINK,
|
||||
+ [0x6] = MV88E6393X_FLAG_ACT | MV88E6393X_FLAG_LINK_10 | MV88E6393X_FLAG_LINK_1G,
|
||||
+ [0x7] = MV88E6393X_FLAG_LINK_10 | MV88E6393X_FLAG_LINK_1G,
|
||||
+ [0x9] = MV88E6393X_FLAG_LINK_100,
|
||||
+ [0xa] = MV88E6393X_FLAG_ACT | MV88E6393X_FLAG_LINK_100,
|
||||
+ [0xb] = MV88E6393X_FLAG_LINK_10 | MV88E6393X_FLAG_LINK_100,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+/* 6393X LED mode to flags mapping for ports 9-10 */
|
||||
+static const unsigned long mv88e6393x_led_map_p9_p10[2][MV88E6393X_LED_MODES] = {
|
||||
+ [0] = {
|
||||
+ [0x1] = MV88E6393X_FLAG_ACT | MV88E6393X_FLAG_LINK,
|
||||
+ },
|
||||
+ [1] = {
|
||||
+ [0x6] = MV88E6393X_FLAG_FULL,
|
||||
+ [0x7] = MV88E6393X_FLAG_ACT | MV88E6393X_FLAG_LINK,
|
||||
+ [0x8] = MV88E6393X_FLAG_LINK,
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
/* The following is a lookup table to check what rules we can support on a
|
||||
* certain LED given restrictions such as that some rules only work with fiber
|
||||
* (SFP) connections and some blink on activity by default.
|
||||
@@ -846,3 +898,354 @@ int mv88e6xxx_port_setup_leds(struct mv88e6xxx_chip *chip, int port)
|
||||
fwnode_handle_put(leds);
|
||||
return ret;
|
||||
}
|
||||
+
|
||||
+/* 6393X LED support */
|
||||
+
|
||||
+static const unsigned long *mv88e6393x_led_map(int port, int led)
|
||||
+{
|
||||
+ if (port >= 1 && port <= 8)
|
||||
+ return mv88e6393x_led_map_p1_p8[led];
|
||||
+ if (port >= 9 && port <= 10)
|
||||
+ return mv88e6393x_led_map_p9_p10[led];
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+static int mv88e6393x_led_flags_to_mode(int port, int led, unsigned long flags)
|
||||
+{
|
||||
+ const unsigned long *map = mv88e6393x_led_map(port, led);
|
||||
+ int i;
|
||||
+
|
||||
+ if (!map)
|
||||
+ return -ENODEV;
|
||||
+
|
||||
+ if (!flags)
|
||||
+ return MV88E6393X_LED_MODE_OFF;
|
||||
+
|
||||
+ for (i = 0; i < MV88E6393X_LED_MODES; i++) {
|
||||
+ if (map[i] == flags)
|
||||
+ return i;
|
||||
+ }
|
||||
+
|
||||
+ return -EOPNOTSUPP;
|
||||
+}
|
||||
+
|
||||
+static int mv88e6393x_led_mode_to_flags(int port, int led, u8 mode,
|
||||
+ unsigned long *flags)
|
||||
+{
|
||||
+ const unsigned long *map = mv88e6393x_led_map(port, led);
|
||||
+
|
||||
+ if (!map)
|
||||
+ return -ENODEV;
|
||||
+
|
||||
+ if (mode == MV88E6393X_LED_MODE_OFF) {
|
||||
+ *flags = 0;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ if (mode < MV88E6393X_LED_MODES && map[mode]) {
|
||||
+ *flags = map[mode];
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ return -EINVAL;
|
||||
+}
|
||||
+
|
||||
+static int mv88e6393x_led_set_mode(struct mv88e6xxx_port *p, int led, int mode)
|
||||
+{
|
||||
+ u16 ctrl;
|
||||
+ int err;
|
||||
+
|
||||
+ if (mode < 0)
|
||||
+ return mode;
|
||||
+
|
||||
+ err = mv88e6393x_port_led_read(p->chip, p->port, 0, &ctrl);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ if (led == 0) {
|
||||
+ ctrl &= ~0x0f;
|
||||
+ ctrl |= mode;
|
||||
+ } else {
|
||||
+ ctrl &= ~0xf0;
|
||||
+ ctrl |= mode << 4;
|
||||
+ }
|
||||
+
|
||||
+ return mv88e6393x_port_led_write(p->chip, p->port, 0, ctrl);
|
||||
+}
|
||||
+
|
||||
+static int mv88e6393x_led_get_mode(struct mv88e6xxx_port *p, int led)
|
||||
+{
|
||||
+ u16 ctrl;
|
||||
+ int err;
|
||||
+
|
||||
+ err = mv88e6393x_port_led_read(p->chip, p->port, 0, &ctrl);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ if (led == 0)
|
||||
+ return ctrl & 0xf;
|
||||
+ else
|
||||
+ return (ctrl >> 4) & 0xf;
|
||||
+}
|
||||
+
|
||||
+static int mv88e6393x_led_brightness_set(struct mv88e6xxx_port *p, int led,
|
||||
+ int brightness)
|
||||
+{
|
||||
+ if (brightness == LED_OFF)
|
||||
+ return mv88e6393x_led_set_mode(p, led, MV88E6393X_LED_MODE_OFF);
|
||||
+
|
||||
+ return mv88e6393x_led_set_mode(p, led, MV88E6393X_LED_MODE_ON);
|
||||
+}
|
||||
+
|
||||
+static int mv88e6393x_led0_brightness_set_blocking(struct led_classdev *ldev,
|
||||
+ enum led_brightness brightness)
|
||||
+{
|
||||
+ struct mv88e6xxx_port *p = container_of(ldev, struct mv88e6xxx_port, led0);
|
||||
+ int err;
|
||||
+
|
||||
+ mv88e6xxx_reg_lock(p->chip);
|
||||
+ err = mv88e6393x_led_brightness_set(p, 0, brightness);
|
||||
+ mv88e6xxx_reg_unlock(p->chip);
|
||||
+
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+static int mv88e6393x_led1_brightness_set_blocking(struct led_classdev *ldev,
|
||||
+ enum led_brightness brightness)
|
||||
+{
|
||||
+ struct mv88e6xxx_port *p = container_of(ldev, struct mv88e6xxx_port, led1);
|
||||
+ int err;
|
||||
+
|
||||
+ mv88e6xxx_reg_lock(p->chip);
|
||||
+ err = mv88e6393x_led_brightness_set(p, 1, brightness);
|
||||
+ mv88e6xxx_reg_unlock(p->chip);
|
||||
+
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+static int mv88e6393x_led_blink_set(struct mv88e6xxx_port *p, int led,
|
||||
+ unsigned long *delay_on,
|
||||
+ unsigned long *delay_off)
|
||||
+{
|
||||
+ int err;
|
||||
+
|
||||
+ /* Defer anything other than 50% duty cycles to software */
|
||||
+ if (*delay_on != *delay_off)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ /* Reject values outside ~20% of our default rate (84ms) */
|
||||
+ if (*delay_on && ((*delay_on < 30) || (*delay_on > 50)))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ mv88e6xxx_reg_lock(p->chip);
|
||||
+ err = mv88e6393x_led_set_mode(p, led, MV88E6393X_LED_MODE_BLINK);
|
||||
+ mv88e6xxx_reg_unlock(p->chip);
|
||||
+ if (!err)
|
||||
+ *delay_on = *delay_off = 42;
|
||||
+
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+static int mv88e6393x_led0_blink_set(struct led_classdev *ldev,
|
||||
+ unsigned long *delay_on,
|
||||
+ unsigned long *delay_off)
|
||||
+{
|
||||
+ struct mv88e6xxx_port *p = container_of(ldev, struct mv88e6xxx_port, led0);
|
||||
+
|
||||
+ return mv88e6393x_led_blink_set(p, 0, delay_on, delay_off);
|
||||
+}
|
||||
+
|
||||
+static int mv88e6393x_led1_blink_set(struct led_classdev *ldev,
|
||||
+ unsigned long *delay_on,
|
||||
+ unsigned long *delay_off)
|
||||
+{
|
||||
+ struct mv88e6xxx_port *p = container_of(ldev, struct mv88e6xxx_port, led1);
|
||||
+
|
||||
+ return mv88e6393x_led_blink_set(p, 1, delay_on, delay_off);
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+mv88e6393x_led0_hw_control_is_supported(struct led_classdev *ldev, unsigned long rules)
|
||||
+{
|
||||
+ struct mv88e6xxx_port *p = container_of(ldev, struct mv88e6xxx_port, led0);
|
||||
+ int mode = mv88e6393x_led_flags_to_mode(p->port, 0, rules);
|
||||
+
|
||||
+ return (mode < 0) ? mode : 0;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+mv88e6393x_led1_hw_control_is_supported(struct led_classdev *ldev, unsigned long rules)
|
||||
+{
|
||||
+ struct mv88e6xxx_port *p = container_of(ldev, struct mv88e6xxx_port, led1);
|
||||
+ int mode = mv88e6393x_led_flags_to_mode(p->port, 1, rules);
|
||||
+
|
||||
+ return (mode < 0) ? mode : 0;
|
||||
+}
|
||||
+
|
||||
+static int mv88e6393x_led_hw_control_set(struct mv88e6xxx_port *p,
|
||||
+ int led, unsigned long rules)
|
||||
+{
|
||||
+ int mode = mv88e6393x_led_flags_to_mode(p->port, led, rules);
|
||||
+
|
||||
+ if (mode < 0)
|
||||
+ return mode;
|
||||
+
|
||||
+ return mv88e6393x_led_set_mode(p, led, mode);
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+mv88e6393x_led0_hw_control_set(struct led_classdev *ldev, unsigned long rules)
|
||||
+{
|
||||
+ struct mv88e6xxx_port *p = container_of(ldev, struct mv88e6xxx_port, led0);
|
||||
+ int err;
|
||||
+
|
||||
+ mv88e6xxx_reg_lock(p->chip);
|
||||
+ err = mv88e6393x_led_hw_control_set(p, 0, rules);
|
||||
+ mv88e6xxx_reg_unlock(p->chip);
|
||||
+
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+mv88e6393x_led1_hw_control_set(struct led_classdev *ldev, unsigned long rules)
|
||||
+{
|
||||
+ struct mv88e6xxx_port *p = container_of(ldev, struct mv88e6xxx_port, led1);
|
||||
+ int err;
|
||||
+
|
||||
+ mv88e6xxx_reg_lock(p->chip);
|
||||
+ err = mv88e6393x_led_hw_control_set(p, 1, rules);
|
||||
+ mv88e6xxx_reg_unlock(p->chip);
|
||||
+
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+mv88e6393x_led_hw_control_get(struct mv88e6xxx_port *p, int led, unsigned long *rules)
|
||||
+{
|
||||
+ int mode;
|
||||
+
|
||||
+ mv88e6xxx_reg_lock(p->chip);
|
||||
+ mode = mv88e6393x_led_get_mode(p, led);
|
||||
+ mv88e6xxx_reg_unlock(p->chip);
|
||||
+ if (mode < 0)
|
||||
+ return mode;
|
||||
+
|
||||
+ return mv88e6393x_led_mode_to_flags(p->port, led, mode, rules);
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+mv88e6393x_led0_hw_control_get(struct led_classdev *ldev, unsigned long *rules)
|
||||
+{
|
||||
+ struct mv88e6xxx_port *p = container_of(ldev, struct mv88e6xxx_port, led0);
|
||||
+
|
||||
+ return mv88e6393x_led_hw_control_get(p, 0, rules);
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+mv88e6393x_led1_hw_control_get(struct led_classdev *ldev, unsigned long *rules)
|
||||
+{
|
||||
+ struct mv88e6xxx_port *p = container_of(ldev, struct mv88e6xxx_port, led1);
|
||||
+
|
||||
+ return mv88e6393x_led_hw_control_get(p, 1, rules);
|
||||
+}
|
||||
+
|
||||
+int mv88e6393x_port_setup_leds(struct mv88e6xxx_chip *chip, int port)
|
||||
+{
|
||||
+ struct fwnode_handle *led = NULL, *leds = NULL;
|
||||
+ struct led_init_data init_data = { };
|
||||
+ enum led_default_state state;
|
||||
+ struct mv88e6xxx_port *p;
|
||||
+ struct led_classdev *l;
|
||||
+ struct device *dev;
|
||||
+ u32 led_num;
|
||||
+ int ret;
|
||||
+
|
||||
+ /* 6393X has LEDs on ports 1-10 */
|
||||
+ if (port < 1 || port > 10)
|
||||
+ return -EOPNOTSUPP;
|
||||
+
|
||||
+ p = &chip->ports[port];
|
||||
+ if (!p->fwnode)
|
||||
+ return 0;
|
||||
+
|
||||
+ dev = chip->dev;
|
||||
+
|
||||
+ leds = fwnode_get_named_child_node(p->fwnode, "leds");
|
||||
+ if (!leds) {
|
||||
+ dev_dbg(dev, "No Leds node specified in device tree for port %d!\n",
|
||||
+ port);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ fwnode_for_each_child_node(leds, led) {
|
||||
+ if (fwnode_property_read_u32(led, "reg", &led_num))
|
||||
+ continue;
|
||||
+ if (led_num > 1) {
|
||||
+ dev_err(dev, "invalid LED specified port %d\n", port);
|
||||
+ ret = -EINVAL;
|
||||
+ goto err_put_led;
|
||||
+ }
|
||||
+
|
||||
+ if (led_num == 0)
|
||||
+ l = &p->led0;
|
||||
+ else
|
||||
+ l = &p->led1;
|
||||
+
|
||||
+ state = led_init_default_state_get(led);
|
||||
+ switch (state) {
|
||||
+ case LEDS_DEFSTATE_ON:
|
||||
+ l->brightness = 1;
|
||||
+ mv88e6393x_led_brightness_set(p, led_num, 1);
|
||||
+ break;
|
||||
+ case LEDS_DEFSTATE_KEEP:
|
||||
+ break;
|
||||
+ default:
|
||||
+ l->brightness = 0;
|
||||
+ mv88e6393x_led_brightness_set(p, led_num, 0);
|
||||
+ }
|
||||
+
|
||||
+ l->max_brightness = 1;
|
||||
+ if (led_num == 0) {
|
||||
+ l->brightness_set_blocking = mv88e6393x_led0_brightness_set_blocking;
|
||||
+ l->blink_set = mv88e6393x_led0_blink_set;
|
||||
+ l->hw_control_is_supported = mv88e6393x_led0_hw_control_is_supported;
|
||||
+ l->hw_control_set = mv88e6393x_led0_hw_control_set;
|
||||
+ l->hw_control_get = mv88e6393x_led0_hw_control_get;
|
||||
+ l->hw_control_get_device = mv88e6xxx_led0_hw_control_get_device;
|
||||
+ } else {
|
||||
+ l->brightness_set_blocking = mv88e6393x_led1_brightness_set_blocking;
|
||||
+ l->blink_set = mv88e6393x_led1_blink_set;
|
||||
+ l->hw_control_is_supported = mv88e6393x_led1_hw_control_is_supported;
|
||||
+ l->hw_control_set = mv88e6393x_led1_hw_control_set;
|
||||
+ l->hw_control_get = mv88e6393x_led1_hw_control_get;
|
||||
+ l->hw_control_get_device = mv88e6xxx_led1_hw_control_get_device;
|
||||
+ }
|
||||
+ l->hw_control_trigger = "netdev";
|
||||
+
|
||||
+ init_data.default_label = ":port";
|
||||
+ init_data.fwnode = led;
|
||||
+ init_data.devname_mandatory = true;
|
||||
+ init_data.devicename = kasprintf(GFP_KERNEL, "%s:0%d:0%d", chip->info->name,
|
||||
+ port, led_num);
|
||||
+ if (!init_data.devicename) {
|
||||
+ ret = -ENOMEM;
|
||||
+ goto err_put_led;
|
||||
+ }
|
||||
+
|
||||
+ ret = devm_led_classdev_register_ext(dev, l, &init_data);
|
||||
+ kfree(init_data.devicename);
|
||||
+
|
||||
+ if (ret) {
|
||||
+ dev_err(dev, "Failed to init LED %d for port %d", led_num, port);
|
||||
+ goto err_put_led;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ fwnode_handle_put(leds);
|
||||
+ return 0;
|
||||
+
|
||||
+err_put_led:
|
||||
+ fwnode_handle_put(led);
|
||||
+ fwnode_handle_put(leds);
|
||||
+ return ret;
|
||||
+}
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c
|
||||
index e28fdd21de38..1985b8553611 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/port.c
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/port.c
|
||||
@@ -1604,6 +1604,39 @@ int mv88e6xxx_port_relinquish_ether_type(struct mv88e6xxx_chip *chip, int port)
|
||||
return err;
|
||||
}
|
||||
|
||||
+/* Offset 0x16: LED Control (6393X family) */
|
||||
+
|
||||
+int mv88e6393x_port_led_write(struct mv88e6xxx_chip *chip, int port,
|
||||
+ unsigned int pointer, u16 data)
|
||||
+{
|
||||
+ u16 cmd = BIT(15) | ((pointer & 0x7) << 12) | (data & 0x7ff);
|
||||
+ int err;
|
||||
+
|
||||
+ err = mv88e6xxx_port_write(chip, port, MV88E6393X_PORT_LED_CONTROL, cmd);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ return mv88e6xxx_port_wait_bit(chip, port, MV88E6393X_PORT_LED_CONTROL, 15, 0);
|
||||
+}
|
||||
+
|
||||
+int mv88e6393x_port_led_read(struct mv88e6xxx_chip *chip, int port,
|
||||
+ unsigned int pointer, u16 *data)
|
||||
+{
|
||||
+ u16 cmd = (pointer & 0x7) << 12;
|
||||
+ int err;
|
||||
+
|
||||
+ err = mv88e6xxx_port_write(chip, port, MV88E6393X_PORT_LED_CONTROL, cmd);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ err = mv88e6xxx_port_read(chip, port, MV88E6393X_PORT_LED_CONTROL, &cmd);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ *data = cmd & 0x7ff;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
/* Offset 0x18: Port IEEE Priority Remapping Registers [0-3]
|
||||
* Offset 0x19: Port IEEE Priority Remapping Registers [4-7]
|
||||
*/
|
||||
diff --git a/drivers/net/dsa/mv88e6xxx/port.h b/drivers/net/dsa/mv88e6xxx/port.h
|
||||
index d2ba9ed1f23e..f4a56671fc4c 100644
|
||||
--- a/drivers/net/dsa/mv88e6xxx/port.h
|
||||
+++ b/drivers/net/dsa/mv88e6xxx/port.h
|
||||
@@ -444,6 +444,9 @@
|
||||
/* Control for Special LED (Index 0x7 of LED Control on Port 2) */
|
||||
#define MV88E6XXX_PORT_LED_CONTROL_0x07_P2_PTP_ACT 0 /* bits 6:0 PTP Activity */
|
||||
|
||||
+/* Offset 0x16: LED Control (6393X family) */
|
||||
+#define MV88E6393X_PORT_LED_CONTROL 0x16
|
||||
+
|
||||
/* Offset 0x18: IEEE Priority Mapping Table */
|
||||
#define MV88E6390_PORT_IEEE_PRIO_MAP_TABLE 0x18
|
||||
#define MV88E6390_PORT_IEEE_PRIO_MAP_TABLE_UPDATE 0x8000
|
||||
@@ -565,6 +568,10 @@ int mv88e6351_port_set_ether_type(struct mv88e6xxx_chip *chip, int port,
|
||||
int mv88e6xxx_port_claim_ether_type(struct mv88e6xxx_chip *chip, int port,
|
||||
u16 etype);
|
||||
int mv88e6xxx_port_relinquish_ether_type(struct mv88e6xxx_chip *chip, int port);
|
||||
+int mv88e6393x_port_led_write(struct mv88e6xxx_chip *chip, int port,
|
||||
+ unsigned int pointer, u16 data);
|
||||
+int mv88e6393x_port_led_read(struct mv88e6xxx_chip *chip, int port,
|
||||
+ unsigned int pointer, u16 *data);
|
||||
int mv88e6393x_set_egress_port(struct mv88e6xxx_chip *chip,
|
||||
enum mv88e6xxx_egress_direction direction,
|
||||
int port);
|
||||
@@ -597,12 +604,18 @@ int mv88e6185_port_get_cmode(struct mv88e6xxx_chip *chip, int port, u8 *cmode);
|
||||
int mv88e6352_port_get_cmode(struct mv88e6xxx_chip *chip, int port, u8 *cmode);
|
||||
#ifdef CONFIG_NET_DSA_MV88E6XXX_LEDS
|
||||
int mv88e6xxx_port_setup_leds(struct mv88e6xxx_chip *chip, int port);
|
||||
+int mv88e6393x_port_setup_leds(struct mv88e6xxx_chip *chip, int port);
|
||||
#else
|
||||
static inline int mv88e6xxx_port_setup_leds(struct mv88e6xxx_chip *chip,
|
||||
int port)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
+static inline int mv88e6393x_port_setup_leds(struct mv88e6xxx_chip *chip,
|
||||
+ int port)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
#endif
|
||||
int mv88e6xxx_port_drop_untagged(struct mv88e6xxx_chip *chip, int port,
|
||||
bool drop_untagged);
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -1,402 +0,0 @@
|
||||
From e660d11d572fa039bdbcf8ed44c8aff6868184ae Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= <lazzer@gmail.com>
|
||||
Date: Thu, 15 Jan 2026 22:47:37 +0100
|
||||
Subject: [PATCH 29/29] wifi: brcmfmac: support deletion and recreation of
|
||||
primary interface
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Organization: Wires
|
||||
|
||||
The Broadcom FullMAC firmware does not allow the primary interface
|
||||
(bsscfgidx 0) to be deleted - it always exists in firmware. However,
|
||||
userspace may want to delete and recreate the primary interface with
|
||||
a different name or configuration.
|
||||
|
||||
Add support for this by:
|
||||
|
||||
1. Allow deletion of primary interface by removing local driver
|
||||
structures while keeping firmware interface. Send BRCMF_C_DOWN to
|
||||
clear firmware state before removing local structures.
|
||||
|
||||
2. Add brcmf_cfg80211_add_primary_iface() to recreate the primary
|
||||
interface by rebuilding local structures and reinitializing the
|
||||
firmware interface with BRCMF_C_UP and brcmf_config_dongle().
|
||||
|
||||
3. When deleting primary interface while secondary interfaces exist,
|
||||
bring dongle back UP since BRCMF_C_DOWN affects the entire dongle.
|
||||
|
||||
4. Fix brcmf_cfg80211_dump_survey() to use the correct interface
|
||||
(the one being surveyed) rather than always using the primary.
|
||||
Also ensure BRCMF_C_UP is called before channel operations.
|
||||
|
||||
5. Make cfg_to_ndev() return NULL when primary interface is deleted,
|
||||
and add NULL checks in callers.
|
||||
|
||||
6. Fix rtnl locking in brcmf_del_if() to avoid deadlock when called
|
||||
with rtnl already held.
|
||||
|
||||
Signed-off-by: Mattias Walström <lazzer@gmail.com>
|
||||
---
|
||||
.../broadcom/brcm80211/brcmfmac/cfg80211.c | 177 ++++++++++++++++--
|
||||
.../broadcom/brcm80211/brcmfmac/cfg80211.h | 4 +-
|
||||
.../broadcom/brcm80211/brcmfmac/core.c | 6 +-
|
||||
.../broadcom/brcm80211/brcmfmac/p2p.c | 16 +-
|
||||
4 files changed, 183 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
index bb96b87b2a6e..9c8128551072 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -124,6 +124,9 @@ struct cca_msrmnt_query {
|
||||
u32 time_req;
|
||||
};
|
||||
|
||||
+/* Forward declaration */
|
||||
+static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg);
|
||||
+
|
||||
static bool check_vif_up(struct brcmf_cfg80211_vif *vif)
|
||||
{
|
||||
if (!test_bit(BRCMF_VIF_STATUS_READY, &vif->sme_state)) {
|
||||
@@ -822,11 +825,18 @@ struct wireless_dev *brcmf_apsta_add_vif(struct wiphy *wiphy, const char *name,
|
||||
enum nl80211_iftype type)
|
||||
{
|
||||
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
|
||||
- struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg));
|
||||
+ struct net_device *ndev = cfg_to_ndev(cfg);
|
||||
struct brcmf_pub *drvr = cfg->pub;
|
||||
struct brcmf_cfg80211_vif *vif;
|
||||
+ struct brcmf_if *ifp;
|
||||
int err;
|
||||
|
||||
+ if (!ndev) {
|
||||
+ bphy_err(drvr, "primary interface not available\n");
|
||||
+ return ERR_PTR(-ENODEV);
|
||||
+ }
|
||||
+ ifp = netdev_priv(ndev);
|
||||
+
|
||||
if (type != NL80211_IFTYPE_STATION && type != NL80211_IFTYPE_AP)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
@@ -868,6 +878,13 @@ struct wireless_dev *brcmf_apsta_add_vif(struct wiphy *wiphy, const char *name,
|
||||
goto fail;
|
||||
}
|
||||
|
||||
+ /*
|
||||
+ * Bring the firmware interface UP. When firmware reuses a bsscfgidx
|
||||
+ * from a previously deleted interface, it may retain stale state that
|
||||
+ * affects channel operations. Bringing it UP ensures proper init.
|
||||
+ */
|
||||
+ brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1);
|
||||
+
|
||||
strscpy(ifp->ndev->name, name, sizeof(ifp->ndev->name));
|
||||
err = brcmf_net_attach(ifp, true);
|
||||
if (err) {
|
||||
@@ -974,6 +991,85 @@ static int brcmf_mon_del_vif(struct wiphy *wiphy, struct wireless_dev *wdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * brcmf_cfg80211_add_primary_iface() - recreate the primary interface
|
||||
+ *
|
||||
+ * @wiphy: wiphy device of new interface.
|
||||
+ * @name: name of the new interface.
|
||||
+ * @type: interface type (STATION or AP).
|
||||
+ *
|
||||
+ * The primary interface (bsscfgidx 0) cannot be created in firmware
|
||||
+ * as it always exists. This function recreates the local driver
|
||||
+ * structures after a previous deletion.
|
||||
+ *
|
||||
+ * Return: pointer to new wdev on success, ERR_PTR(-errno) on failure
|
||||
+ */
|
||||
+static struct wireless_dev *brcmf_cfg80211_add_primary_iface(struct wiphy *wiphy,
|
||||
+ const char *name,
|
||||
+ enum nl80211_iftype type)
|
||||
+{
|
||||
+ struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
|
||||
+ struct brcmf_pub *drvr = cfg->pub;
|
||||
+ struct brcmf_cfg80211_vif *vif;
|
||||
+ struct brcmf_if *ifp;
|
||||
+ int err;
|
||||
+
|
||||
+ brcmf_dbg(INFO, "Recreating primary interface \"%s\" at bsscfgidx 0\n", name);
|
||||
+
|
||||
+ /* Create the interface structure for bsscfgidx 0 */
|
||||
+ ifp = brcmf_add_if(drvr, 0, 0, false, name, drvr->mac);
|
||||
+ if (IS_ERR(ifp))
|
||||
+ return ERR_CAST(ifp);
|
||||
+
|
||||
+ brcmf_proto_add_if(drvr, ifp);
|
||||
+
|
||||
+ /* Allocate and set up the vif */
|
||||
+ vif = brcmf_alloc_vif(cfg, type);
|
||||
+ if (IS_ERR(vif)) {
|
||||
+ err = PTR_ERR(vif);
|
||||
+ goto fail_ifp;
|
||||
+ }
|
||||
+
|
||||
+ vif->ifp = ifp;
|
||||
+ vif->wdev.netdev = ifp->ndev;
|
||||
+ ifp->ndev->ieee80211_ptr = &vif->wdev;
|
||||
+ SET_NETDEV_DEV(ifp->ndev, wiphy_dev(cfg->wiphy));
|
||||
+ ifp->vif = vif;
|
||||
+
|
||||
+ err = brcmf_net_attach(ifp, true);
|
||||
+ if (err) {
|
||||
+ bphy_err(drvr, "Registering netdevice failed\n");
|
||||
+ goto fail_vif;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Bring the firmware interface UP. Since we're reusing bsscfgidx 0
|
||||
+ * which the firmware never truly deletes, bringing it UP ensures
|
||||
+ * proper initialization for channel operations.
|
||||
+ */
|
||||
+ brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1);
|
||||
+
|
||||
+ /*
|
||||
+ * Initialize the firmware interface. This would normally happen
|
||||
+ * on ndo_open via brcmf_cfg80211_up, but operations like channel
|
||||
+ * survey may occur before the interface is opened. We call
|
||||
+ * brcmf_config_dongle directly since dongle_up was reset when
|
||||
+ * the primary interface was deleted.
|
||||
+ */
|
||||
+ set_bit(BRCMF_VIF_STATUS_READY, &vif->sme_state);
|
||||
+ err = brcmf_config_dongle(cfg);
|
||||
+ if (err)
|
||||
+ bphy_err(drvr, "dongle configuration failed: %d\n", err);
|
||||
+
|
||||
+ return &vif->wdev;
|
||||
+
|
||||
+fail_vif:
|
||||
+ brcmf_free_vif(vif);
|
||||
+fail_ifp:
|
||||
+ brcmf_remove_interface(ifp, true);
|
||||
+ return ERR_PTR(err);
|
||||
+}
|
||||
+
|
||||
static struct wireless_dev *brcmf_cfg80211_add_iface(struct wiphy *wiphy,
|
||||
const char *name,
|
||||
unsigned char name_assign_type,
|
||||
@@ -1001,7 +1097,11 @@ static struct wireless_dev *brcmf_cfg80211_add_iface(struct wiphy *wiphy,
|
||||
return brcmf_mon_add_vif(wiphy, name);
|
||||
case NL80211_IFTYPE_STATION:
|
||||
case NL80211_IFTYPE_AP:
|
||||
- wdev = brcmf_apsta_add_vif(wiphy, name, params, type);
|
||||
+ /* Check if primary interface slot is available for recreation */
|
||||
+ if (!drvr->iflist[0])
|
||||
+ wdev = brcmf_cfg80211_add_primary_iface(wiphy, name, type);
|
||||
+ else
|
||||
+ wdev = brcmf_apsta_add_vif(wiphy, name, params, type);
|
||||
break;
|
||||
case NL80211_IFTYPE_P2P_CLIENT:
|
||||
case NL80211_IFTYPE_P2P_GO:
|
||||
@@ -1270,6 +1370,9 @@ static int brcmf_cfg80211_del_apsta_iface(struct wiphy *wiphy,
|
||||
int ret;
|
||||
int err;
|
||||
|
||||
+ /* Bring interface DOWN to clear firmware state before removal */
|
||||
+ brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1);
|
||||
+
|
||||
brcmf_cfg80211_arm_vif_event(cfg, ifp->vif);
|
||||
|
||||
err = brcmf_fil_bsscfg_data_set(ifp, "interface_remove", NULL, 0);
|
||||
@@ -1294,14 +1397,56 @@ static int brcmf_cfg80211_del_apsta_iface(struct wiphy *wiphy,
|
||||
return err;
|
||||
}
|
||||
|
||||
+static int brcmf_cfg80211_del_primary_iface(struct wiphy *wiphy,
|
||||
+ struct wireless_dev *wdev)
|
||||
+{
|
||||
+ struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
|
||||
+ struct net_device *ndev = wdev->netdev;
|
||||
+ struct brcmf_if *ifp = netdev_priv(ndev);
|
||||
+ struct brcmf_pub *drvr = cfg->pub;
|
||||
+ struct brcmf_if *other_ifp;
|
||||
+ int i;
|
||||
+
|
||||
+ /*
|
||||
+ * The primary interface (bsscfgidx 0) cannot be removed from
|
||||
+ * firmware, but we can remove the local interface structures
|
||||
+ * to allow recreation via add_virtual_intf.
|
||||
+ *
|
||||
+ * Bring interface DOWN to clear firmware state before removing
|
||||
+ * local structures, ensuring clean state when recreated.
|
||||
+ */
|
||||
+ brcmf_abort_scanning(cfg);
|
||||
+ brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1);
|
||||
+
|
||||
+ brcmf_remove_interface(ifp, true);
|
||||
+
|
||||
+ /*
|
||||
+ * BRCMF_C_DOWN affects the entire dongle. If other interfaces
|
||||
+ * still exist, bring the dongle back UP so they remain functional.
|
||||
+ */
|
||||
+ for (i = 0; i < BRCMF_MAX_IFS; i++) {
|
||||
+ other_ifp = drvr->iflist[i];
|
||||
+ if (other_ifp) {
|
||||
+ brcmf_fil_cmd_int_set(other_ifp, BRCMF_C_UP, 1);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Reset dongle_up so that when the interface is recreated,
|
||||
+ * brcmf_config_dongle() will reinitialize the firmware.
|
||||
+ */
|
||||
+ cfg->dongle_up = false;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static
|
||||
int brcmf_cfg80211_del_iface(struct wiphy *wiphy, struct wireless_dev *wdev)
|
||||
{
|
||||
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
|
||||
struct net_device *ndev = wdev->netdev;
|
||||
-
|
||||
- if (ndev && ndev == cfg_to_ndev(cfg))
|
||||
- return -ENOTSUPP;
|
||||
+ bool is_primary = ndev && ndev == cfg_to_ndev(cfg);
|
||||
|
||||
/* vif event pending in firmware */
|
||||
if (brcmf_cfg80211_vif_event_armed(cfg))
|
||||
@@ -1326,6 +1471,8 @@ int brcmf_cfg80211_del_iface(struct wiphy *wiphy, struct wireless_dev *wdev)
|
||||
return brcmf_mon_del_vif(wiphy, wdev);
|
||||
case NL80211_IFTYPE_STATION:
|
||||
case NL80211_IFTYPE_AP:
|
||||
+ if (is_primary)
|
||||
+ return brcmf_cfg80211_del_primary_iface(wiphy, wdev);
|
||||
return brcmf_cfg80211_del_apsta_iface(wiphy, wdev);
|
||||
case NL80211_IFTYPE_P2P_CLIENT:
|
||||
case NL80211_IFTYPE_P2P_GO:
|
||||
@@ -8114,11 +8261,11 @@ brcmf_dump_obss(struct brcmf_if *ifp, struct cca_msrmnt_query req,
|
||||
}
|
||||
|
||||
static s32
|
||||
-brcmf_set_channel(struct brcmf_cfg80211_info *cfg, struct ieee80211_channel *chan)
|
||||
+brcmf_set_channel(struct brcmf_cfg80211_info *cfg, struct brcmf_if *ifp,
|
||||
+ struct ieee80211_channel *chan)
|
||||
{
|
||||
u16 chspec = 0;
|
||||
int err = 0;
|
||||
- struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg));
|
||||
|
||||
if (chan->flags & IEEE80211_CHAN_DISABLED)
|
||||
return -EINVAL;
|
||||
@@ -8144,7 +8291,7 @@ brcmf_cfg80211_dump_survey(struct wiphy *wiphy, struct net_device *ndev,
|
||||
int idx, struct survey_info *info)
|
||||
{
|
||||
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
|
||||
- struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg));
|
||||
+ struct brcmf_if *ifp = netdev_priv(ndev);
|
||||
struct brcmf_dump_survey survey = {};
|
||||
struct ieee80211_supported_band *band;
|
||||
enum nl80211_band band_id;
|
||||
@@ -8175,21 +8322,21 @@ brcmf_cfg80211_dump_survey(struct wiphy *wiphy, struct net_device *ndev,
|
||||
if (band_id == NUM_NL80211_BANDS)
|
||||
return -ENOENT;
|
||||
|
||||
- /* Setting current channel to the requested channel */
|
||||
- info->filled = 0;
|
||||
- if (brcmf_set_channel(cfg, info->channel))
|
||||
- return 0;
|
||||
-
|
||||
/* Disable mpc */
|
||||
brcmf_set_mpc(ifp, 0);
|
||||
|
||||
- /* Set interface up, explicitly. */
|
||||
+ /* Set interface up before channel operations */
|
||||
err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1);
|
||||
if (err) {
|
||||
- brcmf_err("set interface up failed, err = %d\n", err);
|
||||
+ brcmf_err("BRCMF_C_UP failed in survey, err = %d\n", err);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
+ /* Setting current channel to the requested channel */
|
||||
+ info->filled = 0;
|
||||
+ if (brcmf_set_channel(cfg, ifp, info->channel))
|
||||
+ return 0;
|
||||
+
|
||||
/* Get noise value */
|
||||
err = brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_PHY_NOISE, &noise);
|
||||
if (err) {
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
|
||||
index 273c80f2d483..ee7e9dc17dce 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
|
||||
@@ -433,7 +433,9 @@ static inline struct brcmf_cfg80211_vif *wdev_to_vif(struct wireless_dev *wdev)
|
||||
static inline
|
||||
struct net_device *cfg_to_ndev(struct brcmf_cfg80211_info *cfg)
|
||||
{
|
||||
- return brcmf_get_ifp(cfg->pub, 0)->ndev;
|
||||
+ struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0);
|
||||
+
|
||||
+ return ifp ? ifp->ndev : NULL;
|
||||
}
|
||||
|
||||
static inline struct brcmf_cfg80211_info *ndev_to_cfg(struct net_device *ndev)
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
index 862a0336a0b5..08f265325ce4 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
@@ -933,9 +933,11 @@ static void brcmf_del_if(struct brcmf_pub *drvr, s32 bsscfgidx,
|
||||
if (ifp->ndev) {
|
||||
if (bsscfgidx == 0) {
|
||||
if (ifp->ndev->netdev_ops == &brcmf_netdev_ops_pri) {
|
||||
- rtnl_lock();
|
||||
+ if (!locked)
|
||||
+ rtnl_lock();
|
||||
brcmf_netdev_stop(ifp->ndev);
|
||||
- rtnl_unlock();
|
||||
+ if (!locked)
|
||||
+ rtnl_unlock();
|
||||
}
|
||||
} else {
|
||||
netif_stop_queue(ifp->ndev);
|
||||
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
|
||||
index e1752a513c73..2dc0fbba271d 100644
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
|
||||
@@ -2222,8 +2222,13 @@ static struct wireless_dev *brcmf_p2p_create_p2pdev(struct brcmf_p2p_info *p2p,
|
||||
static int brcmf_p2p_get_conn_idx(struct brcmf_cfg80211_info *cfg)
|
||||
{
|
||||
int i;
|
||||
- struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg));
|
||||
+ struct net_device *ndev = cfg_to_ndev(cfg);
|
||||
+ struct brcmf_if *ifp;
|
||||
+
|
||||
+ if (!ndev)
|
||||
+ return -ENODEV;
|
||||
|
||||
+ ifp = netdev_priv(ndev);
|
||||
if (!ifp)
|
||||
return -ENODEV;
|
||||
|
||||
@@ -2255,14 +2260,21 @@ struct wireless_dev *brcmf_p2p_add_vif(struct wiphy *wiphy, const char *name,
|
||||
struct vif_params *params)
|
||||
{
|
||||
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
|
||||
- struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg));
|
||||
+ struct net_device *ndev = cfg_to_ndev(cfg);
|
||||
struct brcmf_pub *drvr = cfg->pub;
|
||||
struct brcmf_cfg80211_vif *vif;
|
||||
enum brcmf_fil_p2p_if_types iftype;
|
||||
+ struct brcmf_if *ifp;
|
||||
int err = 0;
|
||||
int connidx;
|
||||
u8 *p2p_intf_addr;
|
||||
|
||||
+ if (!ndev) {
|
||||
+ bphy_err(drvr, "primary interface not available\n");
|
||||
+ return ERR_PTR(-ENODEV);
|
||||
+ }
|
||||
+ ifp = netdev_priv(ndev);
|
||||
+
|
||||
if (brcmf_cfg80211_vif_event_armed(cfg))
|
||||
return ERR_PTR(-EBUSY);
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
# Calculated with utils/kernel-refresh.sh
|
||||
sha256 189d1f409cef8d0d234210e04595172df392f8cb297e14b447ed95720e2fd940 linux-6.18.5.tar.xz
|
||||
sha256 ba3897a1c060b05a03cb4dda6f20d8c75e6f73c88b217744823a915056536eaf linux-6.12.66.tar.xz
|
||||
|
||||
Reference in New Issue
Block a user