[OpenWrt-Devel] ar8216: question regarding ar8xxx_phy_config_aneg
In my tests with AR8327 this callback was never called with an addr != 0. Seems logical to me as it's called for the PHY attached to the net device only. In most cases this is addr 0, just for AR8316 with port4_phy being set this could be 4. This leads to two questions: 1. The current version of this function checks for "addr == 0" always, I'd assume this is not correct for AR8316 and port4_phy being set. 2. As it seems to be called for the attached PHY addr only and in exactly this case we do nothing: Can we simply replace this callback with a dummy "return 0" ? Heiner ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] ar8216: phy_init and bug report 18415
This bug report relates to a device using the AR8216 switch chip and a trunk version where the additional phy reset in 3.14 was still enabled. Seems like there was an issue with autoneg. This is not fully clear to me as after the first phy reset in the kernel phy code we do the hw_init in the driver and set BMCR_RESET | BMCR_ANENABLE. This seems to re-establish autoneg support for other members of the AR8xxx switch chip family but not for AR8216. For AR8216 the BMCR_ANENABLE flag seems to be ignored. However I can't test this as I have no 8216-based device and no datasheet. Maybe to make AR8216 happy we have to enable autoneg explicitely like this before resetting? mdiobus_write(bus, i, MII_BMCR, BMCR_ANENABLE); mdiobus_write(bus, i, MII_BMCR, BMCR_RESET | BMCR_ANENABLE); For the other AR8xxx switches this isn't needed but doesn't disturb. Anybody with a 8216-based device who can test this? However changeset 43410 disabled the additional phy reset. This makes 8216-based devices work properly again so there's no uregent need to check this. Heiner ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] ar8216: question regarding ar8xxx_phy_config_aneg
On Fri, Nov 28, 2014 at 11:06 AM, Heiner Kallweit wrote: > In my tests with AR8327 this callback was never called with an addr != 0. > Seems logical to me as it's called for the PHY attached to the net device > only. > > In most cases this is addr 0, just for AR8316 with port4_phy being set this > could be 4. > > This leads to two questions: > > 1. The current version of this function checks for "addr == 0" always, I'd > assume this is not correct for AR8316 and port4_phy being set. > > 2. As it seems to be called for the attached PHY addr only and in exactly > this case we do nothing: Can we simply replace this callback with a dummy > "return 0" ? Port4_phy being set means the switch operates in dual-mii mode. Most Atheros switches (including AR8327) support a dual-phy mode, where port 5 / phy 4 is split out from the rest of the switch and used as a single phy for a second ethernet mac. In these cases phy 4 is used like a standard phy, and the kernel needs to be able to configure autonegotiation or other features. Consequently you will only see the callback being called for addr != 0 if the switch is in this mode and there is a second ethernet mac as the single wan port. I'm not sure if there are any OpenWrt supported devices with this setup with AR8327, but there are several examples for AR8316, e.g. the RouterStation Pro [1]. The switch driver claiming phy 0 is technically wrong, as the connection to the switch isn't using phy 0, but uses a fixed (R)(G)MII connection that does not support autonegotiation. But there also is no other phy address on the MDIO bus which represents the cpu port, so we need this workaround for autodetection/-attachment. >From the switch perspective port 0 / cpu port. Phy 0 actually belongs to the external port 1, therefore we stub it out for addr == 0. Jonas [1] http://wiki.openwrt.org/toh/ubiquiti/routerstation.pro#switch.ports.for.vlans ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PULL RESEND] oxnas: two small fixes
The following changes since commit 3ecf78cea81128e20d4679f258fb596e8ae09124: kernel: 3.18: Fix patch 644 dependency chain (2014-11-28 01:29:51 +) are available in the git repository at: https://gitorious.org/openwrt-oxnas/openwrt-oxnas.git for you to fetch changes up to 627377b2fdf665cf1e5a532e0e662e6d1a3350b5: oxnas: change visible board name (2014-11-28 12:30:07 +0100) Daniel Golle (2): oxnas: ehci: rename vendor prefix plxtch to plxtech oxnas: change visible board name target/linux/oxnas/Makefile| 2 +- target/linux/oxnas/files/arch/arm/boot/dts/ox820.dtsi | 2 +- target/linux/oxnas/files/drivers/usb/host/ehci-oxnas.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] ar8216: question regarding ar8xxx_phy_config_aneg
On Fri, Nov 28, 2014 at 12:15 PM, Jonas Gorski wrote: > On Fri, Nov 28, 2014 at 11:06 AM, Heiner Kallweit > wrote: > > In my tests with AR8327 this callback was never called with an addr != 0. > > Seems logical to me as it's called for the PHY attached to the net device > > only. > > > > In most cases this is addr 0, just for AR8316 with port4_phy being set > this > > could be 4. > > > > This leads to two questions: > > > > 1. The current version of this function checks for "addr == 0" always, > I'd > > assume this is not correct for AR8316 and port4_phy being set. > > > > 2. As it seems to be called for the attached PHY addr only and in exactly > > this case we do nothing: Can we simply replace this callback with a dummy > > "return 0" ? > > Port4_phy being set means the switch operates in dual-mii mode. > > Most Atheros switches (including AR8327) support a dual-phy mode, > where port 5 / phy 4 is split out from the rest of the switch and used > as a single phy for a second ethernet mac. In these cases phy 4 is > used like a standard phy, and the kernel needs to be able to configure > autonegotiation or other features. > > Consequently you will only see the callback being called for addr != 0 > if the switch is in this mode and there is a second ethernet mac as > the single wan port. I'm not sure if there are any OpenWrt supported > devices with this setup with AR8327, but there are several examples > for AR8316, e.g. the RouterStation Pro [1]. > > The switch driver claiming phy 0 is technically wrong, as the > connection to the switch isn't using phy 0, but uses a fixed (R)(G)MII > connection that does not support autonegotiation. But there also is no > other phy address on the MDIO bus which represents the cpu port, so we > need this workaround for autodetection/-attachment. > > From the switch perspective port 0 / cpu port. Phy 0 actually belongs > to the external port 1, therefore we stub it out for addr == 0. > > > Jonas Thanks a lot for the comprehensive explanation! Heiner ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v3 1/4] kernel.mk: Refactor LINUX_KARCH affectation
Switch to a dumber implementation that will be easier to maintain in the long run, with only if statements instead of having nested subst calls. Signed-off-by: Maxime Ripard --- include/kernel.mk | 25 + 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/include/kernel.mk b/include/kernel.mk index 01fb4dbd8107..97eb1f74f4f7 100644 --- a/include/kernel.mk +++ b/include/kernel.mk @@ -64,13 +64,30 @@ endif ifneq (,$(findstring uml,$(BOARD))) LINUX_KARCH=um +else ifeq ($(ARCH),aarch64) + LINUX_KARCH := arm64 +else ifeq ($(ARCH),aarch64_be) + LINUX_KARCH := arm64 +else ifeq ($(ARCH),armeb) + LINUX_KARCH := arm +else ifeq ($(ARCH),mipsel) + LINUX_KARCH := mips +else ifeq ($(ARCH),mips64) + LINUX_KARCH := mips +else ifeq ($(ARCH),mips64el) + LINUX_KARCH := mips +else ifeq ($(ARCH),sh2) + LINUX_KARCH := sh +else ifeq ($(ARCH),sh3) + LINUX_KARCH := sh +else ifeq ($(ARCH),sh4) + LINUX_KARCH := sh +else ifeq ($(ARCH),i386) + LINUX_KARCH := x86 else - ifeq (,$(LINUX_KARCH)) -LINUX_KARCH=$(strip $(subst i386,x86,$(subst armeb,arm,$(subst mipsel,mips,$(subst mips64,mips,$(subst mips64el,mips,$(subst sh2,sh,$(subst sh3,sh,$(subst sh4,sh,$(subst aarch64,arm64,$(subst aarch64_be,arm64,$(ARCH - endif + LINUX_KARCH := $(ARCH) endif - define KernelPackage/Defaults FILES:= AUTOLOAD:= -- 2.1.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v3 2/4] kernel.mk: Handle the x86_64 LINUX_KARCH case
x64 is handled by the x86 architecture in Linux, add a case for it in LINUX_KARCH. Signed-off-by: Maxime Ripard --- include/kernel.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/kernel.mk b/include/kernel.mk index 97eb1f74f4f7..2d15e9ad2712 100644 --- a/include/kernel.mk +++ b/include/kernel.mk @@ -84,6 +84,8 @@ else ifeq ($(ARCH),sh4) LINUX_KARCH := sh else ifeq ($(ARCH),i386) LINUX_KARCH := x86 +else ifeq ($(ARCH),x86_64) + LINUX_KARCH := x86 else LINUX_KARCH := $(ARCH) endif -- 2.1.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v3 3/4] kernel: Use defconfig instead of full fledged kernel configuration
Rely on the Kconfig defconfig mechanism to fill all the missing options, instead of needing to set them all in the kernel configurations like what was previously done. This will allow to trim down a lot the configuration files, avoid carrying unused configuration options and preserve the developers mental health. Signed-off-by: Maxime Ripard --- include/kernel-defaults.mk | 24 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk index 8abd32d7141d..493e96372eef 100644 --- a/include/kernel-defaults.mk +++ b/include/kernel-defaults.mk @@ -100,16 +100,24 @@ define Kernel/SetNoInitramfs echo 'CONFIG_INITRAMFS_SOURCE=""' >> $(LINUX_DIR)/.config endef +DEFCONFIG_DIR = $(LINUX_DIR)/arch/$(LINUX_KARCH)/configs +DEFCONFIG_NAME = openwrt_defconfig + define Kernel/Configure/Default - $(LINUX_CONF_CMD) > $(LINUX_DIR)/.config.target + $(LINUX_CONF_CMD) > $(DEFCONFIG_DIR)/$(DEFCONFIG_NAME).target # copy CONFIG_KERNEL_* settings over to .config.target - awk '/^(#[[:space:]]+)?CONFIG_KERNEL/{sub("CONFIG_KERNEL_","CONFIG_");print}' $(TOPDIR)/.config >> $(LINUX_DIR)/.config.target - echo "# CONFIG_KALLSYMS_EXTRA_PASS is not set" >> $(LINUX_DIR)/.config.target - echo "# CONFIG_KALLSYMS_ALL is not set" >> $(LINUX_DIR)/.config.target - echo "# CONFIG_KALLSYMS_UNCOMPRESSED is not set" >> $(LINUX_DIR)/.config.target - echo "# CONFIG_KPROBES is not set" >> $(LINUX_DIR)/.config.target - $(SCRIPT_DIR)/metadata.pl kconfig $(TMP_DIR)/.packageinfo $(TOPDIR)/.config > $(LINUX_DIR)/.config.override - $(SCRIPT_DIR)/kconfig.pl 'm+' '+' $(LINUX_DIR)/.config.target /dev/null $(LINUX_DIR)/.config.override > $(LINUX_DIR)/.config + awk '/^(#[[:space:]]+)?CONFIG_KERNEL/{sub("CONFIG_KERNEL_","CONFIG_");print}' \ + $(TOPDIR)/.config >> $(DEFCONFIG_DIR)/$(DEFCONFIG_NAME).target + echo "# CONFIG_KALLSYMS_EXTRA_PASS is not set" >> $(DEFCONFIG_DIR)/$(DEFCONFIG_NAME).target + echo "# CONFIG_KALLSYMS_ALL is not set" >> $(DEFCONFIG_DIR)/$(DEFCONFIG_NAME).target + echo "# CONFIG_KALLSYMS_UNCOMPRESSED is not set" >> $(DEFCONFIG_DIR)/$(DEFCONFIG_NAME).target + echo "# CONFIG_KPROBES is not set" >> $(DEFCONFIG_DIR)/$(DEFCONFIG_NAME).target + $(SCRIPT_DIR)/metadata.pl kconfig $(TMP_DIR)/.packageinfo $(TOPDIR)/.config > \ + $(DEFCONFIG_DIR)/$(DEFCONFIG_NAME).override + $(SCRIPT_DIR)/kconfig.pl 'm+' '+' $(DEFCONFIG_DIR)/$(DEFCONFIG_NAME).target \ +/dev/null $(DEFCONFIG_DIR)/$(DEFCONFIG_NAME).override > \ + $(DEFCONFIG_DIR)/$(DEFCONFIG_NAME) + +$(MAKE) $(KERNEL_MAKEOPTS) $(DEFCONFIG_NAME) $(call Kernel/SetNoInitramfs) rm -rf $(KERNEL_BUILD_DIR)/modules $(_SINGLE) [ -d $(LINUX_DIR)/user_headers ] || $(MAKE) $(KERNEL_MAKEOPTS) INSTALL_HDR_PATH=$(LINUX_DIR)/user_headers headers_install -- 2.1.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH v3 0/4] defconfig support for 3.18
Hi, This is the third attempt to rely on the defconfigs mechanism instead of generating our own full kernel configuration file. This has been build tested, both before and after applying the first patch on all the supported targets so far. You can get a list of the various build runs, with both the log and the generated kernel configuration file from: http://free-electrons.com/~maxime/pub/openwrt/config-backup-with/ http://free-electrons.com/~maxime/pub/openwrt/config-backup-without/ This has been generated with the following script: http://code.bulix.org/bbs1p3-87473 Maxime Changes from v2: - Rebased on current master - Refactored LINUX_KARCH affectation, added a test case for x64 and used it. Changes from v1: - Added a test case for OpenWRT architectures name that don't match Linux' Maxime Ripard (4): kernel.mk: Refactor LINUX_KARCH affectation kernel.mk: Handle the x86_64 LINUX_KARCH case kernel: Use defconfig instead of full fledged kernel configuration kernel: 3.18: Strip off all the useless options include/kernel-defaults.mk | 24 +- include/kernel.mk| 27 +- target/linux/generic/config-3.18 | 4391 +- 3 files changed, 51 insertions(+), 4391 deletions(-) -- 2.1.1 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 0/6] ar8216: further cleanups
This patch series factors out more chip-specific differences to ar8xxx_chip. 1/6 factor out info whether switch should be configured at probe stage to ar8xxx_chip 2/6 factor out mib_func to ar8xxx_chip 3/6 factor out set_mirror_regs to ar8xxx_chip 4/6 factor out chip-specific data structures from ar8xxx_priv 5/6 factor out mii_lo_first to ar8xxx_chip 6/6 factor out reg_port_stats_base parameters to ar8xxx_chip Heiner ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 1/6] ar8216: factor out info whether switch should be configured at probe stage to ar8xxx_chip
Factor out info whether switch should be configured at probe stage to ar8xxx_chip. Remove related chip_is_... checks. Signed-off-by: Heiner Kallweit --- target/linux/generic/files/drivers/net/phy/ar8216.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c index a4e2260..028b98f 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8216.c +++ b/target/linux/generic/files/drivers/net/phy/ar8216.c @@ -70,6 +70,7 @@ struct ar8xxx_mib_desc { struct ar8xxx_chip { unsigned long caps; + bool config_at_probe; int (*hw_init)(struct ar8xxx_priv *priv); void (*cleanup)(struct ar8xxx_priv *priv); @@ -1821,6 +1822,7 @@ ar8327_setup_port(struct ar8xxx_priv *priv, int port, u32 members) static const struct ar8xxx_chip ar8327_chip = { .caps = AR8XXX_CAP_GIGE | AR8XXX_CAP_MIB_COUNTERS, + .config_at_probe = true, .hw_init = ar8327_hw_init, .cleanup = ar8327_cleanup, .init_globals = ar8327_init_globals, @@ -2797,7 +2799,7 @@ ar8xxx_phy_config_init(struct phy_device *phydev) if (WARN_ON(!priv)) return -ENODEV; - if (chip_is_ar8327(priv) || chip_is_ar8337(priv)) + if (priv->chip->config_at_probe) return ar8xxx_phy_check_aneg(phydev); priv->phy = phydev; @@ -2973,7 +2975,7 @@ found: phydev->advertising = ADVERTISED_100baseT_Full; } - if (chip_is_ar8327(priv) || chip_is_ar8337(priv)) { + if (priv->chip->config_at_probe) { priv->phy = phydev; ret = ar8xxx_start(priv); -- 2.1.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 4/6] ar8216: factor out chip-specific data structures from ar8xxx_priv
Factor out chip-specific data structures from ar8xxx_priv. Signed-off-by: Heiner Kallweit --- .../linux/generic/files/drivers/net/phy/ar8216.c | 31 +++--- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c index 8d84a88..3091fff 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8216.c +++ b/target/linux/generic/files/drivers/net/phy/ar8216.c @@ -146,9 +146,7 @@ struct ar8xxx_priv { u8 chip_ver; u8 chip_rev; const struct ar8xxx_chip *chip; - union { - struct ar8327_data ar8327; - } chip_data; + void *chip_data; bool initialized; bool port4_phy; char buf[2048]; @@ -1412,7 +1410,7 @@ static int ar8327_led_create(struct ar8xxx_priv *priv, const struct ar8327_led_info *led_info) { - struct ar8327_data *data = &priv->chip_data.ar8327; + struct ar8327_data *data = priv->chip_data; struct ar8327_led *aled; int ret; @@ -1473,14 +1471,12 @@ ar8327_led_destroy(struct ar8327_led *aled) static void ar8327_leds_init(struct ar8xxx_priv *priv) { - struct ar8327_data *data; + struct ar8327_data *data = priv->chip_data; unsigned i; if (!IS_ENABLED(CONFIG_AR8216_PHY_LEDS)) return; - data = &priv->chip_data.ar8327; - for (i = 0; i < data->num_leds; i++) { struct ar8327_led *aled; @@ -1498,7 +1494,7 @@ ar8327_leds_init(struct ar8xxx_priv *priv) static void ar8327_leds_cleanup(struct ar8xxx_priv *priv) { - struct ar8327_data *data = &priv->chip_data.ar8327; + struct ar8327_data *data = priv->chip_data; unsigned i; if (!IS_ENABLED(CONFIG_AR8216_PHY_LEDS)) @@ -1519,7 +1515,7 @@ ar8327_hw_config_pdata(struct ar8xxx_priv *priv, struct ar8327_platform_data *pdata) { struct ar8327_led_cfg *led_cfg; - struct ar8327_data *data; + struct ar8327_data *data = priv->chip_data; u32 pos, new_pos; u32 t; @@ -1528,8 +1524,6 @@ ar8327_hw_config_pdata(struct ar8xxx_priv *priv, priv->get_port_link = pdata->get_port_link; - data = &priv->chip_data.ar8327; - data->port0_status = ar8327_get_port_init_status(&pdata->port0_cfg); data->port6_status = ar8327_get_port_init_status(&pdata->port6_cfg); @@ -1602,6 +1596,7 @@ ar8327_hw_config_pdata(struct ar8xxx_priv *priv, static int ar8327_hw_config_of(struct ar8xxx_priv *priv, struct device_node *np) { + struct ar8327_data *data = priv->chip_data; const __be32 *paddr; int len; int i; @@ -1621,10 +1616,10 @@ ar8327_hw_config_of(struct ar8xxx_priv *priv, struct device_node *np) switch (reg) { case AR8327_REG_PORT_STATUS(0): - priv->chip_data.ar8327.port0_status = val; + data->port0_status = val; break; case AR8327_REG_PORT_STATUS(6): - priv->chip_data.ar8327.port6_status = val; + data->port6_status = val; break; default: priv->write(priv, reg, val); @@ -1647,6 +1642,10 @@ ar8327_hw_init(struct ar8xxx_priv *priv) { int ret; + priv->chip_data = kzalloc(sizeof(struct ar8327_data), GFP_KERNEL); + if (!priv->chip_data) + return -ENOMEM; + if (priv->phy->dev.of_node) ret = ar8327_hw_config_of(priv, priv->phy->dev.of_node); else @@ -1706,12 +1705,13 @@ ar8327_init_globals(struct ar8xxx_priv *priv) static void ar8327_init_port(struct ar8xxx_priv *priv, int port) { + struct ar8327_data *data = priv->chip_data; u32 t; if (port == AR8216_PORT_CPU) - t = priv->chip_data.ar8327.port0_status; + t = data->port0_status; else if (port == 6) - t = priv->chip_data.ar8327.port6_status; + t = data->port6_status; else t = AR8216_PORT_STATUS_LINK_AUTO; @@ -2700,6 +2700,7 @@ ar8xxx_free(struct ar8xxx_priv *priv) if (priv->chip && priv->chip->cleanup) priv->chip->cleanup(priv); + kfree(priv->chip_data); kfree(priv->mib_stats); kfree(priv); } -- 2.1.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 3/6] ar8216: factor out set_mirror_regs to ar8xxx_chip
Factor out set_mirror_regs to ar8xxx_chip. Remove related chip_is_... checks. Signed-off-by: Heiner Kallweit --- .../linux/generic/files/drivers/net/phy/ar8216.c | 28 ++ 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c index effa33c..8d84a88 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8216.c +++ b/target/linux/generic/files/drivers/net/phy/ar8216.c @@ -54,6 +54,9 @@ struct ar8xxx_priv; #define AR8XXX_NUM_PHYS5 +static void ar8216_set_mirror_regs(struct ar8xxx_priv *priv); +static void ar8327_set_mirror_regs(struct ar8xxx_priv *priv); + enum { AR8XXX_VER_AR8216 = 0x01, AR8XXX_VER_AR8236 = 0x03, @@ -83,6 +86,7 @@ struct ar8xxx_chip { void (*vtu_flush)(struct ar8xxx_priv *priv); void (*vtu_load_vlan)(struct ar8xxx_priv *priv, u32 vid, u32 port_mask); void (*phy_fixup)(struct ar8xxx_priv *priv, int phy); + void (*set_mirror_regs)(struct ar8xxx_priv *priv); const struct ar8xxx_mib_desc *mib_decs; unsigned num_mibs; @@ -891,6 +895,7 @@ static const struct ar8xxx_chip ar8216_chip = { .atu_flush = ar8216_atu_flush, .vtu_flush = ar8216_vtu_flush, .vtu_load_vlan = ar8216_vtu_load_vlan, + .set_mirror_regs = ar8216_set_mirror_regs, .num_mibs = ARRAY_SIZE(ar8216_mibs), .mib_decs = ar8216_mibs, @@ -958,6 +963,7 @@ static const struct ar8xxx_chip ar8236_chip = { .atu_flush = ar8216_atu_flush, .vtu_flush = ar8216_vtu_flush, .vtu_load_vlan = ar8216_vtu_load_vlan, + .set_mirror_regs = ar8216_set_mirror_regs, .num_mibs = ARRAY_SIZE(ar8236_mibs), .mib_decs = ar8236_mibs, @@ -1042,6 +1048,7 @@ static const struct ar8xxx_chip ar8316_chip = { .atu_flush = ar8216_atu_flush, .vtu_flush = ar8216_vtu_flush, .vtu_load_vlan = ar8216_vtu_load_vlan, + .set_mirror_regs = ar8216_set_mirror_regs, .num_mibs = ARRAY_SIZE(ar8236_mibs), .mib_decs = ar8236_mibs, @@ -1832,6 +1839,7 @@ static const struct ar8xxx_chip ar8327_chip = { .vtu_flush = ar8327_vtu_flush, .vtu_load_vlan = ar8327_vtu_load_vlan, .phy_fixup = ar8327_phy_fixup, + .set_mirror_regs = ar8327_set_mirror_regs, .num_mibs = ARRAY_SIZE(ar8236_mibs), .mib_decs = ar8236_mibs, @@ -2093,16 +2101,6 @@ ar8216_set_mirror_regs(struct ar8xxx_priv *priv) AR8216_PORT_CTRL_MIRROR_TX); } -static void -ar8xxx_set_mirror_regs(struct ar8xxx_priv *priv) -{ - if (chip_is_ar8327(priv) || chip_is_ar8337(priv)) { - ar8327_set_mirror_regs(priv); - } else { - ar8216_set_mirror_regs(priv); - } -} - static int ar8xxx_sw_hw_apply(struct switch_dev *dev) { @@ -2150,7 +2148,7 @@ ar8xxx_sw_hw_apply(struct switch_dev *dev) priv->chip->setup_port(priv, i, portmask[i]); } - ar8xxx_set_mirror_regs(priv); + priv->chip->set_mirror_regs(priv); mutex_unlock(&priv->reg_mutex); return 0; @@ -,7 +2220,7 @@ ar8xxx_sw_set_mirror_rx_enable(struct switch_dev *dev, mutex_lock(&priv->reg_mutex); priv->mirror_rx = !!val->value.i; - ar8xxx_set_mirror_regs(priv); + priv->chip->set_mirror_regs(priv); mutex_unlock(&priv->reg_mutex); return 0; @@ -2247,7 +2245,7 @@ ar8xxx_sw_set_mirror_tx_enable(struct switch_dev *dev, mutex_lock(&priv->reg_mutex); priv->mirror_tx = !!val->value.i; - ar8xxx_set_mirror_regs(priv); + priv->chip->set_mirror_regs(priv); mutex_unlock(&priv->reg_mutex); return 0; @@ -2272,7 +2270,7 @@ ar8xxx_sw_set_mirror_monitor_port(struct switch_dev *dev, mutex_lock(&priv->reg_mutex); priv->monitor_port = val->value.i; - ar8xxx_set_mirror_regs(priv); + priv->chip->set_mirror_regs(priv); mutex_unlock(&priv->reg_mutex); return 0; @@ -2297,7 +2295,7 @@ ar8xxx_sw_set_mirror_source_port(struct switch_dev *dev, mutex_lock(&priv->reg_mutex); priv->source_port = val->value.i; - ar8xxx_set_mirror_regs(priv); + priv->chip->set_mirror_regs(priv); mutex_unlock(&priv->reg_mutex); return 0; -- 2.1.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 5/6] ar8216: factor out mii_lo_first to ar8xxx_chip
Factor out mii_lo_first to ar8xxx_chip. Signed-off-by: Heiner Kallweit --- target/linux/generic/files/drivers/net/phy/ar8216.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c index 3091fff..961803c 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8216.c +++ b/target/linux/generic/files/drivers/net/phy/ar8216.c @@ -74,6 +74,7 @@ struct ar8xxx_mib_desc { struct ar8xxx_chip { unsigned long caps; bool config_at_probe; + bool mii_lo_first; int (*hw_init)(struct ar8xxx_priv *priv); void (*cleanup)(struct ar8xxx_priv *priv); @@ -152,7 +153,6 @@ struct ar8xxx_priv { char buf[2048]; bool init; - bool mii_lo_first; struct mutex mib_lock; struct delayed_work mib_work; @@ -428,7 +428,7 @@ ar8xxx_mii_write(struct ar8xxx_priv *priv, int reg, u32 val) bus->write(bus, 0x18, 0, r3); usleep_range(1000, 2000); /* wait for the page switch to propagate */ - if (priv->mii_lo_first) { + if (priv->chip->mii_lo_first) { bus->write(bus, 0x10 | r2, r1, lo); bus->write(bus, 0x10 | r2, r1 + 1, hi); } else { @@ -464,7 +464,7 @@ ar8xxx_mii_rmw(struct ar8xxx_priv *priv, int reg, u32 mask, u32 val) lo = ret & 0x; hi = (u16) (ret >> 16); - if (priv->mii_lo_first) { + if (priv->chip->mii_lo_first) { bus->write(bus, 0x10 | r2, r1, lo); bus->write(bus, 0x10 | r2, r1 + 1, hi); } else { @@ -1829,6 +1829,8 @@ ar8327_setup_port(struct ar8xxx_priv *priv, int port, u32 members) static const struct ar8xxx_chip ar8327_chip = { .caps = AR8XXX_CAP_GIGE | AR8XXX_CAP_MIB_COUNTERS, .config_at_probe = true, + .mii_lo_first = true, + .hw_init = ar8327_hw_init, .cleanup = ar8327_cleanup, .init_globals = ar8327_init_globals, @@ -2596,11 +2598,9 @@ ar8xxx_id_chip(struct ar8xxx_priv *priv) priv->chip = &ar8316_chip; break; case AR8XXX_VER_AR8327: - priv->mii_lo_first = true; priv->chip = &ar8327_chip; break; case AR8XXX_VER_AR8337: - priv->mii_lo_first = true; priv->chip = &ar8327_chip; break; default: -- 2.1.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 2/6] ar8216: factor out mib_func to ar8xxx_chip
Factor out mib_func to ar8xxx_chip. Remove related chip_is_... checks. Signed-off-by: Heiner Kallweit --- target/linux/generic/files/drivers/net/phy/ar8216.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c index 028b98f..effa33c 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8216.c +++ b/target/linux/generic/files/drivers/net/phy/ar8216.c @@ -86,6 +86,7 @@ struct ar8xxx_chip { const struct ar8xxx_mib_desc *mib_decs; unsigned num_mibs; + unsigned mib_func; }; enum ar8327_led_pattern { @@ -532,16 +533,11 @@ ar8xxx_reg_wait(struct ar8xxx_priv *priv, u32 reg, u32 mask, u32 val, static int ar8xxx_mib_op(struct ar8xxx_priv *priv, u32 op) { - unsigned mib_func; + unsigned mib_func = priv->chip->mib_func; int ret; lockdep_assert_held(&priv->mib_lock); - if (chip_is_ar8327(priv) || chip_is_ar8337(priv)) - mib_func = AR8327_REG_MIB_FUNC; - else - mib_func = AR8216_REG_MIB_FUNC; - /* Capture the hardware statistics for all ports */ ar8xxx_rmw(priv, mib_func, AR8216_MIB_FUNC, (op << AR8216_MIB_FUNC_S)); @@ -898,6 +894,7 @@ static const struct ar8xxx_chip ar8216_chip = { .num_mibs = ARRAY_SIZE(ar8216_mibs), .mib_decs = ar8216_mibs, + .mib_func = AR8216_REG_MIB_FUNC }; static void @@ -964,6 +961,7 @@ static const struct ar8xxx_chip ar8236_chip = { .num_mibs = ARRAY_SIZE(ar8236_mibs), .mib_decs = ar8236_mibs, + .mib_func = AR8216_REG_MIB_FUNC }; static int @@ -1047,6 +1045,7 @@ static const struct ar8xxx_chip ar8316_chip = { .num_mibs = ARRAY_SIZE(ar8236_mibs), .mib_decs = ar8236_mibs, + .mib_func = AR8216_REG_MIB_FUNC }; static u32 @@ -1836,6 +1835,7 @@ static const struct ar8xxx_chip ar8327_chip = { .num_mibs = ARRAY_SIZE(ar8236_mibs), .mib_decs = ar8236_mibs, + .mib_func = AR8327_REG_MIB_FUNC }; static int -- 2.1.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 6/6] ar8216: factor out reg_port_stats_base parameters to ar8xxx_chip
Factor out reg_port_stats_base parameters to ar8xxx_chip. Remove related chip_is_... checks. Signed-off-by: Heiner Kallweit --- .../linux/generic/files/drivers/net/phy/ar8216.c | 27 -- .../linux/generic/files/drivers/net/phy/ar8216.h | 6 - 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c index 961803c..558b9f7 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8216.c +++ b/target/linux/generic/files/drivers/net/phy/ar8216.c @@ -76,6 +76,10 @@ struct ar8xxx_chip { bool config_at_probe; bool mii_lo_first; + /* parameters to calculate REG_PORT_STATS_BASE */ + unsigned reg_port_stats_start; + unsigned reg_port_stats_length; + int (*hw_init)(struct ar8xxx_priv *priv); void (*cleanup)(struct ar8xxx_priv *priv); @@ -577,13 +581,8 @@ ar8xxx_mib_fetch_port_stat(struct ar8xxx_priv *priv, int port, bool flush) lockdep_assert_held(&priv->mib_lock); - if (chip_is_ar8327(priv) || chip_is_ar8337(priv)) - base = AR8327_REG_PORT_STATS_BASE(port); - else if (chip_is_ar8236(priv) || -chip_is_ar8316(priv)) - base = AR8236_REG_PORT_STATS_BASE(port); - else - base = AR8216_REG_PORT_STATS_BASE(port); + base = priv->chip->reg_port_stats_start + + priv->chip->reg_port_stats_length * port; mib_stats = &priv->mib_stats[port * priv->chip->num_mibs]; for (i = 0; i < priv->chip->num_mibs; i++) { @@ -885,6 +884,9 @@ ar8216_init_port(struct ar8xxx_priv *priv, int port) static const struct ar8xxx_chip ar8216_chip = { .caps = AR8XXX_CAP_MIB_COUNTERS, + .reg_port_stats_start = 0x19000, + .reg_port_stats_length = 0xa0, + .hw_init = ar8216_hw_init, .init_globals = ar8216_init_globals, .init_port = ar8216_init_port, @@ -953,6 +955,10 @@ ar8236_init_globals(struct ar8xxx_priv *priv) static const struct ar8xxx_chip ar8236_chip = { .caps = AR8XXX_CAP_MIB_COUNTERS, + + .reg_port_stats_start = 0x2, + .reg_port_stats_length = 0x100, + .hw_init = ar8216_hw_init, .init_globals = ar8236_init_globals, .init_port = ar8216_init_port, @@ -1038,6 +1044,10 @@ ar8316_init_globals(struct ar8xxx_priv *priv) static const struct ar8xxx_chip ar8316_chip = { .caps = AR8XXX_CAP_GIGE | AR8XXX_CAP_MIB_COUNTERS, + + .reg_port_stats_start = 0x2, + .reg_port_stats_length = 0x100, + .hw_init = ar8316_hw_init, .init_globals = ar8316_init_globals, .init_port = ar8216_init_port, @@ -1831,6 +1841,9 @@ static const struct ar8xxx_chip ar8327_chip = { .config_at_probe = true, .mii_lo_first = true, + .reg_port_stats_start = 0x1000, + .reg_port_stats_length = 0x100, + .hw_init = ar8327_hw_init, .cleanup = ar8327_cleanup, .init_globals = ar8327_init_globals, diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.h b/target/linux/generic/files/drivers/net/phy/ar8216.h index ca6b2f2..f6df7c8 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8216.h +++ b/target/linux/generic/files/drivers/net/phy/ar8216.h @@ -164,8 +164,6 @@ #define AR8216_REG_PORT_RATE(_i) (AR8216_PORT_OFFSET(_i) + 0x000c) #define AR8216_REG_PORT_PRIO(_i) (AR8216_PORT_OFFSET(_i) + 0x0010) -#define AR8216_REG_PORT_STATS_BASE(_i) (0x19000 + (_i) * 0xa0) - #define AR8216_STATS_RXBROAD 0x00 #define AR8216_STATS_RXPAUSE 0x04 #define AR8216_STATS_RXMULTI 0x08 @@ -217,8 +215,6 @@ #define AR8236_PORT_VLAN2_VLAN_MODE BITS(30, 2) #define AR8236_PORT_VLAN2_VLAN_MODE_S30 -#define AR8236_REG_PORT_STATS_BASE(_i) (0x2 + (_i) * 0x100) - #define AR8236_STATS_RXBROAD 0x00 #define AR8236_STATS_RXPAUSE 0x04 #define AR8236_STATS_RXMULTI 0x08 @@ -455,8 +451,6 @@ #define AR8327_REG_PORT_HOL_CTRL1(_i) (0x974 + (_i) * 0x8) #define AR8327_PORT_HOL_CTRL1_EG_MIRROR_EN BIT(16) -#define AR8327_REG_PORT_STATS_BASE(_i) (0x1000 + (_i) * 0x100) - #define AR8337_PAD_MAC06_EXCHANGE_EN BIT(31) /* port speed */ -- 2.1.3 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Oopses on ZyXEL NBG6716 (atheros)
Hi! The patch in the ticket solves the problem, but there seems to be another with IPv6 NAT. I found a way to get around the IPv6 NAT, so this is not urgent to me anymore, in the hope, that this error has also something to do with IPv6 NAT ;-) Perhaps there is a better place to report this. If you have an idea? Nevertheless, here is the laster iteration: [ 1842.82] CPU: 0 PID: 0 Comm: swapper Not tainted 3.14.18 #1 [ 1842.82] task: 803b6508 ti: 803a4000 task.ti: 803a4000 [ 1842.82] $ 0 : 6000 8e2a0f88 [ 1842.82] $ 4 : 8dc7e054 8dd91000 8dc7e000 0300 [ 1842.82] $ 8 : 0001 00076fcd 0093 [ 1842.82] $12 : 00059fa4 [ 1842.82] $16 : 8dd91000 8e2a0ac0 8dd91180 8e2a0f88 [ 1842.82] $20 : 8f257460 8041d0ec 803c1d00 [ 1842.82] $24 : 8f2866c0 [ 1842.82] $28 : 803a4000 803a5ba0 2000 8f2ab090 [ 1842.82] Hi: 0228 [ 1842.82] Lo: 0002 [ 1842.82] epc : 8f280040 ipv6_opt_accepted+0x40/0xb0 [ipv6] [ 1842.82] Not tainted [ 1842.82] ra: 8f2ab090 ipv6_frag_exit+0x1bcc/0x30c8 [ipv6] [ 1842.82] Status: 1100fc03 KERNEL EXL IE [ 1842.82] Cause : 0088 [ 1842.82] BadVA : 6000 [ 1842.82] PrId : 00019750 (MIPS 74Kc) [ 1842.82] Modules linked in: ath10k_pci ifb gpio_button_hotplug qcserial option iptable_nat ip6table_nat cdc_mbim ath9k usb_wwan sierra_net sierra rndis_host qmi_wwan pppoe pl2303 nf_nat_pptp nf_nat_ipv6 nf_nat_ipv4 nf_nat_amanda nf_conntrack_pptp nf_conntrack_ipv6 nf_conntrack_ipv4 nf_conntrack_amanda l2tp_ppp huawei_cdc_ncm ftdi_sio cdc_subset cdc_ncm cdc_ether cdc_eem ath9k_common xt_time xt_tcpudp xt_tcpmss xt_string xt_statistic xt_state xt_socket xt_recent xt_quota xt_policy xt_pkttype xt_owner xt_nat xt_multiport xt_mark xt_mac xt_limit xt_length xt_iprange xt_id xt_hl xt_helper xt_hashlimit xt_esp xt_ecn xt_dscp xt_conntrack xt_connmark xt_connlimit xt_connbytes xt_comment xt_addrtype xt_TPROXY xt_TCPMSS xt_REDIRECT xt_NETMAP xt_LOG xt_HL xt_DSCP xt_CT xt_CLASSIFY usbserial usbnet usblp ts_kmp ts_fsm ts_bm pppox ppp_synctty ppp_mppe ppp_async nfnetlink_log nf_nat_tftp nf_nat_snmp_basic nf_nat_sip nf_nat_proto_gre nf_nat_irc nf_nat_h323 nf_nat_ftp nf_defrag_ipv6 nf_defrag_ipv4 nf_conntrack_tftp nf_conntrack_snmp nf_conntrack_sip nf_conntrack_proto_gre nf_conntrack_netlink nf_conntrack_irc nf_conntrack_h323 nf_conntrack_ftp nf_conntrack_broadcast iptable_raw iptable_mangle iptable_filter ipt_ah ipt_ULOG ipt_REJECT ipt_MASQUERADE ipt_ECN ip_tables gspca_sonixj gspca_sonixb gspca_main crc_ccitt cdc_wdm cdc_acm ath9k_hw arptable_filter arpt_mangle arp_tables fuse sch_teql sch_tbf sch_sfq sch_red sch_prio sch_netem sch_htb sch_gred sch_dsmark sch_codel em_text em_nbyte em_meta em_cmp cls_basic act_police act_ipt act_connmark act_skbedit act_mirred em_u32 cls_u32 cls_tcindex cls_flow cls_route cls_fw sch_hfsc sch_ingress v4l2_common videodev evdev ath10k_core ath mac80211 cfg80211 compat siit ledtrig_usbdev xt_LED ledtrig_morse ledtrig_heartbeat ledtrig_gpio xt_set ip_set_list_set ip_set_hash_netport ip_set_hash_netiface ip_set_hash_net ip_set_hash_ipportnet ip_set_hash_ipportip ip_set_hash_ipport ip_set_hash_ip ip_set_bitmap_port ip_set_bitmap_ipmac ip_set_bitmap_ip ip_set nfnetlink ip6t_NPT ip6t_MASQUERADE nf_nat nf_conntrack ip6t_REJECT ip6table_raw ip6table_mangle ip6table_filter ip6_tables x_tables pppoatm ppp_generic slhc msdos ip6_gre ip_gre gre dummy l2tp_ip l2tp_eth ip_vti sit l2tp_netlink l2tp_core ipcomp6 xfrm6_tunnel xfrm6_mode_tunnel xfrm6_mode_transport xfrm6_mode_beet esp6 ah6 ipcomp xfrm4_tunnel xfrm4_mode_tunnel xfrm4_mode_transport xfrm4_mode_beet esp4 ah4 ipip ip6_tunnel tunnel6 tunnel4 ip_tunnel veth tun af_key xfrm_user xfrm_ipcomp xfrm_algo vfat fat udf crc_itu_t ntfs isofs br2684 atm fscache ipv6 chainiv eseqiv crypto_wq algif_skcipher algif_hash af_alg sha256_generic sha1_generic krng rng md5 hmac ecb des_generic cbc authenc aead arc4 crypto_blkcipher usb_storage input_polldev ohci_platform ohci_hcd ledtrig_transient ehci_pci ehci_platform ehci_hcd sd_mod scsi_mod ext4 jbd2 mbcache button_hotplug input_core usbcore nls_base usb_common mii crypto_hash [last unloaded: ath10k_pci] [ 1842.82] Process swapper (pid: 0, threadinfo=803a4000, task=803b6508, tls=) [ 1842.82] Stack : 803a5c28 803a5c28 803a7a4c 8dd91180 803a5bb8 803a5c28 801109b0 80110640 8dd91180 8e2a0ac0 8dc7e07c 8dd91180 8e2a0ac0 803b4f90 8dc7e054 0006 8f2ab524 8f292200 8dd91180 8dd91180 0001 000a 8e10b000 801f4dec 9393 8000 9393 0035 803a5c28 8dd91180 8e328600 803b4f90 8f2b9570 0006 0006 fffe 3000 ... [ 1842.82] Call Trace: [ 1842.82] [<8f280040>] ipv6_opt_accepted+0x40/0xb0 [ipv6] [ 1842.82] [<8f2ab090>] ipv6_frag_exit+0x1bcc/0x30c8
Re: [OpenWrt-Devel] ar8216: phy_init and bug report 18415
On Nov 28, 2014 5:23 AM, "Heiner Kallweit" wrote: > Anybody with a 8216-based device who can test this? Me me me, me me. 4300 currently running trunk with 43332 reverted. I am at your service. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH v3 1/4] kernel.mk: Refactor LINUX_KARCH affectation
On Fri, Nov 28, 2014 at 7:20 PM, Maxime Ripard wrote: > Switch to a dumber implementation that will be easier to maintain in the long > run, with only if statements instead of having nested subst calls. > > Signed-off-by: Maxime Ripard > --- > include/kernel.mk | 25 + > 1 file changed, 21 insertions(+), 4 deletions(-) > > diff --git a/include/kernel.mk b/include/kernel.mk > index 01fb4dbd8107..97eb1f74f4f7 100644 > --- a/include/kernel.mk > +++ b/include/kernel.mk > @@ -64,13 +64,30 @@ endif > > ifneq (,$(findstring uml,$(BOARD))) >LINUX_KARCH=um > +else ifeq ($(ARCH),aarch64) > + LINUX_KARCH := arm64 > +else ifeq ($(ARCH),aarch64_be) > + LINUX_KARCH := arm64 > +else ifeq ($(ARCH),armeb) > + LINUX_KARCH := arm > +else ifeq ($(ARCH),mipsel) > + LINUX_KARCH := mips > +else ifeq ($(ARCH),mips64) > + LINUX_KARCH := mips > +else ifeq ($(ARCH),mips64el) > + LINUX_KARCH := mips > +else ifeq ($(ARCH),sh2) > + LINUX_KARCH := sh > +else ifeq ($(ARCH),sh3) > + LINUX_KARCH := sh > +else ifeq ($(ARCH),sh4) > + LINUX_KARCH := sh > +else ifeq ($(ARCH),i386) > + LINUX_KARCH := x86 > +else ifeq ($(ARCH),aarch64_be) > + LINUX_KARCH := arm64 > +else ifeq ($(ARCH),armeb) > + LINUX_KARCH := arm > +else ifeq ($(ARCH),mipsel) > + LINUX_KARCH := mips > +else ifeq ($(ARCH),mips64) > + LINUX_KARCH := mips > +else ifeq ($(ARCH),mips64el) > + LINUX_KARCH := mips > +else ifeq ($(ARCH),sh2) > + LINUX_KARCH := sh > +else ifeq ($(ARCH),sh3) > + LINUX_KARCH := sh > +else ifeq ($(ARCH),sh4) > + LINUX_KARCH := sh > +else ifeq ($(ARCH),i386) > + LINUX_KARCH := x86 > else > - ifeq (,$(LINUX_KARCH)) > -LINUX_KARCH=$(strip $(subst i386,x86,$(subst armeb,arm,$(subst > mipsel,mips,$(subst mips64,mips,$(subst mips64el,mips,$(subst sh2,sh,$(subst > sh3,sh,$(subst sh4,sh,$(subst aarch64,arm64,$(subst > aarch64_be,arm64,$(ARCH > - endif > + LINUX_KARCH := $(ARCH) > endif How about something in the middle, like ifneq (,$(findstring uml,$(BOARD))) LINUX_KARCH := um else ifneq (,$(findstring $(ARCH),aarch64 aarch64_be)) LINUX_KARCH := arm64 else ifneq (,$(findstring $(ARCH),armeb)) LINUX_KARCH := arm else ifneq (,$(findstring $(ARCH),mipsel mips64 mips64el)) LINUX_KARCH := mips else ifneq (,$(findstring $(ARCH),sh2 sh3 sh4)) LINUX_KARCH := sh else ifneq (,$(findstring $(ARCH),i386)) LINUX_KARCH := x86 else LINUX_KARCH := $(ARCH) endif merging the common cases. this is a bit more compact, and should be easier to extend. (NOTE: completely untested, likely contains typos/thinkos). > > - Unrelated whitespace change. > define KernelPackage/Defaults >FILES:= >AUTOLOAD:= Jonas ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] OM2P firmware upgrade with LuCI
Hi! I just noted that there is an issue with the firmware upgrade via LuCI on the OM2P. The image validity check fails, because the following script in system.lua fails: local function image_supported() -- XXX: yay... return ( 0 == os.execute( ". /lib/functions.sh; " .. "include /lib/upgrade; " .. "platform_check_image %q >/dev/null" % image_tmp ) ) end Calling "platform_check_image" directly fails due to the way target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh is written ("break"), but I believe the better way would be to use "sysupgrade -T" anyhow - it works if I change the code like this: local function image_supported() return ( 0 == os.execute( "sysupgrade -T %q >/dev/null" % image_tmp ) ) end Any chance to get this into LuCI or should /lib/upgrade/openmesh.sh be rewritten to be compatible with the ("yay") LuCI way? bruno ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH] Improve 802.1x dynamic vlan support with bridge names
From: Ben Franske In r41872 and r42787 Dynamic VLAN support was reintroduced, but the vlan_bridge parameter is not read while setting up the config, so the default is used which is undesirable for some uses. This patch should be a corrected version of http://patchwork.openwrt.org/patch/6344/ Signed-off-by: Ben Franske --- package/network/services/hostapd/files/netifd.sh |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/package/network/services/hostapd/files/netifd.sh b/package/network/services/hostapd/files/netifd.sh index b1036be..78c8aa7 100644 --- a/package/network/services/hostapd/files/netifd.sh +++ b/package/network/services/hostapd/files/netifd.sh @@ -130,7 +130,7 @@ hostapd_common_add_bss_config() { config_add_string eap_type ca_cert client_cert identity auth priv_key priv_key_pwd config_add_int dynamic_vlan vlan_naming - config_add_string vlan_tagged_interface + config_add_string vlan_tagged_interface vlan_bridge config_add_string 'key1:wepkey' 'key2:wepkey' 'key3:wepkey' 'key4:wepkey' 'password:wpakey' @@ -226,7 +226,8 @@ hostapd_set_bss_options() { dae_client dae_secret dae_port \ nasid ownip \ eap_reauth_period dynamic_vlan \ - vlan_naming vlan_tagged_interface + vlan_naming vlan_tagged_interface \ + vlan_bridge # legacy compatibility [ -n "$auth_server" ] || json_get_var auth_server server @@ -266,6 +267,8 @@ hostapd_set_bss_options() { [ -n "$dynamic_vlan" ] && { append bss_conf "dynamic_vlan=$dynamic_vlan" "$N" append bss_conf "vlan_naming=$vlan_naming" "$N" + [ -n "$vlan_bridge" ] && \ + append bss_conf "vlan_bridge=$vlan_bridge" "$N" [ -n "$vlan_tagged_interface" ] && \ append bss_conf "vlan_tagged_interface=$vlan_tagged_interface" "$N" } -- 1.7.10.4 ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel